pdf-factory 0.8.21 → 1.0.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/__tests__/fixtureGuard.d.ts +1 -6
- package/dist/__tests__/fixtureGuard.d.ts.map +1 -1
- package/dist/composition/printDispatcher.d.ts.map +1 -1
- package/dist/core/drawsDataToDrawData.d.ts.map +1 -1
- package/dist/core/extractCompassData.d.ts.map +1 -1
- package/dist/core/extractDrawData.d.ts +5 -0
- package/dist/core/extractDrawData.d.ts.map +1 -1
- package/dist/core/winnerDrawPosition.d.ts +26 -0
- package/dist/core/winnerDrawPosition.d.ts.map +1 -0
- package/dist/parser.cjs +16 -16
- package/dist/parser.cjs.map +1 -1
- package/dist/parser.js +8951 -7761
- package/dist/parser.js.map +1 -1
- package/dist/pdf-factory.cjs +4 -4
- package/dist/pdf-factory.cjs.map +1 -1
- package/dist/pdf-factory.js +829 -779
- package/dist/pdf-factory.js.map +1 -1
- package/dist/renderers/consolationDraw.d.ts.map +1 -1
- package/dist/renderers/drawSplitter.d.ts.map +1 -1
- package/dist/renderers/mirroredDraw.d.ts.map +1 -1
- package/dist/renderers/positionlessPlacement.d.ts +50 -0
- package/dist/renderers/positionlessPlacement.d.ts.map +1 -0
- package/package.json +8 -8
package/dist/pdf-factory.js
CHANGED
|
@@ -382,11 +382,11 @@ var _ = "itfJunior", v = "combined-tour", y = "grand-slam", b = "officials-signo
|
|
|
382
382
|
function S(e) {
|
|
383
383
|
return x[e];
|
|
384
384
|
}
|
|
385
|
-
function
|
|
385
|
+
function ee(e) {
|
|
386
386
|
let t = Object.values(x);
|
|
387
387
|
return e ? t.filter((t) => t.category === e) : t;
|
|
388
388
|
}
|
|
389
|
-
function
|
|
389
|
+
function te(e, t, n) {
|
|
390
390
|
let r = x[e] || x["club-basic"];
|
|
391
391
|
return {
|
|
392
392
|
header: {
|
|
@@ -401,38 +401,38 @@ function ee(e, t, n) {
|
|
|
401
401
|
}
|
|
402
402
|
//#endregion
|
|
403
403
|
//#region src/config/factSheetCatalog.ts
|
|
404
|
-
var
|
|
405
|
-
function
|
|
404
|
+
var C = "tournament-header", w = "contacts", T = "events", E = "entry-info", D = "venue-info", O = "accommodation", k = "transportation", A = "hospitality", j = "medical", ne = "regulations", re = "prize-money", ie = "officials", ae = "sponsors", oe = "social-events", se = "custom-notes";
|
|
405
|
+
function M(e, t = !0, n) {
|
|
406
406
|
return {
|
|
407
407
|
type: e,
|
|
408
408
|
enabled: t,
|
|
409
409
|
...n && { title: n }
|
|
410
410
|
};
|
|
411
411
|
}
|
|
412
|
-
var
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
],
|
|
412
|
+
var ce = [
|
|
413
|
+
M(C),
|
|
414
|
+
M(w),
|
|
415
|
+
M(T),
|
|
416
|
+
M(E),
|
|
417
|
+
M(D),
|
|
418
|
+
M(O),
|
|
419
|
+
M(k),
|
|
420
|
+
M(A),
|
|
421
|
+
M(j),
|
|
422
|
+
M(ne),
|
|
423
|
+
M(re),
|
|
424
|
+
M(ie),
|
|
425
|
+
M(ae),
|
|
426
|
+
M(oe),
|
|
427
|
+
M(se)
|
|
428
|
+
], le = {
|
|
429
429
|
"itf-junior": {
|
|
430
430
|
id: "itf-junior",
|
|
431
431
|
name: "ITF Junior",
|
|
432
432
|
description: "Full fact sheet with all sections — ITF header style",
|
|
433
433
|
category: "itf",
|
|
434
434
|
headerLayout: "itf",
|
|
435
|
-
sections:
|
|
435
|
+
sections: ce
|
|
436
436
|
},
|
|
437
437
|
"itf-pro-circuit": {
|
|
438
438
|
id: "itf-pro-circuit",
|
|
@@ -441,15 +441,15 @@ var se = [
|
|
|
441
441
|
category: "itf",
|
|
442
442
|
headerLayout: "itf",
|
|
443
443
|
sections: [
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
444
|
+
M(C),
|
|
445
|
+
M(w),
|
|
446
|
+
M(T),
|
|
447
|
+
M(E),
|
|
448
|
+
M(D),
|
|
449
|
+
M(re),
|
|
450
|
+
M(ie),
|
|
451
|
+
M(ne),
|
|
452
|
+
M(se)
|
|
453
453
|
]
|
|
454
454
|
},
|
|
455
455
|
"national-federation": {
|
|
@@ -458,7 +458,7 @@ var se = [
|
|
|
458
458
|
description: "Detailed national federation fact sheet with all logistics",
|
|
459
459
|
category: "national",
|
|
460
460
|
headerLayout: "national-federation",
|
|
461
|
-
sections:
|
|
461
|
+
sections: ce
|
|
462
462
|
},
|
|
463
463
|
"tour-atp-wta": {
|
|
464
464
|
id: "tour-atp-wta",
|
|
@@ -467,16 +467,16 @@ var se = [
|
|
|
467
467
|
category: "tour",
|
|
468
468
|
headerLayout: "wta-tour",
|
|
469
469
|
sections: [
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
470
|
+
M(C),
|
|
471
|
+
M(w),
|
|
472
|
+
M(T),
|
|
473
|
+
M(re),
|
|
474
|
+
M(ie),
|
|
475
|
+
M(ae),
|
|
476
|
+
M(O),
|
|
477
|
+
M(k),
|
|
478
|
+
M(oe),
|
|
479
|
+
M(se)
|
|
480
480
|
]
|
|
481
481
|
},
|
|
482
482
|
"club-basic": {
|
|
@@ -486,25 +486,34 @@ var se = [
|
|
|
486
486
|
category: "club",
|
|
487
487
|
headerLayout: "minimal",
|
|
488
488
|
sections: [
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
489
|
+
M(C),
|
|
490
|
+
M(w),
|
|
491
|
+
M(T),
|
|
492
|
+
M(E),
|
|
493
|
+
M(D),
|
|
494
|
+
M(se)
|
|
495
495
|
]
|
|
496
496
|
}
|
|
497
497
|
};
|
|
498
|
-
function le(e) {
|
|
499
|
-
return ce[e];
|
|
500
|
-
}
|
|
501
498
|
function ue(e) {
|
|
502
|
-
|
|
499
|
+
return le[e];
|
|
500
|
+
}
|
|
501
|
+
function de(e) {
|
|
502
|
+
let t = Object.values(le);
|
|
503
503
|
return e ? t.filter((t) => t.category === e) : t;
|
|
504
504
|
}
|
|
505
505
|
//#endregion
|
|
506
|
+
//#region src/core/winnerDrawPosition.ts
|
|
507
|
+
function fe(e) {
|
|
508
|
+
if (!e?.winningSide) return;
|
|
509
|
+
let t = e.sides?.find((t) => t?.sideNumber === e.winningSide)?.drawPosition;
|
|
510
|
+
if (t) return t;
|
|
511
|
+
let n = (e.drawPositions ?? []).filter(Boolean);
|
|
512
|
+
return n.length === 1 ? n[0] : e.drawPositions?.[e.winningSide - 1];
|
|
513
|
+
}
|
|
514
|
+
//#endregion
|
|
506
515
|
//#region src/core/drawsDataToDrawData.ts
|
|
507
|
-
function
|
|
516
|
+
function N(e) {
|
|
508
517
|
let t = e.roundMatchUps || {}, n = e.roundProfile || {}, r = Object.keys(t).map(Number).sort((e, t) => e - t), i = /* @__PURE__ */ new Map();
|
|
509
518
|
for (let e of r) for (let n of t[e] || []) for (let e of n.sides || []) if (e?.drawPosition && !i.has(e.drawPosition)) {
|
|
510
519
|
let t = e.entryStatus || e.participant?.entryStatus, n = t && t !== "DIRECT_ACCEPTANCE" ? t : void 0;
|
|
@@ -522,6 +531,7 @@ function P(e) {
|
|
|
522
531
|
roundNumber: n.roundNumber,
|
|
523
532
|
roundPosition: n.roundPosition,
|
|
524
533
|
drawPositions: n.drawPositions || [],
|
|
534
|
+
winnerDrawPosition: fe(n),
|
|
525
535
|
score: n.score?.scoreStringSide1 || "",
|
|
526
536
|
winningSide: n.winningSide,
|
|
527
537
|
matchUpStatus: n.matchUpStatus
|
|
@@ -548,58 +558,58 @@ function P(e) {
|
|
|
548
558
|
roundLabelMap: o
|
|
549
559
|
};
|
|
550
560
|
}
|
|
551
|
-
function
|
|
561
|
+
function P(e, t) {
|
|
552
562
|
return e?.[0]?.structures?.find((e) => e.stage === t);
|
|
553
563
|
}
|
|
554
564
|
//#endregion
|
|
555
565
|
//#region src/layout/fonts.ts
|
|
556
|
-
var
|
|
566
|
+
var pe = {
|
|
557
567
|
REGULAR: "helvetica",
|
|
558
568
|
BOLD: "helvetica"
|
|
559
|
-
},
|
|
569
|
+
}, F = {
|
|
560
570
|
NORMAL: "normal",
|
|
561
571
|
BOLD: "bold",
|
|
562
572
|
ITALIC: "italic"
|
|
563
|
-
},
|
|
573
|
+
}, I = {
|
|
564
574
|
TITLE: 16,
|
|
565
575
|
SUBTITLE: 12,
|
|
566
576
|
HEADING: 10,
|
|
567
577
|
BODY: 8,
|
|
568
578
|
SMALL: 7,
|
|
569
579
|
TINY: 6
|
|
570
|
-
},
|
|
580
|
+
}, me = /* @__PURE__ */ new WeakMap(), he = [
|
|
571
581
|
"normal",
|
|
572
582
|
"bold",
|
|
573
583
|
"italic",
|
|
574
584
|
"bolditalic"
|
|
575
585
|
];
|
|
576
|
-
function
|
|
577
|
-
if (!t?.family || !t?.normal) return
|
|
578
|
-
for (let n of
|
|
586
|
+
function ge(e, t) {
|
|
587
|
+
if (!t?.family || !t?.normal) return pe.REGULAR;
|
|
588
|
+
for (let n of he) {
|
|
579
589
|
let r = t[n] ?? t.normal, i = `${t.family}-${n}.ttf`;
|
|
580
590
|
e.addFileToVFS(i, r), e.addFont(i, t.family, n);
|
|
581
591
|
}
|
|
582
|
-
return
|
|
592
|
+
return me.set(e, t.family), t.family;
|
|
583
593
|
}
|
|
584
|
-
function he(e) {
|
|
585
|
-
return fe.get(e) ?? de.REGULAR;
|
|
586
|
-
}
|
|
587
|
-
var ge;
|
|
588
594
|
function _e(e) {
|
|
589
|
-
|
|
595
|
+
return me.get(e) ?? pe.REGULAR;
|
|
596
|
+
}
|
|
597
|
+
var ve;
|
|
598
|
+
function ye(e) {
|
|
599
|
+
ve = e;
|
|
590
600
|
}
|
|
591
|
-
function
|
|
592
|
-
return
|
|
601
|
+
function be() {
|
|
602
|
+
return ve;
|
|
593
603
|
}
|
|
594
|
-
function
|
|
595
|
-
return
|
|
604
|
+
function L(e) {
|
|
605
|
+
return ve ? ge(e, ve) : pe.REGULAR;
|
|
596
606
|
}
|
|
597
|
-
function
|
|
598
|
-
e.setFont(
|
|
607
|
+
function R(e, t, n = F.NORMAL) {
|
|
608
|
+
e.setFont(_e(e), n), e.setFontSize(t);
|
|
599
609
|
}
|
|
600
610
|
//#endregion
|
|
601
611
|
//#region src/composition/page.ts
|
|
602
|
-
function
|
|
612
|
+
function xe(t, n) {
|
|
603
613
|
let r = t.orientation;
|
|
604
614
|
r === "auto" && (r = n && n >= 32 ? "landscape" : "portrait");
|
|
605
615
|
let i = new e({
|
|
@@ -607,9 +617,9 @@ function ye(t, n) {
|
|
|
607
617
|
format: t.pageSize,
|
|
608
618
|
unit: "mm"
|
|
609
619
|
});
|
|
610
|
-
return t.font ?
|
|
620
|
+
return t.font ? ge(i, t.font) : L(i), i;
|
|
611
621
|
}
|
|
612
|
-
function
|
|
622
|
+
function z(e, t, n, r) {
|
|
613
623
|
let i = e.internal.pageSize.getWidth(), a = e.internal.pageSize.getHeight(), { margins: o } = t;
|
|
614
624
|
return {
|
|
615
625
|
headerHeight: n,
|
|
@@ -621,7 +631,7 @@ function B(e, t, n, r) {
|
|
|
621
631
|
pageHeight: a
|
|
622
632
|
};
|
|
623
633
|
}
|
|
624
|
-
function
|
|
634
|
+
function Se() {
|
|
625
635
|
return {
|
|
626
636
|
pageSize: "a4",
|
|
627
637
|
orientation: "auto",
|
|
@@ -635,19 +645,19 @@ function be() {
|
|
|
635
645
|
}
|
|
636
646
|
//#endregion
|
|
637
647
|
//#region src/composition/headerLayouts.ts
|
|
638
|
-
function
|
|
648
|
+
function B(e, t, n) {
|
|
639
649
|
switch (t.layout) {
|
|
640
|
-
case "grand-slam": return
|
|
641
|
-
case "itf": return
|
|
642
|
-
case "minimal": return
|
|
643
|
-
case "wta-tour": return
|
|
644
|
-
case "national-federation": return
|
|
650
|
+
case "grand-slam": return Ce(e, t, n);
|
|
651
|
+
case "itf": return we(e, t, n);
|
|
652
|
+
case "minimal": return Te(e, t, n);
|
|
653
|
+
case "wta-tour": return Ee(e, t, n);
|
|
654
|
+
case "national-federation": return De(e, t, n);
|
|
645
655
|
case "none": return 0;
|
|
646
656
|
}
|
|
647
657
|
}
|
|
648
|
-
function
|
|
658
|
+
function Ce(e, t, n) {
|
|
649
659
|
let { margins: r } = n, i = e.internal.pageSize.getWidth(), a = i - r.right, o = r.top;
|
|
650
|
-
|
|
660
|
+
R(e, 18, F.BOLD), e.text(t.tournamentName.toUpperCase(), i / 2, o, { align: "center" }), o += 7, t.subtitle && (R(e, 12, F.BOLD), e.text(t.subtitle.toUpperCase(), i / 2, o, { align: "center" }), o += 6), R(e, I.BODY, F.NORMAL);
|
|
651
661
|
let s = [];
|
|
652
662
|
if (t.startDate) {
|
|
653
663
|
let e = t.endDate ? `${t.startDate} - ${t.endDate}` : t.startDate;
|
|
@@ -657,23 +667,23 @@ function xe(e, t, n) {
|
|
|
657
667
|
e.text(t, a, r.top + n * 4, { align: "right" });
|
|
658
668
|
}), o += 2, e.setDrawColor(0), e.setLineWidth(.5), e.line(r.left, o, a, o), o += 3, o - r.top;
|
|
659
669
|
}
|
|
660
|
-
function
|
|
670
|
+
function we(e, t, n) {
|
|
661
671
|
let { margins: r } = n, i = e.internal.pageSize.getWidth() - r.right, a = r.top;
|
|
662
|
-
|
|
672
|
+
R(e, I.TITLE, F.BOLD), e.text(t.tournamentName, r.left, a), a += 6, t.subtitle && (R(e, I.SUBTITLE, F.BOLD), e.text(t.subtitle, r.left, a), a += 5), R(e, I.SMALL, F.NORMAL);
|
|
663
673
|
let o = [];
|
|
664
674
|
t.grade && o.push(`Grade: ${t.grade}`), t.surface && o.push(`Surface: ${t.surface}`), t.supervisor && o.push(`Supervisor: ${t.supervisor}`), o.forEach((t, n) => {
|
|
665
675
|
e.text(t, i, r.top + n * 3.5, { align: "right" });
|
|
666
|
-
}),
|
|
676
|
+
}), R(e, I.BODY, F.NORMAL);
|
|
667
677
|
let s = [];
|
|
668
678
|
return t.startDate && s.push(t.startDate), t.location && s.push(t.location), t.organizer && s.push(t.organizer), s.length && (e.text(s.join(" | "), r.left, a), a += 4), a += 1, e.setDrawColor(0), e.setLineWidth(.3), e.line(r.left, a, i, a), a += 3, a - r.top;
|
|
669
679
|
}
|
|
670
|
-
function
|
|
680
|
+
function Te(e, t, n) {
|
|
671
681
|
let { margins: r } = n, i = r.top;
|
|
672
|
-
|
|
682
|
+
R(e, I.SUBTITLE, F.BOLD), e.text(t.tournamentName, r.left, i);
|
|
673
683
|
let a = e.getTextWidth(t.tournamentName);
|
|
674
|
-
return t.subtitle && (
|
|
684
|
+
return t.subtitle && (R(e, I.BODY, F.NORMAL), e.text(` - ${t.subtitle}`, r.left + a, i)), i += 6, i - r.top;
|
|
675
685
|
}
|
|
676
|
-
function
|
|
686
|
+
function Ee(e, t, n) {
|
|
677
687
|
let { margins: r } = n, i = e.internal.pageSize.getWidth(), a = i - r.right, o = i / 2, s = r.top;
|
|
678
688
|
if (t.leftLogoBase64) try {
|
|
679
689
|
e.addImage(t.leftLogoBase64, "PNG", r.left, s - 2, 12, 12);
|
|
@@ -681,9 +691,9 @@ function we(e, t, n) {
|
|
|
681
691
|
if (t.rightLogoBase64) try {
|
|
682
692
|
e.addImage(t.rightLogoBase64, "PNG", a - 12, s - 2, 12, 12);
|
|
683
693
|
} catch {}
|
|
684
|
-
|
|
694
|
+
R(e, 14, F.BOLD), e.text(t.tournamentName, o, s, { align: "center" }), s += 5;
|
|
685
695
|
let c = [t.city, t.country].filter(Boolean).join(", ");
|
|
686
|
-
c && (
|
|
696
|
+
c && (R(e, I.BODY, F.NORMAL), e.setTextColor(80), e.text(c.toUpperCase(), o, s, { align: "center" }), e.setTextColor(0), s += 4);
|
|
687
697
|
let l = [];
|
|
688
698
|
if (t.startDate) {
|
|
689
699
|
let e = t.endDate ? `${t.startDate} - ${t.endDate}` : t.startDate;
|
|
@@ -693,20 +703,20 @@ function we(e, t, n) {
|
|
|
693
703
|
let e = t.currency ? `${t.currency} ${t.prizeMoney}` : t.prizeMoney;
|
|
694
704
|
l.push(e);
|
|
695
705
|
}
|
|
696
|
-
return t.surface && l.push(t.surface), l.length && (
|
|
706
|
+
return t.surface && l.push(t.surface), l.length && (R(e, I.SMALL, F.NORMAL), e.text(l.join(" | "), o, s, { align: "center" }), s += 4), t.sectionLabel && (R(e, I.SMALL, F.BOLD), e.text(t.sectionLabel.toUpperCase(), a, s, { align: "right" }), s += 3), s += 1, e.setDrawColor(0), e.setLineWidth(.3), e.line(r.left, s, a, s), s += 3, s - r.top;
|
|
697
707
|
}
|
|
698
|
-
function
|
|
708
|
+
function De(e, t, n) {
|
|
699
709
|
let { margins: r } = n, i = e.internal.pageSize.getWidth() - r.right, a = r.top;
|
|
700
710
|
if (t.rightLogoBase64) try {
|
|
701
711
|
e.addImage(t.rightLogoBase64, "PNG", i - 14, a - 2, 14, 14);
|
|
702
712
|
} catch {}
|
|
703
|
-
|
|
713
|
+
R(e, I.TITLE, F.BOLD), e.text(t.tournamentName, r.left, a), a += 6, t.subtitle && (R(e, I.HEADING, F.BOLD), e.text(t.subtitle, r.left, a), a += 4), R(e, I.TINY, F.NORMAL), e.setTextColor(80);
|
|
704
714
|
let o = [];
|
|
705
715
|
return t.startDate && o.push(t.startDate), t.organizer && o.push(t.organizer), (t.city || t.country) && o.push([t.city, t.country].filter(Boolean).join(", ")), t.tournamentId && o.push(`ID: ${t.tournamentId}`), t.grade && o.push(`Grade: ${t.grade}`), t.chiefUmpire && o.push(`Umpire: ${t.chiefUmpire}`), o.length && (e.text(o.join(" | "), r.left, a), a += 3), e.setTextColor(0), a += 1, e.setDrawColor(0), e.setLineWidth(.3), e.line(r.left, a, i, a), a += 3, a - r.top;
|
|
706
716
|
}
|
|
707
717
|
//#endregion
|
|
708
718
|
//#region src/composition/tournamentBridge.ts
|
|
709
|
-
function
|
|
719
|
+
function Oe(e) {
|
|
710
720
|
let t = e.person;
|
|
711
721
|
if (t?.standardFamilyName) {
|
|
712
722
|
let e = t.standardGivenName || "";
|
|
@@ -714,62 +724,62 @@ function Ee(e) {
|
|
|
714
724
|
}
|
|
715
725
|
return e.participantName || "";
|
|
716
726
|
}
|
|
717
|
-
function
|
|
727
|
+
function ke(e, t) {
|
|
718
728
|
return e.find((e) => e.participantRole === t);
|
|
719
729
|
}
|
|
720
|
-
function
|
|
730
|
+
function Ae(e, t) {
|
|
721
731
|
return e.find((e) => e.participantRole === "OFFICIAL" && e.participantRoleResponsibilities?.some((e) => e.toUpperCase().includes(t.toUpperCase())));
|
|
722
732
|
}
|
|
723
|
-
function
|
|
733
|
+
function je(e) {
|
|
724
734
|
let t = (e.venues?.[0])?.addresses?.[0], n = [];
|
|
725
735
|
return t?.city && n.push(t.city), t?.state && n.push(t.state), (t?.countryCode || e.hostCountryCode) && n.push(t?.countryCode || e.hostCountryCode || ""), n.join(", ");
|
|
726
736
|
}
|
|
727
|
-
function
|
|
737
|
+
function Me(e) {
|
|
728
738
|
return e.venues?.[0]?.addresses?.[0]?.city;
|
|
729
739
|
}
|
|
730
|
-
function
|
|
740
|
+
function Ne(e) {
|
|
731
741
|
return e.venues?.[0]?.addresses?.[0]?.countryCode || e.hostCountryCode;
|
|
732
742
|
}
|
|
733
|
-
function
|
|
743
|
+
function Pe(e) {
|
|
734
744
|
if (e.tournamentTier) {
|
|
735
745
|
let t = e.tournamentTier;
|
|
736
746
|
return t.system ? t.system + " " + (t.value || "") : t.value;
|
|
737
747
|
}
|
|
738
748
|
return e.tournamentLevel;
|
|
739
749
|
}
|
|
740
|
-
function
|
|
750
|
+
function Fe(e) {
|
|
741
751
|
let t = e.totalPrizeMoney?.[0];
|
|
742
752
|
if (t) return String(t.amount);
|
|
743
753
|
}
|
|
744
|
-
function
|
|
754
|
+
function Ie(e) {
|
|
745
755
|
return e.totalPrizeMoney?.[0]?.currencyCode;
|
|
746
756
|
}
|
|
747
|
-
function
|
|
748
|
-
let { layout: n = "itf", sectionLabel: r, overrides: i } = t, a = e.participants || [], o =
|
|
757
|
+
function Le(e, t = {}) {
|
|
758
|
+
let { layout: n = "itf", sectionLabel: r, overrides: i } = t, a = e.participants || [], o = ke(a, "DIRECTOR"), s = Ae(a, "REFEREE"), c = Ae(a, "CHIEF_UMPIRE") || Ae(a, "UMPIRE"), l = Ae(a, "SUPERVISOR") || s;
|
|
749
759
|
return {
|
|
750
760
|
layout: n,
|
|
751
761
|
tournamentName: e.formalName || e.tournamentName || "",
|
|
752
762
|
startDate: e.startDate,
|
|
753
763
|
endDate: e.endDate,
|
|
754
|
-
location:
|
|
755
|
-
city:
|
|
756
|
-
country:
|
|
764
|
+
location: je(e),
|
|
765
|
+
city: Me(e),
|
|
766
|
+
country: Ne(e),
|
|
757
767
|
surface: e.surfaceCategory,
|
|
758
|
-
grade:
|
|
768
|
+
grade: Pe(e),
|
|
759
769
|
tournamentId: e.tournamentId,
|
|
760
|
-
organizer: o ?
|
|
761
|
-
supervisor: l ?
|
|
762
|
-
chiefUmpire: c ?
|
|
763
|
-
prizeMoney:
|
|
764
|
-
currency:
|
|
770
|
+
organizer: o ? Oe(o) : void 0,
|
|
771
|
+
supervisor: l ? Oe(l) : void 0,
|
|
772
|
+
chiefUmpire: c ? Oe(c) : void 0,
|
|
773
|
+
prizeMoney: Fe(e),
|
|
774
|
+
currency: Ie(e),
|
|
765
775
|
sectionLabel: r,
|
|
766
776
|
...i
|
|
767
777
|
};
|
|
768
778
|
}
|
|
769
|
-
function
|
|
779
|
+
function Re(e, t = {}) {
|
|
770
780
|
let { layout: n = "standard", seedAssignments: r, prizeMoney: i, overrides: a } = t, o = (e.participants || []).filter((e) => e.participantRole === "OFFICIAL" || e.participantRole === "DIRECTOR").map((e) => ({
|
|
771
781
|
role: e.participantRoleResponsibilities?.[0] || e.participantRole || "Official",
|
|
772
|
-
name:
|
|
782
|
+
name: Oe(e)
|
|
773
783
|
}));
|
|
774
784
|
return {
|
|
775
785
|
layout: n,
|
|
@@ -784,19 +794,19 @@ function Ie(e, t = {}) {
|
|
|
784
794
|
}
|
|
785
795
|
//#endregion
|
|
786
796
|
//#region src/composition/footerLayouts.ts
|
|
787
|
-
function
|
|
797
|
+
function ze(e, t, n, r) {
|
|
788
798
|
switch (t.layout) {
|
|
789
|
-
case "standard": return
|
|
799
|
+
case "standard": return Be(e, t, n, r);
|
|
790
800
|
case "seedings":
|
|
791
|
-
case "seedings-table": return
|
|
792
|
-
case "prize-money": return
|
|
801
|
+
case "seedings-table": return Ve(e, t, n, r);
|
|
802
|
+
case "prize-money": return He(e, t, n, r);
|
|
793
803
|
case "officials":
|
|
794
|
-
case "officials-signoff": return
|
|
795
|
-
case "combined-tour": return
|
|
804
|
+
case "officials-signoff": return Ue(e, t, n, r);
|
|
805
|
+
case "combined-tour": return We(e, t, n, r);
|
|
796
806
|
case "none": return 0;
|
|
797
807
|
}
|
|
798
808
|
}
|
|
799
|
-
function
|
|
809
|
+
function V(e) {
|
|
800
810
|
switch (e.layout) {
|
|
801
811
|
case "standard": return 8 + (e.notes?.length || 0) * 3;
|
|
802
812
|
case "seedings":
|
|
@@ -811,57 +821,57 @@ function H(e) {
|
|
|
811
821
|
case "none": return 0;
|
|
812
822
|
}
|
|
813
823
|
}
|
|
814
|
-
function
|
|
824
|
+
function Be(e, t, n, r) {
|
|
815
825
|
let i = e.internal.pageSize.getWidth(), a = e.internal.pageSize.getHeight(), { margins: o } = n, s = i - o.right, c = a - o.bottom;
|
|
816
|
-
if (
|
|
817
|
-
|
|
826
|
+
if (R(e, I.TINY, F.NORMAL), e.setTextColor(120), t.showTimestamp && e.text(`Generated ${(/* @__PURE__ */ new Date()).toLocaleDateString()}`, o.left, c), t.showPageNumbers && r !== void 0 && e.text(`Page ${r}`, s, c, { align: "right" }), e.setTextColor(0), c -= 3, e.setDrawColor(180), e.setLineWidth(.2), e.line(o.left, c, s, c), c -= 2, t.notes?.length) {
|
|
827
|
+
R(e, I.TINY, F.ITALIC), e.setTextColor(100);
|
|
818
828
|
for (let n = t.notes.length - 1; n >= 0; n--) e.text(t.notes[n], o.left, c), c -= 3;
|
|
819
829
|
e.setTextColor(0);
|
|
820
830
|
}
|
|
821
|
-
return
|
|
831
|
+
return V(t);
|
|
822
832
|
}
|
|
823
|
-
function
|
|
824
|
-
let i = e.internal.pageSize.getWidth(), a = e.internal.pageSize.getHeight(), { margins: o } = n, s = i - o.right, c =
|
|
825
|
-
e.setDrawColor(180), e.setLineWidth(.2), e.line(o.left, l, s, l), l += 3,
|
|
833
|
+
function Ve(e, t, n, r) {
|
|
834
|
+
let i = e.internal.pageSize.getWidth(), a = e.internal.pageSize.getHeight(), { margins: o } = n, s = i - o.right, c = V(t), l = a - o.bottom - c + 4;
|
|
835
|
+
e.setDrawColor(180), e.setLineWidth(.2), e.line(o.left, l, s, l), l += 3, R(e, I.SMALL, F.BOLD), e.text("Seeded Players", o.left, l), l += 3;
|
|
826
836
|
let u = t.seedAssignments || [], d = (s - o.left) / 2;
|
|
827
|
-
|
|
837
|
+
R(e, I.TINY, F.NORMAL);
|
|
828
838
|
for (let t = 0; t < u.length; t++) {
|
|
829
839
|
let n = t < Math.ceil(u.length / 2) ? 0 : 1, r = n === 0 ? t : t - Math.ceil(u.length / 2), i = o.left + n * d, a = l + r * 3, s = u[t], c = s.ranking ? ` (${s.ranking})` : "";
|
|
830
840
|
e.text(`${s.seedValue}. ${s.participantName}${c}`, i, a);
|
|
831
841
|
}
|
|
832
842
|
let f = Math.ceil(u.length / 2);
|
|
833
|
-
return l += f * 3 + 2,
|
|
843
|
+
return l += f * 3 + 2, Ge(e, t, n, r, l), c;
|
|
834
844
|
}
|
|
835
|
-
function
|
|
836
|
-
let i = e.internal.pageSize.getWidth(), a = e.internal.pageSize.getHeight(), { margins: o } = n, s = i - o.right, c =
|
|
837
|
-
e.setDrawColor(180), e.setLineWidth(.2), e.line(o.left, l, s, l), l += 3,
|
|
845
|
+
function He(e, t, n, r) {
|
|
846
|
+
let i = e.internal.pageSize.getWidth(), a = e.internal.pageSize.getHeight(), { margins: o } = n, s = i - o.right, c = V(t), l = a - o.bottom - c + 4;
|
|
847
|
+
e.setDrawColor(180), e.setLineWidth(.2), e.line(o.left, l, s, l), l += 3, R(e, I.SMALL, F.BOLD), e.text("Prize Money", o.left, l), l += 3;
|
|
838
848
|
let u = t.prizeMoney || [];
|
|
839
|
-
|
|
849
|
+
R(e, I.TINY, F.NORMAL);
|
|
840
850
|
for (let t of u) {
|
|
841
851
|
let n = [t.round];
|
|
842
852
|
t.amount && n.push(t.amount), t.points && n.push(`${t.points} pts`), e.text(n.join(" — "), o.left, l), l += 2.5;
|
|
843
853
|
}
|
|
844
|
-
return l += 2,
|
|
854
|
+
return l += 2, Ge(e, t, n, r, l), c;
|
|
845
855
|
}
|
|
846
|
-
function
|
|
847
|
-
let i = e.internal.pageSize.getWidth(), a = e.internal.pageSize.getHeight(), { margins: o } = n, s = i - o.right, c =
|
|
848
|
-
e.setDrawColor(180), e.setLineWidth(.2), e.line(o.left, l, s, l), l += 4, t.drawCeremonyDate && (
|
|
856
|
+
function Ue(e, t, n, r) {
|
|
857
|
+
let i = e.internal.pageSize.getWidth(), a = e.internal.pageSize.getHeight(), { margins: o } = n, s = i - o.right, c = V(t), l = a - o.bottom - c + 4;
|
|
858
|
+
e.setDrawColor(180), e.setLineWidth(.2), e.line(o.left, l, s, l), l += 4, t.drawCeremonyDate && (R(e, I.TINY, F.ITALIC), e.setTextColor(80), e.text(`Draw ceremony: ${t.drawCeremonyDate}`, o.left, l), e.setTextColor(0), l += 3), t.releaseDate && (R(e, I.TINY, F.ITALIC), e.setTextColor(80), e.text(`Released: ${t.releaseDate}`, o.left, l), e.setTextColor(0), l += 3);
|
|
849
859
|
let u = t.signatureLines || (t.officials || []).map((e) => ({ role: e })), d = (s - o.left) / Math.min(u.length, 3);
|
|
850
860
|
for (let t = 0; t < u.length; t++) {
|
|
851
861
|
let n = t % 3, r = Math.floor(t / 3), i = o.left + n * d, a = l + r * 10;
|
|
852
|
-
|
|
862
|
+
R(e, I.TINY, F.ITALIC), e.setTextColor(100), e.text(u[t].role, i, a), e.setTextColor(0);
|
|
853
863
|
let s = u[t].name;
|
|
854
|
-
s && (
|
|
864
|
+
s && (R(e, I.TINY, F.BOLD), e.text(s, i, a + 3)), e.setDrawColor(150), e.setLineWidth(.15), e.line(i, a + 5, i + d - 8, a + 5);
|
|
855
865
|
}
|
|
856
866
|
let f = Math.ceil(u.length / 3);
|
|
857
|
-
return l += f * 10 + 2,
|
|
867
|
+
return l += f * 10 + 2, Ge(e, t, n, r, l), c;
|
|
858
868
|
}
|
|
859
|
-
function
|
|
860
|
-
let i = e.internal.pageSize.getWidth(), a = e.internal.pageSize.getHeight(), { margins: o } = n, s = i - o.right, c =
|
|
869
|
+
function We(e, t, n, r) {
|
|
870
|
+
let i = e.internal.pageSize.getWidth(), a = e.internal.pageSize.getHeight(), { margins: o } = n, s = i - o.right, c = V(t), l = a - o.bottom - c + 4;
|
|
861
871
|
e.setDrawColor(180), e.setLineWidth(.2), e.line(o.left, l, s, l), l += 3;
|
|
862
872
|
let u = s - o.left, d = o.left, f = o.left + u * .55, p = l, m = l, h = t.seedAssignments || [];
|
|
863
873
|
if (h.length) {
|
|
864
|
-
|
|
874
|
+
R(e, I.SMALL, F.BOLD), e.text("Seeded Players", d, p), p += 3, R(e, I.TINY, F.NORMAL);
|
|
865
875
|
for (let t of h) {
|
|
866
876
|
let n = t.ranking ? ` (${t.ranking})` : "";
|
|
867
877
|
e.text(`${t.seedValue}. ${t.participantName}${n}`, d, p), p += 2.5;
|
|
@@ -869,22 +879,22 @@ function He(e, t, n, r) {
|
|
|
869
879
|
}
|
|
870
880
|
let g = t.prizeMoney || [];
|
|
871
881
|
if (g.length) {
|
|
872
|
-
|
|
882
|
+
R(e, I.SMALL, F.BOLD), e.text("Prize Money", f, m), m += 3, R(e, I.TINY, F.NORMAL);
|
|
873
883
|
for (let t of g) {
|
|
874
884
|
let n = [t.round];
|
|
875
885
|
t.amount && n.push(t.amount), t.points && n.push(`${t.points} pts`), e.text(n.join(" — "), f, m), m += 2.5;
|
|
876
886
|
}
|
|
877
887
|
}
|
|
878
888
|
if (l = Math.max(p, m) + 2, t.withdrawals?.length) {
|
|
879
|
-
|
|
889
|
+
R(e, I.TINY, F.ITALIC), e.setTextColor(80);
|
|
880
890
|
let n = t.withdrawals.map((e) => e.reason ? `${e.name} (${e.reason})` : e.name).join(", ");
|
|
881
891
|
e.text(`Withdrawals: ${n}`, o.left, l, { maxWidth: u }), e.setTextColor(0), l += 3;
|
|
882
892
|
}
|
|
883
|
-
return t.luckyLosers?.length && (
|
|
893
|
+
return t.luckyLosers?.length && (R(e, I.TINY, F.ITALIC), e.setTextColor(80), e.text(`Lucky Losers: ${t.luckyLosers.join(", ")}`, o.left, l, { maxWidth: u }), e.setTextColor(0), l += 3), t.officials?.length && (R(e, I.TINY, F.NORMAL), e.setTextColor(80), e.text(t.officials.join(" | "), o.left, l), e.setTextColor(0), l += 3), Ge(e, t, n, r, l), c;
|
|
884
894
|
}
|
|
885
|
-
function
|
|
895
|
+
function Ge(e, t, n, r, i) {
|
|
886
896
|
let a = e.internal.pageSize.getWidth(), o = e.internal.pageSize.getHeight(), { margins: s } = n, c = a - s.right, l = o - s.bottom + 2;
|
|
887
|
-
if (
|
|
897
|
+
if (R(e, I.TINY, F.NORMAL), e.setTextColor(120), t.showTimestamp && e.text(`Generated ${(/* @__PURE__ */ new Date()).toLocaleDateString()}`, s.left, l), t.releaseDate) {
|
|
888
898
|
let n = t.showTimestamp ? s.left + 50 : s.left;
|
|
889
899
|
e.text(`Released: ${t.releaseDate}`, n, l);
|
|
890
900
|
}
|
|
@@ -892,25 +902,25 @@ function Ue(e, t, n, r, i) {
|
|
|
892
902
|
}
|
|
893
903
|
//#endregion
|
|
894
904
|
//#region src/composition/seedingsFooter.ts
|
|
895
|
-
var
|
|
896
|
-
function
|
|
905
|
+
var Ke = 5, qe = 2.5;
|
|
906
|
+
function Je(e, t, n, r) {
|
|
897
907
|
let i = t.seedAssignments;
|
|
898
908
|
if (!i.length) return r;
|
|
899
909
|
let a = n.page.margins, o = e.internal.pageSize.getWidth() - a.left - a.right;
|
|
900
|
-
|
|
910
|
+
R(e, 6, F.BOLD), e.text("Seeded players", a.left, r), e.setDrawColor(150), e.setLineWidth(.15), e.line(a.left, r + 1, a.left + o * .5, r + 1), r += 3;
|
|
901
911
|
let s = Math.ceil(i.length / 2), c = i.slice(0, s), l = i.slice(s), u = o * .25, d = r;
|
|
902
|
-
for (let t = 0; t < Math.max(c.length, l.length); t++) c[t] &&
|
|
912
|
+
for (let t = 0; t < Math.max(c.length, l.length); t++) c[t] && Ye(e, c[t], a.left, d, u), l[t] && Ye(e, l[t], a.left + u + 4, d, u), d += qe;
|
|
903
913
|
return d;
|
|
904
914
|
}
|
|
905
|
-
function
|
|
906
|
-
|
|
915
|
+
function Ye(e, t, n, r, i) {
|
|
916
|
+
R(e, Ke, F.BOLD), e.text(`${t.seedValue}`, n + 4, r, { align: "right" }), R(e, Ke, F.NORMAL), e.text(t.participantName, n + 6, r), e.setTextColor(100), e.text(t.nationality, n + 45, r), e.setTextColor(0);
|
|
907
917
|
}
|
|
908
|
-
function
|
|
909
|
-
return e === 0 ? 0 : 4 + Math.ceil(e / 2) *
|
|
918
|
+
function Xe(e) {
|
|
919
|
+
return e === 0 ? 0 : 4 + Math.ceil(e / 2) * qe;
|
|
910
920
|
}
|
|
911
921
|
//#endregion
|
|
912
922
|
//#region src/utils/primitives.ts
|
|
913
|
-
function
|
|
923
|
+
function H(e) {
|
|
914
924
|
if (!e) return "";
|
|
915
925
|
if (e.person) {
|
|
916
926
|
let { standardFamilyName: t, standardGivenName: n } = e.person;
|
|
@@ -918,13 +928,13 @@ function U(e) {
|
|
|
918
928
|
}
|
|
919
929
|
return e.participantName || "";
|
|
920
930
|
}
|
|
921
|
-
function
|
|
931
|
+
function U(e) {
|
|
922
932
|
return e && e.person?.nationalityCode || "";
|
|
923
933
|
}
|
|
924
|
-
function
|
|
934
|
+
function Ze(e) {
|
|
925
935
|
return e ? `[${e}]` : "";
|
|
926
936
|
}
|
|
927
|
-
function
|
|
937
|
+
function Qe(e) {
|
|
928
938
|
return e ? {
|
|
929
939
|
DIRECT_ACCEPTANCE: "DA",
|
|
930
940
|
WILDCARD: "WC",
|
|
@@ -934,31 +944,31 @@ function Xe(e) {
|
|
|
934
944
|
SPECIAL_EXEMPT: "SE"
|
|
935
945
|
}[e] || e : "";
|
|
936
946
|
}
|
|
937
|
-
function
|
|
947
|
+
function $e(e) {
|
|
938
948
|
return e ? typeof e == "string" ? e : e.scoreStringSide1 ? e.scoreStringSide1 : "" : "";
|
|
939
949
|
}
|
|
940
|
-
function
|
|
950
|
+
function et(e) {
|
|
941
951
|
return e ? (/* @__PURE__ */ new Date(e + "T00:00:00")).toLocaleDateString("en-US", {
|
|
942
952
|
day: "2-digit",
|
|
943
953
|
month: "short",
|
|
944
954
|
year: "numeric"
|
|
945
955
|
}) : "";
|
|
946
956
|
}
|
|
947
|
-
function
|
|
957
|
+
function tt(e) {
|
|
948
958
|
if (!e) return "";
|
|
949
959
|
let [t, n] = e.split(":"), r = parseInt(t), i = r >= 12 ? "PM" : "AM", a = r;
|
|
950
960
|
return r === 0 ? a = 12 : r > 12 && (a = r - 12), `${a}:${n} ${i}`;
|
|
951
961
|
}
|
|
952
|
-
function
|
|
962
|
+
function nt(e) {
|
|
953
963
|
return e ? e.split(/\s+/).map((e) => e[0]).join("").toUpperCase() : "";
|
|
954
964
|
}
|
|
955
|
-
function
|
|
965
|
+
function rt(e, t) {
|
|
956
966
|
let n = t - e + 1;
|
|
957
967
|
return n === 1 ? "F" : n === 2 ? "SF" : n === 3 ? "QF" : `R${2 ** n}`;
|
|
958
968
|
}
|
|
959
969
|
//#endregion
|
|
960
970
|
//#region src/core/extractScheduleData.ts
|
|
961
|
-
function
|
|
971
|
+
function it(e) {
|
|
962
972
|
let { matchUps: t = [], venues: n = [], scheduledDate: r = "" } = e, i = /* @__PURE__ */ new Set();
|
|
963
973
|
n.forEach((e) => {
|
|
964
974
|
(e.courts || []).forEach((e) => {
|
|
@@ -975,23 +985,23 @@ function nt(e) {
|
|
|
975
985
|
for (let e of o) {
|
|
976
986
|
let t = e.schedule || {}, n = t.scheduledTime || "00:00", r = t.venueCourtId || t.courtId || "", o = a.get(r) || r;
|
|
977
987
|
o && i.add(o);
|
|
978
|
-
let c = e.sides || [], l =
|
|
988
|
+
let c = e.sides || [], l = at(c[0]), u = at(c[1]), d = {
|
|
979
989
|
courtName: o,
|
|
980
|
-
scheduledTime:
|
|
990
|
+
scheduledTime: tt(n),
|
|
981
991
|
eventName: e.eventName || e.event?.eventName || "",
|
|
982
|
-
eventAbbr:
|
|
992
|
+
eventAbbr: nt(e.eventName || e.event?.eventName || ""),
|
|
983
993
|
roundName: e.roundName || "",
|
|
984
994
|
side1: l,
|
|
985
995
|
side2: u,
|
|
986
|
-
score:
|
|
996
|
+
score: $e(e.score),
|
|
987
997
|
matchUpStatus: e.matchUpStatus,
|
|
988
|
-
notBeforeTime: t.notBeforeTime ?
|
|
998
|
+
notBeforeTime: t.notBeforeTime ? tt(t.notBeforeTime) : void 0
|
|
989
999
|
}, f = t.notBeforeTime || n;
|
|
990
1000
|
s.has(f) || s.set(f, []), s.get(f).push(d);
|
|
991
1001
|
}
|
|
992
1002
|
let c = [...s.keys()].sort().map((e) => ({
|
|
993
1003
|
time: e,
|
|
994
|
-
label:
|
|
1004
|
+
label: tt(e) || "TBD",
|
|
995
1005
|
matches: s.get(e) || []
|
|
996
1006
|
}));
|
|
997
1007
|
return {
|
|
@@ -1000,15 +1010,15 @@ function nt(e) {
|
|
|
1000
1010
|
timeSlots: c
|
|
1001
1011
|
};
|
|
1002
1012
|
}
|
|
1003
|
-
function
|
|
1013
|
+
function at(e) {
|
|
1004
1014
|
if (!e) return {
|
|
1005
1015
|
name: "",
|
|
1006
1016
|
nationality: ""
|
|
1007
1017
|
};
|
|
1008
1018
|
let t = e.participant;
|
|
1009
1019
|
return t ? {
|
|
1010
|
-
name:
|
|
1011
|
-
nationality:
|
|
1020
|
+
name: H(t),
|
|
1021
|
+
nationality: U(t)
|
|
1012
1022
|
} : {
|
|
1013
1023
|
name: "",
|
|
1014
1024
|
nationality: ""
|
|
@@ -1016,7 +1026,7 @@ function rt(e) {
|
|
|
1016
1026
|
}
|
|
1017
1027
|
//#endregion
|
|
1018
1028
|
//#region src/core/extractParticipantData.ts
|
|
1019
|
-
function
|
|
1029
|
+
function ot(e) {
|
|
1020
1030
|
let { participants: t = [], eventEntries: n = [] } = e, r = /* @__PURE__ */ new Map();
|
|
1021
1031
|
for (let { eventName: e, entries: t } of n) for (let n of t) {
|
|
1022
1032
|
let t = n.participantId;
|
|
@@ -1034,18 +1044,18 @@ function it(e) {
|
|
|
1034
1044
|
return t.filter((e) => e.participantType === "INDIVIDUAL").map((e) => {
|
|
1035
1045
|
let t = r.get(e.participantId);
|
|
1036
1046
|
return {
|
|
1037
|
-
name:
|
|
1038
|
-
nationality:
|
|
1039
|
-
ranking:
|
|
1047
|
+
name: H(e),
|
|
1048
|
+
nationality: U(e),
|
|
1049
|
+
ranking: st(e),
|
|
1040
1050
|
seedValue: t?.seedValue,
|
|
1041
|
-
entryStatus:
|
|
1051
|
+
entryStatus: Qe(t?.entryStatus || ""),
|
|
1042
1052
|
events: t?.events || [],
|
|
1043
1053
|
signedIn: e.signInStatus === "SIGNED_IN"
|
|
1044
1054
|
};
|
|
1045
1055
|
}).sort((e, t) => e.name.localeCompare(t.name));
|
|
1046
1056
|
}
|
|
1047
|
-
function
|
|
1048
|
-
for (let t of [e.rankings, e.ratings]) if (
|
|
1057
|
+
function st(e) {
|
|
1058
|
+
for (let t of [e.rankings, e.ratings]) if (t && typeof t == "object") for (let e of Object.values(t)) {
|
|
1049
1059
|
let t = e?.[0]?.scaleValue;
|
|
1050
1060
|
if (t != null && t !== "") return String(t);
|
|
1051
1061
|
}
|
|
@@ -1053,7 +1063,7 @@ function at(e) {
|
|
|
1053
1063
|
}
|
|
1054
1064
|
//#endregion
|
|
1055
1065
|
//#region src/core/extractCourtCardData.ts
|
|
1056
|
-
function
|
|
1066
|
+
function ct(e) {
|
|
1057
1067
|
let { matchUps: t = [], venues: n = [] } = e, r = /* @__PURE__ */ new Map();
|
|
1058
1068
|
n.forEach((e) => {
|
|
1059
1069
|
(e.courts || []).forEach((t) => {
|
|
@@ -1088,26 +1098,26 @@ function ot(e) {
|
|
|
1088
1098
|
o ? u = s[0] : s.length > 1 && (u = s[1]), a.push({
|
|
1089
1099
|
courtName: n.courtName,
|
|
1090
1100
|
venueName: n.venueName,
|
|
1091
|
-
currentMatch: l ?
|
|
1092
|
-
nextMatch: u ?
|
|
1101
|
+
currentMatch: l ? lt(l) : void 0,
|
|
1102
|
+
nextMatch: u ? lt(u) : void 0
|
|
1093
1103
|
});
|
|
1094
1104
|
}
|
|
1095
1105
|
return a.sort((e, t) => e.courtName.localeCompare(t.courtName));
|
|
1096
1106
|
}
|
|
1097
|
-
function
|
|
1107
|
+
function lt(e) {
|
|
1098
1108
|
let t = e.sides || [];
|
|
1099
1109
|
return {
|
|
1100
1110
|
eventName: e.eventName || e.event?.eventName || "",
|
|
1101
1111
|
roundName: e.roundName || "",
|
|
1102
|
-
scheduledTime: e.schedule?.scheduledTime ?
|
|
1103
|
-
side1:
|
|
1104
|
-
side2:
|
|
1112
|
+
scheduledTime: e.schedule?.scheduledTime ? tt(e.schedule.scheduledTime) : void 0,
|
|
1113
|
+
side1: ut(t[0]),
|
|
1114
|
+
side2: ut(t[1])
|
|
1105
1115
|
};
|
|
1106
1116
|
}
|
|
1107
|
-
function
|
|
1117
|
+
function ut(e) {
|
|
1108
1118
|
return e?.participant ? {
|
|
1109
|
-
name:
|
|
1110
|
-
nationality:
|
|
1119
|
+
name: H(e.participant),
|
|
1120
|
+
nationality: U(e.participant)
|
|
1111
1121
|
} : {
|
|
1112
1122
|
name: "TBD",
|
|
1113
1123
|
nationality: ""
|
|
@@ -1115,7 +1125,7 @@ function ct(e) {
|
|
|
1115
1125
|
}
|
|
1116
1126
|
//#endregion
|
|
1117
1127
|
//#region src/generators/orderOfPlay.ts
|
|
1118
|
-
function
|
|
1128
|
+
function dt(e, t = {}) {
|
|
1119
1129
|
let n = e.courts.length >= 4, r = {
|
|
1120
1130
|
pageSize: t.page?.pageSize || "a4",
|
|
1121
1131
|
orientation: t.page?.orientation || (n ? "landscape" : "portrait"),
|
|
@@ -1125,34 +1135,34 @@ function lt(e, t = {}) {
|
|
|
1125
1135
|
bottom: 10,
|
|
1126
1136
|
left: 8
|
|
1127
1137
|
}
|
|
1128
|
-
}, i =
|
|
1138
|
+
}, i = xe(r), a = t.footer || {
|
|
1129
1139
|
layout: "standard",
|
|
1130
1140
|
showTimestamp: !0,
|
|
1131
1141
|
showPageNumbers: !0
|
|
1132
|
-
}, o =
|
|
1142
|
+
}, o = V(a) + (t.notes?.length ? t.notes.length * 3 : 0), s = r.margins.top;
|
|
1133
1143
|
if (t.header) {
|
|
1134
|
-
let e =
|
|
1144
|
+
let e = B(i, t.header, r);
|
|
1135
1145
|
s = r.margins.top + e;
|
|
1136
1146
|
}
|
|
1137
|
-
t.alertBanner && (s =
|
|
1147
|
+
t.alertBanner && (s = ft(i, t.alertBanner, r, s)), pt(i, e, r, s, t);
|
|
1138
1148
|
let c = i.internal.pageSize.getHeight();
|
|
1139
1149
|
if (t.notes?.length) {
|
|
1140
1150
|
let e = c - r.margins.bottom - o + 2;
|
|
1141
|
-
|
|
1151
|
+
R(i, I.TINY, F.ITALIC), i.setTextColor(80);
|
|
1142
1152
|
for (let n of t.notes) i.text(n, r.margins.left, e), e += 3;
|
|
1143
1153
|
i.setTextColor(0);
|
|
1144
1154
|
}
|
|
1145
1155
|
if (t.officials?.length) {
|
|
1146
1156
|
let e = c - r.margins.bottom - 6;
|
|
1147
|
-
|
|
1157
|
+
_t(i, t.officials, r, e);
|
|
1148
1158
|
}
|
|
1149
|
-
return
|
|
1159
|
+
return ze(i, a, r, 1), i;
|
|
1150
1160
|
}
|
|
1151
|
-
function
|
|
1161
|
+
function ft(e, t, n, r) {
|
|
1152
1162
|
let { margins: i } = n, a = e.internal.pageSize.getWidth(), o = a - i.left - i.right;
|
|
1153
|
-
return e.setFillColor(200, 30, 30), e.rect(i.left, r, o, 7, "F"),
|
|
1163
|
+
return e.setFillColor(200, 30, 30), e.rect(i.left, r, o, 7, "F"), R(e, I.SMALL, F.BOLD), e.setTextColor(255, 255, 255), e.text(t, a / 2, r + 4.5, { align: "center" }), e.setTextColor(0), r + 9;
|
|
1154
1164
|
}
|
|
1155
|
-
function
|
|
1165
|
+
function pt(e, n, r, i, a) {
|
|
1156
1166
|
let { margins: o } = r, s = n.courts, c = a.cellStyle === "compact", l = [{
|
|
1157
1167
|
header: "",
|
|
1158
1168
|
dataKey: "slot"
|
|
@@ -1163,7 +1173,7 @@ function dt(e, n, r, i, a) {
|
|
|
1163
1173
|
});
|
|
1164
1174
|
let u = [];
|
|
1165
1175
|
n.timeSlots.forEach((e, t) => {
|
|
1166
|
-
let n = [], r =
|
|
1176
|
+
let n = [], r = mt(e, t);
|
|
1167
1177
|
n.push({
|
|
1168
1178
|
content: r,
|
|
1169
1179
|
styles: {
|
|
@@ -1173,7 +1183,7 @@ function dt(e, n, r, i, a) {
|
|
|
1173
1183
|
}
|
|
1174
1184
|
});
|
|
1175
1185
|
for (let t of s) {
|
|
1176
|
-
let r = e.matches.filter((e) => e.courtName === t), i = r.length > 0 ? r.map((e) =>
|
|
1186
|
+
let r = e.matches.filter((e) => e.courtName === t), i = r.length > 0 ? r.map((e) => ht(e, c)).join("\n---\n") : "";
|
|
1177
1187
|
n.push(i);
|
|
1178
1188
|
}
|
|
1179
1189
|
u.push(n);
|
|
@@ -1236,34 +1246,34 @@ function dt(e, n, r, i, a) {
|
|
|
1236
1246
|
}
|
|
1237
1247
|
});
|
|
1238
1248
|
}
|
|
1239
|
-
function
|
|
1249
|
+
function mt(e, t) {
|
|
1240
1250
|
return `${t + 1}`;
|
|
1241
1251
|
}
|
|
1242
|
-
function
|
|
1252
|
+
function ht(e, t) {
|
|
1243
1253
|
let n = [];
|
|
1244
1254
|
e.notBeforeTime ? n.push(`NB ${e.notBeforeTime}`) : e.scheduledTime && n.push(e.scheduledTime), (e.eventAbbr || e.roundName) && n.push(`${e.eventAbbr} ${e.roundName}`.trim());
|
|
1245
|
-
let r =
|
|
1255
|
+
let r = gt(e.side1, t);
|
|
1246
1256
|
r && n.push(r), n.push("vs.");
|
|
1247
|
-
let i =
|
|
1257
|
+
let i = gt(e.side2, t);
|
|
1248
1258
|
return i && n.push(i), e.score ? n.push(e.score) : e.matchUpStatus === "IN_PROGRESS" && n.push("In progress"), n.join("\n");
|
|
1249
1259
|
}
|
|
1250
|
-
function
|
|
1260
|
+
function gt(e, t) {
|
|
1251
1261
|
return e.name ? t || e.nationality ? `${e.name} (${e.nationality})` : e.name : "TBD";
|
|
1252
1262
|
}
|
|
1253
|
-
function
|
|
1263
|
+
function _t(e, t, n, r) {
|
|
1254
1264
|
let { margins: i } = n, a = e.internal.pageSize.getWidth();
|
|
1255
|
-
e.setDrawColor(120), e.setLineWidth(.2), e.line(i.left, r - 2, a - i.right, r - 2),
|
|
1265
|
+
e.setDrawColor(120), e.setLineWidth(.2), e.line(i.left, r - 2, a - i.right, r - 2), R(e, I.TINY, F.NORMAL);
|
|
1256
1266
|
let o = (a - i.left - i.right) / t.length;
|
|
1257
1267
|
t.forEach((t, n) => {
|
|
1258
1268
|
let a = i.left + n * o;
|
|
1259
|
-
|
|
1269
|
+
R(e, I.TINY, F.ITALIC), e.setTextColor(100), e.text(t.role, a, r), R(e, I.TINY, F.BOLD), e.setTextColor(0), e.text(t.name, a, r + 3);
|
|
1260
1270
|
});
|
|
1261
1271
|
}
|
|
1262
1272
|
//#endregion
|
|
1263
1273
|
//#region src/layout/headers.ts
|
|
1264
|
-
function
|
|
1274
|
+
function vt(e, t, n = 15) {
|
|
1265
1275
|
let r = e.internal.pageSize.getWidth(), i = n;
|
|
1266
|
-
|
|
1276
|
+
R(e, I.TITLE, F.BOLD), e.text(t.tournamentName, 15, i), i += 7, t.subtitle && (R(e, I.SUBTITLE, F.BOLD), e.text(t.subtitle, 15, i), i += 6), R(e, I.BODY, F.NORMAL);
|
|
1267
1277
|
let a = [];
|
|
1268
1278
|
if (t.startDate) {
|
|
1269
1279
|
let e = t.endDate ? `${t.startDate} - ${t.endDate}` : t.startDate;
|
|
@@ -1273,13 +1283,13 @@ function gt(e, t, n = 15) {
|
|
|
1273
1283
|
e.text(t, r - 15, n + i * 4, { align: "right" });
|
|
1274
1284
|
}), i += 2, e.setDrawColor(0), e.setLineWidth(.5), e.line(15, i, r - 15, i), i += 5, i;
|
|
1275
1285
|
}
|
|
1276
|
-
function
|
|
1286
|
+
function W(e, t, n) {
|
|
1277
1287
|
let r = e.internal.pageSize.getWidth(), i = e.internal.pageSize.getHeight();
|
|
1278
|
-
|
|
1288
|
+
R(e, I.SMALL, F.ITALIC), e.setTextColor(120), e.text(t, 15, i - 10), n !== void 0 && e.text(`Page ${n}`, r - 15, i - 10, { align: "right" }), e.setTextColor(0);
|
|
1279
1289
|
}
|
|
1280
1290
|
//#endregion
|
|
1281
1291
|
//#region src/layout/tables.ts
|
|
1282
|
-
var
|
|
1292
|
+
var G = {
|
|
1283
1293
|
compact: {
|
|
1284
1294
|
styles: {
|
|
1285
1295
|
fontSize: 7,
|
|
@@ -1436,14 +1446,14 @@ var _t = {
|
|
|
1436
1446
|
};
|
|
1437
1447
|
//#endregion
|
|
1438
1448
|
//#region src/generators/playerList.ts
|
|
1439
|
-
function
|
|
1449
|
+
function yt(n, r = {}) {
|
|
1440
1450
|
let { header: i, includeRanking: a = !0, includeEvents: o = !0 } = r, s = new e({
|
|
1441
1451
|
orientation: "portrait",
|
|
1442
1452
|
format: "a4"
|
|
1443
1453
|
});
|
|
1444
|
-
|
|
1454
|
+
L(s);
|
|
1445
1455
|
let c = 15;
|
|
1446
|
-
i && (c =
|
|
1456
|
+
i && (c = vt(s, {
|
|
1447
1457
|
...i,
|
|
1448
1458
|
subtitle: i.subtitle || "Player List"
|
|
1449
1459
|
}));
|
|
@@ -1484,7 +1494,7 @@ function vt(n, r = {}) {
|
|
|
1484
1494
|
events: e.events.join(", ")
|
|
1485
1495
|
}));
|
|
1486
1496
|
return t(s, {
|
|
1487
|
-
...
|
|
1497
|
+
...G.playerList,
|
|
1488
1498
|
startY: c,
|
|
1489
1499
|
columns: l,
|
|
1490
1500
|
body: u,
|
|
@@ -1516,24 +1526,24 @@ function vt(n, r = {}) {
|
|
|
1516
1526
|
events: { cellWidth: "auto" }
|
|
1517
1527
|
},
|
|
1518
1528
|
didDrawPage: (e) => {
|
|
1519
|
-
|
|
1529
|
+
W(s, `Generated ${(/* @__PURE__ */ new Date()).toLocaleDateString()}`, e.pageNumber);
|
|
1520
1530
|
}
|
|
1521
1531
|
}), s;
|
|
1522
1532
|
}
|
|
1523
1533
|
//#endregion
|
|
1524
1534
|
//#region src/generators/signInSheet.ts
|
|
1525
|
-
function
|
|
1535
|
+
function bt(n, r = {}) {
|
|
1526
1536
|
let { header: i, eventName: a, signInDate: o, signInTime: s } = r, c = new e({
|
|
1527
1537
|
orientation: "portrait",
|
|
1528
1538
|
format: "a4"
|
|
1529
1539
|
});
|
|
1530
|
-
|
|
1540
|
+
L(c);
|
|
1531
1541
|
let l = 15;
|
|
1532
|
-
if (i && (l =
|
|
1542
|
+
if (i && (l = vt(c, {
|
|
1533
1543
|
...i,
|
|
1534
1544
|
subtitle: i.subtitle || "Player Sign-In Sheet"
|
|
1535
1545
|
})), a || o) {
|
|
1536
|
-
|
|
1546
|
+
R(c, I.BODY, F.NORMAL);
|
|
1537
1547
|
let e = [];
|
|
1538
1548
|
a && e.push(`Event: ${a}`), o && e.push(`Date: ${o}`), s && e.push(`Time: ${s}`), c.text(e.join(" | "), 15, l), l += 6;
|
|
1539
1549
|
}
|
|
@@ -1646,18 +1656,18 @@ function yt(n, r = {}) {
|
|
|
1646
1656
|
}
|
|
1647
1657
|
//#endregion
|
|
1648
1658
|
//#region src/generators/courtCard.ts
|
|
1649
|
-
function
|
|
1659
|
+
function xt(t, n = {}) {
|
|
1650
1660
|
let { tournamentName: r = "", pageSize: i = "a5", cardsPerPage: a = 1 } = n, o = new e({
|
|
1651
1661
|
orientation: "landscape",
|
|
1652
1662
|
format: i
|
|
1653
1663
|
});
|
|
1654
|
-
return
|
|
1655
|
-
t > 0 && o.addPage(),
|
|
1664
|
+
return L(o), t.forEach((e, t) => {
|
|
1665
|
+
t > 0 && o.addPage(), St(o, e, r, a);
|
|
1656
1666
|
}), o;
|
|
1657
1667
|
}
|
|
1658
|
-
function
|
|
1668
|
+
function St(e, n, r, i) {
|
|
1659
1669
|
let a = e.internal.pageSize.getWidth(), o = a / 2, s = 15;
|
|
1660
|
-
if (r && (
|
|
1670
|
+
if (r && (R(e, I.BODY, F.NORMAL), e.setTextColor(100), e.text(r, o, s, { align: "center" }), e.setTextColor(0), s += 8), R(e, 28, F.BOLD), e.text(n.courtName, o, s, { align: "center" }), s += 5, n.venueName && (R(e, I.HEADING, F.NORMAL), e.setTextColor(100), e.text(n.venueName, o, s, { align: "center" }), e.setTextColor(0)), s += 8, e.setDrawColor(0), e.setLineWidth(1), e.line(30, s, a - 30, s), s += 8, n.currentMatch && (R(e, I.HEADING, F.BOLD), e.setTextColor(30, 60, 120), e.text("NOW PLAYING", o, s, { align: "center" }), e.setTextColor(0), s += 6, R(e, I.BODY, F.ITALIC), e.text(`${n.currentMatch.eventName} - ${n.currentMatch.roundName}`, o, s, { align: "center" }), s += 8, t(e, {
|
|
1661
1671
|
startY: s,
|
|
1662
1672
|
margin: {
|
|
1663
1673
|
left: 25,
|
|
@@ -1691,60 +1701,60 @@ function xt(e, n, r, i) {
|
|
|
1691
1701
|
}]
|
|
1692
1702
|
]
|
|
1693
1703
|
}), s = e.lastAutoTable?.finalY || s + 40, s += 8), n.nextMatch) {
|
|
1694
|
-
e.setDrawColor(180), e.setLineWidth(.3), e.line(50, s, a - 50, s), s += 6,
|
|
1704
|
+
e.setDrawColor(180), e.setLineWidth(.3), e.line(50, s, a - 50, s), s += 6, R(e, I.BODY, F.BOLD), e.setTextColor(100);
|
|
1695
1705
|
let t = n.nextMatch.scheduledTime ? `UP NEXT (${n.nextMatch.scheduledTime})` : "UP NEXT";
|
|
1696
|
-
e.text(t, o, s, { align: "center" }), e.setTextColor(0), s += 5,
|
|
1706
|
+
e.text(t, o, s, { align: "center" }), e.setTextColor(0), s += 5, R(e, I.BODY, F.NORMAL), e.text(`${n.nextMatch.eventName} - ${n.nextMatch.roundName}`, o, s, { align: "center" }), s += 5, R(e, I.HEADING, F.NORMAL), e.text(`${n.nextMatch.side1.name} vs. ${n.nextMatch.side2.name}`, o, s, { align: "center" });
|
|
1697
1707
|
}
|
|
1698
1708
|
}
|
|
1699
1709
|
//#endregion
|
|
1700
1710
|
//#region src/generators/matchCard.ts
|
|
1701
|
-
function
|
|
1711
|
+
function Ct(t, n = {}) {
|
|
1702
1712
|
let { cardsPerPage: r = 2, includeScoreBoxes: i = !0 } = n, a = new e({
|
|
1703
1713
|
orientation: "landscape",
|
|
1704
1714
|
format: "a5"
|
|
1705
1715
|
});
|
|
1706
|
-
return
|
|
1716
|
+
return L(a), t.forEach((e, t) => {
|
|
1707
1717
|
t > 0 && (r === 1 || t % r === 0) && a.addPage();
|
|
1708
1718
|
let n = r === 2 && t % 2 == 1 ? a.internal.pageSize.getHeight() / 2 : 5;
|
|
1709
|
-
|
|
1719
|
+
wt(a, e, n, i);
|
|
1710
1720
|
}), a;
|
|
1711
1721
|
}
|
|
1712
|
-
function
|
|
1722
|
+
function wt(e, t, n, r) {
|
|
1713
1723
|
let i = e.internal.pageSize.getWidth(), a = i / 2, o = n;
|
|
1714
|
-
if (t.tournamentName && (
|
|
1715
|
-
|
|
1724
|
+
if (t.tournamentName && (R(e, I.BODY, F.NORMAL), e.setTextColor(100), e.text(t.tournamentName, a, o, { align: "center" }), e.setTextColor(0), o += 5), R(e, I.HEADING, F.BOLD), e.text(`${t.eventName} - ${t.roundName}`, a, o, { align: "center" }), o += 5, t.courtName || t.scheduledTime) {
|
|
1725
|
+
R(e, I.BODY, F.NORMAL);
|
|
1716
1726
|
let n = [];
|
|
1717
1727
|
t.courtName && n.push(`Court: ${t.courtName}`), t.scheduledTime && n.push(`Time: ${t.scheduledTime}`), e.text(n.join(" "), a, o, { align: "center" }), o += 5;
|
|
1718
1728
|
}
|
|
1719
|
-
if (e.setDrawColor(0), e.setLineWidth(.5), e.line(10, o, i - 10, o), o += 6,
|
|
1720
|
-
e.setDrawColor(0), e.setLineWidth(.5), e.line(10, o, i - 10, o), o += 4,
|
|
1729
|
+
if (e.setDrawColor(0), e.setLineWidth(.5), e.line(10, o, i - 10, o), o += 6, Tt(e, t.side1, 10, o, i), o += 8, R(e, I.BODY, F.ITALIC), e.setTextColor(120), e.text("vs.", a, o, { align: "center" }), e.setTextColor(0), o += 6, Tt(e, t.side2, 10, o, i), o += 8, r) {
|
|
1730
|
+
e.setDrawColor(0), e.setLineWidth(.5), e.line(10, o, i - 10, o), o += 4, R(e, I.SMALL, F.BOLD), e.text("Score:", 10, o);
|
|
1721
1731
|
for (let t = 0; t < 5; t++) {
|
|
1722
1732
|
let n = 28 + t * 15;
|
|
1723
|
-
e.rect(n, o - 4, 12, 8),
|
|
1733
|
+
e.rect(n, o - 4, 12, 8), R(e, I.TINY, F.NORMAL), e.setTextColor(150), e.text(`Set ${t + 1}`, n + 6, o - 5, { align: "center" }), e.setTextColor(0);
|
|
1724
1734
|
}
|
|
1725
|
-
o += 14,
|
|
1735
|
+
o += 14, R(e, I.SMALL, F.NORMAL), e.text("Umpire:", 10, o), e.setDrawColor(150), e.setLineWidth(.3), e.line(30, o, 90, o), e.text("Signature:", i - 10 - 70, o), e.line(i - 10 - 40, o, i - 10, o);
|
|
1726
1736
|
}
|
|
1727
1737
|
}
|
|
1728
|
-
function
|
|
1729
|
-
|
|
1738
|
+
function Tt(e, t, n, r, i) {
|
|
1739
|
+
R(e, 14, F.BOLD);
|
|
1730
1740
|
let a = t.seedValue ? `[${t.seedValue}] ` : "";
|
|
1731
|
-
e.text(`${a}${t.name}`, n, r),
|
|
1741
|
+
e.text(`${a}${t.name}`, n, r), R(e, I.HEADING, F.NORMAL), e.setTextColor(80), e.text(t.nationality, i - n, r, { align: "right" }), e.setTextColor(0);
|
|
1732
1742
|
}
|
|
1733
1743
|
//#endregion
|
|
1734
1744
|
//#region src/core/extractDrawData.ts
|
|
1735
|
-
function
|
|
1745
|
+
function Et(e) {
|
|
1736
1746
|
let { drawDefinition: t, participants: n = [] } = e;
|
|
1737
|
-
if (!t) return
|
|
1747
|
+
if (!t) return Ot();
|
|
1738
1748
|
let r = e.structureId ? t.structures?.find((t) => t.structureId === e.structureId) : t.structures?.[0];
|
|
1739
|
-
if (!r) return
|
|
1749
|
+
if (!r) return Ot();
|
|
1740
1750
|
let i = /* @__PURE__ */ new Map();
|
|
1741
1751
|
n.forEach((e) => i.set(e.participantId, e));
|
|
1742
1752
|
let a = r.positionAssignments || [], o = (r.matchUps || []).reduce((e, t) => Math.max(e, t.roundNumber || 0), 0), s = e.structureId ? a.length : t.drawSize || a.length, c = e.structureId ? o : Math.log2(s), l = r.seedAssignments || [], u = a.map((e) => {
|
|
1743
1753
|
let t = e.participantId ? i.get(e.participantId) : void 0, n = l.find((t) => t.participantId === e.participantId);
|
|
1744
1754
|
return {
|
|
1745
1755
|
drawPosition: e.drawPosition,
|
|
1746
|
-
participantName: t ?
|
|
1747
|
-
nationality: t ?
|
|
1756
|
+
participantName: t ? H(t) : "",
|
|
1757
|
+
nationality: t ? U(t) : "",
|
|
1748
1758
|
seedValue: n?.seedValue,
|
|
1749
1759
|
entryStatus: e.entryStatus,
|
|
1750
1760
|
isBye: e.bye === !0
|
|
@@ -1753,17 +1763,18 @@ function Tt(e) {
|
|
|
1753
1763
|
roundNumber: e.roundNumber,
|
|
1754
1764
|
roundPosition: e.roundPosition,
|
|
1755
1765
|
drawPositions: e.drawPositions || [],
|
|
1756
|
-
|
|
1766
|
+
winnerDrawPosition: fe(e),
|
|
1767
|
+
score: $e(e.score),
|
|
1757
1768
|
winningSide: e.winningSide,
|
|
1758
1769
|
matchUpStatus: e.matchUpStatus
|
|
1759
1770
|
})), f = l.filter((e) => e.participantId).map((e) => {
|
|
1760
1771
|
let t = i.get(e.participantId);
|
|
1761
1772
|
return {
|
|
1762
1773
|
seedValue: e.seedValue,
|
|
1763
|
-
participantName: t ?
|
|
1764
|
-
nationality: t ?
|
|
1774
|
+
participantName: t ? H(t) : "",
|
|
1775
|
+
nationality: t ? U(t) : ""
|
|
1765
1776
|
};
|
|
1766
|
-
}).sort((e, t) => e.seedValue - t.seedValue), p =
|
|
1777
|
+
}).sort((e, t) => e.seedValue - t.seedValue), p = Dt(d, c, e.processedMatchUps);
|
|
1767
1778
|
return {
|
|
1768
1779
|
drawName: t.drawName || "",
|
|
1769
1780
|
drawSize: s,
|
|
@@ -1776,9 +1787,9 @@ function Tt(e) {
|
|
|
1776
1787
|
};
|
|
1777
1788
|
}
|
|
1778
1789
|
function K(e, t) {
|
|
1779
|
-
return
|
|
1790
|
+
return rt(e, t);
|
|
1780
1791
|
}
|
|
1781
|
-
function
|
|
1792
|
+
function Dt(e, t, n) {
|
|
1782
1793
|
if (n?.length) {
|
|
1783
1794
|
let e = {};
|
|
1784
1795
|
for (let t of n) t.roundNumber && !e[t.roundNumber] && (e[t.roundNumber] = t.abbreviatedRoundName || t.roundName || `R${t.roundNumber}`);
|
|
@@ -1793,14 +1804,14 @@ function Et(e, t, n) {
|
|
|
1793
1804
|
return (r.get(e) || 0) <= Math.ceil(n / 2);
|
|
1794
1805
|
})) {
|
|
1795
1806
|
let e = {};
|
|
1796
|
-
for (let n of i) e[n] =
|
|
1807
|
+
for (let n of i) e[n] = rt(n, t);
|
|
1797
1808
|
return e;
|
|
1798
1809
|
}
|
|
1799
1810
|
let a = {};
|
|
1800
1811
|
for (let e of i) a[e] = `R${e}`;
|
|
1801
1812
|
return a;
|
|
1802
1813
|
}
|
|
1803
|
-
function
|
|
1814
|
+
function Ot() {
|
|
1804
1815
|
return {
|
|
1805
1816
|
drawName: "",
|
|
1806
1817
|
drawSize: 0,
|
|
@@ -1813,13 +1824,13 @@ function Dt() {
|
|
|
1813
1824
|
}
|
|
1814
1825
|
//#endregion
|
|
1815
1826
|
//#region src/renderers/formatEntry.ts
|
|
1816
|
-
function
|
|
1827
|
+
function kt(e, t) {
|
|
1817
1828
|
if (e.isBye) return "Bye";
|
|
1818
1829
|
if (!e.participantName) return "";
|
|
1819
|
-
let n =
|
|
1830
|
+
let n = jt(e.participantName, t), r = Mt(e.nationality, t), i = e.seedValue ? Nt(e.seedValue, t) : "", a = e.entryStatus ? Ft(e.entryStatus, t) : "", o = [];
|
|
1820
1831
|
return t.seedPosition === "before-position" && i && o.push(i), o.push(n), t.seedPosition === "after-name" && i && o.push(i), r && o.push(r), t.seedPosition === "after-country" && i && o.push(i), a && o.push(a), o.join(" ");
|
|
1821
1832
|
}
|
|
1822
|
-
function
|
|
1833
|
+
function At(e, t) {
|
|
1823
1834
|
if (e.isBye) return {
|
|
1824
1835
|
name: "Bye",
|
|
1825
1836
|
nationality: ""
|
|
@@ -1828,13 +1839,13 @@ function kt(e, t) {
|
|
|
1828
1839
|
name: "",
|
|
1829
1840
|
nationality: ""
|
|
1830
1841
|
};
|
|
1831
|
-
let n =
|
|
1842
|
+
let n = jt(e.participantName, t), r = e.seedValue ? Nt(e.seedValue, t) : "", i = e.entryStatus ? Ft(e.entryStatus, t) : "", a = [];
|
|
1832
1843
|
return t.seedPosition === "before-position" && r && a.push(r), a.push(n), t.seedPosition === "after-name" && r && a.push(r), t.seedPosition === "after-country" && r && a.push(r), i && a.push(i), {
|
|
1833
1844
|
name: a.join(" "),
|
|
1834
1845
|
nationality: e.nationality || ""
|
|
1835
1846
|
};
|
|
1836
1847
|
}
|
|
1837
|
-
function
|
|
1848
|
+
function jt(e, t) {
|
|
1838
1849
|
if (t.nameFormat === "LAST First") return e.replace(",", "");
|
|
1839
1850
|
if (t.nameFormat === "F. LAST") {
|
|
1840
1851
|
let t = e.match(/^([^,]+),\s*(.+)/);
|
|
@@ -1842,7 +1853,7 @@ function At(e, t) {
|
|
|
1842
1853
|
}
|
|
1843
1854
|
return e;
|
|
1844
1855
|
}
|
|
1845
|
-
function
|
|
1856
|
+
function Mt(e, t) {
|
|
1846
1857
|
if (!e) return "";
|
|
1847
1858
|
switch (t.nationalityFormat) {
|
|
1848
1859
|
case "parens": return `(${e})`;
|
|
@@ -1850,14 +1861,14 @@ function jt(e, t) {
|
|
|
1850
1861
|
default: return e;
|
|
1851
1862
|
}
|
|
1852
1863
|
}
|
|
1853
|
-
function
|
|
1864
|
+
function Nt(e, t) {
|
|
1854
1865
|
switch (t.seedFormat) {
|
|
1855
1866
|
case "parens": return `(${e})`;
|
|
1856
1867
|
case "bare": return `${e}`;
|
|
1857
1868
|
default: return `[${e}]`;
|
|
1858
1869
|
}
|
|
1859
1870
|
}
|
|
1860
|
-
var
|
|
1871
|
+
var Pt = {
|
|
1861
1872
|
DIRECT_ACCEPTANCE: "",
|
|
1862
1873
|
WILDCARD: "WC",
|
|
1863
1874
|
QUALIFIER: "Q",
|
|
@@ -1868,9 +1879,9 @@ var Nt = {
|
|
|
1868
1879
|
JUNIOR_EXEMPT: "JE",
|
|
1869
1880
|
ORGANISER_ACCEPTANCE: "OA"
|
|
1870
1881
|
};
|
|
1871
|
-
function
|
|
1882
|
+
function Ft(e, t) {
|
|
1872
1883
|
if (!e) return "";
|
|
1873
|
-
let n =
|
|
1884
|
+
let n = Pt[e];
|
|
1874
1885
|
if (n === void 0) return e;
|
|
1875
1886
|
if (!n) return "";
|
|
1876
1887
|
switch (t.entryFormat) {
|
|
@@ -1889,22 +1900,22 @@ function q(e, t) {
|
|
|
1889
1900
|
}
|
|
1890
1901
|
//#endregion
|
|
1891
1902
|
//#region src/renderers/traditionalDraw.ts
|
|
1892
|
-
function
|
|
1893
|
-
let r = n || Math.log2(e), i = (t.contentHeight - 9) / e, a = i < 3.5, o = a ? .8 : 1.5, s = r, c = o * (s + 1), l = i < 2, u = a ? .18 : .3, d = Math.min(a ? 38 : 65, t.contentWidth * u), f = t.contentWidth - d - c, p = l ? 8 : 0, m = f - p, h = Math.min(65, Math.max(8, m / Math.max(1, s))), g = h + p, _ =
|
|
1894
|
-
return i < 2.5 ? _ = 5 : i < 3.5 && (_ =
|
|
1903
|
+
function It(e, t, n) {
|
|
1904
|
+
let r = n || Math.log2(e), i = (t.contentHeight - 9) / e, a = i < 3.5, o = a ? .8 : 1.5, s = r, c = o * (s + 1), l = i < 2, u = a ? .18 : .3, d = Math.min(a ? 38 : 65, t.contentWidth * u), f = t.contentWidth - d - c, p = l ? 8 : 0, m = f - p, h = Math.min(65, Math.max(8, m / Math.max(1, s))), g = h + p, _ = I.SMALL;
|
|
1905
|
+
return i < 2.5 ? _ = 5 : i < 3.5 && (_ = I.TINY), {
|
|
1895
1906
|
lineHeight: i,
|
|
1896
1907
|
roundColumnWidth: h,
|
|
1897
1908
|
firstRoundWidth: d,
|
|
1898
1909
|
secondRoundWidth: g,
|
|
1899
1910
|
connectorGap: o,
|
|
1900
1911
|
fontSize: _,
|
|
1901
|
-
scoreFontSize: a ? 5 :
|
|
1912
|
+
scoreFontSize: a ? 5 : I.TINY
|
|
1902
1913
|
};
|
|
1903
1914
|
}
|
|
1904
1915
|
function J(e, t, n, r, i = 0, a) {
|
|
1905
|
-
|
|
1916
|
+
Lt(t.matchUps) ? Rt(e, t, n, r) : Xt(e, t, n, r, i, a);
|
|
1906
1917
|
}
|
|
1907
|
-
function
|
|
1918
|
+
function Lt(e) {
|
|
1908
1919
|
let t = /* @__PURE__ */ new Map();
|
|
1909
1920
|
for (let n of e) t.set(n.roundNumber, (t.get(n.roundNumber) || 0) + 1);
|
|
1910
1921
|
let n = [...t.keys()].sort((e, t) => e - t);
|
|
@@ -1914,19 +1925,19 @@ function It(e) {
|
|
|
1914
1925
|
}
|
|
1915
1926
|
return !1;
|
|
1916
1927
|
}
|
|
1917
|
-
function
|
|
1918
|
-
let i = n.page.margins, a = r.contentY + 9, o = r.contentHeight - 9, s =
|
|
1919
|
-
|
|
1920
|
-
let y =
|
|
1921
|
-
|
|
1928
|
+
function Rt(e, t, n, r) {
|
|
1929
|
+
let i = n.page.margins, a = r.contentY + 9, o = r.contentHeight - 9, s = zt(t.matchUps), c = [...s.keys()].sort((e, t) => e - t), l = c.length, u = new Map(t.slots.map((e) => [e.drawPosition, e])), d = Bt(c, s), { feedConfig: f, connectorGap: p, firstRoundWidth: m, roundColumnWidth: h, fontSize: g, scoreFontSize: _ } = Vt(o, s, c, l, r), v = (e) => e === 0 ? i.left : i.left + m + p + (e - 1) * (h + p);
|
|
1930
|
+
Yt(e, c, t, f, n, r, v, l, h);
|
|
1931
|
+
let y = Ht(c, l, s, d, a, o, f.lineHeight);
|
|
1932
|
+
Ut(e, c, l, s, y, d, u, f, n, v, m, h, p, _), Jt(e, t, c, l, s, y, u, v, a, o, h, g, _, n);
|
|
1922
1933
|
}
|
|
1923
|
-
function
|
|
1934
|
+
function zt(e) {
|
|
1924
1935
|
let t = /* @__PURE__ */ new Map();
|
|
1925
1936
|
for (let n of e) t.has(n.roundNumber) || t.set(n.roundNumber, []), t.get(n.roundNumber).push(n);
|
|
1926
1937
|
for (let [, e] of t) e.sort((e, t) => e.roundPosition - t.roundPosition);
|
|
1927
1938
|
return t;
|
|
1928
1939
|
}
|
|
1929
|
-
function
|
|
1940
|
+
function Bt(e, t) {
|
|
1930
1941
|
let n = /* @__PURE__ */ new Set();
|
|
1931
1942
|
for (let r = 1; r < e.length; r++) {
|
|
1932
1943
|
let i = t.get(e[r - 1])?.length || 0;
|
|
@@ -1934,10 +1945,10 @@ function zt(e, t) {
|
|
|
1934
1945
|
}
|
|
1935
1946
|
return n;
|
|
1936
1947
|
}
|
|
1937
|
-
function
|
|
1938
|
-
let a = 1.5, o = e / ((t.get(n[0])?.length || 1) * 2), s = o < 3.5, c = Math.min(s ? 50 : 60, i.contentWidth * .25), l = i.contentWidth - c - a * (r + 1), u = Math.max(8, l / Math.max(1, r)), d =
|
|
1939
|
-
o < 2.5 ? d = 5 : o < 3.5 && (d =
|
|
1940
|
-
let f = s ? 5 :
|
|
1948
|
+
function Vt(e, t, n, r, i) {
|
|
1949
|
+
let a = 1.5, o = e / ((t.get(n[0])?.length || 1) * 2), s = o < 3.5, c = Math.min(s ? 50 : 60, i.contentWidth * .25), l = i.contentWidth - c - a * (r + 1), u = Math.max(8, l / Math.max(1, r)), d = I.SMALL;
|
|
1950
|
+
o < 2.5 ? d = 5 : o < 3.5 && (d = I.TINY);
|
|
1951
|
+
let f = s ? 5 : I.TINY;
|
|
1941
1952
|
return {
|
|
1942
1953
|
feedConfig: {
|
|
1943
1954
|
lineHeight: o,
|
|
@@ -1955,7 +1966,7 @@ function Bt(e, t, n, r, i) {
|
|
|
1955
1966
|
scoreFontSize: f
|
|
1956
1967
|
};
|
|
1957
1968
|
}
|
|
1958
|
-
function
|
|
1969
|
+
function Ht(e, t, n, r, i, a, o) {
|
|
1959
1970
|
let s = /* @__PURE__ */ new Map();
|
|
1960
1971
|
for (let c = 0; c < t; c++) {
|
|
1961
1972
|
let t = e[c], l = n.get(t)?.length || 0;
|
|
@@ -1999,19 +2010,19 @@ function Vt(e, t, n, r, i, a, o) {
|
|
|
1999
2010
|
}
|
|
2000
2011
|
return s;
|
|
2001
2012
|
}
|
|
2002
|
-
function
|
|
2013
|
+
function Ut(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
2003
2014
|
for (let m = 0; m < n; m++) {
|
|
2004
2015
|
let h = t[m], g = r.get(h) || [], _ = i.get(h) || [], v = l(m), y = m === 0 ? u : d, b = a.has(h), x = v + y, S = m < n - 1 && a.has(t[m + 1]);
|
|
2005
2016
|
for (let i = 0; i < g.length; i++) {
|
|
2006
2017
|
let a = g[i], h = _[i];
|
|
2007
2018
|
if (h) {
|
|
2008
|
-
if (e.setDrawColor(40), e.setLineWidth(.25), m === 0 ?
|
|
2019
|
+
if (e.setDrawColor(40), e.setLineWidth(.25), m === 0 ? Wt(e, a, h, o, c, s, v, u, x, f, S) : b ? Gt(e, a, h, o, r, t, m, c, s, v, d, x, f, S) : Kt(e, a, h, o, c, s, v, d, x, f, S), m < n - 1) {
|
|
2009
2020
|
let t = l(m + 1);
|
|
2010
2021
|
S ? e.line(x, h.midY, t, h.midY) : e.line(x + f, h.midY, t, h.midY);
|
|
2011
2022
|
}
|
|
2012
2023
|
if (a.score) {
|
|
2013
2024
|
let t = q(a.score, c);
|
|
2014
|
-
|
|
2025
|
+
R(e, p, F.NORMAL), e.setTextColor(60, 60, 160);
|
|
2015
2026
|
let n = h.midY + p * .12;
|
|
2016
2027
|
e.text(t, x - 1, n, { align: "right" }), e.setTextColor(0);
|
|
2017
2028
|
}
|
|
@@ -2019,52 +2030,52 @@ function Ht(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
|
2019
2030
|
}
|
|
2020
2031
|
}
|
|
2021
2032
|
}
|
|
2022
|
-
function
|
|
2023
|
-
t.drawPositions[0] &&
|
|
2033
|
+
function Wt(e, t, n, r, i, a, o, s, c, l, u) {
|
|
2034
|
+
t.drawPositions[0] && rn(e, r.get(t.drawPositions[0]), t.drawPositions[0], i, a, o, n.topY, s), t.drawPositions[1] && rn(e, r.get(t.drawPositions[1]), t.drawPositions[1], i, a, o, n.bottomY, s), qt(e, n, c, l, u);
|
|
2024
2035
|
}
|
|
2025
|
-
function
|
|
2036
|
+
function Gt(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
2026
2037
|
let m = a[o - 1], h = i.get(m) || [], g = /* @__PURE__ */ new Set();
|
|
2027
|
-
for (let e of h) e.winningSide && g.add(e.
|
|
2038
|
+
for (let e of h) e.winningSide && e.winnerDrawPosition !== void 0 && g.add(e.winnerDrawPosition);
|
|
2028
2039
|
let _ = t.drawPositions.find((e) => e && g.has(e)), v = t.drawPositions.find((e) => e && e !== _);
|
|
2029
|
-
if (e.line(l, n.midY, l, n.bottomY), v ?
|
|
2040
|
+
if (e.line(l, n.midY, l, n.bottomY), v ? rn(e, r.get(v), v, s, c, l, n.topY, u) : e.line(l, n.topY, l + u, n.topY), e.line(l, n.bottomY, l + u, n.bottomY), _) {
|
|
2030
2041
|
let t = r.get(_);
|
|
2031
|
-
t?.participantName &&
|
|
2042
|
+
t?.participantName && an(e, t, s, c, l, n.bottomY);
|
|
2032
2043
|
}
|
|
2033
|
-
|
|
2044
|
+
qt(e, n, d, f, p);
|
|
2034
2045
|
}
|
|
2035
|
-
function
|
|
2046
|
+
function Kt(e, t, n, r, i, a, o, s, c, l, u) {
|
|
2036
2047
|
if (e.line(o, n.topY, o + s, n.topY), e.line(o, n.bottomY, o + s, n.bottomY), t.drawPositions[0]) {
|
|
2037
2048
|
let s = r.get(t.drawPositions[0]);
|
|
2038
|
-
s?.participantName &&
|
|
2049
|
+
s?.participantName && an(e, s, i, a, o, n.topY);
|
|
2039
2050
|
}
|
|
2040
2051
|
if (t.drawPositions[1]) {
|
|
2041
2052
|
let s = r.get(t.drawPositions[1]);
|
|
2042
|
-
s?.participantName &&
|
|
2053
|
+
s?.participantName && an(e, s, i, a, o, n.bottomY);
|
|
2043
2054
|
}
|
|
2044
|
-
|
|
2055
|
+
qt(e, n, c, l, u);
|
|
2045
2056
|
}
|
|
2046
|
-
function
|
|
2057
|
+
function qt(e, t, n, r, i) {
|
|
2047
2058
|
i ? e.line(n, t.topY, n, t.bottomY) : (e.line(n + r, t.topY, n + r, t.bottomY), e.line(n, t.topY, n + r, t.topY), e.line(n, t.bottomY, n + r, t.bottomY));
|
|
2048
2059
|
}
|
|
2049
|
-
function
|
|
2060
|
+
function Jt(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
2050
2061
|
if (t.noWinnerColumn) return;
|
|
2051
2062
|
let m = s(r), h = n.at(-1), g = (a.get(h) || [])[0]?.midY || c + l / 2;
|
|
2052
2063
|
e.setDrawColor(40), e.setLineWidth(.25), e.line(m, g, m + Math.min(65, u), g);
|
|
2053
2064
|
let _ = (i.get(h) || [])[0];
|
|
2054
2065
|
if (_?.winningSide) {
|
|
2055
|
-
let t = _.
|
|
2066
|
+
let t = _.winnerDrawPosition, n = t === void 0 ? void 0 : o.get(t);
|
|
2056
2067
|
if (n) {
|
|
2057
|
-
|
|
2058
|
-
let { name: t } =
|
|
2068
|
+
R(e, d + 1, F.BOLD);
|
|
2069
|
+
let { name: t } = At(n, p);
|
|
2059
2070
|
if (e.text(t, m + 1, g - .5), _.score) {
|
|
2060
2071
|
let t = q(_.score, p);
|
|
2061
|
-
|
|
2072
|
+
R(e, f, F.NORMAL), e.setTextColor(60, 60, 160), e.text(t, m + 1, g + f * .4), e.setTextColor(0);
|
|
2062
2073
|
}
|
|
2063
2074
|
}
|
|
2064
2075
|
}
|
|
2065
2076
|
}
|
|
2066
|
-
function
|
|
2067
|
-
|
|
2077
|
+
function Yt(e, t, n, r, i, a, o, s, c) {
|
|
2078
|
+
R(e, r.fontSize <= I.TINY ? 5.5 : I.SMALL, F.BOLD), e.setTextColor(40);
|
|
2068
2079
|
for (let l = 0; l < s; l++) {
|
|
2069
2080
|
let s = t[l], u = K(s, n.totalRounds), d = n.roundLabelMap?.[s] || i.roundLabels[u] || u, f = o(l), p = l === 0 ? r.firstRoundWidth : c;
|
|
2070
2081
|
e.text(d, f + p / 2, a.contentY + 2, { align: "center" }), e.setDrawColor(160), e.setLineWidth(.15), e.line(f + 2, a.contentY + 3.5, f + p - 2, a.contentY + 3.5);
|
|
@@ -2072,45 +2083,45 @@ function Jt(e, t, n, r, i, a, o, s, c) {
|
|
|
2072
2083
|
let l = o(s);
|
|
2073
2084
|
e.text("Winner", l + c / 2, a.contentY + 2, { align: "center" }), e.setDrawColor(160), e.line(l + 2, a.contentY + 3.5, l + c - 2, a.contentY + 3.5), e.setTextColor(0);
|
|
2074
2085
|
}
|
|
2075
|
-
function
|
|
2076
|
-
let o = a || t.drawSize, s = t.totalRounds || Math.ceil(Math.log2(o)), c = Math.log2(o), l = Number.isInteger(c) ? Math.min(c, s) : s, u =
|
|
2077
|
-
|
|
2078
|
-
for (let r = 0; r < l; r++)
|
|
2079
|
-
t.noWinnerColumn ||
|
|
2086
|
+
function Xt(e, t, n, r, i = 0, a) {
|
|
2087
|
+
let o = a || t.drawSize, s = t.totalRounds || Math.ceil(Math.log2(o)), c = Math.log2(o), l = Number.isInteger(c) ? Math.min(c, s) : s, u = It(o, r, l), d = n.page.margins.left, f = r.contentY + 9;
|
|
2088
|
+
en(e, l, t.totalRounds, u, n, d, r.contentY + 2, t.roundLabelMap, t.noWinnerColumn);
|
|
2089
|
+
for (let r = 0; r < l; r++) Zt(e, t, n, u, o, r, l, d, f, i);
|
|
2090
|
+
t.noWinnerColumn || $t(e, t, n, u, l, d, f);
|
|
2080
2091
|
}
|
|
2081
|
-
function
|
|
2082
|
-
let u = i / 2 ** (a + 1), d = r.lineHeight * 2 ** a, f =
|
|
2092
|
+
function Zt(e, t, n, r, i, a, o, s, c, l) {
|
|
2093
|
+
let u = i / 2 ** (a + 1), d = r.lineHeight * 2 ** a, f = nn(a, r, s), p = (2 ** a - 1) * r.lineHeight / 2, m = 2 ** (a + 1) * r.lineHeight;
|
|
2083
2094
|
for (let i = 0; i < u; i++) {
|
|
2084
2095
|
let u = c + p + i * m, h = u + d, g = (u + h) / 2;
|
|
2085
2096
|
if (a === 0) {
|
|
2086
2097
|
let a = l + i * 2 + 1, o = l + i * 2 + 2;
|
|
2087
|
-
|
|
2098
|
+
rn(e, sn(t.slots, a), a, n, r, f, u), rn(e, sn(t.slots, o), o, n, r, f, h);
|
|
2088
2099
|
} else {
|
|
2089
|
-
let t =
|
|
2100
|
+
let t = tn(a, r);
|
|
2090
2101
|
e.setDrawColor(40), e.setLineWidth(.25), e.line(f, u, f + t, u), e.line(f, h, f + t, h);
|
|
2091
2102
|
}
|
|
2092
|
-
let _ = a === o - 1, v = f +
|
|
2103
|
+
let _ = a === o - 1, v = f + tn(a, r);
|
|
2093
2104
|
if (e.setDrawColor(40), e.setLineWidth(.25), e.line(v + r.connectorGap, u, v + r.connectorGap, h), e.line(v, u, v + r.connectorGap, u), e.line(v, h, v + r.connectorGap, h), !_ || !t.noWinnerColumn) {
|
|
2094
|
-
let t =
|
|
2105
|
+
let t = nn(a + 1, r, s);
|
|
2095
2106
|
e.line(v + r.connectorGap, g, t, g);
|
|
2096
2107
|
}
|
|
2097
|
-
let y =
|
|
2108
|
+
let y = cn(t.matchUps, a + 1, i + 1);
|
|
2098
2109
|
if (_ && t.noWinnerColumn) {
|
|
2099
|
-
let i =
|
|
2100
|
-
i && (e.setDrawColor(40), e.setLineWidth(.25), e.line(v + r.connectorGap, g, v + r.connectorGap + r.roundColumnWidth, g),
|
|
2110
|
+
let i = ln(y, t.slots);
|
|
2111
|
+
i && (e.setDrawColor(40), e.setLineWidth(.25), e.line(v + r.connectorGap, g, v + r.connectorGap + r.roundColumnWidth, g), an(e, i, n, r, v + r.connectorGap, g), y?.score && Qt(e, y, n, r, d, v + r.connectorGap, a, g));
|
|
2101
2112
|
} else if (!_) {
|
|
2102
|
-
let i =
|
|
2113
|
+
let i = ln(y, t.slots);
|
|
2103
2114
|
if (i) {
|
|
2104
|
-
let t =
|
|
2105
|
-
|
|
2115
|
+
let t = nn(a + 1, r, s);
|
|
2116
|
+
an(e, i, n, r, t, g), y?.score && Qt(e, y, n, r, d, t, a, g);
|
|
2106
2117
|
}
|
|
2107
2118
|
}
|
|
2108
2119
|
}
|
|
2109
2120
|
}
|
|
2110
|
-
function
|
|
2121
|
+
function Qt(e, t, n, r, i, a, o, s) {
|
|
2111
2122
|
let c = q(t.score, n);
|
|
2112
|
-
if (
|
|
2113
|
-
let t = a +
|
|
2123
|
+
if (R(e, r.scoreFontSize, F.NORMAL), e.setTextColor(60, 60, 160), i * 2 < r.scoreFontSize * 1.2) {
|
|
2124
|
+
let t = a + tn(o + 1, r) - 1;
|
|
2114
2125
|
e.text(c, t, s - .5, { align: "right" });
|
|
2115
2126
|
} else {
|
|
2116
2127
|
let t = r.scoreFontSize * .4;
|
|
@@ -2118,58 +2129,58 @@ function Zt(e, t, n, r, i, a, o, s) {
|
|
|
2118
2129
|
}
|
|
2119
2130
|
e.setTextColor(0);
|
|
2120
2131
|
}
|
|
2121
|
-
function
|
|
2122
|
-
let s =
|
|
2132
|
+
function $t(e, t, n, r, i, a, o) {
|
|
2133
|
+
let s = nn(i, r, a), c = (2 ** (i - 1) - 1) * r.lineHeight / 2, l = r.lineHeight * 2 ** (i - 1), u = o + c + l / 2;
|
|
2123
2134
|
e.setDrawColor(40), e.setLineWidth(.25), e.line(s, u, s + r.roundColumnWidth, u);
|
|
2124
|
-
let d =
|
|
2135
|
+
let d = cn(t.matchUps, i, 1);
|
|
2125
2136
|
if (d?.winningSide) {
|
|
2126
|
-
let i = d.
|
|
2137
|
+
let i = d.winnerDrawPosition, a = sn(t.slots, i);
|
|
2127
2138
|
if (a) {
|
|
2128
|
-
|
|
2129
|
-
let { name: t } =
|
|
2139
|
+
R(e, r.fontSize + 1, F.BOLD);
|
|
2140
|
+
let { name: t } = At(a, n);
|
|
2130
2141
|
if (e.text(t, s + 1, u - .5), d.score) {
|
|
2131
2142
|
let t = q(d.score, n);
|
|
2132
|
-
|
|
2143
|
+
R(e, r.scoreFontSize, F.NORMAL), e.setTextColor(60, 60, 160), e.text(t, s + 1, u + r.scoreFontSize * .4), e.setTextColor(0);
|
|
2133
2144
|
}
|
|
2134
2145
|
}
|
|
2135
2146
|
}
|
|
2136
2147
|
}
|
|
2137
|
-
function
|
|
2138
|
-
|
|
2148
|
+
function en(e, t, n, r, i, a, o, s, c) {
|
|
2149
|
+
R(e, r.fontSize <= I.TINY ? 5.5 : I.SMALL, F.BOLD), e.setTextColor(40);
|
|
2139
2150
|
for (let c = 0; c < t; c++) {
|
|
2140
|
-
let l = n - t + c + 1, u = K(l, n), d = s?.[l] || i.roundLabels[u] || u, f =
|
|
2151
|
+
let l = n - t + c + 1, u = K(l, n), d = s?.[l] || i.roundLabels[u] || u, f = nn(c, r, a), p = tn(c, r), m = f + p / 2;
|
|
2141
2152
|
e.text(d, m, o, { align: "center" }), e.setDrawColor(160), e.setLineWidth(.15), e.line(f + 2, o + 1.5, f + p - 2, o + 1.5);
|
|
2142
2153
|
}
|
|
2143
2154
|
if (!c) {
|
|
2144
|
-
let n =
|
|
2155
|
+
let n = nn(t, r, a);
|
|
2145
2156
|
e.text("Winner", n + r.roundColumnWidth / 2, o, { align: "center" }), e.setDrawColor(160), e.setLineWidth(.15), e.line(n + 2, o + 1.5, n + r.roundColumnWidth - 2, o + 1.5);
|
|
2146
2157
|
}
|
|
2147
2158
|
e.setTextColor(0);
|
|
2148
2159
|
}
|
|
2149
|
-
function
|
|
2160
|
+
function tn(e, t) {
|
|
2150
2161
|
return e === 0 ? t.firstRoundWidth : e === 1 ? t.secondRoundWidth : t.roundColumnWidth;
|
|
2151
2162
|
}
|
|
2152
|
-
function
|
|
2163
|
+
function nn(e, t, n) {
|
|
2153
2164
|
if (e === 0) return n;
|
|
2154
2165
|
let r = n + t.firstRoundWidth + t.connectorGap;
|
|
2155
|
-
for (let n = 1; n < e; n++) r +=
|
|
2166
|
+
for (let n = 1; n < e; n++) r += tn(n, t) + t.connectorGap;
|
|
2156
2167
|
return r;
|
|
2157
2168
|
}
|
|
2158
|
-
function
|
|
2169
|
+
function rn(e, t, n, r, i, a, o, s) {
|
|
2159
2170
|
let c = i.fontSize <= 5 ? 4 : 5, l = i.fontSize <= 5 ? 5 : 6, u = s || i.firstRoundWidth, d = i.lineHeight < 2 ? .15 : .3;
|
|
2160
|
-
|
|
2171
|
+
R(e, i.scoreFontSize, F.NORMAL), e.setTextColor(120), e.text(`${n}`, a, o - d, { align: "left" }), e.setTextColor(0), t?.nationality && (R(e, i.scoreFontSize, F.NORMAL), e.setTextColor(100), e.text(t.nationality, a + c + l - 1, o - d, { align: "right" }), e.setTextColor(0));
|
|
2161
2172
|
let f = a + c + l, p = a + u;
|
|
2162
2173
|
if (e.setDrawColor(40), e.setLineWidth(.25), e.line(f, o, p, o), !t) return;
|
|
2163
|
-
let { name: m } =
|
|
2174
|
+
let { name: m } = At(t, r);
|
|
2164
2175
|
if (!m) return;
|
|
2165
|
-
|
|
2176
|
+
R(e, i.fontSize, t.isBye ? F.ITALIC : F.NORMAL), t.isBye && e.setTextColor(150);
|
|
2166
2177
|
let h = p - f - 2, g = m;
|
|
2167
|
-
e.getTextWidth(m) > h && (g =
|
|
2178
|
+
e.getTextWidth(m) > h && (g = on(t.participantName));
|
|
2168
2179
|
let _ = i.lineHeight < 2 ? .2 : .5;
|
|
2169
2180
|
e.text(g, f + 1, o - _), t.isBye && e.setTextColor(0);
|
|
2170
2181
|
}
|
|
2171
|
-
function
|
|
2172
|
-
let o =
|
|
2182
|
+
function an(e, t, n, r, i, a) {
|
|
2183
|
+
let o = on(t.participantName), s = "";
|
|
2173
2184
|
if (t.seedValue) switch (n.seedFormat) {
|
|
2174
2185
|
case "parens":
|
|
2175
2186
|
s = `(${t.seedValue})`;
|
|
@@ -2180,272 +2191,302 @@ function rn(e, t, n, r, i, a) {
|
|
|
2180
2191
|
default: s = `[${t.seedValue}]`;
|
|
2181
2192
|
}
|
|
2182
2193
|
let c = s ? `${o} ${s}` : o;
|
|
2183
|
-
|
|
2194
|
+
R(e, r.fontSize, F.BOLD), e.text(c, i + 1, a - .5);
|
|
2184
2195
|
}
|
|
2185
|
-
function
|
|
2196
|
+
function on(e) {
|
|
2186
2197
|
let t = e.match(/^([^,]+),\s*(.+)/);
|
|
2187
2198
|
if (t) return `${t[2][0]}. ${t[1]}`;
|
|
2188
2199
|
let n = e.match(/^(\S+)\s+(.+)/);
|
|
2189
2200
|
return n ? `${n[1][0]}. ${n[2]}` : e;
|
|
2190
2201
|
}
|
|
2191
|
-
function
|
|
2192
|
-
return e.find((e) => e.drawPosition === t);
|
|
2202
|
+
function sn(e, t) {
|
|
2203
|
+
return t === void 0 ? void 0 : e.find((e) => e.drawPosition === t);
|
|
2193
2204
|
}
|
|
2194
|
-
function
|
|
2205
|
+
function cn(e, t, n) {
|
|
2195
2206
|
return e.find((e) => e.roundNumber === t && e.roundPosition === n);
|
|
2196
2207
|
}
|
|
2197
|
-
function
|
|
2208
|
+
function ln(e, t) {
|
|
2198
2209
|
if (e) {
|
|
2199
2210
|
if (e.winningSide) {
|
|
2200
|
-
let n = e.
|
|
2201
|
-
return
|
|
2211
|
+
let n = e.winnerDrawPosition;
|
|
2212
|
+
return sn(t, n);
|
|
2202
2213
|
}
|
|
2203
2214
|
if (e.matchUpStatus === "BYE") for (let n of e.drawPositions) {
|
|
2204
|
-
let e =
|
|
2215
|
+
let e = sn(t, n);
|
|
2205
2216
|
if (e && !e.isBye && e.participantName) return e;
|
|
2206
2217
|
}
|
|
2207
2218
|
}
|
|
2208
2219
|
}
|
|
2209
2220
|
//#endregion
|
|
2221
|
+
//#region src/renderers/positionlessPlacement.ts
|
|
2222
|
+
function un({ partitionCount: e, matchUps: t, matchUp: n }) {
|
|
2223
|
+
if (e < 1) return;
|
|
2224
|
+
let r = t.filter((e) => e.roundNumber === n.roundNumber).length;
|
|
2225
|
+
if (r < e) return;
|
|
2226
|
+
let i = r / e, a = n.roundPosition ?? 1, o = Math.floor((a - 1) / i);
|
|
2227
|
+
return Math.min(o, e - 1);
|
|
2228
|
+
}
|
|
2229
|
+
function dn({ positionPredicate: e, partitionIndex: t, partitionCount: n, matchUps: r, matchUp: i }) {
|
|
2230
|
+
let a = i.drawPositions ?? [];
|
|
2231
|
+
return a.length ? a.every(e) : un({
|
|
2232
|
+
matchUps: r,
|
|
2233
|
+
matchUp: i,
|
|
2234
|
+
partitionCount: n
|
|
2235
|
+
}) === t;
|
|
2236
|
+
}
|
|
2237
|
+
//#endregion
|
|
2210
2238
|
//#region src/renderers/mirroredDraw.ts
|
|
2211
|
-
function
|
|
2212
|
-
let i = n.page.margins, a = r.contentY + 9, o = r.contentHeight - 9, s = t.drawSize / 2, c = Math.log2(s), l = r.contentWidth, u = Math.min(30, l * .08), d = (l - u) / 2, f = i.left + d, p = o / s, m = p < 3.5, h = m ? .8 : 1.5, g = Math.min(m ? 30 : 50, d * .22), _ = c, v = d - g - h * (_ + 1), y = Math.max(8, v / Math.max(1, _)), b =
|
|
2213
|
-
p < 2.5 ? b = 5 : m && (b =
|
|
2214
|
-
let x = m ? 5 :
|
|
2239
|
+
function fn(e, t, n, r) {
|
|
2240
|
+
let i = n.page.margins, a = r.contentY + 9, o = r.contentHeight - 9, s = t.drawSize / 2, c = Math.log2(s), l = r.contentWidth, u = Math.min(30, l * .08), d = (l - u) / 2, f = i.left + d, p = o / s, m = p < 3.5, h = m ? .8 : 1.5, g = Math.min(m ? 30 : 50, d * .22), _ = c, v = d - g - h * (_ + 1), y = Math.max(8, v / Math.max(1, _)), b = I.SMALL;
|
|
2241
|
+
p < 2.5 ? b = 5 : m && (b = I.TINY);
|
|
2242
|
+
let x = m ? 5 : I.TINY, S = {
|
|
2215
2243
|
lineHeight: p,
|
|
2216
2244
|
roundColumnWidth: y,
|
|
2217
2245
|
firstRoundWidth: g,
|
|
2218
2246
|
connectorGap: h,
|
|
2219
2247
|
fontSize: b,
|
|
2220
2248
|
scoreFontSize: x
|
|
2221
|
-
},
|
|
2249
|
+
}, ee = t.slots.filter((e) => e.drawPosition <= s), te = t.slots.filter((e) => e.drawPosition > s), C = t.matchUps.filter((e) => dn({
|
|
2250
|
+
positionPredicate: (e) => e <= s,
|
|
2251
|
+
matchUps: t.matchUps,
|
|
2252
|
+
partitionIndex: 0,
|
|
2253
|
+
partitionCount: 2,
|
|
2254
|
+
matchUp: e
|
|
2255
|
+
})), w = t.matchUps.filter((e) => dn({
|
|
2256
|
+
positionPredicate: (e) => e > s,
|
|
2257
|
+
matchUps: t.matchUps,
|
|
2258
|
+
partitionIndex: 1,
|
|
2259
|
+
partitionCount: 2,
|
|
2260
|
+
matchUp: e
|
|
2261
|
+
})), T = te.map((e) => ({
|
|
2222
2262
|
...e,
|
|
2223
2263
|
drawPosition: e.drawPosition - s
|
|
2224
|
-
})),
|
|
2225
|
-
for (let e of
|
|
2226
|
-
let
|
|
2227
|
-
for (let [, e] of
|
|
2228
|
-
|
|
2264
|
+
})), E = /* @__PURE__ */ new Map();
|
|
2265
|
+
for (let e of w) E.has(e.roundNumber) || E.set(e.roundNumber, []), E.get(e.roundNumber).push(e);
|
|
2266
|
+
let D = [];
|
|
2267
|
+
for (let [, e] of E) e.sort((e, t) => e.roundPosition - t.roundPosition), e.forEach((e, t) => {
|
|
2268
|
+
D.push({
|
|
2229
2269
|
...e,
|
|
2230
2270
|
drawPositions: e.drawPositions.map((e) => e - s),
|
|
2271
|
+
winnerDrawPosition: e.winnerDrawPosition === void 0 ? void 0 : e.winnerDrawPosition - s,
|
|
2231
2272
|
roundPosition: t + 1
|
|
2232
2273
|
});
|
|
2233
2274
|
});
|
|
2234
|
-
let
|
|
2235
|
-
for (let e of
|
|
2236
|
-
let
|
|
2237
|
-
for (let [, e] of
|
|
2238
|
-
|
|
2275
|
+
let O = /* @__PURE__ */ new Map();
|
|
2276
|
+
for (let e of C) O.has(e.roundNumber) || O.set(e.roundNumber, []), O.get(e.roundNumber).push(e);
|
|
2277
|
+
let k = [];
|
|
2278
|
+
for (let [, e] of O) e.sort((e, t) => e.roundPosition - t.roundPosition), e.forEach((e, t) => {
|
|
2279
|
+
k.push({
|
|
2239
2280
|
...e,
|
|
2240
2281
|
roundPosition: t + 1
|
|
2241
2282
|
});
|
|
2242
2283
|
});
|
|
2243
|
-
|
|
2244
|
-
let
|
|
2245
|
-
if (
|
|
2284
|
+
hn(e, c, t.totalRounds, S, n, i.left, i.left + l, r.contentY + 2, t.roundLabelMap), R(e, m ? 5.5 : I.SMALL, F.BOLD), e.setTextColor(40), e.text("Winner", f + u / 2, r.contentY + 2, { align: "center" }), e.setDrawColor(160), e.setLineWidth(.15), e.line(f + 2, r.contentY + 3.5, f + u - 2, r.contentY + 3.5), e.setTextColor(0), pn(e, ee, k, c, S, n, i.left, a, t.totalRounds), mn(e, T, D, c, S, n, i.left + l, a, t.totalRounds);
|
|
2285
|
+
let A = t.matchUps.find((e) => e.roundNumber === t.totalRounds);
|
|
2286
|
+
if (A) {
|
|
2246
2287
|
let r = a + o / 2;
|
|
2247
|
-
if (e.setDrawColor(40), e.setLineWidth(.25), e.line(f + 2, r, f + u - 2, r),
|
|
2248
|
-
let i =
|
|
2288
|
+
if (e.setDrawColor(40), e.setLineWidth(.25), e.line(f + 2, r, f + u - 2, r), A.winningSide) {
|
|
2289
|
+
let i = A.winnerDrawPosition, a = t.slots.find((e) => e.drawPosition === i);
|
|
2249
2290
|
if (a) {
|
|
2250
|
-
let { name: t } =
|
|
2251
|
-
|
|
2291
|
+
let { name: t } = At(a, n);
|
|
2292
|
+
R(e, b + 1, F.BOLD), e.text(t, f + u / 2, r - 1, { align: "center" });
|
|
2252
2293
|
}
|
|
2253
2294
|
}
|
|
2254
|
-
|
|
2295
|
+
A.score && (R(e, x, F.NORMAL), e.setTextColor(60, 60, 160), e.text(q(A.score, n), f + u / 2, r + x * .4, { align: "center" }), e.setTextColor(0));
|
|
2255
2296
|
}
|
|
2256
2297
|
}
|
|
2257
|
-
function
|
|
2298
|
+
function pn(e, t, n, r, i, a, o, s, c) {
|
|
2258
2299
|
let l = new Map(t.map((e) => [e.drawPosition, e])), u = t.length;
|
|
2259
2300
|
for (let t = 0; t < r; t++) {
|
|
2260
|
-
let c = u / 2 ** (t + 1), d = i.lineHeight * 2 ** t, f = (2 ** t - 1) * i.lineHeight / 2, p = 2 ** (t + 1) * i.lineHeight, m =
|
|
2301
|
+
let c = u / 2 ** (t + 1), d = i.lineHeight * 2 ** t, f = (2 ** t - 1) * i.lineHeight / 2, p = 2 ** (t + 1) * i.lineHeight, m = gn(t, i, o), h = t === 0 ? i.firstRoundWidth : i.roundColumnWidth;
|
|
2261
2302
|
for (let u = 0; u < c; u++) {
|
|
2262
2303
|
let c = s + f + u * p, g = c + d, _ = (c + g) / 2;
|
|
2263
2304
|
if (t === 0) {
|
|
2264
2305
|
let t = u * 2 + 1, n = u * 2 + 2;
|
|
2265
|
-
|
|
2306
|
+
vn(e, l.get(t), i, m, c, h, "ltr"), vn(e, l.get(n), i, m, g, h, "ltr");
|
|
2266
2307
|
} else e.setDrawColor(40), e.setLineWidth(.25), e.line(m, c, m + h, c), e.line(m, g, m + h, g);
|
|
2267
|
-
let v = m + h, y =
|
|
2308
|
+
let v = m + h, y = gn(t + 1, i, o);
|
|
2268
2309
|
e.setDrawColor(40), e.setLineWidth(.25), e.line(v + i.connectorGap, c, v + i.connectorGap, g), e.line(v, c, v + i.connectorGap, c), e.line(v, g, v + i.connectorGap, g), e.line(v + i.connectorGap, _, y, _);
|
|
2269
|
-
let b =
|
|
2310
|
+
let b = bn(n, t + 1, u + 1);
|
|
2270
2311
|
if (t < r - 1 && b?.winningSide) {
|
|
2271
|
-
let t = b.
|
|
2312
|
+
let t = b.winnerDrawPosition, n = t === void 0 ? void 0 : l.get(t);
|
|
2272
2313
|
if (n) {
|
|
2273
|
-
|
|
2314
|
+
R(e, i.fontSize, F.BOLD);
|
|
2274
2315
|
let t = n.participantName;
|
|
2275
|
-
e.getTextWidth(t) > i.roundColumnWidth - 2 && (t =
|
|
2316
|
+
e.getTextWidth(t) > i.roundColumnWidth - 2 && (t = yn(t)), e.text(t, y + 1, _ - .5);
|
|
2276
2317
|
}
|
|
2277
2318
|
}
|
|
2278
|
-
b?.score && t < r - 1 && (
|
|
2319
|
+
b?.score && t < r - 1 && (R(e, i.scoreFontSize, F.NORMAL), e.setTextColor(60, 60, 160), e.text(q(b.score, a), y + 1, _ - .5 + i.scoreFontSize * .4), e.setTextColor(0));
|
|
2279
2320
|
}
|
|
2280
2321
|
}
|
|
2281
2322
|
}
|
|
2282
|
-
function
|
|
2323
|
+
function mn(e, t, n, r, i, a, o, s, c) {
|
|
2283
2324
|
let l = new Map(t.map((e) => [e.drawPosition, e])), u = t.length;
|
|
2284
2325
|
for (let t = 0; t < r; t++) {
|
|
2285
|
-
let c = u / 2 ** (t + 1), d = i.lineHeight * 2 ** t, f = (2 ** t - 1) * i.lineHeight / 2, p = 2 ** (t + 1) * i.lineHeight, m =
|
|
2326
|
+
let c = u / 2 ** (t + 1), d = i.lineHeight * 2 ** t, f = (2 ** t - 1) * i.lineHeight / 2, p = 2 ** (t + 1) * i.lineHeight, m = _n(t, i, o), h = t === 0 ? i.firstRoundWidth : i.roundColumnWidth;
|
|
2286
2327
|
for (let u = 0; u < c; u++) {
|
|
2287
2328
|
let c = s + f + u * p, g = c + d, _ = (c + g) / 2;
|
|
2288
2329
|
if (t === 0) {
|
|
2289
2330
|
let t = u * 2 + 1, n = u * 2 + 2;
|
|
2290
|
-
|
|
2331
|
+
vn(e, l.get(t), i, m, c, h, "rtl"), vn(e, l.get(n), i, m, g, h, "rtl");
|
|
2291
2332
|
} else e.setDrawColor(40), e.setLineWidth(.25), e.line(m, c, m + h, c), e.line(m, g, m + h, g);
|
|
2292
|
-
let v = m, y =
|
|
2333
|
+
let v = m, y = _n(t + 1, i, o);
|
|
2293
2334
|
e.setDrawColor(40), e.setLineWidth(.25), e.line(v - i.connectorGap, c, v - i.connectorGap, g), e.line(v, c, v - i.connectorGap, c), e.line(v, g, v - i.connectorGap, g), e.line(v - i.connectorGap, _, y + i.roundColumnWidth, _);
|
|
2294
|
-
let b =
|
|
2335
|
+
let b = bn(n, t + 1, u + 1);
|
|
2295
2336
|
if (t < r - 1 && b?.winningSide) {
|
|
2296
|
-
let t = b.
|
|
2337
|
+
let t = b.winnerDrawPosition, n = t === void 0 ? void 0 : l.get(t);
|
|
2297
2338
|
if (n) {
|
|
2298
|
-
|
|
2339
|
+
R(e, i.fontSize, F.BOLD);
|
|
2299
2340
|
let t = n.participantName;
|
|
2300
|
-
e.getTextWidth(t) > i.roundColumnWidth - 2 && (t =
|
|
2341
|
+
e.getTextWidth(t) > i.roundColumnWidth - 2 && (t = yn(t));
|
|
2301
2342
|
let r = y;
|
|
2302
2343
|
e.text(t, r + i.roundColumnWidth - 1, _ - .5, { align: "right" });
|
|
2303
2344
|
}
|
|
2304
2345
|
}
|
|
2305
2346
|
if (b?.score && t < r - 1) {
|
|
2306
2347
|
let t = y;
|
|
2307
|
-
|
|
2348
|
+
R(e, i.scoreFontSize, F.NORMAL), e.setTextColor(60, 60, 160), e.text(q(b.score, a), t + i.roundColumnWidth - 1, _ - .5 + i.scoreFontSize * .4, { align: "right" }), e.setTextColor(0);
|
|
2308
2349
|
}
|
|
2309
2350
|
}
|
|
2310
2351
|
}
|
|
2311
2352
|
}
|
|
2312
|
-
function
|
|
2313
|
-
|
|
2353
|
+
function hn(e, t, n, r, i, a, o, s, c) {
|
|
2354
|
+
R(e, r.fontSize <= I.TINY ? 5.5 : I.SMALL, F.BOLD), e.setTextColor(40);
|
|
2314
2355
|
for (let l = 0; l < t; l++) {
|
|
2315
|
-
let u = n - t + l + 1, d = K(u, n), f = c?.[u] || i.roundLabels[d] || d, p = l === 0 ? r.firstRoundWidth : r.roundColumnWidth, m =
|
|
2356
|
+
let u = n - t + l + 1, d = K(u, n), f = c?.[u] || i.roundLabels[d] || d, p = l === 0 ? r.firstRoundWidth : r.roundColumnWidth, m = gn(l, r, a);
|
|
2316
2357
|
e.text(f, m + p / 2, s, { align: "center" }), e.setDrawColor(160), e.setLineWidth(.15), e.line(m + 2, s + 1.5, m + p - 2, s + 1.5);
|
|
2317
|
-
let h =
|
|
2358
|
+
let h = _n(l, r, o);
|
|
2318
2359
|
e.text(f, h + p / 2, s, { align: "center" }), e.line(h + 2, s + 1.5, h + p - 2, s + 1.5);
|
|
2319
2360
|
}
|
|
2320
2361
|
e.setTextColor(0);
|
|
2321
2362
|
}
|
|
2322
|
-
function
|
|
2363
|
+
function gn(e, t, n) {
|
|
2323
2364
|
return e === 0 ? n : n + t.firstRoundWidth + t.connectorGap + (e - 1) * (t.roundColumnWidth + t.connectorGap);
|
|
2324
2365
|
}
|
|
2325
|
-
function
|
|
2366
|
+
function _n(e, t, n) {
|
|
2326
2367
|
return e === 0 ? n - t.firstRoundWidth : n - t.firstRoundWidth - t.connectorGap - (e - 1) * (t.roundColumnWidth + t.connectorGap) - t.roundColumnWidth;
|
|
2327
2368
|
}
|
|
2328
|
-
function
|
|
2369
|
+
function vn(e, t, n, r, i, a, o) {
|
|
2329
2370
|
if (e.setDrawColor(40), e.setLineWidth(.25), e.line(r, i, r + a, i), !t || t.isBye) {
|
|
2330
|
-
t?.isBye && (
|
|
2371
|
+
t?.isBye && (R(e, n.fontSize, F.ITALIC), e.setTextColor(150), o === "ltr" ? e.text("Bye", r + 1, i - .3) : e.text("Bye", r + a - 1, i - .3, { align: "right" }), e.setTextColor(0));
|
|
2331
2372
|
return;
|
|
2332
2373
|
}
|
|
2333
2374
|
let s = t.seedValue ? `[${t.seedValue}]` : "";
|
|
2334
|
-
|
|
2375
|
+
R(e, n.fontSize, F.NORMAL);
|
|
2335
2376
|
let c = t.participantName, l = s ? `${s} ${c}` : c;
|
|
2336
|
-
e.getTextWidth(l) > a - 2 && (c =
|
|
2377
|
+
e.getTextWidth(l) > a - 2 && (c = yn(t.participantName), l = s ? `${s} ${c}` : c), o === "ltr" ? e.text(l, r + 1, i - .3) : e.text(l, r + a - 1, i - .3, { align: "right" });
|
|
2337
2378
|
}
|
|
2338
|
-
function
|
|
2379
|
+
function yn(e) {
|
|
2339
2380
|
let t = e.match(/^([^,]+),\s*(.+)/);
|
|
2340
2381
|
if (t) return `${t[2][0]}. ${t[1]}`;
|
|
2341
2382
|
let n = e.match(/^(\S+)\s+(.+)/);
|
|
2342
2383
|
return n ? `${n[1][0]}. ${n[2]}` : e;
|
|
2343
2384
|
}
|
|
2344
|
-
function
|
|
2385
|
+
function bn(e, t, n) {
|
|
2345
2386
|
return e.find((e) => e.roundNumber === t && e.roundPosition === n);
|
|
2346
2387
|
}
|
|
2347
2388
|
//#endregion
|
|
2348
2389
|
//#region src/renderers/backdrawDraw.ts
|
|
2349
|
-
function
|
|
2350
|
-
let i = n.page.margins, a = r.contentY + 9, o = r.contentHeight - 9, s = r.contentWidth, c = t.mainDraw.matchUps, l = t.mainDraw.slots, u = t.consolation.matchUps, d = t.consolation.slots, f = new Map(l.map((e) => [e.drawPosition, e])), p = new Map(d.map((e) => [e.drawPosition, e])), m = c.filter((e) => e.roundNumber === 1).sort((e, t) => e.roundPosition - t.roundPosition), h = m.length, g = h * 2, _ = Math.max(...c.map((e) => e.roundNumber)), v = _ - 1, y = u.length > 0 ? Math.max(...u.map((e) => e.roundNumber)) : 0, b = 1.5, x = s - 28 - b * 4, S = v + 1,
|
|
2351
|
-
|
|
2352
|
-
let
|
|
2353
|
-
|
|
2390
|
+
function xn(e, t, n, r) {
|
|
2391
|
+
let i = n.page.margins, a = r.contentY + 9, o = r.contentHeight - 9, s = r.contentWidth, c = t.mainDraw.matchUps, l = t.mainDraw.slots, u = t.consolation.matchUps, d = t.consolation.slots, f = new Map(l.map((e) => [e.drawPosition, e])), p = new Map(d.map((e) => [e.drawPosition, e])), m = c.filter((e) => e.roundNumber === 1).sort((e, t) => e.roundPosition - t.roundPosition), h = m.length, g = h * 2, _ = Math.max(...c.map((e) => e.roundNumber)), v = _ - 1, y = u.length > 0 ? Math.max(...u.map((e) => e.roundNumber)) : 0, b = 1.5, x = s - 28 - b * 4, S = v + 1, ee = Math.max(y + 1, 1), te = x * (S / (S + ee)), C = x - te, w = i.left + C + b, T = S > 0 ? (te - b * S) / S : 0, E = w + 28 + b, D = ee > 0 ? (C - b * ee) / ee : 0, O = i.left + C, k = o / g, A = k < 3.5, j = I.SMALL;
|
|
2392
|
+
k < 2.5 ? j = 5 : A && (j = I.TINY);
|
|
2393
|
+
let ne = A ? 5 : I.TINY;
|
|
2394
|
+
An(e, _, y, t, n, w, 28, E, T, O, D, b, r.contentY + 2, j), Sn(e, m, h, f, w, 28, b, E, O, a, k, j, y), wn(e, c, f, _, h, E, T, b, a, k, j, ne, n, t.mainDraw.roundLabelMap), Tn(e, u, p, y, O, D, b, a, k, h, j, ne, n, t.consolation.roundLabelMap);
|
|
2354
2395
|
}
|
|
2355
|
-
function
|
|
2396
|
+
function Sn(e, t, n, r, i, a, o, s, c, l, u, d, f) {
|
|
2356
2397
|
for (let p = 0; p < n; p++) {
|
|
2357
2398
|
let n = t[p], m = l + p * u * 2, h = m + u, g = (m + h) / 2, _ = n.drawPositions[0], v = n.drawPositions[1], y = u * .9;
|
|
2358
2399
|
e.setDrawColor(40), e.setLineWidth(.3), e.rect(i, m, a, y), e.rect(i, h, a, y);
|
|
2359
2400
|
let b = _ ? r.get(_) : void 0, x = v ? r.get(v) : void 0;
|
|
2360
|
-
|
|
2401
|
+
R(e, d, F.NORMAL), _ && Cn(e, _, b, n.winningSide === 1, i, m, y, a, d), v && Cn(e, v, x, n.winningSide === 2, i, h, y, a, d), e.setDrawColor(40), e.setLineWidth(.25), e.line(i + a, m + y / 2, i + a + o, m + y / 2), e.line(i + a, h + y / 2, i + a + o, h + y / 2), e.line(i + a + o, m + y / 2, i + a + o, h + y / 2), e.line(i + a + o, g, s, g), f > 0 && (e.line(i, m + y / 2, i - o, m + y / 2), e.line(i, h + y / 2, i - o, h + y / 2), e.line(i - o, m + y / 2, i - o, h + y / 2), e.line(i - o, g, c, g));
|
|
2361
2402
|
}
|
|
2362
2403
|
}
|
|
2363
|
-
function
|
|
2364
|
-
if (e.setTextColor(120),
|
|
2365
|
-
let t =
|
|
2366
|
-
|
|
2404
|
+
function Cn(e, t, n, r, i, a, o, s, c) {
|
|
2405
|
+
if (e.setTextColor(120), R(e, c, F.NORMAL), e.text(`${t}`, i + 1, a + o / 2 + c * .12), e.setTextColor(0), n?.participantName) {
|
|
2406
|
+
let t = jn(n.participantName);
|
|
2407
|
+
R(e, c, r ? F.BOLD : F.NORMAL), e.text(t, i + 5, a + o / 2 + c * .12, { maxWidth: s - 6 });
|
|
2367
2408
|
}
|
|
2368
2409
|
}
|
|
2369
|
-
function
|
|
2410
|
+
function wn(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
2370
2411
|
for (let i = 0; i < r - 1; i++) {
|
|
2371
2412
|
let p = i + 2, m = t.filter((e) => e.roundNumber === p).sort((e, t) => e.roundPosition - t.roundPosition), h = l * 2 ** (i + 1), g = (2 ** (i + 1) - 1) * l / 2, _ = a + i * (o + s);
|
|
2372
2413
|
for (let t = 0; t < m.length; t++) {
|
|
2373
2414
|
let l = m[t], p = c + g + t * h * 2, v = p + h, y = (p + v) / 2;
|
|
2374
|
-
if (e.setDrawColor(40), e.setLineWidth(.25), e.line(_, p, _ + o, p), e.line(_, v, _ + o, v),
|
|
2415
|
+
if (e.setDrawColor(40), e.setLineWidth(.25), e.line(_, p, _ + o, p), e.line(_, v, _ + o, v), kn(e, l, n, _, p, v, o, u, f), i < r - 2) {
|
|
2375
2416
|
let t = _ + o;
|
|
2376
2417
|
e.line(t + s, p, t + s, v), e.line(t, p, t + s, p), e.line(t, v, t + s, v), e.line(t + s, y, _ + o + s + o + s > 0 ? a + (i + 1) * (o + s) : t + s + 5, y);
|
|
2377
2418
|
}
|
|
2378
|
-
l.score && (
|
|
2419
|
+
l.score && (R(e, d, F.NORMAL), e.setTextColor(60, 60, 160), e.text(q(l.score, f), _ + o - 1, y + d * .12, { align: "right" }), e.setTextColor(0));
|
|
2379
2420
|
}
|
|
2380
2421
|
}
|
|
2381
2422
|
let m = a + (r - 2) * (o + s) + o + s, h = c + (2 ** (r - 1) - 1) * l / 2 + l * 2 ** (r - 2);
|
|
2382
2423
|
e.setDrawColor(40), e.setLineWidth(.25), e.line(m, h, m + o, h);
|
|
2383
2424
|
let g = t.find((e) => e.roundNumber === r);
|
|
2384
2425
|
if (g?.winningSide) {
|
|
2385
|
-
let t = n.get(
|
|
2386
|
-
if (
|
|
2387
|
-
let { name:
|
|
2388
|
-
|
|
2426
|
+
let t = g.winnerDrawPosition, r = t === void 0 ? void 0 : n.get(t);
|
|
2427
|
+
if (r) {
|
|
2428
|
+
let { name: t } = At(r, f);
|
|
2429
|
+
R(e, u + 1, F.BOLD), e.text(t, m + 1, h - .5);
|
|
2389
2430
|
}
|
|
2390
2431
|
}
|
|
2391
2432
|
}
|
|
2392
|
-
function
|
|
2393
|
-
for (let l = 0; l < r; l++)
|
|
2394
|
-
|
|
2433
|
+
function Tn(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
2434
|
+
for (let l = 0; l < r; l++) En(e, t, n, l, r, i, a, o, s, c, u, d, f);
|
|
2435
|
+
On(e, t, n, r, i, a, o, s, c, u, f);
|
|
2395
2436
|
}
|
|
2396
|
-
function
|
|
2437
|
+
function En(e, t, n, r, i, a, o, s, c, l, u, d, f) {
|
|
2397
2438
|
let p = r + 1, m = t.filter((e) => e.roundNumber === p).sort((e, t) => e.roundPosition - t.roundPosition), h = l * 2 ** (r + 1), g = (2 ** (r + 1) - 1) * l / 2, _ = a - (r + 1) * (o + s);
|
|
2398
2439
|
for (let t = 0; t < m.length; t++) {
|
|
2399
2440
|
let l = m[t], p = c + g + t * h * 2, v = p + h, y = (p + v) / 2;
|
|
2400
|
-
if (e.setDrawColor(40), e.setLineWidth(.25), e.line(_, p, _ + o, p), e.line(_, v, _ + o, v),
|
|
2441
|
+
if (e.setDrawColor(40), e.setLineWidth(.25), e.line(_, p, _ + o, p), e.line(_, v, _ + o, v), Dn(e, l.drawPositions[0], n, u, _, o, p), Dn(e, l.drawPositions[1], n, u, _, o, v), r < i - 1) {
|
|
2401
2442
|
e.line(_ - s, p, _ - s, v), e.line(_, p, _ - s, p), e.line(_, v, _ - s, v);
|
|
2402
2443
|
let t = a - (r + 2) * (o + s);
|
|
2403
2444
|
e.line(_ - s, y, t + o, y);
|
|
2404
2445
|
}
|
|
2405
|
-
l.score && (
|
|
2446
|
+
l.score && (R(e, d, F.NORMAL), e.setTextColor(60, 60, 160), e.text(q(l.score, f), _ + 1, y + d * .12), e.setTextColor(0));
|
|
2406
2447
|
}
|
|
2407
2448
|
}
|
|
2408
|
-
function
|
|
2449
|
+
function Dn(e, t, n, r, i, a, o) {
|
|
2409
2450
|
if (!t) return;
|
|
2410
2451
|
let s = n.get(t);
|
|
2411
2452
|
if (!s?.participantName) return;
|
|
2412
|
-
|
|
2453
|
+
R(e, r, F.BOLD);
|
|
2413
2454
|
let c = s.participantName;
|
|
2414
|
-
e.getTextWidth(c) > a - 2 && (c =
|
|
2455
|
+
e.getTextWidth(c) > a - 2 && (c = jn(c)), e.text(c, i + a - 1, o - .3, { align: "right" });
|
|
2415
2456
|
}
|
|
2416
|
-
function
|
|
2457
|
+
function On(e, t, n, r, i, a, o, s, c, l, u) {
|
|
2417
2458
|
if (r <= 0) return;
|
|
2418
2459
|
let d = i - (r + 1) * (a + o), f = s + (2 ** r - 1) * c / 2 + c * 2 ** (r - 1);
|
|
2419
2460
|
e.setDrawColor(40), e.setLineWidth(.25), e.line(d, f, d + a, f);
|
|
2420
2461
|
let p = t.find((e) => e.roundNumber === r);
|
|
2421
2462
|
if (p?.winningSide) {
|
|
2422
|
-
let t = n.get(
|
|
2423
|
-
if (
|
|
2424
|
-
let { name:
|
|
2425
|
-
|
|
2463
|
+
let t = p.winnerDrawPosition, r = t === void 0 ? void 0 : n.get(t);
|
|
2464
|
+
if (r) {
|
|
2465
|
+
let { name: t } = At(r, u);
|
|
2466
|
+
R(e, l + 1, F.BOLD), e.text(t, d + a - 1, f - .5, { align: "right" });
|
|
2426
2467
|
}
|
|
2427
2468
|
}
|
|
2428
2469
|
}
|
|
2429
|
-
function
|
|
2470
|
+
function kn(e, t, n, r, i, a, o, s, c) {
|
|
2430
2471
|
if (t.drawPositions[0]) {
|
|
2431
2472
|
let a = n.get(t.drawPositions[0]);
|
|
2432
2473
|
if (a?.participantName) {
|
|
2433
|
-
|
|
2474
|
+
R(e, s, F.BOLD);
|
|
2434
2475
|
let t = a.participantName;
|
|
2435
|
-
e.getTextWidth(t) > o - 2 && (t =
|
|
2476
|
+
e.getTextWidth(t) > o - 2 && (t = jn(t)), e.text(t, r + 1, i - .3);
|
|
2436
2477
|
}
|
|
2437
2478
|
}
|
|
2438
2479
|
if (t.drawPositions[1]) {
|
|
2439
2480
|
let i = n.get(t.drawPositions[1]);
|
|
2440
2481
|
if (i?.participantName) {
|
|
2441
|
-
|
|
2482
|
+
R(e, s, F.BOLD);
|
|
2442
2483
|
let t = i.participantName;
|
|
2443
|
-
e.getTextWidth(t) > o - 2 && (t =
|
|
2484
|
+
e.getTextWidth(t) > o - 2 && (t = jn(t)), e.text(t, r + 1, a - .3);
|
|
2444
2485
|
}
|
|
2445
2486
|
}
|
|
2446
2487
|
}
|
|
2447
|
-
function
|
|
2448
|
-
|
|
2488
|
+
function An(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
2489
|
+
R(e, p <= I.TINY ? 5.5 : I.SMALL, F.BOLD), e.setTextColor(40);
|
|
2449
2490
|
let m = r.mainDraw.roundLabelMap?.[1] || "R1";
|
|
2450
2491
|
e.text(m, a + o / 2, f, { align: "center" });
|
|
2451
2492
|
for (let n = 0; n < t - 1; n++) {
|
|
@@ -2458,7 +2499,7 @@ function Dn(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
|
2458
2499
|
}
|
|
2459
2500
|
e.setTextColor(0);
|
|
2460
2501
|
}
|
|
2461
|
-
function
|
|
2502
|
+
function jn(e) {
|
|
2462
2503
|
let t = e.match(/^([^,]+),\s*(.+)/);
|
|
2463
2504
|
if (t) return `${t[2][0]}. ${t[1]}`;
|
|
2464
2505
|
let n = e.match(/^(\S+)\s+(.+)/);
|
|
@@ -2466,7 +2507,7 @@ function On(e) {
|
|
|
2466
2507
|
}
|
|
2467
2508
|
//#endregion
|
|
2468
2509
|
//#region src/renderers/compassDraw.ts
|
|
2469
|
-
var
|
|
2510
|
+
var Mn = [
|
|
2470
2511
|
"E",
|
|
2471
2512
|
"W",
|
|
2472
2513
|
"N",
|
|
@@ -2476,14 +2517,14 @@ var kn = [
|
|
|
2476
2517
|
"SE",
|
|
2477
2518
|
"SW"
|
|
2478
2519
|
];
|
|
2479
|
-
function
|
|
2480
|
-
let i = n.page.margins, a = [...t.structures].sort((e, t) =>
|
|
2520
|
+
function Nn(e, t, n, r) {
|
|
2521
|
+
let i = n.page.margins, a = [...t.structures].sort((e, t) => Mn.indexOf(e.abbreviation) - Mn.indexOf(t.abbreviation)), o = r.contentY + 3;
|
|
2481
2522
|
for (let s of a) {
|
|
2482
2523
|
if (s.drawSize === 0) continue;
|
|
2483
|
-
let a =
|
|
2524
|
+
let a = Pn(s, r);
|
|
2484
2525
|
o + a > r.contentY + r.contentHeight && (e.addPage(), o = r.contentY);
|
|
2485
2526
|
let c = s.abbreviation === "E";
|
|
2486
|
-
|
|
2527
|
+
R(e, c ? I.HEADING : I.BODY, F.BOLD), c || e.setTextColor(30, 60, 120);
|
|
2487
2528
|
let l = c ? `Main Draw (${s.name})` : `${s.name} Draw`;
|
|
2488
2529
|
e.text(l, i.left, o), c || e.setTextColor(0), o += c ? 5 : 4;
|
|
2489
2530
|
let u = {
|
|
@@ -2491,14 +2532,14 @@ function An(e, t, n, r) {
|
|
|
2491
2532
|
contentY: o,
|
|
2492
2533
|
contentHeight: a - 6
|
|
2493
2534
|
};
|
|
2494
|
-
J(e,
|
|
2535
|
+
J(e, Fn(s, t.drawName), n, u), o += a + 3;
|
|
2495
2536
|
}
|
|
2496
2537
|
}
|
|
2497
|
-
function
|
|
2538
|
+
function Pn(e, t) {
|
|
2498
2539
|
let n = t.contentHeight * .7, r = Math.max(5, Math.min(8, n / e.drawSize));
|
|
2499
2540
|
return e.drawSize * r + 10;
|
|
2500
2541
|
}
|
|
2501
|
-
function
|
|
2542
|
+
function Fn(e, t) {
|
|
2502
2543
|
return {
|
|
2503
2544
|
drawName: `${t} - ${e.name}`,
|
|
2504
2545
|
drawSize: e.drawSize,
|
|
@@ -2511,7 +2552,7 @@ function Mn(e, t) {
|
|
|
2511
2552
|
}
|
|
2512
2553
|
//#endregion
|
|
2513
2554
|
//#region src/renderers/consolationDraw.ts
|
|
2514
|
-
function
|
|
2555
|
+
function In(e) {
|
|
2515
2556
|
let { drawDefinition: t, participants: n = [] } = e;
|
|
2516
2557
|
if (!t?.structures) return [];
|
|
2517
2558
|
let r = /* @__PURE__ */ new Map();
|
|
@@ -2520,8 +2561,8 @@ function Nn(e) {
|
|
|
2520
2561
|
let t = e.participantId ? r.get(e.participantId) : void 0, n = i.find((t) => t.participantId === e.participantId);
|
|
2521
2562
|
return {
|
|
2522
2563
|
drawPosition: e.drawPosition,
|
|
2523
|
-
participantName: t ?
|
|
2524
|
-
nationality: t ?
|
|
2564
|
+
participantName: t ? H(t) : "",
|
|
2565
|
+
nationality: t ? U(t) : "",
|
|
2525
2566
|
seedValue: n?.seedValue,
|
|
2526
2567
|
isBye: e.bye === !0
|
|
2527
2568
|
};
|
|
@@ -2529,6 +2570,7 @@ function Nn(e) {
|
|
|
2529
2570
|
roundNumber: e.roundNumber,
|
|
2530
2571
|
roundPosition: e.roundPosition,
|
|
2531
2572
|
drawPositions: e.drawPositions || [],
|
|
2573
|
+
winnerDrawPosition: fe(e),
|
|
2532
2574
|
score: e.score?.scoreStringSide1 || "",
|
|
2533
2575
|
winningSide: e.winningSide,
|
|
2534
2576
|
matchUpStatus: e.matchUpStatus
|
|
@@ -2551,8 +2593,8 @@ function Nn(e) {
|
|
|
2551
2593
|
let t = r.get(e.participantId);
|
|
2552
2594
|
return {
|
|
2553
2595
|
seedValue: e.seedValue,
|
|
2554
|
-
participantName: t ?
|
|
2555
|
-
nationality: t ?
|
|
2596
|
+
participantName: t ? H(t) : "",
|
|
2597
|
+
nationality: t ? U(t) : ""
|
|
2556
2598
|
};
|
|
2557
2599
|
}),
|
|
2558
2600
|
roundLabelMap: p
|
|
@@ -2560,7 +2602,7 @@ function Nn(e) {
|
|
|
2560
2602
|
};
|
|
2561
2603
|
});
|
|
2562
2604
|
}
|
|
2563
|
-
function
|
|
2605
|
+
function Ln(e, t, n, r) {
|
|
2564
2606
|
let i = n.page.margins, a = r.contentY, o = {
|
|
2565
2607
|
MAIN: 0,
|
|
2566
2608
|
CONSOLATION: 1,
|
|
@@ -2568,7 +2610,7 @@ function Pn(e, t, n, r) {
|
|
|
2568
2610
|
}, s = [...t].filter((e) => e.drawData.drawSize > 0).sort((e, t) => (o[e.stage] ?? 9) - (o[t.stage] ?? 9));
|
|
2569
2611
|
for (let t of s) {
|
|
2570
2612
|
let o = t.stage === "MAIN", s = t.drawData.drawSize * 3.5 + 8;
|
|
2571
|
-
a + s > r.contentY + r.contentHeight && a > r.contentY + 10 && (e.addPage(), a = r.contentY), a += 3,
|
|
2613
|
+
a + s > r.contentY + r.contentHeight && a > r.contentY + 10 && (e.addPage(), a = r.contentY), a += 3, R(e, o ? I.HEADING : I.BODY, F.BOLD), o || e.setTextColor(120, 40, 40), e.text(t.name, i.left, a), o || e.setTextColor(0), a += o ? 4 : 3;
|
|
2572
2614
|
let c = {
|
|
2573
2615
|
...r,
|
|
2574
2616
|
contentY: a,
|
|
@@ -2579,14 +2621,14 @@ function Pn(e, t, n, r) {
|
|
|
2579
2621
|
}
|
|
2580
2622
|
//#endregion
|
|
2581
2623
|
//#region src/renderers/doubleEliminationDraw.ts
|
|
2582
|
-
function
|
|
2583
|
-
let i = n.page.margins, a = r.contentHeight, o = a * .44, s = a * .44, c = r.contentWidth - 30 - 8, l =
|
|
2584
|
-
|
|
2624
|
+
function Rn(e, t, n, r) {
|
|
2625
|
+
let i = n.page.margins, a = r.contentHeight, o = a * .44, s = a * .44, c = r.contentWidth - 30 - 8, l = zn(t.winnersBracket), u = r.contentY + 3;
|
|
2626
|
+
R(e, I.BODY, F.BOLD), e.setTextColor(30, 80, 30), e.text("Winner's Bracket", i.left, u), e.setTextColor(0), u += 3, J(e, l, n, {
|
|
2585
2627
|
...r,
|
|
2586
2628
|
contentY: u,
|
|
2587
2629
|
contentHeight: o - 6,
|
|
2588
2630
|
contentWidth: c
|
|
2589
|
-
}), u = r.contentY + o + 6,
|
|
2631
|
+
}), u = r.contentY + o + 6, R(e, I.BODY, F.BOLD), e.setTextColor(140, 40, 40), e.text("Loser's Bracket (Backdraw)", i.left, u), e.setTextColor(0), u += 3;
|
|
2590
2632
|
let d = {
|
|
2591
2633
|
...r,
|
|
2592
2634
|
contentY: u,
|
|
@@ -2595,26 +2637,26 @@ function Fn(e, t, n, r) {
|
|
|
2595
2637
|
};
|
|
2596
2638
|
J(e, t.losersBracket, n, d);
|
|
2597
2639
|
let f = i.left + c + 8, p = r.contentY + a / 2;
|
|
2598
|
-
if (
|
|
2640
|
+
if (R(e, I.SMALL, F.BOLD), e.text("Decider", f + 14, p - 14 - 4, { align: "center" }), e.setDrawColor(60), e.setLineWidth(.5), e.rect(f, p - 14 - 1, 28, 14), e.setLineWidth(.2), e.line(f, p - 7 - 1, f + 28, p - 7 - 1), t.deciderMatch?.matchUps?.length) {
|
|
2599
2641
|
let n = t.deciderMatch.matchUps[0], r = new Map(t.deciderMatch.slots.map((e) => [e.drawPosition, e]));
|
|
2600
2642
|
if (n.drawPositions[0]) {
|
|
2601
2643
|
let t = r.get(n.drawPositions[0]);
|
|
2602
2644
|
if (t?.participantName) {
|
|
2603
2645
|
let r = n.winningSide === 1;
|
|
2604
|
-
|
|
2646
|
+
R(e, I.TINY, r ? F.BOLD : F.NORMAL), e.text(t.participantName, f + 1, p - 7 - 3, { maxWidth: 26 });
|
|
2605
2647
|
}
|
|
2606
2648
|
}
|
|
2607
2649
|
if (n.drawPositions[1]) {
|
|
2608
2650
|
let t = r.get(n.drawPositions[1]);
|
|
2609
2651
|
if (t?.participantName) {
|
|
2610
2652
|
let r = n.winningSide === 2;
|
|
2611
|
-
|
|
2653
|
+
R(e, I.TINY, r ? F.BOLD : F.NORMAL), e.text(t.participantName, f + 1, p - 3, { maxWidth: 26 });
|
|
2612
2654
|
}
|
|
2613
2655
|
}
|
|
2614
|
-
n.score && (
|
|
2656
|
+
n.score && (R(e, I.TINY, F.NORMAL), e.setTextColor(60, 60, 160), e.text(n.score, f + 28 - 1, p - 14 + 2, { align: "right" }), e.setTextColor(0));
|
|
2615
2657
|
}
|
|
2616
2658
|
}
|
|
2617
|
-
function
|
|
2659
|
+
function zn(e) {
|
|
2618
2660
|
let t = { ...e.roundLabelMap || {} };
|
|
2619
2661
|
for (let e of Object.keys(t)) t[Number(e)] === "F-Q" && (t[Number(e)] = "SF");
|
|
2620
2662
|
return {
|
|
@@ -2624,12 +2666,12 @@ function In(e) {
|
|
|
2624
2666
|
}
|
|
2625
2667
|
//#endregion
|
|
2626
2668
|
//#region src/renderers/luckyDraw.ts
|
|
2627
|
-
var
|
|
2628
|
-
function
|
|
2669
|
+
var Bn = 1, Vn = 16, Hn = 1;
|
|
2670
|
+
function Un(e, t, n, r) {
|
|
2629
2671
|
let i = n.page.margins, a = /* @__PURE__ */ new Map();
|
|
2630
2672
|
for (let e of t.matchUps) a.has(e.roundNumber) || a.set(e.roundNumber, []), a.get(e.roundNumber).push(e);
|
|
2631
|
-
let o = new Map(t.slots.map((e) => [e.drawPosition, e])), s = [...a.keys()].sort((e, t) => e - t), c = s.length, l = r.contentY + 7, u = r.contentHeight - 7, d = Math.min(55, (r.contentWidth - (c - 1) * 6) / c), f = a.get(s[0])?.length || 1, p = Math.min(
|
|
2632
|
-
|
|
2673
|
+
let o = new Map(t.slots.map((e) => [e.drawPosition, e])), s = [...a.keys()].sort((e, t) => e - t), c = s.length, l = r.contentY + 7, u = r.contentHeight - 7, d = Math.min(55, (r.contentWidth - (c - 1) * 6) / c), f = a.get(s[0])?.length || 1, p = Math.min(Vn, (u - (f + 1) * Hn) / f);
|
|
2674
|
+
R(e, I.SMALL, F.BOLD), e.setTextColor(30, 60, 120);
|
|
2633
2675
|
for (let a = 0; a < c; a++) {
|
|
2634
2676
|
let o = s[a], c = n.roundLabels[K(o, t.totalRounds)] || K(o, t.totalRounds), l = i.left + a * (d + 6);
|
|
2635
2677
|
e.text(c, l + d / 2, r.contentY + 3, { align: "center" });
|
|
@@ -2639,38 +2681,38 @@ function Bn(e, t, n, r) {
|
|
|
2639
2681
|
let r = s[t], c = a.get(r) || [], f = c.length, m = i.left + t * (d + 6), h = f * p, g = f > 1 ? (u - h) / (f + 1) : (u - p) / 2;
|
|
2640
2682
|
for (let t = 0; t < f; t++) {
|
|
2641
2683
|
let r = l + g + t * (p + g);
|
|
2642
|
-
|
|
2684
|
+
Wn(e, c[t], o, n, m, r, d, p);
|
|
2643
2685
|
}
|
|
2644
2686
|
}
|
|
2645
2687
|
}
|
|
2646
|
-
function
|
|
2647
|
-
let c = s < 10 ? 5 :
|
|
2688
|
+
function Wn(e, t, n, r, i, a, o, s) {
|
|
2689
|
+
let c = s < 10 ? 5 : I.TINY;
|
|
2648
2690
|
e.setDrawColor(100), e.setLineWidth(.3), e.rect(i, a, o, s);
|
|
2649
2691
|
let l = a + s / 2;
|
|
2650
2692
|
e.setLineWidth(.15), e.line(i, l, i + o, l);
|
|
2651
2693
|
let u = t.drawPositions[0] ? n.get(t.drawPositions[0]) : void 0;
|
|
2652
2694
|
if (u) {
|
|
2653
|
-
let n =
|
|
2654
|
-
|
|
2695
|
+
let n = kt(u, r);
|
|
2696
|
+
R(e, c, t.winningSide === 1 ? F.BOLD : F.NORMAL), e.text(n, i + Bn, l - c * .15, { maxWidth: o - 2 });
|
|
2655
2697
|
}
|
|
2656
2698
|
let d = t.drawPositions[1] ? n.get(t.drawPositions[1]) : void 0;
|
|
2657
2699
|
if (d) {
|
|
2658
|
-
let n =
|
|
2659
|
-
|
|
2700
|
+
let n = kt(d, r);
|
|
2701
|
+
R(e, c, t.winningSide === 2 ? F.BOLD : F.NORMAL), e.text(n, i + Bn, l + c * .55, { maxWidth: o - 2 });
|
|
2660
2702
|
}
|
|
2661
2703
|
if (t.score) {
|
|
2662
2704
|
let n = q(t.score, r);
|
|
2663
|
-
|
|
2705
|
+
R(e, c, F.NORMAL), e.setTextColor(60, 60, 160), e.text(n, i + o - Bn, a + c * .5, { align: "right" }), e.setTextColor(0);
|
|
2664
2706
|
}
|
|
2665
2707
|
}
|
|
2666
2708
|
//#endregion
|
|
2667
2709
|
//#region src/renderers/drawSplitter.ts
|
|
2668
|
-
var
|
|
2710
|
+
var Gn = {
|
|
2669
2711
|
maxPositionsPerPage: 64,
|
|
2670
2712
|
includeOverlapRounds: !0,
|
|
2671
2713
|
summaryPage: !0
|
|
2672
2714
|
};
|
|
2673
|
-
function
|
|
2715
|
+
function Kn(e, t = Gn) {
|
|
2674
2716
|
let { drawSize: n, slots: r, matchUps: i, totalRounds: a } = e;
|
|
2675
2717
|
if (n <= t.maxPositionsPerPage) return [{
|
|
2676
2718
|
label: "Full Draw",
|
|
@@ -2681,13 +2723,19 @@ function Un(e, t = Hn) {
|
|
|
2681
2723
|
segmentRounds: a
|
|
2682
2724
|
}];
|
|
2683
2725
|
let o = t.maxPositionsPerPage, s = Math.ceil(n / o), c = Math.log2(o), l = [];
|
|
2684
|
-
for (let e = 0; e < s; e++) l.push(
|
|
2685
|
-
return t.summaryPage && s > 1 && l.push(
|
|
2726
|
+
for (let e = 0; e < s; e++) l.push(qn(e, o, s, c, n, r, i));
|
|
2727
|
+
return t.summaryPage && s > 1 && l.push(Jn(e)), l;
|
|
2686
2728
|
}
|
|
2687
|
-
function
|
|
2729
|
+
function qn(e, t, n, r, i, a, o) {
|
|
2688
2730
|
let s = e * t + 1, c = Math.min((e + 1) * t, i), l = `Section ${e + 1}`;
|
|
2689
2731
|
n === 2 && (l = e === 0 ? "Top Half" : "Bottom Half");
|
|
2690
|
-
let u = a.filter((e) => e.drawPosition >= s && e.drawPosition <= c), d =
|
|
2732
|
+
let u = a.filter((e) => e.drawPosition >= s && e.drawPosition <= c), d = Yn(o.filter((t) => t.roundNumber > r ? !1 : dn({
|
|
2733
|
+
positionPredicate: (e) => e >= s && e <= c,
|
|
2734
|
+
partitionCount: n,
|
|
2735
|
+
partitionIndex: e,
|
|
2736
|
+
matchUp: t,
|
|
2737
|
+
matchUps: o
|
|
2738
|
+
})));
|
|
2691
2739
|
return {
|
|
2692
2740
|
label: l,
|
|
2693
2741
|
startPosition: s,
|
|
@@ -2698,12 +2746,13 @@ function Wn(e, t, n, r, i, a, o) {
|
|
|
2698
2746
|
noWinnerColumn: !0
|
|
2699
2747
|
};
|
|
2700
2748
|
}
|
|
2701
|
-
function
|
|
2702
|
-
let { slots: t, matchUps: n, totalRounds: r, roundLabelMap: i } = e, a = Math.max(1, r - 5 + 1), o = r - a + 1, s = a - 1, c = n.filter((e) => e.roundNumber === a).sort((e, t) => e.roundPosition - t.roundPosition), l = c.length * 2, u =
|
|
2749
|
+
function Jn(e) {
|
|
2750
|
+
let { slots: t, matchUps: n, totalRounds: r, roundLabelMap: i } = e, a = Math.max(1, r - 5 + 1), o = r - a + 1, s = a - 1, c = n.filter((e) => e.roundNumber === a).sort((e, t) => e.roundPosition - t.roundPosition), l = c.length * 2, u = Xn(c), d = Yn(n.filter((e) => e.roundNumber >= a).map((e) => ({
|
|
2703
2751
|
...e,
|
|
2704
2752
|
roundNumber: e.roundNumber - s,
|
|
2705
2753
|
roundPosition: e.roundNumber === a ? c.findIndex((t) => t.roundPosition === e.roundPosition) + 1 : e.roundPosition,
|
|
2706
|
-
drawPositions: e.drawPositions.map((e) => u.get(e) || e)
|
|
2754
|
+
drawPositions: e.drawPositions.map((e) => u.get(e) || e),
|
|
2755
|
+
winnerDrawPosition: e.winnerDrawPosition === void 0 ? void 0 : u.get(e.winnerDrawPosition) || e.winnerDrawPosition
|
|
2707
2756
|
}))), f = [];
|
|
2708
2757
|
for (let [e, n] of u) {
|
|
2709
2758
|
let r = t.find((t) => t.drawPosition === e);
|
|
@@ -2722,7 +2771,7 @@ function Gn(e) {
|
|
|
2722
2771
|
roundLabelMap: i ? Object.fromEntries(Object.entries(i).filter(([e]) => Number(e) >= a).map(([e, t]) => [Number(e) - s, t])) : void 0
|
|
2723
2772
|
};
|
|
2724
2773
|
}
|
|
2725
|
-
function
|
|
2774
|
+
function Yn(e) {
|
|
2726
2775
|
let t = /* @__PURE__ */ new Map();
|
|
2727
2776
|
for (let n of e) t.has(n.roundNumber) || t.set(n.roundNumber, []), t.get(n.roundNumber).push(n);
|
|
2728
2777
|
let n = [];
|
|
@@ -2734,17 +2783,17 @@ function Kn(e) {
|
|
|
2734
2783
|
});
|
|
2735
2784
|
return n;
|
|
2736
2785
|
}
|
|
2737
|
-
function
|
|
2786
|
+
function Xn(e) {
|
|
2738
2787
|
let t = /* @__PURE__ */ new Map(), n = 1;
|
|
2739
2788
|
for (let r of e) for (let e of r.drawPositions) e && !t.has(e) && t.set(e, n++);
|
|
2740
2789
|
return t;
|
|
2741
2790
|
}
|
|
2742
2791
|
//#endregion
|
|
2743
2792
|
//#region src/generators/drawPDF.ts
|
|
2744
|
-
function
|
|
2745
|
-
return
|
|
2793
|
+
function Zn(e, t = {}) {
|
|
2794
|
+
return Qn(e.matchUps) ? tr(e, t) : $n(e, t);
|
|
2746
2795
|
}
|
|
2747
|
-
function
|
|
2796
|
+
function Qn(e) {
|
|
2748
2797
|
let t = /* @__PURE__ */ new Map();
|
|
2749
2798
|
for (let n of e) t.set(n.roundNumber, (t.get(n.roundNumber) || 0) + 1);
|
|
2750
2799
|
let n = [...t.keys()].sort((e, t) => e - t);
|
|
@@ -2754,26 +2803,26 @@ function Yn(e) {
|
|
|
2754
2803
|
}
|
|
2755
2804
|
return !1;
|
|
2756
2805
|
}
|
|
2757
|
-
function
|
|
2758
|
-
if (e.drawSize >= 256) return
|
|
2806
|
+
function $n(e, t = {}) {
|
|
2807
|
+
if (e.drawSize >= 256) return er(e, {
|
|
2759
2808
|
...t,
|
|
2760
2809
|
maxPositionsPerPage: 64
|
|
2761
2810
|
});
|
|
2762
|
-
let n = Y(e.drawSize, t), r =
|
|
2811
|
+
let n = Y(e.drawSize, t), r = z(n.doc, n.pageConfig, n.headerH, n.footerH);
|
|
2763
2812
|
return J(n.doc, e, n.format, r), X(n), n.doc;
|
|
2764
2813
|
}
|
|
2765
|
-
function
|
|
2766
|
-
let n = Y(e.drawSize, t), r =
|
|
2814
|
+
function er(e, t = {}) {
|
|
2815
|
+
let n = Y(e.drawSize, t), r = Kn(e, {
|
|
2767
2816
|
maxPositionsPerPage: t.maxPositionsPerPage || 32,
|
|
2768
2817
|
includeOverlapRounds: !0,
|
|
2769
2818
|
summaryPage: !0
|
|
2770
2819
|
});
|
|
2771
2820
|
for (let t = 0; t < r.length; t++) {
|
|
2772
2821
|
t > 0 && n.doc.addPage();
|
|
2773
|
-
let i =
|
|
2822
|
+
let i = B(n.doc, {
|
|
2774
2823
|
...n.headerConfig,
|
|
2775
2824
|
subtitle: r[t].label
|
|
2776
|
-
}, n.pageConfig), a =
|
|
2825
|
+
}, n.pageConfig), a = z(n.doc, n.pageConfig, i, n.footerH);
|
|
2777
2826
|
if (r[t].slots.length > 0 || r[t].matchUps.length > 0) {
|
|
2778
2827
|
let i = r[t], o = i.endPosition - i.startPosition + 1, s = {
|
|
2779
2828
|
...e,
|
|
@@ -2789,33 +2838,33 @@ function Zn(e, t = {}) {
|
|
|
2789
2838
|
}
|
|
2790
2839
|
return X(n), n.doc;
|
|
2791
2840
|
}
|
|
2792
|
-
function Qn(e, t = {}) {
|
|
2793
|
-
let n = e.totalRounds >= 5 || e.slots.length >= 12, r = Y(e.drawSize, t, n), i = B(r.doc, r.pageConfig, r.headerH, r.footerH);
|
|
2794
|
-
return J(r.doc, e, r.format, i), X(r), r.doc;
|
|
2795
|
-
}
|
|
2796
|
-
function $n(e, t = {}) {
|
|
2797
|
-
let n = Y(Math.max(...e.map((e) => e.drawData.drawSize), 8), t), r = B(n.doc, n.pageConfig, n.headerH, n.footerH);
|
|
2798
|
-
return Pn(n.doc, e, n.format, r), ar(n, 1), X(n), n.doc;
|
|
2799
|
-
}
|
|
2800
|
-
function er(e, t = {}) {
|
|
2801
|
-
let n = Y(e.mainStructure?.drawSize || 8, t), r = B(n.doc, n.pageConfig, n.headerH, n.footerH);
|
|
2802
|
-
return An(n.doc, e, n.format, r), ar(n, 1), X(n), n.doc;
|
|
2803
|
-
}
|
|
2804
2841
|
function tr(e, t = {}) {
|
|
2805
|
-
let n = Y(e.drawSize, t,
|
|
2806
|
-
return
|
|
2842
|
+
let n = e.totalRounds >= 5 || e.slots.length >= 12, r = Y(e.drawSize, t, n), i = z(r.doc, r.pageConfig, r.headerH, r.footerH);
|
|
2843
|
+
return J(r.doc, e, r.format, i), X(r), r.doc;
|
|
2807
2844
|
}
|
|
2808
2845
|
function nr(e, t = {}) {
|
|
2809
|
-
let n = Y(e.
|
|
2810
|
-
return
|
|
2846
|
+
let n = Y(Math.max(...e.map((e) => e.drawData.drawSize), 8), t), r = z(n.doc, n.pageConfig, n.headerH, n.footerH);
|
|
2847
|
+
return Ln(n.doc, e, n.format, r), cr(n, 1), X(n), n.doc;
|
|
2811
2848
|
}
|
|
2812
2849
|
function rr(e, t = {}) {
|
|
2813
|
-
let n = Y(
|
|
2814
|
-
return
|
|
2850
|
+
let n = Y(e.mainStructure?.drawSize || 8, t), r = z(n.doc, n.pageConfig, n.headerH, n.footerH);
|
|
2851
|
+
return Nn(n.doc, e, n.format, r), cr(n, 1), X(n), n.doc;
|
|
2815
2852
|
}
|
|
2816
2853
|
function ir(e, t = {}) {
|
|
2817
|
-
let n = Y(e.drawSize, t), r =
|
|
2818
|
-
return
|
|
2854
|
+
let n = Y(e.drawSize, t, !0), r = z(n.doc, n.pageConfig, n.headerH, n.footerH);
|
|
2855
|
+
return fn(n.doc, e, n.format, r), X(n), n.doc;
|
|
2856
|
+
}
|
|
2857
|
+
function ar(e, t = {}) {
|
|
2858
|
+
let n = Y(e.mainDraw.drawSize, t, !0), r = z(n.doc, n.pageConfig, n.headerH, n.footerH);
|
|
2859
|
+
return xn(n.doc, e, n.format, r), X(n), n.doc;
|
|
2860
|
+
}
|
|
2861
|
+
function or(e, t = {}) {
|
|
2862
|
+
let n = Y(Math.max(e.winnersBracket.drawSize, e.losersBracket.drawSize, 8), t, !0), r = z(n.doc, n.pageConfig, n.headerH, n.footerH);
|
|
2863
|
+
return Rn(n.doc, e, n.format, r), X(n), n.doc;
|
|
2864
|
+
}
|
|
2865
|
+
function sr(e, t = {}) {
|
|
2866
|
+
let n = Y(e.drawSize, t), r = z(n.doc, n.pageConfig, n.headerH, n.footerH);
|
|
2867
|
+
return Un(n.doc, e, n.format, r), X(n), n.doc;
|
|
2819
2868
|
}
|
|
2820
2869
|
function Y(e, t, n) {
|
|
2821
2870
|
let r = t.format || h(t.preset || "itfJunior"), i = {
|
|
@@ -2829,29 +2878,29 @@ function Y(e, t, n) {
|
|
|
2829
2878
|
layout: "standard",
|
|
2830
2879
|
showPageNumbers: !0,
|
|
2831
2880
|
showTimestamp: !0
|
|
2832
|
-
}, s =
|
|
2881
|
+
}, s = xe(i, e), c = V(o);
|
|
2833
2882
|
return {
|
|
2834
2883
|
doc: s,
|
|
2835
2884
|
pageConfig: i,
|
|
2836
2885
|
headerConfig: a,
|
|
2837
2886
|
footerConfig: o,
|
|
2838
2887
|
format: r,
|
|
2839
|
-
headerH:
|
|
2888
|
+
headerH: B(s, a, i),
|
|
2840
2889
|
footerH: c
|
|
2841
2890
|
};
|
|
2842
2891
|
}
|
|
2843
|
-
function
|
|
2892
|
+
function cr(e, t) {
|
|
2844
2893
|
let n = e.doc.getNumberOfPages();
|
|
2845
|
-
for (let r = t + 1; r <= n; r++) e.doc.setPage(r),
|
|
2894
|
+
for (let r = t + 1; r <= n; r++) e.doc.setPage(r), B(e.doc, e.headerConfig, e.pageConfig);
|
|
2846
2895
|
}
|
|
2847
2896
|
function X(e) {
|
|
2848
2897
|
let t = e.doc.getNumberOfPages();
|
|
2849
|
-
for (let n = 1; n <= t; n++) e.doc.setPage(n),
|
|
2898
|
+
for (let n = 1; n <= t; n++) e.doc.setPage(n), ze(e.doc, e.footerConfig, e.pageConfig, n);
|
|
2850
2899
|
e.doc.setPage(t);
|
|
2851
2900
|
}
|
|
2852
2901
|
//#endregion
|
|
2853
2902
|
//#region src/composition/composeOrderOfPlayOptions.ts
|
|
2854
|
-
function
|
|
2903
|
+
function lr(e) {
|
|
2855
2904
|
let t = e.header ? {
|
|
2856
2905
|
...e.header,
|
|
2857
2906
|
layout: e.header.layout ?? "itf",
|
|
@@ -2871,7 +2920,15 @@ function or(e) {
|
|
|
2871
2920
|
}
|
|
2872
2921
|
//#endregion
|
|
2873
2922
|
//#region src/composition/printDispatcher.ts
|
|
2874
|
-
function
|
|
2923
|
+
function ur(e, t) {
|
|
2924
|
+
let n = e?.sides?.find((e) => e?.sideNumber === t);
|
|
2925
|
+
return {
|
|
2926
|
+
name: n?.participant?.participantName ?? "TBD",
|
|
2927
|
+
nationality: n?.participant?.nationalityCode ?? "",
|
|
2928
|
+
seedValue: n?.seedValue
|
|
2929
|
+
};
|
|
2930
|
+
}
|
|
2931
|
+
function dr(e, t) {
|
|
2875
2932
|
if (!e?.type) return {
|
|
2876
2933
|
success: !1,
|
|
2877
2934
|
error: "Missing request type"
|
|
@@ -2885,15 +2942,15 @@ function sr(e, t) {
|
|
|
2885
2942
|
error: "Missing tournamentEngine in context"
|
|
2886
2943
|
};
|
|
2887
2944
|
switch (e.type) {
|
|
2888
|
-
case "schedule": return
|
|
2889
|
-
case "playerList": return
|
|
2890
|
-
case "signInSheet": return
|
|
2891
|
-
case "courtCards": return
|
|
2892
|
-
case "matchCard": return
|
|
2893
|
-
case "draw": return
|
|
2945
|
+
case "schedule": return Dr(e, t);
|
|
2946
|
+
case "playerList": return Sr(e, t);
|
|
2947
|
+
case "signInSheet": return Cr(e, t);
|
|
2948
|
+
case "courtCards": return wr(e, t);
|
|
2949
|
+
case "matchCard": return Er(e, t);
|
|
2950
|
+
case "draw": return fr(e, t);
|
|
2894
2951
|
}
|
|
2895
2952
|
}
|
|
2896
|
-
function
|
|
2953
|
+
function fr(e, t) {
|
|
2897
2954
|
if (!e.drawId) return {
|
|
2898
2955
|
success: !1,
|
|
2899
2956
|
error: "PrintDrawRequest requires drawId"
|
|
@@ -2908,26 +2965,26 @@ function cr(e, t) {
|
|
|
2908
2965
|
success: !1,
|
|
2909
2966
|
error: `No draw data found for drawId "${e.drawId}"`
|
|
2910
2967
|
};
|
|
2911
|
-
let i = r.tournamentInfo ?? {}, a = r.eventInfo ?? {}, o = r.drawsData[0].structures ?? [], s = o.find((e) => e.stage === "MAIN"), c = o.some((e) => e.stage === "CONSOLATION"), l = o.some((e) => e.stage === "PLAY_OFF"), u =
|
|
2912
|
-
header:
|
|
2913
|
-
footer:
|
|
2968
|
+
let i = r.tournamentInfo ?? {}, a = r.eventInfo ?? {}, o = r.drawsData[0].structures ?? [], s = o.find((e) => e.stage === "MAIN"), c = o.some((e) => e.stage === "CONSOLATION"), l = o.some((e) => e.stage === "PLAY_OFF"), u = yr(e.composition, "draw")?.splitStrategy ?? "single-page", d = {
|
|
2969
|
+
header: gr(e.composition, i, a),
|
|
2970
|
+
footer: _r(e.composition),
|
|
2914
2971
|
page: e.composition.page,
|
|
2915
2972
|
preset: void 0
|
|
2916
2973
|
}, f;
|
|
2917
2974
|
try {
|
|
2918
|
-
if (c && l) f =
|
|
2919
|
-
winnersBracket: s ?
|
|
2920
|
-
losersBracket:
|
|
2921
|
-
deciderMatch:
|
|
2975
|
+
if (c && l) f = or({
|
|
2976
|
+
winnersBracket: s ? N(s) : pr(),
|
|
2977
|
+
losersBracket: mr(r),
|
|
2978
|
+
deciderMatch: hr(r)
|
|
2922
2979
|
}, d);
|
|
2923
|
-
else if (c) f =
|
|
2980
|
+
else if (c) f = nr(o.map((e) => ({
|
|
2924
2981
|
name: e.structureName,
|
|
2925
2982
|
stage: e.stage,
|
|
2926
|
-
drawData:
|
|
2983
|
+
drawData: N(e)
|
|
2927
2984
|
})), d);
|
|
2928
2985
|
else if (s) {
|
|
2929
|
-
let e =
|
|
2930
|
-
f = u === "single-page" ?
|
|
2986
|
+
let e = N(s);
|
|
2987
|
+
f = u === "single-page" ? $n(e, d) : er(e, d);
|
|
2931
2988
|
}
|
|
2932
2989
|
} catch (e) {
|
|
2933
2990
|
return {
|
|
@@ -2947,7 +3004,7 @@ function cr(e, t) {
|
|
|
2947
3004
|
filename: `draw-${p}.pdf`
|
|
2948
3005
|
};
|
|
2949
3006
|
}
|
|
2950
|
-
function
|
|
3007
|
+
function pr() {
|
|
2951
3008
|
return {
|
|
2952
3009
|
drawName: "",
|
|
2953
3010
|
drawSize: 0,
|
|
@@ -2958,15 +3015,15 @@ function lr() {
|
|
|
2958
3015
|
seedAssignments: []
|
|
2959
3016
|
};
|
|
2960
3017
|
}
|
|
2961
|
-
function
|
|
2962
|
-
let t =
|
|
2963
|
-
return t ?
|
|
3018
|
+
function mr(e) {
|
|
3019
|
+
let t = P(e.drawsData, "CONSOLATION");
|
|
3020
|
+
return t ? N(t) : pr();
|
|
2964
3021
|
}
|
|
2965
|
-
function
|
|
2966
|
-
let t =
|
|
2967
|
-
return t ?
|
|
3022
|
+
function hr(e) {
|
|
3023
|
+
let t = P(e.drawsData, "PLAY_OFF");
|
|
3024
|
+
return t ? N(t) : void 0;
|
|
2968
3025
|
}
|
|
2969
|
-
function
|
|
3026
|
+
function gr(e, t, n) {
|
|
2970
3027
|
if (e.header?.layout === "none") return;
|
|
2971
3028
|
let r = e.header ?? {};
|
|
2972
3029
|
return {
|
|
@@ -2991,7 +3048,7 @@ function fr(e, t, n) {
|
|
|
2991
3048
|
chiefUmpire: r.chiefUmpire
|
|
2992
3049
|
};
|
|
2993
3050
|
}
|
|
2994
|
-
function
|
|
3051
|
+
function _r(e) {
|
|
2995
3052
|
if (e.footer?.layout === "none") return;
|
|
2996
3053
|
let t = e.footer ?? {};
|
|
2997
3054
|
return {
|
|
@@ -3009,9 +3066,9 @@ function pr(e) {
|
|
|
3009
3066
|
luckyLosers: t.luckyLosers
|
|
3010
3067
|
};
|
|
3011
3068
|
}
|
|
3012
|
-
function
|
|
3069
|
+
function vr(e) {
|
|
3013
3070
|
let t = e.header;
|
|
3014
|
-
if (
|
|
3071
|
+
if (t && t.layout !== "none") return {
|
|
3015
3072
|
tournamentName: t.tournamentName ?? "",
|
|
3016
3073
|
subtitle: t.subtitle,
|
|
3017
3074
|
startDate: t.startDate,
|
|
@@ -3020,10 +3077,10 @@ function mr(e) {
|
|
|
3020
3077
|
organizer: t.organizer
|
|
3021
3078
|
};
|
|
3022
3079
|
}
|
|
3023
|
-
function
|
|
3080
|
+
function yr(e, t) {
|
|
3024
3081
|
return e.content?.[t];
|
|
3025
3082
|
}
|
|
3026
|
-
function
|
|
3083
|
+
function br(e, t) {
|
|
3027
3084
|
if (typeof e.getParticipants != "function") return {
|
|
3028
3085
|
success: !1,
|
|
3029
3086
|
error: "engine.getParticipants is not a function"
|
|
@@ -3049,7 +3106,7 @@ function gr(e, t) {
|
|
|
3049
3106
|
participants: n.filter((e) => i.has(e.participantId)),
|
|
3050
3107
|
eventEntries: [{
|
|
3051
3108
|
eventName: r.eventName ?? "",
|
|
3052
|
-
entries:
|
|
3109
|
+
entries: xr(r)
|
|
3053
3110
|
}],
|
|
3054
3111
|
eventName: r.eventName ?? ""
|
|
3055
3112
|
};
|
|
@@ -3059,12 +3116,12 @@ function gr(e, t) {
|
|
|
3059
3116
|
participants: n,
|
|
3060
3117
|
eventEntries: (e.getEvents?.()?.events ?? []).map((e) => ({
|
|
3061
3118
|
eventName: e.eventName ?? "",
|
|
3062
|
-
entries:
|
|
3119
|
+
entries: xr(e)
|
|
3063
3120
|
})),
|
|
3064
3121
|
eventName: ""
|
|
3065
3122
|
};
|
|
3066
3123
|
}
|
|
3067
|
-
function
|
|
3124
|
+
function xr(e) {
|
|
3068
3125
|
let t = e.entries ?? [], n = /* @__PURE__ */ new Map();
|
|
3069
3126
|
for (let t of e.drawDefinitions ?? []) for (let e of t.structures ?? []) if (!(e.stage && e.stage !== "MAIN")) for (let t of e.seedAssignments ?? []) {
|
|
3070
3127
|
if (!t?.participantId || t.seedValue === void 0) continue;
|
|
@@ -3076,16 +3133,16 @@ function _r(e) {
|
|
|
3076
3133
|
seedValue: n.get(e.participantId)
|
|
3077
3134
|
} : e);
|
|
3078
3135
|
}
|
|
3079
|
-
function
|
|
3080
|
-
let n =
|
|
3136
|
+
function Sr(e, t) {
|
|
3137
|
+
let n = br(t.tournamentEngine, e.eventId);
|
|
3081
3138
|
if (!n.success) return n;
|
|
3082
|
-
let r =
|
|
3139
|
+
let r = ot({
|
|
3083
3140
|
participants: n.participants,
|
|
3084
3141
|
eventEntries: n.eventEntries
|
|
3085
|
-
}), i =
|
|
3142
|
+
}), i = yr(e.composition, "playerList"), a;
|
|
3086
3143
|
try {
|
|
3087
|
-
a =
|
|
3088
|
-
header:
|
|
3144
|
+
a = yt(r, {
|
|
3145
|
+
header: vr(e.composition),
|
|
3089
3146
|
includeRanking: i?.includeRanking,
|
|
3090
3147
|
includeEvents: i?.includeEvents,
|
|
3091
3148
|
groupByEvent: i?.groupByEvent
|
|
@@ -3104,20 +3161,20 @@ function vr(e, t) {
|
|
|
3104
3161
|
filename: `player-list-${o}.pdf`
|
|
3105
3162
|
};
|
|
3106
3163
|
}
|
|
3107
|
-
function
|
|
3164
|
+
function Cr(e, t) {
|
|
3108
3165
|
if (!e.eventId) return {
|
|
3109
3166
|
success: !1,
|
|
3110
3167
|
error: "PrintSignInSheetRequest requires eventId"
|
|
3111
3168
|
};
|
|
3112
|
-
let n =
|
|
3169
|
+
let n = br(t.tournamentEngine, e.eventId);
|
|
3113
3170
|
if (!n.success) return n;
|
|
3114
|
-
let r =
|
|
3171
|
+
let r = ot({
|
|
3115
3172
|
participants: n.participants,
|
|
3116
3173
|
eventEntries: n.eventEntries
|
|
3117
3174
|
}), i;
|
|
3118
3175
|
try {
|
|
3119
|
-
i =
|
|
3120
|
-
header:
|
|
3176
|
+
i = bt(r, {
|
|
3177
|
+
header: vr(e.composition),
|
|
3121
3178
|
eventName: n.eventName
|
|
3122
3179
|
});
|
|
3123
3180
|
} catch (e) {
|
|
@@ -3134,16 +3191,16 @@ function yr(e, t) {
|
|
|
3134
3191
|
filename: `sign-in-sheet-${a}.pdf`
|
|
3135
3192
|
};
|
|
3136
3193
|
}
|
|
3137
|
-
function
|
|
3138
|
-
let n = t.tournamentEngine, r =
|
|
3194
|
+
function wr(e, t) {
|
|
3195
|
+
let n = t.tournamentEngine, r = Or(n, e.venueId);
|
|
3139
3196
|
if (!r.success) return r;
|
|
3140
|
-
let i =
|
|
3197
|
+
let i = ct({
|
|
3141
3198
|
matchUps: r.matchUps,
|
|
3142
3199
|
venues: r.venues,
|
|
3143
3200
|
scheduledDate: e.scheduledDate
|
|
3144
|
-
}), a =
|
|
3201
|
+
}), a = Tr(e.composition, n), o = yr(e.composition, "courtCard"), s;
|
|
3145
3202
|
try {
|
|
3146
|
-
s =
|
|
3203
|
+
s = xt(i, {
|
|
3147
3204
|
tournamentName: a,
|
|
3148
3205
|
cardsPerPage: o?.cardsPerPage
|
|
3149
3206
|
});
|
|
@@ -3161,10 +3218,10 @@ function br(e, t) {
|
|
|
3161
3218
|
filename: `court-cards${c}.pdf`
|
|
3162
3219
|
};
|
|
3163
3220
|
}
|
|
3164
|
-
function
|
|
3221
|
+
function Tr(e, t) {
|
|
3165
3222
|
return e.header?.tournamentName || (typeof t.getTournamentInfo == "function" ? t.getTournamentInfo()?.tournamentInfo?.tournamentName ?? "" : "");
|
|
3166
3223
|
}
|
|
3167
|
-
function
|
|
3224
|
+
function Er(e, t) {
|
|
3168
3225
|
if (!Array.isArray(e.matchUpIds) || e.matchUpIds.length === 0) return {
|
|
3169
3226
|
success: !1,
|
|
3170
3227
|
error: "PrintMatchCardRequest requires non-empty matchUpIds"
|
|
@@ -3179,26 +3236,18 @@ function Sr(e, t) {
|
|
|
3179
3236
|
success: !1,
|
|
3180
3237
|
error: "No matchUps match the requested matchUpIds"
|
|
3181
3238
|
};
|
|
3182
|
-
let o =
|
|
3239
|
+
let o = Tr(e.composition, n), s = a.map((e) => ({
|
|
3183
3240
|
tournamentName: o,
|
|
3184
3241
|
eventName: e.eventName ?? "",
|
|
3185
3242
|
roundName: e.roundName ?? e.abbreviatedRoundName ?? "",
|
|
3186
3243
|
matchUpId: e.matchUpId,
|
|
3187
3244
|
courtName: e.schedule?.courtName,
|
|
3188
3245
|
scheduledTime: e.schedule?.scheduledTime,
|
|
3189
|
-
side1:
|
|
3190
|
-
|
|
3191
|
-
nationality: e.sides?.[0]?.participant?.nationalityCode ?? "",
|
|
3192
|
-
seedValue: e.sides?.[0]?.seedValue
|
|
3193
|
-
},
|
|
3194
|
-
side2: {
|
|
3195
|
-
name: e.sides?.[1]?.participant?.participantName ?? "TBD",
|
|
3196
|
-
nationality: e.sides?.[1]?.participant?.nationalityCode ?? "",
|
|
3197
|
-
seedValue: e.sides?.[1]?.seedValue
|
|
3198
|
-
}
|
|
3246
|
+
side1: ur(e, 1),
|
|
3247
|
+
side2: ur(e, 2)
|
|
3199
3248
|
})), c;
|
|
3200
3249
|
try {
|
|
3201
|
-
c =
|
|
3250
|
+
c = Ct(s, {
|
|
3202
3251
|
cardsPerPage: 2,
|
|
3203
3252
|
includeScoreBoxes: !0
|
|
3204
3253
|
});
|
|
@@ -3215,20 +3264,20 @@ function Sr(e, t) {
|
|
|
3215
3264
|
filename: `match-cards-${s.length}.pdf`
|
|
3216
3265
|
};
|
|
3217
3266
|
}
|
|
3218
|
-
function
|
|
3267
|
+
function Dr(e, t) {
|
|
3219
3268
|
if (!e.scheduledDate) return {
|
|
3220
3269
|
success: !1,
|
|
3221
3270
|
error: "PrintScheduleRequest requires scheduledDate"
|
|
3222
3271
|
};
|
|
3223
|
-
let n = t.tournamentEngine, r =
|
|
3272
|
+
let n = t.tournamentEngine, r = Or(n, e.venueId);
|
|
3224
3273
|
if (!r.success) return r;
|
|
3225
|
-
let i =
|
|
3274
|
+
let i = it({
|
|
3226
3275
|
matchUps: r.matchUps,
|
|
3227
3276
|
venues: r.venues,
|
|
3228
3277
|
scheduledDate: e.scheduledDate
|
|
3229
|
-
}), a =
|
|
3278
|
+
}), a = lr(e.composition), o;
|
|
3230
3279
|
try {
|
|
3231
|
-
o =
|
|
3280
|
+
o = dt(i, a);
|
|
3232
3281
|
} catch (e) {
|
|
3233
3282
|
return {
|
|
3234
3283
|
success: !1,
|
|
@@ -3242,7 +3291,7 @@ function Cr(e, t) {
|
|
|
3242
3291
|
filename: `order-of-play-${e.scheduledDate}.pdf`
|
|
3243
3292
|
};
|
|
3244
3293
|
}
|
|
3245
|
-
function
|
|
3294
|
+
function Or(e, t) {
|
|
3246
3295
|
if (typeof e.competitionScheduleMatchUps != "function") return {
|
|
3247
3296
|
success: !1,
|
|
3248
3297
|
error: "engine.competitionScheduleMatchUps is not a function"
|
|
@@ -3260,7 +3309,7 @@ function wr(e, t) {
|
|
|
3260
3309
|
}
|
|
3261
3310
|
//#endregion
|
|
3262
3311
|
//#region src/composition/editorTypes.ts
|
|
3263
|
-
var
|
|
3312
|
+
var kr = [
|
|
3264
3313
|
{
|
|
3265
3314
|
value: "grand-slam",
|
|
3266
3315
|
label: "Grand Slam",
|
|
@@ -3281,7 +3330,7 @@ var Tr = [
|
|
|
3281
3330
|
label: "No Header",
|
|
3282
3331
|
description: "Skip header entirely"
|
|
3283
3332
|
}
|
|
3284
|
-
],
|
|
3333
|
+
], Ar = [
|
|
3285
3334
|
{
|
|
3286
3335
|
value: "standard",
|
|
3287
3336
|
label: "Standard",
|
|
@@ -3302,13 +3351,13 @@ var Tr = [
|
|
|
3302
3351
|
label: "No Footer",
|
|
3303
3352
|
description: "Skip footer entirely"
|
|
3304
3353
|
}
|
|
3305
|
-
],
|
|
3354
|
+
], jr = [{
|
|
3306
3355
|
value: "a4",
|
|
3307
3356
|
label: "A4 (210 × 297mm)"
|
|
3308
3357
|
}, {
|
|
3309
3358
|
value: "letter",
|
|
3310
3359
|
label: "US Letter (216 × 279mm)"
|
|
3311
|
-
}],
|
|
3360
|
+
}], Mr = [
|
|
3312
3361
|
{
|
|
3313
3362
|
value: "auto",
|
|
3314
3363
|
label: "Auto (landscape for large draws)"
|
|
@@ -3321,7 +3370,7 @@ var Tr = [
|
|
|
3321
3370
|
value: "portrait",
|
|
3322
3371
|
label: "Portrait"
|
|
3323
3372
|
}
|
|
3324
|
-
],
|
|
3373
|
+
], Nr = [
|
|
3325
3374
|
{
|
|
3326
3375
|
value: "single-page",
|
|
3327
3376
|
label: "Single Page (dense)"
|
|
@@ -3334,7 +3383,7 @@ var Tr = [
|
|
|
3334
3383
|
value: "quarters",
|
|
3335
3384
|
label: "Four Quarters (32×4)"
|
|
3336
3385
|
}
|
|
3337
|
-
],
|
|
3386
|
+
], Pr = [{
|
|
3338
3387
|
id: "content",
|
|
3339
3388
|
label: "Content",
|
|
3340
3389
|
fields: [
|
|
@@ -3425,7 +3474,7 @@ var Tr = [
|
|
|
3425
3474
|
defaultValue: "landscape",
|
|
3426
3475
|
configPath: "page.orientation"
|
|
3427
3476
|
}]
|
|
3428
|
-
}],
|
|
3477
|
+
}], Fr = [{
|
|
3429
3478
|
id: "content",
|
|
3430
3479
|
label: "Content",
|
|
3431
3480
|
fields: [
|
|
@@ -3484,7 +3533,7 @@ var Tr = [
|
|
|
3484
3533
|
}];
|
|
3485
3534
|
//#endregion
|
|
3486
3535
|
//#region src/core/extractRoundRobinData.ts
|
|
3487
|
-
function
|
|
3536
|
+
function Ir(e) {
|
|
3488
3537
|
let { structure: t, participants: n = [] } = e;
|
|
3489
3538
|
if (!t) return [];
|
|
3490
3539
|
let r = /* @__PURE__ */ new Map();
|
|
@@ -3494,15 +3543,15 @@ function Mr(e) {
|
|
|
3494
3543
|
let n = e.positionAssignments || [], i = e.seedAssignments || [], a = n.filter((e) => e.participantId).map((e) => {
|
|
3495
3544
|
let t = r.get(e.participantId), n = i.find((t) => t.participantId === e.participantId);
|
|
3496
3545
|
return {
|
|
3497
|
-
participantName: t ?
|
|
3498
|
-
nationality: t ?
|
|
3546
|
+
participantName: t ? H(t) : "",
|
|
3547
|
+
nationality: t ? U(t) : "",
|
|
3499
3548
|
seedValue: n?.seedValue,
|
|
3500
3549
|
groupPosition: e.drawPosition
|
|
3501
3550
|
};
|
|
3502
3551
|
}).sort((e, t) => e.groupPosition - t.groupPosition), o = [];
|
|
3503
3552
|
for (let t of e.matchUps || []) {
|
|
3504
3553
|
if (!t.drawPositions || t.drawPositions.length < 2) continue;
|
|
3505
|
-
let [e, n] = t.drawPositions, r =
|
|
3554
|
+
let [e, n] = t.drawPositions, r = $e(t.score);
|
|
3506
3555
|
r && o.push({
|
|
3507
3556
|
rowPosition: e,
|
|
3508
3557
|
colPosition: n,
|
|
@@ -3519,26 +3568,26 @@ function Mr(e) {
|
|
|
3519
3568
|
}
|
|
3520
3569
|
//#endregion
|
|
3521
3570
|
//#region src/renderers/roundRobinDraw.ts
|
|
3522
|
-
var
|
|
3571
|
+
var Lr = [
|
|
3523
3572
|
200,
|
|
3524
3573
|
200,
|
|
3525
3574
|
200
|
|
3526
|
-
],
|
|
3575
|
+
], Rr = [
|
|
3527
3576
|
20,
|
|
3528
3577
|
80,
|
|
3529
3578
|
20
|
|
3530
|
-
],
|
|
3579
|
+
], zr = [
|
|
3531
3580
|
160,
|
|
3532
3581
|
40,
|
|
3533
3582
|
40
|
|
3534
|
-
],
|
|
3583
|
+
], Br = [
|
|
3535
3584
|
50,
|
|
3536
3585
|
50,
|
|
3537
3586
|
50
|
|
3538
3587
|
];
|
|
3539
|
-
function
|
|
3588
|
+
function Vr(e, n, r, i, a) {
|
|
3540
3589
|
let o = r.page.margins, s = n.participants.length;
|
|
3541
|
-
|
|
3590
|
+
R(e, I.HEADING, F.BOLD), e.text(n.groupName, o.left, a), a += 5;
|
|
3542
3591
|
let c = [
|
|
3543
3592
|
"#",
|
|
3544
3593
|
"Player",
|
|
@@ -3546,7 +3595,7 @@ function Lr(e, n, r, i, a) {
|
|
|
3546
3595
|
];
|
|
3547
3596
|
for (let e = 0; e < s; e++) c.push(`${e + 1}`);
|
|
3548
3597
|
c.push("W", "L");
|
|
3549
|
-
let l =
|
|
3598
|
+
let l = Hr(n, r), u = n.participants.map((e, t) => {
|
|
3550
3599
|
let n = [
|
|
3551
3600
|
{
|
|
3552
3601
|
content: `${t + 1}`,
|
|
@@ -3566,12 +3615,12 @@ function Lr(e, n, r, i, a) {
|
|
|
3566
3615
|
];
|
|
3567
3616
|
for (let e = 0; e < s; e++) if (t === e) n.push({
|
|
3568
3617
|
content: "",
|
|
3569
|
-
styles: { fillColor:
|
|
3618
|
+
styles: { fillColor: Lr }
|
|
3570
3619
|
});
|
|
3571
3620
|
else {
|
|
3572
3621
|
let r = l[t]?.[e];
|
|
3573
3622
|
if (r) {
|
|
3574
|
-
let e = r.isWin ?
|
|
3623
|
+
let e = r.isWin ? Rr : zr;
|
|
3575
3624
|
n.push({
|
|
3576
3625
|
content: r.score,
|
|
3577
3626
|
styles: {
|
|
@@ -3611,7 +3660,7 @@ function Lr(e, n, r, i, a) {
|
|
|
3611
3660
|
]
|
|
3612
3661
|
},
|
|
3613
3662
|
headStyles: {
|
|
3614
|
-
fillColor:
|
|
3663
|
+
fillColor: Br,
|
|
3615
3664
|
textColor: [
|
|
3616
3665
|
255,
|
|
3617
3666
|
255,
|
|
@@ -3632,7 +3681,7 @@ function Lr(e, n, r, i, a) {
|
|
|
3632
3681
|
}
|
|
3633
3682
|
}), e.lastAutoTable?.finalY || a + 40;
|
|
3634
3683
|
}
|
|
3635
|
-
function
|
|
3684
|
+
function Hr(e, t) {
|
|
3636
3685
|
let n = e.participants.length, r = Array.from({ length: n }, () => Array(n).fill(null)), i = /* @__PURE__ */ new Map();
|
|
3637
3686
|
e.participants.forEach((e, t) => i.set(e.groupPosition, t));
|
|
3638
3687
|
for (let n of e.results) {
|
|
@@ -3643,13 +3692,13 @@ function Rr(e, t) {
|
|
|
3643
3692
|
score: o,
|
|
3644
3693
|
isWin: s
|
|
3645
3694
|
}, r[a][e] = {
|
|
3646
|
-
score:
|
|
3695
|
+
score: Ur(o),
|
|
3647
3696
|
isWin: !s
|
|
3648
3697
|
};
|
|
3649
3698
|
}
|
|
3650
3699
|
return r;
|
|
3651
3700
|
}
|
|
3652
|
-
function
|
|
3701
|
+
function Ur(e) {
|
|
3653
3702
|
return e.split(/\s+/).map((e) => {
|
|
3654
3703
|
let t = e.match(/^(\d+)([/-])(\d+)(\(\d+\))?$/);
|
|
3655
3704
|
return t ? `${t[3]}${t[2]}${t[1]}${t[4] || ""}` : e;
|
|
@@ -3657,7 +3706,7 @@ function zr(e) {
|
|
|
3657
3706
|
}
|
|
3658
3707
|
//#endregion
|
|
3659
3708
|
//#region src/core/extractCompassData.ts
|
|
3660
|
-
var
|
|
3709
|
+
var Wr = {
|
|
3661
3710
|
East: {
|
|
3662
3711
|
name: "East",
|
|
3663
3712
|
abbreviation: "E"
|
|
@@ -3691,7 +3740,7 @@ var Br = {
|
|
|
3691
3740
|
abbreviation: "SW"
|
|
3692
3741
|
}
|
|
3693
3742
|
};
|
|
3694
|
-
function
|
|
3743
|
+
function Gr(e) {
|
|
3695
3744
|
let { drawDefinition: t, participants: n = [] } = e;
|
|
3696
3745
|
if (!t) return {
|
|
3697
3746
|
drawName: "",
|
|
@@ -3701,15 +3750,15 @@ function Vr(e) {
|
|
|
3701
3750
|
n.forEach((e) => r.set(e.participantId, e));
|
|
3702
3751
|
let i = [];
|
|
3703
3752
|
for (let e of t.structures || []) {
|
|
3704
|
-
let t = e.structureName || "", n =
|
|
3753
|
+
let t = e.structureName || "", n = Wr[t] || {
|
|
3705
3754
|
name: t,
|
|
3706
3755
|
abbreviation: t
|
|
3707
3756
|
}, a = e.positionAssignments || [], o = e.seedAssignments || [], s = a.length || 0, c = a.map((e) => {
|
|
3708
3757
|
let t = e.participantId ? r.get(e.participantId) : void 0, n = o.find((t) => t.participantId === e.participantId);
|
|
3709
3758
|
return {
|
|
3710
3759
|
drawPosition: e.drawPosition,
|
|
3711
|
-
participantName: t ?
|
|
3712
|
-
nationality: t ?
|
|
3760
|
+
participantName: t ? H(t) : "",
|
|
3761
|
+
nationality: t ? U(t) : "",
|
|
3713
3762
|
seedValue: n?.seedValue,
|
|
3714
3763
|
isBye: e.bye === !0
|
|
3715
3764
|
};
|
|
@@ -3717,6 +3766,7 @@ function Vr(e) {
|
|
|
3717
3766
|
roundNumber: e.roundNumber,
|
|
3718
3767
|
roundPosition: e.roundPosition,
|
|
3719
3768
|
drawPositions: e.drawPositions || [],
|
|
3769
|
+
winnerDrawPosition: fe(e),
|
|
3720
3770
|
score: e.score?.scoreStringSide1 || "",
|
|
3721
3771
|
winningSide: e.winningSide,
|
|
3722
3772
|
matchUpStatus: e.matchUpStatus
|
|
@@ -3739,7 +3789,7 @@ function Vr(e) {
|
|
|
3739
3789
|
}
|
|
3740
3790
|
//#endregion
|
|
3741
3791
|
//#region src/layout/brackets.ts
|
|
3742
|
-
var
|
|
3792
|
+
var Kr = {
|
|
3743
3793
|
slotWidth: 90,
|
|
3744
3794
|
slotHeight: 14,
|
|
3745
3795
|
roundGap: 20,
|
|
@@ -3747,7 +3797,7 @@ var Hr = {
|
|
|
3747
3797
|
startX: 15,
|
|
3748
3798
|
startY: 10
|
|
3749
3799
|
};
|
|
3750
|
-
function
|
|
3800
|
+
function qr(e, t = Kr, n) {
|
|
3751
3801
|
let r = Math.log2(e), i = [], a = e, o = t.slotHeight + t.verticalGap;
|
|
3752
3802
|
n && a * o > n && (o = n / a);
|
|
3753
3803
|
let s = Math.max(o * .7, 5);
|
|
@@ -3771,14 +3821,14 @@ function Ur(e, t = Hr, n) {
|
|
|
3771
3821
|
}
|
|
3772
3822
|
return i;
|
|
3773
3823
|
}
|
|
3774
|
-
function
|
|
3824
|
+
function Jr(e, t) {
|
|
3775
3825
|
if (e.setDrawColor(150), e.setLineWidth(.3), e.rect(t.x, t.y, t.width, t.height), t.isBye) {
|
|
3776
|
-
|
|
3826
|
+
R(e, I.SMALL, F.ITALIC), e.setTextColor(150), e.text("Bye", t.x + 2, t.y + t.height / 2 + 1.5), e.setTextColor(0);
|
|
3777
3827
|
return;
|
|
3778
3828
|
}
|
|
3779
|
-
t.participantName && (t.seed ? (
|
|
3829
|
+
t.participantName && (t.seed ? (R(e, I.TINY, F.BOLD), e.text(`[${t.seed}]`, t.x + 1, t.y + t.height / 2 + 1), R(e, I.SMALL, F.NORMAL), e.text(t.participantName, t.x + 9, t.y + t.height / 2 + 1)) : (R(e, I.SMALL, F.NORMAL), e.text(t.participantName, t.x + 2, t.y + t.height / 2 + 1)), t.nationality && (R(e, I.TINY, F.NORMAL), e.setTextColor(100), e.text(t.nationality, t.x + t.width - 2, t.y + t.height / 2 + 1, { align: "right" }), e.setTextColor(0)));
|
|
3780
3830
|
}
|
|
3781
|
-
function
|
|
3831
|
+
function Yr(e, t, n) {
|
|
3782
3832
|
e.setDrawColor(100), e.setLineWidth(.3);
|
|
3783
3833
|
for (let r = 0; r < t.length - 1; r++) {
|
|
3784
3834
|
let i = t[r], a = t[r + 1];
|
|
@@ -3790,37 +3840,37 @@ function Gr(e, t, n) {
|
|
|
3790
3840
|
}
|
|
3791
3841
|
}
|
|
3792
3842
|
}
|
|
3793
|
-
function
|
|
3794
|
-
|
|
3843
|
+
function Xr(e, t, n, r) {
|
|
3844
|
+
R(e, I.TINY, F.NORMAL), e.setTextColor(60, 60, 180), e.text(t, n, r), e.setTextColor(0);
|
|
3795
3845
|
}
|
|
3796
3846
|
//#endregion
|
|
3797
3847
|
//#region src/generators/drawSheet.ts
|
|
3798
|
-
function
|
|
3848
|
+
function Zr(t, n = {}) {
|
|
3799
3849
|
let { header: r, includeSeedings: i = !0, includeScores: a = !0 } = n, o = t.drawSize >= 32, s = new e({
|
|
3800
3850
|
orientation: o ? "landscape" : "portrait",
|
|
3801
3851
|
format: "a4"
|
|
3802
3852
|
});
|
|
3803
|
-
|
|
3853
|
+
L(s);
|
|
3804
3854
|
let c = 15;
|
|
3805
3855
|
if (r) {
|
|
3806
3856
|
let e = `${t.drawName} - ${t.drawType.replace(/_/g, " ")} (${t.drawSize})`;
|
|
3807
|
-
c =
|
|
3857
|
+
c = vt(s, {
|
|
3808
3858
|
...r,
|
|
3809
3859
|
subtitle: e
|
|
3810
3860
|
});
|
|
3811
3861
|
}
|
|
3812
|
-
return c = t.drawSize <= 64 && t.drawSize > 0 ?
|
|
3862
|
+
return c = t.drawSize <= 64 && t.drawSize > 0 ? Qr(s, t, c, a) : $r(s, t, c), i && t.seedAssignments.length > 0 && ei(s, t, c + 8), W(s, `Generated ${(/* @__PURE__ */ new Date()).toLocaleDateString()}`), s;
|
|
3813
3863
|
}
|
|
3814
|
-
function
|
|
3864
|
+
function Qr(e, t, n, r) {
|
|
3815
3865
|
let i = e.internal.pageSize.getWidth(), a = e.internal.pageSize.getHeight(), o = i - 30, s = a - n - 30, c = t.totalRounds, l = Math.min(90, (o - c * 10) / c), u = Math.min(14, s / t.drawSize), d = {
|
|
3816
|
-
...
|
|
3866
|
+
...Kr,
|
|
3817
3867
|
slotWidth: l,
|
|
3818
3868
|
slotHeight: u,
|
|
3819
3869
|
verticalGap: Math.max(1, u * .3),
|
|
3820
3870
|
startX: 15,
|
|
3821
3871
|
startY: n
|
|
3822
|
-
}, f =
|
|
3823
|
-
|
|
3872
|
+
}, f = qr(t.drawSize, d, s), p = new Map(t.slots.map((e) => [e.drawPosition, e]));
|
|
3873
|
+
R(e, I.SMALL, F.BOLD);
|
|
3824
3874
|
for (let t = 0; t < c; t++) {
|
|
3825
3875
|
let r = d.startX + t * (d.slotWidth + d.roundGap), i = K(t + 1, c);
|
|
3826
3876
|
e.text(i, r + d.slotWidth / 2, n - 2, { align: "center" });
|
|
@@ -3831,13 +3881,13 @@ function Jr(e, t, n, r) {
|
|
|
3831
3881
|
let t = e + 1, r = p.get(t);
|
|
3832
3882
|
r && (n[e].participantName = r.participantName, n[e].nationality = r.nationality, n[e].seed = r.seedValue, n[e].isBye = r.isBye);
|
|
3833
3883
|
}
|
|
3834
|
-
for (let t of f) for (let n of t)
|
|
3835
|
-
if (
|
|
3884
|
+
for (let t of f) for (let n of t) Jr(e, n);
|
|
3885
|
+
if (Yr(e, f, d), r) for (let n of t.matchUps) {
|
|
3836
3886
|
if (!n.score) continue;
|
|
3837
3887
|
let t = n.roundNumber - 1;
|
|
3838
3888
|
if (t < f.length) {
|
|
3839
3889
|
let r = (n.roundPosition - 1) * 2, i = f[t]?.[r];
|
|
3840
|
-
i &&
|
|
3890
|
+
i && Xr(e, n.score, i.x + i.width + 2, i.y + i.height + 3);
|
|
3841
3891
|
}
|
|
3842
3892
|
}
|
|
3843
3893
|
let i = f[0][f[0].length - 1];
|
|
@@ -3845,7 +3895,7 @@ function Jr(e, t, n, r) {
|
|
|
3845
3895
|
}
|
|
3846
3896
|
return n;
|
|
3847
3897
|
}
|
|
3848
|
-
function
|
|
3898
|
+
function $r(e, n, r) {
|
|
3849
3899
|
let i = [
|
|
3850
3900
|
{
|
|
3851
3901
|
header: "Pos",
|
|
@@ -3875,7 +3925,7 @@ function Yr(e, n, r) {
|
|
|
3875
3925
|
entry: e.entryStatus || ""
|
|
3876
3926
|
}));
|
|
3877
3927
|
return t(e, {
|
|
3878
|
-
...
|
|
3928
|
+
...G.compact,
|
|
3879
3929
|
startY: r,
|
|
3880
3930
|
columns: i,
|
|
3881
3931
|
body: a,
|
|
@@ -3900,8 +3950,8 @@ function Yr(e, n, r) {
|
|
|
3900
3950
|
}
|
|
3901
3951
|
}), e.lastAutoTable?.finalY || r + 20;
|
|
3902
3952
|
}
|
|
3903
|
-
function
|
|
3904
|
-
|
|
3953
|
+
function ei(e, n, r) {
|
|
3954
|
+
R(e, I.HEADING, F.BOLD), e.text("Seeded Players", 15, r), r += 4;
|
|
3905
3955
|
let i = [
|
|
3906
3956
|
{
|
|
3907
3957
|
header: "Seed",
|
|
@@ -3921,7 +3971,7 @@ function Xr(e, n, r) {
|
|
|
3921
3971
|
nat: e.nationality
|
|
3922
3972
|
}));
|
|
3923
3973
|
return t(e, {
|
|
3924
|
-
...
|
|
3974
|
+
...G.compact,
|
|
3925
3975
|
startY: r,
|
|
3926
3976
|
columns: i,
|
|
3927
3977
|
body: a,
|
|
@@ -3942,30 +3992,30 @@ function Xr(e, n, r) {
|
|
|
3942
3992
|
}
|
|
3943
3993
|
//#endregion
|
|
3944
3994
|
//#region src/generators/schedule.ts
|
|
3945
|
-
function
|
|
3995
|
+
function ti(n, r = {}) {
|
|
3946
3996
|
let { header: i, fullCourtNames: a = !0, notes: o } = r, s = (r.landscape === "auto" ? n.courts.length >= 5 : r.landscape) ? "landscape" : "portrait", c = new e({
|
|
3947
3997
|
orientation: s,
|
|
3948
3998
|
format: "a4"
|
|
3949
3999
|
});
|
|
3950
|
-
|
|
4000
|
+
L(c);
|
|
3951
4001
|
let l = 15;
|
|
3952
4002
|
if (i) {
|
|
3953
4003
|
let e = n.scheduledDate ? `Order of Play - ${n.scheduledDate}` : "Order of Play";
|
|
3954
|
-
l =
|
|
4004
|
+
l = vt(c, {
|
|
3955
4005
|
...i,
|
|
3956
4006
|
subtitle: e
|
|
3957
4007
|
});
|
|
3958
4008
|
}
|
|
3959
|
-
let u = n.courts, d = a ? u : u.map(
|
|
4009
|
+
let u = n.courts, d = a ? u : u.map(ri);
|
|
3960
4010
|
for (let e of n.timeSlots) {
|
|
3961
|
-
|
|
4011
|
+
R(c, I.BODY, F.BOLD), c.setTextColor(30, 60, 120), c.text(e.label, 15, l), c.setTextColor(0), l += 4;
|
|
3962
4012
|
let n = d.map((e) => ({
|
|
3963
4013
|
header: e,
|
|
3964
4014
|
dataKey: e
|
|
3965
4015
|
})), r = /* @__PURE__ */ new Map();
|
|
3966
4016
|
u.forEach((e) => r.set(e, []));
|
|
3967
4017
|
for (let t of e.matches) {
|
|
3968
|
-
let e =
|
|
4018
|
+
let e = ni(t), n = r.get(t.courtName) || [];
|
|
3969
4019
|
n.push(e), r.set(t.courtName, n);
|
|
3970
4020
|
}
|
|
3971
4021
|
let o = Math.max(1, ...Array.from(r.values()).map((e) => e.length)), s = [];
|
|
@@ -3977,58 +4027,58 @@ function Zr(n, r = {}) {
|
|
|
3977
4027
|
}), s.push(t);
|
|
3978
4028
|
}
|
|
3979
4029
|
t(c, {
|
|
3980
|
-
...
|
|
4030
|
+
...G.schedule,
|
|
3981
4031
|
startY: l,
|
|
3982
4032
|
columns: n,
|
|
3983
4033
|
body: s,
|
|
3984
4034
|
tableWidth: "auto",
|
|
3985
4035
|
didDrawPage: (e) => {
|
|
3986
|
-
|
|
4036
|
+
W(c, i?.tournamentName || "", e.pageNumber);
|
|
3987
4037
|
}
|
|
3988
4038
|
}), l = c.lastAutoTable?.finalY + 6 || l + 20;
|
|
3989
4039
|
}
|
|
3990
4040
|
if (o?.length) {
|
|
3991
|
-
l += 4,
|
|
4041
|
+
l += 4, R(c, I.SMALL, F.ITALIC), c.setTextColor(80);
|
|
3992
4042
|
for (let e of o) c.text(e, 15, l), l += 4;
|
|
3993
4043
|
c.setTextColor(0);
|
|
3994
4044
|
}
|
|
3995
4045
|
return c;
|
|
3996
4046
|
}
|
|
3997
|
-
function
|
|
4047
|
+
function ni(e) {
|
|
3998
4048
|
let t = [];
|
|
3999
4049
|
return t.push(`${e.eventAbbr} ${e.roundName}`), t.push(`${e.side1.name} (${e.side1.nationality})`), t.push(`vs ${e.side2.name} (${e.side2.nationality})`), e.score && t.push(e.score), t.join("\n");
|
|
4000
4050
|
}
|
|
4001
|
-
function
|
|
4051
|
+
function ri(e) {
|
|
4002
4052
|
return e.replace(/^Court\s*/i, "Ct ");
|
|
4003
4053
|
}
|
|
4004
4054
|
//#endregion
|
|
4005
4055
|
//#region src/composition/resolveCompositionConfig.ts
|
|
4006
|
-
var
|
|
4007
|
-
function
|
|
4056
|
+
var ii = "print";
|
|
4057
|
+
function ai(e) {
|
|
4008
4058
|
let { providerConfig: t, tournamentRecord: n, printType: r, runtime: i } = e;
|
|
4009
|
-
return
|
|
4059
|
+
return oi(oi(t?.providerConfigSettings?.policies?.printPolicies?.[r] ?? {}, (n?.extensions?.find((e) => e.name === ii))?.value?.[r] ?? {}), i ?? {});
|
|
4010
4060
|
}
|
|
4011
|
-
function
|
|
4061
|
+
function oi(e, t) {
|
|
4012
4062
|
let n = { ...e };
|
|
4013
4063
|
for (let e of Object.keys(t)) {
|
|
4014
4064
|
let r = t[e];
|
|
4015
4065
|
if (r === void 0) continue;
|
|
4016
4066
|
let i = n[e];
|
|
4017
|
-
n[e] =
|
|
4067
|
+
n[e] = si(i) && si(r) ? oi(i, r) : r;
|
|
4018
4068
|
}
|
|
4019
4069
|
return n;
|
|
4020
4070
|
}
|
|
4021
|
-
function
|
|
4071
|
+
function si(e) {
|
|
4022
4072
|
return typeof e == "object" && !!e && !Array.isArray(e) && Object.getPrototypeOf(e) === Object.prototype;
|
|
4023
4073
|
}
|
|
4024
4074
|
//#endregion
|
|
4025
4075
|
//#region src/generators/sequentialOOP.ts
|
|
4026
|
-
var
|
|
4076
|
+
var ci = [
|
|
4027
4077
|
120,
|
|
4028
4078
|
50,
|
|
4029
4079
|
140
|
|
4030
4080
|
];
|
|
4031
|
-
function
|
|
4081
|
+
function li(e, t = {}) {
|
|
4032
4082
|
let n = {
|
|
4033
4083
|
pageSize: t.page?.pageSize || "a4",
|
|
4034
4084
|
orientation: t.page?.orientation || "portrait",
|
|
@@ -4038,49 +4088,49 @@ function ai(e, t = {}) {
|
|
|
4038
4088
|
bottom: 12,
|
|
4039
4089
|
left: 15
|
|
4040
4090
|
}
|
|
4041
|
-
}, r =
|
|
4042
|
-
t.header && (d = i.top +
|
|
4043
|
-
let f =
|
|
4091
|
+
}, r = xe(n), { margins: i } = n, a = r.internal.pageSize.getWidth(), o = r.internal.pageSize.getHeight(), s = a - i.left - i.right, c = t.accentColor || ci, l = t.footer || { layout: "none" }, u = V(l), d = i.top;
|
|
4092
|
+
t.header && (d = i.top + B(r, t.header, n) + 3);
|
|
4093
|
+
let f = mi(e);
|
|
4044
4094
|
for (let [e, a] of f) {
|
|
4045
|
-
d + 30 > o - i.bottom - u && (
|
|
4095
|
+
d + 30 > o - i.bottom - u && (hi(r, t, n, l), r.addPage(), d = i.top), d = ui(r, e, i.left, d, s);
|
|
4046
4096
|
let f = "";
|
|
4047
4097
|
for (let e of a) {
|
|
4048
4098
|
let a = e.scheduledTime || e.notBeforeTime || "";
|
|
4049
|
-
a && a !== f && (d + 25 > o - i.bottom - u && (
|
|
4099
|
+
a && a !== f && (d + 25 > o - i.bottom - u && (hi(r, t, n, l), r.addPage(), d = i.top), d = di(r, a, !!e.notBeforeTime, i.left, d, s, c), f = a), d + 22 > o - i.bottom - u && (hi(r, t, n, l), r.addPage(), d = i.top), d = fi(r, e, i.left, d, s);
|
|
4050
4100
|
}
|
|
4051
4101
|
d += 4;
|
|
4052
4102
|
}
|
|
4053
|
-
return t.disclaimer && (d += 2,
|
|
4103
|
+
return t.disclaimer && (d += 2, R(r, I.TINY, F.ITALIC), r.setTextColor(100), r.text(t.disclaimer, a / 2, d, { align: "center" }), r.setTextColor(0)), hi(r, t, n, l), r;
|
|
4054
4104
|
}
|
|
4055
|
-
function
|
|
4056
|
-
return
|
|
4105
|
+
function ui(e, t, n, r, i) {
|
|
4106
|
+
return R(e, I.HEADING, F.BOLD), e.setTextColor(40), e.text(t.toUpperCase(), n + i / 2, r, { align: "center" }), e.setTextColor(0), r + 7;
|
|
4057
4107
|
}
|
|
4058
|
-
function
|
|
4108
|
+
function di(e, t, n, r, i, a, o) {
|
|
4059
4109
|
let s = n ? `Not before ${t}` : `Starting at ${t}`;
|
|
4060
|
-
return e.setFillColor(o[0], o[1], o[2]), e.rect(r + 20, i, a - 40, 5, "F"),
|
|
4110
|
+
return e.setFillColor(o[0], o[1], o[2]), e.rect(r + 20, i, a - 40, 5, "F"), R(e, I.SMALL, F.ITALIC), e.setTextColor(255, 255, 255), e.text(s, r + a / 2, i + 3.5, { align: "center" }), e.setTextColor(0), i + 7;
|
|
4061
4111
|
}
|
|
4062
|
-
function
|
|
4112
|
+
function fi(e, t, n, r, i) {
|
|
4063
4113
|
let a = n + 15, o = i - 30, s = r;
|
|
4064
|
-
|
|
4114
|
+
R(e, I.TINY, F.ITALIC), e.setTextColor(100);
|
|
4065
4115
|
let c = t.eventAbbr ? `${t.eventAbbr} ${t.roundName}` : t.roundName;
|
|
4066
|
-
e.text(c, a + o - 2, r + 3, { align: "right" }), e.setTextColor(0), t.score && (
|
|
4116
|
+
e.text(c, a + o - 2, r + 3, { align: "right" }), e.setTextColor(0), t.score && (R(e, I.SMALL, F.BOLD), e.setTextColor(120, 50, 140), e.text(t.score, a + o / 2, r + 3, { align: "center" }), e.setTextColor(0), r += 4), r += 2, r = pi(e, t.side1, a, r, o), R(e, I.TINY, F.ITALIC), e.setTextColor(120), e.text("vs", a + o / 2, r + 2.5, { align: "center" }), e.setTextColor(0), r += 4, r = pi(e, t.side2, a, r, o), r += 2;
|
|
4067
4117
|
let l = r - s;
|
|
4068
4118
|
return e.setDrawColor(180), e.setLineWidth(.3), e.rect(a, s, o, l), r + 2;
|
|
4069
4119
|
}
|
|
4070
|
-
function
|
|
4071
|
-
if (!t.name || t.name === "TBD") return
|
|
4072
|
-
|
|
4120
|
+
function pi(e, t, n, r, i) {
|
|
4121
|
+
if (!t.name || t.name === "TBD") return R(e, I.BODY, F.ITALIC), e.setTextColor(150), e.text("TBD", n + 10, r + 3), e.setTextColor(0), r + 4;
|
|
4122
|
+
R(e, I.BODY, F.NORMAL);
|
|
4073
4123
|
let a = t.nationality ? `${t.name} ${t.nationality}` : t.name;
|
|
4074
4124
|
return e.text(a, n + 10, r + 3), r + 4;
|
|
4075
4125
|
}
|
|
4076
|
-
function
|
|
4126
|
+
function mi(e) {
|
|
4077
4127
|
let t = /* @__PURE__ */ new Map();
|
|
4078
4128
|
for (let n of e.courts) t.set(n, []);
|
|
4079
4129
|
for (let n of e.timeSlots) for (let e of n.matches) t.has(e.courtName) || t.set(e.courtName, []), t.get(e.courtName).push(e);
|
|
4080
4130
|
for (let [e, n] of t) n.length === 0 && t.delete(e);
|
|
4081
4131
|
return t;
|
|
4082
4132
|
}
|
|
4083
|
-
function
|
|
4133
|
+
function hi(e, t, n, r) {
|
|
4084
4134
|
let { margins: i } = n, a = e.internal.pageSize.getWidth(), o = e.internal.pageSize.getHeight();
|
|
4085
4135
|
if (t.officials?.length) {
|
|
4086
4136
|
let n = o - i.bottom - 10;
|
|
@@ -4088,33 +4138,33 @@ function di(e, t, n, r) {
|
|
|
4088
4138
|
let r = (a - i.left - i.right) / t.officials.length;
|
|
4089
4139
|
t.officials.forEach((t, a) => {
|
|
4090
4140
|
let o = i.left + a * r;
|
|
4091
|
-
|
|
4141
|
+
R(e, I.TINY, F.BOLD), e.text(t.role, o, n), R(e, I.TINY, F.NORMAL), e.text(t.name, o, n + 3);
|
|
4092
4142
|
});
|
|
4093
4143
|
}
|
|
4094
|
-
|
|
4144
|
+
ze(e, r, n);
|
|
4095
4145
|
}
|
|
4096
4146
|
//#endregion
|
|
4097
4147
|
//#region src/generators/report.ts
|
|
4098
|
-
var
|
|
4099
|
-
function
|
|
4148
|
+
var gi = .2645833;
|
|
4149
|
+
function _i(e) {
|
|
4100
4150
|
let t = {};
|
|
4101
4151
|
for (let n of e) {
|
|
4102
4152
|
let e = {};
|
|
4103
|
-
n.type === "number" && (e.halign = "right"), n.width ? e.cellWidth = Math.round(n.width *
|
|
4153
|
+
n.type === "number" && (e.halign = "right"), n.width ? e.cellWidth = Math.round(n.width * gi * 10) / 10 : n.fitData && (e.cellWidth = "wrap"), Object.keys(e).length && (t[n.key] = e);
|
|
4104
4154
|
}
|
|
4105
4155
|
return t;
|
|
4106
4156
|
}
|
|
4107
|
-
function
|
|
4157
|
+
function vi(n, r, i = {}) {
|
|
4108
4158
|
let a = i.orientation || "landscape", o = new e({
|
|
4109
4159
|
orientation: a,
|
|
4110
4160
|
format: "a4"
|
|
4111
4161
|
});
|
|
4112
|
-
|
|
4162
|
+
L(o);
|
|
4113
4163
|
let s = 15;
|
|
4114
|
-
if (i.header ? s =
|
|
4164
|
+
if (i.header ? s = vt(o, {
|
|
4115
4165
|
...i.header,
|
|
4116
4166
|
subtitle: i.header.subtitle || i.title
|
|
4117
|
-
}) : i.title && (
|
|
4167
|
+
}) : i.title && (R(o, I.SUBTITLE, F.BOLD), o.text(i.title, 15, s), s += 8), n.length === 0) return R(o, I.BODY, F.ITALIC), o.text("No columns defined", 15, s), W(o, `Generated ${(/* @__PURE__ */ new Date()).toLocaleDateString()}`, 1), o;
|
|
4118
4168
|
let c = n.map((e) => ({
|
|
4119
4169
|
header: e.title,
|
|
4120
4170
|
dataKey: e.key
|
|
@@ -4125,22 +4175,22 @@ function mi(n, r, i = {}) {
|
|
|
4125
4175
|
t[r.key] = n == null ? "" : String(n);
|
|
4126
4176
|
}
|
|
4127
4177
|
return t;
|
|
4128
|
-
}), u =
|
|
4178
|
+
}), u = _i(n);
|
|
4129
4179
|
return t(o, {
|
|
4130
|
-
...
|
|
4180
|
+
...G.report,
|
|
4131
4181
|
startY: s,
|
|
4132
4182
|
columns: c,
|
|
4133
4183
|
body: l,
|
|
4134
4184
|
columnStyles: u,
|
|
4135
4185
|
didDrawPage: (e) => {
|
|
4136
|
-
|
|
4186
|
+
W(o, `Generated ${(/* @__PURE__ */ new Date()).toLocaleDateString()}`, e.pageNumber);
|
|
4137
4187
|
}
|
|
4138
4188
|
}), o;
|
|
4139
4189
|
}
|
|
4140
4190
|
//#endregion
|
|
4141
4191
|
//#region src/generators/factSheet.ts
|
|
4142
4192
|
var Z = 15;
|
|
4143
|
-
function
|
|
4193
|
+
function yi(e) {
|
|
4144
4194
|
if (typeof document < "u") {
|
|
4145
4195
|
let t = document.createElement("div");
|
|
4146
4196
|
return t.innerHTML = e, t.textContent || "";
|
|
@@ -4160,10 +4210,10 @@ function hi(e) {
|
|
|
4160
4210
|
return t.trim();
|
|
4161
4211
|
}
|
|
4162
4212
|
function Q(e, t, n) {
|
|
4163
|
-
return
|
|
4213
|
+
return R(e, I.HEADING, F.BOLD), e.setTextColor(40), e.text(t.toUpperCase(), Z, n), e.setTextColor(0), n += 1.5, e.setDrawColor(180), e.setLineWidth(.2), e.line(Z, n, e.internal.pageSize.getWidth() - Z, n), n += 4, n;
|
|
4164
4214
|
}
|
|
4165
|
-
function
|
|
4166
|
-
|
|
4215
|
+
function bi(e, t, n, r) {
|
|
4216
|
+
R(e, I.BODY, F.NORMAL);
|
|
4167
4217
|
let i = r || e.internal.pageSize.getWidth() - 30, a = e.splitTextToSize(t, i);
|
|
4168
4218
|
return e.text(a, Z, n), n + a.length * 3.2;
|
|
4169
4219
|
}
|
|
@@ -4171,7 +4221,7 @@ function $(e, t, n) {
|
|
|
4171
4221
|
let r = e.internal.pageSize.getHeight();
|
|
4172
4222
|
return t + n > r - 20 ? (e.addPage(), 20) : t;
|
|
4173
4223
|
}
|
|
4174
|
-
function
|
|
4224
|
+
function xi(e, t, n) {
|
|
4175
4225
|
let r = {
|
|
4176
4226
|
pageSize: "a4",
|
|
4177
4227
|
orientation: "portrait",
|
|
@@ -4182,9 +4232,9 @@ function _i(e, t, n) {
|
|
|
4182
4232
|
left: Z
|
|
4183
4233
|
}
|
|
4184
4234
|
};
|
|
4185
|
-
return n +
|
|
4235
|
+
return n + B(e, Le(t, { layout: "itf" }), r);
|
|
4186
4236
|
}
|
|
4187
|
-
function
|
|
4237
|
+
function Si(e, n, r) {
|
|
4188
4238
|
let i = (n.participants || []).filter((e) => e.participantRole && e.participantRole !== "COMPETITOR");
|
|
4189
4239
|
if (!i.length) return r;
|
|
4190
4240
|
r = $(e, r, 20), r = Q(e, "Tournament Contacts", r);
|
|
@@ -4224,7 +4274,7 @@ function vi(e, n, r) {
|
|
|
4224
4274
|
theme: "grid"
|
|
4225
4275
|
}), e.lastAutoTable.finalY + 6;
|
|
4226
4276
|
}
|
|
4227
|
-
function
|
|
4277
|
+
function Ci(e, n, r) {
|
|
4228
4278
|
let i = n.events || [];
|
|
4229
4279
|
if (!i.length) return r;
|
|
4230
4280
|
r = $(e, r, 20), r = Q(e, "Events", r);
|
|
@@ -4266,7 +4316,7 @@ function yi(e, n, r) {
|
|
|
4266
4316
|
theme: "grid"
|
|
4267
4317
|
}), e.lastAutoTable.finalY + 6;
|
|
4268
4318
|
}
|
|
4269
|
-
function
|
|
4319
|
+
function wi(e, t, n) {
|
|
4270
4320
|
let r = t.registrationProfile;
|
|
4271
4321
|
if (!r) return n;
|
|
4272
4322
|
let i = [];
|
|
@@ -4275,16 +4325,16 @@ function bi(e, t, n) {
|
|
|
4275
4325
|
i.push("Entry Fees: " + e);
|
|
4276
4326
|
}
|
|
4277
4327
|
if (!i.length) return n;
|
|
4278
|
-
n = $(e, n, 10 + i.length * 3.5), n = Q(e, "Entry Information", n),
|
|
4328
|
+
n = $(e, n, 10 + i.length * 3.5), n = Q(e, "Entry Information", n), R(e, I.BODY, F.NORMAL);
|
|
4279
4329
|
for (let t of i) e.text(t, Z, n), n += 3.5;
|
|
4280
4330
|
return n + 3;
|
|
4281
4331
|
}
|
|
4282
|
-
function
|
|
4332
|
+
function Ti(e, t, n) {
|
|
4283
4333
|
let r = t.venues || [];
|
|
4284
4334
|
if (!r.length) return n;
|
|
4285
|
-
n = $(e, n, 15), n = Q(e, "Venue", n),
|
|
4335
|
+
n = $(e, n, 15), n = Q(e, "Venue", n), R(e, I.BODY, F.NORMAL);
|
|
4286
4336
|
for (let t of r) {
|
|
4287
|
-
|
|
4337
|
+
R(e, I.BODY, F.BOLD), e.text(t.venueName || "Venue", Z, n), n += 3.5, R(e, I.BODY, F.NORMAL);
|
|
4288
4338
|
let r = t.addresses?.[0];
|
|
4289
4339
|
if (r) {
|
|
4290
4340
|
let t = [
|
|
@@ -4301,9 +4351,9 @@ function xi(e, t, n) {
|
|
|
4301
4351
|
}
|
|
4302
4352
|
return n + 3;
|
|
4303
4353
|
}
|
|
4304
|
-
function
|
|
4354
|
+
function Ei(e, n, r, i) {
|
|
4305
4355
|
if (!r) return i;
|
|
4306
|
-
let a = r.options?.length, o = r.notes &&
|
|
4356
|
+
let a = r.options?.length, o = r.notes && yi(r.notes);
|
|
4307
4357
|
if (!a && !o) return i;
|
|
4308
4358
|
if (i = $(e, i, 15), i = Q(e, n, i), a) {
|
|
4309
4359
|
let n = r.options.map((e) => {
|
|
@@ -4346,16 +4396,16 @@ function Si(e, n, r, i) {
|
|
|
4346
4396
|
theme: "grid"
|
|
4347
4397
|
}), i = e.lastAutoTable.finalY + 3;
|
|
4348
4398
|
}
|
|
4349
|
-
return o && (i =
|
|
4399
|
+
return o && (i = bi(e, yi(r.notes), i)), i + 3;
|
|
4350
4400
|
}
|
|
4351
|
-
function
|
|
4401
|
+
function Di(e, t, n) {
|
|
4352
4402
|
let r = t.totalPrizeMoney;
|
|
4353
4403
|
if (!r?.length) return n;
|
|
4354
|
-
n = $(e, n, 10), n = Q(e, "Prize Money", n),
|
|
4404
|
+
n = $(e, n, 10), n = Q(e, "Prize Money", n), R(e, I.BODY, F.NORMAL);
|
|
4355
4405
|
for (let t of r) e.text(t.currencyCode + " " + t.amount.toLocaleString(), Z, n), n += 3.5;
|
|
4356
4406
|
return n + 3;
|
|
4357
4407
|
}
|
|
4358
|
-
function
|
|
4408
|
+
function Oi(e, n, r) {
|
|
4359
4409
|
let i = (n.participants || []).filter((e) => e.participantRole === "OFFICIAL" || e.participantRole === "DIRECTOR");
|
|
4360
4410
|
if (!i.length) return r;
|
|
4361
4411
|
r = $(e, r, 15), r = Q(e, "Officials", r);
|
|
@@ -4387,7 +4437,7 @@ function wi(e, n, r) {
|
|
|
4387
4437
|
theme: "grid"
|
|
4388
4438
|
}), e.lastAutoTable.finalY + 6;
|
|
4389
4439
|
}
|
|
4390
|
-
function
|
|
4440
|
+
function ki(e, t, n) {
|
|
4391
4441
|
let r = t.registrationProfile;
|
|
4392
4442
|
if (!r) return n;
|
|
4393
4443
|
let i = [];
|
|
@@ -4397,27 +4447,27 @@ function Ti(e, t, n) {
|
|
|
4397
4447
|
}
|
|
4398
4448
|
if (r.regulations?.length) for (let e of r.regulations) i.push((e.name || "Regulation") + (e.url ? " — " + e.url : ""));
|
|
4399
4449
|
if (r.dressCode && i.push("Dress Code: " + r.dressCode), r.contingencyPlan && i.push("Contingency: " + r.contingencyPlan), !i.length) return n;
|
|
4400
|
-
n = $(e, n, 10 + i.length * 3.5), n = Q(e, "Regulations", n),
|
|
4450
|
+
n = $(e, n, 10 + i.length * 3.5), n = Q(e, "Regulations", n), R(e, I.BODY, F.NORMAL);
|
|
4401
4451
|
for (let t of i) e.text(t, Z, n), n += 3.5;
|
|
4402
4452
|
return n + 3;
|
|
4403
4453
|
}
|
|
4404
|
-
function
|
|
4454
|
+
function Ai(e, t, n) {
|
|
4405
4455
|
let r = t.registrationProfile?.sponsors;
|
|
4406
4456
|
if (!r?.length) return n;
|
|
4407
|
-
n = $(e, n, 10), n = Q(e, "Sponsors", n),
|
|
4457
|
+
n = $(e, n, 10), n = Q(e, "Sponsors", n), R(e, I.BODY, F.NORMAL);
|
|
4408
4458
|
for (let t of r) {
|
|
4409
4459
|
let r = t.tier ? " [" + t.tier + "]" : "";
|
|
4410
4460
|
e.text(t.name + r, Z, n), n += 3.5;
|
|
4411
4461
|
}
|
|
4412
4462
|
return n + 3;
|
|
4413
4463
|
}
|
|
4414
|
-
function
|
|
4464
|
+
function ji(e, t, n) {
|
|
4415
4465
|
let r = t.registrationProfile?.socialEvents;
|
|
4416
4466
|
if (!r?.length) return n;
|
|
4417
4467
|
let i = t.registrationProfile;
|
|
4418
|
-
n = $(e, n, 15), n = Q(e, "Social Events & Ceremonies", n),
|
|
4468
|
+
n = $(e, n, 15), n = Q(e, "Social Events & Ceremonies", n), R(e, I.BODY, F.NORMAL), i?.drawCeremonyDate && (e.text("Draw Ceremony: " + i.drawCeremonyDate, Z, n), n += 3.5), i?.awardsCeremonyDate && (e.text("Awards Ceremony: " + i.awardsCeremonyDate, Z, n), n += 3.5);
|
|
4419
4469
|
for (let t of r) {
|
|
4420
|
-
|
|
4470
|
+
R(e, I.BODY, F.BOLD), e.text(t.name, Z, n), n += 3.5, R(e, I.BODY, F.NORMAL);
|
|
4421
4471
|
let r = [
|
|
4422
4472
|
t.date,
|
|
4423
4473
|
t.time,
|
|
@@ -4427,48 +4477,48 @@ function Di(e, t, n) {
|
|
|
4427
4477
|
}
|
|
4428
4478
|
return n + 3;
|
|
4429
4479
|
}
|
|
4430
|
-
function
|
|
4480
|
+
function Mi(e, t, n) {
|
|
4431
4481
|
let r = t.notes;
|
|
4432
4482
|
if (!r) return n;
|
|
4433
|
-
let i =
|
|
4434
|
-
return i ? (n = $(e, n, 15), n = Q(e, "Additional Information", n), n =
|
|
4435
|
-
}
|
|
4436
|
-
var
|
|
4437
|
-
"tournament-header":
|
|
4438
|
-
contacts:
|
|
4439
|
-
events:
|
|
4440
|
-
"entry-info":
|
|
4441
|
-
"venue-info":
|
|
4442
|
-
accommodation: (e, t, n) =>
|
|
4443
|
-
transportation: (e, t, n) =>
|
|
4444
|
-
hospitality: (e, t, n) =>
|
|
4445
|
-
medical: (e, t, n) =>
|
|
4446
|
-
regulations:
|
|
4447
|
-
"prize-money":
|
|
4448
|
-
officials:
|
|
4449
|
-
sponsors:
|
|
4450
|
-
"social-events":
|
|
4451
|
-
"custom-notes":
|
|
4483
|
+
let i = yi(r);
|
|
4484
|
+
return i ? (n = $(e, n, 15), n = Q(e, "Additional Information", n), n = bi(e, i, n), n + 3) : n;
|
|
4485
|
+
}
|
|
4486
|
+
var Ni = {
|
|
4487
|
+
"tournament-header": xi,
|
|
4488
|
+
contacts: Si,
|
|
4489
|
+
events: Ci,
|
|
4490
|
+
"entry-info": wi,
|
|
4491
|
+
"venue-info": Ti,
|
|
4492
|
+
accommodation: (e, t, n) => Ei(e, "Accommodation", t.registrationProfile?.accommodation, n),
|
|
4493
|
+
transportation: (e, t, n) => Ei(e, "Transportation", t.registrationProfile?.transportation, n),
|
|
4494
|
+
hospitality: (e, t, n) => Ei(e, "Hospitality", t.registrationProfile?.hospitality, n),
|
|
4495
|
+
medical: (e, t, n) => Ei(e, "Medical", t.registrationProfile?.medicalInfo, n),
|
|
4496
|
+
regulations: ki,
|
|
4497
|
+
"prize-money": Di,
|
|
4498
|
+
officials: Oi,
|
|
4499
|
+
sponsors: Ai,
|
|
4500
|
+
"social-events": ji,
|
|
4501
|
+
"custom-notes": Mi
|
|
4452
4502
|
};
|
|
4453
|
-
function
|
|
4454
|
-
let { templateId: r = "itf-junior" } = n, i =
|
|
4503
|
+
function Pi(t, n = {}) {
|
|
4504
|
+
let { templateId: r = "itf-junior" } = n, i = ue(r)?.sections || ue("itf-junior").sections, a = n.enabledSections ? new Set(n.enabledSections) : null, o = new e({
|
|
4455
4505
|
orientation: "portrait",
|
|
4456
4506
|
format: "a4"
|
|
4457
4507
|
});
|
|
4458
|
-
|
|
4508
|
+
L(o);
|
|
4459
4509
|
let s = Z;
|
|
4460
4510
|
for (let e of i) {
|
|
4461
4511
|
if (!e.enabled || a && !a.has(e.type)) continue;
|
|
4462
|
-
let n =
|
|
4512
|
+
let n = Ni[e.type];
|
|
4463
4513
|
n && (s = n(o, t, s));
|
|
4464
4514
|
}
|
|
4465
4515
|
let c = o.getNumberOfPages();
|
|
4466
|
-
for (let e = 1; e <= c; e++) o.setPage(e),
|
|
4516
|
+
for (let e = 1; e <= c; e++) o.setPage(e), W(o, "Generated " + (/* @__PURE__ */ new Date()).toLocaleDateString(), e);
|
|
4467
4517
|
return o;
|
|
4468
4518
|
}
|
|
4469
4519
|
//#endregion
|
|
4470
4520
|
//#region src/generators/generateFromEventData.ts
|
|
4471
|
-
function
|
|
4521
|
+
function Fi(e, t = {}) {
|
|
4472
4522
|
let n = e?.drawsData || [], r = e?.tournamentInfo || {}, i = e?.eventInfo || {}, a = S(t.catalogPreset || "club-basic"), o = h(a?.drawFormatPreset || "itfJunior"), s = {
|
|
4473
4523
|
layout: "itf",
|
|
4474
4524
|
tournamentName: r.tournamentName || "Tournament",
|
|
@@ -4492,18 +4542,18 @@ function ji(e, t = {}) {
|
|
|
4492
4542
|
footer: c,
|
|
4493
4543
|
format: o
|
|
4494
4544
|
};
|
|
4495
|
-
if (u && d) return
|
|
4496
|
-
winnersBracket: f ?
|
|
4497
|
-
losersBracket:
|
|
4498
|
-
deciderMatch:
|
|
4545
|
+
if (u && d) return or({
|
|
4546
|
+
winnersBracket: f ? N(f) : Ii(),
|
|
4547
|
+
losersBracket: P(n, "CONSOLATION") ? N(P(n, "CONSOLATION")) : Ii(),
|
|
4548
|
+
deciderMatch: P(n, "PLAY_OFF") ? N(P(n, "PLAY_OFF")) : void 0
|
|
4499
4549
|
}, p);
|
|
4500
|
-
if (u) return
|
|
4550
|
+
if (u) return nr(l.map((e) => ({
|
|
4501
4551
|
name: e.structureName,
|
|
4502
4552
|
stage: e.stage,
|
|
4503
|
-
drawData:
|
|
4553
|
+
drawData: N(e)
|
|
4504
4554
|
})), p);
|
|
4505
4555
|
let m = t.structureId && l.find((e) => e.structureId === t.structureId) || f;
|
|
4506
|
-
if (!m) return
|
|
4556
|
+
if (!m) return xe({
|
|
4507
4557
|
pageSize: "a4",
|
|
4508
4558
|
orientation: "portrait",
|
|
4509
4559
|
margins: {
|
|
@@ -4513,13 +4563,13 @@ function ji(e, t = {}) {
|
|
|
4513
4563
|
left: 15
|
|
4514
4564
|
}
|
|
4515
4565
|
});
|
|
4516
|
-
let g =
|
|
4517
|
-
return t.mirrored ?
|
|
4566
|
+
let g = N(m);
|
|
4567
|
+
return t.mirrored ? ir(g, p) : t.splitPages || g.drawSize >= 256 ? er(g, {
|
|
4518
4568
|
...p,
|
|
4519
4569
|
maxPositionsPerPage: t.maxPositionsPerPage || 32
|
|
4520
|
-
}) :
|
|
4570
|
+
}) : $n(g, p);
|
|
4521
4571
|
}
|
|
4522
|
-
function
|
|
4572
|
+
function Ii() {
|
|
4523
4573
|
return {
|
|
4524
4574
|
drawName: "",
|
|
4525
4575
|
drawSize: 0,
|
|
@@ -4531,6 +4581,6 @@ function Mi() {
|
|
|
4531
4581
|
};
|
|
4532
4582
|
}
|
|
4533
4583
|
//#endregion
|
|
4534
|
-
export { x as COMPOSITION_CATALOG,
|
|
4584
|
+
export { x as COMPOSITION_CATALOG, Pr as DRAW_MODAL_TABS, le as FACT_SHEET_CATALOG, pe as FONT, Ar as FOOTER_LAYOUT_OPTIONS, kr as HEADER_LAYOUT_OPTIONS, Mr as ORIENTATION_OPTIONS, jr as PAGE_SIZE_OPTIONS, m as PRESETS, Fr as SCHEDULE_MODAL_TABS, I as SIZE, Nr as SPLIT_STRATEGY_OPTIONS, F as STYLE, G as TABLE_STYLES, _e as activeFontFamily, L as applyDefaultFont, Re as buildFooterFromTournament, Le as buildHeaderFromTournament, qr as calculateBracketPositions, xe as createDoc, Yr as drawBracketConnectors, Jr as drawBracketSlot, W as drawPageFooter, vt as drawTournamentHeader, Qe as entryStatusDisplay, nt as eventAbbreviation, dr as executePrint, Gr as extractCompassData, In as extractConsolationStructures, ct as extractCourtCardData, Et as extractDrawData, ot as extractParticipantData, Ir as extractRoundRobinData, it as extractScheduleData, P as findStructure, et as formatDate, q as formatMatchScore, kt as formatPlayerEntry, $e as formatScore, tt as formatTime, ar as generateBackdrawPDF, rr as generateCompassDrawPDF, nr as generateConsolationDrawPDF, xt as generateCourtCardPDF, or as generateDoubleEliminationPDF, Zn as generateDrawPDF, Zr as generateDrawSheetPDF, Pi as generateFactSheet, tr as generateFeedInDrawPDF, Fi as generateFromEventData, sr as generateLuckyDrawPDF, Ct as generateMatchCardPDF, ir as generateMirroredDrawPDF, dt as generateOrderOfPlayPDF, dt as generateScheduleV2PDF, yt as generatePlayerListPDF, vi as generateReportPDF, ti as generateSchedulePDF, li as generateSequentialOOP, bt as generateSignInSheetPDF, er as generateSplitDrawPDF, $n as generateTraditionalDrawPDF, S as getCatalogPreset, be as getDefaultFont, Se as getDefaultPageConfig, ue as getFactSheetTemplate, z as getPageRegions, h as getPreset, K as getRoundLabel, ee as listCatalogPresets, de as listFactSheetTemplates, V as measureFooterHeight, Xe as measureSeedingsHeight, te as mergeCatalogPreset, g as mergePreset, U as nationality, H as participantName, ge as registerFont, Nn as renderCompassDraw, Ln as renderConsolationDraw, Rn as renderDoubleEliminationDraw, ze as renderFooter, B as renderHeader, Un as renderLuckyDraw, Vr as renderRoundRobinGroup, Je as renderSeedingsFooter, J as renderTraditionalDraw, ai as resolveCompositionConfig, rt as roundName, Ze as seedDisplay, ye as setDefaultFont, R as setFont, Kn as splitDraw, N as structureToDrawData };
|
|
4535
4585
|
|
|
4536
4586
|
//# sourceMappingURL=pdf-factory.js.map
|