@sensiblestats/widget-react 0.128.1 → 0.130.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
@@ -935,19 +935,69 @@ var formatTime = (when, tag2, clock3, opts) => formatDate(when, tag2, { ...clock
935
935
  var clockOf = (ui) => ui.clock ?? "24h";
936
936
  var formatFixed = (n, tag2, digits) => formatNumber(n, tag2, { minimumFractionDigits: digits, maximumFractionDigits: digits });
937
937
 
938
+ // src/zone.ts
939
+ var DAY_MS = 864e5;
940
+ var formatters = /* @__PURE__ */ new Map();
941
+ var formatterFor = (timeZone) => {
942
+ let f = formatters.get(timeZone);
943
+ if (!f) {
944
+ f = new Intl.DateTimeFormat(BUNDLED_TAG, {
945
+ timeZone,
946
+ year: "numeric",
947
+ month: "2-digit",
948
+ day: "2-digit",
949
+ hour: "2-digit",
950
+ minute: "2-digit",
951
+ second: "2-digit",
952
+ hourCycle: "h23"
953
+ });
954
+ formatters.set(timeZone, f);
955
+ }
956
+ return f;
957
+ };
958
+ function validZone(timeZone) {
959
+ if (typeof timeZone !== "string" || timeZone.trim() === "") return void 0;
960
+ const zone = timeZone.trim();
961
+ try {
962
+ new Intl.DateTimeFormat("en", { timeZone: zone });
963
+ return zone;
964
+ } catch {
965
+ return void 0;
966
+ }
967
+ }
968
+ function zonedParts(ms, timeZone) {
969
+ const out = { year: NaN, month: NaN, day: NaN, hour: NaN, minute: NaN, second: NaN };
970
+ if (Number.isNaN(ms)) return out;
971
+ if (timeZone === void 0) {
972
+ const d = new Date(ms);
973
+ return { year: d.getFullYear(), month: d.getMonth() + 1, day: d.getDate(), hour: d.getHours(), minute: d.getMinutes(), second: d.getSeconds() };
974
+ }
975
+ for (const p of formatterFor(timeZone).formatToParts(ms)) {
976
+ if (p.type in out) out[p.type] = Number(p.value);
977
+ }
978
+ return out;
979
+ }
980
+ function zonedDayNumber(ms, timeZone) {
981
+ const p = zonedParts(ms, timeZone);
982
+ return Date.UTC(p.year, p.month - 1, p.day) / DAY_MS;
983
+ }
984
+ function zoneOffsetMinutes(ms, timeZone) {
985
+ const p = zonedParts(ms, timeZone);
986
+ const wall = Date.UTC(p.year, p.month - 1, p.day, p.hour, p.minute, p.second);
987
+ return Math.round((wall - Math.floor(ms / 1e3) * 1e3) / 6e4);
988
+ }
989
+
938
990
  // src/kickoff.ts
939
- function formatBettingKickoff(kickoffUtc, ui, tag2, clock3 = "24h", now = /* @__PURE__ */ new Date()) {
991
+ function formatBettingKickoff(kickoffUtc, ui, tag2, clock3 = "24h", now = /* @__PURE__ */ new Date(), timeZone) {
940
992
  const at2 = new Date(kickoffUtc);
941
- const time = formatTime(at2, tag2, clock3);
942
- const atLocalDate = new Date(at2.getFullYear(), at2.getMonth(), at2.getDate());
943
- const nowLocalDate = new Date(now.getFullYear(), now.getMonth(), now.getDate());
944
- const dayDiff = Math.round((atLocalDate.getTime() - nowLocalDate.getTime()) / 864e5);
945
- const dayLabel = dayDiff === 0 ? ui.today : dayDiff === 1 ? ui.tomorrow : formatDate(at2, tag2, { weekday: "short", day: "numeric", month: "short" });
993
+ const time = formatTime(at2, tag2, clock3, { timeZone });
994
+ const dayDiff = zonedDayNumber(at2.getTime(), timeZone) - zonedDayNumber(now.getTime(), timeZone);
995
+ const dayLabel = dayDiff === 0 ? ui.today : dayDiff === 1 ? ui.tomorrow : formatDate(at2, tag2, { weekday: "short", day: "numeric", month: "short", timeZone });
946
996
  return { dayLabel, time };
947
997
  }
948
998
 
949
999
  // src/nbaFormDay.ts
950
- var DAY_MS = 864e5;
1000
+ var DAY_MS2 = 864e5;
951
1001
  var ISO_DATE = /^\d{4}-\d{2}-\d{2}$/;
952
1002
  function utcMs(etDate) {
953
1003
  if (!ISO_DATE.test(etDate)) return null;
@@ -959,7 +1009,7 @@ function formDay(etDate, anchorEtDate, tag2) {
959
1009
  const at2 = utcMs(etDate);
960
1010
  if (at2 === null) return etDate;
961
1011
  const anchor = utcMs(anchorEtDate);
962
- const days = anchor === null ? Infinity : Math.abs(Math.round((at2 - anchor) / DAY_MS));
1012
+ const days = anchor === null ? Infinity : Math.abs(Math.round((at2 - anchor) / DAY_MS2));
963
1013
  const options = days <= 6 ? { weekday: "short", timeZone: "UTC" } : { day: "numeric", month: "short", timeZone: "UTC" };
964
1014
  return formatDate(at2, tag2, options);
965
1015
  }
@@ -1015,13 +1065,13 @@ var shortDate = (tag2, ms, opts) => nbsp(formatDate(ms, tag2, opts).replace("Sep
1015
1065
  var signed = (line) => line.replace(/^-/, "\u2212");
1016
1066
  var decimalMark = (tag2) => new Intl.NumberFormat(tag2).formatToParts(1.1).find((p) => p.type === "decimal")?.value ?? ".";
1017
1067
  var INTL_LEAVES = {
1018
- chartTimeLabel: (c) => (ms) => formatDate(ms, c.tag, { day: "numeric", month: "short", ...clockFields(c.clock) }),
1019
- logShortDate: (c) => (ms) => shortDate(c.tag, ms, { day: "numeric", month: "short" }),
1068
+ chartTimeLabel: (c) => (ms) => formatDate(ms, c.tag, { day: "numeric", month: "short", ...clockFields(c.clock), timeZone: c.timeZone }),
1069
+ logShortDate: (c) => (ms) => shortDate(c.tag, ms, { day: "numeric", month: "short", timeZone: c.timeZone }),
1020
1070
  "games.formatPts": (c) => (n) => formatNumber(n, c.tag),
1021
- "games.formatDayTime": (c) => (iso) => formatDate(iso, c.tag, { weekday: "short", ...clockFields(c.clock) }),
1071
+ "games.formatDayTime": (c) => (iso) => formatDate(iso, c.tag, { weekday: "short", ...clockFields(c.clock), timeZone: c.timeZone }),
1022
1072
  "nba.lineText": (c) => (line) => signed(line).replace(".", decimalMark(c.tag)),
1023
1073
  "nba.formDay": (c) => (etDate, anchorEtDate) => formDay(etDate, anchorEtDate, c.tag),
1024
- bettingKickoff: (c) => (kickoffUtc, now) => formatBettingKickoff(kickoffUtc, { today: c.t("widget.today"), tomorrow: c.t("widget.tomorrow") }, c.tag, c.clock, now),
1074
+ bettingKickoff: (c) => (kickoffUtc, now) => formatBettingKickoff(kickoffUtc, { today: c.t("widget.today"), tomorrow: c.t("widget.tomorrow") }, c.tag, c.clock, now, c.timeZone),
1025
1075
  v8FormResult: (c) => (result) => codeLabel(c.table, "result", result) ?? result
1026
1076
  };
1027
1077
  var pairs = (c, key, list) => list.map(([home, away]) => c.t(key, { home, away })).join(", ");
@@ -1054,7 +1104,7 @@ var ROW_LEAVES = {
1054
1104
  availabilityNext: (c) => (opponent, isHome, ms) => {
1055
1105
  const line = c.t(isHome ? "widget.availabilityNext.home" : "widget.availabilityNext.away", { opponent });
1056
1106
  if (ms === null || !(ms > 0)) return line;
1057
- return c.t("widget.availabilityNext.dated", { text: line, date: shortDate(c.tag, ms, { weekday: "short", day: "numeric", month: "short" }) });
1107
+ return c.t("widget.availabilityNext.dated", { text: line, date: shortDate(c.tag, ms, { weekday: "short", day: "numeric", month: "short", timeZone: c.timeZone }) });
1058
1108
  },
1059
1109
  availabilityBack: (c) => (ms) => c.t("widget.availabilityBack", { date: shortDate(c.tag, ms, { day: "numeric", month: "short" }) }),
1060
1110
  perfRankedAgainst: (c) => (competition, group) => c.t("widget.perfRankedAgainst", { competition, group: codeLabel(c.table, "groupNoun", group) ?? group }),
@@ -1225,7 +1275,7 @@ function setPath(root, path, value) {
1225
1275
  node[parts2[parts2.length - 1]] = value;
1226
1276
  }
1227
1277
  var ownedByLeaf = (key) => key.startsWith("widget.code.") || Object.keys(LEAVES).some((path) => key === `widget.${path}` || key.startsWith(`widget.${path}.`));
1228
- function buildLocaleStrings(table, tag2, clock3 = "24h") {
1278
+ function buildLocaleStrings(table, tag2, clock3 = "24h", timeZone) {
1229
1279
  const root = {};
1230
1280
  for (const [key, row] of Object.entries(table)) {
1231
1281
  if (key.startsWith("widget.") && typeof row === "string" && !ownedByLeaf(key)) setPath(root, key.slice("widget.".length), row);
@@ -1233,6 +1283,7 @@ function buildLocaleStrings(table, tag2, clock3 = "24h") {
1233
1283
  const ctx = {
1234
1284
  tag: tag2,
1235
1285
  clock: clock3,
1286
+ timeZone,
1236
1287
  table,
1237
1288
  t: (key, tokens = {}) => fill(table[key] ?? key, tokens, tag2)
1238
1289
  };
@@ -1244,6 +1295,21 @@ function buildLocaleStrings(table, tag2, clock3 = "24h") {
1244
1295
  }
1245
1296
 
1246
1297
  // src/odds.ts
1298
+ var DISPLAY_KEYS = ["home", "away", "kickoffUtc", "market", "marketLabel", "selection", "line", "player"];
1299
+ var DISPLAY_MAX = 80;
1300
+ function slipDisplay(parts2) {
1301
+ const out = {};
1302
+ for (const k of DISPLAY_KEYS) {
1303
+ const v = typeof parts2[k] === "string" ? parts2[k].trim() : "";
1304
+ if (!v || k === "kickoffUtc" && !Number.isFinite(Date.parse(v))) continue;
1305
+ out[k] = v.slice(0, DISPLAY_MAX);
1306
+ }
1307
+ return Object.keys(out).length > 0 ? out : void 0;
1308
+ }
1309
+ function withMatch(selection, match) {
1310
+ const display = slipDisplay({ home: match.home, away: match.away, kickoffUtc: match.kickoffUtc, marketLabel: match.marketLabel, player: match.player });
1311
+ return display ? { ...selection, display } : selection;
1312
+ }
1247
1313
  function formatOdds(forms, format2) {
1248
1314
  return (format2 === "american" ? forms.american : format2 === "fractional" ? forms.fractional : forms.decimal) ?? forms.decimal;
1249
1315
  }
@@ -1257,7 +1323,7 @@ function parseOddsFormat(value) {
1257
1323
  }
1258
1324
 
1259
1325
  // src/version.generated.ts
1260
- var WIDGET_REACT_VERSION = "0.128.1";
1326
+ var WIDGET_REACT_VERSION = "0.130.0";
1261
1327
 
1262
1328
  // src/config.ts
1263
1329
  function hostTag(cfg) {
@@ -1266,7 +1332,8 @@ function hostTag(cfg) {
1266
1332
  }
1267
1333
  var isBundledFamily = (tag2) => sameFamily(tag2, BUNDLED_TAG);
1268
1334
  function normalizeUi(cfg, loaded) {
1269
- const strings = buildLocaleStrings(loaded.strings, loaded.tag, loaded.clock);
1335
+ const timeZone = validZone(cfg.timeZone);
1336
+ const strings = buildLocaleStrings(loaded.strings, loaded.tag, loaded.clock, timeZone);
1270
1337
  return {
1271
1338
  theme: cfg.theme ?? "auto",
1272
1339
  oddsFormat: parseOddsFormat(cfg.oddsFormat) ?? "decimal",
@@ -1275,6 +1342,7 @@ function normalizeUi(cfg, loaded) {
1275
1342
  headerTitle: cfg.headerTitle,
1276
1343
  locale: loaded.tag,
1277
1344
  clock: loaded.clock,
1345
+ timeZone,
1278
1346
  hostTag: hostTag(cfg),
1279
1347
  rawBettingLabels: isBundledFamily(loaded.tag),
1280
1348
  cta: cfg.cta,
@@ -1780,9 +1848,9 @@ function projectSeries(samples) {
1780
1848
  yMin = pMin - FLAT_DOMAIN_PAD;
1781
1849
  yMax = pMax + FLAT_DOMAIN_PAD;
1782
1850
  } else {
1783
- const pad2 = (pMax - pMin) * 0.1;
1784
- yMin = pMin - pad2;
1785
- yMax = pMax + pad2;
1851
+ const pad = (pMax - pMin) * 0.1;
1852
+ yMin = pMin - pad;
1853
+ yMax = pMax + pad;
1786
1854
  }
1787
1855
  const x = (atMs) => round2(PLOT_X0 + (atMs - tMin) / (tMax - tMin) * (PLOT_X1 - PLOT_X0));
1788
1856
  const y = (price) => round2(PLOT_Y1 - (price - yMin) / (yMax - yMin) * (PLOT_Y1 - PLOT_Y0));
@@ -1933,7 +2001,7 @@ function toSlipSelection(vm, conversationId) {
1933
2001
  if (vm.quotedAtUtc !== void 0) selection.quotedAtUtc = vm.quotedAtUtc;
1934
2002
  if (vm.id !== void 0) selection.insightId = vm.id;
1935
2003
  if (conversationId !== void 0) selection.conversationId = conversationId;
1936
- return selection;
2004
+ return withMatch(selection, { home: vm.homeTeamName, away: vm.awayTeamName, kickoffUtc: vm.kickoffUtc, marketLabel: vm.market });
1937
2005
  }
1938
2006
  function toMarketOddsVM(card) {
1939
2007
  const rows = Array.isArray(card.rows) ? card.rows : [];
@@ -2050,7 +2118,7 @@ function marketOddsRowToSlipSelection(vm, row, conversationId) {
2050
2118
  const slipSport = (0, import_widget_sdk.slipSportOf)(vm.sport);
2051
2119
  if (slipSport) selection.sport = slipSport;
2052
2120
  if (conversationId !== void 0) selection.conversationId = conversationId;
2053
- return selection;
2121
+ return withMatch(selection, { home: vm.homeTeamName, away: vm.awayTeamName, kickoffUtc: vm.kickoffUtc, marketLabel: vm.market });
2054
2122
  }
2055
2123
  function finite(v) {
2056
2124
  return typeof v === "number" && Number.isFinite(v) ? v : void 0;
@@ -2124,7 +2192,7 @@ function comboLegToSlipSelection(leg, conversationId) {
2124
2192
  if (leg.quotedAtUtc !== void 0) selection.quotedAtUtc = leg.quotedAtUtc;
2125
2193
  if (leg.sport !== void 0) selection.sport = leg.sport;
2126
2194
  if (conversationId !== void 0) selection.conversationId = conversationId;
2127
- return selection;
2195
+ return withMatch(selection, { home: leg.homeTeamName, away: leg.awayTeamName, kickoffUtc: leg.kickoffUtc, marketLabel: leg.market });
2128
2196
  }
2129
2197
  var isNum = (v) => typeof v === "number" && Number.isFinite(v);
2130
2198
  var isObj = (v) => typeof v === "object" && v !== null;
@@ -2257,7 +2325,7 @@ function toNbaSlipSelection(vm, key, conversationId) {
2257
2325
  sport: "basketball"
2258
2326
  };
2259
2327
  if (conversationId !== void 0) selection.conversationId = conversationId;
2260
- return selection;
2328
+ return withMatch(selection, { home: vm.homeTeamName, away: vm.awayTeamName, kickoffUtc: vm.kickoffUtc });
2261
2329
  }
2262
2330
  function nbaCoHitLegs(vm, conversationId) {
2263
2331
  if (vm.evidence.kind !== "co_hit") return [];
@@ -2270,6 +2338,7 @@ function nbaCoHitLegs(vm, conversationId) {
2270
2338
  matchId: vm.matchId,
2271
2339
  homeTeamName: vm.homeTeamName ?? "",
2272
2340
  awayTeamName: vm.awayTeamName ?? "",
2341
+ kickoffUtc: vm.kickoffUtc ?? void 0,
2273
2342
  market: vm.title,
2274
2343
  marketDeveloperName: s.marketDeveloperName,
2275
2344
  selection: s.selectionLabel,
@@ -2376,7 +2445,7 @@ function toNflSlipSelection(vm, key, nowMs, conversationId) {
2376
2445
  sport: "americanfootball"
2377
2446
  };
2378
2447
  if (conversationId !== void 0) selection.conversationId = conversationId;
2379
- return selection;
2448
+ return withMatch(selection, { home: vm.homeTeamName, away: vm.awayTeamName, kickoffUtc: vm.kickoffUtc });
2380
2449
  }
2381
2450
 
2382
2451
  // src/slipKey.ts
@@ -2435,11 +2504,11 @@ function slipPickFields(selection, label, line) {
2435
2504
  if (Number.isFinite(odds) && odds > 1 && odds <= MAX_ODDS) fields.odds = odds;
2436
2505
  return fields;
2437
2506
  }
2438
- function chipSelection(market, matchId, conversationId) {
2507
+ function chipSelection(market, match, conversationId) {
2439
2508
  if (!market || !market.addToSlipEnabled || typeof market.matchOddsId !== "number" || typeof market.price !== "number" || !market.priceFormats) return null;
2440
- const selection = { matchOddsId: market.matchOddsId, matchId, oddsDecimal: market.price, forms: market.priceFormats };
2509
+ const selection = { matchOddsId: market.matchOddsId, matchId: match.matchId, oddsDecimal: market.price, forms: market.priceFormats };
2441
2510
  if (conversationId !== void 0) selection.conversationId = conversationId;
2442
- return selection;
2511
+ return withMatch(selection, { home: match.homeTeamName, away: match.awayTeamName, kickoffUtc: match.kickoffUtc, marketLabel: market.marketLabel });
2443
2512
  }
2444
2513
  function chipPriceText(market, format2) {
2445
2514
  return typeof market.price === "number" && market.priceFormats ? formatOdds(market.priceFormats, format2) : void 0;
@@ -3545,12 +3614,12 @@ var import_widget_sdk13 = require("@sensiblestats/widget-sdk");
3545
3614
  var PREFIX2 = "ss-w-schedule:";
3546
3615
  var SCHEMA_VERSION = 7;
3547
3616
  var TTL_MS3 = 6 * 36e5;
3548
- function scheduleCacheKey(operatorId, encodedUserKey2, localDate) {
3549
- return `${PREFIX2}${operatorId}:${encodedUserKey2}:${localDate}`;
3617
+ function scheduleCacheKey(operatorId, encodedUserKey2, localDate, timeZone) {
3618
+ return `${PREFIX2}${operatorId}:${encodedUserKey2}:${timeZone ?? "local"}:${localDate}`;
3550
3619
  }
3551
- function read(operatorId, encodedUserKey2, localDate) {
3620
+ function read(operatorId, encodedUserKey2, localDate, timeZone) {
3552
3621
  try {
3553
- const raw = localStorage.getItem(scheduleCacheKey(operatorId, encodedUserKey2, localDate));
3622
+ const raw = localStorage.getItem(scheduleCacheKey(operatorId, encodedUserKey2, localDate, timeZone));
3554
3623
  if (!raw) return null;
3555
3624
  const entry = JSON.parse(raw);
3556
3625
  if (entry.v !== SCHEMA_VERSION || !entry.payload) return null;
@@ -3559,13 +3628,13 @@ function read(operatorId, encodedUserKey2, localDate) {
3559
3628
  return null;
3560
3629
  }
3561
3630
  }
3562
- function readSchedule(operatorId, encodedUserKey2, localDate, nowMs) {
3563
- const entry = read(operatorId, encodedUserKey2, localDate);
3631
+ function readSchedule(operatorId, encodedUserKey2, localDate, nowMs, timeZone) {
3632
+ const entry = read(operatorId, encodedUserKey2, localDate, timeZone);
3564
3633
  if (!entry) return null;
3565
3634
  return nowMs - entry.at > TTL_MS3 ? null : entry.payload;
3566
3635
  }
3567
- function readScheduleIgnoringTtl(operatorId, encodedUserKey2, localDate) {
3568
- return read(operatorId, encodedUserKey2, localDate)?.payload ?? null;
3636
+ function readScheduleIgnoringTtl(operatorId, encodedUserKey2, localDate, timeZone) {
3637
+ return read(operatorId, encodedUserKey2, localDate, timeZone)?.payload ?? null;
3569
3638
  }
3570
3639
  function skeletonOnly(payload) {
3571
3640
  return {
@@ -3604,8 +3673,8 @@ function skeletonOnly(payload) {
3604
3673
  }))
3605
3674
  };
3606
3675
  }
3607
- function writeSchedule(operatorId, encodedUserKey2, localDate, payload, nowMs) {
3608
- const keep = scheduleCacheKey(operatorId, encodedUserKey2, localDate);
3676
+ function writeSchedule(operatorId, encodedUserKey2, localDate, payload, nowMs, timeZone) {
3677
+ const keep = scheduleCacheKey(operatorId, encodedUserKey2, localDate, timeZone);
3609
3678
  const mine = `${PREFIX2}${operatorId}:${encodedUserKey2}:`;
3610
3679
  try {
3611
3680
  for (let i = localStorage.length - 1; i >= 0; i--) {
@@ -3617,9 +3686,9 @@ function writeSchedule(operatorId, encodedUserKey2, localDate, payload, nowMs) {
3617
3686
  } catch {
3618
3687
  }
3619
3688
  }
3620
- function clearSchedule(operatorId, encodedUserKey2, localDate) {
3689
+ function clearSchedule(operatorId, encodedUserKey2, localDate, timeZone) {
3621
3690
  try {
3622
- localStorage.removeItem(scheduleCacheKey(operatorId, encodedUserKey2, localDate));
3691
+ localStorage.removeItem(scheduleCacheKey(operatorId, encodedUserKey2, localDate, timeZone));
3623
3692
  } catch {
3624
3693
  }
3625
3694
  }
@@ -3661,6 +3730,51 @@ function nearestTennisKeys(open) {
3661
3730
  return [...open.values()].sort((a, b) => a.kickoffUnix - b.kickoffUnix).slice(0, MAX_TENNIS_KEYS).map((e) => e.key);
3662
3731
  }
3663
3732
 
3733
+ // src/scheduleDays.ts
3734
+ var MAX_AFTER_TODAY = 6;
3735
+ var parts = (date) => {
3736
+ const [y = 0, m = 1, d = 1] = date.split("-").map(Number);
3737
+ return [y, m, d];
3738
+ };
3739
+ function offsetOf(localDate, timeZone) {
3740
+ const [y, m, d] = parts(localDate);
3741
+ if (timeZone === void 0) return -new Date(y, m - 1, d, 12).getTimezoneOffset();
3742
+ const utcNoon = Date.UTC(y, m - 1, d, 12);
3743
+ return zoneOffsetMinutes(utcNoon - zoneOffsetMinutes(utcNoon, timeZone) * 6e4, timeZone);
3744
+ }
3745
+ function localDateOfUnix(unix, offsetMinutes = -new Date(unix * 1e3).getTimezoneOffset()) {
3746
+ return new Date((unix + offsetMinutes * 60) * 1e3).toISOString().slice(0, 10);
3747
+ }
3748
+ var dayAfter = (date) => {
3749
+ const [y, m, d] = parts(date);
3750
+ return new Date(Date.UTC(y, m - 1, d + 1)).toISOString().slice(0, 10);
3751
+ };
3752
+ function buildDayChips(today, matchDays, sport) {
3753
+ const dates = /* @__PURE__ */ new Set();
3754
+ for (const md of matchDays) {
3755
+ if (sport !== "all" && md.sport !== sport) continue;
3756
+ for (const date of md.dates) if (date > today) dates.add(date);
3757
+ }
3758
+ const chips = [{ date: today, isToday: true, gapBefore: false }];
3759
+ for (const date of [...dates].sort().slice(0, MAX_AFTER_TODAY)) {
3760
+ const prev = chips[chips.length - 1];
3761
+ chips.push({ date, isToday: false, gapBefore: prev !== void 0 && dayAfter(prev.date) !== date });
3762
+ }
3763
+ return chips;
3764
+ }
3765
+ function weekdayAndDay(date, tag2) {
3766
+ const [y, m, d] = parts(date);
3767
+ const at2 = new Date(Date.UTC(y, m - 1, d, 12));
3768
+ return {
3769
+ weekday: formatDate(at2, tag2, { weekday: "short", timeZone: "UTC" }),
3770
+ day: formatDate(at2, tag2, { day: "numeric", timeZone: "UTC" })
3771
+ };
3772
+ }
3773
+ function weekdayLong(date, tag2) {
3774
+ const [y, m, d] = parts(date);
3775
+ return formatDate(new Date(Date.UTC(y, m - 1, d, 12)), tag2, { weekday: "long", timeZone: "UTC" });
3776
+ }
3777
+
3664
3778
  // src/liveClock.ts
3665
3779
  var import_widget_sdk12 = require("@sensiblestats/widget-sdk");
3666
3780
  function isTreatedLive(state, pollStale) {
@@ -3680,7 +3794,11 @@ var STALE_AFTER_FAILURES = 2;
3680
3794
  function encodedUserKey(operatorUserId, anonymousUserId) {
3681
3795
  return encodeURIComponent(operatorUserId || anonymousUserId || "none");
3682
3796
  }
3683
- function localDateOf(now) {
3797
+ function localDateOf(now, timeZone) {
3798
+ if (timeZone !== void 0) {
3799
+ const p = zonedParts(now.getTime(), timeZone);
3800
+ return `${p.year}-${`${p.month}`.padStart(2, "0")}-${`${p.day}`.padStart(2, "0")}`;
3801
+ }
3684
3802
  const y = now.getFullYear();
3685
3803
  const m = `${now.getMonth() + 1}`.padStart(2, "0");
3686
3804
  const d = `${now.getDate()}`.padStart(2, "0");
@@ -3706,19 +3824,19 @@ function useMatchDiscovery(opts) {
3706
3824
  statesRef.current = states;
3707
3825
  const getStatesRef = (0, import_react5.useRef)(opts.getStates);
3708
3826
  getStatesRef.current = opts.getStates;
3709
- const [localDate, setLocalDate] = (0, import_react5.useState)(() => localDateOf(/* @__PURE__ */ new Date()));
3827
+ const [localDate, setLocalDate] = (0, import_react5.useState)(() => localDateOf(/* @__PURE__ */ new Date(), opts.timeZone));
3710
3828
  (0, import_react5.useEffect)(() => {
3711
3829
  const id = setInterval(() => {
3712
- const next = localDateOf(/* @__PURE__ */ new Date());
3830
+ const next = localDateOf(/* @__PURE__ */ new Date(), opts.timeZone);
3713
3831
  setLocalDate((prev) => prev === next ? prev : next);
3714
3832
  }, ROLLOVER_CHECK_MS);
3715
3833
  return () => clearInterval(id);
3716
- }, []);
3834
+ }, [opts.timeZone]);
3717
3835
  (0, import_react5.useEffect)(() => {
3718
3836
  let cancelled = false;
3719
- const utcOffsetMinutes = -(/* @__PURE__ */ new Date()).getTimezoneOffset();
3837
+ const utcOffsetMinutes = opts.timeZone === void 0 ? -(/* @__PURE__ */ new Date()).getTimezoneOffset() : offsetOf(localDate, opts.timeZone);
3720
3838
  const key = encodedUserKey(opts.operatorUserId, opts.anonymousUserId);
3721
- const cached = readSchedule(opts.operatorId, key, localDate, Date.now());
3839
+ const cached = readSchedule(opts.operatorId, key, localDate, Date.now(), opts.timeZone);
3722
3840
  if (cached) {
3723
3841
  if (!cancelled) {
3724
3842
  setGroups(cached.groups);
@@ -3738,12 +3856,12 @@ function useMatchDiscovery(opts) {
3738
3856
  setScheduleLoaded(true);
3739
3857
  return;
3740
3858
  }
3741
- writeSchedule(opts.operatorId, key, localDate, payload, Date.now());
3859
+ writeSchedule(opts.operatorId, key, localDate, payload, Date.now(), opts.timeZone);
3742
3860
  setGroups(payload.groups);
3743
3861
  setMatchDays(payload.matchDays ?? []);
3744
3862
  setScheduleLoaded(true);
3745
3863
  } catch {
3746
- const fallback = readScheduleIgnoringTtl(opts.operatorId, key, localDate);
3864
+ const fallback = readScheduleIgnoringTtl(opts.operatorId, key, localDate, opts.timeZone);
3747
3865
  if (!cancelled && fallback) {
3748
3866
  setGroups(fallback.groups);
3749
3867
  setMatchDays(fallback.matchDays ?? []);
@@ -3754,7 +3872,7 @@ function useMatchDiscovery(opts) {
3754
3872
  return () => {
3755
3873
  cancelled = true;
3756
3874
  };
3757
- }, [opts.operatorId, opts.operatorUserId, opts.anonymousUserId, localDate, refreshKey]);
3875
+ }, [opts.operatorId, opts.operatorUserId, opts.anonymousUserId, localDate, refreshKey, opts.timeZone]);
3758
3876
  const tick = (0, import_react5.useCallback)(async () => {
3759
3877
  const ids = dueMatchIds(groupsRef.current, statesRef.current, Date.now());
3760
3878
  if (ids.football.length === 0 && ids.nba.length === 0 && ids.nfl.length === 0 && ids.tennis.length === 0) return;
@@ -3789,10 +3907,10 @@ function useMatchDiscovery(opts) {
3789
3907
  return n;
3790
3908
  }, [groups, states, stale]);
3791
3909
  const refreshSchedule = (0, import_react5.useCallback)(async () => {
3792
- clearSchedule(opts.operatorId, encodedUserKey(opts.operatorUserId, opts.anonymousUserId), localDate);
3910
+ clearSchedule(opts.operatorId, encodedUserKey(opts.operatorUserId, opts.anonymousUserId), localDate, opts.timeZone);
3793
3911
  setRefreshKey((n) => n + 1);
3794
3912
  setScheduleVersion((n) => n + 1);
3795
- }, [opts.operatorId, opts.operatorUserId, opts.anonymousUserId, localDate]);
3913
+ }, [opts.operatorId, opts.operatorUserId, opts.anonymousUserId, localDate, opts.timeZone]);
3796
3914
  return { groups, localDate, matchDays, scheduleLoaded, states, liveCount, stale, refreshSchedule, scheduleVersion, _tick: tick };
3797
3915
  }
3798
3916
 
@@ -5883,7 +6001,8 @@ function useSlipAdd(slip, ui) {
5883
6001
  const operatorFormat = ui?.oddsFormat ?? "decimal";
5884
6002
  return (0, import_react25.useCallback)(async (selection, { marketDeveloperName, selectionLabel, line }) => {
5885
6003
  if (!handler) return { kind: "failed" };
5886
- const out = toHostSelection(selection, operatorFormat);
6004
+ const display = slipDisplay({ ...selection.display, market: marketDeveloperName, selection: selectionLabel, line });
6005
+ const out = toHostSelection(display ? { ...selection, display } : selection, operatorFormat);
5887
6006
  const pick = slipPickFields(out, rawLabels ? selectionLabel : void 0, line);
5888
6007
  const wireSport = (0, import_widget_sdk16.toWireSport)(out.sport);
5889
6008
  const sportField = {
@@ -6327,8 +6446,8 @@ function OddsRow({ vm, row, ui, slip, inSlipIds, history, suppressSlip }) {
6327
6446
  ] });
6328
6447
  }
6329
6448
  var STALE_AFTER_MS = 12e4;
6330
- function fmtHhMm(iso, tag2, clock3) {
6331
- return formatTime(iso, tag2, clock3);
6449
+ function fmtHhMm(iso, tag2, clock3, timeZone) {
6450
+ return formatTime(iso, tag2, clock3, { timeZone });
6332
6451
  }
6333
6452
  function MarketOddsCard({ vm, ui, slip, monitor, inSlipIds, hideHeader, pinRef }) {
6334
6453
  const [open, setOpen] = (0, import_react33.useState)(false);
@@ -6341,7 +6460,7 @@ function MarketOddsCard({ vm, ui, slip, monitor, inSlipIds, hideHeader, pinRef }
6341
6460
  const isClosed = closedReason !== null;
6342
6461
  const asOfMs = live ? new Date(live.asOfUtc).getTime() : NaN;
6343
6462
  const isStale = live != null && !isClosed && (vm.awaitingLiveUpdate === true || Date.now() - asOfMs > STALE_AFTER_MS);
6344
- const staleTime = isStale && live ? fmtHhMm(live.asOfUtc, ui.locale, clockOf(ui)) : null;
6463
+ const staleTime = isStale && live ? fmtHhMm(live.asOfUtc, ui.locale, clockOf(ui), ui.timeZone) : null;
6345
6464
  const [, setStaleTick] = (0, import_react33.useState)(0);
6346
6465
  const watchStale = live != null && !isClosed && !isStale;
6347
6466
  (0, import_react33.useEffect)(() => {
@@ -6467,9 +6586,9 @@ function allowedForStars(stars, leg) {
6467
6586
  var import_jsx_runtime13 = require("react/jsx-runtime");
6468
6587
  var asOf = (iso, ui) => {
6469
6588
  const at2 = new Date(iso);
6470
- const time = fmtHhMm(iso, ui.locale, clockOf(ui));
6471
- if (at2.toDateString() === (/* @__PURE__ */ new Date()).toDateString()) return time;
6472
- return `${formatDate(at2, ui.locale, { day: "numeric", month: "short" })} ${time}`;
6589
+ const time = fmtHhMm(iso, ui.locale, clockOf(ui), ui.timeZone);
6590
+ if (zonedDayNumber(at2.getTime(), ui.timeZone) === zonedDayNumber(Date.now(), ui.timeZone)) return time;
6591
+ return `${formatDate(at2, ui.locale, { day: "numeric", month: "short", timeZone: ui.timeZone })} ${time}`;
6473
6592
  };
6474
6593
  function CardLine({ card, ui, slip, sport, marketKey, conversation, operatorUserId, anonymousUserId }) {
6475
6594
  const matchId = card.matchId;
@@ -6691,9 +6810,8 @@ function instantMs(iso) {
6691
6810
  const ms = Date.parse(iso);
6692
6811
  return Number.isNaN(ms) ? null : ms;
6693
6812
  }
6694
- function localDayStart(ms) {
6695
- const d = new Date(ms);
6696
- return new Date(d.getFullYear(), d.getMonth(), d.getDate()).getTime();
6813
+ function localDayStart(ms, timeZone) {
6814
+ return zonedDayNumber(ms, timeZone) * 864e5;
6697
6815
  }
6698
6816
  function kickoffText(ui, iso) {
6699
6817
  if (instantMs(iso) === null) return null;
@@ -6858,15 +6976,15 @@ function MatchCard({ card, ui, slip, sport, marketKey, conversation, operatorUse
6858
6976
  var import_jsx_runtime22 = require("react/jsx-runtime");
6859
6977
  var STATUSES = ["available", "doubtful", "out"];
6860
6978
  var MAX_MARKS = 30;
6861
- var pad = (n) => String(n).padStart(2, "0");
6862
- function clock(iso) {
6979
+ function clock(iso, ui) {
6863
6980
  if (!iso) return null;
6864
6981
  const at2 = new Date(iso);
6865
- return Number.isNaN(at2.getTime()) ? null : `${pad(at2.getHours())}:${pad(at2.getMinutes())}`;
6982
+ if (Number.isNaN(at2.getTime())) return null;
6983
+ return formatTime(at2, ui.locale, clockOf(ui), { timeZone: ui.timeZone });
6866
6984
  }
6867
6985
  function badge(card, ui) {
6868
6986
  if (card.status === "out") {
6869
- const time = clock(card.statusAsOfUtc);
6987
+ const time = clock(card.statusAsOfUtc, ui);
6870
6988
  return { kind: "out", text: time ? ui.v8Out(time) : ui.v8OutNoTime };
6871
6989
  }
6872
6990
  return card.status === "doubtful" ? { kind: "doubtful", text: ui.v8Doubtful } : null;
@@ -6914,10 +7032,10 @@ function SinceLines({ since, ui }) {
6914
7032
  // src/components/dashboard/v8/YouRibbon.tsx
6915
7033
  var import_jsx_runtime24 = require("react/jsx-runtime");
6916
7034
  var FROM_CHATS_SHOWN = 2;
6917
- function showsNoGamesNote(chip, now = Date.now()) {
7035
+ function showsNoGamesNote(chip, now = Date.now(), timeZone) {
6918
7036
  if (chip.kind !== "competition") return false;
6919
7037
  const at2 = instantMs(chip.nextGameAtUtc);
6920
- if (at2 !== null) return localDayStart(at2) > localDayStart(now);
7038
+ if (at2 !== null) return localDayStart(at2, timeZone) > localDayStart(now, timeZone);
6921
7039
  return chip.noGamesToday === true;
6922
7040
  }
6923
7041
  function YouRibbon({ ribbon, ui, controller, holds, sport, onMore }) {
@@ -6927,7 +7045,7 @@ function YouRibbon({ ribbon, ui, controller, holds, sport, onMore }) {
6927
7045
  return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("section", { className: "ss-w-v8-sec ss-w-v8-ribbon", children: [
6928
7046
  /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "ss-w-v8-chips", children: [
6929
7047
  ribbon.stars.map((chip, i) => {
6930
- const quiet = showsNoGamesNote(chip);
7048
+ const quiet = showsNoGamesNote(chip, Date.now(), ui.timeZone);
6931
7049
  return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { className: `ss-w-v8-chip ss-w-v8-chip--${chip.kind}`, children: [
6932
7050
  chip.playing && !quiet ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("i", { className: "ss-w-v8-playing", "aria-hidden": "true" }) : null,
6933
7051
  chip.label,
@@ -7140,54 +7258,9 @@ var import_react40 = require("react");
7140
7258
 
7141
7259
  // src/useScheduleDay.ts
7142
7260
  var import_react39 = require("react");
7143
-
7144
- // src/scheduleDays.ts
7145
- var MAX_AFTER_TODAY = 6;
7146
- var parts = (date) => {
7147
- const [y = 0, m = 1, d = 1] = date.split("-").map(Number);
7148
- return [y, m, d];
7149
- };
7150
- function offsetOf(localDate) {
7151
- const [y, m, d] = parts(localDate);
7152
- return -new Date(y, m - 1, d, 12).getTimezoneOffset();
7153
- }
7154
- function localDateOfUnix(unix, offsetMinutes = -new Date(unix * 1e3).getTimezoneOffset()) {
7155
- return new Date((unix + offsetMinutes * 60) * 1e3).toISOString().slice(0, 10);
7156
- }
7157
- var dayAfter = (date) => {
7158
- const [y, m, d] = parts(date);
7159
- return new Date(Date.UTC(y, m - 1, d + 1)).toISOString().slice(0, 10);
7160
- };
7161
- function buildDayChips(today, matchDays, sport) {
7162
- const dates = /* @__PURE__ */ new Set();
7163
- for (const md of matchDays) {
7164
- if (sport !== "all" && md.sport !== sport) continue;
7165
- for (const date of md.dates) if (date > today) dates.add(date);
7166
- }
7167
- const chips = [{ date: today, isToday: true, gapBefore: false }];
7168
- for (const date of [...dates].sort().slice(0, MAX_AFTER_TODAY)) {
7169
- const prev = chips[chips.length - 1];
7170
- chips.push({ date, isToday: false, gapBefore: prev !== void 0 && dayAfter(prev.date) !== date });
7171
- }
7172
- return chips;
7173
- }
7174
- function weekdayAndDay(date, tag2) {
7175
- const [y, m, d] = parts(date);
7176
- const at2 = new Date(Date.UTC(y, m - 1, d, 12));
7177
- return {
7178
- weekday: formatDate(at2, tag2, { weekday: "short", timeZone: "UTC" }),
7179
- day: formatDate(at2, tag2, { day: "numeric", timeZone: "UTC" })
7180
- };
7181
- }
7182
- function weekdayLong(date, tag2) {
7183
- const [y, m, d] = parts(date);
7184
- return formatDate(new Date(Date.UTC(y, m - 1, d, 12)), tag2, { weekday: "long", timeZone: "UTC" });
7185
- }
7186
-
7187
- // src/useScheduleDay.ts
7188
7261
  var EMPTY = [];
7189
7262
  function useScheduleDay(opts) {
7190
- const { localDate, today, todayGroups, enabled, resetKey } = opts;
7263
+ const { localDate, today, todayGroups, enabled, resetKey, timeZone } = opts;
7191
7264
  const getRef = (0, import_react39.useRef)(opts.getSchedule);
7192
7265
  getRef.current = opts.getSchedule;
7193
7266
  const daysRef = (0, import_react39.useRef)(/* @__PURE__ */ new Map());
@@ -7195,12 +7268,14 @@ function useScheduleDay(opts) {
7195
7268
  const [retryKey, setRetryKey] = (0, import_react39.useState)(0);
7196
7269
  const [seenDate, setSeenDate] = (0, import_react39.useState)(localDate);
7197
7270
  const [seenReset, setSeenReset] = (0, import_react39.useState)(resetKey);
7271
+ const [seenZone, setSeenZone] = (0, import_react39.useState)(timeZone);
7198
7272
  if (seenDate !== localDate) {
7199
7273
  setSeenDate(localDate);
7200
7274
  setFetched({ status: "idle", groups: EMPTY });
7201
7275
  }
7202
- if (seenReset !== resetKey) {
7276
+ if (seenReset !== resetKey || seenZone !== timeZone) {
7203
7277
  setSeenReset(resetKey);
7278
+ setSeenZone(timeZone);
7204
7279
  daysRef.current.clear();
7205
7280
  setFetched({ status: "idle", groups: EMPTY });
7206
7281
  }
@@ -7211,7 +7286,7 @@ function useScheduleDay(opts) {
7211
7286
  setFetched({ status: "loading", groups: EMPTY });
7212
7287
  void (async () => {
7213
7288
  try {
7214
- const payload = await getRef.current(localDate, offsetOf(localDate));
7289
+ const payload = await getRef.current(localDate, offsetOf(localDate, timeZone));
7215
7290
  if (cancelled) return;
7216
7291
  if (!payload) {
7217
7292
  setFetched({ status: "error", groups: EMPTY });
@@ -7226,7 +7301,7 @@ function useScheduleDay(opts) {
7226
7301
  return () => {
7227
7302
  cancelled = true;
7228
7303
  };
7229
- }, [localDate, isToday, enabled, retryKey, resetKey]);
7304
+ }, [localDate, isToday, enabled, retryKey, resetKey, timeZone]);
7230
7305
  const retry = (0, import_react39.useCallback)(() => {
7231
7306
  setRetryKey((k) => k + 1);
7232
7307
  }, []);
@@ -7238,7 +7313,7 @@ function useScheduleDay(opts) {
7238
7313
  }
7239
7314
 
7240
7315
  // src/useMatchesDay.ts
7241
- function useMatchesDay({ discovery, day, sport, getSchedule, enabled }) {
7316
+ function useMatchesDay({ discovery, day, sport, getSchedule, enabled, timeZone }) {
7242
7317
  const { localDate: today, matchDays } = discovery;
7243
7318
  const chips = (0, import_react40.useMemo)(() => buildDayChips(today, matchDays, sport), [today, matchDays, sport]);
7244
7319
  const selected = chips.some((c) => c.date === day) ? day : today;
@@ -7248,6 +7323,7 @@ function useMatchesDay({ discovery, day, sport, getSchedule, enabled }) {
7248
7323
  todayGroups: discovery.groups,
7249
7324
  getSchedule,
7250
7325
  enabled,
7326
+ timeZone,
7251
7327
  resetKey: String(discovery.scheduleVersion)
7252
7328
  });
7253
7329
  return { ...loaded, chips, selected };
@@ -8782,7 +8858,7 @@ function ticksFor(lo, hi) {
8782
8858
  return out;
8783
8859
  }
8784
8860
  function scatterScale(e) {
8785
- const { w, h, pad: pad2 } = SCATTER_VIEW;
8861
+ const { w, h, pad } = SCATTER_VIEW;
8786
8862
  const xs = finite3([...e.field.map((d) => d.returnPct), ...e.marked.map((m) => m.returnPct), e.tourReturnPct]);
8787
8863
  const ys = finite3([...e.field.map((d) => d.servePct), ...e.marked.map((m) => m.servePct), e.tourServePct]);
8788
8864
  const x0 = Math.floor(Math.min(...xs) - 1);
@@ -8790,26 +8866,26 @@ function scatterScale(e) {
8790
8866
  const y0 = Math.floor(Math.min(...ys) - 1);
8791
8867
  const y1 = Math.ceil(Math.max(...ys) + 1);
8792
8868
  return {
8793
- x: (v) => round22(pad2.l + (v - x0) / (x1 - x0) * (w - pad2.l - pad2.r)),
8794
- y: (v) => round22(h - pad2.b - (v - y0) / (y1 - y0) * (h - pad2.t - pad2.b)),
8869
+ x: (v) => round22(pad.l + (v - x0) / (x1 - x0) * (w - pad.l - pad.r)),
8870
+ y: (v) => round22(h - pad.b - (v - y0) / (y1 - y0) * (h - pad.t - pad.b)),
8795
8871
  ticksX: ticksFor(x0, x1),
8796
8872
  ticksY: ticksFor(y0, y1)
8797
8873
  };
8798
8874
  }
8799
8875
  function formBars(e) {
8800
- const { w, h, pad: pad2 } = FORM_VIEW;
8876
+ const { w, h, pad } = FORM_VIEW;
8801
8877
  const n = e.matches.length;
8802
8878
  const bounds = finite3([e.min, e.max, e.tourServePct]);
8803
8879
  const lo = Math.min(...bounds) - 4;
8804
8880
  const hi = Math.max(...bounds) + 2;
8805
- const plotW = w - pad2.l - pad2.r;
8806
- const base = h - pad2.b;
8807
- const y = (v) => round22(base - (v - lo) / (hi - lo) * (h - pad2.t - pad2.b));
8881
+ const plotW = w - pad.l - pad.r;
8882
+ const base = h - pad.b;
8883
+ const y = (v) => round22(base - (v - lo) / (hi - lo) * (h - pad.t - pad.b));
8808
8884
  const slot = plotW / Math.max(n, 1);
8809
8885
  const bw = Math.max(1, Math.min(MAX_BAR_W, slot - BAR_GAP));
8810
8886
  const bars = e.matches.map((m, i) => {
8811
8887
  const top = y(clampTo(m.servePct, lo, hi));
8812
- return { x: round22(pad2.l + slot * i + (slot - bw) / 2), w: round22(bw), y: top, h: round22(base - top), won: m.result === "W" };
8888
+ return { x: round22(pad.l + slot * i + (slot - bw) / 2), w: round22(bw), y: top, h: round22(base - top), won: m.result === "W" };
8813
8889
  });
8814
8890
  return { bars, tourY: y(e.tourServePct) };
8815
8891
  }
@@ -8832,9 +8908,9 @@ function roundSpan(e) {
8832
8908
  return { lo, span: ROUND_STEPS - lo };
8833
8909
  }
8834
8910
  function pathRounds(e) {
8835
- const { h, pad: pad2 } = PATH_VIEW;
8836
- const base = h - pad2.b;
8837
- const plotH = h - pad2.t - pad2.b;
8911
+ const { h, pad } = PATH_VIEW;
8912
+ const base = h - pad.b;
8913
+ const plotH = h - pad.t - pad.b;
8838
8914
  const { lo, span } = roundSpan(e);
8839
8915
  const seen = /* @__PURE__ */ new Map();
8840
8916
  for (const ev of e.events) {
@@ -8858,11 +8934,11 @@ function pathGutter(e) {
8858
8934
  return Math.max(PATH_VIEW.pad.l, Math.ceil(longest * GLYPH_W) + GUTTER_PAD + 4);
8859
8935
  }
8860
8936
  function pathBars(e, left = PATH_VIEW.pad.l) {
8861
- const { w, h, pad: pad2 } = PATH_VIEW;
8937
+ const { w, h, pad } = PATH_VIEW;
8862
8938
  const n = e.events.length;
8863
- const plotW = w - left - pad2.r;
8864
- const plotH = h - pad2.t - pad2.b;
8865
- const base = h - pad2.b;
8939
+ const plotW = w - left - pad.r;
8940
+ const plotH = h - pad.t - pad.b;
8941
+ const base = h - pad.b;
8866
8942
  const slot = plotW / Math.max(n, 1);
8867
8943
  const bw = Math.max(1, Math.min(MAX_BAR_W, slot - BAR_GAP));
8868
8944
  const { lo, span } = roundSpan(e);
@@ -8922,7 +8998,7 @@ function TennisInsightPriceRow({ prices }) {
8922
8998
  ] });
8923
8999
  }
8924
9000
  function ServeReturnChart({ vm, e, ui }) {
8925
- const { w, h, pad: pad2 } = SCATTER_VIEW;
9001
+ const { w, h, pad } = SCATTER_VIEW;
8926
9002
  const s = scatterScale(e);
8927
9003
  const tx = s.x(e.tourReturnPct);
8928
9004
  const ty = s.y(e.tourServePct);
@@ -8934,19 +9010,19 @@ function ServeReturnChart({ vm, e, ui }) {
8934
9010
  });
8935
9011
  return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("svg", { className: "ss-w-tni-svg", viewBox: `0 0 ${w} ${h}`, width: "100%", role: "img", "aria-label": summaryOf(vm, ui), children: [
8936
9012
  s.ticksX.map((t) => /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("g", { children: [
8937
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("line", { className: "ss-w-tni-grid", x1: s.x(t), x2: s.x(t), y1: pad2.t, y2: h - pad2.b }),
8938
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("text", { className: "ss-w-tni-tick", x: s.x(t), y: h - pad2.b + 11, textAnchor: "middle", children: pct(t, ui, 0) })
9013
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("line", { className: "ss-w-tni-grid", x1: s.x(t), x2: s.x(t), y1: pad.t, y2: h - pad.b }),
9014
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("text", { className: "ss-w-tni-tick", x: s.x(t), y: h - pad.b + 11, textAnchor: "middle", children: pct(t, ui, 0) })
8939
9015
  ] }, `x${t}`)),
8940
9016
  s.ticksY.map((t) => /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("g", { children: [
8941
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("line", { className: "ss-w-tni-grid", x1: pad2.l, x2: w - pad2.r, y1: s.y(t), y2: s.y(t) }),
8942
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("text", { className: "ss-w-tni-tick", x: pad2.l - 4, y: s.y(t) + 3, textAnchor: "end", children: pct(t, ui, 0) })
9017
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("line", { className: "ss-w-tni-grid", x1: pad.l, x2: w - pad.r, y1: s.y(t), y2: s.y(t) }),
9018
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("text", { className: "ss-w-tni-tick", x: pad.l - 4, y: s.y(t) + 3, textAnchor: "end", children: pct(t, ui, 0) })
8943
9019
  ] }, `y${t}`)),
8944
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("text", { className: "ss-w-tni-axis", x: pad2.l + (w - pad2.l - pad2.r) / 2, y: h - 3, textAnchor: "middle", children: e.xAxis }),
8945
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("text", { className: "ss-w-tni-axis", transform: `translate(8 ${pad2.t + (h - pad2.t - pad2.b) / 2}) rotate(-90)`, textAnchor: "middle", children: e.yAxis }),
9020
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("text", { className: "ss-w-tni-axis", x: pad.l + (w - pad.l - pad.r) / 2, y: h - 3, textAnchor: "middle", children: e.xAxis }),
9021
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("text", { className: "ss-w-tni-axis", transform: `translate(8 ${pad.t + (h - pad.t - pad.b) / 2}) rotate(-90)`, textAnchor: "middle", children: e.yAxis }),
8946
9022
  e.field.map((d) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("circle", { className: "ss-w-tni-dot", cx: s.x(d.returnPct), cy: s.y(d.servePct), r: 2.4 }, d.playerId)),
8947
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("line", { className: "ss-w-tni-tour", x1: tx, x2: tx, y1: pad2.t, y2: h - pad2.b }),
8948
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("line", { className: "ss-w-tni-tour", x1: pad2.l, x2: w - pad2.r, y1: ty, y2: ty }),
8949
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("text", { className: "ss-w-tni-lab ss-w-tni-lab-faint", x: w - pad2.r - 2, y: ty - 4, textAnchor: "end", children: e.tourAverage }),
9023
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("line", { className: "ss-w-tni-tour", x1: tx, x2: tx, y1: pad.t, y2: h - pad.b }),
9024
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("line", { className: "ss-w-tni-tour", x1: pad.l, x2: w - pad.r, y1: ty, y2: ty }),
9025
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("text", { className: "ss-w-tni-lab ss-w-tni-lab-faint", x: w - pad.r - 2, y: ty - 4, textAnchor: "end", children: e.tourAverage }),
8950
9026
  e.marked.map((m, i) => {
8951
9027
  const l = labels[i];
8952
9028
  return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("g", { children: [
@@ -8967,15 +9043,15 @@ function ServeReturnCard({ vm, e, ui }) {
8967
9043
  ] });
8968
9044
  }
8969
9045
  function ServeFormCard({ vm, e, ui }) {
8970
- const { w, h, pad: pad2 } = FORM_VIEW;
9046
+ const { w, h, pad } = FORM_VIEW;
8971
9047
  const { bars, tourY } = formBars(e);
8972
9048
  const lo = Math.min(e.min, e.tourServePct) - 4;
8973
9049
  const hi = Math.max(e.max, e.tourServePct) + 2;
8974
- const base = h - pad2.b;
8975
- const yOf = (v) => base - (v - lo) / (hi - lo) * (h - pad2.t - pad2.b);
9050
+ const base = h - pad.b;
9051
+ const yOf = (v) => base - (v - lo) / (hi - lo) * (h - pad.t - pad.b);
8976
9052
  const ticks = [];
8977
9053
  for (let t = Math.ceil(lo / 5) * 5; t <= hi; t += 5) ticks.push(t);
8978
- const slot = (w - pad2.l - pad2.r) / Math.max(e.matches.length, 1);
9054
+ const slot = (w - pad.l - pad.r) / Math.max(e.matches.length, 1);
8979
9055
  const tiles = [
8980
9056
  { label: e.labels.average, value: pct(e.average, ui) },
8981
9057
  e.winsAverage == null ? null : { label: e.labels.inWins, value: pct(e.winsAverage, ui) },
@@ -8984,10 +9060,10 @@ function ServeFormCard({ vm, e, ui }) {
8984
9060
  ].filter((t) => t !== null);
8985
9061
  return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
8986
9062
  /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("svg", { className: "ss-w-tni-svg", viewBox: `0 0 ${w} ${h}`, width: "100%", role: "img", "aria-label": summaryOf(vm, ui), children: [
8987
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("text", { className: "ss-w-tni-axis", x: pad2.l, y: 9, children: e.labels.metric }),
9063
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("text", { className: "ss-w-tni-axis", x: pad.l, y: 9, children: e.labels.metric }),
8988
9064
  ticks.map((t) => /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("g", { children: [
8989
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("line", { className: "ss-w-tni-grid", x1: pad2.l, x2: w - pad2.r, y1: yOf(t), y2: yOf(t) }),
8990
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("text", { className: "ss-w-tni-tick", x: pad2.l - 4, y: yOf(t) + 3, textAnchor: "end", children: pct(t, ui, 0) })
9065
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("line", { className: "ss-w-tni-grid", x1: pad.l, x2: w - pad.r, y1: yOf(t), y2: yOf(t) }),
9066
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("text", { className: "ss-w-tni-tick", x: pad.l - 4, y: yOf(t) + 3, textAnchor: "end", children: pct(t, ui, 0) })
8991
9067
  ] }, t)),
8992
9068
  bars.map((b, i) => {
8993
9069
  const m = e.matches[i];
@@ -8999,8 +9075,8 @@ function ServeFormCard({ vm, e, ui }) {
8999
9075
  /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("text", { className: "ss-w-tni-xl", x: cx, y: base + (i % 2 === 0 ? 22 : 32), textAnchor: "middle", children: fitLabel(m.opponent, formLabelWidth(slot), FORM_GLYPH_W) })
9000
9076
  ] }, m.matchId);
9001
9077
  }),
9002
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("line", { className: "ss-w-tni-tour", x1: pad2.l, x2: w - pad2.r, y1: tourY, y2: tourY }),
9003
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("text", { className: "ss-w-tni-lab ss-w-tni-lab-faint", x: w - pad2.r - 2, y: pad2.t - 4, textAnchor: "end", children: `${e.labels.tourAverage} ${pct(e.tourServePct, ui)}` })
9078
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("line", { className: "ss-w-tni-tour", x1: pad.l, x2: w - pad.r, y1: tourY, y2: tourY }),
9079
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("text", { className: "ss-w-tni-lab ss-w-tni-lab-faint", x: w - pad.r - 2, y: pad.t - 4, textAnchor: "end", children: `${e.labels.tourAverage} ${pct(e.tourServePct, ui)}` })
9004
9080
  ] }),
9005
9081
  /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "ss-w-tni-tiles", children: tiles.map((t) => /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "ss-w-tni-tile", children: [
9006
9082
  /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "ss-w-tni-tile-v", children: t.value }),
@@ -9009,12 +9085,12 @@ function ServeFormCard({ vm, e, ui }) {
9009
9085
  ] });
9010
9086
  }
9011
9087
  function SeasonPathCard({ vm, e, ui }) {
9012
- const { w, h, pad: pad2 } = PATH_VIEW;
9088
+ const { w, h, pad } = PATH_VIEW;
9013
9089
  const left = pathGutter(e);
9014
9090
  const bars = pathBars(e, left);
9015
9091
  const rounds = pathRounds(e);
9016
- const base = h - pad2.b;
9017
- const labelled = (w - pad2.l - pad2.r) / Math.max(e.events.length, 1) >= 22;
9092
+ const base = h - pad.b;
9093
+ const labelled = (w - pad.l - pad.r) / Math.max(e.events.length, 1) >= 22;
9018
9094
  const NAME_ROOM = 46;
9019
9095
  const namesShown = labelled && e.events.some((ev) => ev.name);
9020
9096
  const hasTitle = e.events.some((ev) => ev.title);
@@ -9023,10 +9099,10 @@ function SeasonPathCard({ vm, e, ui }) {
9023
9099
  return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
9024
9100
  /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("svg", { className: "ss-w-tni-svg", viewBox: `0 0 ${w} ${h + (namesShown ? NAME_ROOM : -14)}`, width: "100%", role: "img", "aria-label": summaryOf(vm, ui), children: [
9025
9101
  rounds.map((r) => /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("g", { children: [
9026
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("line", { className: "ss-w-tni-grid ss-w-tni-rline", x1: left, x2: w - pad2.r, y1: r.y, y2: r.y }),
9102
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("line", { className: "ss-w-tni-grid ss-w-tni-rline", x1: left, x2: w - pad.r, y1: r.y, y2: r.y }),
9027
9103
  /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("text", { className: "ss-w-tni-tick", x: left - 4, y: r.y + 3, textAnchor: "end", children: r.label })
9028
9104
  ] }, `r${r.roundIndex}`)),
9029
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("line", { className: "ss-w-tni-grid", x1: left, x2: w - pad2.r, y1: base, y2: base }),
9105
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("line", { className: "ss-w-tni-grid", x1: left, x2: w - pad.r, y1: base, y2: base }),
9030
9106
  bars.map((b, i) => {
9031
9107
  const ev = e.events[i];
9032
9108
  const surface = surfaceOf(b.surface);
@@ -9450,7 +9526,7 @@ function FixtureCard({ card, ui }) {
9450
9526
  // src/components/dashboard/CountdownCard.tsx
9451
9527
  var import_react50 = require("react");
9452
9528
  var import_jsx_runtime43 = require("react/jsx-runtime");
9453
- var DAY_MS2 = 864e5;
9529
+ var DAY_MS3 = 864e5;
9454
9530
  function remainingSegments(kickoffUnix, nowMs, withSeconds) {
9455
9531
  const totalSeconds = Math.floor((kickoffUnix * 1e3 - nowMs) / 1e3);
9456
9532
  if (totalSeconds <= 0) return null;
@@ -9458,10 +9534,10 @@ function remainingSegments(kickoffUnix, nowMs, withSeconds) {
9458
9534
  const hours = Math.floor(totalSeconds % 86400 / 3600);
9459
9535
  const minutes = Math.floor(totalSeconds % 3600 / 60);
9460
9536
  const seconds = totalSeconds % 60;
9461
- const pad2 = (n) => String(n).padStart(2, "0");
9462
- if (days > 0) return [{ value: pad2(days), unit: "d" }, { value: pad2(hours), unit: "h" }];
9463
- const segs = [{ value: pad2(hours), unit: "h" }, { value: pad2(minutes), unit: "m" }];
9464
- if (withSeconds) segs.push({ value: pad2(seconds), unit: "s" });
9537
+ const pad = (n) => String(n).padStart(2, "0");
9538
+ if (days > 0) return [{ value: pad(days), unit: "d" }, { value: pad(hours), unit: "h" }];
9539
+ const segs = [{ value: pad(hours), unit: "h" }, { value: pad(minutes), unit: "m" }];
9540
+ if (withSeconds) segs.push({ value: pad(seconds), unit: "s" });
9465
9541
  return segs;
9466
9542
  }
9467
9543
  function CountdownCard({ card, ui }) {
@@ -9471,7 +9547,7 @@ function CountdownCard({ card, ui }) {
9471
9547
  const [reduced] = (0, import_react50.useState)(
9472
9548
  () => typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches
9473
9549
  );
9474
- const withinDay = data.kickoffUnix * 1e3 - nowMs < DAY_MS2;
9550
+ const withinDay = data.kickoffUnix * 1e3 - nowMs < DAY_MS3;
9475
9551
  (0, import_react50.useEffect)(() => {
9476
9552
  if (reduced) return;
9477
9553
  const id = window.setInterval(() => setNowMs(Date.now()), withinDay ? 1e3 : 6e4);
@@ -10499,7 +10575,7 @@ function MarketAccordion({ match, monitor, ui, slip }) {
10499
10575
  // src/components/LiveFactBlock.tsx
10500
10576
  var import_react61 = require("react");
10501
10577
  var import_jsx_runtime70 = require("react/jsx-runtime");
10502
- function LiveFactBlock({ facts, matchId, ui, slip, onAsk }) {
10578
+ function LiveFactBlock({ facts, match, ui, slip, onAsk }) {
10503
10579
  const [expanded, setExpanded] = (0, import_react61.useState)(false);
10504
10580
  const { oddsFormat } = useOddsSettings();
10505
10581
  const [current, ...earlier] = facts;
@@ -10528,7 +10604,7 @@ function LiveFactBlock({ facts, matchId, ui, slip, onAsk }) {
10528
10604
  /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
10529
10605
  SlipButton,
10530
10606
  {
10531
- selection: chipSelection(m, matchId, slip.conversationId),
10607
+ selection: chipSelection(m, match, slip.conversationId),
10532
10608
  marketDeveloperName: m.marketDeveloperName,
10533
10609
  selectionLabel: m.selectionLabel,
10534
10610
  slip,
@@ -10550,7 +10626,7 @@ function LiveFactBlock({ facts, matchId, ui, slip, onAsk }) {
10550
10626
  {
10551
10627
  type: "button",
10552
10628
  className: "ss-w-fact-link",
10553
- onClick: () => onAsk(current.text, { kind: "liveFact", matchId, subject: current.text.slice(0, 400) }),
10629
+ onClick: () => onAsk(current.text, { kind: "liveFact", matchId: match.matchId, subject: current.text.slice(0, 400) }),
10554
10630
  children: ui.liveFactAsk
10555
10631
  }
10556
10632
  ),
@@ -10741,11 +10817,11 @@ function MonitorMatchCard({ match, promotedPins, monitor, ui, slip, onAsk }) {
10741
10817
  /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("span", { className: "ss-w-mon-scorers-ball", "aria-hidden": "true", children: "\u26BD" }),
10742
10818
  /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("ul", { className: "ss-w-mon-scorers-col ss-w-mon-scorers-away", children: awayScorers.map((s, i) => /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("li", { children: s.label }, `${s.player}-${i}`)) })
10743
10819
  ] }),
10744
- live && match.facts && match.facts.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(LiveFactBlock, { facts: match.facts, matchId: match.matchId, ui, slip, onAsk }),
10820
+ live && match.facts && match.facts.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(LiveFactBlock, { facts: match.facts, match, ui, slip, onAsk }),
10745
10821
  /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("div", { className: "ss-w-mon-stats", children: orderedRows.map((row) => {
10746
10822
  const { home, away } = splitWidths2(row.homeNum, row.awayNum);
10747
10823
  const promoted = isPromoted(row, promotedPins);
10748
- const selection = chipSelection(row.market, match.matchId, slip.conversationId);
10824
+ const selection = chipSelection(row.market, match, slip.conversationId);
10749
10825
  const chipPrice = row.market ? chipPriceText(row.market, oddsFormat) : void 0;
10750
10826
  return /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { className: promoted ? "ss-w-mon-stat ss-w-mon-pstrip" : "ss-w-mon-stat", children: [
10751
10827
  /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { className: "ss-w-mon-stat-row", children: [
@@ -10779,7 +10855,7 @@ function MonitorMatchCard({ match, promotedPins, monitor, ui, slip, onAsk }) {
10779
10855
  ] })
10780
10856
  ] }, row.label);
10781
10857
  }) }),
10782
- match.status === "stale" && /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("span", { className: "ss-w-mon-asof", children: ui.asOf(formatTime(match.asOfUtc, ui.locale, clockOf(ui))) }),
10858
+ match.status === "stale" && /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("span", { className: "ss-w-mon-asof", children: ui.asOf(formatTime(match.asOfUtc, ui.locale, clockOf(ui), { timeZone: ui.timeZone })) }),
10783
10859
  match.momentum.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { className: "ss-w-mon-mom", children: [
10784
10860
  /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("span", { className: "ss-w-mon-stat-l", children: ui.momentumLabel }),
10785
10861
  /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(MomentumWave, { points: match.momentum, label: ui.momentumLabel, clubIsHome: true })
@@ -10999,7 +11075,7 @@ function usePropsOpen(match, monitor, descriptor) {
10999
11075
  }, [match.matchId, match.asOfUtc, open]);
11000
11076
  return { bundle: monitor.playerProps?.[monitorMatchKey(sport, match.matchId)]?.bundle, live, open };
11001
11077
  }
11002
- function PropPrice({ price, label, ariaName, stat, bundle, descriptor, ui, slip }) {
11078
+ function PropPrice({ price, label, ariaName, player, stat, bundle, descriptor, ui, slip }) {
11003
11079
  const { oddsFormat } = useOddsSettings();
11004
11080
  const shown2 = formatOdds(price.priceFormats, oddsFormat);
11005
11081
  if (bundle.addToSlipEnabled && takesSport(slip, descriptor.sport)) {
@@ -11015,7 +11091,7 @@ function PropPrice({ price, label, ariaName, stat, bundle, descriptor, ui, slip
11015
11091
  return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
11016
11092
  SlipButton,
11017
11093
  {
11018
- selection,
11094
+ selection: withMatch(selection, { home: bundle.homeAbbreviation, away: bundle.awayAbbreviation, kickoffUtc: bundle.startsAtUtc, marketLabel: stat.label, player }),
11019
11095
  marketDeveloperName: stat.marketDeveloperName,
11020
11096
  selectionLabel: price.label,
11021
11097
  line: price.line != null ? String(price.line) : void 0,
@@ -11076,7 +11152,7 @@ function PropPlayerPanel({ player: given, bundle, descriptor, ui, slip }) {
11076
11152
  const hitsOf = (price, text2) => descriptor.showHits && sample > 0 && price.hits != null ? text2(price.hits) : null;
11077
11153
  const bars = active ? descriptor.bars(active, player) : [];
11078
11154
  const title = typeof descriptor.barsTitle === "function" ? descriptor.barsTitle(bars.length, bars.some((b) => b.live)) : descriptor.barsTitle;
11079
- const priceProps = { bundle, descriptor, ui, slip };
11155
+ const priceProps = { bundle, descriptor, ui, slip, player: player.name };
11080
11156
  const liveValue = (s) => hasLiveLine(player) ? descriptor.live?.(s, player) ?? null : null;
11081
11157
  const liveChips = stats.some((s) => liveValue(s) !== null);
11082
11158
  return /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { className: "ss-w-props-panel", children: [
@@ -11567,6 +11643,7 @@ function Trends({ bundle, facts, descriptor, ui, slip }) {
11567
11643
  price: f.price,
11568
11644
  label: "",
11569
11645
  ariaName: `${f.playerName}, ${bet}`,
11646
+ player: f.playerName,
11570
11647
  stat: f,
11571
11648
  bundle,
11572
11649
  descriptor,
@@ -11582,7 +11659,7 @@ function Trends({ bundle, facts, descriptor, ui, slip }) {
11582
11659
  function Scorers({ bundle, scorers, abbreviations, descriptor, ui, slip }) {
11583
11660
  const [all, setAll] = (0, import_react67.useState)(false);
11584
11661
  const shown2 = all ? scorers : scorers.slice(0, SCORERS_SHOWN);
11585
- const cell2 = (name, column, price, stat) => price && stat ? /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(PropPrice, { price, label: "", ariaName: `${name}, ${column}`, stat, bundle, descriptor, ui, slip }) : /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("span", { className: "ss-w-props-scorer-none", children: "\u2014" });
11662
+ const cell2 = (name, column, price, stat) => price && stat ? /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(PropPrice, { price, label: "", ariaName: `${name}, ${column}`, player: name, stat, bundle, descriptor, ui, slip }) : /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("span", { className: "ss-w-props-scorer-none", children: "\u2014" });
11586
11663
  return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "ss-w-props-scorers", children: [
11587
11664
  /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "ss-w-props-scorer ss-w-props-scorer-head", children: [
11588
11665
  /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("span", { children: ui.nfl.propsPlayer }),
@@ -11806,12 +11883,11 @@ function splitAtFirstSpace(label) {
11806
11883
  const i = label.indexOf(" ");
11807
11884
  return i > 0 && i < label.length - 1 ? [label.slice(0, i), label.slice(i + 1)] : null;
11808
11885
  }
11809
- function isOtherLocalDay(kickoffUnix, now) {
11810
- const at2 = new Date(kickoffUnix * 1e3);
11811
- return at2.getFullYear() !== now.getFullYear() || at2.getMonth() !== now.getMonth() || at2.getDate() !== now.getDate();
11886
+ function isOtherLocalDay(kickoffUnix, now, timeZone) {
11887
+ return zonedDayNumber(kickoffUnix * 1e3, timeZone) !== zonedDayNumber(now.getTime(), timeZone);
11812
11888
  }
11813
- function kickoffLabel(kickoffUnix, tag2, clock3) {
11814
- return formatTime(kickoffUnix * 1e3, tag2, clock3);
11889
+ function kickoffLabel(kickoffUnix, tag2, clock3, timeZone) {
11890
+ return formatTime(kickoffUnix * 1e3, tag2, clock3, { timeZone });
11815
11891
  }
11816
11892
  function Side2({ name, crest, abbr, away = false }) {
11817
11893
  return /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("span", { className: away ? "ss-w-drow-side ss-w-drow-side--away" : "ss-w-drow-side", children: [
@@ -11829,12 +11905,12 @@ function rowStatusOf(state, stale, ui) {
11829
11905
  }
11830
11906
  function FixtureRow({ match, state, stale, ui, monitor, onOpen }) {
11831
11907
  const { isLive, hasScore, score, ticked, when: clock3 } = rowStatusOf(state, stale, ui);
11832
- const when = clock3 ?? kickoffLabel(match.kickoffUnix, ui.locale, clockOf(ui));
11908
+ const when = clock3 ?? kickoffLabel(match.kickoffUnix, ui.locale, clockOf(ui), ui.timeZone);
11833
11909
  const isUsSport = sportKeyOf(match.sport) !== "football";
11834
11910
  const pinSport = (0, import_widget_sdk25.slipSportOf)(match.sport);
11835
11911
  const liveTone = isLive || state?.isHalfTime;
11836
11912
  const clockParts = isUsSport && isLive && ticked !== null && !state?.isHalfTime ? splitAtFirstSpace(ticked) : null;
11837
- const dayMarker = isUsSport && !liveTone && state?.phase !== "live" && isOtherLocalDay(match.kickoffUnix, /* @__PURE__ */ new Date()) ? formatDate(match.kickoffUnix * 1e3, ui.locale, { weekday: "short" }) : null;
11913
+ const dayMarker = isUsSport && !liveTone && state?.phase !== "live" && isOtherLocalDay(match.kickoffUnix, /* @__PURE__ */ new Date(), ui.timeZone) ? formatDate(match.kickoffUnix * 1e3, ui.locale, { weekday: "short", timeZone: ui.timeZone }) : null;
11838
11914
  const twoLines = clockParts ?? (dayMarker !== null ? [when, dayMarker] : null);
11839
11915
  const whenClass = [
11840
11916
  "ss-w-drow-when",
@@ -11898,12 +11974,12 @@ var hasGames = (s) => s.sets.some((x) => (x.p1Games ?? 0) > 0 || (x.p2Games ?? 0
11898
11974
 
11899
11975
  // src/components/TennisFixtureRow.tsx
11900
11976
  var import_jsx_runtime85 = require("react/jsx-runtime");
11901
- function TennisSidePrice({ matchId, tour, price, forms, value, oddsId, player, ui, slip, name, lead, movedLabel }) {
11977
+ function TennisSidePrice({ matchId, tour, pair, price, forms, value, oddsId, player, ui, slip, name, lead, movedLabel }) {
11902
11978
  const { oddsFormat } = useOddsSettings();
11903
11979
  const added = useSlipState()?.added;
11904
11980
  const slipAllowed = !!slip && price.addToSlipEnabled && slipOpenFor(slip, "tennis");
11905
11981
  const label = formatOdds(forms, oddsFormat);
11906
- const selection = slipAllowed && oddsId != null ? {
11982
+ const selection = slipAllowed && oddsId != null ? withMatch({
11907
11983
  matchOddsId: oddsId,
11908
11984
  matchId,
11909
11985
  oddsDecimal: value,
@@ -11912,7 +11988,7 @@ function TennisSidePrice({ matchId, tour, price, forms, value, oddsId, player, u
11912
11988
  sport: "tennis",
11913
11989
  ...tour ? { tour } : {},
11914
11990
  ...slip.conversationId !== void 0 ? { conversationId: slip.conversationId } : {}
11915
- } : null;
11991
+ }, pair) : null;
11916
11992
  const inSlip = oddsId != null && !!added?.[slipKey({ matchOddsId: oddsId, sport: "tennis" })];
11917
11993
  const ariaLabel = `${player} ${label}${movedLabel ? `, ${movedLabel}` : ""}`;
11918
11994
  if (selection) {
@@ -11948,7 +12024,14 @@ function TennisSidePrice({ matchId, tour, price, forms, value, oddsId, player, u
11948
12024
  ] });
11949
12025
  }
11950
12026
  function TennisPriceCell({ match, price, ui, slip }) {
11951
- const common = { matchId: match.matchId, tour: match.tour, price, ui, slip };
12027
+ const common = {
12028
+ matchId: match.matchId,
12029
+ tour: match.tour,
12030
+ price,
12031
+ ui,
12032
+ slip,
12033
+ pair: { home: match.homeTeamName, away: match.awayTeamName, kickoffUtc: match.kickoffUnix > 0 ? new Date(match.kickoffUnix * 1e3).toISOString() : null }
12034
+ };
11952
12035
  return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("span", { className: "ss-w-trow-prices", children: [
11953
12036
  /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(TennisSidePrice, { ...common, forms: price.p1, value: price.p1Value, oddsId: price.p1OddsId, player: match.homeTeamName }),
11954
12037
  /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(TennisSidePrice, { ...common, forms: price.p2, value: price.p2Value, oddsId: price.p2OddsId, player: match.awayTeamName })
@@ -12004,7 +12087,7 @@ function TennisFixtureRow({ match, state, stale, ui, prices, slip, monitor }) {
12004
12087
  live ? /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("span", { className: "ss-w-trow-when ss-w-trow-live", children: [
12005
12088
  ui.liveLabel,
12006
12089
  setLabel ? /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "ss-w-trow-set", children: setLabel }) : null
12007
- ] }) : endMark ? /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "ss-w-trow-when ss-w-trow-when--end", children: endMark }) : match.timeTba ? /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "ss-w-trow-when ss-w-trow-when--tba", children: ui.tennis.timeTba }) : /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "ss-w-trow-when", children: kickoffLabel(match.kickoffUnix, ui.locale, clockOf(ui)) }),
12090
+ ] }) : endMark ? /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "ss-w-trow-when ss-w-trow-when--end", children: endMark }) : match.timeTba ? /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "ss-w-trow-when ss-w-trow-when--tba", children: ui.tennis.timeTba }) : /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "ss-w-trow-when", children: kickoffLabel(match.kickoffUnix, ui.locale, clockOf(ui), ui.timeZone) }),
12008
12091
  pinned ? /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("button", { type: "button", className: "ss-w-trow-players ss-w-trow-open", onClick: open, children: players }) : /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "ss-w-trow-players", children: players }),
12009
12092
  showPrices && (entry === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "ss-w-trow-prices" }) : entry === null ? /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "ss-w-trow-prices", children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "ss-w-trow-noodds", children: ui.tennis.noOdds }) }) : /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(TennisPriceCell, { match, price: entry, ui, slip })),
12010
12093
  pinnable && monitor && pin && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(PinToggle, { ui, monitor, pin })
@@ -12156,7 +12239,7 @@ function WinnerPrice({ match, t, price, ui, slip }) {
12156
12239
  const liveBlock = t.live ?? null;
12157
12240
  const paused = !!liveBlock?.pricesPaused;
12158
12241
  const effective = price && paused ? { ...price, addToSlipEnabled: false } : price;
12159
- const common = effective ? { matchId: match.matchId, tour: t.header.tour, price: effective, ui, slip } : null;
12242
+ const common = effective ? { matchId: match.matchId, tour: t.header.tour, price: effective, ui, slip, pair: { home: t.p1.name, away: t.p2.name, kickoffUtc: t.header.startsAtUtc } } : null;
12160
12243
  const moved = price && (direction(price.p1Direction) || direction(price.p2Direction));
12161
12244
  const since = price?.previousAtUtc ? ui.bettingKickoff(price.previousAtUtc).dayLabel : null;
12162
12245
  const sides = price && common ? [
@@ -12599,7 +12682,7 @@ function OddsLiveStrip({ m, ui }) {
12599
12682
  m.minuteLabel && /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("span", { className: "ss-w-mon-min", children: m.minuteLabel }),
12600
12683
  m.isSuspended && !m.isSettled && /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("span", { className: "ss-w-mon-susp", children: ui.suspendedLabel }),
12601
12684
  m.isSettled && /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("span", { className: "ss-w-mon-pill", children: ui.fullTimeLabel }),
12602
- stale && /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("span", { className: "ss-w-mon-asof", children: ui.asOf(formatTime(m.asOfUtc, ui.locale, clockOf(ui))) })
12685
+ stale && /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("span", { className: "ss-w-mon-asof", children: ui.asOf(formatTime(m.asOfUtc, ui.locale, clockOf(ui), { timeZone: ui.timeZone })) })
12603
12686
  ] });
12604
12687
  }
12605
12688
  function MatchesPanel({ monitor, ui, slip, onAsk, discovery }) {
@@ -12726,7 +12809,7 @@ var countryThenName = (a, b) => {
12726
12809
  };
12727
12810
  function matchSections(a) {
12728
12811
  const live = (m) => isTreatedLive(a.states.get(keyOf3(m)), a.stale);
12729
- const offset = offsetOf(a.date);
12812
+ const offset = offsetOf(a.date, a.timeZone);
12730
12813
  const onDate = (m) => localDateOfUnix(m.kickoffUnix, offset) === a.date;
12731
12814
  const afterMidnight = [];
12732
12815
  const built = [];
@@ -12909,8 +12992,8 @@ function useModalDialog(onClose, opts = {}) {
12909
12992
 
12910
12993
  // src/components/MatchSheet.tsx
12911
12994
  var import_jsx_runtime95 = require("react/jsx-runtime");
12912
- function kickoffDate(kickoffUnix, lang) {
12913
- return formatDate(kickoffUnix * 1e3, lang, { weekday: "short", day: "numeric", month: "short" });
12995
+ function kickoffDate(kickoffUnix, lang, timeZone) {
12996
+ return formatDate(kickoffUnix * 1e3, lang, { weekday: "short", day: "numeric", month: "short", timeZone });
12914
12997
  }
12915
12998
  function MatchSheet({ match, league, state, stale, ui, monitor, onAsk, onClose, opener }) {
12916
12999
  const { dialogRef, onKeyDown } = useModalDialog(onClose, { opener });
@@ -12963,7 +13046,7 @@ function MatchSheet({ match, league, state, stale, ui, monitor, onAsk, onClose,
12963
13046
  };
12964
13047
  const { score, when } = rowStatusOf(state, stale, ui);
12965
13048
  const statusParts = [when, score].filter((v) => v !== null && v !== void 0);
12966
- const status2 = statusParts.length > 0 ? statusParts.join(" \xB7 ") : ui.kickoffLine(kickoffDate(match.kickoffUnix, ui.locale), kickoffLabel(match.kickoffUnix, ui.locale, clockOf(ui)));
13049
+ const status2 = statusParts.length > 0 ? statusParts.join(" \xB7 ") : ui.kickoffLine(kickoffDate(match.kickoffUnix, ui.locale, ui.timeZone), kickoffLabel(match.kickoffUnix, ui.locale, clockOf(ui), ui.timeZone));
12967
13050
  return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { className: "ss-w-tool-backdrop ss-w-sheet-backdrop", onClick: onBackdrop, children: /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("div", { ref: dialogRef, className: "ss-w-tool ss-w-sheet", role: "dialog", "aria-modal": "true", "aria-labelledby": titleId, tabIndex: -1, onKeyDown, children: [
12968
13051
  /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("div", { className: "ss-w-tool-head", children: [
12969
13052
  /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("h2", { id: titleId, className: "ss-w-tool-title", children: [
@@ -13320,7 +13403,8 @@ function ScheduleMatchesPanel({ discovery, ui, monitor, sport, offered, onSport,
13320
13403
  pinnedKeys,
13321
13404
  isToday,
13322
13405
  date: selected,
13323
- query: q
13406
+ query: q,
13407
+ timeZone: ui.timeZone
13324
13408
  });
13325
13409
  const priced = sectionsFor("");
13326
13410
  const { sections, afterMidnight } = searching ? sectionsFor(query) : priced;
@@ -16752,8 +16836,8 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, slip, spor
16752
16836
  send(requestFor(next));
16753
16837
  }, [empty2, singles, widened, canWiden, view]);
16754
16838
  (0, import_react97.useEffect)(() => {
16755
- if (coolOff) onCoolOff?.();
16756
- }, [coolOff, onCoolOff]);
16839
+ if (coolOff) onCoolOff?.(sport);
16840
+ }, [coolOff, onCoolOff, sport]);
16757
16841
  if (coolOff) return null;
16758
16842
  const nextGames = preset.nextGames?.trim() || null;
16759
16843
  const nextAtMs = instantMs(preset.nextGamesAtUtc);
@@ -16862,7 +16946,7 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, slip, spor
16862
16946
  void request(lastRequest.current);
16863
16947
  } }) : null
16864
16948
  ] }),
16865
- 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))) }) : null
16949
+ 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
16866
16950
  ] }) : null
16867
16951
  ] }) : null });
16868
16952
  }
@@ -18450,7 +18534,10 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
18450
18534
  .ss-w-combo-leg-market { font-size: 11.5px; font-weight: 600; line-height: 1.25; color: var(--ss-w-faint); overflow-wrap: break-word; }
18451
18535
  .ss-w-combo-leg-sel { font-size: 13px; font-weight: 700; line-height: 1.2; color: var(--ss-w-ink); overflow-wrap: break-word; }
18452
18536
  .ss-w-combo-leg-price { flex: none; font-family: ui-monospace, monospace; font-variant-numeric: tabular-nums; font-size: 17px; font-weight: 800; line-height: 1.05; color: var(--ss-w-accent); }
18453
- .ss-w-combo-leg-pick .ss-w-slip { flex: none; }
18537
+ .ss-w-combo-leg-pick .ss-w-slip { display: contents; }
18538
+ .ss-w-combo-leg-pick .ss-w-slip-btn { flex: none; }
18539
+ .ss-w-combo-leg .ss-w-bi-team { white-space: normal; text-overflow: clip; overflow-wrap: break-word; line-height: 1.25; }
18540
+ .ss-w-combo-leg-pick .ss-w-toast { position: static; flex-basis: 100%; width: auto; max-width: none; box-shadow: none; }
18454
18541
  .ss-w-combo-leg-stat { font-size: 12px; line-height: 1.45; color: var(--ss-w-ink); background: var(--ss-w-bubble); border-radius: 8px; padding: 6px 9px; }
18455
18542
  .ss-w-combo-math { font-family: ui-monospace, monospace; font-variant-numeric: tabular-nums; font-size: 14px; font-weight: 700; line-height: 1.4; color: var(--ss-w-ink); text-align: right; background: color-mix(in srgb, var(--ss-w-accent) 9%, var(--ss-w-panel)); border-radius: 8px; padding: 8px 10px; overflow-wrap: anywhere; }
18456
18543
  .ss-w-combo-note { font-size: 11px; line-height: 1.4; color: var(--ss-w-faint); }
@@ -20707,7 +20794,8 @@ function StatsWidget(props) {
20707
20794
  operatorUserId,
20708
20795
  anonymousUserId,
20709
20796
  isOpen: panelOpen,
20710
- pinnedMatchIds
20797
+ pinnedMatchIds,
20798
+ timeZone: ui.timeZone
20711
20799
  });
20712
20800
  const offeredSports = (0, import_react102.useMemo)(() => {
20713
20801
  const seen = new Set(discovery.matchDays.map((d) => d.sport));
@@ -20722,7 +20810,8 @@ function StatsWidget(props) {
20722
20810
  day: matchesDay,
20723
20811
  sport: scheduleSport.sport,
20724
20812
  getSchedule,
20725
- enabled: panelOpen && monitor.activeTab === "matches"
20813
+ enabled: panelOpen && monitor.activeTab === "matches",
20814
+ timeZone: ui.timeZone
20726
20815
  });
20727
20816
  const prevLiveSnapshotRef = (0, import_react102.useRef)(monitor.snapshot);
20728
20817
  (0, import_react102.useEffect)(() => {
@@ -20786,17 +20875,26 @@ function StatsWidget(props) {
20786
20875
  () => [...controller.state.messages].reverse().find((m) => m.role === "assistant" && (m.greetingDashboard !== void 0 || m.greetingDashboards !== void 0)) ?? null,
20787
20876
  [controller.state.messages]
20788
20877
  );
20789
- const [coolOffGreeting, setCoolOffGreeting] = (0, import_react102.useState)(null);
20790
- const onBuilderCoolOff = (0, import_react102.useCallback)(() => setCoolOffGreeting(builderGreeting), [builderGreeting]);
20878
+ const [coolOff, setCoolOff] = (0, import_react102.useState)(null);
20879
+ const onBuilderCoolOff = (0, import_react102.useCallback)((sport) => {
20880
+ if (!builderGreeting) return;
20881
+ setCoolOff((prev) => {
20882
+ const sports = prev?.greeting === builderGreeting ? prev.sports : [];
20883
+ return sports.includes(sport) ? prev : { greeting: builderGreeting, sports: [...sports, sport] };
20884
+ });
20885
+ }, [builderGreeting]);
20791
20886
  const builderOptions = (0, import_react102.useMemo)(() => {
20792
20887
  const greeting = builderGreeting;
20793
- if (!greeting || greeting === coolOffGreeting) return [];
20888
+ if (!greeting) return [];
20889
+ const cooled = coolOff?.greeting === greeting ? coolOff.sports : [];
20794
20890
  const sets = switchSets(greeting.greetingDashboards);
20795
- if (sets) return sets.flatMap((s) => s.dashboard.personal?.builder ? [{ sport: s.sport, label: s.label, preset: s.dashboard.personal.builder }] : []);
20796
- const preset = greeting.greetingDashboard?.personal?.builder;
20797
- const sport = greeting.defaultSport || "football";
20798
- return preset ? [{ sport, label: sportLabel(ui, sport), preset }] : [];
20799
- }, [builderGreeting, coolOffGreeting, ui]);
20891
+ const options = sets ? sets.flatMap((s) => s.dashboard.personal?.builder ? [{ sport: s.sport, label: s.label, preset: s.dashboard.personal.builder }] : []) : (() => {
20892
+ const preset = greeting.greetingDashboard?.personal?.builder;
20893
+ const sport = greeting.defaultSport || "football";
20894
+ return preset ? [{ sport, label: sportLabel(ui, sport), preset }] : [];
20895
+ })();
20896
+ return options.filter((o) => !cooled.includes(o.sport));
20897
+ }, [builderGreeting, coolOff, ui]);
20800
20898
  const builderSport = [builderSportPick, rememberedSport, latestGreeting?.defaultSport].find((s) => !!s && builderOptions.some((o) => o.sport === s)) ?? builderOptions[0]?.sport ?? "";
20801
20899
  const [panelEverOpened, setPanelEverOpened] = (0, import_react102.useState)(panelOpen);
20802
20900
  if (panelOpen && !panelEverOpened) setPanelEverOpened(true);