export function isJudgeTaskEntry(_0x571a6d){return _0x571a6d?.['isJudgeTask']===!![]||_0x571a6d?.['taskType']==='judge'||_0x571a6d?.['task_type']==='judge';}export function getDisplayTaskVariants(_0x1ab3e3){if(!Array['isArray'](_0x1ab3e3))return[];const _0x446843=_0x1ab3e3['filter'](_0x5644b7=>!isJudgeTaskEntry(_0x5644b7));return _0x446843['length']>0x0?_0x446843:_0x1ab3e3;}export function getDisplayTaskVariantCount(_0x7f9eff){return getDisplayTaskVariants(_0x7f9eff)['length'];}export function isDisplayTaskGroup(_0x3debb7){return getDisplayTaskVariantCount(_0x3debb7)>0x1;}export function getAggregateTaskStatus(_0x57763e,{fallback:fallback='unknown'}={}){const _0x4a1c1f=Array['isArray'](_0x57763e)?_0x57763e['filter'](Boolean):[];if(_0x4a1c1f['length']===0x0)return fallback;const _0x4c257e=_0x4a1c1f['map'](_0x4fe0bb=>_0x4fe0bb?.['status']||'unknown'),_0x3d6b7d=_0x541a91=>_0x4c257e['every'](_0x20b25a=>_0x20b25a===_0x541a91),_0x1e1ef1=_0x4203f1=>_0x4c257e['some'](_0x183df8=>_0x183df8===_0x4203f1),_0x3c2067=_0x1e1ef1('failed')&&(_0x1e1ef1('completed')||_0x1e1ef1('interrupted'));if(_0x3d6b7d('staged'))return'staged';if(_0x3d6b7d('queued'))return'queued';if(_0x1e1ef1('running'))return'running';if(_0x1e1ef1('queued'))return'queued';if(_0x3c2067)return'mixed';if(_0x1e1ef1('failed'))return'failed';if(_0x3d6b7d('interrupted'))return'interrupted';if(_0x1e1ef1('completed'))return'completed';return fallback;}export function getTaskTileStatus({primary:_0x2ad520,variants:_0x242006,isGroup:isGroup=![]}={}){const _0x26b9f7=_0x2ad520?.['status']||'unknown',_0x1d88cf=Array['isArray'](_0x242006)?_0x242006['filter'](Boolean):[],_0x56e1ff=_0x1d88cf['some'](_0x58c7c8=>_0x58c7c8?.['taskId']!==_0x2ad520?.['taskId']&&isJudgeTaskEntry(_0x58c7c8));if(!isGroup&&!_0x56e1ff)return _0x26b9f7;return getAggregateTaskStatus(_0x1d88cf['length']>0x0?_0x1d88cf:[_0x2ad520],{'fallback':_0x26b9f7});}export function getTaskTileStatusLabel({primary:_0x437823,variants:_0x172591,isGroup:isGroup=![]}={}){const _0x575580=getTaskTileStatus({'primary':_0x437823,'variants':_0x172591,'isGroup':isGroup});if(_0x575580!=='running'){const _0x5ea8b1={'interrupted':'Interrupted','failed':'Failed','mixed':'Some\x20Failed','staged':'Staged','queued':'Queued'};return _0x5ea8b1[_0x575580]||'';}const _0x3ddfad=Array['isArray'](_0x172591)&&_0x172591['length']>0x0?_0x172591['filter'](Boolean):[_0x437823]['filter'](Boolean),_0xdd34f9=_0x3ddfad['filter'](_0x5be645=>_0x5be645?.['status']==='running'),_0x2f164b=_0xdd34f9['length']>0x0&&_0xdd34f9['every'](isJudgeTaskEntry);if(!_0x2f164b)return'Running';return _0xdd34f9['every'](_0x30f171=>_0x30f171?.['judgeMode']==='review')?'Reviewing':'Judging';}export function getTaskActivityTime(_0x49d08e){const _0x440131=_0x49d08e?.['lastActivityTimestamp']||_0x49d08e?.['lastActivity']||_0x49d08e?.['updatedAt']||_0x49d08e?.['createdAt'],_0x506b7c=_0x440131?new Date(_0x440131)['getTime']():0x0;return Number['isFinite'](_0x506b7c)?_0x506b7c:0x0;}export function hasLiveTaskStatusDetail(_0x11f3cd){return Boolean(_0x11f3cd?.['status']==='running'&&(_0x11f3cd['lastActivityAction']||typeof _0x11f3cd['progress']==='number'||_0x11f3cd['currentPhase']));}export function getDashboardStatusDetailTask(_0x26be8e,_0x481448,_0x250826,{displayVariants:displayVariants=null}={}){if(!_0x250826)return _0x26be8e;if(hasLiveTaskStatusDetail(_0x26be8e))return _0x26be8e;const _0x260c1b=Array['isArray'](_0x481448)?_0x481448['filter'](Boolean):[],_0x285753=Array['isArray'](displayVariants)&&displayVariants['length']>0x0?displayVariants['filter'](Boolean):_0x260c1b,_0x1de727=_0x285753['filter'](hasLiveTaskStatusDetail);if(_0x1de727['length']>0x0)return _0x1de727['sort']((_0x29bd92,_0x2e4d46)=>getTaskActivityTime(_0x2e4d46)-getTaskActivityTime(_0x29bd92))[0x0];if(_0x26be8e?.['status']==='queued'&&_0x26be8e['queuePosition'])return _0x26be8e;return _0x285753['find'](_0x4169df=>_0x4169df?.['status']==='queued'&&_0x4169df['queuePosition'])||_0x26be8e;}