import{_ as g,a as C}from"./12.js";import{C as f}from"./Close.js";import{H as y}from"./Heading.js";import{C as B}from"./Button.js";import{a as x}from"./ItemInfo.js";import{r as c,o as l,c as d,b as p,a as s,w as I,e as S,t as m,F as E,i as w,p as P,g as O,_ as N}from"./index.js";import"./telegram-authenticator.js";import"./close2.js";import"./donate.js";import"./money.js";const o=t=>(P("data-v-5d9842bd"),t=t(),O(),t),T={class:"box iface-container"},k={class:"box__wrapper"},A=o(()=>s("div",{class:"box__shadow"},null,-1)),D={class:"box-top"},H=["src"],Y={class:"box-wrapper-list"},K=o(()=>s("div",{class:"box-border-list top"},null,-1)),V={class:"box-list"},X=o(()=>s("div",{class:"item__rounded-border"},null,-1)),F=["src"],G={class:"item__value"},J={class:"item__title"},L=o(()=>s("div",{class:"box-border-list bottom"},null,-1)),q={class:"box-controls"},z=o(()=>s("div",{class:"box-controls__text"},"Продолжить",-1));function M(t,n,_,r,e,i){const b=c("ControlsClose"),u=c("Heading"),v=c("ControlsButton");return l(),d("div",T,[p(b,{onClose:n[0]||(n[0]=a=>i.close())}),s("div",k,[A,s("div",D,[p(u,{class:"box-top__title"},{default:I(()=>[S("Получено из "+m(i.getBoxByType(e.box)),1)]),_:1}),s("img",{class:"box-top__image",src:e.boxIcons[`/src/assets/images/box/types/${e.box.type}.png`]},null,8,H)]),s("div",Y,[K,s("div",V,[(l(!0),d(E,null,w(e.box.items,(a,h)=>(l(),d("div",{class:"box-list__item",key:h},[X,s("img",{class:"item__image",src:`/images/inventoryItems/${a.item}.png`},null,8,F),s("div",G,"x"+m(a.value),1),s("div",J,m(i.getTitleName(a.item)),1)]))),128))]),L]),s("div",q,[p(v,{class:"box-controls__button",onPressed:i.nextStep,keyCode:e.KEY_CODE_SPACE,text:"Space"},null,8,["onPressed","keyCode"]),z])])])}const Q={BOX:0,BAG:1},R={name:"Box",props:["openParams"],components:{ControlsClose:f,Heading:y,ControlsButton:B},data(){return{KEY_CODE_SPACE:window.KEY_CODE_SPACE,boxIcons:Object.assign({"/src/assets/images/box/types/0.png":g,"/src/assets/images/box/types/1.png":C}),box:{type:0,itemInfo:x,items:[{item:0,value:2},{item:2,value:8},{item:2,value:1}]}}},created(){this.$data.noAdaptation=!0,this.openParams&&(this.box.type=this.openParams[0],this.setItems(this.openParams[1]))},mounted(){},methods:{setItems(t){const n=typeof t=="string"?JSON.parse(t):t,_=[];for(const r of n)_.push({item:r[0],value:r[1]});this.box.items=_},close(){window.closeInterface("Box")},getBoxByType(t){return t.type===Q.BOX?"ящика":"мешка"},getTitleName(t){return x[t].name},nextStep(){this.close()}}},is=N(R,[["render",M],["__scopeId","data-v-5d9842bd"]]);export{is as default};
