@xcpcio/board-app 0.64.3 → 0.65.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/404.html +1 -1
- package/dist/assets/{Balloon.vue_vue_type_script_setup_true_lang-C72zkpsg.js → Balloon.vue_vue_type_script_setup_true_lang-DJ7VLDtb.js} +1 -1
- package/dist/assets/{Board-Bg3Ppuz0.js → Board-B8rG5arh.js} +88 -88
- package/dist/assets/{Board-DfGcLI3S.css → Board-KDwnMR7h.css} +1 -1
- package/dist/assets/{ContestStateBadge-DdwsGPTU.js → ContestStateBadge-qOSo5QET.js} +1 -1
- package/dist/assets/{Countdown-DTJUHvaQ.js → Countdown-BHNR4sYA.js} +1 -1
- package/dist/assets/{DataSourceInput.vue_vue_type_script_setup_true_lang-CPMBGjH4.js → DataSourceInput.vue_vue_type_script_setup_true_lang-BZxKU59c.js} +1 -1
- package/dist/assets/{Footer-ChSZxbGT.js → Footer-951oB-Bb.js} +1 -1
- package/dist/assets/{NavBar-DDnpbir3.js → NavBar-Cr1S8se3.js} +1 -1
- package/dist/assets/{Resolver-D3Uo7ft5.js → Resolver-D9tUtksI.js} +4 -4
- package/dist/assets/{Resolver-BTlxgfNF.css → Resolver-ZGkKM3bm.css} +1 -1
- package/dist/assets/{RightArrowIcon-DXtf7iXS.js → RightArrowIcon-CZF5qnjM.js} +1 -1
- package/dist/assets/{TheInput.vue_vue_type_script_setup_true_lang-CVZfHKVN.js → TheInput.vue_vue_type_script_setup_true_lang-eomBm7cI.js} +1 -1
- package/dist/assets/{Tooltip.vue_vue_type_script_setup_true_lang-51X8aMF6.js → Tooltip.vue_vue_type_script_setup_true_lang-B8oj5jxD.js} +1 -1
- package/dist/assets/_...all_-BcdnV0AV.js +6 -0
- package/dist/assets/_...all_-DAWA-z10.js +1 -0
- package/dist/assets/{_name_-P2IH5H8T.js → _name_-BVpG1Zli.js} +1 -1
- package/dist/assets/{about-DrtUZup4.js → about-D_TkNdy_.js} +1 -1
- package/dist/assets/board-C-k6XFrG.js +1 -0
- package/dist/assets/{board-layout-BOYna77X.js → board-layout-C40Fw6xh.js} +1 -1
- package/dist/assets/{constant-Dh1ZtsNO.js → constant-BhgmbFq0.js} +1 -1
- package/dist/assets/contest-BvNwg3Kw.js +39 -0
- package/dist/assets/dayjs-Gf_GNPDe.js +1 -0
- package/dist/assets/{default-PAZ0Oa-G.js → default-o6xn9mNa.js} +1 -1
- package/dist/assets/{headless-C4BPq_WX.js → headless-B6eNVzTA.js} +1 -1
- package/dist/assets/{home-BpF3q5rc.js → home-PHDhW-P_.js} +1 -1
- package/dist/assets/index-6AMd99bp.js +1 -0
- package/dist/assets/{index-BYKufEfk.js → index-BJ4GH733.js} +1 -1
- package/dist/assets/index-BNhOKJ4o.js +1 -0
- package/dist/assets/{index-CREIPGSZ.css → index-Bce8wPYb.css} +1 -1
- package/dist/assets/index-CEGUcXke.js +1 -0
- package/dist/assets/{index-DKi5jS9p.js → index-CptCs1lA.js} +4 -4
- package/dist/assets/{index-BtZZuxRc.js → index-DehXnBju.js} +3 -3
- package/dist/assets/{index-layout-Sw7OZ5f7.js → index-layout-5CMnOQFQ.js} +1 -1
- package/dist/assets/{pagination-PAprVtYE.js → pagination-BnTU9Znz.js} +1 -1
- package/dist/assets/person-C4W5ZTIf.js +1 -0
- package/dist/assets/{query-pkEyawI-.js → query-Bu2cZcfI.js} +1 -1
- package/dist/assets/rank-FQQWnSoF.js +1 -0
- package/dist/assets/{test-BwiuHZeA.js → test-ZakcI5XS.js} +1 -1
- package/dist/assets/{use-vmodel-Dqa3e3VF.js → use-vmodel-D3rpy0C7.js} +1 -1
- package/dist/assets/{user-CzgkhnoZ.js → user-4a0kuxzg.js} +1 -1
- package/dist/assets/{virtual_pwa-register-CVx5QtUX.js → virtual_pwa-register-D4goqIHu.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/sw.js +1 -1
- package/package.json +3 -3
- package/src/components/ContestIndexUI.vue +6 -3
- package/src/components/ResolverTeamRow.vue +5 -1
- package/src/components/board/Board.vue +8 -6
- package/src/components/board/Export.vue +1 -1
- package/src/components/board/OptionsModal.vue +4 -2
- package/src/components/board/ProblemInfoModal.vue +9 -1
- package/src/components/board/SecondLevelMenu.vue +6 -13
- package/src/components/board/Standings.vue +4 -2
- package/src/components/board/SubmissionsTable.vue +7 -3
- package/src/components/board/SubmissionsTableModal.vue +6 -1
- package/src/components/board/TeamInfoModal.vue +9 -5
- package/src/components/board/TeamUI.vue +6 -1
- package/src/components/rating/Rating.vue +5 -2
- package/src/components/rating/RatingInfoModal.vue +7 -3
- package/src/components/rating/RatingTable.vue +1 -39
- package/src/components/rating/RatingUserUI.vue +5 -2
- package/src/pages/index.vue +6 -3
- package/dist/assets/_...all_-CZT5dXNi.js +0 -6
- package/dist/assets/_...all_-j0y2p9D9.js +0 -1
- package/dist/assets/board-CmMG_hVW.js +0 -1
- package/dist/assets/contest-Dqsw2u_w.js +0 -39
- package/dist/assets/dayjs-R18HHVUp.js +0 -1
- package/dist/assets/index-53cbY7nJ.js +0 -1
- package/dist/assets/index-DwpTMrg8.js +0 -1
- package/dist/assets/index-ZCq50Wiz.js +0 -1
- package/dist/assets/rank-C5KVO0Rq.js +0 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import type { Lang } from "@xcpcio/types";
|
|
2
3
|
import { useFetch } from "@vueuse/core";
|
|
3
4
|
import { Rating } from "@xcpcio/core";
|
|
4
5
|
|
|
@@ -14,7 +15,9 @@ function genURL() {
|
|
|
14
15
|
const url = ref(genURL());
|
|
15
16
|
const rating = ref({} as Rating);
|
|
16
17
|
|
|
17
|
-
const { t } = useI18n();
|
|
18
|
+
const { t, locale } = useI18n();
|
|
19
|
+
const lang = computed(() => locale.value as unknown as Lang);
|
|
20
|
+
|
|
18
21
|
useTitle(RATING_TITLE_SUFFIX);
|
|
19
22
|
|
|
20
23
|
const {
|
|
@@ -65,7 +68,7 @@ const {
|
|
|
65
68
|
text-4xl
|
|
66
69
|
font-medium font-serif
|
|
67
70
|
>
|
|
68
|
-
{{ rating.name }}
|
|
71
|
+
{{ rating.name.getOrDefault(lang) }}
|
|
69
72
|
</div>
|
|
70
73
|
|
|
71
74
|
<div
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { RatingUser } from "@xcpcio/core";
|
|
3
|
+
import type { Lang } from "@xcpcio/types";
|
|
3
4
|
|
|
4
5
|
import { Chart } from "highcharts-vue";
|
|
5
6
|
|
|
@@ -22,6 +23,9 @@ const isHidden = computed({
|
|
|
22
23
|
},
|
|
23
24
|
});
|
|
24
25
|
|
|
26
|
+
const { locale } = useI18n();
|
|
27
|
+
const lang = computed(() => locale.value as unknown as Lang);
|
|
28
|
+
|
|
25
29
|
const ratingUser = computed(() => props.ratingUser);
|
|
26
30
|
|
|
27
31
|
const headerTitle = computed(() => {
|
|
@@ -31,14 +35,14 @@ const headerTitle = computed(() => {
|
|
|
31
35
|
res += `${ratingUser.value.organization} - `;
|
|
32
36
|
}
|
|
33
37
|
|
|
34
|
-
res += `${ratingUser.value.name}`;
|
|
38
|
+
res += `${ratingUser.value.name.getOrDefault(lang.value)}`;
|
|
35
39
|
|
|
36
40
|
if (ratingUser.value.members.length > 0) {
|
|
37
|
-
res += ` - ${ratingUser.value.members.map(m => m.name).join(",")}`;
|
|
41
|
+
res += ` - ${ratingUser.value.members.map(m => m.name.getOrDefault(lang.value)).join(", ")}`;
|
|
38
42
|
}
|
|
39
43
|
|
|
40
44
|
if (ratingUser.value.coaches.length > 0) {
|
|
41
|
-
res += ` - ${ratingUser.value.coaches.map(c => c.name).join(",")}(coach)`;
|
|
45
|
+
res += ` - ${ratingUser.value.coaches.map(c => c.name.getOrDefault(lang.value)).join(", ")}(coach)`;
|
|
42
46
|
}
|
|
43
47
|
|
|
44
48
|
return res;
|
|
@@ -5,7 +5,6 @@ import { Pagination } from "@board/composables/pagination";
|
|
|
5
5
|
|
|
6
6
|
interface FilterOptions {
|
|
7
7
|
organizations: string[];
|
|
8
|
-
members: string[];
|
|
9
8
|
}
|
|
10
9
|
|
|
11
10
|
const props = defineProps<{
|
|
@@ -18,7 +17,6 @@ const rating = computed(() => props.rating);
|
|
|
18
17
|
|
|
19
18
|
const filterOptions = ref<FilterOptions>({
|
|
20
19
|
organizations: [],
|
|
21
|
-
members: [],
|
|
22
20
|
});
|
|
23
21
|
|
|
24
22
|
const orgOptions = computed(() => {
|
|
@@ -42,38 +40,12 @@ function orgOnSelect(selectedItems: Array<SelectOptionItem>, lastSelectItem: Sel
|
|
|
42
40
|
orgLastSelectItem.value = lastSelectItem;
|
|
43
41
|
}
|
|
44
42
|
|
|
45
|
-
// const memberOptions = computed(() => {
|
|
46
|
-
// const se = new Set();
|
|
47
|
-
// rating.value.users.forEach((u) => {
|
|
48
|
-
// return u.members.forEach((m) => {
|
|
49
|
-
// se.add(m.name);
|
|
50
|
-
// });
|
|
51
|
-
// });
|
|
52
|
-
// const res = Array.from(se);
|
|
53
|
-
|
|
54
|
-
// return res.map((o) => {
|
|
55
|
-
// return {
|
|
56
|
-
// value: o,
|
|
57
|
-
// text: o,
|
|
58
|
-
// };
|
|
59
|
-
// });
|
|
60
|
-
// });
|
|
61
|
-
|
|
62
|
-
// const memberSelectedItems = ref<Array<SelectOptionItem>>([]);
|
|
63
|
-
// const memberLastSelectItem = ref({});
|
|
64
|
-
|
|
65
|
-
// function memberOnSelect(selectedItems: Array<SelectOptionItem>, lastSelectItem: SelectOptionItem) {
|
|
66
|
-
// memberSelectedItems.value = selectedItems;
|
|
67
|
-
// memberLastSelectItem.value = lastSelectItem;
|
|
68
|
-
// }
|
|
69
|
-
|
|
70
43
|
const users = computed(() => {
|
|
71
44
|
const us = rating.value.users;
|
|
72
45
|
return us.filter((u) => {
|
|
73
46
|
const o = filterOptions.value;
|
|
74
47
|
|
|
75
|
-
if (o.organizations.length === 0
|
|
76
|
-
&& o.members.length === 0) {
|
|
48
|
+
if (o.organizations.length === 0) {
|
|
77
49
|
return true;
|
|
78
50
|
}
|
|
79
51
|
|
|
@@ -83,14 +55,6 @@ const users = computed(() => {
|
|
|
83
55
|
}
|
|
84
56
|
}
|
|
85
57
|
|
|
86
|
-
for (const member of o.members) {
|
|
87
|
-
for (const m of u.members) {
|
|
88
|
-
if (member === m.name) {
|
|
89
|
-
return true;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
58
|
return false;
|
|
95
59
|
});
|
|
96
60
|
});
|
|
@@ -98,11 +62,9 @@ const users = computed(() => {
|
|
|
98
62
|
function onFilter() {
|
|
99
63
|
const newFilterOptions: FilterOptions = {
|
|
100
64
|
organizations: [],
|
|
101
|
-
members: [],
|
|
102
65
|
};
|
|
103
66
|
|
|
104
67
|
newFilterOptions.organizations = orgSelectedItems.value.map(o => o.value);
|
|
105
|
-
// newFilterOptions.members = memberSelectedItems.value.map(o => o.value);
|
|
106
68
|
|
|
107
69
|
filterOptions.value = newFilterOptions;
|
|
108
70
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { RatingUser } from "@xcpcio/core";
|
|
3
|
+
import type { Lang } from "@xcpcio/types";
|
|
3
4
|
import { RatingUtility } from "@xcpcio/core";
|
|
4
5
|
|
|
5
6
|
import "./rating.less";
|
|
@@ -10,6 +11,8 @@ const props = defineProps<{
|
|
|
10
11
|
}>();
|
|
11
12
|
|
|
12
13
|
const u = computed(() => props.ratingUser);
|
|
14
|
+
const { locale } = useI18n();
|
|
15
|
+
const lang = computed(() => locale.value as unknown as Lang);
|
|
13
16
|
|
|
14
17
|
const hiddenRatingInfoModal = ref(true);
|
|
15
18
|
function onClickRatingInfoModal() {
|
|
@@ -33,7 +36,7 @@ function onClickRatingInfoModal() {
|
|
|
33
36
|
:class="RatingUtility.getRatingLevelClass(u.rating)"
|
|
34
37
|
@click="onClickRatingInfoModal"
|
|
35
38
|
>
|
|
36
|
-
{{ u.name }}
|
|
39
|
+
{{ u.name.getOrDefault(lang) }}
|
|
37
40
|
</div>
|
|
38
41
|
|
|
39
42
|
<div>
|
|
@@ -47,7 +50,7 @@ function onClickRatingInfoModal() {
|
|
|
47
50
|
<td
|
|
48
51
|
class="whitespace-nowrap px-4 py-2 text-gray-900 dark:text-white"
|
|
49
52
|
>
|
|
50
|
-
{{ u.members.map(m => m.name.trim()).join(" ") }}
|
|
53
|
+
{{ u.members.map(m => m.name.getOrDefault(lang).trim()).join(" ") }}
|
|
51
54
|
</td>
|
|
52
55
|
<td
|
|
53
56
|
class="whitespace-nowrap px-4 py-2 text-gray-900 dark:text-white"
|
package/src/pages/index.vue
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { ContestIndexList } from "@xcpcio/core";
|
|
3
|
+
import type { Lang } from "@xcpcio/types";
|
|
3
4
|
|
|
4
5
|
import ContestIndexUI from "@board/components/ContestIndexUI.vue";
|
|
5
6
|
import SearchInput from "@board/components/SearchInput.vue";
|
|
@@ -9,7 +10,9 @@ import { useFetch } from "@vueuse/core";
|
|
|
9
10
|
import { useRouteQuery } from "@vueuse/router";
|
|
10
11
|
import { createContestIndexList } from "@xcpcio/core";
|
|
11
12
|
|
|
12
|
-
const { t } = useI18n();
|
|
13
|
+
const { t, locale } = useI18n();
|
|
14
|
+
const lang = computed(() => locale.value as unknown as Lang);
|
|
15
|
+
|
|
13
16
|
useTitle(TITLE_SUFFIX);
|
|
14
17
|
|
|
15
18
|
const FETCH_INTERVAL = 1000 * 60 * 5;
|
|
@@ -41,8 +44,8 @@ function onSearch() {
|
|
|
41
44
|
|
|
42
45
|
s.value = searchText.value;
|
|
43
46
|
|
|
44
|
-
if (c.contest.name.includes(searchText.value)
|
|
45
|
-
|| c.contest.name.toLowerCase().includes(searchText.value.toLowerCase())
|
|
47
|
+
if (c.contest.name.getOrDefault(lang.value).includes(searchText.value)
|
|
48
|
+
|| c.contest.name.getOrDefault(lang.value).toLowerCase().includes(searchText.value.toLowerCase())
|
|
46
49
|
|| c.boardLink.toLocaleLowerCase().includes(searchText.value.toLowerCase())) {
|
|
47
50
|
return true;
|
|
48
51
|
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{a as U,h as H,P as Y,_ as W,b as V}from"./pagination-PAprVtYE.js";import{_ as P}from"./Tooltip.vue_vue_type_script_setup_true_lang-51X8aMF6.js";import{d as y,f as p,c as f,o as h,a as _,w,b as r,n as O,h as o,k as x,G as $,z,m as v,q as S,C as X,j as q,F as K,E as Q,u as Z,A as J,B as tt,g as et}from"./index-DKi5jS9p.js";import{R as st,d as F}from"./constant-Dh1ZtsNO.js";import{c as G}from"./dayjs-R18HHVUp.js";class R{constructor(t=""){this.name=t}toJSON(){return{name:this.name}}static fromJSON(t){typeof t=="string"&&(t=JSON.parse(t));const s=new R;return s.name=t.name,s}}function k(c){if(typeof c=="string"){for(const t of" ,、|")if(c.includes(t))return c.split(t).map(s=>new R(s));return[new R(c)]}return c.map(t=>new R(t))}class L{constructor(){this.rank=0,this.rating=0,this.teamName="",this.organization="",this.members=[],this.coaches=[],this.contestID="",this.contestName="",this.contestLink="",this.contestTime=G()}toJSON(){return{rank:this.rank,rating:this.rating,teamName:this.teamName,organization:this.organization,members:this.members.map(t=>t.toJSON()),coaches:this.coaches.map(t=>t.toJSON()),contestID:this.contestID,contestName:this.contestName,contestLink:this.contestLink,contestTime:this.contestTime.toDate()}}static fromJSON(t){typeof t=="string"&&(t=JSON.parse(t));const s=new L;return s.rank=t.rank,s.rating=t.rating,s.teamName=t.teamName,s.organization=t.organization,s.members=t.members.map(a=>R.fromJSON(a)),s.coaches=t.coaches.map(a=>R.fromJSON(a)),s.contestID=t.contestID,s.contestName=t.contestName,s.contestLink=t.contestLink,s.contestTime=G(t.contestTime),s}}class A{constructor(){this.id="",this.name="",this.organization="",this.members=[],this.coaches=[],this.rating=0,this.minRating=1061109567,this.maxRating=-1061109567,this.rank=0,this.oldRating=0,this.seed=1,this.delta=0,this.ratingHistories=[]}UpdateRating(t){this.rating=t,this.minRating=Math.min(this.minRating,t),this.maxRating=Math.max(this.maxRating,t)}toJSON(){return{id:this.id,name:this.name,organization:this.organization,members:this.members.map(t=>t.toJSON()),coaches:this.coaches.map(t=>t.toJSON()),rating:this.rating,minRating:this.minRating,maxRating:this.maxRating,ratingHistories:this.ratingHistories.map(t=>t.toJSON())}}static fromJSON(t){typeof t=="string"&&(t=JSON.parse(t));const s=new A;s.id=t.id,s.name=t.name,s.organization=t.organization,s.members=t.members.map(a=>R.fromJSON(a)),s.coaches=t.coaches.map(a=>R.fromJSON(a)),s.rating=t.rating,s.minRating=t.minRating,s.maxRating=t.maxRating;for(const a of t.ratingHistories)s.ratingHistories.push(L.fromJSON(a));return s}}class nt{constructor(){this.users=[]}calculate(){this.calculateInternal()}calcP(t,s){return 1/(1+10**((s.oldRating-t.oldRating)/400))}getExSeed(t,s,a){const l=new A;l.oldRating=s;let e=0;return t.forEach(n=>{n.id!==a.id&&(e+=this.calcP(n,l))}),e}calcRating(t,s,a){let l=1,e=8e3;for(;e-l>1;){const n=Math.floor((l+e)/2);this.getExSeed(t,n,a)<s?e=n:l=n}return l}calculateInternal(){for(let e=0;e<this.users.length;e++){const n=this.users[e];n.seed=1;for(let i=0;i<this.users.length;i++)if(e!==i){const u=this.users[i];n.seed+=this.calcP(u,n)}}let t=0;for(let e=0;e<this.users.length;e++){const n=this.users[e];n.delta=Math.floor((this.calcRating(this.users,Math.sqrt(n.rank*n.seed),n)-n.oldRating)/2),t+=n.delta}let s=Math.floor(-t/this.users.length)-1;for(let e=0;e<this.users.length;e++){const n=this.users[e];n.delta+=s}this.users=this.users.sort((e,n)=>n.oldRating-e.oldRating);const a=Math.min(this.users.length,Math.floor(4*Math.round(Math.sqrt(this.users.length))));let l=0;for(let e=0;e<a;e++)l+=this.users[e].delta;s=Math.min(Math.max(Math.floor(-l/a),-10),0),this.users.forEach(e=>{e.delta+=s,e.UpdateRating(e.oldRating+e.delta)}),this.users=this.users.sort((e,n)=>e.rank-n.rank)}}class C{constructor(){this.id="",this.name="",this.baseRating=1500,this.contestIDs=[],this.users=[],this.ranks=[],this.userMap=new Map}buildRating(){for(const t of this.ranks){t.buildRank();const s=new nt;for(const a of t.teams){const l=this.generateTeamId(a);let e=null;this.userMap.has(l)?(e=this.userMap.get(l),e.rank=a.rank,e.oldRating=e.rating,s.users.push(e)):(e=new A,e.id=l,e.name=a.name,e.organization=a.organization,e.members=k(a.members??[]),e.coaches=k(a.coach??[]),e.rank=a.rank,e.oldRating=this.baseRating,e.UpdateRating(this.baseRating),this.userMap.set(l,e),this.users.push(e),s.users.push(e));{const n=new L;n.rank=a.rank,n.rating=e.rating,n.teamName=a.name,n.organization=a.organization,n.members=k(a.members??[]),n.coaches=k(a.coach??[]),n.contestID=t.contest.id,n.contestLink=n.contestID,n.contestName=t.contest.name,n.contestTime=t.contest.startTime,e.ratingHistories.push(n)}}s.calculate();for(const a of s.users)a.ratingHistories.at(-1).rating=a.rating}}generateTeamId(t){const s=k(t.members??[]);return s.length>0?s.map(a=>a.name.trim()).sort().join("|"):`${t.organization}-${t.name}`}toJSON(){return{id:this.id,name:this.name,baseRating:this.baseRating,contestIDs:this.contestIDs,users:this.users.map(t=>t.toJSON())}}static fromJSON(t){typeof t=="string"&&(t=JSON.parse(t));const s=new C;s.id=t.id,s.name=t.name,s.baseRating=t.baseRating,s.contestIDs=t.contestIDs;for(const a of t.users)s.users.push(A.fromJSON(a));return s}}const B={NEWBIE:"Newbie",PUPIL:"Pupil",SPECIALIST:"Specialist",EXPERT:"Expert",CANDIDATE_MASTER:"Candidate Master",MASTER:"Master",INTERNATIONAL_MASTER:"International Master",GRANDMASTER:"Grandmaster",INTERNATIONAL_GRANDMASTER:"International Grandmaster",LEGENDARY_GRANDMASTER:"Legendary Grandmaster"};class M{static getRatingLevel(t){return t>=3e3?"LEGENDARY_GRANDMASTER":t>=2600?"INTERNATIONAL_GRANDMASTER":t>=2400?"GRANDMASTER":t>=2300?"INTERNATIONAL_MASTER":t>=2100?"MASTER":t>=1900?"CANDIDATE_MASTER":t>=1600?"EXPERT":t>=1400?"SPECIALIST":t>=1200?"PUPIL":"NEWBIE"}static getRatingLevelClass(t){if(typeof t=="number")return this.getRatingLevelClass(this.getRatingLevel(t));switch(t){case"NEWBIE":return"user-gray";case"PUPIL":return"user-green";case"SPECIALIST":return"user-cyan";case"EXPERT":return"user-blue";case"CANDIDATE_MASTER":return"user-violet";case"MASTER":return"user-orange";case"INTERNATIONAL_MASTER":return"user-orange";case"GRANDMASTER":return"user-red";case"INTERNATIONAL_GRANDMASTER":return"user-red";case"LEGENDARY_GRANDMASTER":return"user-legendary"}}}const at={"text-md":""},rt=y({__name:"RatingBadge",props:{rating:null},setup(c){const t=c,s=p(()=>t.rating);return(a,l)=>{const e=P;return h(),f("div",null,[_(e,null,{popper:w(()=>[r("div",at,x(o(B)[o(M).getRatingLevel(o(s))]),1)]),default:w(()=>[r("div",{"font-mono":"","font-bold":"",class:O(o(M).getRatingLevelClass(o(s)))},x(o(s)),3)]),_:1})])}}});function ot(c,t){const s=t-c;return t>c?`+${s.toString()}`:s.toString()}function it(c){const t=[];{let l=0;for(const e of c.ratingHistories){const n={};n.x=e.contestTime.unix()*1e3,n.y=e.rating,n.diffRating=ot(l,e.rating),n.rank=e.rank,n.contestName=e.contestName,n.link=`/board/${e.contestID}`,n.contestTime=e.contestTime.format("YYYY-MM-DD HH:mm:ss"),n.teamName=e.teamName,n.ratingTitle=B[M.getRatingLevel(e.rating)],t.push(n),l=e.rating}}let s=[1200,1400,1600,1900,2100,2300,2400,2600,3e3];{let e=Math.max(0,c.minRating-100),n=c.maxRating+100;for(let i=0;i<s.length;++i)if(s[i]>n){n=s[i];break}for(let i=s.length-1;i>=0;--i)if(s[i]<e){e=s[i];break}e<1200&&(s=[e,...s]),n>3e3&&s.push(n),s=s.filter(i=>i>=e&&i<=n)}return{chart:{type:"line",height:"408px"},title:{text:null},xAxis:{tickWidth:0,gridLineWidth:.4,minRange:720*60*60*1e3,type:"datetime",showFirstLabel:!0,showLastLabel:!0,dateTimeLabelFormats:{month:"%b %Y"}},yAxis:{showEmpty:!1,showFirstLabel:!1,showLastLabel:!1,tickPositions:s,tickWidth:0,gridLineWidth:.6,labels:{enabled:!0,format:"{value}"},title:{text:null},plotBands:[{from:0,to:1199,color:"#CCCCCC"},{from:1200,to:1399,color:"#98FA87"},{from:1400,to:1599,color:"#90DABD"},{from:1600,to:1899,color:"#A9ACF9"},{from:1900,to:2099,color:"#EF91F9"},{from:2100,to:2299,color:"#F7CD91"},{from:2300,to:2399,color:"#F5BD67"},{from:2400,to:2599,color:"#Ef7F7B"},{from:2600,to:2999,color:"#EB483F"},{from:3e3,to:1061109567,color:"#9C1E14"}]},credits:{enabled:!1},plotOptions:{line:{color:"#ffec3d",dataLabels:{enabled:!1},enableMouseTracking:!0,marker:{enabled:!0,fillColor:"#fffb8f"}}},tooltip:{enabled:!0,headerFormat:"",useHTML:!0,shared:!0,shadow:!0,followPointer:!1,followTouchMove:!1,pointFormat:`= {point.y} ({point.diffRating}), {point.ratingTitle}
|
|
2
|
-
<br/>Rank: {point.rank}
|
|
3
|
-
<br/>TeamName: {point.teamName}
|
|
4
|
-
<br/>ContestTime: {point.contestTime}
|
|
5
|
-
<br/><a href="{point.link}">{point.contestName}</a>
|
|
6
|
-
<br/>`},series:[{showInLegend:!1,allowPointSelect:!0,data:t}]}}const lt={"w-full":"","max-w-screen-xl":"","mx-auto":"","px-4":"","lg:px-8":""},ct={relative:"","overflow-hidden":"","bg-white":"","dark:bg-gray-800":""},ut={flex:"","flex-col":"","items-center":"","justify-between":"","md:flex-row":"","space-y-3":"","md:space-y-0":""},mt={flex:"","flex-row":"","space-x-3":""},dt={"text-gray-900":"","dark:text-white":"","text-2xl":"","font-sans":"","font-semibold":"",italic:""},ht={flex:"","flex-col":"","justify-start":"","items-start":""},gt={"w-full":"","font-bold":"","font-mono":"",flex:"","items-center":"","justify-center":""},ft={"w-full":""},pt=y({__name:"RatingInfoModal",props:{isHidden:{type:Boolean},ratingUser:null},emits:["update:isHidden"],setup(c,{emit:t}){const s=c,a=t,l=p({get(){return s.isHidden},set(i){a("update:isHidden",i)}}),e=p(()=>s.ratingUser),n=p(()=>{let i="";return e.value.organization.length>0&&(i+=`${e.value.organization} - `),i+=`${e.value.name}`,e.value.members.length>0&&(i+=` - ${e.value.members.map(u=>u.name).join(",")}`),e.value.coaches.length>0&&(i+=` - ${e.value.coaches.map(u=>u.name).join(",")}(coach)`),i});return(i,u)=>{const b=P,m=U;return h(),$(m,{"is-hidden":o(l),"onUpdate:isHidden":u[0]||(u[0]=E=>z(l)?l.value=E:null),width:"w-278"},{header:w(()=>[r("div",lt,[r("div",ct,[r("div",ut,[r("div",mt,[_(b,null,{popper:w(()=>[r("div",ht,[r("div",null," TeamID: "+x(o(e).id),1)])]),default:w(()=>[r("h3",dt,x(o(n)),1)]),_:1})])])])])]),default:w(()=>[r("div",gt,[r("div",ft,[_(o(H.Chart),{options:("getRatingGraphOptions"in i?i.getRatingGraphOptions:o(it))(o(e))},null,8,["options"])])])]),_:1},8,["is-hidden"])}}}),_t={class:"border-b dark:border-gray-600 hover:bg-gray-100 dark:hover:bg-gray-700"},xt={class:"whitespace-nowrap px-4 py-2 text-gray-900 dark:text-white"},bt={class:"whitespace-nowrap px-4 py-2 text-gray-900 dark:text-white"},Rt={class:"whitespace-nowrap px-4 py-2 text-gray-900 dark:text-white"},vt={class:"whitespace-nowrap px-4 py-2 text-gray-900 dark:text-white"},Nt={class:"whitespace-nowrap px-4 py-2 text-gray-900 dark:text-white"},wt=y({__name:"RatingUserUI",props:{ix:null,ratingUser:null},setup(c){const t=c,s=p(()=>t.ratingUser),a=v(!0);function l(){a.value=!1}return(e,n)=>{const i=pt,u=rt;return h(),f("tr",_t,[r("td",xt,x(o(s).organization),1),r("td",null,[r("div",{class:O(["whitespace-nowrap px-4 py-2 text-gray-900 dark:text-white",o(M).getRatingLevelClass(o(s).rating)]),"cursor-pointer":"",onClick:l},x(o(s).name),3),r("div",null,[o(a)?S("",!0):(h(),$(i,{key:0,"is-hidden":o(a),"onUpdate:isHidden":n[0]||(n[0]=b=>z(a)?a.value=b:null),"rating-user":o(s)},null,8,["is-hidden","rating-user"]))])]),r("td",bt,x(o(s).members.map(b=>b.name.trim()).join(" ")),1),r("td",Rt,[_(u,{rating:o(s).rating},null,8,["rating"])]),r("td",vt,[_(u,{rating:o(s).maxRating},null,8,["rating"])]),r("td",Nt,[_(u,{rating:o(s).minRating},null,8,["rating"])])])}}}),yt={"mx-auto":"","w-full":""},Tt={"space-y-3":"",flex:"","flex-col":"","px-4":"","py-3":"","lg:flex-row":"","lg:items-center":"","lg:justify-between":"","lg:space-x-4":"","lg:space-y-0":""},kt={flex:"","flex-shrink-0":"","flex-col":"","md:flex-row":"","md:items-center":"","lg:justify-end":"","space-y-3":"","md:space-x-3":"","md:space-y-0":""},St={"w-108":""},At={class:"overflow-x-auto"},Et={class:"w-full text-left text-sm text-gray-500 dark:text-gray-400","font-medium":"","font-mono":""},It=y({__name:"RatingTable",props:{rating:null,pageSize:null,removeBorder:{type:Boolean}},setup(c){const t=c,s=p(()=>t.rating),a=v({organizations:[],members:[]}),l=p(()=>{let g=s.value.users.map(d=>d.organization);return g=Array.from(new Set(g)),g.map(d=>({value:d,text:d}))}),e=v([]),n=v({});function i(g,d){e.value=g,n.value=d}const u=p(()=>s.value.users.filter(d=>{const N=a.value;if(N.organizations.length===0&&N.members.length===0)return!0;for(const T of N.organizations)if(T===d.organization)return!0;for(const T of N.members)for(const D of d.members)if(T===D.name)return!0;return!1}));function b(){const g={organizations:[],members:[]};g.organizations=e.value.map(d=>d.value),a.value=g}const m=v(new Y);m.value.currentPage=0,m.value.pageSize=t.pageSize??20,m.value.totalSize=u.value.length,X(u,()=>{m.value.totalSize=u.value.length,m.value.currentPage>=m.value.totalPage&&(m.value.currentPage=m.value.totalPage-1)});const E=p(()=>u.value.slice(m.value.currentLeft,m.value.currentRight));return(g,d)=>{const N=W,T=wt,D=V;return h(),f("section",null,[r("div",yt,[r("div",{relative:"","overflow-hidden":"","bg-white":"","dark:bg-gray-800":"",class:O({"shadow-md":t.removeBorder!==!0,"sm:rounded-sm":t.removeBorder!==!0})},[r("div",Tt,[r("div",kt,[r("div",St,[_(N,{options:o(l),"selected-options":o(e),placeholder:"Organization",onSelect:i},null,8,["options","selected-options"])]),r("div",null,[r("button",{type:"button",class:"flex flex-shrink-0 items-center justify-center border border-gray-200 rounded-lg bg-white px-3 py-2 text-sm font-medium text-gray-900 focus:z-10 dark:border-gray-600 dark:bg-gray-800 hover:bg-gray-100 dark:text-gray-400 hover:text-primary-700 focus:outline-none focus:ring-4 focus:ring-gray-200 dark:hover:bg-gray-700 dark:hover:text-white dark:focus:ring-gray-700",onClick:b},[...d[1]||(d[1]=[r("div",{"i-material-symbols-search":"","mr-1":"","h-5":"","w-5":""},null,-1),q(" Filter ",-1)])])])])]),r("div",At,[r("table",Et,[d[2]||(d[2]=r("thead",{"text-xs":"","bg-gray-50":"","text-gray-700":"","dark:bg-gray-700":"","dark:text-gray-400":""},[r("tr",null,[r("th",{scope:"col",class:"px-4 py-3","w-68":""}," Organization "),r("th",{scope:"col",class:"px-4 py-3","w-128":""}," TeamName "),r("th",{scope:"col",class:"px-4 py-3","w-68":""}," Members "),r("th",{scope:"col",class:"px-4 py-3"}," Rating "),r("th",{scope:"col",class:"px-4 py-3"}," MaxRating "),r("th",{scope:"col",class:"px-4 py-3"}," MinRating ")])],-1)),r("tbody",null,[(h(!0),f(K,null,Q(o(E),(I,j)=>(h(),$(T,{key:I.id,ix:j,"rating-user":I},null,8,["ix","rating-user"]))),128))])])]),_(D,{pagination:o(m),"onUpdate:pagination":d[0]||(d[0]=I=>z(m)?m.value=I:null)},null,8,["pagination"])],2)])])}}}),Mt={class:"sm:w-[1024px] lg:w-screen","lg:of-x-hidden":"",flex:"","flex-col":"","justify-center":"","items-center":""},Lt={key:0,"mt-4":"","mb-4":"",class:"sm:w-[1000px] lg:w-screen",flex:"","justify-center":"","items-center":""},Dt={key:0},Ot={key:1},$t={key:1,flex:"","flex-col":"","justify-center":"","items-center":""},zt={"text-4xl":"","font-medium":"","font-serif":""},Ct={"mt-4":""},Jt=y({__name:"Rating",props:{id:null},setup(c){const t=c,s=p(()=>t.id);function a(){return`${st.value}${s.value}/rating.json`}const l=v(a()),e=v({}),{t:n}=Z();J(F);const{error:i,isFetching:u,isFinished:b}=tt(l,{refetch:!0,afterFetch:m=>(e.value=C.fromJSON(m.data),J(`${e.value.name} | ${F}`),m)}).get();return(m,E)=>{const g=It;return h(),f("div",Mt,[r("div",null,[o(u)||o(i)?(h(),f("div",Lt,[o(u)?(h(),f("div",Dt,x(o(n)("common.loading"))+"... ",1)):S("",!0),o(i)?(h(),f("div",Ot,x(o(i)),1)):S("",!0)])):S("",!0),o(b)?(h(),f("div",$t,[r("div",zt,x(o(e).name),1),r("div",Ct,[_(g,{rating:o(e),"remove-border":!0},null,8,["rating"])])])):S("",!0)])])}}}),Ut=y({__name:"[...all]",setup(c){const s=et().path.split("/").pop();return(a,l)=>{const e=Jt;return h(),f("div",null,[_(e,{id:o(s)},null,8,["id"])])}}});export{Ut as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as k,H as R,u as b,r as h,c,o as t,b as m,a as i,k as _,h as o,w as $,j as v,g as N,G as a,q as S}from"./index-DKi5jS9p.js";import{_ as T}from"./Countdown-DTJUHvaQ.js";import{_ as V}from"./Balloon.vue_vue_type_script_setup_true_lang-C72zkpsg.js";import{_ as G}from"./Resolver-D3Uo7ft5.js";import{_ as A}from"./Board-Bg3Ppuz0.js";import{u as D}from"./contest-Dqsw2u_w.js";import{b as f}from"./route-block-B_A1xBdJ.js";import"./constant-Dh1ZtsNO.js";import"./query-pkEyawI-.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./rank-C5KVO0Rq.js";import"./pagination-PAprVtYE.js";import"./Tooltip.vue_vue_type_script_setup_true_lang-51X8aMF6.js";import"./TheInput.vue_vue_type_script_setup_true_lang-CVZfHKVN.js";import"./use-vmodel-Dqa3e3VF.js";import"./dayjs-R18HHVUp.js";import"./ContestStateBadge-DdwsGPTU.js";const E=k({__name:"GoBack",setup(y){const u=R(),{t:s}=b();return(x,r)=>{const e=h("RouterLink");return t(),c("div",null,[m("div",{class:"m-3 text-sm btn",onClick:r[0]||(r[0]=n=>o(u).back())},_(o(s)("button.back")),1),i(e,{class:"m-3 text-sm btn",to:"/"},{default:$(()=>[v(_(o(s)("button.home")),1)]),_:1})])}}}),L={key:0},j={key:1,class:"flex flex-col items-center"},q={key:2},F=k({__name:"[...all]",setup(y){const{t:u}=b(),s=N(),r=!["camp","icpc","ccpc","provincial-contest"].some(l=>s.fullPath.startsWith(`/${l}`)),e=D("component","board",{transform:String}),n=window.DATA_SOURCE;return(l,p)=>{const d=A,B=G,g=V,w=T,C=E;return o(n)?(t(),c("div",L,[o(e)==="board"?(t(),a(d,{key:0,"data-source-url":o(n)},null,8,["data-source-url"])):o(e)==="resolver"?(t(),a(B,{key:1,"data-source-url":o(n)},null,8,["data-source-url"])):o(e)==="balloon"?(t(),a(g,{key:2,"data-source-url":o(n)},null,8,["data-source-url"])):o(e)==="countdown"?(t(),a(w,{key:3,"data-source-url":o(n)},null,8,["data-source-url"])):S("",!0)])):r?(t(),c("div",j,[p[0]||(p[0]=m("div",{"text-4xl":""},[m("div",{"i-carbon-warning":""})],-1)),v(" "+_(o(u)("not-found"))+" ",1),i(C)])):(t(),c("div",q,[i(d)]))}}});typeof f=="function"&&f(F);export{F as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as i}from"./Board-Bg3Ppuz0.js";import{_ as u}from"./DataSourceInput.vue_vue_type_script_setup_true_lang-CPMBGjH4.js";import{g as f}from"./query-pkEyawI-.js";import{d,c as e,o as t,a as n,q as l,h as a,F as B,G as g}from"./index-DKi5jS9p.js";import{b as c}from"./route-block-B_A1xBdJ.js";import{_ as h}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./pagination-PAprVtYE.js";import"./Tooltip.vue_vue_type_script_setup_true_lang-51X8aMF6.js";import"./TheInput.vue_vue_type_script_setup_true_lang-CVZfHKVN.js";import"./use-vmodel-Dqa3e3VF.js";import"./rank-C5KVO0Rq.js";import"./contest-Dqsw2u_w.js";import"./dayjs-R18HHVUp.js";import"./ContestStateBadge-DdwsGPTU.js";import"./constant-Dh1ZtsNO.js";const k={key:0},x=d({__name:"CustomBoard",setup(s){const o=f();return(r,b)=>{const _=u,p=i;return t(),e(B,null,[n(_),a(o).length>0?(t(),e("div",k,[n(p,{"data-source-url":a(o)},null,8,["data-source-url"])])):l("",!0)],64)}}}),m={};function C(s,o){const r=x;return t(),g(r)}typeof c=="function"&&c(m);const z=h(m,[["render",C]]);export{z as default};
|