@sensiblestats/widget-react 0.85.0 → 0.86.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/index.cjs +767 -283
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +762 -278
- package/dist/index.js.map +1 -1
- package/dist/styles.css +100 -15
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -37,7 +37,7 @@ __export(index_exports, {
|
|
|
37
37
|
module.exports = __toCommonJS(index_exports);
|
|
38
38
|
|
|
39
39
|
// src/StatsWidget.tsx
|
|
40
|
-
var
|
|
40
|
+
var import_react69 = require("react");
|
|
41
41
|
var import_widget_sdk6 = require("@sensiblestats/widget-sdk");
|
|
42
42
|
|
|
43
43
|
// src/kickoff.ts
|
|
@@ -53,8 +53,13 @@ function formatBettingKickoff(kickoffUtc, ui, locale, now = /* @__PURE__ */ new
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
// src/i18n.ts
|
|
56
|
+
var GROUP_NOUN_EN = { G: "goalkeepers", D: "defenders", M: "midfielders", F: "forwards" };
|
|
57
|
+
var GROUP_NOUN_TR = { G: "kalecileri", D: "defans oyuncular\u0131", M: "orta saha oyuncular\u0131", F: "forvetleri" };
|
|
56
58
|
var formatPtsEn = (n) => new Intl.NumberFormat("en-GB").format(n);
|
|
57
59
|
var formatPtsTr = (n) => new Intl.NumberFormat("tr-TR").format(n);
|
|
60
|
+
var nbsp = (s) => s.replace(/\s/g, "\xA0");
|
|
61
|
+
var pdDateEn = (ms, opts) => nbsp(new Intl.DateTimeFormat("en-GB", opts).format(new Date(ms)).replace("Sept", "Sep"));
|
|
62
|
+
var pdDateTr = (ms, opts) => nbsp(new Intl.DateTimeFormat("tr-TR", opts).format(new Date(ms)));
|
|
58
63
|
var STRINGS = {
|
|
59
64
|
en: {
|
|
60
65
|
launcherLabel: "Chat with SensibleStats",
|
|
@@ -190,6 +195,60 @@ var STRINGS = {
|
|
|
190
195
|
recordsMostAssists: "Most assists",
|
|
191
196
|
recordsSince: "Since {season}",
|
|
192
197
|
standingsColClub: "Club",
|
|
198
|
+
statHeadPos: "Pos",
|
|
199
|
+
statHeadMins: "Mins",
|
|
200
|
+
statHeadGoals: "G",
|
|
201
|
+
statHeadAssists: "A",
|
|
202
|
+
statHeadYellow: "Y",
|
|
203
|
+
statHeadRed: "R",
|
|
204
|
+
statHeadRating: "Rtg",
|
|
205
|
+
squadStatsEyebrow: (season, competition, n) => `${season} ${competition} \xB7 after ${n} game${n === 1 ? "" : "s"}`,
|
|
206
|
+
squadTopScorer: (name, n) => `Top scorer: ${name} (${n})`,
|
|
207
|
+
squadTopAssists: (name, n) => `Most assists: ${name} (${n})`,
|
|
208
|
+
detailStarted: "Started",
|
|
209
|
+
detailMatches: "Matches",
|
|
210
|
+
detailNatShort: "Nat.",
|
|
211
|
+
detailYellows: "Yellows",
|
|
212
|
+
detailReds: "Reds",
|
|
213
|
+
availabilityNext: (opponent, isHome, kickoffMs) => `Next: ${isHome ? "vs" : "at"} ${opponent} (${isHome ? "H" : "A"})` + (kickoffMs !== null && kickoffMs > 0 ? ` \xB7 ${pdDateEn(kickoffMs, { weekday: "short", day: "numeric", month: "short" })}` : ""),
|
|
214
|
+
availabilityAvailable: "Available",
|
|
215
|
+
availabilityInjured: "Injured",
|
|
216
|
+
availabilitySuspended: "Suspended",
|
|
217
|
+
availabilityUnavailable: "Unavailable",
|
|
218
|
+
availabilityNoConcerns: "No fitness concerns reported",
|
|
219
|
+
availabilityBack: (ms) => `Expected back ${pdDateEn(ms, { day: "numeric", month: "short" })}`,
|
|
220
|
+
perfTitle: "Season performance",
|
|
221
|
+
perfTotal: "Total",
|
|
222
|
+
perfPer90: "Per 90",
|
|
223
|
+
perfRankedAgainst: (competition, group) => `Ranked against ${competition} ${GROUP_NOUN_EN[group] ?? group}`,
|
|
224
|
+
perfUnranked: "Not enough minutes to rank",
|
|
225
|
+
perfUnrankedCohort: "Not enough players in this position to rank",
|
|
226
|
+
perfUnrankedNoLeague: "Not ranked \u2014 no league data",
|
|
227
|
+
perfGroupShooting: "Shooting",
|
|
228
|
+
perfGroupPassing: "Passing",
|
|
229
|
+
perfGroupPossession: "Possession",
|
|
230
|
+
perfGroupDefending: "Defending",
|
|
231
|
+
perfMetric: {
|
|
232
|
+
goals: "Goals",
|
|
233
|
+
xg: "Expected goals (xG)",
|
|
234
|
+
shots: "Shots",
|
|
235
|
+
shotsOnTarget: "Shots on target",
|
|
236
|
+
assists: "Assists",
|
|
237
|
+
successfulPasses: "Successful passes",
|
|
238
|
+
passAccuracy: "Pass accuracy",
|
|
239
|
+
chancesCreated: "Chances created",
|
|
240
|
+
successfulDribbles: "Successful dribbles",
|
|
241
|
+
dribbleSuccess: "Dribble success",
|
|
242
|
+
touches: "Touches",
|
|
243
|
+
tacklesWon: "Tackles won",
|
|
244
|
+
interceptions: "Interceptions",
|
|
245
|
+
duelsWon: "Duels won"
|
|
246
|
+
},
|
|
247
|
+
perfGroupNoun: GROUP_NOUN_EN,
|
|
248
|
+
matchLogTitle: "Match log",
|
|
249
|
+
matchLogOpponent: (name, isHome) => isHome ? `vs ${name}` : `at ${name}`,
|
|
250
|
+
resultLetter: { W: "W", D: "D", L: "L" },
|
|
251
|
+
logShortDate: (ms) => pdDateEn(ms, { day: "numeric", month: "short" }),
|
|
193
252
|
standingsColPlayed: "P",
|
|
194
253
|
standingsColWon: "W",
|
|
195
254
|
standingsColDrawn: "D",
|
|
@@ -603,6 +662,60 @@ var STRINGS = {
|
|
|
603
662
|
recordsMostAssists: "En \xE7ok asist yapanlar",
|
|
604
663
|
recordsSince: "{season} sezonundan beri",
|
|
605
664
|
standingsColClub: "Tak\u0131m",
|
|
665
|
+
statHeadPos: "Mvk",
|
|
666
|
+
statHeadMins: "Dk",
|
|
667
|
+
statHeadGoals: "G",
|
|
668
|
+
statHeadAssists: "A",
|
|
669
|
+
statHeadYellow: "S",
|
|
670
|
+
statHeadRed: "K",
|
|
671
|
+
statHeadRating: "Puan",
|
|
672
|
+
squadStatsEyebrow: (season, competition, n) => `${season} ${competition} \xB7 ${n} ma\xE7 sonra`,
|
|
673
|
+
squadTopScorer: (name, n) => `Gol kral\u0131: ${name} (${n})`,
|
|
674
|
+
squadTopAssists: (name, n) => `Asist lideri: ${name} (${n})`,
|
|
675
|
+
detailStarted: "\u0130lk 11",
|
|
676
|
+
detailMatches: "Ma\xE7",
|
|
677
|
+
detailNatShort: "Uyruk",
|
|
678
|
+
detailYellows: "Sar\u0131",
|
|
679
|
+
detailReds: "K\u0131rm\u0131z\u0131",
|
|
680
|
+
availabilityNext: (opponent, isHome, kickoffMs) => `Sonraki: ${opponent} (${isHome ? "\u0130\xE7\xA0saha" : "Deplasman"})` + (kickoffMs !== null && kickoffMs > 0 ? ` \xB7 ${pdDateTr(kickoffMs, { day: "numeric", month: "short", weekday: "short" })}` : ""),
|
|
681
|
+
availabilityAvailable: "Haz\u0131r",
|
|
682
|
+
availabilityInjured: "Sakat",
|
|
683
|
+
availabilitySuspended: "Cezal\u0131",
|
|
684
|
+
availabilityUnavailable: "Haz\u0131r de\u011Fil",
|
|
685
|
+
availabilityNoConcerns: "Sakatl\u0131k bildirimi yok",
|
|
686
|
+
availabilityBack: (ms) => `D\xF6n\xFC\u015F: ${pdDateTr(ms, { day: "numeric", month: "short" })}`,
|
|
687
|
+
perfTitle: "Sezon performans\u0131",
|
|
688
|
+
perfTotal: "Toplam",
|
|
689
|
+
perfPer90: "90 dk",
|
|
690
|
+
perfRankedAgainst: (competition, group) => `${competition} ${GROUP_NOUN_TR[group] ?? group} aras\u0131nda`,
|
|
691
|
+
perfUnranked: "S\u0131ralama i\xE7in yeterli s\xFCre yok",
|
|
692
|
+
perfUnrankedCohort: "Bu mevkide s\u0131ralama i\xE7in yeterli oyuncu yok",
|
|
693
|
+
perfUnrankedNoLeague: "S\u0131ralanmad\u0131 \u2014 lig verisi yok",
|
|
694
|
+
perfGroupShooting: "\u015Eut",
|
|
695
|
+
perfGroupPassing: "Pas",
|
|
696
|
+
perfGroupPossession: "Top hakimiyeti",
|
|
697
|
+
perfGroupDefending: "Savunma",
|
|
698
|
+
perfMetric: {
|
|
699
|
+
goals: "Gol",
|
|
700
|
+
xg: "Gol beklentisi (xG)",
|
|
701
|
+
shots: "\u015Eut",
|
|
702
|
+
shotsOnTarget: "\u0130sabetli \u015Fut",
|
|
703
|
+
assists: "Asist",
|
|
704
|
+
successfulPasses: "Ba\u015Far\u0131l\u0131 pas",
|
|
705
|
+
passAccuracy: "Pas isabeti",
|
|
706
|
+
chancesCreated: "Yarat\u0131lan f\u0131rsat",
|
|
707
|
+
successfulDribbles: "Ba\u015Far\u0131l\u0131 \xE7al\u0131m",
|
|
708
|
+
dribbleSuccess: "\xC7al\u0131m ba\u015Far\u0131s\u0131",
|
|
709
|
+
touches: "Topla bulu\u015Fma",
|
|
710
|
+
tacklesWon: "Kazan\u0131lan m\xFCdahale",
|
|
711
|
+
interceptions: "Top kapma",
|
|
712
|
+
duelsWon: "Kazan\u0131lan ikili m\xFCcadele"
|
|
713
|
+
},
|
|
714
|
+
perfGroupNoun: GROUP_NOUN_TR,
|
|
715
|
+
matchLogTitle: "Ma\xE7 ge\xE7mi\u015Fi",
|
|
716
|
+
matchLogOpponent: (name, isHome) => isHome ? `${name} (\u0130)` : `${name} (D)`,
|
|
717
|
+
resultLetter: { W: "G", D: "B", L: "M" },
|
|
718
|
+
logShortDate: (ms) => pdDateTr(ms, { day: "numeric", month: "short" }),
|
|
606
719
|
standingsColPlayed: "O",
|
|
607
720
|
standingsColWon: "G",
|
|
608
721
|
standingsColDrawn: "B",
|
|
@@ -1013,6 +1126,45 @@ function normalizeUi(cfg) {
|
|
|
1013
1126
|
recordsMostAssists: strings.recordsMostAssists,
|
|
1014
1127
|
recordsSince: strings.recordsSince,
|
|
1015
1128
|
standingsColClub: strings.standingsColClub,
|
|
1129
|
+
statHeadPos: strings.statHeadPos,
|
|
1130
|
+
statHeadMins: strings.statHeadMins,
|
|
1131
|
+
statHeadGoals: strings.statHeadGoals,
|
|
1132
|
+
statHeadAssists: strings.statHeadAssists,
|
|
1133
|
+
statHeadYellow: strings.statHeadYellow,
|
|
1134
|
+
statHeadRed: strings.statHeadRed,
|
|
1135
|
+
statHeadRating: strings.statHeadRating,
|
|
1136
|
+
squadStatsEyebrow: strings.squadStatsEyebrow,
|
|
1137
|
+
squadTopScorer: strings.squadTopScorer,
|
|
1138
|
+
squadTopAssists: strings.squadTopAssists,
|
|
1139
|
+
detailStarted: strings.detailStarted,
|
|
1140
|
+
detailMatches: strings.detailMatches,
|
|
1141
|
+
detailNatShort: strings.detailNatShort,
|
|
1142
|
+
detailYellows: strings.detailYellows,
|
|
1143
|
+
detailReds: strings.detailReds,
|
|
1144
|
+
availabilityNext: strings.availabilityNext,
|
|
1145
|
+
availabilityAvailable: strings.availabilityAvailable,
|
|
1146
|
+
availabilityInjured: strings.availabilityInjured,
|
|
1147
|
+
availabilitySuspended: strings.availabilitySuspended,
|
|
1148
|
+
availabilityUnavailable: strings.availabilityUnavailable,
|
|
1149
|
+
availabilityNoConcerns: strings.availabilityNoConcerns,
|
|
1150
|
+
availabilityBack: strings.availabilityBack,
|
|
1151
|
+
perfTitle: strings.perfTitle,
|
|
1152
|
+
perfTotal: strings.perfTotal,
|
|
1153
|
+
perfPer90: strings.perfPer90,
|
|
1154
|
+
perfRankedAgainst: strings.perfRankedAgainst,
|
|
1155
|
+
perfUnranked: strings.perfUnranked,
|
|
1156
|
+
perfUnrankedCohort: strings.perfUnrankedCohort,
|
|
1157
|
+
perfUnrankedNoLeague: strings.perfUnrankedNoLeague,
|
|
1158
|
+
perfGroupShooting: strings.perfGroupShooting,
|
|
1159
|
+
perfGroupPassing: strings.perfGroupPassing,
|
|
1160
|
+
perfGroupPossession: strings.perfGroupPossession,
|
|
1161
|
+
perfGroupDefending: strings.perfGroupDefending,
|
|
1162
|
+
perfMetric: strings.perfMetric,
|
|
1163
|
+
perfGroupNoun: strings.perfGroupNoun,
|
|
1164
|
+
matchLogTitle: strings.matchLogTitle,
|
|
1165
|
+
matchLogOpponent: strings.matchLogOpponent,
|
|
1166
|
+
resultLetter: strings.resultLetter,
|
|
1167
|
+
logShortDate: strings.logShortDate,
|
|
1016
1168
|
standingsColPlayed: strings.standingsColPlayed,
|
|
1017
1169
|
standingsColWon: strings.standingsColWon,
|
|
1018
1170
|
standingsColDrawn: strings.standingsColDrawn,
|
|
@@ -3382,6 +3534,8 @@ var import_react12 = require("react");
|
|
|
3382
3534
|
function useClubSquadStats(conversation, { activeTab, enabled }) {
|
|
3383
3535
|
const [data, setData] = (0, import_react12.useState)(null);
|
|
3384
3536
|
const [seasonName, setSeasonName] = (0, import_react12.useState)(null);
|
|
3537
|
+
const [competitionName, setCompetitionName] = (0, import_react12.useState)(null);
|
|
3538
|
+
const [matchesPlayed, setMatchesPlayed] = (0, import_react12.useState)(null);
|
|
3385
3539
|
const [loading, setLoading] = (0, import_react12.useState)(false);
|
|
3386
3540
|
const [refreshCount, setRefreshCount] = (0, import_react12.useState)(0);
|
|
3387
3541
|
const inFlightRef = (0, import_react12.useRef)(false);
|
|
@@ -3400,6 +3554,8 @@ function useClubSquadStats(conversation, { activeTab, enabled }) {
|
|
|
3400
3554
|
if (active) {
|
|
3401
3555
|
setData(result?.players ?? null);
|
|
3402
3556
|
setSeasonName(result?.seasonName ?? null);
|
|
3557
|
+
setCompetitionName(result?.competitionName ?? null);
|
|
3558
|
+
setMatchesPlayed(result?.clubMatchesPlayed ?? null);
|
|
3403
3559
|
}
|
|
3404
3560
|
} catch {
|
|
3405
3561
|
} finally {
|
|
@@ -3417,7 +3573,7 @@ function useClubSquadStats(conversation, { activeTab, enabled }) {
|
|
|
3417
3573
|
setRefreshCount((c) => c + 1);
|
|
3418
3574
|
}, []);
|
|
3419
3575
|
const effectiveLoading = loading || activeTab === "squad" && enabled && data === null;
|
|
3420
|
-
return { data, seasonName, loading: effectiveLoading, refresh };
|
|
3576
|
+
return { data, seasonName, competitionName, matchesPlayed, loading: effectiveLoading, refresh };
|
|
3421
3577
|
}
|
|
3422
3578
|
|
|
3423
3579
|
// src/useClubPlayerDetail.ts
|
|
@@ -3817,7 +3973,7 @@ function ChatFab({ label, greeting, popupText, logoUrl, onOpen, onDismissPopup,
|
|
|
3817
3973
|
}
|
|
3818
3974
|
|
|
3819
3975
|
// src/components/ChatPanel.tsx
|
|
3820
|
-
var
|
|
3976
|
+
var import_react68 = require("react");
|
|
3821
3977
|
|
|
3822
3978
|
// src/components/ChatHeader.tsx
|
|
3823
3979
|
var import_react20 = require("react");
|
|
@@ -5507,11 +5663,14 @@ function LiveCrest({ url, name, side }) {
|
|
|
5507
5663
|
}
|
|
5508
5664
|
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: `${cls} ss-w-fandash-live-crest--fallback`, "aria-hidden": "true", children: initials5(name) });
|
|
5509
5665
|
}
|
|
5510
|
-
function
|
|
5511
|
-
if (!goalEvents || goalEvents.length === 0) return null;
|
|
5666
|
+
function scorersBySide(goalEvents) {
|
|
5667
|
+
if (!goalEvents || goalEvents.length === 0) return { home: null, away: null };
|
|
5512
5668
|
const named = goalEvents.filter((e) => e.type === "goal" && e.player);
|
|
5513
|
-
|
|
5514
|
-
|
|
5669
|
+
const line = (side) => {
|
|
5670
|
+
const scorers = named.filter((e) => e.side === side).slice().sort((a, b) => a.minute - b.minute).map((e) => `${e.player} ${e.minuteLabel}`);
|
|
5671
|
+
return scorers.length === 0 ? null : scorers.join(", ");
|
|
5672
|
+
};
|
|
5673
|
+
return { home: line("home"), away: line("away") };
|
|
5515
5674
|
}
|
|
5516
5675
|
function LiveScoreCard({
|
|
5517
5676
|
card,
|
|
@@ -5525,7 +5684,7 @@ function LiveScoreCard({
|
|
|
5525
5684
|
}
|
|
5526
5685
|
const displayMinute = useLiveClock(data.minute, data.clockRunning, seedRef.current.receivedAtMs);
|
|
5527
5686
|
const minuteSuffix = data.minuteLabel.replace(/^\d+/, "");
|
|
5528
|
-
const
|
|
5687
|
+
const { home: homeScorers, away: awayScorers } = scorersBySide(goalEvents);
|
|
5529
5688
|
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "ss-w-fandash-card ss-w-fandash-live-score", children: [
|
|
5530
5689
|
card.title ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "ss-w-fandash-eyebrow", children: card.title }) : null,
|
|
5531
5690
|
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "ss-w-fandash-live-top", children: [
|
|
@@ -5551,9 +5710,15 @@ function LiveScoreCard({
|
|
|
5551
5710
|
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "ss-w-fandash-live-team-name", children: data.awayName })
|
|
5552
5711
|
] })
|
|
5553
5712
|
] }),
|
|
5554
|
-
|
|
5555
|
-
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("
|
|
5556
|
-
|
|
5713
|
+
homeScorers || awayScorers ? /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "ss-w-fandash-live-scorers-row", children: [
|
|
5714
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "ss-w-fandash-live-scorers ss-w-fandash-live-scorers--home", children: homeScorers ? /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_jsx_runtime41.Fragment, { children: [
|
|
5715
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "ss-w-fandash-live-scorers-icon", "aria-hidden": "true", children: "\u26BD" }),
|
|
5716
|
+
homeScorers
|
|
5717
|
+
] }) : null }),
|
|
5718
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "ss-w-fandash-live-scorers ss-w-fandash-live-scorers--away", children: awayScorers ? /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_jsx_runtime41.Fragment, { children: [
|
|
5719
|
+
awayScorers,
|
|
5720
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "ss-w-fandash-live-scorers-icon", "aria-hidden": "true", children: "\u26BD" })
|
|
5721
|
+
] }) : null })
|
|
5557
5722
|
] }) : null
|
|
5558
5723
|
] });
|
|
5559
5724
|
}
|
|
@@ -10005,51 +10170,92 @@ function footLabel(ui, foot) {
|
|
|
10005
10170
|
return v;
|
|
10006
10171
|
}
|
|
10007
10172
|
}
|
|
10173
|
+
var GROUP_CODE = { Goalkeeper: "GK", Defender: "DF", Midfielder: "MF", Attacker: "FW" };
|
|
10174
|
+
function positionShort(code, positionName) {
|
|
10175
|
+
const c = code?.trim().toUpperCase() ?? "";
|
|
10176
|
+
if (c !== "") return c === "CF" || c === "SS" ? "ST" : c;
|
|
10177
|
+
return positionName !== null && GROUP_CODE[positionName] || "\u2013";
|
|
10178
|
+
}
|
|
10179
|
+
function statsEyebrow(ui, season, competition, matches) {
|
|
10180
|
+
if (season === null || competition === null || matches === null || matches <= 0) return null;
|
|
10181
|
+
return ui.squadStatsEyebrow(season, competition, matches);
|
|
10182
|
+
}
|
|
10008
10183
|
|
|
10009
10184
|
// src/components/SquadStats.tsx
|
|
10010
10185
|
var import_jsx_runtime97 = require("react/jsx-runtime");
|
|
10186
|
+
function leader(stats, pick) {
|
|
10187
|
+
let best = null;
|
|
10188
|
+
for (const p of stats) {
|
|
10189
|
+
if (pick(p) <= 0) continue;
|
|
10190
|
+
if (best === null || pick(p) > pick(best) || pick(p) === pick(best) && p.minutesPlayed < best.minutesPlayed) best = p;
|
|
10191
|
+
}
|
|
10192
|
+
return best;
|
|
10193
|
+
}
|
|
10194
|
+
function ratingClass(rating) {
|
|
10195
|
+
if (rating === null) return "ss-w-sq-c36 ss-w-sq-rtg-none";
|
|
10196
|
+
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";
|
|
10197
|
+
}
|
|
10011
10198
|
function SquadStats({ stats, loading, ui, onSelectPlayer }) {
|
|
10012
10199
|
if (stats === null && loading) return /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "ss-w-mon-list" });
|
|
10013
10200
|
if (stats === null || stats.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "ss-w-mon-empty", children: ui.clubSquadStatsEmpty });
|
|
10014
|
-
|
|
10015
|
-
|
|
10016
|
-
|
|
10017
|
-
|
|
10018
|
-
|
|
10019
|
-
|
|
10020
|
-
|
|
10021
|
-
|
|
10022
|
-
|
|
10023
|
-
|
|
10024
|
-
|
|
10025
|
-
|
|
10026
|
-
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { className: "ss-w-sq-
|
|
10027
|
-
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { className: "ss-w-sq-
|
|
10028
|
-
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { className: "ss-w-sq-
|
|
10029
|
-
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { className: "ss-w-sq-
|
|
10030
|
-
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { className: "ss-w-sq-
|
|
10031
|
-
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { className: "ss-w-sq-
|
|
10201
|
+
const scorer = leader(stats, (p) => p.goals);
|
|
10202
|
+
const assister = leader(stats, (p) => p.assists);
|
|
10203
|
+
const footer = [
|
|
10204
|
+
scorer && ui.squadTopScorer(scorer.playerName, scorer.goals),
|
|
10205
|
+
assister && ui.squadTopAssists(assister.playerName, assister.assists)
|
|
10206
|
+
].filter((part) => !!part).join(" \xB7 ");
|
|
10207
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "ss-w-mon-list ss-w-sq-stats", children: [
|
|
10208
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "ss-w-sq-card", children: [
|
|
10209
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "ss-w-sq-row ss-w-sq-head", "aria-hidden": "true", children: [
|
|
10210
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { className: "ss-w-sq-name" }),
|
|
10211
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { className: "ss-w-sq-pos", children: ui.statHeadPos }),
|
|
10212
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { className: "ss-w-sq-c30", children: ui.statColApps }),
|
|
10213
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { className: "ss-w-sq-c36", children: ui.statHeadMins }),
|
|
10214
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { className: "ss-w-sq-c20", children: ui.statHeadGoals }),
|
|
10215
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { className: "ss-w-sq-c20", children: ui.statHeadAssists }),
|
|
10216
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { className: "ss-w-sq-c20 ss-w-sq-yr", children: ui.statHeadYellow }),
|
|
10217
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { className: "ss-w-sq-c20 ss-w-sq-yr", children: ui.statHeadRed }),
|
|
10218
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { className: "ss-w-sq-c36", children: ui.statHeadRating })
|
|
10219
|
+
] }),
|
|
10220
|
+
stats.map((p) => /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("button", { type: "button", className: "ss-w-sq-row ss-w-sq-tap", onClick: () => onSelectPlayer(p.playerId), children: [
|
|
10221
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("span", { className: "ss-w-sq-player", children: [
|
|
10222
|
+
p.jerseyNumber !== null && /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { className: "ss-w-sq-badge", children: p.jerseyNumber }),
|
|
10223
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { className: "ss-w-sq-name ss-w-sq-name-1", children: p.playerName })
|
|
10224
|
+
] }),
|
|
10225
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { className: "ss-w-sq-pos", children: positionShort(p.positionCode, p.positionName) }),
|
|
10226
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { className: "ss-w-sq-c30", children: p.appearances }),
|
|
10227
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { className: "ss-w-sq-c36", children: p.minutesPlayed }),
|
|
10228
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { className: "ss-w-sq-c20", children: p.goals }),
|
|
10229
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { className: "ss-w-sq-c20", children: p.assists }),
|
|
10230
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { className: "ss-w-sq-c20 ss-w-sq-yr", children: p.yellowCards }),
|
|
10231
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { className: "ss-w-sq-c20 ss-w-sq-yr", children: p.redCards }),
|
|
10232
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { className: ratingClass(p.averageRating), children: p.averageRating === null ? "\u2013" : p.averageRating.toFixed(1) })
|
|
10032
10233
|
] }, p.playerId))
|
|
10033
|
-
] },
|
|
10234
|
+
] }),
|
|
10235
|
+
footer !== "" && /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "ss-w-sq-foot", children: footer })
|
|
10034
10236
|
] });
|
|
10035
10237
|
}
|
|
10036
10238
|
|
|
10037
10239
|
// src/components/Squad.tsx
|
|
10038
10240
|
var import_jsx_runtime98 = require("react/jsx-runtime");
|
|
10039
|
-
function Squad({ squad, loading, ui, view, onToggleView, stats, statsLoading, onSelectPlayer }) {
|
|
10040
|
-
const
|
|
10041
|
-
|
|
10042
|
-
{
|
|
10043
|
-
|
|
10044
|
-
|
|
10045
|
-
|
|
10046
|
-
|
|
10047
|
-
|
|
10241
|
+
function Squad({ squad, loading, ui, view, onToggleView, stats, statsLoading, seasonName = null, competitionName = null, matchesPlayed = null, onSelectPlayer }) {
|
|
10242
|
+
const eyebrow = view === "stats" ? statsEyebrow(ui, seasonName, competitionName, matchesPlayed) : null;
|
|
10243
|
+
const toggle = /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("div", { className: "ss-w-sq-bar", children: [
|
|
10244
|
+
eyebrow !== null && /* @__PURE__ */ (0, import_jsx_runtime98.jsx)("div", { className: "ss-w-sq-eyebrow", children: eyebrow }),
|
|
10245
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)("div", { className: "ss-w-sq-seg", role: "group", children: ["roster", "stats"].map((v) => /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
10246
|
+
"button",
|
|
10247
|
+
{
|
|
10248
|
+
type: "button",
|
|
10249
|
+
className: "ss-w-sq-seg-btn",
|
|
10250
|
+
"aria-pressed": view === v,
|
|
10251
|
+
onClick: () => {
|
|
10252
|
+
if (view !== v) onToggleView();
|
|
10253
|
+
},
|
|
10254
|
+
children: v === "roster" ? ui.squadViewRoster : ui.squadViewStats
|
|
10048
10255
|
},
|
|
10049
|
-
|
|
10050
|
-
}
|
|
10051
|
-
|
|
10052
|
-
)) });
|
|
10256
|
+
v
|
|
10257
|
+
)) })
|
|
10258
|
+
] });
|
|
10053
10259
|
if (view === "stats") {
|
|
10054
10260
|
return /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(import_jsx_runtime98.Fragment, { children: [
|
|
10055
10261
|
toggle,
|
|
@@ -10076,8 +10282,125 @@ function Squad({ squad, loading, ui, view, onToggleView, stats, statsLoading, on
|
|
|
10076
10282
|
] });
|
|
10077
10283
|
}
|
|
10078
10284
|
|
|
10079
|
-
// src/components/
|
|
10285
|
+
// src/components/PlayerPhoto.tsx
|
|
10286
|
+
var import_react63 = require("react");
|
|
10080
10287
|
var import_jsx_runtime99 = require("react/jsx-runtime");
|
|
10288
|
+
function PlayerPhoto({ photoUrl, jerseyNumber, size }) {
|
|
10289
|
+
const [failed, setFailed] = (0, import_react63.useState)(false);
|
|
10290
|
+
const box = { width: size, height: size };
|
|
10291
|
+
if (photoUrl && !failed) {
|
|
10292
|
+
return /* @__PURE__ */ (0, import_jsx_runtime99.jsx)("img", { className: "ss-w-pd-photo", style: box, src: photoUrl, alt: "", "aria-hidden": "true", onError: () => setFailed(true) });
|
|
10293
|
+
}
|
|
10294
|
+
return /* @__PURE__ */ (0, import_jsx_runtime99.jsx)("span", { className: "ss-w-pd-photo ss-w-pd-avatar", style: { ...box, fontSize: Math.round(size * 0.35) }, "aria-hidden": "true", children: jerseyNumber ?? "" });
|
|
10295
|
+
}
|
|
10296
|
+
|
|
10297
|
+
// src/components/MiniPitch.tsx
|
|
10298
|
+
var import_jsx_runtime100 = require("react/jsx-runtime");
|
|
10299
|
+
var SPOT = {
|
|
10300
|
+
GK: [50, 90],
|
|
10301
|
+
CB: [50, 75],
|
|
10302
|
+
LB: [18, 70],
|
|
10303
|
+
RB: [82, 70],
|
|
10304
|
+
LWB: [15, 58],
|
|
10305
|
+
RWB: [85, 58],
|
|
10306
|
+
DM: [50, 60],
|
|
10307
|
+
CM: [50, 48],
|
|
10308
|
+
LM: [18, 45],
|
|
10309
|
+
RM: [82, 45],
|
|
10310
|
+
AM: [50, 32],
|
|
10311
|
+
LW: [20, 25],
|
|
10312
|
+
RW: [80, 25],
|
|
10313
|
+
CF: [50, 14],
|
|
10314
|
+
SS: [50, 14],
|
|
10315
|
+
ST: [50, 14]
|
|
10316
|
+
};
|
|
10317
|
+
function MiniPitch({ positionCode }) {
|
|
10318
|
+
const spot = SPOT[positionCode?.trim().toUpperCase() ?? ""];
|
|
10319
|
+
if (spot === void 0) return null;
|
|
10320
|
+
return /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "ss-w-pd-pitch", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "ss-w-pd-pitch-dot", style: { left: `${spot[0]}%`, top: `${spot[1]}%` } }) });
|
|
10321
|
+
}
|
|
10322
|
+
|
|
10323
|
+
// src/components/PerformanceBars.tsx
|
|
10324
|
+
var import_react64 = require("react");
|
|
10325
|
+
var import_jsx_runtime101 = require("react/jsx-runtime");
|
|
10326
|
+
var GROUPS = ["shooting", "passing", "possession", "defending"];
|
|
10327
|
+
function finite3(v) {
|
|
10328
|
+
return typeof v === "number" && Number.isFinite(v) ? v : null;
|
|
10329
|
+
}
|
|
10330
|
+
function valueOf(m, mode) {
|
|
10331
|
+
return finite3(mode === "total" ? m.total : m.per90);
|
|
10332
|
+
}
|
|
10333
|
+
function rankOf(m, mode) {
|
|
10334
|
+
const r = finite3(mode === "total" ? m.totalRank : m.per90Rank);
|
|
10335
|
+
return r === null ? null : Math.min(100, Math.max(0, Math.round(r)));
|
|
10336
|
+
}
|
|
10337
|
+
function format(m, v, mode) {
|
|
10338
|
+
if (m.isPercent) return `${v.toFixed(1)}%`;
|
|
10339
|
+
if (mode === "per90" || m.key === "xg") return v.toFixed(2);
|
|
10340
|
+
return String(Math.round(v));
|
|
10341
|
+
}
|
|
10342
|
+
function band(rank) {
|
|
10343
|
+
if (rank >= 67) return "pos";
|
|
10344
|
+
if (rank >= 34) return "warn";
|
|
10345
|
+
return "neg";
|
|
10346
|
+
}
|
|
10347
|
+
function groupTitle(ui, g) {
|
|
10348
|
+
switch (g) {
|
|
10349
|
+
case "shooting":
|
|
10350
|
+
return ui.perfGroupShooting;
|
|
10351
|
+
case "passing":
|
|
10352
|
+
return ui.perfGroupPassing;
|
|
10353
|
+
case "possession":
|
|
10354
|
+
return ui.perfGroupPossession;
|
|
10355
|
+
case "defending":
|
|
10356
|
+
return ui.perfGroupDefending;
|
|
10357
|
+
}
|
|
10358
|
+
}
|
|
10359
|
+
function unrankedLine(ui, reason) {
|
|
10360
|
+
switch (reason) {
|
|
10361
|
+
case "cohort":
|
|
10362
|
+
return ui.perfUnrankedCohort;
|
|
10363
|
+
case "noLeague":
|
|
10364
|
+
return ui.perfUnrankedNoLeague;
|
|
10365
|
+
default:
|
|
10366
|
+
return ui.perfUnranked;
|
|
10367
|
+
}
|
|
10368
|
+
}
|
|
10369
|
+
function PerformanceBars({ performance, competitionName, strings }) {
|
|
10370
|
+
const [mode, setMode] = (0, import_react64.useState)("total");
|
|
10371
|
+
const labelled = performance.metrics.filter((m) => Object.prototype.hasOwnProperty.call(strings.perfMetric, m.key));
|
|
10372
|
+
if (!labelled.some((m) => valueOf(m, "total") !== null || valueOf(m, "per90") !== null)) return null;
|
|
10373
|
+
const subtitle = !performance.ranked ? unrankedLine(strings, performance.unrankedReason) : competitionName ? strings.perfRankedAgainst(competitionName, performance.positionGroup) : null;
|
|
10374
|
+
const cards = GROUPS.map((g) => {
|
|
10375
|
+
const rows = labelled.filter((m) => m.group === g && valueOf(m, mode) !== null);
|
|
10376
|
+
if (rows.length === 0) return null;
|
|
10377
|
+
return /* @__PURE__ */ (0, import_jsx_runtime101.jsxs)("div", { className: "ss-w-pd-card ss-w-pd-perf-card", children: [
|
|
10378
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)("div", { className: "ss-w-pd-perf-group", children: groupTitle(strings, g) }),
|
|
10379
|
+
rows.map((m) => {
|
|
10380
|
+
const v = valueOf(m, mode);
|
|
10381
|
+
const rank = performance.ranked ? rankOf(m, mode) : null;
|
|
10382
|
+
return /* @__PURE__ */ (0, import_jsx_runtime101.jsxs)("div", { className: "ss-w-pd-bar-row", children: [
|
|
10383
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsxs)("div", { className: "ss-w-pd-bar-top", children: [
|
|
10384
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)("span", { className: "ss-w-pd-bar-label", children: strings.perfMetric[m.key] }),
|
|
10385
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)("span", { className: "ss-w-pd-bar-value", children: format(m, v, mode) })
|
|
10386
|
+
] }),
|
|
10387
|
+
rank !== null && /* @__PURE__ */ (0, import_jsx_runtime101.jsx)("div", { className: "ss-w-pd-track", children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)("div", { className: `ss-w-pd-fill ss-w-pd-fill--${band(rank)}`, style: { width: `${rank}%` } }) })
|
|
10388
|
+
] }, m.key);
|
|
10389
|
+
})
|
|
10390
|
+
] }, g);
|
|
10391
|
+
});
|
|
10392
|
+
return /* @__PURE__ */ (0, import_jsx_runtime101.jsxs)("div", { children: [
|
|
10393
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsxs)("div", { className: "ss-w-pd-perf-head", children: [
|
|
10394
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)("div", { className: "ss-w-pd-eyebrow", children: strings.perfTitle }),
|
|
10395
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)("div", { className: "ss-w-pd-seg", role: "group", children: ["total", "per90"].map((m) => /* @__PURE__ */ (0, import_jsx_runtime101.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)) })
|
|
10396
|
+
] }),
|
|
10397
|
+
subtitle !== null && /* @__PURE__ */ (0, import_jsx_runtime101.jsx)("div", { className: "ss-w-pd-perf-sub", children: subtitle }),
|
|
10398
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)("div", { className: "ss-w-pd-perf-cards", children: cards })
|
|
10399
|
+
] });
|
|
10400
|
+
}
|
|
10401
|
+
|
|
10402
|
+
// src/components/PlayerDetail.tsx
|
|
10403
|
+
var import_jsx_runtime102 = require("react/jsx-runtime");
|
|
10081
10404
|
var DASH = "\u2014";
|
|
10082
10405
|
function ageFrom(dobMs) {
|
|
10083
10406
|
if (dobMs === null) return DASH;
|
|
@@ -10088,68 +10411,141 @@ function ageFrom(dobMs) {
|
|
|
10088
10411
|
if (beforeBirthday) age--;
|
|
10089
10412
|
return String(age);
|
|
10090
10413
|
}
|
|
10091
|
-
function
|
|
10092
|
-
return
|
|
10093
|
-
|
|
10094
|
-
|
|
10414
|
+
function validMs(ms) {
|
|
10415
|
+
return typeof ms === "number" && Number.isFinite(ms) && ms > 0 ? ms : null;
|
|
10416
|
+
}
|
|
10417
|
+
function ratingTone(rounded) {
|
|
10418
|
+
if (rounded >= 7) return "pos";
|
|
10419
|
+
if (rounded >= 6) return "warn";
|
|
10420
|
+
return "neg";
|
|
10421
|
+
}
|
|
10422
|
+
function Bio({ label, value }) {
|
|
10423
|
+
return /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("div", { className: "ss-w-pd-bio-item", children: [
|
|
10424
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)("span", { className: "ss-w-pd-faint", children: label }),
|
|
10425
|
+
" ",
|
|
10426
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)("span", { children: value })
|
|
10427
|
+
] });
|
|
10428
|
+
}
|
|
10429
|
+
function Tile({ label, value, pos }) {
|
|
10430
|
+
return /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("div", { className: "ss-w-pd-tile", children: [
|
|
10431
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)("div", { className: "ss-w-pd-tile-label", children: label }),
|
|
10432
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)("div", { className: pos ? "ss-w-pd-tile-value ss-w-pd-pos-ink" : "ss-w-pd-tile-value", children: value })
|
|
10433
|
+
] });
|
|
10434
|
+
}
|
|
10435
|
+
function AvailabilityCard({ ui, next, availability }) {
|
|
10436
|
+
let note = null;
|
|
10437
|
+
let pill = null;
|
|
10438
|
+
if (availability !== null) {
|
|
10439
|
+
if (availability.status === "available") {
|
|
10440
|
+
note = ui.availabilityNoConcerns;
|
|
10441
|
+
pill = { text: ui.availabilityAvailable, tone: "pos" };
|
|
10442
|
+
} else {
|
|
10443
|
+
const back = validMs(availability.expectedReturnUnixMs);
|
|
10444
|
+
note = [availability.detail?.trim() || null, back === null ? null : ui.availabilityBack(back)].filter(Boolean).join(" \xB7 ") || null;
|
|
10445
|
+
pill = availability.status === "injured" ? { text: ui.availabilityInjured, tone: "neg" } : availability.status === "suspended" ? { text: ui.availabilitySuspended, tone: "warn" } : { text: ui.availabilityUnavailable, tone: "warn" };
|
|
10446
|
+
}
|
|
10447
|
+
}
|
|
10448
|
+
return /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("div", { className: "ss-w-pd-card ss-w-pd-avail", children: [
|
|
10449
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("div", { className: "ss-w-pd-avail-text", children: [
|
|
10450
|
+
next !== null && /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("div", { className: "ss-w-pd-avail-next", children: ui.availabilityNext(next.opponentName, next.isHome, validMs(next.kickoffUnixMs)) }),
|
|
10451
|
+
note !== null && /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("div", { className: "ss-w-pd-avail-note", children: note })
|
|
10452
|
+
] }),
|
|
10453
|
+
pill !== null && /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("div", { className: `ss-w-pd-pill ss-w-pd-pill--${pill.tone}`, children: pill.text })
|
|
10454
|
+
] });
|
|
10455
|
+
}
|
|
10456
|
+
function MatchRow({ ui, row }) {
|
|
10457
|
+
const date = validMs(row.kickoffUnixMs);
|
|
10458
|
+
const extras = [
|
|
10459
|
+
row.goals > 0 ? `${row.goals}${ui.statHeadGoals}` : null,
|
|
10460
|
+
row.assists > 0 ? `${row.assists}${ui.statHeadAssists}` : null,
|
|
10461
|
+
row.yellowCards > 0 ? `${row.yellowCards}${ui.statHeadYellow}` : null,
|
|
10462
|
+
row.sentOff ? ui.statHeadRed : null
|
|
10463
|
+
].filter((x) => x !== null);
|
|
10464
|
+
const sub = [`${ui.resultLetter[row.result]} ${row.goalsFor}\u2013${row.goalsAgainst}`, `${row.minutes}\u2032`, ...extras].join(" \xB7 ");
|
|
10465
|
+
const rating = typeof row.rating === "number" && Number.isFinite(row.rating) ? Math.round(row.rating * 10) / 10 : null;
|
|
10466
|
+
const pillTone = row.result === "W" ? "pos" : row.result === "L" ? "neg" : "draw";
|
|
10467
|
+
return /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("div", { className: "ss-w-pd-match", children: [
|
|
10468
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)("div", { className: "ss-w-pd-match-date", children: date === null ? "" : ui.logShortDate(date) }),
|
|
10469
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("div", { className: "ss-w-pd-match-main", children: [
|
|
10470
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)("div", { className: "ss-w-pd-match-opp", children: ui.matchLogOpponent(row.opponentName, row.isHome) }),
|
|
10471
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)("div", { className: "ss-w-pd-match-sub", children: sub })
|
|
10472
|
+
] }),
|
|
10473
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)("div", { className: `ss-w-pd-pill ss-w-pd-pill--${pillTone}`, children: ui.resultLetter[row.result] }),
|
|
10474
|
+
rating === null ? /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("div", { className: "ss-w-pd-chip-empty" }) : /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("div", { className: `ss-w-pd-chip ss-w-pd-chip--${ratingTone(rating)}`, children: rating.toFixed(1) })
|
|
10095
10475
|
] });
|
|
10096
10476
|
}
|
|
10097
10477
|
function PlayerDetail({ detail, loading, ui, seasonName, onClose }) {
|
|
10098
|
-
const back = /* @__PURE__ */ (0,
|
|
10099
|
-
/* @__PURE__ */ (0,
|
|
10100
|
-
" ",
|
|
10478
|
+
const back = /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("button", { type: "button", className: "ss-w-pd-back", onClick: onClose, children: [
|
|
10479
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.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_runtime102.jsx)("path", { d: "M15 18l-6-6 6-6" }) }),
|
|
10101
10480
|
ui.clubPlayerBack
|
|
10102
10481
|
] });
|
|
10103
10482
|
if (detail === null) {
|
|
10104
|
-
return loading ? /* @__PURE__ */ (0,
|
|
10105
|
-
/* @__PURE__ */ (0,
|
|
10106
|
-
/* @__PURE__ */ (0,
|
|
10107
|
-
] }) : /* @__PURE__ */ (0,
|
|
10108
|
-
/* @__PURE__ */ (0,
|
|
10109
|
-
/* @__PURE__ */ (0,
|
|
10483
|
+
return loading ? /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(import_jsx_runtime102.Fragment, { children: [
|
|
10484
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)("div", { className: "ss-w-pd-bar", children: back }),
|
|
10485
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)("div", { className: "ss-w-mon-list" })
|
|
10486
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(import_jsx_runtime102.Fragment, { children: [
|
|
10487
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)("div", { className: "ss-w-pd-bar", children: back }),
|
|
10488
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)("div", { className: "ss-w-mon-empty", children: ui.clubPlayerDetailEmpty })
|
|
10110
10489
|
] });
|
|
10111
10490
|
}
|
|
10112
10491
|
const s = detail.seasonStats;
|
|
10113
|
-
const
|
|
10114
|
-
|
|
10115
|
-
|
|
10116
|
-
|
|
10117
|
-
|
|
10118
|
-
|
|
10119
|
-
|
|
10120
|
-
|
|
10121
|
-
|
|
10122
|
-
|
|
10123
|
-
|
|
10124
|
-
|
|
10125
|
-
|
|
10492
|
+
const foot = footLabel(ui, detail.foot);
|
|
10493
|
+
const position = positionLabel(ui, detail.positionName);
|
|
10494
|
+
const subLine = [detail.teamName?.trim() || null, position].filter(Boolean).join(" \xB7 ");
|
|
10495
|
+
const competition = detail.competitionName?.trim() || null;
|
|
10496
|
+
const eyebrow = seasonName === null ? null : competition === null ? ui.detailSeason.replace("{season}", seasonName) : `${seasonName} ${competition}`;
|
|
10497
|
+
const rating = typeof s.averageRating === "number" && Number.isFinite(s.averageRating) ? s.averageRating : null;
|
|
10498
|
+
const next = detail.nextFixture ?? null;
|
|
10499
|
+
const availability = detail.availability ?? null;
|
|
10500
|
+
const log = detail.matchLog ?? [];
|
|
10501
|
+
return /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(import_jsx_runtime102.Fragment, { children: [
|
|
10502
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)("div", { className: "ss-w-pd-bar", children: back }),
|
|
10503
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("div", { className: "ss-w-mon-list ss-w-pd-list", children: [
|
|
10504
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("div", { className: "ss-w-pd-card ss-w-pd-profile", children: [
|
|
10505
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)(PlayerPhoto, { photoUrl: detail.photoUrl, jerseyNumber: detail.jerseyNumber, size: 52 }, detail.photoUrl ?? ""),
|
|
10506
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("div", { className: "ss-w-pd-profile-main", children: [
|
|
10507
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)("div", { className: "ss-w-pd-name", children: detail.playerName }),
|
|
10508
|
+
subLine !== "" && /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("div", { className: "ss-w-pd-sub", children: subLine }),
|
|
10509
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("div", { className: "ss-w-pd-bio", children: [
|
|
10510
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)(Bio, { label: ui.detailAge, value: ageFrom(detail.dateOfBirthUnixMs) }),
|
|
10511
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)(Bio, { label: ui.detailHeight, value: detail.heightCm === null ? DASH : `${detail.heightCm} cm` }),
|
|
10512
|
+
foot !== null && /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(Bio, { label: ui.detailFoot, value: foot }),
|
|
10513
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)(Bio, { label: ui.detailNatShort, value: detail.nationality ?? DASH })
|
|
10514
|
+
] })
|
|
10515
|
+
] }),
|
|
10516
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)(MiniPitch, { positionCode: detail.positionCode })
|
|
10126
10517
|
] }),
|
|
10127
|
-
/* @__PURE__ */ (0,
|
|
10128
|
-
|
|
10129
|
-
/* @__PURE__ */ (0,
|
|
10130
|
-
|
|
10131
|
-
/* @__PURE__ */ (0,
|
|
10132
|
-
/* @__PURE__ */ (0,
|
|
10133
|
-
/* @__PURE__ */ (0,
|
|
10134
|
-
/* @__PURE__ */ (0,
|
|
10135
|
-
/* @__PURE__ */ (0,
|
|
10136
|
-
/* @__PURE__ */ (0,
|
|
10137
|
-
/* @__PURE__ */ (0,
|
|
10138
|
-
/* @__PURE__ */ (0,
|
|
10518
|
+
(next !== null || availability !== null) && /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(AvailabilityCard, { ui, next, availability }),
|
|
10519
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("div", { children: [
|
|
10520
|
+
eyebrow !== null && /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("div", { className: "ss-w-pd-eyebrow ss-w-pd-eyebrow--block", children: eyebrow }),
|
|
10521
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("div", { className: "ss-w-pd-tiles", children: [
|
|
10522
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)(Tile, { label: ui.statColGoals, value: String(s.goals) }),
|
|
10523
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)(Tile, { label: ui.statColAssists, value: String(s.assists) }),
|
|
10524
|
+
typeof s.starts === "number" && /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(Tile, { label: ui.detailStarted, value: String(s.starts) }),
|
|
10525
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)(Tile, { label: ui.detailMatches, value: String(s.appearances) }),
|
|
10526
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)(Tile, { label: ui.statColMinutes, value: String(s.minutesPlayed) }),
|
|
10527
|
+
rating !== null && /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(Tile, { label: ui.statColRating, value: rating.toFixed(2), pos: Math.round(rating * 100) / 100 >= 7 }),
|
|
10528
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)(Tile, { label: ui.detailYellows, value: String(s.yellowCards) }),
|
|
10529
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)(Tile, { label: ui.detailReds, value: String(s.redCards) })
|
|
10139
10530
|
] })
|
|
10531
|
+
] }),
|
|
10532
|
+
detail.performance != null && /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(PerformanceBars, { performance: detail.performance, competitionName: competition, strings: ui }),
|
|
10533
|
+
log.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("div", { children: [
|
|
10534
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)("div", { className: "ss-w-pd-eyebrow ss-w-pd-eyebrow--block", children: ui.matchLogTitle }),
|
|
10535
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)("div", { className: "ss-w-pd-card ss-w-pd-log", children: log.map((row) => /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(MatchRow, { ui, row }, row.matchId)) })
|
|
10140
10536
|
] })
|
|
10141
10537
|
] })
|
|
10142
10538
|
] });
|
|
10143
10539
|
}
|
|
10144
10540
|
|
|
10145
10541
|
// src/components/PresetSpeedDial.tsx
|
|
10146
|
-
var
|
|
10147
|
-
var
|
|
10542
|
+
var import_react65 = require("react");
|
|
10543
|
+
var import_jsx_runtime103 = require("react/jsx-runtime");
|
|
10148
10544
|
function PresetSpeedDial({ expanded, showDot, strings, onToggle, onOpen, rootRef, buttonRef }) {
|
|
10149
|
-
const pillsId = (0,
|
|
10545
|
+
const pillsId = (0, import_react65.useId)();
|
|
10150
10546
|
const tabIndex = expanded ? 0 : -1;
|
|
10151
|
-
return /* @__PURE__ */ (0,
|
|
10152
|
-
/* @__PURE__ */ (0,
|
|
10547
|
+
return /* @__PURE__ */ (0, import_jsx_runtime103.jsxs)("div", { ref: rootRef, className: "ss-w-dial", children: [
|
|
10548
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsxs)(
|
|
10153
10549
|
"button",
|
|
10154
10550
|
{
|
|
10155
10551
|
ref: buttonRef,
|
|
@@ -10160,36 +10556,36 @@ function PresetSpeedDial({ expanded, showDot, strings, onToggle, onOpen, rootRef
|
|
|
10160
10556
|
"aria-label": strings.dialName,
|
|
10161
10557
|
onClick: onToggle,
|
|
10162
10558
|
children: [
|
|
10163
|
-
/* @__PURE__ */ (0,
|
|
10164
|
-
/* @__PURE__ */ (0,
|
|
10165
|
-
showDot && !expanded ? /* @__PURE__ */ (0,
|
|
10559
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsx)("span", { className: "ss-w-dial-icon ss-w-dial-icon--open", children: /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(SlidersIcon, {}) }),
|
|
10560
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsx)("span", { className: "ss-w-dial-icon ss-w-dial-icon--close", children: /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(CloseIcon, {}) }),
|
|
10561
|
+
showDot && !expanded ? /* @__PURE__ */ (0, import_jsx_runtime103.jsx)("span", { className: "ss-w-dial-dot", "aria-hidden": "true" }) : null
|
|
10166
10562
|
]
|
|
10167
10563
|
}
|
|
10168
10564
|
),
|
|
10169
|
-
/* @__PURE__ */ (0,
|
|
10170
|
-
/* @__PURE__ */ (0,
|
|
10171
|
-
/* @__PURE__ */ (0,
|
|
10172
|
-
/* @__PURE__ */ (0,
|
|
10565
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsxs)("div", { id: pillsId, className: "ss-w-dial-pills", "data-open": expanded ? "" : void 0, children: [
|
|
10566
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsxs)("button", { type: "button", className: "ss-w-dial-pill", tabIndex, onClick: () => onOpen("numbers"), children: [
|
|
10567
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsx)(SlidersIcon, {}),
|
|
10568
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsx)("span", { className: "ss-w-dial-pill-label", children: strings.setNumbers })
|
|
10173
10569
|
] }),
|
|
10174
|
-
/* @__PURE__ */ (0,
|
|
10175
|
-
/* @__PURE__ */ (0,
|
|
10176
|
-
/* @__PURE__ */ (0,
|
|
10570
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsxs)("button", { type: "button", className: "ss-w-dial-pill", tabIndex, onClick: () => onOpen("combo"), children: [
|
|
10571
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsx)(ComboIcon, {}),
|
|
10572
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsx)("span", { className: "ss-w-dial-pill-label", children: strings.buildCombo })
|
|
10177
10573
|
] })
|
|
10178
10574
|
] })
|
|
10179
10575
|
] });
|
|
10180
10576
|
}
|
|
10181
10577
|
|
|
10182
10578
|
// src/components/PresetTools.tsx
|
|
10183
|
-
var
|
|
10184
|
-
var
|
|
10579
|
+
var import_react66 = require("react");
|
|
10580
|
+
var import_jsx_runtime104 = require("react/jsx-runtime");
|
|
10185
10581
|
var FOCUSABLE = 'button:not([disabled]), [href], input:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
10186
10582
|
function PresetToolModal({ title, closeLabel, onClose, children, footer }) {
|
|
10187
|
-
const dialogRef = (0,
|
|
10188
|
-
const titleId = (0,
|
|
10189
|
-
(0,
|
|
10583
|
+
const dialogRef = (0, import_react66.useRef)(null);
|
|
10584
|
+
const titleId = (0, import_react66.useId)();
|
|
10585
|
+
(0, import_react66.useEffect)(() => {
|
|
10190
10586
|
dialogRef.current?.focus();
|
|
10191
10587
|
}, []);
|
|
10192
|
-
(0,
|
|
10588
|
+
(0, import_react66.useEffect)(() => {
|
|
10193
10589
|
const onKey = (e) => {
|
|
10194
10590
|
if (e.key !== "Escape") return;
|
|
10195
10591
|
e.stopPropagation();
|
|
@@ -10219,79 +10615,79 @@ function PresetToolModal({ title, closeLabel, onClose, children, footer }) {
|
|
|
10219
10615
|
first.focus();
|
|
10220
10616
|
}
|
|
10221
10617
|
};
|
|
10222
|
-
return /* @__PURE__ */ (0,
|
|
10223
|
-
/* @__PURE__ */ (0,
|
|
10224
|
-
/* @__PURE__ */ (0,
|
|
10225
|
-
/* @__PURE__ */ (0,
|
|
10618
|
+
return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("div", { className: "ss-w-tool-backdrop", children: /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)("div", { ref: dialogRef, className: "ss-w-tool", role: "dialog", "aria-modal": "true", "aria-labelledby": titleId, tabIndex: -1, onKeyDown: trapTab, children: [
|
|
10619
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsxs)("div", { className: "ss-w-tool-head", children: [
|
|
10620
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsx)("h2", { id: titleId, className: "ss-w-tool-title", children: title }),
|
|
10621
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsx)("button", { type: "button", className: "ss-w-tool-close", "aria-label": closeLabel, onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(CloseIcon, {}) })
|
|
10226
10622
|
] }),
|
|
10227
|
-
/* @__PURE__ */ (0,
|
|
10228
|
-
footer ? /* @__PURE__ */ (0,
|
|
10623
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsx)("div", { className: "ss-w-tool-body", children }),
|
|
10624
|
+
footer ? /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("div", { className: "ss-w-tool-foot", children: footer }) : null
|
|
10229
10625
|
] }) });
|
|
10230
10626
|
}
|
|
10231
10627
|
function fillTemplate(template, slots) {
|
|
10232
10628
|
return template.split(/(\{[a-z]+\})/).filter((part) => part !== "").map((part, i) => {
|
|
10233
10629
|
const key = /^\{([a-z]+)\}$/.exec(part)?.[1];
|
|
10234
|
-
return /* @__PURE__ */ (0,
|
|
10630
|
+
return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_react66.Fragment, { children: key !== void 0 && key in slots ? slots[key] : part }, i);
|
|
10235
10631
|
});
|
|
10236
10632
|
}
|
|
10237
10633
|
function NumberSelect({ current, choices: choices2, label, notToday, lockEmpty = true, onChoose }) {
|
|
10238
10634
|
const selected = Math.max(0, choices2.findIndex((c) => c.text === current));
|
|
10239
|
-
return /* @__PURE__ */ (0,
|
|
10240
|
-
/* @__PURE__ */ (0,
|
|
10241
|
-
/* @__PURE__ */ (0,
|
|
10635
|
+
return /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)("span", { className: "ss-w-tool-num", children: [
|
|
10636
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsx)("span", { className: "ss-w-tool-num-size", "aria-hidden": "true", children: current }),
|
|
10637
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsx)("select", { className: "ss-w-tool-num-select", "aria-label": label, value: String(selected), onChange: (e) => {
|
|
10242
10638
|
const c = choices2[Number(e.target.value)];
|
|
10243
10639
|
if (c) onChoose(c.value);
|
|
10244
|
-
}, children: choices2.map((c, i) => /* @__PURE__ */ (0,
|
|
10640
|
+
}, children: choices2.map((c, i) => /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("option", { value: String(i), disabled: lockEmpty && !c.available && i !== selected, children: c.available ? c.text : `${c.text}${notToday}` }, i)) })
|
|
10245
10641
|
] });
|
|
10246
10642
|
}
|
|
10247
10643
|
function ChoiceSelect({ currentIdx, sizeLabels, optionLabels, label, onChoose }) {
|
|
10248
10644
|
const sizeText = sizeLabels[currentIdx] ?? "";
|
|
10249
|
-
return /* @__PURE__ */ (0,
|
|
10250
|
-
/* @__PURE__ */ (0,
|
|
10251
|
-
/* @__PURE__ */ (0,
|
|
10645
|
+
return /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)("span", { className: "ss-w-tool-num", children: [
|
|
10646
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsx)("span", { className: "ss-w-tool-num-size", "aria-hidden": "true", children: sizeText }),
|
|
10647
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsx)("select", { className: "ss-w-tool-num-select", "aria-label": label, value: String(currentIdx), onChange: (e) => onChoose(Number(e.target.value)), children: optionLabels.map((opt, i) => /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("option", { value: String(i), children: opt }, i)) })
|
|
10252
10648
|
] });
|
|
10253
10649
|
}
|
|
10254
10650
|
function SendButton({ label, display, disabled, onClick }) {
|
|
10255
|
-
return /* @__PURE__ */ (0,
|
|
10651
|
+
return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("button", { type: "button", className: "ss-w-tool-send", "aria-label": `${label}: ${display}`, disabled, onClick, children: label });
|
|
10256
10652
|
}
|
|
10257
10653
|
function PickList({ picks, formatKickoff }) {
|
|
10258
|
-
return /* @__PURE__ */ (0,
|
|
10259
|
-
/* @__PURE__ */ (0,
|
|
10654
|
+
return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("ul", { className: "ss-w-tool-picks", role: "list", children: picks.map((p) => /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)("li", { className: "ss-w-tool-pick", children: [
|
|
10655
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsxs)("span", { className: "ss-w-tool-pick-match", children: [
|
|
10260
10656
|
p.homeTeamName,
|
|
10261
10657
|
" \u2013 ",
|
|
10262
10658
|
p.awayTeamName
|
|
10263
10659
|
] }),
|
|
10264
|
-
/* @__PURE__ */ (0,
|
|
10660
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsxs)("span", { className: "ss-w-tool-pick-sel", children: [
|
|
10265
10661
|
p.marketLabel,
|
|
10266
10662
|
": ",
|
|
10267
10663
|
p.selectionLabel,
|
|
10268
10664
|
p.line ? ` ${p.line}` : ""
|
|
10269
10665
|
] }),
|
|
10270
|
-
/* @__PURE__ */ (0,
|
|
10271
|
-
/* @__PURE__ */ (0,
|
|
10666
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsx)("span", { className: "ss-w-tool-pick-kick", children: formatKickoff(p.kickoffUtc) }),
|
|
10667
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsx)("span", { className: "ss-w-tool-pick-price", children: p.price.toFixed(2) })
|
|
10272
10668
|
] }, p.matchOddsId)) });
|
|
10273
10669
|
}
|
|
10274
10670
|
function ComboPreview({ cell, formatKickoff }) {
|
|
10275
|
-
return /* @__PURE__ */ (0,
|
|
10276
|
-
/* @__PURE__ */ (0,
|
|
10277
|
-
/* @__PURE__ */ (0,
|
|
10671
|
+
return /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)(import_jsx_runtime104.Fragment, { children: [
|
|
10672
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsx)(PickList, { picks: cell.combo.legs, formatKickoff }),
|
|
10673
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsx)("div", { className: "ss-w-tool-math", children: cell.combo.multiplication })
|
|
10278
10674
|
] });
|
|
10279
10675
|
}
|
|
10280
10676
|
function Unavailable({ text }) {
|
|
10281
|
-
return /* @__PURE__ */ (0,
|
|
10677
|
+
return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("p", { className: "ss-w-tool-unavailable", children: text });
|
|
10282
10678
|
}
|
|
10283
10679
|
function AskRow({ icon, ask, ready, send }) {
|
|
10284
|
-
return /* @__PURE__ */ (0,
|
|
10285
|
-
/* @__PURE__ */ (0,
|
|
10286
|
-
/* @__PURE__ */ (0,
|
|
10287
|
-
/* @__PURE__ */ (0,
|
|
10288
|
-
ready ? /* @__PURE__ */ (0,
|
|
10680
|
+
return /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)("section", { className: "ss-w-tool-row ss-w-tool-row--ask", children: [
|
|
10681
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsx)("span", { className: "ss-w-tool-icon", "aria-hidden": "true", children: icon }),
|
|
10682
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsxs)("div", { className: "ss-w-tool-main", children: [
|
|
10683
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsx)("p", { className: "ss-w-tool-ask", children: ask }),
|
|
10684
|
+
ready ? /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("span", { className: "ss-w-tool-ready", children: ready }) : null
|
|
10289
10685
|
] }),
|
|
10290
10686
|
send
|
|
10291
10687
|
] });
|
|
10292
10688
|
}
|
|
10293
10689
|
function RoundSend({ label, display, disabled, onClick }) {
|
|
10294
|
-
return /* @__PURE__ */ (0,
|
|
10690
|
+
return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("button", { type: "button", className: "ss-w-tool-go", "aria-label": `${label}: ${display}`, disabled, onClick, children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(SendIcon, {}) });
|
|
10295
10691
|
}
|
|
10296
10692
|
var BIG_COMBO = { total: 50, legs: 6 };
|
|
10297
10693
|
function SetNumbersTool({ grid, strings, streaming, onSend, onClose }) {
|
|
@@ -10300,15 +10696,15 @@ function SetNumbersTool({ grid, strings, streaming, onSend, onClose }) {
|
|
|
10300
10696
|
const totals = comboTotals(grid);
|
|
10301
10697
|
const legChoices = comboLegChoices(grid);
|
|
10302
10698
|
const count = FIXED_SINGLES_COUNT;
|
|
10303
|
-
const [maxPrice, setMaxPrice] = (0,
|
|
10304
|
-
const [minPrice, setMinPrice] = (0,
|
|
10305
|
-
const [start] = (0,
|
|
10306
|
-
const [total, setTotal] = (0,
|
|
10307
|
-
const [legs, setLegs] = (0,
|
|
10308
|
-
const [bigStart] = (0,
|
|
10309
|
-
const [bigTotal, setBigTotal] = (0,
|
|
10310
|
-
const [bigLegs, setBigLegs] = (0,
|
|
10311
|
-
const [announcement, setAnnouncement] = (0,
|
|
10699
|
+
const [maxPrice, setMaxPrice] = (0, import_react66.useState)(() => startSingles(grid.singles, limits, START.maxPrice, count));
|
|
10700
|
+
const [minPrice, setMinPrice] = (0, import_react66.useState)(() => startSingles(grid.singlesFrom, floors, START.minPrice, count));
|
|
10701
|
+
const [start] = (0, import_react66.useState)(() => startCombo(grid, totals, legChoices, START.comboTotal, START.comboLegs));
|
|
10702
|
+
const [total, setTotal] = (0, import_react66.useState)(start.total);
|
|
10703
|
+
const [legs, setLegs] = (0, import_react66.useState)(start.legs);
|
|
10704
|
+
const [bigStart] = (0, import_react66.useState)(() => startCombo(grid, totals, legChoices, BIG_COMBO.total, BIG_COMBO.legs));
|
|
10705
|
+
const [bigTotal, setBigTotal] = (0, import_react66.useState)(bigStart.total);
|
|
10706
|
+
const [bigLegs, setBigLegs] = (0, import_react66.useState)(bigStart.legs);
|
|
10707
|
+
const [announcement, setAnnouncement] = (0, import_react66.useState)("");
|
|
10312
10708
|
const maxCell = findSingles(grid.singles, maxPrice, count);
|
|
10313
10709
|
const minCell = findSingles(grid.singlesFrom, minPrice, count);
|
|
10314
10710
|
const comboCell = findCombo(grid, total, legs);
|
|
@@ -10352,95 +10748,95 @@ function SetNumbersTool({ grid, strings, streaming, onSend, onClose }) {
|
|
|
10352
10748
|
const totalChoices = totals.map((v) => ({ value: v, text: v.toFixed(1), available: legChoices.some((n) => !!findCombo(grid, v, n)) }));
|
|
10353
10749
|
const legChoicesFor = (t) => legChoices.map((n) => ({ value: n, text: String(n), available: !!findCombo(grid, t, n) }));
|
|
10354
10750
|
const markets = grid.markets ?? [];
|
|
10355
|
-
const [marketIdx, setMarketIdx] = (0,
|
|
10751
|
+
const [marketIdx, setMarketIdx] = (0, import_react66.useState)(0);
|
|
10356
10752
|
const marketCell = markets[marketIdx] ?? null;
|
|
10357
10753
|
const marketLabels = markets.map((c) => strings.marketShort(c.marketDeveloperName, c.marketLabel, c.selectionLabel ?? null));
|
|
10358
10754
|
const singlesReady = (cell) => cell ? strings.readyCount(cell.picks.length) : strings.unavailable;
|
|
10359
10755
|
const comboReady = (cell) => cell ? strings.readyAt(cell.combo.total) : strings.unavailable;
|
|
10360
|
-
return /* @__PURE__ */ (0,
|
|
10361
|
-
/* @__PURE__ */ (0,
|
|
10756
|
+
return /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)(PresetToolModal, { title: strings.setNumbers, closeLabel: strings.close, onClose, children: [
|
|
10757
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
|
|
10362
10758
|
AskRow,
|
|
10363
10759
|
{
|
|
10364
10760
|
icon: "\u{1F3AF}",
|
|
10365
10761
|
ask: fillTemplate(strings.maxPriceRow, {
|
|
10366
10762
|
count: String(count),
|
|
10367
|
-
price: /* @__PURE__ */ (0,
|
|
10763
|
+
price: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(NumberSelect, { current: maxPrice.toFixed(2), choices: maxChoices, label: strings.maxPriceName, notToday: strings.notToday, onChoose: chooseMax })
|
|
10368
10764
|
}),
|
|
10369
10765
|
ready: singlesReady(maxCell),
|
|
10370
|
-
send: /* @__PURE__ */ (0,
|
|
10766
|
+
send: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(RoundSend, { label: strings.send, display: strings.maxPriceDisplay(count, maxPrice), disabled: !maxCell || streaming, onClick: () => {
|
|
10371
10767
|
if (maxCell) onSend(maxPriceAsk(maxCell, strings));
|
|
10372
10768
|
} })
|
|
10373
10769
|
}
|
|
10374
10770
|
),
|
|
10375
|
-
/* @__PURE__ */ (0,
|
|
10771
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
|
|
10376
10772
|
AskRow,
|
|
10377
10773
|
{
|
|
10378
10774
|
icon: "\u{1F4C8}",
|
|
10379
10775
|
ask: fillTemplate(strings.minPriceRow, {
|
|
10380
10776
|
count: String(count),
|
|
10381
|
-
price: /* @__PURE__ */ (0,
|
|
10777
|
+
price: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(NumberSelect, { current: minPrice.toFixed(2), choices: minChoices, label: strings.minPriceName, notToday: strings.notToday, onChoose: chooseMin })
|
|
10382
10778
|
}),
|
|
10383
10779
|
ready: singlesReady(minCell),
|
|
10384
|
-
send: /* @__PURE__ */ (0,
|
|
10780
|
+
send: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(RoundSend, { label: strings.send, display: strings.minPriceDisplay(count, minPrice), disabled: !minCell || streaming, onClick: () => {
|
|
10385
10781
|
if (minCell) onSend(minPriceAsk(minCell, strings));
|
|
10386
10782
|
} })
|
|
10387
10783
|
}
|
|
10388
10784
|
),
|
|
10389
|
-
/* @__PURE__ */ (0,
|
|
10785
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
|
|
10390
10786
|
AskRow,
|
|
10391
10787
|
{
|
|
10392
10788
|
icon: "\u2728",
|
|
10393
10789
|
ask: fillTemplate(strings.comboRow, {
|
|
10394
|
-
legs: /* @__PURE__ */ (0,
|
|
10395
|
-
total: /* @__PURE__ */ (0,
|
|
10790
|
+
legs: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(NumberSelect, { current: String(legs), choices: legChoicesFor(total), label: strings.matchesLabel, notToday: strings.notToday, lockEmpty: false, onChoose: chooseLegs }),
|
|
10791
|
+
total: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(NumberSelect, { current: total.toFixed(1), choices: totalChoices, label: strings.totalLabel, notToday: strings.notToday, onChoose: chooseTotal })
|
|
10396
10792
|
}),
|
|
10397
10793
|
ready: comboReady(comboCell),
|
|
10398
|
-
send: /* @__PURE__ */ (0,
|
|
10794
|
+
send: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(RoundSend, { label: strings.send, display: strings.comboDisplay(legs, total), disabled: !comboCell || streaming, onClick: () => {
|
|
10399
10795
|
if (comboCell) onSend(comboAsk(comboCell, strings));
|
|
10400
10796
|
} })
|
|
10401
10797
|
}
|
|
10402
10798
|
),
|
|
10403
|
-
/* @__PURE__ */ (0,
|
|
10799
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
|
|
10404
10800
|
AskRow,
|
|
10405
10801
|
{
|
|
10406
10802
|
icon: "\u{1F3C6}",
|
|
10407
10803
|
ask: fillTemplate(strings.bigComboRow, {
|
|
10408
|
-
legs: /* @__PURE__ */ (0,
|
|
10409
|
-
total: /* @__PURE__ */ (0,
|
|
10804
|
+
legs: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(NumberSelect, { current: String(bigLegs), choices: legChoicesFor(bigTotal), label: strings.matchesLabel, notToday: strings.notToday, lockEmpty: false, onChoose: chooseBigLegs }),
|
|
10805
|
+
total: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(NumberSelect, { current: bigTotal.toFixed(1), choices: totalChoices, label: strings.totalLabel, notToday: strings.notToday, onChoose: chooseBigTotal })
|
|
10410
10806
|
}),
|
|
10411
10807
|
ready: comboReady(bigCell),
|
|
10412
|
-
send: /* @__PURE__ */ (0,
|
|
10808
|
+
send: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(RoundSend, { label: strings.send, display: strings.comboDisplay(bigLegs, bigTotal), disabled: !bigCell || streaming, onClick: () => {
|
|
10413
10809
|
if (bigCell) onSend(comboAsk(bigCell, strings));
|
|
10414
10810
|
} })
|
|
10415
10811
|
}
|
|
10416
10812
|
),
|
|
10417
|
-
markets.length > 0 && /* @__PURE__ */ (0,
|
|
10813
|
+
markets.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
|
|
10418
10814
|
AskRow,
|
|
10419
10815
|
{
|
|
10420
10816
|
icon: "\u26BD",
|
|
10421
10817
|
ask: fillTemplate(strings.marketRow, {
|
|
10422
|
-
market: /* @__PURE__ */ (0,
|
|
10818
|
+
market: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(ChoiceSelect, { currentIdx: marketIdx, sizeLabels: marketLabels, optionLabels: marketLabels, label: strings.marketName, onChoose: chooseMarket })
|
|
10423
10819
|
}),
|
|
10424
10820
|
ready: marketCell ? strings.readyCount(marketCell.count) : null,
|
|
10425
|
-
send: /* @__PURE__ */ (0,
|
|
10821
|
+
send: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(RoundSend, { label: strings.send, display: marketCell ? marketDisplay(marketCell, strings) : "", disabled: !marketCell || streaming, onClick: () => {
|
|
10426
10822
|
if (marketCell) onSend(marketAsk(marketCell, strings));
|
|
10427
10823
|
} })
|
|
10428
10824
|
}
|
|
10429
10825
|
),
|
|
10430
|
-
/* @__PURE__ */ (0,
|
|
10826
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsx)("p", { className: "ss-w-vh", "aria-live": "polite", children: announcement })
|
|
10431
10827
|
] });
|
|
10432
10828
|
}
|
|
10433
10829
|
function BuildComboTool({ grid, strings, streaming, formatKickoff, initialTotal, initialLegs, onSend, onClose }) {
|
|
10434
10830
|
const totals = comboTotals(grid);
|
|
10435
10831
|
const legChoices = comboLegChoices(grid);
|
|
10436
|
-
const [start] = (0,
|
|
10437
|
-
const [total, setTotal] = (0,
|
|
10438
|
-
const [legs, setLegs] = (0,
|
|
10832
|
+
const [start] = (0, import_react66.useState)(() => initialTotal === void 0 ? startCombo(grid, totals, legChoices, START.comboTotal, START.comboLegs) : null);
|
|
10833
|
+
const [total, setTotal] = (0, import_react66.useState)(() => initialTotal !== void 0 ? nearest(totals, initialTotal) : start.total);
|
|
10834
|
+
const [legs, setLegs] = (0, import_react66.useState)(() => {
|
|
10439
10835
|
if (initialTotal === void 0) return initialLegs !== void 0 ? clampLegs(legChoices, initialLegs) : start.legs;
|
|
10440
10836
|
const from = initialLegs !== void 0 ? clampLegs(legChoices, initialLegs) : startValue(legChoices, START.comboLegs);
|
|
10441
10837
|
return legsForTotal(grid, nearest(totals, initialTotal), from);
|
|
10442
10838
|
});
|
|
10443
|
-
const [announcement, setAnnouncement] = (0,
|
|
10839
|
+
const [announcement, setAnnouncement] = (0, import_react66.useState)("");
|
|
10444
10840
|
const cell = findCombo(grid, total, legs);
|
|
10445
10841
|
const minLegs = legChoices[0] ?? legs;
|
|
10446
10842
|
const maxLegs = legChoices[legChoices.length - 1] ?? legs;
|
|
@@ -10451,29 +10847,29 @@ function BuildComboTool({ grid, strings, streaming, formatKickoff, initialTotal,
|
|
|
10451
10847
|
const d = strings.comboDisplay(nextLegs, nextTotal);
|
|
10452
10848
|
setAnnouncement(findCombo(grid, nextTotal, nextLegs) ? d : `${d}. ${strings.unavailable}`);
|
|
10453
10849
|
};
|
|
10454
|
-
const footer = /* @__PURE__ */ (0,
|
|
10850
|
+
const footer = /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(SendButton, { label: strings.send, display, disabled: !cell || streaming, onClick: () => {
|
|
10455
10851
|
if (cell) onSend(comboAsk(cell, strings));
|
|
10456
10852
|
} });
|
|
10457
|
-
return /* @__PURE__ */ (0,
|
|
10458
|
-
/* @__PURE__ */ (0,
|
|
10459
|
-
/* @__PURE__ */ (0,
|
|
10460
|
-
/* @__PURE__ */ (0,
|
|
10853
|
+
return /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)(PresetToolModal, { title: strings.buildCombo, closeLabel: strings.close, onClose, footer, children: [
|
|
10854
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsxs)("div", { className: "ss-w-tool-section", role: "group", "aria-label": strings.totalLabel, children: [
|
|
10855
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsx)("span", { className: "ss-w-tool-label", "aria-hidden": "true", children: strings.totalLabel }),
|
|
10856
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsx)("div", { className: "ss-w-tool-chips", children: totals.map((t) => /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("button", { type: "button", className: "ss-w-tool-chip", "aria-pressed": samePrice(t, total), onClick: () => choose(t, samePrice(t, total) ? legs : legsForTotal(grid, t, legs)), children: t.toFixed(1) }, t)) })
|
|
10461
10857
|
] }),
|
|
10462
|
-
/* @__PURE__ */ (0,
|
|
10463
|
-
/* @__PURE__ */ (0,
|
|
10464
|
-
/* @__PURE__ */ (0,
|
|
10465
|
-
/* @__PURE__ */ (0,
|
|
10466
|
-
/* @__PURE__ */ (0,
|
|
10467
|
-
/* @__PURE__ */ (0,
|
|
10858
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsxs)("div", { className: "ss-w-tool-section", role: "group", "aria-label": strings.matchesLabel, children: [
|
|
10859
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsx)("span", { className: "ss-w-tool-label", "aria-hidden": "true", children: strings.matchesLabel }),
|
|
10860
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsxs)("div", { className: "ss-w-tool-stepper", children: [
|
|
10861
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsx)("button", { type: "button", className: "ss-w-tool-step", "aria-label": strings.fewerMatches, disabled: legs <= minLegs, onClick: () => choose(total, legs - 1), children: "\u2212" }),
|
|
10862
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsx)("span", { className: "ss-w-tool-count", children: legs }),
|
|
10863
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsx)("button", { type: "button", className: "ss-w-tool-step", "aria-label": strings.moreMatches, disabled: legs >= maxLegs, onClick: () => choose(total, legs + 1), children: "+" })
|
|
10468
10864
|
] })
|
|
10469
10865
|
] }),
|
|
10470
|
-
cell ? /* @__PURE__ */ (0,
|
|
10471
|
-
/* @__PURE__ */ (0,
|
|
10866
|
+
cell ? /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(ComboPreview, { cell, formatKickoff }) : /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(Unavailable, { text: strings.unavailable }),
|
|
10867
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsx)("p", { className: "ss-w-vh", "aria-live": "polite", children: announcement })
|
|
10472
10868
|
] });
|
|
10473
10869
|
}
|
|
10474
10870
|
|
|
10475
10871
|
// src/usePresetDial.ts
|
|
10476
|
-
var
|
|
10872
|
+
var import_react67 = require("react");
|
|
10477
10873
|
function sendInFlight(messages, isStreaming) {
|
|
10478
10874
|
const last = messages[messages.length - 1];
|
|
10479
10875
|
return isStreaming && !!last && last.role === "assistant" && !last.done && !last.isGreeting;
|
|
@@ -10487,25 +10883,25 @@ function lastUserId(messages) {
|
|
|
10487
10883
|
}
|
|
10488
10884
|
var SCROLL_KEYS = /* @__PURE__ */ new Set(["ArrowUp", "ArrowDown", "PageUp", "PageDown", "Home", "End", " "]);
|
|
10489
10885
|
function usePresetDial({ layerRef, dialRef, dialButtonRef, messages, isStreaming, activeTab }) {
|
|
10490
|
-
const [expanded, setExpanded] = (0,
|
|
10491
|
-
const fold = (0,
|
|
10492
|
-
const toggle = (0,
|
|
10886
|
+
const [expanded, setExpanded] = (0, import_react67.useState)(() => !sendInFlight(messages, isStreaming));
|
|
10887
|
+
const fold = (0, import_react67.useCallback)(() => setExpanded(false), []);
|
|
10888
|
+
const toggle = (0, import_react67.useCallback)(() => setExpanded((e) => !e), []);
|
|
10493
10889
|
const currentUserId = lastUserId(messages);
|
|
10494
|
-
const userIdRef = (0,
|
|
10495
|
-
(0,
|
|
10890
|
+
const userIdRef = (0, import_react67.useRef)(currentUserId);
|
|
10891
|
+
(0, import_react67.useEffect)(() => {
|
|
10496
10892
|
if (currentUserId === userIdRef.current) return;
|
|
10497
10893
|
userIdRef.current = currentUserId;
|
|
10498
10894
|
setExpanded(false);
|
|
10499
10895
|
}, [currentUserId]);
|
|
10500
|
-
const tabRef = (0,
|
|
10501
|
-
(0,
|
|
10896
|
+
const tabRef = (0, import_react67.useRef)(activeTab);
|
|
10897
|
+
(0, import_react67.useEffect)(() => {
|
|
10502
10898
|
if (activeTab === tabRef.current) return;
|
|
10503
10899
|
tabRef.current = activeTab;
|
|
10504
10900
|
setExpanded(false);
|
|
10505
10901
|
}, [activeTab]);
|
|
10506
|
-
const expandedRef = (0,
|
|
10902
|
+
const expandedRef = (0, import_react67.useRef)(expanded);
|
|
10507
10903
|
expandedRef.current = expanded;
|
|
10508
|
-
(0,
|
|
10904
|
+
(0, import_react67.useEffect)(() => {
|
|
10509
10905
|
const onEscape = (e) => {
|
|
10510
10906
|
const dial = dialRef.current;
|
|
10511
10907
|
if (e.key !== "Escape" || !dial || !e.composedPath().includes(dial)) return;
|
|
@@ -10518,7 +10914,7 @@ function usePresetDial({ layerRef, dialRef, dialButtonRef, messages, isStreaming
|
|
|
10518
10914
|
window.addEventListener("keydown", onEscape, true);
|
|
10519
10915
|
return () => window.removeEventListener("keydown", onEscape, true);
|
|
10520
10916
|
}, [dialRef, dialButtonRef]);
|
|
10521
|
-
(0,
|
|
10917
|
+
(0, import_react67.useEffect)(() => {
|
|
10522
10918
|
if (!expanded) return;
|
|
10523
10919
|
const layer = layerRef.current;
|
|
10524
10920
|
const inDial = (e) => {
|
|
@@ -10570,11 +10966,11 @@ function markToolSeen() {
|
|
|
10570
10966
|
}
|
|
10571
10967
|
|
|
10572
10968
|
// src/components/ChatPanel.tsx
|
|
10573
|
-
var
|
|
10969
|
+
var import_jsx_runtime105 = require("react/jsx-runtime");
|
|
10574
10970
|
var FULLSCREEN_QUERY = "(max-width: 639px)";
|
|
10575
10971
|
function useIsModal() {
|
|
10576
|
-
const [modal, setModal] = (0,
|
|
10577
|
-
(0,
|
|
10972
|
+
const [modal, setModal] = (0, import_react68.useState)(false);
|
|
10973
|
+
(0, import_react68.useEffect)(() => {
|
|
10578
10974
|
if (typeof window === "undefined" || typeof window.matchMedia !== "function") return;
|
|
10579
10975
|
const mql = window.matchMedia(FULLSCREEN_QUERY);
|
|
10580
10976
|
const sync = () => setModal(mql.matches);
|
|
@@ -10588,12 +10984,12 @@ var HIDDEN_LAYER_STYLE = { position: "absolute", inset: 0, visibility: "hidden",
|
|
|
10588
10984
|
var SQUAD_LAYER_STYLE = { display: "flex", flexDirection: "column", flex: 1, minHeight: 0 };
|
|
10589
10985
|
function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, gamesResult, leaderboardResult, clubFixturesResult, clubStandingsResult, clubSquadResult, clubSquadStatsResult, clubPlayerDetailResult, loggedIn, conversation, presetGrid }) {
|
|
10590
10986
|
const { state, close, stop, send, reset } = controller;
|
|
10591
|
-
const [squadView, setSquadView] = (0,
|
|
10592
|
-
const [selectedPlayerId, setSelectedPlayerId] = (0,
|
|
10987
|
+
const [squadView, setSquadView] = (0, import_react68.useState)("roster");
|
|
10988
|
+
const [selectedPlayerId, setSelectedPlayerId] = (0, import_react68.useState)(null);
|
|
10593
10989
|
const clearPlayerDetail = clubPlayerDetailResult?.clear;
|
|
10594
10990
|
const fetchPlayerDetail = clubPlayerDetailResult?.fetch;
|
|
10595
|
-
const squadLayerRef = (0,
|
|
10596
|
-
const squadScrollRef = (0,
|
|
10991
|
+
const squadLayerRef = (0, import_react68.useRef)(null);
|
|
10992
|
+
const squadScrollRef = (0, import_react68.useRef)(null);
|
|
10597
10993
|
const selectPlayer = (playerId) => {
|
|
10598
10994
|
squadScrollRef.current = squadLayerRef.current?.querySelector(".ss-w-mon-list")?.scrollTop ?? null;
|
|
10599
10995
|
setSelectedPlayerId(playerId);
|
|
@@ -10603,20 +10999,20 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, g
|
|
|
10603
10999
|
setSelectedPlayerId(null);
|
|
10604
11000
|
clearPlayerDetail?.();
|
|
10605
11001
|
};
|
|
10606
|
-
(0,
|
|
11002
|
+
(0, import_react68.useLayoutEffect)(() => {
|
|
10607
11003
|
if (selectedPlayerId !== null || squadScrollRef.current === null) return;
|
|
10608
11004
|
const list = squadLayerRef.current?.querySelector(".ss-w-mon-list");
|
|
10609
11005
|
if (list) list.scrollTop = squadScrollRef.current;
|
|
10610
11006
|
squadScrollRef.current = null;
|
|
10611
11007
|
}, [selectedPlayerId]);
|
|
10612
11008
|
const activeTab = monitor?.activeTab;
|
|
10613
|
-
(0,
|
|
11009
|
+
(0, import_react68.useEffect)(() => {
|
|
10614
11010
|
if (activeTab === "squad" || selectedPlayerId === null) return;
|
|
10615
11011
|
setSelectedPlayerId(null);
|
|
10616
11012
|
clearPlayerDetail?.();
|
|
10617
11013
|
}, [activeTab, selectedPlayerId, clearPlayerDetail]);
|
|
10618
11014
|
const isModal = useIsModal();
|
|
10619
|
-
(0,
|
|
11015
|
+
(0, import_react68.useEffect)(() => {
|
|
10620
11016
|
const onKey = (e) => {
|
|
10621
11017
|
if (e.key === "Escape") close();
|
|
10622
11018
|
};
|
|
@@ -10632,19 +11028,19 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, g
|
|
|
10632
11028
|
monitor?.setActiveTab("chat");
|
|
10633
11029
|
send(text, { grounding });
|
|
10634
11030
|
};
|
|
10635
|
-
(0,
|
|
11031
|
+
(0, import_react68.useEffect)(() => {
|
|
10636
11032
|
if (monitor && monitor.activeTab !== "chat" && state.isStreaming) monitor.markChatActivity();
|
|
10637
11033
|
}, [monitor, state.isStreaming, state.messages.length]);
|
|
10638
11034
|
const onChatTab = !monitor || monitor.activeTab === "chat";
|
|
10639
|
-
const layerRef = (0,
|
|
10640
|
-
const dialRef = (0,
|
|
10641
|
-
const dialButtonRef = (0,
|
|
10642
|
-
const inputRef = (0,
|
|
10643
|
-
const limitRef = (0,
|
|
10644
|
-
const typedSendRef = (0,
|
|
10645
|
-
const focusAfterCloseRef = (0,
|
|
10646
|
-
const [tool, setTool] = (0,
|
|
10647
|
-
const [toolSeen, setToolSeen] = (0,
|
|
11035
|
+
const layerRef = (0, import_react68.useRef)(null);
|
|
11036
|
+
const dialRef = (0, import_react68.useRef)(null);
|
|
11037
|
+
const dialButtonRef = (0, import_react68.useRef)(null);
|
|
11038
|
+
const inputRef = (0, import_react68.useRef)(null);
|
|
11039
|
+
const limitRef = (0, import_react68.useRef)(null);
|
|
11040
|
+
const typedSendRef = (0, import_react68.useRef)(false);
|
|
11041
|
+
const focusAfterCloseRef = (0, import_react68.useRef)(null);
|
|
11042
|
+
const [tool, setTool] = (0, import_react68.useState)(null);
|
|
11043
|
+
const [toolSeen, setToolSeen] = (0, import_react68.useState)(readToolSeen);
|
|
10648
11044
|
const dial = usePresetDial({
|
|
10649
11045
|
layerRef,
|
|
10650
11046
|
dialRef,
|
|
@@ -10656,53 +11052,53 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, g
|
|
|
10656
11052
|
const { fold } = dial;
|
|
10657
11053
|
const paused = isPaused(state.limit);
|
|
10658
11054
|
const showDial = !!presetGrid && onChatTab && !tool && !paused;
|
|
10659
|
-
(0,
|
|
11055
|
+
(0, import_react68.useEffect)(() => {
|
|
10660
11056
|
if (paused) setTool(null);
|
|
10661
11057
|
}, [paused]);
|
|
10662
|
-
(0,
|
|
11058
|
+
(0, import_react68.useEffect)(() => {
|
|
10663
11059
|
if (!paused) return;
|
|
10664
11060
|
if (typedSendRef.current) limitRef.current?.focus();
|
|
10665
11061
|
typedSendRef.current = false;
|
|
10666
11062
|
}, [paused]);
|
|
10667
|
-
const openTool = (0,
|
|
11063
|
+
const openTool = (0, import_react68.useCallback)((next) => {
|
|
10668
11064
|
fold();
|
|
10669
11065
|
markToolSeen();
|
|
10670
11066
|
setToolSeen(true);
|
|
10671
11067
|
setTool(next);
|
|
10672
11068
|
}, [fold]);
|
|
10673
|
-
const onPill = (0,
|
|
10674
|
-
const toolsValue = (0,
|
|
11069
|
+
const onPill = (0, import_react68.useCallback)((kind) => openTool(kind === "numbers" ? { kind: "numbers" } : { kind: "combo" }), [openTool]);
|
|
11070
|
+
const toolsValue = (0, import_react68.useMemo)(
|
|
10675
11071
|
() => presetGrid && !paused ? { openBuilder: (total, legs) => openTool({ kind: "combo", total, legs }), changeLabel: ui.presets.changeCombo } : null,
|
|
10676
11072
|
[presetGrid, paused, openTool, ui.presets.changeCombo]
|
|
10677
11073
|
);
|
|
10678
|
-
const closeTool = (0,
|
|
11074
|
+
const closeTool = (0, import_react68.useCallback)(() => {
|
|
10679
11075
|
focusAfterCloseRef.current = "dial";
|
|
10680
11076
|
setTool(null);
|
|
10681
11077
|
}, []);
|
|
10682
|
-
const sendAsk = (0,
|
|
11078
|
+
const sendAsk = (0, import_react68.useCallback)((ask) => {
|
|
10683
11079
|
focusAfterCloseRef.current = "composer";
|
|
10684
11080
|
setTool(null);
|
|
10685
11081
|
monitor?.setActiveTab("chat");
|
|
10686
11082
|
send(ask.message, { displayText: ask.displayText, preset: ask.preset });
|
|
10687
11083
|
}, [monitor, send]);
|
|
10688
|
-
const formatKickoff = (0,
|
|
11084
|
+
const formatKickoff = (0, import_react68.useCallback)((kickoffUtc) => {
|
|
10689
11085
|
const k = ui.bettingKickoff(kickoffUtc);
|
|
10690
11086
|
return `${k.dayLabel} ${k.time}`;
|
|
10691
11087
|
}, [ui]);
|
|
10692
|
-
(0,
|
|
11088
|
+
(0, import_react68.useEffect)(() => {
|
|
10693
11089
|
if (tool) return;
|
|
10694
11090
|
const target = focusAfterCloseRef.current;
|
|
10695
11091
|
focusAfterCloseRef.current = null;
|
|
10696
11092
|
if (target === "dial") dialButtonRef.current?.focus();
|
|
10697
11093
|
else if (target === "composer") inputRef.current?.focus();
|
|
10698
11094
|
}, [tool]);
|
|
10699
|
-
(0,
|
|
11095
|
+
(0, import_react68.useEffect)(() => {
|
|
10700
11096
|
if (!tool || onChatTab && presetGrid) return;
|
|
10701
11097
|
focusAfterCloseRef.current = "composer";
|
|
10702
11098
|
setTool(null);
|
|
10703
11099
|
}, [tool, onChatTab, presetGrid]);
|
|
10704
|
-
return /* @__PURE__ */ (0,
|
|
10705
|
-
/* @__PURE__ */ (0,
|
|
11100
|
+
return /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("div", { className: "ss-w-panel", role: "dialog", "aria-modal": isModal, "aria-label": ui.chatDialogLabel, children: [
|
|
11101
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
10706
11102
|
ChatHeader,
|
|
10707
11103
|
{
|
|
10708
11104
|
onClose: close,
|
|
@@ -10715,7 +11111,7 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, g
|
|
|
10715
11111
|
moreOptionsLabel: ui.moreOptions
|
|
10716
11112
|
}
|
|
10717
11113
|
),
|
|
10718
|
-
monitor && /* @__PURE__ */ (0,
|
|
11114
|
+
monitor && /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
10719
11115
|
TabBar,
|
|
10720
11116
|
{
|
|
10721
11117
|
monitor,
|
|
@@ -10728,9 +11124,9 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, g
|
|
|
10728
11124
|
clubEnabled: clubFixturesResult?.enabled ?? false
|
|
10729
11125
|
}
|
|
10730
11126
|
),
|
|
10731
|
-
/* @__PURE__ */ (0,
|
|
10732
|
-
/* @__PURE__ */ (0,
|
|
10733
|
-
showDial ? /* @__PURE__ */ (0,
|
|
11127
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("div", { ref: layerRef, className: "ss-w-chat-layer", "data-dial": presetGrid ? "" : void 0, style: onChatTab ? void 0 : HIDDEN_LAYER_STYLE, children: [
|
|
11128
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)(PresetToolsContext.Provider, { value: toolsValue, children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(MessageList, { controller, ui, slip, onDashboardTap, monitor }) }),
|
|
11129
|
+
showDial ? /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
10734
11130
|
PresetSpeedDial,
|
|
10735
11131
|
{
|
|
10736
11132
|
expanded: dial.expanded,
|
|
@@ -10742,21 +11138,21 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, g
|
|
|
10742
11138
|
buttonRef: dialButtonRef
|
|
10743
11139
|
}
|
|
10744
11140
|
) : null,
|
|
10745
|
-
tool && presetGrid && onChatTab && !paused ? tool.kind === "numbers" ? /* @__PURE__ */ (0,
|
|
11141
|
+
tool && presetGrid && onChatTab && !paused ? tool.kind === "numbers" ? /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(SetNumbersTool, { grid: presetGrid, strings: ui.presets, streaming: state.isStreaming, onSend: sendAsk, onClose: closeTool }) : /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(BuildComboTool, { grid: presetGrid, strings: ui.presets, streaming: state.isStreaming, formatKickoff, initialTotal: tool.total, initialLegs: tool.legs, onSend: sendAsk, onClose: closeTool }) : null
|
|
10746
11142
|
] }),
|
|
10747
|
-
monitor && discovery && monitor.activeTab === "today" && /* @__PURE__ */ (0,
|
|
10748
|
-
monitor && monitor.activeTab === "following" && /* @__PURE__ */ (0,
|
|
10749
|
-
monitor && monitor.activeTab === "odds" && /* @__PURE__ */ (0,
|
|
10750
|
-
monitor && monitor.activeTab === "fixtures" && /* @__PURE__ */ (0,
|
|
10751
|
-
monitor && monitor.activeTab === "standings" && /* @__PURE__ */ (0,
|
|
10752
|
-
monitor && monitor.activeTab === "squad" && /* @__PURE__ */ (0,
|
|
10753
|
-
/* @__PURE__ */ (0,
|
|
11143
|
+
monitor && discovery && monitor.activeTab === "today" && /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(TodayPanel, { discovery, ui, monitor }),
|
|
11144
|
+
monitor && monitor.activeTab === "following" && /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(MatchesPanel, { monitor, ui, slip, onAsk: paused ? void 0 : handleAsk }),
|
|
11145
|
+
monitor && monitor.activeTab === "odds" && /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(OddsPanel, { monitor, ui, slip }),
|
|
11146
|
+
monitor && monitor.activeTab === "fixtures" && /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(Fixtures, { fixtures: clubFixturesResult?.fixtures ?? [], loading: clubFixturesResult?.loading ?? false, ui }),
|
|
11147
|
+
monitor && monitor.activeTab === "standings" && /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(Standings, { standings: clubStandingsResult?.data ?? null, loading: clubStandingsResult?.loading ?? false, ui }),
|
|
11148
|
+
monitor && monitor.activeTab === "squad" && /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)(import_jsx_runtime105.Fragment, { children: [
|
|
11149
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
10754
11150
|
"div",
|
|
10755
11151
|
{
|
|
10756
11152
|
ref: squadLayerRef,
|
|
10757
11153
|
style: selectedPlayerId === null ? SQUAD_LAYER_STYLE : HIDDEN_LAYER_STYLE,
|
|
10758
11154
|
"aria-hidden": selectedPlayerId !== null ? true : void 0,
|
|
10759
|
-
children: /* @__PURE__ */ (0,
|
|
11155
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
10760
11156
|
Squad,
|
|
10761
11157
|
{
|
|
10762
11158
|
squad: clubSquadResult?.data ?? null,
|
|
@@ -10766,14 +11162,17 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, g
|
|
|
10766
11162
|
onToggleView: () => setSquadView((v) => v === "roster" ? "stats" : "roster"),
|
|
10767
11163
|
stats: clubSquadStatsResult?.data ?? null,
|
|
10768
11164
|
statsLoading: clubSquadStatsResult?.loading ?? false,
|
|
11165
|
+
seasonName: clubSquadStatsResult?.seasonName ?? null,
|
|
11166
|
+
competitionName: clubSquadStatsResult?.competitionName ?? null,
|
|
11167
|
+
matchesPlayed: clubSquadStatsResult?.matchesPlayed ?? null,
|
|
10769
11168
|
onSelectPlayer: selectPlayer
|
|
10770
11169
|
}
|
|
10771
11170
|
)
|
|
10772
11171
|
}
|
|
10773
11172
|
),
|
|
10774
|
-
selectedPlayerId !== null && /* @__PURE__ */ (0,
|
|
11173
|
+
selectedPlayerId !== null && /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(PlayerDetail, { detail: clubPlayerDetailResult?.data ?? null, loading: clubPlayerDetailResult?.loading ?? false, ui, seasonName: clubSquadStatsResult?.seasonName ?? null, onClose: closePlayer })
|
|
10775
11174
|
] }),
|
|
10776
|
-
monitor && monitor.activeTab === "games" && gamesResult && /* @__PURE__ */ (0,
|
|
11175
|
+
monitor && monitor.activeTab === "games" && gamesResult && /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
10777
11176
|
GamesPanel,
|
|
10778
11177
|
{
|
|
10779
11178
|
loggedIn: !!loggedIn,
|
|
@@ -10788,9 +11187,9 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, g
|
|
|
10788
11187
|
}
|
|
10789
11188
|
}
|
|
10790
11189
|
),
|
|
10791
|
-
(!monitor || monitor.activeTab !== "games") && /* @__PURE__ */ (0,
|
|
10792
|
-
/* @__PURE__ */ (0,
|
|
10793
|
-
paused ? null : /* @__PURE__ */ (0,
|
|
11190
|
+
(!monitor || monitor.activeTab !== "games") && /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)(import_jsx_runtime105.Fragment, { children: [
|
|
11191
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { ref: limitRef, className: "ss-w-limit", role: "status", tabIndex: -1, children: state.limit ? limitText(state.limit, ui) : null }),
|
|
11192
|
+
paused ? null : /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
10794
11193
|
ChatInput,
|
|
10795
11194
|
{
|
|
10796
11195
|
ref: inputRef,
|
|
@@ -10809,9 +11208,9 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, g
|
|
|
10809
11208
|
}
|
|
10810
11209
|
|
|
10811
11210
|
// src/components/HostEventsProvider.tsx
|
|
10812
|
-
var
|
|
11211
|
+
var import_jsx_runtime106 = require("react/jsx-runtime");
|
|
10813
11212
|
function HostEventsProvider({ value, children }) {
|
|
10814
|
-
return /* @__PURE__ */ (0,
|
|
11213
|
+
return /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(SlipStateContext.Provider, { value: value.slipState, children });
|
|
10815
11214
|
}
|
|
10816
11215
|
|
|
10817
11216
|
// src/styles/css.generated.ts
|
|
@@ -10822,7 +11221,7 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
|
|
|
10822
11221
|
--ss-w-cta: #f5a623; --ss-w-cta-ink: #1b1300;
|
|
10823
11222
|
--ss-w-ink: #14181d; --ss-w-faint: #6b7580; --ss-w-line: #e4e8ec;
|
|
10824
11223
|
--ss-w-panel: #ffffff; --ss-w-bubble: #f3f5f7; --ss-w-nav: #0e1622;
|
|
10825
|
-
--ss-w-pos: #1aa563; --ss-w-neg: #e0524b;
|
|
11224
|
+
--ss-w-pos: #1aa563; --ss-w-neg: #e0524b; --ss-w-warn: #c07a00;
|
|
10826
11225
|
--ss-w-home: #3a63a8; --ss-w-away: #c8102e; --ss-w-track: #e9edf1;
|
|
10827
11226
|
--ss-w-correct: #1f9d55; --ss-w-wrong: #b9bbc2;
|
|
10828
11227
|
--ss-w-radius: 16px; --ss-w-offset-x: 20px; --ss-w-offset-y: 20px;
|
|
@@ -10834,7 +11233,7 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
|
|
|
10834
11233
|
--ss-w-accent: #37c891; --ss-w-cta: #ffb638; --ss-w-cta-ink: #1b1300;
|
|
10835
11234
|
--ss-w-ink: #e8edf2; --ss-w-faint: #8b95a1;
|
|
10836
11235
|
--ss-w-line: #2a3441; --ss-w-panel: #141b24; --ss-w-bubble: #1e2732; --ss-w-nav: #0a0f16;
|
|
10837
|
-
--ss-w-pos: #37c891; --ss-w-neg: #f0655d;
|
|
11236
|
+
--ss-w-pos: #37c891; --ss-w-neg: #f0655d; --ss-w-warn: #e0a030;
|
|
10838
11237
|
--ss-w-home: #5b83c8; --ss-w-away: #e8384f; --ss-w-track: #232d3a;
|
|
10839
11238
|
--ss-w-correct: #37c86b; --ss-w-wrong: #3a3a41;
|
|
10840
11239
|
}
|
|
@@ -10843,7 +11242,7 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
|
|
|
10843
11242
|
--ss-w-accent: #37c891; --ss-w-cta: #ffb638; --ss-w-cta-ink: #1b1300;
|
|
10844
11243
|
--ss-w-ink: #e8edf2; --ss-w-faint: #8b95a1;
|
|
10845
11244
|
--ss-w-line: #2a3441; --ss-w-panel: #141b24; --ss-w-bubble: #1e2732; --ss-w-nav: #0a0f16;
|
|
10846
|
-
--ss-w-pos: #37c891; --ss-w-neg: #f0655d;
|
|
11245
|
+
--ss-w-pos: #37c891; --ss-w-neg: #f0655d; --ss-w-warn: #e0a030;
|
|
10847
11246
|
--ss-w-home: #5b83c8; --ss-w-away: #e8384f; --ss-w-track: #232d3a;
|
|
10848
11247
|
--ss-w-correct: #37c86b; --ss-w-wrong: #3a3a41;
|
|
10849
11248
|
}
|
|
@@ -11820,8 +12219,13 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
|
|
|
11820
12219
|
.ss-w-fandash-live-team-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 700; line-height: 1.15; color: var(--ss-w-ink); }
|
|
11821
12220
|
.ss-w-fandash-live-score-main { display: flex; align-items: baseline; justify-content: center; font-size: 36px; font-weight: 850; font-variant-numeric: tabular-nums; line-height: 1; white-space: nowrap; color: var(--ss-w-ink); }
|
|
11822
12221
|
.ss-w-fandash-live-score-sep { color: var(--ss-w-faint); font-weight: 500; margin: 0 5px; }
|
|
11823
|
-
.ss-w-fandash-live-scorers { margin-top: 12px; display: flex; justify-content:
|
|
11824
|
-
.ss-w-fandash-live-scorers
|
|
12222
|
+
.ss-w-fandash-live-scorers-row { margin-top: 12px; display: flex; justify-content: space-between; gap: 10px; }
|
|
12223
|
+
.ss-w-fandash-live-scorers { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: 12.5px; color: var(--ss-w-faint); overflow-wrap: anywhere; }
|
|
12224
|
+
.ss-w-fandash-live-scorers--home { justify-content: flex-start; }
|
|
12225
|
+
.ss-w-fandash-live-scorers--away { justify-content: flex-end; }
|
|
12226
|
+
.ss-w-fandash-live-scorers--home .ss-w-fandash-live-scorers-icon { color: var(--ss-w-home); }
|
|
12227
|
+
.ss-w-fandash-live-scorers--away .ss-w-fandash-live-scorers-icon { color: var(--ss-w-away); }
|
|
12228
|
+
.ss-w-fandash-live-scorers-icon { flex: none; }
|
|
11825
12229
|
|
|
11826
12230
|
/* live timeline: a compact two-sided event list down a centre spine -- each club's events sit on
|
|
11827
12231
|
its own side (home left, away right), most-recent 3 shown with a "See more" toggle for the
|
|
@@ -11974,7 +12378,7 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
|
|
|
11974
12378
|
.ss-w-sq-name { font-size: 13px; font-weight: 600; color: var(--ss-w-ink); }
|
|
11975
12379
|
.ss-w-sq-name { flex: 1; min-width: 0; }
|
|
11976
12380
|
.ss-w-sq-name-1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
11977
|
-
.ss-w-sq-seg { display: flex;
|
|
12381
|
+
.ss-w-sq-seg { display: flex; gap: 2px; padding: 2px; border-radius: var(--ss-w-radius); background: var(--ss-w-track); }
|
|
11978
12382
|
.ss-w-sq-seg-btn { flex: 1; padding: 5px 8px; border: 0; border-radius: calc(var(--ss-w-radius) - 2px); background: transparent; font: inherit; font-size: 12px; font-weight: 600; color: var(--ss-w-faint); cursor: pointer; }
|
|
11979
12383
|
.ss-w-sq-seg-btn[aria-pressed="true"] { background: var(--ss-w-panel); color: var(--ss-w-ink); }
|
|
11980
12384
|
.ss-w-sq-seg-btn:focus-visible, .ss-w-sq-tap:focus-visible, .ss-w-pd-back:focus-visible { outline: 2px solid var(--ss-w-accent); outline-offset: 1px; }
|
|
@@ -11982,15 +12386,95 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
|
|
|
11982
12386
|
.ss-w-sq-col { flex: none; width: 40px; text-align: center; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ss-w-ink); }
|
|
11983
12387
|
.ss-w-sq-head { border-bottom: 0; padding-bottom: 0; }
|
|
11984
12388
|
.ss-w-sq-head .ss-w-sq-col { font-size: 10px; font-weight: 700; color: var(--ss-w-faint); }
|
|
11985
|
-
.ss-w-
|
|
11986
|
-
.ss-w-
|
|
11987
|
-
.ss-w-
|
|
11988
|
-
.ss-w-
|
|
11989
|
-
.ss-w-
|
|
11990
|
-
.ss-w-
|
|
11991
|
-
.ss-w-
|
|
11992
|
-
.ss-w-
|
|
11993
|
-
.ss-w-
|
|
12389
|
+
.ss-w-sq-stats { padding-top: 10px; gap: 10px; }
|
|
12390
|
+
.ss-w-sq-card { background: var(--ss-w-panel); border: 1px solid var(--ss-w-line); border-radius: 12px; overflow: hidden; }
|
|
12391
|
+
.ss-w-sq-stats .ss-w-sq-row { display: grid; grid-template-columns: 1fr 26px 30px 36px 20px 20px 20px 20px 36px; gap: 0; padding: 7px 10px; font-size: 11px; }
|
|
12392
|
+
.ss-w-sq-card > :last-child { border-bottom: 0; }
|
|
12393
|
+
.ss-w-sq-pos, .ss-w-sq-c20, .ss-w-sq-c30, .ss-w-sq-c36 { text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11px; font-weight: 400; font-variant-numeric: tabular-nums; color: var(--ss-w-ink); }
|
|
12394
|
+
.ss-w-sq-stats .ss-w-sq-head { padding-bottom: 7px; border-bottom: 1px solid var(--ss-w-line); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; color: var(--ss-w-faint); }
|
|
12395
|
+
.ss-w-sq-stats .ss-w-sq-head > span { font-size: 9px; font-weight: 700; color: var(--ss-w-faint); }
|
|
12396
|
+
.ss-w-sq-player { display: flex; align-items: center; gap: 6px; min-width: 0; }
|
|
12397
|
+
.ss-w-sq-badge { flex: none; width: 18px; height: 18px; border-radius: 6px; background: var(--ss-w-track); color: var(--ss-w-faint); font-size: 9px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
|
|
12398
|
+
.ss-w-sq-stats .ss-w-sq-name { font-size: 11px; }
|
|
12399
|
+
.ss-w-sq-rtg { font-weight: 700; }
|
|
12400
|
+
.ss-w-sq-rtg-none { color: var(--ss-w-faint); font-weight: 400; }
|
|
12401
|
+
.ss-w-sq-stats .ss-w-pos-ink { color: var(--ss-w-pos); font-weight: 700; }
|
|
12402
|
+
.ss-w-sq-foot { padding: 0 2px; font-size: 10.5px; color: var(--ss-w-faint); }
|
|
12403
|
+
.ss-w-sq-bar { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 10px 14px 0; }
|
|
12404
|
+
.ss-w-sq-bar .ss-w-sq-seg { margin: 0; }
|
|
12405
|
+
.ss-w-sq-bar .ss-w-sq-seg:only-child { flex: 1; }
|
|
12406
|
+
.ss-w-sq-bar .ss-w-sq-seg:not(:only-child) { flex: none; }
|
|
12407
|
+
.ss-w-sq-eyebrow { flex: 1; min-width: 0; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ss-w-faint); }
|
|
12408
|
+
@media (max-width: 429px) { .ss-w-sq-badge { display: none; } }
|
|
12409
|
+
@media (max-width: 359px) {
|
|
12410
|
+
.ss-w-sq-yr { display: none; }
|
|
12411
|
+
.ss-w-sq-stats .ss-w-sq-row { grid-template-columns: 1fr 26px 30px 36px 20px 20px 36px; }
|
|
12412
|
+
}
|
|
12413
|
+
.ss-w-pd-bar { flex: none; display: flex; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--ss-w-line); line-height: normal; }
|
|
12414
|
+
.ss-w-pd-back { display: flex; align-items: center; gap: 2px; min-height: 32px; padding: 8px 8px 8px 0; margin: -8px 0; border: 0; background: transparent; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--ss-w-faint); cursor: pointer; }
|
|
12415
|
+
.ss-w-pd-back:hover { color: var(--ss-w-ink); }
|
|
12416
|
+
.ss-w-mon-list.ss-w-pd-list { padding: 16px; gap: 14px; line-height: normal; }
|
|
12417
|
+
.ss-w-pd-card { background: var(--ss-w-panel); border: 1px solid var(--ss-w-line); border-radius: 12px; }
|
|
12418
|
+
.ss-w-pd-faint { color: var(--ss-w-faint); }
|
|
12419
|
+
.ss-w-pd-profile { display: flex; gap: 12px; padding: 14px; }
|
|
12420
|
+
.ss-w-pd-photo { flex: none; border-radius: 50%; border: 1px solid var(--ss-w-line); background: var(--ss-w-bubble); object-fit: cover; }
|
|
12421
|
+
.ss-w-pd-avatar { display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--ss-w-ink); }
|
|
12422
|
+
.ss-w-pd-profile-main { flex: 1; min-width: 0; }
|
|
12423
|
+
.ss-w-pd-name { font-size: 16px; font-weight: 800; color: var(--ss-w-ink); overflow-wrap: break-word; }
|
|
12424
|
+
.ss-w-pd-sub { margin-top: 1px; font-size: 12px; color: var(--ss-w-faint); }
|
|
12425
|
+
/* Two columns as on the board, collapsing to one when a column would drop under 80px (narrow phones). */
|
|
12426
|
+
.ss-w-pd-bio { display: grid; grid-template-columns: repeat(auto-fill, minmax(max(80px, calc((100% - 10px) / 2)), 1fr)); gap: 4px 10px; margin-top: 10px; font-size: 11.5px; }
|
|
12427
|
+
.ss-w-pd-bio-item { min-width: 0; overflow-wrap: break-word; }
|
|
12428
|
+
.ss-w-pd-pitch { position: relative; flex: none; width: 56px; height: 76px; border: 1px solid var(--ss-w-line); border-radius: 6px; background: var(--ss-w-track); }
|
|
12429
|
+
.ss-w-pd-pitch-dot { position: absolute; width: 11px; height: 11px; border-radius: 50%; background: var(--ss-w-accent); border: 2px solid var(--ss-w-nav); transform: translate(-50%, -50%); }
|
|
12430
|
+
.ss-w-pd-avail { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; }
|
|
12431
|
+
.ss-w-pd-avail-text { min-width: 0; }
|
|
12432
|
+
.ss-w-pd-avail-next { font-size: 12.5px; font-weight: 700; }
|
|
12433
|
+
.ss-w-pd-avail-note { margin-top: 1px; font-size: 11px; color: var(--ss-w-faint); }
|
|
12434
|
+
.ss-w-pd-pill { flex: none; padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
|
|
12435
|
+
.ss-w-pd-pill--pos, .ss-w-pd-chip--pos { background: color-mix(in srgb, var(--ss-w-pos) 14%, transparent); color: var(--ss-w-pos); }
|
|
12436
|
+
.ss-w-pd-pill--warn, .ss-w-pd-chip--warn { background: color-mix(in srgb, var(--ss-w-warn) 14%, transparent); color: var(--ss-w-warn); }
|
|
12437
|
+
.ss-w-pd-pill--neg, .ss-w-pd-chip--neg { background: color-mix(in srgb, var(--ss-w-neg) 14%, transparent); color: var(--ss-w-neg); }
|
|
12438
|
+
.ss-w-pd-pill--draw { background: var(--ss-w-track); color: var(--ss-w-faint); }
|
|
12439
|
+
.ss-w-pd-eyebrow { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ss-w-faint); padding: 0 2px; }
|
|
12440
|
+
.ss-w-pd-eyebrow--block { margin-bottom: 8px; }
|
|
12441
|
+
.ss-w-pd-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
|
|
12442
|
+
.ss-w-pd-tile { min-width: 0; padding: 10px; background: var(--ss-w-panel); border: 1px solid var(--ss-w-line); border-radius: 12px; }
|
|
12443
|
+
.ss-w-pd-tile-label { font-size: 10.5px; color: var(--ss-w-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
12444
|
+
.ss-w-pd-tile-value { margin-top: 2px; font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
|
|
12445
|
+
.ss-w-pd-pos-ink { color: var(--ss-w-pos); }
|
|
12446
|
+
/* Below 360px the board's 10px tile padding clips "Matches"/"Minutes" (43px) in a ~34px label box. */
|
|
12447
|
+
@media (max-width: 359px) {
|
|
12448
|
+
.ss-w-pd-tiles { gap: 6px; }
|
|
12449
|
+
.ss-w-pd-tile { padding: 10px 6px; }
|
|
12450
|
+
}
|
|
12451
|
+
.ss-w-pd-perf-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 2px; }
|
|
12452
|
+
.ss-w-pd-perf-head .ss-w-pd-eyebrow { flex: 1; min-width: 0; }
|
|
12453
|
+
.ss-w-pd-seg { flex: none; display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--ss-w-track); }
|
|
12454
|
+
.ss-w-pd-seg-btn { padding: 5px 12px; border: 0; border-radius: 999px; background: transparent; font: inherit; font-size: 11.5px; font-weight: 700; line-height: normal; white-space: nowrap; color: var(--ss-w-faint); cursor: pointer; }
|
|
12455
|
+
.ss-w-pd-seg-btn[aria-pressed="true"] { background: var(--ss-w-nav); color: #fff; }
|
|
12456
|
+
.ss-w-pd-seg-btn:focus-visible { outline: 2px solid var(--ss-w-accent); outline-offset: 1px; }
|
|
12457
|
+
.ss-w-pd-perf-sub { margin-bottom: 10px; font-size: 11px; color: var(--ss-w-faint); }
|
|
12458
|
+
.ss-w-pd-perf-head + .ss-w-pd-perf-cards { margin-top: 10px; }
|
|
12459
|
+
.ss-w-pd-perf-cards { display: flex; flex-direction: column; gap: 8px; }
|
|
12460
|
+
.ss-w-pd-perf-card { padding: 14px; }
|
|
12461
|
+
.ss-w-pd-perf-group { margin-bottom: 10px; font-size: 12.5px; font-weight: 700; }
|
|
12462
|
+
.ss-w-pd-bar-row + .ss-w-pd-bar-row { margin-top: 12px; }
|
|
12463
|
+
.ss-w-pd-bar-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 5px; font-size: 12.5px; }
|
|
12464
|
+
.ss-w-pd-bar-label { min-width: 0; overflow-wrap: break-word; }
|
|
12465
|
+
.ss-w-pd-bar-value { flex: none; font-weight: 700; font-variant-numeric: tabular-nums; }
|
|
12466
|
+
.ss-w-pd-track { height: 6px; border-radius: 999px; background: var(--ss-w-track); overflow: hidden; }
|
|
12467
|
+
.ss-w-pd-fill { height: 100%; border-radius: 999px; }
|
|
12468
|
+
.ss-w-pd-fill--pos { background: var(--ss-w-pos); }
|
|
12469
|
+
.ss-w-pd-fill--warn { background: var(--ss-w-warn); }
|
|
12470
|
+
.ss-w-pd-fill--neg { background: var(--ss-w-neg); }
|
|
12471
|
+
.ss-w-pd-match { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--ss-w-line); }
|
|
12472
|
+
.ss-w-pd-match:last-child { border-bottom: none; }
|
|
12473
|
+
.ss-w-pd-match-date { font-size: 10.5px; color: var(--ss-w-faint); }
|
|
12474
|
+
.ss-w-pd-match-opp { font-size: 12.5px; font-weight: 600; overflow-wrap: break-word; }
|
|
12475
|
+
.ss-w-pd-match-sub { margin-top: 1px; font-size: 10.5px; color: var(--ss-w-faint); }
|
|
12476
|
+
.ss-w-pd-chip-empty { min-width: 30px; }
|
|
12477
|
+
.ss-w-pd-chip { min-width: 30px; padding: 3px 0; border-radius: 6px; text-align: center; font-size: 11.5px; font-weight: 800; font-variant-numeric: tabular-nums; }
|
|
11994
12478
|
.ss-w-rec-list { margin: 0; padding: 0; list-style: none; }
|
|
11995
12479
|
.ss-w-rec-value { flex: none; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ss-w-ink); }
|
|
11996
12480
|
.ss-w-rec-since { font-size: 12px; color: var(--ss-w-faint); }
|
|
@@ -12597,7 +13081,7 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
|
|
|
12597
13081
|
`;
|
|
12598
13082
|
|
|
12599
13083
|
// src/StatsWidget.tsx
|
|
12600
|
-
var
|
|
13084
|
+
var import_jsx_runtime107 = require("react/jsx-runtime");
|
|
12601
13085
|
function buildClient(props) {
|
|
12602
13086
|
try {
|
|
12603
13087
|
if ("client" in props && props.client) {
|
|
@@ -12622,24 +13106,24 @@ function injectStyles(root) {
|
|
|
12622
13106
|
function StatsWidget(props) {
|
|
12623
13107
|
const injectedClient = "client" in props ? props.client : void 0;
|
|
12624
13108
|
const cfg = props.config;
|
|
12625
|
-
const built = (0,
|
|
12626
|
-
const logger = (0,
|
|
13109
|
+
const built = (0, import_react69.useMemo)(() => buildClient(props), [injectedClient, cfg?.operatorId, cfg?.publicKey, cfg?.baseUrl]);
|
|
13110
|
+
const logger = (0, import_react69.useMemo)(
|
|
12627
13111
|
() => built ? built.client.createEventLogger({
|
|
12628
13112
|
operatorUserId: cfg?.userContext?.operatorUserId,
|
|
12629
13113
|
anonymousUserId: cfg?.userContext?.anonymousUserId
|
|
12630
13114
|
}) : null,
|
|
12631
13115
|
[built?.client]
|
|
12632
13116
|
);
|
|
12633
|
-
const ui = (0,
|
|
12634
|
-
const rootRef = (0,
|
|
12635
|
-
const introDoneRef = (0,
|
|
12636
|
-
const markIntroDone = (0,
|
|
13117
|
+
const ui = (0, import_react69.useMemo)(() => normalizeUi(props.config ?? { operatorId: "", publicKey: "" }), [props.config]);
|
|
13118
|
+
const rootRef = (0, import_react69.useRef)(null);
|
|
13119
|
+
const introDoneRef = (0, import_react69.useRef)(false);
|
|
13120
|
+
const markIntroDone = (0, import_react69.useCallback)(() => {
|
|
12637
13121
|
introDoneRef.current = true;
|
|
12638
13122
|
}, []);
|
|
12639
13123
|
const convStorageKey = `ss-w-conv:${cfg?.operatorId ?? ""}:${cfg?.userContext?.operatorUserId ?? "anon"}`;
|
|
12640
13124
|
const controller = useChatStream(built?.conversation ?? emptyConversation(), ui.starters, built ? ui.greetingMessage : void 0, convStorageKey);
|
|
12641
|
-
const [hasToday, setHasToday] = (0,
|
|
12642
|
-
const liveCardWatches = (0,
|
|
13125
|
+
const [hasToday, setHasToday] = (0, import_react69.useState)(false);
|
|
13126
|
+
const liveCardWatches = (0, import_react69.useMemo)(() => {
|
|
12643
13127
|
const seen = /* @__PURE__ */ new Set();
|
|
12644
13128
|
const out = [];
|
|
12645
13129
|
for (const msg of controller.state.messages) {
|
|
@@ -12665,19 +13149,19 @@ function StatsWidget(props) {
|
|
|
12665
13149
|
});
|
|
12666
13150
|
const operatorUserId = cfg?.userContext?.operatorUserId;
|
|
12667
13151
|
const anonymousUserId = cfg?.userContext?.anonymousUserId;
|
|
12668
|
-
const getSchedule = (0,
|
|
13152
|
+
const getSchedule = (0, import_react69.useCallback)(
|
|
12669
13153
|
(localDate, utcOffsetMinutes) => built ? built.conversation.getSchedule(localDate, utcOffsetMinutes, operatorUserId, anonymousUserId) : Promise.resolve(null),
|
|
12670
13154
|
[built, operatorUserId, anonymousUserId]
|
|
12671
13155
|
);
|
|
12672
|
-
const postLeagueStar = (0,
|
|
13156
|
+
const postLeagueStar = (0, import_react69.useCallback)(
|
|
12673
13157
|
(competitionId, starred) => built ? built.conversation.starLeague(competitionId, starred, operatorUserId, anonymousUserId) : Promise.resolve(null),
|
|
12674
13158
|
[built, operatorUserId, anonymousUserId]
|
|
12675
13159
|
);
|
|
12676
|
-
const getStates = (0,
|
|
13160
|
+
const getStates = (0, import_react69.useCallback)(
|
|
12677
13161
|
(matchIds) => built ? built.conversation.getStates(matchIds) : Promise.resolve(null),
|
|
12678
13162
|
[built]
|
|
12679
13163
|
);
|
|
12680
|
-
const pinnedMatchIds = (0,
|
|
13164
|
+
const pinnedMatchIds = (0, import_react69.useMemo)(
|
|
12681
13165
|
() => monitor.pins.filter((p) => p.kind === "match").map((p) => p.matchId),
|
|
12682
13166
|
[monitor.pins]
|
|
12683
13167
|
);
|
|
@@ -12692,11 +13176,11 @@ function StatsWidget(props) {
|
|
|
12692
13176
|
pinnedMatchIds
|
|
12693
13177
|
});
|
|
12694
13178
|
const todayHasContent = visibleGroupsOf(discovery.groups, discovery.states).length > 0;
|
|
12695
|
-
(0,
|
|
13179
|
+
(0, import_react69.useEffect)(() => {
|
|
12696
13180
|
setHasToday(todayHasContent);
|
|
12697
13181
|
}, [todayHasContent]);
|
|
12698
|
-
const prevLiveSnapshotRef = (0,
|
|
12699
|
-
(0,
|
|
13182
|
+
const prevLiveSnapshotRef = (0, import_react69.useRef)(monitor.snapshot);
|
|
13183
|
+
(0, import_react69.useEffect)(() => {
|
|
12700
13184
|
const snap = monitor.snapshot;
|
|
12701
13185
|
if (!snap || snap === prevLiveSnapshotRef.current) return;
|
|
12702
13186
|
prevLiveSnapshotRef.current = snap;
|
|
@@ -12736,14 +13220,14 @@ function StatsWidget(props) {
|
|
|
12736
13220
|
const clubSquadResult = useClubSquad(built?.conversation ?? null, { activeTab: monitor.activeTab, enabled: clubFixturesResult.enabled });
|
|
12737
13221
|
const clubSquadStatsResult = useClubSquadStats(built?.conversation ?? null, { activeTab: monitor.activeTab, enabled: clubFixturesResult.enabled });
|
|
12738
13222
|
const clubPlayerDetailResult = useClubPlayerDetail(built?.conversation ?? null);
|
|
12739
|
-
const getPricePresets = (0,
|
|
13223
|
+
const getPricePresets = (0, import_react69.useCallback)(
|
|
12740
13224
|
(locale2) => built ? built.conversation.getPricePresets(locale2, { pool: "open" }) : Promise.resolve(null),
|
|
12741
13225
|
[built]
|
|
12742
13226
|
);
|
|
12743
13227
|
const presetGrid = usePresetGrid({ getPricePresets, isOpen: controller.state.isOpen, locale: ui.presets.lang });
|
|
12744
13228
|
const markTodayActivity = monitor.markTodayActivity;
|
|
12745
|
-
const prevLiveCountRef = (0,
|
|
12746
|
-
(0,
|
|
13229
|
+
const prevLiveCountRef = (0, import_react69.useRef)(0);
|
|
13230
|
+
(0, import_react69.useEffect)(() => {
|
|
12747
13231
|
const rose = prevLiveCountRef.current === 0 && discovery.liveCount > 0;
|
|
12748
13232
|
prevLiveCountRef.current = discovery.liveCount;
|
|
12749
13233
|
if (rose) markTodayActivity();
|
|
@@ -12757,7 +13241,7 @@ function StatsWidget(props) {
|
|
|
12757
13241
|
closePanel: controller.close
|
|
12758
13242
|
});
|
|
12759
13243
|
const markAdded = hostEvents.markAdded;
|
|
12760
|
-
const slip = (0,
|
|
13244
|
+
const slip = (0, import_react69.useMemo)(
|
|
12761
13245
|
() => {
|
|
12762
13246
|
const handler = props.config?.onAddToSlip;
|
|
12763
13247
|
return {
|
|
@@ -12776,7 +13260,7 @@ function StatsWidget(props) {
|
|
|
12776
13260
|
},
|
|
12777
13261
|
[props.config?.onAddToSlip, controller.state.conversationId, markAdded]
|
|
12778
13262
|
);
|
|
12779
|
-
const onDashboardTap = (0,
|
|
13263
|
+
const onDashboardTap = (0, import_react69.useMemo)(
|
|
12780
13264
|
() => built ? createDashboardTapSignal((input) => built.conversation.sendSignal(input), logger) : void 0,
|
|
12781
13265
|
[built, logger]
|
|
12782
13266
|
);
|
|
@@ -12793,11 +13277,11 @@ function StatsWidget(props) {
|
|
|
12793
13277
|
})
|
|
12794
13278
|
}));
|
|
12795
13279
|
const conversationId = controller.state.conversationId ?? void 0;
|
|
12796
|
-
(0,
|
|
13280
|
+
(0, import_react69.useEffect)(() => {
|
|
12797
13281
|
if (!logger) return;
|
|
12798
13282
|
logger.setIdentity({ operatorUserId, anonymousUserId, conversationId });
|
|
12799
13283
|
}, [logger, operatorUserId, anonymousUserId, conversationId]);
|
|
12800
|
-
(0,
|
|
13284
|
+
(0, import_react69.useEffect)(() => {
|
|
12801
13285
|
if (!logger) return;
|
|
12802
13286
|
logger.resume();
|
|
12803
13287
|
const onHide = () => {
|
|
@@ -12815,14 +13299,14 @@ function StatsWidget(props) {
|
|
|
12815
13299
|
logger.dispose();
|
|
12816
13300
|
};
|
|
12817
13301
|
}, [logger]);
|
|
12818
|
-
(0,
|
|
13302
|
+
(0, import_react69.useEffect)(() => {
|
|
12819
13303
|
if (!built || !ui.injectStyles) return;
|
|
12820
13304
|
const node = rootRef.current?.getRootNode();
|
|
12821
13305
|
if (node) injectStyles(node);
|
|
12822
13306
|
}, [built, ui.injectStyles]);
|
|
12823
13307
|
if (!built) return null;
|
|
12824
13308
|
const attrs = themeAttrs(ui);
|
|
12825
|
-
return /* @__PURE__ */ (0,
|
|
13309
|
+
return /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(EventLogContext.Provider, { value: logger, children: /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(HostEventsProvider, { value: hostEvents, children: /* @__PURE__ */ (0, import_jsx_runtime107.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"], style: attrs.style, children: controller.state.isOpen ? /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
|
|
12826
13310
|
ChatPanel,
|
|
12827
13311
|
{
|
|
12828
13312
|
controller,
|
|
@@ -12842,7 +13326,7 @@ function StatsWidget(props) {
|
|
|
12842
13326
|
conversation: built?.conversation ?? null,
|
|
12843
13327
|
presetGrid
|
|
12844
13328
|
}
|
|
12845
|
-
) : /* @__PURE__ */ (0,
|
|
13329
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
|
|
12846
13330
|
ChatFab,
|
|
12847
13331
|
{
|
|
12848
13332
|
label: ui.launcherLabel,
|