import{f as u}from"./numbers.js";import{o as t,c as a,b as _,w as n,f as d,T as c,a as s,t as r,d as h,n as k,p,g,_ as f}from"./index.js";import{_ as b,a as y,b as x}from"./offer2.js";const i=l=>(p("data-v-67db8e6d"),l=l(),g(),l),P=i(()=>s("div",{class:"trade-skin__bg"},null,-1)),S={key:0,class:"trade-skin__side left",src:b},w={key:0,class:"trade-skin__side right",src:y},C={key:0,class:"trade-skin__player"},E=i(()=>s("div",{class:"text"},"Предложил",-1)),T={class:"name"},I={class:"trade-skin__main"},N=i(()=>s("div",{class:"trade-skin__offer"},[s("img",{src:x}),s("div",{class:"text"},"Поступило предложение")],-1)),B={key:0,class:"trade-skin__skin"},V={class:"image"},A=i(()=>s("div",{class:"image-top"},[s("div",{class:"image--x"}),s("div",{class:"image--x"})],-1)),M={key:1,class:"text"},z=i(()=>s("div",{class:"image-bottom"},[s("div",{class:"image--x"}),s("div",{class:"image--x"})],-1)),U={class:"data-name"},W={class:"data-value"},D={class:"data-wear"},L={key:0,class:"trade-skin__buttons"},O=i(()=>s("div",{class:"button-text"},"Отклонить",-1)),X=i(()=>s("div",{class:"button-overlay"},null,-1)),j=[O,X],q={key:0,class:"trade-skin__text"},F={key:0,class:"trade-skin__player"},G=i(()=>s("div",{class:"text"},"Рассматривает",-1)),H={class:"name"};function J(l,m,Q,R,e,o){return t(),a("div",{class:k(["trade-skin",{"trade-skin_mobile":o.isMobile}])},[P,_(c,{name:"slide-left"},{default:n(()=>[e.state>1&&e.state<3?(t(),a("img",S)):d("",!0)]),_:1}),_(c,{name:"slide-right"},{default:n(()=>[e.state>1&&e.state<3?(t(),a("img",w)):d("",!0)]),_:1}),_(c,{name:"slide-left"},{default:n(()=>[e.state&&e.state<3?(t(),a("div",C,[E,s("div",T,r(e.from.replace("_"," ")),1)])):d("",!0)]),_:1}),s("div",I,[N,_(c,{name:"fade"},{default:n(()=>[e.state?(t(),a("div",B,[s("div",V,[A,o.skinPath?(t(),a("div",{key:0,class:"image-img",style:h({backgroundImage:`url('${o.skinPath}')`})},null,4)):(t(),a("div",M,"guest")),z]),s("div",{class:"data",style:h(o.getStylePrice())},[s("div",U,r(e.name),1),s("div",W,r(o.formatNumberWithSpaces(e.price))+" руб.",1),s("div",D,"Износ "+r(e.wear)+"%",1)],4)])):d("",!0)]),_:1}),_(c,{name:"fade"},{default:n(()=>[e.state&&e.state<3?(t(),a("div",L,[s("div",{class:"button button--main",onClick:m[0]||(m[0]=v=>o.send(1))},"Принять"),s("div",{class:"button",onClick:m[1]||(m[1]=v=>o.send(0))},j)])):d("",!0)]),_:1})]),_(c,{name:"slide-bottom"},{default:n(()=>[e.state==3?(t(),a("div",q,"Получена новая одежда!")):d("",!0)]),_:1}),_(c,{name:"slide-right"},{default:n(()=>[e.state&&e.state<3?(t(),a("div",F,[G,s("div",H,r(e.to.replace("_"," ")),1)])):d("",!0)]),_:1})],2)}const K={props:["openParams"],data(){return{scale:1,state:1,name:"Одежда",price:7e5,skin:5,from:"Pavel_Addams",to:"Pavel_Addams",wear:42}},computed:{skinPath(){try{return`/images/skins/${this.skin}.png`}catch{return!1}},isMobile(){return this.$root.isMobile}},created(){this.scale=window.scale,this.$data.noAdaptation=!0,this.skin=this.openParams[0],this.price=this.openParams[1],this.from=this.openParams[2],this.to=this.openParams[3],this.wear=this.openParams[4],setTimeout(()=>{this.state=1,setTimeout(()=>{this.state=2},250)},1e3)},methods:{formatNumberWithSpaces:u,getStylePrice(){if(this.state==3)return{opacity:0,height:"2.35vh"}},accept(){this.state=3},send(l){sendClientEvent(gm.EVENT_EXECUTE_PUBLIC,"OnPlayerSellSkinEvent",l)},cancel(){}}},ss=f(K,[["render",J],["__scopeId","data-v-67db8e6d"]]);export{ss as default};
