@sensiblestats/widget-react 0.52.0 → 0.54.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -4192,6 +4192,89 @@ function useGamePlay(conversation, { gameId, gameDay, fixtureId, refresh }) {
4192
4192
 
4193
4193
  // src/components/games/MysteryTigerGame.tsx
4194
4194
  import { useState as useState23, useId as useId2 } from "react";
4195
+
4196
+ // src/components/games/nationFlags.ts
4197
+ var FLAGS = {
4198
+ england: "\u{1F3F4}\u{E0067}\u{E0062}\u{E0065}\u{E006E}\u{E0067}\u{E007F}",
4199
+ scotland: "\u{1F3F4}\u{E0067}\u{E0062}\u{E0073}\u{E0063}\u{E0074}\u{E007F}",
4200
+ wales: "\u{1F3F4}\u{E0067}\u{E0062}\u{E0077}\u{E006C}\u{E0073}\u{E007F}",
4201
+ "northern ireland": "\u{1F1EC}\u{1F1E7}",
4202
+ "republic of ireland": "\u{1F1EE}\u{1F1EA}",
4203
+ ireland: "\u{1F1EE}\u{1F1EA}",
4204
+ "united kingdom": "\u{1F1EC}\u{1F1E7}",
4205
+ france: "\u{1F1EB}\u{1F1F7}",
4206
+ spain: "\u{1F1EA}\u{1F1F8}",
4207
+ portugal: "\u{1F1F5}\u{1F1F9}",
4208
+ germany: "\u{1F1E9}\u{1F1EA}",
4209
+ italy: "\u{1F1EE}\u{1F1F9}",
4210
+ netherlands: "\u{1F1F3}\u{1F1F1}",
4211
+ belgium: "\u{1F1E7}\u{1F1EA}",
4212
+ switzerland: "\u{1F1E8}\u{1F1ED}",
4213
+ austria: "\u{1F1E6}\u{1F1F9}",
4214
+ denmark: "\u{1F1E9}\u{1F1F0}",
4215
+ sweden: "\u{1F1F8}\u{1F1EA}",
4216
+ norway: "\u{1F1F3}\u{1F1F4}",
4217
+ finland: "\u{1F1EB}\u{1F1EE}",
4218
+ iceland: "\u{1F1EE}\u{1F1F8}",
4219
+ poland: "\u{1F1F5}\u{1F1F1}",
4220
+ czechia: "\u{1F1E8}\u{1F1FF}",
4221
+ "czech republic": "\u{1F1E8}\u{1F1FF}",
4222
+ croatia: "\u{1F1ED}\u{1F1F7}",
4223
+ serbia: "\u{1F1F7}\u{1F1F8}",
4224
+ "bosnia and herzegovina": "\u{1F1E7}\u{1F1E6}",
4225
+ greece: "\u{1F1EC}\u{1F1F7}",
4226
+ romania: "\u{1F1F7}\u{1F1F4}",
4227
+ ukraine: "\u{1F1FA}\u{1F1E6}",
4228
+ russia: "\u{1F1F7}\u{1F1FA}",
4229
+ hungary: "\u{1F1ED}\u{1F1FA}",
4230
+ slovakia: "\u{1F1F8}\u{1F1F0}",
4231
+ slovenia: "\u{1F1F8}\u{1F1EE}",
4232
+ turkey: "\u{1F1F9}\u{1F1F7}",
4233
+ t\u00FCrkiye: "\u{1F1F9}\u{1F1F7}",
4234
+ albania: "\u{1F1E6}\u{1F1F1}",
4235
+ "north macedonia": "\u{1F1F2}\u{1F1F0}",
4236
+ brazil: "\u{1F1E7}\u{1F1F7}",
4237
+ argentina: "\u{1F1E6}\u{1F1F7}",
4238
+ uruguay: "\u{1F1FA}\u{1F1FE}",
4239
+ colombia: "\u{1F1E8}\u{1F1F4}",
4240
+ chile: "\u{1F1E8}\u{1F1F1}",
4241
+ peru: "\u{1F1F5}\u{1F1EA}",
4242
+ ecuador: "\u{1F1EA}\u{1F1E8}",
4243
+ paraguay: "\u{1F1F5}\u{1F1FE}",
4244
+ mexico: "\u{1F1F2}\u{1F1FD}",
4245
+ "united states": "\u{1F1FA}\u{1F1F8}",
4246
+ usa: "\u{1F1FA}\u{1F1F8}",
4247
+ canada: "\u{1F1E8}\u{1F1E6}",
4248
+ jamaica: "\u{1F1EF}\u{1F1F2}",
4249
+ nigeria: "\u{1F1F3}\u{1F1EC}",
4250
+ ghana: "\u{1F1EC}\u{1F1ED}",
4251
+ senegal: "\u{1F1F8}\u{1F1F3}",
4252
+ ivorycoast: "\u{1F1E8}\u{1F1EE}",
4253
+ "cote d'ivoire": "\u{1F1E8}\u{1F1EE}",
4254
+ "ivory coast": "\u{1F1E8}\u{1F1EE}",
4255
+ cameroon: "\u{1F1E8}\u{1F1F2}",
4256
+ egypt: "\u{1F1EA}\u{1F1EC}",
4257
+ morocco: "\u{1F1F2}\u{1F1E6}",
4258
+ algeria: "\u{1F1E9}\u{1F1FF}",
4259
+ tunisia: "\u{1F1F9}\u{1F1F3}",
4260
+ mali: "\u{1F1F2}\u{1F1F1}",
4261
+ "south africa": "\u{1F1FF}\u{1F1E6}",
4262
+ "dr congo": "\u{1F1E8}\u{1F1E9}",
4263
+ japan: "\u{1F1EF}\u{1F1F5}",
4264
+ "south korea": "\u{1F1F0}\u{1F1F7}",
4265
+ korea: "\u{1F1F0}\u{1F1F7}",
4266
+ australia: "\u{1F1E6}\u{1F1FA}",
4267
+ "saudi arabia": "\u{1F1F8}\u{1F1E6}",
4268
+ iran: "\u{1F1EE}\u{1F1F7}",
4269
+ "new zealand": "\u{1F1F3}\u{1F1FF}"
4270
+ };
4271
+ function nationalityFlag(nationality) {
4272
+ if (!nationality) return "\u{1F3F3}\uFE0F";
4273
+ const key = nationality.trim().toLowerCase();
4274
+ return FLAGS[key] ?? nationality.slice(0, 3).toUpperCase();
4275
+ }
4276
+
4277
+ // src/components/games/MysteryTigerGame.tsx
4195
4278
  import { Fragment as Fragment9, jsx as jsx55, jsxs as jsxs49 } from "react/jsx-runtime";
4196
4279
  function parseClientState(json) {
4197
4280
  if (!json) return null;
@@ -4222,6 +4305,15 @@ function verdictGlyph(v) {
4222
4305
  if (v.direction === "down") return "\u2193";
4223
4306
  return "\u2248";
4224
4307
  }
4308
+ function directionArrow(v) {
4309
+ if (v.direction === "up") return "\u25B2";
4310
+ if (v.direction === "down") return "\u25BC";
4311
+ return "";
4312
+ }
4313
+ function tileFace(key, v) {
4314
+ if (!v.value) return verdictGlyph(v);
4315
+ return key === "nationality" ? nationalityFlag(v.value) : v.value;
4316
+ }
4225
4317
  function MysteryTigerGame({
4226
4318
  config,
4227
4319
  result,
@@ -4257,6 +4349,13 @@ function MysteryTigerGame({
4257
4349
  " left"
4258
4350
  ] })
4259
4351
  ] }),
4352
+ guessResults.length === 0 && !isOver && /* @__PURE__ */ jsxs49("div", { className: "ss-w-gt-legend", children: [
4353
+ /* @__PURE__ */ jsx55("div", { className: "ss-w-gt-legend-lead", children: "Guess any squad player \u2014 each guess reveals how close you are:" }),
4354
+ /* @__PURE__ */ jsx55("div", { className: "ss-w-gtrow", children: ATTR_KEYS.map((key) => /* @__PURE__ */ jsxs49("div", { className: "ss-w-gtile ss-w-gtile--legend", children: [
4355
+ /* @__PURE__ */ jsx55("span", { className: "ss-w-gtile-lab", children: ATTR_LABELS[key] }),
4356
+ /* @__PURE__ */ jsx55("span", { className: "ss-w-gtile-v", "aria-hidden": "true", children: "\xB7" })
4357
+ ] }, key)) })
4358
+ ] }),
4260
4359
  guessResults.length > 0 && /* @__PURE__ */ jsx55("div", { className: "ss-w-gtrows", children: guessResults.map((gr, i) => {
4261
4360
  const player = config.squadPlayers.find((p) => p.id === gr.playerId);
4262
4361
  return /* @__PURE__ */ jsxs49("div", { className: "ss-w-gtguess", children: [
@@ -4267,16 +4366,20 @@ function MysteryTigerGame({
4267
4366
  ] }),
4268
4367
  /* @__PURE__ */ jsx55("div", { className: "ss-w-gtrow", children: ATTR_KEYS.map((key) => {
4269
4368
  const v = gr[key];
4369
+ const arrow = directionArrow(v);
4270
4370
  return /* @__PURE__ */ jsxs49(
4271
4371
  "div",
4272
4372
  {
4273
4373
  className: `ss-w-gtile ss-w-gtile--${v.verdict}`,
4274
4374
  "data-testid": `verdict-${key}-${i}`,
4275
4375
  "data-verdict": v.verdict,
4276
- "aria-label": `${ATTR_LABELS[key]}: ${v.verdict}${v.direction ? ` ${v.direction}` : ""}`,
4376
+ "aria-label": `${ATTR_LABELS[key]}: ${v.value ?? v.verdict}${v.direction ? ` ${v.direction}` : ""}`,
4277
4377
  children: [
4278
4378
  /* @__PURE__ */ jsx55("span", { className: "ss-w-gtile-lab", children: ATTR_LABELS[key] }),
4279
- /* @__PURE__ */ jsx55("span", { className: "ss-w-gtile-v", "aria-hidden": "true", children: verdictGlyph(v) })
4379
+ /* @__PURE__ */ jsxs49("span", { className: "ss-w-gtile-v", "aria-hidden": "true", children: [
4380
+ tileFace(key, v),
4381
+ arrow && /* @__PURE__ */ jsx55("span", { className: "ss-w-gtile-dir", children: arrow })
4382
+ ] })
4280
4383
  ]
4281
4384
  },
4282
4385
  key
@@ -4337,6 +4440,7 @@ function MysteryTigerGame({
4337
4440
 
4338
4441
  // src/components/games/HigherOrLowerGame.tsx
4339
4442
  import { Fragment as Fragment10, jsx as jsx56, jsxs as jsxs50 } from "react/jsx-runtime";
4443
+ var POINTS_PER_CORRECT = 10;
4340
4444
  function parseClientState2(json) {
4341
4445
  if (!json) return null;
4342
4446
  try {
@@ -4428,39 +4532,25 @@ function HigherOrLowerGame({
4428
4532
  ] })
4429
4533
  ] })
4430
4534
  ] }),
4535
+ !isOver && /* @__PURE__ */ jsxs50("div", { className: "ss-w-hl-foot", children: [
4536
+ /* @__PURE__ */ jsxs50("span", { className: "ss-w-hl-chip", children: [
4537
+ score,
4538
+ " pts"
4539
+ ] }),
4540
+ /* @__PURE__ */ jsxs50("span", { className: "ss-w-hl-chip ss-w-hl-chip--green", children: [
4541
+ "+",
4542
+ POINTS_PER_CORRECT,
4543
+ " / correct"
4544
+ ] })
4545
+ ] }),
4431
4546
  isOver && /* @__PURE__ */ jsxs50("div", { className: "ss-w-hl-over", children: [
4432
4547
  /* @__PURE__ */ jsx56("div", { className: "ss-w-hl-over-title", children: runEndedWrong ? "Run over" : "Nice run!" }),
4433
4548
  /* @__PURE__ */ jsx56("div", { className: "ss-w-hl-over-score", children: score }),
4434
4549
  /* @__PURE__ */ jsxs50("div", { className: "ss-w-hl-over-sub", children: [
4435
4550
  correctCount,
4436
- " correct",
4437
- correctCount === 1 ? "" : "",
4438
- " \xB7 come back tomorrow for a new run"
4551
+ " correct \xB7 come back tomorrow for a new run"
4439
4552
  ] })
4440
- ] }),
4441
- answeredPairs.length > 0 && /* @__PURE__ */ jsx56("div", { className: "ss-w-hlresults", children: answeredPairs.map((answered) => {
4442
- const pair = config.pairs.find((p) => p.pairIndex === answered.pairIndex);
4443
- return /* @__PURE__ */ jsxs50(
4444
- "div",
4445
- {
4446
- className: `ss-w-hlrrow ss-w-hlrrow--${answered.wasCorrect ? "correct" : "wrong"}`,
4447
- children: [
4448
- /* @__PURE__ */ jsxs50("span", { className: "ss-w-hlrrow-names", children: [
4449
- pair?.playerAName ?? "?",
4450
- " ",
4451
- /* @__PURE__ */ jsx56("b", { className: "ss-w-hlrrow-val", children: pair?.playerAValue }),
4452
- " vs ",
4453
- pair?.playerBName ?? "?",
4454
- " ",
4455
- /* @__PURE__ */ jsx56("b", { className: "ss-w-hlrrow-val", children: answered.playerBValue })
4456
- ] }),
4457
- /* @__PURE__ */ jsx56("span", { className: "ss-w-hlrrow-pick", children: answered.pick }),
4458
- /* @__PURE__ */ jsx56("span", { className: "ss-w-hlrrow-icon", children: answered.wasCorrect ? "\u2713" : "\u2717" })
4459
- ]
4460
- },
4461
- answered.pairIndex
4462
- );
4463
- }) })
4553
+ ] })
4464
4554
  ] })
4465
4555
  ] });
4466
4556
  }
@@ -4477,18 +4567,22 @@ function parseClientState3(json) {
4477
4567
  }
4478
4568
  }
4479
4569
  function spellYears(spell) {
4480
- const parts = [];
4481
- if (spell.startYear) parts.push(String(spell.startYear));
4482
- if (spell.endYear) parts.push(String(spell.endYear));
4483
- return parts.join("\u2013");
4570
+ if (!spell.startYear) return "";
4571
+ const yy = (y) => `'${String(y % 100).padStart(2, "0")}`;
4572
+ if (spell.endYear && spell.endYear !== spell.startYear) {
4573
+ return `${yy(spell.startYear)}\u2013${String(spell.endYear % 100).padStart(2, "0")}`;
4574
+ }
4575
+ return yy(spell.startYear);
4484
4576
  }
4485
4577
  function ClubSpellCard({ spell }) {
4486
4578
  const years = spellYears(spell);
4487
4579
  return /* @__PURE__ */ jsxs51("div", { className: `ss-w-cpath-club${spell.isLoan ? " ss-w-cpath-club--loan" : ""}`, children: [
4488
4580
  spell.crestUrl ? /* @__PURE__ */ jsx57("img", { src: spell.crestUrl, alt: "", className: "ss-w-cpath-crest", loading: "lazy" }) : /* @__PURE__ */ jsx57("div", { className: "ss-w-cpath-crest ss-w-cpath-crest--fallback", "aria-hidden": "true", children: spell.clubName.slice(0, 3).toUpperCase() }),
4489
- /* @__PURE__ */ jsx57("span", { className: "ss-w-cpath-club-name", children: spell.clubName }),
4490
- years && /* @__PURE__ */ jsx57("span", { className: "ss-w-cpath-spell-yr", children: years }),
4491
- spell.isLoan && /* @__PURE__ */ jsx57("span", { className: "ss-w-cpath-loan-badge", children: "Loan" })
4581
+ /* @__PURE__ */ jsxs51("span", { className: "ss-w-cpath-club-name", children: [
4582
+ spell.clubName,
4583
+ spell.isLoan && /* @__PURE__ */ jsx57("span", { className: "ss-w-cpath-loan-note", children: " (loan)" })
4584
+ ] }),
4585
+ years && /* @__PURE__ */ jsx57("span", { className: "ss-w-cpath-spell-yr", children: years })
4492
4586
  ] });
4493
4587
  }
4494
4588
  function CareerPathGame({
@@ -4503,8 +4597,6 @@ function CareerPathGame({
4503
4597
  const alreadyGuessedIds = new Set(clientState?.guessResults.map((g) => g.playerId) ?? []);
4504
4598
  const isOver = result?.alreadyPlayed === true || clientState?.solved === true || clientState?.failed === true;
4505
4599
  const visiblePath = clientState?.visiblePath ?? config?.initialPath ?? [];
4506
- const totalClubs = clientState?.totalClubs ?? config?.totalClubs ?? visiblePath.length;
4507
- const hiddenCount = Math.max(0, totalClubs - visiblePath.length);
4508
4600
  const filtered = config && !isOver ? config.typeaheadPool.filter(
4509
4601
  (p) => !alreadyGuessedIds.has(p.id) && p.name.toLowerCase().includes(query.toLowerCase())
4510
4602
  ) : [];
@@ -4528,20 +4620,10 @@ function CareerPathGame({
4528
4620
  " left"
4529
4621
  ] })
4530
4622
  ] }),
4531
- /* @__PURE__ */ jsxs51("div", { className: "ss-w-cpath-seq", children: [
4532
- visiblePath.map((spell, i) => /* @__PURE__ */ jsxs51(Fragment11, { children: [
4533
- i > 0 && /* @__PURE__ */ jsx57("span", { className: "ss-w-cpath-arrow", "aria-hidden": "true", children: "\u2192" }),
4534
- /* @__PURE__ */ jsx57(ClubSpellCard, { spell })
4535
- ] }, `${spell.clubName}-${i}`)),
4536
- hiddenCount > 0 && /* @__PURE__ */ jsxs51(Fragment12, { children: [
4537
- /* @__PURE__ */ jsx57("span", { className: "ss-w-cpath-arrow", "aria-hidden": "true", children: "\u2192" }),
4538
- /* @__PURE__ */ jsxs51("div", { className: "ss-w-cpath-hidden", children: [
4539
- "+",
4540
- hiddenCount,
4541
- " more"
4542
- ] })
4543
- ] })
4544
- ] }),
4623
+ /* @__PURE__ */ jsx57("div", { className: "ss-w-cpath-seq", children: visiblePath.map((spell, i) => /* @__PURE__ */ jsxs51(Fragment11, { children: [
4624
+ i > 0 && /* @__PURE__ */ jsx57("span", { className: "ss-w-cpath-arrow", "aria-hidden": "true", children: "\u203A" }),
4625
+ /* @__PURE__ */ jsx57(ClubSpellCard, { spell })
4626
+ ] }, `${spell.clubName}-${i}`)) }),
4545
4627
  clientState?.hintLine && !isOver && /* @__PURE__ */ jsxs51("div", { className: "ss-w-cpath-hint", children: [
4546
4628
  "\u{1F4A1} ",
4547
4629
  clientState.hintLine
@@ -4791,90 +4873,8 @@ function BeatTheGridGame({
4791
4873
 
4792
4874
  // src/components/games/GuessTheXiGame.tsx
4793
4875
  import { useState as useState26, useId as useId5 } from "react";
4794
-
4795
- // src/components/games/nationFlags.ts
4796
- var FLAGS = {
4797
- england: "\u{1F3F4}\u{E0067}\u{E0062}\u{E0065}\u{E006E}\u{E0067}\u{E007F}",
4798
- scotland: "\u{1F3F4}\u{E0067}\u{E0062}\u{E0073}\u{E0063}\u{E0074}\u{E007F}",
4799
- wales: "\u{1F3F4}\u{E0067}\u{E0062}\u{E0077}\u{E006C}\u{E0073}\u{E007F}",
4800
- "northern ireland": "\u{1F1EC}\u{1F1E7}",
4801
- "republic of ireland": "\u{1F1EE}\u{1F1EA}",
4802
- ireland: "\u{1F1EE}\u{1F1EA}",
4803
- "united kingdom": "\u{1F1EC}\u{1F1E7}",
4804
- france: "\u{1F1EB}\u{1F1F7}",
4805
- spain: "\u{1F1EA}\u{1F1F8}",
4806
- portugal: "\u{1F1F5}\u{1F1F9}",
4807
- germany: "\u{1F1E9}\u{1F1EA}",
4808
- italy: "\u{1F1EE}\u{1F1F9}",
4809
- netherlands: "\u{1F1F3}\u{1F1F1}",
4810
- belgium: "\u{1F1E7}\u{1F1EA}",
4811
- switzerland: "\u{1F1E8}\u{1F1ED}",
4812
- austria: "\u{1F1E6}\u{1F1F9}",
4813
- denmark: "\u{1F1E9}\u{1F1F0}",
4814
- sweden: "\u{1F1F8}\u{1F1EA}",
4815
- norway: "\u{1F1F3}\u{1F1F4}",
4816
- finland: "\u{1F1EB}\u{1F1EE}",
4817
- iceland: "\u{1F1EE}\u{1F1F8}",
4818
- poland: "\u{1F1F5}\u{1F1F1}",
4819
- czechia: "\u{1F1E8}\u{1F1FF}",
4820
- "czech republic": "\u{1F1E8}\u{1F1FF}",
4821
- croatia: "\u{1F1ED}\u{1F1F7}",
4822
- serbia: "\u{1F1F7}\u{1F1F8}",
4823
- "bosnia and herzegovina": "\u{1F1E7}\u{1F1E6}",
4824
- greece: "\u{1F1EC}\u{1F1F7}",
4825
- romania: "\u{1F1F7}\u{1F1F4}",
4826
- ukraine: "\u{1F1FA}\u{1F1E6}",
4827
- russia: "\u{1F1F7}\u{1F1FA}",
4828
- hungary: "\u{1F1ED}\u{1F1FA}",
4829
- slovakia: "\u{1F1F8}\u{1F1F0}",
4830
- slovenia: "\u{1F1F8}\u{1F1EE}",
4831
- turkey: "\u{1F1F9}\u{1F1F7}",
4832
- t\u00FCrkiye: "\u{1F1F9}\u{1F1F7}",
4833
- albania: "\u{1F1E6}\u{1F1F1}",
4834
- "north macedonia": "\u{1F1F2}\u{1F1F0}",
4835
- brazil: "\u{1F1E7}\u{1F1F7}",
4836
- argentina: "\u{1F1E6}\u{1F1F7}",
4837
- uruguay: "\u{1F1FA}\u{1F1FE}",
4838
- colombia: "\u{1F1E8}\u{1F1F4}",
4839
- chile: "\u{1F1E8}\u{1F1F1}",
4840
- peru: "\u{1F1F5}\u{1F1EA}",
4841
- ecuador: "\u{1F1EA}\u{1F1E8}",
4842
- paraguay: "\u{1F1F5}\u{1F1FE}",
4843
- mexico: "\u{1F1F2}\u{1F1FD}",
4844
- "united states": "\u{1F1FA}\u{1F1F8}",
4845
- usa: "\u{1F1FA}\u{1F1F8}",
4846
- canada: "\u{1F1E8}\u{1F1E6}",
4847
- jamaica: "\u{1F1EF}\u{1F1F2}",
4848
- nigeria: "\u{1F1F3}\u{1F1EC}",
4849
- ghana: "\u{1F1EC}\u{1F1ED}",
4850
- senegal: "\u{1F1F8}\u{1F1F3}",
4851
- ivorycoast: "\u{1F1E8}\u{1F1EE}",
4852
- "cote d'ivoire": "\u{1F1E8}\u{1F1EE}",
4853
- "ivory coast": "\u{1F1E8}\u{1F1EE}",
4854
- cameroon: "\u{1F1E8}\u{1F1F2}",
4855
- egypt: "\u{1F1EA}\u{1F1EC}",
4856
- morocco: "\u{1F1F2}\u{1F1E6}",
4857
- algeria: "\u{1F1E9}\u{1F1FF}",
4858
- tunisia: "\u{1F1F9}\u{1F1F3}",
4859
- mali: "\u{1F1F2}\u{1F1F1}",
4860
- "south africa": "\u{1F1FF}\u{1F1E6}",
4861
- "dr congo": "\u{1F1E8}\u{1F1E9}",
4862
- japan: "\u{1F1EF}\u{1F1F5}",
4863
- "south korea": "\u{1F1F0}\u{1F1F7}",
4864
- korea: "\u{1F1F0}\u{1F1F7}",
4865
- australia: "\u{1F1E6}\u{1F1FA}",
4866
- "saudi arabia": "\u{1F1F8}\u{1F1E6}",
4867
- iran: "\u{1F1EE}\u{1F1F7}",
4868
- "new zealand": "\u{1F1F3}\u{1F1FF}"
4869
- };
4870
- function nationalityFlag(nationality) {
4871
- if (!nationality) return "\u{1F3F3}\uFE0F";
4872
- const key = nationality.trim().toLowerCase();
4873
- return FLAGS[key] ?? nationality.slice(0, 3).toUpperCase();
4874
- }
4875
-
4876
- // src/components/games/GuessTheXiGame.tsx
4877
4876
  import { Fragment as Fragment14, jsx as jsx59, jsxs as jsxs53 } from "react/jsx-runtime";
4877
+ var MAX_GUESSES = 3;
4878
4878
  function parseClientState5(json) {
4879
4879
  if (!json) return null;
4880
4880
  try {
@@ -4930,12 +4930,12 @@ function GuessTheXiGame({
4930
4930
  /* @__PURE__ */ jsxs53("div", { children: [
4931
4931
  /* @__PURE__ */ jsx59("div", { className: "ss-w-gxi-title", children: "Guess the XI" }),
4932
4932
  /* @__PURE__ */ jsxs53("div", { className: "ss-w-gxi-sub", children: [
4933
- "Which team? \xB7 ",
4933
+ "Which team? \xB7 flags only \xB7 ",
4934
4934
  config.poolLabel
4935
4935
  ] })
4936
4936
  ] }),
4937
4937
  clientState && !isOver && /* @__PURE__ */ jsxs53("span", { className: "ss-w-gxi-left", children: [
4938
- Math.max(0, 6 - clientState.guessesUsed),
4938
+ Math.max(0, MAX_GUESSES - clientState.guessesUsed),
4939
4939
  " left"
4940
4940
  ] })
4941
4941
  ] }),
@@ -5610,15 +5610,17 @@ function GameScreenHost({
5610
5610
  config: safeParseConfig(configJson)
5611
5611
  }
5612
5612
  );
5613
- case "beat-the-grid":
5613
+ case "beat-the-grid": {
5614
+ const btgConfig = safeParseConfig(configJson);
5614
5615
  return /* @__PURE__ */ jsx65(
5615
5616
  BeatTheGridGame,
5616
5617
  {
5617
5618
  ...sharedProps,
5618
- config: safeParseConfig(configJson),
5619
- playerPool: []
5619
+ config: btgConfig,
5620
+ playerPool: btgConfig?.playerPool ?? []
5620
5621
  }
5621
5622
  );
5623
+ }
5622
5624
  case "guess-the-xi":
5623
5625
  return /* @__PURE__ */ jsx65(
5624
5626
  GuessTheXiGame,
@@ -6941,13 +6943,19 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
6941
6943
  .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; }
6942
6944
  /* Guess rows \u2014 one labelled block per guess */
6943
6945
  .ss-w-gtrows { display: flex; flex-direction: column; gap: 8px; }
6946
+ /* First-load legend (empty state) */
6947
+ .ss-w-gt-legend { display: flex; flex-direction: column; gap: 8px; }
6948
+ .ss-w-gt-legend-lead { font-size: 11.5px; color: var(--ss-w-faint); line-height: 1.35; }
6949
+ .ss-w-gtile--legend { background: var(--ss-w-bubble); border: 1px dashed var(--ss-w-line); color: var(--ss-w-faint); }
6950
+ .ss-w-gtile--legend .ss-w-gtile-lab { opacity: .9; }
6944
6951
  .ss-w-gtguess { display: flex; flex-direction: column; gap: 4px; }
6945
6952
  .ss-w-gtguess-nm { font-size: 11px; font-weight: 600; color: var(--ss-w-faint); }
6946
6953
  .ss-w-gtrow { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
6947
6954
  /* Verdict tiles: label on top, verdict glyph below */
6948
6955
  .ss-w-gtile { display: flex; flex-direction: column; align-items: center; justify-content: center; aspect-ratio: 1; border-radius: 8px; gap: 2px; min-width: 0; }
6949
6956
  .ss-w-gtile-lab { font-size: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; opacity: .75; }
6950
- .ss-w-gtile-v { font-size: 15px; font-weight: 800; line-height: 1; }
6957
+ .ss-w-gtile-v { display: inline-flex; align-items: center; gap: 1px; font-size: 13px; font-weight: 800; line-height: 1; max-width: 100%; padding: 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
6958
+ .ss-w-gtile-dir { font-size: 9px; line-height: 1; }
6951
6959
  .ss-w-gtile--exact { background: var(--ss-w-correct); color: #062611; }
6952
6960
  .ss-w-gtile--near { background: var(--ss-w-accent); color: #241700; }
6953
6961
  .ss-w-gtile--miss { background: var(--ss-w-bubble); color: var(--ss-w-faint); border: 1px solid var(--ss-w-line); }
@@ -6992,16 +7000,10 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
6992
7000
  .ss-w-hl-over-score { font-size: 34px; font-weight: 800; color: var(--ss-w-accent); line-height: 1; font-variant-numeric: tabular-nums; }
6993
7001
  .ss-w-hl-over-sub { font-size: 11px; color: var(--ss-w-faint); }
6994
7002
  /* Answered history \u2014 clean single-line rows with the revealed value */
6995
- .ss-w-hlresults { display: flex; flex-direction: column; gap: 5px; }
6996
- .ss-w-hlrrow { display: flex; align-items: center; gap: 8px; padding: 8px 11px; border-radius: 10px; font-size: 12px; background: var(--ss-w-bubble); border: 1px solid var(--ss-w-line); }
6997
- .ss-w-hlrrow--correct { background: color-mix(in srgb, var(--ss-w-correct) 10%, var(--ss-w-panel)); border-color: color-mix(in srgb, var(--ss-w-correct) 30%, var(--ss-w-line)); }
6998
- .ss-w-hlrrow--wrong { background: color-mix(in srgb, var(--ss-w-cta) 8%, var(--ss-w-panel)); }
6999
- .ss-w-hlrrow-names { flex: 1; min-width: 0; font-weight: 600; color: var(--ss-w-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
7000
- .ss-w-hlrrow-val { font-weight: 800; color: var(--ss-w-accent); font-variant-numeric: tabular-nums; }
7001
- .ss-w-hlrrow-pick { font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--ss-w-faint); flex: none; }
7002
- .ss-w-hlrrow-icon { font-size: 14px; flex: none; }
7003
- .ss-w-hlrrow--correct .ss-w-hlrrow-icon { color: var(--ss-w-correct); }
7004
- .ss-w-hlrrow--wrong .ss-w-hlrrow-icon { color: var(--ss-w-cta); }
7003
+ /* In-progress footer chips (artifact) */
7004
+ .ss-w-hl-foot { display: flex; align-items: center; gap: 8px; }
7005
+ .ss-w-hl-chip { font-size: 11px; font-weight: 600; color: var(--ss-w-faint); background: var(--ss-w-bubble); border: 1px solid var(--ss-w-line); border-radius: 999px; padding: 4px 10px; }
7006
+ .ss-w-hl-chip--green { margin-left: auto; color: var(--ss-w-correct); background: color-mix(in srgb, var(--ss-w-correct) 10%, var(--ss-w-panel)); border-color: color-mix(in srgb, var(--ss-w-correct) 26%, var(--ss-w-line)); }
7005
7007
 
7006
7008
  /* ---- Career Path game screen (D3) \u2014 artifact cpath/club/cto layout ---- */
7007
7009
  .ss-w-cpath { display: flex; flex-direction: column; gap: 12px; }
@@ -7011,18 +7013,16 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
7011
7013
  .ss-w-cpath-sub { font-size: 11px; color: var(--ss-w-faint); margin-top: 4px; }
7012
7014
  .ss-w-cpath-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; }
7013
7015
  /* Career sequence \u2014 horizontal crests with arrows */
7014
- .ss-w-cpath-seq { display: flex; flex-wrap: nowrap; align-items: flex-start; gap: 4px; background: var(--ss-w-panel); border: 1px solid var(--ss-w-line); border-radius: 14px; padding: 13px 11px; overflow-x: auto; overscroll-behavior-x: contain; }
7015
- .ss-w-cpath-arrow { align-self: center; flex: none; color: var(--ss-w-faint); font-size: 13px; padding-top: 10px; }
7016
+ .ss-w-cpath-seq { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px 4px; background: var(--ss-w-panel); border: 1px solid var(--ss-w-line); border-radius: 14px; padding: 13px 11px; }
7017
+ .ss-w-cpath-arrow { align-self: flex-start; flex: none; color: var(--ss-w-faint); font-size: 13px; padding-top: 9px; }
7016
7018
  /* Single club \u2014 small vertical card */
7017
7019
  .ss-w-cpath-club { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 56px; flex: none; }
7018
7020
  .ss-w-cpath-crest { width: 34px; height: 34px; object-fit: contain; flex: none; border-radius: 8px; }
7019
7021
  .ss-w-cpath-crest--fallback { background: var(--ss-w-bubble); border: 1px solid var(--ss-w-line); display: grid; place-items: center; font-size: 9px; font-weight: 800; letter-spacing: .02em; color: var(--ss-w-faint); }
7020
- .ss-w-cpath-club-name { font-size: 9px; font-weight: 600; color: var(--ss-w-ink); text-align: center; line-height: 1.15; max-width: 56px; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
7022
+ .ss-w-cpath-club-name { font-size: 9px; font-weight: 600; color: var(--ss-w-ink); text-align: center; line-height: 1.15; max-width: 56px; overflow-wrap: anywhere; }
7021
7023
  .ss-w-cpath-spell-yr { font-size: 8px; color: var(--ss-w-faint); font-weight: 500; white-space: nowrap; }
7022
- .ss-w-cpath-loan-badge { font-size: 7.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 0 5px; border-radius: 999px; background: color-mix(in srgb, var(--ss-w-accent) 15%, var(--ss-w-panel)); color: var(--ss-w-accent); border: 1px solid color-mix(in srgb, var(--ss-w-accent) 30%, var(--ss-w-line)); }
7024
+ .ss-w-cpath-loan-note { display: block; color: var(--ss-w-faint); font-weight: 500; }
7023
7025
  .ss-w-cpath-club--loan .ss-w-cpath-crest { border: 1px dashed color-mix(in srgb, var(--ss-w-accent) 40%, var(--ss-w-line)); }
7024
- /* Hidden clubs chip */
7025
- .ss-w-cpath-hidden { align-self: center; flex: none; white-space: nowrap; font-size: 9px; font-weight: 700; color: var(--ss-w-faint); background: var(--ss-w-bubble); border: 1px dashed var(--ss-w-line); border-radius: 8px; padding: 6px 8px; }
7026
7026
  /* Hint line */
7027
7027
  .ss-w-cpath-hint { font-size: 11.5px; color: var(--ss-w-faint); text-align: center; padding: 6px 10px; border-radius: 10px; background: color-mix(in srgb, var(--ss-w-accent) 8%, var(--ss-w-panel)); border: 1px dashed color-mix(in srgb, var(--ss-w-accent) 30%, var(--ss-w-line)); }
7028
7028
  /* Terminal outcome */
@@ -7086,10 +7086,15 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
7086
7086
  .ss-w-gxi-title { font-size: 18px; font-weight: 800; text-transform: uppercase; letter-spacing: .02em; color: var(--ss-w-ink); line-height: 1; }
7087
7087
  .ss-w-gxi-sub { font-size: 11px; color: var(--ss-w-faint); margin-top: 4px; }
7088
7088
  .ss-w-gxi-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; }
7089
- /* Pitch: a flag per slot laid out in formation rows on a green field */
7090
- .ss-w-gxi-pitch { display: flex; flex-direction: column; justify-content: space-between; gap: 10px; padding: 16px 10px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--ss-w-correct) 22%, var(--ss-w-line)); background: linear-gradient(180deg, color-mix(in srgb, var(--ss-w-correct) 10%, var(--ss-w-panel)), color-mix(in srgb, var(--ss-w-correct) 4%, var(--ss-w-panel))); }
7091
- .ss-w-gxi-prow { display: flex; justify-content: space-around; align-items: center; gap: 8px; }
7092
- .ss-w-gxi-flag { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 19px; line-height: 1; background: var(--ss-w-panel); border: 1px solid var(--ss-w-line); box-shadow: 0 1px 3px rgba(0,0,0,.14); overflow: hidden; }
7089
+ /* Pitch: a flag per slot laid out in formation rows on a green field. A real min-height plus
7090
+ space-between distributes the formation lines top\u2192bottom like a pitch (GK at the back, forwards
7091
+ forward); yard-line stripes reinforce the read. Without a height the lines collapse together. */
7092
+ .ss-w-gxi-pitch { display: flex; flex-direction: column; justify-content: space-between; gap: 8px; min-height: 300px; padding: 18px 10px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--ss-w-correct) 22%, var(--ss-w-line));
7093
+ background:
7094
+ linear-gradient(180deg, color-mix(in srgb, var(--ss-w-correct) 12%, var(--ss-w-panel)), color-mix(in srgb, var(--ss-w-correct) 4%, var(--ss-w-panel))),
7095
+ repeating-linear-gradient(180deg, transparent 0 40px, color-mix(in srgb, var(--ss-w-ink) 4%, transparent) 40px 80px); }
7096
+ .ss-w-gxi-prow { display: flex; justify-content: center; align-items: center; gap: 14px; }
7097
+ .ss-w-gxi-flag { width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 20px; line-height: 1; background: var(--ss-w-panel); border: 1px solid var(--ss-w-line); box-shadow: 0 1px 3px rgba(0,0,0,.14); overflow: hidden; }
7093
7098
  /* Wrong-guess trail */
7094
7099
  .ss-w-gxi-wrong { display: flex; flex-wrap: wrap; gap: 6px; }
7095
7100
  .ss-w-gxi-wrong-pill { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: color-mix(in srgb, var(--ss-w-wrong) 10%, var(--ss-w-panel)); border: 1px solid var(--ss-w-line); color: var(--ss-w-faint); text-decoration: line-through; }