@claudinho/core 0.8.5 → 0.8.6
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 +15 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -295,8 +295,8 @@ var ES = {
|
|
|
295
295
|
"bracket.invalidStage": "La fase debe ser una de: R32, R16, QF, SF, 3P, F",
|
|
296
296
|
"bracket.unknownStage": 'Fase desconocida "{stage}". Usa R32, R16, QF, SF, 3P o F.',
|
|
297
297
|
"bracket.slot.groupWinner": "Ganador del grupo {group}",
|
|
298
|
-
"bracket.slot.groupSecond": "2
|
|
299
|
-
"bracket.slot.third": "3
|
|
298
|
+
"bracket.slot.groupSecond": "2\xBA del grupo {group}",
|
|
299
|
+
"bracket.slot.third": "3\xBA ({groups})",
|
|
300
300
|
"bracket.slot.winner": "Ganador {stage} {n}",
|
|
301
301
|
"bracket.slot.loser": "Perdedor {stage} {n}",
|
|
302
302
|
"bracket.slot.tbd": "Por definir",
|
|
@@ -3400,17 +3400,24 @@ function participant(team, status) {
|
|
|
3400
3400
|
function tbd(label) {
|
|
3401
3401
|
return { label, flag: "\u{1F3F3}\uFE0F", status: "tbd" };
|
|
3402
3402
|
}
|
|
3403
|
+
function confirmedLiveParticipant(team) {
|
|
3404
|
+
if (!team || team.flag === "\u{1F3F3}\uFE0F") return void 0;
|
|
3405
|
+
return participant(team, "confirmed");
|
|
3406
|
+
}
|
|
3403
3407
|
function winnerLabel(ctx, stage, index) {
|
|
3404
3408
|
return t(ctx.lang, "bracket.slot.winner", {
|
|
3405
3409
|
stage: stageLabelI18n(ctx.lang, stage),
|
|
3406
3410
|
n: String(index)
|
|
3407
3411
|
});
|
|
3408
3412
|
}
|
|
3409
|
-
function resolveSlot(ref, ctx) {
|
|
3413
|
+
function resolveSlot(ref, ctx, liveTeam) {
|
|
3414
|
+
const liveParticipant = confirmedLiveParticipant(liveTeam);
|
|
3410
3415
|
switch (ref.kind) {
|
|
3411
3416
|
case "seed":
|
|
3417
|
+
if (liveParticipant) return liveParticipant;
|
|
3412
3418
|
return tbd(ref.label);
|
|
3413
3419
|
case "group": {
|
|
3420
|
+
if (liveParticipant) return liveParticipant;
|
|
3414
3421
|
if (!ctx.standingsDegraded && hasGroupStarted(ref.group, ctx.tables)) {
|
|
3415
3422
|
const team = teamFromStandings(ref.group, ref.position, ctx.tables);
|
|
3416
3423
|
if (team) {
|
|
@@ -3422,6 +3429,7 @@ function resolveSlot(ref, ctx) {
|
|
|
3422
3429
|
return tbd(label);
|
|
3423
3430
|
}
|
|
3424
3431
|
case "third":
|
|
3432
|
+
if (liveParticipant) return liveParticipant;
|
|
3425
3433
|
return tbd(t(ctx.lang, "bracket.slot.third", { groups: ref.groups.join("/") }));
|
|
3426
3434
|
case "winner": {
|
|
3427
3435
|
const node = ctx.nodesByKey.get(matchKey(ref.stage, ref.index));
|
|
@@ -3430,6 +3438,7 @@ function resolveSlot(ref, ctx) {
|
|
|
3430
3438
|
const winner = resolveWinner(match);
|
|
3431
3439
|
if (winner) return participant(winner, "confirmed");
|
|
3432
3440
|
}
|
|
3441
|
+
if (liveParticipant) return liveParticipant;
|
|
3433
3442
|
return tbd(winnerLabel(ctx, ref.stage, ref.index));
|
|
3434
3443
|
}
|
|
3435
3444
|
case "loser": {
|
|
@@ -3439,6 +3448,7 @@ function resolveSlot(ref, ctx) {
|
|
|
3439
3448
|
const loser = resolveLoser(match);
|
|
3440
3449
|
if (loser) return participant(loser, "confirmed");
|
|
3441
3450
|
}
|
|
3451
|
+
if (liveParticipant) return liveParticipant;
|
|
3442
3452
|
return tbd(
|
|
3443
3453
|
t(ctx.lang, "bracket.slot.loser", {
|
|
3444
3454
|
stage: stageLabelI18n(ctx.lang, ref.stage),
|
|
@@ -3476,8 +3486,8 @@ function buildBracketView(topology, matches, tables, standingsDegraded, liveDegr
|
|
|
3476
3486
|
stage: node.stage,
|
|
3477
3487
|
index: node.index,
|
|
3478
3488
|
kickoff: match.kickoff,
|
|
3479
|
-
home: resolveSlot(node.home, ctx),
|
|
3480
|
-
away: resolveSlot(node.away, ctx),
|
|
3489
|
+
home: resolveSlot(node.home, ctx, match.home),
|
|
3490
|
+
away: resolveSlot(node.away, ctx, match.away),
|
|
3481
3491
|
match
|
|
3482
3492
|
};
|
|
3483
3493
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@claudinho/core",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.6",
|
|
4
4
|
"description": "Domain model, provider adapters (ESPN), standings, bundled schedule, and the read-only Polymarket market-signal sidecar powering Claudinho. Not affiliated with FIFA or Anthropic.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|