@sensiblestats/widget-react 0.75.0 → 0.77.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/index.cjs +717 -641
- 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 +718 -642
- package/dist/index.js.map +1 -1
- package/dist/styles.css +31 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -154,7 +154,8 @@ var STRINGS = {
|
|
|
154
154
|
marketRow: "{market} picks today",
|
|
155
155
|
marketName: "Market",
|
|
156
156
|
marketShort: (dev, market, sel) => ({ BOTH_TEAMS_TO_SCORE: "BTTS", DOUBLE_CHANCE: "Double chance", FULLTIME_RESULT: "Match winner" })[dev] ?? (dev === "GOALS_OVER_UNDER" && sel ? sel : sel ? `${market} ${sel}` : market),
|
|
157
|
-
marketMessage: (market, sel, count) => `Show me ${count} ${sel ? `${market} \u2013 ${sel}` : market} picks
|
|
157
|
+
marketMessage: (market, sel, count) => `Show me ${count} ${sel ? `${market} \u2013 ${sel}` : market} picks.`,
|
|
158
|
+
standoutAsk: "Standout matches today"
|
|
158
159
|
},
|
|
159
160
|
games: {
|
|
160
161
|
lang: "en",
|
|
@@ -169,6 +170,8 @@ var STRINGS = {
|
|
|
169
170
|
statRank: "Rank",
|
|
170
171
|
unitDays: "days",
|
|
171
172
|
unitPts: "pts",
|
|
173
|
+
worthNow: (pts) => `Worth ${pts} pts now`,
|
|
174
|
+
worthAfterMiss: (pts) => `${pts} after a miss`,
|
|
172
175
|
thisWeek: "this week",
|
|
173
176
|
newToday: "New today",
|
|
174
177
|
resume: "Resume",
|
|
@@ -493,7 +496,8 @@ var STRINGS = {
|
|
|
493
496
|
marketRow: "Bug\xFCnk\xFC {market} se\xE7imleri",
|
|
494
497
|
marketName: "Bahis t\xFCr\xFC",
|
|
495
498
|
marketShort: (dev, market, sel) => ({ BOTH_TEAMS_TO_SCORE: "KG Var", DOUBLE_CHANCE: "\xC7ifte \u015Fans", FULLTIME_RESULT: "Ma\xE7 sonucu" })[dev] ?? (dev === "GOALS_OVER_UNDER" && sel ? sel : sel ? `${market} ${sel}` : market),
|
|
496
|
-
marketMessage: (market, sel, count) => `${count} ${sel ? `${market} \u2013 ${sel}` : market} se\xE7imi g\xF6ster
|
|
499
|
+
marketMessage: (market, sel, count) => `${count} ${sel ? `${market} \u2013 ${sel}` : market} se\xE7imi g\xF6ster.`,
|
|
500
|
+
standoutAsk: "Bug\xFCn\xFCn \xF6ne \xE7\u0131kan ma\xE7lar\u0131"
|
|
497
501
|
},
|
|
498
502
|
games: {
|
|
499
503
|
lang: "tr",
|
|
@@ -508,6 +512,8 @@ var STRINGS = {
|
|
|
508
512
|
statRank: "S\u0131ra",
|
|
509
513
|
unitDays: "g\xFCn",
|
|
510
514
|
unitPts: "puan",
|
|
515
|
+
worthNow: (pts) => `\u015Eimdi ${pts} puan`,
|
|
516
|
+
worthAfterMiss: (pts) => `yanl\u0131\u015Fta ${pts}`,
|
|
511
517
|
thisWeek: "bu hafta",
|
|
512
518
|
newToday: "Bug\xFCn yeni",
|
|
513
519
|
resume: "Devam et",
|
|
@@ -1954,18 +1960,23 @@ function tileDisplayText(tile) {
|
|
|
1954
1960
|
const subtitle = tile.subtitle?.trim();
|
|
1955
1961
|
return isPriceTile(tile) && subtitle ? subtitle : tile.title;
|
|
1956
1962
|
}
|
|
1957
|
-
var
|
|
1958
|
-
|
|
1963
|
+
var MAX_PRICE_TILE_ID = "goal-preset-max-price";
|
|
1964
|
+
var STANDOUT_TILE_ID = "goal-standout-matches";
|
|
1965
|
+
function bubbleAsks(messages, standoutLabel) {
|
|
1959
1966
|
for (let i = messages.length - 1; i >= 0; i--) {
|
|
1960
1967
|
const m = messages[i];
|
|
1961
1968
|
if (!m || m.role !== "assistant" || !m.isGreeting) continue;
|
|
1962
1969
|
const dashboard = m.greetingDashboard;
|
|
1963
|
-
if (!dashboard) return [];
|
|
1970
|
+
if (!dashboard || !dashboard.tiles.some(isPriceTile)) return [];
|
|
1964
1971
|
const asks = [];
|
|
1965
|
-
|
|
1966
|
-
const
|
|
1967
|
-
|
|
1968
|
-
|
|
1972
|
+
const add = (entityId, labelOf) => {
|
|
1973
|
+
const index = dashboard.tiles.findIndex((tile2) => tile2.signal?.entityId === entityId);
|
|
1974
|
+
const tile = dashboard.tiles[index];
|
|
1975
|
+
const label = tile ? labelOf(tile)?.trim() : void 0;
|
|
1976
|
+
if (tile && label) asks.push({ tile, index, position: asks.length, layout: dashboard.layout, label });
|
|
1977
|
+
};
|
|
1978
|
+
add(MAX_PRICE_TILE_ID, (tile) => tile.subtitle ?? void 0);
|
|
1979
|
+
add(STANDOUT_TILE_ID, () => standoutLabel);
|
|
1969
1980
|
return asks;
|
|
1970
1981
|
}
|
|
1971
1982
|
return [];
|
|
@@ -1974,7 +1985,7 @@ function runBubbleAsk(ask, deps) {
|
|
|
1974
1985
|
deps.log?.log({ name: "popup_ask_tap", outcome: String(ask.position) });
|
|
1975
1986
|
deps.open();
|
|
1976
1987
|
deps.setActiveTab("chat");
|
|
1977
|
-
const displayText =
|
|
1988
|
+
const displayText = ask.label;
|
|
1978
1989
|
deps.send(ask.tile.actionValue, ask.tile.actionRef ? { actionRef: ask.tile.actionRef, displayText } : { displayText });
|
|
1979
1990
|
deps.onDashboardTap?.(ask.tile, ask.index, ask.layout);
|
|
1980
1991
|
}
|
|
@@ -6378,53 +6389,104 @@ function SearchField({ id, label, labelHidden = false, placeholder, value, onCha
|
|
|
6378
6389
|
] });
|
|
6379
6390
|
}
|
|
6380
6391
|
|
|
6392
|
+
// src/components/games/ui/AnswerTray.tsx
|
|
6393
|
+
import { Fragment as Fragment11, jsx as jsx67, jsxs as jsxs59 } from "react/jsx-runtime";
|
|
6394
|
+
function AnswerTray({ id, label, placeholder, optionsLabel, options, query, onQuery, onPick, disabled, minQuery = 0 }) {
|
|
6395
|
+
const needle = query.trim().toLowerCase();
|
|
6396
|
+
const shown = needle.length < minQuery ? [] : needle ? options.filter((o) => o.name.toLowerCase().includes(needle)) : options;
|
|
6397
|
+
return /* @__PURE__ */ jsxs59(Fragment11, { children: [
|
|
6398
|
+
/* @__PURE__ */ jsx67(
|
|
6399
|
+
SearchField,
|
|
6400
|
+
{
|
|
6401
|
+
id,
|
|
6402
|
+
label,
|
|
6403
|
+
labelHidden: true,
|
|
6404
|
+
placeholder,
|
|
6405
|
+
value: query,
|
|
6406
|
+
onChange: onQuery,
|
|
6407
|
+
disabled
|
|
6408
|
+
}
|
|
6409
|
+
),
|
|
6410
|
+
shown.length > 0 && /* @__PURE__ */ jsx67("div", { className: "ss-g-tray", role: "listbox", "aria-label": optionsLabel, children: shown.map((o) => {
|
|
6411
|
+
const { first, last } = splitName(o.name);
|
|
6412
|
+
return /* @__PURE__ */ jsxs59(
|
|
6413
|
+
"button",
|
|
6414
|
+
{
|
|
6415
|
+
type: "button",
|
|
6416
|
+
role: "option",
|
|
6417
|
+
"aria-selected": false,
|
|
6418
|
+
"aria-label": o.name,
|
|
6419
|
+
className: "ss-g-tray-chip",
|
|
6420
|
+
disabled,
|
|
6421
|
+
onClick: () => onPick(o.id),
|
|
6422
|
+
children: [
|
|
6423
|
+
/* @__PURE__ */ jsx67(PlayerAvatar, { className: "ss-g-tray-av", name: o.name, imagePath: o.imagePath }),
|
|
6424
|
+
/* @__PURE__ */ jsxs59("span", { className: "ss-g-tray-name", "aria-hidden": "true", children: [
|
|
6425
|
+
first && /* @__PURE__ */ jsx67("span", { className: "ss-g-tray-first", children: first }),
|
|
6426
|
+
/* @__PURE__ */ jsx67("span", { className: "ss-g-tray-last", children: last })
|
|
6427
|
+
] })
|
|
6428
|
+
]
|
|
6429
|
+
},
|
|
6430
|
+
o.id
|
|
6431
|
+
);
|
|
6432
|
+
}) })
|
|
6433
|
+
] });
|
|
6434
|
+
}
|
|
6435
|
+
|
|
6381
6436
|
// src/components/games/ui/FooterBar.tsx
|
|
6382
|
-
import { jsx as
|
|
6437
|
+
import { jsx as jsx68 } from "react/jsx-runtime";
|
|
6383
6438
|
function FooterBar({ children }) {
|
|
6384
|
-
return /* @__PURE__ */
|
|
6439
|
+
return /* @__PURE__ */ jsx68("div", { className: "ss-g-footer", children });
|
|
6385
6440
|
}
|
|
6386
6441
|
|
|
6387
6442
|
// src/components/games/ui/Silhouette.tsx
|
|
6388
|
-
import { jsx as
|
|
6443
|
+
import { jsx as jsx69, jsxs as jsxs60 } from "react/jsx-runtime";
|
|
6389
6444
|
function Silhouette({ size, variant = "default" }) {
|
|
6390
|
-
return /* @__PURE__ */
|
|
6391
|
-
/* @__PURE__ */
|
|
6392
|
-
/* @__PURE__ */
|
|
6393
|
-
/* @__PURE__ */
|
|
6445
|
+
return /* @__PURE__ */ jsxs60("span", { className: `ss-g-sil ss-g-sil--${variant}`, style: { width: size, height: size }, "aria-hidden": "true", children: [
|
|
6446
|
+
/* @__PURE__ */ jsxs60("svg", { width: size * 0.86, height: size * 0.86, viewBox: "0 0 100 100", children: [
|
|
6447
|
+
/* @__PURE__ */ jsx69("circle", { cx: "50", cy: "40", r: "19", fill: "currentColor" }),
|
|
6448
|
+
/* @__PURE__ */ jsx69("path", { d: "M12 100c0-23 17-38 38-38s38 15 38 38z", fill: "currentColor" })
|
|
6394
6449
|
] }),
|
|
6395
|
-
variant === "mystery" && /* @__PURE__ */
|
|
6450
|
+
variant === "mystery" && /* @__PURE__ */ jsx69("span", { className: "ss-g-sil-q", children: "?" })
|
|
6396
6451
|
] });
|
|
6397
6452
|
}
|
|
6398
6453
|
|
|
6399
6454
|
// src/components/games/ui/GameButton.tsx
|
|
6400
|
-
import { jsx as
|
|
6455
|
+
import { jsx as jsx70 } from "react/jsx-runtime";
|
|
6401
6456
|
function GameButton({ variant = "primary", block = false, className, type = "button", ...rest }) {
|
|
6402
6457
|
const cls = `ss-g-btn ss-g-btn--${variant}${block ? " ss-g-btn--block" : ""}${className ? ` ${className}` : ""}`;
|
|
6403
|
-
return /* @__PURE__ */
|
|
6458
|
+
return /* @__PURE__ */ jsx70("button", { type, className: cls, ...rest });
|
|
6404
6459
|
}
|
|
6405
6460
|
|
|
6406
6461
|
// src/components/games/ui/ResultCard.tsx
|
|
6407
|
-
import { jsx as
|
|
6462
|
+
import { jsx as jsx71, jsxs as jsxs61 } from "react/jsx-runtime";
|
|
6408
6463
|
function ResultCard({ tone, title, score, detail, onBack, ui }) {
|
|
6409
|
-
return /* @__PURE__ */
|
|
6410
|
-
/* @__PURE__ */
|
|
6411
|
-
score !== void 0 && /* @__PURE__ */
|
|
6412
|
-
/* @__PURE__ */
|
|
6464
|
+
return /* @__PURE__ */ jsxs61("div", { className: "ss-g-result", "data-tone": tone, role: "status", children: [
|
|
6465
|
+
/* @__PURE__ */ jsx71("span", { className: "ss-g-result-title", children: title }),
|
|
6466
|
+
score !== void 0 && /* @__PURE__ */ jsxs61("span", { className: "ss-g-result-score", children: [
|
|
6467
|
+
/* @__PURE__ */ jsx71("span", { className: "ss-g-result-num", children: score }),
|
|
6413
6468
|
ui.games.unitPts
|
|
6414
6469
|
] }),
|
|
6415
|
-
detail && /* @__PURE__ */
|
|
6416
|
-
onBack && /* @__PURE__ */
|
|
6470
|
+
detail && /* @__PURE__ */ jsx71("span", { className: "ss-g-result-detail", children: detail }),
|
|
6471
|
+
onBack && /* @__PURE__ */ jsx71(GameButton, { variant: "outline", onClick: onBack, children: ui.games.backToGames })
|
|
6417
6472
|
] });
|
|
6418
6473
|
}
|
|
6419
6474
|
|
|
6420
|
-
// src/components/games/ui/
|
|
6421
|
-
import { jsx as
|
|
6422
|
-
function
|
|
6423
|
-
|
|
6475
|
+
// src/components/games/ui/PointsLadderRow.tsx
|
|
6476
|
+
import { jsx as jsx72, jsxs as jsxs62 } from "react/jsx-runtime";
|
|
6477
|
+
function PointsLadderRow({ ladder, guessesUsed, ui }) {
|
|
6478
|
+
if (!ladder || ladder.length === 0) return null;
|
|
6479
|
+
const now = ladder[Math.min(guessesUsed, ladder.length - 1)];
|
|
6480
|
+
const next = ladder[guessesUsed + 1];
|
|
6481
|
+
if (now === void 0) return null;
|
|
6482
|
+
return /* @__PURE__ */ jsxs62("div", { className: "ss-g-worth", "data-testid": "points-ladder", children: [
|
|
6483
|
+
/* @__PURE__ */ jsx72("span", { className: "ss-g-worth-now", children: ui.games.worthNow(now) }),
|
|
6484
|
+
next !== void 0 && next !== now && /* @__PURE__ */ jsx72("span", { className: "ss-g-worth-next", children: ui.games.worthAfterMiss(next) })
|
|
6485
|
+
] });
|
|
6424
6486
|
}
|
|
6425
6487
|
|
|
6426
6488
|
// src/components/games/MysteryTigerGame.tsx
|
|
6427
|
-
import { Fragment as
|
|
6489
|
+
import { Fragment as Fragment12, jsx as jsx73, jsxs as jsxs63 } from "react/jsx-runtime";
|
|
6428
6490
|
function parseClientState(json) {
|
|
6429
6491
|
if (!json) return null;
|
|
6430
6492
|
try {
|
|
@@ -6538,9 +6600,7 @@ function MysteryTigerGame({
|
|
|
6538
6600
|
const totalGuesses = clientState ? clientState.guessesUsed + clientState.guessesRemaining : MAX_GUESSES;
|
|
6539
6601
|
const score = result?.score ?? 0;
|
|
6540
6602
|
const revealName = isOver ? clientState?.revealedPlayerName : void 0;
|
|
6541
|
-
const
|
|
6542
|
-
(p) => !alreadyGuessedIds.has(p.id) && p.name.toLowerCase().includes(query.toLowerCase())
|
|
6543
|
-
) : [];
|
|
6603
|
+
const pool = config && !isOver ? config.squadPlayers.filter((p) => !alreadyGuessedIds.has(p.id)) : [];
|
|
6544
6604
|
function handleSelect(playerId) {
|
|
6545
6605
|
if (!config || isOver || submitting) return;
|
|
6546
6606
|
const prevGuesses = guessResults.map((g) => g.playerId);
|
|
@@ -6548,22 +6608,22 @@ function MysteryTigerGame({
|
|
|
6548
6608
|
setQuery("");
|
|
6549
6609
|
onSubmit(JSON.stringify({ guesses: newGuesses }));
|
|
6550
6610
|
}
|
|
6551
|
-
const headerRight = !config ? void 0 : isOver ? /* @__PURE__ */
|
|
6611
|
+
const headerRight = !config ? void 0 : isOver ? /* @__PURE__ */ jsxs63(Chip, { variant: "accent", children: [
|
|
6552
6612
|
score,
|
|
6553
6613
|
" ",
|
|
6554
6614
|
ui.games.unitPts
|
|
6555
|
-
] }) : /* @__PURE__ */
|
|
6615
|
+
] }) : /* @__PURE__ */ jsx73("span", { "data-testid": "mt-chip", children: /* @__PURE__ */ jsxs63(Chip, { children: [
|
|
6556
6616
|
ui.games.guess,
|
|
6557
6617
|
" ",
|
|
6558
|
-
/* @__PURE__ */
|
|
6618
|
+
/* @__PURE__ */ jsx73("span", { className: "ss-g-num", children: guessesUsed + 1 }),
|
|
6559
6619
|
" / ",
|
|
6560
6620
|
totalGuesses
|
|
6561
6621
|
] }) });
|
|
6562
6622
|
const segments = Array.from({ length: totalGuesses }, (_, i) => i < guessesUsed ? "done" : i === guessesUsed ? "current" : "todo");
|
|
6563
6623
|
const cols = { gridTemplateColumns: `minmax(0, 1fr) repeat(${keys.length}, 42px)` };
|
|
6564
6624
|
const known = deriveKnownAttributes(guessResults, keys);
|
|
6565
|
-
return /* @__PURE__ */
|
|
6566
|
-
/* @__PURE__ */
|
|
6625
|
+
return /* @__PURE__ */ jsxs63("div", { className: "ss-g-screen ss-g-mt", "data-game": "mystery-tiger", "data-testid": "game-screen-mystery-tiger", children: [
|
|
6626
|
+
/* @__PURE__ */ jsx73(
|
|
6567
6627
|
GameHeader,
|
|
6568
6628
|
{
|
|
6569
6629
|
title: gameTitle({ gameId: "mystery-tiger" }, ui.games.titles),
|
|
@@ -6573,40 +6633,41 @@ function MysteryTigerGame({
|
|
|
6573
6633
|
backLabel: ui.back
|
|
6574
6634
|
}
|
|
6575
6635
|
),
|
|
6576
|
-
!config && /* @__PURE__ */
|
|
6577
|
-
config && /* @__PURE__ */
|
|
6578
|
-
/* @__PURE__ */
|
|
6579
|
-
/* @__PURE__ */
|
|
6580
|
-
|
|
6581
|
-
|
|
6582
|
-
revealName
|
|
6636
|
+
!config && /* @__PURE__ */ jsx73("div", { className: "ss-g-body ss-g-loading", children: ui.games.loading }),
|
|
6637
|
+
config && /* @__PURE__ */ jsxs63(Fragment12, { children: [
|
|
6638
|
+
/* @__PURE__ */ jsxs63("div", { className: "ss-g-body", children: [
|
|
6639
|
+
!isOver && /* @__PURE__ */ jsx73(PointsLadderRow, { ladder: config.pointsLadder, guessesUsed, ui }),
|
|
6640
|
+
/* @__PURE__ */ jsxs63("div", { className: `ss-g-mt-card${isOver ? " ss-g-mt-card--reveal" : ""}`, children: [
|
|
6641
|
+
/* @__PURE__ */ jsxs63("div", { className: "ss-g-mt-portrait", children: [
|
|
6642
|
+
revealName ? /* @__PURE__ */ jsx73(PlayerAvatar, { className: "ss-g-mt-photo", name: revealName, imagePath: clientState?.revealedPlayerImagePath }) : /* @__PURE__ */ jsx73(Silhouette, { size: 150, variant: "mystery" }),
|
|
6643
|
+
revealName && /* @__PURE__ */ jsx73("span", { className: "ss-g-mt-reveal-name", children: revealName })
|
|
6583
6644
|
] }),
|
|
6584
|
-
/* @__PURE__ */
|
|
6585
|
-
/* @__PURE__ */
|
|
6586
|
-
/* @__PURE__ */
|
|
6645
|
+
/* @__PURE__ */ jsx73("div", { className: "ss-g-mt-known", style: { gridTemplateColumns: `repeat(${keys.length}, minmax(0, 1fr))` }, children: known.map((k) => /* @__PURE__ */ jsxs63("div", { className: "ss-g-mt-known-cell", children: [
|
|
6646
|
+
/* @__PURE__ */ jsx73("span", { className: "ss-g-mt-lab", children: t.labels[k.key] }),
|
|
6647
|
+
/* @__PURE__ */ jsx73("span", { className: "ss-g-mt-known-v", "data-state": k.state, "data-testid": `known-${k.key}`, children: k.text })
|
|
6587
6648
|
] }, k.key)) })
|
|
6588
6649
|
] }),
|
|
6589
|
-
!isOver && /* @__PURE__ */
|
|
6590
|
-
guessResults.length > 0 && /* @__PURE__ */
|
|
6591
|
-
/* @__PURE__ */
|
|
6592
|
-
/* @__PURE__ */
|
|
6593
|
-
keys.map((k) => /* @__PURE__ */
|
|
6650
|
+
!isOver && /* @__PURE__ */ jsx73(SegmentProgress, { segments, ariaLabel: t.progress(guessesUsed, totalGuesses) }),
|
|
6651
|
+
guessResults.length > 0 && /* @__PURE__ */ jsxs63("div", { className: "ss-g-mt-table", children: [
|
|
6652
|
+
/* @__PURE__ */ jsxs63("div", { className: "ss-g-mt-thead", style: cols, children: [
|
|
6653
|
+
/* @__PURE__ */ jsx73("span", { children: t.yourGuesses }),
|
|
6654
|
+
keys.map((k) => /* @__PURE__ */ jsx73("span", { children: t.labels[k] }, k))
|
|
6594
6655
|
] }),
|
|
6595
6656
|
guessResults.map((gr, i) => {
|
|
6596
6657
|
const name = config.squadPlayers.find((p) => p.id === gr.playerId)?.name ?? `#${gr.playerId}`;
|
|
6597
6658
|
const { first, last } = splitName(name);
|
|
6598
|
-
return /* @__PURE__ */
|
|
6599
|
-
/* @__PURE__ */
|
|
6600
|
-
/* @__PURE__ */
|
|
6601
|
-
/* @__PURE__ */
|
|
6602
|
-
first && /* @__PURE__ */
|
|
6603
|
-
/* @__PURE__ */
|
|
6659
|
+
return /* @__PURE__ */ jsxs63("div", { className: "ss-g-mt-row", style: cols, children: [
|
|
6660
|
+
/* @__PURE__ */ jsxs63("div", { className: "ss-g-mt-who", children: [
|
|
6661
|
+
/* @__PURE__ */ jsx73(PlayerAvatar, { className: "ss-g-mt-av", name }),
|
|
6662
|
+
/* @__PURE__ */ jsxs63("span", { className: "ss-g-mt-names", children: [
|
|
6663
|
+
first && /* @__PURE__ */ jsx73("span", { className: "ss-g-mt-first", children: first }),
|
|
6664
|
+
/* @__PURE__ */ jsx73("span", { className: "ss-g-mt-last", children: last })
|
|
6604
6665
|
] })
|
|
6605
6666
|
] }),
|
|
6606
6667
|
keys.map((key) => {
|
|
6607
6668
|
const v = gr[key];
|
|
6608
6669
|
const arrow = directionArrow(v);
|
|
6609
|
-
return /* @__PURE__ */
|
|
6670
|
+
return /* @__PURE__ */ jsxs63(
|
|
6610
6671
|
"div",
|
|
6611
6672
|
{
|
|
6612
6673
|
className: "ss-g-mt-cell",
|
|
@@ -6614,8 +6675,8 @@ function MysteryTigerGame({
|
|
|
6614
6675
|
"data-verdict": v.verdict,
|
|
6615
6676
|
"aria-label": `${t.labels[key]}: ${v.value ?? v.verdict}${v.direction ? ` ${v.direction}` : ""}`,
|
|
6616
6677
|
children: [
|
|
6617
|
-
/* @__PURE__ */
|
|
6618
|
-
arrow && /* @__PURE__ */
|
|
6678
|
+
/* @__PURE__ */ jsx73("span", { className: "ss-g-mt-cell-v", "aria-hidden": "true", children: tileFace(key, v) }),
|
|
6679
|
+
arrow && /* @__PURE__ */ jsx73("span", { className: "ss-g-mt-cell-dir", "aria-hidden": "true", children: arrow })
|
|
6619
6680
|
]
|
|
6620
6681
|
},
|
|
6621
6682
|
key
|
|
@@ -6624,25 +6685,25 @@ function MysteryTigerGame({
|
|
|
6624
6685
|
] }, gr.playerId);
|
|
6625
6686
|
})
|
|
6626
6687
|
] }),
|
|
6627
|
-
!isOver && /* @__PURE__ */
|
|
6628
|
-
/* @__PURE__ */
|
|
6629
|
-
/* @__PURE__ */
|
|
6688
|
+
!isOver && /* @__PURE__ */ jsxs63("div", { className: "ss-g-mt-legend", children: [
|
|
6689
|
+
/* @__PURE__ */ jsxs63("span", { children: [
|
|
6690
|
+
/* @__PURE__ */ jsx73("i", { className: "ss-g-mt-sw", "data-verdict": "exact" }),
|
|
6630
6691
|
t.legendMatch
|
|
6631
6692
|
] }),
|
|
6632
|
-
/* @__PURE__ */
|
|
6633
|
-
/* @__PURE__ */
|
|
6693
|
+
/* @__PURE__ */ jsxs63("span", { children: [
|
|
6694
|
+
/* @__PURE__ */ jsx73("i", { className: "ss-g-mt-sw", "data-verdict": "near" }),
|
|
6634
6695
|
t.legendClose
|
|
6635
6696
|
] }),
|
|
6636
|
-
/* @__PURE__ */
|
|
6697
|
+
/* @__PURE__ */ jsxs63("span", { children: [
|
|
6637
6698
|
"\u25B2 ",
|
|
6638
6699
|
t.legendHigher
|
|
6639
6700
|
] })
|
|
6640
6701
|
] }),
|
|
6641
|
-
clientState?.hintLine && !isOver && /* @__PURE__ */
|
|
6642
|
-
/* @__PURE__ */
|
|
6643
|
-
/* @__PURE__ */
|
|
6702
|
+
clientState?.hintLine && !isOver && /* @__PURE__ */ jsxs63("div", { className: "ss-g-mt-hint", children: [
|
|
6703
|
+
/* @__PURE__ */ jsx73(IconBulb, {}),
|
|
6704
|
+
/* @__PURE__ */ jsx73("span", { children: clientState.hintLine })
|
|
6644
6705
|
] }),
|
|
6645
|
-
isOver && /* @__PURE__ */
|
|
6706
|
+
isOver && /* @__PURE__ */ jsx73(
|
|
6646
6707
|
ResultCard,
|
|
6647
6708
|
{
|
|
6648
6709
|
tone: clientState?.solved ? "win" : clientState?.failed ? "lose" : "neutral",
|
|
@@ -6654,39 +6715,26 @@ function MysteryTigerGame({
|
|
|
6654
6715
|
}
|
|
6655
6716
|
)
|
|
6656
6717
|
] }),
|
|
6657
|
-
!isOver && /* @__PURE__ */
|
|
6658
|
-
|
|
6659
|
-
|
|
6660
|
-
|
|
6661
|
-
|
|
6662
|
-
|
|
6663
|
-
|
|
6664
|
-
|
|
6665
|
-
|
|
6666
|
-
|
|
6667
|
-
|
|
6668
|
-
|
|
6669
|
-
|
|
6670
|
-
|
|
6671
|
-
),
|
|
6672
|
-
/* @__PURE__ */ jsx72(
|
|
6673
|
-
SearchField,
|
|
6674
|
-
{
|
|
6675
|
-
id: inputId,
|
|
6676
|
-
label: t.searchLabel,
|
|
6677
|
-
placeholder: t.searchPlaceholder,
|
|
6678
|
-
value: query,
|
|
6679
|
-
onChange: setQuery,
|
|
6680
|
-
disabled: submitting
|
|
6681
|
-
}
|
|
6682
|
-
)
|
|
6683
|
-
] })
|
|
6718
|
+
!isOver && /* @__PURE__ */ jsx73(FooterBar, { children: /* @__PURE__ */ jsx73(
|
|
6719
|
+
AnswerTray,
|
|
6720
|
+
{
|
|
6721
|
+
id: inputId,
|
|
6722
|
+
label: t.searchLabel,
|
|
6723
|
+
placeholder: t.searchPlaceholder,
|
|
6724
|
+
optionsLabel: t.optionsLabel,
|
|
6725
|
+
options: pool,
|
|
6726
|
+
query,
|
|
6727
|
+
onQuery: setQuery,
|
|
6728
|
+
onPick: handleSelect,
|
|
6729
|
+
disabled: submitting
|
|
6730
|
+
}
|
|
6731
|
+
) })
|
|
6684
6732
|
] })
|
|
6685
6733
|
] });
|
|
6686
6734
|
}
|
|
6687
6735
|
|
|
6688
6736
|
// src/components/games/HigherOrLowerGame.tsx
|
|
6689
|
-
import { Fragment as
|
|
6737
|
+
import { Fragment as Fragment13, jsx as jsx74, jsxs as jsxs64 } from "react/jsx-runtime";
|
|
6690
6738
|
var POINTS_PER_CORRECT = 10;
|
|
6691
6739
|
function parseClientState2(json) {
|
|
6692
6740
|
if (!json) return null;
|
|
@@ -6698,11 +6746,11 @@ function parseClientState2(json) {
|
|
|
6698
6746
|
}
|
|
6699
6747
|
function PlayerCard({ name, imagePath, highlight, children }) {
|
|
6700
6748
|
const { first, last } = splitName(name);
|
|
6701
|
-
return /* @__PURE__ */
|
|
6702
|
-
/* @__PURE__ */
|
|
6703
|
-
/* @__PURE__ */
|
|
6704
|
-
first && /* @__PURE__ */
|
|
6705
|
-
/* @__PURE__ */
|
|
6749
|
+
return /* @__PURE__ */ jsxs64("div", { className: `ss-g-hl-card${highlight ? " ss-g-hl-card--b" : ""}`, children: [
|
|
6750
|
+
/* @__PURE__ */ jsx74("div", { className: "ss-g-hl-photo-wrap", children: imagePath ? /* @__PURE__ */ jsx74(PlayerAvatar, { className: "ss-g-hl-photo", name, imagePath }) : /* @__PURE__ */ jsx74(Silhouette, { size: 150 }) }),
|
|
6751
|
+
/* @__PURE__ */ jsxs64("div", { className: "ss-g-hl-info", children: [
|
|
6752
|
+
first && /* @__PURE__ */ jsx74("span", { className: "ss-g-hl-first", children: first }),
|
|
6753
|
+
/* @__PURE__ */ jsx74("span", { className: "ss-g-hl-surname", children: last }),
|
|
6706
6754
|
children
|
|
6707
6755
|
] })
|
|
6708
6756
|
] });
|
|
@@ -6734,47 +6782,47 @@ function HigherOrLowerGame({
|
|
|
6734
6782
|
const newAnswers = [...prevAnswers, { pairIndex: currentPair.pairIndex, pick }];
|
|
6735
6783
|
onSubmit(JSON.stringify({ answers: newAnswers }));
|
|
6736
6784
|
}
|
|
6737
|
-
return /* @__PURE__ */
|
|
6738
|
-
/* @__PURE__ */
|
|
6785
|
+
return /* @__PURE__ */ jsxs64("div", { className: "ss-g-screen ss-g-hl", "data-game": "higher-or-lower", "data-testid": "game-screen-higher-or-lower", children: [
|
|
6786
|
+
/* @__PURE__ */ jsx74(
|
|
6739
6787
|
GameHeader,
|
|
6740
6788
|
{
|
|
6741
6789
|
title: gameTitle({ gameId: "higher-or-lower" }, ui.games.titles),
|
|
6742
6790
|
eyebrow: t.eyebrow(POINTS_PER_CORRECT),
|
|
6743
|
-
right: config ? /* @__PURE__ */
|
|
6791
|
+
right: config ? /* @__PURE__ */ jsx74(StatStack, { value: runLength, label: t.streak }) : void 0,
|
|
6744
6792
|
onBack,
|
|
6745
6793
|
backLabel: ui.back
|
|
6746
6794
|
}
|
|
6747
6795
|
),
|
|
6748
|
-
!config && /* @__PURE__ */
|
|
6749
|
-
config && /* @__PURE__ */
|
|
6750
|
-
/* @__PURE__ */
|
|
6751
|
-
/* @__PURE__ */
|
|
6752
|
-
/* @__PURE__ */
|
|
6753
|
-
/* @__PURE__ */
|
|
6754
|
-
/* @__PURE__ */
|
|
6796
|
+
!config && /* @__PURE__ */ jsx74("div", { className: "ss-g-body ss-g-loading", children: ui.games.loading }),
|
|
6797
|
+
config && /* @__PURE__ */ jsxs64(Fragment13, { children: [
|
|
6798
|
+
/* @__PURE__ */ jsxs64("div", { className: "ss-g-body", children: [
|
|
6799
|
+
/* @__PURE__ */ jsxs64("div", { className: "ss-g-hl-prompt", "data-testid": "hol-prompt", children: [
|
|
6800
|
+
/* @__PURE__ */ jsx74("span", { className: "ss-g-hl-prompt-q", children: t.whoHadMore }),
|
|
6801
|
+
/* @__PURE__ */ jsx74("span", { className: "ss-g-hl-prompt-stat", children: config.statLabel }),
|
|
6802
|
+
/* @__PURE__ */ jsx74("span", { className: "ss-g-hl-prompt-season", children: t.season(config.seasonLabel) })
|
|
6755
6803
|
] }),
|
|
6756
|
-
currentPair && /* @__PURE__ */
|
|
6757
|
-
/* @__PURE__ */
|
|
6758
|
-
/* @__PURE__ */
|
|
6759
|
-
/* @__PURE__ */
|
|
6804
|
+
currentPair && /* @__PURE__ */ jsxs64("div", { className: "ss-g-hl-pair", children: [
|
|
6805
|
+
/* @__PURE__ */ jsxs64(PlayerCard, { name: currentPair.playerAName, imagePath: currentPair.playerAImagePath, children: [
|
|
6806
|
+
/* @__PURE__ */ jsx74("span", { className: "ss-g-hl-value", children: currentPair.playerAValue }),
|
|
6807
|
+
/* @__PURE__ */ jsx74("span", { className: "ss-g-hl-stat", children: config.statLabel })
|
|
6760
6808
|
] }),
|
|
6761
|
-
/* @__PURE__ */
|
|
6762
|
-
/* @__PURE__ */
|
|
6763
|
-
/* @__PURE__ */
|
|
6764
|
-
/* @__PURE__ */
|
|
6809
|
+
/* @__PURE__ */ jsx74("span", { className: "ss-g-hl-vs", "aria-hidden": "true", children: t.vs }),
|
|
6810
|
+
/* @__PURE__ */ jsx74(PlayerCard, { name: currentPair.playerBName, imagePath: currentPair.playerBImagePath, highlight: true, children: /* @__PURE__ */ jsxs64("div", { className: "ss-g-hl-btns", children: [
|
|
6811
|
+
/* @__PURE__ */ jsxs64(GameButton, { variant: "primary", disabled: submitting, onClick: () => handlePick("higher"), children: [
|
|
6812
|
+
/* @__PURE__ */ jsx74(IconArrowUp, { size: 16 }),
|
|
6765
6813
|
t.higher
|
|
6766
6814
|
] }),
|
|
6767
|
-
/* @__PURE__ */
|
|
6768
|
-
/* @__PURE__ */
|
|
6815
|
+
/* @__PURE__ */ jsxs64(GameButton, { variant: "outline", disabled: submitting, onClick: () => handlePick("lower"), children: [
|
|
6816
|
+
/* @__PURE__ */ jsx74(IconArrowDown, { size: 16 }),
|
|
6769
6817
|
t.lower
|
|
6770
6818
|
] })
|
|
6771
6819
|
] }) })
|
|
6772
6820
|
] }),
|
|
6773
|
-
lastAnswer && lastAnswerPair && /* @__PURE__ */
|
|
6774
|
-
lastAnswer.wasCorrect ? /* @__PURE__ */
|
|
6821
|
+
lastAnswer && lastAnswerPair && /* @__PURE__ */ jsxs64("p", { className: "ss-g-hl-feedback", "data-testid": "hol-last", "data-correct": lastAnswer.wasCorrect ? "true" : "false", children: [
|
|
6822
|
+
lastAnswer.wasCorrect ? /* @__PURE__ */ jsx74(IconCheck, {}) : /* @__PURE__ */ jsx74(IconClose, {}),
|
|
6775
6823
|
t.lastAnswer(splitName(lastAnswerPair.playerBName).last, lastAnswer.playerBValue)
|
|
6776
6824
|
] }),
|
|
6777
|
-
isOver && /* @__PURE__ */
|
|
6825
|
+
isOver && /* @__PURE__ */ jsx74(
|
|
6778
6826
|
ResultCard,
|
|
6779
6827
|
{
|
|
6780
6828
|
tone: runEndedWrong ? "lose" : allPairsAnswered ? "win" : "neutral",
|
|
@@ -6786,15 +6834,15 @@ function HigherOrLowerGame({
|
|
|
6786
6834
|
}
|
|
6787
6835
|
)
|
|
6788
6836
|
] }),
|
|
6789
|
-
!isOver && /* @__PURE__ */
|
|
6790
|
-
/* @__PURE__ */
|
|
6837
|
+
!isOver && /* @__PURE__ */ jsx74(FooterBar, { children: /* @__PURE__ */ jsxs64("div", { className: "ss-g-hl-foot", children: [
|
|
6838
|
+
/* @__PURE__ */ jsx74("div", { className: "ss-g-hl-dots", role: "img", "aria-label": t.answersSoFar(answeredCount, config.pairs.length), children: config.pairs.map((p, i) => {
|
|
6791
6839
|
const a = answeredPairs[i];
|
|
6792
|
-
return /* @__PURE__ */
|
|
6840
|
+
return /* @__PURE__ */ jsx74("span", { className: "ss-g-hl-dot", "data-state": a ? a.wasCorrect ? "correct" : "wrong" : "todo" }, p.pairIndex);
|
|
6793
6841
|
}) }),
|
|
6794
|
-
/* @__PURE__ */
|
|
6795
|
-
/* @__PURE__ */
|
|
6842
|
+
/* @__PURE__ */ jsxs64("span", { className: "ss-g-hl-pts", children: [
|
|
6843
|
+
/* @__PURE__ */ jsx74("span", { "data-testid": "hol-score", children: score }),
|
|
6796
6844
|
" ",
|
|
6797
|
-
/* @__PURE__ */
|
|
6845
|
+
/* @__PURE__ */ jsx74("span", { className: "ss-g-hl-pts-unit", children: ui.games.unitPts })
|
|
6798
6846
|
] })
|
|
6799
6847
|
] }) })
|
|
6800
6848
|
] })
|
|
@@ -6806,17 +6854,17 @@ import { useState as useState31, useId as useId3 } from "react";
|
|
|
6806
6854
|
|
|
6807
6855
|
// src/components/games/ui/CrestShield.tsx
|
|
6808
6856
|
import { useState as useState30 } from "react";
|
|
6809
|
-
import { jsx as
|
|
6857
|
+
import { jsx as jsx75 } from "react/jsx-runtime";
|
|
6810
6858
|
function CrestShield({ src, name, size = 28 }) {
|
|
6811
6859
|
const [failed, setFailed] = useState30(false);
|
|
6812
6860
|
if (src && !isPlaceholderImage(src) && !failed) {
|
|
6813
|
-
return /* @__PURE__ */
|
|
6861
|
+
return /* @__PURE__ */ jsx75("img", { className: "ss-g-crest", src, alt: name, width: size, height: size, loading: "lazy", onError: () => setFailed(true) });
|
|
6814
6862
|
}
|
|
6815
|
-
return /* @__PURE__ */
|
|
6863
|
+
return /* @__PURE__ */ jsx75("svg", { className: "ss-g-crest ss-g-crest--ph", width: size, height: size * 32 / 28, viewBox: "0 0 28 32", role: "img", "aria-label": name, children: /* @__PURE__ */ jsx75("path", { d: "M2 3h24v12c0 9-6 14-12 17C8 29 2 24 2 15z", fill: "currentColor" }) });
|
|
6816
6864
|
}
|
|
6817
6865
|
|
|
6818
6866
|
// src/components/games/CareerPathGame.tsx
|
|
6819
|
-
import { Fragment as
|
|
6867
|
+
import { Fragment as Fragment14, jsx as jsx76, jsxs as jsxs65 } from "react/jsx-runtime";
|
|
6820
6868
|
function parseClientState3(json) {
|
|
6821
6869
|
if (!json) return null;
|
|
6822
6870
|
try {
|
|
@@ -6846,17 +6894,15 @@ function CareerPathGame({
|
|
|
6846
6894
|
const alreadyGuessedIds = new Set(clientState?.guessResults.map((g) => g.playerId) ?? []);
|
|
6847
6895
|
const isOver = result?.alreadyPlayed === true || clientState?.solved === true || clientState?.failed === true;
|
|
6848
6896
|
if (!config) {
|
|
6849
|
-
return /* @__PURE__ */
|
|
6850
|
-
/* @__PURE__ */
|
|
6851
|
-
/* @__PURE__ */
|
|
6897
|
+
return /* @__PURE__ */ jsxs65("div", { className: "ss-g-screen", "data-game": "career-path", "data-testid": "game-screen-career-path", children: [
|
|
6898
|
+
/* @__PURE__ */ jsx76(GameHeader, { title, eyebrow: s.eyebrow, onBack, backLabel: ui.back }),
|
|
6899
|
+
/* @__PURE__ */ jsx76("div", { className: "ss-g-body ss-g-loading", children: ui.games.loading })
|
|
6852
6900
|
] });
|
|
6853
6901
|
}
|
|
6854
6902
|
const visiblePath = clientState?.visiblePath ?? config.initialPath;
|
|
6855
6903
|
const totalClubs = clientState?.totalClubs ?? config.totalClubs;
|
|
6856
6904
|
const hidden = isOver ? 0 : Math.max(0, totalClubs - visiblePath.length);
|
|
6857
|
-
const
|
|
6858
|
-
(p) => !alreadyGuessedIds.has(p.id) && p.name.toLowerCase().includes(query.toLowerCase())
|
|
6859
|
-
) : [];
|
|
6905
|
+
const pool = !isOver ? config.typeaheadPool.filter((p) => !alreadyGuessedIds.has(p.id)) : [];
|
|
6860
6906
|
function handleSelect(playerId) {
|
|
6861
6907
|
if (!config || isOver || submitting) return;
|
|
6862
6908
|
const prevGuesses = clientState?.guessResults.map((g) => g.playerId) ?? [];
|
|
@@ -6864,60 +6910,61 @@ function CareerPathGame({
|
|
|
6864
6910
|
setQuery("");
|
|
6865
6911
|
onSubmit(JSON.stringify({ guesses: newGuesses }));
|
|
6866
6912
|
}
|
|
6867
|
-
const right = !isOver && clientState ? /* @__PURE__ */
|
|
6913
|
+
const right = !isOver && clientState ? /* @__PURE__ */ jsx76("span", { "data-testid": "cp-guess-chip", children: /* @__PURE__ */ jsxs65(Chip, { variant: "neutral", children: [
|
|
6868
6914
|
ui.games.guess,
|
|
6869
6915
|
" ",
|
|
6870
|
-
/* @__PURE__ */
|
|
6916
|
+
/* @__PURE__ */ jsx76("span", { className: "ss-g-num", children: clientState.guessesUsed + 1 }),
|
|
6871
6917
|
" / ",
|
|
6872
6918
|
clientState.guessesUsed + clientState.guessesRemaining
|
|
6873
6919
|
] }) }) : void 0;
|
|
6874
6920
|
const outcome = clientState?.solved ? s.solved : clientState?.failed ? s.failed : ui.games.done;
|
|
6875
|
-
return /* @__PURE__ */
|
|
6876
|
-
/* @__PURE__ */
|
|
6877
|
-
/* @__PURE__ */
|
|
6878
|
-
/* @__PURE__ */
|
|
6879
|
-
|
|
6880
|
-
/* @__PURE__ */
|
|
6881
|
-
|
|
6882
|
-
|
|
6883
|
-
|
|
6884
|
-
/* @__PURE__ */
|
|
6921
|
+
return /* @__PURE__ */ jsxs65("div", { className: "ss-g-screen", "data-game": "career-path", "data-testid": "game-screen-career-path", children: [
|
|
6922
|
+
/* @__PURE__ */ jsx76(GameHeader, { title, eyebrow: s.eyebrow, right, onBack, backLabel: ui.back }),
|
|
6923
|
+
/* @__PURE__ */ jsxs65("div", { className: "ss-g-body", children: [
|
|
6924
|
+
!isOver && /* @__PURE__ */ jsx76(PointsLadderRow, { ladder: config.pointsLadder, guessesUsed: clientState?.guessesUsed ?? 0, ui }),
|
|
6925
|
+
/* @__PURE__ */ jsxs65("div", { className: "ss-g-cp-card", children: [
|
|
6926
|
+
isOver && clientState?.revealedPlayerName ? /* @__PURE__ */ jsx76(PlayerAvatar, { className: "ss-g-cp-photo", name: clientState.revealedPlayerName, imagePath: clientState.revealedPlayerImagePath }) : /* @__PURE__ */ jsx76(Silhouette, { size: 64, variant: isOver ? "default" : "mystery" }),
|
|
6927
|
+
/* @__PURE__ */ jsxs65("div", { className: "ss-g-cp-card-text", children: [
|
|
6928
|
+
/* @__PURE__ */ jsx76("span", { className: "ss-g-cp-card-title", children: isOver && clientState?.revealedPlayerName ? clientState.revealedPlayerName : s.mysteryPlayer }),
|
|
6929
|
+
clientState?.hintLine ? /* @__PURE__ */ jsx76("span", { className: "ss-g-cp-hint", children: clientState.hintLine }) : !isOver ? /* @__PURE__ */ jsxs65("span", { className: "ss-g-cp-locks", children: [
|
|
6930
|
+
/* @__PURE__ */ jsx76(Chip, { variant: "lock", icon: /* @__PURE__ */ jsx76(IconLock, { size: 11 }), children: s.lockPosition }),
|
|
6931
|
+
/* @__PURE__ */ jsx76(Chip, { variant: "lock", icon: /* @__PURE__ */ jsx76(IconLock, { size: 11 }), children: s.lockNationality })
|
|
6885
6932
|
] }) : null
|
|
6886
6933
|
] })
|
|
6887
6934
|
] }),
|
|
6888
|
-
/* @__PURE__ */
|
|
6935
|
+
/* @__PURE__ */ jsxs65("ol", { className: "ss-g-cp-line", children: [
|
|
6889
6936
|
visiblePath.map((spell, i) => {
|
|
6890
6937
|
const years = i === 0 ? s.firstClub : spellYears(spell);
|
|
6891
|
-
return /* @__PURE__ */
|
|
6892
|
-
/* @__PURE__ */
|
|
6893
|
-
/* @__PURE__ */
|
|
6894
|
-
/* @__PURE__ */
|
|
6938
|
+
return /* @__PURE__ */ jsxs65("li", { className: "ss-g-cp-step", children: [
|
|
6939
|
+
/* @__PURE__ */ jsxs65("span", { className: "ss-g-cp-rail", children: [
|
|
6940
|
+
/* @__PURE__ */ jsx76("span", { className: "ss-g-cp-tile", children: /* @__PURE__ */ jsx76(CrestShield, { src: spell.crestUrl, name: spell.clubName, size: 30 }) }),
|
|
6941
|
+
/* @__PURE__ */ jsx76("span", { className: "ss-g-cp-conn", "aria-hidden": "true" })
|
|
6895
6942
|
] }),
|
|
6896
|
-
/* @__PURE__ */
|
|
6897
|
-
/* @__PURE__ */
|
|
6898
|
-
/* @__PURE__ */
|
|
6899
|
-
/* @__PURE__ */
|
|
6900
|
-
spell.isLoan && /* @__PURE__ */
|
|
6943
|
+
/* @__PURE__ */ jsxs65("span", { className: "ss-g-cp-step-text", children: [
|
|
6944
|
+
/* @__PURE__ */ jsx76("span", { className: "ss-g-cp-club", children: spell.clubName }),
|
|
6945
|
+
/* @__PURE__ */ jsxs65("span", { className: "ss-g-cp-sub", children: [
|
|
6946
|
+
/* @__PURE__ */ jsx76("span", { className: "ss-g-cp-years", children: years }),
|
|
6947
|
+
spell.isLoan && /* @__PURE__ */ jsxs65(Fragment14, { children: [
|
|
6901
6948
|
years ? " \xB7 " : "",
|
|
6902
|
-
/* @__PURE__ */
|
|
6949
|
+
/* @__PURE__ */ jsx76("span", { className: "ss-g-cp-loan", children: s.loan })
|
|
6903
6950
|
] })
|
|
6904
6951
|
] })
|
|
6905
6952
|
] })
|
|
6906
6953
|
] }, `${spell.clubName}-${i}`);
|
|
6907
6954
|
}),
|
|
6908
|
-
hidden > 0 && /* @__PURE__ */
|
|
6909
|
-
/* @__PURE__ */
|
|
6910
|
-
/* @__PURE__ */
|
|
6911
|
-
hidden > 1 && /* @__PURE__ */
|
|
6955
|
+
hidden > 0 && /* @__PURE__ */ jsxs65("li", { className: "ss-g-cp-step ss-g-cp-step--hidden", children: [
|
|
6956
|
+
/* @__PURE__ */ jsxs65("span", { className: "ss-g-cp-rail", children: [
|
|
6957
|
+
/* @__PURE__ */ jsx76("span", { className: "ss-g-cp-tile ss-g-cp-tile--locked", children: /* @__PURE__ */ jsx76(IconLock, { size: 18 }) }),
|
|
6958
|
+
hidden > 1 && /* @__PURE__ */ jsx76("span", { className: "ss-g-cp-conn ss-g-cp-conn--faint", "aria-hidden": "true" })
|
|
6912
6959
|
] }),
|
|
6913
|
-
/* @__PURE__ */
|
|
6960
|
+
/* @__PURE__ */ jsx76("span", { className: "ss-g-cp-step-text", children: /* @__PURE__ */ jsx76("span", { className: "ss-g-cp-sub", children: s.nextClubHidden }) })
|
|
6914
6961
|
] }),
|
|
6915
|
-
hidden > 1 && /* @__PURE__ */
|
|
6916
|
-
/* @__PURE__ */
|
|
6917
|
-
/* @__PURE__ */
|
|
6962
|
+
hidden > 1 && /* @__PURE__ */ jsxs65("li", { className: "ss-g-cp-step ss-g-cp-step--more", children: [
|
|
6963
|
+
/* @__PURE__ */ jsx76("span", { className: "ss-g-cp-rail", children: /* @__PURE__ */ jsx76("span", { className: "ss-g-cp-tile ss-g-cp-tile--faint", children: /* @__PURE__ */ jsx76(IconLock, { size: 18 }) }) }),
|
|
6964
|
+
/* @__PURE__ */ jsx76("span", { className: "ss-g-cp-step-text", children: /* @__PURE__ */ jsx76("span", { className: "ss-g-cp-sub", children: s.moreClubs(hidden - 1) }) })
|
|
6918
6965
|
] })
|
|
6919
6966
|
] }),
|
|
6920
|
-
isOver && /* @__PURE__ */
|
|
6967
|
+
isOver && /* @__PURE__ */ jsx76(
|
|
6921
6968
|
ResultCard,
|
|
6922
6969
|
{
|
|
6923
6970
|
tone: clientState?.solved ? "win" : clientState?.failed ? "lose" : "neutral",
|
|
@@ -6929,39 +6976,35 @@ function CareerPathGame({
|
|
|
6929
6976
|
}
|
|
6930
6977
|
)
|
|
6931
6978
|
] }),
|
|
6932
|
-
!isOver && /* @__PURE__ */
|
|
6933
|
-
|
|
6934
|
-
|
|
6935
|
-
|
|
6936
|
-
|
|
6937
|
-
|
|
6938
|
-
|
|
6939
|
-
|
|
6940
|
-
|
|
6941
|
-
|
|
6942
|
-
|
|
6943
|
-
|
|
6944
|
-
|
|
6945
|
-
|
|
6946
|
-
|
|
6947
|
-
/* @__PURE__ */ jsx75(
|
|
6948
|
-
SearchField,
|
|
6949
|
-
{
|
|
6950
|
-
id: inputId,
|
|
6951
|
-
label: s.searchLabel,
|
|
6952
|
-
placeholder: s.searchPlaceholder,
|
|
6953
|
-
value: query,
|
|
6954
|
-
onChange: setQuery,
|
|
6955
|
-
disabled: submitting
|
|
6956
|
-
}
|
|
6957
|
-
)
|
|
6958
|
-
] })
|
|
6979
|
+
!isOver && /* @__PURE__ */ jsx76(FooterBar, { children: /* @__PURE__ */ jsx76(
|
|
6980
|
+
AnswerTray,
|
|
6981
|
+
{
|
|
6982
|
+
id: inputId,
|
|
6983
|
+
label: s.searchLabel,
|
|
6984
|
+
placeholder: s.searchPlaceholder,
|
|
6985
|
+
optionsLabel: s.searchLabel,
|
|
6986
|
+
options: pool,
|
|
6987
|
+
query,
|
|
6988
|
+
onQuery: setQuery,
|
|
6989
|
+
onPick: handleSelect,
|
|
6990
|
+
disabled: submitting,
|
|
6991
|
+
minQuery: 1
|
|
6992
|
+
}
|
|
6993
|
+
) })
|
|
6959
6994
|
] });
|
|
6960
6995
|
}
|
|
6961
6996
|
|
|
6962
6997
|
// src/components/games/BeatTheGridGame.tsx
|
|
6963
6998
|
import React, { useEffect as useEffect20, useId as useId4, useRef as useRef17, useState as useState32 } from "react";
|
|
6964
|
-
|
|
6999
|
+
|
|
7000
|
+
// src/components/games/ui/OptionList.tsx
|
|
7001
|
+
import { jsx as jsx77 } from "react/jsx-runtime";
|
|
7002
|
+
function OptionList({ label, options, onPick }) {
|
|
7003
|
+
return /* @__PURE__ */ jsx77("div", { className: "ss-g-opts", role: "listbox", "aria-label": label, children: options.map((o) => /* @__PURE__ */ jsx77("button", { type: "button", role: "option", "aria-selected": false, className: "ss-g-opt", onClick: () => onPick(o.key), children: o.content }, o.key)) });
|
|
7004
|
+
}
|
|
7005
|
+
|
|
7006
|
+
// src/components/games/BeatTheGridGame.tsx
|
|
7007
|
+
import { Fragment as Fragment15, jsx as jsx78, jsxs as jsxs66 } from "react/jsx-runtime";
|
|
6965
7008
|
function criterionIconKind(label, key) {
|
|
6966
7009
|
const l = (key ?? label).toLowerCase();
|
|
6967
7010
|
if (l.includes("app")) return "calendar";
|
|
@@ -6979,34 +7022,34 @@ function rowAbbrev(label, map, key) {
|
|
|
6979
7022
|
function CriterionIcon({ kind }) {
|
|
6980
7023
|
switch (kind) {
|
|
6981
7024
|
case "calendar":
|
|
6982
|
-
return /* @__PURE__ */
|
|
7025
|
+
return /* @__PURE__ */ jsx78(IconCalendar, {});
|
|
6983
7026
|
case "ball":
|
|
6984
|
-
return /* @__PURE__ */
|
|
7027
|
+
return /* @__PURE__ */ jsx78(IconBall, {});
|
|
6985
7028
|
case "boot":
|
|
6986
|
-
return /* @__PURE__ */
|
|
7029
|
+
return /* @__PURE__ */ jsx78(IconBoot, {});
|
|
6987
7030
|
case "gloves":
|
|
6988
|
-
return /* @__PURE__ */
|
|
7031
|
+
return /* @__PURE__ */ jsx78(IconGloves, {});
|
|
6989
7032
|
case "shield":
|
|
6990
|
-
return /* @__PURE__ */
|
|
7033
|
+
return /* @__PURE__ */ jsx78(IconShield, {});
|
|
6991
7034
|
default:
|
|
6992
|
-
return /* @__PURE__ */
|
|
7035
|
+
return /* @__PURE__ */ jsx78(IconFlag, {});
|
|
6993
7036
|
}
|
|
6994
7037
|
}
|
|
6995
7038
|
function HeaderVisual({ label, textKey: iKey, meta }) {
|
|
6996
7039
|
if (!meta) {
|
|
6997
|
-
return /* @__PURE__ */
|
|
7040
|
+
return /* @__PURE__ */ jsx78(CriterionIcon, { kind: criterionIconKind(label, iKey) });
|
|
6998
7041
|
}
|
|
6999
7042
|
switch (meta.kind) {
|
|
7000
7043
|
case "club":
|
|
7001
|
-
return /* @__PURE__ */
|
|
7044
|
+
return /* @__PURE__ */ jsx78(CrestShield, { src: meta.imageUrl, name: label, size: 24 });
|
|
7002
7045
|
case "coach":
|
|
7003
|
-
return /* @__PURE__ */
|
|
7046
|
+
return /* @__PURE__ */ jsx78(PlayerAvatar, { name: label, imagePath: meta.imageUrl, className: "ss-g-btg-coach-av" });
|
|
7004
7047
|
case "country":
|
|
7005
|
-
return /* @__PURE__ */
|
|
7048
|
+
return /* @__PURE__ */ jsx78("span", { className: "ss-g-btg-hdr-flag", "aria-hidden": "true", children: nationalityFlag(meta.country ?? label) });
|
|
7006
7049
|
case "position":
|
|
7007
|
-
return /* @__PURE__ */
|
|
7050
|
+
return /* @__PURE__ */ jsx78(Fragment15, {});
|
|
7008
7051
|
default:
|
|
7009
|
-
return /* @__PURE__ */
|
|
7052
|
+
return /* @__PURE__ */ jsx78(CriterionIcon, { kind: criterionIconKind(label, iKey) });
|
|
7010
7053
|
}
|
|
7011
7054
|
}
|
|
7012
7055
|
function parseClientState4(json) {
|
|
@@ -7050,12 +7093,12 @@ function SearchSheet({
|
|
|
7050
7093
|
const filtered = playerPool.filter(
|
|
7051
7094
|
(p) => !alreadyFilledIds.has(p.id) && p.name.toLowerCase().includes(query.toLowerCase())
|
|
7052
7095
|
);
|
|
7053
|
-
return /* @__PURE__ */
|
|
7054
|
-
/* @__PURE__ */
|
|
7055
|
-
/* @__PURE__ */
|
|
7056
|
-
/* @__PURE__ */
|
|
7057
|
-
/* @__PURE__ */
|
|
7058
|
-
/* @__PURE__ */
|
|
7096
|
+
return /* @__PURE__ */ jsxs66("div", { className: "ss-g-btg-sheet", "data-testid": "btg-search-sheet", children: [
|
|
7097
|
+
/* @__PURE__ */ jsxs66("div", { className: "ss-g-btg-sheet-hdr", children: [
|
|
7098
|
+
/* @__PURE__ */ jsx78(Chip, { variant: "neutral", children: rowLabel }),
|
|
7099
|
+
/* @__PURE__ */ jsx78("span", { className: "ss-g-btg-sheet-x", "aria-hidden": "true", children: /* @__PURE__ */ jsx78(IconClose, { size: 12 }) }),
|
|
7100
|
+
/* @__PURE__ */ jsx78(Chip, { variant: "accent", children: colLabel }),
|
|
7101
|
+
/* @__PURE__ */ jsx78(
|
|
7059
7102
|
"button",
|
|
7060
7103
|
{
|
|
7061
7104
|
type: "button",
|
|
@@ -7063,12 +7106,12 @@ function SearchSheet({
|
|
|
7063
7106
|
"data-testid": "btg-sheet-dismiss",
|
|
7064
7107
|
"aria-label": s.closeSearch,
|
|
7065
7108
|
onClick: onDismiss,
|
|
7066
|
-
children: /* @__PURE__ */
|
|
7109
|
+
children: /* @__PURE__ */ jsx78(IconClose, {})
|
|
7067
7110
|
}
|
|
7068
7111
|
)
|
|
7069
7112
|
] }),
|
|
7070
|
-
playerPool.length === 0 ? /* @__PURE__ */
|
|
7071
|
-
/* @__PURE__ */
|
|
7113
|
+
playerPool.length === 0 ? /* @__PURE__ */ jsx78("div", { className: "ss-g-btg-sheet-empty", children: s.emptyPool }) : /* @__PURE__ */ jsxs66(Fragment15, { children: [
|
|
7114
|
+
/* @__PURE__ */ jsx78(
|
|
7072
7115
|
SearchField,
|
|
7073
7116
|
{
|
|
7074
7117
|
id: inputId,
|
|
@@ -7080,16 +7123,16 @@ function SearchSheet({
|
|
|
7080
7123
|
inputRef
|
|
7081
7124
|
}
|
|
7082
7125
|
),
|
|
7083
|
-
query.length > 0 && filtered.length > 0 && /* @__PURE__ */
|
|
7126
|
+
query.length > 0 && filtered.length > 0 && /* @__PURE__ */ jsx78(
|
|
7084
7127
|
OptionList,
|
|
7085
7128
|
{
|
|
7086
7129
|
label: s.searchLabel(rowLabel, colLabel),
|
|
7087
7130
|
options: filtered.map((p) => ({
|
|
7088
7131
|
key: p.id,
|
|
7089
|
-
content: /* @__PURE__ */
|
|
7090
|
-
/* @__PURE__ */
|
|
7091
|
-
/* @__PURE__ */
|
|
7092
|
-
/* @__PURE__ */
|
|
7132
|
+
content: /* @__PURE__ */ jsxs66(Fragment15, { children: [
|
|
7133
|
+
/* @__PURE__ */ jsx78(PlayerAvatar, { name: p.name, imagePath: p.imagePath, className: "ss-g-opt-av" }),
|
|
7134
|
+
/* @__PURE__ */ jsx78("span", { className: "ss-g-btg-result-name", children: p.name }),
|
|
7135
|
+
/* @__PURE__ */ jsx78("span", { className: "ss-g-btg-result-plus", "aria-hidden": "true", children: /* @__PURE__ */ jsx78(IconPlus, { size: 18 }) })
|
|
7093
7136
|
] })
|
|
7094
7137
|
})),
|
|
7095
7138
|
onPick: (k) => onPick(row, col, Number(k))
|
|
@@ -7127,9 +7170,9 @@ function BeatTheGridGame({
|
|
|
7127
7170
|
onSubmit(JSON.stringify({ cells: newCells }));
|
|
7128
7171
|
}
|
|
7129
7172
|
if (!config) {
|
|
7130
|
-
return /* @__PURE__ */
|
|
7131
|
-
/* @__PURE__ */
|
|
7132
|
-
/* @__PURE__ */
|
|
7173
|
+
return /* @__PURE__ */ jsxs66("div", { className: "ss-g-screen", "data-game": "beat-the-grid", "data-testid": "game-screen-beat-the-grid", children: [
|
|
7174
|
+
/* @__PURE__ */ jsx78(GameHeader, { title, eyebrow: s.eyebrow, onBack, backLabel: ui.back }),
|
|
7175
|
+
/* @__PURE__ */ jsx78("div", { className: "ss-g-body ss-g-loading", children: ui.games.loading })
|
|
7133
7176
|
] });
|
|
7134
7177
|
}
|
|
7135
7178
|
const rows = config.rows;
|
|
@@ -7142,20 +7185,20 @@ function BeatTheGridGame({
|
|
|
7142
7185
|
(_, i) => i < correctCount ? "correct" : i < correctCount + wrongCount ? "wrong" : "todo"
|
|
7143
7186
|
);
|
|
7144
7187
|
const totalScore = clientState?.totalScore ?? result?.score ?? 0;
|
|
7145
|
-
return /* @__PURE__ */
|
|
7146
|
-
/* @__PURE__ */
|
|
7147
|
-
/* @__PURE__ */
|
|
7188
|
+
return /* @__PURE__ */ jsxs66("div", { className: "ss-g-screen", "data-game": "beat-the-grid", "data-testid": "game-screen-beat-the-grid", children: [
|
|
7189
|
+
/* @__PURE__ */ jsx78(GameHeader, { title, eyebrow: s.eyebrow, onBack, backLabel: ui.back }),
|
|
7190
|
+
/* @__PURE__ */ jsx78(
|
|
7148
7191
|
SegmentProgress,
|
|
7149
7192
|
{
|
|
7150
7193
|
segments,
|
|
7151
7194
|
ariaLabel: s.progressAria(filledCells.length, total),
|
|
7152
7195
|
leftLabel: s.filled(filledCells.length, total),
|
|
7153
7196
|
rightLabel: s.toGo(Math.max(0, total - filledCells.length)),
|
|
7154
|
-
right: /* @__PURE__ */
|
|
7197
|
+
right: /* @__PURE__ */ jsx78(Chip, { variant: "accent", children: `${totalScore} ${ui.games.unitPts}` })
|
|
7155
7198
|
}
|
|
7156
7199
|
),
|
|
7157
|
-
/* @__PURE__ */
|
|
7158
|
-
/* @__PURE__ */
|
|
7200
|
+
/* @__PURE__ */ jsxs66("div", { className: "ss-g-body", children: [
|
|
7201
|
+
/* @__PURE__ */ jsxs66(
|
|
7159
7202
|
"div",
|
|
7160
7203
|
{
|
|
7161
7204
|
className: activeCell !== null ? "ss-g-btg-grid ss-g-btg-grid--fit" : "ss-g-btg-grid",
|
|
@@ -7165,31 +7208,31 @@ function BeatTheGridGame({
|
|
|
7165
7208
|
},
|
|
7166
7209
|
role: "grid",
|
|
7167
7210
|
children: [
|
|
7168
|
-
/* @__PURE__ */
|
|
7211
|
+
/* @__PURE__ */ jsx78("div", { className: "ss-g-btg-corner" }),
|
|
7169
7212
|
cols.map((col, colIdx) => {
|
|
7170
7213
|
const colMeta = config.colsMeta?.[colIdx];
|
|
7171
|
-
return /* @__PURE__ */
|
|
7172
|
-
/* @__PURE__ */
|
|
7173
|
-
/* @__PURE__ */
|
|
7214
|
+
return /* @__PURE__ */ jsxs66("div", { className: "ss-g-btg-colhdr", "data-meta": colMeta ? "true" : void 0, children: [
|
|
7215
|
+
/* @__PURE__ */ jsx78(HeaderVisual, { label: col, textKey: config.colsI18n?.[colIdx]?.key, meta: colMeta }),
|
|
7216
|
+
/* @__PURE__ */ jsx78("span", { children: col })
|
|
7174
7217
|
] }, col);
|
|
7175
7218
|
}),
|
|
7176
7219
|
rows.map((rowLabel, rowIdx) => {
|
|
7177
7220
|
const rowMeta = config.rowsMeta?.[rowIdx];
|
|
7178
7221
|
const abbr = rowAbbrev(rowLabel, s.rowAbbrev, config.rowsI18n?.[rowIdx]?.key);
|
|
7179
|
-
const rowHeaderContent = rowMeta ? /* @__PURE__ */
|
|
7180
|
-
/* @__PURE__ */
|
|
7181
|
-
/* @__PURE__ */
|
|
7182
|
-
] }) : abbr === rowLabel ? /* @__PURE__ */
|
|
7183
|
-
/* @__PURE__ */
|
|
7184
|
-
/* @__PURE__ */
|
|
7222
|
+
const rowHeaderContent = rowMeta ? /* @__PURE__ */ jsxs66(Fragment15, { children: [
|
|
7223
|
+
/* @__PURE__ */ jsx78(HeaderVisual, { label: rowLabel, textKey: config.rowsI18n?.[rowIdx]?.key, meta: rowMeta }),
|
|
7224
|
+
/* @__PURE__ */ jsx78("span", { children: rowLabel })
|
|
7225
|
+
] }) : abbr === rowLabel ? /* @__PURE__ */ jsx78("span", { children: rowLabel }) : /* @__PURE__ */ jsxs66(Fragment15, { children: [
|
|
7226
|
+
/* @__PURE__ */ jsx78("span", { "aria-hidden": "true", children: abbr }),
|
|
7227
|
+
/* @__PURE__ */ jsx78("span", { className: "ss-g-sr", children: rowLabel })
|
|
7185
7228
|
] });
|
|
7186
|
-
return /* @__PURE__ */
|
|
7187
|
-
/* @__PURE__ */
|
|
7229
|
+
return /* @__PURE__ */ jsxs66(React.Fragment, { children: [
|
|
7230
|
+
/* @__PURE__ */ jsx78("div", { className: "ss-g-btg-rowhdr", "data-meta": rowMeta ? "true" : void 0, children: rowHeaderContent }),
|
|
7188
7231
|
cols.map((colLabel, colIdx) => {
|
|
7189
7232
|
const filled = findCellResult(filledCells, rowIdx, colIdx);
|
|
7190
7233
|
const isActive = activeCell?.row === rowIdx && activeCell?.col === colIdx;
|
|
7191
7234
|
const state = filled ? filled.isCorrect ? "correct" : "wrong" : isActive ? "active" : "empty";
|
|
7192
|
-
return /* @__PURE__ */
|
|
7235
|
+
return /* @__PURE__ */ jsx78(
|
|
7193
7236
|
"button",
|
|
7194
7237
|
{
|
|
7195
7238
|
type: "button",
|
|
@@ -7200,20 +7243,20 @@ function BeatTheGridGame({
|
|
|
7200
7243
|
className: "ss-g-btg-cell",
|
|
7201
7244
|
disabled: isLocked2 || submitting,
|
|
7202
7245
|
onClick: () => handleCellClick(rowIdx, colIdx),
|
|
7203
|
-
children: filled ? /* @__PURE__ */
|
|
7204
|
-
/* @__PURE__ */
|
|
7246
|
+
children: filled ? /* @__PURE__ */ jsxs66(Fragment15, { children: [
|
|
7247
|
+
/* @__PURE__ */ jsx78(
|
|
7205
7248
|
"span",
|
|
7206
7249
|
{
|
|
7207
7250
|
className: `ss-g-btg-badge ss-g-btg-badge--${filled.isCorrect ? "correct" : "wrong"}`,
|
|
7208
7251
|
role: "img",
|
|
7209
7252
|
"aria-label": filled.isCorrect ? s.correct : s.wrong,
|
|
7210
|
-
children: filled.isCorrect ? /* @__PURE__ */
|
|
7253
|
+
children: filled.isCorrect ? /* @__PURE__ */ jsx78(IconCheck, { size: 11 }) : /* @__PURE__ */ jsx78(IconClose, { size: 11 })
|
|
7211
7254
|
}
|
|
7212
7255
|
),
|
|
7213
|
-
/* @__PURE__ */
|
|
7256
|
+
/* @__PURE__ */ jsx78("span", { className: "ss-g-btg-rarity", children: filled.rarityScore }),
|
|
7214
7257
|
(() => {
|
|
7215
7258
|
const entry = playerPool.find((p) => p.id === filled.playerId);
|
|
7216
|
-
return /* @__PURE__ */
|
|
7259
|
+
return /* @__PURE__ */ jsx78(
|
|
7217
7260
|
PlayerAvatar,
|
|
7218
7261
|
{
|
|
7219
7262
|
name: entry?.name ?? "",
|
|
@@ -7222,8 +7265,8 @@ function BeatTheGridGame({
|
|
|
7222
7265
|
}
|
|
7223
7266
|
);
|
|
7224
7267
|
})(),
|
|
7225
|
-
/* @__PURE__ */
|
|
7226
|
-
] }) : /* @__PURE__ */
|
|
7268
|
+
/* @__PURE__ */ jsx78("span", { className: "ss-g-btg-name", children: shortName(playerPool.find((p) => p.id === filled.playerId)?.name) })
|
|
7269
|
+
] }) : /* @__PURE__ */ jsx78("span", { className: "ss-g-btg-plus", "aria-hidden": "true", children: /* @__PURE__ */ jsx78(IconPlus, { size: 22 }) })
|
|
7227
7270
|
},
|
|
7228
7271
|
`cell-${rowIdx}-${colIdx}`
|
|
7229
7272
|
);
|
|
@@ -7233,7 +7276,7 @@ function BeatTheGridGame({
|
|
|
7233
7276
|
]
|
|
7234
7277
|
}
|
|
7235
7278
|
),
|
|
7236
|
-
isLocked2 && /* @__PURE__ */
|
|
7279
|
+
isLocked2 && /* @__PURE__ */ jsx78(
|
|
7237
7280
|
ResultCard,
|
|
7238
7281
|
{
|
|
7239
7282
|
tone: "neutral",
|
|
@@ -7245,7 +7288,7 @@ function BeatTheGridGame({
|
|
|
7245
7288
|
}
|
|
7246
7289
|
)
|
|
7247
7290
|
] }),
|
|
7248
|
-
activeCell !== null && /* @__PURE__ */
|
|
7291
|
+
activeCell !== null && /* @__PURE__ */ jsx78("div", { className: "ss-g-btg-pin", children: /* @__PURE__ */ jsx78(
|
|
7249
7292
|
SearchSheet,
|
|
7250
7293
|
{
|
|
7251
7294
|
row: activeCell.row,
|
|
@@ -7267,18 +7310,18 @@ function BeatTheGridGame({
|
|
|
7267
7310
|
import { useState as useState33, useId as useId5 } from "react";
|
|
7268
7311
|
|
|
7269
7312
|
// src/components/games/ui/PitchSvg.tsx
|
|
7270
|
-
import { Fragment as
|
|
7313
|
+
import { Fragment as Fragment16, jsx as jsx79, jsxs as jsxs67 } from "react/jsx-runtime";
|
|
7271
7314
|
function PitchSvg({ variant }) {
|
|
7272
|
-
return /* @__PURE__ */
|
|
7273
|
-
/* @__PURE__ */
|
|
7274
|
-
variant === "full" ? /* @__PURE__ */
|
|
7275
|
-
/* @__PURE__ */
|
|
7276
|
-
/* @__PURE__ */
|
|
7277
|
-
/* @__PURE__ */
|
|
7278
|
-
/* @__PURE__ */
|
|
7279
|
-
] }) : /* @__PURE__ */
|
|
7280
|
-
/* @__PURE__ */
|
|
7281
|
-
/* @__PURE__ */
|
|
7315
|
+
return /* @__PURE__ */ jsxs67("svg", { className: "ss-g-pitch-svg", viewBox: variant === "full" ? "0 0 100 150" : "0 0 100 100", preserveAspectRatio: "none", "aria-hidden": "true", children: [
|
|
7316
|
+
/* @__PURE__ */ jsx79("rect", { x: "4", y: "4", width: "92", height: variant === "full" ? 142 : 92, fill: "none" }),
|
|
7317
|
+
variant === "full" ? /* @__PURE__ */ jsxs67(Fragment16, { children: [
|
|
7318
|
+
/* @__PURE__ */ jsx79("line", { x1: "4", y1: "75", x2: "96", y2: "75" }),
|
|
7319
|
+
/* @__PURE__ */ jsx79("circle", { cx: "50", cy: "75", r: "12", fill: "none" }),
|
|
7320
|
+
/* @__PURE__ */ jsx79("rect", { x: "26", y: "4", width: "48", height: "20", fill: "none" }),
|
|
7321
|
+
/* @__PURE__ */ jsx79("rect", { x: "26", y: "126", width: "48", height: "20", fill: "none" })
|
|
7322
|
+
] }) : /* @__PURE__ */ jsxs67(Fragment16, { children: [
|
|
7323
|
+
/* @__PURE__ */ jsx79("path", { d: "M38 4a12 12 0 0 0 24 0", fill: "none" }),
|
|
7324
|
+
/* @__PURE__ */ jsx79("rect", { x: "26", y: "76", width: "48", height: "20", fill: "none" })
|
|
7282
7325
|
] })
|
|
7283
7326
|
] });
|
|
7284
7327
|
}
|
|
@@ -7334,7 +7377,7 @@ function positionsBySlot(formation, rowsAttackFirst) {
|
|
|
7334
7377
|
}
|
|
7335
7378
|
|
|
7336
7379
|
// src/components/games/GuessTheXiGame.tsx
|
|
7337
|
-
import { Fragment as
|
|
7380
|
+
import { Fragment as Fragment17, jsx as jsx80, jsxs as jsxs68 } from "react/jsx-runtime";
|
|
7338
7381
|
var MAX_GUESSES2 = 3;
|
|
7339
7382
|
function parseClientState5(json) {
|
|
7340
7383
|
if (!json) return null;
|
|
@@ -7384,30 +7427,31 @@ function GuessTheXiGame({
|
|
|
7384
7427
|
const wrongGuesses = (clientState?.guessHistory ?? []).filter((g) => !g.wasCorrect);
|
|
7385
7428
|
const guessesLeft = Math.max(0, MAX_GUESSES2 - (clientState?.guessesUsed ?? 0));
|
|
7386
7429
|
const teamName = (id) => config?.teamPool.find((tm) => tm.teamId === id)?.teamName ?? `#${id}`;
|
|
7387
|
-
return /* @__PURE__ */
|
|
7388
|
-
/* @__PURE__ */
|
|
7430
|
+
return /* @__PURE__ */ jsxs68("div", { className: "ss-g-screen ss-g-gxi", "data-game": "guess-the-xi", "data-testid": "game-screen-guess-the-xi", children: [
|
|
7431
|
+
/* @__PURE__ */ jsx80(
|
|
7389
7432
|
GameHeader,
|
|
7390
7433
|
{
|
|
7391
7434
|
title: gameTitle({ gameId: "guess-the-xi" }, ui.games.titles),
|
|
7392
7435
|
eyebrow: config?.poolLabel,
|
|
7393
|
-
right: formation ? /* @__PURE__ */
|
|
7436
|
+
right: formation ? /* @__PURE__ */ jsx80(Chip, { variant: "accent", children: formation }) : void 0,
|
|
7394
7437
|
onBack,
|
|
7395
7438
|
backLabel: ui.back
|
|
7396
7439
|
}
|
|
7397
7440
|
),
|
|
7398
|
-
!config && /* @__PURE__ */
|
|
7399
|
-
config && /* @__PURE__ */
|
|
7400
|
-
/* @__PURE__ */
|
|
7401
|
-
|
|
7402
|
-
|
|
7403
|
-
/* @__PURE__ */
|
|
7441
|
+
!config && /* @__PURE__ */ jsx80("div", { className: "ss-g-body ss-g-loading", children: ui.games.loading }),
|
|
7442
|
+
config && /* @__PURE__ */ jsxs68(Fragment17, { children: [
|
|
7443
|
+
/* @__PURE__ */ jsxs68("div", { className: "ss-g-body", children: [
|
|
7444
|
+
!isOver && /* @__PURE__ */ jsx80(PointsLadderRow, { ladder: config.pointsLadder, guessesUsed: clientState?.guessHistory.length ?? 0, ui }),
|
|
7445
|
+
rows.length > 0 && /* @__PURE__ */ jsxs68("div", { className: "ss-g-gxi-pitch", role: "group", "aria-label": t.pitchLabel, children: [
|
|
7446
|
+
/* @__PURE__ */ jsx80(PitchSvg, { variant: "full" }),
|
|
7447
|
+
/* @__PURE__ */ jsx80("div", { className: "ss-g-gxi-rows", children: rows.map((row, r) => /* @__PURE__ */ jsx80("div", { className: "ss-g-gxi-row", children: row.map((pos, c) => {
|
|
7404
7448
|
const posLabel = pos.slot ? posBySlot.get(pos.slot) ?? "" : "";
|
|
7405
7449
|
const name = pos.slot ? nameBySlot.get(pos.slot) : void 0;
|
|
7406
7450
|
const lineupEntry = pos.slot ? lineupBySlot.get(pos.slot) : void 0;
|
|
7407
7451
|
const flag = nationalityFlag(pos.nationality);
|
|
7408
7452
|
if (lineupEntry) {
|
|
7409
|
-
return /* @__PURE__ */
|
|
7410
|
-
/* @__PURE__ */
|
|
7453
|
+
return /* @__PURE__ */ jsxs68("div", { className: "ss-g-gxi-node", "data-revealed": "true", children: [
|
|
7454
|
+
/* @__PURE__ */ jsx80(
|
|
7411
7455
|
PlayerAvatar,
|
|
7412
7456
|
{
|
|
7413
7457
|
name: lineupEntry.name,
|
|
@@ -7415,11 +7459,11 @@ function GuessTheXiGame({
|
|
|
7415
7459
|
className: "ss-g-gxi-disc ss-g-gxi-disc--photo"
|
|
7416
7460
|
}
|
|
7417
7461
|
),
|
|
7418
|
-
/* @__PURE__ */
|
|
7462
|
+
/* @__PURE__ */ jsx80("span", { className: "ss-g-gxi-pos ss-g-gxi-pos--name", children: splitName(lineupEntry.name).last })
|
|
7419
7463
|
] }, `${pos.slot}-${c}`);
|
|
7420
7464
|
}
|
|
7421
|
-
return /* @__PURE__ */
|
|
7422
|
-
/* @__PURE__ */
|
|
7465
|
+
return /* @__PURE__ */ jsxs68("div", { className: "ss-g-gxi-node", "data-revealed": name ? "true" : void 0, children: [
|
|
7466
|
+
/* @__PURE__ */ jsx80(
|
|
7423
7467
|
"span",
|
|
7424
7468
|
{
|
|
7425
7469
|
className: "ss-g-gxi-disc",
|
|
@@ -7430,22 +7474,22 @@ function GuessTheXiGame({
|
|
|
7430
7474
|
children: flag
|
|
7431
7475
|
}
|
|
7432
7476
|
),
|
|
7433
|
-
name ? /* @__PURE__ */
|
|
7477
|
+
name ? /* @__PURE__ */ jsx80("span", { className: "ss-g-gxi-pos ss-g-gxi-pos--name", children: splitName(name).last }) : posLabel && /* @__PURE__ */ jsx80("span", { className: "ss-g-gxi-pos", children: posLabel })
|
|
7434
7478
|
] }, `${pos.slot}-${c}`);
|
|
7435
7479
|
}) }, r)) })
|
|
7436
7480
|
] }),
|
|
7437
|
-
!isOver && wrongGuesses.length > 0 && /* @__PURE__ */
|
|
7438
|
-
/* @__PURE__ */
|
|
7481
|
+
!isOver && wrongGuesses.length > 0 && /* @__PURE__ */ jsxs68("div", { className: "ss-g-gxi-wrong", children: [
|
|
7482
|
+
/* @__PURE__ */ jsx80("span", { className: "ss-g-gxi-wrong-l", children: t.notThem }),
|
|
7439
7483
|
wrongGuesses.map((g) => {
|
|
7440
7484
|
const crestUrl = config?.teamPool.find((tm) => tm.teamId === g.teamId)?.crestUrl;
|
|
7441
|
-
return /* @__PURE__ */
|
|
7442
|
-
/* @__PURE__ */
|
|
7443
|
-
/* @__PURE__ */
|
|
7485
|
+
return /* @__PURE__ */ jsxs68("span", { className: "ss-g-gxi-wrong-chip", children: [
|
|
7486
|
+
/* @__PURE__ */ jsx80(CrestShield, { src: crestUrl, name: teamName(g.teamId), size: 18 }),
|
|
7487
|
+
/* @__PURE__ */ jsx80("s", { children: teamName(g.teamId) })
|
|
7444
7488
|
] }, g.teamId);
|
|
7445
7489
|
})
|
|
7446
7490
|
] }),
|
|
7447
|
-
isOver && /* @__PURE__ */
|
|
7448
|
-
/* @__PURE__ */
|
|
7491
|
+
isOver && /* @__PURE__ */ jsxs68(Fragment17, { children: [
|
|
7492
|
+
/* @__PURE__ */ jsx80(
|
|
7449
7493
|
ResultCard,
|
|
7450
7494
|
{
|
|
7451
7495
|
tone: solved ? "win" : failed ? "lose" : "neutral",
|
|
@@ -7456,29 +7500,29 @@ function GuessTheXiGame({
|
|
|
7456
7500
|
ui
|
|
7457
7501
|
}
|
|
7458
7502
|
),
|
|
7459
|
-
(solved || failed) && clientState?.answer && /* @__PURE__ */
|
|
7460
|
-
/* @__PURE__ */
|
|
7461
|
-
/* @__PURE__ */
|
|
7462
|
-
/* @__PURE__ */
|
|
7503
|
+
(solved || failed) && clientState?.answer && /* @__PURE__ */ jsxs68("div", { className: "ss-g-gxi-answer", "data-testid": "gxi-answer-reveal", children: [
|
|
7504
|
+
/* @__PURE__ */ jsx80("span", { className: "ss-g-gxi-answer-label", children: t.theAnswer }),
|
|
7505
|
+
/* @__PURE__ */ jsx80(CrestShield, { src: clientState.answer.crestUrl, name: clientState.answer.teamName, size: 32 }),
|
|
7506
|
+
/* @__PURE__ */ jsx80("span", { className: "ss-g-gxi-answer-name", children: clientState.answer.teamName })
|
|
7463
7507
|
] })
|
|
7464
7508
|
] })
|
|
7465
7509
|
] }),
|
|
7466
|
-
!isOver && /* @__PURE__ */
|
|
7467
|
-
query.length > 0 && filtered.length > 0 && /* @__PURE__ */
|
|
7510
|
+
!isOver && /* @__PURE__ */ jsxs68(FooterBar, { children: [
|
|
7511
|
+
query.length > 0 && filtered.length > 0 && /* @__PURE__ */ jsx80(
|
|
7468
7512
|
OptionList,
|
|
7469
7513
|
{
|
|
7470
7514
|
label: t.optionsLabel,
|
|
7471
7515
|
options: filtered.map((tm) => ({
|
|
7472
7516
|
key: tm.teamId,
|
|
7473
|
-
content: /* @__PURE__ */
|
|
7474
|
-
/* @__PURE__ */
|
|
7475
|
-
/* @__PURE__ */
|
|
7517
|
+
content: /* @__PURE__ */ jsxs68(Fragment17, { children: [
|
|
7518
|
+
/* @__PURE__ */ jsx80(CrestShield, { src: tm.crestUrl, name: tm.teamName, size: 28 }),
|
|
7519
|
+
/* @__PURE__ */ jsx80("span", { children: tm.teamName })
|
|
7476
7520
|
] })
|
|
7477
7521
|
})),
|
|
7478
7522
|
onPick: (k) => handlePick(Number(k))
|
|
7479
7523
|
}
|
|
7480
7524
|
),
|
|
7481
|
-
/* @__PURE__ */
|
|
7525
|
+
/* @__PURE__ */ jsx80(
|
|
7482
7526
|
SearchField,
|
|
7483
7527
|
{
|
|
7484
7528
|
id: inputId,
|
|
@@ -7496,7 +7540,7 @@ function GuessTheXiGame({
|
|
|
7496
7540
|
|
|
7497
7541
|
// src/components/games/DailyQuizGame.tsx
|
|
7498
7542
|
import { useState as useState34 } from "react";
|
|
7499
|
-
import { Fragment as
|
|
7543
|
+
import { Fragment as Fragment18, jsx as jsx81, jsxs as jsxs69 } from "react/jsx-runtime";
|
|
7500
7544
|
function parseClientState6(json) {
|
|
7501
7545
|
if (!json) return null;
|
|
7502
7546
|
try {
|
|
@@ -7517,13 +7561,13 @@ function OptionName({ text }) {
|
|
|
7517
7561
|
const tokens = base.split(/\s+/).filter(Boolean);
|
|
7518
7562
|
const isPlainName = tokens.length >= 1 && tokens.length <= 4 && tokens.every((t) => NAME_TOKEN.test(t));
|
|
7519
7563
|
if (!isPlainName || base === "") {
|
|
7520
|
-
return /* @__PURE__ */
|
|
7564
|
+
return /* @__PURE__ */ jsx81("span", { className: "ss-g-dq-opt-name", children: /* @__PURE__ */ jsx81("span", { className: "ss-g-dq-opt-full", children: text }) });
|
|
7521
7565
|
}
|
|
7522
7566
|
const { first, last } = splitName(base);
|
|
7523
|
-
return /* @__PURE__ */
|
|
7524
|
-
first && /* @__PURE__ */
|
|
7525
|
-
/* @__PURE__ */
|
|
7526
|
-
suffix && /* @__PURE__ */
|
|
7567
|
+
return /* @__PURE__ */ jsxs69("span", { className: "ss-g-dq-opt-name", children: [
|
|
7568
|
+
first && /* @__PURE__ */ jsx81("span", { className: "ss-g-dq-opt-first", children: first }),
|
|
7569
|
+
/* @__PURE__ */ jsx81("span", { className: "ss-g-dq-opt-last", children: last }),
|
|
7570
|
+
suffix && /* @__PURE__ */ jsx81("span", { className: "ss-g-dq-opt-suffix", children: suffix })
|
|
7527
7571
|
] });
|
|
7528
7572
|
}
|
|
7529
7573
|
function DailyQuizGame({
|
|
@@ -7542,9 +7586,9 @@ function DailyQuizGame({
|
|
|
7542
7586
|
const results = clientState?.results ?? [];
|
|
7543
7587
|
const isRevealed = results.length > 0 || result?.alreadyPlayed === true;
|
|
7544
7588
|
if (!config) {
|
|
7545
|
-
return /* @__PURE__ */
|
|
7546
|
-
/* @__PURE__ */
|
|
7547
|
-
/* @__PURE__ */
|
|
7589
|
+
return /* @__PURE__ */ jsxs69("div", { className: "ss-g-screen", "data-game": "daily-quiz", "data-testid": "game-screen-daily-quiz", children: [
|
|
7590
|
+
/* @__PURE__ */ jsx81(GameHeader, { title, onBack, backLabel: ui.back }),
|
|
7591
|
+
/* @__PURE__ */ jsx81("div", { className: "ss-g-body ss-g-loading", children: ui.games.loading })
|
|
7548
7592
|
] });
|
|
7549
7593
|
}
|
|
7550
7594
|
const questions = config.questions;
|
|
@@ -7579,11 +7623,11 @@ function DailyQuizGame({
|
|
|
7579
7623
|
return r.isCorrect ? "correct" : "wrong";
|
|
7580
7624
|
});
|
|
7581
7625
|
const correctCount = results.filter((r) => r.isCorrect).length;
|
|
7582
|
-
return /* @__PURE__ */
|
|
7583
|
-
/* @__PURE__ */
|
|
7584
|
-
/* @__PURE__ */
|
|
7585
|
-
/* @__PURE__ */
|
|
7586
|
-
/* @__PURE__ */
|
|
7626
|
+
return /* @__PURE__ */ jsxs69("div", { className: "ss-g-screen", "data-game": "daily-quiz", "data-testid": "game-screen-daily-quiz", children: [
|
|
7627
|
+
/* @__PURE__ */ jsx81(GameHeader, { title, eyebrow: s.results, onBack, backLabel: ui.back }),
|
|
7628
|
+
/* @__PURE__ */ jsx81(SegmentProgress, { segments: segments2, ariaLabel: s.results }),
|
|
7629
|
+
/* @__PURE__ */ jsxs69("div", { className: "ss-g-body", children: [
|
|
7630
|
+
/* @__PURE__ */ jsx81(
|
|
7587
7631
|
ResultCard,
|
|
7588
7632
|
{
|
|
7589
7633
|
tone: "neutral",
|
|
@@ -7596,15 +7640,15 @@ function DailyQuizGame({
|
|
|
7596
7640
|
questions.map((q) => {
|
|
7597
7641
|
const r = findResult(results, q.index);
|
|
7598
7642
|
const picked = selections.get(q.index);
|
|
7599
|
-
return /* @__PURE__ */
|
|
7600
|
-
/* @__PURE__ */
|
|
7601
|
-
r && /* @__PURE__ */
|
|
7643
|
+
return /* @__PURE__ */ jsxs69("div", { className: "ss-g-dq-rq", children: [
|
|
7644
|
+
/* @__PURE__ */ jsx81("div", { className: "ss-g-dq-rq-stem", children: q.stem }),
|
|
7645
|
+
r && /* @__PURE__ */ jsx81("div", { className: "ss-g-dq-rq-opts", children: q.options.map((opt, optIdx) => {
|
|
7602
7646
|
let cls = "ss-g-dq-rq-opt";
|
|
7603
7647
|
if (optIdx === r.correctOptionIndex) cls += " ss-g-dq-rq-opt--correct";
|
|
7604
7648
|
else if (optIdx === picked && !r.isCorrect) cls += " ss-g-dq-rq-opt--wrong";
|
|
7605
|
-
return /* @__PURE__ */
|
|
7649
|
+
return /* @__PURE__ */ jsx81("span", { className: cls, children: opt }, optIdx);
|
|
7606
7650
|
}) }),
|
|
7607
|
-
r?.revealText && /* @__PURE__ */
|
|
7651
|
+
r?.revealText && /* @__PURE__ */ jsx81("div", { className: "ss-g-dq-why", children: r.revealText })
|
|
7608
7652
|
] }, q.index);
|
|
7609
7653
|
})
|
|
7610
7654
|
] })
|
|
@@ -7612,16 +7656,16 @@ function DailyQuizGame({
|
|
|
7612
7656
|
}
|
|
7613
7657
|
const segments = questions.map((_, i) => i < page ? "done" : i === page ? "current" : "todo");
|
|
7614
7658
|
const selectedIdx = current ? selections.get(current.index) : void 0;
|
|
7615
|
-
return /* @__PURE__ */
|
|
7616
|
-
/* @__PURE__ */
|
|
7617
|
-
/* @__PURE__ */
|
|
7618
|
-
/* @__PURE__ */
|
|
7619
|
-
/* @__PURE__ */
|
|
7620
|
-
/* @__PURE__ */
|
|
7659
|
+
return /* @__PURE__ */ jsxs69("div", { className: "ss-g-screen", "data-game": "daily-quiz", "data-testid": "game-screen-daily-quiz", children: [
|
|
7660
|
+
/* @__PURE__ */ jsx81(GameHeader, { title, eyebrow: s.questionOf(page + 1, total), onBack, backLabel: ui.back }),
|
|
7661
|
+
/* @__PURE__ */ jsx81(SegmentProgress, { segments, ariaLabel: s.progressAria(page + 1, total) }),
|
|
7662
|
+
/* @__PURE__ */ jsx81("div", { className: "ss-g-body", children: current && /* @__PURE__ */ jsxs69(Fragment18, { children: [
|
|
7663
|
+
/* @__PURE__ */ jsx81("h3", { className: "ss-g-dq-stem", children: current.stem }),
|
|
7664
|
+
/* @__PURE__ */ jsx81("div", { className: "ss-g-dq-opts", children: current.options.map((opt, optIdx) => {
|
|
7621
7665
|
const selected = optIdx === selectedIdx;
|
|
7622
7666
|
const imagePath = current.optionImagePaths?.[optIdx] ?? void 0;
|
|
7623
7667
|
const playerName = opt;
|
|
7624
|
-
return /* @__PURE__ */
|
|
7668
|
+
return /* @__PURE__ */ jsxs69(
|
|
7625
7669
|
"button",
|
|
7626
7670
|
{
|
|
7627
7671
|
type: "button",
|
|
@@ -7630,25 +7674,25 @@ function DailyQuizGame({
|
|
|
7630
7674
|
disabled: submitting,
|
|
7631
7675
|
onClick: () => handleSelect(current.index, optIdx),
|
|
7632
7676
|
children: [
|
|
7633
|
-
current.optionImagePaths && /* @__PURE__ */
|
|
7634
|
-
/* @__PURE__ */
|
|
7635
|
-
/* @__PURE__ */
|
|
7677
|
+
current.optionImagePaths && /* @__PURE__ */ jsx81(PlayerAvatar, { name: playerName, imagePath, className: "ss-g-dq-opt-av" }),
|
|
7678
|
+
/* @__PURE__ */ jsx81("span", { className: "ss-g-dq-badge", "aria-hidden": "true", children: selected ? /* @__PURE__ */ jsx81(IconCheck, {}) : String.fromCharCode(65 + optIdx) }),
|
|
7679
|
+
/* @__PURE__ */ jsx81(OptionName, { text: opt })
|
|
7636
7680
|
]
|
|
7637
7681
|
},
|
|
7638
7682
|
optIdx
|
|
7639
7683
|
);
|
|
7640
7684
|
}) })
|
|
7641
7685
|
] }) }),
|
|
7642
|
-
/* @__PURE__ */
|
|
7643
|
-
page > 0 && /* @__PURE__ */
|
|
7644
|
-
isLast ? /* @__PURE__ */
|
|
7686
|
+
/* @__PURE__ */ jsx81(FooterBar, { children: /* @__PURE__ */ jsxs69("div", { className: "ss-g-dq-nav", children: [
|
|
7687
|
+
page > 0 && /* @__PURE__ */ jsx81(GameButton, { variant: "outline", onClick: goPrev, disabled: submitting, children: s.previous }),
|
|
7688
|
+
isLast ? /* @__PURE__ */ jsx81(GameButton, { variant: "primary", block: true, onClick: handleSubmit, disabled: !currentAnswered || !allAnswered || submitting, children: submitting ? s.submitting : s.submit }) : /* @__PURE__ */ jsx81(GameButton, { variant: "primary", block: true, onClick: goNext, disabled: !currentAnswered || submitting, children: s.next })
|
|
7645
7689
|
] }) })
|
|
7646
7690
|
] });
|
|
7647
7691
|
}
|
|
7648
7692
|
|
|
7649
7693
|
// src/components/games/MatchdayPredictorGame.tsx
|
|
7650
7694
|
import { useId as useId6, useState as useState35 } from "react";
|
|
7651
|
-
import { jsx as
|
|
7695
|
+
import { jsx as jsx82, jsxs as jsxs70 } from "react/jsx-runtime";
|
|
7652
7696
|
var SCORER_SEARCH_THRESHOLD = 9;
|
|
7653
7697
|
function parseClientState7(json) {
|
|
7654
7698
|
if (!json) return null;
|
|
@@ -7666,7 +7710,7 @@ function isLocked(kickoffUtc) {
|
|
|
7666
7710
|
}
|
|
7667
7711
|
}
|
|
7668
7712
|
function IconMinus() {
|
|
7669
|
-
return /* @__PURE__ */
|
|
7713
|
+
return /* @__PURE__ */ jsx82(
|
|
7670
7714
|
"svg",
|
|
7671
7715
|
{
|
|
7672
7716
|
width: 18,
|
|
@@ -7677,20 +7721,20 @@ function IconMinus() {
|
|
|
7677
7721
|
strokeWidth: 2.2,
|
|
7678
7722
|
strokeLinecap: "round",
|
|
7679
7723
|
"aria-hidden": "true",
|
|
7680
|
-
children: /* @__PURE__ */
|
|
7724
|
+
children: /* @__PURE__ */ jsx82("path", { d: "M5 12h14" })
|
|
7681
7725
|
}
|
|
7682
7726
|
);
|
|
7683
7727
|
}
|
|
7684
7728
|
function TeamBadge({ team, label }) {
|
|
7685
|
-
return /* @__PURE__ */
|
|
7686
|
-
/* @__PURE__ */
|
|
7687
|
-
/* @__PURE__ */
|
|
7688
|
-
/* @__PURE__ */
|
|
7729
|
+
return /* @__PURE__ */ jsxs70("div", { className: "ss-g-mp-team", children: [
|
|
7730
|
+
/* @__PURE__ */ jsx82(CrestShield, { name: team.name, size: 44 }),
|
|
7731
|
+
/* @__PURE__ */ jsx82("span", { className: "ss-g-mp-team-name", children: team.name }),
|
|
7732
|
+
/* @__PURE__ */ jsx82("span", { className: "ss-g-mp-team-side", children: label })
|
|
7689
7733
|
] });
|
|
7690
7734
|
}
|
|
7691
7735
|
function ScoreCard({ home, away, h, a, t, edit }) {
|
|
7692
|
-
const col = (side, team, value) => /* @__PURE__ */
|
|
7693
|
-
edit && /* @__PURE__ */
|
|
7736
|
+
const col = (side, team, value) => /* @__PURE__ */ jsxs70("div", { className: "ss-g-mp-col", children: [
|
|
7737
|
+
edit && /* @__PURE__ */ jsx82(
|
|
7694
7738
|
"button",
|
|
7695
7739
|
{
|
|
7696
7740
|
type: "button",
|
|
@@ -7698,11 +7742,11 @@ function ScoreCard({ home, away, h, a, t, edit }) {
|
|
|
7698
7742
|
"aria-label": t.goalsUp(team.name),
|
|
7699
7743
|
disabled: edit.disabled,
|
|
7700
7744
|
onClick: () => edit.onStep(side, 1),
|
|
7701
|
-
children: /* @__PURE__ */
|
|
7745
|
+
children: /* @__PURE__ */ jsx82(IconPlus, { size: 18 })
|
|
7702
7746
|
}
|
|
7703
7747
|
),
|
|
7704
|
-
/* @__PURE__ */
|
|
7705
|
-
edit && /* @__PURE__ */
|
|
7748
|
+
/* @__PURE__ */ jsx82("span", { className: "ss-g-mp-digit", "data-testid": "mp-digit", "data-active": edit ? String(edit.active === side) : "false", children: value }),
|
|
7749
|
+
edit && /* @__PURE__ */ jsx82(
|
|
7706
7750
|
"button",
|
|
7707
7751
|
{
|
|
7708
7752
|
type: "button",
|
|
@@ -7710,27 +7754,27 @@ function ScoreCard({ home, away, h, a, t, edit }) {
|
|
|
7710
7754
|
"aria-label": t.goalsDown(team.name),
|
|
7711
7755
|
disabled: edit.disabled || value <= 0,
|
|
7712
7756
|
onClick: () => edit.onStep(side, -1),
|
|
7713
|
-
children: /* @__PURE__ */
|
|
7757
|
+
children: /* @__PURE__ */ jsx82(IconMinus, {})
|
|
7714
7758
|
}
|
|
7715
7759
|
)
|
|
7716
7760
|
] });
|
|
7717
|
-
return /* @__PURE__ */
|
|
7718
|
-
/* @__PURE__ */
|
|
7719
|
-
/* @__PURE__ */
|
|
7761
|
+
return /* @__PURE__ */ jsxs70("div", { className: "ss-g-mp-card", children: [
|
|
7762
|
+
/* @__PURE__ */ jsx82(TeamBadge, { team: home, label: t.home }),
|
|
7763
|
+
/* @__PURE__ */ jsxs70("div", { className: "ss-g-mp-scores", children: [
|
|
7720
7764
|
col("home", home, h),
|
|
7721
|
-
/* @__PURE__ */
|
|
7765
|
+
/* @__PURE__ */ jsx82("span", { className: "ss-g-mp-dash", "aria-hidden": "true", children: "\u2013" }),
|
|
7722
7766
|
col("away", away, a)
|
|
7723
7767
|
] }),
|
|
7724
|
-
/* @__PURE__ */
|
|
7768
|
+
/* @__PURE__ */ jsx82(TeamBadge, { team: away, label: t.away })
|
|
7725
7769
|
] });
|
|
7726
7770
|
}
|
|
7727
7771
|
function OutcomeRow({ label, ok, detail, t }) {
|
|
7728
|
-
return /* @__PURE__ */
|
|
7729
|
-
/* @__PURE__ */
|
|
7730
|
-
/* @__PURE__ */
|
|
7731
|
-
ok ? /* @__PURE__ */
|
|
7732
|
-
/* @__PURE__ */
|
|
7733
|
-
detail ? /* @__PURE__ */
|
|
7772
|
+
return /* @__PURE__ */ jsxs70("li", { className: "ss-g-mp-row", "data-testid": "mp-row", "data-ok": String(ok), children: [
|
|
7773
|
+
/* @__PURE__ */ jsx82("span", { className: "ss-g-mp-row-k", children: label }),
|
|
7774
|
+
/* @__PURE__ */ jsxs70("span", { className: "ss-g-mp-row-v", children: [
|
|
7775
|
+
ok ? /* @__PURE__ */ jsx82(IconCheck, {}) : /* @__PURE__ */ jsx82(IconClose, { size: 14 }),
|
|
7776
|
+
/* @__PURE__ */ jsx82("span", { className: "ss-g-sr", children: ok ? t.correct : t.incorrect }),
|
|
7777
|
+
detail ? /* @__PURE__ */ jsx82("span", { className: "ss-g-mp-row-d", children: detail }) : null
|
|
7734
7778
|
] })
|
|
7735
7779
|
] });
|
|
7736
7780
|
}
|
|
@@ -7751,12 +7795,12 @@ function MatchdayPredictorGame({
|
|
|
7751
7795
|
const searchId = useId6();
|
|
7752
7796
|
const clientState = parseClientState7(result?.clientStateJson);
|
|
7753
7797
|
const alreadyPlayed = result?.alreadyPlayed === true;
|
|
7754
|
-
const header = /* @__PURE__ */
|
|
7798
|
+
const header = /* @__PURE__ */ jsx82(
|
|
7755
7799
|
GameHeader,
|
|
7756
7800
|
{
|
|
7757
7801
|
title: gameTitle({ gameId: "matchday-predictor" }, ui.games.titles),
|
|
7758
7802
|
eyebrow: config ? t.eyebrow(config.homeTeam.name, config.awayTeam.name) : void 0,
|
|
7759
|
-
right: config ? /* @__PURE__ */
|
|
7803
|
+
right: config ? /* @__PURE__ */ jsx82(Chip, { icon: /* @__PURE__ */ jsx82(IconLock, {}), children: ui.games.formatDayTime(config.kickoffUtc) }) : void 0,
|
|
7760
7804
|
onBack,
|
|
7761
7805
|
backLabel: ui.back
|
|
7762
7806
|
}
|
|
@@ -7764,10 +7808,10 @@ function MatchdayPredictorGame({
|
|
|
7764
7808
|
if (alreadyPlayed && clientState) {
|
|
7765
7809
|
if (!clientState.graded) {
|
|
7766
7810
|
const scorer = config?.scorerPool.find((p) => p.playerId === clientState.predictedFirstScorerPlayerId) ?? null;
|
|
7767
|
-
return /* @__PURE__ */
|
|
7811
|
+
return /* @__PURE__ */ jsxs70("div", { className: "ss-g-screen", "data-game": "matchday-predictor", "data-testid": "game-screen-matchday-predictor", children: [
|
|
7768
7812
|
header,
|
|
7769
|
-
/* @__PURE__ */
|
|
7770
|
-
config && /* @__PURE__ */
|
|
7813
|
+
/* @__PURE__ */ jsxs70("div", { className: "ss-g-body", children: [
|
|
7814
|
+
config && /* @__PURE__ */ jsx82(
|
|
7771
7815
|
ScoreCard,
|
|
7772
7816
|
{
|
|
7773
7817
|
home: config.homeTeam,
|
|
@@ -7777,7 +7821,7 @@ function MatchdayPredictorGame({
|
|
|
7777
7821
|
t
|
|
7778
7822
|
}
|
|
7779
7823
|
),
|
|
7780
|
-
/* @__PURE__ */
|
|
7824
|
+
/* @__PURE__ */ jsx82(
|
|
7781
7825
|
ResultCard,
|
|
7782
7826
|
{
|
|
7783
7827
|
tone: "neutral",
|
|
@@ -7794,28 +7838,28 @@ function MatchdayPredictorGame({
|
|
|
7794
7838
|
}
|
|
7795
7839
|
)
|
|
7796
7840
|
] }),
|
|
7797
|
-
/* @__PURE__ */
|
|
7841
|
+
/* @__PURE__ */ jsx82(FooterBar, { children: /* @__PURE__ */ jsx82("p", { className: "ss-g-mp-fun", children: t.forFun }) })
|
|
7798
7842
|
] });
|
|
7799
7843
|
}
|
|
7800
7844
|
const r = clientState.result;
|
|
7801
|
-
return /* @__PURE__ */
|
|
7845
|
+
return /* @__PURE__ */ jsxs70("div", { className: "ss-g-screen", "data-game": "matchday-predictor", "data-testid": "game-screen-matchday-predictor", children: [
|
|
7802
7846
|
header,
|
|
7803
|
-
/* @__PURE__ */
|
|
7804
|
-
config && /* @__PURE__ */
|
|
7805
|
-
/* @__PURE__ */
|
|
7806
|
-
/* @__PURE__ */
|
|
7807
|
-
/* @__PURE__ */
|
|
7808
|
-
/* @__PURE__ */
|
|
7809
|
-
!clientState.firstScorerVoid && /* @__PURE__ */
|
|
7847
|
+
/* @__PURE__ */ jsxs70("div", { className: "ss-g-body", children: [
|
|
7848
|
+
config && /* @__PURE__ */ jsx82(ScoreCard, { home: config.homeTeam, away: config.awayTeam, h: r.homeScore, a: r.awayScore, t }),
|
|
7849
|
+
/* @__PURE__ */ jsx82(ResultCard, { tone: "neutral", title: t.fullTime(r.homeScore, r.awayScore), onBack, ui }),
|
|
7850
|
+
/* @__PURE__ */ jsxs70("ul", { className: "ss-g-mp-rows", children: [
|
|
7851
|
+
/* @__PURE__ */ jsx82(OutcomeRow, { label: t.exactScore, ok: clientState.exactScoreCorrect, t }),
|
|
7852
|
+
/* @__PURE__ */ jsx82(OutcomeRow, { label: t.outcome, ok: clientState.outcomeCorrect, t }),
|
|
7853
|
+
!clientState.firstScorerVoid && /* @__PURE__ */ jsx82(OutcomeRow, { label: t.firstScorerRow, ok: clientState.firstScorerCorrect, detail: r.firstScorerName, t })
|
|
7810
7854
|
] })
|
|
7811
7855
|
] }),
|
|
7812
|
-
/* @__PURE__ */
|
|
7856
|
+
/* @__PURE__ */ jsx82(FooterBar, { children: /* @__PURE__ */ jsx82("p", { className: "ss-g-mp-fun", children: t.forFun }) })
|
|
7813
7857
|
] });
|
|
7814
7858
|
}
|
|
7815
7859
|
if (!config) {
|
|
7816
|
-
return /* @__PURE__ */
|
|
7860
|
+
return /* @__PURE__ */ jsxs70("div", { className: "ss-g-screen", "data-game": "matchday-predictor", "data-testid": "game-screen-matchday-predictor", children: [
|
|
7817
7861
|
header,
|
|
7818
|
-
/* @__PURE__ */
|
|
7862
|
+
/* @__PURE__ */ jsx82("div", { className: "ss-g-body ss-g-loading", children: ui.games.loading })
|
|
7819
7863
|
] });
|
|
7820
7864
|
}
|
|
7821
7865
|
const locked = isLocked(config.kickoffUtc);
|
|
@@ -7839,10 +7883,10 @@ function MatchdayPredictorGame({
|
|
|
7839
7883
|
const showSearch = pool.length > SCORER_SEARCH_THRESHOLD;
|
|
7840
7884
|
const q = query.trim().toLowerCase();
|
|
7841
7885
|
const visible = showSearch && q ? pool.filter((p) => p.playerName.toLowerCase().includes(q)) : pool;
|
|
7842
|
-
return /* @__PURE__ */
|
|
7886
|
+
return /* @__PURE__ */ jsxs70("div", { className: "ss-g-screen", "data-game": "matchday-predictor", "data-testid": "game-screen-matchday-predictor", children: [
|
|
7843
7887
|
header,
|
|
7844
|
-
/* @__PURE__ */
|
|
7845
|
-
/* @__PURE__ */
|
|
7888
|
+
/* @__PURE__ */ jsxs70("div", { className: "ss-g-body", children: [
|
|
7889
|
+
/* @__PURE__ */ jsx82(
|
|
7846
7890
|
ScoreCard,
|
|
7847
7891
|
{
|
|
7848
7892
|
home: config.homeTeam,
|
|
@@ -7853,12 +7897,12 @@ function MatchdayPredictorGame({
|
|
|
7853
7897
|
edit: { disabled, active: lastEdited, onStep: step }
|
|
7854
7898
|
}
|
|
7855
7899
|
),
|
|
7856
|
-
pool.length > 0 && /* @__PURE__ */
|
|
7857
|
-
/* @__PURE__ */
|
|
7858
|
-
/* @__PURE__ */
|
|
7859
|
-
/* @__PURE__ */
|
|
7900
|
+
pool.length > 0 && /* @__PURE__ */ jsxs70("section", { className: "ss-g-mp-scorer", children: [
|
|
7901
|
+
/* @__PURE__ */ jsxs70("div", { className: "ss-g-mp-sec-head", children: [
|
|
7902
|
+
/* @__PURE__ */ jsx82("h3", { children: t.firstScorer }),
|
|
7903
|
+
/* @__PURE__ */ jsx82("span", { children: t.optional })
|
|
7860
7904
|
] }),
|
|
7861
|
-
showSearch && /* @__PURE__ */
|
|
7905
|
+
showSearch && /* @__PURE__ */ jsx82(
|
|
7862
7906
|
SearchField,
|
|
7863
7907
|
{
|
|
7864
7908
|
id: searchId,
|
|
@@ -7870,9 +7914,9 @@ function MatchdayPredictorGame({
|
|
|
7870
7914
|
disabled
|
|
7871
7915
|
}
|
|
7872
7916
|
),
|
|
7873
|
-
/* @__PURE__ */
|
|
7917
|
+
/* @__PURE__ */ jsx82("div", { className: "ss-g-mp-grid", children: visible.map((p) => {
|
|
7874
7918
|
const selected = firstScorerPlayerId === p.playerId;
|
|
7875
|
-
return /* @__PURE__ */
|
|
7919
|
+
return /* @__PURE__ */ jsxs70(
|
|
7876
7920
|
"button",
|
|
7877
7921
|
{
|
|
7878
7922
|
type: "button",
|
|
@@ -7882,15 +7926,15 @@ function MatchdayPredictorGame({
|
|
|
7882
7926
|
disabled,
|
|
7883
7927
|
onClick: () => setFirstScorerPlayerId((id) => id === p.playerId ? null : p.playerId),
|
|
7884
7928
|
children: [
|
|
7885
|
-
selected && /* @__PURE__ */
|
|
7886
|
-
/* @__PURE__ */
|
|
7887
|
-
/* @__PURE__ */
|
|
7929
|
+
selected && /* @__PURE__ */ jsx82("span", { className: "ss-g-mp-pcheck", children: /* @__PURE__ */ jsx82(IconCheck, { size: 12 }) }),
|
|
7930
|
+
/* @__PURE__ */ jsx82(Silhouette, { size: 52, variant: selected ? "selected" : "default" }),
|
|
7931
|
+
/* @__PURE__ */ jsx82("span", { className: "ss-g-mp-pname", children: splitName(p.playerName).last })
|
|
7888
7932
|
]
|
|
7889
7933
|
},
|
|
7890
7934
|
p.playerId
|
|
7891
7935
|
);
|
|
7892
7936
|
}) }),
|
|
7893
|
-
/* @__PURE__ */
|
|
7937
|
+
/* @__PURE__ */ jsxs70(
|
|
7894
7938
|
"button",
|
|
7895
7939
|
{
|
|
7896
7940
|
type: "button",
|
|
@@ -7899,24 +7943,24 @@ function MatchdayPredictorGame({
|
|
|
7899
7943
|
disabled,
|
|
7900
7944
|
onClick: () => setFirstScorerPlayerId(null),
|
|
7901
7945
|
children: [
|
|
7902
|
-
/* @__PURE__ */
|
|
7946
|
+
/* @__PURE__ */ jsx82("span", { className: "ss-g-mp-radio", "aria-hidden": "true" }),
|
|
7903
7947
|
t.noScorer
|
|
7904
7948
|
]
|
|
7905
7949
|
}
|
|
7906
7950
|
)
|
|
7907
7951
|
] }),
|
|
7908
|
-
locked && /* @__PURE__ */
|
|
7952
|
+
locked && /* @__PURE__ */ jsx82("p", { className: "ss-g-mp-closed", children: t.closed })
|
|
7909
7953
|
] }),
|
|
7910
|
-
/* @__PURE__ */
|
|
7911
|
-
/* @__PURE__ */
|
|
7912
|
-
/* @__PURE__ */
|
|
7954
|
+
/* @__PURE__ */ jsxs70(FooterBar, { children: [
|
|
7955
|
+
/* @__PURE__ */ jsx82(GameButton, { variant: "primary", block: true, disabled, onClick: handleSubmit, children: submitting ? t.saving : t.save }),
|
|
7956
|
+
/* @__PURE__ */ jsx82("p", { className: "ss-g-mp-fun", children: t.forFun })
|
|
7913
7957
|
] })
|
|
7914
7958
|
] });
|
|
7915
7959
|
}
|
|
7916
7960
|
|
|
7917
7961
|
// src/components/games/StartingXiGame.tsx
|
|
7918
7962
|
import { useId as useId7, useState as useState36 } from "react";
|
|
7919
|
-
import { Fragment as
|
|
7963
|
+
import { Fragment as Fragment19, jsx as jsx83, jsxs as jsxs71 } from "react/jsx-runtime";
|
|
7920
7964
|
var POINTS_PER_STARTER = 8;
|
|
7921
7965
|
var XI_SIZE = 11;
|
|
7922
7966
|
var DEFAULT_FORMATION = "4-3-3";
|
|
@@ -7965,20 +8009,20 @@ function StartingXiGame({
|
|
|
7965
8009
|
const searchId = useId7();
|
|
7966
8010
|
const clientState = parseClientState8(result?.clientStateJson);
|
|
7967
8011
|
const alreadyPlayed = result?.alreadyPlayed === true;
|
|
7968
|
-
const header = /* @__PURE__ */
|
|
8012
|
+
const header = /* @__PURE__ */ jsx83(
|
|
7969
8013
|
GameHeader,
|
|
7970
8014
|
{
|
|
7971
8015
|
title: gameTitle({ gameId: "starting-xi" }, ui.games.titles),
|
|
7972
8016
|
eyebrow: t.eyebrow,
|
|
7973
|
-
right: /* @__PURE__ */
|
|
8017
|
+
right: /* @__PURE__ */ jsx83(Chip, { variant: "accent", children: t.perStarter(POINTS_PER_STARTER) }),
|
|
7974
8018
|
onBack,
|
|
7975
8019
|
backLabel: ui.back
|
|
7976
8020
|
}
|
|
7977
8021
|
);
|
|
7978
8022
|
function statusScreen(title, score) {
|
|
7979
|
-
return /* @__PURE__ */
|
|
8023
|
+
return /* @__PURE__ */ jsxs71("div", { className: "ss-g-screen", "data-game": "starting-xi", "data-testid": "game-screen-starting-xi", children: [
|
|
7980
8024
|
header,
|
|
7981
|
-
/* @__PURE__ */
|
|
8025
|
+
/* @__PURE__ */ jsx83("div", { className: "ss-g-body", children: /* @__PURE__ */ jsx83(ResultCard, { tone: "neutral", title, score, onBack, ui }) })
|
|
7982
8026
|
] });
|
|
7983
8027
|
}
|
|
7984
8028
|
if (alreadyPlayed) {
|
|
@@ -7987,9 +8031,9 @@ function StartingXiGame({
|
|
|
7987
8031
|
if (clientState.status === "graded") return statusScreen(t.gradedLine(clientState.correctCount), clientState.score);
|
|
7988
8032
|
}
|
|
7989
8033
|
if (!config) {
|
|
7990
|
-
return /* @__PURE__ */
|
|
8034
|
+
return /* @__PURE__ */ jsxs71("div", { className: "ss-g-screen", "data-game": "starting-xi", "data-testid": "game-screen-starting-xi", children: [
|
|
7991
8035
|
header,
|
|
7992
|
-
/* @__PURE__ */
|
|
8036
|
+
/* @__PURE__ */ jsx83("div", { className: "ss-g-body ss-g-loading", children: ui.games.loading })
|
|
7993
8037
|
] });
|
|
7994
8038
|
}
|
|
7995
8039
|
const { formation, slots } = formationSlots(config.formation);
|
|
@@ -8024,27 +8068,27 @@ function StartingXiGame({
|
|
|
8024
8068
|
onSubmit(JSON.stringify({ predictedPlayerIds: slotPlayers }));
|
|
8025
8069
|
}
|
|
8026
8070
|
const segments = slotPlayers.map((p) => p !== null ? "current" : "todo");
|
|
8027
|
-
return /* @__PURE__ */
|
|
8071
|
+
return /* @__PURE__ */ jsxs71("div", { className: "ss-g-screen", "data-game": "starting-xi", "data-testid": "game-screen-starting-xi", children: [
|
|
8028
8072
|
header,
|
|
8029
|
-
/* @__PURE__ */
|
|
8073
|
+
/* @__PURE__ */ jsx83(
|
|
8030
8074
|
SegmentProgress,
|
|
8031
8075
|
{
|
|
8032
8076
|
segments,
|
|
8033
8077
|
ariaLabel: t.picked(pickedCount),
|
|
8034
8078
|
leftLabel: t.picked(pickedCount),
|
|
8035
8079
|
rightLabel: t.toGo(XI_SIZE - pickedCount),
|
|
8036
|
-
right: /* @__PURE__ */
|
|
8080
|
+
right: /* @__PURE__ */ jsx83(Chip, { children: formation })
|
|
8037
8081
|
}
|
|
8038
8082
|
),
|
|
8039
|
-
/* @__PURE__ */
|
|
8040
|
-
/* @__PURE__ */
|
|
8041
|
-
/* @__PURE__ */
|
|
8083
|
+
/* @__PURE__ */ jsxs71("div", { className: "ss-g-body", children: [
|
|
8084
|
+
/* @__PURE__ */ jsxs71("div", { className: "ss-g-xi-pitch", children: [
|
|
8085
|
+
/* @__PURE__ */ jsx83(PitchSvg, { variant: "half" }),
|
|
8042
8086
|
slots.map((s) => {
|
|
8043
8087
|
const playerId = slotPlayers[s.index] ?? null;
|
|
8044
8088
|
const player = playerId !== null ? byId.get(playerId) ?? null : null;
|
|
8045
8089
|
const name = player?.playerName ?? "";
|
|
8046
8090
|
const state = player ? "filled" : active === s.index ? "active" : "empty";
|
|
8047
|
-
return /* @__PURE__ */
|
|
8091
|
+
return /* @__PURE__ */ jsxs71(
|
|
8048
8092
|
"button",
|
|
8049
8093
|
{
|
|
8050
8094
|
type: "button",
|
|
@@ -8056,21 +8100,21 @@ function StartingXiGame({
|
|
|
8056
8100
|
disabled: submitting,
|
|
8057
8101
|
onClick: () => tapSlot(s.index),
|
|
8058
8102
|
children: [
|
|
8059
|
-
/* @__PURE__ */
|
|
8060
|
-
/* @__PURE__ */
|
|
8103
|
+
/* @__PURE__ */ jsx83("span", { className: "ss-g-xi-ring", "aria-hidden": "true", children: player ? player.jerseyNumber ?? "" : /* @__PURE__ */ jsx83(IconPlus, { size: 18 }) }),
|
|
8104
|
+
/* @__PURE__ */ jsx83("span", { className: "ss-g-xi-tag", "aria-hidden": "true", children: player ? splitName(name).last : s.label })
|
|
8061
8105
|
]
|
|
8062
8106
|
},
|
|
8063
8107
|
s.index
|
|
8064
8108
|
);
|
|
8065
8109
|
})
|
|
8066
8110
|
] }),
|
|
8067
|
-
/* @__PURE__ */
|
|
8068
|
-
/* @__PURE__ */
|
|
8069
|
-
/* @__PURE__ */
|
|
8070
|
-
/* @__PURE__ */
|
|
8071
|
-
] }) : /* @__PURE__ */
|
|
8072
|
-
activeSlot && /* @__PURE__ */
|
|
8073
|
-
/* @__PURE__ */
|
|
8111
|
+
/* @__PURE__ */ jsxs71("div", { className: "ss-g-xi-picker", children: [
|
|
8112
|
+
/* @__PURE__ */ jsx83("div", { className: "ss-g-xi-picker-head", children: activeSlot ? /* @__PURE__ */ jsxs71(Fragment19, { children: [
|
|
8113
|
+
/* @__PURE__ */ jsx83(Chip, { variant: "badge", children: activeSlot.label }),
|
|
8114
|
+
/* @__PURE__ */ jsx83("strong", { children: t.pickFor(activeSlot.label) })
|
|
8115
|
+
] }) : /* @__PURE__ */ jsx83("strong", { children: t.allPicked }) }),
|
|
8116
|
+
activeSlot && /* @__PURE__ */ jsxs71(Fragment19, { children: [
|
|
8117
|
+
/* @__PURE__ */ jsx83(
|
|
8074
8118
|
SearchField,
|
|
8075
8119
|
{
|
|
8076
8120
|
id: searchId,
|
|
@@ -8082,18 +8126,18 @@ function StartingXiGame({
|
|
|
8082
8126
|
disabled: submitting
|
|
8083
8127
|
}
|
|
8084
8128
|
),
|
|
8085
|
-
/* @__PURE__ */
|
|
8086
|
-
/* @__PURE__ */
|
|
8087
|
-
/* @__PURE__ */
|
|
8088
|
-
/* @__PURE__ */
|
|
8129
|
+
/* @__PURE__ */ jsx83("ul", { className: "ss-g-xi-list", children: available.map((p) => /* @__PURE__ */ jsx83("li", { children: /* @__PURE__ */ jsxs71("button", { type: "button", className: "ss-g-xi-opt", disabled: submitting, onClick: () => pick(p.playerId), children: [
|
|
8130
|
+
/* @__PURE__ */ jsx83("span", { className: "ss-g-xi-opt-no", "aria-hidden": "true", children: p.jerseyNumber ?? "" }),
|
|
8131
|
+
/* @__PURE__ */ jsx83("span", { className: "ss-g-xi-opt-name", children: p.playerName }),
|
|
8132
|
+
/* @__PURE__ */ jsx83("span", { className: "ss-g-xi-opt-pos", children: p.positionName })
|
|
8089
8133
|
] }) }, p.playerId)) })
|
|
8090
8134
|
] })
|
|
8091
8135
|
] })
|
|
8092
8136
|
] }),
|
|
8093
|
-
/* @__PURE__ */
|
|
8094
|
-
/* @__PURE__ */
|
|
8095
|
-
/* @__PURE__ */
|
|
8096
|
-
/* @__PURE__ */
|
|
8137
|
+
/* @__PURE__ */ jsxs71(FooterBar, { children: [
|
|
8138
|
+
/* @__PURE__ */ jsx83(GameButton, { variant: "primary", block: true, disabled: !canSubmit, onClick: handleSubmit, children: submitting ? t.submitting : t.submit }),
|
|
8139
|
+
/* @__PURE__ */ jsxs71("p", { className: "ss-g-xi-lock", children: [
|
|
8140
|
+
/* @__PURE__ */ jsx83(IconLock, {}),
|
|
8097
8141
|
lockAtUtc ? t.locksAt(ui.games.formatDayTime(lockAtUtc)) : t.locksSoon
|
|
8098
8142
|
] })
|
|
8099
8143
|
] })
|
|
@@ -8102,7 +8146,7 @@ function StartingXiGame({
|
|
|
8102
8146
|
|
|
8103
8147
|
// src/components/games/StatLadderGame.tsx
|
|
8104
8148
|
import { useId as useId8, useState as useState37 } from "react";
|
|
8105
|
-
import { jsx as
|
|
8149
|
+
import { jsx as jsx84, jsxs as jsxs72 } from "react/jsx-runtime";
|
|
8106
8150
|
function ladderClue(ladder) {
|
|
8107
8151
|
const mystery = ladder.find((r) => r.rank === 2);
|
|
8108
8152
|
if (!mystery) return null;
|
|
@@ -8124,9 +8168,9 @@ function parseClientState9(json) {
|
|
|
8124
8168
|
}
|
|
8125
8169
|
function NameStack({ name }) {
|
|
8126
8170
|
const { first, last } = splitName(name);
|
|
8127
|
-
return /* @__PURE__ */
|
|
8128
|
-
first && /* @__PURE__ */
|
|
8129
|
-
/* @__PURE__ */
|
|
8171
|
+
return /* @__PURE__ */ jsxs72("span", { className: "ss-g-sl-name", children: [
|
|
8172
|
+
first && /* @__PURE__ */ jsx84("small", { children: `${first[0]}.` }),
|
|
8173
|
+
/* @__PURE__ */ jsx84("b", { children: last })
|
|
8130
8174
|
] });
|
|
8131
8175
|
}
|
|
8132
8176
|
function StatLadderGame({
|
|
@@ -8143,11 +8187,11 @@ function StatLadderGame({
|
|
|
8143
8187
|
const searchId = useId8();
|
|
8144
8188
|
const clientState = parseClientState9(result?.clientStateJson);
|
|
8145
8189
|
const revealed = clientState != null;
|
|
8146
|
-
const header = /* @__PURE__ */
|
|
8190
|
+
const header = /* @__PURE__ */ jsx84(GameHeader, { title: gameTitle({ gameId: "stat-ladder" }, ui.games.titles), eyebrow: t.eyebrow, onBack, backLabel: ui.back });
|
|
8147
8191
|
if (!config) {
|
|
8148
|
-
return /* @__PURE__ */
|
|
8192
|
+
return /* @__PURE__ */ jsxs72("div", { className: "ss-g-screen", "data-game": "stat-ladder", "data-testid": "game-screen-stat-ladder", children: [
|
|
8149
8193
|
header,
|
|
8150
|
-
/* @__PURE__ */
|
|
8194
|
+
/* @__PURE__ */ jsx84("div", { className: "ss-g-body ss-g-loading", children: ui.games.loading })
|
|
8151
8195
|
] });
|
|
8152
8196
|
}
|
|
8153
8197
|
const question = t.question(config.statLabel);
|
|
@@ -8159,44 +8203,45 @@ function StatLadderGame({
|
|
|
8159
8203
|
if (selectedId === null || submitting || revealed) return;
|
|
8160
8204
|
onSubmit(JSON.stringify({ guessedPlayerId: selectedId }));
|
|
8161
8205
|
}
|
|
8162
|
-
return /* @__PURE__ */
|
|
8206
|
+
return /* @__PURE__ */ jsxs72("div", { className: "ss-g-screen", "data-game": "stat-ladder", "data-testid": "game-screen-stat-ladder", children: [
|
|
8163
8207
|
header,
|
|
8164
|
-
/* @__PURE__ */
|
|
8165
|
-
/* @__PURE__ */
|
|
8166
|
-
|
|
8167
|
-
/* @__PURE__ */
|
|
8208
|
+
/* @__PURE__ */ jsxs72("div", { className: "ss-g-body", children: [
|
|
8209
|
+
!revealed && /* @__PURE__ */ jsx84(PointsLadderRow, { ladder: config.pointsLadder, guessesUsed: 0, ui }),
|
|
8210
|
+
/* @__PURE__ */ jsxs72("div", { className: "ss-g-sl-prompt", children: [
|
|
8211
|
+
/* @__PURE__ */ jsx84(Chip, { variant: "accent", icon: /* @__PURE__ */ jsx84(IconShield, { size: 14 }), className: "ss-g-sl-stat", children: config.statLabel }),
|
|
8212
|
+
/* @__PURE__ */ jsxs72("h3", { className: "ss-g-sl-q", children: [
|
|
8168
8213
|
question.pre,
|
|
8169
|
-
/* @__PURE__ */
|
|
8214
|
+
/* @__PURE__ */ jsx84("em", { children: question.emph }),
|
|
8170
8215
|
question.post
|
|
8171
8216
|
] })
|
|
8172
8217
|
] }),
|
|
8173
|
-
/* @__PURE__ */
|
|
8174
|
-
(rung) => rung.rank === 2 ? /* @__PURE__ */
|
|
8218
|
+
/* @__PURE__ */ jsx84("ol", { className: "ss-g-sl-rungs", children: rungs.map(
|
|
8219
|
+
(rung) => rung.rank === 2 ? /* @__PURE__ */ jsxs72(
|
|
8175
8220
|
"li",
|
|
8176
8221
|
{
|
|
8177
8222
|
className: "ss-g-sl-rung ss-g-sl-rung--mystery",
|
|
8178
8223
|
"data-testid": "sl-mystery-rung",
|
|
8179
8224
|
"data-result": revealed ? clientState.isCorrect ? "correct" : "wrong" : void 0,
|
|
8180
8225
|
children: [
|
|
8181
|
-
/* @__PURE__ */
|
|
8182
|
-
revealed ? /* @__PURE__ */
|
|
8183
|
-
revealed ? /* @__PURE__ */
|
|
8184
|
-
/* @__PURE__ */
|
|
8226
|
+
/* @__PURE__ */ jsx84("span", { className: "ss-g-sl-rank", children: "2" }),
|
|
8227
|
+
revealed ? /* @__PURE__ */ jsx84(PlayerAvatar, { name: clientState.revealedRank2.playerName, className: "ss-g-sl-av" }) : /* @__PURE__ */ jsx84(Silhouette, { size: 52, variant: "mystery" }),
|
|
8228
|
+
revealed ? /* @__PURE__ */ jsx84(NameStack, { name: clientState.revealedRank2.playerName }) : /* @__PURE__ */ jsx84("span", { className: "ss-g-sl-who", children: t.whoSecond }),
|
|
8229
|
+
/* @__PURE__ */ jsx84("span", { className: "ss-g-sl-val ss-g-sl-val--mystery", children: rung.statValue })
|
|
8185
8230
|
]
|
|
8186
8231
|
},
|
|
8187
8232
|
rung.rank
|
|
8188
|
-
) : /* @__PURE__ */
|
|
8189
|
-
/* @__PURE__ */
|
|
8190
|
-
/* @__PURE__ */
|
|
8191
|
-
/* @__PURE__ */
|
|
8192
|
-
/* @__PURE__ */
|
|
8233
|
+
) : /* @__PURE__ */ jsxs72("li", { className: "ss-g-sl-rung", children: [
|
|
8234
|
+
/* @__PURE__ */ jsx84("span", { className: "ss-g-sl-rank", children: rung.rank }),
|
|
8235
|
+
/* @__PURE__ */ jsx84(PlayerAvatar, { name: rung.playerName ?? "?", className: "ss-g-sl-av" }),
|
|
8236
|
+
/* @__PURE__ */ jsx84(NameStack, { name: rung.playerName ?? "?" }),
|
|
8237
|
+
/* @__PURE__ */ jsx84("span", { className: "ss-g-sl-val", children: rung.statValue })
|
|
8193
8238
|
] }, rung.rank)
|
|
8194
8239
|
) }),
|
|
8195
|
-
clue && /* @__PURE__ */
|
|
8196
|
-
/* @__PURE__ */
|
|
8197
|
-
/* @__PURE__ */
|
|
8240
|
+
clue && /* @__PURE__ */ jsxs72("p", { className: "ss-g-sl-clue", children: [
|
|
8241
|
+
/* @__PURE__ */ jsx84(IconBulb, {}),
|
|
8242
|
+
/* @__PURE__ */ jsx84("span", { children: t.clue(clue, config.statLabel) })
|
|
8198
8243
|
] }),
|
|
8199
|
-
!revealed && /* @__PURE__ */
|
|
8244
|
+
!revealed && /* @__PURE__ */ jsx84("ul", { className: "ss-g-sl-pool", children: pool.map((p) => /* @__PURE__ */ jsx84("li", { children: /* @__PURE__ */ jsxs72(
|
|
8200
8245
|
"button",
|
|
8201
8246
|
{
|
|
8202
8247
|
type: "button",
|
|
@@ -8209,13 +8254,13 @@ function StatLadderGame({
|
|
|
8209
8254
|
setQuery(p.playerName);
|
|
8210
8255
|
},
|
|
8211
8256
|
children: [
|
|
8212
|
-
/* @__PURE__ */
|
|
8213
|
-
/* @__PURE__ */
|
|
8214
|
-
selectedId === p.playerId && /* @__PURE__ */
|
|
8257
|
+
/* @__PURE__ */ jsx84(PlayerAvatar, { name: p.playerName, className: "ss-g-sl-opt-av" }),
|
|
8258
|
+
/* @__PURE__ */ jsx84("span", { className: "ss-g-sl-opt-name", children: p.playerName }),
|
|
8259
|
+
selectedId === p.playerId && /* @__PURE__ */ jsx84(IconCheck, {})
|
|
8215
8260
|
]
|
|
8216
8261
|
}
|
|
8217
8262
|
) }, p.playerId)) }),
|
|
8218
|
-
revealed && /* @__PURE__ */
|
|
8263
|
+
revealed && /* @__PURE__ */ jsx84(
|
|
8219
8264
|
ResultCard,
|
|
8220
8265
|
{
|
|
8221
8266
|
tone: clientState.isCorrect ? "win" : "lose",
|
|
@@ -8226,8 +8271,8 @@ function StatLadderGame({
|
|
|
8226
8271
|
}
|
|
8227
8272
|
)
|
|
8228
8273
|
] }),
|
|
8229
|
-
!revealed && /* @__PURE__ */
|
|
8230
|
-
/* @__PURE__ */
|
|
8274
|
+
!revealed && /* @__PURE__ */ jsx84(FooterBar, { children: /* @__PURE__ */ jsxs72("div", { className: "ss-g-sl-guess", children: [
|
|
8275
|
+
/* @__PURE__ */ jsx84(
|
|
8231
8276
|
SearchField,
|
|
8232
8277
|
{
|
|
8233
8278
|
id: searchId,
|
|
@@ -8242,13 +8287,13 @@ function StatLadderGame({
|
|
|
8242
8287
|
disabled: submitting
|
|
8243
8288
|
}
|
|
8244
8289
|
),
|
|
8245
|
-
/* @__PURE__ */
|
|
8290
|
+
/* @__PURE__ */ jsx84(GameButton, { variant: "primary", disabled: selectedId === null || submitting, onClick: guess, children: t.guess })
|
|
8246
8291
|
] }) })
|
|
8247
8292
|
] });
|
|
8248
8293
|
}
|
|
8249
8294
|
|
|
8250
8295
|
// src/components/games/FanMotmGame.tsx
|
|
8251
|
-
import { jsx as
|
|
8296
|
+
import { jsx as jsx85, jsxs as jsxs73 } from "react/jsx-runtime";
|
|
8252
8297
|
function parseClientState10(json) {
|
|
8253
8298
|
if (!json) return null;
|
|
8254
8299
|
try {
|
|
@@ -8269,20 +8314,20 @@ function FanMotmGame({
|
|
|
8269
8314
|
const clientState = parseClientState10(result?.clientStateJson);
|
|
8270
8315
|
const alreadyVoted = result?.alreadyPlayed === true;
|
|
8271
8316
|
const pickedId = clientState?.pickedPlayerId ?? null;
|
|
8272
|
-
const header = /* @__PURE__ */
|
|
8317
|
+
const header = /* @__PURE__ */ jsx85(
|
|
8273
8318
|
GameHeader,
|
|
8274
8319
|
{
|
|
8275
8320
|
title: t.title,
|
|
8276
8321
|
eyebrow: t.eyebrow,
|
|
8277
|
-
right: alreadyVoted ? /* @__PURE__ */
|
|
8322
|
+
right: alreadyVoted ? /* @__PURE__ */ jsx85(Chip, { variant: "success", icon: /* @__PURE__ */ jsx85(IconCheck, {}), children: t.voted }) : void 0,
|
|
8278
8323
|
onBack,
|
|
8279
8324
|
backLabel: ui.back
|
|
8280
8325
|
}
|
|
8281
8326
|
);
|
|
8282
8327
|
if (!config) {
|
|
8283
|
-
return /* @__PURE__ */
|
|
8328
|
+
return /* @__PURE__ */ jsxs73("div", { className: "ss-g-screen", "data-game": "fan-motm", "data-testid": "game-screen-fan-motm", children: [
|
|
8284
8329
|
header,
|
|
8285
|
-
/* @__PURE__ */
|
|
8330
|
+
/* @__PURE__ */ jsx85("div", { className: "ss-g-body ss-g-loading", children: ui.games.loading })
|
|
8286
8331
|
] });
|
|
8287
8332
|
}
|
|
8288
8333
|
const picked = config.candidates.find((c) => c.playerId === pickedId) ?? null;
|
|
@@ -8290,12 +8335,12 @@ function FanMotmGame({
|
|
|
8290
8335
|
if (alreadyVoted || submitting) return;
|
|
8291
8336
|
onSubmit(JSON.stringify({ pickedPlayerId: candidateId }));
|
|
8292
8337
|
}
|
|
8293
|
-
return /* @__PURE__ */
|
|
8338
|
+
return /* @__PURE__ */ jsxs73("div", { className: "ss-g-screen", "data-game": "fan-motm", "data-testid": "game-screen-fan-motm", children: [
|
|
8294
8339
|
header,
|
|
8295
|
-
/* @__PURE__ */
|
|
8296
|
-
/* @__PURE__ */
|
|
8340
|
+
/* @__PURE__ */ jsxs73("div", { className: "ss-g-body", children: [
|
|
8341
|
+
/* @__PURE__ */ jsx85("ul", { className: "ss-g-motm-list", children: config.candidates.map((c) => {
|
|
8297
8342
|
const isVoted = alreadyVoted && pickedId === c.playerId;
|
|
8298
|
-
return /* @__PURE__ */
|
|
8343
|
+
return /* @__PURE__ */ jsx85("li", { children: /* @__PURE__ */ jsxs73(
|
|
8299
8344
|
"button",
|
|
8300
8345
|
{
|
|
8301
8346
|
type: "button",
|
|
@@ -8304,24 +8349,24 @@ function FanMotmGame({
|
|
|
8304
8349
|
disabled: alreadyVoted || submitting,
|
|
8305
8350
|
onClick: () => handleVote(c.playerId),
|
|
8306
8351
|
children: [
|
|
8307
|
-
/* @__PURE__ */
|
|
8308
|
-
/* @__PURE__ */
|
|
8309
|
-
isVoted && /* @__PURE__ */
|
|
8352
|
+
/* @__PURE__ */ jsx85(PlayerAvatar, { name: c.playerName, className: "ss-g-motm-av" }),
|
|
8353
|
+
/* @__PURE__ */ jsx85("span", { className: "ss-g-motm-name", children: c.playerName }),
|
|
8354
|
+
isVoted && /* @__PURE__ */ jsx85(Chip, { variant: "accent", className: "ss-g-motm-pill", children: t.yourVote })
|
|
8310
8355
|
]
|
|
8311
8356
|
}
|
|
8312
8357
|
) }, c.playerId);
|
|
8313
8358
|
}) }),
|
|
8314
|
-
alreadyVoted && picked && /* @__PURE__ */
|
|
8359
|
+
alreadyVoted && picked && /* @__PURE__ */ jsx85(ResultCard, { tone: "neutral", title: t.youVoted(picked.playerName), detail: t.thanks, onBack, ui })
|
|
8315
8360
|
] }),
|
|
8316
|
-
/* @__PURE__ */
|
|
8317
|
-
!alreadyVoted && /* @__PURE__ */
|
|
8318
|
-
/* @__PURE__ */
|
|
8361
|
+
/* @__PURE__ */ jsxs73(FooterBar, { children: [
|
|
8362
|
+
!alreadyVoted && /* @__PURE__ */ jsx85("p", { className: "ss-g-motm-foot", children: t.tapToVote }),
|
|
8363
|
+
/* @__PURE__ */ jsx85("p", { className: "ss-g-motm-fun", children: t.forFun })
|
|
8319
8364
|
] })
|
|
8320
8365
|
] });
|
|
8321
8366
|
}
|
|
8322
8367
|
|
|
8323
8368
|
// src/components/GameScreenHost.tsx
|
|
8324
|
-
import { jsx as
|
|
8369
|
+
import { jsx as jsx86 } from "react/jsx-runtime";
|
|
8325
8370
|
var FIXTURE_GAME_IDS = /* @__PURE__ */ new Set([
|
|
8326
8371
|
"matchday-predictor",
|
|
8327
8372
|
"starting-xi",
|
|
@@ -8397,7 +8442,7 @@ function GameScreenHost({
|
|
|
8397
8442
|
function renderScreen() {
|
|
8398
8443
|
switch (gameId) {
|
|
8399
8444
|
case "mystery-tiger":
|
|
8400
|
-
return /* @__PURE__ */
|
|
8445
|
+
return /* @__PURE__ */ jsx86(
|
|
8401
8446
|
MysteryTigerGame,
|
|
8402
8447
|
{
|
|
8403
8448
|
...sharedProps,
|
|
@@ -8405,7 +8450,7 @@ function GameScreenHost({
|
|
|
8405
8450
|
}
|
|
8406
8451
|
);
|
|
8407
8452
|
case "higher-or-lower":
|
|
8408
|
-
return /* @__PURE__ */
|
|
8453
|
+
return /* @__PURE__ */ jsx86(
|
|
8409
8454
|
HigherOrLowerGame,
|
|
8410
8455
|
{
|
|
8411
8456
|
...sharedProps,
|
|
@@ -8413,7 +8458,7 @@ function GameScreenHost({
|
|
|
8413
8458
|
}
|
|
8414
8459
|
);
|
|
8415
8460
|
case "career-path":
|
|
8416
|
-
return /* @__PURE__ */
|
|
8461
|
+
return /* @__PURE__ */ jsx86(
|
|
8417
8462
|
CareerPathGame,
|
|
8418
8463
|
{
|
|
8419
8464
|
...sharedProps,
|
|
@@ -8422,7 +8467,7 @@ function GameScreenHost({
|
|
|
8422
8467
|
);
|
|
8423
8468
|
case "beat-the-grid": {
|
|
8424
8469
|
const btgConfig = safeParseConfig(configJson);
|
|
8425
|
-
return /* @__PURE__ */
|
|
8470
|
+
return /* @__PURE__ */ jsx86(
|
|
8426
8471
|
BeatTheGridGame,
|
|
8427
8472
|
{
|
|
8428
8473
|
...sharedProps,
|
|
@@ -8432,7 +8477,7 @@ function GameScreenHost({
|
|
|
8432
8477
|
);
|
|
8433
8478
|
}
|
|
8434
8479
|
case "guess-the-xi":
|
|
8435
|
-
return /* @__PURE__ */
|
|
8480
|
+
return /* @__PURE__ */ jsx86(
|
|
8436
8481
|
GuessTheXiGame,
|
|
8437
8482
|
{
|
|
8438
8483
|
...sharedProps,
|
|
@@ -8440,7 +8485,7 @@ function GameScreenHost({
|
|
|
8440
8485
|
}
|
|
8441
8486
|
);
|
|
8442
8487
|
case "daily-quiz":
|
|
8443
|
-
return /* @__PURE__ */
|
|
8488
|
+
return /* @__PURE__ */ jsx86(
|
|
8444
8489
|
DailyQuizGame,
|
|
8445
8490
|
{
|
|
8446
8491
|
...sharedProps,
|
|
@@ -8448,7 +8493,7 @@ function GameScreenHost({
|
|
|
8448
8493
|
}
|
|
8449
8494
|
);
|
|
8450
8495
|
case "matchday-predictor":
|
|
8451
|
-
return /* @__PURE__ */
|
|
8496
|
+
return /* @__PURE__ */ jsx86(
|
|
8452
8497
|
MatchdayPredictorGame,
|
|
8453
8498
|
{
|
|
8454
8499
|
...sharedProps,
|
|
@@ -8456,7 +8501,7 @@ function GameScreenHost({
|
|
|
8456
8501
|
}
|
|
8457
8502
|
);
|
|
8458
8503
|
case "starting-xi":
|
|
8459
|
-
return /* @__PURE__ */
|
|
8504
|
+
return /* @__PURE__ */ jsx86(
|
|
8460
8505
|
StartingXiGame,
|
|
8461
8506
|
{
|
|
8462
8507
|
...sharedProps,
|
|
@@ -8464,7 +8509,7 @@ function GameScreenHost({
|
|
|
8464
8509
|
}
|
|
8465
8510
|
);
|
|
8466
8511
|
case "stat-ladder":
|
|
8467
|
-
return /* @__PURE__ */
|
|
8512
|
+
return /* @__PURE__ */ jsx86(
|
|
8468
8513
|
StatLadderGame,
|
|
8469
8514
|
{
|
|
8470
8515
|
...sharedProps,
|
|
@@ -8472,7 +8517,7 @@ function GameScreenHost({
|
|
|
8472
8517
|
}
|
|
8473
8518
|
);
|
|
8474
8519
|
case "fan-motm":
|
|
8475
|
-
return /* @__PURE__ */
|
|
8520
|
+
return /* @__PURE__ */ jsx86(
|
|
8476
8521
|
FanMotmGame,
|
|
8477
8522
|
{
|
|
8478
8523
|
...sharedProps,
|
|
@@ -8480,10 +8525,10 @@ function GameScreenHost({
|
|
|
8480
8525
|
}
|
|
8481
8526
|
);
|
|
8482
8527
|
default:
|
|
8483
|
-
return /* @__PURE__ */
|
|
8528
|
+
return /* @__PURE__ */ jsx86("div", { className: "ss-g-screen", "data-testid": `game-screen-${gameId}`, children: /* @__PURE__ */ jsx86(GameHeader, { title: gameTitle({ gameId }, ui.games.titles), onBack, backLabel: ui.back }) });
|
|
8484
8529
|
}
|
|
8485
8530
|
}
|
|
8486
|
-
return /* @__PURE__ */
|
|
8531
|
+
return /* @__PURE__ */ jsx86("div", { className: "ss-w-gscreen", "data-testid": "gscreen", "data-lock-at": lockAtUtc ?? void 0, children: renderScreen() });
|
|
8487
8532
|
}
|
|
8488
8533
|
|
|
8489
8534
|
// src/components/games/ui/fonts.ts
|
|
@@ -8500,7 +8545,7 @@ function ensureGamesFonts(doc = document) {
|
|
|
8500
8545
|
}
|
|
8501
8546
|
|
|
8502
8547
|
// src/components/GamesPanel.tsx
|
|
8503
|
-
import { jsx as
|
|
8548
|
+
import { jsx as jsx87 } from "react/jsx-runtime";
|
|
8504
8549
|
function GamesPanel({
|
|
8505
8550
|
loggedIn,
|
|
8506
8551
|
games,
|
|
@@ -8513,9 +8558,9 @@ function GamesPanel({
|
|
|
8513
8558
|
useEffect22(() => {
|
|
8514
8559
|
ensureGamesFonts();
|
|
8515
8560
|
}, []);
|
|
8516
|
-
if (!loggedIn) return /* @__PURE__ */
|
|
8561
|
+
if (!loggedIn) return /* @__PURE__ */ jsx87(GamesLoginWall, { ui });
|
|
8517
8562
|
if (selected !== null) {
|
|
8518
|
-
return /* @__PURE__ */
|
|
8563
|
+
return /* @__PURE__ */ jsx87("div", { className: "ss-w-gscreen-wrap", lang: ui.games.lang, children: /* @__PURE__ */ jsx87(
|
|
8519
8564
|
GameScreenHost,
|
|
8520
8565
|
{
|
|
8521
8566
|
selected,
|
|
@@ -8529,7 +8574,7 @@ function GamesPanel({
|
|
|
8529
8574
|
}
|
|
8530
8575
|
) });
|
|
8531
8576
|
}
|
|
8532
|
-
return /* @__PURE__ */
|
|
8577
|
+
return /* @__PURE__ */ jsx87("div", { className: "ss-g-hub-wrap", "data-testid": "games-hub", lang: ui.games.lang, children: /* @__PURE__ */ jsx87(
|
|
8533
8578
|
GamesHub,
|
|
8534
8579
|
{
|
|
8535
8580
|
games,
|
|
@@ -8544,7 +8589,7 @@ function GamesPanel({
|
|
|
8544
8589
|
import { useState as useState40 } from "react";
|
|
8545
8590
|
|
|
8546
8591
|
// src/components/LeaderboardRow.tsx
|
|
8547
|
-
import { jsx as
|
|
8592
|
+
import { jsx as jsx88, jsxs as jsxs74 } from "react/jsx-runtime";
|
|
8548
8593
|
function formatPoints(n) {
|
|
8549
8594
|
return n.toLocaleString("en");
|
|
8550
8595
|
}
|
|
@@ -8553,14 +8598,14 @@ function LeaderboardWeeklyRow({
|
|
|
8553
8598
|
isMe
|
|
8554
8599
|
}) {
|
|
8555
8600
|
const rankClass = `ss-w-lb2-rank${row.rank <= 3 ? " ss-w-lb2-rank--top3" : ""}`;
|
|
8556
|
-
return /* @__PURE__ */
|
|
8557
|
-
/* @__PURE__ */
|
|
8601
|
+
return /* @__PURE__ */ jsxs74("div", { className: `ss-w-lb2-row${isMe ? " ss-w-lb2-row--you" : ""}`, children: [
|
|
8602
|
+
/* @__PURE__ */ jsxs74("span", { className: rankClass, children: [
|
|
8558
8603
|
"#",
|
|
8559
8604
|
row.rank
|
|
8560
8605
|
] }),
|
|
8561
|
-
/* @__PURE__ */
|
|
8562
|
-
/* @__PURE__ */
|
|
8563
|
-
row.currentStreak > 0 && /* @__PURE__ */
|
|
8606
|
+
/* @__PURE__ */ jsx88("span", { className: "ss-w-lb2-handle", children: row.handle }),
|
|
8607
|
+
/* @__PURE__ */ jsx88("span", { className: "ss-w-lb2-points", children: formatPoints(row.points) }),
|
|
8608
|
+
row.currentStreak > 0 && /* @__PURE__ */ jsxs74("span", { className: "ss-w-lb2-streak", children: [
|
|
8564
8609
|
"\u{1F525} ",
|
|
8565
8610
|
row.currentStreak
|
|
8566
8611
|
] })
|
|
@@ -8571,18 +8616,18 @@ function LeaderboardAllTimeRow({
|
|
|
8571
8616
|
isMe
|
|
8572
8617
|
}) {
|
|
8573
8618
|
const rankClass = `ss-w-lb2-rank${row.rank <= 3 ? " ss-w-lb2-rank--top3" : ""}`;
|
|
8574
|
-
return /* @__PURE__ */
|
|
8575
|
-
/* @__PURE__ */
|
|
8619
|
+
return /* @__PURE__ */ jsxs74("div", { className: `ss-w-lb2-row${isMe ? " ss-w-lb2-row--you" : ""}`, children: [
|
|
8620
|
+
/* @__PURE__ */ jsxs74("span", { className: rankClass, children: [
|
|
8576
8621
|
"#",
|
|
8577
8622
|
row.rank
|
|
8578
8623
|
] }),
|
|
8579
|
-
/* @__PURE__ */
|
|
8580
|
-
/* @__PURE__ */
|
|
8624
|
+
/* @__PURE__ */ jsx88("span", { className: "ss-w-lb2-handle", children: row.handle }),
|
|
8625
|
+
/* @__PURE__ */ jsx88("span", { className: "ss-w-lb2-points", children: formatPoints(row.allTimePoints) })
|
|
8581
8626
|
] });
|
|
8582
8627
|
}
|
|
8583
8628
|
|
|
8584
8629
|
// src/components/LeaderboardEmpty.tsx
|
|
8585
|
-
import { jsx as
|
|
8630
|
+
import { jsx as jsx89, jsxs as jsxs75 } from "react/jsx-runtime";
|
|
8586
8631
|
function LeaderboardEmpty({
|
|
8587
8632
|
segment,
|
|
8588
8633
|
lastWeek,
|
|
@@ -8591,36 +8636,36 @@ function LeaderboardEmpty({
|
|
|
8591
8636
|
ui
|
|
8592
8637
|
}) {
|
|
8593
8638
|
if (segment === "alltime") {
|
|
8594
|
-
return /* @__PURE__ */
|
|
8595
|
-
/* @__PURE__ */
|
|
8596
|
-
/* @__PURE__ */
|
|
8639
|
+
return /* @__PURE__ */ jsxs75("div", { className: "ss-w-lb-empty ss-w-lb-empty--alltime", children: [
|
|
8640
|
+
/* @__PURE__ */ jsx89("div", { className: "ss-w-lb-empty-icon", "aria-hidden": "true", children: "\u{1F4CA}" }),
|
|
8641
|
+
/* @__PURE__ */ jsx89("p", { className: "ss-w-lb-empty-body", children: ui.leaderboardAllTimeEmpty })
|
|
8597
8642
|
] });
|
|
8598
8643
|
}
|
|
8599
8644
|
const fresh = lastWeek != null;
|
|
8600
8645
|
const title = fresh ? ui.leaderboardEmptyFreshTitle : ui.leaderboardEmptyColdTitle;
|
|
8601
8646
|
const body = fresh ? ui.leaderboardEmptyFreshBody : ui.leaderboardEmptyColdBody;
|
|
8602
|
-
return /* @__PURE__ */
|
|
8603
|
-
weeklyPrize && /* @__PURE__ */
|
|
8604
|
-
/* @__PURE__ */
|
|
8605
|
-
/* @__PURE__ */
|
|
8647
|
+
return /* @__PURE__ */ jsxs75("div", { className: "ss-w-lb-empty", children: [
|
|
8648
|
+
weeklyPrize && /* @__PURE__ */ jsxs75("div", { className: "ss-w-prize", children: [
|
|
8649
|
+
/* @__PURE__ */ jsx89("span", { className: "ss-w-prize-icon", "aria-hidden": "true", children: "\u{1F3C6}" }),
|
|
8650
|
+
/* @__PURE__ */ jsx89("div", { className: "ss-w-prize-body", children: /* @__PURE__ */ jsx89("span", { className: "ss-w-prize-text", children: weeklyPrize }) })
|
|
8606
8651
|
] }),
|
|
8607
|
-
/* @__PURE__ */
|
|
8608
|
-
/* @__PURE__ */
|
|
8609
|
-
/* @__PURE__ */
|
|
8610
|
-
/* @__PURE__ */
|
|
8611
|
-
onPlay && /* @__PURE__ */
|
|
8652
|
+
/* @__PURE__ */ jsxs75("div", { className: "ss-w-lb-empty-hero", children: [
|
|
8653
|
+
/* @__PURE__ */ jsx89("div", { className: "ss-w-lb-empty-icon", "aria-hidden": "true", children: fresh ? "\u{1F3C6}" : "\u{1F3AE}" }),
|
|
8654
|
+
/* @__PURE__ */ jsx89("h4", { className: "ss-w-lb-empty-title", children: title }),
|
|
8655
|
+
/* @__PURE__ */ jsx89("p", { className: "ss-w-lb-empty-body", children: body }),
|
|
8656
|
+
onPlay && /* @__PURE__ */ jsx89("button", { type: "button", className: "ss-w-lb-empty-cta", onClick: onPlay, children: ui.leaderboardEmptyCta })
|
|
8612
8657
|
] }),
|
|
8613
|
-
fresh && lastWeek && /* @__PURE__ */
|
|
8614
|
-
/* @__PURE__ */
|
|
8615
|
-
/* @__PURE__ */
|
|
8616
|
-
/* @__PURE__ */
|
|
8617
|
-
/* @__PURE__ */
|
|
8658
|
+
fresh && lastWeek && /* @__PURE__ */ jsxs75("div", { className: "ss-w-lb-last", children: [
|
|
8659
|
+
/* @__PURE__ */ jsx89("span", { className: "ss-w-lb-last-label", children: ui.leaderboardLastWeekLabel }),
|
|
8660
|
+
/* @__PURE__ */ jsx89("span", { className: "ss-w-lb-last-champ", "aria-hidden": "true", children: "\u{1F947}" }),
|
|
8661
|
+
/* @__PURE__ */ jsx89("span", { className: "ss-w-lb-last-handle", children: lastWeek.handle }),
|
|
8662
|
+
/* @__PURE__ */ jsx89("span", { className: "ss-w-lb-last-points", children: formatPoints(lastWeek.points) })
|
|
8618
8663
|
] })
|
|
8619
8664
|
] });
|
|
8620
8665
|
}
|
|
8621
8666
|
|
|
8622
8667
|
// src/components/Leaderboard.tsx
|
|
8623
|
-
import { Fragment as
|
|
8668
|
+
import { Fragment as Fragment20, jsx as jsx90, jsxs as jsxs76 } from "react/jsx-runtime";
|
|
8624
8669
|
function Leaderboard({
|
|
8625
8670
|
data,
|
|
8626
8671
|
ui,
|
|
@@ -8630,9 +8675,9 @@ function Leaderboard({
|
|
|
8630
8675
|
const myRow = segment === "weekly" ? data.myWeeklyRow : data.myAllTimeRow;
|
|
8631
8676
|
const offBoard = myRow !== null && myRow !== void 0 && myRow.rank === -1;
|
|
8632
8677
|
const isEmpty = segment === "weekly" ? data.weeklyTop.length === 0 : data.allTimeTop.length === 0;
|
|
8633
|
-
return /* @__PURE__ */
|
|
8634
|
-
/* @__PURE__ */
|
|
8635
|
-
/* @__PURE__ */
|
|
8678
|
+
return /* @__PURE__ */ jsxs76("div", { className: "ss-w-lb2", children: [
|
|
8679
|
+
/* @__PURE__ */ jsxs76("div", { className: "ss-w-seg", children: [
|
|
8680
|
+
/* @__PURE__ */ jsx90(
|
|
8636
8681
|
"button",
|
|
8637
8682
|
{
|
|
8638
8683
|
type: "button",
|
|
@@ -8642,7 +8687,7 @@ function Leaderboard({
|
|
|
8642
8687
|
children: ui.leaderboardThisWeek
|
|
8643
8688
|
}
|
|
8644
8689
|
),
|
|
8645
|
-
/* @__PURE__ */
|
|
8690
|
+
/* @__PURE__ */ jsx90(
|
|
8646
8691
|
"button",
|
|
8647
8692
|
{
|
|
8648
8693
|
type: "button",
|
|
@@ -8653,7 +8698,7 @@ function Leaderboard({
|
|
|
8653
8698
|
}
|
|
8654
8699
|
)
|
|
8655
8700
|
] }),
|
|
8656
|
-
isEmpty ? /* @__PURE__ */
|
|
8701
|
+
isEmpty ? /* @__PURE__ */ jsx90(
|
|
8657
8702
|
LeaderboardEmpty,
|
|
8658
8703
|
{
|
|
8659
8704
|
segment,
|
|
@@ -8662,15 +8707,15 @@ function Leaderboard({
|
|
|
8662
8707
|
onPlay,
|
|
8663
8708
|
ui
|
|
8664
8709
|
}
|
|
8665
|
-
) : /* @__PURE__ */
|
|
8666
|
-
/* @__PURE__ */
|
|
8710
|
+
) : /* @__PURE__ */ jsxs76(Fragment20, { children: [
|
|
8711
|
+
/* @__PURE__ */ jsx90("div", { className: "ss-w-lb2-rows", children: segment === "weekly" ? data.weeklyTop.map((row) => /* @__PURE__ */ jsx90(
|
|
8667
8712
|
LeaderboardWeeklyRow,
|
|
8668
8713
|
{
|
|
8669
8714
|
row,
|
|
8670
8715
|
isMe: row.operatorUserId === data.myWeeklyRow?.operatorUserId
|
|
8671
8716
|
},
|
|
8672
8717
|
row.operatorUserId
|
|
8673
|
-
)) : data.allTimeTop.map((row) => /* @__PURE__ */
|
|
8718
|
+
)) : data.allTimeTop.map((row) => /* @__PURE__ */ jsx90(
|
|
8674
8719
|
LeaderboardAllTimeRow,
|
|
8675
8720
|
{
|
|
8676
8721
|
row,
|
|
@@ -8678,18 +8723,18 @@ function Leaderboard({
|
|
|
8678
8723
|
},
|
|
8679
8724
|
row.operatorUserId
|
|
8680
8725
|
)) }),
|
|
8681
|
-
/* @__PURE__ */
|
|
8682
|
-
myRow != null && (offBoard ? /* @__PURE__ */
|
|
8683
|
-
segment === "weekly" && data.myWeeklyRow && /* @__PURE__ */
|
|
8684
|
-
segment === "alltime" && data.myAllTimeRow && /* @__PURE__ */
|
|
8726
|
+
/* @__PURE__ */ jsx90("div", { className: "ss-w-kitline", children: "\u{1F3BD}" }),
|
|
8727
|
+
myRow != null && (offBoard ? /* @__PURE__ */ jsx90("div", { className: "ss-w-lbgap", children: ui.leaderboardOffBoard }) : /* @__PURE__ */ jsxs76("div", { className: "ss-w-lb2-rows", children: [
|
|
8728
|
+
segment === "weekly" && data.myWeeklyRow && /* @__PURE__ */ jsx90(LeaderboardWeeklyRow, { row: data.myWeeklyRow, isMe: true }),
|
|
8729
|
+
segment === "alltime" && data.myAllTimeRow && /* @__PURE__ */ jsx90(LeaderboardAllTimeRow, { row: data.myAllTimeRow, isMe: true })
|
|
8685
8730
|
] })),
|
|
8686
|
-
segment === "alltime" && data.myAllTimeRow && !offBoard && /* @__PURE__ */
|
|
8731
|
+
segment === "alltime" && data.myAllTimeRow && !offBoard && /* @__PURE__ */ jsx90("div", { className: "ss-w-lb2-rows", children: /* @__PURE__ */ jsx90("div", { className: "ss-w-lb2-row", children: /* @__PURE__ */ jsx90("span", { className: "ss-w-lb2-handle", children: formatPoints(data.allTimeTop.reduce((s, r) => s + r.allTimePoints, 0)) }) }) })
|
|
8687
8732
|
] })
|
|
8688
8733
|
] });
|
|
8689
8734
|
}
|
|
8690
8735
|
|
|
8691
8736
|
// src/components/LeaderboardPanel.tsx
|
|
8692
|
-
import { jsx as
|
|
8737
|
+
import { jsx as jsx91 } from "react/jsx-runtime";
|
|
8693
8738
|
var EMPTY_PAYLOAD = {
|
|
8694
8739
|
week: "",
|
|
8695
8740
|
weeklyTop: [],
|
|
@@ -8700,19 +8745,19 @@ var EMPTY_PAYLOAD = {
|
|
|
8700
8745
|
lastWeek: null
|
|
8701
8746
|
};
|
|
8702
8747
|
function LeaderboardPanel({ loggedIn, data, loading, onPlay, ui }) {
|
|
8703
|
-
if (!loggedIn) return /* @__PURE__ */
|
|
8704
|
-
if (data === null && loading) return /* @__PURE__ */
|
|
8705
|
-
return /* @__PURE__ */
|
|
8748
|
+
if (!loggedIn) return /* @__PURE__ */ jsx91(GamesLoginWall, { ui });
|
|
8749
|
+
if (data === null && loading) return /* @__PURE__ */ jsx91("div", { className: "ss-w-mon-list" });
|
|
8750
|
+
return /* @__PURE__ */ jsx91("div", { className: "ss-w-mon-list", children: /* @__PURE__ */ jsx91(Leaderboard, { data: data ?? EMPTY_PAYLOAD, ui, onPlay }) });
|
|
8706
8751
|
}
|
|
8707
8752
|
|
|
8708
8753
|
// src/components/PresetSpeedDial.tsx
|
|
8709
8754
|
import { useId as useId9 } from "react";
|
|
8710
|
-
import { jsx as
|
|
8755
|
+
import { jsx as jsx92, jsxs as jsxs77 } from "react/jsx-runtime";
|
|
8711
8756
|
function PresetSpeedDial({ expanded, showDot, strings, onToggle, onOpen, rootRef, buttonRef }) {
|
|
8712
8757
|
const pillsId = useId9();
|
|
8713
8758
|
const tabIndex = expanded ? 0 : -1;
|
|
8714
|
-
return /* @__PURE__ */
|
|
8715
|
-
/* @__PURE__ */
|
|
8759
|
+
return /* @__PURE__ */ jsxs77("div", { ref: rootRef, className: "ss-w-dial", children: [
|
|
8760
|
+
/* @__PURE__ */ jsxs77(
|
|
8716
8761
|
"button",
|
|
8717
8762
|
{
|
|
8718
8763
|
ref: buttonRef,
|
|
@@ -8723,28 +8768,28 @@ function PresetSpeedDial({ expanded, showDot, strings, onToggle, onOpen, rootRef
|
|
|
8723
8768
|
"aria-label": strings.dialName,
|
|
8724
8769
|
onClick: onToggle,
|
|
8725
8770
|
children: [
|
|
8726
|
-
/* @__PURE__ */
|
|
8727
|
-
/* @__PURE__ */
|
|
8728
|
-
showDot && !expanded ? /* @__PURE__ */
|
|
8771
|
+
/* @__PURE__ */ jsx92("span", { className: "ss-w-dial-icon ss-w-dial-icon--open", children: /* @__PURE__ */ jsx92(SlidersIcon, {}) }),
|
|
8772
|
+
/* @__PURE__ */ jsx92("span", { className: "ss-w-dial-icon ss-w-dial-icon--close", children: /* @__PURE__ */ jsx92(CloseIcon, {}) }),
|
|
8773
|
+
showDot && !expanded ? /* @__PURE__ */ jsx92("span", { className: "ss-w-dial-dot", "aria-hidden": "true" }) : null
|
|
8729
8774
|
]
|
|
8730
8775
|
}
|
|
8731
8776
|
),
|
|
8732
|
-
/* @__PURE__ */
|
|
8733
|
-
/* @__PURE__ */
|
|
8734
|
-
/* @__PURE__ */
|
|
8735
|
-
/* @__PURE__ */
|
|
8777
|
+
/* @__PURE__ */ jsxs77("div", { id: pillsId, className: "ss-w-dial-pills", "data-open": expanded ? "" : void 0, children: [
|
|
8778
|
+
/* @__PURE__ */ jsxs77("button", { type: "button", className: "ss-w-dial-pill", tabIndex, onClick: () => onOpen("numbers"), children: [
|
|
8779
|
+
/* @__PURE__ */ jsx92(SlidersIcon, {}),
|
|
8780
|
+
/* @__PURE__ */ jsx92("span", { className: "ss-w-dial-pill-label", children: strings.setNumbers })
|
|
8736
8781
|
] }),
|
|
8737
|
-
/* @__PURE__ */
|
|
8738
|
-
/* @__PURE__ */
|
|
8739
|
-
/* @__PURE__ */
|
|
8782
|
+
/* @__PURE__ */ jsxs77("button", { type: "button", className: "ss-w-dial-pill", tabIndex, onClick: () => onOpen("combo"), children: [
|
|
8783
|
+
/* @__PURE__ */ jsx92(ComboIcon, {}),
|
|
8784
|
+
/* @__PURE__ */ jsx92("span", { className: "ss-w-dial-pill-label", children: strings.buildCombo })
|
|
8740
8785
|
] })
|
|
8741
8786
|
] })
|
|
8742
8787
|
] });
|
|
8743
8788
|
}
|
|
8744
8789
|
|
|
8745
8790
|
// src/components/PresetTools.tsx
|
|
8746
|
-
import { Fragment as
|
|
8747
|
-
import { Fragment as
|
|
8791
|
+
import { Fragment as Fragment21, useEffect as useEffect23, useId as useId10, useRef as useRef19, useState as useState41 } from "react";
|
|
8792
|
+
import { Fragment as Fragment22, jsx as jsx93, jsxs as jsxs78 } from "react/jsx-runtime";
|
|
8748
8793
|
var FOCUSABLE = 'button:not([disabled]), [href], input:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
8749
8794
|
function PresetToolModal({ title, closeLabel, onClose, children, footer }) {
|
|
8750
8795
|
const dialogRef = useRef19(null);
|
|
@@ -8782,79 +8827,79 @@ function PresetToolModal({ title, closeLabel, onClose, children, footer }) {
|
|
|
8782
8827
|
first.focus();
|
|
8783
8828
|
}
|
|
8784
8829
|
};
|
|
8785
|
-
return /* @__PURE__ */
|
|
8786
|
-
/* @__PURE__ */
|
|
8787
|
-
/* @__PURE__ */
|
|
8788
|
-
/* @__PURE__ */
|
|
8830
|
+
return /* @__PURE__ */ jsx93("div", { className: "ss-w-tool-backdrop", children: /* @__PURE__ */ jsxs78("div", { ref: dialogRef, className: "ss-w-tool", role: "dialog", "aria-modal": "true", "aria-labelledby": titleId, tabIndex: -1, onKeyDown: trapTab, children: [
|
|
8831
|
+
/* @__PURE__ */ jsxs78("div", { className: "ss-w-tool-head", children: [
|
|
8832
|
+
/* @__PURE__ */ jsx93("h2", { id: titleId, className: "ss-w-tool-title", children: title }),
|
|
8833
|
+
/* @__PURE__ */ jsx93("button", { type: "button", className: "ss-w-tool-close", "aria-label": closeLabel, onClick: onClose, children: /* @__PURE__ */ jsx93(CloseIcon, {}) })
|
|
8789
8834
|
] }),
|
|
8790
|
-
/* @__PURE__ */
|
|
8791
|
-
footer ? /* @__PURE__ */
|
|
8835
|
+
/* @__PURE__ */ jsx93("div", { className: "ss-w-tool-body", children }),
|
|
8836
|
+
footer ? /* @__PURE__ */ jsx93("div", { className: "ss-w-tool-foot", children: footer }) : null
|
|
8792
8837
|
] }) });
|
|
8793
8838
|
}
|
|
8794
8839
|
function fillTemplate(template, slots) {
|
|
8795
8840
|
return template.split(/(\{[a-z]+\})/).filter((part) => part !== "").map((part, i) => {
|
|
8796
8841
|
const key = /^\{([a-z]+)\}$/.exec(part)?.[1];
|
|
8797
|
-
return /* @__PURE__ */
|
|
8842
|
+
return /* @__PURE__ */ jsx93(Fragment21, { children: key !== void 0 && key in slots ? slots[key] : part }, i);
|
|
8798
8843
|
});
|
|
8799
8844
|
}
|
|
8800
8845
|
function NumberSelect({ current, choices: choices2, label, notToday, lockEmpty = true, onChoose }) {
|
|
8801
8846
|
const selected = Math.max(0, choices2.findIndex((c) => c.text === current));
|
|
8802
|
-
return /* @__PURE__ */
|
|
8803
|
-
/* @__PURE__ */
|
|
8804
|
-
/* @__PURE__ */
|
|
8847
|
+
return /* @__PURE__ */ jsxs78("span", { className: "ss-w-tool-num", children: [
|
|
8848
|
+
/* @__PURE__ */ jsx93("span", { className: "ss-w-tool-num-size", "aria-hidden": "true", children: current }),
|
|
8849
|
+
/* @__PURE__ */ jsx93("select", { className: "ss-w-tool-num-select", "aria-label": label, value: String(selected), onChange: (e) => {
|
|
8805
8850
|
const c = choices2[Number(e.target.value)];
|
|
8806
8851
|
if (c) onChoose(c.value);
|
|
8807
|
-
}, children: choices2.map((c, i) => /* @__PURE__ */
|
|
8852
|
+
}, children: choices2.map((c, i) => /* @__PURE__ */ jsx93("option", { value: String(i), disabled: lockEmpty && !c.available && i !== selected, children: c.available ? c.text : `${c.text}${notToday}` }, i)) })
|
|
8808
8853
|
] });
|
|
8809
8854
|
}
|
|
8810
8855
|
function ChoiceSelect({ currentIdx, sizeLabels, optionLabels, label, onChoose }) {
|
|
8811
8856
|
const sizeText = sizeLabels[currentIdx] ?? "";
|
|
8812
|
-
return /* @__PURE__ */
|
|
8813
|
-
/* @__PURE__ */
|
|
8814
|
-
/* @__PURE__ */
|
|
8857
|
+
return /* @__PURE__ */ jsxs78("span", { className: "ss-w-tool-num", children: [
|
|
8858
|
+
/* @__PURE__ */ jsx93("span", { className: "ss-w-tool-num-size", "aria-hidden": "true", children: sizeText }),
|
|
8859
|
+
/* @__PURE__ */ jsx93("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__ */ jsx93("option", { value: String(i), children: opt }, i)) })
|
|
8815
8860
|
] });
|
|
8816
8861
|
}
|
|
8817
8862
|
function SendButton({ label, display, disabled, onClick }) {
|
|
8818
|
-
return /* @__PURE__ */
|
|
8863
|
+
return /* @__PURE__ */ jsx93("button", { type: "button", className: "ss-w-tool-send", "aria-label": `${label}: ${display}`, disabled, onClick, children: label });
|
|
8819
8864
|
}
|
|
8820
8865
|
function PickList({ picks, formatKickoff }) {
|
|
8821
|
-
return /* @__PURE__ */
|
|
8822
|
-
/* @__PURE__ */
|
|
8866
|
+
return /* @__PURE__ */ jsx93("ul", { className: "ss-w-tool-picks", role: "list", children: picks.map((p) => /* @__PURE__ */ jsxs78("li", { className: "ss-w-tool-pick", children: [
|
|
8867
|
+
/* @__PURE__ */ jsxs78("span", { className: "ss-w-tool-pick-match", children: [
|
|
8823
8868
|
p.homeTeamName,
|
|
8824
8869
|
" \u2013 ",
|
|
8825
8870
|
p.awayTeamName
|
|
8826
8871
|
] }),
|
|
8827
|
-
/* @__PURE__ */
|
|
8872
|
+
/* @__PURE__ */ jsxs78("span", { className: "ss-w-tool-pick-sel", children: [
|
|
8828
8873
|
p.marketLabel,
|
|
8829
8874
|
": ",
|
|
8830
8875
|
p.selectionLabel,
|
|
8831
8876
|
p.line ? ` ${p.line}` : ""
|
|
8832
8877
|
] }),
|
|
8833
|
-
/* @__PURE__ */
|
|
8834
|
-
/* @__PURE__ */
|
|
8878
|
+
/* @__PURE__ */ jsx93("span", { className: "ss-w-tool-pick-kick", children: formatKickoff(p.kickoffUtc) }),
|
|
8879
|
+
/* @__PURE__ */ jsx93("span", { className: "ss-w-tool-pick-price", children: p.price.toFixed(2) })
|
|
8835
8880
|
] }, p.matchOddsId)) });
|
|
8836
8881
|
}
|
|
8837
8882
|
function ComboPreview({ cell, formatKickoff }) {
|
|
8838
|
-
return /* @__PURE__ */
|
|
8839
|
-
/* @__PURE__ */
|
|
8840
|
-
/* @__PURE__ */
|
|
8883
|
+
return /* @__PURE__ */ jsxs78(Fragment22, { children: [
|
|
8884
|
+
/* @__PURE__ */ jsx93(PickList, { picks: cell.combo.legs, formatKickoff }),
|
|
8885
|
+
/* @__PURE__ */ jsx93("div", { className: "ss-w-tool-math", children: cell.combo.multiplication })
|
|
8841
8886
|
] });
|
|
8842
8887
|
}
|
|
8843
8888
|
function Unavailable({ text }) {
|
|
8844
|
-
return /* @__PURE__ */
|
|
8889
|
+
return /* @__PURE__ */ jsx93("p", { className: "ss-w-tool-unavailable", children: text });
|
|
8845
8890
|
}
|
|
8846
8891
|
function AskRow({ icon, ask, ready, send }) {
|
|
8847
|
-
return /* @__PURE__ */
|
|
8848
|
-
/* @__PURE__ */
|
|
8849
|
-
/* @__PURE__ */
|
|
8850
|
-
/* @__PURE__ */
|
|
8851
|
-
ready ? /* @__PURE__ */
|
|
8892
|
+
return /* @__PURE__ */ jsxs78("section", { className: "ss-w-tool-row ss-w-tool-row--ask", children: [
|
|
8893
|
+
/* @__PURE__ */ jsx93("span", { className: "ss-w-tool-icon", "aria-hidden": "true", children: icon }),
|
|
8894
|
+
/* @__PURE__ */ jsxs78("div", { className: "ss-w-tool-main", children: [
|
|
8895
|
+
/* @__PURE__ */ jsx93("p", { className: "ss-w-tool-ask", children: ask }),
|
|
8896
|
+
ready ? /* @__PURE__ */ jsx93("span", { className: "ss-w-tool-ready", children: ready }) : null
|
|
8852
8897
|
] }),
|
|
8853
8898
|
send
|
|
8854
8899
|
] });
|
|
8855
8900
|
}
|
|
8856
8901
|
function RoundSend({ label, display, disabled, onClick }) {
|
|
8857
|
-
return /* @__PURE__ */
|
|
8902
|
+
return /* @__PURE__ */ jsx93("button", { type: "button", className: "ss-w-tool-go", "aria-label": `${label}: ${display}`, disabled, onClick, children: /* @__PURE__ */ jsx93(SendIcon, {}) });
|
|
8858
8903
|
}
|
|
8859
8904
|
var BIG_COMBO = { total: 50, legs: 6 };
|
|
8860
8905
|
function SetNumbersTool({ grid, strings, streaming, onSend, onClose }) {
|
|
@@ -8920,77 +8965,77 @@ function SetNumbersTool({ grid, strings, streaming, onSend, onClose }) {
|
|
|
8920
8965
|
const marketLabels = markets.map((c) => strings.marketShort(c.marketDeveloperName, c.marketLabel, c.selectionLabel ?? null));
|
|
8921
8966
|
const singlesReady = (cell) => cell ? strings.readyCount(cell.picks.length) : strings.unavailable;
|
|
8922
8967
|
const comboReady = (cell) => cell ? strings.readyAt(cell.combo.total) : strings.unavailable;
|
|
8923
|
-
return /* @__PURE__ */
|
|
8924
|
-
/* @__PURE__ */
|
|
8968
|
+
return /* @__PURE__ */ jsxs78(PresetToolModal, { title: strings.setNumbers, closeLabel: strings.close, onClose, children: [
|
|
8969
|
+
/* @__PURE__ */ jsx93(
|
|
8925
8970
|
AskRow,
|
|
8926
8971
|
{
|
|
8927
8972
|
icon: "\u{1F3AF}",
|
|
8928
8973
|
ask: fillTemplate(strings.maxPriceRow, {
|
|
8929
8974
|
count: String(count),
|
|
8930
|
-
price: /* @__PURE__ */
|
|
8975
|
+
price: /* @__PURE__ */ jsx93(NumberSelect, { current: maxPrice.toFixed(2), choices: maxChoices, label: strings.maxPriceName, notToday: strings.notToday, onChoose: chooseMax })
|
|
8931
8976
|
}),
|
|
8932
8977
|
ready: singlesReady(maxCell),
|
|
8933
|
-
send: /* @__PURE__ */
|
|
8978
|
+
send: /* @__PURE__ */ jsx93(RoundSend, { label: strings.send, display: strings.maxPriceDisplay(count, maxPrice), disabled: !maxCell || streaming, onClick: () => {
|
|
8934
8979
|
if (maxCell) onSend(maxPriceAsk(maxCell, strings));
|
|
8935
8980
|
} })
|
|
8936
8981
|
}
|
|
8937
8982
|
),
|
|
8938
|
-
/* @__PURE__ */
|
|
8983
|
+
/* @__PURE__ */ jsx93(
|
|
8939
8984
|
AskRow,
|
|
8940
8985
|
{
|
|
8941
8986
|
icon: "\u{1F4C8}",
|
|
8942
8987
|
ask: fillTemplate(strings.minPriceRow, {
|
|
8943
8988
|
count: String(count),
|
|
8944
|
-
price: /* @__PURE__ */
|
|
8989
|
+
price: /* @__PURE__ */ jsx93(NumberSelect, { current: minPrice.toFixed(2), choices: minChoices, label: strings.minPriceName, notToday: strings.notToday, onChoose: chooseMin })
|
|
8945
8990
|
}),
|
|
8946
8991
|
ready: singlesReady(minCell),
|
|
8947
|
-
send: /* @__PURE__ */
|
|
8992
|
+
send: /* @__PURE__ */ jsx93(RoundSend, { label: strings.send, display: strings.minPriceDisplay(count, minPrice), disabled: !minCell || streaming, onClick: () => {
|
|
8948
8993
|
if (minCell) onSend(minPriceAsk(minCell, strings));
|
|
8949
8994
|
} })
|
|
8950
8995
|
}
|
|
8951
8996
|
),
|
|
8952
|
-
/* @__PURE__ */
|
|
8997
|
+
/* @__PURE__ */ jsx93(
|
|
8953
8998
|
AskRow,
|
|
8954
8999
|
{
|
|
8955
9000
|
icon: "\u2728",
|
|
8956
9001
|
ask: fillTemplate(strings.comboRow, {
|
|
8957
|
-
legs: /* @__PURE__ */
|
|
8958
|
-
total: /* @__PURE__ */
|
|
9002
|
+
legs: /* @__PURE__ */ jsx93(NumberSelect, { current: String(legs), choices: legChoicesFor(total), label: strings.matchesLabel, notToday: strings.notToday, lockEmpty: false, onChoose: chooseLegs }),
|
|
9003
|
+
total: /* @__PURE__ */ jsx93(NumberSelect, { current: total.toFixed(1), choices: totalChoices, label: strings.totalLabel, notToday: strings.notToday, onChoose: chooseTotal })
|
|
8959
9004
|
}),
|
|
8960
9005
|
ready: comboReady(comboCell),
|
|
8961
|
-
send: /* @__PURE__ */
|
|
9006
|
+
send: /* @__PURE__ */ jsx93(RoundSend, { label: strings.send, display: strings.comboDisplay(legs, total), disabled: !comboCell || streaming, onClick: () => {
|
|
8962
9007
|
if (comboCell) onSend(comboAsk(comboCell, strings));
|
|
8963
9008
|
} })
|
|
8964
9009
|
}
|
|
8965
9010
|
),
|
|
8966
|
-
/* @__PURE__ */
|
|
9011
|
+
/* @__PURE__ */ jsx93(
|
|
8967
9012
|
AskRow,
|
|
8968
9013
|
{
|
|
8969
9014
|
icon: "\u{1F3C6}",
|
|
8970
9015
|
ask: fillTemplate(strings.bigComboRow, {
|
|
8971
|
-
legs: /* @__PURE__ */
|
|
8972
|
-
total: /* @__PURE__ */
|
|
9016
|
+
legs: /* @__PURE__ */ jsx93(NumberSelect, { current: String(bigLegs), choices: legChoicesFor(bigTotal), label: strings.matchesLabel, notToday: strings.notToday, lockEmpty: false, onChoose: chooseBigLegs }),
|
|
9017
|
+
total: /* @__PURE__ */ jsx93(NumberSelect, { current: bigTotal.toFixed(1), choices: totalChoices, label: strings.totalLabel, notToday: strings.notToday, onChoose: chooseBigTotal })
|
|
8973
9018
|
}),
|
|
8974
9019
|
ready: comboReady(bigCell),
|
|
8975
|
-
send: /* @__PURE__ */
|
|
9020
|
+
send: /* @__PURE__ */ jsx93(RoundSend, { label: strings.send, display: strings.comboDisplay(bigLegs, bigTotal), disabled: !bigCell || streaming, onClick: () => {
|
|
8976
9021
|
if (bigCell) onSend(comboAsk(bigCell, strings));
|
|
8977
9022
|
} })
|
|
8978
9023
|
}
|
|
8979
9024
|
),
|
|
8980
|
-
markets.length > 0 && /* @__PURE__ */
|
|
9025
|
+
markets.length > 0 && /* @__PURE__ */ jsx93(
|
|
8981
9026
|
AskRow,
|
|
8982
9027
|
{
|
|
8983
9028
|
icon: "\u26BD",
|
|
8984
9029
|
ask: fillTemplate(strings.marketRow, {
|
|
8985
|
-
market: /* @__PURE__ */
|
|
9030
|
+
market: /* @__PURE__ */ jsx93(ChoiceSelect, { currentIdx: marketIdx, sizeLabels: marketLabels, optionLabels: marketLabels, label: strings.marketName, onChoose: chooseMarket })
|
|
8986
9031
|
}),
|
|
8987
9032
|
ready: marketCell ? strings.readyCount(marketCell.count) : null,
|
|
8988
|
-
send: /* @__PURE__ */
|
|
9033
|
+
send: /* @__PURE__ */ jsx93(RoundSend, { label: strings.send, display: marketCell ? marketDisplay(marketCell, strings) : "", disabled: !marketCell || streaming, onClick: () => {
|
|
8989
9034
|
if (marketCell) onSend(marketAsk(marketCell, strings));
|
|
8990
9035
|
} })
|
|
8991
9036
|
}
|
|
8992
9037
|
),
|
|
8993
|
-
/* @__PURE__ */
|
|
9038
|
+
/* @__PURE__ */ jsx93("p", { className: "ss-w-vh", "aria-live": "polite", children: announcement })
|
|
8994
9039
|
] });
|
|
8995
9040
|
}
|
|
8996
9041
|
function BuildComboTool({ grid, strings, streaming, formatKickoff, initialTotal, initialLegs, onSend, onClose }) {
|
|
@@ -9014,24 +9059,24 @@ function BuildComboTool({ grid, strings, streaming, formatKickoff, initialTotal,
|
|
|
9014
9059
|
const d = strings.comboDisplay(nextLegs, nextTotal);
|
|
9015
9060
|
setAnnouncement(findCombo(grid, nextTotal, nextLegs) ? d : `${d}. ${strings.unavailable}`);
|
|
9016
9061
|
};
|
|
9017
|
-
const footer = /* @__PURE__ */
|
|
9062
|
+
const footer = /* @__PURE__ */ jsx93(SendButton, { label: strings.send, display, disabled: !cell || streaming, onClick: () => {
|
|
9018
9063
|
if (cell) onSend(comboAsk(cell, strings));
|
|
9019
9064
|
} });
|
|
9020
|
-
return /* @__PURE__ */
|
|
9021
|
-
/* @__PURE__ */
|
|
9022
|
-
/* @__PURE__ */
|
|
9023
|
-
/* @__PURE__ */
|
|
9065
|
+
return /* @__PURE__ */ jsxs78(PresetToolModal, { title: strings.buildCombo, closeLabel: strings.close, onClose, footer, children: [
|
|
9066
|
+
/* @__PURE__ */ jsxs78("div", { className: "ss-w-tool-section", role: "group", "aria-label": strings.totalLabel, children: [
|
|
9067
|
+
/* @__PURE__ */ jsx93("span", { className: "ss-w-tool-label", "aria-hidden": "true", children: strings.totalLabel }),
|
|
9068
|
+
/* @__PURE__ */ jsx93("div", { className: "ss-w-tool-chips", children: totals.map((t) => /* @__PURE__ */ jsx93("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)) })
|
|
9024
9069
|
] }),
|
|
9025
|
-
/* @__PURE__ */
|
|
9026
|
-
/* @__PURE__ */
|
|
9027
|
-
/* @__PURE__ */
|
|
9028
|
-
/* @__PURE__ */
|
|
9029
|
-
/* @__PURE__ */
|
|
9030
|
-
/* @__PURE__ */
|
|
9070
|
+
/* @__PURE__ */ jsxs78("div", { className: "ss-w-tool-section", role: "group", "aria-label": strings.matchesLabel, children: [
|
|
9071
|
+
/* @__PURE__ */ jsx93("span", { className: "ss-w-tool-label", "aria-hidden": "true", children: strings.matchesLabel }),
|
|
9072
|
+
/* @__PURE__ */ jsxs78("div", { className: "ss-w-tool-stepper", children: [
|
|
9073
|
+
/* @__PURE__ */ jsx93("button", { type: "button", className: "ss-w-tool-step", "aria-label": strings.fewerMatches, disabled: legs <= minLegs, onClick: () => choose(total, legs - 1), children: "\u2212" }),
|
|
9074
|
+
/* @__PURE__ */ jsx93("span", { className: "ss-w-tool-count", children: legs }),
|
|
9075
|
+
/* @__PURE__ */ jsx93("button", { type: "button", className: "ss-w-tool-step", "aria-label": strings.moreMatches, disabled: legs >= maxLegs, onClick: () => choose(total, legs + 1), children: "+" })
|
|
9031
9076
|
] })
|
|
9032
9077
|
] }),
|
|
9033
|
-
cell ? /* @__PURE__ */
|
|
9034
|
-
/* @__PURE__ */
|
|
9078
|
+
cell ? /* @__PURE__ */ jsx93(ComboPreview, { cell, formatKickoff }) : /* @__PURE__ */ jsx93(Unavailable, { text: strings.unavailable }),
|
|
9079
|
+
/* @__PURE__ */ jsx93("p", { className: "ss-w-vh", "aria-live": "polite", children: announcement })
|
|
9035
9080
|
] });
|
|
9036
9081
|
}
|
|
9037
9082
|
|
|
@@ -9133,7 +9178,7 @@ function markToolSeen() {
|
|
|
9133
9178
|
}
|
|
9134
9179
|
|
|
9135
9180
|
// src/components/ChatPanel.tsx
|
|
9136
|
-
import { jsx as
|
|
9181
|
+
import { jsx as jsx94, jsxs as jsxs79 } from "react/jsx-runtime";
|
|
9137
9182
|
var FULLSCREEN_QUERY = "(max-width: 639px)";
|
|
9138
9183
|
function useIsModal() {
|
|
9139
9184
|
const [modal, setModal] = useState43(false);
|
|
@@ -9224,8 +9269,8 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, g
|
|
|
9224
9269
|
focusAfterCloseRef.current = "composer";
|
|
9225
9270
|
setTool(null);
|
|
9226
9271
|
}, [tool, onChatTab, presetGrid]);
|
|
9227
|
-
return /* @__PURE__ */
|
|
9228
|
-
/* @__PURE__ */
|
|
9272
|
+
return /* @__PURE__ */ jsxs79("div", { className: "ss-w-panel", role: "dialog", "aria-modal": isModal, "aria-label": ui.chatDialogLabel, children: [
|
|
9273
|
+
/* @__PURE__ */ jsx94(
|
|
9229
9274
|
ChatHeader,
|
|
9230
9275
|
{
|
|
9231
9276
|
onClose: close,
|
|
@@ -9238,7 +9283,7 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, g
|
|
|
9238
9283
|
moreOptionsLabel: ui.moreOptions
|
|
9239
9284
|
}
|
|
9240
9285
|
),
|
|
9241
|
-
monitor && /* @__PURE__ */
|
|
9286
|
+
monitor && /* @__PURE__ */ jsx94(
|
|
9242
9287
|
TabBar,
|
|
9243
9288
|
{
|
|
9244
9289
|
monitor,
|
|
@@ -9250,9 +9295,9 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, g
|
|
|
9250
9295
|
gamesEnabled: gamesResult?.enabled ?? false
|
|
9251
9296
|
}
|
|
9252
9297
|
),
|
|
9253
|
-
/* @__PURE__ */
|
|
9254
|
-
/* @__PURE__ */
|
|
9255
|
-
showDial ? /* @__PURE__ */
|
|
9298
|
+
/* @__PURE__ */ jsxs79("div", { ref: layerRef, className: "ss-w-chat-layer", "data-dial": presetGrid ? "" : void 0, style: onChatTab ? void 0 : HIDDEN_LAYER_STYLE, children: [
|
|
9299
|
+
/* @__PURE__ */ jsx94(PresetToolsContext.Provider, { value: toolsValue, children: /* @__PURE__ */ jsx94(MessageList, { controller, ui, slip, onDashboardTap, monitor }) }),
|
|
9300
|
+
showDial ? /* @__PURE__ */ jsx94(
|
|
9256
9301
|
PresetSpeedDial,
|
|
9257
9302
|
{
|
|
9258
9303
|
expanded: dial.expanded,
|
|
@@ -9264,12 +9309,12 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, g
|
|
|
9264
9309
|
buttonRef: dialButtonRef
|
|
9265
9310
|
}
|
|
9266
9311
|
) : null,
|
|
9267
|
-
tool && presetGrid && onChatTab ? tool.kind === "numbers" ? /* @__PURE__ */
|
|
9312
|
+
tool && presetGrid && onChatTab ? tool.kind === "numbers" ? /* @__PURE__ */ jsx94(SetNumbersTool, { grid: presetGrid, strings: ui.presets, streaming: state.isStreaming, onSend: sendAsk, onClose: closeTool }) : /* @__PURE__ */ jsx94(BuildComboTool, { grid: presetGrid, strings: ui.presets, streaming: state.isStreaming, formatKickoff, initialTotal: tool.total, initialLegs: tool.legs, onSend: sendAsk, onClose: closeTool }) : null
|
|
9268
9313
|
] }),
|
|
9269
|
-
monitor && discovery && monitor.activeTab === "today" && /* @__PURE__ */
|
|
9270
|
-
monitor && monitor.activeTab === "following" && /* @__PURE__ */
|
|
9271
|
-
monitor && monitor.activeTab === "odds" && /* @__PURE__ */
|
|
9272
|
-
monitor && monitor.activeTab === "games" && gamesResult && /* @__PURE__ */
|
|
9314
|
+
monitor && discovery && monitor.activeTab === "today" && /* @__PURE__ */ jsx94(TodayPanel, { discovery, ui, monitor }),
|
|
9315
|
+
monitor && monitor.activeTab === "following" && /* @__PURE__ */ jsx94(MatchesPanel, { monitor, ui, slip, onAsk: handleAsk }),
|
|
9316
|
+
monitor && monitor.activeTab === "odds" && /* @__PURE__ */ jsx94(OddsPanel, { monitor, ui, slip }),
|
|
9317
|
+
monitor && monitor.activeTab === "games" && gamesResult && /* @__PURE__ */ jsx94(
|
|
9273
9318
|
GamesPanel,
|
|
9274
9319
|
{
|
|
9275
9320
|
loggedIn: !!loggedIn,
|
|
@@ -9283,7 +9328,7 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, g
|
|
|
9283
9328
|
}
|
|
9284
9329
|
}
|
|
9285
9330
|
),
|
|
9286
|
-
monitor && monitor.activeTab === "leaderboard" && leaderboardResult && /* @__PURE__ */
|
|
9331
|
+
monitor && monitor.activeTab === "leaderboard" && leaderboardResult && /* @__PURE__ */ jsx94(
|
|
9287
9332
|
LeaderboardPanel,
|
|
9288
9333
|
{
|
|
9289
9334
|
loggedIn: !!loggedIn,
|
|
@@ -9293,7 +9338,7 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, g
|
|
|
9293
9338
|
ui
|
|
9294
9339
|
}
|
|
9295
9340
|
),
|
|
9296
|
-
(!monitor || monitor.activeTab !== "games" && monitor.activeTab !== "leaderboard") && /* @__PURE__ */
|
|
9341
|
+
(!monitor || monitor.activeTab !== "games" && monitor.activeTab !== "leaderboard") && /* @__PURE__ */ jsx94(
|
|
9297
9342
|
ChatInput,
|
|
9298
9343
|
{
|
|
9299
9344
|
ref: inputRef,
|
|
@@ -9311,9 +9356,9 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, g
|
|
|
9311
9356
|
}
|
|
9312
9357
|
|
|
9313
9358
|
// src/components/HostEventsProvider.tsx
|
|
9314
|
-
import { jsx as
|
|
9359
|
+
import { jsx as jsx95 } from "react/jsx-runtime";
|
|
9315
9360
|
function HostEventsProvider({ value, children }) {
|
|
9316
|
-
return /* @__PURE__ */
|
|
9361
|
+
return /* @__PURE__ */ jsx95(SlipStateContext.Provider, { value: value.slipState, children });
|
|
9317
9362
|
}
|
|
9318
9363
|
|
|
9319
9364
|
// src/styles/css.generated.ts
|
|
@@ -10958,10 +11003,41 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
|
|
|
10958
11003
|
.ss-g-motm-pill { flex: none; padding: 3px 8px; font-size: 11px; }
|
|
10959
11004
|
.ss-g-motm-foot { font-size: 14px; font-weight: 600; }
|
|
10960
11005
|
.ss-g-motm-fun { font-size: 11px; color: var(--ss-g-faint); }
|
|
11006
|
+
|
|
11007
|
+
/* \u2500\u2500 tap-to-answer tray + per-game team-colour band (u503) \u2500\u2500 */
|
|
11008
|
+
.ss-g-tray { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; max-height: 150px; overflow-y: auto; overscroll-behavior: contain; padding: 2px; }
|
|
11009
|
+
.ss-g-tray-chip { display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 78px; padding: 6px 4px; border: 1px solid var(--ss-g-line); border-radius: 14px; background: var(--ss-g-surface); color: var(--ss-g-ink); font-family: var(--ss-g-font-body); cursor: pointer; }
|
|
11010
|
+
.ss-g-tray-chip:hover, .ss-g-tray-chip:focus-visible { background: var(--ss-g-raised); border-color: var(--ss-w-accent); outline: none; }
|
|
11011
|
+
.ss-g-tray-chip:disabled { opacity: .5; cursor: default; }
|
|
11012
|
+
.ss-g-tray-av { width: 38px; height: 38px; flex: none; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--ss-g-raised); color: var(--ss-g-muted); font-size: 14px; font-weight: 700; }
|
|
11013
|
+
.ss-g-tray-av img { width: 100%; height: 100%; object-fit: cover; }
|
|
11014
|
+
.ss-g-tray-name { width: 100%; display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
|
|
11015
|
+
.ss-g-tray-first { max-width: 100%; font-size: 10px; font-weight: 500; color: var(--ss-g-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
11016
|
+
.ss-g-tray-last { max-width: 100%; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
11017
|
+
|
|
11018
|
+
/* Each game gets its own band colour: the operator accent mixed into the ground, hue-nudged per game.
|
|
11019
|
+
Browsers without relative colour syntax keep the plain accent mix. */
|
|
11020
|
+
.ss-g-screen[data-game] { --ss-g-band: color-mix(in srgb, var(--ss-w-accent) var(--ss-g-band-mix, 18%), var(--ss-g-ground)); }
|
|
11021
|
+
@supports (color: oklch(from red l c h)) {
|
|
11022
|
+
.ss-g-screen[data-game] { --ss-g-band: oklch(from color-mix(in srgb, var(--ss-w-accent) var(--ss-g-band-mix, 18%), var(--ss-g-ground)) l calc(c * 1.5) calc(h + var(--ss-g-hue-shift, 0))); }
|
|
11023
|
+
}
|
|
11024
|
+
.ss-g-screen[data-game="mystery-tiger"] { --ss-g-band-mix: 14%; --ss-g-hue-shift: 0; }
|
|
11025
|
+
.ss-g-screen[data-game="career-path"] { --ss-g-band-mix: 11%; --ss-g-hue-shift: -24; }
|
|
11026
|
+
.ss-g-screen[data-game] > .ss-g-head { background: var(--ss-g-band); border-radius: 0 0 24px 24px; padding-bottom: 12px; }
|
|
11027
|
+
.ss-g-worth { flex: none; display: flex; align-items: baseline; gap: 10px; font-size: 13px; color: var(--ss-g-muted); }
|
|
11028
|
+
.ss-g-worth-now { font-family: var(--ss-g-font-display); font-weight: 800; font-size: 18px; letter-spacing: .02em; text-transform: uppercase; color: var(--ss-w-accent); }
|
|
11029
|
+
.ss-g-screen[data-game="beat-the-grid"] { --ss-g-band-mix: 13%; --ss-g-hue-shift: 14; }
|
|
11030
|
+
.ss-g-screen[data-game="guess-the-xi"] { --ss-g-band-mix: 12%; --ss-g-hue-shift: -36; }
|
|
11031
|
+
.ss-g-screen[data-game="higher-or-lower"] { --ss-g-band-mix: 16%; --ss-g-hue-shift: 28; }
|
|
11032
|
+
.ss-g-screen[data-game="daily-quiz"] { --ss-g-band-mix: 10%; --ss-g-hue-shift: -12; }
|
|
11033
|
+
.ss-g-screen[data-game="stat-ladder"] { --ss-g-band-mix: 15%; --ss-g-hue-shift: 36; }
|
|
11034
|
+
.ss-g-screen[data-game="matchday-predictor"] { --ss-g-band-mix: 18%; --ss-g-hue-shift: -4; }
|
|
11035
|
+
.ss-g-screen[data-game="starting-xi"] { --ss-g-band-mix: 9%; --ss-g-hue-shift: -30; }
|
|
11036
|
+
.ss-g-screen[data-game="fan-motm"] { --ss-g-band-mix: 14%; --ss-g-hue-shift: 8; }
|
|
10961
11037
|
`;
|
|
10962
11038
|
|
|
10963
11039
|
// src/StatsWidget.tsx
|
|
10964
|
-
import { jsx as
|
|
11040
|
+
import { jsx as jsx96 } from "react/jsx-runtime";
|
|
10965
11041
|
function buildClient(props) {
|
|
10966
11042
|
try {
|
|
10967
11043
|
if ("client" in props && props.client) {
|
|
@@ -11130,7 +11206,7 @@ function StatsWidget(props) {
|
|
|
11130
11206
|
[built, logger]
|
|
11131
11207
|
);
|
|
11132
11208
|
const dismissPopup = usePopupTelemetry(logger, controller.state.isOpen, controller.state.popupText, controller.dismissPopup);
|
|
11133
|
-
const asks = bubbleAsks(controller.state.messages).map((ask) => ({
|
|
11209
|
+
const asks = bubbleAsks(controller.state.messages, ui.presets.standoutAsk).map((ask) => ({
|
|
11134
11210
|
label: ask.label,
|
|
11135
11211
|
onTap: () => runBubbleAsk(ask, {
|
|
11136
11212
|
open: controller.open,
|
|
@@ -11172,7 +11248,7 @@ function StatsWidget(props) {
|
|
|
11172
11248
|
}, [built, ui.injectStyles]);
|
|
11173
11249
|
if (!built) return null;
|
|
11174
11250
|
const attrs = themeAttrs(ui);
|
|
11175
|
-
return /* @__PURE__ */
|
|
11251
|
+
return /* @__PURE__ */ jsx96(EventLogContext.Provider, { value: logger, children: /* @__PURE__ */ jsx96(HostEventsProvider, { value: hostEvents, children: /* @__PURE__ */ jsx96("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__ */ jsx96(
|
|
11176
11252
|
ChatPanel,
|
|
11177
11253
|
{
|
|
11178
11254
|
controller,
|
|
@@ -11187,7 +11263,7 @@ function StatsWidget(props) {
|
|
|
11187
11263
|
conversation: built?.conversation ?? null,
|
|
11188
11264
|
presetGrid
|
|
11189
11265
|
}
|
|
11190
|
-
) : /* @__PURE__ */
|
|
11266
|
+
) : /* @__PURE__ */ jsx96(
|
|
11191
11267
|
ChatFab,
|
|
11192
11268
|
{
|
|
11193
11269
|
label: ui.launcherLabel,
|