import{D as E,p as I}from"./DailyRewardsPrizes.js";import{a as h,b as u,_ as k}from"./reward-particle.js";import{o as r,c as t,a,F as l,i as g,n as m,f as R,t as n,e as c,_ as y,r as D,b as P}from"./index.js";import"./gold_battle_pass.js";import"./ItemInfo.js";const A={class:"daily-rewards-list"},S={class:"daily-rewards-list__cards"},C={key:0,class:"daily-rewards-list__card__current-backgound"},f={class:"daily-rewards-list__card__image"},N=["src"],T={key:0,class:"daily-rewards-list__card__image-passed",src:h},b={class:"daily-rewards-list__card__value"},L={class:"daily-rewards-list__card__status"},M={class:"daily-rewards-list__reward__image"},W=["src"],V={key:0,class:"daily-rewards-list__card__image-passed",src:h},F={class:"daily-rewards-list__reward__value"},O=a("img",{src:u},null,-1),Y=a("img",{src:u},null,-1),G={class:"daily-rewards-list__reward__status"};function U(e,i,o,v,p,s){return r(),t("div",A,[a("div",S,[(r(!0),t(l,null,g(s.mainRewards,(_,d)=>(r(),t("div",{class:m(["daily-rewards-list__card",s.getRewardClassNames(d)]),key:d},[s.checkRewardIsCurrent(d)?(r(),t("div",C)):R("",!0),a("div",f,[a("img",{src:e.DAILY_REWARDS_PRIZE_TYPE[_.type].icon(_.itemId)},null,8,N),s.checkRewardIsPassed(d)?(r(),t("img",T)):R("",!0)]),a("div",b,n(_.value),1),a("div",L,[s.checkRewardIsPassed(d)?(r(),t(l,{key:1},[c("Получено")],64)):(r(),t(l,{key:0},[c("День "+n(_.serverIndex),1)],64))])],2))),128))]),a("div",{class:m(["daily-rewards-list__reward",s.getRewardClassNames(o.rewards.length-1,"reward")])},[a("div",M,[a("img",{src:e.DAILY_REWARDS_PRIZE_TYPE[s.lastReward.type].icon(s.lastReward.itemId)},null,8,W),s.checkRewardIsPassed(o.rewards.length-1)?(r(),t("img",V)):R("",!0)]),a("div",F,[O,c(n(s.lastReward.value),1),Y]),a("div",G,[s.checkRewardIsPassed(o.rewards.length-1)?(r(),t(l,{key:1},[c("Получено")],64)):(r(),t(l,{key:0},[c("День "+n(s.lastReward.serverIndex),1)],64))])],2)])}const w=7,B={props:["rewards","passedRewards","takenReward"],data:()=>({DAILY_REWARDS_PRIZE_TYPE:E}),computed:{mainRewards(){return this.rewards.slice(0,w-1)},lastReward(){return this.rewards[w-1]}},created(){if(this.rewards.length!==w)throw new Error(`Количество наград должно быть сопоставимо количеству дней: ${w}`)},methods:{gotoPlayerRewards(){this.$emit("goto:playerRewards")},checkRewardIsPassed(e){return e<this.passedRewards},checkRewardIsCurrent(e){return e===this.takenReward&&!this.checkRewardIsPassed(e)},getRewardClassNames(e,i="card"){return{[`daily-rewards-list__${i}_passed`]:this.checkRewardIsPassed(e),[`daily-rewards-list__${i}_current`]:this.checkRewardIsCurrent(e)}}}},H=y(B,[["render",U]]),Z={class:"daily-rewards__content"},K=a("img",{class:"daily-rewards__logo",src:k},null,-1),$={class:"daily-rewards__text"},z={class:"daily-rewards__buttons"};function X(e,i,o,v,p,s){const _=D("DailyRewardsList");return r(),t("div",{class:m(["daily-rewards iface-container",{"daily-rewards_mobile":s.isMobile}])},[a("div",Z,[K,a("div",$,n(`Отыграйте всего ${e.timeForGiveRewards} и получите награду за сегодняшний день!`),1),P(_,{rewards:e.list,passedRewards:e.passed,takenReward:e.takenReward},null,8,["rewards","passedRewards","takenReward"]),a("div",z,[a("div",{class:"daily-rewards__button",onClick:i[0]||(i[0]=(...d)=>s.close&&s.close(...d))},"Понятно"),a("div",{class:"daily-rewards__button",onClick:i[1]||(i[1]=(...d)=>s.more&&s.more(...d))},"Подробнее")])])],2)}const j={props:["openParams"],components:{DailyRewardsList:H},data:()=>({passed:0,takenReward:-1,timeForGiveRewards:1,list:[{type:0,itemId:0,value:"10 002"},{type:0,itemId:0,value:"10 000"},{type:0,itemId:0,value:"10 000"},{type:0,itemId:0,value:"10 000"},{type:0,itemId:0,value:"10 000"},{type:0,itemId:0,value:"10 000"},{type:0,itemId:1,value:"Кейс Охотничий"}]}),computed:{isMobile(){return this.$root.isMobile}},created(){if(this.$data.noAdaptation=!0,this.openParams){const e={PASSED:0,TAKEN_REWARD:1,HOUR_FOR_GIVE_REWARD:2,REWARDS_ITEMS:3};this.passed=this.openParams[e.PASSED],this.takenReward=this.openParams[e.TAKEN_REWARD],this.timeForGiveRewards=this.openParams[e.HOUR_FOR_GIVE_REWARD],this.list=[],this.list=I(this.openParams[e.REWARDS_ITEMS])}},methods:{more(){sendClientEvent(gm.EVENT_EXECUTE_PUBLIC,"MainMenu_OnMoreDailyRewards"),window.closeInterface("DailyRewards")},close(){window.closeInterface("DailyRewards")}}},se=y(j,[["render",X]]);export{se as default};
