@xcpcio/board-app 0.74.2 → 0.75.1
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-D1FgknH-.js +1 -0
- package/dist/assets/{Board-Czrq4DtS.js → Board-DjCZZlDZ.js} +12 -12
- package/dist/assets/{Board-BwblFaIo.css → Board-JvA5b1h4.css} +1 -1
- package/dist/assets/{ContestStateBadge-BiHZXi73.js → ContestStateBadge-BcWWr0vn.js} +1 -1
- package/dist/assets/Countdown-CLZfeAst.css +1 -0
- package/dist/assets/Countdown-D_UUNiMj.js +1 -0
- package/dist/assets/{DataSourceInput.vue_vue_type_script_setup_true_lang-D_o9JwYS.js → DataSourceInput.vue_vue_type_script_setup_true_lang-WXUmTUzJ.js} +1 -1
- package/dist/assets/{NavBar-DPNugPx9.js → NavBar-Bh02f6cT.js} +1 -1
- package/dist/assets/{Resolver-WB6joHhI.css → Resolver-DV9FleNP.css} +1 -1
- package/dist/assets/{Resolver-Di5gzWKf.js → Resolver-oax2vTMR.js} +4 -4
- package/dist/assets/{RightArrowIcon-CAcphpMB.js → RightArrowIcon-UwLTIJrW.js} +1 -1
- package/dist/assets/TheInput.vue_vue_type_script_setup_true_lang-C4V5Kgtf.js +1 -0
- package/dist/assets/{Tooltip.vue_vue_type_script_setup_true_lang-DqsW-ncZ.js → Tooltip.vue_vue_type_script_setup_true_lang-CqovKM2f.js} +1 -1
- package/dist/assets/{_...all_-CHhcrOv6.js → _...all_-BXkOsr0e.js} +1 -1
- package/dist/assets/{_...all_-BwXneS2r.js → _...all_-CgZvPdCs.js} +1 -1
- package/dist/assets/{board-layout-h2COplO6.js → board-layout-BJ9XOEk7.js} +1 -1
- package/dist/assets/constant-DBo_2lNG.js +1 -0
- package/dist/assets/{dayjs-Crt-XxG9.js → dayjs-DHI77Sx3.js} +1 -1
- package/dist/assets/default-DXQxfsL1.js +1 -0
- package/dist/assets/{headless-CKpo5hWl.js → headless-CT9JmEUq.js} +1 -1
- package/dist/assets/{index-DdX8qtp6.js → index-BPfG3xFX.js} +1 -1
- package/dist/assets/{index-DUsX43ur.js → index-C6xFsYYS.js} +1 -1
- package/dist/assets/index-CHIQkSeX.js +1 -0
- package/dist/assets/{index-Cl8ui4U3.js → index-C_1CeIsX.js} +3 -3
- package/dist/assets/{index-DoPOjLrQ.js → index-Cvxk8k_Q.js} +1 -1
- package/dist/assets/{index-BX7NLYCU.js → index-DfhIQ1rz.js} +1 -1
- package/dist/assets/index-DoiqlG5Q.js +1 -0
- package/dist/assets/{index-layout-pjrmzbp0.js → index-layout-DYzYhlvo.js} +1 -1
- package/dist/assets/{pagination-CeQCwn68.js → pagination-MGvyo3KY.js} +1 -1
- package/dist/assets/{person-DeEVCAi-.js → person-BwrHTBeO.js} +1 -1
- package/dist/assets/{rank-CmURXpVL.js → rank-XvBOaFgJ.js} +1 -1
- package/dist/assets/{use-vmodel-B-AJYPXB.js → use-vmodel-Byn458t1.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +3 -3
- package/src/components/Balloon.vue +1 -2
- package/src/components/Countdown.vue +1 -1
- package/src/components/Resolver.vue +1 -2
- package/src/components/board/Board.vue +1 -1
- package/src/composables/useQueryBoardData.ts +12 -25
- package/src/shims.d.ts +1 -0
- package/dist/assets/Balloon.vue_vue_type_script_setup_true_lang-BVfUciQ-.js +0 -1
- package/dist/assets/Countdown-BzEYBgj7.css +0 -1
- package/dist/assets/Countdown-Dpt0MI7P.js +0 -1
- package/dist/assets/TheInput.vue_vue_type_script_setup_true_lang-4EASslBu.js +0 -1
- package/dist/assets/constant-hbYXej-M.js +0 -1
- package/dist/assets/default-mCPNjTt4.js +0 -1
- package/dist/assets/index-CGO5s095.js +0 -1
- package/dist/assets/index-D_cZ1LCV.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{I as n}from"./dayjs-
|
|
1
|
+
import{I as n}from"./dayjs-DHI77Sx3.js";class e{constructor(r){this.name=r??new n}toIPerson(){return{name:this.name.toI18NStringSet(),cf_id:this.cfID,icpc_id:this.icpcID}}static fromIPerson(r){const c=new e;return c.name=n.fromIText(r.name),c.cfID=r.cf_id,c.icpcID=r.icpc_id,c}}function m(t){if(!t)return[];if(typeof t=="string"){for(const r of" ,、|")if(t.includes(r))return t.split(r).map(c=>new e(n.fromIText(c)));return[new e(n.fromIText(t))]}return Array.isArray(t)?t.length>0&&typeof t[0]=="object"&&"name"in t[0]?t.map(r=>e.fromIPerson(r)):t.map(r=>new e(n.fromIText(r))):[new e(n.fromIText(t))]}export{e as P,m as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{l as J,d as f,P as q,T as Q,M as T,A as R}from"./use-vmodel-B-AJYPXB.js";import{I as _}from"./dayjs-Crt-XxG9.js";import{c as D}from"./person-DeEVCAi-.js";var a=(e=>(e.PENDING="PENDING",e.WAITING="WAITING",e.PREPARING="PREPARING",e.COMPILING="COMPILING",e.RUNNING="RUNNING",e.JUDGING="JUDGING",e.FROZEN="FROZEN",e.ACCEPTED="ACCEPTED",e.CORRECT="CORRECT",e.PARTIALLY_CORRECT="PARTIALLY_CORRECT",e.REJECTED="REJECTED",e.WRONG_ANSWER="WRONG_ANSWER",e.NO_OUTPUT="NO_OUTPUT",e.COMPILATION_ERROR="COMPILATION_ERROR",e.PRESENTATION_ERROR="PRESENTATION_ERROR",e.RUNTIME_ERROR="RUNTIME_ERROR",e.TIME_LIMIT_EXCEEDED="TIME_LIMIT_EXCEEDED",e.MEMORY_LIMIT_EXCEEDED="MEMORY_LIMIT_EXCEEDED",e.OUTPUT_LIMIT_EXCEEDED="OUTPUT_LIMIT_EXCEEDED",e.IDLENESS_LIMIT_EXCEEDED="IDLENESS_LIMIT_EXCEEDED",e.HACKED="HACKED",e.JUDGEMENT_FAILED="JUDGEMENT_FAILED",e.CONFIGURATION_ERROR="CONFIGURATION_ERROR",e.FILE_ERROR="FILE_ERROR",e.SYSTEM_ERROR="SYSTEM_ERROR",e.CANCELED="CANCELED",e.SKIPPED="SKIPPED",e.SECURITY_VIOLATED="SECURITY_VIOLATED",e.DENIAL_OF_JUDGEMENT="DENIAL_OF_JUDGEMENT",e.UNKNOWN="UNKNOWN",e.UNDEFINED="UNDEFINED",e))(a||{});const Dt={PENDING:"Pending",WAITING:"Waiting",PREPARING:"Preparing",COMPILING:"Compiling",RUNNING:"Running",JUDGING:"Judging",FROZEN:"Frozen",ACCEPTED:"Accepted",CORRECT:"Correct",PARTIALLY_CORRECT:"Partially Correct",REJECTED:"Rejected",WRONG_ANSWER:"Wrong Answer",NO_OUTPUT:"No Output",COMPILATION_ERROR:"Compilation Error",PRESENTATION_ERROR:"Presentation Error",RUNTIME_ERROR:"Runtime Error",TIME_LIMIT_EXCEEDED:"Time Limit Exceeded",MEMORY_LIMIT_EXCEEDED:"Memory Limit Exceeded",OUTPUT_LIMIT_EXCEEDED:"Output Limit Exceeded",IDLENESS_LIMIT_EXCEEDED:"Idleness Limit Exceeded",HACKED:"Hacked",JUDGEMENT_FAILED:"Judgement Failed",CONFIGURATION_ERROR:"Configuration Error",FILE_ERROR:"File Error",SYSTEM_ERROR:"System Error",CANCELED:"Canceled",SKIPPED:"Skipped",SECURITY_VIOLATED:"Security Violated",DENIAL_OF_JUDGEMENT:"Denial Of Judgement",UNKNOWN:"Unknown",UNDEFINED:"Undefined"},Ct={PENDING:"PD",WAITING:"PD",PREPARING:"PD",COMPILING:"PD",RUNNING:"PD",JUDGING:"PD",FROZEN:"?",ACCEPTED:"AC",CORRECT:"AC",PARTIALLY_CORRECT:"RJ",REJECTED:"RJ",WRONG_ANSWER:"WA",NO_OUTPUT:"NO",COMPILATION_ERROR:"CE",PRESENTATION_ERROR:"PE",RUNTIME_ERROR:"RTE",TIME_LIMIT_EXCEEDED:"TLE",MEMORY_LIMIT_EXCEEDED:"MLE",OUTPUT_LIMIT_EXCEEDED:"OLE",IDLENESS_LIMIT_EXCEEDED:"ILE",HACKED:"RJ",JUDGEMENT_FAILED:"RJ",CONFIGURATION_ERROR:"RJ",FILE_ERROR:"RJ",SYSTEM_ERROR:"RJ",CANCELED:"RJ",SKIPPED:"RJ",SECURITY_VIOLATED:"RJ",DENIAL_OF_JUDGEMENT:"RJ",UNKNOWN:"RJ",UNDEFINED:"RJ"};function tt(e){return e=e.toUpperCase().replace(" ","_"),["OK","AC",a.ACCEPTED.toString()].includes(e)||[a.CORRECT.toString()].includes(e)?a.ACCEPTED:[a.PARTIALLY_CORRECT.toString()].includes(e)?a.PARTIALLY_CORRECT:["WA",a.WRONG_ANSWER.toString()].includes(e)?a.WRONG_ANSWER:["RJ","INCORRECT",a.REJECTED.toString()].includes(e)?a.REJECTED:["NO",a.NO_OUTPUT.toString()].includes(e)?a.NO_OUTPUT:["PD",a.PENDING.toString()].includes(e)?a.PENDING:[a.WAITING.toString()].includes(e)?a.WAITING:[a.JUDGING.toString()].includes(e)?a.JUDGING:[a.FROZEN.toString()].includes(e)?a.FROZEN:["CE",a.COMPILATION_ERROR.toString()].includes(e)?a.COMPILATION_ERROR:["PE",a.PRESENTATION_ERROR.toString()].includes(e)?a.PRESENTATION_ERROR:["TL","TLE",a.TIME_LIMIT_EXCEEDED.toString()].includes(e)?a.TIME_LIMIT_EXCEEDED:["ML","MLE",a.MEMORY_LIMIT_EXCEEDED.toString()].includes(e)?a.MEMORY_LIMIT_EXCEEDED:["OL","OLE",a.OUTPUT_LIMIT_EXCEEDED.toString()].includes(e)?a.OUTPUT_LIMIT_EXCEEDED:["IL","ILE",a.IDLENESS_LIMIT_EXCEEDED.toString()].includes(e)?a.IDLENESS_LIMIT_EXCEEDED:["RT","RE","RTE",a.RUNTIME_ERROR.toString()].includes(e)?a.RUNTIME_ERROR:["JE",a.JUDGEMENT_FAILED.toString()].includes(e)?a.JUDGEMENT_FAILED:["SE",a.SYSTEM_ERROR.toString()].includes(e)?a.SYSTEM_ERROR:[a.HACKED.toString()].includes(e)?a.HACKED:[a.CONFIGURATION_ERROR.toString()].includes(e)?a.CONFIGURATION_ERROR:[a.CANCELED.toString()].includes(e)?a.CANCELED:[a.SKIPPED.toString()].includes(e)?a.SKIPPED:[a.SECURITY_VIOLATED.toString()].includes(e)?a.SECURITY_VIOLATED:[a.DENIAL_OF_JUDGEMENT.toString()].includes(e)?a.DENIAL_OF_JUDGEMENT:a.UNKNOWN}function et(e){return[a.ACCEPTED,a.CORRECT].includes(e)}function it(e){return[a.RUNTIME_ERROR,a.TIME_LIMIT_EXCEEDED,a.MEMORY_LIMIT_EXCEEDED,a.OUTPUT_LIMIT_EXCEEDED,a.IDLENESS_LIMIT_EXCEEDED,a.WRONG_ANSWER,a.REJECTED,a.NO_OUTPUT,a.JUDGEMENT_FAILED,a.HACKED].includes(e)}function st(e){return[a.PENDING,a.WAITING,a.COMPILING,a.JUDGING,a.FROZEN].includes(e)}function nt(e){return[a.COMPILATION_ERROR,a.PRESENTATION_ERROR,a.CONFIGURATION_ERROR,a.SYSTEM_ERROR,a.CANCELED,a.SKIPPED,a.UNKNOWN,a.UNDEFINED].includes(e)}class b{constructor(){this.status=a.UNKNOWN,this.isIgnore=!1,this.isSolved=!1,this.isFirstSolved=!1,this.id="",this.teamId="",this.problemId="",this.timestamp=0,this.timestampUnit="second"}isAccepted(){return et(this.status)}isRejected(){return it(this.status)}isPending(){return st(this.status)}isNotCalculatedPenaltyStatus(){return nt(this.status)}get timestampToMinute(){return this.timestampUnit==="nanosecond"?Math.floor(this.timestamp/60/1e3/1e3/1e3):this.timestampUnit==="microsecond"?Math.floor(this.timestamp/60/1e3/1e3):this.timestampUnit==="millisecond"?Math.floor(this.timestamp/60/1e3):Math.floor(this.timestamp/60)}get timestampToSecond(){return this.timestampUnit==="nanosecond"?Math.floor(this.timestamp/1e3/1e3/1e3):this.timestampUnit==="microsecond"?Math.floor(this.timestamp/1e3/1e3):this.timestampUnit==="millisecond"?Math.floor(this.timestamp/1e3):this.timestamp}get timestampDisplayFormatWithSecond(){const t=this.timestampToSecond,i=Math.floor(t/3600),s=Math.floor(t%3600/60),n=t%60,r=m=>m.toString().padStart(2,"0");return`${r(i)}:${r(s)}:${r(n)}`}get timestampDisplayFormatWithMilliSecond(){let t=this.timestampDisplayFormatWithSecond;if(this.timestampUnit==="millisecond"){const i=(this.timestamp%1e3).toString().padStart(3,"0");t+=`.${i}`}return t}static compare(t,i){if(t.timestamp!==i.timestamp)return t.timestamp-i.timestamp;if(t.teamId===i.teamId){if(t.isAccepted()&&!i.isAccepted())return-1;if(!t.isAccepted()&&i.isAccepted())return 1}return t.id<i.id?-1:t.id===i.id?0:1}}function M(e,t){const i=new b;return i.id=String(e.id??e.submission_id??""),i.teamId=String(e.team_id),i.problemId=String(e.problem_id),i.timestamp=e.timestamp,i.status=tt(e.status),i.isIgnore=e.is_ignore??!1,e.time&&(i.time=e.time),e.language&&(i.language=e.language),e.reaction?i.reaction=e.reaction:t?.options.reactionVideoUrlTemplate&&(i.reaction={url:t.options.reactionVideoUrlTemplate.replace(/\$\{submission_id\}/,i.id)}),i}function Pt(e,t){return Array.isArray(e)?e.map((i,s)=>M({...i,id:i.submission_id??String(s)},t)):Object.entries(e).map(([s,n])=>M({...n,id:n.submission_id??s},t))}class p{constructor(){this.id="",this.name=new _,this.isFirstRankOfOrganization=!1,this.group=[],this.tag=[],this.coaches=[],this.members=[],this.rank=0,this.originalRank=0,this.solvedProblemNum=0,this.attemptedProblemNum=0,this.lastSolvedProblem=null,this.lastSolvedProblemStatistics=null,this.penalty=0,this.problemStatistics=[],this.problemStatisticsMap=new Map,this.submissions=[],this.placeChartPoints=[],this.awards=[],this.missingPhoto=!1,this.se=0}reset(){this.isFirstRankOfOrganization=!1,this.rank=0,this.originalRank=0,this.solvedProblemNum=0,this.attemptedProblemNum=0,this.lastSolvedProblem=null,this.lastSolvedProblemStatistics=null,this.penalty=0,this.problemStatistics=[],this.problemStatisticsMap=new Map,this.submissions=[],this.placeChartPoints=[],this.awards=[],this.se=0}get penaltyToMinute(){return Math.floor(this.penalty/60)}get isUnofficial(){return this.group.includes("unofficial")}get isGirl(){return this.group.includes("girl")}get isEffectiveTeam(){return this.solvedProblemNum>0}get dirt(){const t=this.attemptedProblemNum,i=this.solvedProblemNum;return J(t,i)}membersToString(t){return this.members.map(i=>i.name.getOrDefault(t)).join(", ")}coachesToString(t){return this.coaches.map(i=>i.name.getOrDefault(t)).join(", ")}calcSE(t){let i=0,s=0;if(this.problemStatistics.forEach(r=>{r.isSolved&&(i+=1,s+=r.problem.statistics.acceptedNum)}),t===0||i===0)return 0;const n=(i*t-s)/t/i;return this.se=Math.round(n*100)/100,this.se}calcSolvedData(t){this.solvedProblemNum=0,this.attemptedProblemNum=0,this.penalty=0;for(const i of this.problemStatistics)i.isAccepted&&(this.solvedProblemNum++,this.attemptedProblemNum+=i.failedCount+1,t?.calculationOfPenalty==="in_seconds"||t?.calculationOfPenalty==="accumulate_in_seconds_and_finally_to_the_minute"?this.penalty+=i.penaltyInSecond:this.penalty+=i.penalty);t?.calculationOfPenalty==="accumulate_in_seconds_and_finally_to_the_minute"&&(this.penalty=Math.floor(this.penalty/60)*60)}calcAwards(t){if(t)for(const i of t)this.rank>=i.minRank&&this.rank<=i.maxRank&&this.awards.push(i.medalType)}isEqualRank(t){return this.solvedProblemNum===t.solvedProblemNum&&this.penalty===t.penalty&&this.lastSolvedProblemStatistics?.solvedTimestampToMinute===t.lastSolvedProblemStatistics?.solvedTimestampToMinute}postProcessPlaceChartPoints(){if(this.placeChartPoints.length===0)return;const t=[];t.push(this.placeChartPoints[0]);for(let i=1;i<this.placeChartPoints.length-1;i++){const s=this.placeChartPoints[i],n=t[t.length-1];(s.rank!==n.rank||s.lastSolvedProblem!==n.lastSolvedProblem)&&t.push(s)}this.placeChartPoints.length>1&&t.push(this.placeChartPoints[this.placeChartPoints.length-1]),this.placeChartPoints=t}static compare(t,i){return t.solvedProblemNum!==i.solvedProblemNum?i.solvedProblemNum-t.solvedProblemNum:t.penalty!==i.penalty?t.penalty-i.penalty:t.lastSolvedProblemStatistics&&i.lastSolvedProblemStatistics?t.lastSolvedProblemStatistics.solvedTimestampToMinute-i.lastSolvedProblemStatistics.solvedTimestampToMinute:t.name<i.name?-1:t.name>i.name?1:0}}function y(e){const t=new p;t.id=e.id??e.team_id??"",t.name=_.fromIText(e.name??e.team_name??""),e.organization?(t.organizationId=e.organization,t.organizationName=e.organization):t.organizationId=e.organization_id,t.group=f.cloneDeep(e.group??[]),t.tag=f.cloneDeep(e.tag??[]),t.members=D(e.members),e.coach?t.coaches=D(e.coach):t.coaches=D(e.coaches),e.official&&t.group.push("official"),e.unofficial&&t.group.push("unofficial"),e.girl&&t.group.push("girl");{const i=e;for(const s of Object.keys(i))s!=="missing_photo"&&(i[s]===1||i[s]===!0)&&t.group.push(s)}return t.group=[...new Set(t.group)],t.group.sort(),t.badge=e.badge,e.missing_photo&&(t.missingPhoto=!0),t.photo=e.photo,e.location&&(t.location=e.location),e.icpc_id&&(t.icpcID=e.icpc_id),t}function At(e){return Array.isArray(e)?e.map(t=>y(t)):Object.entries(e).map(([i,s])=>y({...s,team_id:s.team_id??i}))}class at{constructor(){this.problem=new q,this.team=new p,this.submission=new b}get key(){return`balloon-${this.team.id}-${this.problem.id}`}static compare(t,i){return b.compare(t.submission,i.submission)}}const G="3.7.8",rt=G,E=typeof Buffer=="function",U=typeof TextDecoder=="function"?new TextDecoder:void 0,L=typeof TextEncoder=="function"?new TextEncoder:void 0,ot="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",d=Array.prototype.slice.call(ot),g=(e=>{let t={};return e.forEach((i,s)=>t[i]=s),t})(d),lt=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,u=String.fromCharCode.bind(String),v=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),w=e=>e.replace(/=/g,"").replace(/[+\/]/g,t=>t=="+"?"-":"_"),B=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),z=e=>{let t,i,s,n,r="";const l=e.length%3;for(let m=0;m<e.length;){if((i=e.charCodeAt(m++))>255||(s=e.charCodeAt(m++))>255||(n=e.charCodeAt(m++))>255)throw new TypeError("invalid character found");t=i<<16|s<<8|n,r+=d[t>>18&63]+d[t>>12&63]+d[t>>6&63]+d[t&63]}return l?r.slice(0,l-3)+"===".substring(l):r},O=typeof btoa=="function"?e=>btoa(e):E?e=>Buffer.from(e,"binary").toString("base64"):z,P=E?e=>Buffer.from(e).toString("base64"):e=>{let i=[];for(let s=0,n=e.length;s<n;s+=4096)i.push(u.apply(null,e.subarray(s,s+4096)));return O(i.join(""))},N=(e,t=!1)=>t?w(P(e)):P(e),mt=e=>{if(e.length<2){var t=e.charCodeAt(0);return t<128?e:t<2048?u(192|t>>>6)+u(128|t&63):u(224|t>>>12&15)+u(128|t>>>6&63)+u(128|t&63)}else{var t=65536+(e.charCodeAt(0)-55296)*1024+(e.charCodeAt(1)-56320);return u(240|t>>>18&7)+u(128|t>>>12&63)+u(128|t>>>6&63)+u(128|t&63)}},ct=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,W=e=>e.replace(ct,mt),x=E?e=>Buffer.from(e,"utf8").toString("base64"):L?e=>P(L.encode(e)):e=>O(W(e)),h=(e,t=!1)=>t?w(x(e)):x(e),F=e=>h(e,!0),ut=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,ht=e=>{switch(e.length){case 4:var t=(7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3),i=t-65536;return u((i>>>10)+55296)+u((i&1023)+56320);case 3:return u((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return u((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},X=e=>e.replace(ut,ht),Y=e=>{if(e=e.replace(/\s+/g,""),!lt.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(e.length&3));let t,i,s,n=[];for(let r=0;r<e.length;)t=g[e.charAt(r++)]<<18|g[e.charAt(r++)]<<12|(i=g[e.charAt(r++)])<<6|(s=g[e.charAt(r++)]),i===64?n.push(u(t>>16&255)):s===64?n.push(u(t>>16&255,t>>8&255)):n.push(u(t>>16&255,t>>8&255,t&255));return n.join("")},S=typeof atob=="function"?e=>atob(B(e)):E?e=>Buffer.from(e,"base64").toString("binary"):Y,K=E?e=>v(Buffer.from(e,"base64")):e=>v(S(e).split("").map(t=>t.charCodeAt(0))),j=e=>K(V(e)),Et=E?e=>Buffer.from(e,"base64").toString("utf8"):U?e=>U.decode(K(e)):e=>X(S(e)),V=e=>B(e.replace(/[-_]/g,t=>t=="-"?"+":"/")),A=e=>Et(V(e)),dt=e=>{if(typeof e!="string")return!1;const t=e.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(t)||!/[^\s0-9a-zA-Z\-_]/.test(t)},Z=e=>({value:e,enumerable:!1,writable:!0,configurable:!0}),H=function(){const e=(t,i)=>Object.defineProperty(String.prototype,t,Z(i));e("fromBase64",function(){return A(this)}),e("toBase64",function(t){return h(this,t)}),e("toBase64URI",function(){return h(this,!0)}),e("toBase64URL",function(){return h(this,!0)}),e("toUint8Array",function(){return j(this)})},$=function(){const e=(t,i)=>Object.defineProperty(Uint8Array.prototype,t,Z(i));e("toBase64",function(t){return N(this,t)}),e("toBase64URI",function(){return N(this,!0)}),e("toBase64URL",function(){return N(this,!0)})},ft=()=>{H(),$()},C={version:G,VERSION:rt,atob:S,atobPolyfill:Y,btoa:O,btoaPolyfill:z,fromBase64:A,toBase64:h,encode:h,encodeURI:F,encodeURL:F,utob:W,btou:X,decode:A,isValid:dt,fromUint8Array:N,toUint8Array:j,extendString:H,extendUint8Array:$,extendBuiltins:ft};var pt=(e=>(e[e.BLUE=0]="BLUE",e[e.RED=1]="RED",e))(pt||{});class I{constructor(t=0){this.type=t,this.name=`${t===0?"Blue":"Red"} Team`,this.teams=[],this.filterOrganizations=[],this.filterOrganizationMap=new Map,this.filterTeams=[],this.filterTeamMap=new Map}setFilterOrganizations(t){const i=new Map;t.forEach(s=>{i.set(s.value,s)}),this.filterOrganizations=t,this.filterOrganizationMap=i}setFilterTeams(t){const i=new Map;t.forEach(s=>{i.set(s.value,s)}),this.filterTeams=t,this.filterTeamMap=i}refreshName(){return this.filterOrganizations.length>0?this.name=this.filterOrganizations[0].text:this.name=`${this.type===0?"Blue":"Red"} Team`,this.name}get totalSolvedProblemNum(){let t=0;return this.teams.forEach(i=>{t+=i.solvedProblemNum}),t}get totalPenalty(){let t=0;return this.teams.forEach(i=>{t+=i.penaltyToMinute}),t}get totalPenaltyToString(){const t=this.totalPenalty,i=r=>r<10?`0${r}`:String(r),s=Math.floor(t/60),n=Math.floor(t%60);return[i(s),i(n)].join(":")}toJSON(){return{type:this.type,name:this.name,filterOrganizations:this.filterOrganizations,filterTeams:this.filterTeams}}}class Tt{constructor(){this.enable=!1,this.topX=5,this.equalTeams=!0,this.persist=!1,this.blueTeam=new I(0),this.redTeam=new I(1)}ToBase64(){return C.encode(JSON.stringify(this))}FromBase64(t){if(t.length===0||C.isValid(t)===!1)return;const i=JSON.parse(C.decode(t));this.enable=i.enable,this.topX=i.topX,this.equalTeams=i.equalTeams,this.persist=i.persist,this.blueTeam=new I(0),this.blueTeam.name=i.blueTeam.name,this.blueTeam.setFilterOrganizations(i.blueTeam.filterOrganizations),this.blueTeam.setFilterTeams(i.blueTeam.filterTeams),this.redTeam=new I(1),this.redTeam.name=i.redTeam.name,this.redTeam.setFilterOrganizations(i.redTeam.filterOrganizations),this.redTeam.setFilterTeams(i.redTeam.filterTeams)}}class k{constructor(){this.id="",this.name=new _,this.teams=[],this.rank=-1}reset(){this.rank=-1}static compare(t,i){return t.id<i.id?-1:t.id>i.id?1:0}}class Rt{constructor(){this.teamSolvedNum=[],this.teamSolvedNumIndex=[],this.maxSolvedProblems=0,this.effectiveTeamNum=0,this.totalTeamNum=0}reset(){this.teamSolvedNum=[],this.teamSolvedNumIndex=[],this.maxSolvedProblems=0,this.effectiveTeamNum=0,this.totalTeamNum=0}getTeamSolvedNumIndex(t){return this.teamSolvedNumIndex[t]??0}}class gt{constructor(){this.enableFilterSubmissionsByTimestamp=!1,this.width=0,this.timestamp=0,this.enableFilterTeamsByGroup=!1,this.group="all",this.filterOrganizations=[],this.filterOrganizationMap=new Map,this.filterTeams=[],this.filterTeamMap=new Map,this.enableAnimatedSubmissions=!1,this.battleOfGiants=new Tt}setSelf(t){this.enableFilterSubmissionsByTimestamp=t.enableFilterSubmissionsByTimestamp,this.width=t.width,this.timestamp=t.timestamp,this.enableFilterTeamsByGroup=t.enableFilterTeamsByGroup,this.group=t.group,this.filterOrganizations=t.filterOrganizations,this.filterOrganizationMap=t.filterOrganizationMap,this.filterTeams=t.filterTeams,this.filterTeamMap=t.filterTeamMap,this.enableAnimatedSubmissions=t.enableAnimatedSubmissions,this.battleOfGiants=t.battleOfGiants}setWidth(t,i){this.width=t,this.timestamp=Math.floor((i.getEndTime().unix()-i.getStartTime().unix())*this.width*1e-4),this.enableFilterSubmissionsByTimestamp=!0}disableFilterSubmissionByTimestamp(){this.enableFilterSubmissionsByTimestamp=!1}setGroup(t){this.group=t,this.enableFilterTeamsByGroup=!0,this.group==="all"&&this.disableFilterTeamsByGroup()}disableFilterTeamsByGroup(){this.enableFilterTeamsByGroup=!1,this.group="all"}setFilterOrganizations(t){const i=new Map;t.forEach(s=>{i.set(s.value,s)}),this.filterOrganizations=t,this.filterOrganizationMap=i}setFilterTeams(t){const i=new Map;t.forEach(s=>{i.set(s.value,s)}),this.filterTeams=t,this.filterTeamMap=i}isNeedReBuildRank(t){return this.enableFilterSubmissionsByTimestamp!==t.enableFilterSubmissionsByTimestamp||this.width!==t.width||this.timestamp!==t.timestamp||this.enableFilterTeamsByGroup!==t.enableFilterTeamsByGroup||this.group!==t.group}}class Ot{constructor(t,i,s){this.contest=t,this.teams=f.cloneDeep(i),this.teamsMap=new Map(this.teams.map(n=>[n.id,n])),this.submissions=f.cloneDeep(s).sort(b.compare);{const n=this.contest.options,r=f.cloneDeep(n.submissionTimestampUnit);this.submissions.forEach(l=>{l.timestampUnit=r,l.time&&(n.submissionHasTimeField=!0),l.language&&(n.submissionHasLanguageField=!0)})}this.submissionsMap=new Map(this.submissions.map(n=>[n.id,n])),this.organizationsMap=this.buildOrganizationsMap(),this.organizations=[...this.organizationsMap.values()],this.organizations.sort(k.compare),this.originTeams=this.teams.map(n=>n),this.originTeams.sort(p.compare),this.rankStatistics=new Rt,this.options=new gt,this.balloons=[];{const n=new Set;this.submissions.forEach(r=>{r.language&&n.add(r.language)}),this.languages=[...n].sort()}{const n=new Set;this.submissions.forEach(r=>{n.add(r.status)}),this.statuses=[...n].sort()}}buildOrganizationsMap(){if(!this.contest.organization)return new Map;const t=new Map;return this.teams.forEach(i=>{if(!i.organizationId)return;if(t.has(i.organizationId)){const n=t.get(i.organizationId);n?.teams.push(i),i.organization=n;return}const s=new k;s.id=i.organizationId,s.name=new _,s.name.fallback=i.organizationName,s.teams.push(i),i.organization=s,t.set(s.id,s)}),t}cleanRank(){(()=>{this.teams=[];for(const[t,i]of this.teamsMap)this.filterTeamByOrg(i)||this.teams.push(i)})();for(const t of this.organizations)t.reset();for(const t of this.teams)t.reset(),t.problemStatistics=this.contest.problems.map(i=>{const s=new Q;return s.problem=i,s.contestPenalty=this.contest.penalty,s}),t.problemStatisticsMap=new Map(t.problemStatistics.map(i=>[i.problem.id,i]));this.contest.problems.forEach(t=>{t.statistics.reset()})}buildRank(){return(()=>{this.cleanRank(),this.teams.forEach(s=>s.placeChartPoints.push({timePoint:0,rank:1,lastSolvedProblem:null})),this.rankStatistics.reset(),this.rankStatistics.teamSolvedNum=Array.from({length:this.contest.problems.length+1}).fill(0),this.rankStatistics.teamSolvedNumIndex=Array.from({length:this.contest.problems.length+1}).fill(0);let t=0;const i=this.getSubmissions();for(let s=0;s<i.length;s++){const n=i[s],r=n.teamId,l=n.problemId,m=this.teamsMap.get(r),c=this.contest.problemsMap.get(l);(()=>{if(m===void 0||this.filterTeamByOrg(m)||c===void 0)return;const o=m.problemStatisticsMap.get(l);if(o.submissions.push(n),m.submissions.push(n),c.statistics.submittedNum++,o.isSolved){n.isSolved=!1,n.isFirstSolved=!1;return}if(n.isIgnore||n.isNotCalculatedPenaltyStatus()){c.statistics.ignoreNum++,o.ignoreCount++;return}if(o.isSubmitted=!0,o.lastSubmitTimestamp=n.timestampToSecond,o.totalCount++,n.isAccepted()){for(n.isSolved=!0,o.isSolved=!0,o.solvedTimestamp=n.timestampToSecond,c.statistics.acceptedNum++,c.statistics.attemptedNum+=o.failedCount+1,(c.statistics.firstSolveSubmissions.length===0||c.statistics.firstSolveSubmissions[c.statistics.firstSolveSubmissions.length-1].timestamp===n.timestamp)&&(n.isFirstSolved=!0,o.isFirstSolved=!0,c.statistics.firstSolveSubmissions.push(n));c.statistics.lastSolveSubmissions.length>0;)c.statistics.lastSolveSubmissions.pop();c.statistics.lastSolveSubmissions.push(n),m.lastSolvedProblem=c,m.lastSolvedProblemStatistics=o}n.isRejected()&&(o.failedCount++,c.statistics.rejectedNum++),n.isPending()&&(o.pendingCount++,c.statistics.pendingNum++)})(),(n.timestampToMinute>t||s===i.length-1)&&(this.teams.forEach(o=>o.calcSolvedData(this.contest.options)),this.teams.sort(p.compare),this.buildTeamRank(),this.teams.forEach(o=>o.placeChartPoints.push({timePoint:n.timestampToMinute,rank:o.rank,lastSolvedProblem:o.lastSolvedProblem}))),t=n.timestampToMinute}this.teams.forEach(s=>s.calcSolvedData(this.contest.options)),this.teams.sort(p.compare),this.buildTeamRank(),this.buildOrgRank(),this.rankStatistics.effectiveTeamNum=this.teams.filter(s=>s.isEffectiveTeam).length,this.rankStatistics.totalTeamNum=this.teams.length,this.teams.forEach(s=>s.calcSE(this.rankStatistics.totalTeamNum)),this.contest.problems.forEach(s=>s.statistics.calcSE(this.rankStatistics.totalTeamNum)),this.buildAwards(),this.teams.forEach(s=>s.calcAwards(this.contest.awards?.get(this.options.group))),this.teams.forEach(s=>s.postProcessPlaceChartPoints())})(),(()=>{for(const t of this.teams)this.rankStatistics.teamSolvedNum[t.solvedProblemNum]++;{let t=0;const i=this.rankStatistics.teamSolvedNum,s=this.rankStatistics.teamSolvedNumIndex;for(let n=s.length-1;n>=0;n--)t+=i[n]>0?1:0,s[n]=t}this.teams.length>0&&(this.rankStatistics.maxSolvedProblems=this.teams[0].solvedProblemNum)})(),this}buildTeamRank(){let t=1,i=1,s=null;for(const n of this.teams)n.rank=t++,n.originalRank=i++,s!==null&&n.isEqualRank(s)&&(n.rank=s.rank),s=n}buildOrgRank(){if(!this.contest.organization)return;let t=1,i=null;for(const s of this.teams){const n=s.organization;!n||n.rank>-1||(n.rank=t++,s.isFirstRankOfOrganization=!0,i&&s.isEqualRank(i)&&(n.rank=i.organization.rank),i=s)}}buildAwards(){if(this.contest.medal==="ccpc"){this.contest.awards=new Map;const t=this.rankStatistics.effectiveTeamNum,i=[],s=new R,n=new R,r=new R,l=new R;s.medalType=T.GOLD,s.minRank=1,s.maxRank=Math.ceil(t*.1),s.maxRank>=s.minRank&&i.push(s),n.medalType=T.SILVER,n.minRank=s.maxRank+1,n.maxRank=Math.ceil(t*.3),n.maxRank>=n.minRank&&i.push(n),r.medalType=T.BRONZE,r.minRank=n.maxRank+1,r.maxRank=Math.ceil(t*.6),r.maxRank>=r.minRank&&i.push(r),l.medalType=T.HONORABLE,l.minRank=r.maxRank+1,this.teams.forEach(m=>{m.solvedProblemNum>0&&(l.maxRank=Math.max(l.maxRank,m.rank))}),l.maxRank>=l.minRank&&i.push(l),this.contest.awards.set("official",i)}}filterTeamByOrg(t){const i=this.options;return!!(i.enableFilterTeamsByGroup&&!t.group?.includes(i.group))}getSubmissions(){return this.contest.replayContestStartTimestamp===void 0&&this.options.enableFilterSubmissionsByTimestamp===!1?this.submissions:this.submissions.filter(t=>!(this.contest.replayContestStartTimestamp!==void 0&&t.timestampToSecond>this.contest.replayContestStartTimestamp||this.options.enableFilterSubmissionsByTimestamp&&t.timestampToSecond>this.options.timestamp))}buildBalloons(){this.balloons=[],this.cleanRank();const t=this.getSubmissions();for(let i=0;i<t.length;i++){const s=t[i],n=s.teamId,r=s.problemId,l=this.teamsMap.get(n),m=this.contest.problemsMap.get(r);(()=>{if(l===void 0||m===void 0)return;const c=l.problemStatisticsMap.get(r);if(!c.isSolved&&s.isAccepted()){c.isSolved=!0,c.solvedTimestamp=s.timestampToSecond;const o=new at;o.team=l,o.problem=m,o.submission=s,this.balloons.push(o)}})()}}setReplayTime(t){this.contest.setReplayTime(t)}}export{at as B,pt as G,Ot as R,a as S,p as T,Pt as a,nt as b,At as c,st as d,Ct as e,b as f,it as g,Dt as h,et as i,gt as j};
|
|
1
|
+
import{l as J,d as f,P as q,T as Q,M as T,A as R}from"./use-vmodel-Byn458t1.js";import{I as _}from"./dayjs-DHI77Sx3.js";import{c as D}from"./person-BwrHTBeO.js";var a=(e=>(e.PENDING="PENDING",e.WAITING="WAITING",e.PREPARING="PREPARING",e.COMPILING="COMPILING",e.RUNNING="RUNNING",e.JUDGING="JUDGING",e.FROZEN="FROZEN",e.ACCEPTED="ACCEPTED",e.CORRECT="CORRECT",e.PARTIALLY_CORRECT="PARTIALLY_CORRECT",e.REJECTED="REJECTED",e.WRONG_ANSWER="WRONG_ANSWER",e.NO_OUTPUT="NO_OUTPUT",e.COMPILATION_ERROR="COMPILATION_ERROR",e.PRESENTATION_ERROR="PRESENTATION_ERROR",e.RUNTIME_ERROR="RUNTIME_ERROR",e.TIME_LIMIT_EXCEEDED="TIME_LIMIT_EXCEEDED",e.MEMORY_LIMIT_EXCEEDED="MEMORY_LIMIT_EXCEEDED",e.OUTPUT_LIMIT_EXCEEDED="OUTPUT_LIMIT_EXCEEDED",e.IDLENESS_LIMIT_EXCEEDED="IDLENESS_LIMIT_EXCEEDED",e.HACKED="HACKED",e.JUDGEMENT_FAILED="JUDGEMENT_FAILED",e.CONFIGURATION_ERROR="CONFIGURATION_ERROR",e.FILE_ERROR="FILE_ERROR",e.SYSTEM_ERROR="SYSTEM_ERROR",e.CANCELED="CANCELED",e.SKIPPED="SKIPPED",e.SECURITY_VIOLATED="SECURITY_VIOLATED",e.DENIAL_OF_JUDGEMENT="DENIAL_OF_JUDGEMENT",e.UNKNOWN="UNKNOWN",e.UNDEFINED="UNDEFINED",e))(a||{});const Dt={PENDING:"Pending",WAITING:"Waiting",PREPARING:"Preparing",COMPILING:"Compiling",RUNNING:"Running",JUDGING:"Judging",FROZEN:"Frozen",ACCEPTED:"Accepted",CORRECT:"Correct",PARTIALLY_CORRECT:"Partially Correct",REJECTED:"Rejected",WRONG_ANSWER:"Wrong Answer",NO_OUTPUT:"No Output",COMPILATION_ERROR:"Compilation Error",PRESENTATION_ERROR:"Presentation Error",RUNTIME_ERROR:"Runtime Error",TIME_LIMIT_EXCEEDED:"Time Limit Exceeded",MEMORY_LIMIT_EXCEEDED:"Memory Limit Exceeded",OUTPUT_LIMIT_EXCEEDED:"Output Limit Exceeded",IDLENESS_LIMIT_EXCEEDED:"Idleness Limit Exceeded",HACKED:"Hacked",JUDGEMENT_FAILED:"Judgement Failed",CONFIGURATION_ERROR:"Configuration Error",FILE_ERROR:"File Error",SYSTEM_ERROR:"System Error",CANCELED:"Canceled",SKIPPED:"Skipped",SECURITY_VIOLATED:"Security Violated",DENIAL_OF_JUDGEMENT:"Denial Of Judgement",UNKNOWN:"Unknown",UNDEFINED:"Undefined"},Ct={PENDING:"PD",WAITING:"PD",PREPARING:"PD",COMPILING:"PD",RUNNING:"PD",JUDGING:"PD",FROZEN:"?",ACCEPTED:"AC",CORRECT:"AC",PARTIALLY_CORRECT:"RJ",REJECTED:"RJ",WRONG_ANSWER:"WA",NO_OUTPUT:"NO",COMPILATION_ERROR:"CE",PRESENTATION_ERROR:"PE",RUNTIME_ERROR:"RTE",TIME_LIMIT_EXCEEDED:"TLE",MEMORY_LIMIT_EXCEEDED:"MLE",OUTPUT_LIMIT_EXCEEDED:"OLE",IDLENESS_LIMIT_EXCEEDED:"ILE",HACKED:"RJ",JUDGEMENT_FAILED:"RJ",CONFIGURATION_ERROR:"RJ",FILE_ERROR:"RJ",SYSTEM_ERROR:"RJ",CANCELED:"RJ",SKIPPED:"RJ",SECURITY_VIOLATED:"RJ",DENIAL_OF_JUDGEMENT:"RJ",UNKNOWN:"RJ",UNDEFINED:"RJ"};function tt(e){return e=e.toUpperCase().replace(" ","_"),["OK","AC",a.ACCEPTED.toString()].includes(e)||[a.CORRECT.toString()].includes(e)?a.ACCEPTED:[a.PARTIALLY_CORRECT.toString()].includes(e)?a.PARTIALLY_CORRECT:["WA",a.WRONG_ANSWER.toString()].includes(e)?a.WRONG_ANSWER:["RJ","INCORRECT",a.REJECTED.toString()].includes(e)?a.REJECTED:["NO",a.NO_OUTPUT.toString()].includes(e)?a.NO_OUTPUT:["PD",a.PENDING.toString()].includes(e)?a.PENDING:[a.WAITING.toString()].includes(e)?a.WAITING:[a.JUDGING.toString()].includes(e)?a.JUDGING:[a.FROZEN.toString()].includes(e)?a.FROZEN:["CE",a.COMPILATION_ERROR.toString()].includes(e)?a.COMPILATION_ERROR:["PE",a.PRESENTATION_ERROR.toString()].includes(e)?a.PRESENTATION_ERROR:["TL","TLE",a.TIME_LIMIT_EXCEEDED.toString()].includes(e)?a.TIME_LIMIT_EXCEEDED:["ML","MLE",a.MEMORY_LIMIT_EXCEEDED.toString()].includes(e)?a.MEMORY_LIMIT_EXCEEDED:["OL","OLE",a.OUTPUT_LIMIT_EXCEEDED.toString()].includes(e)?a.OUTPUT_LIMIT_EXCEEDED:["IL","ILE",a.IDLENESS_LIMIT_EXCEEDED.toString()].includes(e)?a.IDLENESS_LIMIT_EXCEEDED:["RT","RE","RTE",a.RUNTIME_ERROR.toString()].includes(e)?a.RUNTIME_ERROR:["JE",a.JUDGEMENT_FAILED.toString()].includes(e)?a.JUDGEMENT_FAILED:["SE",a.SYSTEM_ERROR.toString()].includes(e)?a.SYSTEM_ERROR:[a.HACKED.toString()].includes(e)?a.HACKED:[a.CONFIGURATION_ERROR.toString()].includes(e)?a.CONFIGURATION_ERROR:[a.CANCELED.toString()].includes(e)?a.CANCELED:[a.SKIPPED.toString()].includes(e)?a.SKIPPED:[a.SECURITY_VIOLATED.toString()].includes(e)?a.SECURITY_VIOLATED:[a.DENIAL_OF_JUDGEMENT.toString()].includes(e)?a.DENIAL_OF_JUDGEMENT:a.UNKNOWN}function et(e){return[a.ACCEPTED,a.CORRECT].includes(e)}function it(e){return[a.RUNTIME_ERROR,a.TIME_LIMIT_EXCEEDED,a.MEMORY_LIMIT_EXCEEDED,a.OUTPUT_LIMIT_EXCEEDED,a.IDLENESS_LIMIT_EXCEEDED,a.WRONG_ANSWER,a.REJECTED,a.NO_OUTPUT,a.JUDGEMENT_FAILED,a.HACKED].includes(e)}function st(e){return[a.PENDING,a.WAITING,a.COMPILING,a.JUDGING,a.FROZEN].includes(e)}function nt(e){return[a.COMPILATION_ERROR,a.PRESENTATION_ERROR,a.CONFIGURATION_ERROR,a.SYSTEM_ERROR,a.CANCELED,a.SKIPPED,a.UNKNOWN,a.UNDEFINED].includes(e)}class b{constructor(){this.status=a.UNKNOWN,this.isIgnore=!1,this.isSolved=!1,this.isFirstSolved=!1,this.id="",this.teamId="",this.problemId="",this.timestamp=0,this.timestampUnit="second"}isAccepted(){return et(this.status)}isRejected(){return it(this.status)}isPending(){return st(this.status)}isNotCalculatedPenaltyStatus(){return nt(this.status)}get timestampToMinute(){return this.timestampUnit==="nanosecond"?Math.floor(this.timestamp/60/1e3/1e3/1e3):this.timestampUnit==="microsecond"?Math.floor(this.timestamp/60/1e3/1e3):this.timestampUnit==="millisecond"?Math.floor(this.timestamp/60/1e3):Math.floor(this.timestamp/60)}get timestampToSecond(){return this.timestampUnit==="nanosecond"?Math.floor(this.timestamp/1e3/1e3/1e3):this.timestampUnit==="microsecond"?Math.floor(this.timestamp/1e3/1e3):this.timestampUnit==="millisecond"?Math.floor(this.timestamp/1e3):this.timestamp}get timestampDisplayFormatWithSecond(){const t=this.timestampToSecond,i=Math.floor(t/3600),s=Math.floor(t%3600/60),n=t%60,r=m=>m.toString().padStart(2,"0");return`${r(i)}:${r(s)}:${r(n)}`}get timestampDisplayFormatWithMilliSecond(){let t=this.timestampDisplayFormatWithSecond;if(this.timestampUnit==="millisecond"){const i=(this.timestamp%1e3).toString().padStart(3,"0");t+=`.${i}`}return t}static compare(t,i){if(t.timestamp!==i.timestamp)return t.timestamp-i.timestamp;if(t.teamId===i.teamId){if(t.isAccepted()&&!i.isAccepted())return-1;if(!t.isAccepted()&&i.isAccepted())return 1}return t.id<i.id?-1:t.id===i.id?0:1}}function M(e,t){const i=new b;return i.id=String(e.id??e.submission_id??""),i.teamId=String(e.team_id),i.problemId=String(e.problem_id),i.timestamp=e.timestamp,i.status=tt(e.status),i.isIgnore=e.is_ignore??!1,e.time&&(i.time=e.time),e.language&&(i.language=e.language),e.reaction?i.reaction=e.reaction:t?.options.reactionVideoUrlTemplate&&(i.reaction={url:t.options.reactionVideoUrlTemplate.replace(/\$\{submission_id\}/,i.id)}),i}function Pt(e,t){return Array.isArray(e)?e.map((i,s)=>M({...i,id:i.submission_id??String(s)},t)):Object.entries(e).map(([s,n])=>M({...n,id:n.submission_id??s},t))}class p{constructor(){this.id="",this.name=new _,this.isFirstRankOfOrganization=!1,this.group=[],this.tag=[],this.coaches=[],this.members=[],this.rank=0,this.originalRank=0,this.solvedProblemNum=0,this.attemptedProblemNum=0,this.lastSolvedProblem=null,this.lastSolvedProblemStatistics=null,this.penalty=0,this.problemStatistics=[],this.problemStatisticsMap=new Map,this.submissions=[],this.placeChartPoints=[],this.awards=[],this.missingPhoto=!1,this.se=0}reset(){this.isFirstRankOfOrganization=!1,this.rank=0,this.originalRank=0,this.solvedProblemNum=0,this.attemptedProblemNum=0,this.lastSolvedProblem=null,this.lastSolvedProblemStatistics=null,this.penalty=0,this.problemStatistics=[],this.problemStatisticsMap=new Map,this.submissions=[],this.placeChartPoints=[],this.awards=[],this.se=0}get penaltyToMinute(){return Math.floor(this.penalty/60)}get isUnofficial(){return this.group.includes("unofficial")}get isGirl(){return this.group.includes("girl")}get isEffectiveTeam(){return this.solvedProblemNum>0}get dirt(){const t=this.attemptedProblemNum,i=this.solvedProblemNum;return J(t,i)}membersToString(t){return this.members.map(i=>i.name.getOrDefault(t)).join(", ")}coachesToString(t){return this.coaches.map(i=>i.name.getOrDefault(t)).join(", ")}calcSE(t){let i=0,s=0;if(this.problemStatistics.forEach(r=>{r.isSolved&&(i+=1,s+=r.problem.statistics.acceptedNum)}),t===0||i===0)return 0;const n=(i*t-s)/t/i;return this.se=Math.round(n*100)/100,this.se}calcSolvedData(t){this.solvedProblemNum=0,this.attemptedProblemNum=0,this.penalty=0;for(const i of this.problemStatistics)i.isAccepted&&(this.solvedProblemNum++,this.attemptedProblemNum+=i.failedCount+1,t?.calculationOfPenalty==="in_seconds"||t?.calculationOfPenalty==="accumulate_in_seconds_and_finally_to_the_minute"?this.penalty+=i.penaltyInSecond:this.penalty+=i.penalty);t?.calculationOfPenalty==="accumulate_in_seconds_and_finally_to_the_minute"&&(this.penalty=Math.floor(this.penalty/60)*60)}calcAwards(t){if(t)for(const i of t)this.rank>=i.minRank&&this.rank<=i.maxRank&&this.awards.push(i.medalType)}isEqualRank(t){return this.solvedProblemNum===t.solvedProblemNum&&this.penalty===t.penalty&&this.lastSolvedProblemStatistics?.solvedTimestampToMinute===t.lastSolvedProblemStatistics?.solvedTimestampToMinute}postProcessPlaceChartPoints(){if(this.placeChartPoints.length===0)return;const t=[];t.push(this.placeChartPoints[0]);for(let i=1;i<this.placeChartPoints.length-1;i++){const s=this.placeChartPoints[i],n=t[t.length-1];(s.rank!==n.rank||s.lastSolvedProblem!==n.lastSolvedProblem)&&t.push(s)}this.placeChartPoints.length>1&&t.push(this.placeChartPoints[this.placeChartPoints.length-1]),this.placeChartPoints=t}static compare(t,i){return t.solvedProblemNum!==i.solvedProblemNum?i.solvedProblemNum-t.solvedProblemNum:t.penalty!==i.penalty?t.penalty-i.penalty:t.lastSolvedProblemStatistics&&i.lastSolvedProblemStatistics?t.lastSolvedProblemStatistics.solvedTimestampToMinute-i.lastSolvedProblemStatistics.solvedTimestampToMinute:t.name<i.name?-1:t.name>i.name?1:0}}function y(e){const t=new p;t.id=e.id??e.team_id??"",t.name=_.fromIText(e.name??e.team_name??""),e.organization?(t.organizationId=e.organization,t.organizationName=e.organization):t.organizationId=e.organization_id,t.group=f.cloneDeep(e.group??[]),t.tag=f.cloneDeep(e.tag??[]),t.members=D(e.members),e.coach?t.coaches=D(e.coach):t.coaches=D(e.coaches),e.official&&t.group.push("official"),e.unofficial&&t.group.push("unofficial"),e.girl&&t.group.push("girl");{const i=e;for(const s of Object.keys(i))s!=="missing_photo"&&(i[s]===1||i[s]===!0)&&t.group.push(s)}return t.group=[...new Set(t.group)],t.group.sort(),t.badge=e.badge,e.missing_photo&&(t.missingPhoto=!0),t.photo=e.photo,e.location&&(t.location=e.location),e.icpc_id&&(t.icpcID=e.icpc_id),t}function At(e){return Array.isArray(e)?e.map(t=>y(t)):Object.entries(e).map(([i,s])=>y({...s,team_id:s.team_id??i}))}class at{constructor(){this.problem=new q,this.team=new p,this.submission=new b}get key(){return`balloon-${this.team.id}-${this.problem.id}`}static compare(t,i){return b.compare(t.submission,i.submission)}}const G="3.7.8",rt=G,E=typeof Buffer=="function",U=typeof TextDecoder=="function"?new TextDecoder:void 0,L=typeof TextEncoder=="function"?new TextEncoder:void 0,ot="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",d=Array.prototype.slice.call(ot),g=(e=>{let t={};return e.forEach((i,s)=>t[i]=s),t})(d),lt=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,u=String.fromCharCode.bind(String),v=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),w=e=>e.replace(/=/g,"").replace(/[+\/]/g,t=>t=="+"?"-":"_"),B=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),z=e=>{let t,i,s,n,r="";const l=e.length%3;for(let m=0;m<e.length;){if((i=e.charCodeAt(m++))>255||(s=e.charCodeAt(m++))>255||(n=e.charCodeAt(m++))>255)throw new TypeError("invalid character found");t=i<<16|s<<8|n,r+=d[t>>18&63]+d[t>>12&63]+d[t>>6&63]+d[t&63]}return l?r.slice(0,l-3)+"===".substring(l):r},O=typeof btoa=="function"?e=>btoa(e):E?e=>Buffer.from(e,"binary").toString("base64"):z,P=E?e=>Buffer.from(e).toString("base64"):e=>{let i=[];for(let s=0,n=e.length;s<n;s+=4096)i.push(u.apply(null,e.subarray(s,s+4096)));return O(i.join(""))},N=(e,t=!1)=>t?w(P(e)):P(e),mt=e=>{if(e.length<2){var t=e.charCodeAt(0);return t<128?e:t<2048?u(192|t>>>6)+u(128|t&63):u(224|t>>>12&15)+u(128|t>>>6&63)+u(128|t&63)}else{var t=65536+(e.charCodeAt(0)-55296)*1024+(e.charCodeAt(1)-56320);return u(240|t>>>18&7)+u(128|t>>>12&63)+u(128|t>>>6&63)+u(128|t&63)}},ct=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,W=e=>e.replace(ct,mt),x=E?e=>Buffer.from(e,"utf8").toString("base64"):L?e=>P(L.encode(e)):e=>O(W(e)),h=(e,t=!1)=>t?w(x(e)):x(e),F=e=>h(e,!0),ut=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,ht=e=>{switch(e.length){case 4:var t=(7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3),i=t-65536;return u((i>>>10)+55296)+u((i&1023)+56320);case 3:return u((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return u((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},X=e=>e.replace(ut,ht),Y=e=>{if(e=e.replace(/\s+/g,""),!lt.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(e.length&3));let t,i,s,n=[];for(let r=0;r<e.length;)t=g[e.charAt(r++)]<<18|g[e.charAt(r++)]<<12|(i=g[e.charAt(r++)])<<6|(s=g[e.charAt(r++)]),i===64?n.push(u(t>>16&255)):s===64?n.push(u(t>>16&255,t>>8&255)):n.push(u(t>>16&255,t>>8&255,t&255));return n.join("")},S=typeof atob=="function"?e=>atob(B(e)):E?e=>Buffer.from(e,"base64").toString("binary"):Y,K=E?e=>v(Buffer.from(e,"base64")):e=>v(S(e).split("").map(t=>t.charCodeAt(0))),j=e=>K(V(e)),Et=E?e=>Buffer.from(e,"base64").toString("utf8"):U?e=>U.decode(K(e)):e=>X(S(e)),V=e=>B(e.replace(/[-_]/g,t=>t=="-"?"+":"/")),A=e=>Et(V(e)),dt=e=>{if(typeof e!="string")return!1;const t=e.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(t)||!/[^\s0-9a-zA-Z\-_]/.test(t)},Z=e=>({value:e,enumerable:!1,writable:!0,configurable:!0}),H=function(){const e=(t,i)=>Object.defineProperty(String.prototype,t,Z(i));e("fromBase64",function(){return A(this)}),e("toBase64",function(t){return h(this,t)}),e("toBase64URI",function(){return h(this,!0)}),e("toBase64URL",function(){return h(this,!0)}),e("toUint8Array",function(){return j(this)})},$=function(){const e=(t,i)=>Object.defineProperty(Uint8Array.prototype,t,Z(i));e("toBase64",function(t){return N(this,t)}),e("toBase64URI",function(){return N(this,!0)}),e("toBase64URL",function(){return N(this,!0)})},ft=()=>{H(),$()},C={version:G,VERSION:rt,atob:S,atobPolyfill:Y,btoa:O,btoaPolyfill:z,fromBase64:A,toBase64:h,encode:h,encodeURI:F,encodeURL:F,utob:W,btou:X,decode:A,isValid:dt,fromUint8Array:N,toUint8Array:j,extendString:H,extendUint8Array:$,extendBuiltins:ft};var pt=(e=>(e[e.BLUE=0]="BLUE",e[e.RED=1]="RED",e))(pt||{});class I{constructor(t=0){this.type=t,this.name=`${t===0?"Blue":"Red"} Team`,this.teams=[],this.filterOrganizations=[],this.filterOrganizationMap=new Map,this.filterTeams=[],this.filterTeamMap=new Map}setFilterOrganizations(t){const i=new Map;t.forEach(s=>{i.set(s.value,s)}),this.filterOrganizations=t,this.filterOrganizationMap=i}setFilterTeams(t){const i=new Map;t.forEach(s=>{i.set(s.value,s)}),this.filterTeams=t,this.filterTeamMap=i}refreshName(){return this.filterOrganizations.length>0?this.name=this.filterOrganizations[0].text:this.name=`${this.type===0?"Blue":"Red"} Team`,this.name}get totalSolvedProblemNum(){let t=0;return this.teams.forEach(i=>{t+=i.solvedProblemNum}),t}get totalPenalty(){let t=0;return this.teams.forEach(i=>{t+=i.penaltyToMinute}),t}get totalPenaltyToString(){const t=this.totalPenalty,i=r=>r<10?`0${r}`:String(r),s=Math.floor(t/60),n=Math.floor(t%60);return[i(s),i(n)].join(":")}toJSON(){return{type:this.type,name:this.name,filterOrganizations:this.filterOrganizations,filterTeams:this.filterTeams}}}class Tt{constructor(){this.enable=!1,this.topX=5,this.equalTeams=!0,this.persist=!1,this.blueTeam=new I(0),this.redTeam=new I(1)}ToBase64(){return C.encode(JSON.stringify(this))}FromBase64(t){if(t.length===0||C.isValid(t)===!1)return;const i=JSON.parse(C.decode(t));this.enable=i.enable,this.topX=i.topX,this.equalTeams=i.equalTeams,this.persist=i.persist,this.blueTeam=new I(0),this.blueTeam.name=i.blueTeam.name,this.blueTeam.setFilterOrganizations(i.blueTeam.filterOrganizations),this.blueTeam.setFilterTeams(i.blueTeam.filterTeams),this.redTeam=new I(1),this.redTeam.name=i.redTeam.name,this.redTeam.setFilterOrganizations(i.redTeam.filterOrganizations),this.redTeam.setFilterTeams(i.redTeam.filterTeams)}}class k{constructor(){this.id="",this.name=new _,this.teams=[],this.rank=-1}reset(){this.rank=-1}static compare(t,i){return t.id<i.id?-1:t.id>i.id?1:0}}class Rt{constructor(){this.teamSolvedNum=[],this.teamSolvedNumIndex=[],this.maxSolvedProblems=0,this.effectiveTeamNum=0,this.totalTeamNum=0}reset(){this.teamSolvedNum=[],this.teamSolvedNumIndex=[],this.maxSolvedProblems=0,this.effectiveTeamNum=0,this.totalTeamNum=0}getTeamSolvedNumIndex(t){return this.teamSolvedNumIndex[t]??0}}class gt{constructor(){this.enableFilterSubmissionsByTimestamp=!1,this.width=0,this.timestamp=0,this.enableFilterTeamsByGroup=!1,this.group="all",this.filterOrganizations=[],this.filterOrganizationMap=new Map,this.filterTeams=[],this.filterTeamMap=new Map,this.enableAnimatedSubmissions=!1,this.battleOfGiants=new Tt}setSelf(t){this.enableFilterSubmissionsByTimestamp=t.enableFilterSubmissionsByTimestamp,this.width=t.width,this.timestamp=t.timestamp,this.enableFilterTeamsByGroup=t.enableFilterTeamsByGroup,this.group=t.group,this.filterOrganizations=t.filterOrganizations,this.filterOrganizationMap=t.filterOrganizationMap,this.filterTeams=t.filterTeams,this.filterTeamMap=t.filterTeamMap,this.enableAnimatedSubmissions=t.enableAnimatedSubmissions,this.battleOfGiants=t.battleOfGiants}setWidth(t,i){this.width=t,this.timestamp=Math.floor((i.getEndTime().unix()-i.getStartTime().unix())*this.width*1e-4),this.enableFilterSubmissionsByTimestamp=!0}disableFilterSubmissionByTimestamp(){this.enableFilterSubmissionsByTimestamp=!1}setGroup(t){this.group=t,this.enableFilterTeamsByGroup=!0,this.group==="all"&&this.disableFilterTeamsByGroup()}disableFilterTeamsByGroup(){this.enableFilterTeamsByGroup=!1,this.group="all"}setFilterOrganizations(t){const i=new Map;t.forEach(s=>{i.set(s.value,s)}),this.filterOrganizations=t,this.filterOrganizationMap=i}setFilterTeams(t){const i=new Map;t.forEach(s=>{i.set(s.value,s)}),this.filterTeams=t,this.filterTeamMap=i}isNeedReBuildRank(t){return this.enableFilterSubmissionsByTimestamp!==t.enableFilterSubmissionsByTimestamp||this.width!==t.width||this.timestamp!==t.timestamp||this.enableFilterTeamsByGroup!==t.enableFilterTeamsByGroup||this.group!==t.group}}class Ot{constructor(t,i,s){this.contest=t,this.teams=f.cloneDeep(i),this.teamsMap=new Map(this.teams.map(n=>[n.id,n])),this.submissions=f.cloneDeep(s).sort(b.compare);{const n=this.contest.options,r=f.cloneDeep(n.submissionTimestampUnit);this.submissions.forEach(l=>{l.timestampUnit=r,l.time&&(n.submissionHasTimeField=!0),l.language&&(n.submissionHasLanguageField=!0)})}this.submissionsMap=new Map(this.submissions.map(n=>[n.id,n])),this.organizationsMap=this.buildOrganizationsMap(),this.organizations=[...this.organizationsMap.values()],this.organizations.sort(k.compare),this.originTeams=this.teams.map(n=>n),this.originTeams.sort(p.compare),this.rankStatistics=new Rt,this.options=new gt,this.balloons=[];{const n=new Set;this.submissions.forEach(r=>{r.language&&n.add(r.language)}),this.languages=[...n].sort()}{const n=new Set;this.submissions.forEach(r=>{n.add(r.status)}),this.statuses=[...n].sort()}}buildOrganizationsMap(){if(!this.contest.organization)return new Map;const t=new Map;return this.teams.forEach(i=>{if(!i.organizationId)return;if(t.has(i.organizationId)){const n=t.get(i.organizationId);n?.teams.push(i),i.organization=n;return}const s=new k;s.id=i.organizationId,s.name=new _,s.name.fallback=i.organizationName,s.teams.push(i),i.organization=s,t.set(s.id,s)}),t}cleanRank(){(()=>{this.teams=[];for(const[t,i]of this.teamsMap)this.filterTeamByOrg(i)||this.teams.push(i)})();for(const t of this.organizations)t.reset();for(const t of this.teams)t.reset(),t.problemStatistics=this.contest.problems.map(i=>{const s=new Q;return s.problem=i,s.contestPenalty=this.contest.penalty,s}),t.problemStatisticsMap=new Map(t.problemStatistics.map(i=>[i.problem.id,i]));this.contest.problems.forEach(t=>{t.statistics.reset()})}buildRank(){return(()=>{this.cleanRank(),this.teams.forEach(s=>s.placeChartPoints.push({timePoint:0,rank:1,lastSolvedProblem:null})),this.rankStatistics.reset(),this.rankStatistics.teamSolvedNum=Array.from({length:this.contest.problems.length+1}).fill(0),this.rankStatistics.teamSolvedNumIndex=Array.from({length:this.contest.problems.length+1}).fill(0);let t=0;const i=this.getSubmissions();for(let s=0;s<i.length;s++){const n=i[s],r=n.teamId,l=n.problemId,m=this.teamsMap.get(r),c=this.contest.problemsMap.get(l);(()=>{if(m===void 0||this.filterTeamByOrg(m)||c===void 0)return;const o=m.problemStatisticsMap.get(l);if(o.submissions.push(n),m.submissions.push(n),c.statistics.submittedNum++,o.isSolved){n.isSolved=!1,n.isFirstSolved=!1;return}if(n.isIgnore||n.isNotCalculatedPenaltyStatus()){c.statistics.ignoreNum++,o.ignoreCount++;return}if(o.isSubmitted=!0,o.lastSubmitTimestamp=n.timestampToSecond,o.totalCount++,n.isAccepted()){for(n.isSolved=!0,o.isSolved=!0,o.solvedTimestamp=n.timestampToSecond,c.statistics.acceptedNum++,c.statistics.attemptedNum+=o.failedCount+1,(c.statistics.firstSolveSubmissions.length===0||c.statistics.firstSolveSubmissions[c.statistics.firstSolveSubmissions.length-1].timestamp===n.timestamp)&&(n.isFirstSolved=!0,o.isFirstSolved=!0,c.statistics.firstSolveSubmissions.push(n));c.statistics.lastSolveSubmissions.length>0;)c.statistics.lastSolveSubmissions.pop();c.statistics.lastSolveSubmissions.push(n),m.lastSolvedProblem=c,m.lastSolvedProblemStatistics=o}n.isRejected()&&(o.failedCount++,c.statistics.rejectedNum++),n.isPending()&&(o.pendingCount++,c.statistics.pendingNum++)})(),(n.timestampToMinute>t||s===i.length-1)&&(this.teams.forEach(o=>o.calcSolvedData(this.contest.options)),this.teams.sort(p.compare),this.buildTeamRank(),this.teams.forEach(o=>o.placeChartPoints.push({timePoint:n.timestampToMinute,rank:o.rank,lastSolvedProblem:o.lastSolvedProblem}))),t=n.timestampToMinute}this.teams.forEach(s=>s.calcSolvedData(this.contest.options)),this.teams.sort(p.compare),this.buildTeamRank(),this.buildOrgRank(),this.rankStatistics.effectiveTeamNum=this.teams.filter(s=>s.isEffectiveTeam).length,this.rankStatistics.totalTeamNum=this.teams.length,this.teams.forEach(s=>s.calcSE(this.rankStatistics.totalTeamNum)),this.contest.problems.forEach(s=>s.statistics.calcSE(this.rankStatistics.totalTeamNum)),this.buildAwards(),this.teams.forEach(s=>s.calcAwards(this.contest.awards?.get(this.options.group))),this.teams.forEach(s=>s.postProcessPlaceChartPoints())})(),(()=>{for(const t of this.teams)this.rankStatistics.teamSolvedNum[t.solvedProblemNum]++;{let t=0;const i=this.rankStatistics.teamSolvedNum,s=this.rankStatistics.teamSolvedNumIndex;for(let n=s.length-1;n>=0;n--)t+=i[n]>0?1:0,s[n]=t}this.teams.length>0&&(this.rankStatistics.maxSolvedProblems=this.teams[0].solvedProblemNum)})(),this}buildTeamRank(){let t=1,i=1,s=null;for(const n of this.teams)n.rank=t++,n.originalRank=i++,s!==null&&n.isEqualRank(s)&&(n.rank=s.rank),s=n}buildOrgRank(){if(!this.contest.organization)return;let t=1,i=null;for(const s of this.teams){const n=s.organization;!n||n.rank>-1||(n.rank=t++,s.isFirstRankOfOrganization=!0,i&&s.isEqualRank(i)&&(n.rank=i.organization.rank),i=s)}}buildAwards(){if(this.contest.medal==="ccpc"){this.contest.awards=new Map;const t=this.rankStatistics.effectiveTeamNum,i=[],s=new R,n=new R,r=new R,l=new R;s.medalType=T.GOLD,s.minRank=1,s.maxRank=Math.ceil(t*.1),s.maxRank>=s.minRank&&i.push(s),n.medalType=T.SILVER,n.minRank=s.maxRank+1,n.maxRank=Math.ceil(t*.3),n.maxRank>=n.minRank&&i.push(n),r.medalType=T.BRONZE,r.minRank=n.maxRank+1,r.maxRank=Math.ceil(t*.6),r.maxRank>=r.minRank&&i.push(r),l.medalType=T.HONORABLE,l.minRank=r.maxRank+1,this.teams.forEach(m=>{m.solvedProblemNum>0&&(l.maxRank=Math.max(l.maxRank,m.rank))}),l.maxRank>=l.minRank&&i.push(l),this.contest.awards.set("official",i)}}filterTeamByOrg(t){const i=this.options;return!!(i.enableFilterTeamsByGroup&&!t.group?.includes(i.group))}getSubmissions(){return this.contest.replayContestStartTimestamp===void 0&&this.options.enableFilterSubmissionsByTimestamp===!1?this.submissions:this.submissions.filter(t=>!(this.contest.replayContestStartTimestamp!==void 0&&t.timestampToSecond>this.contest.replayContestStartTimestamp||this.options.enableFilterSubmissionsByTimestamp&&t.timestampToSecond>this.options.timestamp))}buildBalloons(){this.balloons=[],this.cleanRank();const t=this.getSubmissions();for(let i=0;i<t.length;i++){const s=t[i],n=s.teamId,r=s.problemId,l=this.teamsMap.get(n),m=this.contest.problemsMap.get(r);(()=>{if(l===void 0||m===void 0)return;const c=l.problemStatisticsMap.get(r);if(!c.isSolved&&s.isAccepted()){c.isSolved=!0,c.solvedTimestamp=s.timestampToSecond;const o=new at;o.team=l,o.problem=m,o.submission=s,this.balloons.push(o)}})()}}setReplayTime(t){this.contest.setReplayTime(t)}}export{at as B,pt as G,Ot as R,a as S,p as T,Pt as a,nt as b,At as c,st as d,Ct as e,b as f,it as g,Dt as h,et as i,gt as j};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{I as fi,c as Un,d as Xr,g as Pf}from"./dayjs-
|
|
1
|
+
import{I as fi,c as Un,d as Xr,g as Pf}from"./dayjs-DHI77Sx3.js";import{P as Qr,K as bp,i as mp,H as vp,at as wp,au as yp,av as Vr,N as xp,C as Ap,aw as Tp,ax as No}from"./index-C_1CeIsX.js";var je=(i=>(i.UNKNOWN="Unknown",i.GOLD="Gold",i.SILVER="Silver",i.BRONZE="Bronze",i.HONORABLE="Honorable",i))(je||{});class ko{constructor(){this.medalType="Unknown",this.minRank=0,this.maxRank=0}}function W_(i){return["Gold","Silver","Bronze","Honorable"].includes(i)}var nr={exports:{}};/**
|
|
2
2
|
* @license
|
|
3
3
|
* Lodash <https://lodash.com/>
|
|
4
4
|
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
package/dist/index.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!doctype html><html lang="en-US" dir="ltr"><head><meta charset="UTF-8"/><title>Board - XCPCIO</title><script>!function(e,t,a,n){e[n]=e[n]||[],e[n].push({"gtm.start":(new Date).getTime(),event:"gtm.js"});var g=t.getElementsByTagName(a)[0],m=t.createElement(a);m.async=!0,m.src="https://www.googletagmanager.com/gtm.js?id=GTM-WHLF55BJ",g.parentNode.insertBefore(m,g)}(window,document,"script","dataLayer")</script><link rel="icon" href="https://cdn.jsdelivr.net/npm/@xcpcio/board-app@0.
|
|
1
|
+
<!doctype html><html lang="en-US" dir="ltr"><head><meta charset="UTF-8"/><title>Board - XCPCIO</title><script>!function(e,t,a,n){e[n]=e[n]||[],e[n].push({"gtm.start":(new Date).getTime(),event:"gtm.js"});var g=t.getElementsByTagName(a)[0],m=t.createElement(a);m.async=!0,m.src="https://www.googletagmanager.com/gtm.js?id=GTM-WHLF55BJ",g.parentNode.insertBefore(m,g)}(window,document,"script","dataLayer")</script><link rel="icon" href="https://cdn.jsdelivr.net/npm/@xcpcio/board-app@0.75.1/dist/balloon-512x512.svg" type="image/svg+xml"/><link rel="mask-icon" href="https://cdn.jsdelivr.net/npm/@xcpcio/board-app@0.75.1/dist/balloon-512x512.svg" color="#00aba9"/><link rel="apple-touch-icon" href="https://cdn.jsdelivr.net/npm/@xcpcio/board-app@0.75.1/dist/balloon-192x192.png"/><meta name="msapplication-TileColor" content="#00aba9"/><meta name="author" content="Dup4"/><meta name="title" content="Board - XCPCIO"/><meta name="description" content="The ICPC Series Competition Leaderboard Visualization Engine."/><meta name="keywords" content="ICPC, Rank, Board, Leaderboard, ScoreBoard, Standings"/><meta property="og:site_name" content="XCPCIO"/><meta property="og:title" content="Board - XCPCIO"/><meta property="og:description" content="The ICPC Series Competition Leaderboard Visualization Engine."/><meta property="og:type" content="website"/><meta property="og:image" content="https://xcpcio.com/og.png"/><meta property="og:image:type" content="image/png"/><meta property="og:image:width" content="1200"/><meta property="og:image:height" content="630"/><meta name="twitter:title" content="Board - XCPCIO"/><meta name="twitter:description" content="The ICPC Series Competition Leaderboard Visualization Engine."/><meta name="twitter:card" content="summary_large_image"/><meta name="twitter:image" content="https://xcpcio.com/og.png"/><script>function normalizePath(_){for(;_.endsWith("/");)_=_.slice(0,-1);return`${_}/`}{let _="https://cdn.jsdelivr.net/npm/@xcpcio/board-app@0.75.1/dist";_=normalizePath(_),window.CDN_HOST=_,window.__toAssetUrl=_=>window.CDN_HOST+_}try{let _=__DATA_HOST__;_=normalizePath(_),window.DATA_HOST=_}catch(_){window.DATA_HOST="/data/"}try{let _=__DATA_REGION__;window.DATA_REGION=_}catch(_){window.DATA_REGION="CN"}try{let _=__DEFAULT_LANG__;window.DEFAULT_LANG=_}catch(_){window.DEFAULT_LANG="en"}try{window.REFETCH_INTERVAL=Number(__REFETCH_INTERVAL__)}catch(_){window.REFETCH_INTERVAL=15e3}</script><script>!function(){localStorage.getItem("vueuse-color-scheme")||localStorage.setItem("vueuse-color-scheme","light");const e=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches,o=localStorage.getItem("vueuse-color-scheme")||"auto";("dark"===o||e&&"light"!==o)&&document.documentElement.classList.toggle("dark",!0)}()</script><script type="module" crossorigin src="https://cdn.jsdelivr.net/npm/@xcpcio/board-app@0.75.1/dist/assets/index-C_1CeIsX.js"></script><link rel="stylesheet" crossorigin href="https://cdn.jsdelivr.net/npm/@xcpcio/board-app@0.75.1/dist/assets/index-B1MSy4n9.css"></head><body class="font-sans"><noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-WHLF55BJ" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript><div id="app"></div><noscript>This website requires JavaScript to function properly. Please enable JavaScript to continue.</noscript><script>try{var umamiJSUrl=__UMAMI_JS_URL__,umamiWebsiteId=__UMAMI_WEBSITE_ID__;!function(){var e=document.createElement("script");e.src=umamiJSUrl,e.defer=!0,e.setAttribute("data-website-id",umamiWebsiteId);var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)}()}catch(e){}try{var baiduAnalyticsId=__BAIDU_ANALYTICS_ID__,_hmt=_hmt||[];!function(){var e=document.createElement("script");e.src=`https://hm.baidu.com/hm.js?${baiduAnalyticsId}`;var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)}()}catch(e){}</script></body></html>
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xcpcio/board-app",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.75.1",
|
|
5
5
|
"description": "The ICPC Series Competition Leaderboard Visualization Engine",
|
|
6
6
|
"author": "Dup4 <hi@dup4.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
"vue-router": "^4.6.3",
|
|
54
54
|
"vue-search-select": "^3.2.0",
|
|
55
55
|
"vue-toast-notification": "^3.1.3",
|
|
56
|
-
"@xcpcio/core": "0.
|
|
57
|
-
"@xcpcio/types": "0.
|
|
56
|
+
"@xcpcio/core": "0.75.1",
|
|
57
|
+
"@xcpcio/types": "0.75.1"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@iconify/json": "^2.2.401",
|
|
@@ -18,7 +18,6 @@ const contestData = ref({} as Contest);
|
|
|
18
18
|
const teamsData = ref([] as Teams);
|
|
19
19
|
const submissionsData = ref([] as Submissions);
|
|
20
20
|
const rank = ref({} as Rank);
|
|
21
|
-
const now = useNow();
|
|
22
21
|
|
|
23
22
|
function reBuildBalloons() {
|
|
24
23
|
const newRank = new Rank(contestData.value, teamsData.value, submissionsData.value);
|
|
@@ -26,7 +25,7 @@ function reBuildBalloons() {
|
|
|
26
25
|
rank.value = newRank;
|
|
27
26
|
}
|
|
28
27
|
|
|
29
|
-
const { data, isError, error } = useQueryBoardData(props.dataSourceUrl
|
|
28
|
+
const { data, isError, error } = useQueryBoardData(props.dataSourceUrl);
|
|
30
29
|
watch(data, async () => {
|
|
31
30
|
if (data.value === null || data.value === undefined) {
|
|
32
31
|
return;
|
|
@@ -16,7 +16,7 @@ const now = useNow();
|
|
|
16
16
|
const contest = ref({} as Contest);
|
|
17
17
|
const firstLoaded = ref(false);
|
|
18
18
|
|
|
19
|
-
const { data, isError, error } = useQueryBoardData(props.dataSourceUrl
|
|
19
|
+
const { data, isError, error } = useQueryBoardData(props.dataSourceUrl);
|
|
20
20
|
watch(data, async () => {
|
|
21
21
|
if (data.value === null || data.value === undefined) {
|
|
22
22
|
return;
|
|
@@ -23,7 +23,6 @@ const contest = ref({} as Contest);
|
|
|
23
23
|
const teams = ref([] as Teams);
|
|
24
24
|
const submissions = ref([] as Submissions);
|
|
25
25
|
const resolver = ref({} as ResolverVue);
|
|
26
|
-
const now = useNow();
|
|
27
26
|
|
|
28
27
|
function reBuildResolver() {
|
|
29
28
|
const newResolver = new ResolverVue(contest.value, teams.value, submissions.value);
|
|
@@ -31,7 +30,7 @@ function reBuildResolver() {
|
|
|
31
30
|
resolver.value = newResolver;
|
|
32
31
|
}
|
|
33
32
|
|
|
34
|
-
const { data, isError, error } = useQueryBoardData(props.dataSourceUrl,
|
|
33
|
+
const { data, isError, error } = useQueryBoardData(props.dataSourceUrl, /* queryOnce= */true);
|
|
35
34
|
watch(data, async () => {
|
|
36
35
|
if (data.value === null || data.value === undefined) {
|
|
37
36
|
return;
|
|
@@ -94,7 +94,7 @@ function updateContestName() {
|
|
|
94
94
|
title.value = `${contestName.value} | ${TITLE_SUFFIX}`;
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
const { data, isError, error, refetch } = useQueryBoardData(props.dataSourceUrl ?? route.path
|
|
97
|
+
const { data, isError, error, refetch } = useQueryBoardData(props.dataSourceUrl ?? route.path);
|
|
98
98
|
watch(data, async () => {
|
|
99
99
|
if (data.value === null || data.value === undefined) {
|
|
100
100
|
return;
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import type { Contest, Submissions, Teams } from "@xcpcio/types";
|
|
2
2
|
import { useQuery } from "@tanstack/vue-query";
|
|
3
|
-
import { DATA_REGION } from "./constant";
|
|
4
|
-
|
|
5
|
-
const RETRY = 3;
|
|
6
3
|
|
|
7
4
|
export interface BoardData {
|
|
8
5
|
contest: Contest;
|
|
@@ -10,7 +7,7 @@ export interface BoardData {
|
|
|
10
7
|
submissions: Submissions;
|
|
11
8
|
}
|
|
12
9
|
|
|
13
|
-
async function
|
|
10
|
+
async function fetch_board_data(target: string): Promise<BoardData> {
|
|
14
11
|
const endpoint = target.startsWith("/") ? target.slice(1) : target;
|
|
15
12
|
let prefix = `${window.DATA_HOST}${endpoint}`;
|
|
16
13
|
const options = {
|
|
@@ -30,16 +27,12 @@ async function fetcher(target: string, timestamp?: number): Promise<BoardData> {
|
|
|
30
27
|
prefix = prefix.slice(0, -1);
|
|
31
28
|
}
|
|
32
29
|
|
|
33
|
-
const addTimestamp = (url: string) => {
|
|
34
|
-
return url.includes("?") ? `${url}&t=${timestamp ?? 0}` : `${url}?t=${timestamp ?? 0}`;
|
|
35
|
-
};
|
|
36
|
-
|
|
37
30
|
const res = options.allInOne
|
|
38
|
-
? [await fetch(
|
|
31
|
+
? [await fetch(prefix)]
|
|
39
32
|
: [
|
|
40
|
-
await fetch(
|
|
41
|
-
await fetch(
|
|
42
|
-
await fetch(
|
|
33
|
+
await fetch(`${prefix}/config.json`),
|
|
34
|
+
await fetch(`${prefix}/team.json`),
|
|
35
|
+
await fetch(`${prefix}/run.json`),
|
|
43
36
|
];
|
|
44
37
|
|
|
45
38
|
const { status, statusText } = res[0];
|
|
@@ -60,25 +53,19 @@ async function fetcher(target: string, timestamp?: number): Promise<BoardData> {
|
|
|
60
53
|
return p;
|
|
61
54
|
}
|
|
62
55
|
|
|
63
|
-
export function useQueryBoardData(target: string,
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
if (DATA_REGION.value === "I18N") {
|
|
69
|
-
staleTime = 10 * 1000;
|
|
70
|
-
refetchInterval = staleTime;
|
|
71
|
-
}
|
|
56
|
+
export function useQueryBoardData(target: string, queryOnce = false) {
|
|
57
|
+
const retry = 3;
|
|
58
|
+
const staleTime = 30_000;
|
|
59
|
+
let refetchInterval: number | false = window.REFETCH_INTERVAL;
|
|
72
60
|
|
|
73
61
|
if (queryOnce) {
|
|
74
|
-
staleTime = Number.POSITIVE_INFINITY;
|
|
75
62
|
refetchInterval = false;
|
|
76
63
|
}
|
|
77
64
|
|
|
78
65
|
return useQuery({
|
|
79
|
-
queryKey: [target
|
|
80
|
-
queryFn: () =>
|
|
81
|
-
retry
|
|
66
|
+
queryKey: [target],
|
|
67
|
+
queryFn: () => fetch_board_data(target),
|
|
68
|
+
retry,
|
|
82
69
|
staleTime,
|
|
83
70
|
refetchInterval,
|
|
84
71
|
});
|
package/src/shims.d.ts
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as C,h as i,m as c,p as N,f as D,c as n,o as t,q as j,u as e,n as O,b as o,I as B,t as d,A as F,C as I,F as V,E as z,G as R,s as U}from"./index-Cl8ui4U3.js";import{B as w}from"./constant-hbYXej-M.js";import{c as A,a as q,B as G,R as M}from"./rank-CmURXpVL.js";import{c as Q}from"./use-vmodel-B-AJYPXB.js";import{u as X}from"./TheInput.vue_vue_type_script_setup_true_lang-4EASslBu.js";const H={flex:"","flex-1":"","flex-col":"","justify-center":"","items-start":""},J={class:"resolver-team-name",truncate:"","overflow-hidden":""},K={"w-32":"",flex:"","flex-shrink-0":"","flex-row":"","justify-start":"","items-center":""},P=C({__name:"BalloonBlock",props:{index:null,balloon:null},setup(p){const f=p,b=i(()=>f.index),a=i(()=>f.balloon),v=c(null),y=N(v),{locale:_}=D(),s=i(()=>_.value);function x(l){return[l.location,l.organization?.name.getOrDefault(s.value),l.name.getOrDefault(s.value)].filter(g=>g).join(" - ")}const u=i(()=>a.value.problem.balloonColor);return(l,m)=>(t(),n("div",{ref_key:"el",ref:v,"h-24":""},[e(y)?(t(),n("div",{key:0,"h-24":"",flex:"","flex-row":"","gap-x-4":"","font-mono":"","text-4xl":"",class:O([e(b)%2===0?"bg-resolver-bg-0":"bg-resolver-bg-1"])},[o("div",{"w-20":"",flex:"","flex-shrink-0":"","justify-center":"","items-center":"",style:B({backgroundColor:e(u).background_color})},[o("div",{style:B({color:e(u).color})},d(e(a).problem.label),5)],4),o("div",H,[o("div",J,d(x(e(a).team)),1),m[0]||(m[0]=o("div",{flex:"","flex-row":"","text-sm":"","items-start":"","gap-x-2":""},null,-1))]),o("div",K,d(e(a).submission.timestampToMinute),1)],2)):j("",!0)],512))}}),W={class:"bg-[#323443]","text-gray-200":"","w-screen":"","h-screen":""},Y={key:0},Z={flex:"","flex-col":"","justify-center":"","items-center":"","w-screen":"","h-screen":"","text-xl":"",italic:""},ee={key:0},oe={key:1},te={flex:"","flex-col":"","justify-between":""},ie=C({__name:"Balloon",props:{dataSourceUrl:null},setup(p){const f=p,b=F(w),{t:a,locale:v}=D(),y=i(()=>v.value),_=c(!1),s=c({}),x=c([]),u=c([]),l=c({}),m=U();function g(){const h=new M(s.value,x.value,u.value);h.buildBalloons(),l.value=h}const{data:r,isError:S,error:T}=X(f.dataSourceUrl,m);I(r,async()=>{r.value===null||r.value===void 0||(s.value=Q(r.value?.contest),b.value=`${s.value.name.getOrDefault(y.value)} | ${w}`,x.value=A(r.value?.teams),u.value=q(r.value?.submissions,s.value),g(),_.value=!0)},{immediate:!0});const $=i(()=>l.value.balloons.sort(G.compare).reverse().slice(0,256));return(h,se)=>{const E=P;return t(),n("div",W,[e(_)?(t(),n("div",oe,[o("div",te,[(t(!0),n(V,null,z(e($),(k,L)=>(t(),R(E,{key:k.key,index:L,balloon:k},null,8,["index","balloon"]))),128))])])):(t(),n("div",Y,[o("div",Z,[o("div",null,d(e(a)("common.loading"))+"... ",1),e(S)?(t(),n("div",ee,d(e(T)),1)):j("",!0)])]))])}}});export{ie as _};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.PENDING[data-v-22f76880]{color:#3bb4f2}.RUNNING[data-v-22f76880]{color:#5eb95e}.FROZEN[data-v-22f76880]{color:#dd514c}.FINISHED[data-v-22f76880]{color:#0e90d2}.PAUSED[data-v-22f76880]{color:#3bb4f2}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as h,j as y}from"./use-vmodel-B-AJYPXB.js";import{e as S,f as k,h as N,A as w,m as l,C as T,c as o,o as n,u as t,b as a,q as D,t as c,n as d,s as E}from"./index-Cl8ui4U3.js";import{c as u}from"./constant-hbYXej-M.js";import{u as I}from"./TheInput.vue_vue_type_script_setup_true_lang-4EASslBu.js";import{_ as B}from"./_plugin-vue_export-helper-DlAUqK2U.js";const U={class:"bg-[#323443]","text-gray-200":"","w-screen":"","h-screen":""},j={key:0},O={flex:"","flex-col":"","justify-center":"","items-center":"","w-screen":"","h-screen":"","text-xl":"",italic:""},b={key:0},F={key:1},L={flex:"","flex-col":"","items-center":"","justify-center":"","font-mono":""},P={key:0},V={key:1},$=S({__name:"Countdown",props:{dataSourceUrl:null},setup(_){const m=_,{t:f,locale:v}=k(),p=N(()=>v.value),g=w(u),s=E(),e=l({}),i=l(!1),{data:r,isError:x,error:C}=I(m.dataSourceUrl,s);return T(r,async()=>{r.value===null||r.value===void 0||(e.value=h(r.value?.contest),g.value=`${e.value.name.getOrDefault(p.value)} | ${u}`,i.value=!0)},{immediate:!0}),(q,z)=>(n(),o("div",U,[t(i)?(n(),o("div",F,[a("div",L,[a("div",{"mt-20":"","text-6xl":"",class:d([t(e).getContestState(t(s)).toString()])},c(t(e).getContestState(t(s))),3),a("div",{"mt-20":"",class:d(["text-[320px]",[t(e).getContestState(t(s)).toString()]])},[t(e).getContestState(t(s))===t(y).PENDING?(n(),o("div",P,c(t(e).getContestPendingTime(t(s))),1)):(n(),o("div",V,c(t(e).getContestElapsedTime(t(s))),1))],2)])])):(n(),o("div",j,[a("div",O,[a("div",null,c(t(f)("common.loading"))+"... ",1),t(x)?(n(),o("div",b,c(t(C)),1)):D("",!0)])]))]))}}),H=B($,[["__scopeId","data-v-22f76880"]]);export{H as _};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a2 as W,a3 as F,a4 as f,a5 as Q,a6 as w,a7 as B,a8 as k,a9 as M,aa as z,ab as T,ac as H,ad as K,ae as j,af as Y,ag as G,ah as J,ai as X,h as N,aj as Z,ak as q,al as tt,C as x,am as A,an as et,ao as $,ap as st,aq as it,ar as nt,e as at,v as rt,as as ot,u as ht,c as lt,o as ut,y as ct,z as dt}from"./index-Cl8ui4U3.js";import{b as ft}from"./constant-hbYXej-M.js";import{_ as pt}from"./use-vmodel-B-AJYPXB.js";var vt=class extends W{constructor(t,e){super(),this.options=e,this.#s=t,this.#n=null,this.#i=F(),this.bindMethods(),this.setOptions(e)}#s;#t=void 0;#p=void 0;#e=void 0;#r;#u;#i;#n;#v;#c;#d;#o;#h;#a;#f=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),L(this.#t,this.options)?this.#l():this.updateResult(),this.#R())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return D(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return D(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#g(),this.#O(),this.#t.removeObserver(this)}setOptions(t){const e=this.options,i=this.#t;if(this.options=this.#s.defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof f(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#w(),this.#t.setOptions(this.options),e._defaulted&&!Q(this.options,e)&&this.#s.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const s=this.hasListeners();s&&V(this.#t,i,this.options,e)&&this.#l(),this.updateResult(),s&&(this.#t!==i||f(this.options.enabled,this.#t)!==f(e.enabled,this.#t)||w(this.options.staleTime,this.#t)!==w(e.staleTime,this.#t))&&this.#m();const n=this.#b();s&&(this.#t!==i||f(this.options.enabled,this.#t)!==f(e.enabled,this.#t)||n!==this.#a)&&this.#y(n)}getOptimisticResult(t){const e=this.#s.getQueryCache().build(this.#s,t),i=this.createResult(e,t);return bt(this,i)&&(this.#e=i,this.#u=this.options,this.#r=this.#t.state),i}getCurrentResult(){return this.#e}trackResult(t,e){return new Proxy(t,{get:(i,s)=>(this.trackProp(s),e?.(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#i.status==="pending"&&this.#i.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(i,s))})}trackProp(t){this.#f.add(t)}getCurrentQuery(){return this.#t}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=this.#s.defaultQueryOptions(t),i=this.#s.getQueryCache().build(this.#s,e);return i.fetch().then(()=>this.createResult(i,e))}fetch(t){return this.#l({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#e))}#l(t){this.#w();let e=this.#t.fetch(this.options,t);return t?.throwOnError||(e=e.catch(B)),e}#m(){this.#g();const t=w(this.options.staleTime,this.#t);if(k||this.#e.isStale||!M(t))return;const i=z(this.#e.dataUpdatedAt,t)+1;this.#o=T.setTimeout(()=>{this.#e.isStale||this.updateResult()},i)}#b(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#y(t){this.#O(),this.#a=t,!(k||f(this.options.enabled,this.#t)===!1||!M(this.#a)||this.#a===0)&&(this.#h=T.setInterval(()=>{(this.options.refetchIntervalInBackground||H.isFocused())&&this.#l()},this.#a))}#R(){this.#m(),this.#y(this.#b())}#g(){this.#o&&(T.clearTimeout(this.#o),this.#o=void 0)}#O(){this.#h&&(T.clearInterval(this.#h),this.#h=void 0)}createResult(t,e){const i=this.#t,s=this.options,n=this.#e,r=this.#r,l=this.#u,m=t!==i?t.state:this.#p,{state:g}=t;let a={...g},C=!1,h;if(e._optimisticResults){const c=this.hasListeners(),I=!c&&L(t,e),R=c&&V(t,i,e,s);(I||R)&&(a={...a,...K(g.data,t.options)}),e._optimisticResults==="isRestoring"&&(a.fetchStatus="idle")}let{error:o,errorUpdatedAt:v,status:d}=a;h=a.data;let O=!1;if(e.placeholderData!==void 0&&h===void 0&&d==="pending"){let c;n?.isPlaceholderData&&e.placeholderData===l?.placeholderData?(c=n.data,O=!0):c=typeof e.placeholderData=="function"?e.placeholderData(this.#d?.state.data,this.#d):e.placeholderData,c!==void 0&&(d="success",h=j(n?.data,c,e),C=!0)}if(e.select&&h!==void 0&&!O)if(n&&h===r?.data&&e.select===this.#v)h=this.#c;else try{this.#v=e.select,h=e.select(h),h=j(n?.data,h,e),this.#c=h,this.#n=null}catch(c){this.#n=c}this.#n&&(o=this.#n,h=this.#c,v=Date.now(),d="error");const b=a.fetchStatus==="fetching",y=d==="pending",E=d==="error",U=y&&b,_=h!==void 0,p={status:d,fetchStatus:a.fetchStatus,isPending:y,isSuccess:d==="success",isError:E,isInitialLoading:U,isLoading:U,data:h,dataUpdatedAt:a.dataUpdatedAt,error:o,errorUpdatedAt:v,failureCount:a.fetchFailureCount,failureReason:a.fetchFailureReason,errorUpdateCount:a.errorUpdateCount,isFetched:a.dataUpdateCount>0||a.errorUpdateCount>0,isFetchedAfterMount:a.dataUpdateCount>m.dataUpdateCount||a.errorUpdateCount>m.errorUpdateCount,isFetching:b,isRefetching:b&&!y,isLoadingError:E&&!_,isPaused:a.fetchStatus==="paused",isPlaceholderData:C,isRefetchError:E&&_,isStale:P(t,e),refetch:this.refetch,promise:this.#i,isEnabled:f(e.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const c=S=>{p.status==="error"?S.reject(p.error):p.data!==void 0&&S.resolve(p.data)},I=()=>{const S=this.#i=p.promise=F();c(S)},R=this.#i;switch(R.status){case"pending":t.queryHash===i.queryHash&&c(R);break;case"fulfilled":(p.status==="error"||p.data!==R.value)&&I();break;case"rejected":(p.status!=="error"||p.error!==R.reason)&&I();break}}return p}updateResult(){const t=this.#e,e=this.createResult(this.#t,this.options);if(this.#r=this.#t.state,this.#u=this.options,this.#r.data!==void 0&&(this.#d=this.#t),Q(e,t))return;this.#e=e;const i=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,n=typeof s=="function"?s():s;if(n==="all"||!n&&!this.#f.size)return!0;const r=new Set(n??this.#f);return this.options.throwOnError&&r.add("error"),Object.keys(this.#e).some(l=>{const u=l;return this.#e[u]!==t[u]&&r.has(u)})};this.#C({listeners:i()})}#w(){const t=this.#s.getQueryCache().build(this.#s,this.options);if(t===this.#t)return;const e=this.#t;this.#t=t,this.#p=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#R()}#C(t){Y.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(this.#e)}),this.#s.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function mt(t,e){return f(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function L(t,e){return mt(t,e)||t.state.data!==void 0&&D(t,e,e.refetchOnMount)}function D(t,e,i){if(f(e.enabled,t)!==!1&&w(e.staleTime,t)!=="static"){const s=typeof i=="function"?i(t):i;return s==="always"||s!==!1&&P(t,e)}return!1}function V(t,e,i,s){return(t!==e||f(s.enabled,t)===!1)&&(!i.suspense||t.state.status!=="error")&&P(t,i)}function P(t,e){return f(e.enabled,t)!==!1&&t.isStaleByTime(w(e.staleTime,t))}function bt(t,e){return!Q(t.getCurrentResult(),e)}function yt(t=""){if(!G())throw new Error("vue-query hooks can only be used inside setup() function or functions that support injection context.");const e=X(t),i=J(e);if(!i)throw new Error("No 'queryClient' found in Vue context, use 'VueQueryPlugin' to properly initialize the library.");return i}function Rt(t,e,i){const s=yt(),n=N(()=>{const o=Z(e);typeof o.enabled=="function"&&(o.enabled=o.enabled());const v=s.defaultQueryOptions(o);return v._optimisticResults=s.isRestoring?.value?"isRestoring":"optimistic",v}),r=new t(s,n.value),l=n.value.shallow?q(r.getCurrentResult()):tt(r.getCurrentResult());let u=()=>{};s.isRestoring&&x(s.isRestoring,o=>{o||(u(),u=r.subscribe(v=>{A(l,v)}))},{immediate:!0});const m=()=>{r.setOptions(n.value),A(l,r.getCurrentResult())};x(n,m),et(()=>{u()});const g=(...o)=>(m(),l.refetch(...o)),a=()=>new Promise((o,v)=>{let d=()=>{};const O=()=>{if(n.value.enabled!==!1){r.setOptions(n.value);const b=r.getOptimisticResult(n.value);b.isStale?(d(),r.fetchOptimistic(n.value).then(o,y=>{$(n.value.throwOnError,[y,r.getCurrentQuery()])?v(y):o(r.getCurrentResult())})):(d(),o(b))}};O(),d=x(n,O)});x(()=>l.error,o=>{if(l.isError&&!l.isFetching&&$(n.value.throwOnError,[o,r.getCurrentQuery()]))throw o});const C=n.value.shallow?st(l):it(l),h=nt(C);for(const o in l)typeof l[o]=="function"&&(h[o]=l[o]);return h.suspense=a,h.refetch=g,h}function gt(t,e){return Rt(vt,t)}const Ot=3;async function wt(t,e){const i=t.startsWith("/")?t.slice(1):t;let s=`${window.DATA_HOST}${i}`;const n={allInOne:!1};if(s.includes("#")){const a=new URLSearchParams(s.split("#")[1]);n.allInOne=a.get("allInOne")==="true",s=s.split("#")[0]}t.startsWith("http")&&(s=t),s.endsWith("/")&&(s=s.slice(0,-1));const r=a=>a.includes("?")?`${a}&t=${e??0}`:`${a}?t=${e??0}`,l=n.allInOne?[await fetch(r(s))]:[await fetch(r(`${s}/config.json`)),await fetch(r(`${s}/team.json`)),await fetch(r(`${s}/run.json`))],{status:u,statusText:m}=l[0];if(u>=300||u<200)throw new Error(`fetch data failed. [status=${u}] [statusText=${m}]`);return Promise.all(l.map(a=>a.json())).then(a=>n.allInOne?a[0]:{contest:a[0],teams:a[1],submissions:a[2]})}function Et(t,e,i=!1){let s=3e4,n=s;const r=N(()=>Math.floor(e.value.getTime()/1e3/10));return ft.value==="I18N"&&(s=10*1e3,n=s),i&&(s=Number.POSITIVE_INFINITY,n=!1),gt({queryKey:[t,r.value],queryFn:()=>wt(t,r.value),retry:Ot,staleTime:s,refetchInterval:n})}const Ct=["type","text"],Qt=at({__name:"TheInput",props:{textAlign:null,textType:null,modelValue:null},emits:["update:modelValue"],setup(t){const e=t,{modelValue:i}=pt("modelValue");return(s,n)=>rt((ut(),lt("input",ct({id:"input","onUpdate:modelValue":n[0]||(n[0]=r=>dt(i)?i.value=r:null)},s.$attrs,{type:e.textType??"text",text:e.textAlign??"center",p:"x-4 y-2","w-full":"",bg:"transparent",border:"~ rounded gray-200 dark:gray-700",outline:"none active:none"}),null,16,Ct)),[[ot,ht(i)]])}});export{Qt as _,Et as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as t}from"./index-Cl8ui4U3.js";const a="0.74.2",c="https://github.com/xcpcio/xcpcio",T="9cdcbf511b",I="https://xcpcio.com",r="Board - XCPCIO",_="Rating - XCPCIO",O="Balloon - XCPCIO",C="Resolver - XCPCIO",i="Countdown - XCPCIO",A=t(()=>window?window.CDN_HOST:""),o=t(()=>window?window.DATA_HOST:""),d=t(()=>o.value.replace("/data/","/rating-data/")),e=t(()=>window?window.DATA_REGION:"");export{a as A,O as B,A as C,o as D,c as G,d as R,r as T,I as X,T as a,e as b,i as c,_ as d,C as e};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as r,a}from"./NavBar-DPNugPx9.js";import{_}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{c,o as s,a as o,b as m,r as p,F as i}from"./index-Cl8ui4U3.js";import"./Tooltip.vue_vue_type_script_setup_true_lang-DqsW-ncZ.js";import"./constant-hbYXej-M.js";const u={},l={"py-10":"","text-gray-700":"","dark:text-gray-200":""};function f(d,g){const e=r,t=p("RouterView"),n=a;return s(),c(i,null,[o(e),m("main",l,[o(t),o(n)])],64)}const F=_(u,[["render",f]]);export{F as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as p}from"./Resolver-Di5gzWKf.js";import{_ as l}from"./DataSourceInput.vue_vue_type_script_setup_true_lang-D_o9JwYS.js";import{b as d}from"./use-vmodel-B-AJYPXB.js";import{e as f,c as e,o as t,F as h,q as c,u as r,b as v,a as n}from"./index-Cl8ui4U3.js";import{b as a}from"./route-block-B_A1xBdJ.js";import{_ as k}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./rank-CmURXpVL.js";import"./dayjs-Crt-XxG9.js";import"./person-DeEVCAi-.js";import"./constant-hbYXej-M.js";import"./TheInput.vue_vue_type_script_setup_true_lang-4EASslBu.js";const x={key:0},b={"mt-20":""},g={key:1},y=f({__name:"CustomResolver",setup(m){const o=d();return(s,B)=>{const u=l,i=p;return t(),e(h,null,[r(o).length===0?(t(),e("div",x,[v("div",b,[n(u)])])):c("",!0),r(o).length>0?(t(),e("div",g,[n(i,{"data-source-url":r(o)},null,8,["data-source-url"])])):c("",!0)],64)}}}),_={};function C(m,o){const s=y;return t(),e("div",null,[n(s)])}typeof a=="function"&&a(_);const Q=k(_,[["render",C]]);export{Q as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as u}from"./Board-Czrq4DtS.js";import{_ as i}from"./DataSourceInput.vue_vue_type_script_setup_true_lang-D_o9JwYS.js";import{b as f}from"./use-vmodel-B-AJYPXB.js";import{e as l,c as e,o as t,a as n,q as d,u as a,F as B,G as k}from"./index-Cl8ui4U3.js";import{b as c}from"./route-block-B_A1xBdJ.js";import{_ as x}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./pagination-CeQCwn68.js";import"./Tooltip.vue_vue_type_script_setup_true_lang-DqsW-ncZ.js";import"./TheInput.vue_vue_type_script_setup_true_lang-4EASslBu.js";import"./constant-hbYXej-M.js";import"./rank-CmURXpVL.js";import"./dayjs-Crt-XxG9.js";import"./person-DeEVCAi-.js";import"./ContestStateBadge-BiHZXi73.js";const h={key:0},C=l({__name:"CustomBoard",setup(m){const o=f();return(r,g)=>{const _=i,p=u;return t(),e(B,null,[n(_),a(o).length>0?(t(),e("div",h,[n(p,{"data-source-url":a(o)},null,8,["data-source-url"])])):d("",!0)],64)}}}),s={};function b(m,o){const r=C;return t(),k(r)}typeof c=="function"&&c(s);const j=x(s,[["render",b]]);export{j as default};
|