import{_ as n,a as g,b as m,c as v,d as b,e as d,f as u,g as A,h as E,i as C,j as y,k as S,l as w,m as f,n as p,o as R,p as B,q as P,r as T,s as h,t as k}from"./telegram-authenticator.js";import{_ as L}from"./close2.js";import{C as I}from"./Button.js";import{r as O,o as i,c as r,b as U,a as q,t as Q,n as x,_ as D}from"./index.js";const K={key:0,class:"controls-close"},H=["src"];function N(s,o,t,Y,_,a){const c=O("ControlsButton");return a.isMobile?(i(),r("img",{key:1,class:x(["controls-close controls-close_mobile",{".controls-close_square":t.type===_.TYPES.SQUARE_WHITE||t.type===_.TYPES.SQUARE_BLACK}]),src:a.getImage(),onClick:o[2]||(o[2]=l=>a.close())},null,10,H)):(i(),r("div",K,[U(c,{keyCode:_.ESCAPE,disabled:t.disabled,isPressAllwaysAllowed:t.isPressAllwaysAllowed,onPressed:o[0]||(o[0]=l=>a.onPress())},null,8,["keyCode","disabled","isPressAllwaysAllowed"]),q("div",{class:"controls-close--text",onClick:o[1]||(o[1]=l=>a.close())},Q(t.text),1)]))}const e={DEFAULT:0,SQUARE_WHITE:1,OCTAGONAL:2,SQUARE_BLACK:3,BORDERLESS_SQUARE_WHITE:4,CROSS:5,BACK:6,CIRCLE:7},W={props:{text:{type:String,default:"Закрыть"},type:{type:Number,default:e.DEFAULT},isPressAllwaysAllowed:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},components:{ControlsButton:I},data(){return{ESCAPE:window.KEY_CODE_ESC,TYPES:e,icons:Object.assign({"/src/assets/images/icons/angle-up-primary.svg":n,"/src/assets/images/icons/angle-up-secondary.svg":g,"/src/assets/images/icons/arrow-square-white.svg":m,"/src/assets/images/icons/close-mobile-back.svg":v,"/src/assets/images/icons/close-mobile-borderless-square-white.svg":b,"/src/assets/images/icons/close-mobile-circle.svg":d,"/src/assets/images/icons/close-mobile-cross.svg":u,"/src/assets/images/icons/close-mobile-octagonal.svg":A,"/src/assets/images/icons/close-mobile-square-black.svg":E,"/src/assets/images/icons/close-mobile-square-white.svg":C,"/src/assets/images/icons/close-mobile.svg":y,"/src/assets/images/icons/close-primary.svg":S,"/src/assets/images/icons/close-secondary.svg":w,"/src/assets/images/icons/close.svg":L,"/src/assets/images/icons/faq.svg":f,"/src/assets/images/icons/google-authenticator.svg":p,"/src/assets/images/icons/left-mouse-button.svg":R,"/src/assets/images/icons/long-arrow-left-primary.svg":B,"/src/assets/images/icons/long-arrow-left-secondary.svg":P,"/src/assets/images/icons/rouble_sign.svg":T,"/src/assets/images/icons/rouble_sign_grey.svg":h,"/src/assets/images/icons/telegram-authenticator.svg":k})}},computed:{isMobile(){return this.$root.isMobile}},created(){},methods:{onPress(){!this.getPressAllowedStatus()&&!this.isPressAllwaysAllowed||this.close()},getPressAllowedStatus(){return!window.getInterfaceStatus("TrainingOnboarding")},close(){this.$emit("close")},getImage(){const s={};return s[e.DEFAULT]="",s[e.SQUARE_WHITE]="-square-white",s[e.OCTAGONAL]="-octagonal",s[e.SQUARE_BLACK]="-square-black",s[e.BORDERLESS_SQUARE_WHITE]="-borderless-square-white",s[e.CROSS]="-cross",s[e.BACK]="-back",s[e.CIRCLE]="-circle",this.icons[`/src/assets/images/icons/close-mobile${s[this.type]}.svg`]}}},V=D(W,[["render",N],["__scopeId","data-v-ae718f18"]]);export{V as C};
