import{S as E}from"./ScrollableContainer.js";import{_ as S,a as f,b as w}from"./weapon-bg.js";import{_ as y}from"./close2.js";import{r as M,o as a,c as n,a as e,b as T,w as b,F as d,i as u,t as h,n as v,f as m,d as C,p as I,g as N,_ as V}from"./index.js";import"./dom.js";const _=t=>(I("data-v-e3f974e8"),t=t(),N(),t),O={class:"shoot-wrapper"},x={key:0,class:"shoot-close"},P=_(()=>e("img",{src:y},null,-1)),W=[P],k={class:"shoot-left"},L=_(()=>e("img",{class:"logo",src:f},null,-1)),U=_(()=>e("div",{class:"text"},"Выбирайте нужную вам тренировку и улучшайте свои навыки стрельбы",-1)),H={class:"shoot-guns"},A={class:"shoot-guns__category"},B={class:"shoot-guns--title"},G=["onClick"],q={class:"data"},R={class:"data-value"},z={class:"data-name"},D={class:"bar"},F={class:"bar-item"},K={key:0,class:"bar-item--fill",style:{width:"100%"}},X={class:"icon-container"},j=["src"],J={class:"shoot-weapon"},Q=_(()=>e("img",{class:"weapon-bg",src:w},null,-1)),Y=["innerHTML"];function Z(t,i,ee,se,r,s){const p=M("ScrollableContainer");return a(),n("div",{class:v(["shoot",{shoot_mobile:s.isMobile,"shoot_with-hover":!s.isMobile,shoot_square:s.isSquare}])},[e("div",O,[s.isMobile?(a(),n("div",x,[e("img",{src:S,onClick:i[0]||(i[0]=(...l)=>s.close&&s.close(...l))})])):(a(),n("div",{key:1,class:"shoot-close",onClick:i[1]||(i[1]=(...l)=>s.close&&s.close(...l))},W)),e("div",k,[L,U,T(p,{class:"shoot-guns__container",type:5},{default:b(()=>[e("div",H,[(a(!0),n(d,null,u(r.categories,(l,g)=>(a(),n("div",A,[e("div",B,h(l),1),(a(!0),n(d,null,u(r.weapons.filter(o=>o.category==g),o=>(a(),n("div",{class:v(["shoot-guns__card",{active:r.activeWeaponIndex==r.weapons.indexOf(o)}]),onClick:c=>s.selectWeapon(r.weapons.indexOf(o))},[e("div",q,[e("div",R,h(o.value)+"%",1),e("div",z,h(o.name),1),e("div",D,[(a(),n(d,null,u(5,c=>e("div",F,[s.getPercentModelValue(o.value)*5>=c?(a(),n("div",K)):m("",!0),s.getPercentModelValue(o.value)*5-c>=-1&&s.getPercentModelValue(o.value)*5-c<=0?(a(),n("div",{key:1,class:"bar-item--fill",style:C({width:`${(s.getPercentModelValue(o.value)*5-Number.parseInt(s.getPercentModelValue(o.value)*5))*100}%`})},null,4)):m("",!0)])),64))])]),e("div",X,[e("img",{class:"icon",src:`/images/inventoryItems/${o.weaponid}.png`},null,8,j)])],10,G))),256))]))),256))])]),_:1})])]),e("div",J,[Q,e("div",{class:"shoot-weapon--name",innerHTML:s.activeWeapon.name},null,8,Y),e("div",{class:"shoot-weapon__button",onClick:i[2]||(i[2]=l=>s.startTraining())},"Начать тренировку")])],2)}const $={props:["openParams"],components:{ScrollableContainer:E},data(){return{value:50,activeWeaponIndex:0,categories:["Пистолеты","Дробовики","Полу-автоматическое"],weapons:[{value:70,name:"Электрошокер",weaponid:13,category:0},{value:70,name:"DESERT EAGLE",weaponid:19,category:0},{value:70,name:"Remington 870",weaponid:14,category:1},{value:70,name:"АКС-74У",weaponid:18,category:2},{value:70,name:"AKM",weaponid:21,category:2},{value:70,name:"HK416",weaponid:20,category:2},{value:70,name:"AWM",weaponid:22,category:2}],EVENT_SHOOTING_MENU_START:1,EVENT_SHOOTING_MENU_CLOSE:2}},computed:{activeWeapon(){const t=this.weapons[this.activeWeaponIndex]||this.weapons[0];return t.weaponid===13?{...t,name:t.name.replace(/(Электро)(шокер)/,"$1<br/>$2")}:t},isMobile(){return this.$root.isMobile},isSquare(){return this.$root.isSquare}},created(){this.$data.noAdaptation=!0,this.getWeaponsInfo(this.openParams)},methods:{getWeaponsInfo(t){for(let i in this.weapons)this.weapons[i].value=t[i]},close(){sendClientEvent(gm.EVENT_EXECUTE_PUBLIC,"OnPlayerShootingMenuEvent",this.EVENT_SHOOTING_MENU_CLOSE,-1)},selectWeapon(t){this.activeWeaponIndex=t},startTraining(){sendClientEvent(gm.EVENT_EXECUTE_PUBLIC,"OnPlayerShootingMenuEvent",this.EVENT_SHOOTING_MENU_START,this.weapons[this.activeWeaponIndex].weaponid)},getPercentModelValue(t){return t/100}}},le=V($,[["render",Z],["__scopeId","data-v-e3f974e8"]]);export{le as default};
