"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isVoteSubmitted=exports.isVoteEnded=exports.hasVoteContext=void 0;var _times=require("./times"),isVoteEnded=function(e){if("Deadline"===(null==e?void 0:e.Status))return!0;var t=Number((null==e?void 0:e.Deadline)||0);return!!t&&t<=(0,_times.getCurrentServerTimeSecond)()};exports.isVoteEnded=isVoteEnded;var isVoteSubmitted=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=null==e?void 0:e.VoteId;return!(!o||!t[o])||!(null==e||!e.UserVotedStatus)||!!((null==e?void 0:e.UserChose)||[]).length};exports.isVoteSubmitted=isVoteSubmitted;var hasVoteContext=function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).some(function(e){return((null==e?void 0:e.Context)||[]).some(function(e){return!(null==e||!e.VoteContext)})})};exports.hasVoteContext=hasVoteContext;