"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isEndStatus=exports.getShowNumberStr=exports.getLotteryUserStatus=exports.getLotteryStatus=exports.formatConditionDetails=exports.QuizUserStatus=exports.QuizType=exports.QuizTitleType=exports.QuizStatus=exports.LotteryStatus=exports.LotteryServerStatus=exports.IQuizResultType=exports.EnumWinnerInfoType=exports.ConditionCompleteFlag=exports.AwardVersion=exports.AwardType=exports.AwardResult=exports.AwardItemType=exports.AttendedStatus=void 0;var QuizStatus={INIT:0,SEND:1,PUBLISHED:2,END:3,DELETE:4,REVOKE:5};exports.QuizStatus=QuizStatus;var QuizTitleType={SINGLE:0,MULTIPLE:1};exports.QuizTitleType=QuizTitleType;var QuizType={DEFAULT:0,SIMPLE:1};exports.QuizType=QuizType;var QuizUserStatus={UNSUBMITTED:0,SUBMITTED:1};exports.QuizUserStatus=QuizUserStatus;var IQuizResultType={SUBMIT:0,DEADLINE:1,MANUAL:2};exports.IQuizResultType=IQuizResultType;var isEndStatus=function(t){var e;return"number"==typeof t?QuizStatus.END===t:t.QuizStatus===QuizStatus.END||!(null===(e=t.RightOptions)||void 0===e||!e.length)};exports.isEndStatus=isEndStatus;var LotteryServerStatus={UNKNOWN:0,Init:1,Ing:2,BeforeOpen:3,Opened:4,Delete:5,UnOpened:6,Retract:7,Opening:8};exports.LotteryServerStatus=LotteryServerStatus;var AwardType={AutoOpen:1,AdminOpen:2};exports.AwardType=AwardType;var AwardResult={INIT:1,ATTEND:2,WIN:4,LOSE:5};exports.AwardResult=AwardResult;var LotteryStatus={OPEN:0,ENROLLED:1,WIN:2,LOSE:3,UNATTEND:4,WAITING:5,CLOSED:6,RETRACT:7};exports.LotteryStatus=LotteryStatus;var AttendedStatus=[LotteryStatus.ENROLLED,LotteryStatus.WIN,LotteryStatus.LOSE];exports.AttendedStatus=AttendedStatus;var ConditionCompleteFlag={NOT_SET:0,COMPLETED:1,NOT_COMPLETED:2};exports.ConditionCompleteFlag=ConditionCompleteFlag;var AwardItemType={VIRTUAL:2,REAL:1,CUSTOM:3,TICKET:4,UNKNOWN:0};exports.AwardItemType=AwardItemType;var getLotteryStatus=function(t){switch(t){case LotteryServerStatus.Init:case LotteryServerStatus.Ing:case LotteryServerStatus.UNKNOWN:return LotteryStatus.OPEN;case LotteryServerStatus.BeforeOpen:case LotteryServerStatus.Opening:return LotteryStatus.WAITING;case LotteryServerStatus.Opened:return LotteryStatus.UNATTEND;case LotteryServerStatus.Retract:return LotteryStatus.RETRACT;case LotteryServerStatus.Delete:case LotteryServerStatus.UnOpened:default:return LotteryStatus.CLOSED}};exports.getLotteryStatus=getLotteryStatus;var EnumWinnerInfoType={Address:"1",Tel:"2",ReceiverName:"3",Email:"4"};exports.EnumWinnerInfoType=EnumWinnerInfoType;var AwardVersion={TEL:0,UID:1};exports.AwardVersion=AwardVersion;var getLotteryUserStatus=function(t,e){var r=t.ID,s=t.Status,o=(e.get("lotteriesUserStatus")||{}).lotteriesUserStatus;return(void 0===o?{}:o)[r]||getLotteryStatus(s)};exports.getLotteryUserStatus=getLotteryUserStatus;var formatConditionDetails=function(t,e,r,s){if(!e)return[];var o=[];return t&&o.push({key:"BarragePwd",value:t,completed:!1}),Object.keys(e).forEach(function(t){e[t]&&o.push({key:t,value:e[t],completed:!!s||!(!r||r[t]!==ConditionCompleteFlag.COMPLETED)})}),o};exports.formatConditionDetails=formatConditionDetails;var getShowNumberStr=function(t,e){var r=formatConditionDetails(t);return e===LotteryStatus.ENROLLED?"".concat(r.length,"/").concat(r.length):t.UndoAwardCondition?"".concat(r.filter(function(t){return t.completed}).length,"/").concat(r.length):"".concat(r.length)};exports.getShowNumberStr=getShowNumberStr;