@xcpcio/core 0.83.1 → 0.84.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +51 -0
- package/dist/index.d.cts +21 -2
- package/dist/index.d.mts +21 -2
- package/dist/index.d.ts +21 -2
- package/dist/index.mjs +48 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1158,6 +1158,47 @@ function createOrganizations(orgsJSON) {
|
|
|
1158
1158
|
return orgsJSON.map((org) => createOrganization(org));
|
|
1159
1159
|
}
|
|
1160
1160
|
|
|
1161
|
+
class SeatMapSection {
|
|
1162
|
+
title;
|
|
1163
|
+
rowLabels;
|
|
1164
|
+
grid;
|
|
1165
|
+
constructor() {
|
|
1166
|
+
this.title = new I18nText();
|
|
1167
|
+
this.rowLabels = [];
|
|
1168
|
+
this.grid = [];
|
|
1169
|
+
}
|
|
1170
|
+
}
|
|
1171
|
+
class SeatMap {
|
|
1172
|
+
sections;
|
|
1173
|
+
constructor() {
|
|
1174
|
+
this.sections = [];
|
|
1175
|
+
}
|
|
1176
|
+
/**
|
|
1177
|
+
* Build a map from seat IDs (from team.location) to teams
|
|
1178
|
+
*/
|
|
1179
|
+
buildSeatToTeamMap(teams) {
|
|
1180
|
+
const map = /* @__PURE__ */ new Map();
|
|
1181
|
+
for (const team of teams) {
|
|
1182
|
+
if (team.location) {
|
|
1183
|
+
map.set(team.location, team);
|
|
1184
|
+
}
|
|
1185
|
+
}
|
|
1186
|
+
return map;
|
|
1187
|
+
}
|
|
1188
|
+
}
|
|
1189
|
+
function createSeatMapSection(sectionJSON) {
|
|
1190
|
+
const s = new SeatMapSection();
|
|
1191
|
+
s.title = I18nText.fromIText(sectionJSON.title ?? "");
|
|
1192
|
+
s.rowLabels = sectionJSON.rowLabels ?? [];
|
|
1193
|
+
s.grid = sectionJSON.grid ?? [];
|
|
1194
|
+
return s;
|
|
1195
|
+
}
|
|
1196
|
+
function createSeatMap(seatMapJSON) {
|
|
1197
|
+
const sm = new SeatMap();
|
|
1198
|
+
sm.sections = (seatMapJSON.sections ?? []).map(createSeatMapSection);
|
|
1199
|
+
return sm;
|
|
1200
|
+
}
|
|
1201
|
+
|
|
1161
1202
|
class Contest {
|
|
1162
1203
|
id = "";
|
|
1163
1204
|
name;
|
|
@@ -1184,8 +1225,10 @@ class Contest {
|
|
|
1184
1225
|
banner;
|
|
1185
1226
|
bannerMode;
|
|
1186
1227
|
boardLink;
|
|
1228
|
+
socialMedia;
|
|
1187
1229
|
options;
|
|
1188
1230
|
organizations;
|
|
1231
|
+
seatMap;
|
|
1189
1232
|
constructor() {
|
|
1190
1233
|
this.name = new I18nText();
|
|
1191
1234
|
this.startTime = createDayJS();
|
|
@@ -1405,12 +1448,16 @@ function createContest(contestJSON) {
|
|
|
1405
1448
|
}
|
|
1406
1449
|
c.logo = contestJSON.logo;
|
|
1407
1450
|
c.boardLink = contestJSON.board_link;
|
|
1451
|
+
c.socialMedia = contestJSON.social_media;
|
|
1408
1452
|
if (contestJSON.options) {
|
|
1409
1453
|
c.options = createContestOptions(contestJSON.options);
|
|
1410
1454
|
}
|
|
1411
1455
|
if (contestJSON.organizations) {
|
|
1412
1456
|
c.organizations = createOrganizations(contestJSON.organizations);
|
|
1413
1457
|
}
|
|
1458
|
+
if (contestJSON.seat_map && !("url" in contestJSON.seat_map)) {
|
|
1459
|
+
c.seatMap = createSeatMap(contestJSON.seat_map);
|
|
1460
|
+
}
|
|
1414
1461
|
return c;
|
|
1415
1462
|
}
|
|
1416
1463
|
|
|
@@ -3007,6 +3054,8 @@ exports.RatingUser = RatingUser;
|
|
|
3007
3054
|
exports.RatingUtility = RatingUtility;
|
|
3008
3055
|
exports.Resolver = Resolver;
|
|
3009
3056
|
exports.ResolverVue = ResolverVue;
|
|
3057
|
+
exports.SeatMap = SeatMap;
|
|
3058
|
+
exports.SeatMapSection = SeatMapSection;
|
|
3010
3059
|
exports.Submission = Submission;
|
|
3011
3060
|
exports.Team = Team;
|
|
3012
3061
|
exports.TeamProblemStatistics = TeamProblemStatistics;
|
|
@@ -3021,6 +3070,8 @@ exports.createPersons = createPersons;
|
|
|
3021
3070
|
exports.createProblem = createProblem;
|
|
3022
3071
|
exports.createProblems = createProblems;
|
|
3023
3072
|
exports.createProblemsByProblemIds = createProblemsByProblemIds;
|
|
3073
|
+
exports.createSeatMap = createSeatMap;
|
|
3074
|
+
exports.createSeatMapSection = createSeatMapSection;
|
|
3024
3075
|
exports.createSubmission = createSubmission;
|
|
3025
3076
|
exports.createSubmissions = createSubmissions;
|
|
3026
3077
|
exports.createTeam = createTeam;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CalculationOfPenalty, TimeUnit, Image, Lang, I18NStringSet, Text, Person as Person$1, Persons as Persons$1, Team as Team$1, Teams as Teams$1, Organization as Organization$1, Organizations as Organizations$1, StatusTimeDisplay, MedalPreset, BannerMode, ContestState, Contest as Contest$1, SubmissionReaction, SubmissionStatus, Submission as Submission$1, Submissions as Submissions$1, BalloonColor, Problem as Problem$1, Problems as Problems$1, ContestIndex as ContestIndex$1, IRatingHistory, IRatingUser, IRating } from '@xcpcio/types';
|
|
1
|
+
import { CalculationOfPenalty, TimeUnit, Image, Lang, I18NStringSet, Text, Person as Person$1, Persons as Persons$1, Team as Team$1, Teams as Teams$1, Organization as Organization$1, Organizations as Organizations$1, SeatMapSection as SeatMapSection$1, SeatMap as SeatMap$1, StatusTimeDisplay, MedalPreset, BannerMode, SocialMedia, ContestState, Contest as Contest$1, SubmissionReaction, SubmissionStatus, Submission as Submission$1, Submissions as Submissions$1, BalloonColor, Problem as Problem$1, Problems as Problems$1, ContestIndex as ContestIndex$1, IRatingHistory, IRatingUser, IRating } from '@xcpcio/types';
|
|
2
2
|
import dayjs from 'dayjs';
|
|
3
3
|
export { default as dayjs } from 'dayjs';
|
|
4
4
|
import * as XLSX from 'xlsx-js-style';
|
|
@@ -140,6 +140,23 @@ type Organizations = Array<Organization>;
|
|
|
140
140
|
declare function createOrganization(orgJSON: Organization$1): Organization;
|
|
141
141
|
declare function createOrganizations(orgsJSON: Organizations$1): Organizations;
|
|
142
142
|
|
|
143
|
+
declare class SeatMapSection {
|
|
144
|
+
title: I18nText;
|
|
145
|
+
rowLabels: Array<string | null>;
|
|
146
|
+
grid: Array<Array<string | null>>;
|
|
147
|
+
constructor();
|
|
148
|
+
}
|
|
149
|
+
declare class SeatMap {
|
|
150
|
+
sections: Array<SeatMapSection>;
|
|
151
|
+
constructor();
|
|
152
|
+
/**
|
|
153
|
+
* Build a map from seat IDs (from team.location) to teams
|
|
154
|
+
*/
|
|
155
|
+
buildSeatToTeamMap(teams: Teams): Map<string, Team>;
|
|
156
|
+
}
|
|
157
|
+
declare function createSeatMapSection(sectionJSON: SeatMapSection$1): SeatMapSection;
|
|
158
|
+
declare function createSeatMap(seatMapJSON: SeatMap$1): SeatMap;
|
|
159
|
+
|
|
143
160
|
declare class Group {
|
|
144
161
|
name: I18nText;
|
|
145
162
|
isDefault: boolean;
|
|
@@ -183,8 +200,10 @@ declare class Contest {
|
|
|
183
200
|
banner?: Image;
|
|
184
201
|
bannerMode?: BannerMode;
|
|
185
202
|
boardLink?: string;
|
|
203
|
+
socialMedia?: SocialMedia;
|
|
186
204
|
options: ContestOptions;
|
|
187
205
|
organizations?: Organizations;
|
|
206
|
+
seatMap?: SeatMap;
|
|
188
207
|
constructor();
|
|
189
208
|
getStartTime(): dayjs.Dayjs;
|
|
190
209
|
getEndTime(): dayjs.Dayjs;
|
|
@@ -572,5 +591,5 @@ declare function isRejected(status: SubmissionStatus): boolean;
|
|
|
572
591
|
declare function isPending(status: SubmissionStatus): boolean;
|
|
573
592
|
declare function isNotCalculatedPenaltyStatus(status: SubmissionStatus): boolean;
|
|
574
593
|
|
|
575
|
-
export { Award, Balloon, BattleOfGiants, CodeforcesGymGhostDATConverter, Contest, ContestIndex, ContestIndexConfig, ContestOptions, GeneralExcelConverter, Giants, GiantsType, I18nText, ICPCStandingsCsvConverter, MedalType, Organization, Person, PlaceChartPointData, Problem, ProblemStatistics, Rank, RankOptions, RankStatistics, Rating, RatingCalculator, RatingHistory, RatingLevel, RatingLevelToString, RatingUser, RatingUtility, Resolver, ResolverVue, Submission, Team, TeamProblemStatistics, calcDirt, createContest, createContestIndex, createContestIndexList, createDayJS, createOrganization, createOrganizations, createPersons, createProblem, createProblems, createProblemsByProblemIds, createSubmission, createSubmissions, createTeam, createTeams, getImageSource, getTimeDiff, getTimestamp, getWhiteOrBlackColor, getWhiteOrBlackColorV1, isAccepted, isNotCalculatedPenaltyStatus, isPending, isRejected, isValidMedalType, normalizePath, stringToSubmissionStatus };
|
|
594
|
+
export { Award, Balloon, BattleOfGiants, CodeforcesGymGhostDATConverter, Contest, ContestIndex, ContestIndexConfig, ContestOptions, GeneralExcelConverter, Giants, GiantsType, I18nText, ICPCStandingsCsvConverter, MedalType, Organization, Person, PlaceChartPointData, Problem, ProblemStatistics, Rank, RankOptions, RankStatistics, Rating, RatingCalculator, RatingHistory, RatingLevel, RatingLevelToString, RatingUser, RatingUtility, Resolver, ResolverVue, SeatMap, SeatMapSection, Submission, Team, TeamProblemStatistics, calcDirt, createContest, createContestIndex, createContestIndexList, createDayJS, createOrganization, createOrganizations, createPersons, createProblem, createProblems, createProblemsByProblemIds, createSeatMap, createSeatMapSection, createSubmission, createSubmissions, createTeam, createTeams, getImageSource, getTimeDiff, getTimestamp, getWhiteOrBlackColor, getWhiteOrBlackColorV1, isAccepted, isNotCalculatedPenaltyStatus, isPending, isRejected, isValidMedalType, normalizePath, stringToSubmissionStatus };
|
|
576
595
|
export type { Awards, Balloons, ContestIndexList, Options, Organizations, Persons, Problems, Ranks, RatingHistories, RatingUserMap, RatingUsers, SelectOptionItem, Submissions, Teams };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CalculationOfPenalty, TimeUnit, Image, Lang, I18NStringSet, Text, Person as Person$1, Persons as Persons$1, Team as Team$1, Teams as Teams$1, Organization as Organization$1, Organizations as Organizations$1, StatusTimeDisplay, MedalPreset, BannerMode, ContestState, Contest as Contest$1, SubmissionReaction, SubmissionStatus, Submission as Submission$1, Submissions as Submissions$1, BalloonColor, Problem as Problem$1, Problems as Problems$1, ContestIndex as ContestIndex$1, IRatingHistory, IRatingUser, IRating } from '@xcpcio/types';
|
|
1
|
+
import { CalculationOfPenalty, TimeUnit, Image, Lang, I18NStringSet, Text, Person as Person$1, Persons as Persons$1, Team as Team$1, Teams as Teams$1, Organization as Organization$1, Organizations as Organizations$1, SeatMapSection as SeatMapSection$1, SeatMap as SeatMap$1, StatusTimeDisplay, MedalPreset, BannerMode, SocialMedia, ContestState, Contest as Contest$1, SubmissionReaction, SubmissionStatus, Submission as Submission$1, Submissions as Submissions$1, BalloonColor, Problem as Problem$1, Problems as Problems$1, ContestIndex as ContestIndex$1, IRatingHistory, IRatingUser, IRating } from '@xcpcio/types';
|
|
2
2
|
import dayjs from 'dayjs';
|
|
3
3
|
export { default as dayjs } from 'dayjs';
|
|
4
4
|
import * as XLSX from 'xlsx-js-style';
|
|
@@ -140,6 +140,23 @@ type Organizations = Array<Organization>;
|
|
|
140
140
|
declare function createOrganization(orgJSON: Organization$1): Organization;
|
|
141
141
|
declare function createOrganizations(orgsJSON: Organizations$1): Organizations;
|
|
142
142
|
|
|
143
|
+
declare class SeatMapSection {
|
|
144
|
+
title: I18nText;
|
|
145
|
+
rowLabels: Array<string | null>;
|
|
146
|
+
grid: Array<Array<string | null>>;
|
|
147
|
+
constructor();
|
|
148
|
+
}
|
|
149
|
+
declare class SeatMap {
|
|
150
|
+
sections: Array<SeatMapSection>;
|
|
151
|
+
constructor();
|
|
152
|
+
/**
|
|
153
|
+
* Build a map from seat IDs (from team.location) to teams
|
|
154
|
+
*/
|
|
155
|
+
buildSeatToTeamMap(teams: Teams): Map<string, Team>;
|
|
156
|
+
}
|
|
157
|
+
declare function createSeatMapSection(sectionJSON: SeatMapSection$1): SeatMapSection;
|
|
158
|
+
declare function createSeatMap(seatMapJSON: SeatMap$1): SeatMap;
|
|
159
|
+
|
|
143
160
|
declare class Group {
|
|
144
161
|
name: I18nText;
|
|
145
162
|
isDefault: boolean;
|
|
@@ -183,8 +200,10 @@ declare class Contest {
|
|
|
183
200
|
banner?: Image;
|
|
184
201
|
bannerMode?: BannerMode;
|
|
185
202
|
boardLink?: string;
|
|
203
|
+
socialMedia?: SocialMedia;
|
|
186
204
|
options: ContestOptions;
|
|
187
205
|
organizations?: Organizations;
|
|
206
|
+
seatMap?: SeatMap;
|
|
188
207
|
constructor();
|
|
189
208
|
getStartTime(): dayjs.Dayjs;
|
|
190
209
|
getEndTime(): dayjs.Dayjs;
|
|
@@ -572,5 +591,5 @@ declare function isRejected(status: SubmissionStatus): boolean;
|
|
|
572
591
|
declare function isPending(status: SubmissionStatus): boolean;
|
|
573
592
|
declare function isNotCalculatedPenaltyStatus(status: SubmissionStatus): boolean;
|
|
574
593
|
|
|
575
|
-
export { Award, Balloon, BattleOfGiants, CodeforcesGymGhostDATConverter, Contest, ContestIndex, ContestIndexConfig, ContestOptions, GeneralExcelConverter, Giants, GiantsType, I18nText, ICPCStandingsCsvConverter, MedalType, Organization, Person, PlaceChartPointData, Problem, ProblemStatistics, Rank, RankOptions, RankStatistics, Rating, RatingCalculator, RatingHistory, RatingLevel, RatingLevelToString, RatingUser, RatingUtility, Resolver, ResolverVue, Submission, Team, TeamProblemStatistics, calcDirt, createContest, createContestIndex, createContestIndexList, createDayJS, createOrganization, createOrganizations, createPersons, createProblem, createProblems, createProblemsByProblemIds, createSubmission, createSubmissions, createTeam, createTeams, getImageSource, getTimeDiff, getTimestamp, getWhiteOrBlackColor, getWhiteOrBlackColorV1, isAccepted, isNotCalculatedPenaltyStatus, isPending, isRejected, isValidMedalType, normalizePath, stringToSubmissionStatus };
|
|
594
|
+
export { Award, Balloon, BattleOfGiants, CodeforcesGymGhostDATConverter, Contest, ContestIndex, ContestIndexConfig, ContestOptions, GeneralExcelConverter, Giants, GiantsType, I18nText, ICPCStandingsCsvConverter, MedalType, Organization, Person, PlaceChartPointData, Problem, ProblemStatistics, Rank, RankOptions, RankStatistics, Rating, RatingCalculator, RatingHistory, RatingLevel, RatingLevelToString, RatingUser, RatingUtility, Resolver, ResolverVue, SeatMap, SeatMapSection, Submission, Team, TeamProblemStatistics, calcDirt, createContest, createContestIndex, createContestIndexList, createDayJS, createOrganization, createOrganizations, createPersons, createProblem, createProblems, createProblemsByProblemIds, createSeatMap, createSeatMapSection, createSubmission, createSubmissions, createTeam, createTeams, getImageSource, getTimeDiff, getTimestamp, getWhiteOrBlackColor, getWhiteOrBlackColorV1, isAccepted, isNotCalculatedPenaltyStatus, isPending, isRejected, isValidMedalType, normalizePath, stringToSubmissionStatus };
|
|
576
595
|
export type { Awards, Balloons, ContestIndexList, Options, Organizations, Persons, Problems, Ranks, RatingHistories, RatingUserMap, RatingUsers, SelectOptionItem, Submissions, Teams };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CalculationOfPenalty, TimeUnit, Image, Lang, I18NStringSet, Text, Person as Person$1, Persons as Persons$1, Team as Team$1, Teams as Teams$1, Organization as Organization$1, Organizations as Organizations$1, StatusTimeDisplay, MedalPreset, BannerMode, ContestState, Contest as Contest$1, SubmissionReaction, SubmissionStatus, Submission as Submission$1, Submissions as Submissions$1, BalloonColor, Problem as Problem$1, Problems as Problems$1, ContestIndex as ContestIndex$1, IRatingHistory, IRatingUser, IRating } from '@xcpcio/types';
|
|
1
|
+
import { CalculationOfPenalty, TimeUnit, Image, Lang, I18NStringSet, Text, Person as Person$1, Persons as Persons$1, Team as Team$1, Teams as Teams$1, Organization as Organization$1, Organizations as Organizations$1, SeatMapSection as SeatMapSection$1, SeatMap as SeatMap$1, StatusTimeDisplay, MedalPreset, BannerMode, SocialMedia, ContestState, Contest as Contest$1, SubmissionReaction, SubmissionStatus, Submission as Submission$1, Submissions as Submissions$1, BalloonColor, Problem as Problem$1, Problems as Problems$1, ContestIndex as ContestIndex$1, IRatingHistory, IRatingUser, IRating } from '@xcpcio/types';
|
|
2
2
|
import dayjs from 'dayjs';
|
|
3
3
|
export { default as dayjs } from 'dayjs';
|
|
4
4
|
import * as XLSX from 'xlsx-js-style';
|
|
@@ -140,6 +140,23 @@ type Organizations = Array<Organization>;
|
|
|
140
140
|
declare function createOrganization(orgJSON: Organization$1): Organization;
|
|
141
141
|
declare function createOrganizations(orgsJSON: Organizations$1): Organizations;
|
|
142
142
|
|
|
143
|
+
declare class SeatMapSection {
|
|
144
|
+
title: I18nText;
|
|
145
|
+
rowLabels: Array<string | null>;
|
|
146
|
+
grid: Array<Array<string | null>>;
|
|
147
|
+
constructor();
|
|
148
|
+
}
|
|
149
|
+
declare class SeatMap {
|
|
150
|
+
sections: Array<SeatMapSection>;
|
|
151
|
+
constructor();
|
|
152
|
+
/**
|
|
153
|
+
* Build a map from seat IDs (from team.location) to teams
|
|
154
|
+
*/
|
|
155
|
+
buildSeatToTeamMap(teams: Teams): Map<string, Team>;
|
|
156
|
+
}
|
|
157
|
+
declare function createSeatMapSection(sectionJSON: SeatMapSection$1): SeatMapSection;
|
|
158
|
+
declare function createSeatMap(seatMapJSON: SeatMap$1): SeatMap;
|
|
159
|
+
|
|
143
160
|
declare class Group {
|
|
144
161
|
name: I18nText;
|
|
145
162
|
isDefault: boolean;
|
|
@@ -183,8 +200,10 @@ declare class Contest {
|
|
|
183
200
|
banner?: Image;
|
|
184
201
|
bannerMode?: BannerMode;
|
|
185
202
|
boardLink?: string;
|
|
203
|
+
socialMedia?: SocialMedia;
|
|
186
204
|
options: ContestOptions;
|
|
187
205
|
organizations?: Organizations;
|
|
206
|
+
seatMap?: SeatMap;
|
|
188
207
|
constructor();
|
|
189
208
|
getStartTime(): dayjs.Dayjs;
|
|
190
209
|
getEndTime(): dayjs.Dayjs;
|
|
@@ -572,5 +591,5 @@ declare function isRejected(status: SubmissionStatus): boolean;
|
|
|
572
591
|
declare function isPending(status: SubmissionStatus): boolean;
|
|
573
592
|
declare function isNotCalculatedPenaltyStatus(status: SubmissionStatus): boolean;
|
|
574
593
|
|
|
575
|
-
export { Award, Balloon, BattleOfGiants, CodeforcesGymGhostDATConverter, Contest, ContestIndex, ContestIndexConfig, ContestOptions, GeneralExcelConverter, Giants, GiantsType, I18nText, ICPCStandingsCsvConverter, MedalType, Organization, Person, PlaceChartPointData, Problem, ProblemStatistics, Rank, RankOptions, RankStatistics, Rating, RatingCalculator, RatingHistory, RatingLevel, RatingLevelToString, RatingUser, RatingUtility, Resolver, ResolverVue, Submission, Team, TeamProblemStatistics, calcDirt, createContest, createContestIndex, createContestIndexList, createDayJS, createOrganization, createOrganizations, createPersons, createProblem, createProblems, createProblemsByProblemIds, createSubmission, createSubmissions, createTeam, createTeams, getImageSource, getTimeDiff, getTimestamp, getWhiteOrBlackColor, getWhiteOrBlackColorV1, isAccepted, isNotCalculatedPenaltyStatus, isPending, isRejected, isValidMedalType, normalizePath, stringToSubmissionStatus };
|
|
594
|
+
export { Award, Balloon, BattleOfGiants, CodeforcesGymGhostDATConverter, Contest, ContestIndex, ContestIndexConfig, ContestOptions, GeneralExcelConverter, Giants, GiantsType, I18nText, ICPCStandingsCsvConverter, MedalType, Organization, Person, PlaceChartPointData, Problem, ProblemStatistics, Rank, RankOptions, RankStatistics, Rating, RatingCalculator, RatingHistory, RatingLevel, RatingLevelToString, RatingUser, RatingUtility, Resolver, ResolverVue, SeatMap, SeatMapSection, Submission, Team, TeamProblemStatistics, calcDirt, createContest, createContestIndex, createContestIndexList, createDayJS, createOrganization, createOrganizations, createPersons, createProblem, createProblems, createProblemsByProblemIds, createSeatMap, createSeatMapSection, createSubmission, createSubmissions, createTeam, createTeams, getImageSource, getTimeDiff, getTimestamp, getWhiteOrBlackColor, getWhiteOrBlackColorV1, isAccepted, isNotCalculatedPenaltyStatus, isPending, isRejected, isValidMedalType, normalizePath, stringToSubmissionStatus };
|
|
576
595
|
export type { Awards, Balloons, ContestIndexList, Options, Organizations, Persons, Problems, Ranks, RatingHistories, RatingUserMap, RatingUsers, SelectOptionItem, Submissions, Teams };
|
package/dist/index.mjs
CHANGED
|
@@ -1127,6 +1127,47 @@ function createOrganizations(orgsJSON) {
|
|
|
1127
1127
|
return orgsJSON.map((org) => createOrganization(org));
|
|
1128
1128
|
}
|
|
1129
1129
|
|
|
1130
|
+
class SeatMapSection {
|
|
1131
|
+
title;
|
|
1132
|
+
rowLabels;
|
|
1133
|
+
grid;
|
|
1134
|
+
constructor() {
|
|
1135
|
+
this.title = new I18nText();
|
|
1136
|
+
this.rowLabels = [];
|
|
1137
|
+
this.grid = [];
|
|
1138
|
+
}
|
|
1139
|
+
}
|
|
1140
|
+
class SeatMap {
|
|
1141
|
+
sections;
|
|
1142
|
+
constructor() {
|
|
1143
|
+
this.sections = [];
|
|
1144
|
+
}
|
|
1145
|
+
/**
|
|
1146
|
+
* Build a map from seat IDs (from team.location) to teams
|
|
1147
|
+
*/
|
|
1148
|
+
buildSeatToTeamMap(teams) {
|
|
1149
|
+
const map = /* @__PURE__ */ new Map();
|
|
1150
|
+
for (const team of teams) {
|
|
1151
|
+
if (team.location) {
|
|
1152
|
+
map.set(team.location, team);
|
|
1153
|
+
}
|
|
1154
|
+
}
|
|
1155
|
+
return map;
|
|
1156
|
+
}
|
|
1157
|
+
}
|
|
1158
|
+
function createSeatMapSection(sectionJSON) {
|
|
1159
|
+
const s = new SeatMapSection();
|
|
1160
|
+
s.title = I18nText.fromIText(sectionJSON.title ?? "");
|
|
1161
|
+
s.rowLabels = sectionJSON.rowLabels ?? [];
|
|
1162
|
+
s.grid = sectionJSON.grid ?? [];
|
|
1163
|
+
return s;
|
|
1164
|
+
}
|
|
1165
|
+
function createSeatMap(seatMapJSON) {
|
|
1166
|
+
const sm = new SeatMap();
|
|
1167
|
+
sm.sections = (seatMapJSON.sections ?? []).map(createSeatMapSection);
|
|
1168
|
+
return sm;
|
|
1169
|
+
}
|
|
1170
|
+
|
|
1130
1171
|
class Contest {
|
|
1131
1172
|
id = "";
|
|
1132
1173
|
name;
|
|
@@ -1153,8 +1194,10 @@ class Contest {
|
|
|
1153
1194
|
banner;
|
|
1154
1195
|
bannerMode;
|
|
1155
1196
|
boardLink;
|
|
1197
|
+
socialMedia;
|
|
1156
1198
|
options;
|
|
1157
1199
|
organizations;
|
|
1200
|
+
seatMap;
|
|
1158
1201
|
constructor() {
|
|
1159
1202
|
this.name = new I18nText();
|
|
1160
1203
|
this.startTime = createDayJS();
|
|
@@ -1374,12 +1417,16 @@ function createContest(contestJSON) {
|
|
|
1374
1417
|
}
|
|
1375
1418
|
c.logo = contestJSON.logo;
|
|
1376
1419
|
c.boardLink = contestJSON.board_link;
|
|
1420
|
+
c.socialMedia = contestJSON.social_media;
|
|
1377
1421
|
if (contestJSON.options) {
|
|
1378
1422
|
c.options = createContestOptions(contestJSON.options);
|
|
1379
1423
|
}
|
|
1380
1424
|
if (contestJSON.organizations) {
|
|
1381
1425
|
c.organizations = createOrganizations(contestJSON.organizations);
|
|
1382
1426
|
}
|
|
1427
|
+
if (contestJSON.seat_map && !("url" in contestJSON.seat_map)) {
|
|
1428
|
+
c.seatMap = createSeatMap(contestJSON.seat_map);
|
|
1429
|
+
}
|
|
1383
1430
|
return c;
|
|
1384
1431
|
}
|
|
1385
1432
|
|
|
@@ -2944,4 +2991,4 @@ class ResolverVue extends Resolver {
|
|
|
2944
2991
|
}
|
|
2945
2992
|
}
|
|
2946
2993
|
|
|
2947
|
-
export { Award, Balloon, BattleOfGiants, CodeforcesGymGhostDATConverter, Contest, ContestIndex, ContestIndexConfig, ContestOptions, GeneralExcelConverter, Giants, GiantsType, I18nText, ICPCStandingsCsvConverter, MedalType, Organization, Person, PlaceChartPointData, Problem, ProblemStatistics, Rank, RankOptions, RankStatistics, Rating, RatingCalculator, RatingHistory, RatingLevel, RatingLevelToString, RatingUser, RatingUtility, Resolver, ResolverVue, Submission, Team, TeamProblemStatistics, calcDirt, createContest, createContestIndex, createContestIndexList, createDayJS, createOrganization, createOrganizations, createPersons, createProblem, createProblems, createProblemsByProblemIds, createSubmission, createSubmissions, createTeam, createTeams, getImageSource, getTimeDiff, getTimestamp, getWhiteOrBlackColor, getWhiteOrBlackColorV1, isAccepted, isNotCalculatedPenaltyStatus, isPending, isRejected, isValidMedalType, normalizePath, stringToSubmissionStatus };
|
|
2994
|
+
export { Award, Balloon, BattleOfGiants, CodeforcesGymGhostDATConverter, Contest, ContestIndex, ContestIndexConfig, ContestOptions, GeneralExcelConverter, Giants, GiantsType, I18nText, ICPCStandingsCsvConverter, MedalType, Organization, Person, PlaceChartPointData, Problem, ProblemStatistics, Rank, RankOptions, RankStatistics, Rating, RatingCalculator, RatingHistory, RatingLevel, RatingLevelToString, RatingUser, RatingUtility, Resolver, ResolverVue, SeatMap, SeatMapSection, Submission, Team, TeamProblemStatistics, calcDirt, createContest, createContestIndex, createContestIndexList, createDayJS, createOrganization, createOrganizations, createPersons, createProblem, createProblems, createProblemsByProblemIds, createSeatMap, createSeatMapSection, createSubmission, createSubmissions, createTeam, createTeams, getImageSource, getTimeDiff, getTimestamp, getWhiteOrBlackColor, getWhiteOrBlackColorV1, isAccepted, isNotCalculatedPenaltyStatus, isPending, isRejected, isValidMedalType, normalizePath, stringToSubmissionStatus };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xcpcio/core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.84.0",
|
|
5
5
|
"description": "The core library for XCPCIO",
|
|
6
6
|
"author": "Dup4 <hi@dup4.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"papaparse": "^5.5.3",
|
|
43
43
|
"string-width": "^8.1.0",
|
|
44
44
|
"xlsx-js-style": "^1.2.0",
|
|
45
|
-
"@xcpcio/types": "0.
|
|
45
|
+
"@xcpcio/types": "0.84.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@babel/types": "^7.28.6",
|