@sensiblestats/widget-react 0.136.1 → 0.137.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/dist/index.cjs CHANGED
@@ -1337,7 +1337,7 @@ function parseOddsFormat(value) {
1337
1337
  }
1338
1338
 
1339
1339
  // src/version.generated.ts
1340
- var WIDGET_REACT_VERSION = "0.136.1";
1340
+ var WIDGET_REACT_VERSION = "0.137.0";
1341
1341
 
1342
1342
  // src/config.ts
1343
1343
  function hostTag(cfg) {
@@ -7335,7 +7335,7 @@ function PersonalGreeting({ personal, ui, slip, sport, starsElsewhere = false, o
7335
7335
  const since = personal.since ?? [];
7336
7336
  const asks = personal.asks ?? [];
7337
7337
  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?.favouritesTab === true && noFavourites;
7338
+ const showInvite = ctx?.favouritesOffered === true && noFavourites;
7339
7339
  const cards = hasCards ? /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("section", { className: "ss-w-v8-sec ss-w-v8-cards", children: [
7340
7340
  ofYours ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("h3", { className: "ss-w-v8-sec-title", children: ui.v8YourTeams }) : null,
7341
7341
  teamCards.map((c, i) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
@@ -7819,7 +7819,9 @@ function ChatHeader({
7819
7819
  newConversationLabel,
7820
7820
  moreOptionsLabel,
7821
7821
  onOpenSettings,
7822
- settingsLabel
7822
+ settingsLabel,
7823
+ onOpenFavourites,
7824
+ favouritesLabel
7823
7825
  }) {
7824
7826
  const [menuOpen, setMenuOpen] = (0, import_react48.useState)(false);
7825
7827
  const wrapRef = (0, import_react48.useRef)(null);
@@ -7827,7 +7829,8 @@ function ChatHeader({
7827
7829
  const firstItemRef = (0, import_react48.useRef)(null);
7828
7830
  const hasNew = !!(canReset && onNewConversation);
7829
7831
  const hasSettings = !!onOpenSettings;
7830
- const hasMenu = hasNew || hasSettings;
7832
+ const hasFavourites = !!onOpenFavourites;
7833
+ const hasMenu = hasFavourites || hasNew || hasSettings;
7831
7834
  (0, import_react48.useEffect)(() => {
7832
7835
  if (menuOpen) firstItemRef.current?.focus();
7833
7836
  }, [menuOpen]);
@@ -7853,6 +7856,10 @@ function ChatHeader({
7853
7856
  setMenuOpen(false);
7854
7857
  onNewConversation?.();
7855
7858
  };
7859
+ const runFavourites = () => {
7860
+ setMenuOpen(false);
7861
+ onOpenFavourites?.();
7862
+ };
7856
7863
  const runSettings = () => {
7857
7864
  setMenuOpen(false);
7858
7865
  onOpenSettings?.();
@@ -7875,13 +7882,24 @@ function ChatHeader({
7875
7882
  }
7876
7883
  ),
7877
7884
  menuOpen ? /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "ss-w-menu", role: "menu", "aria-label": moreOptionsLabel, children: [
7878
- hasNew ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
7885
+ hasFavourites ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
7879
7886
  "button",
7880
7887
  {
7881
7888
  type: "button",
7882
7889
  className: "ss-w-menu-item",
7883
7890
  role: "menuitem",
7884
7891
  ref: firstItemRef,
7892
+ onClick: runFavourites,
7893
+ children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { children: favouritesLabel })
7894
+ }
7895
+ ) : null,
7896
+ hasNew ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
7897
+ "button",
7898
+ {
7899
+ type: "button",
7900
+ className: "ss-w-menu-item",
7901
+ role: "menuitem",
7902
+ ref: hasFavourites ? void 0 : firstItemRef,
7885
7903
  onClick: runNewConversation,
7886
7904
  children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { children: newConversationLabel })
7887
7905
  }
@@ -7892,7 +7910,7 @@ function ChatHeader({
7892
7910
  type: "button",
7893
7911
  className: "ss-w-menu-item",
7894
7912
  role: "menuitem",
7895
- ref: hasNew ? void 0 : firstItemRef,
7913
+ ref: hasFavourites || hasNew ? void 0 : firstItemRef,
7896
7914
  onClick: runSettings,
7897
7915
  children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { children: settingsLabel })
7898
7916
  }
@@ -10728,8 +10746,8 @@ var ChatInput = (0, import_react62.forwardRef)(function ChatInput2({ placeholder
10728
10746
  // src/components/TabBar.tsx
10729
10747
  var import_react63 = require("react");
10730
10748
  var import_jsx_runtime69 = require("react/jsx-runtime");
10731
- var FIT_STEPS = [[0, false], [1, false], [1, true], [2, true], [3, true], [4, true], [5, true], [6, true]];
10732
- function TabBar({ monitor, ui, matchCount, trendsCount, liveCount, hasSchedule, hasBuilder = false, gamesEnabled, clubEnabled, favouritesEnabled }) {
10749
+ var TIGHT_LEVELS = [0, 1, 2, 3, 4, 5, 6];
10750
+ function TabBar({ monitor, ui, matchCount, trendsCount, liveCount, hasSchedule, hasBuilder = false, gamesEnabled, clubEnabled }) {
10733
10751
  const tabs = [
10734
10752
  { tab: "chat", label: ui.tabChat, count: 0, dot: monitor.chatDot },
10735
10753
  ...clubEnabled ? [
@@ -10745,8 +10763,7 @@ function TabBar({ monitor, ui, matchCount, trendsCount, liveCount, hasSchedule,
10745
10763
  ...matchCount > 0 ? [{ tab: "following", label: ui.tabFollowing, count: matchCount, dot: monitor.matchesDot }] : [],
10746
10764
  ...trendsCount > 0 ? [{ tab: "trends", label: ui.tabTrends, count: trendsCount, dot: monitor.trendsDot }] : []
10747
10765
  ],
10748
- ...gamesEnabled ? [{ tab: "games", label: ui.tabGames, count: 0, dot: false }] : [],
10749
- ...favouritesEnabled && !clubEnabled ? [{ tab: "favourites", label: ui.tabFavourites, count: 0, dot: false }] : []
10766
+ ...gamesEnabled ? [{ tab: "games", label: ui.tabGames, count: 0, dot: false }] : []
10750
10767
  ];
10751
10768
  const track = useTrack();
10752
10769
  const listRef = (0, import_react63.useRef)(null);
@@ -10761,12 +10778,10 @@ function TabBar({ monitor, ui, matchCount, trendsCount, liveCount, hasSchedule,
10761
10778
  (0, import_react63.useLayoutEffect)(() => {
10762
10779
  const strip = listRef.current;
10763
10780
  if (!strip) return;
10764
- const fav = strip.querySelector("[data-fav-tab]");
10765
10781
  const measure = () => {
10766
- for (const [tight, compact] of FIT_STEPS) {
10782
+ for (const tight of TIGHT_LEVELS) {
10767
10783
  if (tight === 0) strip.removeAttribute("data-tight");
10768
10784
  else strip.setAttribute("data-tight", String(tight));
10769
- fav?.toggleAttribute("data-compact", compact);
10770
10785
  if (strip.scrollWidth <= strip.clientWidth) return;
10771
10786
  }
10772
10787
  };
@@ -10790,18 +10805,14 @@ function TabBar({ monitor, ui, matchCount, trendsCount, liveCount, hasSchedule,
10790
10805
  role: "tab",
10791
10806
  "aria-selected": active,
10792
10807
  "data-on": active ? "" : void 0,
10793
- "data-fav-tab": tab === "favourites" ? "" : void 0,
10794
- "aria-label": tab === "favourites" ? label : tab === "live" && count > 0 ? `${label} \xB7 ${ui.liveCountLabel(count)}` : void 0,
10808
+ "aria-label": tab === "live" && count > 0 ? `${label} \xB7 ${ui.liveCountLabel(count)}` : void 0,
10795
10809
  className: "ss-w-tab",
10796
10810
  onClick: () => {
10797
10811
  if (tab !== monitor.activeTab) track({ name: "tab_change", from: monitor.activeTab, to: tab });
10798
10812
  monitor.setActiveTab(tab);
10799
10813
  },
10800
10814
  children: [
10801
- tab === "favourites" ? /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_jsx_runtime69.Fragment, { children: [
10802
- /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { className: "ss-w-tab-label", children: label }),
10803
- /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { className: "ss-w-tab-star", "aria-hidden": "true", children: "\u2605" })
10804
- ] }) : label,
10815
+ label,
10805
10816
  count > 0 && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { className: "ss-w-tab-count", "aria-hidden": tab === "live" ? true : void 0, children: count }),
10806
10817
  dot && !active && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { className: "ss-w-tab-dot", "aria-hidden": "true" })
10807
10818
  ]
@@ -16946,7 +16957,7 @@ function FavouritesPanel({ controller, ui, sport, sports, onSportChange }) {
16946
16957
  }, [sport]);
16947
16958
  const sportLabel2 = sports.find((s) => s.sport === sport)?.label ?? sportLabel(ui, sport);
16948
16959
  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-mon-list ss-w-fav", children: [
16960
+ return /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)("div", { className: "ss-w-fav", children: [
16950
16961
  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
16962
  "button",
16952
16963
  {
@@ -16966,9 +16977,104 @@ function FavouritesPanel({ controller, ui, sport, sports, onSportChange }) {
16966
16977
  ] });
16967
16978
  }
16968
16979
 
16969
- // src/components/dashboard/v8/SentenceBuilder.tsx
16980
+ // src/components/PresetTools.tsx
16970
16981
  var import_react100 = require("react");
16971
16982
  var import_jsx_runtime138 = require("react/jsx-runtime");
16983
+ function PresetToolModal({ title, closeLabel, onClose, children, footer, className }) {
16984
+ const { dialogRef, onKeyDown } = useModalDialog(onClose, { restoreFocus: false });
16985
+ const titleId = (0, import_react100.useId)();
16986
+ 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: [
16987
+ /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)("div", { className: "ss-w-tool-head", children: [
16988
+ /* @__PURE__ */ (0, import_jsx_runtime138.jsx)("h2", { id: titleId, className: "ss-w-tool-title", children: title }),
16989
+ /* @__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, {}) })
16990
+ ] }),
16991
+ /* @__PURE__ */ (0, import_jsx_runtime138.jsx)("div", { className: "ss-w-tool-body", children }),
16992
+ footer ? /* @__PURE__ */ (0, import_jsx_runtime138.jsx)("div", { className: "ss-w-tool-foot", children: footer }) : null
16993
+ ] }) });
16994
+ }
16995
+ function SendButton({ label, display, disabled, onClick }) {
16996
+ return /* @__PURE__ */ (0, import_jsx_runtime138.jsx)("button", { type: "button", className: "ss-w-tool-send", "aria-label": `${label}: ${display}`, disabled, onClick, children: label });
16997
+ }
16998
+ function PickList({ picks, formatKickoff }) {
16999
+ const { oddsFormat } = useOddsSettings();
17000
+ 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: [
17001
+ /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)("span", { className: "ss-w-tool-pick-match", children: [
17002
+ p.homeTeamName,
17003
+ " \u2013 ",
17004
+ p.awayTeamName
17005
+ ] }),
17006
+ /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)("span", { className: "ss-w-tool-pick-sel", children: [
17007
+ p.marketLabel,
17008
+ ": ",
17009
+ p.selectionLabel,
17010
+ p.line ? ` ${p.line}` : ""
17011
+ ] }),
17012
+ /* @__PURE__ */ (0, import_jsx_runtime138.jsx)("span", { className: "ss-w-tool-pick-kick", children: formatKickoff(p.kickoffUtc) }),
17013
+ /* @__PURE__ */ (0, import_jsx_runtime138.jsx)("span", { className: "ss-w-tool-pick-price", children: formatOdds(p.priceFormats, oddsFormat) })
17014
+ ] }, p.matchOddsId)) });
17015
+ }
17016
+ function ComboPreview({ cell: cell2, formatKickoff }) {
17017
+ const { oddsFormat } = useOddsSettings();
17018
+ return /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)(import_jsx_runtime138.Fragment, { children: [
17019
+ /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(PickList, { picks: cell2.combo.legs, formatKickoff }),
17020
+ /* @__PURE__ */ (0, import_jsx_runtime138.jsx)("div", { className: "ss-w-tool-math", children: oddsFormat === "decimal" ? cell2.combo.multiplication : formatOdds(cell2.combo.totalFormats, oddsFormat) })
17021
+ ] });
17022
+ }
17023
+ function Unavailable({ text: text2 }) {
17024
+ return /* @__PURE__ */ (0, import_jsx_runtime138.jsx)("p", { className: "ss-w-tool-unavailable", children: text2 });
17025
+ }
17026
+ var textOf = (options, value, format2) => {
17027
+ const o = options.find((x) => samePrice(x.value, value));
17028
+ return o ? formatOdds(o.formats, format2) : "";
17029
+ };
17030
+ function BuildComboTool({ grid, strings, streaming, formatKickoff, initialTotal, initialLegs, onSend, onClose }) {
17031
+ const { oddsFormat } = useOddsSettings();
17032
+ const totalOptions = comboTotals(grid);
17033
+ const totals = totalOptions.map((o) => o.value);
17034
+ const legChoices = comboLegChoices(grid);
17035
+ const [total, setTotal] = (0, import_react100.useState)(() => nearest(totals, initialTotal));
17036
+ const [legs, setLegs] = (0, import_react100.useState)(() => legsForTotal(grid, nearest(totals, initialTotal), clampLegs(legChoices, initialLegs)));
17037
+ const [announcement, setAnnouncement] = (0, import_react100.useState)("");
17038
+ const cell2 = findCombo(grid, total, legs);
17039
+ const minLegs = legChoices[0] ?? legs;
17040
+ const maxLegs = legChoices[legChoices.length - 1] ?? legs;
17041
+ const display = strings.comboDisplay(legs, textOf(totalOptions, total, oddsFormat));
17042
+ const choose = (nextTotal, nextLegs) => {
17043
+ setTotal(nextTotal);
17044
+ setLegs(nextLegs);
17045
+ const d = strings.comboDisplay(nextLegs, textOf(totalOptions, nextTotal, oddsFormat));
17046
+ setAnnouncement(findCombo(grid, nextTotal, nextLegs) ? d : `${d}. ${strings.unavailable}`);
17047
+ };
17048
+ const footer = /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(SendButton, { label: strings.send, display, disabled: !cell2 || streaming, onClick: () => {
17049
+ if (cell2) onSend(comboAsk(cell2, strings, oddsFormat));
17050
+ } });
17051
+ return /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)(PresetToolModal, { title: strings.buildCombo, closeLabel: strings.close, onClose, footer, children: [
17052
+ /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)("div", { className: "ss-w-tool-section", role: "group", "aria-label": strings.totalLabel, children: [
17053
+ /* @__PURE__ */ (0, import_jsx_runtime138.jsx)("span", { className: "ss-w-tool-label", "aria-hidden": "true", children: strings.totalLabel }),
17054
+ /* @__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)) })
17055
+ ] }),
17056
+ /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)("div", { className: "ss-w-tool-section", role: "group", "aria-label": strings.matchesLabel, children: [
17057
+ /* @__PURE__ */ (0, import_jsx_runtime138.jsx)("span", { className: "ss-w-tool-label", "aria-hidden": "true", children: strings.matchesLabel }),
17058
+ /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)("div", { className: "ss-w-tool-stepper", children: [
17059
+ /* @__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" }),
17060
+ /* @__PURE__ */ (0, import_jsx_runtime138.jsx)("span", { className: "ss-w-tool-count", children: legs }),
17061
+ /* @__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: "+" })
17062
+ ] })
17063
+ ] }),
17064
+ cell2 ? /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(ComboPreview, { cell: cell2, formatKickoff }) : /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(Unavailable, { text: strings.unavailable }),
17065
+ /* @__PURE__ */ (0, import_jsx_runtime138.jsx)("p", { className: "ss-w-vh", "aria-live": "polite", children: announcement })
17066
+ ] });
17067
+ }
17068
+
17069
+ // src/components/FavouritesSheet.tsx
17070
+ var import_jsx_runtime139 = require("react/jsx-runtime");
17071
+ function FavouritesSheet({ ui, controller, sport, sports, onSportChange, onClose }) {
17072
+ 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 }) });
17073
+ }
17074
+
17075
+ // src/components/dashboard/v8/SentenceBuilder.tsx
17076
+ var import_react101 = require("react");
17077
+ var import_jsx_runtime140 = require("react/jsx-runtime");
16972
17078
  var TOTALS = ["any", "3", "5", "10", "20", "50"];
16973
17079
  var BASE_LEGS = [1, 2, 3, 4];
16974
17080
  var isTotal = (v) => TOTALS.includes(v);
@@ -16993,8 +17099,8 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, slip, spor
16993
17099
  const opening = openingGames(preset);
16994
17100
  const gamesOptions = opening.options;
16995
17101
  const marketOptions = usableMarkets(preset);
16996
- const [fingerprint] = (0, import_react100.useState)(() => JSON.stringify(preset));
16997
- const [saved] = (0, import_react100.useState)(() => {
17102
+ const [fingerprint] = (0, import_react101.useState)(() => JSON.stringify(preset));
17103
+ const [saved] = (0, import_react101.useState)(() => {
16998
17104
  const kept = memory3?.savedView(sport);
16999
17105
  return kept && kept.fingerprint === fingerprint ? kept : null;
17000
17106
  });
@@ -17008,9 +17114,9 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, slip, spor
17008
17114
  // The server never widens by itself: an all-games preset with no ids asks for it.
17009
17115
  widen: opening.option ? opening.option.matchIds.length === 0 : preset.gamesScope === "all" && preset.matchIds.length === 0
17010
17116
  };
17011
- const [view, setView] = (0, import_react100.useState)(() => saved?.view ?? openingView);
17012
- const autoWidened = (0, import_react100.useRef)(false);
17013
- const [widenedNote, setWidenedNote] = (0, import_react100.useState)(saved?.widenedNote ?? false);
17117
+ const [view, setView] = (0, import_react101.useState)(() => saved?.view ?? openingView);
17118
+ const autoWidened = (0, import_react101.useRef)(false);
17119
+ const [widenedNote, setWidenedNote] = (0, import_react101.useState)(saved?.widenedNote ?? false);
17014
17120
  const requestFor = (v) => ({
17015
17121
  sport,
17016
17122
  ...v.marketKey !== null ? { marketKey: v.marketKey } : {},
@@ -17022,10 +17128,10 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, slip, spor
17022
17128
  ...operatorUserId ? { operatorUserId } : {},
17023
17129
  ...anonymousUserId ? { anonymousUserId } : {}
17024
17130
  });
17025
- const [first] = (0, import_react100.useState)(() => requestFor(view));
17131
+ const [first] = (0, import_react101.useState)(() => requestFor(view));
17026
17132
  const { grid, status: status2, confirmed, request } = useBuilderGrid({ conversation, locale: ui.hostTag, memory: memory3, initial: first });
17027
- const lastRequest = (0, import_react100.useRef)(first);
17028
- (0, import_react100.useEffect)(() => {
17133
+ const lastRequest = (0, import_react101.useRef)(first);
17134
+ (0, import_react101.useEffect)(() => {
17029
17135
  void request(lastRequest.current);
17030
17136
  }, [request]);
17031
17137
  const send = (req) => {
@@ -17058,14 +17164,14 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, slip, spor
17058
17164
  const rows = ready && grid.status === "ok" ? legsOf(grid, sport) : null;
17059
17165
  const rowSlip = rows ? guardLegsPreMatch(slip, rows, ui) : slip;
17060
17166
  useNextKickoffRender(rows ? rows.map((l) => l.kickoffUtc) : []);
17061
- const [startedNote, setStartedNote] = (0, import_react100.useState)(false);
17167
+ const [startedNote, setStartedNote] = (0, import_react101.useState)(false);
17062
17168
  const anyStarted = rows !== null && rows.some((l) => !preMatchOpen(l.kickoffUtc, Date.now()));
17063
- (0, import_react100.useEffect)(() => {
17169
+ (0, import_react101.useEffect)(() => {
17064
17170
  if (startedNote && status2 === "ready" && !anyStarted) setStartedNote(false);
17065
17171
  }, [startedNote, status2, anyStarted]);
17066
17172
  const market = rows?.[0]?.market;
17067
- const [seen2, setSeen] = (0, import_react100.useState)(null);
17068
- (0, import_react100.useEffect)(() => {
17173
+ const [seen2, setSeen] = (0, import_react101.useState)(null);
17174
+ (0, import_react101.useEffect)(() => {
17069
17175
  if (market) setSeen(market);
17070
17176
  }, [market]);
17071
17177
  const marketName = view.marketKey === null ? null : marketOptions?.find((m) => m.key === view.marketKey)?.label ?? market ?? seen2;
@@ -17078,14 +17184,14 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, slip, spor
17078
17184
  const quotedAt = rows ? oldestQuote(rows) : null;
17079
17185
  const combo = ready && grid.total !== null ? { sport, totalChosen: view.total, totalActual: grid.total } : void 0;
17080
17186
  const canWiden = gamesOptions === null || allGames !== null;
17081
- (0, import_react100.useEffect)(() => {
17187
+ (0, import_react101.useEffect)(() => {
17082
17188
  if (!empty2 || !singles || widened || !canWiden || autoWidened.current) return;
17083
17189
  autoWidened.current = true;
17084
17190
  const next = { ...view, widen: true, matchIds: [], gamesId: allGames ? allGames.id : view.gamesId };
17085
17191
  commit(next, true);
17086
17192
  send(requestFor(next));
17087
17193
  }, [empty2, singles, widened, canWiden, view]);
17088
- (0, import_react100.useEffect)(() => {
17194
+ (0, import_react101.useEffect)(() => {
17089
17195
  if (coolOff) onCoolOff?.(sport);
17090
17196
  }, [coolOff, onCoolOff, sport]);
17091
17197
  if (coolOff) return null;
@@ -17094,13 +17200,13 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, slip, spor
17094
17200
  const nextWhen = nextAtMs !== null && nextAtMs > Date.now() ? kickoffText(ui, preset.nextGamesAtUtc) : null;
17095
17201
  const phrase = preset.nextGamesAtUtc == null ? nextGames : null;
17096
17202
  const mineGames = gamesOptions?.find((o) => o.id === view.gamesId)?.mine === true;
17097
- return /* @__PURE__ */ (0, import_jsx_runtime138.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_runtime138.jsx)("p", { className: "ss-w-v8-builder-note", "data-kind": "paused", children: nextWhen ? ui.v8PausedNext(nextWhen) : /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)(import_jsx_runtime138.Fragment, { children: [
17203
+ 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
17204
  ui.v8Paused,
17099
- phrase ? /* @__PURE__ */ (0, import_jsx_runtime138.jsx)("span", { className: "ss-w-v8-builder-next", "data-testid": "v8-next-games", children: phrase }) : null
17100
- ] }) }) : conversation ? /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)(import_jsx_runtime138.Fragment, { children: [
17101
- marketOptions ? /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)("div", { className: "ss-w-v8-builder-ln", children: [
17102
- /* @__PURE__ */ (0, import_jsx_runtime138.jsx)("span", { className: "ss-w-v8-builder-w", children: ui.v8BuilderShow }),
17103
- /* @__PURE__ */ (0, import_jsx_runtime138.jsx)("div", { className: "ss-w-v8-slot", "data-mine": marketOptions.find((m) => m.key === view.marketKey)?.usual || void 0, children: /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)(
17205
+ phrase ? /* @__PURE__ */ (0, import_jsx_runtime140.jsx)("span", { className: "ss-w-v8-builder-next", "data-testid": "v8-next-games", children: phrase }) : null
17206
+ ] }) }) : conversation ? /* @__PURE__ */ (0, import_jsx_runtime140.jsxs)(import_jsx_runtime140.Fragment, { children: [
17207
+ marketOptions ? /* @__PURE__ */ (0, import_jsx_runtime140.jsxs)("div", { className: "ss-w-v8-builder-ln", children: [
17208
+ /* @__PURE__ */ (0, import_jsx_runtime140.jsx)("span", { className: "ss-w-v8-builder-w", children: ui.v8BuilderShow }),
17209
+ /* @__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
17210
  "select",
17105
17211
  {
17106
17212
  className: "ss-w-v8-select",
@@ -17111,18 +17217,18 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, slip, spor
17111
17217
  if (picked !== view.marketKey) ask({ ...view, marketKey: picked });
17112
17218
  },
17113
17219
  children: [
17114
- /* @__PURE__ */ (0, import_jsx_runtime138.jsx)("option", { value: ALL_MARKETS, children: ui.v8AllMarkets }),
17115
- marketOptions.map((m) => /* @__PURE__ */ (0, import_jsx_runtime138.jsx)("option", { value: m.key, children: m.usual ? `${ui.v8UsualPrefix}${m.label}` : m.label }, m.key))
17220
+ /* @__PURE__ */ (0, import_jsx_runtime140.jsx)("option", { value: ALL_MARKETS, children: ui.v8AllMarkets }),
17221
+ 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
17222
  ]
17117
17223
  }
17118
17224
  ) })
17119
- ] }) : marketName ? /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)("div", { className: "ss-w-v8-builder-ln", children: [
17120
- /* @__PURE__ */ (0, import_jsx_runtime138.jsx)("span", { className: "ss-w-v8-builder-w", children: ui.v8BuilderShow }),
17121
- /* @__PURE__ */ (0, import_jsx_runtime138.jsx)("span", { className: "ss-w-v8-builder-market", children: marketName })
17225
+ ] }) : marketName ? /* @__PURE__ */ (0, import_jsx_runtime140.jsxs)("div", { className: "ss-w-v8-builder-ln", children: [
17226
+ /* @__PURE__ */ (0, import_jsx_runtime140.jsx)("span", { className: "ss-w-v8-builder-w", children: ui.v8BuilderShow }),
17227
+ /* @__PURE__ */ (0, import_jsx_runtime140.jsx)("span", { className: "ss-w-v8-builder-market", children: marketName })
17122
17228
  ] }) : null,
17123
- /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)("div", { className: "ss-w-v8-builder-ln", children: [
17124
- /* @__PURE__ */ (0, import_jsx_runtime138.jsx)("span", { className: "ss-w-v8-builder-w", children: ui.v8BuilderIn }),
17125
- gamesOptions ? /* @__PURE__ */ (0, import_jsx_runtime138.jsx)("div", { className: "ss-w-v8-slot", "data-mine": mineGames || void 0, children: /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(
17229
+ /* @__PURE__ */ (0, import_jsx_runtime140.jsxs)("div", { className: "ss-w-v8-builder-ln", children: [
17230
+ /* @__PURE__ */ (0, import_jsx_runtime140.jsx)("span", { className: "ss-w-v8-builder-w", children: ui.v8BuilderIn }),
17231
+ 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
17232
  "select",
17127
17233
  {
17128
17234
  className: "ss-w-v8-select",
@@ -17132,16 +17238,16 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, slip, spor
17132
17238
  const picked = gamesOptions.find((o) => o.id === e.target.value);
17133
17239
  if (picked && picked.id !== view.gamesId) pickGames(picked);
17134
17240
  },
17135
- children: /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(GamesOptions, { options: gamesOptions, ui })
17241
+ children: /* @__PURE__ */ (0, import_jsx_runtime140.jsx)(GamesOptions, { options: gamesOptions, ui })
17136
17242
  }
17137
- ) }) : /* @__PURE__ */ (0, import_jsx_runtime138.jsx)("button", { type: "button", className: "ss-w-v8-builder-btn", "aria-pressed": view.widen, disabled: view.widen && !canNarrow, onClick: () => {
17243
+ ) }) : /* @__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
17244
  const next = { ...view, widen: canNarrow ? !view.widen : true, matchIds: canNarrow && view.widen && view.matchIds.length === 0 ? preset.matchIds : view.matchIds };
17139
17245
  ask(next);
17140
17246
  }, children: ui.v8UseAllGames })
17141
17247
  ] }),
17142
- /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)("div", { className: "ss-w-v8-builder-ln", children: [
17143
- /* @__PURE__ */ (0, import_jsx_runtime138.jsx)("span", { className: "ss-w-v8-builder-w", children: ui.v8BuilderAs }),
17144
- /* @__PURE__ */ (0, import_jsx_runtime138.jsx)("div", { className: "ss-w-v8-builder-btns", role: "group", "aria-label": ui.v8BuilderAs, children: legButtons.map((n) => /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(
17248
+ /* @__PURE__ */ (0, import_jsx_runtime140.jsxs)("div", { className: "ss-w-v8-builder-ln", children: [
17249
+ /* @__PURE__ */ (0, import_jsx_runtime140.jsx)("span", { className: "ss-w-v8-builder-w", children: ui.v8BuilderAs }),
17250
+ /* @__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
17251
  "button",
17146
17252
  {
17147
17253
  type: "button",
@@ -17156,9 +17262,9 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, slip, spor
17156
17262
  n
17157
17263
  )) })
17158
17264
  ] }),
17159
- view.legs > 1 ? /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)("div", { className: "ss-w-v8-builder-ln ss-w-v8-builder-ln--total", children: [
17160
- /* @__PURE__ */ (0, import_jsx_runtime138.jsx)("span", { className: "ss-w-v8-builder-w", children: ui.v8BuilderTotal }),
17161
- /* @__PURE__ */ (0, import_jsx_runtime138.jsx)("div", { className: "ss-w-v8-builder-btns", role: "group", "aria-label": ui.v8BuilderTotal, children: totals.map((t) => /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(
17265
+ view.legs > 1 ? /* @__PURE__ */ (0, import_jsx_runtime140.jsxs)("div", { className: "ss-w-v8-builder-ln ss-w-v8-builder-ln--total", children: [
17266
+ /* @__PURE__ */ (0, import_jsx_runtime140.jsx)("span", { className: "ss-w-v8-builder-w", children: ui.v8BuilderTotal }),
17267
+ /* @__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
17268
  "button",
17163
17269
  {
17164
17270
  type: "button",
@@ -17172,31 +17278,31 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, slip, spor
17172
17278
  t
17173
17279
  )) })
17174
17280
  ] }) : null,
17175
- ready && singles && widenedNote && !empty2 ? /* @__PURE__ */ (0, import_jsx_runtime138.jsx)("p", { className: "ss-w-v8-builder-note", "data-kind": "widened", children: ui.v8SinglesWidened(marketName) }) : null,
17176
- ready && !widenedNote && !empty2 && preset.widenedForMarket === true && onOpeningChoice && view.marketKey !== null ? /* @__PURE__ */ (0, import_jsx_runtime138.jsx)("p", { className: "ss-w-v8-builder-note", children: ui.v8Widened }) : null,
17177
- startedNote ? /* @__PURE__ */ (0, import_jsx_runtime138.jsx)("p", { className: "ss-w-v8-builder-note", "data-kind": "started", role: "status", children: ui.slipStarted }) : null,
17178
- status2 === "loading" ? /* @__PURE__ */ (0, import_jsx_runtime138.jsx)("p", { className: "ss-w-v8-builder-note", "data-kind": "loading", children: ui.v8BuilderLoading }) : null,
17179
- status2 === "error" ? /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)(import_jsx_runtime138.Fragment, { children: [
17180
- /* @__PURE__ */ (0, import_jsx_runtime138.jsx)("p", { className: "ss-w-v8-builder-note", "data-kind": "error", children: ui.v8BuilderError }),
17181
- /* @__PURE__ */ (0, import_jsx_runtime138.jsx)("button", { type: "button", className: "ss-w-v8-builder-btn", onClick: () => {
17281
+ 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,
17282
+ 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,
17283
+ startedNote ? /* @__PURE__ */ (0, import_jsx_runtime140.jsx)("p", { className: "ss-w-v8-builder-note", "data-kind": "started", role: "status", children: ui.slipStarted }) : null,
17284
+ status2 === "loading" ? /* @__PURE__ */ (0, import_jsx_runtime140.jsx)("p", { className: "ss-w-v8-builder-note", "data-kind": "loading", children: ui.v8BuilderLoading }) : null,
17285
+ status2 === "error" ? /* @__PURE__ */ (0, import_jsx_runtime140.jsxs)(import_jsx_runtime140.Fragment, { children: [
17286
+ /* @__PURE__ */ (0, import_jsx_runtime140.jsx)("p", { className: "ss-w-v8-builder-note", "data-kind": "error", children: ui.v8BuilderError }),
17287
+ /* @__PURE__ */ (0, import_jsx_runtime140.jsx)("button", { type: "button", className: "ss-w-v8-builder-btn", onClick: () => {
17182
17288
  setStartedNote(false);
17183
17289
  void request(lastRequest.current);
17184
17290
  }, children: ui.v8BuilderRetry })
17185
17291
  ] }) : null,
17186
- empty2 && singles && (widened || !canWiden) ? /* @__PURE__ */ (0, import_jsx_runtime138.jsx)("p", { className: "ss-w-v8-builder-note", "data-kind": "no-prices", children: ui.v8NoPrices(marketName) }) : null,
17187
- empty2 && !singles ? /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)(import_jsx_runtime138.Fragment, { children: [
17188
- /* @__PURE__ */ (0, import_jsx_runtime138.jsx)("p", { className: "ss-w-v8-builder-note", "data-kind": "miss", children: ui.v8Miss }),
17189
- gamesOptions && allGames && !widened ? /* @__PURE__ */ (0, import_jsx_runtime138.jsx)("button", { type: "button", className: "ss-w-v8-builder-btn", onClick: () => pickGames(allGames), children: ui.v8UseAllGames }) : null
17292
+ 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,
17293
+ empty2 && !singles ? /* @__PURE__ */ (0, import_jsx_runtime140.jsxs)(import_jsx_runtime140.Fragment, { children: [
17294
+ /* @__PURE__ */ (0, import_jsx_runtime140.jsx)("p", { className: "ss-w-v8-builder-note", "data-kind": "miss", children: ui.v8Miss }),
17295
+ 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
17296
  ] }) : null,
17191
- rows && rows.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)(import_jsx_runtime138.Fragment, { children: [
17192
- /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)("div", { className: "ss-w-v8-builder-rows", children: [
17193
- /* @__PURE__ */ (0, import_jsx_runtime138.jsx)("ol", { className: "ss-w-combo-legs", role: "list", children: rows.map((leg) => /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(ComboLegRow, { leg, addToSlipEnabled: !!slip.onAddToSlip, ui, slip: rowSlip, hold: !confirmed, closed: !preMatchOpen(leg.kickoffUtc, Date.now()) }, leg.key)) }),
17194
- grid && grid.requestedLegs > 1 ? /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(AddAllToSlipButton, { legs: rows, slip: rowSlip, ui, labels: { add: ui.v8AddAll, done: ui.allInSlip }, combo, sizeless: true, hold: !confirmed, onStartedGame: () => {
17297
+ rows && rows.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime140.jsxs)(import_jsx_runtime140.Fragment, { children: [
17298
+ /* @__PURE__ */ (0, import_jsx_runtime140.jsxs)("div", { className: "ss-w-v8-builder-rows", children: [
17299
+ /* @__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)) }),
17300
+ 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
17301
  setStartedNote(true);
17196
17302
  void request(lastRequest.current);
17197
17303
  } }) : null
17198
17304
  ] }),
17199
- quotedAt ? /* @__PURE__ */ (0, import_jsx_runtime138.jsx)("p", { className: "ss-w-v8-builder-note", "data-testid": "v8-asof", children: ui.v8PricesAsOf(fmtHhMm(quotedAt, ui.locale, clockOf(ui), ui.timeZone)) }) : null
17305
+ 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
17306
  ] }) : null
17201
17307
  ] }) : null });
17202
17308
  }
@@ -17204,25 +17310,25 @@ function GamesOptions({ options, ui }) {
17204
17310
  const top = options.filter((o) => o.group !== "league" && o.group !== "game");
17205
17311
  const leagues = options.filter((o) => o.group === "league");
17206
17312
  const games = options.filter((o) => o.group === "game");
17207
- return /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)(import_jsx_runtime138.Fragment, { children: [
17208
- top.map((o) => /* @__PURE__ */ (0, import_jsx_runtime138.jsx)("option", { value: o.id, children: o.label }, o.id)),
17209
- leagues.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime138.jsx)("optgroup", { label: ui.v8LeaguesGroup, children: leagues.map((o) => /* @__PURE__ */ (0, import_jsx_runtime138.jsx)("option", { value: o.id, children: o.label }, o.id)) }) : null,
17210
- games.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime138.jsx)("optgroup", { label: ui.v8GamesGroup, children: games.map((o) => {
17313
+ return /* @__PURE__ */ (0, import_jsx_runtime140.jsxs)(import_jsx_runtime140.Fragment, { children: [
17314
+ top.map((o) => /* @__PURE__ */ (0, import_jsx_runtime140.jsx)("option", { value: o.id, children: o.label }, o.id)),
17315
+ 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,
17316
+ games.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime140.jsx)("optgroup", { label: ui.v8GamesGroup, children: games.map((o) => {
17211
17317
  const at2 = kickoffText(ui, o.startsAtUtc);
17212
- return /* @__PURE__ */ (0, import_jsx_runtime138.jsx)("option", { value: o.id, children: at2 ? `${o.label} \xB7 ${at2}` : o.label }, o.id);
17318
+ return /* @__PURE__ */ (0, import_jsx_runtime140.jsx)("option", { value: o.id, children: at2 ? `${o.label} \xB7 ${at2}` : o.label }, o.id);
17213
17319
  }) }) : null
17214
17320
  ] });
17215
17321
  }
17216
17322
 
17217
17323
  // src/components/BuilderPanel.tsx
17218
- var import_jsx_runtime139 = require("react/jsx-runtime");
17324
+ var import_jsx_runtime141 = require("react/jsx-runtime");
17219
17325
  function BuilderPanel({ options, sport, onSportChange, ui, slip, onCoolOff }) {
17220
17326
  const ctx = usePersonalGreeting();
17221
17327
  const scope = useSportScope();
17222
17328
  const active = options.find((o) => o.sport === sport) ?? options[0];
17223
17329
  if (!active) return null;
17224
- return /* @__PURE__ */ (0, import_jsx_runtime139.jsxs)("div", { className: "ss-w-mon-list ss-w-builder-tab", children: [
17225
- options.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime139.jsx)("div", { className: "ss-w-dash-sports", role: "group", "aria-label": ui.sportGroupLabel, children: options.map((o) => /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
17330
+ return /* @__PURE__ */ (0, import_jsx_runtime141.jsxs)("div", { className: "ss-w-mon-list ss-w-builder-tab", children: [
17331
+ 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
17332
  "button",
17227
17333
  {
17228
17334
  type: "button",
@@ -17233,7 +17339,7 @@ function BuilderPanel({ options, sport, onSportChange, ui, slip, onCoolOff }) {
17233
17339
  },
17234
17340
  o.sport
17235
17341
  )) }) : null,
17236
- /* @__PURE__ */ (0, import_jsx_runtime139.jsx)("div", { className: "ss-w-v8", children: /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
17342
+ /* @__PURE__ */ (0, import_jsx_runtime141.jsx)("div", { className: "ss-w-v8", children: /* @__PURE__ */ (0, import_jsx_runtime141.jsx)(
17237
17343
  SentenceBuilder,
17238
17344
  {
17239
17345
  preset: active.preset,
@@ -17252,7 +17358,7 @@ function BuilderPanel({ options, sport, onSportChange, ui, slip, onCoolOff }) {
17252
17358
  }
17253
17359
 
17254
17360
  // src/components/Fixtures.tsx
17255
- var import_jsx_runtime140 = require("react/jsx-runtime");
17361
+ var import_jsx_runtime142 = require("react/jsx-runtime");
17256
17362
  function groupByRound(fixtures) {
17257
17363
  const groups = [];
17258
17364
  for (const fx of fixtures) {
@@ -17264,31 +17370,31 @@ function groupByRound(fixtures) {
17264
17370
  }
17265
17371
  function Fixtures({ fixtures, loading, ui }) {
17266
17372
  if (fixtures.length === 0) {
17267
- if (loading) return /* @__PURE__ */ (0, import_jsx_runtime140.jsx)("div", { className: "ss-w-mon-list" });
17268
- return /* @__PURE__ */ (0, import_jsx_runtime140.jsx)("div", { className: "ss-w-mon-empty", children: ui.clubFixturesEmpty });
17373
+ if (loading) return /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("div", { className: "ss-w-mon-list" });
17374
+ return /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("div", { className: "ss-w-mon-empty", children: ui.clubFixturesEmpty });
17269
17375
  }
17270
- return /* @__PURE__ */ (0, import_jsx_runtime140.jsx)("div", { className: "ss-w-mon-list", children: groupByRound(fixtures).map((group, gi) => /* @__PURE__ */ (0, import_jsx_runtime140.jsxs)("div", { children: [
17271
- group.round && /* @__PURE__ */ (0, import_jsx_runtime140.jsx)("div", { className: "ss-w-club-eyebrow", children: group.round }),
17376
+ 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: [
17377
+ group.round && /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("div", { className: "ss-w-club-eyebrow", children: group.round }),
17272
17378
  group.items.map((fx) => {
17273
17379
  const played = fx.homeScore !== null && fx.awayScore !== null;
17274
17380
  const kickoff = fx.matchDateTime ? ui.bettingKickoff(fx.matchDateTime) : null;
17275
- return /* @__PURE__ */ (0, import_jsx_runtime140.jsxs)("div", { className: "ss-w-mon", children: [
17276
- /* @__PURE__ */ (0, import_jsx_runtime140.jsxs)("div", { className: "ss-w-mon-top", children: [
17277
- fx.competitionName && /* @__PURE__ */ (0, import_jsx_runtime140.jsx)("span", { className: "ss-w-mon-comp", children: fx.competitionName }),
17278
- !played && kickoff && /* @__PURE__ */ (0, import_jsx_runtime140.jsxs)("span", { className: "ss-w-mon-pill", children: [
17381
+ return /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)("div", { className: "ss-w-mon", children: [
17382
+ /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)("div", { className: "ss-w-mon-top", children: [
17383
+ fx.competitionName && /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("span", { className: "ss-w-mon-comp", children: fx.competitionName }),
17384
+ !played && kickoff && /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)("span", { className: "ss-w-mon-pill", children: [
17279
17385
  kickoff.dayLabel,
17280
17386
  " \xB7 ",
17281
17387
  kickoff.time
17282
17388
  ] })
17283
17389
  ] }),
17284
- /* @__PURE__ */ (0, import_jsx_runtime140.jsxs)("div", { className: "ss-w-mon-main", children: [
17285
- /* @__PURE__ */ (0, import_jsx_runtime140.jsx)("span", { className: "ss-w-mon-side", children: /* @__PURE__ */ (0, import_jsx_runtime140.jsx)("span", { className: "ss-w-mon-name", children: fx.homeTeamName }) }),
17286
- played ? /* @__PURE__ */ (0, import_jsx_runtime140.jsxs)("span", { className: "ss-w-mon-score", children: [
17390
+ /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)("div", { className: "ss-w-mon-main", children: [
17391
+ /* @__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 }) }),
17392
+ played ? /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)("span", { className: "ss-w-mon-score", children: [
17287
17393
  fx.homeScore,
17288
- /* @__PURE__ */ (0, import_jsx_runtime140.jsx)("i", { children: "-" }),
17394
+ /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("i", { children: "-" }),
17289
17395
  fx.awayScore
17290
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime140.jsx)("span", { className: "ss-w-mon-vs", children: ui.venue.home }),
17291
- /* @__PURE__ */ (0, import_jsx_runtime140.jsx)("span", { className: "ss-w-mon-side ss-w-mon-side--away", children: /* @__PURE__ */ (0, import_jsx_runtime140.jsx)("span", { className: "ss-w-mon-name", children: fx.awayTeamName }) })
17396
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("span", { className: "ss-w-mon-vs", children: ui.venue.home }),
17397
+ /* @__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
17398
  ] })
17293
17399
  ] }, fx.id);
17294
17400
  })
@@ -17296,7 +17402,7 @@ function Fixtures({ fixtures, loading, ui }) {
17296
17402
  }
17297
17403
 
17298
17404
  // src/components/Standings.tsx
17299
- var import_jsx_runtime141 = require("react/jsx-runtime");
17405
+ var import_jsx_runtime143 = require("react/jsx-runtime");
17300
17406
  function groupByTable(rows) {
17301
17407
  const groups = [];
17302
17408
  for (const row of rows) {
@@ -17307,30 +17413,30 @@ function groupByTable(rows) {
17307
17413
  return groups;
17308
17414
  }
17309
17415
  function Standings({ standings, loading, ui }) {
17310
- if (standings === null && loading) return /* @__PURE__ */ (0, import_jsx_runtime141.jsx)("div", { className: "ss-w-mon-list" });
17311
- if (standings === null || standings.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime141.jsx)("div", { className: "ss-w-mon-empty", children: ui.clubStandingsEmpty });
17312
- return /* @__PURE__ */ (0, import_jsx_runtime141.jsx)("div", { className: "ss-w-mon-list", children: groupByTable(standings).map((group, gi) => /* @__PURE__ */ (0, import_jsx_runtime141.jsxs)("div", { className: "ss-w-table-wrap", children: [
17313
- group.table && /* @__PURE__ */ (0, import_jsx_runtime141.jsx)("div", { className: "ss-w-club-eyebrow", children: group.table }),
17314
- /* @__PURE__ */ (0, import_jsx_runtime141.jsxs)("table", { className: "ss-w-md-table", children: [
17315
- /* @__PURE__ */ (0, import_jsx_runtime141.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime141.jsxs)("tr", { children: [
17316
- /* @__PURE__ */ (0, import_jsx_runtime141.jsx)("th", { children: "#" }),
17317
- /* @__PURE__ */ (0, import_jsx_runtime141.jsx)("th", { children: ui.standingsColClub }),
17318
- /* @__PURE__ */ (0, import_jsx_runtime141.jsx)("th", { children: ui.standingsColPlayed }),
17319
- /* @__PURE__ */ (0, import_jsx_runtime141.jsx)("th", { children: ui.standingsColWon }),
17320
- /* @__PURE__ */ (0, import_jsx_runtime141.jsx)("th", { children: ui.standingsColDrawn }),
17321
- /* @__PURE__ */ (0, import_jsx_runtime141.jsx)("th", { children: ui.standingsColLost }),
17322
- /* @__PURE__ */ (0, import_jsx_runtime141.jsx)("th", { children: ui.standingsColGoalDiff }),
17323
- /* @__PURE__ */ (0, import_jsx_runtime141.jsx)("th", { children: ui.standingsColPoints })
17416
+ if (standings === null && loading) return /* @__PURE__ */ (0, import_jsx_runtime143.jsx)("div", { className: "ss-w-mon-list" });
17417
+ if (standings === null || standings.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime143.jsx)("div", { className: "ss-w-mon-empty", children: ui.clubStandingsEmpty });
17418
+ 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: [
17419
+ group.table && /* @__PURE__ */ (0, import_jsx_runtime143.jsx)("div", { className: "ss-w-club-eyebrow", children: group.table }),
17420
+ /* @__PURE__ */ (0, import_jsx_runtime143.jsxs)("table", { className: "ss-w-md-table", children: [
17421
+ /* @__PURE__ */ (0, import_jsx_runtime143.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime143.jsxs)("tr", { children: [
17422
+ /* @__PURE__ */ (0, import_jsx_runtime143.jsx)("th", { children: "#" }),
17423
+ /* @__PURE__ */ (0, import_jsx_runtime143.jsx)("th", { children: ui.standingsColClub }),
17424
+ /* @__PURE__ */ (0, import_jsx_runtime143.jsx)("th", { children: ui.standingsColPlayed }),
17425
+ /* @__PURE__ */ (0, import_jsx_runtime143.jsx)("th", { children: ui.standingsColWon }),
17426
+ /* @__PURE__ */ (0, import_jsx_runtime143.jsx)("th", { children: ui.standingsColDrawn }),
17427
+ /* @__PURE__ */ (0, import_jsx_runtime143.jsx)("th", { children: ui.standingsColLost }),
17428
+ /* @__PURE__ */ (0, import_jsx_runtime143.jsx)("th", { children: ui.standingsColGoalDiff }),
17429
+ /* @__PURE__ */ (0, import_jsx_runtime143.jsx)("th", { children: ui.standingsColPoints })
17324
17430
  ] }) }),
17325
- /* @__PURE__ */ (0, import_jsx_runtime141.jsx)("tbody", { children: group.items.map((row) => /* @__PURE__ */ (0, import_jsx_runtime141.jsxs)("tr", { children: [
17326
- /* @__PURE__ */ (0, import_jsx_runtime141.jsx)("td", { children: row.position }),
17327
- /* @__PURE__ */ (0, import_jsx_runtime141.jsx)("td", { children: row.teamName }),
17328
- /* @__PURE__ */ (0, import_jsx_runtime141.jsx)("td", { children: row.playedGames }),
17329
- /* @__PURE__ */ (0, import_jsx_runtime141.jsx)("td", { children: row.wins }),
17330
- /* @__PURE__ */ (0, import_jsx_runtime141.jsx)("td", { children: row.draws }),
17331
- /* @__PURE__ */ (0, import_jsx_runtime141.jsx)("td", { children: row.losses }),
17332
- /* @__PURE__ */ (0, import_jsx_runtime141.jsx)("td", { children: row.goalDifference }),
17333
- /* @__PURE__ */ (0, import_jsx_runtime141.jsx)("td", { children: row.points })
17431
+ /* @__PURE__ */ (0, import_jsx_runtime143.jsx)("tbody", { children: group.items.map((row) => /* @__PURE__ */ (0, import_jsx_runtime143.jsxs)("tr", { children: [
17432
+ /* @__PURE__ */ (0, import_jsx_runtime143.jsx)("td", { children: row.position }),
17433
+ /* @__PURE__ */ (0, import_jsx_runtime143.jsx)("td", { children: row.teamName }),
17434
+ /* @__PURE__ */ (0, import_jsx_runtime143.jsx)("td", { children: row.playedGames }),
17435
+ /* @__PURE__ */ (0, import_jsx_runtime143.jsx)("td", { children: row.wins }),
17436
+ /* @__PURE__ */ (0, import_jsx_runtime143.jsx)("td", { children: row.draws }),
17437
+ /* @__PURE__ */ (0, import_jsx_runtime143.jsx)("td", { children: row.losses }),
17438
+ /* @__PURE__ */ (0, import_jsx_runtime143.jsx)("td", { children: row.goalDifference }),
17439
+ /* @__PURE__ */ (0, import_jsx_runtime143.jsx)("td", { children: row.points })
17334
17440
  ] }, row.teamId)) })
17335
17441
  ] })
17336
17442
  ] }, `${gi}-${group.table ?? "none"}`)) });
@@ -17387,7 +17493,7 @@ function statsEyebrow(ui, season, competition, matches) {
17387
17493
  }
17388
17494
 
17389
17495
  // src/components/SquadStats.tsx
17390
- var import_jsx_runtime142 = require("react/jsx-runtime");
17496
+ var import_jsx_runtime144 = require("react/jsx-runtime");
17391
17497
  function leader(stats, pick) {
17392
17498
  let best = null;
17393
17499
  for (const p of stats) {
@@ -17401,53 +17507,53 @@ function ratingClass(rating) {
17401
17507
  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
17508
  }
17403
17509
  function SquadStats({ stats, loading, ui, onSelectPlayer }) {
17404
- if (stats === null && loading) return /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("div", { className: "ss-w-mon-list" });
17405
- if (stats === null || stats.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("div", { className: "ss-w-mon-empty", children: ui.clubSquadStatsEmpty });
17510
+ if (stats === null && loading) return /* @__PURE__ */ (0, import_jsx_runtime144.jsx)("div", { className: "ss-w-mon-list" });
17511
+ if (stats === null || stats.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime144.jsx)("div", { className: "ss-w-mon-empty", children: ui.clubSquadStatsEmpty });
17406
17512
  const scorer = leader(stats, (p) => p.goals);
17407
17513
  const assister = leader(stats, (p) => p.assists);
17408
17514
  const footer = [
17409
17515
  scorer && ui.squadTopScorer(scorer.playerName, scorer.goals),
17410
17516
  assister && ui.squadTopAssists(assister.playerName, assister.assists)
17411
17517
  ].filter((part) => !!part).join(" \xB7 ");
17412
- return /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)("div", { className: "ss-w-mon-list ss-w-sq-stats", children: [
17413
- /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)("div", { className: "ss-w-sq-card", children: [
17414
- /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)("div", { className: "ss-w-sq-row ss-w-sq-head", "aria-hidden": "true", children: [
17415
- /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("span", { className: "ss-w-sq-name" }),
17416
- /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("span", { className: "ss-w-sq-pos", children: ui.statHeadPos }),
17417
- /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("span", { className: "ss-w-sq-c30", children: ui.statColApps }),
17418
- /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("span", { className: "ss-w-sq-c36", children: ui.statHeadMins }),
17419
- /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("span", { className: "ss-w-sq-c20", children: ui.statHeadGoals }),
17420
- /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("span", { className: "ss-w-sq-c20", children: ui.statHeadAssists }),
17421
- /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("span", { className: "ss-w-sq-c20 ss-w-sq-yr", children: ui.statHeadYellow }),
17422
- /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("span", { className: "ss-w-sq-c20 ss-w-sq-yr", children: ui.statHeadRed }),
17423
- /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("span", { className: "ss-w-sq-c36", children: ui.statHeadRating })
17518
+ return /* @__PURE__ */ (0, import_jsx_runtime144.jsxs)("div", { className: "ss-w-mon-list ss-w-sq-stats", children: [
17519
+ /* @__PURE__ */ (0, import_jsx_runtime144.jsxs)("div", { className: "ss-w-sq-card", children: [
17520
+ /* @__PURE__ */ (0, import_jsx_runtime144.jsxs)("div", { className: "ss-w-sq-row ss-w-sq-head", "aria-hidden": "true", children: [
17521
+ /* @__PURE__ */ (0, import_jsx_runtime144.jsx)("span", { className: "ss-w-sq-name" }),
17522
+ /* @__PURE__ */ (0, import_jsx_runtime144.jsx)("span", { className: "ss-w-sq-pos", children: ui.statHeadPos }),
17523
+ /* @__PURE__ */ (0, import_jsx_runtime144.jsx)("span", { className: "ss-w-sq-c30", children: ui.statColApps }),
17524
+ /* @__PURE__ */ (0, import_jsx_runtime144.jsx)("span", { className: "ss-w-sq-c36", children: ui.statHeadMins }),
17525
+ /* @__PURE__ */ (0, import_jsx_runtime144.jsx)("span", { className: "ss-w-sq-c20", children: ui.statHeadGoals }),
17526
+ /* @__PURE__ */ (0, import_jsx_runtime144.jsx)("span", { className: "ss-w-sq-c20", children: ui.statHeadAssists }),
17527
+ /* @__PURE__ */ (0, import_jsx_runtime144.jsx)("span", { className: "ss-w-sq-c20 ss-w-sq-yr", children: ui.statHeadYellow }),
17528
+ /* @__PURE__ */ (0, import_jsx_runtime144.jsx)("span", { className: "ss-w-sq-c20 ss-w-sq-yr", children: ui.statHeadRed }),
17529
+ /* @__PURE__ */ (0, import_jsx_runtime144.jsx)("span", { className: "ss-w-sq-c36", children: ui.statHeadRating })
17424
17530
  ] }),
17425
- stats.map((p) => /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)("button", { type: "button", className: "ss-w-sq-row ss-w-sq-tap", onClick: () => onSelectPlayer(p.playerId), children: [
17426
- /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)("span", { className: "ss-w-sq-player", children: [
17427
- p.jerseyNumber !== null && /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("span", { className: "ss-w-sq-badge", children: p.jerseyNumber }),
17428
- /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("span", { className: "ss-w-sq-name ss-w-sq-name-1", children: p.playerName })
17531
+ 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: [
17532
+ /* @__PURE__ */ (0, import_jsx_runtime144.jsxs)("span", { className: "ss-w-sq-player", children: [
17533
+ p.jerseyNumber !== null && /* @__PURE__ */ (0, import_jsx_runtime144.jsx)("span", { className: "ss-w-sq-badge", children: p.jerseyNumber }),
17534
+ /* @__PURE__ */ (0, import_jsx_runtime144.jsx)("span", { className: "ss-w-sq-name ss-w-sq-name-1", children: p.playerName })
17429
17535
  ] }),
17430
- /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("span", { className: "ss-w-sq-pos", children: positionShort(ui, p.positionCode, p.positionName) }),
17431
- /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("span", { className: "ss-w-sq-c30", children: p.appearances }),
17432
- /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("span", { className: "ss-w-sq-c36", children: p.minutesPlayed }),
17433
- /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("span", { className: "ss-w-sq-c20", children: p.goals }),
17434
- /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("span", { className: "ss-w-sq-c20", children: p.assists }),
17435
- /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("span", { className: "ss-w-sq-c20 ss-w-sq-yr", children: p.yellowCards }),
17436
- /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("span", { className: "ss-w-sq-c20 ss-w-sq-yr", children: p.redCards }),
17437
- /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("span", { className: ratingClass(p.averageRating), children: p.averageRating === null ? "\u2013" : formatFixed(p.averageRating, ui.locale, 1) })
17536
+ /* @__PURE__ */ (0, import_jsx_runtime144.jsx)("span", { className: "ss-w-sq-pos", children: positionShort(ui, p.positionCode, p.positionName) }),
17537
+ /* @__PURE__ */ (0, import_jsx_runtime144.jsx)("span", { className: "ss-w-sq-c30", children: p.appearances }),
17538
+ /* @__PURE__ */ (0, import_jsx_runtime144.jsx)("span", { className: "ss-w-sq-c36", children: p.minutesPlayed }),
17539
+ /* @__PURE__ */ (0, import_jsx_runtime144.jsx)("span", { className: "ss-w-sq-c20", children: p.goals }),
17540
+ /* @__PURE__ */ (0, import_jsx_runtime144.jsx)("span", { className: "ss-w-sq-c20", children: p.assists }),
17541
+ /* @__PURE__ */ (0, import_jsx_runtime144.jsx)("span", { className: "ss-w-sq-c20 ss-w-sq-yr", children: p.yellowCards }),
17542
+ /* @__PURE__ */ (0, import_jsx_runtime144.jsx)("span", { className: "ss-w-sq-c20 ss-w-sq-yr", children: p.redCards }),
17543
+ /* @__PURE__ */ (0, import_jsx_runtime144.jsx)("span", { className: ratingClass(p.averageRating), children: p.averageRating === null ? "\u2013" : formatFixed(p.averageRating, ui.locale, 1) })
17438
17544
  ] }, p.playerId))
17439
17545
  ] }),
17440
- footer !== "" && /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("div", { className: "ss-w-sq-foot", children: footer })
17546
+ footer !== "" && /* @__PURE__ */ (0, import_jsx_runtime144.jsx)("div", { className: "ss-w-sq-foot", children: footer })
17441
17547
  ] });
17442
17548
  }
17443
17549
 
17444
17550
  // src/components/Squad.tsx
17445
- var import_jsx_runtime143 = require("react/jsx-runtime");
17551
+ var import_jsx_runtime145 = require("react/jsx-runtime");
17446
17552
  function Squad({ squad, loading, ui, view, onToggleView, stats, statsLoading, seasonName = null, competitionName = null, matchesPlayed = null, onSelectPlayer }) {
17447
17553
  const eyebrow = view === "stats" ? statsEyebrow(ui, seasonName, competitionName, matchesPlayed) : null;
17448
- const toggle = /* @__PURE__ */ (0, import_jsx_runtime143.jsxs)("div", { className: "ss-w-sq-bar", children: [
17449
- eyebrow !== null && /* @__PURE__ */ (0, import_jsx_runtime143.jsx)("div", { className: "ss-w-sq-eyebrow", children: eyebrow }),
17450
- /* @__PURE__ */ (0, import_jsx_runtime143.jsx)("div", { className: "ss-w-sq-seg", role: "group", children: ["roster", "stats"].map((v) => /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(
17554
+ const toggle = /* @__PURE__ */ (0, import_jsx_runtime145.jsxs)("div", { className: "ss-w-sq-bar", children: [
17555
+ eyebrow !== null && /* @__PURE__ */ (0, import_jsx_runtime145.jsx)("div", { className: "ss-w-sq-eyebrow", children: eyebrow }),
17556
+ /* @__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
17557
  "button",
17452
17558
  {
17453
17559
  type: "button",
@@ -17462,45 +17568,45 @@ function Squad({ squad, loading, ui, view, onToggleView, stats, statsLoading, se
17462
17568
  )) })
17463
17569
  ] });
17464
17570
  if (view === "stats") {
17465
- return /* @__PURE__ */ (0, import_jsx_runtime143.jsxs)(import_jsx_runtime143.Fragment, { children: [
17571
+ return /* @__PURE__ */ (0, import_jsx_runtime145.jsxs)(import_jsx_runtime145.Fragment, { children: [
17466
17572
  toggle,
17467
- /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(SquadStats, { stats, loading: statsLoading, ui, onSelectPlayer })
17573
+ /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(SquadStats, { stats, loading: statsLoading, ui, onSelectPlayer })
17468
17574
  ] });
17469
17575
  }
17470
- if (squad === null && loading) return /* @__PURE__ */ (0, import_jsx_runtime143.jsxs)(import_jsx_runtime143.Fragment, { children: [
17576
+ if (squad === null && loading) return /* @__PURE__ */ (0, import_jsx_runtime145.jsxs)(import_jsx_runtime145.Fragment, { children: [
17471
17577
  toggle,
17472
- /* @__PURE__ */ (0, import_jsx_runtime143.jsx)("div", { className: "ss-w-mon-list" })
17578
+ /* @__PURE__ */ (0, import_jsx_runtime145.jsx)("div", { className: "ss-w-mon-list" })
17473
17579
  ] });
17474
- if (squad === null || squad.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime143.jsxs)(import_jsx_runtime143.Fragment, { children: [
17580
+ if (squad === null || squad.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime145.jsxs)(import_jsx_runtime145.Fragment, { children: [
17475
17581
  toggle,
17476
- /* @__PURE__ */ (0, import_jsx_runtime143.jsx)("div", { className: "ss-w-mon-empty", children: ui.clubSquadEmpty })
17582
+ /* @__PURE__ */ (0, import_jsx_runtime145.jsx)("div", { className: "ss-w-mon-empty", children: ui.clubSquadEmpty })
17477
17583
  ] });
17478
- return /* @__PURE__ */ (0, import_jsx_runtime143.jsxs)(import_jsx_runtime143.Fragment, { children: [
17584
+ return /* @__PURE__ */ (0, import_jsx_runtime145.jsxs)(import_jsx_runtime145.Fragment, { children: [
17479
17585
  toggle,
17480
- /* @__PURE__ */ (0, import_jsx_runtime143.jsx)("div", { className: "ss-w-mon-list", children: groupByPosition(squad).map((group, gi) => /* @__PURE__ */ (0, import_jsx_runtime143.jsxs)("div", { children: [
17481
- group.positionName && /* @__PURE__ */ (0, import_jsx_runtime143.jsx)("div", { className: "ss-w-club-eyebrow", children: positionLabel(ui, group.positionName) }),
17482
- group.items.map((p) => /* @__PURE__ */ (0, import_jsx_runtime143.jsxs)("button", { type: "button", className: "ss-w-sq-row ss-w-sq-tap", onClick: () => onSelectPlayer(p.playerId), children: [
17483
- /* @__PURE__ */ (0, import_jsx_runtime143.jsx)("span", { className: "ss-w-sq-num", children: p.jerseyNumber ?? "" }),
17484
- /* @__PURE__ */ (0, import_jsx_runtime143.jsx)("span", { className: "ss-w-sq-name", children: p.playerName })
17586
+ /* @__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: [
17587
+ group.positionName && /* @__PURE__ */ (0, import_jsx_runtime145.jsx)("div", { className: "ss-w-club-eyebrow", children: positionLabel(ui, group.positionName) }),
17588
+ 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: [
17589
+ /* @__PURE__ */ (0, import_jsx_runtime145.jsx)("span", { className: "ss-w-sq-num", children: p.jerseyNumber ?? "" }),
17590
+ /* @__PURE__ */ (0, import_jsx_runtime145.jsx)("span", { className: "ss-w-sq-name", children: p.playerName })
17485
17591
  ] }, p.playerId))
17486
17592
  ] }, `${gi}-${group.positionName ?? "none"}`)) })
17487
17593
  ] });
17488
17594
  }
17489
17595
 
17490
17596
  // src/components/PlayerPhoto.tsx
17491
- var import_react101 = require("react");
17492
- var import_jsx_runtime144 = require("react/jsx-runtime");
17597
+ var import_react102 = require("react");
17598
+ var import_jsx_runtime146 = require("react/jsx-runtime");
17493
17599
  function PlayerPhoto({ photoUrl, jerseyNumber, size }) {
17494
- const [failed, setFailed] = (0, import_react101.useState)(false);
17600
+ const [failed, setFailed] = (0, import_react102.useState)(false);
17495
17601
  const box = { width: size, height: size };
17496
17602
  if (photoUrl && !failed) {
17497
- return /* @__PURE__ */ (0, import_jsx_runtime144.jsx)("img", { className: "ss-w-pd-photo", style: box, src: photoUrl, alt: "", "aria-hidden": "true", onError: () => setFailed(true) });
17603
+ 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
17604
  }
17499
- return /* @__PURE__ */ (0, import_jsx_runtime144.jsx)("span", { className: "ss-w-pd-photo ss-w-pd-avatar", style: { ...box, fontSize: Math.round(size * 0.35) }, "aria-hidden": "true", children: jerseyNumber ?? "" });
17605
+ 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
17606
  }
17501
17607
 
17502
17608
  // src/components/MiniPitch.tsx
17503
- var import_jsx_runtime145 = require("react/jsx-runtime");
17609
+ var import_jsx_runtime147 = require("react/jsx-runtime");
17504
17610
  var SPOT = {
17505
17611
  GK: [50, 90],
17506
17612
  CB: [50, 75],
@@ -17522,12 +17628,12 @@ var SPOT = {
17522
17628
  function MiniPitch({ positionCode }) {
17523
17629
  const spot = SPOT[positionCode?.trim().toUpperCase() ?? ""];
17524
17630
  if (spot === void 0) return null;
17525
- return /* @__PURE__ */ (0, import_jsx_runtime145.jsx)("div", { className: "ss-w-pd-pitch", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime145.jsx)("div", { className: "ss-w-pd-pitch-dot", style: { left: `${spot[0]}%`, top: `${spot[1]}%` } }) });
17631
+ 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
17632
  }
17527
17633
 
17528
17634
  // src/components/PerformanceBars.tsx
17529
- var import_react102 = require("react");
17530
- var import_jsx_runtime146 = require("react/jsx-runtime");
17635
+ var import_react103 = require("react");
17636
+ var import_jsx_runtime148 = require("react/jsx-runtime");
17531
17637
  var GROUPS = ["shooting", "passing", "possession", "defending"];
17532
17638
  function finite4(v) {
17533
17639
  return typeof v === "number" && Number.isFinite(v) ? v : null;
@@ -17572,40 +17678,40 @@ function unrankedLine(ui, reason) {
17572
17678
  }
17573
17679
  }
17574
17680
  function PerformanceBars({ performance, competitionName, strings }) {
17575
- const [mode, setMode] = (0, import_react102.useState)("total");
17681
+ const [mode, setMode] = (0, import_react103.useState)("total");
17576
17682
  const labelled = performance.metrics.filter((m) => Object.prototype.hasOwnProperty.call(strings.perfMetric, m.key));
17577
17683
  if (!labelled.some((m) => valueOf(m, "total") !== null || valueOf(m, "per90") !== null)) return null;
17578
17684
  const subtitle = !performance.ranked ? unrankedLine(strings, performance.unrankedReason) : competitionName ? strings.perfRankedAgainst(competitionName, performance.positionGroup) : null;
17579
17685
  const cards = GROUPS.map((g) => {
17580
17686
  const rows = labelled.filter((m) => m.group === g && valueOf(m, mode) !== null);
17581
17687
  if (rows.length === 0) return null;
17582
- return /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)("div", { className: "ss-w-pd-card ss-w-pd-perf-card", children: [
17583
- /* @__PURE__ */ (0, import_jsx_runtime146.jsx)("div", { className: "ss-w-pd-perf-group", children: groupTitle(strings, g) }),
17688
+ return /* @__PURE__ */ (0, import_jsx_runtime148.jsxs)("div", { className: "ss-w-pd-card ss-w-pd-perf-card", children: [
17689
+ /* @__PURE__ */ (0, import_jsx_runtime148.jsx)("div", { className: "ss-w-pd-perf-group", children: groupTitle(strings, g) }),
17584
17690
  rows.map((m) => {
17585
17691
  const v = valueOf(m, mode);
17586
17692
  const rank2 = performance.ranked ? rankOf(m, mode) : null;
17587
- return /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)("div", { className: "ss-w-pd-bar-row", children: [
17588
- /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)("div", { className: "ss-w-pd-bar-top", children: [
17589
- /* @__PURE__ */ (0, import_jsx_runtime146.jsx)("span", { className: "ss-w-pd-bar-label", children: strings.perfMetric[m.key] }),
17590
- /* @__PURE__ */ (0, import_jsx_runtime146.jsx)("span", { className: "ss-w-pd-bar-value", children: format(m, v, mode, strings.locale) })
17693
+ return /* @__PURE__ */ (0, import_jsx_runtime148.jsxs)("div", { className: "ss-w-pd-bar-row", children: [
17694
+ /* @__PURE__ */ (0, import_jsx_runtime148.jsxs)("div", { className: "ss-w-pd-bar-top", children: [
17695
+ /* @__PURE__ */ (0, import_jsx_runtime148.jsx)("span", { className: "ss-w-pd-bar-label", children: strings.perfMetric[m.key] }),
17696
+ /* @__PURE__ */ (0, import_jsx_runtime148.jsx)("span", { className: "ss-w-pd-bar-value", children: format(m, v, mode, strings.locale) })
17591
17697
  ] }),
17592
- rank2 !== null && /* @__PURE__ */ (0, import_jsx_runtime146.jsx)("div", { className: "ss-w-pd-track", children: /* @__PURE__ */ (0, import_jsx_runtime146.jsx)("div", { className: `ss-w-pd-fill ss-w-pd-fill--${band(rank2)}`, style: { width: `${rank2}%` } }) })
17698
+ 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
17699
  ] }, m.key);
17594
17700
  })
17595
17701
  ] }, g);
17596
17702
  });
17597
- return /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)("div", { children: [
17598
- /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)("div", { className: "ss-w-pd-perf-head", children: [
17599
- /* @__PURE__ */ (0, import_jsx_runtime146.jsx)("div", { className: "ss-w-pd-eyebrow", children: strings.perfTitle }),
17600
- /* @__PURE__ */ (0, import_jsx_runtime146.jsx)("div", { className: "ss-w-pd-seg", role: "group", children: ["total", "per90"].map((m) => /* @__PURE__ */ (0, import_jsx_runtime146.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)) })
17703
+ return /* @__PURE__ */ (0, import_jsx_runtime148.jsxs)("div", { children: [
17704
+ /* @__PURE__ */ (0, import_jsx_runtime148.jsxs)("div", { className: "ss-w-pd-perf-head", children: [
17705
+ /* @__PURE__ */ (0, import_jsx_runtime148.jsx)("div", { className: "ss-w-pd-eyebrow", children: strings.perfTitle }),
17706
+ /* @__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
17707
  ] }),
17602
- subtitle !== null && /* @__PURE__ */ (0, import_jsx_runtime146.jsx)("div", { className: "ss-w-pd-perf-sub", children: subtitle }),
17603
- /* @__PURE__ */ (0, import_jsx_runtime146.jsx)("div", { className: "ss-w-pd-perf-cards", children: cards })
17708
+ subtitle !== null && /* @__PURE__ */ (0, import_jsx_runtime148.jsx)("div", { className: "ss-w-pd-perf-sub", children: subtitle }),
17709
+ /* @__PURE__ */ (0, import_jsx_runtime148.jsx)("div", { className: "ss-w-pd-perf-cards", children: cards })
17604
17710
  ] });
17605
17711
  }
17606
17712
 
17607
17713
  // src/components/PlayerDetail.tsx
17608
- var import_jsx_runtime147 = require("react/jsx-runtime");
17714
+ var import_jsx_runtime149 = require("react/jsx-runtime");
17609
17715
  var DASH = "\u2014";
17610
17716
  function ageFrom(dobMs) {
17611
17717
  if (dobMs === null) return DASH;
@@ -17625,16 +17731,16 @@ function ratingTone(rounded) {
17625
17731
  return "neg";
17626
17732
  }
17627
17733
  function Bio({ label, value }) {
17628
- return /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { className: "ss-w-pd-bio-item", children: [
17629
- /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("span", { className: "ss-w-pd-faint", children: label }),
17734
+ return /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("div", { className: "ss-w-pd-bio-item", children: [
17735
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("span", { className: "ss-w-pd-faint", children: label }),
17630
17736
  " ",
17631
- /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("span", { children: value })
17737
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("span", { children: value })
17632
17738
  ] });
17633
17739
  }
17634
17740
  function Tile({ label, value, pos }) {
17635
- return /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { className: "ss-w-pd-tile", children: [
17636
- /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "ss-w-pd-tile-label", children: label }),
17637
- /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: pos ? "ss-w-pd-tile-value ss-w-pd-pos-ink" : "ss-w-pd-tile-value", children: value })
17741
+ return /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("div", { className: "ss-w-pd-tile", children: [
17742
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: "ss-w-pd-tile-label", children: label }),
17743
+ /* @__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
17744
  ] });
17639
17745
  }
17640
17746
  function AvailabilityCard({ ui, next, availability }) {
@@ -17650,12 +17756,12 @@ function AvailabilityCard({ ui, next, availability }) {
17650
17756
  pill = availability.status === "injured" ? { text: ui.availabilityInjured, tone: "neg" } : availability.status === "suspended" ? { text: ui.availabilitySuspended, tone: "warn" } : { text: ui.availabilityUnavailable, tone: "warn" };
17651
17757
  }
17652
17758
  }
17653
- return /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { className: "ss-w-pd-card ss-w-pd-avail", children: [
17654
- /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { className: "ss-w-pd-avail-text", children: [
17655
- next !== null && /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "ss-w-pd-avail-next", children: ui.availabilityNext(next.opponentName, next.isHome, validMs(next.kickoffUnixMs)) }),
17656
- note !== null && /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "ss-w-pd-avail-note", children: note })
17759
+ return /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("div", { className: "ss-w-pd-card ss-w-pd-avail", children: [
17760
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("div", { className: "ss-w-pd-avail-text", children: [
17761
+ 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)) }),
17762
+ note !== null && /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: "ss-w-pd-avail-note", children: note })
17657
17763
  ] }),
17658
- pill !== null && /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: `ss-w-pd-pill ss-w-pd-pill--${pill.tone}`, children: pill.text })
17764
+ pill !== null && /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: `ss-w-pd-pill ss-w-pd-pill--${pill.tone}`, children: pill.text })
17659
17765
  ] });
17660
17766
  }
17661
17767
  function MatchRow({ ui, row }) {
@@ -17669,28 +17775,28 @@ function MatchRow({ ui, row }) {
17669
17775
  const sub = [`${ui.resultLetter[row.result]} ${row.goalsFor}\u2013${row.goalsAgainst}`, `${row.minutes}\u2032`, ...extras].join(" \xB7 ");
17670
17776
  const rating = typeof row.rating === "number" && Number.isFinite(row.rating) ? Math.round(row.rating * 10) / 10 : null;
17671
17777
  const pillTone = row.result === "W" ? "pos" : row.result === "L" ? "neg" : "draw";
17672
- return /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { className: "ss-w-pd-match", children: [
17673
- /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "ss-w-pd-match-date", children: date === null ? "" : ui.logShortDate(date) }),
17674
- /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { className: "ss-w-pd-match-main", children: [
17675
- /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "ss-w-pd-match-opp", children: ui.matchLogOpponent(row.opponentName, row.isHome) }),
17676
- /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "ss-w-pd-match-sub", children: sub })
17778
+ return /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("div", { className: "ss-w-pd-match", children: [
17779
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: "ss-w-pd-match-date", children: date === null ? "" : ui.logShortDate(date) }),
17780
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("div", { className: "ss-w-pd-match-main", children: [
17781
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: "ss-w-pd-match-opp", children: ui.matchLogOpponent(row.opponentName, row.isHome) }),
17782
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: "ss-w-pd-match-sub", children: sub })
17677
17783
  ] }),
17678
- /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: `ss-w-pd-pill ss-w-pd-pill--${pillTone}`, children: ui.resultLetter[row.result] }),
17679
- rating === null ? /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "ss-w-pd-chip-empty" }) : /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: `ss-w-pd-chip ss-w-pd-chip--${ratingTone(rating)}`, children: formatFixed(rating, ui.locale, 1) })
17784
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: `ss-w-pd-pill ss-w-pd-pill--${pillTone}`, children: ui.resultLetter[row.result] }),
17785
+ 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
17786
  ] });
17681
17787
  }
17682
17788
  function PlayerDetail({ detail, loading, ui, seasonName, onClose }) {
17683
- const back = /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("button", { type: "button", className: "ss-w-pd-back", onClick: onClose, children: [
17684
- /* @__PURE__ */ (0, import_jsx_runtime147.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_runtime147.jsx)("path", { d: "M15 18l-6-6 6-6" }) }),
17789
+ const back = /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("button", { type: "button", className: "ss-w-pd-back", onClick: onClose, children: [
17790
+ /* @__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
17791
  ui.clubPlayerBack
17686
17792
  ] });
17687
17793
  if (detail === null) {
17688
- return loading ? /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)(import_jsx_runtime147.Fragment, { children: [
17689
- /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "ss-w-pd-bar", children: back }),
17690
- /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "ss-w-mon-list" })
17691
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)(import_jsx_runtime147.Fragment, { children: [
17692
- /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "ss-w-pd-bar", children: back }),
17693
- /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "ss-w-mon-empty", children: ui.clubPlayerDetailEmpty })
17794
+ return loading ? /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)(import_jsx_runtime149.Fragment, { children: [
17795
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: "ss-w-pd-bar", children: back }),
17796
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: "ss-w-mon-list" })
17797
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)(import_jsx_runtime149.Fragment, { children: [
17798
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: "ss-w-pd-bar", children: back }),
17799
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: "ss-w-mon-empty", children: ui.clubPlayerDetailEmpty })
17694
17800
  ] });
17695
17801
  }
17696
17802
  const s = detail.seasonStats;
@@ -17703,163 +17809,74 @@ function PlayerDetail({ detail, loading, ui, seasonName, onClose }) {
17703
17809
  const next = detail.nextFixture ?? null;
17704
17810
  const availability = detail.availability ?? null;
17705
17811
  const log = detail.matchLog ?? [];
17706
- return /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)(import_jsx_runtime147.Fragment, { children: [
17707
- /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "ss-w-pd-bar", children: back }),
17708
- /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { className: "ss-w-mon-list ss-w-pd-list", children: [
17709
- /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { className: "ss-w-pd-card ss-w-pd-profile", children: [
17710
- /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(PlayerPhoto, { photoUrl: detail.photoUrl, jerseyNumber: detail.jerseyNumber, size: 52 }, detail.photoUrl ?? ""),
17711
- /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { className: "ss-w-pd-profile-main", children: [
17712
- /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "ss-w-pd-name", children: detail.playerName }),
17713
- subLine !== "" && /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "ss-w-pd-sub", children: subLine }),
17714
- /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { className: "ss-w-pd-bio", children: [
17715
- /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(Bio, { label: ui.detailAge, value: ageFrom(detail.dateOfBirthUnixMs) }),
17716
- /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(Bio, { label: ui.detailHeight, value: detail.heightCm === null ? DASH : `${detail.heightCm} cm` }),
17717
- foot !== null && /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(Bio, { label: ui.detailFoot, value: foot }),
17718
- /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(Bio, { label: ui.detailNatShort, value: detail.nationality ?? DASH })
17812
+ return /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)(import_jsx_runtime149.Fragment, { children: [
17813
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: "ss-w-pd-bar", children: back }),
17814
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("div", { className: "ss-w-mon-list ss-w-pd-list", children: [
17815
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("div", { className: "ss-w-pd-card ss-w-pd-profile", children: [
17816
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(PlayerPhoto, { photoUrl: detail.photoUrl, jerseyNumber: detail.jerseyNumber, size: 52 }, detail.photoUrl ?? ""),
17817
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("div", { className: "ss-w-pd-profile-main", children: [
17818
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: "ss-w-pd-name", children: detail.playerName }),
17819
+ subLine !== "" && /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: "ss-w-pd-sub", children: subLine }),
17820
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("div", { className: "ss-w-pd-bio", children: [
17821
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(Bio, { label: ui.detailAge, value: ageFrom(detail.dateOfBirthUnixMs) }),
17822
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(Bio, { label: ui.detailHeight, value: detail.heightCm === null ? DASH : `${detail.heightCm} cm` }),
17823
+ foot !== null && /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(Bio, { label: ui.detailFoot, value: foot }),
17824
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(Bio, { label: ui.detailNatShort, value: detail.nationality ?? DASH })
17719
17825
  ] })
17720
17826
  ] }),
17721
- /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(MiniPitch, { positionCode: detail.positionCode })
17827
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(MiniPitch, { positionCode: detail.positionCode })
17722
17828
  ] }),
17723
- (next !== null || availability !== null) && /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(AvailabilityCard, { ui, next, availability }),
17724
- /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { children: [
17725
- eyebrow !== null && /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "ss-w-pd-eyebrow ss-w-pd-eyebrow--block", children: eyebrow }),
17726
- /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { className: "ss-w-pd-tiles", children: [
17727
- /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(Tile, { label: ui.statColGoals, value: String(s.goals) }),
17728
- /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(Tile, { label: ui.statColAssists, value: String(s.assists) }),
17729
- typeof s.starts === "number" && /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(Tile, { label: ui.detailStarted, value: String(s.starts) }),
17730
- /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(Tile, { label: ui.detailMatches, value: String(s.appearances) }),
17731
- /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(Tile, { label: ui.statColMinutes, value: String(s.minutesPlayed) }),
17732
- rating !== null && /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(Tile, { label: ui.statColRating, value: formatFixed(rating, ui.locale, 2), pos: Math.round(rating * 100) / 100 >= 7 }),
17733
- /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(Tile, { label: ui.detailYellows, value: String(s.yellowCards) }),
17734
- /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(Tile, { label: ui.detailReds, value: String(s.redCards) })
17829
+ (next !== null || availability !== null) && /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(AvailabilityCard, { ui, next, availability }),
17830
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("div", { children: [
17831
+ eyebrow !== null && /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: "ss-w-pd-eyebrow ss-w-pd-eyebrow--block", children: eyebrow }),
17832
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("div", { className: "ss-w-pd-tiles", children: [
17833
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(Tile, { label: ui.statColGoals, value: String(s.goals) }),
17834
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(Tile, { label: ui.statColAssists, value: String(s.assists) }),
17835
+ typeof s.starts === "number" && /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(Tile, { label: ui.detailStarted, value: String(s.starts) }),
17836
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(Tile, { label: ui.detailMatches, value: String(s.appearances) }),
17837
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(Tile, { label: ui.statColMinutes, value: String(s.minutesPlayed) }),
17838
+ 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 }),
17839
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(Tile, { label: ui.detailYellows, value: String(s.yellowCards) }),
17840
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(Tile, { label: ui.detailReds, value: String(s.redCards) })
17735
17841
  ] })
17736
17842
  ] }),
17737
- detail.performance != null && /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(PerformanceBars, { performance: detail.performance, competitionName: competition, strings: ui }),
17738
- log.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { children: [
17739
- /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "ss-w-pd-eyebrow ss-w-pd-eyebrow--block", children: ui.matchLogTitle }),
17740
- /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "ss-w-pd-card ss-w-pd-log", children: log.map((row) => /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(MatchRow, { ui, row }, row.matchId)) })
17843
+ detail.performance != null && /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(PerformanceBars, { performance: detail.performance, competitionName: competition, strings: ui }),
17844
+ log.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("div", { children: [
17845
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: "ss-w-pd-eyebrow ss-w-pd-eyebrow--block", children: ui.matchLogTitle }),
17846
+ /* @__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
17847
  ] })
17742
17848
  ] })
17743
17849
  ] });
17744
17850
  }
17745
17851
 
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
17852
  // src/components/SettingsSheet.tsx
17836
- var import_jsx_runtime149 = require("react/jsx-runtime");
17853
+ var import_jsx_runtime150 = require("react/jsx-runtime");
17837
17854
  var SAMPLE = { decimal: "2.50", american: "+150", fractional: "3/2" };
17838
17855
  var ODDS = ["decimal", "fractional", "american"];
17839
17856
  var THEMES2 = ["light", "dark", "auto"];
17840
17857
  function SettingsSheet({ ui, onClose }) {
17841
17858
  const s = useOddsSettings();
17842
17859
  const t = ui.settings;
17843
- return /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)(
17860
+ return /* @__PURE__ */ (0, import_jsx_runtime150.jsxs)(
17844
17861
  PresetToolModal,
17845
17862
  {
17846
17863
  title: t.title,
17847
17864
  closeLabel: t.close,
17848
17865
  onClose,
17849
17866
  className: "ss-w-set-backdrop-in",
17850
- footer: /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("p", { className: "ss-w-set-foot", children: t.foot }),
17867
+ footer: /* @__PURE__ */ (0, import_jsx_runtime150.jsx)("p", { className: "ss-w-set-foot", children: t.foot }),
17851
17868
  children: [
17852
- s.oddsOffered && /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("div", { className: "ss-w-set-row", children: [
17853
- /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: "ss-w-tool-label", id: "ss-w-set-odds", children: t.oddsLabel }),
17854
- /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("div", { className: "ss-w-set-sample", children: [
17855
- /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("span", { children: t.sampleLabel }),
17856
- /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("b", { children: formatOdds(SAMPLE, s.oddsFormat) })
17869
+ s.oddsOffered && /* @__PURE__ */ (0, import_jsx_runtime150.jsxs)("div", { className: "ss-w-set-row", children: [
17870
+ /* @__PURE__ */ (0, import_jsx_runtime150.jsx)("div", { className: "ss-w-tool-label", id: "ss-w-set-odds", children: t.oddsLabel }),
17871
+ /* @__PURE__ */ (0, import_jsx_runtime150.jsxs)("div", { className: "ss-w-set-sample", children: [
17872
+ /* @__PURE__ */ (0, import_jsx_runtime150.jsx)("span", { children: t.sampleLabel }),
17873
+ /* @__PURE__ */ (0, import_jsx_runtime150.jsx)("b", { children: formatOdds(SAMPLE, s.oddsFormat) })
17857
17874
  ] }),
17858
- /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: "ss-w-set-seg", role: "group", "aria-labelledby": "ss-w-set-odds", children: ODDS.map((f) => /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("button", { type: "button", "aria-pressed": s.oddsFormat === f, onClick: () => s.setOddsFormat(f), children: t[f] }, f)) })
17875
+ /* @__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
17876
  ] }),
17860
- !s.themeLocked && /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("div", { className: "ss-w-set-row", children: [
17861
- /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: "ss-w-tool-label", id: "ss-w-set-theme", children: t.themeLabel }),
17862
- /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: "ss-w-set-seg", role: "group", "aria-labelledby": "ss-w-set-theme", children: THEMES2.map((m) => /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("button", { type: "button", "aria-pressed": s.theme === m, onClick: () => s.setTheme(m), children: t[m] }, m)) })
17877
+ !s.themeLocked && /* @__PURE__ */ (0, import_jsx_runtime150.jsxs)("div", { className: "ss-w-set-row", children: [
17878
+ /* @__PURE__ */ (0, import_jsx_runtime150.jsx)("div", { className: "ss-w-tool-label", id: "ss-w-set-theme", children: t.themeLabel }),
17879
+ /* @__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
17880
  ] })
17864
17881
  ]
17865
17882
  }
@@ -17867,7 +17884,7 @@ function SettingsSheet({ ui, onClose }) {
17867
17884
  }
17868
17885
 
17869
17886
  // src/components/ChatPanel.tsx
17870
- var import_jsx_runtime150 = require("react/jsx-runtime");
17887
+ var import_jsx_runtime151 = require("react/jsx-runtime");
17871
17888
  var FULLSCREEN_QUERY = "(max-width: 639px)";
17872
17889
  function useIsModal() {
17873
17890
  const [modal, setModal] = (0, import_react104.useState)(false);
@@ -17918,9 +17935,13 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, s
17918
17935
  setSelectedPlayerId(null);
17919
17936
  clearPlayerDetail?.();
17920
17937
  }, [activeTab, selectedPlayerId, clearPlayerDetail]);
17938
+ const favouritesOffered = !!monitor && (favouritesEnabled ?? false) && !!favourites;
17939
+ const favouritesOpen = favouritesOffered && (favourites?.open ?? false);
17940
+ const favouritesAskedOpen = favourites?.open ?? false;
17941
+ const setFavouritesOpen = favourites?.onOpenChange;
17921
17942
  (0, import_react104.useEffect)(() => {
17922
- if (activeTab === "favourites" && !favouritesEnabled) setMonitorTab?.("chat");
17923
- }, [activeTab, favouritesEnabled, setMonitorTab]);
17943
+ if (favouritesAskedOpen && !favouritesOffered) setFavouritesOpen?.(false);
17944
+ }, [favouritesAskedOpen, favouritesOffered, setFavouritesOpen]);
17924
17945
  const storedTab = tabState?.activeTab;
17925
17946
  (0, import_react104.useEffect)(() => {
17926
17947
  const unreachable = storedTab === "builder" ? !hasBuilder : !monitor && storedTab !== void 0 && storedTab !== "chat";
@@ -17967,12 +17988,23 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, s
17967
17988
  const hasSettings = settings.oddsOffered || !settings.themeLocked;
17968
17989
  const openSettings = (0, import_react104.useCallback)(() => {
17969
17990
  setTool(null);
17991
+ setFavouritesOpen?.(false);
17970
17992
  setSettingsOpen(true);
17971
- }, []);
17993
+ }, [setFavouritesOpen]);
17972
17994
  const closeSettings = (0, import_react104.useCallback)(() => {
17973
17995
  setSettingsOpen(false);
17974
17996
  panelRef.current?.querySelector(".ss-w-kebab")?.focus();
17975
17997
  }, []);
17998
+ const openFavourites = (0, import_react104.useCallback)(() => setFavouritesOpen?.(true), [setFavouritesOpen]);
17999
+ const closeFavourites = (0, import_react104.useCallback)(() => {
18000
+ setFavouritesOpen?.(false);
18001
+ panelRef.current?.querySelector(".ss-w-kebab")?.focus();
18002
+ }, [setFavouritesOpen]);
18003
+ (0, import_react104.useEffect)(() => {
18004
+ if (!favouritesOpen) return;
18005
+ setTool(null);
18006
+ setSettingsOpen(false);
18007
+ }, [favouritesOpen]);
17976
18008
  const paused = isPaused(state.limit);
17977
18009
  (0, import_react104.useEffect)(() => {
17978
18010
  if (paused) setTool(null);
@@ -18016,6 +18048,10 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, s
18016
18048
  }, [tool, onChatTab, presetGrid]);
18017
18049
  const backRef = (0, import_react104.useRef)(() => false);
18018
18050
  backRef.current = () => {
18051
+ if (favouritesOpen) {
18052
+ closeFavourites();
18053
+ return true;
18054
+ }
18019
18055
  if (settingsOpen && hasSettings) {
18020
18056
  closeSettings();
18021
18057
  return true;
@@ -18039,8 +18075,8 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, s
18039
18075
  onRegisterBack(() => backRef.current());
18040
18076
  return () => onRegisterBack(null);
18041
18077
  }, [onRegisterBack]);
18042
- return /* @__PURE__ */ (0, import_jsx_runtime150.jsxs)("div", { ref: panelRef, className: "ss-w-panel", role: "dialog", "aria-modal": isModal, "aria-label": ui.chatDialogLabel, children: [
18043
- /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
18078
+ return /* @__PURE__ */ (0, import_jsx_runtime151.jsxs)("div", { ref: panelRef, className: "ss-w-panel", role: "dialog", "aria-modal": isModal, "aria-label": ui.chatDialogLabel, children: [
18079
+ /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
18044
18080
  ChatHeader,
18045
18081
  {
18046
18082
  onClose: () => closeWith("button"),
@@ -18052,10 +18088,12 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, s
18052
18088
  newConversationLabel: ui.newConversation,
18053
18089
  moreOptionsLabel: ui.moreOptions,
18054
18090
  onOpenSettings: hasSettings ? openSettings : void 0,
18055
- settingsLabel: ui.settings.title
18091
+ settingsLabel: ui.settings.title,
18092
+ onOpenFavourites: favouritesOffered ? openFavourites : void 0,
18093
+ favouritesLabel: ui.tabFavourites
18056
18094
  }
18057
18095
  ),
18058
- tabs && /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
18096
+ tabs && /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
18059
18097
  TabBar,
18060
18098
  {
18061
18099
  monitor: tabs,
@@ -18066,15 +18104,14 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, s
18066
18104
  hasSchedule: !!monitor && !!discovery && !!schedule,
18067
18105
  hasBuilder,
18068
18106
  gamesEnabled: !!monitor && (gamesResult?.enabled ?? false),
18069
- clubEnabled: clubFixturesResult?.enabled ?? false,
18070
- favouritesEnabled: !!monitor && (favouritesEnabled ?? false)
18107
+ clubEnabled: clubFixturesResult?.enabled ?? false
18071
18108
  }
18072
18109
  ),
18073
- /* @__PURE__ */ (0, import_jsx_runtime150.jsxs)("div", { className: "ss-w-chat-layer", style: onChatTab ? void 0 : HIDDEN_LAYER_STYLE, children: [
18074
- /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(PresetToolsContext.Provider, { value: toolsValue, children: /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(MessageList, { controller, ui, slip, onDashboardTap, monitor, onGreetingSport: favourites?.onSportChange }) }),
18075
- tool && presetGrid && onChatTab && !paused ? /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(BuildComboTool, { grid: presetGrid, strings: ui.presets, streaming: state.isStreaming, formatKickoff, initialTotal: tool.total, initialLegs: tool.legs, onSend: sendAsk, onClose: closeTool }) : null
18110
+ /* @__PURE__ */ (0, import_jsx_runtime151.jsxs)("div", { className: "ss-w-chat-layer", style: onChatTab ? void 0 : HIDDEN_LAYER_STYLE, children: [
18111
+ /* @__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 }) }),
18112
+ 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
18113
  ] }),
18077
- monitor && discovery && schedule && monitor.activeTab === "live" && /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
18114
+ monitor && discovery && schedule && monitor.activeTab === "live" && /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
18078
18115
  LivePanel,
18079
18116
  {
18080
18117
  discovery,
@@ -18092,7 +18129,7 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, s
18092
18129
  }
18093
18130
  }
18094
18131
  ),
18095
- monitor && discovery && schedule && monitor.activeTab === "matches" && /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
18132
+ monitor && discovery && schedule && monitor.activeTab === "matches" && /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
18096
18133
  ScheduleMatchesPanel,
18097
18134
  {
18098
18135
  discovery,
@@ -18114,19 +18151,19 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, s
18114
18151
  }
18115
18152
  }
18116
18153
  ),
18117
- tabs && tabs.activeTab === "builder" && hasBuilder && builder && /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(BuilderPanel, { options: builder.options, sport: builder.sport, onSportChange: builder.onSportChange, ui, slip, onCoolOff: builder.onCoolOff }),
18118
- monitor && monitor.activeTab === "following" && /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(MatchesPanel, { monitor, ui, slip, onAsk: paused ? void 0 : handleAsk, discovery }),
18119
- monitor && monitor.activeTab === "trends" && /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(TrendsPanel, { monitor, ui, slip }),
18120
- monitor && monitor.activeTab === "fixtures" && /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(Fixtures, { fixtures: clubFixturesResult?.fixtures ?? [], loading: clubFixturesResult?.loading ?? false, ui }),
18121
- monitor && monitor.activeTab === "standings" && /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(Standings, { standings: clubStandingsResult?.data ?? null, loading: clubStandingsResult?.loading ?? false, ui }),
18122
- monitor && monitor.activeTab === "squad" && /* @__PURE__ */ (0, import_jsx_runtime150.jsxs)(import_jsx_runtime150.Fragment, { children: [
18123
- /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
18154
+ 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 }),
18155
+ monitor && monitor.activeTab === "following" && /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(MatchesPanel, { monitor, ui, slip, onAsk: paused ? void 0 : handleAsk, discovery }),
18156
+ monitor && monitor.activeTab === "trends" && /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(TrendsPanel, { monitor, ui, slip }),
18157
+ monitor && monitor.activeTab === "fixtures" && /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(Fixtures, { fixtures: clubFixturesResult?.fixtures ?? [], loading: clubFixturesResult?.loading ?? false, ui }),
18158
+ monitor && monitor.activeTab === "standings" && /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(Standings, { standings: clubStandingsResult?.data ?? null, loading: clubStandingsResult?.loading ?? false, ui }),
18159
+ monitor && monitor.activeTab === "squad" && /* @__PURE__ */ (0, import_jsx_runtime151.jsxs)(import_jsx_runtime151.Fragment, { children: [
18160
+ /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
18124
18161
  "div",
18125
18162
  {
18126
18163
  ref: squadLayerRef,
18127
18164
  style: selectedPlayerId === null ? SQUAD_LAYER_STYLE : HIDDEN_LAYER_STYLE,
18128
18165
  "aria-hidden": selectedPlayerId !== null ? true : void 0,
18129
- children: /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
18166
+ children: /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
18130
18167
  Squad,
18131
18168
  {
18132
18169
  squad: clubSquadResult?.data ?? null,
@@ -18144,9 +18181,9 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, s
18144
18181
  )
18145
18182
  }
18146
18183
  ),
18147
- selectedPlayerId !== null && /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(PlayerDetail, { detail: clubPlayerDetailResult?.data ?? null, loading: clubPlayerDetailResult?.loading ?? false, ui, seasonName: clubSquadStatsResult?.seasonName ?? null, onClose: closePlayer })
18184
+ 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
18185
  ] }),
18149
- monitor && monitor.activeTab === "games" && gamesResult && /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
18186
+ monitor && monitor.activeTab === "games" && gamesResult && /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
18150
18187
  GamesPanel,
18151
18188
  {
18152
18189
  loggedIn: !!loggedIn,
@@ -18161,10 +18198,9 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, s
18161
18198
  }
18162
18199
  }
18163
18200
  ),
18164
- monitor && monitor.activeTab === "favourites" && favouritesEnabled && favourites && /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(FavouritesPanel, { controller: favourites.controller, ui, sport: favourites.sport, sports: favourites.sports, onSportChange: favourites.onSportChange }),
18165
- (!tabs || tabs.activeTab !== "games" && tabs.activeTab !== "favourites" && tabs.activeTab !== "builder") && /* @__PURE__ */ (0, import_jsx_runtime150.jsxs)(import_jsx_runtime150.Fragment, { children: [
18166
- /* @__PURE__ */ (0, import_jsx_runtime150.jsx)("div", { ref: limitRef, className: "ss-w-limit", role: "status", tabIndex: -1, children: state.limit ? limitText(state.limit, ui) : null }),
18167
- paused ? null : /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
18201
+ (!tabs || tabs.activeTab !== "games" && tabs.activeTab !== "builder") && /* @__PURE__ */ (0, import_jsx_runtime151.jsxs)(import_jsx_runtime151.Fragment, { children: [
18202
+ /* @__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 }),
18203
+ paused ? null : /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
18168
18204
  ChatInput,
18169
18205
  {
18170
18206
  ref: inputRef,
@@ -18178,14 +18214,15 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, s
18178
18214
  }
18179
18215
  )
18180
18216
  ] }),
18181
- settingsOpen && hasSettings ? /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(SettingsSheet, { ui, onClose: closeSettings }) : null
18217
+ settingsOpen && hasSettings ? /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(SettingsSheet, { ui, onClose: closeSettings }) : null,
18218
+ 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
18219
  ] });
18183
18220
  }
18184
18221
 
18185
18222
  // src/components/HostEventsProvider.tsx
18186
- var import_jsx_runtime151 = require("react/jsx-runtime");
18223
+ var import_jsx_runtime152 = require("react/jsx-runtime");
18187
18224
  function HostEventsProvider({ value, children }) {
18188
- return /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(SlipStateContext.Provider, { value: value.slipState, children });
18225
+ return /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(SlipStateContext.Provider, { value: value.slipState, children });
18189
18226
  }
18190
18227
 
18191
18228
  // src/styles/css.generated.ts
@@ -19524,9 +19561,6 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
19524
19561
  /* 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
19562
  .ss-w-tab { position: relative; }
19526
19563
  .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
19564
  .ss-w-sportchips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 3px; }
19531
19565
  .ss-w-sportchips::-webkit-scrollbar { display: none; }
19532
19566
  .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 +19753,9 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
19719
19753
  }
19720
19754
  .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
19755
  .ss-w-lg-showall:focus-visible { outline: 2px solid var(--ss-w-accent); outline-offset: -2px; }
19722
- .ss-w-fav { gap: 14px; }
19756
+ /* 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. */
19757
+ .ss-w-fav-sheet > .ss-w-tool { height: 85%; }
19758
+ .ss-w-fav { display: flex; flex-direction: column; gap: 14px; }
19723
19759
  .ss-w-fav-saved { margin: 0; display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ss-w-faint); }
19724
19760
  .ss-w-fav-saved::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ss-w-accent); flex: none; }
19725
19761
  .ss-w-fav-saved--browser::before { background: var(--ss-w-warn); }
@@ -20984,7 +21020,7 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
20984
21020
  `;
20985
21021
 
20986
21022
  // src/StatsWidget.tsx
20987
- var import_jsx_runtime152 = require("react/jsx-runtime");
21023
+ var import_jsx_runtime153 = require("react/jsx-runtime");
20988
21024
  function buildClient(props) {
20989
21025
  try {
20990
21026
  if ("client" in props && props.client) {
@@ -21207,6 +21243,8 @@ function StatsWidget(props) {
21207
21243
  onChanged: discovery.refreshSchedule
21208
21244
  });
21209
21245
  const favouritesEnabled = hasFavouritesIdentity && favourites.status !== "refused";
21246
+ const [favouritesOpen, setFavouritesOpen] = (0, import_react105.useState)(false);
21247
+ if (!panelOpen && favouritesOpen) setFavouritesOpen(false);
21210
21248
  const getPricePresets = (0, import_react105.useCallback)(
21211
21249
  (locale) => built ? built.conversation.getPricePresets(locale, { pool: "open" }) : Promise.resolve(null),
21212
21250
  [built]
@@ -21329,17 +21367,17 @@ function StatsWidget(props) {
21329
21367
  const personalGreeting = (0, import_react105.useMemo)(() => ({
21330
21368
  favourites: favouritesEnabled && monitor.enabled ? favourites : null,
21331
21369
  conversation: built?.conversation ?? null,
21332
- openFavourites: () => monitor.setActiveTab("favourites"),
21333
- // Not before the club probe has answered: a club brand has no Favourites tab, and the invite must not appear and then go.
21334
- favouritesTab: favouritesEnabled && monitor.enabled && clubFixturesResult.settled && !clubFixturesResult.enabled,
21335
- // The tab is drawn, so a link to it opens it: the probe is out for at most CLUB_TAB_WAIT_MS before the tab shows.
21370
+ openFavourites: () => setFavouritesOpen(true),
21371
+ // Not before the club probe has answered: a club brand has no Favourites sheet, and the invite must not appear and then go.
21372
+ favouritesOffered: favouritesEnabled && monitor.enabled && clubFixturesResult.settled && !clubFixturesResult.enabled,
21373
+ // 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
21374
  favouritesReady: favouritesEnabled && monitor.enabled && clubFixturesResult.tabReady && !clubFixturesResult.enabled,
21337
21375
  holds,
21338
21376
  memory: builderMemory
21339
- }), [favouritesEnabled, monitor.enabled, clubFixturesResult.settled, clubFixturesResult.tabReady, clubFixturesResult.enabled, monitor.setActiveTab, favourites, built, holds, builderMemory]);
21377
+ }), [favouritesEnabled, monitor.enabled, clubFixturesResult.settled, clubFixturesResult.tabReady, clubFixturesResult.enabled, favourites, built, holds, builderMemory]);
21340
21378
  if (!built || widgetStrings.state === "unavailable") return null;
21341
21379
  const attrs = themeAttrs(ui, oddsSettings.userTheme);
21342
- return /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(EventLogContext.Provider, { value: logger, children: /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(TrackingContext.Provider, { value: track, children: /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(SportScopeContext.Provider, { value: sportScope, children: /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(OddsSettingsContext.Provider, { value: oddsSettings, children: /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(HostEventsProvider, { value: hostEvents, children: /* @__PURE__ */ (0, import_jsx_runtime152.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_runtime152.jsx)(PersonalGreetingContext.Provider, { value: personalGreeting, children: /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(
21380
+ 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
21381
  ChatPanel,
21344
21382
  {
21345
21383
  controller,
@@ -21370,12 +21408,12 @@ function StatsWidget(props) {
21370
21408
  conversation: built?.conversation ?? null,
21371
21409
  presetGrid,
21372
21410
  favouritesEnabled: favouritesEnabled && clubFixturesResult.tabReady && !clubFixturesResult.enabled,
21373
- favourites: { controller: favourites, sport: favSport, sports: favSports, onSportChange: setFavSportPick },
21411
+ favourites: { controller: favourites, sport: favSport, sports: favSports, onSportChange: setFavSportPick, open: favouritesOpen, onOpenChange: setFavouritesOpen },
21374
21412
  builder: { options: builderOptions, sport: builderSport, onSportChange: setBuilderSportPick, onCoolOff: onBuilderCoolOff, tabs: monitor },
21375
21413
  onCloseRequested: mobile.onCloseRequested,
21376
21414
  onRegisterBack: mobile.onRegisterBack
21377
21415
  }
21378
- ) }) : props.mobile ? null : /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(
21416
+ ) }) : props.mobile ? null : /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(
21379
21417
  ChatFab,
21380
21418
  {
21381
21419
  label: stringsPending ? cfg?.launcherLabel : ui.launcherLabel,