import{_ as p,a as v}from"./open.js";/* empty css     */import{H as f}from"./Heading.js";import{C as g}from"./Button.js";import{f as k}from"./numbers.js";import{r as _,o as i,c as o,a as s,b as l,w as d,e as m,t as n,f as h,T as C,n as P,_ as y}from"./index.js";import"./telegram-authenticator.js";import"./close2.js";import"./donate.js";import"./money.js";const E={key:0,class:"business-content"},T=["src"],w={class:"business-data table"},S={class:"table-row"},x=s("div",{class:"col"},"Владелец",-1),N={class:"col"},A={key:0,class:"table-row"},B=s("div",{class:"col"},"Свободных полок",-1),M={class:"col"},I={key:1,class:"table-row"},O=s("div",{class:"col"},"Цена входа",-1),V={class:"col business-price-block"},W=s("div",{class:"business-rouble-sign"},null,-1),D={class:"text"},K={key:2,class:"table-row"},L=s("div",{class:"col"},"Налог на продажу",-1),U={class:"col"},Y=s("span",{class:"c-green"},"%",-1),z={class:"business-data table"},H={class:"table-row"},j=s("div",{class:"col"},"Государственная стоимость",-1),X={class:"col business-price-block"},q=s("div",{class:"business-rouble-sign"},null,-1),F={class:"text"},G={key:0,class:"business-control"},J=s("div",{class:"text"},"Войти",-1);function Q(a,c,Z,$,e,t){const u=_("heading"),b=_("control-button");return i(),o("div",{class:P(["business iface-container",{business_mobile:t.isMobile}])},[s("div",{class:"business-overlay",onClick:c[0]||(c[0]=(...r)=>t.close&&t.close(...r))}),l(C,{name:"slide-bottom"},{default:d(()=>[e.state?(i(),o("div",E,[l(u,{size:"42"},{default:d(()=>[m(n(e.name),1)]),_:1}),s("img",{class:"business-status",src:e.statusImage[`/src/assets/images/business/${e.STATUSES[e.status]}.svg`]},null,8,T),s("div",w,[s("div",S,[x,s("div",N,n(e.nickname.replace("_"," ")),1)]),e.type?(i(),o("div",A,[B,s("div",M,n(t.formatNumberWithSpaces(e.shelves)),1)])):h("",!0),e.type?(i(),o("div",K,[L,s("div",U,[m(n(t.formatNumberWithSpaces(e.enterPrice)),1),Y])])):(i(),o("div",I,[O,s("div",V,[W,s("div",D,n(t.formatNumberWithSpaces(e.enterPrice)),1)])]))]),s("div",z,[s("div",H,[j,s("div",X,[q,s("div",F,n(t.formatNumberWithSpaces(e.price)),1)])])]),t.isMobile?(i(),o("div",{key:1,class:"business-enter",onClick:c[1]||(c[1]=(...r)=>t.enter&&t.enter(...r))},"Войти")):(i(),o("div",G,[l(b,{keyCode:e.KEY_CODE_ALT,text:"Alt",onPressed:t.enter},null,8,["keyCode","onPressed"]),J]))])):h("",!0)]),_:1})],2)}const R={props:["openParams"],components:{Heading:f,ControlButton:g},data(){return{statusImage:Object.assign({"/src/assets/images/business/closed.svg":p,"/src/assets/images/business/open.svg":v}),STATUSES:["closed","open"],KEY_CODE_ALT:window.KEY_CODE_ALT,state:0,type:0,status:1,name:"Закусочная гриль",nickname:"Pavel_Addams",enterPrice:15,price:7e5,shelves:10}},computed:{isMobile(){return this.$root.isMobile}},created(){this.$data.noAdaptation=!0,this.openParams&&(this.type=this.openParams[0],this.status=this.openParams[1],this.name=this.openParams[2],this.nickname=this.openParams[3],this.enterPrice=this.openParams[4],this.price=this.openParams[5],this.type&&(this.shelves=this.openParams[6])),this.isMobile?this.state=!0:this.$nextTick(()=>this.state=!0)},methods:{formatNumberWithSpaces:k,close(){const a=()=>window.closeInterface("Business");if(this.isMobile){a();return}this.state=!1,setTimeout(()=>{this.$nextTick(()=>a())},300)},enter(){this.isMobile?window.sendClientKeyEvent("Alt"):sendClientEvent(gm.EVENT_EXECUTE_PUBLIC,"Business_OnPlayerEnter")}}},_s=y(R,[["render",Q]]);export{_s as default};
