pdf-factory 1.1.0 → 1.1.2
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/core/drawsDataToDrawData.d.ts.map +1 -1
- package/dist/core/extractDrawData.d.ts +2 -1
- package/dist/core/extractDrawData.d.ts.map +1 -1
- package/dist/core/sideOrderedDrawPositions.d.ts +15 -0
- package/dist/core/sideOrderedDrawPositions.d.ts.map +1 -0
- package/dist/parser.cjs +16 -16
- package/dist/parser.cjs.map +1 -1
- package/dist/parser.js +7078 -7478
- 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 +699 -704
- package/dist/pdf-factory.js.map +1 -1
- package/dist/renderers/positionlessPlacement.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/pdf-factory.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import e from "jspdf";
|
|
2
2
|
import t from "jspdf-autotable";
|
|
3
|
+
import { matchUpGovernor as n } from "tods-competition-factory";
|
|
3
4
|
//#region src/config/formatPresets.ts
|
|
4
|
-
var
|
|
5
|
+
var r = {
|
|
5
6
|
F: "Final",
|
|
6
7
|
SF: "Semi-Finals",
|
|
7
8
|
QF: "Quarter-Finals",
|
|
@@ -9,7 +10,7 @@ var n = {
|
|
|
9
10
|
R32: "Round of 32",
|
|
10
11
|
R64: "Round of 64",
|
|
11
12
|
R128: "Round of 128"
|
|
12
|
-
},
|
|
13
|
+
}, i = {
|
|
13
14
|
F: "Final",
|
|
14
15
|
SF: "Semi-Finals",
|
|
15
16
|
QF: "Quarter-Finals",
|
|
@@ -17,7 +18,7 @@ var n = {
|
|
|
17
18
|
R32: "Third Round",
|
|
18
19
|
R64: "Second Round",
|
|
19
20
|
R128: "First Round"
|
|
20
|
-
},
|
|
21
|
+
}, a = {
|
|
21
22
|
F: "Final",
|
|
22
23
|
SF: "Semifinals",
|
|
23
24
|
QF: "Quarterfinals",
|
|
@@ -25,7 +26,7 @@ var n = {
|
|
|
25
26
|
R32: "Round 3",
|
|
26
27
|
R64: "Round 2",
|
|
27
28
|
R128: "Round 1"
|
|
28
|
-
},
|
|
29
|
+
}, o = {
|
|
29
30
|
F: "Final",
|
|
30
31
|
SF: "Semifinals",
|
|
31
32
|
QF: "Quarterfinals",
|
|
@@ -33,7 +34,7 @@ var n = {
|
|
|
33
34
|
R32: "Round of 32",
|
|
34
35
|
R64: "Round of 64",
|
|
35
36
|
R128: "Round of 128"
|
|
36
|
-
},
|
|
37
|
+
}, s = {
|
|
37
38
|
F: "FINALE",
|
|
38
39
|
SF: "1/2 FINALE",
|
|
39
40
|
QF: "1/4 FINALE",
|
|
@@ -41,7 +42,7 @@ var n = {
|
|
|
41
42
|
R32: "3eme TOUR",
|
|
42
43
|
R64: "2eme TOUR",
|
|
43
44
|
R128: "1er TOUR"
|
|
44
|
-
},
|
|
45
|
+
}, c = {
|
|
45
46
|
pageSize: "a4",
|
|
46
47
|
orientation: "auto",
|
|
47
48
|
margins: {
|
|
@@ -50,174 +51,174 @@ var n = {
|
|
|
50
51
|
bottom: 15,
|
|
51
52
|
left: 10
|
|
52
53
|
}
|
|
53
|
-
},
|
|
54
|
+
}, l = "LAST, First", u = "bare", d = "before-position", f = "brackets", p = "-", m = "traditional-lines", h = {
|
|
54
55
|
wimbledon: {
|
|
55
|
-
nameFormat:
|
|
56
|
-
nationalityFormat:
|
|
57
|
-
seedPosition:
|
|
58
|
-
seedFormat:
|
|
56
|
+
nameFormat: l,
|
|
57
|
+
nationalityFormat: u,
|
|
58
|
+
seedPosition: d,
|
|
59
|
+
seedFormat: f,
|
|
59
60
|
entryFormat: "parens",
|
|
60
|
-
gameScoreSeparator:
|
|
61
|
+
gameScoreSeparator: p,
|
|
61
62
|
setScoreSeparator: " ",
|
|
62
63
|
retirementLabel: "Ret.",
|
|
63
64
|
walkoverLabel: "w/o",
|
|
64
|
-
roundLabels:
|
|
65
|
-
renderStyle:
|
|
66
|
-
page: { ...
|
|
65
|
+
roundLabels: i,
|
|
66
|
+
renderStyle: m,
|
|
67
|
+
page: { ...c }
|
|
67
68
|
},
|
|
68
69
|
usOpen: {
|
|
69
|
-
nameFormat:
|
|
70
|
-
nationalityFormat:
|
|
71
|
-
seedPosition:
|
|
72
|
-
seedFormat:
|
|
70
|
+
nameFormat: l,
|
|
71
|
+
nationalityFormat: u,
|
|
72
|
+
seedPosition: d,
|
|
73
|
+
seedFormat: f,
|
|
73
74
|
entryFormat: "parens",
|
|
74
|
-
gameScoreSeparator:
|
|
75
|
+
gameScoreSeparator: p,
|
|
75
76
|
setScoreSeparator: " | ",
|
|
76
77
|
retirementLabel: "Ret.",
|
|
77
78
|
walkoverLabel: "w/o",
|
|
78
|
-
roundLabels:
|
|
79
|
-
renderStyle:
|
|
80
|
-
page: { ...
|
|
79
|
+
roundLabels: a,
|
|
80
|
+
renderStyle: m,
|
|
81
|
+
page: { ...c }
|
|
81
82
|
},
|
|
82
83
|
rolandGarros: {
|
|
83
84
|
nameFormat: "LAST First",
|
|
84
|
-
nationalityFormat:
|
|
85
|
+
nationalityFormat: u,
|
|
85
86
|
seedPosition: "after-country",
|
|
86
|
-
seedFormat:
|
|
87
|
+
seedFormat: f,
|
|
87
88
|
entryFormat: "parens",
|
|
88
89
|
gameScoreSeparator: "/",
|
|
89
90
|
setScoreSeparator: " ",
|
|
90
91
|
retirementLabel: "Ab",
|
|
91
92
|
walkoverLabel: "w/o",
|
|
92
|
-
roundLabels:
|
|
93
|
-
renderStyle:
|
|
94
|
-
page: { ...
|
|
93
|
+
roundLabels: s,
|
|
94
|
+
renderStyle: m,
|
|
95
|
+
page: { ...c }
|
|
95
96
|
},
|
|
96
97
|
australianOpen: {
|
|
97
|
-
nameFormat:
|
|
98
|
+
nameFormat: l,
|
|
98
99
|
nationalityFormat: "parens",
|
|
99
100
|
seedPosition: "after-name",
|
|
100
|
-
seedFormat:
|
|
101
|
+
seedFormat: f,
|
|
101
102
|
entryFormat: "hyphen",
|
|
102
103
|
gameScoreSeparator: "/",
|
|
103
104
|
setScoreSeparator: " ",
|
|
104
105
|
retirementLabel: "Ret.",
|
|
105
106
|
walkoverLabel: "w/o",
|
|
106
|
-
roundLabels:
|
|
107
|
-
renderStyle:
|
|
107
|
+
roundLabels: r,
|
|
108
|
+
renderStyle: m,
|
|
108
109
|
page: {
|
|
109
|
-
...
|
|
110
|
+
...c,
|
|
110
111
|
pageSize: "letter",
|
|
111
112
|
orientation: "portrait"
|
|
112
113
|
}
|
|
113
114
|
},
|
|
114
115
|
atp: {
|
|
115
|
-
nameFormat:
|
|
116
|
-
nationalityFormat:
|
|
117
|
-
seedPosition:
|
|
116
|
+
nameFormat: l,
|
|
117
|
+
nationalityFormat: u,
|
|
118
|
+
seedPosition: d,
|
|
118
119
|
seedFormat: "bare",
|
|
119
120
|
entryFormat: "bare",
|
|
120
121
|
gameScoreSeparator: "none",
|
|
121
122
|
setScoreSeparator: " ",
|
|
122
123
|
retirementLabel: "RET",
|
|
123
124
|
walkoverLabel: "W/O",
|
|
124
|
-
roundLabels:
|
|
125
|
-
renderStyle:
|
|
126
|
-
page: { ...
|
|
125
|
+
roundLabels: r,
|
|
126
|
+
renderStyle: m,
|
|
127
|
+
page: { ...c }
|
|
127
128
|
},
|
|
128
129
|
wta: {
|
|
129
|
-
nameFormat:
|
|
130
|
-
nationalityFormat:
|
|
131
|
-
seedPosition:
|
|
130
|
+
nameFormat: l,
|
|
131
|
+
nationalityFormat: u,
|
|
132
|
+
seedPosition: d,
|
|
132
133
|
seedFormat: "bare",
|
|
133
134
|
entryFormat: "bare",
|
|
134
135
|
gameScoreSeparator: "none",
|
|
135
136
|
setScoreSeparator: " ",
|
|
136
137
|
retirementLabel: "RET",
|
|
137
138
|
walkoverLabel: "W/O",
|
|
138
|
-
roundLabels:
|
|
139
|
-
renderStyle:
|
|
140
|
-
page: { ...
|
|
139
|
+
roundLabels: r,
|
|
140
|
+
renderStyle: m,
|
|
141
|
+
page: { ...c }
|
|
141
142
|
},
|
|
142
143
|
atpFinals: {
|
|
143
|
-
nameFormat:
|
|
144
|
+
nameFormat: l,
|
|
144
145
|
nationalityFormat: "parens",
|
|
145
|
-
seedPosition:
|
|
146
|
-
seedFormat:
|
|
146
|
+
seedPosition: d,
|
|
147
|
+
seedFormat: f,
|
|
147
148
|
entryFormat: "bare",
|
|
148
|
-
gameScoreSeparator:
|
|
149
|
+
gameScoreSeparator: p,
|
|
149
150
|
setScoreSeparator: " ",
|
|
150
151
|
retirementLabel: "RET",
|
|
151
152
|
walkoverLabel: "W/O",
|
|
152
|
-
roundLabels:
|
|
153
|
+
roundLabels: r,
|
|
153
154
|
renderStyle: "round-robin",
|
|
154
155
|
page: {
|
|
155
|
-
...
|
|
156
|
+
...c,
|
|
156
157
|
orientation: "landscape"
|
|
157
158
|
}
|
|
158
159
|
},
|
|
159
160
|
itfJunior: {
|
|
160
|
-
nameFormat:
|
|
161
|
-
nationalityFormat:
|
|
162
|
-
seedPosition:
|
|
163
|
-
seedFormat:
|
|
161
|
+
nameFormat: l,
|
|
162
|
+
nationalityFormat: u,
|
|
163
|
+
seedPosition: d,
|
|
164
|
+
seedFormat: f,
|
|
164
165
|
entryFormat: "bare",
|
|
165
|
-
gameScoreSeparator:
|
|
166
|
+
gameScoreSeparator: p,
|
|
166
167
|
setScoreSeparator: " ",
|
|
167
168
|
retirementLabel: "Ret.",
|
|
168
169
|
walkoverLabel: "w/o",
|
|
169
|
-
roundLabels:
|
|
170
|
-
renderStyle:
|
|
171
|
-
page: { ...
|
|
170
|
+
roundLabels: r,
|
|
171
|
+
renderStyle: m,
|
|
172
|
+
page: { ...c }
|
|
172
173
|
},
|
|
173
174
|
lta: {
|
|
174
|
-
nameFormat:
|
|
175
|
-
nationalityFormat:
|
|
176
|
-
seedPosition:
|
|
177
|
-
seedFormat:
|
|
175
|
+
nameFormat: l,
|
|
176
|
+
nationalityFormat: u,
|
|
177
|
+
seedPosition: d,
|
|
178
|
+
seedFormat: f,
|
|
178
179
|
entryFormat: "bare",
|
|
179
|
-
gameScoreSeparator:
|
|
180
|
+
gameScoreSeparator: p,
|
|
180
181
|
setScoreSeparator: " ",
|
|
181
182
|
retirementLabel: "Ret.",
|
|
182
183
|
walkoverLabel: "w/o",
|
|
183
|
-
roundLabels:
|
|
184
|
-
renderStyle:
|
|
185
|
-
page: { ...
|
|
184
|
+
roundLabels: o,
|
|
185
|
+
renderStyle: m,
|
|
186
|
+
page: { ...c }
|
|
186
187
|
},
|
|
187
188
|
usta: {
|
|
188
|
-
nameFormat:
|
|
189
|
-
nationalityFormat:
|
|
190
|
-
seedPosition:
|
|
191
|
-
seedFormat:
|
|
189
|
+
nameFormat: l,
|
|
190
|
+
nationalityFormat: u,
|
|
191
|
+
seedPosition: d,
|
|
192
|
+
seedFormat: f,
|
|
192
193
|
entryFormat: "bare",
|
|
193
|
-
gameScoreSeparator:
|
|
194
|
+
gameScoreSeparator: p,
|
|
194
195
|
setScoreSeparator: " ",
|
|
195
196
|
retirementLabel: "Ret.",
|
|
196
197
|
walkoverLabel: "W/O",
|
|
197
|
-
roundLabels:
|
|
198
|
-
renderStyle:
|
|
199
|
-
page: { ...
|
|
198
|
+
roundLabels: r,
|
|
199
|
+
renderStyle: m,
|
|
200
|
+
page: { ...c }
|
|
200
201
|
}
|
|
201
202
|
};
|
|
202
|
-
function
|
|
203
|
-
return
|
|
203
|
+
function g(e) {
|
|
204
|
+
return h[e] || h.itfJunior;
|
|
204
205
|
}
|
|
205
|
-
function
|
|
206
|
+
function _(e, t) {
|
|
206
207
|
return {
|
|
207
|
-
...
|
|
208
|
+
...g(e),
|
|
208
209
|
...t
|
|
209
210
|
};
|
|
210
211
|
}
|
|
211
212
|
//#endregion
|
|
212
213
|
//#region src/config/compositionCatalog.ts
|
|
213
|
-
var
|
|
214
|
-
[
|
|
215
|
-
id:
|
|
214
|
+
var v = "itfJunior", y = "combined-tour", b = "grand-slam", x = "officials-signoff", S = {
|
|
215
|
+
[b]: {
|
|
216
|
+
id: b,
|
|
216
217
|
name: "Grand Slam",
|
|
217
218
|
description: "Minimal chrome — large tournament name, timestamp footer",
|
|
218
|
-
category:
|
|
219
|
+
category: b,
|
|
219
220
|
tier: 1,
|
|
220
|
-
header: { layout:
|
|
221
|
+
header: { layout: b },
|
|
221
222
|
footer: {
|
|
222
223
|
layout: "standard",
|
|
223
224
|
showPageNumbers: !0,
|
|
@@ -229,9 +230,9 @@ var _ = "itfJunior", v = "combined-tour", y = "grand-slam", b = "officials-signo
|
|
|
229
230
|
id: "wimbledon",
|
|
230
231
|
name: "Wimbledon",
|
|
231
232
|
description: "Green/purple Grand Slam style with crest",
|
|
232
|
-
category:
|
|
233
|
+
category: b,
|
|
233
234
|
tier: 1,
|
|
234
|
-
header: { layout:
|
|
235
|
+
header: { layout: b },
|
|
235
236
|
footer: {
|
|
236
237
|
layout: "standard",
|
|
237
238
|
showPageNumbers: !0,
|
|
@@ -243,11 +244,11 @@ var _ = "itfJunior", v = "combined-tour", y = "grand-slam", b = "officials-signo
|
|
|
243
244
|
id: "australian-open",
|
|
244
245
|
name: "Australian Open",
|
|
245
246
|
description: "Grand Slam with seedings + prize money footer",
|
|
246
|
-
category:
|
|
247
|
+
category: b,
|
|
247
248
|
tier: 2,
|
|
248
|
-
header: { layout:
|
|
249
|
+
header: { layout: b },
|
|
249
250
|
footer: {
|
|
250
|
-
layout:
|
|
251
|
+
layout: y,
|
|
251
252
|
showPageNumbers: !0,
|
|
252
253
|
showTimestamp: !0
|
|
253
254
|
},
|
|
@@ -261,11 +262,11 @@ var _ = "itfJunior", v = "combined-tour", y = "grand-slam", b = "officials-signo
|
|
|
261
262
|
tier: 2,
|
|
262
263
|
header: { layout: "wta-tour" },
|
|
263
264
|
footer: {
|
|
264
|
-
layout:
|
|
265
|
+
layout: y,
|
|
265
266
|
showPageNumbers: !1,
|
|
266
267
|
showTimestamp: !0
|
|
267
268
|
},
|
|
268
|
-
drawFormatPreset:
|
|
269
|
+
drawFormatPreset: v
|
|
269
270
|
},
|
|
270
271
|
"wta-1000": {
|
|
271
272
|
id: "wta-1000",
|
|
@@ -275,11 +276,11 @@ var _ = "itfJunior", v = "combined-tour", y = "grand-slam", b = "officials-signo
|
|
|
275
276
|
tier: 2,
|
|
276
277
|
header: { layout: "wta-tour" },
|
|
277
278
|
footer: {
|
|
278
|
-
layout:
|
|
279
|
+
layout: y,
|
|
279
280
|
showPageNumbers: !1,
|
|
280
281
|
showTimestamp: !0
|
|
281
282
|
},
|
|
282
|
-
drawFormatPreset:
|
|
283
|
+
drawFormatPreset: v
|
|
283
284
|
},
|
|
284
285
|
"atp-250": {
|
|
285
286
|
id: "atp-250",
|
|
@@ -289,11 +290,11 @@ var _ = "itfJunior", v = "combined-tour", y = "grand-slam", b = "officials-signo
|
|
|
289
290
|
tier: 2,
|
|
290
291
|
header: { layout: "wta-tour" },
|
|
291
292
|
footer: {
|
|
292
|
-
layout:
|
|
293
|
+
layout: y,
|
|
293
294
|
showPageNumbers: !1,
|
|
294
295
|
showTimestamp: !0
|
|
295
296
|
},
|
|
296
|
-
drawFormatPreset:
|
|
297
|
+
drawFormatPreset: v
|
|
297
298
|
},
|
|
298
299
|
"atp-finals": {
|
|
299
300
|
id: "atp-finals",
|
|
@@ -301,12 +302,12 @@ var _ = "itfJunior", v = "combined-tour", y = "grand-slam", b = "officials-signo
|
|
|
301
302
|
description: "Full official sign-off with signature lines",
|
|
302
303
|
category: "tour",
|
|
303
304
|
tier: 3,
|
|
304
|
-
header: { layout:
|
|
305
|
+
header: { layout: b },
|
|
305
306
|
footer: {
|
|
306
|
-
layout:
|
|
307
|
+
layout: x,
|
|
307
308
|
showTimestamp: !0
|
|
308
309
|
},
|
|
309
|
-
drawFormatPreset:
|
|
310
|
+
drawFormatPreset: v
|
|
310
311
|
},
|
|
311
312
|
"itf-junior": {
|
|
312
313
|
id: "itf-junior",
|
|
@@ -316,11 +317,11 @@ var _ = "itfJunior", v = "combined-tour", y = "grand-slam", b = "officials-signo
|
|
|
316
317
|
tier: 3,
|
|
317
318
|
header: { layout: "itf" },
|
|
318
319
|
footer: {
|
|
319
|
-
layout:
|
|
320
|
+
layout: x,
|
|
320
321
|
showPageNumbers: !0,
|
|
321
322
|
showTimestamp: !0
|
|
322
323
|
},
|
|
323
|
-
drawFormatPreset:
|
|
324
|
+
drawFormatPreset: v
|
|
324
325
|
},
|
|
325
326
|
"itf-pro-circuit": {
|
|
326
327
|
id: "itf-pro-circuit",
|
|
@@ -330,11 +331,11 @@ var _ = "itfJunior", v = "combined-tour", y = "grand-slam", b = "officials-signo
|
|
|
330
331
|
tier: 2,
|
|
331
332
|
header: { layout: "itf" },
|
|
332
333
|
footer: {
|
|
333
|
-
layout:
|
|
334
|
+
layout: y,
|
|
334
335
|
showPageNumbers: !0,
|
|
335
336
|
showTimestamp: !0
|
|
336
337
|
},
|
|
337
|
-
drawFormatPreset:
|
|
338
|
+
drawFormatPreset: v
|
|
338
339
|
},
|
|
339
340
|
"national-federation": {
|
|
340
341
|
id: "national-federation",
|
|
@@ -344,7 +345,7 @@ var _ = "itfJunior", v = "combined-tour", y = "grand-slam", b = "officials-signo
|
|
|
344
345
|
tier: 3,
|
|
345
346
|
header: { layout: "national-federation" },
|
|
346
347
|
footer: {
|
|
347
|
-
layout:
|
|
348
|
+
layout: x,
|
|
348
349
|
showPageNumbers: !0,
|
|
349
350
|
showTimestamp: !0
|
|
350
351
|
},
|
|
@@ -356,13 +357,13 @@ var _ = "itfJunior", v = "combined-tour", y = "grand-slam", b = "officials-signo
|
|
|
356
357
|
description: "Mirrored bracket layout, team logos, minimal footer",
|
|
357
358
|
category: "collegiate",
|
|
358
359
|
tier: 1,
|
|
359
|
-
header: { layout:
|
|
360
|
+
header: { layout: b },
|
|
360
361
|
footer: {
|
|
361
362
|
layout: "standard",
|
|
362
363
|
showPageNumbers: !0,
|
|
363
364
|
showTimestamp: !0
|
|
364
365
|
},
|
|
365
|
-
drawFormatPreset:
|
|
366
|
+
drawFormatPreset: v
|
|
366
367
|
},
|
|
367
368
|
"club-basic": {
|
|
368
369
|
id: "club-basic",
|
|
@@ -376,18 +377,18 @@ var _ = "itfJunior", v = "combined-tour", y = "grand-slam", b = "officials-signo
|
|
|
376
377
|
showPageNumbers: !0,
|
|
377
378
|
showTimestamp: !0
|
|
378
379
|
},
|
|
379
|
-
drawFormatPreset:
|
|
380
|
+
drawFormatPreset: v
|
|
380
381
|
}
|
|
381
382
|
};
|
|
382
|
-
function
|
|
383
|
-
return
|
|
383
|
+
function C(e) {
|
|
384
|
+
return S[e];
|
|
384
385
|
}
|
|
385
386
|
function ee(e) {
|
|
386
|
-
let t = Object.values(
|
|
387
|
+
let t = Object.values(S);
|
|
387
388
|
return e ? t.filter((t) => t.category === e) : t;
|
|
388
389
|
}
|
|
389
390
|
function te(e, t, n) {
|
|
390
|
-
let r =
|
|
391
|
+
let r = S[e] || S["club-basic"];
|
|
391
392
|
return {
|
|
392
393
|
header: {
|
|
393
394
|
...r.header,
|
|
@@ -401,7 +402,7 @@ function te(e, t, n) {
|
|
|
401
402
|
}
|
|
402
403
|
//#endregion
|
|
403
404
|
//#region src/config/factSheetCatalog.ts
|
|
404
|
-
var
|
|
405
|
+
var w = "tournament-header", T = "contacts", E = "events", D = "entry-info", O = "venue-info", k = "accommodation", A = "transportation", j = "hospitality", ne = "medical", re = "regulations", ie = "prize-money", ae = "officials", oe = "sponsors", se = "social-events", ce = "custom-notes";
|
|
405
406
|
function M(e, t = !0, n) {
|
|
406
407
|
return {
|
|
407
408
|
type: e,
|
|
@@ -409,8 +410,7 @@ function M(e, t = !0, n) {
|
|
|
409
410
|
...n && { title: n }
|
|
410
411
|
};
|
|
411
412
|
}
|
|
412
|
-
var
|
|
413
|
-
M(C),
|
|
413
|
+
var le = [
|
|
414
414
|
M(w),
|
|
415
415
|
M(T),
|
|
416
416
|
M(E),
|
|
@@ -424,15 +424,16 @@ var ce = [
|
|
|
424
424
|
M(ie),
|
|
425
425
|
M(ae),
|
|
426
426
|
M(oe),
|
|
427
|
-
M(se)
|
|
428
|
-
|
|
427
|
+
M(se),
|
|
428
|
+
M(ce)
|
|
429
|
+
], ue = {
|
|
429
430
|
"itf-junior": {
|
|
430
431
|
id: "itf-junior",
|
|
431
432
|
name: "ITF Junior",
|
|
432
433
|
description: "Full fact sheet with all sections — ITF header style",
|
|
433
434
|
category: "itf",
|
|
434
435
|
headerLayout: "itf",
|
|
435
|
-
sections:
|
|
436
|
+
sections: le
|
|
436
437
|
},
|
|
437
438
|
"itf-pro-circuit": {
|
|
438
439
|
id: "itf-pro-circuit",
|
|
@@ -441,15 +442,15 @@ var ce = [
|
|
|
441
442
|
category: "itf",
|
|
442
443
|
headerLayout: "itf",
|
|
443
444
|
sections: [
|
|
444
|
-
M(C),
|
|
445
445
|
M(w),
|
|
446
446
|
M(T),
|
|
447
447
|
M(E),
|
|
448
448
|
M(D),
|
|
449
|
-
M(
|
|
449
|
+
M(O),
|
|
450
450
|
M(ie),
|
|
451
|
-
M(
|
|
452
|
-
M(
|
|
451
|
+
M(ae),
|
|
452
|
+
M(re),
|
|
453
|
+
M(ce)
|
|
453
454
|
]
|
|
454
455
|
},
|
|
455
456
|
"national-federation": {
|
|
@@ -458,7 +459,7 @@ var ce = [
|
|
|
458
459
|
description: "Detailed national federation fact sheet with all logistics",
|
|
459
460
|
category: "national",
|
|
460
461
|
headerLayout: "national-federation",
|
|
461
|
-
sections:
|
|
462
|
+
sections: le
|
|
462
463
|
},
|
|
463
464
|
"tour-atp-wta": {
|
|
464
465
|
id: "tour-atp-wta",
|
|
@@ -467,16 +468,16 @@ var ce = [
|
|
|
467
468
|
category: "tour",
|
|
468
469
|
headerLayout: "wta-tour",
|
|
469
470
|
sections: [
|
|
470
|
-
M(C),
|
|
471
471
|
M(w),
|
|
472
472
|
M(T),
|
|
473
|
-
M(
|
|
473
|
+
M(E),
|
|
474
474
|
M(ie),
|
|
475
475
|
M(ae),
|
|
476
|
-
M(O),
|
|
477
|
-
M(k),
|
|
478
476
|
M(oe),
|
|
479
|
-
M(
|
|
477
|
+
M(k),
|
|
478
|
+
M(A),
|
|
479
|
+
M(se),
|
|
480
|
+
M(ce)
|
|
480
481
|
]
|
|
481
482
|
},
|
|
482
483
|
"club-basic": {
|
|
@@ -486,25 +487,33 @@ var ce = [
|
|
|
486
487
|
category: "club",
|
|
487
488
|
headerLayout: "minimal",
|
|
488
489
|
sections: [
|
|
489
|
-
M(C),
|
|
490
490
|
M(w),
|
|
491
491
|
M(T),
|
|
492
492
|
M(E),
|
|
493
493
|
M(D),
|
|
494
|
-
M(
|
|
494
|
+
M(O),
|
|
495
|
+
M(ce)
|
|
495
496
|
]
|
|
496
497
|
}
|
|
497
498
|
};
|
|
498
|
-
function ue(e) {
|
|
499
|
-
return le[e];
|
|
500
|
-
}
|
|
501
499
|
function de(e) {
|
|
502
|
-
|
|
500
|
+
return ue[e];
|
|
501
|
+
}
|
|
502
|
+
function fe(e) {
|
|
503
|
+
let t = Object.values(ue);
|
|
503
504
|
return e ? t.filter((t) => t.category === e) : t;
|
|
504
505
|
}
|
|
505
506
|
//#endregion
|
|
507
|
+
//#region src/core/sideOrderedDrawPositions.ts
|
|
508
|
+
function pe(e, t) {
|
|
509
|
+
let n = e?.sides ?? [], r = [1, 2].map((e) => n.find((t) => t?.sideNumber === e)?.drawPosition);
|
|
510
|
+
if (r.some(Boolean)) return r;
|
|
511
|
+
let i = t?.[e?.roundNumber]?.pairedDrawPositions?.[(e?.roundPosition ?? 0) - 1];
|
|
512
|
+
return Array.isArray(i) && i.some(Boolean) ? [i[0] ?? void 0, i[1] ?? void 0] : e?.drawPositions ?? [];
|
|
513
|
+
}
|
|
514
|
+
//#endregion
|
|
506
515
|
//#region src/core/winnerDrawPosition.ts
|
|
507
|
-
function
|
|
516
|
+
function me(e) {
|
|
508
517
|
if (!e?.winningSide) return;
|
|
509
518
|
let t = e.sides?.find((t) => t?.sideNumber === e.winningSide)?.drawPosition;
|
|
510
519
|
if (t) return t;
|
|
@@ -527,14 +536,14 @@ function N(e) {
|
|
|
527
536
|
});
|
|
528
537
|
}
|
|
529
538
|
let a = [];
|
|
530
|
-
for (let e of r) for (let
|
|
531
|
-
roundNumber:
|
|
532
|
-
roundPosition:
|
|
533
|
-
drawPositions: n
|
|
534
|
-
winnerDrawPosition:
|
|
535
|
-
score:
|
|
536
|
-
winningSide:
|
|
537
|
-
matchUpStatus:
|
|
539
|
+
for (let e of r) for (let r of t[e] || []) a.push({
|
|
540
|
+
roundNumber: r.roundNumber,
|
|
541
|
+
roundPosition: r.roundPosition,
|
|
542
|
+
drawPositions: pe(r, n),
|
|
543
|
+
winnerDrawPosition: me(r),
|
|
544
|
+
score: r.score?.scoreStringSide1 || "",
|
|
545
|
+
winningSide: r.winningSide,
|
|
546
|
+
matchUpStatus: r.matchUpStatus
|
|
538
547
|
});
|
|
539
548
|
let o = {};
|
|
540
549
|
for (let e of r) {
|
|
@@ -564,7 +573,7 @@ function P(e, t) {
|
|
|
564
573
|
}
|
|
565
574
|
//#endregion
|
|
566
575
|
//#region src/layout/fonts.ts
|
|
567
|
-
var
|
|
576
|
+
var he = {
|
|
568
577
|
REGULAR: "helvetica",
|
|
569
578
|
BOLD: "helvetica"
|
|
570
579
|
}, F = {
|
|
@@ -578,39 +587,39 @@ var pe = {
|
|
|
578
587
|
BODY: 8,
|
|
579
588
|
SMALL: 7,
|
|
580
589
|
TINY: 6
|
|
581
|
-
},
|
|
590
|
+
}, ge = /* @__PURE__ */ new WeakMap(), _e = [
|
|
582
591
|
"normal",
|
|
583
592
|
"bold",
|
|
584
593
|
"italic",
|
|
585
594
|
"bolditalic"
|
|
586
595
|
];
|
|
587
|
-
function
|
|
588
|
-
if (!t?.family || !t?.normal) return
|
|
589
|
-
for (let n of
|
|
596
|
+
function ve(e, t) {
|
|
597
|
+
if (!t?.family || !t?.normal) return he.REGULAR;
|
|
598
|
+
for (let n of _e) {
|
|
590
599
|
let r = t[n] ?? t.normal, i = `${t.family}-${n}.ttf`;
|
|
591
600
|
e.addFileToVFS(i, r), e.addFont(i, t.family, n);
|
|
592
601
|
}
|
|
593
|
-
return
|
|
602
|
+
return ge.set(e, t.family), t.family;
|
|
594
603
|
}
|
|
595
|
-
function _e(e) {
|
|
596
|
-
return me.get(e) ?? pe.REGULAR;
|
|
597
|
-
}
|
|
598
|
-
var ve;
|
|
599
604
|
function ye(e) {
|
|
600
|
-
|
|
605
|
+
return ge.get(e) ?? he.REGULAR;
|
|
606
|
+
}
|
|
607
|
+
var be;
|
|
608
|
+
function xe(e) {
|
|
609
|
+
be = e;
|
|
601
610
|
}
|
|
602
|
-
function
|
|
603
|
-
return
|
|
611
|
+
function Se() {
|
|
612
|
+
return be;
|
|
604
613
|
}
|
|
605
614
|
function L(e) {
|
|
606
|
-
return
|
|
615
|
+
return be ? ve(e, be) : he.REGULAR;
|
|
607
616
|
}
|
|
608
617
|
function R(e, t, n = F.NORMAL) {
|
|
609
|
-
e.setFont(
|
|
618
|
+
e.setFont(ye(e), n), e.setFontSize(t);
|
|
610
619
|
}
|
|
611
620
|
//#endregion
|
|
612
621
|
//#region src/composition/page.ts
|
|
613
|
-
function
|
|
622
|
+
function Ce(t, n) {
|
|
614
623
|
let r = t.orientation;
|
|
615
624
|
r === "auto" && (r = n && n >= 32 ? "landscape" : "portrait");
|
|
616
625
|
let i = new e({
|
|
@@ -618,7 +627,7 @@ function xe(t, n) {
|
|
|
618
627
|
format: t.pageSize,
|
|
619
628
|
unit: "mm"
|
|
620
629
|
});
|
|
621
|
-
return t.font ?
|
|
630
|
+
return t.font ? ve(i, t.font) : L(i), i;
|
|
622
631
|
}
|
|
623
632
|
function z(e, t, n, r) {
|
|
624
633
|
let i = e.internal.pageSize.getWidth(), a = e.internal.pageSize.getHeight(), { margins: o } = t;
|
|
@@ -632,7 +641,7 @@ function z(e, t, n, r) {
|
|
|
632
641
|
pageHeight: a
|
|
633
642
|
};
|
|
634
643
|
}
|
|
635
|
-
function
|
|
644
|
+
function we() {
|
|
636
645
|
return {
|
|
637
646
|
pageSize: "a4",
|
|
638
647
|
orientation: "auto",
|
|
@@ -648,15 +657,15 @@ function Se() {
|
|
|
648
657
|
//#region src/composition/headerLayouts.ts
|
|
649
658
|
function B(e, t, n) {
|
|
650
659
|
switch (t.layout) {
|
|
651
|
-
case "grand-slam": return
|
|
652
|
-
case "itf": return
|
|
653
|
-
case "minimal": return
|
|
654
|
-
case "wta-tour": return
|
|
655
|
-
case "national-federation": return
|
|
660
|
+
case "grand-slam": return Te(e, t, n);
|
|
661
|
+
case "itf": return Ee(e, t, n);
|
|
662
|
+
case "minimal": return De(e, t, n);
|
|
663
|
+
case "wta-tour": return Oe(e, t, n);
|
|
664
|
+
case "national-federation": return ke(e, t, n);
|
|
656
665
|
case "none": return 0;
|
|
657
666
|
}
|
|
658
667
|
}
|
|
659
|
-
function
|
|
668
|
+
function Te(e, t, n) {
|
|
660
669
|
let { margins: r } = n, i = e.internal.pageSize.getWidth(), a = i - r.right, o = r.top;
|
|
661
670
|
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);
|
|
662
671
|
let s = [];
|
|
@@ -668,7 +677,7 @@ function Ce(e, t, n) {
|
|
|
668
677
|
e.text(t, a, r.top + n * 4, { align: "right" });
|
|
669
678
|
}), o += 2, e.setDrawColor(0), e.setLineWidth(.5), e.line(r.left, o, a, o), o += 3, o - r.top;
|
|
670
679
|
}
|
|
671
|
-
function
|
|
680
|
+
function Ee(e, t, n) {
|
|
672
681
|
let { margins: r } = n, i = e.internal.pageSize.getWidth() - r.right, a = r.top;
|
|
673
682
|
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);
|
|
674
683
|
let o = [];
|
|
@@ -678,13 +687,13 @@ function we(e, t, n) {
|
|
|
678
687
|
let s = [];
|
|
679
688
|
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;
|
|
680
689
|
}
|
|
681
|
-
function
|
|
690
|
+
function De(e, t, n) {
|
|
682
691
|
let { margins: r } = n, i = r.top;
|
|
683
692
|
R(e, I.SUBTITLE, F.BOLD), e.text(t.tournamentName, r.left, i);
|
|
684
693
|
let a = e.getTextWidth(t.tournamentName);
|
|
685
694
|
return t.subtitle && (R(e, I.BODY, F.NORMAL), e.text(` - ${t.subtitle}`, r.left + a, i)), i += 6, i - r.top;
|
|
686
695
|
}
|
|
687
|
-
function
|
|
696
|
+
function Oe(e, t, n) {
|
|
688
697
|
let { margins: r } = n, i = e.internal.pageSize.getWidth(), a = i - r.right, o = i / 2, s = r.top;
|
|
689
698
|
if (t.leftLogoBase64) try {
|
|
690
699
|
e.addImage(t.leftLogoBase64, "PNG", r.left, s - 2, 12, 12);
|
|
@@ -706,7 +715,7 @@ function Ee(e, t, n) {
|
|
|
706
715
|
}
|
|
707
716
|
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;
|
|
708
717
|
}
|
|
709
|
-
function
|
|
718
|
+
function ke(e, t, n) {
|
|
710
719
|
let { margins: r } = n, i = e.internal.pageSize.getWidth() - r.right, a = r.top;
|
|
711
720
|
if (t.rightLogoBase64) try {
|
|
712
721
|
e.addImage(t.rightLogoBase64, "PNG", i - 14, a - 2, 14, 14);
|
|
@@ -717,7 +726,7 @@ function De(e, t, n) {
|
|
|
717
726
|
}
|
|
718
727
|
//#endregion
|
|
719
728
|
//#region src/composition/tournamentBridge.ts
|
|
720
|
-
function
|
|
729
|
+
function Ae(e) {
|
|
721
730
|
let t = e.person;
|
|
722
731
|
if (t?.standardFamilyName) {
|
|
723
732
|
let e = t.standardGivenName || "";
|
|
@@ -725,62 +734,62 @@ function Oe(e) {
|
|
|
725
734
|
}
|
|
726
735
|
return e.participantName || "";
|
|
727
736
|
}
|
|
728
|
-
function
|
|
737
|
+
function je(e, t) {
|
|
729
738
|
return e.find((e) => e.participantRole === t);
|
|
730
739
|
}
|
|
731
|
-
function
|
|
740
|
+
function Me(e, t) {
|
|
732
741
|
return e.find((e) => e.participantRole === "OFFICIAL" && e.participantRoleResponsibilities?.some((e) => e.toUpperCase().includes(t.toUpperCase())));
|
|
733
742
|
}
|
|
734
|
-
function
|
|
743
|
+
function Ne(e) {
|
|
735
744
|
let t = (e.venues?.[0])?.addresses?.[0], n = [];
|
|
736
745
|
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(", ");
|
|
737
746
|
}
|
|
738
|
-
function
|
|
747
|
+
function Pe(e) {
|
|
739
748
|
return e.venues?.[0]?.addresses?.[0]?.city;
|
|
740
749
|
}
|
|
741
|
-
function
|
|
750
|
+
function Fe(e) {
|
|
742
751
|
return e.venues?.[0]?.addresses?.[0]?.countryCode || e.hostCountryCode;
|
|
743
752
|
}
|
|
744
|
-
function
|
|
753
|
+
function Ie(e) {
|
|
745
754
|
if (e.tournamentTier) {
|
|
746
755
|
let t = e.tournamentTier;
|
|
747
756
|
return t.system ? t.system + " " + (t.value || "") : t.value;
|
|
748
757
|
}
|
|
749
758
|
return e.tournamentLevel;
|
|
750
759
|
}
|
|
751
|
-
function
|
|
760
|
+
function Le(e) {
|
|
752
761
|
let t = e.totalPrizeMoney?.[0];
|
|
753
762
|
if (t) return String(t.amount);
|
|
754
763
|
}
|
|
755
|
-
function
|
|
764
|
+
function Re(e) {
|
|
756
765
|
return e.totalPrizeMoney?.[0]?.currencyCode;
|
|
757
766
|
}
|
|
758
|
-
function
|
|
759
|
-
let { layout: n = "itf", sectionLabel: r, overrides: i } = t, a = e.participants || [], o =
|
|
767
|
+
function ze(e, t = {}) {
|
|
768
|
+
let { layout: n = "itf", sectionLabel: r, overrides: i } = t, a = e.participants || [], o = je(a, "DIRECTOR"), s = Me(a, "REFEREE"), c = Me(a, "CHIEF_UMPIRE") || Me(a, "UMPIRE"), l = Me(a, "SUPERVISOR") || s;
|
|
760
769
|
return {
|
|
761
770
|
layout: n,
|
|
762
771
|
tournamentName: e.formalName || e.tournamentName || "",
|
|
763
772
|
startDate: e.startDate,
|
|
764
773
|
endDate: e.endDate,
|
|
765
|
-
location:
|
|
766
|
-
city:
|
|
767
|
-
country:
|
|
774
|
+
location: Ne(e),
|
|
775
|
+
city: Pe(e),
|
|
776
|
+
country: Fe(e),
|
|
768
777
|
surface: e.surfaceCategory,
|
|
769
|
-
grade:
|
|
778
|
+
grade: Ie(e),
|
|
770
779
|
tournamentId: e.tournamentId,
|
|
771
|
-
organizer: o ?
|
|
772
|
-
supervisor: l ?
|
|
773
|
-
chiefUmpire: c ?
|
|
774
|
-
prizeMoney:
|
|
775
|
-
currency:
|
|
780
|
+
organizer: o ? Ae(o) : void 0,
|
|
781
|
+
supervisor: l ? Ae(l) : void 0,
|
|
782
|
+
chiefUmpire: c ? Ae(c) : void 0,
|
|
783
|
+
prizeMoney: Le(e),
|
|
784
|
+
currency: Re(e),
|
|
776
785
|
sectionLabel: r,
|
|
777
786
|
...i
|
|
778
787
|
};
|
|
779
788
|
}
|
|
780
|
-
function
|
|
789
|
+
function Be(e, t = {}) {
|
|
781
790
|
let { layout: n = "standard", seedAssignments: r, prizeMoney: i, overrides: a } = t, o = (e.participants || []).filter((e) => e.participantRole === "OFFICIAL" || e.participantRole === "DIRECTOR").map((e) => ({
|
|
782
791
|
role: e.participantRoleResponsibilities?.[0] || e.participantRole || "Official",
|
|
783
|
-
name:
|
|
792
|
+
name: Ae(e)
|
|
784
793
|
}));
|
|
785
794
|
return {
|
|
786
795
|
layout: n,
|
|
@@ -795,26 +804,26 @@ function Re(e, t = {}) {
|
|
|
795
804
|
}
|
|
796
805
|
//#endregion
|
|
797
806
|
//#region src/core/seedingBasis.ts
|
|
798
|
-
var
|
|
807
|
+
var Ve = [
|
|
799
808
|
"†",
|
|
800
809
|
"‡",
|
|
801
810
|
"§",
|
|
802
811
|
"¶"
|
|
803
|
-
],
|
|
812
|
+
], He = {
|
|
804
813
|
ORGANISER_DISCRETION: "organiser discretion",
|
|
805
814
|
PROTECTED_RANKING: "protected ranking",
|
|
806
815
|
RANKING: "ranking",
|
|
807
816
|
RATING: "rating"
|
|
808
|
-
},
|
|
809
|
-
function
|
|
817
|
+
}, Ue = "RANKING";
|
|
818
|
+
function We(e) {
|
|
810
819
|
let t = /* @__PURE__ */ new Map(), n = e.map((e) => {
|
|
811
820
|
let n = e?.seedingBasis;
|
|
812
|
-
if (!n || n ===
|
|
821
|
+
if (!n || n === Ue) return "";
|
|
813
822
|
let r = t.get(n);
|
|
814
823
|
if (r) return r;
|
|
815
|
-
let i =
|
|
824
|
+
let i = Ve[t.size] ?? Ve[Ve.length - 1];
|
|
816
825
|
return t.set(n, i), i;
|
|
817
|
-
}), r = [...t.entries()].map(([e, t]) => `${t} Additional seed — ${
|
|
826
|
+
}), r = [...t.entries()].map(([e, t]) => `${t} Additional seed — ${He[e] ?? e.toLowerCase()}`);
|
|
818
827
|
return {
|
|
819
828
|
markers: n,
|
|
820
829
|
footnotes: r,
|
|
@@ -823,37 +832,37 @@ function He(e) {
|
|
|
823
832
|
}
|
|
824
833
|
//#endregion
|
|
825
834
|
//#region src/composition/footerLayouts.ts
|
|
826
|
-
function
|
|
835
|
+
function Ge(e, t, n, r) {
|
|
827
836
|
switch (t.layout) {
|
|
828
|
-
case "standard": return
|
|
837
|
+
case "standard": return qe(e, t, n, r);
|
|
829
838
|
case "seedings":
|
|
830
|
-
case "seedings-table": return
|
|
831
|
-
case "prize-money": return
|
|
839
|
+
case "seedings-table": return Je(e, t, n, r);
|
|
840
|
+
case "prize-money": return Ye(e, t, n, r);
|
|
832
841
|
case "officials":
|
|
833
|
-
case "officials-signoff": return
|
|
834
|
-
case "combined-tour": return
|
|
842
|
+
case "officials-signoff": return Xe(e, t, n, r);
|
|
843
|
+
case "combined-tour": return Ze(e, t, n, r);
|
|
835
844
|
case "none": return 0;
|
|
836
845
|
}
|
|
837
846
|
}
|
|
838
|
-
function
|
|
839
|
-
return
|
|
847
|
+
function Ke(e) {
|
|
848
|
+
return We(e.seedAssignments || []).footnotes.length;
|
|
840
849
|
}
|
|
841
850
|
function V(e) {
|
|
842
851
|
switch (e.layout) {
|
|
843
852
|
case "standard": return 8 + (e.notes?.length || 0) * 3;
|
|
844
853
|
case "seedings":
|
|
845
|
-
case "seedings-table": return 12 + Math.ceil((e.seedAssignments?.length || 0) / 2) * 3 +
|
|
854
|
+
case "seedings-table": return 12 + Math.ceil((e.seedAssignments?.length || 0) / 2) * 3 + Ke(e) * 3;
|
|
846
855
|
case "prize-money": return 12 + (e.prizeMoney?.length || 0) * 2.5;
|
|
847
856
|
case "officials":
|
|
848
857
|
case "officials-signoff": return 12 + (e.signatureLines?.length || e.officials?.length || 0) * 5;
|
|
849
858
|
case "combined-tour": {
|
|
850
|
-
let t = (e.seedAssignments?.length || 0) +
|
|
859
|
+
let t = (e.seedAssignments?.length || 0) + Ke(e), n = e.prizeMoney?.length || 0;
|
|
851
860
|
return 16 + Math.max(t * 2.5, n * 2.5) + (e.withdrawals?.length ? 6 : 0);
|
|
852
861
|
}
|
|
853
862
|
case "none": return 0;
|
|
854
863
|
}
|
|
855
864
|
}
|
|
856
|
-
function
|
|
865
|
+
function qe(e, t, n, r) {
|
|
857
866
|
let i = e.internal.pageSize.getWidth(), a = e.internal.pageSize.getHeight(), { margins: o } = n, s = i - o.right, c = a - o.bottom;
|
|
858
867
|
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) {
|
|
859
868
|
R(e, I.TINY, F.ITALIC), e.setTextColor(100);
|
|
@@ -862,10 +871,10 @@ function Ge(e, t, n, r) {
|
|
|
862
871
|
}
|
|
863
872
|
return V(t);
|
|
864
873
|
}
|
|
865
|
-
function
|
|
874
|
+
function Je(e, t, n, r) {
|
|
866
875
|
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;
|
|
867
876
|
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;
|
|
868
|
-
let u = t.seedAssignments || [], d = (s - o.left) / 2, { markers: f, footnotes: p, hasAnnotations: m } =
|
|
877
|
+
let u = t.seedAssignments || [], d = (s - o.left) / 2, { markers: f, footnotes: p, hasAnnotations: m } = We(u);
|
|
869
878
|
R(e, I.TINY, F.NORMAL);
|
|
870
879
|
for (let t = 0; t < u.length; t++) {
|
|
871
880
|
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})` : "", p = f[t] ? ` ${f[t]}` : "";
|
|
@@ -877,9 +886,9 @@ function Ke(e, t, n, r) {
|
|
|
877
886
|
for (let t of p) e.text(t, o.left, l), l += 3;
|
|
878
887
|
R(e, I.TINY, F.NORMAL);
|
|
879
888
|
}
|
|
880
|
-
return
|
|
889
|
+
return Qe(e, t, n, r, l), c;
|
|
881
890
|
}
|
|
882
|
-
function
|
|
891
|
+
function Ye(e, t, n, r) {
|
|
883
892
|
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;
|
|
884
893
|
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;
|
|
885
894
|
let u = t.prizeMoney || [];
|
|
@@ -888,9 +897,9 @@ function qe(e, t, n, r) {
|
|
|
888
897
|
let n = [t.round];
|
|
889
898
|
t.amount && n.push(t.amount), t.points && n.push(`${t.points} pts`), e.text(n.join(" — "), o.left, l), l += 2.5;
|
|
890
899
|
}
|
|
891
|
-
return l += 2,
|
|
900
|
+
return l += 2, Qe(e, t, n, r, l), c;
|
|
892
901
|
}
|
|
893
|
-
function
|
|
902
|
+
function Xe(e, t, n, r) {
|
|
894
903
|
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;
|
|
895
904
|
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);
|
|
896
905
|
let u = t.signatureLines || (t.officials || []).map((e) => ({ role: e })), d = (s - o.left) / Math.min(u.length, 3);
|
|
@@ -901,14 +910,14 @@ function Je(e, t, n, r) {
|
|
|
901
910
|
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);
|
|
902
911
|
}
|
|
903
912
|
let f = Math.ceil(u.length / 3);
|
|
904
|
-
return l += f * 10 + 2,
|
|
913
|
+
return l += f * 10 + 2, Qe(e, t, n, r, l), c;
|
|
905
914
|
}
|
|
906
|
-
function
|
|
915
|
+
function Ze(e, t, n, r) {
|
|
907
916
|
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;
|
|
908
917
|
e.setDrawColor(180), e.setLineWidth(.2), e.line(o.left, l, s, l), l += 3;
|
|
909
918
|
let u = s - o.left, d = o.left, f = o.left + u * .55, p = l, m = l, h = t.seedAssignments || [];
|
|
910
919
|
if (h.length) {
|
|
911
|
-
let { markers: t, footnotes: n, hasAnnotations: r } =
|
|
920
|
+
let { markers: t, footnotes: n, hasAnnotations: r } = We(h);
|
|
912
921
|
if (R(e, I.SMALL, F.BOLD), e.text("Seeded Players", d, p), p += 3, R(e, I.TINY, F.NORMAL), h.forEach((n, r) => {
|
|
913
922
|
let i = n.ranking ? ` (${n.ranking})` : "", a = t[r] ? ` ${t[r]}` : "";
|
|
914
923
|
e.text(`${n.seedValue}. ${n.participantName}${i}${a}`, d, p), p += 2.5;
|
|
@@ -931,9 +940,9 @@ function Ye(e, t, n, r) {
|
|
|
931
940
|
let n = t.withdrawals.map((e) => e.reason ? `${e.name} (${e.reason})` : e.name).join(", ");
|
|
932
941
|
e.text(`Withdrawals: ${n}`, o.left, l, { maxWidth: u }), e.setTextColor(0), l += 3;
|
|
933
942
|
}
|
|
934
|
-
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),
|
|
943
|
+
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), Qe(e, t, n, r, l), c;
|
|
935
944
|
}
|
|
936
|
-
function
|
|
945
|
+
function Qe(e, t, n, r, i) {
|
|
937
946
|
let a = e.internal.pageSize.getWidth(), o = e.internal.pageSize.getHeight(), { margins: s } = n, c = a - s.right, l = o - s.bottom + 2;
|
|
938
947
|
if (R(e, I.TINY, F.NORMAL), e.setTextColor(120), t.showTimestamp && e.text(`Generated ${(/* @__PURE__ */ new Date()).toLocaleDateString()}`, s.left, l), t.releaseDate) {
|
|
939
948
|
let n = t.showTimestamp ? s.left + 50 : s.left;
|
|
@@ -943,21 +952,21 @@ function Xe(e, t, n, r, i) {
|
|
|
943
952
|
}
|
|
944
953
|
//#endregion
|
|
945
954
|
//#region src/composition/seedingsFooter.ts
|
|
946
|
-
var
|
|
947
|
-
function
|
|
955
|
+
var $e = 5, et = 2.5;
|
|
956
|
+
function tt(e, t, n, r) {
|
|
948
957
|
let i = t.seedAssignments;
|
|
949
958
|
if (!i.length) return r;
|
|
950
959
|
let a = n.page.margins, o = e.internal.pageSize.getWidth() - a.left - a.right;
|
|
951
960
|
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;
|
|
952
961
|
let s = Math.ceil(i.length / 2), c = i.slice(0, s), l = i.slice(s), u = o * .25, d = r;
|
|
953
|
-
for (let t = 0; t < Math.max(c.length, l.length); t++) c[t] &&
|
|
962
|
+
for (let t = 0; t < Math.max(c.length, l.length); t++) c[t] && nt(e, c[t], a.left, d, u), l[t] && nt(e, l[t], a.left + u + 4, d, u), d += et;
|
|
954
963
|
return d;
|
|
955
964
|
}
|
|
956
|
-
function
|
|
957
|
-
R(e,
|
|
965
|
+
function nt(e, t, n, r, i) {
|
|
966
|
+
R(e, $e, F.BOLD), e.text(`${t.seedValue}`, n + 4, r, { align: "right" }), R(e, $e, F.NORMAL), e.text(t.participantName, n + 6, r), e.setTextColor(100), e.text(t.nationality, n + 45, r), e.setTextColor(0);
|
|
958
967
|
}
|
|
959
|
-
function
|
|
960
|
-
return e === 0 ? 0 : 4 + Math.ceil(e / 2) *
|
|
968
|
+
function rt(e) {
|
|
969
|
+
return e === 0 ? 0 : 4 + Math.ceil(e / 2) * et;
|
|
961
970
|
}
|
|
962
971
|
//#endregion
|
|
963
972
|
//#region src/utils/primitives.ts
|
|
@@ -972,10 +981,10 @@ function H(e) {
|
|
|
972
981
|
function U(e) {
|
|
973
982
|
return e && e.person?.nationalityCode || "";
|
|
974
983
|
}
|
|
975
|
-
function
|
|
984
|
+
function it(e) {
|
|
976
985
|
return e ? `[${e}]` : "";
|
|
977
986
|
}
|
|
978
|
-
function
|
|
987
|
+
function at(e) {
|
|
979
988
|
return e ? {
|
|
980
989
|
DIRECT_ACCEPTANCE: "DA",
|
|
981
990
|
WILDCARD: "WC",
|
|
@@ -985,36 +994,36 @@ function rt(e) {
|
|
|
985
994
|
SPECIAL_EXEMPT: "SE"
|
|
986
995
|
}[e] || e : "";
|
|
987
996
|
}
|
|
988
|
-
function
|
|
997
|
+
function ot(e) {
|
|
989
998
|
return e ? typeof e == "string" ? e : e.scoreStringSide1 ? e.scoreStringSide1 : "" : "";
|
|
990
999
|
}
|
|
991
|
-
function
|
|
1000
|
+
function st(e) {
|
|
992
1001
|
return e ? (/* @__PURE__ */ new Date(e + "T00:00:00")).toLocaleDateString("en-US", {
|
|
993
1002
|
day: "2-digit",
|
|
994
1003
|
month: "short",
|
|
995
1004
|
year: "numeric"
|
|
996
1005
|
}) : "";
|
|
997
1006
|
}
|
|
998
|
-
function
|
|
1007
|
+
function ct(e) {
|
|
999
1008
|
if (!e) return "";
|
|
1000
1009
|
let [t, n] = e.split(":"), r = parseInt(t), i = r >= 12 ? "PM" : "AM", a = r;
|
|
1001
1010
|
return r === 0 ? a = 12 : r > 12 && (a = r - 12), `${a}:${n} ${i}`;
|
|
1002
1011
|
}
|
|
1003
|
-
function
|
|
1012
|
+
function lt(e) {
|
|
1004
1013
|
return e ? e.split(/\s+/).map((e) => e[0]).join("").toUpperCase() : "";
|
|
1005
1014
|
}
|
|
1006
|
-
function
|
|
1015
|
+
function ut(e, t) {
|
|
1007
1016
|
let n = t - e + 1;
|
|
1008
1017
|
return n === 1 ? "F" : n === 2 ? "SF" : n === 3 ? "QF" : `R${2 ** n}`;
|
|
1009
1018
|
}
|
|
1010
1019
|
//#endregion
|
|
1011
1020
|
//#region src/core/sideByNumber.ts
|
|
1012
|
-
function
|
|
1021
|
+
function dt(e, t) {
|
|
1013
1022
|
return e.find((e) => e?.sideNumber === t) ?? e[t - 1];
|
|
1014
1023
|
}
|
|
1015
1024
|
//#endregion
|
|
1016
1025
|
//#region src/core/extractScheduleData.ts
|
|
1017
|
-
function
|
|
1026
|
+
function ft(e) {
|
|
1018
1027
|
let { matchUps: t = [], venues: n = [], scheduledDate: r = "" } = e, i = /* @__PURE__ */ new Set();
|
|
1019
1028
|
n.forEach((e) => {
|
|
1020
1029
|
(e.courts || []).forEach((e) => {
|
|
@@ -1031,23 +1040,23 @@ function ut(e) {
|
|
|
1031
1040
|
for (let e of o) {
|
|
1032
1041
|
let t = e.schedule || {}, n = t.scheduledTime || "00:00", r = t.venueCourtId || t.courtId || "", o = a.get(r) || r;
|
|
1033
1042
|
o && i.add(o);
|
|
1034
|
-
let c = e.sides || [], l = dt(
|
|
1043
|
+
let c = e.sides || [], l = pt(dt(c, 1)), u = pt(dt(c, 2)), d = {
|
|
1035
1044
|
courtName: o,
|
|
1036
|
-
scheduledTime:
|
|
1045
|
+
scheduledTime: ct(n),
|
|
1037
1046
|
eventName: e.eventName || e.event?.eventName || "",
|
|
1038
|
-
eventAbbr:
|
|
1047
|
+
eventAbbr: lt(e.eventName || e.event?.eventName || ""),
|
|
1039
1048
|
roundName: e.roundName || "",
|
|
1040
1049
|
side1: l,
|
|
1041
1050
|
side2: u,
|
|
1042
|
-
score:
|
|
1051
|
+
score: ot(e.score),
|
|
1043
1052
|
matchUpStatus: e.matchUpStatus,
|
|
1044
|
-
notBeforeTime: t.notBeforeTime ?
|
|
1053
|
+
notBeforeTime: t.notBeforeTime ? ct(t.notBeforeTime) : void 0
|
|
1045
1054
|
}, f = t.notBeforeTime || n;
|
|
1046
1055
|
s.has(f) || s.set(f, []), s.get(f).push(d);
|
|
1047
1056
|
}
|
|
1048
1057
|
let c = [...s.keys()].sort().map((e) => ({
|
|
1049
1058
|
time: e,
|
|
1050
|
-
label:
|
|
1059
|
+
label: ct(e) || "TBD",
|
|
1051
1060
|
matches: s.get(e) || []
|
|
1052
1061
|
}));
|
|
1053
1062
|
return {
|
|
@@ -1056,7 +1065,7 @@ function ut(e) {
|
|
|
1056
1065
|
timeSlots: c
|
|
1057
1066
|
};
|
|
1058
1067
|
}
|
|
1059
|
-
function
|
|
1068
|
+
function pt(e) {
|
|
1060
1069
|
if (!e) return {
|
|
1061
1070
|
name: "",
|
|
1062
1071
|
nationality: ""
|
|
@@ -1072,7 +1081,7 @@ function dt(e) {
|
|
|
1072
1081
|
}
|
|
1073
1082
|
//#endregion
|
|
1074
1083
|
//#region src/core/extractParticipantData.ts
|
|
1075
|
-
function
|
|
1084
|
+
function mt(e) {
|
|
1076
1085
|
let { participants: t = [], eventEntries: n = [] } = e, r = /* @__PURE__ */ new Map();
|
|
1077
1086
|
for (let { eventName: e, entries: t } of n) for (let n of t) {
|
|
1078
1087
|
let t = n.participantId;
|
|
@@ -1092,15 +1101,15 @@ function ft(e) {
|
|
|
1092
1101
|
return {
|
|
1093
1102
|
name: H(e),
|
|
1094
1103
|
nationality: U(e),
|
|
1095
|
-
ranking:
|
|
1104
|
+
ranking: ht(e),
|
|
1096
1105
|
seedValue: t?.seedValue,
|
|
1097
|
-
entryStatus:
|
|
1106
|
+
entryStatus: at(t?.entryStatus || ""),
|
|
1098
1107
|
events: t?.events || [],
|
|
1099
1108
|
signedIn: e.signInStatus === "SIGNED_IN"
|
|
1100
1109
|
};
|
|
1101
1110
|
}).sort((e, t) => e.name.localeCompare(t.name));
|
|
1102
1111
|
}
|
|
1103
|
-
function
|
|
1112
|
+
function ht(e) {
|
|
1104
1113
|
for (let t of [e.rankings, e.ratings]) if (t && typeof t == "object") for (let e of Object.values(t)) {
|
|
1105
1114
|
let t = e?.[0]?.scaleValue;
|
|
1106
1115
|
if (t != null && t !== "") return String(t);
|
|
@@ -1109,7 +1118,7 @@ function pt(e) {
|
|
|
1109
1118
|
}
|
|
1110
1119
|
//#endregion
|
|
1111
1120
|
//#region src/core/extractCourtCardData.ts
|
|
1112
|
-
function
|
|
1121
|
+
function gt(e) {
|
|
1113
1122
|
let { matchUps: t = [], venues: n = [] } = e, r = /* @__PURE__ */ new Map();
|
|
1114
1123
|
n.forEach((e) => {
|
|
1115
1124
|
(e.courts || []).forEach((t) => {
|
|
@@ -1144,23 +1153,23 @@ function mt(e) {
|
|
|
1144
1153
|
o ? u = s[0] : s.length > 1 && (u = s[1]), a.push({
|
|
1145
1154
|
courtName: n.courtName,
|
|
1146
1155
|
venueName: n.venueName,
|
|
1147
|
-
currentMatch: l ?
|
|
1148
|
-
nextMatch: u ?
|
|
1156
|
+
currentMatch: l ? _t(l) : void 0,
|
|
1157
|
+
nextMatch: u ? _t(u) : void 0
|
|
1149
1158
|
});
|
|
1150
1159
|
}
|
|
1151
1160
|
return a.sort((e, t) => e.courtName.localeCompare(t.courtName));
|
|
1152
1161
|
}
|
|
1153
|
-
function
|
|
1162
|
+
function _t(e) {
|
|
1154
1163
|
let t = e.sides || [];
|
|
1155
1164
|
return {
|
|
1156
1165
|
eventName: e.eventName || e.event?.eventName || "",
|
|
1157
1166
|
roundName: e.roundName || "",
|
|
1158
|
-
scheduledTime: e.schedule?.scheduledTime ?
|
|
1159
|
-
side1:
|
|
1160
|
-
side2:
|
|
1167
|
+
scheduledTime: e.schedule?.scheduledTime ? ct(e.schedule.scheduledTime) : void 0,
|
|
1168
|
+
side1: vt(dt(t, 1)),
|
|
1169
|
+
side2: vt(dt(t, 2))
|
|
1161
1170
|
};
|
|
1162
1171
|
}
|
|
1163
|
-
function
|
|
1172
|
+
function vt(e) {
|
|
1164
1173
|
return e?.participant ? {
|
|
1165
1174
|
name: H(e.participant),
|
|
1166
1175
|
nationality: U(e.participant)
|
|
@@ -1171,7 +1180,7 @@ function gt(e) {
|
|
|
1171
1180
|
}
|
|
1172
1181
|
//#endregion
|
|
1173
1182
|
//#region src/generators/orderOfPlay.ts
|
|
1174
|
-
function
|
|
1183
|
+
function yt(e, t = {}) {
|
|
1175
1184
|
let n = e.courts.length >= 4, r = {
|
|
1176
1185
|
pageSize: t.page?.pageSize || "a4",
|
|
1177
1186
|
orientation: t.page?.orientation || (n ? "landscape" : "portrait"),
|
|
@@ -1181,7 +1190,7 @@ function _t(e, t = {}) {
|
|
|
1181
1190
|
bottom: 10,
|
|
1182
1191
|
left: 8
|
|
1183
1192
|
}
|
|
1184
|
-
}, i =
|
|
1193
|
+
}, i = Ce(r), a = t.footer || {
|
|
1185
1194
|
layout: "standard",
|
|
1186
1195
|
showTimestamp: !0,
|
|
1187
1196
|
showPageNumbers: !0
|
|
@@ -1190,7 +1199,7 @@ function _t(e, t = {}) {
|
|
|
1190
1199
|
let e = B(i, t.header, r);
|
|
1191
1200
|
s = r.margins.top + e;
|
|
1192
1201
|
}
|
|
1193
|
-
t.alertBanner && (s =
|
|
1202
|
+
t.alertBanner && (s = bt(i, t.alertBanner, r, s)), xt(i, e, r, s, t);
|
|
1194
1203
|
let c = i.internal.pageSize.getHeight();
|
|
1195
1204
|
if (t.notes?.length) {
|
|
1196
1205
|
let e = c - r.margins.bottom - o + 2;
|
|
@@ -1200,15 +1209,15 @@ function _t(e, t = {}) {
|
|
|
1200
1209
|
}
|
|
1201
1210
|
if (t.officials?.length) {
|
|
1202
1211
|
let e = c - r.margins.bottom - 6;
|
|
1203
|
-
|
|
1212
|
+
Tt(i, t.officials, r, e);
|
|
1204
1213
|
}
|
|
1205
|
-
return
|
|
1214
|
+
return Ge(i, a, r, 1), i;
|
|
1206
1215
|
}
|
|
1207
|
-
function
|
|
1216
|
+
function bt(e, t, n, r) {
|
|
1208
1217
|
let { margins: i } = n, a = e.internal.pageSize.getWidth(), o = a - i.left - i.right;
|
|
1209
1218
|
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;
|
|
1210
1219
|
}
|
|
1211
|
-
function
|
|
1220
|
+
function xt(e, n, r, i, a) {
|
|
1212
1221
|
let { margins: o } = r, s = n.courts, c = a.cellStyle === "compact", l = [{
|
|
1213
1222
|
header: "",
|
|
1214
1223
|
dataKey: "slot"
|
|
@@ -1219,7 +1228,7 @@ function yt(e, n, r, i, a) {
|
|
|
1219
1228
|
});
|
|
1220
1229
|
let u = [];
|
|
1221
1230
|
n.timeSlots.forEach((e, t) => {
|
|
1222
|
-
let n = [], r =
|
|
1231
|
+
let n = [], r = St(e, t);
|
|
1223
1232
|
n.push({
|
|
1224
1233
|
content: r,
|
|
1225
1234
|
styles: {
|
|
@@ -1229,7 +1238,7 @@ function yt(e, n, r, i, a) {
|
|
|
1229
1238
|
}
|
|
1230
1239
|
});
|
|
1231
1240
|
for (let t of s) {
|
|
1232
|
-
let r = e.matches.filter((e) => e.courtName === t), i = r.length > 0 ? r.map((e) =>
|
|
1241
|
+
let r = e.matches.filter((e) => e.courtName === t), i = r.length > 0 ? r.map((e) => Ct(e, c)).join("\n---\n") : "";
|
|
1233
1242
|
n.push(i);
|
|
1234
1243
|
}
|
|
1235
1244
|
u.push(n);
|
|
@@ -1292,21 +1301,21 @@ function yt(e, n, r, i, a) {
|
|
|
1292
1301
|
}
|
|
1293
1302
|
});
|
|
1294
1303
|
}
|
|
1295
|
-
function
|
|
1304
|
+
function St(e, t) {
|
|
1296
1305
|
return `${t + 1}`;
|
|
1297
1306
|
}
|
|
1298
|
-
function
|
|
1307
|
+
function Ct(e, t) {
|
|
1299
1308
|
let n = [];
|
|
1300
1309
|
e.notBeforeTime ? n.push(`NB ${e.notBeforeTime}`) : e.scheduledTime && n.push(e.scheduledTime), (e.eventAbbr || e.roundName) && n.push(`${e.eventAbbr} ${e.roundName}`.trim());
|
|
1301
|
-
let r =
|
|
1310
|
+
let r = wt(e.side1, t);
|
|
1302
1311
|
r && n.push(r), n.push("vs.");
|
|
1303
|
-
let i =
|
|
1312
|
+
let i = wt(e.side2, t);
|
|
1304
1313
|
return i && n.push(i), e.score ? n.push(e.score) : e.matchUpStatus === "IN_PROGRESS" && n.push("In progress"), n.join("\n");
|
|
1305
1314
|
}
|
|
1306
|
-
function
|
|
1315
|
+
function wt(e, t) {
|
|
1307
1316
|
return e.name ? t || e.nationality ? `${e.name} (${e.nationality})` : e.name : "TBD";
|
|
1308
1317
|
}
|
|
1309
|
-
function
|
|
1318
|
+
function Tt(e, t, n, r) {
|
|
1310
1319
|
let { margins: i } = n, a = e.internal.pageSize.getWidth();
|
|
1311
1320
|
e.setDrawColor(120), e.setLineWidth(.2), e.line(i.left, r - 2, a - i.right, r - 2), R(e, I.TINY, F.NORMAL);
|
|
1312
1321
|
let o = (a - i.left - i.right) / t.length;
|
|
@@ -1317,7 +1326,7 @@ function Ct(e, t, n, r) {
|
|
|
1317
1326
|
}
|
|
1318
1327
|
//#endregion
|
|
1319
1328
|
//#region src/layout/headers.ts
|
|
1320
|
-
function
|
|
1329
|
+
function Et(e, t, n = 15) {
|
|
1321
1330
|
let r = e.internal.pageSize.getWidth(), i = n;
|
|
1322
1331
|
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);
|
|
1323
1332
|
let a = [];
|
|
@@ -1492,14 +1501,14 @@ var G = {
|
|
|
1492
1501
|
};
|
|
1493
1502
|
//#endregion
|
|
1494
1503
|
//#region src/generators/playerList.ts
|
|
1495
|
-
function
|
|
1504
|
+
function Dt(n, r = {}) {
|
|
1496
1505
|
let { header: i, includeRanking: a = !0, includeEvents: o = !0 } = r, s = new e({
|
|
1497
1506
|
orientation: "portrait",
|
|
1498
1507
|
format: "a4"
|
|
1499
1508
|
});
|
|
1500
1509
|
L(s);
|
|
1501
1510
|
let c = 15;
|
|
1502
|
-
i && (c =
|
|
1511
|
+
i && (c = Et(s, {
|
|
1503
1512
|
...i,
|
|
1504
1513
|
subtitle: i.subtitle || "Player List"
|
|
1505
1514
|
}));
|
|
@@ -1578,14 +1587,14 @@ function Tt(n, r = {}) {
|
|
|
1578
1587
|
}
|
|
1579
1588
|
//#endregion
|
|
1580
1589
|
//#region src/generators/signInSheet.ts
|
|
1581
|
-
function
|
|
1590
|
+
function Ot(n, r = {}) {
|
|
1582
1591
|
let { header: i, eventName: a, signInDate: o, signInTime: s } = r, c = new e({
|
|
1583
1592
|
orientation: "portrait",
|
|
1584
1593
|
format: "a4"
|
|
1585
1594
|
});
|
|
1586
1595
|
L(c);
|
|
1587
1596
|
let l = 15;
|
|
1588
|
-
if (i && (l =
|
|
1597
|
+
if (i && (l = Et(c, {
|
|
1589
1598
|
...i,
|
|
1590
1599
|
subtitle: i.subtitle || "Player Sign-In Sheet"
|
|
1591
1600
|
})), a || o) {
|
|
@@ -1702,16 +1711,16 @@ function Et(n, r = {}) {
|
|
|
1702
1711
|
}
|
|
1703
1712
|
//#endregion
|
|
1704
1713
|
//#region src/generators/courtCard.ts
|
|
1705
|
-
function
|
|
1714
|
+
function kt(t, n = {}) {
|
|
1706
1715
|
let { tournamentName: r = "", pageSize: i = "a5", cardsPerPage: a = 1 } = n, o = new e({
|
|
1707
1716
|
orientation: "landscape",
|
|
1708
1717
|
format: i
|
|
1709
1718
|
});
|
|
1710
1719
|
return L(o), t.forEach((e, t) => {
|
|
1711
|
-
t > 0 && o.addPage(),
|
|
1720
|
+
t > 0 && o.addPage(), At(o, e, r, a);
|
|
1712
1721
|
}), o;
|
|
1713
1722
|
}
|
|
1714
|
-
function
|
|
1723
|
+
function At(e, n, r, i) {
|
|
1715
1724
|
let a = e.internal.pageSize.getWidth(), o = a / 2, s = 15;
|
|
1716
1725
|
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, {
|
|
1717
1726
|
startY: s,
|
|
@@ -1754,7 +1763,7 @@ function Ot(e, n, r, i) {
|
|
|
1754
1763
|
}
|
|
1755
1764
|
//#endregion
|
|
1756
1765
|
//#region src/generators/matchCard.ts
|
|
1757
|
-
function
|
|
1766
|
+
function jt(t, n = {}) {
|
|
1758
1767
|
let { cardsPerPage: r = 2, includeScoreBoxes: i = !0 } = n, a = new e({
|
|
1759
1768
|
orientation: "landscape",
|
|
1760
1769
|
format: "a5"
|
|
@@ -1762,17 +1771,17 @@ function kt(t, n = {}) {
|
|
|
1762
1771
|
return L(a), t.forEach((e, t) => {
|
|
1763
1772
|
t > 0 && (r === 1 || t % r === 0) && a.addPage();
|
|
1764
1773
|
let n = r === 2 && t % 2 == 1 ? a.internal.pageSize.getHeight() / 2 : 5;
|
|
1765
|
-
|
|
1774
|
+
Mt(a, e, n, i);
|
|
1766
1775
|
}), a;
|
|
1767
1776
|
}
|
|
1768
|
-
function
|
|
1777
|
+
function Mt(e, t, n, r) {
|
|
1769
1778
|
let i = e.internal.pageSize.getWidth(), a = i / 2, o = n;
|
|
1770
1779
|
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) {
|
|
1771
1780
|
R(e, I.BODY, F.NORMAL);
|
|
1772
1781
|
let n = [];
|
|
1773
1782
|
t.courtName && n.push(`Court: ${t.courtName}`), t.scheduledTime && n.push(`Time: ${t.scheduledTime}`), e.text(n.join(" "), a, o, { align: "center" }), o += 5;
|
|
1774
1783
|
}
|
|
1775
|
-
if (e.setDrawColor(0), e.setLineWidth(.5), e.line(10, o, i - 10, o), o += 6,
|
|
1784
|
+
if (e.setDrawColor(0), e.setLineWidth(.5), e.line(10, o, i - 10, o), o += 6, Nt(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, Nt(e, t.side2, 10, o, i), o += 8, r) {
|
|
1776
1785
|
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);
|
|
1777
1786
|
for (let t = 0; t < 5; t++) {
|
|
1778
1787
|
let n = 28 + t * 15;
|
|
@@ -1781,22 +1790,22 @@ function At(e, t, n, r) {
|
|
|
1781
1790
|
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);
|
|
1782
1791
|
}
|
|
1783
1792
|
}
|
|
1784
|
-
function
|
|
1793
|
+
function Nt(e, t, n, r, i) {
|
|
1785
1794
|
R(e, 14, F.BOLD);
|
|
1786
1795
|
let a = t.seedValue ? `[${t.seedValue}] ` : "";
|
|
1787
1796
|
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);
|
|
1788
1797
|
}
|
|
1789
1798
|
//#endregion
|
|
1790
1799
|
//#region src/core/extractDrawData.ts
|
|
1791
|
-
function
|
|
1792
|
-
let { drawDefinition: t, participants:
|
|
1793
|
-
if (!t) return
|
|
1794
|
-
let
|
|
1795
|
-
if (!
|
|
1796
|
-
let
|
|
1797
|
-
|
|
1798
|
-
let
|
|
1799
|
-
let t = e.participantId ?
|
|
1800
|
+
function Pt(e) {
|
|
1801
|
+
let { drawDefinition: t, participants: r = [] } = e;
|
|
1802
|
+
if (!t) return It();
|
|
1803
|
+
let i = e.structureId ? t.structures?.find((t) => t.structureId === e.structureId) : t.structures?.[0];
|
|
1804
|
+
if (!i) return It();
|
|
1805
|
+
let a = /* @__PURE__ */ new Map();
|
|
1806
|
+
r.forEach((e) => a.set(e.participantId, e));
|
|
1807
|
+
let o = i.positionAssignments || [], s = i.matchUps || [], c = s.reduce((e, t) => Math.max(e, t.roundNumber || 0), 0), l = e.structureId ? o.length : t.drawSize || o.length, u = e.structureId ? c : Math.log2(l), d = i.seedAssignments || [], f = o.map((e) => {
|
|
1808
|
+
let t = e.participantId ? a.get(e.participantId) : void 0, n = d.find((t) => t.participantId === e.participantId);
|
|
1800
1809
|
return {
|
|
1801
1810
|
drawPosition: e.drawPosition,
|
|
1802
1811
|
participantName: t ? H(t) : "",
|
|
@@ -1805,38 +1814,38 @@ function Mt(e) {
|
|
|
1805
1814
|
entryStatus: e.entryStatus,
|
|
1806
1815
|
isBye: e.bye === !0
|
|
1807
1816
|
};
|
|
1808
|
-
}),
|
|
1817
|
+
}), { roundProfile: p } = n.getRoundMatchUps({ matchUps: s }) ?? {}, m = (i.matchUps || []).map((e) => ({
|
|
1809
1818
|
roundNumber: e.roundNumber,
|
|
1810
1819
|
roundPosition: e.roundPosition,
|
|
1811
|
-
drawPositions: e
|
|
1812
|
-
winnerDrawPosition:
|
|
1813
|
-
score:
|
|
1820
|
+
drawPositions: pe(e, p),
|
|
1821
|
+
winnerDrawPosition: me(e),
|
|
1822
|
+
score: ot(e.score),
|
|
1814
1823
|
winningSide: e.winningSide,
|
|
1815
1824
|
matchUpStatus: e.matchUpStatus
|
|
1816
|
-
})),
|
|
1817
|
-
let t =
|
|
1825
|
+
})), h = d.filter((e) => e.participantId).map((e) => {
|
|
1826
|
+
let t = a.get(e.participantId);
|
|
1818
1827
|
return {
|
|
1819
1828
|
seedValue: e.seedValue,
|
|
1820
1829
|
participantName: t ? H(t) : "",
|
|
1821
1830
|
nationality: t ? U(t) : "",
|
|
1822
1831
|
seedingBasis: e.seedingBasis
|
|
1823
1832
|
};
|
|
1824
|
-
}).sort((e, t) => e.seedValue - t.seedValue),
|
|
1833
|
+
}).sort((e, t) => e.seedValue - t.seedValue), g = Ft(m, u, e.processedMatchUps);
|
|
1825
1834
|
return {
|
|
1826
1835
|
drawName: t.drawName || "",
|
|
1827
|
-
drawSize:
|
|
1836
|
+
drawSize: l,
|
|
1828
1837
|
drawType: t.drawType || "SINGLE_ELIMINATION",
|
|
1829
|
-
totalRounds:
|
|
1830
|
-
slots:
|
|
1831
|
-
matchUps:
|
|
1832
|
-
seedAssignments:
|
|
1833
|
-
roundLabelMap:
|
|
1838
|
+
totalRounds: u,
|
|
1839
|
+
slots: f,
|
|
1840
|
+
matchUps: m,
|
|
1841
|
+
seedAssignments: h,
|
|
1842
|
+
roundLabelMap: g
|
|
1834
1843
|
};
|
|
1835
1844
|
}
|
|
1836
1845
|
function K(e, t) {
|
|
1837
|
-
return
|
|
1846
|
+
return ut(e, t);
|
|
1838
1847
|
}
|
|
1839
|
-
function
|
|
1848
|
+
function Ft(e, t, n) {
|
|
1840
1849
|
if (n?.length) {
|
|
1841
1850
|
let e = {};
|
|
1842
1851
|
for (let t of n) t.roundNumber && !e[t.roundNumber] && (e[t.roundNumber] = t.abbreviatedRoundName || t.roundName || `R${t.roundNumber}`);
|
|
@@ -1851,14 +1860,14 @@ function Nt(e, t, n) {
|
|
|
1851
1860
|
return (r.get(e) || 0) <= Math.ceil(n / 2);
|
|
1852
1861
|
})) {
|
|
1853
1862
|
let e = {};
|
|
1854
|
-
for (let n of i) e[n] =
|
|
1863
|
+
for (let n of i) e[n] = ut(n, t);
|
|
1855
1864
|
return e;
|
|
1856
1865
|
}
|
|
1857
1866
|
let a = {};
|
|
1858
1867
|
for (let e of i) a[e] = `R${e}`;
|
|
1859
1868
|
return a;
|
|
1860
1869
|
}
|
|
1861
|
-
function
|
|
1870
|
+
function It() {
|
|
1862
1871
|
return {
|
|
1863
1872
|
drawName: "",
|
|
1864
1873
|
drawSize: 0,
|
|
@@ -1871,13 +1880,13 @@ function Pt() {
|
|
|
1871
1880
|
}
|
|
1872
1881
|
//#endregion
|
|
1873
1882
|
//#region src/renderers/formatEntry.ts
|
|
1874
|
-
function
|
|
1883
|
+
function Lt(e, t) {
|
|
1875
1884
|
if (e.isBye) return "Bye";
|
|
1876
1885
|
if (!e.participantName) return "";
|
|
1877
|
-
let n =
|
|
1886
|
+
let n = zt(e.participantName, t), r = Bt(e.nationality, t), i = e.seedValue ? Vt(e.seedValue, t) : "", a = e.entryStatus ? Ut(e.entryStatus, t) : "", o = [];
|
|
1878
1887
|
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(" ");
|
|
1879
1888
|
}
|
|
1880
|
-
function
|
|
1889
|
+
function Rt(e, t) {
|
|
1881
1890
|
if (e.isBye) return {
|
|
1882
1891
|
name: "Bye",
|
|
1883
1892
|
nationality: ""
|
|
@@ -1886,13 +1895,13 @@ function It(e, t) {
|
|
|
1886
1895
|
name: "",
|
|
1887
1896
|
nationality: ""
|
|
1888
1897
|
};
|
|
1889
|
-
let n =
|
|
1898
|
+
let n = zt(e.participantName, t), r = e.seedValue ? Vt(e.seedValue, t) : "", i = e.entryStatus ? Ut(e.entryStatus, t) : "", a = [];
|
|
1890
1899
|
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), {
|
|
1891
1900
|
name: a.join(" "),
|
|
1892
1901
|
nationality: e.nationality || ""
|
|
1893
1902
|
};
|
|
1894
1903
|
}
|
|
1895
|
-
function
|
|
1904
|
+
function zt(e, t) {
|
|
1896
1905
|
if (t.nameFormat === "LAST First") return e.replace(",", "");
|
|
1897
1906
|
if (t.nameFormat === "F. LAST") {
|
|
1898
1907
|
let t = e.match(/^([^,]+),\s*(.+)/);
|
|
@@ -1900,7 +1909,7 @@ function Lt(e, t) {
|
|
|
1900
1909
|
}
|
|
1901
1910
|
return e;
|
|
1902
1911
|
}
|
|
1903
|
-
function
|
|
1912
|
+
function Bt(e, t) {
|
|
1904
1913
|
if (!e) return "";
|
|
1905
1914
|
switch (t.nationalityFormat) {
|
|
1906
1915
|
case "parens": return `(${e})`;
|
|
@@ -1908,14 +1917,14 @@ function Rt(e, t) {
|
|
|
1908
1917
|
default: return e;
|
|
1909
1918
|
}
|
|
1910
1919
|
}
|
|
1911
|
-
function
|
|
1920
|
+
function Vt(e, t) {
|
|
1912
1921
|
switch (t.seedFormat) {
|
|
1913
1922
|
case "parens": return `(${e})`;
|
|
1914
1923
|
case "bare": return `${e}`;
|
|
1915
1924
|
default: return `[${e}]`;
|
|
1916
1925
|
}
|
|
1917
1926
|
}
|
|
1918
|
-
var
|
|
1927
|
+
var Ht = {
|
|
1919
1928
|
DIRECT_ACCEPTANCE: "",
|
|
1920
1929
|
WILDCARD: "WC",
|
|
1921
1930
|
QUALIFIER: "Q",
|
|
@@ -1925,9 +1934,9 @@ var Bt = {
|
|
|
1925
1934
|
JUNIOR_EXEMPT: "JE",
|
|
1926
1935
|
ORGANISER_ACCEPTANCE: "OA"
|
|
1927
1936
|
};
|
|
1928
|
-
function
|
|
1937
|
+
function Ut(e, t) {
|
|
1929
1938
|
if (!e) return "";
|
|
1930
|
-
let n =
|
|
1939
|
+
let n = Ht[e];
|
|
1931
1940
|
if (n === void 0) return e;
|
|
1932
1941
|
if (!n) return "";
|
|
1933
1942
|
switch (t.entryFormat) {
|
|
@@ -1946,7 +1955,7 @@ function q(e, t) {
|
|
|
1946
1955
|
}
|
|
1947
1956
|
//#endregion
|
|
1948
1957
|
//#region src/renderers/traditionalDraw.ts
|
|
1949
|
-
function
|
|
1958
|
+
function Wt(e, t, n) {
|
|
1950
1959
|
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;
|
|
1951
1960
|
return i < 2.5 ? _ = 5 : i < 3.5 && (_ = I.TINY), {
|
|
1952
1961
|
lineHeight: i,
|
|
@@ -1959,9 +1968,9 @@ function Ht(e, t, n) {
|
|
|
1959
1968
|
};
|
|
1960
1969
|
}
|
|
1961
1970
|
function J(e, t, n, r, i = 0, a) {
|
|
1962
|
-
|
|
1971
|
+
Gt(t.matchUps) ? Kt(e, t, n, r) : an(e, t, n, r, i, a);
|
|
1963
1972
|
}
|
|
1964
|
-
function
|
|
1973
|
+
function Gt(e) {
|
|
1965
1974
|
let t = /* @__PURE__ */ new Map();
|
|
1966
1975
|
for (let n of e) t.set(n.roundNumber, (t.get(n.roundNumber) || 0) + 1);
|
|
1967
1976
|
let n = [...t.keys()].sort((e, t) => e - t);
|
|
@@ -1971,19 +1980,19 @@ function Ut(e) {
|
|
|
1971
1980
|
}
|
|
1972
1981
|
return !1;
|
|
1973
1982
|
}
|
|
1974
|
-
function
|
|
1975
|
-
let i = n.page.margins, a = r.contentY + 9, o = r.contentHeight - 9, s =
|
|
1976
|
-
|
|
1977
|
-
let y =
|
|
1978
|
-
|
|
1983
|
+
function Kt(e, t, n, r) {
|
|
1984
|
+
let i = n.page.margins, a = r.contentY + 9, o = r.contentHeight - 9, s = qt(t.matchUps), c = [...s.keys()].sort((e, t) => e - t), l = c.length, u = new Map(t.slots.map((e) => [e.drawPosition, e])), d = Jt(c, s), { feedConfig: f, connectorGap: p, firstRoundWidth: m, roundColumnWidth: h, fontSize: g, scoreFontSize: _ } = Yt(o, s, c, l, r), v = (e) => e === 0 ? i.left : i.left + m + p + (e - 1) * (h + p);
|
|
1985
|
+
rn(e, c, t, f, n, r, v, l, h);
|
|
1986
|
+
let y = Xt(c, l, s, d, a, o, f.lineHeight);
|
|
1987
|
+
Zt(e, c, l, s, y, d, u, f, n, v, m, h, p, _), nn(e, t, c, l, s, y, u, v, a, o, h, g, _, n);
|
|
1979
1988
|
}
|
|
1980
|
-
function
|
|
1989
|
+
function qt(e) {
|
|
1981
1990
|
let t = /* @__PURE__ */ new Map();
|
|
1982
1991
|
for (let n of e) t.has(n.roundNumber) || t.set(n.roundNumber, []), t.get(n.roundNumber).push(n);
|
|
1983
1992
|
for (let [, e] of t) e.sort((e, t) => e.roundPosition - t.roundPosition);
|
|
1984
1993
|
return t;
|
|
1985
1994
|
}
|
|
1986
|
-
function
|
|
1995
|
+
function Jt(e, t) {
|
|
1987
1996
|
let n = /* @__PURE__ */ new Set();
|
|
1988
1997
|
for (let r = 1; r < e.length; r++) {
|
|
1989
1998
|
let i = t.get(e[r - 1])?.length || 0;
|
|
@@ -1991,7 +2000,7 @@ function Kt(e, t) {
|
|
|
1991
2000
|
}
|
|
1992
2001
|
return n;
|
|
1993
2002
|
}
|
|
1994
|
-
function
|
|
2003
|
+
function Yt(e, t, n, r, i) {
|
|
1995
2004
|
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;
|
|
1996
2005
|
o < 2.5 ? d = 5 : o < 3.5 && (d = I.TINY);
|
|
1997
2006
|
let f = s ? 5 : I.TINY;
|
|
@@ -2012,7 +2021,7 @@ function qt(e, t, n, r, i) {
|
|
|
2012
2021
|
scoreFontSize: f
|
|
2013
2022
|
};
|
|
2014
2023
|
}
|
|
2015
|
-
function
|
|
2024
|
+
function Xt(e, t, n, r, i, a, o) {
|
|
2016
2025
|
let s = /* @__PURE__ */ new Map();
|
|
2017
2026
|
for (let c = 0; c < t; c++) {
|
|
2018
2027
|
let t = e[c], l = n.get(t)?.length || 0;
|
|
@@ -2056,13 +2065,13 @@ function Jt(e, t, n, r, i, a, o) {
|
|
|
2056
2065
|
}
|
|
2057
2066
|
return s;
|
|
2058
2067
|
}
|
|
2059
|
-
function
|
|
2068
|
+
function Zt(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
2060
2069
|
for (let m = 0; m < n; m++) {
|
|
2061
2070
|
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]);
|
|
2062
2071
|
for (let i = 0; i < g.length; i++) {
|
|
2063
2072
|
let a = g[i], h = _[i];
|
|
2064
2073
|
if (h) {
|
|
2065
|
-
if (e.setDrawColor(40), e.setLineWidth(.25), m === 0 ?
|
|
2074
|
+
if (e.setDrawColor(40), e.setLineWidth(.25), m === 0 ? Qt(e, a, h, o, c, s, v, u, x, f, S) : b ? $t(e, a, h, o, r, t, m, c, s, v, d, x, f, S) : en(e, a, h, o, c, s, v, d, x, f, S), m < n - 1) {
|
|
2066
2075
|
let t = l(m + 1);
|
|
2067
2076
|
S ? e.line(x, h.midY, t, h.midY) : e.line(x + f, h.midY, t, h.midY);
|
|
2068
2077
|
}
|
|
@@ -2076,34 +2085,34 @@ function Yt(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
|
2076
2085
|
}
|
|
2077
2086
|
}
|
|
2078
2087
|
}
|
|
2079
|
-
function
|
|
2080
|
-
t.drawPositions[0] &&
|
|
2088
|
+
function Qt(e, t, n, r, i, a, o, s, c, l, u) {
|
|
2089
|
+
t.drawPositions[0] && fn(e, r.get(t.drawPositions[0]), t.drawPositions[0], i, a, o, n.topY, s), t.drawPositions[1] && fn(e, r.get(t.drawPositions[1]), t.drawPositions[1], i, a, o, n.bottomY, s), tn(e, n, c, l, u);
|
|
2081
2090
|
}
|
|
2082
|
-
function
|
|
2091
|
+
function $t(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
2083
2092
|
let m = a[o - 1], h = i.get(m) || [], g = /* @__PURE__ */ new Set();
|
|
2084
2093
|
for (let e of h) e.winningSide && e.winnerDrawPosition !== void 0 && g.add(e.winnerDrawPosition);
|
|
2085
2094
|
let _ = t.drawPositions.find((e) => e && g.has(e)), v = t.drawPositions.find((e) => e && e !== _);
|
|
2086
|
-
if (e.line(l, n.midY, l, n.bottomY), v ?
|
|
2095
|
+
if (e.line(l, n.midY, l, n.bottomY), v ? fn(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), _) {
|
|
2087
2096
|
let t = r.get(_);
|
|
2088
|
-
t?.participantName &&
|
|
2097
|
+
t?.participantName && pn(e, t, s, c, l, n.bottomY);
|
|
2089
2098
|
}
|
|
2090
|
-
|
|
2099
|
+
tn(e, n, d, f, p);
|
|
2091
2100
|
}
|
|
2092
|
-
function
|
|
2101
|
+
function en(e, t, n, r, i, a, o, s, c, l, u) {
|
|
2093
2102
|
if (e.line(o, n.topY, o + s, n.topY), e.line(o, n.bottomY, o + s, n.bottomY), t.drawPositions[0]) {
|
|
2094
2103
|
let s = r.get(t.drawPositions[0]);
|
|
2095
|
-
s?.participantName &&
|
|
2104
|
+
s?.participantName && pn(e, s, i, a, o, n.topY);
|
|
2096
2105
|
}
|
|
2097
2106
|
if (t.drawPositions[1]) {
|
|
2098
2107
|
let s = r.get(t.drawPositions[1]);
|
|
2099
|
-
s?.participantName &&
|
|
2108
|
+
s?.participantName && pn(e, s, i, a, o, n.bottomY);
|
|
2100
2109
|
}
|
|
2101
|
-
|
|
2110
|
+
tn(e, n, c, l, u);
|
|
2102
2111
|
}
|
|
2103
|
-
function
|
|
2112
|
+
function tn(e, t, n, r, i) {
|
|
2104
2113
|
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));
|
|
2105
2114
|
}
|
|
2106
|
-
function
|
|
2115
|
+
function nn(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
2107
2116
|
if (t.noWinnerColumn) return;
|
|
2108
2117
|
let m = s(r), h = n.at(-1), g = (a.get(h) || [])[0]?.midY || c + l / 2;
|
|
2109
2118
|
e.setDrawColor(40), e.setLineWidth(.25), e.line(m, g, m + Math.min(65, u), g);
|
|
@@ -2112,7 +2121,7 @@ function en(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
|
2112
2121
|
let t = _.winnerDrawPosition, n = t === void 0 ? void 0 : o.get(t);
|
|
2113
2122
|
if (n) {
|
|
2114
2123
|
R(e, d + 1, F.BOLD);
|
|
2115
|
-
let { name: t } =
|
|
2124
|
+
let { name: t } = Rt(n, p);
|
|
2116
2125
|
if (e.text(t, m + 1, g - .5), _.score) {
|
|
2117
2126
|
let t = q(_.score, p);
|
|
2118
2127
|
R(e, f, F.NORMAL), e.setTextColor(60, 60, 160), e.text(t, m + 1, g + f * .4), e.setTextColor(0);
|
|
@@ -2120,7 +2129,7 @@ function en(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
|
2120
2129
|
}
|
|
2121
2130
|
}
|
|
2122
2131
|
}
|
|
2123
|
-
function
|
|
2132
|
+
function rn(e, t, n, r, i, a, o, s, c) {
|
|
2124
2133
|
R(e, r.fontSize <= I.TINY ? 5.5 : I.SMALL, F.BOLD), e.setTextColor(40);
|
|
2125
2134
|
for (let l = 0; l < s; l++) {
|
|
2126
2135
|
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;
|
|
@@ -2129,45 +2138,45 @@ function tn(e, t, n, r, i, a, o, s, c) {
|
|
|
2129
2138
|
let l = o(s);
|
|
2130
2139
|
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);
|
|
2131
2140
|
}
|
|
2132
|
-
function
|
|
2133
|
-
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 =
|
|
2134
|
-
|
|
2135
|
-
for (let r = 0; r < l; r++)
|
|
2136
|
-
t.noWinnerColumn ||
|
|
2141
|
+
function an(e, t, n, r, i = 0, a) {
|
|
2142
|
+
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 = Wt(o, r, l), d = n.page.margins.left, f = r.contentY + 9;
|
|
2143
|
+
ln(e, l, t.totalRounds, u, n, d, r.contentY + 2, t.roundLabelMap, t.noWinnerColumn);
|
|
2144
|
+
for (let r = 0; r < l; r++) on(e, t, n, u, o, r, l, d, f, i);
|
|
2145
|
+
t.noWinnerColumn || cn(e, t, n, u, l, d, f);
|
|
2137
2146
|
}
|
|
2138
|
-
function
|
|
2139
|
-
let u = i / 2 ** (a + 1), d = r.lineHeight * 2 ** a, f =
|
|
2147
|
+
function on(e, t, n, r, i, a, o, s, c, l) {
|
|
2148
|
+
let u = i / 2 ** (a + 1), d = r.lineHeight * 2 ** a, f = dn(a, r, s), p = (2 ** a - 1) * r.lineHeight / 2, m = 2 ** (a + 1) * r.lineHeight;
|
|
2140
2149
|
for (let i = 0; i < u; i++) {
|
|
2141
2150
|
let u = c + p + i * m, h = u + d, g = (u + h) / 2;
|
|
2142
2151
|
if (a === 0) {
|
|
2143
2152
|
let a = l + i * 2 + 1, o = l + i * 2 + 2;
|
|
2144
|
-
|
|
2153
|
+
fn(e, hn(t.slots, a), a, n, r, f, u), fn(e, hn(t.slots, o), o, n, r, f, h);
|
|
2145
2154
|
} else {
|
|
2146
|
-
let t =
|
|
2155
|
+
let t = un(a, r);
|
|
2147
2156
|
e.setDrawColor(40), e.setLineWidth(.25), e.line(f, u, f + t, u), e.line(f, h, f + t, h);
|
|
2148
2157
|
}
|
|
2149
|
-
let _ = a === o - 1, v = f +
|
|
2158
|
+
let _ = a === o - 1, v = f + un(a, r);
|
|
2150
2159
|
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) {
|
|
2151
|
-
let t =
|
|
2160
|
+
let t = dn(a + 1, r, s);
|
|
2152
2161
|
e.line(v + r.connectorGap, g, t, g);
|
|
2153
2162
|
}
|
|
2154
|
-
let y =
|
|
2163
|
+
let y = gn(t.matchUps, a + 1, i + 1);
|
|
2155
2164
|
if (_ && t.noWinnerColumn) {
|
|
2156
|
-
let i =
|
|
2157
|
-
i && (e.setDrawColor(40), e.setLineWidth(.25), e.line(v + r.connectorGap, g, v + r.connectorGap + r.roundColumnWidth, g),
|
|
2165
|
+
let i = _n(y, t.slots);
|
|
2166
|
+
i && (e.setDrawColor(40), e.setLineWidth(.25), e.line(v + r.connectorGap, g, v + r.connectorGap + r.roundColumnWidth, g), pn(e, i, n, r, v + r.connectorGap, g), y?.score && sn(e, y, n, r, d, v + r.connectorGap, a, g));
|
|
2158
2167
|
} else if (!_) {
|
|
2159
|
-
let i =
|
|
2168
|
+
let i = _n(y, t.slots);
|
|
2160
2169
|
if (i) {
|
|
2161
|
-
let t =
|
|
2162
|
-
|
|
2170
|
+
let t = dn(a + 1, r, s);
|
|
2171
|
+
pn(e, i, n, r, t, g), y?.score && sn(e, y, n, r, d, t, a, g);
|
|
2163
2172
|
}
|
|
2164
2173
|
}
|
|
2165
2174
|
}
|
|
2166
2175
|
}
|
|
2167
|
-
function
|
|
2176
|
+
function sn(e, t, n, r, i, a, o, s) {
|
|
2168
2177
|
let c = q(t.score, n);
|
|
2169
2178
|
if (R(e, r.scoreFontSize, F.NORMAL), e.setTextColor(60, 60, 160), i * 2 < r.scoreFontSize * 1.2) {
|
|
2170
|
-
let t = a +
|
|
2179
|
+
let t = a + un(o + 1, r) - 1;
|
|
2171
2180
|
e.text(c, t, s - .5, { align: "right" });
|
|
2172
2181
|
} else {
|
|
2173
2182
|
let t = r.scoreFontSize * .4;
|
|
@@ -2175,15 +2184,15 @@ function an(e, t, n, r, i, a, o, s) {
|
|
|
2175
2184
|
}
|
|
2176
2185
|
e.setTextColor(0);
|
|
2177
2186
|
}
|
|
2178
|
-
function
|
|
2179
|
-
let s =
|
|
2187
|
+
function cn(e, t, n, r, i, a, o) {
|
|
2188
|
+
let s = dn(i, r, a), c = (2 ** (i - 1) - 1) * r.lineHeight / 2, l = r.lineHeight * 2 ** (i - 1), u = o + c + l / 2;
|
|
2180
2189
|
e.setDrawColor(40), e.setLineWidth(.25), e.line(s, u, s + r.roundColumnWidth, u);
|
|
2181
|
-
let d =
|
|
2190
|
+
let d = gn(t.matchUps, i, 1);
|
|
2182
2191
|
if (d?.winningSide) {
|
|
2183
|
-
let i = d.winnerDrawPosition, a =
|
|
2192
|
+
let i = d.winnerDrawPosition, a = hn(t.slots, i);
|
|
2184
2193
|
if (a) {
|
|
2185
2194
|
R(e, r.fontSize + 1, F.BOLD);
|
|
2186
|
-
let { name: t } =
|
|
2195
|
+
let { name: t } = Rt(a, n);
|
|
2187
2196
|
if (e.text(t, s + 1, u - .5), d.score) {
|
|
2188
2197
|
let t = q(d.score, n);
|
|
2189
2198
|
R(e, r.scoreFontSize, F.NORMAL), e.setTextColor(60, 60, 160), e.text(t, s + 1, u + r.scoreFontSize * .4), e.setTextColor(0);
|
|
@@ -2191,42 +2200,42 @@ function on(e, t, n, r, i, a, o) {
|
|
|
2191
2200
|
}
|
|
2192
2201
|
}
|
|
2193
2202
|
}
|
|
2194
|
-
function
|
|
2203
|
+
function ln(e, t, n, r, i, a, o, s, c) {
|
|
2195
2204
|
R(e, r.fontSize <= I.TINY ? 5.5 : I.SMALL, F.BOLD), e.setTextColor(40);
|
|
2196
2205
|
for (let c = 0; c < t; c++) {
|
|
2197
|
-
let l = n - t + c + 1, u = K(l, n), d = s?.[l] || i.roundLabels[u] || u, f =
|
|
2206
|
+
let l = n - t + c + 1, u = K(l, n), d = s?.[l] || i.roundLabels[u] || u, f = dn(c, r, a), p = un(c, r), m = f + p / 2;
|
|
2198
2207
|
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);
|
|
2199
2208
|
}
|
|
2200
2209
|
if (!c) {
|
|
2201
|
-
let n =
|
|
2210
|
+
let n = dn(t, r, a);
|
|
2202
2211
|
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);
|
|
2203
2212
|
}
|
|
2204
2213
|
e.setTextColor(0);
|
|
2205
2214
|
}
|
|
2206
|
-
function
|
|
2215
|
+
function un(e, t) {
|
|
2207
2216
|
return e === 0 ? t.firstRoundWidth : e === 1 ? t.secondRoundWidth : t.roundColumnWidth;
|
|
2208
2217
|
}
|
|
2209
|
-
function
|
|
2218
|
+
function dn(e, t, n) {
|
|
2210
2219
|
if (e === 0) return n;
|
|
2211
2220
|
let r = n + t.firstRoundWidth + t.connectorGap;
|
|
2212
|
-
for (let n = 1; n < e; n++) r +=
|
|
2221
|
+
for (let n = 1; n < e; n++) r += un(n, t) + t.connectorGap;
|
|
2213
2222
|
return r;
|
|
2214
2223
|
}
|
|
2215
|
-
function
|
|
2224
|
+
function fn(e, t, n, r, i, a, o, s) {
|
|
2216
2225
|
let c = i.fontSize <= 5 ? 4 : 5, l = i.fontSize <= 5 ? 5 : 6, u = s || i.firstRoundWidth, d = i.lineHeight < 2 ? .15 : .3;
|
|
2217
2226
|
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));
|
|
2218
2227
|
let f = a + c + l, p = a + u;
|
|
2219
2228
|
if (e.setDrawColor(40), e.setLineWidth(.25), e.line(f, o, p, o), !t) return;
|
|
2220
|
-
let { name: m } =
|
|
2229
|
+
let { name: m } = Rt(t, r);
|
|
2221
2230
|
if (!m) return;
|
|
2222
2231
|
R(e, i.fontSize, t.isBye ? F.ITALIC : F.NORMAL), t.isBye && e.setTextColor(150);
|
|
2223
2232
|
let h = p - f - 2, g = m;
|
|
2224
|
-
e.getTextWidth(m) > h && (g =
|
|
2233
|
+
e.getTextWidth(m) > h && (g = mn(t.participantName));
|
|
2225
2234
|
let _ = i.lineHeight < 2 ? .2 : .5;
|
|
2226
2235
|
e.text(g, f + 1, o - _), t.isBye && e.setTextColor(0);
|
|
2227
2236
|
}
|
|
2228
|
-
function
|
|
2229
|
-
let o =
|
|
2237
|
+
function pn(e, t, n, r, i, a) {
|
|
2238
|
+
let o = mn(t.participantName), s = "";
|
|
2230
2239
|
if (t.seedValue) switch (n.seedFormat) {
|
|
2231
2240
|
case "parens":
|
|
2232
2241
|
s = `(${t.seedValue})`;
|
|
@@ -2239,42 +2248,42 @@ function dn(e, t, n, r, i, a) {
|
|
|
2239
2248
|
let c = s ? `${o} ${s}` : o;
|
|
2240
2249
|
R(e, r.fontSize, F.BOLD), e.text(c, i + 1, a - .5);
|
|
2241
2250
|
}
|
|
2242
|
-
function
|
|
2251
|
+
function mn(e) {
|
|
2243
2252
|
let t = e.match(/^([^,]+),\s*(.+)/);
|
|
2244
2253
|
if (t) return `${t[2][0]}. ${t[1]}`;
|
|
2245
2254
|
let n = e.match(/^(\S+)\s+(.+)/);
|
|
2246
2255
|
return n ? `${n[1][0]}. ${n[2]}` : e;
|
|
2247
2256
|
}
|
|
2248
|
-
function
|
|
2257
|
+
function hn(e, t) {
|
|
2249
2258
|
return t === void 0 ? void 0 : e.find((e) => e.drawPosition === t);
|
|
2250
2259
|
}
|
|
2251
|
-
function
|
|
2260
|
+
function gn(e, t, n) {
|
|
2252
2261
|
return e.find((e) => e.roundNumber === t && e.roundPosition === n);
|
|
2253
2262
|
}
|
|
2254
|
-
function
|
|
2263
|
+
function _n(e, t) {
|
|
2255
2264
|
if (e) {
|
|
2256
2265
|
if (e.winningSide) {
|
|
2257
2266
|
let n = e.winnerDrawPosition;
|
|
2258
|
-
return
|
|
2267
|
+
return hn(t, n);
|
|
2259
2268
|
}
|
|
2260
2269
|
if (e.matchUpStatus === "BYE") for (let n of e.drawPositions) {
|
|
2261
|
-
let e =
|
|
2270
|
+
let e = hn(t, n);
|
|
2262
2271
|
if (e && !e.isBye && e.participantName) return e;
|
|
2263
2272
|
}
|
|
2264
2273
|
}
|
|
2265
2274
|
}
|
|
2266
2275
|
//#endregion
|
|
2267
2276
|
//#region src/renderers/positionlessPlacement.ts
|
|
2268
|
-
function
|
|
2277
|
+
function vn({ partitionCount: e, matchUps: t, matchUp: n }) {
|
|
2269
2278
|
if (e < 1) return;
|
|
2270
2279
|
let r = t.filter((e) => e.roundNumber === n.roundNumber).length;
|
|
2271
2280
|
if (r < e) return;
|
|
2272
2281
|
let i = r / e, a = n.roundPosition ?? 1, o = Math.floor((a - 1) / i);
|
|
2273
2282
|
return Math.min(o, e - 1);
|
|
2274
2283
|
}
|
|
2275
|
-
function
|
|
2276
|
-
let a = i.drawPositions ?? [];
|
|
2277
|
-
return a.length ? a.every(e) :
|
|
2284
|
+
function yn({ positionPredicate: e, partitionIndex: t, partitionCount: n, matchUps: r, matchUp: i }) {
|
|
2285
|
+
let a = (i.drawPositions ?? []).filter((e) => !!e);
|
|
2286
|
+
return a.length ? a.every(e) : vn({
|
|
2278
2287
|
matchUps: r,
|
|
2279
2288
|
matchUp: i,
|
|
2280
2289
|
partitionCount: n
|
|
@@ -2282,7 +2291,7 @@ function _n({ positionPredicate: e, partitionIndex: t, partitionCount: n, matchU
|
|
|
2282
2291
|
}
|
|
2283
2292
|
//#endregion
|
|
2284
2293
|
//#region src/renderers/mirroredDraw.ts
|
|
2285
|
-
function
|
|
2294
|
+
function bn(e, t, n, r) {
|
|
2286
2295
|
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;
|
|
2287
2296
|
p < 2.5 ? b = 5 : m && (b = I.TINY);
|
|
2288
2297
|
let x = m ? 5 : I.TINY, S = {
|
|
@@ -2292,19 +2301,19 @@ function vn(e, t, n, r) {
|
|
|
2292
2301
|
connectorGap: h,
|
|
2293
2302
|
fontSize: b,
|
|
2294
2303
|
scoreFontSize: x
|
|
2295
|
-
},
|
|
2304
|
+
}, C = t.slots.filter((e) => e.drawPosition <= s), ee = t.slots.filter((e) => e.drawPosition > s), te = t.matchUps.filter((e) => yn({
|
|
2296
2305
|
positionPredicate: (e) => e <= s,
|
|
2297
2306
|
matchUps: t.matchUps,
|
|
2298
2307
|
partitionIndex: 0,
|
|
2299
2308
|
partitionCount: 2,
|
|
2300
2309
|
matchUp: e
|
|
2301
|
-
})), w = t.matchUps.filter((e) =>
|
|
2310
|
+
})), w = t.matchUps.filter((e) => yn({
|
|
2302
2311
|
positionPredicate: (e) => e > s,
|
|
2303
2312
|
matchUps: t.matchUps,
|
|
2304
2313
|
partitionIndex: 1,
|
|
2305
2314
|
partitionCount: 2,
|
|
2306
2315
|
matchUp: e
|
|
2307
|
-
})), T =
|
|
2316
|
+
})), T = ee.map((e) => ({
|
|
2308
2317
|
...e,
|
|
2309
2318
|
drawPosition: e.drawPosition - s
|
|
2310
2319
|
})), E = /* @__PURE__ */ new Map();
|
|
@@ -2313,13 +2322,13 @@ function vn(e, t, n, r) {
|
|
|
2313
2322
|
for (let [, e] of E) e.sort((e, t) => e.roundPosition - t.roundPosition), e.forEach((e, t) => {
|
|
2314
2323
|
D.push({
|
|
2315
2324
|
...e,
|
|
2316
|
-
drawPositions: e.drawPositions.map((e) => e - s),
|
|
2325
|
+
drawPositions: e.drawPositions.map((e) => e === void 0 ? void 0 : e - s),
|
|
2317
2326
|
winnerDrawPosition: e.winnerDrawPosition === void 0 ? void 0 : e.winnerDrawPosition - s,
|
|
2318
2327
|
roundPosition: t + 1
|
|
2319
2328
|
});
|
|
2320
2329
|
});
|
|
2321
2330
|
let O = /* @__PURE__ */ new Map();
|
|
2322
|
-
for (let e of
|
|
2331
|
+
for (let e of te) O.has(e.roundNumber) || O.set(e.roundNumber, []), O.get(e.roundNumber).push(e);
|
|
2323
2332
|
let k = [];
|
|
2324
2333
|
for (let [, e] of O) e.sort((e, t) => e.roundPosition - t.roundPosition), e.forEach((e, t) => {
|
|
2325
2334
|
k.push({
|
|
@@ -2327,64 +2336,64 @@ function vn(e, t, n, r) {
|
|
|
2327
2336
|
roundPosition: t + 1
|
|
2328
2337
|
});
|
|
2329
2338
|
});
|
|
2330
|
-
|
|
2339
|
+
Cn(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), xn(e, C, k, c, S, n, i.left, a, t.totalRounds), Sn(e, T, D, c, S, n, i.left + l, a, t.totalRounds);
|
|
2331
2340
|
let A = t.matchUps.find((e) => e.roundNumber === t.totalRounds);
|
|
2332
2341
|
if (A) {
|
|
2333
2342
|
let r = a + o / 2;
|
|
2334
2343
|
if (e.setDrawColor(40), e.setLineWidth(.25), e.line(f + 2, r, f + u - 2, r), A.winningSide) {
|
|
2335
2344
|
let i = A.winnerDrawPosition, a = t.slots.find((e) => e.drawPosition === i);
|
|
2336
2345
|
if (a) {
|
|
2337
|
-
let { name: t } =
|
|
2346
|
+
let { name: t } = Rt(a, n);
|
|
2338
2347
|
R(e, b + 1, F.BOLD), e.text(t, f + u / 2, r - 1, { align: "center" });
|
|
2339
2348
|
}
|
|
2340
2349
|
}
|
|
2341
2350
|
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));
|
|
2342
2351
|
}
|
|
2343
2352
|
}
|
|
2344
|
-
function
|
|
2353
|
+
function xn(e, t, n, r, i, a, o, s, c) {
|
|
2345
2354
|
let l = new Map(t.map((e) => [e.drawPosition, e])), u = t.length;
|
|
2346
2355
|
for (let t = 0; t < r; t++) {
|
|
2347
|
-
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 =
|
|
2356
|
+
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 = wn(t, i, o), h = t === 0 ? i.firstRoundWidth : i.roundColumnWidth;
|
|
2348
2357
|
for (let u = 0; u < c; u++) {
|
|
2349
2358
|
let c = s + f + u * p, g = c + d, _ = (c + g) / 2;
|
|
2350
2359
|
if (t === 0) {
|
|
2351
2360
|
let t = u * 2 + 1, n = u * 2 + 2;
|
|
2352
|
-
|
|
2361
|
+
En(e, l.get(t), i, m, c, h, "ltr"), En(e, l.get(n), i, m, g, h, "ltr");
|
|
2353
2362
|
} else e.setDrawColor(40), e.setLineWidth(.25), e.line(m, c, m + h, c), e.line(m, g, m + h, g);
|
|
2354
|
-
let v = m + h, y =
|
|
2363
|
+
let v = m + h, y = wn(t + 1, i, o);
|
|
2355
2364
|
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, _);
|
|
2356
|
-
let b =
|
|
2365
|
+
let b = On(n, t + 1, u + 1);
|
|
2357
2366
|
if (t < r - 1 && b?.winningSide) {
|
|
2358
2367
|
let t = b.winnerDrawPosition, n = t === void 0 ? void 0 : l.get(t);
|
|
2359
2368
|
if (n) {
|
|
2360
2369
|
R(e, i.fontSize, F.BOLD);
|
|
2361
2370
|
let t = n.participantName;
|
|
2362
|
-
e.getTextWidth(t) > i.roundColumnWidth - 2 && (t =
|
|
2371
|
+
e.getTextWidth(t) > i.roundColumnWidth - 2 && (t = Dn(t)), e.text(t, y + 1, _ - .5);
|
|
2363
2372
|
}
|
|
2364
2373
|
}
|
|
2365
2374
|
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));
|
|
2366
2375
|
}
|
|
2367
2376
|
}
|
|
2368
2377
|
}
|
|
2369
|
-
function
|
|
2378
|
+
function Sn(e, t, n, r, i, a, o, s, c) {
|
|
2370
2379
|
let l = new Map(t.map((e) => [e.drawPosition, e])), u = t.length;
|
|
2371
2380
|
for (let t = 0; t < r; t++) {
|
|
2372
|
-
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 =
|
|
2381
|
+
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 = Tn(t, i, o), h = t === 0 ? i.firstRoundWidth : i.roundColumnWidth;
|
|
2373
2382
|
for (let u = 0; u < c; u++) {
|
|
2374
2383
|
let c = s + f + u * p, g = c + d, _ = (c + g) / 2;
|
|
2375
2384
|
if (t === 0) {
|
|
2376
2385
|
let t = u * 2 + 1, n = u * 2 + 2;
|
|
2377
|
-
|
|
2386
|
+
En(e, l.get(t), i, m, c, h, "rtl"), En(e, l.get(n), i, m, g, h, "rtl");
|
|
2378
2387
|
} else e.setDrawColor(40), e.setLineWidth(.25), e.line(m, c, m + h, c), e.line(m, g, m + h, g);
|
|
2379
|
-
let v = m, y =
|
|
2388
|
+
let v = m, y = Tn(t + 1, i, o);
|
|
2380
2389
|
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, _);
|
|
2381
|
-
let b =
|
|
2390
|
+
let b = On(n, t + 1, u + 1);
|
|
2382
2391
|
if (t < r - 1 && b?.winningSide) {
|
|
2383
2392
|
let t = b.winnerDrawPosition, n = t === void 0 ? void 0 : l.get(t);
|
|
2384
2393
|
if (n) {
|
|
2385
2394
|
R(e, i.fontSize, F.BOLD);
|
|
2386
2395
|
let t = n.participantName;
|
|
2387
|
-
e.getTextWidth(t) > i.roundColumnWidth - 2 && (t =
|
|
2396
|
+
e.getTextWidth(t) > i.roundColumnWidth - 2 && (t = Dn(t));
|
|
2388
2397
|
let r = y;
|
|
2389
2398
|
e.text(t, r + i.roundColumnWidth - 1, _ - .5, { align: "right" });
|
|
2390
2399
|
}
|
|
@@ -2396,23 +2405,23 @@ function bn(e, t, n, r, i, a, o, s, c) {
|
|
|
2396
2405
|
}
|
|
2397
2406
|
}
|
|
2398
2407
|
}
|
|
2399
|
-
function
|
|
2408
|
+
function Cn(e, t, n, r, i, a, o, s, c) {
|
|
2400
2409
|
R(e, r.fontSize <= I.TINY ? 5.5 : I.SMALL, F.BOLD), e.setTextColor(40);
|
|
2401
2410
|
for (let l = 0; l < t; l++) {
|
|
2402
|
-
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 =
|
|
2411
|
+
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 = wn(l, r, a);
|
|
2403
2412
|
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);
|
|
2404
|
-
let h =
|
|
2413
|
+
let h = Tn(l, r, o);
|
|
2405
2414
|
e.text(f, h + p / 2, s, { align: "center" }), e.line(h + 2, s + 1.5, h + p - 2, s + 1.5);
|
|
2406
2415
|
}
|
|
2407
2416
|
e.setTextColor(0);
|
|
2408
2417
|
}
|
|
2409
|
-
function
|
|
2418
|
+
function wn(e, t, n) {
|
|
2410
2419
|
return e === 0 ? n : n + t.firstRoundWidth + t.connectorGap + (e - 1) * (t.roundColumnWidth + t.connectorGap);
|
|
2411
2420
|
}
|
|
2412
|
-
function
|
|
2421
|
+
function Tn(e, t, n) {
|
|
2413
2422
|
return e === 0 ? n - t.firstRoundWidth : n - t.firstRoundWidth - t.connectorGap - (e - 1) * (t.roundColumnWidth + t.connectorGap) - t.roundColumnWidth;
|
|
2414
2423
|
}
|
|
2415
|
-
function
|
|
2424
|
+
function En(e, t, n, r, i, a, o) {
|
|
2416
2425
|
if (e.setDrawColor(40), e.setLineWidth(.25), e.line(r, i, r + a, i), !t || t.isBye) {
|
|
2417
2426
|
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));
|
|
2418
2427
|
return;
|
|
@@ -2420,45 +2429,45 @@ function wn(e, t, n, r, i, a, o) {
|
|
|
2420
2429
|
let s = t.seedValue ? `[${t.seedValue}]` : "";
|
|
2421
2430
|
R(e, n.fontSize, F.NORMAL);
|
|
2422
2431
|
let c = t.participantName, l = s ? `${s} ${c}` : c;
|
|
2423
|
-
e.getTextWidth(l) > a - 2 && (c =
|
|
2432
|
+
e.getTextWidth(l) > a - 2 && (c = Dn(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" });
|
|
2424
2433
|
}
|
|
2425
|
-
function
|
|
2434
|
+
function Dn(e) {
|
|
2426
2435
|
let t = e.match(/^([^,]+),\s*(.+)/);
|
|
2427
2436
|
if (t) return `${t[2][0]}. ${t[1]}`;
|
|
2428
2437
|
let n = e.match(/^(\S+)\s+(.+)/);
|
|
2429
2438
|
return n ? `${n[1][0]}. ${n[2]}` : e;
|
|
2430
2439
|
}
|
|
2431
|
-
function
|
|
2440
|
+
function On(e, t, n) {
|
|
2432
2441
|
return e.find((e) => e.roundNumber === t && e.roundPosition === n);
|
|
2433
2442
|
}
|
|
2434
2443
|
//#endregion
|
|
2435
2444
|
//#region src/renderers/backdrawDraw.ts
|
|
2436
|
-
function
|
|
2437
|
-
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,
|
|
2445
|
+
function kn(e, t, n, r) {
|
|
2446
|
+
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, C = Math.max(y + 1, 1), ee = x * (S / (S + C)), te = x - ee, w = i.left + te + b, T = S > 0 ? (ee - b * S) / S : 0, E = w + 28 + b, D = C > 0 ? (te - b * C) / C : 0, O = i.left + te, k = o / g, A = k < 3.5, j = I.SMALL;
|
|
2438
2447
|
k < 2.5 ? j = 5 : A && (j = I.TINY);
|
|
2439
2448
|
let ne = A ? 5 : I.TINY;
|
|
2440
|
-
|
|
2449
|
+
Rn(e, _, y, t, n, w, 28, E, T, O, D, b, r.contentY + 2, j), An(e, m, h, f, w, 28, b, E, O, a, k, j, y), Mn(e, c, f, _, h, E, T, b, a, k, j, ne, n, t.mainDraw.roundLabelMap), Nn(e, u, p, y, O, D, b, a, k, h, j, ne, n, t.consolation.roundLabelMap);
|
|
2441
2450
|
}
|
|
2442
|
-
function
|
|
2451
|
+
function An(e, t, n, r, i, a, o, s, c, l, u, d, f) {
|
|
2443
2452
|
for (let p = 0; p < n; p++) {
|
|
2444
2453
|
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;
|
|
2445
2454
|
e.setDrawColor(40), e.setLineWidth(.3), e.rect(i, m, a, y), e.rect(i, h, a, y);
|
|
2446
2455
|
let b = _ ? r.get(_) : void 0, x = v ? r.get(v) : void 0;
|
|
2447
|
-
R(e, d, F.NORMAL), _ &&
|
|
2456
|
+
R(e, d, F.NORMAL), _ && jn(e, _, b, n.winningSide === 1, i, m, y, a, d), v && jn(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));
|
|
2448
2457
|
}
|
|
2449
2458
|
}
|
|
2450
|
-
function
|
|
2459
|
+
function jn(e, t, n, r, i, a, o, s, c) {
|
|
2451
2460
|
if (e.setTextColor(120), R(e, c, F.NORMAL), e.text(`${t}`, i + 1, a + o / 2 + c * .12), e.setTextColor(0), n?.participantName) {
|
|
2452
|
-
let t =
|
|
2461
|
+
let t = zn(n.participantName);
|
|
2453
2462
|
R(e, c, r ? F.BOLD : F.NORMAL), e.text(t, i + 5, a + o / 2 + c * .12, { maxWidth: s - 6 });
|
|
2454
2463
|
}
|
|
2455
2464
|
}
|
|
2456
|
-
function
|
|
2465
|
+
function Mn(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
2457
2466
|
for (let i = 0; i < r - 1; i++) {
|
|
2458
2467
|
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);
|
|
2459
2468
|
for (let t = 0; t < m.length; t++) {
|
|
2460
2469
|
let l = m[t], p = c + g + t * h * 2, v = p + h, y = (p + v) / 2;
|
|
2461
|
-
if (e.setDrawColor(40), e.setLineWidth(.25), e.line(_, p, _ + o, p), e.line(_, v, _ + o, v),
|
|
2470
|
+
if (e.setDrawColor(40), e.setLineWidth(.25), e.line(_, p, _ + o, p), e.line(_, v, _ + o, v), Ln(e, l, n, _, p, v, o, u, f), i < r - 2) {
|
|
2462
2471
|
let t = _ + o;
|
|
2463
2472
|
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);
|
|
2464
2473
|
}
|
|
@@ -2471,20 +2480,20 @@ function An(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
|
2471
2480
|
if (g?.winningSide) {
|
|
2472
2481
|
let t = g.winnerDrawPosition, r = t === void 0 ? void 0 : n.get(t);
|
|
2473
2482
|
if (r) {
|
|
2474
|
-
let { name: t } =
|
|
2483
|
+
let { name: t } = Rt(r, f);
|
|
2475
2484
|
R(e, u + 1, F.BOLD), e.text(t, m + 1, h - .5);
|
|
2476
2485
|
}
|
|
2477
2486
|
}
|
|
2478
2487
|
}
|
|
2479
|
-
function
|
|
2480
|
-
for (let l = 0; l < r; l++)
|
|
2481
|
-
|
|
2488
|
+
function Nn(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
2489
|
+
for (let l = 0; l < r; l++) Pn(e, t, n, l, r, i, a, o, s, c, u, d, f);
|
|
2490
|
+
In(e, t, n, r, i, a, o, s, c, u, f);
|
|
2482
2491
|
}
|
|
2483
|
-
function
|
|
2492
|
+
function Pn(e, t, n, r, i, a, o, s, c, l, u, d, f) {
|
|
2484
2493
|
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);
|
|
2485
2494
|
for (let t = 0; t < m.length; t++) {
|
|
2486
2495
|
let l = m[t], p = c + g + t * h * 2, v = p + h, y = (p + v) / 2;
|
|
2487
|
-
if (e.setDrawColor(40), e.setLineWidth(.25), e.line(_, p, _ + o, p), e.line(_, v, _ + o, v),
|
|
2496
|
+
if (e.setDrawColor(40), e.setLineWidth(.25), e.line(_, p, _ + o, p), e.line(_, v, _ + o, v), Fn(e, l.drawPositions[0], n, u, _, o, p), Fn(e, l.drawPositions[1], n, u, _, o, v), r < i - 1) {
|
|
2488
2497
|
e.line(_ - s, p, _ - s, v), e.line(_, p, _ - s, p), e.line(_, v, _ - s, v);
|
|
2489
2498
|
let t = a - (r + 2) * (o + s);
|
|
2490
2499
|
e.line(_ - s, y, t + o, y);
|
|
@@ -2492,15 +2501,15 @@ function Mn(e, t, n, r, i, a, o, s, c, l, u, d, f) {
|
|
|
2492
2501
|
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));
|
|
2493
2502
|
}
|
|
2494
2503
|
}
|
|
2495
|
-
function
|
|
2504
|
+
function Fn(e, t, n, r, i, a, o) {
|
|
2496
2505
|
if (!t) return;
|
|
2497
2506
|
let s = n.get(t);
|
|
2498
2507
|
if (!s?.participantName) return;
|
|
2499
2508
|
R(e, r, F.BOLD);
|
|
2500
2509
|
let c = s.participantName;
|
|
2501
|
-
e.getTextWidth(c) > a - 2 && (c =
|
|
2510
|
+
e.getTextWidth(c) > a - 2 && (c = zn(c)), e.text(c, i + a - 1, o - .3, { align: "right" });
|
|
2502
2511
|
}
|
|
2503
|
-
function
|
|
2512
|
+
function In(e, t, n, r, i, a, o, s, c, l, u) {
|
|
2504
2513
|
if (r <= 0) return;
|
|
2505
2514
|
let d = i - (r + 1) * (a + o), f = s + (2 ** r - 1) * c / 2 + c * 2 ** (r - 1);
|
|
2506
2515
|
e.setDrawColor(40), e.setLineWidth(.25), e.line(d, f, d + a, f);
|
|
@@ -2508,18 +2517,18 @@ function Pn(e, t, n, r, i, a, o, s, c, l, u) {
|
|
|
2508
2517
|
if (p?.winningSide) {
|
|
2509
2518
|
let t = p.winnerDrawPosition, r = t === void 0 ? void 0 : n.get(t);
|
|
2510
2519
|
if (r) {
|
|
2511
|
-
let { name: t } =
|
|
2520
|
+
let { name: t } = Rt(r, u);
|
|
2512
2521
|
R(e, l + 1, F.BOLD), e.text(t, d + a - 1, f - .5, { align: "right" });
|
|
2513
2522
|
}
|
|
2514
2523
|
}
|
|
2515
2524
|
}
|
|
2516
|
-
function
|
|
2525
|
+
function Ln(e, t, n, r, i, a, o, s, c) {
|
|
2517
2526
|
if (t.drawPositions[0]) {
|
|
2518
2527
|
let a = n.get(t.drawPositions[0]);
|
|
2519
2528
|
if (a?.participantName) {
|
|
2520
2529
|
R(e, s, F.BOLD);
|
|
2521
2530
|
let t = a.participantName;
|
|
2522
|
-
e.getTextWidth(t) > o - 2 && (t =
|
|
2531
|
+
e.getTextWidth(t) > o - 2 && (t = zn(t)), e.text(t, r + 1, i - .3);
|
|
2523
2532
|
}
|
|
2524
2533
|
}
|
|
2525
2534
|
if (t.drawPositions[1]) {
|
|
@@ -2527,11 +2536,11 @@ function Fn(e, t, n, r, i, a, o, s, c) {
|
|
|
2527
2536
|
if (i?.participantName) {
|
|
2528
2537
|
R(e, s, F.BOLD);
|
|
2529
2538
|
let t = i.participantName;
|
|
2530
|
-
e.getTextWidth(t) > o - 2 && (t =
|
|
2539
|
+
e.getTextWidth(t) > o - 2 && (t = zn(t)), e.text(t, r + 1, a - .3);
|
|
2531
2540
|
}
|
|
2532
2541
|
}
|
|
2533
2542
|
}
|
|
2534
|
-
function
|
|
2543
|
+
function Rn(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
2535
2544
|
R(e, p <= I.TINY ? 5.5 : I.SMALL, F.BOLD), e.setTextColor(40);
|
|
2536
2545
|
let m = r.mainDraw.roundLabelMap?.[1] || "R1";
|
|
2537
2546
|
e.text(m, a + o / 2, f, { align: "center" });
|
|
@@ -2545,7 +2554,7 @@ function In(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
|
2545
2554
|
}
|
|
2546
2555
|
e.setTextColor(0);
|
|
2547
2556
|
}
|
|
2548
|
-
function
|
|
2557
|
+
function zn(e) {
|
|
2549
2558
|
let t = e.match(/^([^,]+),\s*(.+)/);
|
|
2550
2559
|
if (t) return `${t[2][0]}. ${t[1]}`;
|
|
2551
2560
|
let n = e.match(/^(\S+)\s+(.+)/);
|
|
@@ -2553,7 +2562,7 @@ function Ln(e) {
|
|
|
2553
2562
|
}
|
|
2554
2563
|
//#endregion
|
|
2555
2564
|
//#region src/renderers/compassDraw.ts
|
|
2556
|
-
var
|
|
2565
|
+
var Bn = [
|
|
2557
2566
|
"E",
|
|
2558
2567
|
"W",
|
|
2559
2568
|
"N",
|
|
@@ -2563,11 +2572,11 @@ var Rn = [
|
|
|
2563
2572
|
"SE",
|
|
2564
2573
|
"SW"
|
|
2565
2574
|
];
|
|
2566
|
-
function
|
|
2567
|
-
let i = n.page.margins, a = [...t.structures].sort((e, t) =>
|
|
2575
|
+
function Vn(e, t, n, r) {
|
|
2576
|
+
let i = n.page.margins, a = [...t.structures].sort((e, t) => Bn.indexOf(e.abbreviation) - Bn.indexOf(t.abbreviation)), o = r.contentY + 3;
|
|
2568
2577
|
for (let s of a) {
|
|
2569
2578
|
if (s.drawSize === 0) continue;
|
|
2570
|
-
let a =
|
|
2579
|
+
let a = Hn(s, r);
|
|
2571
2580
|
o + a > r.contentY + r.contentHeight && (e.addPage(), o = r.contentY);
|
|
2572
2581
|
let c = s.abbreviation === "E";
|
|
2573
2582
|
R(e, c ? I.HEADING : I.BODY, F.BOLD), c || e.setTextColor(30, 60, 120);
|
|
@@ -2578,14 +2587,14 @@ function zn(e, t, n, r) {
|
|
|
2578
2587
|
contentY: o,
|
|
2579
2588
|
contentHeight: a - 6
|
|
2580
2589
|
};
|
|
2581
|
-
J(e,
|
|
2590
|
+
J(e, Un(s, t.drawName), n, u), o += a + 3;
|
|
2582
2591
|
}
|
|
2583
2592
|
}
|
|
2584
|
-
function
|
|
2593
|
+
function Hn(e, t) {
|
|
2585
2594
|
let n = t.contentHeight * .7, r = Math.max(5, Math.min(8, n / e.drawSize));
|
|
2586
2595
|
return e.drawSize * r + 10;
|
|
2587
2596
|
}
|
|
2588
|
-
function
|
|
2597
|
+
function Un(e, t) {
|
|
2589
2598
|
return {
|
|
2590
2599
|
drawName: `${t} - ${e.name}`,
|
|
2591
2600
|
drawSize: e.drawSize,
|
|
@@ -2598,7 +2607,7 @@ function Vn(e, t) {
|
|
|
2598
2607
|
}
|
|
2599
2608
|
//#endregion
|
|
2600
2609
|
//#region src/renderers/consolationDraw.ts
|
|
2601
|
-
function
|
|
2610
|
+
function Wn(e) {
|
|
2602
2611
|
let { drawDefinition: t, participants: n = [] } = e;
|
|
2603
2612
|
if (!t?.structures) return [];
|
|
2604
2613
|
let r = /* @__PURE__ */ new Map();
|
|
@@ -2616,7 +2625,7 @@ function Hn(e) {
|
|
|
2616
2625
|
roundNumber: e.roundNumber,
|
|
2617
2626
|
roundPosition: e.roundPosition,
|
|
2618
2627
|
drawPositions: e.drawPositions || [],
|
|
2619
|
-
winnerDrawPosition:
|
|
2628
|
+
winnerDrawPosition: me(e),
|
|
2620
2629
|
score: e.score?.scoreStringSide1 || "",
|
|
2621
2630
|
winningSide: e.winningSide,
|
|
2622
2631
|
matchUpStatus: e.matchUpStatus
|
|
@@ -2649,7 +2658,7 @@ function Hn(e) {
|
|
|
2649
2658
|
};
|
|
2650
2659
|
});
|
|
2651
2660
|
}
|
|
2652
|
-
function
|
|
2661
|
+
function Gn(e, t, n, r) {
|
|
2653
2662
|
let i = n.page.margins, a = r.contentY, o = {
|
|
2654
2663
|
MAIN: 0,
|
|
2655
2664
|
CONSOLATION: 1,
|
|
@@ -2668,8 +2677,8 @@ function Un(e, t, n, r) {
|
|
|
2668
2677
|
}
|
|
2669
2678
|
//#endregion
|
|
2670
2679
|
//#region src/renderers/doubleEliminationDraw.ts
|
|
2671
|
-
function
|
|
2672
|
-
let i = n.page.margins, a = r.contentHeight, o = a * .44, s = a * .44, c = r.contentWidth - 30 - 8, l =
|
|
2680
|
+
function Kn(e, t, n, r) {
|
|
2681
|
+
let i = n.page.margins, a = r.contentHeight, o = a * .44, s = a * .44, c = r.contentWidth - 30 - 8, l = qn(t.winnersBracket), u = r.contentY + 3;
|
|
2673
2682
|
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, {
|
|
2674
2683
|
...r,
|
|
2675
2684
|
contentY: u,
|
|
@@ -2703,7 +2712,7 @@ function Wn(e, t, n, r) {
|
|
|
2703
2712
|
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));
|
|
2704
2713
|
}
|
|
2705
2714
|
}
|
|
2706
|
-
function
|
|
2715
|
+
function qn(e) {
|
|
2707
2716
|
let t = { ...e.roundLabelMap || {} };
|
|
2708
2717
|
for (let e of Object.keys(t)) t[Number(e)] === "F-Q" && (t[Number(e)] = "SF");
|
|
2709
2718
|
return {
|
|
@@ -2713,11 +2722,11 @@ function Gn(e) {
|
|
|
2713
2722
|
}
|
|
2714
2723
|
//#endregion
|
|
2715
2724
|
//#region src/renderers/luckyDraw.ts
|
|
2716
|
-
var
|
|
2717
|
-
function
|
|
2725
|
+
var Jn = 1, Yn = 16, Xn = 1;
|
|
2726
|
+
function Zn(e, t, n, r) {
|
|
2718
2727
|
let i = n.page.margins, a = /* @__PURE__ */ new Map();
|
|
2719
2728
|
for (let e of t.matchUps) a.has(e.roundNumber) || a.set(e.roundNumber, []), a.get(e.roundNumber).push(e);
|
|
2720
|
-
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(
|
|
2729
|
+
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(Yn, (u - (f + 1) * Xn) / f);
|
|
2721
2730
|
R(e, I.SMALL, F.BOLD), e.setTextColor(30, 60, 120);
|
|
2722
2731
|
for (let a = 0; a < c; a++) {
|
|
2723
2732
|
let o = s[a], c = n.roundLabels[K(o, t.totalRounds)] || K(o, t.totalRounds), l = i.left + a * (d + 6);
|
|
@@ -2728,38 +2737,38 @@ function Yn(e, t, n, r) {
|
|
|
2728
2737
|
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;
|
|
2729
2738
|
for (let t = 0; t < f; t++) {
|
|
2730
2739
|
let r = l + g + t * (p + g);
|
|
2731
|
-
|
|
2740
|
+
Qn(e, c[t], o, n, m, r, d, p);
|
|
2732
2741
|
}
|
|
2733
2742
|
}
|
|
2734
2743
|
}
|
|
2735
|
-
function
|
|
2744
|
+
function Qn(e, t, n, r, i, a, o, s) {
|
|
2736
2745
|
let c = s < 10 ? 5 : I.TINY;
|
|
2737
2746
|
e.setDrawColor(100), e.setLineWidth(.3), e.rect(i, a, o, s);
|
|
2738
2747
|
let l = a + s / 2;
|
|
2739
2748
|
e.setLineWidth(.15), e.line(i, l, i + o, l);
|
|
2740
2749
|
let u = t.drawPositions[0] ? n.get(t.drawPositions[0]) : void 0;
|
|
2741
2750
|
if (u) {
|
|
2742
|
-
let n =
|
|
2743
|
-
R(e, c, t.winningSide === 1 ? F.BOLD : F.NORMAL), e.text(n, i +
|
|
2751
|
+
let n = Lt(u, r);
|
|
2752
|
+
R(e, c, t.winningSide === 1 ? F.BOLD : F.NORMAL), e.text(n, i + Jn, l - c * .15, { maxWidth: o - 2 });
|
|
2744
2753
|
}
|
|
2745
2754
|
let d = t.drawPositions[1] ? n.get(t.drawPositions[1]) : void 0;
|
|
2746
2755
|
if (d) {
|
|
2747
|
-
let n =
|
|
2748
|
-
R(e, c, t.winningSide === 2 ? F.BOLD : F.NORMAL), e.text(n, i +
|
|
2756
|
+
let n = Lt(d, r);
|
|
2757
|
+
R(e, c, t.winningSide === 2 ? F.BOLD : F.NORMAL), e.text(n, i + Jn, l + c * .55, { maxWidth: o - 2 });
|
|
2749
2758
|
}
|
|
2750
2759
|
if (t.score) {
|
|
2751
2760
|
let n = q(t.score, r);
|
|
2752
|
-
R(e, c, F.NORMAL), e.setTextColor(60, 60, 160), e.text(n, i + o -
|
|
2761
|
+
R(e, c, F.NORMAL), e.setTextColor(60, 60, 160), e.text(n, i + o - Jn, a + c * .5, { align: "right" }), e.setTextColor(0);
|
|
2753
2762
|
}
|
|
2754
2763
|
}
|
|
2755
2764
|
//#endregion
|
|
2756
2765
|
//#region src/renderers/drawSplitter.ts
|
|
2757
|
-
var
|
|
2766
|
+
var $n = {
|
|
2758
2767
|
maxPositionsPerPage: 64,
|
|
2759
2768
|
includeOverlapRounds: !0,
|
|
2760
2769
|
summaryPage: !0
|
|
2761
2770
|
};
|
|
2762
|
-
function
|
|
2771
|
+
function er(e, t = $n) {
|
|
2763
2772
|
let { drawSize: n, slots: r, matchUps: i, totalRounds: a } = e;
|
|
2764
2773
|
if (n <= t.maxPositionsPerPage) return [{
|
|
2765
2774
|
label: "Full Draw",
|
|
@@ -2770,13 +2779,13 @@ function Qn(e, t = Zn) {
|
|
|
2770
2779
|
segmentRounds: a
|
|
2771
2780
|
}];
|
|
2772
2781
|
let o = t.maxPositionsPerPage, s = Math.ceil(n / o), c = Math.log2(o), l = [];
|
|
2773
|
-
for (let e = 0; e < s; e++) l.push(
|
|
2774
|
-
return t.summaryPage && s > 1 && l.push(
|
|
2782
|
+
for (let e = 0; e < s; e++) l.push(tr(e, o, s, c, n, r, i));
|
|
2783
|
+
return t.summaryPage && s > 1 && l.push(nr(e)), l;
|
|
2775
2784
|
}
|
|
2776
|
-
function
|
|
2785
|
+
function tr(e, t, n, r, i, a, o) {
|
|
2777
2786
|
let s = e * t + 1, c = Math.min((e + 1) * t, i), l = `Section ${e + 1}`;
|
|
2778
2787
|
n === 2 && (l = e === 0 ? "Top Half" : "Bottom Half");
|
|
2779
|
-
let u = a.filter((e) => e.drawPosition >= s && e.drawPosition <= c), d =
|
|
2788
|
+
let u = a.filter((e) => e.drawPosition >= s && e.drawPosition <= c), d = rr(o.filter((t) => t.roundNumber > r ? !1 : yn({
|
|
2780
2789
|
positionPredicate: (e) => e >= s && e <= c,
|
|
2781
2790
|
partitionCount: n,
|
|
2782
2791
|
partitionIndex: e,
|
|
@@ -2793,12 +2802,12 @@ function $n(e, t, n, r, i, a, o) {
|
|
|
2793
2802
|
noWinnerColumn: !0
|
|
2794
2803
|
};
|
|
2795
2804
|
}
|
|
2796
|
-
function
|
|
2797
|
-
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 =
|
|
2805
|
+
function nr(e) {
|
|
2806
|
+
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 = ir(c), d = rr(n.filter((e) => e.roundNumber >= a).map((e) => ({
|
|
2798
2807
|
...e,
|
|
2799
2808
|
roundNumber: e.roundNumber - s,
|
|
2800
2809
|
roundPosition: e.roundNumber === a ? c.findIndex((t) => t.roundPosition === e.roundPosition) + 1 : e.roundPosition,
|
|
2801
|
-
drawPositions: e.drawPositions.map((e) => u.get(e) || e),
|
|
2810
|
+
drawPositions: e.drawPositions.map((e) => e === void 0 ? void 0 : u.get(e) || e),
|
|
2802
2811
|
winnerDrawPosition: e.winnerDrawPosition === void 0 ? void 0 : u.get(e.winnerDrawPosition) || e.winnerDrawPosition
|
|
2803
2812
|
}))), f = [];
|
|
2804
2813
|
for (let [e, n] of u) {
|
|
@@ -2818,7 +2827,7 @@ function er(e) {
|
|
|
2818
2827
|
roundLabelMap: i ? Object.fromEntries(Object.entries(i).filter(([e]) => Number(e) >= a).map(([e, t]) => [Number(e) - s, t])) : void 0
|
|
2819
2828
|
};
|
|
2820
2829
|
}
|
|
2821
|
-
function
|
|
2830
|
+
function rr(e) {
|
|
2822
2831
|
let t = /* @__PURE__ */ new Map();
|
|
2823
2832
|
for (let n of e) t.has(n.roundNumber) || t.set(n.roundNumber, []), t.get(n.roundNumber).push(n);
|
|
2824
2833
|
let n = [];
|
|
@@ -2830,17 +2839,17 @@ function tr(e) {
|
|
|
2830
2839
|
});
|
|
2831
2840
|
return n;
|
|
2832
2841
|
}
|
|
2833
|
-
function
|
|
2842
|
+
function ir(e) {
|
|
2834
2843
|
let t = /* @__PURE__ */ new Map(), n = 1;
|
|
2835
2844
|
for (let r of e) for (let e of r.drawPositions) e && !t.has(e) && t.set(e, n++);
|
|
2836
2845
|
return t;
|
|
2837
2846
|
}
|
|
2838
2847
|
//#endregion
|
|
2839
2848
|
//#region src/generators/drawPDF.ts
|
|
2840
|
-
function
|
|
2841
|
-
return
|
|
2849
|
+
function ar(e, t = {}) {
|
|
2850
|
+
return or(e.matchUps) ? lr(e, t) : sr(e, t);
|
|
2842
2851
|
}
|
|
2843
|
-
function
|
|
2852
|
+
function or(e) {
|
|
2844
2853
|
let t = /* @__PURE__ */ new Map();
|
|
2845
2854
|
for (let n of e) t.set(n.roundNumber, (t.get(n.roundNumber) || 0) + 1);
|
|
2846
2855
|
let n = [...t.keys()].sort((e, t) => e - t);
|
|
@@ -2850,16 +2859,16 @@ function ir(e) {
|
|
|
2850
2859
|
}
|
|
2851
2860
|
return !1;
|
|
2852
2861
|
}
|
|
2853
|
-
function
|
|
2854
|
-
if (e.drawSize >= 256) return
|
|
2862
|
+
function sr(e, t = {}) {
|
|
2863
|
+
if (e.drawSize >= 256) return cr(e, {
|
|
2855
2864
|
...t,
|
|
2856
2865
|
maxPositionsPerPage: 64
|
|
2857
2866
|
});
|
|
2858
2867
|
let n = Y(e.drawSize, t), r = z(n.doc, n.pageConfig, n.headerH, n.footerH);
|
|
2859
2868
|
return J(n.doc, e, n.format, r), X(n), n.doc;
|
|
2860
2869
|
}
|
|
2861
|
-
function
|
|
2862
|
-
let n = Y(e.drawSize, t), r =
|
|
2870
|
+
function cr(e, t = {}) {
|
|
2871
|
+
let n = Y(e.drawSize, t), r = er(e, {
|
|
2863
2872
|
maxPositionsPerPage: t.maxPositionsPerPage || 32,
|
|
2864
2873
|
includeOverlapRounds: !0,
|
|
2865
2874
|
summaryPage: !0
|
|
@@ -2885,36 +2894,36 @@ function or(e, t = {}) {
|
|
|
2885
2894
|
}
|
|
2886
2895
|
return X(n), n.doc;
|
|
2887
2896
|
}
|
|
2888
|
-
function
|
|
2897
|
+
function lr(e, t = {}) {
|
|
2889
2898
|
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);
|
|
2890
2899
|
return J(r.doc, e, r.format, i), X(r), r.doc;
|
|
2891
2900
|
}
|
|
2892
|
-
function
|
|
2901
|
+
function ur(e, t = {}) {
|
|
2893
2902
|
let n = Y(Math.max(...e.map((e) => e.drawData.drawSize), 8), t), r = z(n.doc, n.pageConfig, n.headerH, n.footerH);
|
|
2894
|
-
return
|
|
2903
|
+
return Gn(n.doc, e, n.format, r), gr(n, 1), X(n), n.doc;
|
|
2895
2904
|
}
|
|
2896
|
-
function
|
|
2905
|
+
function dr(e, t = {}) {
|
|
2897
2906
|
let n = Y(e.mainStructure?.drawSize || 8, t), r = z(n.doc, n.pageConfig, n.headerH, n.footerH);
|
|
2898
|
-
return
|
|
2907
|
+
return Vn(n.doc, e, n.format, r), gr(n, 1), X(n), n.doc;
|
|
2899
2908
|
}
|
|
2900
|
-
function
|
|
2909
|
+
function fr(e, t = {}) {
|
|
2901
2910
|
let n = Y(e.drawSize, t, !0), r = z(n.doc, n.pageConfig, n.headerH, n.footerH);
|
|
2902
|
-
return
|
|
2911
|
+
return bn(n.doc, e, n.format, r), X(n), n.doc;
|
|
2903
2912
|
}
|
|
2904
|
-
function
|
|
2913
|
+
function pr(e, t = {}) {
|
|
2905
2914
|
let n = Y(e.mainDraw.drawSize, t, !0), r = z(n.doc, n.pageConfig, n.headerH, n.footerH);
|
|
2906
|
-
return
|
|
2915
|
+
return kn(n.doc, e, n.format, r), X(n), n.doc;
|
|
2907
2916
|
}
|
|
2908
|
-
function
|
|
2917
|
+
function mr(e, t = {}) {
|
|
2909
2918
|
let n = Y(Math.max(e.winnersBracket.drawSize, e.losersBracket.drawSize, 8), t, !0), r = z(n.doc, n.pageConfig, n.headerH, n.footerH);
|
|
2910
|
-
return
|
|
2919
|
+
return Kn(n.doc, e, n.format, r), X(n), n.doc;
|
|
2911
2920
|
}
|
|
2912
|
-
function
|
|
2921
|
+
function hr(e, t = {}) {
|
|
2913
2922
|
let n = Y(e.drawSize, t), r = z(n.doc, n.pageConfig, n.headerH, n.footerH);
|
|
2914
|
-
return
|
|
2923
|
+
return Zn(n.doc, e, n.format, r), X(n), n.doc;
|
|
2915
2924
|
}
|
|
2916
2925
|
function Y(e, t, n) {
|
|
2917
|
-
let r = t.format ||
|
|
2926
|
+
let r = t.format || g(t.preset || "itfJunior"), i = {
|
|
2918
2927
|
...r.page,
|
|
2919
2928
|
...t.page,
|
|
2920
2929
|
orientation: n ? "landscape" : t.page?.orientation || r.page.orientation
|
|
@@ -2925,7 +2934,7 @@ function Y(e, t, n) {
|
|
|
2925
2934
|
layout: "standard",
|
|
2926
2935
|
showPageNumbers: !0,
|
|
2927
2936
|
showTimestamp: !0
|
|
2928
|
-
}, s =
|
|
2937
|
+
}, s = Ce(i, e), c = V(o);
|
|
2929
2938
|
return {
|
|
2930
2939
|
doc: s,
|
|
2931
2940
|
pageConfig: i,
|
|
@@ -2936,18 +2945,18 @@ function Y(e, t, n) {
|
|
|
2936
2945
|
footerH: c
|
|
2937
2946
|
};
|
|
2938
2947
|
}
|
|
2939
|
-
function
|
|
2948
|
+
function gr(e, t) {
|
|
2940
2949
|
let n = e.doc.getNumberOfPages();
|
|
2941
2950
|
for (let r = t + 1; r <= n; r++) e.doc.setPage(r), B(e.doc, e.headerConfig, e.pageConfig);
|
|
2942
2951
|
}
|
|
2943
2952
|
function X(e) {
|
|
2944
2953
|
let t = e.doc.getNumberOfPages();
|
|
2945
|
-
for (let n = 1; n <= t; n++) e.doc.setPage(n),
|
|
2954
|
+
for (let n = 1; n <= t; n++) e.doc.setPage(n), Ge(e.doc, e.footerConfig, e.pageConfig, n);
|
|
2946
2955
|
e.doc.setPage(t);
|
|
2947
2956
|
}
|
|
2948
2957
|
//#endregion
|
|
2949
2958
|
//#region src/composition/composeOrderOfPlayOptions.ts
|
|
2950
|
-
function
|
|
2959
|
+
function _r(e) {
|
|
2951
2960
|
let t = e.header ? {
|
|
2952
2961
|
...e.header,
|
|
2953
2962
|
layout: e.header.layout ?? "itf",
|
|
@@ -2967,7 +2976,7 @@ function hr(e) {
|
|
|
2967
2976
|
}
|
|
2968
2977
|
//#endregion
|
|
2969
2978
|
//#region src/composition/printDispatcher.ts
|
|
2970
|
-
function
|
|
2979
|
+
function vr(e, t) {
|
|
2971
2980
|
let n = e?.sides?.find((e) => e?.sideNumber === t);
|
|
2972
2981
|
return {
|
|
2973
2982
|
name: n?.participant?.participantName ?? "TBD",
|
|
@@ -2975,7 +2984,7 @@ function gr(e, t) {
|
|
|
2975
2984
|
seedValue: n?.seedValue
|
|
2976
2985
|
};
|
|
2977
2986
|
}
|
|
2978
|
-
function
|
|
2987
|
+
function yr(e, t) {
|
|
2979
2988
|
if (!e?.type) return {
|
|
2980
2989
|
success: !1,
|
|
2981
2990
|
error: "Missing request type"
|
|
@@ -2989,15 +2998,15 @@ function _r(e, t) {
|
|
|
2989
2998
|
error: "Missing tournamentEngine in context"
|
|
2990
2999
|
};
|
|
2991
3000
|
switch (e.type) {
|
|
2992
|
-
case "schedule": return
|
|
2993
|
-
case "playerList": return
|
|
2994
|
-
case "signInSheet": return
|
|
2995
|
-
case "courtCards": return
|
|
2996
|
-
case "matchCard": return
|
|
2997
|
-
case "draw": return
|
|
3001
|
+
case "schedule": return Fr(e, t);
|
|
3002
|
+
case "playerList": return Ar(e, t);
|
|
3003
|
+
case "signInSheet": return jr(e, t);
|
|
3004
|
+
case "courtCards": return Mr(e, t);
|
|
3005
|
+
case "matchCard": return Pr(e, t);
|
|
3006
|
+
case "draw": return br(e, t);
|
|
2998
3007
|
}
|
|
2999
3008
|
}
|
|
3000
|
-
function
|
|
3009
|
+
function br(e, t) {
|
|
3001
3010
|
if (!e.drawId) return {
|
|
3002
3011
|
success: !1,
|
|
3003
3012
|
error: "PrintDrawRequest requires drawId"
|
|
@@ -3012,26 +3021,26 @@ function vr(e, t) {
|
|
|
3012
3021
|
success: !1,
|
|
3013
3022
|
error: `No draw data found for drawId "${e.drawId}"`
|
|
3014
3023
|
};
|
|
3015
|
-
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 =
|
|
3016
|
-
header:
|
|
3017
|
-
footer:
|
|
3024
|
+
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 = Dr(e.composition, "draw")?.splitStrategy ?? "single-page", d = {
|
|
3025
|
+
header: wr(e.composition, i, a),
|
|
3026
|
+
footer: Tr(e.composition),
|
|
3018
3027
|
page: e.composition.page,
|
|
3019
3028
|
preset: void 0
|
|
3020
3029
|
}, f;
|
|
3021
3030
|
try {
|
|
3022
|
-
if (c && l) f =
|
|
3023
|
-
winnersBracket: s ? N(s) :
|
|
3024
|
-
losersBracket:
|
|
3025
|
-
deciderMatch:
|
|
3031
|
+
if (c && l) f = mr({
|
|
3032
|
+
winnersBracket: s ? N(s) : xr(),
|
|
3033
|
+
losersBracket: Sr(r),
|
|
3034
|
+
deciderMatch: Cr(r)
|
|
3026
3035
|
}, d);
|
|
3027
|
-
else if (c) f =
|
|
3036
|
+
else if (c) f = ur(o.map((e) => ({
|
|
3028
3037
|
name: e.structureName,
|
|
3029
3038
|
stage: e.stage,
|
|
3030
3039
|
drawData: N(e)
|
|
3031
3040
|
})), d);
|
|
3032
3041
|
else if (s) {
|
|
3033
3042
|
let e = N(s);
|
|
3034
|
-
f = u === "single-page" ?
|
|
3043
|
+
f = u === "single-page" ? sr(e, d) : cr(e, d);
|
|
3035
3044
|
}
|
|
3036
3045
|
} catch (e) {
|
|
3037
3046
|
return {
|
|
@@ -3051,7 +3060,7 @@ function vr(e, t) {
|
|
|
3051
3060
|
filename: `draw-${p}.pdf`
|
|
3052
3061
|
};
|
|
3053
3062
|
}
|
|
3054
|
-
function
|
|
3063
|
+
function xr() {
|
|
3055
3064
|
return {
|
|
3056
3065
|
drawName: "",
|
|
3057
3066
|
drawSize: 0,
|
|
@@ -3062,15 +3071,15 @@ function yr() {
|
|
|
3062
3071
|
seedAssignments: []
|
|
3063
3072
|
};
|
|
3064
3073
|
}
|
|
3065
|
-
function
|
|
3074
|
+
function Sr(e) {
|
|
3066
3075
|
let t = P(e.drawsData, "CONSOLATION");
|
|
3067
|
-
return t ? N(t) :
|
|
3076
|
+
return t ? N(t) : xr();
|
|
3068
3077
|
}
|
|
3069
|
-
function
|
|
3078
|
+
function Cr(e) {
|
|
3070
3079
|
let t = P(e.drawsData, "PLAY_OFF");
|
|
3071
3080
|
return t ? N(t) : void 0;
|
|
3072
3081
|
}
|
|
3073
|
-
function
|
|
3082
|
+
function wr(e, t, n) {
|
|
3074
3083
|
if (e.header?.layout === "none") return;
|
|
3075
3084
|
let r = e.header ?? {};
|
|
3076
3085
|
return {
|
|
@@ -3095,7 +3104,7 @@ function Sr(e, t, n) {
|
|
|
3095
3104
|
chiefUmpire: r.chiefUmpire
|
|
3096
3105
|
};
|
|
3097
3106
|
}
|
|
3098
|
-
function
|
|
3107
|
+
function Tr(e) {
|
|
3099
3108
|
if (e.footer?.layout === "none") return;
|
|
3100
3109
|
let t = e.footer ?? {};
|
|
3101
3110
|
return {
|
|
@@ -3113,7 +3122,7 @@ function Cr(e) {
|
|
|
3113
3122
|
luckyLosers: t.luckyLosers
|
|
3114
3123
|
};
|
|
3115
3124
|
}
|
|
3116
|
-
function
|
|
3125
|
+
function Er(e) {
|
|
3117
3126
|
let t = e.header;
|
|
3118
3127
|
if (t && t.layout !== "none") return {
|
|
3119
3128
|
tournamentName: t.tournamentName ?? "",
|
|
@@ -3124,10 +3133,10 @@ function wr(e) {
|
|
|
3124
3133
|
organizer: t.organizer
|
|
3125
3134
|
};
|
|
3126
3135
|
}
|
|
3127
|
-
function
|
|
3136
|
+
function Dr(e, t) {
|
|
3128
3137
|
return e.content?.[t];
|
|
3129
3138
|
}
|
|
3130
|
-
function
|
|
3139
|
+
function Or(e, t) {
|
|
3131
3140
|
if (typeof e.getParticipants != "function") return {
|
|
3132
3141
|
success: !1,
|
|
3133
3142
|
error: "engine.getParticipants is not a function"
|
|
@@ -3153,7 +3162,7 @@ function Er(e, t) {
|
|
|
3153
3162
|
participants: n.filter((e) => i.has(e.participantId)),
|
|
3154
3163
|
eventEntries: [{
|
|
3155
3164
|
eventName: r.eventName ?? "",
|
|
3156
|
-
entries:
|
|
3165
|
+
entries: kr(r)
|
|
3157
3166
|
}],
|
|
3158
3167
|
eventName: r.eventName ?? ""
|
|
3159
3168
|
};
|
|
@@ -3163,12 +3172,12 @@ function Er(e, t) {
|
|
|
3163
3172
|
participants: n,
|
|
3164
3173
|
eventEntries: (e.getEvents?.()?.events ?? []).map((e) => ({
|
|
3165
3174
|
eventName: e.eventName ?? "",
|
|
3166
|
-
entries:
|
|
3175
|
+
entries: kr(e)
|
|
3167
3176
|
})),
|
|
3168
3177
|
eventName: ""
|
|
3169
3178
|
};
|
|
3170
3179
|
}
|
|
3171
|
-
function
|
|
3180
|
+
function kr(e) {
|
|
3172
3181
|
let t = e.entries ?? [], n = /* @__PURE__ */ new Map();
|
|
3173
3182
|
for (let t of e.drawDefinitions ?? []) for (let e of t.structures ?? []) if (!(e.stage && e.stage !== "MAIN")) for (let t of e.seedAssignments ?? []) {
|
|
3174
3183
|
if (!t?.participantId || t.seedValue === void 0) continue;
|
|
@@ -3180,16 +3189,16 @@ function Dr(e) {
|
|
|
3180
3189
|
seedValue: n.get(e.participantId)
|
|
3181
3190
|
} : e);
|
|
3182
3191
|
}
|
|
3183
|
-
function
|
|
3184
|
-
let n =
|
|
3192
|
+
function Ar(e, t) {
|
|
3193
|
+
let n = Or(t.tournamentEngine, e.eventId);
|
|
3185
3194
|
if (!n.success) return n;
|
|
3186
|
-
let r =
|
|
3195
|
+
let r = mt({
|
|
3187
3196
|
participants: n.participants,
|
|
3188
3197
|
eventEntries: n.eventEntries
|
|
3189
|
-
}), i =
|
|
3198
|
+
}), i = Dr(e.composition, "playerList"), a;
|
|
3190
3199
|
try {
|
|
3191
|
-
a =
|
|
3192
|
-
header:
|
|
3200
|
+
a = Dt(r, {
|
|
3201
|
+
header: Er(e.composition),
|
|
3193
3202
|
includeRanking: i?.includeRanking,
|
|
3194
3203
|
includeEvents: i?.includeEvents,
|
|
3195
3204
|
groupByEvent: i?.groupByEvent
|
|
@@ -3208,20 +3217,20 @@ function Or(e, t) {
|
|
|
3208
3217
|
filename: `player-list-${o}.pdf`
|
|
3209
3218
|
};
|
|
3210
3219
|
}
|
|
3211
|
-
function
|
|
3220
|
+
function jr(e, t) {
|
|
3212
3221
|
if (!e.eventId) return {
|
|
3213
3222
|
success: !1,
|
|
3214
3223
|
error: "PrintSignInSheetRequest requires eventId"
|
|
3215
3224
|
};
|
|
3216
|
-
let n =
|
|
3225
|
+
let n = Or(t.tournamentEngine, e.eventId);
|
|
3217
3226
|
if (!n.success) return n;
|
|
3218
|
-
let r =
|
|
3227
|
+
let r = mt({
|
|
3219
3228
|
participants: n.participants,
|
|
3220
3229
|
eventEntries: n.eventEntries
|
|
3221
3230
|
}), i;
|
|
3222
3231
|
try {
|
|
3223
|
-
i =
|
|
3224
|
-
header:
|
|
3232
|
+
i = Ot(r, {
|
|
3233
|
+
header: Er(e.composition),
|
|
3225
3234
|
eventName: n.eventName
|
|
3226
3235
|
});
|
|
3227
3236
|
} catch (e) {
|
|
@@ -3238,16 +3247,16 @@ function kr(e, t) {
|
|
|
3238
3247
|
filename: `sign-in-sheet-${a}.pdf`
|
|
3239
3248
|
};
|
|
3240
3249
|
}
|
|
3241
|
-
function
|
|
3242
|
-
let n = t.tournamentEngine, r =
|
|
3250
|
+
function Mr(e, t) {
|
|
3251
|
+
let n = t.tournamentEngine, r = Ir(n, e.venueId);
|
|
3243
3252
|
if (!r.success) return r;
|
|
3244
|
-
let i =
|
|
3253
|
+
let i = gt({
|
|
3245
3254
|
matchUps: r.matchUps,
|
|
3246
3255
|
venues: r.venues,
|
|
3247
3256
|
scheduledDate: e.scheduledDate
|
|
3248
|
-
}), a =
|
|
3257
|
+
}), a = Nr(e.composition, n), o = Dr(e.composition, "courtCard"), s;
|
|
3249
3258
|
try {
|
|
3250
|
-
s =
|
|
3259
|
+
s = kt(i, {
|
|
3251
3260
|
tournamentName: a,
|
|
3252
3261
|
cardsPerPage: o?.cardsPerPage
|
|
3253
3262
|
});
|
|
@@ -3265,10 +3274,10 @@ function Ar(e, t) {
|
|
|
3265
3274
|
filename: `court-cards${c}.pdf`
|
|
3266
3275
|
};
|
|
3267
3276
|
}
|
|
3268
|
-
function
|
|
3277
|
+
function Nr(e, t) {
|
|
3269
3278
|
return e.header?.tournamentName || (typeof t.getTournamentInfo == "function" ? t.getTournamentInfo()?.tournamentInfo?.tournamentName ?? "" : "");
|
|
3270
3279
|
}
|
|
3271
|
-
function
|
|
3280
|
+
function Pr(e, t) {
|
|
3272
3281
|
if (!Array.isArray(e.matchUpIds) || e.matchUpIds.length === 0) return {
|
|
3273
3282
|
success: !1,
|
|
3274
3283
|
error: "PrintMatchCardRequest requires non-empty matchUpIds"
|
|
@@ -3283,18 +3292,18 @@ function Mr(e, t) {
|
|
|
3283
3292
|
success: !1,
|
|
3284
3293
|
error: "No matchUps match the requested matchUpIds"
|
|
3285
3294
|
};
|
|
3286
|
-
let o =
|
|
3295
|
+
let o = Nr(e.composition, n), s = a.map((e) => ({
|
|
3287
3296
|
tournamentName: o,
|
|
3288
3297
|
eventName: e.eventName ?? "",
|
|
3289
3298
|
roundName: e.roundName ?? e.abbreviatedRoundName ?? "",
|
|
3290
3299
|
matchUpId: e.matchUpId,
|
|
3291
3300
|
courtName: e.schedule?.courtName,
|
|
3292
3301
|
scheduledTime: e.schedule?.scheduledTime,
|
|
3293
|
-
side1:
|
|
3294
|
-
side2:
|
|
3302
|
+
side1: vr(e, 1),
|
|
3303
|
+
side2: vr(e, 2)
|
|
3295
3304
|
})), c;
|
|
3296
3305
|
try {
|
|
3297
|
-
c =
|
|
3306
|
+
c = jt(s, {
|
|
3298
3307
|
cardsPerPage: 2,
|
|
3299
3308
|
includeScoreBoxes: !0
|
|
3300
3309
|
});
|
|
@@ -3311,20 +3320,20 @@ function Mr(e, t) {
|
|
|
3311
3320
|
filename: `match-cards-${s.length}.pdf`
|
|
3312
3321
|
};
|
|
3313
3322
|
}
|
|
3314
|
-
function
|
|
3323
|
+
function Fr(e, t) {
|
|
3315
3324
|
if (!e.scheduledDate) return {
|
|
3316
3325
|
success: !1,
|
|
3317
3326
|
error: "PrintScheduleRequest requires scheduledDate"
|
|
3318
3327
|
};
|
|
3319
|
-
let n = t.tournamentEngine, r =
|
|
3328
|
+
let n = t.tournamentEngine, r = Ir(n, e.venueId);
|
|
3320
3329
|
if (!r.success) return r;
|
|
3321
|
-
let i =
|
|
3330
|
+
let i = ft({
|
|
3322
3331
|
matchUps: r.matchUps,
|
|
3323
3332
|
venues: r.venues,
|
|
3324
3333
|
scheduledDate: e.scheduledDate
|
|
3325
|
-
}), a =
|
|
3334
|
+
}), a = _r(e.composition), o;
|
|
3326
3335
|
try {
|
|
3327
|
-
o =
|
|
3336
|
+
o = yt(i, a);
|
|
3328
3337
|
} catch (e) {
|
|
3329
3338
|
return {
|
|
3330
3339
|
success: !1,
|
|
@@ -3338,7 +3347,7 @@ function Nr(e, t) {
|
|
|
3338
3347
|
filename: `order-of-play-${e.scheduledDate}.pdf`
|
|
3339
3348
|
};
|
|
3340
3349
|
}
|
|
3341
|
-
function
|
|
3350
|
+
function Ir(e, t) {
|
|
3342
3351
|
if (typeof e.competitionScheduleMatchUps != "function") return {
|
|
3343
3352
|
success: !1,
|
|
3344
3353
|
error: "engine.competitionScheduleMatchUps is not a function"
|
|
@@ -3356,7 +3365,7 @@ function Pr(e, t) {
|
|
|
3356
3365
|
}
|
|
3357
3366
|
//#endregion
|
|
3358
3367
|
//#region src/composition/editorTypes.ts
|
|
3359
|
-
var
|
|
3368
|
+
var Lr = [
|
|
3360
3369
|
{
|
|
3361
3370
|
value: "grand-slam",
|
|
3362
3371
|
label: "Grand Slam",
|
|
@@ -3377,7 +3386,7 @@ var Fr = [
|
|
|
3377
3386
|
label: "No Header",
|
|
3378
3387
|
description: "Skip header entirely"
|
|
3379
3388
|
}
|
|
3380
|
-
],
|
|
3389
|
+
], Rr = [
|
|
3381
3390
|
{
|
|
3382
3391
|
value: "standard",
|
|
3383
3392
|
label: "Standard",
|
|
@@ -3398,13 +3407,13 @@ var Fr = [
|
|
|
3398
3407
|
label: "No Footer",
|
|
3399
3408
|
description: "Skip footer entirely"
|
|
3400
3409
|
}
|
|
3401
|
-
],
|
|
3410
|
+
], zr = [{
|
|
3402
3411
|
value: "a4",
|
|
3403
3412
|
label: "A4 (210 × 297mm)"
|
|
3404
3413
|
}, {
|
|
3405
3414
|
value: "letter",
|
|
3406
3415
|
label: "US Letter (216 × 279mm)"
|
|
3407
|
-
}],
|
|
3416
|
+
}], Br = [
|
|
3408
3417
|
{
|
|
3409
3418
|
value: "auto",
|
|
3410
3419
|
label: "Auto (landscape for large draws)"
|
|
@@ -3417,7 +3426,7 @@ var Fr = [
|
|
|
3417
3426
|
value: "portrait",
|
|
3418
3427
|
label: "Portrait"
|
|
3419
3428
|
}
|
|
3420
|
-
],
|
|
3429
|
+
], Vr = [
|
|
3421
3430
|
{
|
|
3422
3431
|
value: "single-page",
|
|
3423
3432
|
label: "Single Page (dense)"
|
|
@@ -3430,7 +3439,7 @@ var Fr = [
|
|
|
3430
3439
|
value: "quarters",
|
|
3431
3440
|
label: "Four Quarters (32×4)"
|
|
3432
3441
|
}
|
|
3433
|
-
],
|
|
3442
|
+
], Hr = [{
|
|
3434
3443
|
id: "content",
|
|
3435
3444
|
label: "Content",
|
|
3436
3445
|
fields: [
|
|
@@ -3521,7 +3530,7 @@ var Fr = [
|
|
|
3521
3530
|
defaultValue: "landscape",
|
|
3522
3531
|
configPath: "page.orientation"
|
|
3523
3532
|
}]
|
|
3524
|
-
}],
|
|
3533
|
+
}], Ur = [{
|
|
3525
3534
|
id: "content",
|
|
3526
3535
|
label: "Content",
|
|
3527
3536
|
fields: [
|
|
@@ -3580,7 +3589,7 @@ var Fr = [
|
|
|
3580
3589
|
}];
|
|
3581
3590
|
//#endregion
|
|
3582
3591
|
//#region src/core/extractRoundRobinData.ts
|
|
3583
|
-
function
|
|
3592
|
+
function Wr(e) {
|
|
3584
3593
|
let { structure: t, participants: n = [] } = e;
|
|
3585
3594
|
if (!t) return [];
|
|
3586
3595
|
let r = /* @__PURE__ */ new Map();
|
|
@@ -3598,7 +3607,7 @@ function Hr(e) {
|
|
|
3598
3607
|
}).sort((e, t) => e.groupPosition - t.groupPosition), o = [];
|
|
3599
3608
|
for (let t of e.matchUps || []) {
|
|
3600
3609
|
if (!t.drawPositions || t.drawPositions.length < 2) continue;
|
|
3601
|
-
let [e, n] = t.drawPositions, r =
|
|
3610
|
+
let [e, n] = t.drawPositions, r = ot(t.score);
|
|
3602
3611
|
r && o.push({
|
|
3603
3612
|
rowPosition: e,
|
|
3604
3613
|
colPosition: n,
|
|
@@ -3615,24 +3624,24 @@ function Hr(e) {
|
|
|
3615
3624
|
}
|
|
3616
3625
|
//#endregion
|
|
3617
3626
|
//#region src/renderers/roundRobinDraw.ts
|
|
3618
|
-
var
|
|
3627
|
+
var Gr = [
|
|
3619
3628
|
200,
|
|
3620
3629
|
200,
|
|
3621
3630
|
200
|
|
3622
|
-
],
|
|
3631
|
+
], Kr = [
|
|
3623
3632
|
20,
|
|
3624
3633
|
80,
|
|
3625
3634
|
20
|
|
3626
|
-
],
|
|
3635
|
+
], qr = [
|
|
3627
3636
|
160,
|
|
3628
3637
|
40,
|
|
3629
3638
|
40
|
|
3630
|
-
],
|
|
3639
|
+
], Jr = [
|
|
3631
3640
|
50,
|
|
3632
3641
|
50,
|
|
3633
3642
|
50
|
|
3634
3643
|
];
|
|
3635
|
-
function
|
|
3644
|
+
function Yr(e, n, r, i, a) {
|
|
3636
3645
|
let o = r.page.margins, s = n.participants.length;
|
|
3637
3646
|
R(e, I.HEADING, F.BOLD), e.text(n.groupName, o.left, a), a += 5;
|
|
3638
3647
|
let c = [
|
|
@@ -3642,7 +3651,7 @@ function qr(e, n, r, i, a) {
|
|
|
3642
3651
|
];
|
|
3643
3652
|
for (let e = 0; e < s; e++) c.push(`${e + 1}`);
|
|
3644
3653
|
c.push("W", "L");
|
|
3645
|
-
let l =
|
|
3654
|
+
let l = Xr(n, r), u = n.participants.map((e, t) => {
|
|
3646
3655
|
let n = [
|
|
3647
3656
|
{
|
|
3648
3657
|
content: `${t + 1}`,
|
|
@@ -3662,12 +3671,12 @@ function qr(e, n, r, i, a) {
|
|
|
3662
3671
|
];
|
|
3663
3672
|
for (let e = 0; e < s; e++) if (t === e) n.push({
|
|
3664
3673
|
content: "",
|
|
3665
|
-
styles: { fillColor:
|
|
3674
|
+
styles: { fillColor: Gr }
|
|
3666
3675
|
});
|
|
3667
3676
|
else {
|
|
3668
3677
|
let r = l[t]?.[e];
|
|
3669
3678
|
if (r) {
|
|
3670
|
-
let e = r.isWin ?
|
|
3679
|
+
let e = r.isWin ? Kr : qr;
|
|
3671
3680
|
n.push({
|
|
3672
3681
|
content: r.score,
|
|
3673
3682
|
styles: {
|
|
@@ -3707,7 +3716,7 @@ function qr(e, n, r, i, a) {
|
|
|
3707
3716
|
]
|
|
3708
3717
|
},
|
|
3709
3718
|
headStyles: {
|
|
3710
|
-
fillColor:
|
|
3719
|
+
fillColor: Jr,
|
|
3711
3720
|
textColor: [
|
|
3712
3721
|
255,
|
|
3713
3722
|
255,
|
|
@@ -3728,7 +3737,7 @@ function qr(e, n, r, i, a) {
|
|
|
3728
3737
|
}
|
|
3729
3738
|
}), e.lastAutoTable?.finalY || a + 40;
|
|
3730
3739
|
}
|
|
3731
|
-
function
|
|
3740
|
+
function Xr(e, t) {
|
|
3732
3741
|
let n = e.participants.length, r = Array.from({ length: n }, () => Array(n).fill(null)), i = /* @__PURE__ */ new Map();
|
|
3733
3742
|
e.participants.forEach((e, t) => i.set(e.groupPosition, t));
|
|
3734
3743
|
for (let n of e.results) {
|
|
@@ -3739,13 +3748,13 @@ function Jr(e, t) {
|
|
|
3739
3748
|
score: o,
|
|
3740
3749
|
isWin: s
|
|
3741
3750
|
}, r[a][e] = {
|
|
3742
|
-
score:
|
|
3751
|
+
score: Zr(o),
|
|
3743
3752
|
isWin: !s
|
|
3744
3753
|
};
|
|
3745
3754
|
}
|
|
3746
3755
|
return r;
|
|
3747
3756
|
}
|
|
3748
|
-
function
|
|
3757
|
+
function Zr(e) {
|
|
3749
3758
|
return e.split(/\s+/).map((e) => {
|
|
3750
3759
|
let t = e.match(/^(\d+)([/-])(\d+)(\(\d+\))?$/);
|
|
3751
3760
|
return t ? `${t[3]}${t[2]}${t[1]}${t[4] || ""}` : e;
|
|
@@ -3753,7 +3762,7 @@ function Yr(e) {
|
|
|
3753
3762
|
}
|
|
3754
3763
|
//#endregion
|
|
3755
3764
|
//#region src/core/extractCompassData.ts
|
|
3756
|
-
var
|
|
3765
|
+
var Qr = {
|
|
3757
3766
|
East: {
|
|
3758
3767
|
name: "East",
|
|
3759
3768
|
abbreviation: "E"
|
|
@@ -3787,7 +3796,7 @@ var Xr = {
|
|
|
3787
3796
|
abbreviation: "SW"
|
|
3788
3797
|
}
|
|
3789
3798
|
};
|
|
3790
|
-
function
|
|
3799
|
+
function $r(e) {
|
|
3791
3800
|
let { drawDefinition: t, participants: n = [] } = e;
|
|
3792
3801
|
if (!t) return {
|
|
3793
3802
|
drawName: "",
|
|
@@ -3797,7 +3806,7 @@ function Zr(e) {
|
|
|
3797
3806
|
n.forEach((e) => r.set(e.participantId, e));
|
|
3798
3807
|
let i = [];
|
|
3799
3808
|
for (let e of t.structures || []) {
|
|
3800
|
-
let t = e.structureName || "", n =
|
|
3809
|
+
let t = e.structureName || "", n = Qr[t] || {
|
|
3801
3810
|
name: t,
|
|
3802
3811
|
abbreviation: t
|
|
3803
3812
|
}, a = e.positionAssignments || [], o = e.seedAssignments || [], s = a.length || 0, c = a.map((e) => {
|
|
@@ -3813,7 +3822,7 @@ function Zr(e) {
|
|
|
3813
3822
|
roundNumber: e.roundNumber,
|
|
3814
3823
|
roundPosition: e.roundPosition,
|
|
3815
3824
|
drawPositions: e.drawPositions || [],
|
|
3816
|
-
winnerDrawPosition:
|
|
3825
|
+
winnerDrawPosition: me(e),
|
|
3817
3826
|
score: e.score?.scoreStringSide1 || "",
|
|
3818
3827
|
winningSide: e.winningSide,
|
|
3819
3828
|
matchUpStatus: e.matchUpStatus
|
|
@@ -3836,7 +3845,7 @@ function Zr(e) {
|
|
|
3836
3845
|
}
|
|
3837
3846
|
//#endregion
|
|
3838
3847
|
//#region src/layout/brackets.ts
|
|
3839
|
-
var
|
|
3848
|
+
var ei = {
|
|
3840
3849
|
slotWidth: 90,
|
|
3841
3850
|
slotHeight: 14,
|
|
3842
3851
|
roundGap: 20,
|
|
@@ -3844,7 +3853,7 @@ var Qr = {
|
|
|
3844
3853
|
startX: 15,
|
|
3845
3854
|
startY: 10
|
|
3846
3855
|
};
|
|
3847
|
-
function
|
|
3856
|
+
function ti(e, t = ei, n) {
|
|
3848
3857
|
let r = Math.log2(e), i = [], a = e, o = t.slotHeight + t.verticalGap;
|
|
3849
3858
|
n && a * o > n && (o = n / a);
|
|
3850
3859
|
let s = Math.max(o * .7, 5);
|
|
@@ -3868,14 +3877,10 @@ function $r(e, t = Qr, n) {
|
|
|
3868
3877
|
}
|
|
3869
3878
|
return i;
|
|
3870
3879
|
}
|
|
3871
|
-
function
|
|
3872
|
-
|
|
3873
|
-
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);
|
|
3874
|
-
return;
|
|
3875
|
-
}
|
|
3876
|
-
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)));
|
|
3880
|
+
function ni(e, t) {
|
|
3881
|
+
e.setDrawColor(150), e.setLineWidth(.3), e.rect(t.x, t.y, t.width, t.height), t.isBye ? (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)) : 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)));
|
|
3877
3882
|
}
|
|
3878
|
-
function
|
|
3883
|
+
function ri(e, t, n) {
|
|
3879
3884
|
e.setDrawColor(100), e.setLineWidth(.3);
|
|
3880
3885
|
for (let r = 0; r < t.length - 1; r++) {
|
|
3881
3886
|
let i = t[r], a = t[r + 1];
|
|
@@ -3887,12 +3892,12 @@ function ti(e, t, n) {
|
|
|
3887
3892
|
}
|
|
3888
3893
|
}
|
|
3889
3894
|
}
|
|
3890
|
-
function
|
|
3895
|
+
function ii(e, t, n, r) {
|
|
3891
3896
|
R(e, I.TINY, F.NORMAL), e.setTextColor(60, 60, 180), e.text(t, n, r), e.setTextColor(0);
|
|
3892
3897
|
}
|
|
3893
3898
|
//#endregion
|
|
3894
3899
|
//#region src/generators/drawSheet.ts
|
|
3895
|
-
function
|
|
3900
|
+
function ai(t, n = {}) {
|
|
3896
3901
|
let { header: r, includeSeedings: i = !0, includeScores: a = !0 } = n, o = t.drawSize >= 32, s = new e({
|
|
3897
3902
|
orientation: o ? "landscape" : "portrait",
|
|
3898
3903
|
format: "a4"
|
|
@@ -3901,22 +3906,22 @@ function ri(t, n = {}) {
|
|
|
3901
3906
|
let c = 15;
|
|
3902
3907
|
if (r) {
|
|
3903
3908
|
let e = `${t.drawName} - ${t.drawType.replace(/_/g, " ")} (${t.drawSize})`;
|
|
3904
|
-
c =
|
|
3909
|
+
c = Et(s, {
|
|
3905
3910
|
...r,
|
|
3906
3911
|
subtitle: e
|
|
3907
3912
|
});
|
|
3908
3913
|
}
|
|
3909
|
-
return c = t.drawSize <= 64 && t.drawSize > 0 ?
|
|
3914
|
+
return c = t.drawSize <= 64 && t.drawSize > 0 ? oi(s, t, c, a) : si(s, t, c), i && t.seedAssignments.length > 0 && ci(s, t, c + 8), W(s, `Generated ${(/* @__PURE__ */ new Date()).toLocaleDateString()}`), s;
|
|
3910
3915
|
}
|
|
3911
|
-
function
|
|
3916
|
+
function oi(e, t, n, r) {
|
|
3912
3917
|
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 = {
|
|
3913
|
-
...
|
|
3918
|
+
...ei,
|
|
3914
3919
|
slotWidth: l,
|
|
3915
3920
|
slotHeight: u,
|
|
3916
3921
|
verticalGap: Math.max(1, u * .3),
|
|
3917
3922
|
startX: 15,
|
|
3918
3923
|
startY: n
|
|
3919
|
-
}, f =
|
|
3924
|
+
}, f = ti(t.drawSize, d, s), p = new Map(t.slots.map((e) => [e.drawPosition, e]));
|
|
3920
3925
|
R(e, I.SMALL, F.BOLD);
|
|
3921
3926
|
for (let t = 0; t < c; t++) {
|
|
3922
3927
|
let r = d.startX + t * (d.slotWidth + d.roundGap), i = K(t + 1, c);
|
|
@@ -3928,13 +3933,13 @@ function ii(e, t, n, r) {
|
|
|
3928
3933
|
let t = e + 1, r = p.get(t);
|
|
3929
3934
|
r && (n[e].participantName = r.participantName, n[e].nationality = r.nationality, n[e].seed = r.seedValue, n[e].isBye = r.isBye);
|
|
3930
3935
|
}
|
|
3931
|
-
for (let t of f) for (let n of t)
|
|
3932
|
-
if (
|
|
3936
|
+
for (let t of f) for (let n of t) ni(e, n);
|
|
3937
|
+
if (ri(e, f, d), r) for (let n of t.matchUps) {
|
|
3933
3938
|
if (!n.score) continue;
|
|
3934
3939
|
let t = n.roundNumber - 1;
|
|
3935
3940
|
if (t < f.length) {
|
|
3936
3941
|
let r = (n.roundPosition - 1) * 2, i = f[t]?.[r];
|
|
3937
|
-
i &&
|
|
3942
|
+
i && ii(e, n.score, i.x + i.width + 2, i.y + i.height + 3);
|
|
3938
3943
|
}
|
|
3939
3944
|
}
|
|
3940
3945
|
let i = f[0][f[0].length - 1];
|
|
@@ -3942,7 +3947,7 @@ function ii(e, t, n, r) {
|
|
|
3942
3947
|
}
|
|
3943
3948
|
return n;
|
|
3944
3949
|
}
|
|
3945
|
-
function
|
|
3950
|
+
function si(e, n, r) {
|
|
3946
3951
|
let i = [
|
|
3947
3952
|
{
|
|
3948
3953
|
header: "Pos",
|
|
@@ -3997,7 +4002,7 @@ function ai(e, n, r) {
|
|
|
3997
4002
|
}
|
|
3998
4003
|
}), e.lastAutoTable?.finalY || r + 20;
|
|
3999
4004
|
}
|
|
4000
|
-
function
|
|
4005
|
+
function ci(e, n, r) {
|
|
4001
4006
|
R(e, I.HEADING, F.BOLD), e.text("Seeded Players", 15, r), r += 4;
|
|
4002
4007
|
let i = [
|
|
4003
4008
|
{
|
|
@@ -4012,7 +4017,7 @@ function oi(e, n, r) {
|
|
|
4012
4017
|
header: "Nat.",
|
|
4013
4018
|
dataKey: "nat"
|
|
4014
4019
|
}
|
|
4015
|
-
], { markers: a, footnotes: o, hasAnnotations: s } =
|
|
4020
|
+
], { markers: a, footnotes: o, hasAnnotations: s } = We(n.seedAssignments), c = n.seedAssignments.map((e, t) => ({
|
|
4016
4021
|
seed: [e.seedValue, a[t]].filter(Boolean).join(" "),
|
|
4017
4022
|
name: e.participantName,
|
|
4018
4023
|
nat: e.nationality
|
|
@@ -4046,7 +4051,7 @@ function oi(e, n, r) {
|
|
|
4046
4051
|
}
|
|
4047
4052
|
//#endregion
|
|
4048
4053
|
//#region src/generators/schedule.ts
|
|
4049
|
-
function
|
|
4054
|
+
function li(n, r = {}) {
|
|
4050
4055
|
let { header: i, fullCourtNames: a = !0, notes: o } = r, s = (r.landscape === "auto" ? n.courts.length >= 5 : r.landscape) ? "landscape" : "portrait", c = new e({
|
|
4051
4056
|
orientation: s,
|
|
4052
4057
|
format: "a4"
|
|
@@ -4055,12 +4060,12 @@ function si(n, r = {}) {
|
|
|
4055
4060
|
let l = 15;
|
|
4056
4061
|
if (i) {
|
|
4057
4062
|
let e = n.scheduledDate ? `Order of Play - ${n.scheduledDate}` : "Order of Play";
|
|
4058
|
-
l =
|
|
4063
|
+
l = Et(c, {
|
|
4059
4064
|
...i,
|
|
4060
4065
|
subtitle: e
|
|
4061
4066
|
});
|
|
4062
4067
|
}
|
|
4063
|
-
let u = n.courts, d = a ? u : u.map(
|
|
4068
|
+
let u = n.courts, d = a ? u : u.map(di);
|
|
4064
4069
|
for (let e of n.timeSlots) {
|
|
4065
4070
|
R(c, I.BODY, F.BOLD), c.setTextColor(30, 60, 120), c.text(e.label, 15, l), c.setTextColor(0), l += 4;
|
|
4066
4071
|
let n = d.map((e) => ({
|
|
@@ -4069,7 +4074,7 @@ function si(n, r = {}) {
|
|
|
4069
4074
|
})), r = /* @__PURE__ */ new Map();
|
|
4070
4075
|
u.forEach((e) => r.set(e, []));
|
|
4071
4076
|
for (let t of e.matches) {
|
|
4072
|
-
let e =
|
|
4077
|
+
let e = ui(t), n = r.get(t.courtName) || [];
|
|
4073
4078
|
n.push(e), r.set(t.courtName, n);
|
|
4074
4079
|
}
|
|
4075
4080
|
let o = Math.max(1, ...Array.from(r.values()).map((e) => e.length)), s = [];
|
|
@@ -4098,41 +4103,41 @@ function si(n, r = {}) {
|
|
|
4098
4103
|
}
|
|
4099
4104
|
return c;
|
|
4100
4105
|
}
|
|
4101
|
-
function
|
|
4106
|
+
function ui(e) {
|
|
4102
4107
|
let t = [];
|
|
4103
4108
|
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");
|
|
4104
4109
|
}
|
|
4105
|
-
function
|
|
4110
|
+
function di(e) {
|
|
4106
4111
|
return e.replace(/^Court\s*/i, "Ct ");
|
|
4107
4112
|
}
|
|
4108
4113
|
//#endregion
|
|
4109
4114
|
//#region src/composition/resolveCompositionConfig.ts
|
|
4110
|
-
var
|
|
4111
|
-
function
|
|
4115
|
+
var fi = "print";
|
|
4116
|
+
function pi(e) {
|
|
4112
4117
|
let { providerConfig: t, tournamentRecord: n, printType: r, runtime: i } = e;
|
|
4113
|
-
return
|
|
4118
|
+
return mi(mi(t?.providerConfigSettings?.policies?.printPolicies?.[r] ?? {}, (n?.extensions?.find((e) => e.name === fi))?.value?.[r] ?? {}), i ?? {});
|
|
4114
4119
|
}
|
|
4115
|
-
function
|
|
4120
|
+
function mi(e, t) {
|
|
4116
4121
|
let n = { ...e };
|
|
4117
4122
|
for (let e of Object.keys(t)) {
|
|
4118
4123
|
let r = t[e];
|
|
4119
4124
|
if (r === void 0) continue;
|
|
4120
4125
|
let i = n[e];
|
|
4121
|
-
n[e] =
|
|
4126
|
+
n[e] = hi(i) && hi(r) ? mi(i, r) : r;
|
|
4122
4127
|
}
|
|
4123
4128
|
return n;
|
|
4124
4129
|
}
|
|
4125
|
-
function
|
|
4130
|
+
function hi(e) {
|
|
4126
4131
|
return typeof e == "object" && !!e && !Array.isArray(e) && Object.getPrototypeOf(e) === Object.prototype;
|
|
4127
4132
|
}
|
|
4128
4133
|
//#endregion
|
|
4129
4134
|
//#region src/generators/sequentialOOP.ts
|
|
4130
|
-
var
|
|
4135
|
+
var gi = [
|
|
4131
4136
|
120,
|
|
4132
4137
|
50,
|
|
4133
4138
|
140
|
|
4134
4139
|
];
|
|
4135
|
-
function
|
|
4140
|
+
function _i(e, t = {}) {
|
|
4136
4141
|
let n = {
|
|
4137
4142
|
pageSize: t.page?.pageSize || "a4",
|
|
4138
4143
|
orientation: t.page?.orientation || "portrait",
|
|
@@ -4142,49 +4147,49 @@ function hi(e, t = {}) {
|
|
|
4142
4147
|
bottom: 12,
|
|
4143
4148
|
left: 15
|
|
4144
4149
|
}
|
|
4145
|
-
}, r =
|
|
4150
|
+
}, r = Ce(n), { margins: i } = n, a = r.internal.pageSize.getWidth(), o = r.internal.pageSize.getHeight(), s = a - i.left - i.right, c = t.accentColor || gi, l = t.footer || { layout: "none" }, u = V(l), d = i.top;
|
|
4146
4151
|
t.header && (d = i.top + B(r, t.header, n) + 3);
|
|
4147
|
-
let f =
|
|
4152
|
+
let f = Si(e);
|
|
4148
4153
|
for (let [e, a] of f) {
|
|
4149
|
-
d + 30 > o - i.bottom - u && (
|
|
4154
|
+
d + 30 > o - i.bottom - u && (Ci(r, t, n, l), r.addPage(), d = i.top), d = vi(r, e, i.left, d, s);
|
|
4150
4155
|
let f = "";
|
|
4151
4156
|
for (let e of a) {
|
|
4152
4157
|
let a = e.scheduledTime || e.notBeforeTime || "";
|
|
4153
|
-
a && a !== f && (d + 25 > o - i.bottom - u && (
|
|
4158
|
+
a && a !== f && (d + 25 > o - i.bottom - u && (Ci(r, t, n, l), r.addPage(), d = i.top), d = yi(r, a, !!e.notBeforeTime, i.left, d, s, c), f = a), d + 22 > o - i.bottom - u && (Ci(r, t, n, l), r.addPage(), d = i.top), d = bi(r, e, i.left, d, s);
|
|
4154
4159
|
}
|
|
4155
4160
|
d += 4;
|
|
4156
4161
|
}
|
|
4157
|
-
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)),
|
|
4162
|
+
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)), Ci(r, t, n, l), r;
|
|
4158
4163
|
}
|
|
4159
|
-
function
|
|
4164
|
+
function vi(e, t, n, r, i) {
|
|
4160
4165
|
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;
|
|
4161
4166
|
}
|
|
4162
|
-
function
|
|
4167
|
+
function yi(e, t, n, r, i, a, o) {
|
|
4163
4168
|
let s = n ? `Not before ${t}` : `Starting at ${t}`;
|
|
4164
4169
|
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;
|
|
4165
4170
|
}
|
|
4166
|
-
function
|
|
4171
|
+
function bi(e, t, n, r, i) {
|
|
4167
4172
|
let a = n + 15, o = i - 30, s = r;
|
|
4168
4173
|
R(e, I.TINY, F.ITALIC), e.setTextColor(100);
|
|
4169
4174
|
let c = t.eventAbbr ? `${t.eventAbbr} ${t.roundName}` : t.roundName;
|
|
4170
|
-
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 =
|
|
4175
|
+
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 = xi(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 = xi(e, t.side2, a, r, o), r += 2;
|
|
4171
4176
|
let l = r - s;
|
|
4172
4177
|
return e.setDrawColor(180), e.setLineWidth(.3), e.rect(a, s, o, l), r + 2;
|
|
4173
4178
|
}
|
|
4174
|
-
function
|
|
4179
|
+
function xi(e, t, n, r, i) {
|
|
4175
4180
|
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;
|
|
4176
4181
|
R(e, I.BODY, F.NORMAL);
|
|
4177
4182
|
let a = t.nationality ? `${t.name} ${t.nationality}` : t.name;
|
|
4178
4183
|
return e.text(a, n + 10, r + 3), r + 4;
|
|
4179
4184
|
}
|
|
4180
|
-
function
|
|
4185
|
+
function Si(e) {
|
|
4181
4186
|
let t = /* @__PURE__ */ new Map();
|
|
4182
4187
|
for (let n of e.courts) t.set(n, []);
|
|
4183
4188
|
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);
|
|
4184
4189
|
for (let [e, n] of t) n.length === 0 && t.delete(e);
|
|
4185
4190
|
return t;
|
|
4186
4191
|
}
|
|
4187
|
-
function
|
|
4192
|
+
function Ci(e, t, n, r) {
|
|
4188
4193
|
let { margins: i } = n, a = e.internal.pageSize.getWidth(), o = e.internal.pageSize.getHeight();
|
|
4189
4194
|
if (t.officials?.length) {
|
|
4190
4195
|
let n = o - i.bottom - 10;
|
|
@@ -4195,27 +4200,27 @@ function xi(e, t, n, r) {
|
|
|
4195
4200
|
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);
|
|
4196
4201
|
});
|
|
4197
4202
|
}
|
|
4198
|
-
|
|
4203
|
+
Ge(e, r, n);
|
|
4199
4204
|
}
|
|
4200
4205
|
//#endregion
|
|
4201
4206
|
//#region src/generators/report.ts
|
|
4202
|
-
var
|
|
4203
|
-
function
|
|
4207
|
+
var wi = .2645833;
|
|
4208
|
+
function Ti(e) {
|
|
4204
4209
|
let t = {};
|
|
4205
4210
|
for (let n of e) {
|
|
4206
4211
|
let e = {};
|
|
4207
|
-
n.type === "number" && (e.halign = "right"), n.width ? e.cellWidth = Math.round(n.width *
|
|
4212
|
+
n.type === "number" && (e.halign = "right"), n.width ? e.cellWidth = Math.round(n.width * wi * 10) / 10 : n.fitData && (e.cellWidth = "wrap"), Object.keys(e).length && (t[n.key] = e);
|
|
4208
4213
|
}
|
|
4209
4214
|
return t;
|
|
4210
4215
|
}
|
|
4211
|
-
function
|
|
4216
|
+
function Ei(n, r, i = {}) {
|
|
4212
4217
|
let a = i.orientation || "landscape", o = new e({
|
|
4213
4218
|
orientation: a,
|
|
4214
4219
|
format: "a4"
|
|
4215
4220
|
});
|
|
4216
4221
|
L(o);
|
|
4217
4222
|
let s = 15;
|
|
4218
|
-
if (i.header ? s =
|
|
4223
|
+
if (i.header ? s = Et(o, {
|
|
4219
4224
|
...i.header,
|
|
4220
4225
|
subtitle: i.header.subtitle || i.title
|
|
4221
4226
|
}) : 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;
|
|
@@ -4229,7 +4234,7 @@ function wi(n, r, i = {}) {
|
|
|
4229
4234
|
t[r.key] = n == null ? "" : String(n);
|
|
4230
4235
|
}
|
|
4231
4236
|
return t;
|
|
4232
|
-
}), u =
|
|
4237
|
+
}), u = Ti(n);
|
|
4233
4238
|
return t(o, {
|
|
4234
4239
|
...G.report,
|
|
4235
4240
|
startY: s,
|
|
@@ -4244,29 +4249,19 @@ function wi(n, r, i = {}) {
|
|
|
4244
4249
|
//#endregion
|
|
4245
4250
|
//#region src/generators/factSheet.ts
|
|
4246
4251
|
var Z = 15;
|
|
4247
|
-
function
|
|
4252
|
+
function Di(e) {
|
|
4248
4253
|
if (typeof document < "u") {
|
|
4249
4254
|
let t = document.createElement("div");
|
|
4250
4255
|
return t.innerHTML = e, t.textContent || "";
|
|
4251
4256
|
}
|
|
4252
4257
|
let t = "", n = !1;
|
|
4253
|
-
for (let r of e)
|
|
4254
|
-
if (r === "<") {
|
|
4255
|
-
n = !0;
|
|
4256
|
-
continue;
|
|
4257
|
-
}
|
|
4258
|
-
if (r === ">") {
|
|
4259
|
-
n = !1;
|
|
4260
|
-
continue;
|
|
4261
|
-
}
|
|
4262
|
-
n || (t += r);
|
|
4263
|
-
}
|
|
4258
|
+
for (let r of e) r === "<" ? n = !0 : r === ">" ? n = !1 : n || (t += r);
|
|
4264
4259
|
return t.trim();
|
|
4265
4260
|
}
|
|
4266
4261
|
function Q(e, t, n) {
|
|
4267
4262
|
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;
|
|
4268
4263
|
}
|
|
4269
|
-
function
|
|
4264
|
+
function Oi(e, t, n, r) {
|
|
4270
4265
|
R(e, I.BODY, F.NORMAL);
|
|
4271
4266
|
let i = r || e.internal.pageSize.getWidth() - 30, a = e.splitTextToSize(t, i);
|
|
4272
4267
|
return e.text(a, Z, n), n + a.length * 3.2;
|
|
@@ -4275,7 +4270,7 @@ function $(e, t, n) {
|
|
|
4275
4270
|
let r = e.internal.pageSize.getHeight();
|
|
4276
4271
|
return t + n > r - 20 ? (e.addPage(), 20) : t;
|
|
4277
4272
|
}
|
|
4278
|
-
function
|
|
4273
|
+
function ki(e, t, n) {
|
|
4279
4274
|
let r = {
|
|
4280
4275
|
pageSize: "a4",
|
|
4281
4276
|
orientation: "portrait",
|
|
@@ -4286,9 +4281,9 @@ function Di(e, t, n) {
|
|
|
4286
4281
|
left: Z
|
|
4287
4282
|
}
|
|
4288
4283
|
};
|
|
4289
|
-
return n + B(e,
|
|
4284
|
+
return n + B(e, ze(t, { layout: "itf" }), r);
|
|
4290
4285
|
}
|
|
4291
|
-
function
|
|
4286
|
+
function Ai(e, n, r) {
|
|
4292
4287
|
let i = (n.participants || []).filter((e) => e.participantRole && e.participantRole !== "COMPETITOR");
|
|
4293
4288
|
if (!i.length) return r;
|
|
4294
4289
|
r = $(e, r, 20), r = Q(e, "Tournament Contacts", r);
|
|
@@ -4328,7 +4323,7 @@ function Oi(e, n, r) {
|
|
|
4328
4323
|
theme: "grid"
|
|
4329
4324
|
}), e.lastAutoTable.finalY + 6;
|
|
4330
4325
|
}
|
|
4331
|
-
function
|
|
4326
|
+
function ji(e, n, r) {
|
|
4332
4327
|
let i = n.events || [];
|
|
4333
4328
|
if (!i.length) return r;
|
|
4334
4329
|
r = $(e, r, 20), r = Q(e, "Events", r);
|
|
@@ -4370,7 +4365,7 @@ function ki(e, n, r) {
|
|
|
4370
4365
|
theme: "grid"
|
|
4371
4366
|
}), e.lastAutoTable.finalY + 6;
|
|
4372
4367
|
}
|
|
4373
|
-
function
|
|
4368
|
+
function Mi(e, t, n) {
|
|
4374
4369
|
let r = t.registrationProfile;
|
|
4375
4370
|
if (!r) return n;
|
|
4376
4371
|
let i = [];
|
|
@@ -4383,7 +4378,7 @@ function Ai(e, t, n) {
|
|
|
4383
4378
|
for (let t of i) e.text(t, Z, n), n += 3.5;
|
|
4384
4379
|
return n + 3;
|
|
4385
4380
|
}
|
|
4386
|
-
function
|
|
4381
|
+
function Ni(e, t, n) {
|
|
4387
4382
|
let r = t.venues || [];
|
|
4388
4383
|
if (!r.length) return n;
|
|
4389
4384
|
n = $(e, n, 15), n = Q(e, "Venue", n), R(e, I.BODY, F.NORMAL);
|
|
@@ -4405,9 +4400,9 @@ function ji(e, t, n) {
|
|
|
4405
4400
|
}
|
|
4406
4401
|
return n + 3;
|
|
4407
4402
|
}
|
|
4408
|
-
function
|
|
4403
|
+
function Pi(e, n, r, i) {
|
|
4409
4404
|
if (!r) return i;
|
|
4410
|
-
let a = r.options?.length, o = r.notes &&
|
|
4405
|
+
let a = r.options?.length, o = r.notes && Di(r.notes);
|
|
4411
4406
|
if (!a && !o) return i;
|
|
4412
4407
|
if (i = $(e, i, 15), i = Q(e, n, i), a) {
|
|
4413
4408
|
let n = r.options.map((e) => {
|
|
@@ -4450,16 +4445,16 @@ function Mi(e, n, r, i) {
|
|
|
4450
4445
|
theme: "grid"
|
|
4451
4446
|
}), i = e.lastAutoTable.finalY + 3;
|
|
4452
4447
|
}
|
|
4453
|
-
return o && (i =
|
|
4448
|
+
return o && (i = Oi(e, Di(r.notes), i)), i + 3;
|
|
4454
4449
|
}
|
|
4455
|
-
function
|
|
4450
|
+
function Fi(e, t, n) {
|
|
4456
4451
|
let r = t.totalPrizeMoney;
|
|
4457
4452
|
if (!r?.length) return n;
|
|
4458
4453
|
n = $(e, n, 10), n = Q(e, "Prize Money", n), R(e, I.BODY, F.NORMAL);
|
|
4459
4454
|
for (let t of r) e.text(t.currencyCode + " " + t.amount.toLocaleString(), Z, n), n += 3.5;
|
|
4460
4455
|
return n + 3;
|
|
4461
4456
|
}
|
|
4462
|
-
function
|
|
4457
|
+
function Ii(e, n, r) {
|
|
4463
4458
|
let i = (n.participants || []).filter((e) => e.participantRole === "OFFICIAL" || e.participantRole === "DIRECTOR");
|
|
4464
4459
|
if (!i.length) return r;
|
|
4465
4460
|
r = $(e, r, 15), r = Q(e, "Officials", r);
|
|
@@ -4491,7 +4486,7 @@ function Pi(e, n, r) {
|
|
|
4491
4486
|
theme: "grid"
|
|
4492
4487
|
}), e.lastAutoTable.finalY + 6;
|
|
4493
4488
|
}
|
|
4494
|
-
function
|
|
4489
|
+
function Li(e, t, n) {
|
|
4495
4490
|
let r = t.registrationProfile;
|
|
4496
4491
|
if (!r) return n;
|
|
4497
4492
|
let i = [];
|
|
@@ -4505,7 +4500,7 @@ function Fi(e, t, n) {
|
|
|
4505
4500
|
for (let t of i) e.text(t, Z, n), n += 3.5;
|
|
4506
4501
|
return n + 3;
|
|
4507
4502
|
}
|
|
4508
|
-
function
|
|
4503
|
+
function Ri(e, t, n) {
|
|
4509
4504
|
let r = t.registrationProfile?.sponsors;
|
|
4510
4505
|
if (!r?.length) return n;
|
|
4511
4506
|
n = $(e, n, 10), n = Q(e, "Sponsors", n), R(e, I.BODY, F.NORMAL);
|
|
@@ -4515,7 +4510,7 @@ function Ii(e, t, n) {
|
|
|
4515
4510
|
}
|
|
4516
4511
|
return n + 3;
|
|
4517
4512
|
}
|
|
4518
|
-
function
|
|
4513
|
+
function zi(e, t, n) {
|
|
4519
4514
|
let r = t.registrationProfile?.socialEvents;
|
|
4520
4515
|
if (!r?.length) return n;
|
|
4521
4516
|
let i = t.registrationProfile;
|
|
@@ -4531,31 +4526,31 @@ function Li(e, t, n) {
|
|
|
4531
4526
|
}
|
|
4532
4527
|
return n + 3;
|
|
4533
4528
|
}
|
|
4534
|
-
function
|
|
4529
|
+
function Bi(e, t, n) {
|
|
4535
4530
|
let r = t.notes;
|
|
4536
4531
|
if (!r) return n;
|
|
4537
|
-
let i =
|
|
4538
|
-
return i ? (n = $(e, n, 15), n = Q(e, "Additional Information", n), n =
|
|
4539
|
-
}
|
|
4540
|
-
var
|
|
4541
|
-
"tournament-header":
|
|
4542
|
-
contacts:
|
|
4543
|
-
events:
|
|
4544
|
-
"entry-info":
|
|
4545
|
-
"venue-info":
|
|
4546
|
-
accommodation: (e, t, n) =>
|
|
4547
|
-
transportation: (e, t, n) =>
|
|
4548
|
-
hospitality: (e, t, n) =>
|
|
4549
|
-
medical: (e, t, n) =>
|
|
4550
|
-
regulations:
|
|
4551
|
-
"prize-money":
|
|
4552
|
-
officials:
|
|
4553
|
-
sponsors:
|
|
4554
|
-
"social-events":
|
|
4555
|
-
"custom-notes":
|
|
4532
|
+
let i = Di(r);
|
|
4533
|
+
return i ? (n = $(e, n, 15), n = Q(e, "Additional Information", n), n = Oi(e, i, n), n + 3) : n;
|
|
4534
|
+
}
|
|
4535
|
+
var Vi = {
|
|
4536
|
+
"tournament-header": ki,
|
|
4537
|
+
contacts: Ai,
|
|
4538
|
+
events: ji,
|
|
4539
|
+
"entry-info": Mi,
|
|
4540
|
+
"venue-info": Ni,
|
|
4541
|
+
accommodation: (e, t, n) => Pi(e, "Accommodation", t.registrationProfile?.accommodation, n),
|
|
4542
|
+
transportation: (e, t, n) => Pi(e, "Transportation", t.registrationProfile?.transportation, n),
|
|
4543
|
+
hospitality: (e, t, n) => Pi(e, "Hospitality", t.registrationProfile?.hospitality, n),
|
|
4544
|
+
medical: (e, t, n) => Pi(e, "Medical", t.registrationProfile?.medicalInfo, n),
|
|
4545
|
+
regulations: Li,
|
|
4546
|
+
"prize-money": Fi,
|
|
4547
|
+
officials: Ii,
|
|
4548
|
+
sponsors: Ri,
|
|
4549
|
+
"social-events": zi,
|
|
4550
|
+
"custom-notes": Bi
|
|
4556
4551
|
};
|
|
4557
|
-
function
|
|
4558
|
-
let { templateId: r = "itf-junior" } = n, i =
|
|
4552
|
+
function Hi(t, n = {}) {
|
|
4553
|
+
let { templateId: r = "itf-junior" } = n, i = de(r)?.sections || de("itf-junior").sections, a = n.enabledSections ? new Set(n.enabledSections) : null, o = new e({
|
|
4559
4554
|
orientation: "portrait",
|
|
4560
4555
|
format: "a4"
|
|
4561
4556
|
});
|
|
@@ -4563,7 +4558,7 @@ function Bi(t, n = {}) {
|
|
|
4563
4558
|
let s = Z;
|
|
4564
4559
|
for (let e of i) {
|
|
4565
4560
|
if (!e.enabled || a && !a.has(e.type)) continue;
|
|
4566
|
-
let n =
|
|
4561
|
+
let n = Vi[e.type];
|
|
4567
4562
|
n && (s = n(o, t, s));
|
|
4568
4563
|
}
|
|
4569
4564
|
let c = o.getNumberOfPages();
|
|
@@ -4572,8 +4567,8 @@ function Bi(t, n = {}) {
|
|
|
4572
4567
|
}
|
|
4573
4568
|
//#endregion
|
|
4574
4569
|
//#region src/generators/generateFromEventData.ts
|
|
4575
|
-
function
|
|
4576
|
-
let n = e?.drawsData || [], r = e?.tournamentInfo || {}, i = e?.eventInfo || {}, a =
|
|
4570
|
+
function Ui(e, t = {}) {
|
|
4571
|
+
let n = e?.drawsData || [], r = e?.tournamentInfo || {}, i = e?.eventInfo || {}, a = C(t.catalogPreset || "club-basic"), o = g(a?.drawFormatPreset || "itfJunior"), s = {
|
|
4577
4572
|
layout: "itf",
|
|
4578
4573
|
tournamentName: r.tournamentName || "Tournament",
|
|
4579
4574
|
...a?.header,
|
|
@@ -4596,18 +4591,18 @@ function Vi(e, t = {}) {
|
|
|
4596
4591
|
footer: c,
|
|
4597
4592
|
format: o
|
|
4598
4593
|
};
|
|
4599
|
-
if (u && d) return
|
|
4600
|
-
winnersBracket: f ? N(f) :
|
|
4601
|
-
losersBracket: P(n, "CONSOLATION") ? N(P(n, "CONSOLATION")) :
|
|
4594
|
+
if (u && d) return mr({
|
|
4595
|
+
winnersBracket: f ? N(f) : Wi(),
|
|
4596
|
+
losersBracket: P(n, "CONSOLATION") ? N(P(n, "CONSOLATION")) : Wi(),
|
|
4602
4597
|
deciderMatch: P(n, "PLAY_OFF") ? N(P(n, "PLAY_OFF")) : void 0
|
|
4603
4598
|
}, p);
|
|
4604
|
-
if (u) return
|
|
4599
|
+
if (u) return ur(l.map((e) => ({
|
|
4605
4600
|
name: e.structureName,
|
|
4606
4601
|
stage: e.stage,
|
|
4607
4602
|
drawData: N(e)
|
|
4608
4603
|
})), p);
|
|
4609
4604
|
let m = t.structureId && l.find((e) => e.structureId === t.structureId) || f;
|
|
4610
|
-
if (!m) return
|
|
4605
|
+
if (!m) return Ce({
|
|
4611
4606
|
pageSize: "a4",
|
|
4612
4607
|
orientation: "portrait",
|
|
4613
4608
|
margins: {
|
|
@@ -4617,13 +4612,13 @@ function Vi(e, t = {}) {
|
|
|
4617
4612
|
left: 15
|
|
4618
4613
|
}
|
|
4619
4614
|
});
|
|
4620
|
-
let
|
|
4621
|
-
return t.mirrored ?
|
|
4615
|
+
let h = N(m);
|
|
4616
|
+
return t.mirrored ? fr(h, p) : t.splitPages || h.drawSize >= 256 ? cr(h, {
|
|
4622
4617
|
...p,
|
|
4623
4618
|
maxPositionsPerPage: t.maxPositionsPerPage || 32
|
|
4624
|
-
}) :
|
|
4619
|
+
}) : sr(h, p);
|
|
4625
4620
|
}
|
|
4626
|
-
function
|
|
4621
|
+
function Wi() {
|
|
4627
4622
|
return {
|
|
4628
4623
|
drawName: "",
|
|
4629
4624
|
drawSize: 0,
|
|
@@ -4635,6 +4630,6 @@ function Hi() {
|
|
|
4635
4630
|
};
|
|
4636
4631
|
}
|
|
4637
4632
|
//#endregion
|
|
4638
|
-
export {
|
|
4633
|
+
export { S as COMPOSITION_CATALOG, Hr as DRAW_MODAL_TABS, ue as FACT_SHEET_CATALOG, he as FONT, Rr as FOOTER_LAYOUT_OPTIONS, Lr as HEADER_LAYOUT_OPTIONS, Br as ORIENTATION_OPTIONS, zr as PAGE_SIZE_OPTIONS, h as PRESETS, Ur as SCHEDULE_MODAL_TABS, I as SIZE, Vr as SPLIT_STRATEGY_OPTIONS, F as STYLE, G as TABLE_STYLES, ye as activeFontFamily, L as applyDefaultFont, Be as buildFooterFromTournament, ze as buildHeaderFromTournament, ti as calculateBracketPositions, Ce as createDoc, ri as drawBracketConnectors, ni as drawBracketSlot, W as drawPageFooter, Et as drawTournamentHeader, at as entryStatusDisplay, lt as eventAbbreviation, yr as executePrint, $r as extractCompassData, Wn as extractConsolationStructures, gt as extractCourtCardData, Pt as extractDrawData, mt as extractParticipantData, Wr as extractRoundRobinData, ft as extractScheduleData, P as findStructure, st as formatDate, q as formatMatchScore, Lt as formatPlayerEntry, ot as formatScore, ct as formatTime, pr as generateBackdrawPDF, dr as generateCompassDrawPDF, ur as generateConsolationDrawPDF, kt as generateCourtCardPDF, mr as generateDoubleEliminationPDF, ar as generateDrawPDF, ai as generateDrawSheetPDF, Hi as generateFactSheet, lr as generateFeedInDrawPDF, Ui as generateFromEventData, hr as generateLuckyDrawPDF, jt as generateMatchCardPDF, fr as generateMirroredDrawPDF, yt as generateOrderOfPlayPDF, yt as generateScheduleV2PDF, Dt as generatePlayerListPDF, Ei as generateReportPDF, li as generateSchedulePDF, _i as generateSequentialOOP, Ot as generateSignInSheetPDF, cr as generateSplitDrawPDF, sr as generateTraditionalDrawPDF, C as getCatalogPreset, Se as getDefaultFont, we as getDefaultPageConfig, de as getFactSheetTemplate, z as getPageRegions, g as getPreset, K as getRoundLabel, ee as listCatalogPresets, fe as listFactSheetTemplates, V as measureFooterHeight, rt as measureSeedingsHeight, te as mergeCatalogPreset, _ as mergePreset, U as nationality, H as participantName, ve as registerFont, Vn as renderCompassDraw, Gn as renderConsolationDraw, Kn as renderDoubleEliminationDraw, Ge as renderFooter, B as renderHeader, Zn as renderLuckyDraw, Yr as renderRoundRobinGroup, tt as renderSeedingsFooter, J as renderTraditionalDraw, pi as resolveCompositionConfig, ut as roundName, it as seedDisplay, xe as setDefaultFont, R as setFont, er as splitDraw, N as structureToDrawData };
|
|
4639
4634
|
|
|
4640
4635
|
//# sourceMappingURL=pdf-factory.js.map
|