@sensiblestats/widget-react 0.58.0 → 0.59.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/index.cjs +531 -394
- 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 +381 -244
- package/dist/index.js.map +1 -1
- package/dist/styles.css +30 -3
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -36,7 +36,7 @@ __export(index_exports, {
|
|
|
36
36
|
module.exports = __toCommonJS(index_exports);
|
|
37
37
|
|
|
38
38
|
// src/StatsWidget.tsx
|
|
39
|
-
var
|
|
39
|
+
var import_react41 = require("react");
|
|
40
40
|
var import_widget_sdk5 = require("@sensiblestats/widget-sdk");
|
|
41
41
|
|
|
42
42
|
// src/kickoff.ts
|
|
@@ -1933,7 +1933,7 @@ function ChatFab({ label, greeting, popupText, logoUrl, onOpen, onDismissPopup,
|
|
|
1933
1933
|
}
|
|
1934
1934
|
|
|
1935
1935
|
// src/components/ChatPanel.tsx
|
|
1936
|
-
var
|
|
1936
|
+
var import_react40 = require("react");
|
|
1937
1937
|
|
|
1938
1938
|
// src/components/ChatHeader.tsx
|
|
1939
1939
|
var import_react11 = require("react");
|
|
@@ -4036,7 +4036,7 @@ function TodayPanel({ discovery, ui, monitor }) {
|
|
|
4036
4036
|
}
|
|
4037
4037
|
|
|
4038
4038
|
// src/components/GamesPanel.tsx
|
|
4039
|
-
var
|
|
4039
|
+
var import_react38 = require("react");
|
|
4040
4040
|
|
|
4041
4041
|
// src/components/GamesLoginWall.tsx
|
|
4042
4042
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
@@ -4170,7 +4170,7 @@ function GamesHub({
|
|
|
4170
4170
|
}
|
|
4171
4171
|
|
|
4172
4172
|
// src/components/GameScreenHost.tsx
|
|
4173
|
-
var
|
|
4173
|
+
var import_react37 = require("react");
|
|
4174
4174
|
|
|
4175
4175
|
// src/useGamePlay.ts
|
|
4176
4176
|
var import_react28 = require("react");
|
|
@@ -4245,7 +4245,7 @@ function useGamePlay(conversation, { gameId, gameDay, fixtureId, refresh }) {
|
|
|
4245
4245
|
}
|
|
4246
4246
|
|
|
4247
4247
|
// src/components/games/MysteryTigerGame.tsx
|
|
4248
|
-
var
|
|
4248
|
+
var import_react30 = require("react");
|
|
4249
4249
|
|
|
4250
4250
|
// src/components/games/nationFlags.ts
|
|
4251
4251
|
var FLAGS = {
|
|
@@ -4328,8 +4328,29 @@ function nationalityFlag(nationality) {
|
|
|
4328
4328
|
return FLAGS[key] ?? nationality.slice(0, 3).toUpperCase();
|
|
4329
4329
|
}
|
|
4330
4330
|
|
|
4331
|
-
// src/components/games/
|
|
4331
|
+
// src/components/games/PlayerAvatar.tsx
|
|
4332
|
+
var import_react29 = require("react");
|
|
4332
4333
|
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
4334
|
+
function initialsOf(name) {
|
|
4335
|
+
const parts = name.trim().split(/\s+/).filter(Boolean);
|
|
4336
|
+
const first = parts[0];
|
|
4337
|
+
if (!first) return "?";
|
|
4338
|
+
const last = parts[parts.length - 1];
|
|
4339
|
+
if (parts.length === 1 || !last) return first.slice(0, 2).toUpperCase();
|
|
4340
|
+
return ((first[0] ?? "") + (last[0] ?? "")).toUpperCase();
|
|
4341
|
+
}
|
|
4342
|
+
function PlayerAvatar({
|
|
4343
|
+
name,
|
|
4344
|
+
imagePath,
|
|
4345
|
+
className
|
|
4346
|
+
}) {
|
|
4347
|
+
const [failed, setFailed] = (0, import_react29.useState)(false);
|
|
4348
|
+
const showImage = Boolean(imagePath) && !failed;
|
|
4349
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className, "aria-hidden": "true", children: showImage ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("img", { src: imagePath, alt: "", loading: "lazy", onError: () => setFailed(true) }) : /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "ss-w-av-initials", children: initialsOf(name) }) });
|
|
4350
|
+
}
|
|
4351
|
+
|
|
4352
|
+
// src/components/games/MysteryTigerGame.tsx
|
|
4353
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
4333
4354
|
function parseClientState(json) {
|
|
4334
4355
|
if (!json) return null;
|
|
4335
4356
|
try {
|
|
@@ -4352,6 +4373,14 @@ var ATTR_KEYS = [
|
|
|
4352
4373
|
"shirtNumber",
|
|
4353
4374
|
"apps"
|
|
4354
4375
|
];
|
|
4376
|
+
var PROFILE_ROWS = [
|
|
4377
|
+
{ key: "position", label: "Position" },
|
|
4378
|
+
{ key: "nationality", label: "Nationality" },
|
|
4379
|
+
{ key: "age", label: "Age" },
|
|
4380
|
+
{ key: "shirtNumber", label: "Jersey number" },
|
|
4381
|
+
{ key: "apps", label: "Match count" }
|
|
4382
|
+
];
|
|
4383
|
+
var MAX_GUESSES = 6;
|
|
4355
4384
|
function verdictGlyph(v) {
|
|
4356
4385
|
if (v.verdict === "exact") return "\u2713";
|
|
4357
4386
|
if (v.verdict === "miss") return "\u2717";
|
|
@@ -4364,9 +4393,49 @@ function directionArrow(v) {
|
|
|
4364
4393
|
if (v.direction === "down") return "\u25BC";
|
|
4365
4394
|
return "";
|
|
4366
4395
|
}
|
|
4396
|
+
var POSITION_SHORT = {
|
|
4397
|
+
goalkeeper: "GK",
|
|
4398
|
+
keeper: "GK",
|
|
4399
|
+
defender: "DEF",
|
|
4400
|
+
"centre back": "CB",
|
|
4401
|
+
"center back": "CB",
|
|
4402
|
+
"centre-back": "CB",
|
|
4403
|
+
"center-back": "CB",
|
|
4404
|
+
"left back": "LB",
|
|
4405
|
+
"right back": "RB",
|
|
4406
|
+
"left wing-back": "LWB",
|
|
4407
|
+
"right wing-back": "RWB",
|
|
4408
|
+
sweeper: "SW",
|
|
4409
|
+
midfielder: "MID",
|
|
4410
|
+
"defensive midfield": "DM",
|
|
4411
|
+
"central midfield": "CM",
|
|
4412
|
+
"centre midfield": "CM",
|
|
4413
|
+
"attacking midfield": "AM",
|
|
4414
|
+
"left midfield": "LM",
|
|
4415
|
+
"right midfield": "RM",
|
|
4416
|
+
"left wing": "LW",
|
|
4417
|
+
"right wing": "RW",
|
|
4418
|
+
"left winger": "LW",
|
|
4419
|
+
"right winger": "RW",
|
|
4420
|
+
forward: "FWD",
|
|
4421
|
+
attacker: "FWD",
|
|
4422
|
+
striker: "ST",
|
|
4423
|
+
"second striker": "SS",
|
|
4424
|
+
"centre forward": "CF",
|
|
4425
|
+
"center forward": "CF",
|
|
4426
|
+
"centre-forward": "CF"
|
|
4427
|
+
};
|
|
4428
|
+
function shortPosition(value) {
|
|
4429
|
+
const mapped = POSITION_SHORT[value.trim().toLowerCase()];
|
|
4430
|
+
if (mapped) return mapped;
|
|
4431
|
+
if (value.length <= 3) return value.toUpperCase();
|
|
4432
|
+
return value.split(/[\s-]+/).filter(Boolean).map((w) => (w[0] ?? "").toUpperCase()).join("").slice(0, 3);
|
|
4433
|
+
}
|
|
4367
4434
|
function tileFace(key, v) {
|
|
4368
4435
|
if (!v.value) return verdictGlyph(v);
|
|
4369
|
-
|
|
4436
|
+
if (key === "nationality") return nationalityFlag(v.value);
|
|
4437
|
+
if (key === "position") return shortPosition(v.value);
|
|
4438
|
+
return v.value;
|
|
4370
4439
|
}
|
|
4371
4440
|
function MysteryTigerGame({
|
|
4372
4441
|
config,
|
|
@@ -4374,12 +4443,17 @@ function MysteryTigerGame({
|
|
|
4374
4443
|
submitting,
|
|
4375
4444
|
onSubmit
|
|
4376
4445
|
}) {
|
|
4377
|
-
const [query, setQuery] = (0,
|
|
4378
|
-
const
|
|
4446
|
+
const [query, setQuery] = (0, import_react30.useState)("");
|
|
4447
|
+
const [portraitFailed, setPortraitFailed] = (0, import_react30.useState)(false);
|
|
4448
|
+
const inputId = (0, import_react30.useId)();
|
|
4379
4449
|
const clientState = parseClientState(result?.clientStateJson);
|
|
4380
4450
|
const guessResults = clientState?.guessResults ?? [];
|
|
4381
4451
|
const alreadyGuessedIds = new Set(guessResults.map((g) => g.playerId));
|
|
4452
|
+
const shirtEnabled = config?.shirtTileEnabled ?? clientState?.shirtTileEnabled ?? false;
|
|
4382
4453
|
const isOver = result?.alreadyPlayed === true || clientState?.solved === true || clientState?.failed === true;
|
|
4454
|
+
const guessesUsed = clientState?.guessesUsed ?? guessResults.length;
|
|
4455
|
+
const revealPhoto = isOver && Boolean(clientState?.revealedPlayerImagePath) && !portraitFailed;
|
|
4456
|
+
const revealName = isOver ? clientState?.revealedPlayerName : void 0;
|
|
4383
4457
|
const filtered = config && !isOver ? config.squadPlayers.filter(
|
|
4384
4458
|
(p) => !alreadyGuessedIds.has(p.id) && p.name.toLowerCase().includes(query.toLowerCase())
|
|
4385
4459
|
) : [];
|
|
@@ -4390,43 +4464,65 @@ function MysteryTigerGame({
|
|
|
4390
4464
|
setQuery("");
|
|
4391
4465
|
onSubmit(JSON.stringify({ guesses: newGuesses }));
|
|
4392
4466
|
}
|
|
4393
|
-
return /* @__PURE__ */ (0,
|
|
4394
|
-
!config && /* @__PURE__ */ (0,
|
|
4395
|
-
config && /* @__PURE__ */ (0,
|
|
4396
|
-
/* @__PURE__ */ (0,
|
|
4397
|
-
/* @__PURE__ */ (0,
|
|
4398
|
-
/* @__PURE__ */ (0,
|
|
4399
|
-
/* @__PURE__ */ (0,
|
|
4467
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "ss-w-gt", "data-testid": "game-screen-mystery-tiger", children: [
|
|
4468
|
+
!config && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "ss-w-gscreen-body", children: "Loading\u2026" }),
|
|
4469
|
+
config && /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_jsx_runtime56.Fragment, { children: [
|
|
4470
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "ss-w-gt-head", children: [
|
|
4471
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { children: [
|
|
4472
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "ss-w-gt-title", children: "Mystery Tiger" }),
|
|
4473
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "ss-w-gt-sub", children: "Guess today's squad player" })
|
|
4400
4474
|
] }),
|
|
4401
|
-
clientState && !isOver && /* @__PURE__ */ (0,
|
|
4475
|
+
clientState && !isOver && /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("span", { className: "ss-w-gt-left", children: [
|
|
4402
4476
|
clientState.guessesRemaining,
|
|
4403
4477
|
" left"
|
|
4404
4478
|
] })
|
|
4405
4479
|
] }),
|
|
4406
|
-
/* @__PURE__ */ (0,
|
|
4407
|
-
|
|
4480
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "ss-w-gscroll", children: [
|
|
4481
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: `ss-w-gt-card${isOver ? " ss-w-gt-card--reveal" : ""}`, children: [
|
|
4482
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "ss-w-gt-sil", children: revealPhoto ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
4483
|
+
"img",
|
|
4484
|
+
{
|
|
4485
|
+
src: clientState.revealedPlayerImagePath,
|
|
4486
|
+
alt: "",
|
|
4487
|
+
onError: () => setPortraitFailed(true)
|
|
4488
|
+
}
|
|
4489
|
+
) : isOver && revealName ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "ss-w-av-initials", children: initialsOf(revealName) }) : /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("svg", { viewBox: "0 0 96 118", role: "img", "aria-label": "hidden player silhouette", children: [
|
|
4490
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("circle", { cx: "48", cy: "40", r: "21", fill: "var(--ss-w-faint)" }),
|
|
4491
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("path", { d: "M8 118c0-25 18-39 40-39s40 14 40 39z", fill: "var(--ss-w-faint)" })
|
|
4492
|
+
] }) }),
|
|
4493
|
+
!isOver && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "ss-w-gt-attrs", children: PROFILE_ROWS.filter((r) => r.key !== "shirtNumber" || shirtEnabled).map((row) => /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "ss-w-gt-attr", children: [
|
|
4494
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "ss-w-gt-attr-k", children: row.label }),
|
|
4495
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "ss-w-gt-attr-v", children: "\u2022\u2022\u2022" })
|
|
4496
|
+
] }, row.key)) })
|
|
4497
|
+
] }),
|
|
4498
|
+
!isOver && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "ss-w-gt-dots", "aria-label": `${guessesUsed} of ${MAX_GUESSES} guesses used`, children: Array.from({ length: MAX_GUESSES }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("i", { className: i < guessesUsed ? "ss-w-gt-dot ss-w-gt-dot--on" : "ss-w-gt-dot" }, i)) }),
|
|
4499
|
+
!isOver && /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "ss-w-gt-lead", children: [
|
|
4408
4500
|
guessResults.length === 0 ? "Guess a squad player \u2014 each guess compares it to the mystery player on Pos, Nat, Age, Shirt & Apps: " : "Tiles: ",
|
|
4409
|
-
/* @__PURE__ */ (0,
|
|
4410
|
-
/* @__PURE__ */ (0,
|
|
4411
|
-
" match \xB7
|
|
4412
|
-
|
|
4501
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("span", { className: "ss-w-gt-key", children: [
|
|
4502
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "ss-w-gt-sw ss-w-gt-sw--exact", "aria-hidden": "true" }),
|
|
4503
|
+
" match \xB7",
|
|
4504
|
+
" ",
|
|
4505
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "ss-w-gt-sw ss-w-gt-sw--near", "aria-hidden": "true" }),
|
|
4506
|
+
" close \xB7",
|
|
4507
|
+
" ",
|
|
4508
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("b", { children: "\u25B2" }),
|
|
4413
4509
|
" higher \xB7 ",
|
|
4414
|
-
/* @__PURE__ */ (0,
|
|
4510
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("b", { children: "\u25BC" }),
|
|
4415
4511
|
" lower"
|
|
4416
4512
|
] })
|
|
4417
4513
|
] }),
|
|
4418
|
-
guessResults.length > 0 && /* @__PURE__ */ (0,
|
|
4514
|
+
guessResults.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "ss-w-gtrows", children: guessResults.map((gr, i) => {
|
|
4419
4515
|
const player = config.squadPlayers.find((p) => p.id === gr.playerId);
|
|
4420
|
-
return /* @__PURE__ */ (0,
|
|
4421
|
-
/* @__PURE__ */ (0,
|
|
4516
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "ss-w-gtguess", children: [
|
|
4517
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "ss-w-gtguess-nm", children: [
|
|
4422
4518
|
i + 1,
|
|
4423
4519
|
" \xB7 ",
|
|
4424
4520
|
player?.name ?? `#${gr.playerId}`
|
|
4425
4521
|
] }),
|
|
4426
|
-
/* @__PURE__ */ (0,
|
|
4522
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "ss-w-gtrow", children: ATTR_KEYS.map((key) => {
|
|
4427
4523
|
const v = gr[key];
|
|
4428
4524
|
const arrow = directionArrow(v);
|
|
4429
|
-
return /* @__PURE__ */ (0,
|
|
4525
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
4430
4526
|
"div",
|
|
4431
4527
|
{
|
|
4432
4528
|
className: `ss-w-gtile ss-w-gtile--${v.verdict}`,
|
|
@@ -4434,10 +4530,10 @@ function MysteryTigerGame({
|
|
|
4434
4530
|
"data-verdict": v.verdict,
|
|
4435
4531
|
"aria-label": `${ATTR_LABELS[key]}: ${v.value ?? v.verdict}${v.direction ? ` ${v.direction}` : ""}`,
|
|
4436
4532
|
children: [
|
|
4437
|
-
/* @__PURE__ */ (0,
|
|
4438
|
-
/* @__PURE__ */ (0,
|
|
4533
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "ss-w-gtile-lab", children: ATTR_LABELS[key] }),
|
|
4534
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("span", { className: "ss-w-gtile-v", "aria-hidden": "true", children: [
|
|
4439
4535
|
tileFace(key, v),
|
|
4440
|
-
arrow && /* @__PURE__ */ (0,
|
|
4536
|
+
arrow && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "ss-w-gtile-dir", children: arrow })
|
|
4441
4537
|
] })
|
|
4442
4538
|
]
|
|
4443
4539
|
},
|
|
@@ -4446,14 +4542,14 @@ function MysteryTigerGame({
|
|
|
4446
4542
|
}) })
|
|
4447
4543
|
] }, gr.playerId);
|
|
4448
4544
|
}) }),
|
|
4449
|
-
clientState?.hintLine && !isOver && /* @__PURE__ */ (0,
|
|
4545
|
+
clientState?.hintLine && !isOver && /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "ss-w-gt-hint", children: [
|
|
4450
4546
|
"\u{1F4A1} ",
|
|
4451
4547
|
clientState.hintLine
|
|
4452
4548
|
] }),
|
|
4453
|
-
isOver && clientState && /* @__PURE__ */ (0,
|
|
4454
|
-
/* @__PURE__ */ (0,
|
|
4455
|
-
clientState.revealedPlayerName && /* @__PURE__ */ (0,
|
|
4456
|
-
/* @__PURE__ */ (0,
|
|
4549
|
+
isOver && clientState && /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: `ss-w-gt-banner ss-w-gt-banner--${clientState.solved ? "solved" : "failed"}`, children: [
|
|
4550
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "ss-w-gt-banner-label", children: clientState.solved ? "\u{1F42F} You found them!" : "\u{1F614} Out of guesses" }),
|
|
4551
|
+
clientState.revealedPlayerName && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "ss-w-gt-banner-name", children: clientState.revealedPlayerName }),
|
|
4552
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "ss-w-gt-banner-sub", children: [
|
|
4457
4553
|
clientState.guessesUsed,
|
|
4458
4554
|
" guess",
|
|
4459
4555
|
clientState.guessesUsed === 1 ? "" : "es",
|
|
@@ -4461,8 +4557,8 @@ function MysteryTigerGame({
|
|
|
4461
4557
|
] })
|
|
4462
4558
|
] })
|
|
4463
4559
|
] }),
|
|
4464
|
-
!isOver && /* @__PURE__ */ (0,
|
|
4465
|
-
/* @__PURE__ */ (0,
|
|
4560
|
+
!isOver && /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "ss-w-gpin ss-w-gtta", children: [
|
|
4561
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
4466
4562
|
"input",
|
|
4467
4563
|
{
|
|
4468
4564
|
id: inputId,
|
|
@@ -4478,7 +4574,7 @@ function MysteryTigerGame({
|
|
|
4478
4574
|
"aria-autocomplete": "list"
|
|
4479
4575
|
}
|
|
4480
4576
|
),
|
|
4481
|
-
query.length > 0 && filtered.length > 0 && /* @__PURE__ */ (0,
|
|
4577
|
+
query.length > 0 && filtered.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "ss-w-gtta-drop", role: "listbox", children: filtered.map((p) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
4482
4578
|
"div",
|
|
4483
4579
|
{
|
|
4484
4580
|
className: "ss-w-gtta-opt",
|
|
@@ -4499,7 +4595,7 @@ function MysteryTigerGame({
|
|
|
4499
4595
|
}
|
|
4500
4596
|
|
|
4501
4597
|
// src/components/games/HigherOrLowerGame.tsx
|
|
4502
|
-
var
|
|
4598
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
4503
4599
|
var POINTS_PER_CORRECT = 10;
|
|
4504
4600
|
function parseClientState2(json) {
|
|
4505
4601
|
if (!json) return null;
|
|
@@ -4531,38 +4627,45 @@ function HigherOrLowerGame({
|
|
|
4531
4627
|
const newAnswers = [...prevAnswers, { pairIndex: currentPair.pairIndex, pick }];
|
|
4532
4628
|
onSubmit(JSON.stringify({ answers: newAnswers }));
|
|
4533
4629
|
}
|
|
4534
|
-
return /* @__PURE__ */ (0,
|
|
4535
|
-
!config && /* @__PURE__ */ (0,
|
|
4536
|
-
config && /* @__PURE__ */ (0,
|
|
4537
|
-
/* @__PURE__ */ (0,
|
|
4538
|
-
/* @__PURE__ */ (0,
|
|
4539
|
-
/* @__PURE__ */ (0,
|
|
4540
|
-
/* @__PURE__ */ (0,
|
|
4630
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "ss-w-hl", "data-testid": "game-screen-higher-or-lower", children: [
|
|
4631
|
+
!config && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "ss-w-gscreen-body", children: "Loading\u2026" }),
|
|
4632
|
+
config && /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_jsx_runtime57.Fragment, { children: [
|
|
4633
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "ss-w-hl-head", children: [
|
|
4634
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { children: [
|
|
4635
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "ss-w-hl-title", children: "Higher or Lower" }),
|
|
4636
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "ss-w-hl-sub", children: [
|
|
4541
4637
|
config.statLabel,
|
|
4542
4638
|
" \xB7 ",
|
|
4543
4639
|
config.seasonLabel
|
|
4544
4640
|
] })
|
|
4545
4641
|
] }),
|
|
4546
|
-
runLength > 0 && !isOver && /* @__PURE__ */ (0,
|
|
4642
|
+
runLength > 0 && !isOver && /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("span", { className: "ss-w-hl-streak", children: [
|
|
4547
4643
|
"\u{1F525} ",
|
|
4548
4644
|
runLength
|
|
4549
4645
|
] })
|
|
4550
4646
|
] }),
|
|
4551
|
-
currentPair && /* @__PURE__ */ (0,
|
|
4552
|
-
/* @__PURE__ */ (0,
|
|
4647
|
+
currentPair && /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_jsx_runtime57.Fragment, { children: [
|
|
4648
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "ss-w-hl-q", children: [
|
|
4553
4649
|
"Who has more ",
|
|
4554
4650
|
config.statLabel.toLowerCase(),
|
|
4555
4651
|
"?"
|
|
4556
4652
|
] }),
|
|
4557
|
-
/* @__PURE__ */ (0,
|
|
4558
|
-
/* @__PURE__ */ (0,
|
|
4559
|
-
/* @__PURE__ */ (0,
|
|
4560
|
-
|
|
4561
|
-
|
|
4562
|
-
|
|
4653
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "ss-w-hlpair", children: [
|
|
4654
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "ss-w-hlpc", children: [
|
|
4655
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
4656
|
+
PlayerAvatar,
|
|
4657
|
+
{
|
|
4658
|
+
className: "ss-w-hlpc-av",
|
|
4659
|
+
name: currentPair.playerAName,
|
|
4660
|
+
imagePath: currentPair.playerAImagePath
|
|
4661
|
+
}
|
|
4662
|
+
),
|
|
4663
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "ss-w-hlpc-name", children: currentPair.playerAName }),
|
|
4664
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "ss-w-hlpc-stat", children: config.statLabel }),
|
|
4665
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "ss-w-hlpc-val", children: currentPair.playerAValue })
|
|
4563
4666
|
] }),
|
|
4564
|
-
/* @__PURE__ */ (0,
|
|
4565
|
-
/* @__PURE__ */ (0,
|
|
4667
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "ss-w-hlbtns", children: [
|
|
4668
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
4566
4669
|
"button",
|
|
4567
4670
|
{
|
|
4568
4671
|
type: "button",
|
|
@@ -4572,8 +4675,8 @@ function HigherOrLowerGame({
|
|
|
4572
4675
|
children: "Higher \u25B2"
|
|
4573
4676
|
}
|
|
4574
4677
|
),
|
|
4575
|
-
/* @__PURE__ */ (0,
|
|
4576
|
-
/* @__PURE__ */ (0,
|
|
4678
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "ss-w-hl-or", children: "or" }),
|
|
4679
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
4577
4680
|
"button",
|
|
4578
4681
|
{
|
|
4579
4682
|
type: "button",
|
|
@@ -4584,32 +4687,39 @@ function HigherOrLowerGame({
|
|
|
4584
4687
|
}
|
|
4585
4688
|
)
|
|
4586
4689
|
] }),
|
|
4587
|
-
/* @__PURE__ */ (0,
|
|
4588
|
-
/* @__PURE__ */ (0,
|
|
4589
|
-
|
|
4590
|
-
|
|
4591
|
-
|
|
4690
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "ss-w-hlpc ss-w-hlpc--b", children: [
|
|
4691
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
4692
|
+
PlayerAvatar,
|
|
4693
|
+
{
|
|
4694
|
+
className: "ss-w-hlpc-av",
|
|
4695
|
+
name: currentPair.playerBName,
|
|
4696
|
+
imagePath: currentPair.playerBImagePath
|
|
4697
|
+
}
|
|
4698
|
+
),
|
|
4699
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "ss-w-hlpc-name", children: currentPair.playerBName }),
|
|
4700
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "ss-w-hlpc-stat", children: config.statLabel }),
|
|
4701
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "ss-w-hlpc-val ss-w-hlpc-val--hidden", children: "?" })
|
|
4592
4702
|
] })
|
|
4593
4703
|
] })
|
|
4594
4704
|
] }),
|
|
4595
|
-
!isOver && /* @__PURE__ */ (0,
|
|
4596
|
-
/* @__PURE__ */ (0,
|
|
4705
|
+
!isOver && /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "ss-w-hl-foot", children: [
|
|
4706
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("span", { className: "ss-w-hl-chip", children: [
|
|
4597
4707
|
score,
|
|
4598
4708
|
" pts"
|
|
4599
4709
|
] }),
|
|
4600
|
-
/* @__PURE__ */ (0,
|
|
4710
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("span", { className: "ss-w-hl-chip ss-w-hl-chip--green", children: [
|
|
4601
4711
|
"+",
|
|
4602
4712
|
POINTS_PER_CORRECT,
|
|
4603
4713
|
" / correct"
|
|
4604
4714
|
] })
|
|
4605
4715
|
] }),
|
|
4606
|
-
isOver && /* @__PURE__ */ (0,
|
|
4607
|
-
/* @__PURE__ */ (0,
|
|
4608
|
-
/* @__PURE__ */ (0,
|
|
4716
|
+
isOver && /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "ss-w-hl-over", children: [
|
|
4717
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "ss-w-hl-over-title", children: runEndedWrong ? "\u{1F6AB} Run over" : "\u{1F389} Perfect run!" }),
|
|
4718
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "ss-w-hl-over-score", children: [
|
|
4609
4719
|
score,
|
|
4610
|
-
/* @__PURE__ */ (0,
|
|
4720
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "ss-w-hl-over-unit", children: " pts" })
|
|
4611
4721
|
] }),
|
|
4612
|
-
/* @__PURE__ */ (0,
|
|
4722
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "ss-w-hl-over-sub", children: [
|
|
4613
4723
|
correctCount,
|
|
4614
4724
|
" correct in a row",
|
|
4615
4725
|
runEndedWrong ? " before a wrong pick" : "",
|
|
@@ -4621,8 +4731,8 @@ function HigherOrLowerGame({
|
|
|
4621
4731
|
}
|
|
4622
4732
|
|
|
4623
4733
|
// src/components/games/CareerPathGame.tsx
|
|
4624
|
-
var
|
|
4625
|
-
var
|
|
4734
|
+
var import_react31 = require("react");
|
|
4735
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
4626
4736
|
function parseClientState3(json) {
|
|
4627
4737
|
if (!json) return null;
|
|
4628
4738
|
try {
|
|
@@ -4641,13 +4751,13 @@ function spellYears(spell) {
|
|
|
4641
4751
|
}
|
|
4642
4752
|
function ClubSpellCard({ spell }) {
|
|
4643
4753
|
const years = spellYears(spell);
|
|
4644
|
-
return /* @__PURE__ */ (0,
|
|
4645
|
-
spell.crestUrl ? /* @__PURE__ */ (0,
|
|
4646
|
-
/* @__PURE__ */ (0,
|
|
4754
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: `ss-w-cpath-club${spell.isLoan ? " ss-w-cpath-club--loan" : ""}`, children: [
|
|
4755
|
+
spell.crestUrl ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("img", { src: spell.crestUrl, alt: "", className: "ss-w-cpath-crest", loading: "lazy" }) : /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "ss-w-cpath-crest ss-w-cpath-crest--fallback", "aria-hidden": "true", children: spell.clubName.slice(0, 3).toUpperCase() }),
|
|
4756
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("span", { className: "ss-w-cpath-club-name", children: [
|
|
4647
4757
|
spell.clubName,
|
|
4648
|
-
spell.isLoan && /* @__PURE__ */ (0,
|
|
4758
|
+
spell.isLoan && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "ss-w-cpath-loan-note", children: " (loan)" })
|
|
4649
4759
|
] }),
|
|
4650
|
-
years && /* @__PURE__ */ (0,
|
|
4760
|
+
years && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "ss-w-cpath-spell-yr", children: years })
|
|
4651
4761
|
] });
|
|
4652
4762
|
}
|
|
4653
4763
|
function CareerPathGame({
|
|
@@ -4656,8 +4766,8 @@ function CareerPathGame({
|
|
|
4656
4766
|
submitting,
|
|
4657
4767
|
onSubmit
|
|
4658
4768
|
}) {
|
|
4659
|
-
const [query, setQuery] = (0,
|
|
4660
|
-
const inputId = (0,
|
|
4769
|
+
const [query, setQuery] = (0, import_react31.useState)("");
|
|
4770
|
+
const inputId = (0, import_react31.useId)();
|
|
4661
4771
|
const clientState = parseClientState3(result?.clientStateJson);
|
|
4662
4772
|
const alreadyGuessedIds = new Set(clientState?.guessResults.map((g) => g.playerId) ?? []);
|
|
4663
4773
|
const isOver = result?.alreadyPlayed === true || clientState?.solved === true || clientState?.failed === true;
|
|
@@ -4672,32 +4782,32 @@ function CareerPathGame({
|
|
|
4672
4782
|
setQuery("");
|
|
4673
4783
|
onSubmit(JSON.stringify({ guesses: newGuesses }));
|
|
4674
4784
|
}
|
|
4675
|
-
return /* @__PURE__ */ (0,
|
|
4676
|
-
!config && /* @__PURE__ */ (0,
|
|
4677
|
-
config && /* @__PURE__ */ (0,
|
|
4678
|
-
/* @__PURE__ */ (0,
|
|
4679
|
-
/* @__PURE__ */ (0,
|
|
4680
|
-
/* @__PURE__ */ (0,
|
|
4681
|
-
/* @__PURE__ */ (0,
|
|
4785
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "ss-w-cpath", "data-testid": "game-screen-career-path", children: [
|
|
4786
|
+
!config && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "ss-w-gscreen-body", children: "Loading\u2026" }),
|
|
4787
|
+
config && /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(import_jsx_runtime58.Fragment, { children: [
|
|
4788
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "ss-w-cpath-head", children: [
|
|
4789
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { children: [
|
|
4790
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "ss-w-cpath-title", children: "Career Path" }),
|
|
4791
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "ss-w-cpath-sub", children: "Guess the mystery player from the clubs they've played for, oldest first." })
|
|
4682
4792
|
] }),
|
|
4683
|
-
clientState && !isOver && /* @__PURE__ */ (0,
|
|
4793
|
+
clientState && !isOver && /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("span", { className: "ss-w-cpath-left", children: [
|
|
4684
4794
|
clientState.guessesRemaining,
|
|
4685
4795
|
" left"
|
|
4686
4796
|
] })
|
|
4687
4797
|
] }),
|
|
4688
|
-
/* @__PURE__ */ (0,
|
|
4689
|
-
/* @__PURE__ */ (0,
|
|
4690
|
-
i > 0 && /* @__PURE__ */ (0,
|
|
4691
|
-
/* @__PURE__ */ (0,
|
|
4798
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "ss-w-gscroll", children: [
|
|
4799
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "ss-w-cpath-seq", children: visiblePath.map((spell, i) => /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(import_react31.Fragment, { children: [
|
|
4800
|
+
i > 0 && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "ss-w-cpath-arrow", "aria-hidden": "true", children: "\u203A" }),
|
|
4801
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(ClubSpellCard, { spell })
|
|
4692
4802
|
] }, `${spell.clubName}-${i}`)) }),
|
|
4693
|
-
clientState?.hintLine && !isOver && /* @__PURE__ */ (0,
|
|
4803
|
+
clientState?.hintLine && !isOver && /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "ss-w-cpath-hint", children: [
|
|
4694
4804
|
"\u{1F4A1} ",
|
|
4695
4805
|
clientState.hintLine
|
|
4696
4806
|
] }),
|
|
4697
|
-
isOver && clientState && /* @__PURE__ */ (0,
|
|
4698
|
-
/* @__PURE__ */ (0,
|
|
4699
|
-
clientState.revealedPlayerName && /* @__PURE__ */ (0,
|
|
4700
|
-
/* @__PURE__ */ (0,
|
|
4807
|
+
isOver && clientState && /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: `ss-w-cpath-banner ss-w-cpath-banner--${clientState.solved ? "solved" : "failed"}`, children: [
|
|
4808
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "ss-w-cpath-banner-label", children: clientState.solved ? "\u2705 Career traced!" : "\u{1F614} Out of guesses" }),
|
|
4809
|
+
clientState.revealedPlayerName && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "ss-w-cpath-banner-name", children: clientState.revealedPlayerName }),
|
|
4810
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "ss-w-cpath-banner-sub", children: [
|
|
4701
4811
|
clientState.guessesUsed,
|
|
4702
4812
|
" guess",
|
|
4703
4813
|
clientState.guessesUsed === 1 ? "" : "es",
|
|
@@ -4705,8 +4815,8 @@ function CareerPathGame({
|
|
|
4705
4815
|
] })
|
|
4706
4816
|
] })
|
|
4707
4817
|
] }),
|
|
4708
|
-
!isOver && /* @__PURE__ */ (0,
|
|
4709
|
-
/* @__PURE__ */ (0,
|
|
4818
|
+
!isOver && /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "ss-w-gpin ss-w-gtta", children: [
|
|
4819
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
4710
4820
|
"input",
|
|
4711
4821
|
{
|
|
4712
4822
|
id: inputId,
|
|
@@ -4722,7 +4832,7 @@ function CareerPathGame({
|
|
|
4722
4832
|
"aria-autocomplete": "list"
|
|
4723
4833
|
}
|
|
4724
4834
|
),
|
|
4725
|
-
query.length > 0 && filtered.length > 0 && /* @__PURE__ */ (0,
|
|
4835
|
+
query.length > 0 && filtered.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "ss-w-gtta-drop", role: "listbox", children: filtered.map((p) => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
4726
4836
|
"div",
|
|
4727
4837
|
{
|
|
4728
4838
|
className: "ss-w-gtta-opt",
|
|
@@ -4743,8 +4853,8 @@ function CareerPathGame({
|
|
|
4743
4853
|
}
|
|
4744
4854
|
|
|
4745
4855
|
// src/components/games/BeatTheGridGame.tsx
|
|
4746
|
-
var
|
|
4747
|
-
var
|
|
4856
|
+
var import_react32 = __toESM(require("react"), 1);
|
|
4857
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
4748
4858
|
function parseClientState4(json) {
|
|
4749
4859
|
if (!json) return null;
|
|
4750
4860
|
try {
|
|
@@ -4775,19 +4885,19 @@ function SearchSheet({
|
|
|
4775
4885
|
onPick,
|
|
4776
4886
|
onDismiss
|
|
4777
4887
|
}) {
|
|
4778
|
-
const [query, setQuery] = (0,
|
|
4779
|
-
const inputId = (0,
|
|
4888
|
+
const [query, setQuery] = (0, import_react32.useState)("");
|
|
4889
|
+
const inputId = (0, import_react32.useId)();
|
|
4780
4890
|
const filtered = playerPool.filter(
|
|
4781
4891
|
(p) => !alreadyFilledIds.has(p.id) && p.name.toLowerCase().includes(query.toLowerCase())
|
|
4782
4892
|
);
|
|
4783
|
-
return /* @__PURE__ */ (0,
|
|
4784
|
-
/* @__PURE__ */ (0,
|
|
4785
|
-
/* @__PURE__ */ (0,
|
|
4786
|
-
/* @__PURE__ */ (0,
|
|
4787
|
-
/* @__PURE__ */ (0,
|
|
4788
|
-
/* @__PURE__ */ (0,
|
|
4893
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "ss-w-btg-sheet", "data-testid": "btg-search-sheet", children: [
|
|
4894
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "ss-w-btg-sheet-hdr", children: [
|
|
4895
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "ss-w-btg-sheet-ctx", children: [
|
|
4896
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "ss-w-btg-sheet-row", children: rowLabel }),
|
|
4897
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "ss-w-btg-sheet-sep", children: "\xD7" }),
|
|
4898
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "ss-w-btg-sheet-col", children: colLabel })
|
|
4789
4899
|
] }),
|
|
4790
|
-
/* @__PURE__ */ (0,
|
|
4900
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
4791
4901
|
"button",
|
|
4792
4902
|
{
|
|
4793
4903
|
type: "button",
|
|
@@ -4799,8 +4909,8 @@ function SearchSheet({
|
|
|
4799
4909
|
}
|
|
4800
4910
|
)
|
|
4801
4911
|
] }),
|
|
4802
|
-
playerPool.length === 0 ? /* @__PURE__ */ (0,
|
|
4803
|
-
/* @__PURE__ */ (0,
|
|
4912
|
+
playerPool.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "ss-w-btg-sheet-empty", children: "No players available to search yet." }) : /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "ss-w-gtta", children: [
|
|
4913
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
4804
4914
|
"input",
|
|
4805
4915
|
{
|
|
4806
4916
|
id: inputId,
|
|
@@ -4816,7 +4926,7 @@ function SearchSheet({
|
|
|
4816
4926
|
autoFocus: true
|
|
4817
4927
|
}
|
|
4818
4928
|
),
|
|
4819
|
-
query.length > 0 && filtered.length > 0 && /* @__PURE__ */ (0,
|
|
4929
|
+
query.length > 0 && filtered.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "ss-w-gtta-drop ss-w-btg-ta-list", role: "listbox", children: filtered.map((p) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
4820
4930
|
"div",
|
|
4821
4931
|
{
|
|
4822
4932
|
className: "ss-w-gtta-opt",
|
|
@@ -4841,7 +4951,7 @@ function BeatTheGridGame({
|
|
|
4841
4951
|
onSubmit,
|
|
4842
4952
|
playerPool
|
|
4843
4953
|
}) {
|
|
4844
|
-
const [activeCell, setActiveCell] = (0,
|
|
4954
|
+
const [activeCell, setActiveCell] = (0, import_react32.useState)(null);
|
|
4845
4955
|
const clientState = parseClientState4(result?.clientStateJson);
|
|
4846
4956
|
const filledCells = clientState?.cells ?? [];
|
|
4847
4957
|
const isLocked2 = result?.alreadyPlayed === true || clientState?.isComplete === true;
|
|
@@ -4859,22 +4969,22 @@ function BeatTheGridGame({
|
|
|
4859
4969
|
onSubmit(JSON.stringify({ cells: newCells }));
|
|
4860
4970
|
}
|
|
4861
4971
|
if (!config) {
|
|
4862
|
-
return /* @__PURE__ */ (0,
|
|
4972
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "ss-w-btg", "data-testid": "game-screen-beat-the-grid", children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "ss-w-gscreen-body", children: "Loading\u2026" }) });
|
|
4863
4973
|
}
|
|
4864
4974
|
const rows = config.rows;
|
|
4865
4975
|
const cols = config.cols;
|
|
4866
|
-
return /* @__PURE__ */ (0,
|
|
4867
|
-
/* @__PURE__ */ (0,
|
|
4868
|
-
/* @__PURE__ */ (0,
|
|
4869
|
-
/* @__PURE__ */ (0,
|
|
4870
|
-
/* @__PURE__ */ (0,
|
|
4976
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "ss-w-btg", "data-testid": "game-screen-beat-the-grid", children: [
|
|
4977
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "ss-w-btg-head", children: [
|
|
4978
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { children: [
|
|
4979
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "ss-w-btg-title", children: "Beat the Grid" }),
|
|
4980
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "ss-w-btg-sub", children: "Fill each cell with a player who fits" })
|
|
4871
4981
|
] }),
|
|
4872
|
-
/* @__PURE__ */ (0,
|
|
4873
|
-
/* @__PURE__ */ (0,
|
|
4982
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "ss-w-btg-ctx", children: [
|
|
4983
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("span", { className: "ss-w-btg-ctx-score", children: [
|
|
4874
4984
|
clientState?.totalScore ?? 0,
|
|
4875
4985
|
" pts"
|
|
4876
4986
|
] }),
|
|
4877
|
-
!isLocked2 && /* @__PURE__ */ (0,
|
|
4987
|
+
!isLocked2 && /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("span", { className: "ss-w-btg-ctx-left", children: [
|
|
4878
4988
|
config.maxGuesses - filledCells.length,
|
|
4879
4989
|
" cell",
|
|
4880
4990
|
config.maxGuesses - filledCells.length !== 1 ? "s" : "",
|
|
@@ -4882,22 +4992,22 @@ function BeatTheGridGame({
|
|
|
4882
4992
|
] })
|
|
4883
4993
|
] })
|
|
4884
4994
|
] }),
|
|
4885
|
-
/* @__PURE__ */ (0,
|
|
4886
|
-
/* @__PURE__ */ (0,
|
|
4995
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "ss-w-gscroll", children: [
|
|
4996
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
4887
4997
|
"div",
|
|
4888
4998
|
{
|
|
4889
4999
|
className: "ss-w-btg-grid",
|
|
4890
5000
|
style: { gridTemplateColumns: `auto repeat(${cols.length}, 1fr)` },
|
|
4891
5001
|
role: "grid",
|
|
4892
5002
|
children: [
|
|
4893
|
-
/* @__PURE__ */ (0,
|
|
4894
|
-
cols.map((col) => /* @__PURE__ */ (0,
|
|
4895
|
-
rows.map((rowLabel, rowIdx) => /* @__PURE__ */ (0,
|
|
4896
|
-
/* @__PURE__ */ (0,
|
|
5003
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "ss-w-btg-gc ss-w-btg-gc--corner" }),
|
|
5004
|
+
cols.map((col) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "ss-w-btg-gc ss-w-btg-gc--colhdr", children: col }, col)),
|
|
5005
|
+
rows.map((rowLabel, rowIdx) => /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(import_react32.default.Fragment, { children: [
|
|
5006
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "ss-w-btg-gc ss-w-btg-gc--rowhdr", children: rowLabel }),
|
|
4897
5007
|
cols.map((colLabel, colIdx) => {
|
|
4898
5008
|
const filled = findCellResult(filledCells, rowIdx, colIdx);
|
|
4899
5009
|
const isActive = activeCell?.row === rowIdx && activeCell?.col === colIdx;
|
|
4900
|
-
return /* @__PURE__ */ (0,
|
|
5010
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
4901
5011
|
"button",
|
|
4902
5012
|
{
|
|
4903
5013
|
type: "button",
|
|
@@ -4910,13 +5020,13 @@ function BeatTheGridGame({
|
|
|
4910
5020
|
].filter(Boolean).join(" "),
|
|
4911
5021
|
disabled: isLocked2 || submitting,
|
|
4912
5022
|
onClick: () => handleCellClick(rowIdx, colIdx),
|
|
4913
|
-
children: filled ? /* @__PURE__ */ (0,
|
|
4914
|
-
/* @__PURE__ */ (0,
|
|
4915
|
-
/* @__PURE__ */ (0,
|
|
5023
|
+
children: filled ? /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(import_jsx_runtime59.Fragment, { children: [
|
|
5024
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "ss-w-btg-cell-nm", children: shortName(playerPool.find((p) => p.id === filled.playerId)?.name) }),
|
|
5025
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("span", { className: "ss-w-btg-cell-score", children: [
|
|
4916
5026
|
filled.rarityScore,
|
|
4917
|
-
filled.isCorrect && /* @__PURE__ */ (0,
|
|
5027
|
+
filled.isCorrect && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "ss-w-btg-cell-check", "aria-hidden": "true", children: " \u2713" })
|
|
4918
5028
|
] })
|
|
4919
|
-
] }) : /* @__PURE__ */ (0,
|
|
5029
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "ss-w-btg-cell-empty", "aria-hidden": "true", children: "+" })
|
|
4920
5030
|
},
|
|
4921
5031
|
`cell-${rowIdx}-${colIdx}`
|
|
4922
5032
|
);
|
|
@@ -4925,10 +5035,10 @@ function BeatTheGridGame({
|
|
|
4925
5035
|
]
|
|
4926
5036
|
}
|
|
4927
5037
|
),
|
|
4928
|
-
isLocked2 && /* @__PURE__ */ (0,
|
|
4929
|
-
/* @__PURE__ */ (0,
|
|
4930
|
-
/* @__PURE__ */ (0,
|
|
4931
|
-
/* @__PURE__ */ (0,
|
|
5038
|
+
isLocked2 && /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "ss-w-btg-done", children: [
|
|
5039
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "ss-w-btg-done-label", children: "\u{1F532} Grid complete" }),
|
|
5040
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "ss-w-btg-done-score", children: clientState?.totalScore ?? 0 }),
|
|
5041
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "ss-w-btg-done-sub", children: [
|
|
4932
5042
|
filledCells.filter((c) => c.isCorrect).length,
|
|
4933
5043
|
"/",
|
|
4934
5044
|
filledCells.length,
|
|
@@ -4936,7 +5046,7 @@ function BeatTheGridGame({
|
|
|
4936
5046
|
] })
|
|
4937
5047
|
] })
|
|
4938
5048
|
] }),
|
|
4939
|
-
activeCell !== null && /* @__PURE__ */ (0,
|
|
5049
|
+
activeCell !== null && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "ss-w-gpin", children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
4940
5050
|
SearchSheet,
|
|
4941
5051
|
{
|
|
4942
5052
|
row: activeCell.row,
|
|
@@ -4953,9 +5063,9 @@ function BeatTheGridGame({
|
|
|
4953
5063
|
}
|
|
4954
5064
|
|
|
4955
5065
|
// src/components/games/GuessTheXiGame.tsx
|
|
4956
|
-
var
|
|
4957
|
-
var
|
|
4958
|
-
var
|
|
5066
|
+
var import_react33 = require("react");
|
|
5067
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
5068
|
+
var MAX_GUESSES2 = 3;
|
|
4959
5069
|
function parseClientState5(json) {
|
|
4960
5070
|
if (!json) return null;
|
|
4961
5071
|
try {
|
|
@@ -5021,8 +5131,8 @@ function GuessTheXiGame({
|
|
|
5021
5131
|
submitting,
|
|
5022
5132
|
onSubmit
|
|
5023
5133
|
}) {
|
|
5024
|
-
const [query, setQuery] = (0,
|
|
5025
|
-
const inputId = (0,
|
|
5134
|
+
const [query, setQuery] = (0, import_react33.useState)("");
|
|
5135
|
+
const inputId = (0, import_react33.useId)();
|
|
5026
5136
|
const clientState = parseClientState5(result?.clientStateJson);
|
|
5027
5137
|
const isOver = result?.alreadyPlayed === true || clientState?.status === "solved" || clientState?.status === "failed";
|
|
5028
5138
|
const solved = clientState?.status === "solved";
|
|
@@ -5046,31 +5156,31 @@ function GuessTheXiGame({
|
|
|
5046
5156
|
}
|
|
5047
5157
|
const wrongGuesses = (clientState?.guessHistory ?? []).filter((g) => !g.wasCorrect);
|
|
5048
5158
|
const revealCount = nameBySlot.size;
|
|
5049
|
-
return /* @__PURE__ */ (0,
|
|
5050
|
-
!config && /* @__PURE__ */ (0,
|
|
5051
|
-
config && /* @__PURE__ */ (0,
|
|
5052
|
-
/* @__PURE__ */ (0,
|
|
5053
|
-
/* @__PURE__ */ (0,
|
|
5054
|
-
/* @__PURE__ */ (0,
|
|
5159
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "ss-w-gxi", "data-testid": "game-screen-guess-the-xi", children: [
|
|
5160
|
+
!config && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "ss-w-gscreen-body", children: "Loading\u2026" }),
|
|
5161
|
+
config && /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_jsx_runtime60.Fragment, { children: [
|
|
5162
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "ss-w-gxi-head", children: [
|
|
5163
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { children: [
|
|
5164
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "ss-w-gxi-title", children: [
|
|
5055
5165
|
"Guess the XI",
|
|
5056
|
-
formation && /* @__PURE__ */ (0,
|
|
5166
|
+
formation && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { className: "ss-w-gxi-form", "aria-label": `Formation ${formation}`, children: formation })
|
|
5057
5167
|
] }),
|
|
5058
|
-
/* @__PURE__ */ (0,
|
|
5168
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "ss-w-gxi-sub", children: [
|
|
5059
5169
|
"Name the team \xB7 flags are each player's nationality \xB7 ",
|
|
5060
5170
|
config.poolLabel
|
|
5061
5171
|
] })
|
|
5062
5172
|
] }),
|
|
5063
|
-
clientState && !isOver && /* @__PURE__ */ (0,
|
|
5064
|
-
Math.max(0,
|
|
5173
|
+
clientState && !isOver && /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("span", { className: "ss-w-gxi-left", children: [
|
|
5174
|
+
Math.max(0, MAX_GUESSES2 - clientState.guessesUsed),
|
|
5065
5175
|
" left"
|
|
5066
5176
|
] })
|
|
5067
5177
|
] }),
|
|
5068
|
-
/* @__PURE__ */ (0,
|
|
5069
|
-
rows.length > 0 && /* @__PURE__ */ (0,
|
|
5178
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "ss-w-gscroll", children: [
|
|
5179
|
+
rows.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "ss-w-gxi-pitch", children: rows.map((row, r) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "ss-w-gxi-prow", children: row.map((pos, c) => {
|
|
5070
5180
|
const posLabel = pos.slot ? posBySlot.get(pos.slot) ?? "" : "";
|
|
5071
5181
|
const name = pos.slot ? nameBySlot.get(pos.slot) : void 0;
|
|
5072
|
-
return /* @__PURE__ */ (0,
|
|
5073
|
-
/* @__PURE__ */ (0,
|
|
5182
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "ss-w-gxi-slot", children: [
|
|
5183
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
5074
5184
|
"div",
|
|
5075
5185
|
{
|
|
5076
5186
|
className: `ss-w-gxi-flag${name ? " ss-w-gxi-flag--revealed" : ""}`,
|
|
@@ -5079,25 +5189,25 @@ function GuessTheXiGame({
|
|
|
5079
5189
|
children: nationalityFlag(pos.nationality)
|
|
5080
5190
|
}
|
|
5081
5191
|
),
|
|
5082
|
-
posLabel && /* @__PURE__ */ (0,
|
|
5083
|
-
name && /* @__PURE__ */ (0,
|
|
5192
|
+
posLabel && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { className: "ss-w-gxi-pos", children: posLabel }),
|
|
5193
|
+
name && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { className: "ss-w-gxi-flag-lab", children: surname(name) })
|
|
5084
5194
|
] }, `${pos.slot}-${c}`);
|
|
5085
5195
|
}) }, r)) }),
|
|
5086
|
-
revealCount > 0 && !isOver && /* @__PURE__ */ (0,
|
|
5196
|
+
revealCount > 0 && !isOver && /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "ss-w-gxi-revnote", children: [
|
|
5087
5197
|
"\u{1F50E} ",
|
|
5088
5198
|
revealCount,
|
|
5089
5199
|
" player",
|
|
5090
5200
|
revealCount === 1 ? "" : "s",
|
|
5091
5201
|
" revealed \u2014 highlighted on the pitch"
|
|
5092
5202
|
] }),
|
|
5093
|
-
!isOver && wrongGuesses.length > 0 && /* @__PURE__ */ (0,
|
|
5203
|
+
!isOver && wrongGuesses.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "ss-w-gxi-wrong", children: wrongGuesses.map((g) => {
|
|
5094
5204
|
const team = config.teamPool.find((t) => t.teamId === g.teamId);
|
|
5095
|
-
return /* @__PURE__ */ (0,
|
|
5205
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { className: "ss-w-gxi-wrong-pill", children: team?.teamName ?? `#${g.teamId}` }, g.teamId);
|
|
5096
5206
|
}) }),
|
|
5097
|
-
isOver && clientState && /* @__PURE__ */ (0,
|
|
5098
|
-
/* @__PURE__ */ (0,
|
|
5099
|
-
/* @__PURE__ */ (0,
|
|
5100
|
-
/* @__PURE__ */ (0,
|
|
5207
|
+
isOver && clientState && /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: `ss-w-gxi-banner ss-w-gxi-banner--${solved ? "solved" : "failed"}`, children: [
|
|
5208
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "ss-w-gxi-banner-label", children: solved ? "\u2705 Solved!" : "\u{1F614} Out of guesses" }),
|
|
5209
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "ss-w-gxi-banner-score", children: clientState.score }),
|
|
5210
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "ss-w-gxi-banner-sub", children: [
|
|
5101
5211
|
clientState.guessesUsed,
|
|
5102
5212
|
" guess",
|
|
5103
5213
|
clientState.guessesUsed === 1 ? "" : "es",
|
|
@@ -5105,8 +5215,8 @@ function GuessTheXiGame({
|
|
|
5105
5215
|
] })
|
|
5106
5216
|
] })
|
|
5107
5217
|
] }),
|
|
5108
|
-
!isOver && /* @__PURE__ */ (0,
|
|
5109
|
-
/* @__PURE__ */ (0,
|
|
5218
|
+
!isOver && /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "ss-w-gpin ss-w-gtta", children: [
|
|
5219
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
5110
5220
|
"input",
|
|
5111
5221
|
{
|
|
5112
5222
|
id: inputId,
|
|
@@ -5122,7 +5232,7 @@ function GuessTheXiGame({
|
|
|
5122
5232
|
"aria-autocomplete": "list"
|
|
5123
5233
|
}
|
|
5124
5234
|
),
|
|
5125
|
-
query.length > 0 && filtered.length > 0 && /* @__PURE__ */ (0,
|
|
5235
|
+
query.length > 0 && filtered.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "ss-w-gtta-drop", role: "listbox", children: filtered.map((t) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
5126
5236
|
"div",
|
|
5127
5237
|
{
|
|
5128
5238
|
className: "ss-w-gtta-opt",
|
|
@@ -5143,8 +5253,8 @@ function GuessTheXiGame({
|
|
|
5143
5253
|
}
|
|
5144
5254
|
|
|
5145
5255
|
// src/components/games/DailyQuizGame.tsx
|
|
5146
|
-
var
|
|
5147
|
-
var
|
|
5256
|
+
var import_react34 = require("react");
|
|
5257
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
5148
5258
|
function parseClientState6(json) {
|
|
5149
5259
|
if (!json) return null;
|
|
5150
5260
|
try {
|
|
@@ -5162,7 +5272,7 @@ function DailyQuizGame({
|
|
|
5162
5272
|
submitting,
|
|
5163
5273
|
onSubmit
|
|
5164
5274
|
}) {
|
|
5165
|
-
const [selections, setSelections] = (0,
|
|
5275
|
+
const [selections, setSelections] = (0, import_react34.useState)(/* @__PURE__ */ new Map());
|
|
5166
5276
|
const clientState = parseClientState6(result?.clientStateJson);
|
|
5167
5277
|
const isRevealed = (clientState?.results.length ?? 0) > 0 || result?.alreadyPlayed === true;
|
|
5168
5278
|
const allAnswered = config != null && selections.size === config.questions.length;
|
|
@@ -5178,26 +5288,26 @@ function DailyQuizGame({
|
|
|
5178
5288
|
}));
|
|
5179
5289
|
onSubmit(JSON.stringify({ answers }));
|
|
5180
5290
|
}
|
|
5181
|
-
return /* @__PURE__ */ (0,
|
|
5182
|
-
!config && /* @__PURE__ */ (0,
|
|
5183
|
-
config && /* @__PURE__ */ (0,
|
|
5184
|
-
isRevealed && result?.score != null && /* @__PURE__ */ (0,
|
|
5185
|
-
/* @__PURE__ */ (0,
|
|
5186
|
-
/* @__PURE__ */ (0,
|
|
5291
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "ss-w-dq", "data-testid": "game-screen-daily-quiz", children: [
|
|
5292
|
+
!config && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "ss-w-gscreen-body", children: "Loading\u2026" }),
|
|
5293
|
+
config && /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(import_jsx_runtime61.Fragment, { children: [
|
|
5294
|
+
isRevealed && result?.score != null && /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "ss-w-dq-score", children: [
|
|
5295
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("span", { className: "ss-w-dq-score-val", children: result.score }),
|
|
5296
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("span", { className: "ss-w-dq-score-label", children: "pts" })
|
|
5187
5297
|
] }),
|
|
5188
|
-
!isRevealed && /* @__PURE__ */ (0,
|
|
5298
|
+
!isRevealed && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "ss-w-dq-prog", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
5189
5299
|
"div",
|
|
5190
5300
|
{
|
|
5191
5301
|
className: "ss-w-dq-prog-fill",
|
|
5192
5302
|
style: { width: `${Math.round(selections.size / config.questions.length * 100)}%` }
|
|
5193
5303
|
}
|
|
5194
5304
|
) }),
|
|
5195
|
-
/* @__PURE__ */ (0,
|
|
5305
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "ss-w-dq-questions", children: config.questions.map((q) => {
|
|
5196
5306
|
const qResult = clientState ? findResult(clientState.results, q.index) : void 0;
|
|
5197
5307
|
const selectedIdx = selections.get(q.index);
|
|
5198
|
-
return /* @__PURE__ */ (0,
|
|
5199
|
-
/* @__PURE__ */ (0,
|
|
5200
|
-
/* @__PURE__ */ (0,
|
|
5308
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "ss-w-dq-q", children: [
|
|
5309
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "ss-w-dq-qstem", children: q.stem }),
|
|
5310
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "ss-w-dq-opts", children: q.options.map((opt, optIdx) => {
|
|
5201
5311
|
let optCls = "ss-w-dq-qopt";
|
|
5202
5312
|
if (qResult) {
|
|
5203
5313
|
if (optIdx === qResult.correctOptionIndex) {
|
|
@@ -5208,7 +5318,7 @@ function DailyQuizGame({
|
|
|
5208
5318
|
} else if (optIdx === selectedIdx) {
|
|
5209
5319
|
optCls += " ss-w-dq-qopt--selected";
|
|
5210
5320
|
}
|
|
5211
|
-
return /* @__PURE__ */ (0,
|
|
5321
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
|
|
5212
5322
|
"button",
|
|
5213
5323
|
{
|
|
5214
5324
|
type: "button",
|
|
@@ -5216,17 +5326,17 @@ function DailyQuizGame({
|
|
|
5216
5326
|
disabled: isRevealed || submitting,
|
|
5217
5327
|
onClick: () => handleSelect(q.index, optIdx),
|
|
5218
5328
|
children: [
|
|
5219
|
-
/* @__PURE__ */ (0,
|
|
5220
|
-
/* @__PURE__ */ (0,
|
|
5329
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("span", { className: "ss-w-dq-qopt-letter", children: String.fromCharCode(65 + optIdx) }),
|
|
5330
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("span", { className: "ss-w-dq-qopt-text", children: opt })
|
|
5221
5331
|
]
|
|
5222
5332
|
},
|
|
5223
5333
|
optIdx
|
|
5224
5334
|
);
|
|
5225
5335
|
}) }),
|
|
5226
|
-
qResult?.revealText && /* @__PURE__ */ (0,
|
|
5336
|
+
qResult?.revealText && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: `ss-w-dq-qwhy ss-w-dq-qwhy--${qResult.isCorrect ? "correct" : "wrong"}`, children: qResult.revealText })
|
|
5227
5337
|
] }, q.index);
|
|
5228
5338
|
}) }),
|
|
5229
|
-
!isRevealed && /* @__PURE__ */ (0,
|
|
5339
|
+
!isRevealed && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
5230
5340
|
"button",
|
|
5231
5341
|
{
|
|
5232
5342
|
type: "button",
|
|
@@ -5242,8 +5352,8 @@ function DailyQuizGame({
|
|
|
5242
5352
|
}
|
|
5243
5353
|
|
|
5244
5354
|
// src/components/games/MatchdayPredictorGame.tsx
|
|
5245
|
-
var
|
|
5246
|
-
var
|
|
5355
|
+
var import_react35 = require("react");
|
|
5356
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
5247
5357
|
function parseClientState7(json) {
|
|
5248
5358
|
if (!json) return null;
|
|
5249
5359
|
try {
|
|
@@ -5265,54 +5375,54 @@ function MatchdayPredictorGame({
|
|
|
5265
5375
|
submitting,
|
|
5266
5376
|
onSubmit
|
|
5267
5377
|
}) {
|
|
5268
|
-
const [homeScore, setHomeScore] = (0,
|
|
5269
|
-
const [awayScore, setAwayScore] = (0,
|
|
5270
|
-
const [firstScorerPlayerId, setFirstScorerPlayerId] = (0,
|
|
5378
|
+
const [homeScore, setHomeScore] = (0, import_react35.useState)(0);
|
|
5379
|
+
const [awayScore, setAwayScore] = (0, import_react35.useState)(0);
|
|
5380
|
+
const [firstScorerPlayerId, setFirstScorerPlayerId] = (0, import_react35.useState)(null);
|
|
5271
5381
|
const clientState = parseClientState7(result?.clientStateJson);
|
|
5272
5382
|
const alreadyPlayed = result?.alreadyPlayed === true;
|
|
5273
5383
|
if (alreadyPlayed && clientState) {
|
|
5274
5384
|
if (!clientState.graded) {
|
|
5275
|
-
return /* @__PURE__ */ (0,
|
|
5276
|
-
/* @__PURE__ */ (0,
|
|
5277
|
-
/* @__PURE__ */ (0,
|
|
5385
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "ss-w-mp", "data-testid": "game-screen-matchday-predictor", children: [
|
|
5386
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "ss-w-mp-live", children: [
|
|
5387
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "ss-w-mp-live-score", children: [
|
|
5278
5388
|
clientState.predictedHomeScore,
|
|
5279
5389
|
" \u2013 ",
|
|
5280
5390
|
clientState.predictedAwayScore
|
|
5281
5391
|
] }),
|
|
5282
|
-
/* @__PURE__ */ (0,
|
|
5392
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "ss-w-mp-live-label", children: "Locked in \u2014 awaiting result" })
|
|
5283
5393
|
] }),
|
|
5284
|
-
/* @__PURE__ */ (0,
|
|
5394
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "ss-w-mp-fun", children: "For fun \u2014 not in the leaderboard" })
|
|
5285
5395
|
] });
|
|
5286
5396
|
}
|
|
5287
5397
|
const r = clientState.result;
|
|
5288
5398
|
const actualScore = `${r.homeScore} \u2013 ${r.awayScore}`;
|
|
5289
|
-
return /* @__PURE__ */ (0,
|
|
5290
|
-
/* @__PURE__ */ (0,
|
|
5291
|
-
/* @__PURE__ */ (0,
|
|
5292
|
-
/* @__PURE__ */ (0,
|
|
5293
|
-
/* @__PURE__ */ (0,
|
|
5294
|
-
/* @__PURE__ */ (0,
|
|
5295
|
-
/* @__PURE__ */ (0,
|
|
5296
|
-
/* @__PURE__ */ (0,
|
|
5399
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "ss-w-mp", "data-testid": "game-screen-matchday-predictor", children: [
|
|
5400
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "ss-w-mp-live", children: [
|
|
5401
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "ss-w-mp-live-score", children: actualScore }),
|
|
5402
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "ss-w-mp-live-label", children: "Full-time result" }),
|
|
5403
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "ss-w-mp-live-outcome", children: [
|
|
5404
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: `ss-w-mp-live-row${clientState.exactScoreCorrect ? " ss-w-mp-live-row--correct" : ""}`, children: [
|
|
5405
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { className: "ss-w-mp-live-row-key", children: "Exact score" }),
|
|
5406
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { className: "ss-w-mp-live-row-val", children: clientState.exactScoreCorrect ? "\u2713" : "\u2717" })
|
|
5297
5407
|
] }),
|
|
5298
|
-
/* @__PURE__ */ (0,
|
|
5299
|
-
/* @__PURE__ */ (0,
|
|
5300
|
-
/* @__PURE__ */ (0,
|
|
5408
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: `ss-w-mp-live-row${clientState.outcomeCorrect ? " ss-w-mp-live-row--correct" : ""}`, children: [
|
|
5409
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { className: "ss-w-mp-live-row-key", children: "Result (W/D/L)" }),
|
|
5410
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { className: "ss-w-mp-live-row-val", children: clientState.outcomeCorrect ? "\u2713" : "\u2717" })
|
|
5301
5411
|
] }),
|
|
5302
|
-
!clientState.firstScorerVoid && /* @__PURE__ */ (0,
|
|
5303
|
-
/* @__PURE__ */ (0,
|
|
5304
|
-
/* @__PURE__ */ (0,
|
|
5412
|
+
!clientState.firstScorerVoid && /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: `ss-w-mp-live-row${clientState.firstScorerCorrect ? " ss-w-mp-live-row--correct" : ""}`, children: [
|
|
5413
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { className: "ss-w-mp-live-row-key", children: "First scorer" }),
|
|
5414
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("span", { className: "ss-w-mp-live-row-val", children: [
|
|
5305
5415
|
clientState.firstScorerCorrect ? "\u2713" : "\u2717",
|
|
5306
5416
|
r.firstScorerName ? ` ${r.firstScorerName}` : ""
|
|
5307
5417
|
] })
|
|
5308
5418
|
] })
|
|
5309
5419
|
] })
|
|
5310
5420
|
] }),
|
|
5311
|
-
/* @__PURE__ */ (0,
|
|
5421
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "ss-w-mp-fun", children: "For fun \u2014 not in the leaderboard" })
|
|
5312
5422
|
] });
|
|
5313
5423
|
}
|
|
5314
5424
|
if (!config) {
|
|
5315
|
-
return /* @__PURE__ */ (0,
|
|
5425
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "ss-w-mp", "data-testid": "game-screen-matchday-predictor", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "ss-w-gscreen-body", children: "Loading\u2026" }) });
|
|
5316
5426
|
}
|
|
5317
5427
|
const locked = isLocked(config.kickoffUtc);
|
|
5318
5428
|
const disabled = locked || submitting;
|
|
@@ -5326,12 +5436,12 @@ function MatchdayPredictorGame({
|
|
|
5326
5436
|
})
|
|
5327
5437
|
);
|
|
5328
5438
|
}
|
|
5329
|
-
return /* @__PURE__ */ (0,
|
|
5330
|
-
/* @__PURE__ */ (0,
|
|
5331
|
-
/* @__PURE__ */ (0,
|
|
5332
|
-
/* @__PURE__ */ (0,
|
|
5333
|
-
/* @__PURE__ */ (0,
|
|
5334
|
-
/* @__PURE__ */ (0,
|
|
5439
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "ss-w-mp", "data-testid": "game-screen-matchday-predictor", children: [
|
|
5440
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "ss-w-mp-pred-score", children: [
|
|
5441
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "ss-w-mp-team", children: [
|
|
5442
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "ss-w-mp-team-name", children: config.homeTeam.name }),
|
|
5443
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "ss-w-mp-stepper", children: [
|
|
5444
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
5335
5445
|
"button",
|
|
5336
5446
|
{
|
|
5337
5447
|
type: "button",
|
|
@@ -5342,8 +5452,8 @@ function MatchdayPredictorGame({
|
|
|
5342
5452
|
children: "\u2212"
|
|
5343
5453
|
}
|
|
5344
5454
|
),
|
|
5345
|
-
/* @__PURE__ */ (0,
|
|
5346
|
-
/* @__PURE__ */ (0,
|
|
5455
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { className: "ss-w-mp-stepper-val", children: homeScore }),
|
|
5456
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
5347
5457
|
"button",
|
|
5348
5458
|
{
|
|
5349
5459
|
type: "button",
|
|
@@ -5356,11 +5466,11 @@ function MatchdayPredictorGame({
|
|
|
5356
5466
|
)
|
|
5357
5467
|
] })
|
|
5358
5468
|
] }),
|
|
5359
|
-
/* @__PURE__ */ (0,
|
|
5360
|
-
/* @__PURE__ */ (0,
|
|
5361
|
-
/* @__PURE__ */ (0,
|
|
5362
|
-
/* @__PURE__ */ (0,
|
|
5363
|
-
/* @__PURE__ */ (0,
|
|
5469
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { className: "ss-w-mp-sep", children: "\u2013" }),
|
|
5470
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "ss-w-mp-team", children: [
|
|
5471
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "ss-w-mp-team-name", children: config.awayTeam.name }),
|
|
5472
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "ss-w-mp-stepper", children: [
|
|
5473
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
5364
5474
|
"button",
|
|
5365
5475
|
{
|
|
5366
5476
|
type: "button",
|
|
@@ -5371,8 +5481,8 @@ function MatchdayPredictorGame({
|
|
|
5371
5481
|
children: "\u2212"
|
|
5372
5482
|
}
|
|
5373
5483
|
),
|
|
5374
|
-
/* @__PURE__ */ (0,
|
|
5375
|
-
/* @__PURE__ */ (0,
|
|
5484
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { className: "ss-w-mp-stepper-val", children: awayScore }),
|
|
5485
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
5376
5486
|
"button",
|
|
5377
5487
|
{
|
|
5378
5488
|
type: "button",
|
|
@@ -5386,9 +5496,9 @@ function MatchdayPredictorGame({
|
|
|
5386
5496
|
] })
|
|
5387
5497
|
] })
|
|
5388
5498
|
] }),
|
|
5389
|
-
config.scorerPool.length > 0 && /* @__PURE__ */ (0,
|
|
5390
|
-
/* @__PURE__ */ (0,
|
|
5391
|
-
/* @__PURE__ */ (0,
|
|
5499
|
+
config.scorerPool.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "ss-w-mp-scorer", children: [
|
|
5500
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "ss-w-mp-scorer-label", children: "First scorer (optional)" }),
|
|
5501
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "ss-w-mp-scorer-list", children: config.scorerPool.map((p) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
5392
5502
|
"button",
|
|
5393
5503
|
{
|
|
5394
5504
|
type: "button",
|
|
@@ -5400,8 +5510,8 @@ function MatchdayPredictorGame({
|
|
|
5400
5510
|
p.playerId
|
|
5401
5511
|
)) })
|
|
5402
5512
|
] }),
|
|
5403
|
-
locked && /* @__PURE__ */ (0,
|
|
5404
|
-
/* @__PURE__ */ (0,
|
|
5513
|
+
locked && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "ss-w-mp-live-label", children: "Submissions are now closed" }),
|
|
5514
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
5405
5515
|
"button",
|
|
5406
5516
|
{
|
|
5407
5517
|
type: "button",
|
|
@@ -5412,13 +5522,13 @@ function MatchdayPredictorGame({
|
|
|
5412
5522
|
children: submitting ? "Saving\u2026" : "Save prediction"
|
|
5413
5523
|
}
|
|
5414
5524
|
),
|
|
5415
|
-
/* @__PURE__ */ (0,
|
|
5525
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "ss-w-mp-fun", children: "For fun \u2014 not in the leaderboard" })
|
|
5416
5526
|
] });
|
|
5417
5527
|
}
|
|
5418
5528
|
|
|
5419
5529
|
// src/components/games/StartingXiGame.tsx
|
|
5420
|
-
var
|
|
5421
|
-
var
|
|
5530
|
+
var import_react36 = require("react");
|
|
5531
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
5422
5532
|
function parseClientState8(json) {
|
|
5423
5533
|
if (!json) return null;
|
|
5424
5534
|
try {
|
|
@@ -5438,24 +5548,24 @@ function StartingXiGame({
|
|
|
5438
5548
|
submitting,
|
|
5439
5549
|
onSubmit
|
|
5440
5550
|
}) {
|
|
5441
|
-
const [picked, setPicked] = (0,
|
|
5551
|
+
const [picked, setPicked] = (0, import_react36.useState)([]);
|
|
5442
5552
|
const clientState = parseClientState8(result?.clientStateJson);
|
|
5443
5553
|
const alreadyPlayed = result?.alreadyPlayed === true;
|
|
5444
5554
|
if (alreadyPlayed) {
|
|
5445
5555
|
if (!clientState) {
|
|
5446
|
-
return /* @__PURE__ */ (0,
|
|
5556
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "ss-w-sxi", "data-testid": "game-screen-starting-xi", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "ss-w-sxi-status", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "ss-w-sxi-status-label", children: "This game has been voided" }) }) });
|
|
5447
5557
|
}
|
|
5448
5558
|
if (clientState.status === "pending") {
|
|
5449
|
-
return /* @__PURE__ */ (0,
|
|
5559
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "ss-w-sxi", "data-testid": "game-screen-starting-xi", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "ss-w-sxi-status", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "ss-w-sxi-status-label", children: [
|
|
5450
5560
|
"Prediction locked in (",
|
|
5451
5561
|
clientState.predictedCount,
|
|
5452
5562
|
" players) \u2014 awaiting result"
|
|
5453
5563
|
] }) }) });
|
|
5454
5564
|
}
|
|
5455
5565
|
if (clientState.status === "graded") {
|
|
5456
|
-
return /* @__PURE__ */ (0,
|
|
5457
|
-
/* @__PURE__ */ (0,
|
|
5458
|
-
/* @__PURE__ */ (0,
|
|
5566
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "ss-w-sxi", "data-testid": "game-screen-starting-xi", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "ss-w-sxi-status ss-w-sxi-status--graded", children: [
|
|
5567
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "ss-w-sxi-status-score", children: clientState.score }),
|
|
5568
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "ss-w-sxi-status-label", children: [
|
|
5459
5569
|
clientState.correctCount,
|
|
5460
5570
|
" correct starters"
|
|
5461
5571
|
] })
|
|
@@ -5463,7 +5573,7 @@ function StartingXiGame({
|
|
|
5463
5573
|
}
|
|
5464
5574
|
}
|
|
5465
5575
|
if (!config) {
|
|
5466
|
-
return /* @__PURE__ */ (0,
|
|
5576
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "ss-w-sxi", "data-testid": "game-screen-starting-xi", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "ss-w-gscreen-body", children: "Loading\u2026" }) });
|
|
5467
5577
|
}
|
|
5468
5578
|
const formationRows = parseFormationRows(config.formation);
|
|
5469
5579
|
const pickedSet = new Set(picked);
|
|
@@ -5488,12 +5598,12 @@ function StartingXiGame({
|
|
|
5488
5598
|
slotIndex += count;
|
|
5489
5599
|
return { rowIdx, count, rowSlots };
|
|
5490
5600
|
});
|
|
5491
|
-
return /* @__PURE__ */ (0,
|
|
5492
|
-
/* @__PURE__ */ (0,
|
|
5493
|
-
/* @__PURE__ */ (0,
|
|
5601
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "ss-w-sxi", "data-testid": "game-screen-starting-xi", children: [
|
|
5602
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "ss-w-sxi-formation", children: config.formation }),
|
|
5603
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "ss-w-sxi-pitch", children: pitchRows.map(({ rowIdx, count, rowSlots }) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "ss-w-sxi-pitch-row", children: Array.from({ length: count }).map((_, i) => {
|
|
5494
5604
|
const playerId = rowSlots[i];
|
|
5495
5605
|
const player = playerId != null ? config.squadSheet.find((p) => p.playerId === playerId) : void 0;
|
|
5496
|
-
return /* @__PURE__ */ (0,
|
|
5606
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
|
|
5497
5607
|
"div",
|
|
5498
5608
|
{
|
|
5499
5609
|
className: `ss-w-sxi-pslot${player ? " ss-w-sxi-pslot--filled" : ""}`,
|
|
@@ -5507,16 +5617,16 @@ function StartingXiGame({
|
|
|
5507
5617
|
role: player ? "button" : void 0,
|
|
5508
5618
|
"aria-label": player ? `Remove ${player.playerName ?? ""}` : void 0,
|
|
5509
5619
|
children: [
|
|
5510
|
-
/* @__PURE__ */ (0,
|
|
5511
|
-
/* @__PURE__ */ (0,
|
|
5620
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "ss-w-sxi-pslot-num", children: player?.jerseyNumber ?? (rowIdx === 0 ? "GK" : "?") }),
|
|
5621
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "ss-w-sxi-pslot-name", children: player?.playerName ?? "" })
|
|
5512
5622
|
]
|
|
5513
5623
|
},
|
|
5514
5624
|
i
|
|
5515
5625
|
);
|
|
5516
5626
|
}) }, rowIdx)) }),
|
|
5517
|
-
/* @__PURE__ */ (0,
|
|
5627
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "ss-w-sxi-squad", children: config.squadSheet.map((p) => {
|
|
5518
5628
|
const isPicked = pickedSet.has(p.playerId);
|
|
5519
|
-
return /* @__PURE__ */ (0,
|
|
5629
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
|
|
5520
5630
|
"div",
|
|
5521
5631
|
{
|
|
5522
5632
|
className: `ss-w-sxi-squad-row${isPicked ? " ss-w-sxi-squad-row--picked" : ""}`,
|
|
@@ -5528,14 +5638,14 @@ function StartingXiGame({
|
|
|
5528
5638
|
role: "button",
|
|
5529
5639
|
"aria-pressed": isPicked,
|
|
5530
5640
|
children: [
|
|
5531
|
-
/* @__PURE__ */ (0,
|
|
5532
|
-
/* @__PURE__ */ (0,
|
|
5641
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "ss-w-sxi-squad-name", children: p.playerName }),
|
|
5642
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "ss-w-sxi-squad-pos", children: p.positionName })
|
|
5533
5643
|
]
|
|
5534
5644
|
},
|
|
5535
5645
|
p.playerId
|
|
5536
5646
|
);
|
|
5537
5647
|
}) }),
|
|
5538
|
-
/* @__PURE__ */ (0,
|
|
5648
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
5539
5649
|
"button",
|
|
5540
5650
|
{
|
|
5541
5651
|
type: "button",
|
|
@@ -5550,7 +5660,7 @@ function StartingXiGame({
|
|
|
5550
5660
|
}
|
|
5551
5661
|
|
|
5552
5662
|
// src/components/games/StatLadderGame.tsx
|
|
5553
|
-
var
|
|
5663
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
5554
5664
|
function parseClientState9(json) {
|
|
5555
5665
|
if (!json) return null;
|
|
5556
5666
|
try {
|
|
@@ -5568,12 +5678,12 @@ function StatLadderGame({
|
|
|
5568
5678
|
const clientState = parseClientState9(result?.clientStateJson);
|
|
5569
5679
|
const revealed = clientState != null;
|
|
5570
5680
|
if (!config) {
|
|
5571
|
-
return /* @__PURE__ */ (0,
|
|
5681
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "ss-w-sl", "data-testid": "game-screen-stat-ladder", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "ss-w-gscreen-body", children: "Loading\u2026" }) });
|
|
5572
5682
|
}
|
|
5573
5683
|
const mysteryName = revealed ? clientState.revealedRank2.playerName : null;
|
|
5574
|
-
return /* @__PURE__ */ (0,
|
|
5575
|
-
/* @__PURE__ */ (0,
|
|
5576
|
-
/* @__PURE__ */ (0,
|
|
5684
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "ss-w-sl", "data-testid": "game-screen-stat-ladder", children: [
|
|
5685
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "ss-w-sl-title", children: config.statLabel }),
|
|
5686
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "ss-w-sl-ladder", children: config.ladder.map((rung) => {
|
|
5577
5687
|
const isMystery = rung.rank === 2;
|
|
5578
5688
|
let rowCls = "ss-w-sl-lrow";
|
|
5579
5689
|
if (isMystery) rowCls += " ss-w-sl-mystery";
|
|
@@ -5582,17 +5692,17 @@ function StatLadderGame({
|
|
|
5582
5692
|
rowCls += clientState.isCorrect ? " ss-w-sl-lrow--correct" : " ss-w-sl-lrow--wrong";
|
|
5583
5693
|
}
|
|
5584
5694
|
const displayName = isMystery ? revealed ? mysteryName : "?" : rung.playerName ?? "?";
|
|
5585
|
-
return /* @__PURE__ */ (0,
|
|
5586
|
-
/* @__PURE__ */ (0,
|
|
5695
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: rowCls, children: [
|
|
5696
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "ss-w-sl-lrow-rank", children: [
|
|
5587
5697
|
"#",
|
|
5588
5698
|
rung.rank
|
|
5589
5699
|
] }),
|
|
5590
|
-
/* @__PURE__ */ (0,
|
|
5591
|
-
/* @__PURE__ */ (0,
|
|
5700
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "ss-w-sl-lrow-name", children: displayName }),
|
|
5701
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "ss-w-sl-lrow-stat", children: rung.statValue })
|
|
5592
5702
|
] }, rung.rank);
|
|
5593
5703
|
}) }),
|
|
5594
|
-
revealed && /* @__PURE__ */ (0,
|
|
5595
|
-
!revealed && /* @__PURE__ */ (0,
|
|
5704
|
+
revealed && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: `ss-w-sl-reveal ss-w-sl-reveal--${clientState.isCorrect ? "correct" : "wrong"}`, children: clientState.isCorrect ? "Correct!" : `Wrong \u2014 it was ${clientState.revealedRank2.playerName}` }),
|
|
5705
|
+
!revealed && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "ss-w-sl-picker", children: config.playerPool.map((p) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
5596
5706
|
"button",
|
|
5597
5707
|
{
|
|
5598
5708
|
type: "button",
|
|
@@ -5608,7 +5718,7 @@ function StatLadderGame({
|
|
|
5608
5718
|
}
|
|
5609
5719
|
|
|
5610
5720
|
// src/components/games/FanMotmGame.tsx
|
|
5611
|
-
var
|
|
5721
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
5612
5722
|
function parseClientState10(json) {
|
|
5613
5723
|
if (!json) return null;
|
|
5614
5724
|
try {
|
|
@@ -5626,19 +5736,19 @@ function FanMotmGame({
|
|
|
5626
5736
|
const clientState = parseClientState10(result?.clientStateJson);
|
|
5627
5737
|
const alreadyVoted = result?.alreadyPlayed === true;
|
|
5628
5738
|
if (!config) {
|
|
5629
|
-
return /* @__PURE__ */ (0,
|
|
5739
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "ss-w-motm", "data-testid": "game-screen-fan-motm", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "ss-w-gscreen-body", children: "Loading\u2026" }) });
|
|
5630
5740
|
}
|
|
5631
5741
|
const pickedId = clientState?.pickedPlayerId ?? null;
|
|
5632
5742
|
function handleVote(candidateId) {
|
|
5633
5743
|
if (alreadyVoted || submitting) return;
|
|
5634
5744
|
onSubmit(JSON.stringify({ pickedPlayerId: candidateId }));
|
|
5635
5745
|
}
|
|
5636
|
-
return /* @__PURE__ */ (0,
|
|
5637
|
-
/* @__PURE__ */ (0,
|
|
5638
|
-
/* @__PURE__ */ (0,
|
|
5746
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "ss-w-motm", "data-testid": "game-screen-fan-motm", children: [
|
|
5747
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "ss-w-motm-title", children: "Man of the Match \u2014 your vote" }),
|
|
5748
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "ss-w-motm-votes", children: config.candidates.map((c) => {
|
|
5639
5749
|
const isVoted = alreadyVoted && pickedId === c.playerId;
|
|
5640
5750
|
const rowCls = `ss-w-motm-vrow${isVoted ? " ss-w-motm-vrow--voted" : ""}${alreadyVoted ? " ss-w-motm-vrow--result" : ""}`;
|
|
5641
|
-
return /* @__PURE__ */ (0,
|
|
5751
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
5642
5752
|
"button",
|
|
5643
5753
|
{
|
|
5644
5754
|
type: "button",
|
|
@@ -5647,19 +5757,19 @@ function FanMotmGame({
|
|
|
5647
5757
|
disabled: alreadyVoted || submitting,
|
|
5648
5758
|
onClick: () => handleVote(c.playerId),
|
|
5649
5759
|
children: [
|
|
5650
|
-
/* @__PURE__ */ (0,
|
|
5651
|
-
/* @__PURE__ */ (0,
|
|
5760
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "ss-w-motm-vfill", style: { width: isVoted ? "100%" : "0%" } }),
|
|
5761
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "ss-w-motm-vrow-name", children: c.playerName })
|
|
5652
5762
|
]
|
|
5653
5763
|
},
|
|
5654
5764
|
c.playerId
|
|
5655
5765
|
);
|
|
5656
5766
|
}) }),
|
|
5657
|
-
/* @__PURE__ */ (0,
|
|
5767
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "ss-w-motm-fun", children: "For fun \u2014 unranked community vote" })
|
|
5658
5768
|
] });
|
|
5659
5769
|
}
|
|
5660
5770
|
|
|
5661
5771
|
// src/components/GameScreenHost.tsx
|
|
5662
|
-
var
|
|
5772
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
5663
5773
|
var FIXTURE_GAME_IDS = /* @__PURE__ */ new Set([
|
|
5664
5774
|
"matchday-predictor",
|
|
5665
5775
|
"starting-xi",
|
|
@@ -5682,8 +5792,8 @@ function GameScreenHost({
|
|
|
5682
5792
|
ui
|
|
5683
5793
|
}) {
|
|
5684
5794
|
const { gameId, fixtureId, gameDay = "" } = selected;
|
|
5685
|
-
const [configJson, setConfigJson] = (0,
|
|
5686
|
-
(0,
|
|
5795
|
+
const [configJson, setConfigJson] = (0, import_react37.useState)(null);
|
|
5796
|
+
(0, import_react37.useEffect)(() => {
|
|
5687
5797
|
setConfigJson(null);
|
|
5688
5798
|
if (!conversation) return;
|
|
5689
5799
|
let cancelled = false;
|
|
@@ -5705,12 +5815,12 @@ function GameScreenHost({
|
|
|
5705
5815
|
gameDay,
|
|
5706
5816
|
fixtureId: fixtureId || void 0
|
|
5707
5817
|
});
|
|
5708
|
-
(0,
|
|
5818
|
+
(0, import_react37.useEffect)(() => {
|
|
5709
5819
|
if (conversation) hydrate();
|
|
5710
5820
|
}, [conversation, gameId]);
|
|
5711
|
-
const hydrateRef = (0,
|
|
5821
|
+
const hydrateRef = (0, import_react37.useRef)(hydrate);
|
|
5712
5822
|
hydrateRef.current = hydrate;
|
|
5713
|
-
(0,
|
|
5823
|
+
(0, import_react37.useEffect)(() => {
|
|
5714
5824
|
if (!FIXTURE_GAME_IDS.has(gameId)) return;
|
|
5715
5825
|
if (rawStatus !== "pending") return;
|
|
5716
5826
|
const timerId = setInterval(() => {
|
|
@@ -5727,7 +5837,7 @@ function GameScreenHost({
|
|
|
5727
5837
|
function renderScreen() {
|
|
5728
5838
|
switch (gameId) {
|
|
5729
5839
|
case "mystery-tiger":
|
|
5730
|
-
return /* @__PURE__ */ (0,
|
|
5840
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
5731
5841
|
MysteryTigerGame,
|
|
5732
5842
|
{
|
|
5733
5843
|
...sharedProps,
|
|
@@ -5735,7 +5845,7 @@ function GameScreenHost({
|
|
|
5735
5845
|
}
|
|
5736
5846
|
);
|
|
5737
5847
|
case "higher-or-lower":
|
|
5738
|
-
return /* @__PURE__ */ (0,
|
|
5848
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
5739
5849
|
HigherOrLowerGame,
|
|
5740
5850
|
{
|
|
5741
5851
|
...sharedProps,
|
|
@@ -5743,7 +5853,7 @@ function GameScreenHost({
|
|
|
5743
5853
|
}
|
|
5744
5854
|
);
|
|
5745
5855
|
case "career-path":
|
|
5746
|
-
return /* @__PURE__ */ (0,
|
|
5856
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
5747
5857
|
CareerPathGame,
|
|
5748
5858
|
{
|
|
5749
5859
|
...sharedProps,
|
|
@@ -5752,7 +5862,7 @@ function GameScreenHost({
|
|
|
5752
5862
|
);
|
|
5753
5863
|
case "beat-the-grid": {
|
|
5754
5864
|
const btgConfig = safeParseConfig(configJson);
|
|
5755
|
-
return /* @__PURE__ */ (0,
|
|
5865
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
5756
5866
|
BeatTheGridGame,
|
|
5757
5867
|
{
|
|
5758
5868
|
...sharedProps,
|
|
@@ -5762,7 +5872,7 @@ function GameScreenHost({
|
|
|
5762
5872
|
);
|
|
5763
5873
|
}
|
|
5764
5874
|
case "guess-the-xi":
|
|
5765
|
-
return /* @__PURE__ */ (0,
|
|
5875
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
5766
5876
|
GuessTheXiGame,
|
|
5767
5877
|
{
|
|
5768
5878
|
...sharedProps,
|
|
@@ -5770,7 +5880,7 @@ function GameScreenHost({
|
|
|
5770
5880
|
}
|
|
5771
5881
|
);
|
|
5772
5882
|
case "daily-quiz":
|
|
5773
|
-
return /* @__PURE__ */ (0,
|
|
5883
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
5774
5884
|
DailyQuizGame,
|
|
5775
5885
|
{
|
|
5776
5886
|
...sharedProps,
|
|
@@ -5778,7 +5888,7 @@ function GameScreenHost({
|
|
|
5778
5888
|
}
|
|
5779
5889
|
);
|
|
5780
5890
|
case "matchday-predictor":
|
|
5781
|
-
return /* @__PURE__ */ (0,
|
|
5891
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
5782
5892
|
MatchdayPredictorGame,
|
|
5783
5893
|
{
|
|
5784
5894
|
...sharedProps,
|
|
@@ -5786,7 +5896,7 @@ function GameScreenHost({
|
|
|
5786
5896
|
}
|
|
5787
5897
|
);
|
|
5788
5898
|
case "starting-xi":
|
|
5789
|
-
return /* @__PURE__ */ (0,
|
|
5899
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
5790
5900
|
StartingXiGame,
|
|
5791
5901
|
{
|
|
5792
5902
|
...sharedProps,
|
|
@@ -5794,7 +5904,7 @@ function GameScreenHost({
|
|
|
5794
5904
|
}
|
|
5795
5905
|
);
|
|
5796
5906
|
case "stat-ladder":
|
|
5797
|
-
return /* @__PURE__ */ (0,
|
|
5907
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
5798
5908
|
StatLadderGame,
|
|
5799
5909
|
{
|
|
5800
5910
|
...sharedProps,
|
|
@@ -5802,7 +5912,7 @@ function GameScreenHost({
|
|
|
5802
5912
|
}
|
|
5803
5913
|
);
|
|
5804
5914
|
case "fan-motm":
|
|
5805
|
-
return /* @__PURE__ */ (0,
|
|
5915
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
5806
5916
|
FanMotmGame,
|
|
5807
5917
|
{
|
|
5808
5918
|
...sharedProps,
|
|
@@ -5810,12 +5920,12 @@ function GameScreenHost({
|
|
|
5810
5920
|
}
|
|
5811
5921
|
);
|
|
5812
5922
|
default:
|
|
5813
|
-
return /* @__PURE__ */ (0,
|
|
5923
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "ss-w-gscreen-body", "data-testid": `game-screen-${gameId}`, children: gameId });
|
|
5814
5924
|
}
|
|
5815
5925
|
}
|
|
5816
|
-
return /* @__PURE__ */ (0,
|
|
5817
|
-
/* @__PURE__ */ (0,
|
|
5818
|
-
/* @__PURE__ */ (0,
|
|
5926
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "ss-w-gscreen", children: [
|
|
5927
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("button", { type: "button", className: "ss-w-gscreen-back", onClick: onBack, children: [
|
|
5928
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { className: "ss-w-gscreen-back-arrow", "aria-hidden": "true", children: "\u2039" }),
|
|
5819
5929
|
ui.back
|
|
5820
5930
|
] }),
|
|
5821
5931
|
renderScreen()
|
|
@@ -5823,17 +5933,17 @@ function GameScreenHost({
|
|
|
5823
5933
|
}
|
|
5824
5934
|
|
|
5825
5935
|
// src/components/GamesPanel.tsx
|
|
5826
|
-
var
|
|
5936
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
5827
5937
|
function GamesPanel({
|
|
5828
5938
|
loggedIn,
|
|
5829
5939
|
games,
|
|
5830
5940
|
ui,
|
|
5831
5941
|
conversation
|
|
5832
5942
|
}) {
|
|
5833
|
-
const [selected, setSelected] = (0,
|
|
5834
|
-
if (!loggedIn) return /* @__PURE__ */ (0,
|
|
5943
|
+
const [selected, setSelected] = (0, import_react38.useState)(null);
|
|
5944
|
+
if (!loggedIn) return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(GamesLoginWall, { ui });
|
|
5835
5945
|
if (selected !== null) {
|
|
5836
|
-
return /* @__PURE__ */ (0,
|
|
5946
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "ss-w-gscreen-wrap", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
5837
5947
|
GameScreenHost,
|
|
5838
5948
|
{
|
|
5839
5949
|
selected,
|
|
@@ -5843,7 +5953,7 @@ function GamesPanel({
|
|
|
5843
5953
|
}
|
|
5844
5954
|
) });
|
|
5845
5955
|
}
|
|
5846
|
-
return /* @__PURE__ */ (0,
|
|
5956
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "ss-w-mon-list", "data-testid": "games-hub", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
5847
5957
|
GamesHub,
|
|
5848
5958
|
{
|
|
5849
5959
|
games,
|
|
@@ -5854,10 +5964,10 @@ function GamesPanel({
|
|
|
5854
5964
|
}
|
|
5855
5965
|
|
|
5856
5966
|
// src/components/Leaderboard.tsx
|
|
5857
|
-
var
|
|
5967
|
+
var import_react39 = require("react");
|
|
5858
5968
|
|
|
5859
5969
|
// src/components/LeaderboardRow.tsx
|
|
5860
|
-
var
|
|
5970
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
5861
5971
|
function formatPoints(n) {
|
|
5862
5972
|
return n.toLocaleString("en");
|
|
5863
5973
|
}
|
|
@@ -5866,14 +5976,14 @@ function LeaderboardWeeklyRow({
|
|
|
5866
5976
|
isMe
|
|
5867
5977
|
}) {
|
|
5868
5978
|
const rankClass = `ss-w-lb2-rank${row.rank <= 3 ? " ss-w-lb2-rank--top3" : ""}`;
|
|
5869
|
-
return /* @__PURE__ */ (0,
|
|
5870
|
-
/* @__PURE__ */ (0,
|
|
5979
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: `ss-w-lb2-row${isMe ? " ss-w-lb2-row--you" : ""}`, children: [
|
|
5980
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("span", { className: rankClass, children: [
|
|
5871
5981
|
"#",
|
|
5872
5982
|
row.rank
|
|
5873
5983
|
] }),
|
|
5874
|
-
/* @__PURE__ */ (0,
|
|
5875
|
-
/* @__PURE__ */ (0,
|
|
5876
|
-
row.currentStreak > 0 && /* @__PURE__ */ (0,
|
|
5984
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "ss-w-lb2-handle", children: row.handle }),
|
|
5985
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "ss-w-lb2-points", children: formatPoints(row.points) }),
|
|
5986
|
+
row.currentStreak > 0 && /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("span", { className: "ss-w-lb2-streak", children: [
|
|
5877
5987
|
"\u{1F525} ",
|
|
5878
5988
|
row.currentStreak
|
|
5879
5989
|
] })
|
|
@@ -5884,18 +5994,18 @@ function LeaderboardAllTimeRow({
|
|
|
5884
5994
|
isMe
|
|
5885
5995
|
}) {
|
|
5886
5996
|
const rankClass = `ss-w-lb2-rank${row.rank <= 3 ? " ss-w-lb2-rank--top3" : ""}`;
|
|
5887
|
-
return /* @__PURE__ */ (0,
|
|
5888
|
-
/* @__PURE__ */ (0,
|
|
5997
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: `ss-w-lb2-row${isMe ? " ss-w-lb2-row--you" : ""}`, children: [
|
|
5998
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("span", { className: rankClass, children: [
|
|
5889
5999
|
"#",
|
|
5890
6000
|
row.rank
|
|
5891
6001
|
] }),
|
|
5892
|
-
/* @__PURE__ */ (0,
|
|
5893
|
-
/* @__PURE__ */ (0,
|
|
6002
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "ss-w-lb2-handle", children: row.handle }),
|
|
6003
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "ss-w-lb2-points", children: formatPoints(row.allTimePoints) })
|
|
5894
6004
|
] });
|
|
5895
6005
|
}
|
|
5896
6006
|
|
|
5897
6007
|
// src/components/LeaderboardEmpty.tsx
|
|
5898
|
-
var
|
|
6008
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
5899
6009
|
function LeaderboardEmpty({
|
|
5900
6010
|
segment,
|
|
5901
6011
|
lastWeek,
|
|
@@ -5904,48 +6014,48 @@ function LeaderboardEmpty({
|
|
|
5904
6014
|
ui
|
|
5905
6015
|
}) {
|
|
5906
6016
|
if (segment === "alltime") {
|
|
5907
|
-
return /* @__PURE__ */ (0,
|
|
5908
|
-
/* @__PURE__ */ (0,
|
|
5909
|
-
/* @__PURE__ */ (0,
|
|
6017
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "ss-w-lb-empty ss-w-lb-empty--alltime", children: [
|
|
6018
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "ss-w-lb-empty-icon", "aria-hidden": "true", children: "\u{1F4CA}" }),
|
|
6019
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("p", { className: "ss-w-lb-empty-body", children: ui.leaderboardAllTimeEmpty })
|
|
5910
6020
|
] });
|
|
5911
6021
|
}
|
|
5912
6022
|
const fresh = lastWeek != null;
|
|
5913
6023
|
const title = fresh ? ui.leaderboardEmptyFreshTitle : ui.leaderboardEmptyColdTitle;
|
|
5914
6024
|
const body = fresh ? ui.leaderboardEmptyFreshBody : ui.leaderboardEmptyColdBody;
|
|
5915
|
-
return /* @__PURE__ */ (0,
|
|
5916
|
-
weeklyPrize && /* @__PURE__ */ (0,
|
|
5917
|
-
/* @__PURE__ */ (0,
|
|
5918
|
-
/* @__PURE__ */ (0,
|
|
6025
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "ss-w-lb-empty", children: [
|
|
6026
|
+
weeklyPrize && /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "ss-w-prize", children: [
|
|
6027
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { className: "ss-w-prize-icon", "aria-hidden": "true", children: "\u{1F3C6}" }),
|
|
6028
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "ss-w-prize-body", children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { className: "ss-w-prize-text", children: weeklyPrize }) })
|
|
5919
6029
|
] }),
|
|
5920
|
-
/* @__PURE__ */ (0,
|
|
5921
|
-
/* @__PURE__ */ (0,
|
|
5922
|
-
/* @__PURE__ */ (0,
|
|
5923
|
-
/* @__PURE__ */ (0,
|
|
5924
|
-
onPlay && /* @__PURE__ */ (0,
|
|
6030
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "ss-w-lb-empty-hero", children: [
|
|
6031
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "ss-w-lb-empty-icon", "aria-hidden": "true", children: fresh ? "\u{1F3C6}" : "\u{1F3AE}" }),
|
|
6032
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("h4", { className: "ss-w-lb-empty-title", children: title }),
|
|
6033
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("p", { className: "ss-w-lb-empty-body", children: body }),
|
|
6034
|
+
onPlay && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("button", { type: "button", className: "ss-w-lb-empty-cta", onClick: onPlay, children: ui.leaderboardEmptyCta })
|
|
5925
6035
|
] }),
|
|
5926
|
-
fresh && lastWeek && /* @__PURE__ */ (0,
|
|
5927
|
-
/* @__PURE__ */ (0,
|
|
5928
|
-
/* @__PURE__ */ (0,
|
|
5929
|
-
/* @__PURE__ */ (0,
|
|
5930
|
-
/* @__PURE__ */ (0,
|
|
6036
|
+
fresh && lastWeek && /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "ss-w-lb-last", children: [
|
|
6037
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { className: "ss-w-lb-last-label", children: ui.leaderboardLastWeekLabel }),
|
|
6038
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { className: "ss-w-lb-last-champ", "aria-hidden": "true", children: "\u{1F947}" }),
|
|
6039
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { className: "ss-w-lb-last-handle", children: lastWeek.handle }),
|
|
6040
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { className: "ss-w-lb-last-points", children: formatPoints(lastWeek.points) })
|
|
5931
6041
|
] })
|
|
5932
6042
|
] });
|
|
5933
6043
|
}
|
|
5934
6044
|
|
|
5935
6045
|
// src/components/Leaderboard.tsx
|
|
5936
|
-
var
|
|
6046
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
5937
6047
|
function Leaderboard({
|
|
5938
6048
|
data,
|
|
5939
6049
|
ui,
|
|
5940
6050
|
onPlay
|
|
5941
6051
|
}) {
|
|
5942
|
-
const [segment, setSegment] = (0,
|
|
6052
|
+
const [segment, setSegment] = (0, import_react39.useState)("weekly");
|
|
5943
6053
|
const myRow = segment === "weekly" ? data.myWeeklyRow : data.myAllTimeRow;
|
|
5944
6054
|
const offBoard = myRow !== null && myRow !== void 0 && myRow.rank === -1;
|
|
5945
6055
|
const isEmpty = segment === "weekly" ? data.weeklyTop.length === 0 : data.allTimeTop.length === 0;
|
|
5946
|
-
return /* @__PURE__ */ (0,
|
|
5947
|
-
/* @__PURE__ */ (0,
|
|
5948
|
-
/* @__PURE__ */ (0,
|
|
6056
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: "ss-w-lb2", children: [
|
|
6057
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: "ss-w-seg", children: [
|
|
6058
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
5949
6059
|
"button",
|
|
5950
6060
|
{
|
|
5951
6061
|
type: "button",
|
|
@@ -5955,7 +6065,7 @@ function Leaderboard({
|
|
|
5955
6065
|
children: ui.leaderboardThisWeek
|
|
5956
6066
|
}
|
|
5957
6067
|
),
|
|
5958
|
-
/* @__PURE__ */ (0,
|
|
6068
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
5959
6069
|
"button",
|
|
5960
6070
|
{
|
|
5961
6071
|
type: "button",
|
|
@@ -5966,7 +6076,7 @@ function Leaderboard({
|
|
|
5966
6076
|
}
|
|
5967
6077
|
)
|
|
5968
6078
|
] }),
|
|
5969
|
-
isEmpty ? /* @__PURE__ */ (0,
|
|
6079
|
+
isEmpty ? /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
5970
6080
|
LeaderboardEmpty,
|
|
5971
6081
|
{
|
|
5972
6082
|
segment,
|
|
@@ -5975,15 +6085,15 @@ function Leaderboard({
|
|
|
5975
6085
|
onPlay,
|
|
5976
6086
|
ui
|
|
5977
6087
|
}
|
|
5978
|
-
) : /* @__PURE__ */ (0,
|
|
5979
|
-
/* @__PURE__ */ (0,
|
|
6088
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(import_jsx_runtime70.Fragment, { children: [
|
|
6089
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { className: "ss-w-lb2-rows", children: segment === "weekly" ? data.weeklyTop.map((row) => /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
5980
6090
|
LeaderboardWeeklyRow,
|
|
5981
6091
|
{
|
|
5982
6092
|
row,
|
|
5983
6093
|
isMe: row.operatorUserId === data.myWeeklyRow?.operatorUserId
|
|
5984
6094
|
},
|
|
5985
6095
|
row.operatorUserId
|
|
5986
|
-
)) : data.allTimeTop.map((row) => /* @__PURE__ */ (0,
|
|
6096
|
+
)) : data.allTimeTop.map((row) => /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
5987
6097
|
LeaderboardAllTimeRow,
|
|
5988
6098
|
{
|
|
5989
6099
|
row,
|
|
@@ -5991,18 +6101,18 @@ function Leaderboard({
|
|
|
5991
6101
|
},
|
|
5992
6102
|
row.operatorUserId
|
|
5993
6103
|
)) }),
|
|
5994
|
-
/* @__PURE__ */ (0,
|
|
5995
|
-
myRow != null && (offBoard ? /* @__PURE__ */ (0,
|
|
5996
|
-
segment === "weekly" && data.myWeeklyRow && /* @__PURE__ */ (0,
|
|
5997
|
-
segment === "alltime" && data.myAllTimeRow && /* @__PURE__ */ (0,
|
|
6104
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { className: "ss-w-kitline", children: "\u{1F3BD}" }),
|
|
6105
|
+
myRow != null && (offBoard ? /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { className: "ss-w-lbgap", children: ui.leaderboardOffBoard }) : /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: "ss-w-lb2-rows", children: [
|
|
6106
|
+
segment === "weekly" && data.myWeeklyRow && /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(LeaderboardWeeklyRow, { row: data.myWeeklyRow, isMe: true }),
|
|
6107
|
+
segment === "alltime" && data.myAllTimeRow && /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(LeaderboardAllTimeRow, { row: data.myAllTimeRow, isMe: true })
|
|
5998
6108
|
] })),
|
|
5999
|
-
segment === "alltime" && data.myAllTimeRow && !offBoard && /* @__PURE__ */ (0,
|
|
6109
|
+
segment === "alltime" && data.myAllTimeRow && !offBoard && /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { className: "ss-w-lb2-rows", children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { className: "ss-w-lb2-row", children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("span", { className: "ss-w-lb2-handle", children: formatPoints(data.allTimeTop.reduce((s, r) => s + r.allTimePoints, 0)) }) }) })
|
|
6000
6110
|
] })
|
|
6001
6111
|
] });
|
|
6002
6112
|
}
|
|
6003
6113
|
|
|
6004
6114
|
// src/components/LeaderboardPanel.tsx
|
|
6005
|
-
var
|
|
6115
|
+
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
6006
6116
|
var EMPTY_PAYLOAD = {
|
|
6007
6117
|
week: "",
|
|
6008
6118
|
weeklyTop: [],
|
|
@@ -6013,17 +6123,17 @@ var EMPTY_PAYLOAD = {
|
|
|
6013
6123
|
lastWeek: null
|
|
6014
6124
|
};
|
|
6015
6125
|
function LeaderboardPanel({ loggedIn, data, loading, onPlay, ui }) {
|
|
6016
|
-
if (!loggedIn) return /* @__PURE__ */ (0,
|
|
6017
|
-
if (data === null && loading) return /* @__PURE__ */ (0,
|
|
6018
|
-
return /* @__PURE__ */ (0,
|
|
6126
|
+
if (!loggedIn) return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(GamesLoginWall, { ui });
|
|
6127
|
+
if (data === null && loading) return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("div", { className: "ss-w-mon-list" });
|
|
6128
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("div", { className: "ss-w-mon-list", children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Leaderboard, { data: data ?? EMPTY_PAYLOAD, ui, onPlay }) });
|
|
6019
6129
|
}
|
|
6020
6130
|
|
|
6021
6131
|
// src/components/ChatPanel.tsx
|
|
6022
|
-
var
|
|
6132
|
+
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
6023
6133
|
var FULLSCREEN_QUERY = "(max-width: 639px)";
|
|
6024
6134
|
function useIsModal() {
|
|
6025
|
-
const [modal, setModal] = (0,
|
|
6026
|
-
(0,
|
|
6135
|
+
const [modal, setModal] = (0, import_react40.useState)(false);
|
|
6136
|
+
(0, import_react40.useEffect)(() => {
|
|
6027
6137
|
if (typeof window === "undefined" || typeof window.matchMedia !== "function") return;
|
|
6028
6138
|
const mql = window.matchMedia(FULLSCREEN_QUERY);
|
|
6029
6139
|
const sync = () => setModal(mql.matches);
|
|
@@ -6036,7 +6146,7 @@ function useIsModal() {
|
|
|
6036
6146
|
function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, gamesResult, leaderboardResult, loggedIn, conversation }) {
|
|
6037
6147
|
const { state, close, stop, send, reset } = controller;
|
|
6038
6148
|
const isModal = useIsModal();
|
|
6039
|
-
(0,
|
|
6149
|
+
(0, import_react40.useEffect)(() => {
|
|
6040
6150
|
const onKey = (e) => {
|
|
6041
6151
|
if (e.key === "Escape") close();
|
|
6042
6152
|
};
|
|
@@ -6047,11 +6157,11 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, g
|
|
|
6047
6157
|
monitor?.setActiveTab("chat");
|
|
6048
6158
|
send(text);
|
|
6049
6159
|
};
|
|
6050
|
-
(0,
|
|
6160
|
+
(0, import_react40.useEffect)(() => {
|
|
6051
6161
|
if (monitor && monitor.activeTab !== "chat" && state.isStreaming) monitor.markChatActivity();
|
|
6052
6162
|
}, [monitor, state.isStreaming, state.messages.length]);
|
|
6053
|
-
return /* @__PURE__ */ (0,
|
|
6054
|
-
/* @__PURE__ */ (0,
|
|
6163
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { className: "ss-w-panel", role: "dialog", "aria-modal": isModal, "aria-label": ui.chatDialogLabel, children: [
|
|
6164
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
6055
6165
|
ChatHeader,
|
|
6056
6166
|
{
|
|
6057
6167
|
onClose: close,
|
|
@@ -6064,7 +6174,7 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, g
|
|
|
6064
6174
|
moreOptionsLabel: ui.moreOptions
|
|
6065
6175
|
}
|
|
6066
6176
|
),
|
|
6067
|
-
monitor && /* @__PURE__ */ (0,
|
|
6177
|
+
monitor && /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
6068
6178
|
TabBar,
|
|
6069
6179
|
{
|
|
6070
6180
|
monitor,
|
|
@@ -6076,18 +6186,18 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, g
|
|
|
6076
6186
|
gamesEnabled: gamesResult?.enabled ?? false
|
|
6077
6187
|
}
|
|
6078
6188
|
),
|
|
6079
|
-
/* @__PURE__ */ (0,
|
|
6189
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
6080
6190
|
"div",
|
|
6081
6191
|
{
|
|
6082
6192
|
style: !monitor || monitor.activeTab === "chat" ? { display: "contents" } : { position: "absolute", inset: 0, visibility: "hidden", display: "flex", flexDirection: "column" },
|
|
6083
|
-
children: /* @__PURE__ */ (0,
|
|
6193
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(MessageList, { controller, ui, slip, onDashboardTap, monitor })
|
|
6084
6194
|
}
|
|
6085
6195
|
),
|
|
6086
|
-
monitor && discovery && monitor.activeTab === "today" && /* @__PURE__ */ (0,
|
|
6087
|
-
monitor && monitor.activeTab === "following" && /* @__PURE__ */ (0,
|
|
6088
|
-
monitor && monitor.activeTab === "odds" && /* @__PURE__ */ (0,
|
|
6089
|
-
monitor && monitor.activeTab === "games" && gamesResult && /* @__PURE__ */ (0,
|
|
6090
|
-
monitor && monitor.activeTab === "leaderboard" && leaderboardResult && /* @__PURE__ */ (0,
|
|
6196
|
+
monitor && discovery && monitor.activeTab === "today" && /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(TodayPanel, { discovery, ui, monitor }),
|
|
6197
|
+
monitor && monitor.activeTab === "following" && /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(MatchesPanel, { monitor, ui, slip }),
|
|
6198
|
+
monitor && monitor.activeTab === "odds" && /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(OddsPanel, { monitor, ui, slip }),
|
|
6199
|
+
monitor && monitor.activeTab === "games" && gamesResult && /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(GamesPanel, { loggedIn: !!loggedIn, games: gamesResult.games, ui, conversation }),
|
|
6200
|
+
monitor && monitor.activeTab === "leaderboard" && leaderboardResult && /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
6091
6201
|
LeaderboardPanel,
|
|
6092
6202
|
{
|
|
6093
6203
|
loggedIn: !!loggedIn,
|
|
@@ -6097,7 +6207,7 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, g
|
|
|
6097
6207
|
ui
|
|
6098
6208
|
}
|
|
6099
6209
|
),
|
|
6100
|
-
(!monitor || monitor.activeTab !== "games" && monitor.activeTab !== "leaderboard") && /* @__PURE__ */ (0,
|
|
6210
|
+
(!monitor || monitor.activeTab !== "games" && monitor.activeTab !== "leaderboard") && /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(ChatInput, { placeholder: ui.placeholder, streaming: state.isStreaming, onSend: handleSend, onStop: stop, stopLabel: ui.stopResponse, sendLabel: ui.sendMessage })
|
|
6101
6211
|
] });
|
|
6102
6212
|
}
|
|
6103
6213
|
|
|
@@ -7038,6 +7148,11 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
|
|
|
7038
7148
|
.ss-w-gt-key { white-space: nowrap; }
|
|
7039
7149
|
.ss-w-gt-key b { font-weight: 800; color: var(--ss-w-ink); }
|
|
7040
7150
|
.ss-w-gt-key-ok { color: var(--ss-w-correct) !important; }
|
|
7151
|
+
/* Legend colour swatches \u2014 green = exact match, amber = close (same broad line / confederation
|
|
7152
|
+
/ within tolerance). Mirrors .ss-w-gtile--exact / --near tile fills. */
|
|
7153
|
+
.ss-w-gt-sw { display: inline-block; width: 9px; height: 9px; border-radius: 3px; vertical-align: middle; }
|
|
7154
|
+
.ss-w-gt-sw--exact { background: var(--ss-w-correct); }
|
|
7155
|
+
.ss-w-gt-sw--near { background: var(--ss-w-accent); }
|
|
7041
7156
|
/* Higher or Lower terminal score unit. */
|
|
7042
7157
|
.ss-w-hl-over-unit { font-size: 14px; font-weight: 700; color: var(--ss-w-faint); }
|
|
7043
7158
|
.ss-w-gscreen-back { display: inline-flex; align-items: center; gap: 5px; background: none; border: none; color: var(--ss-w-accent); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; padding: 6px 0 10px; align-self: flex-start; }
|
|
@@ -7104,6 +7219,22 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
|
|
|
7104
7219
|
.ss-w-gt-title { font-size: 18px; font-weight: 800; text-transform: uppercase; letter-spacing: .02em; color: var(--ss-w-ink); line-height: 1; }
|
|
7105
7220
|
.ss-w-gt-sub { font-size: 11px; color: var(--ss-w-faint); margin-top: 4px; }
|
|
7106
7221
|
.ss-w-gt-left { margin-left: auto; flex: none; font-size: 11px; font-weight: 700; color: var(--ss-w-accent); background: color-mix(in srgb, var(--ss-w-accent) 11%, var(--ss-w-panel)); border: 1px solid color-mix(in srgb, var(--ss-w-accent) 22%, var(--ss-w-line)); border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
|
|
7222
|
+
/* Hero card \u2014 portrait + the masked profile the fan is hunting on. On reveal the silhouette
|
|
7223
|
+
becomes the real photo (or initials) and the profile rows drop away. Fully token-driven. */
|
|
7224
|
+
.ss-w-gt-card { display: grid; grid-template-columns: 96px 1fr; gap: 12px; background: var(--ss-w-bubble); border: 1px solid var(--ss-w-line); border-radius: 14px; padding: 12px; }
|
|
7225
|
+
.ss-w-gt-card--reveal { grid-template-columns: 1fr; justify-items: center; }
|
|
7226
|
+
.ss-w-gt-sil { width: 96px; height: 118px; border-radius: 11px; overflow: hidden; background: var(--ss-w-panel); border: 1px solid var(--ss-w-line); display: grid; place-items: center; }
|
|
7227
|
+
.ss-w-gt-sil svg, .ss-w-gt-sil img { display: block; width: 100%; height: 100%; }
|
|
7228
|
+
.ss-w-gt-sil img { object-fit: cover; }
|
|
7229
|
+
.ss-w-gt-attrs { display: flex; flex-direction: column; justify-content: center; }
|
|
7230
|
+
.ss-w-gt-attr { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 2px; }
|
|
7231
|
+
.ss-w-gt-attr + .ss-w-gt-attr { border-top: 1px solid var(--ss-w-line); }
|
|
7232
|
+
.ss-w-gt-attr-k { color: var(--ss-w-faint); font-size: 12px; font-weight: 600; }
|
|
7233
|
+
.ss-w-gt-attr-v { color: var(--ss-w-faint); font-size: 13px; font-weight: 800; letter-spacing: .12em; }
|
|
7234
|
+
/* Progress dots \u2014 one per guess allowance; used guesses filled with the accent. */
|
|
7235
|
+
.ss-w-gt-dots { display: flex; gap: 7px; justify-content: center; }
|
|
7236
|
+
.ss-w-gt-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ss-w-wrong); }
|
|
7237
|
+
.ss-w-gt-dot--on { background: var(--ss-w-accent); }
|
|
7107
7238
|
/* Guess rows \u2014 one labelled block per guess */
|
|
7108
7239
|
.ss-w-gtrows { display: flex; flex-direction: column; gap: 8px; }
|
|
7109
7240
|
/* First-load legend (empty state) */
|
|
@@ -7141,13 +7272,19 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
|
|
|
7141
7272
|
/* Pair: player A | Higher/Lower | player B */
|
|
7142
7273
|
.ss-w-hlpair { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: stretch; }
|
|
7143
7274
|
.ss-w-hlpc { background: var(--ss-w-panel); border: 1px solid var(--ss-w-line); border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 14px 6px; text-align: center; min-width: 0; }
|
|
7144
|
-
|
|
7275
|
+
/* Player photo (was a 42px ball emoji): fixed 60px circle on both cards so they stay identical
|
|
7276
|
+
regardless of name length. Falls back to initials when no photo URL is present. */
|
|
7277
|
+
.ss-w-hlpc-av { width: 60px; height: 60px; border-radius: 50%; overflow: hidden; background: var(--ss-w-bubble); border: 1px solid var(--ss-w-line); display: grid; place-items: center; flex: none; }
|
|
7278
|
+
.ss-w-hlpc-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
|
|
7279
|
+
.ss-w-av-initials { font-size: 18px; font-weight: 800; color: var(--ss-w-faint); text-transform: uppercase; letter-spacing: .02em; }
|
|
7145
7280
|
.ss-w-hlpc-name { font-size: 12.5px; font-weight: 700; color: var(--ss-w-ink); line-height: 1.15; }
|
|
7146
7281
|
.ss-w-hlpc-stat { font-size: 8.5px; color: var(--ss-w-faint); text-transform: uppercase; letter-spacing: .04em; }
|
|
7147
7282
|
.ss-w-hlpc-val { font-size: 30px; font-weight: 800; color: var(--ss-w-accent); font-variant-numeric: tabular-nums; line-height: 1; }
|
|
7148
7283
|
.ss-w-hlpc-val--hidden { color: var(--ss-w-faint); }
|
|
7149
|
-
/* Higher / Lower \u2014 middle column
|
|
7150
|
-
|
|
7284
|
+
/* Higher / Lower \u2014 middle column. The pair grid stretches this column to the cards' height, so
|
|
7285
|
+
space-between pins Higher to the top and Lower to the bottom, with "or" centered between the
|
|
7286
|
+
two players. */
|
|
7287
|
+
.ss-w-hlbtns { display: flex; flex-direction: column; gap: 6px; justify-content: space-between; }
|
|
7151
7288
|
.ss-w-hl-or { text-align: center; font-size: 11px; font-weight: 700; color: var(--ss-w-faint); }
|
|
7152
7289
|
.ss-w-hlbtn { font: inherit; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; border-radius: 9px; padding: 10px 12px; cursor: pointer; border: 1px solid var(--ss-w-line); white-space: nowrap; transition: border-color .1s, background .1s; }
|
|
7153
7290
|
/* Both options are neutral until picked \u2014 an amber default read as "already selected". */
|
|
@@ -7431,7 +7568,7 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
|
|
|
7431
7568
|
`;
|
|
7432
7569
|
|
|
7433
7570
|
// src/StatsWidget.tsx
|
|
7434
|
-
var
|
|
7571
|
+
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
7435
7572
|
function buildClient(props) {
|
|
7436
7573
|
try {
|
|
7437
7574
|
if ("client" in props && props.client) {
|
|
@@ -7456,23 +7593,23 @@ function injectStyles(root) {
|
|
|
7456
7593
|
function StatsWidget(props) {
|
|
7457
7594
|
const injectedClient = "client" in props ? props.client : void 0;
|
|
7458
7595
|
const cfg = props.config;
|
|
7459
|
-
const built = (0,
|
|
7460
|
-
const logger = (0,
|
|
7596
|
+
const built = (0, import_react41.useMemo)(() => buildClient(props), [injectedClient, cfg?.operatorId, cfg?.publicKey, cfg?.baseUrl]);
|
|
7597
|
+
const logger = (0, import_react41.useMemo)(
|
|
7461
7598
|
() => built ? built.client.createEventLogger({
|
|
7462
7599
|
operatorUserId: cfg?.userContext?.operatorUserId,
|
|
7463
7600
|
anonymousUserId: cfg?.userContext?.anonymousUserId
|
|
7464
7601
|
}) : null,
|
|
7465
7602
|
[built?.client]
|
|
7466
7603
|
);
|
|
7467
|
-
const ui = (0,
|
|
7468
|
-
const rootRef = (0,
|
|
7469
|
-
const introDoneRef = (0,
|
|
7470
|
-
const markIntroDone = (0,
|
|
7604
|
+
const ui = (0, import_react41.useMemo)(() => normalizeUi(props.config ?? { operatorId: "", publicKey: "" }), [props.config]);
|
|
7605
|
+
const rootRef = (0, import_react41.useRef)(null);
|
|
7606
|
+
const introDoneRef = (0, import_react41.useRef)(false);
|
|
7607
|
+
const markIntroDone = (0, import_react41.useCallback)(() => {
|
|
7471
7608
|
introDoneRef.current = true;
|
|
7472
7609
|
}, []);
|
|
7473
7610
|
const convStorageKey = `ss-w-conv:${cfg?.operatorId ?? ""}:${cfg?.userContext?.operatorUserId ?? "anon"}`;
|
|
7474
7611
|
const controller = useChatStream(built?.conversation ?? emptyConversation(), ui.starters, built ? ui.greetingMessage : void 0, convStorageKey);
|
|
7475
|
-
const [hasToday, setHasToday] = (0,
|
|
7612
|
+
const [hasToday, setHasToday] = (0, import_react41.useState)(false);
|
|
7476
7613
|
const monitor = useLiveMonitor({
|
|
7477
7614
|
getLiveMonitor: (pins) => built ? built.conversation.getLiveMonitor(pins) : Promise.resolve(null),
|
|
7478
7615
|
getMarketOdds: (matchId, dev) => built ? built.conversation.getMarketOdds(matchId, dev) : Promise.resolve(null),
|
|
@@ -7480,15 +7617,15 @@ function StatsWidget(props) {
|
|
|
7480
7617
|
isOpen: controller.state.isOpen,
|
|
7481
7618
|
hasToday
|
|
7482
7619
|
});
|
|
7483
|
-
const getSchedule = (0,
|
|
7620
|
+
const getSchedule = (0, import_react41.useCallback)(
|
|
7484
7621
|
(localDate, utcOffsetMinutes) => built ? built.conversation.getSchedule(localDate, utcOffsetMinutes) : Promise.resolve(null),
|
|
7485
7622
|
[built]
|
|
7486
7623
|
);
|
|
7487
|
-
const getStates = (0,
|
|
7624
|
+
const getStates = (0, import_react41.useCallback)(
|
|
7488
7625
|
(matchIds) => built ? built.conversation.getStates(matchIds) : Promise.resolve(null),
|
|
7489
7626
|
[built]
|
|
7490
7627
|
);
|
|
7491
|
-
const pinnedMatchIds = (0,
|
|
7628
|
+
const pinnedMatchIds = (0, import_react41.useMemo)(
|
|
7492
7629
|
() => monitor.pins.filter((p) => p.kind === "match").map((p) => p.matchId),
|
|
7493
7630
|
[monitor.pins]
|
|
7494
7631
|
);
|
|
@@ -7500,19 +7637,19 @@ function StatsWidget(props) {
|
|
|
7500
7637
|
pinnedMatchIds
|
|
7501
7638
|
});
|
|
7502
7639
|
const todayHasContent = visibleGroupsOf(discovery.groups, discovery.states).length > 0;
|
|
7503
|
-
(0,
|
|
7640
|
+
(0, import_react41.useEffect)(() => {
|
|
7504
7641
|
setHasToday(todayHasContent);
|
|
7505
7642
|
}, [todayHasContent]);
|
|
7506
7643
|
const gamesResult = useGames(built?.conversation ?? null, { activeTab: monitor.activeTab });
|
|
7507
7644
|
const leaderboardResult = useLeaderboard(built?.conversation ?? null, { activeTab: monitor.activeTab });
|
|
7508
7645
|
const markTodayActivity = monitor.markTodayActivity;
|
|
7509
|
-
const prevLiveCountRef = (0,
|
|
7510
|
-
(0,
|
|
7646
|
+
const prevLiveCountRef = (0, import_react41.useRef)(0);
|
|
7647
|
+
(0, import_react41.useEffect)(() => {
|
|
7511
7648
|
const rose = prevLiveCountRef.current === 0 && discovery.liveCount > 0;
|
|
7512
7649
|
prevLiveCountRef.current = discovery.liveCount;
|
|
7513
7650
|
if (rose) markTodayActivity();
|
|
7514
7651
|
}, [discovery.liveCount, markTodayActivity]);
|
|
7515
|
-
const slip = (0,
|
|
7652
|
+
const slip = (0, import_react41.useMemo)(
|
|
7516
7653
|
() => {
|
|
7517
7654
|
const handler = props.config?.onAddToSlip;
|
|
7518
7655
|
return {
|
|
@@ -7535,18 +7672,18 @@ function StatsWidget(props) {
|
|
|
7535
7672
|
},
|
|
7536
7673
|
[props.config?.onAddToSlip, controller.state.conversationId, built, monitor.markInSlip]
|
|
7537
7674
|
);
|
|
7538
|
-
const onDashboardTap = (0,
|
|
7675
|
+
const onDashboardTap = (0, import_react41.useMemo)(
|
|
7539
7676
|
() => built ? createDashboardTapSignal((input) => built.conversation.sendSignal(input), logger) : void 0,
|
|
7540
7677
|
[built, logger]
|
|
7541
7678
|
);
|
|
7542
7679
|
const operatorUserId = cfg?.userContext?.operatorUserId;
|
|
7543
7680
|
const anonymousUserId = cfg?.userContext?.anonymousUserId;
|
|
7544
7681
|
const conversationId = controller.state.conversationId ?? void 0;
|
|
7545
|
-
(0,
|
|
7682
|
+
(0, import_react41.useEffect)(() => {
|
|
7546
7683
|
if (!logger) return;
|
|
7547
7684
|
logger.setIdentity({ operatorUserId, anonymousUserId, conversationId });
|
|
7548
7685
|
}, [logger, operatorUserId, anonymousUserId, conversationId]);
|
|
7549
|
-
(0,
|
|
7686
|
+
(0, import_react41.useEffect)(() => {
|
|
7550
7687
|
if (!logger) return;
|
|
7551
7688
|
const onHide = () => {
|
|
7552
7689
|
logger.flushOnHide();
|
|
@@ -7563,14 +7700,14 @@ function StatsWidget(props) {
|
|
|
7563
7700
|
logger.dispose();
|
|
7564
7701
|
};
|
|
7565
7702
|
}, [logger]);
|
|
7566
|
-
(0,
|
|
7703
|
+
(0, import_react41.useEffect)(() => {
|
|
7567
7704
|
if (!built || !ui.injectStyles) return;
|
|
7568
7705
|
const node = rootRef.current?.getRootNode();
|
|
7569
7706
|
if (node) injectStyles(node);
|
|
7570
7707
|
}, [built, ui.injectStyles]);
|
|
7571
7708
|
if (!built) return null;
|
|
7572
7709
|
const attrs = themeAttrs(ui);
|
|
7573
|
-
return /* @__PURE__ */ (0,
|
|
7710
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(EventLogContext.Provider, { value: logger, children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { ref: rootRef, className: "ss-w-root", "data-ss-w-theme": attrs["data-ss-w-theme"], "data-ss-w-pos": attrs["data-ss-w-pos"], style: attrs.style, children: controller.state.isOpen ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
7574
7711
|
ChatPanel,
|
|
7575
7712
|
{
|
|
7576
7713
|
controller,
|
|
@@ -7584,7 +7721,7 @@ function StatsWidget(props) {
|
|
|
7584
7721
|
loggedIn: !!operatorUserId,
|
|
7585
7722
|
conversation: built?.conversation ?? null
|
|
7586
7723
|
}
|
|
7587
|
-
) : /* @__PURE__ */ (0,
|
|
7724
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
7588
7725
|
ChatFab,
|
|
7589
7726
|
{
|
|
7590
7727
|
label: ui.launcherLabel,
|