1import{I as y}from"./IconCloseSimple-BuMM0PT6.js";import{w}from"./runtime-dom.esm-bundler-Bm0-6-7k.js";import{_ as b}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{i as k,a as r,o as h,d as _,b as u,e as M,f as m}from"./runtime-core.esm-bundler-qir4qudY.js";import{S,n as E}from"./reactivity.esm-bundler-BFx7IUI5.js";const $={name:"Modal",components:{IconCloseSimple:y},props:{btnClose:{default:!0,type:Boolean},container:{default:null,type:[Object,String]},header:{default:!0,type:Boolean},title:{default:!0,type:Boolean},touch:{default:!1,type:Boolean},width:{default:"",type:String},contentTestId:{default:"",type:String}},emits:["close"],data(){return{openedModal:null}},computed:{touch_event_listener(){return this.header&&this.touch}},mounted(){this.container&&(typeof this.container=="string"?document.querySelector(this.container):this.container).append(this.$el),window.addEventListener("keyup",this.event_keyup_esc),this.touch_event_listener&&this.touch_header(),this.$nextTick(()=>{this.openedModal=document.querySelector(".new-modal_open"),this.openedModal||(window.scrollbar_width=window.scrollbar_width||window.innerWidth-document.documentElement.clientWidth,document.body.style.paddingRight=scrollbar_width+"px",document.body.classList.add("new-modal-open")),this.$el.classList.add("new-modal_open")})},beforeUnmount(){if(this.openedModal||(document.body.style.paddingRight=null,document.body.classList.remove("new-modal-open")),window.removeEventListener("keyup",this.event_keyup_esc),this.touch_event_listener){const e=this.$refs.header;e.removeEventListener("touchstart",this.touch_header.handleTouchStart,{passive:this}),e.removeEventListener("touchmove",this.touch_header.handleTouchMove,!1),e.removeEventListener("touchend",this.touch_header.handleTouchEnd,!1)}},methods:{event_keyup_esc(e){e.keyCode===27&&this.$emit("close")},touch_header(){const e=this.$refs.header,o=this.$refs.content;let t=!1,l=!1,a=!1,d=null,i=null;this.touch_header.handleTouchStart=n=>{const s=n.touches[0];d=s.clientX,i=s.clientY},this.touch_header.handleTouchMove=n=>{if(n.preventDefault(),t)return;const s=n.touches[0];let f=s.clientX,p=s.clientY,v=d-f,c=i-p;l||Math.abs(v)<Math.abs(c)?(l=!0,c>=0?(o.style.marginBottom="",a=!1):(o.style.marginBottom=c+"px",a=!0)):t=!0},this.touch_header.handleTouchEnd=()=>{t=!1,l=!1,a&&this.$emit("close")},e.addEventListener("touchstart",this.touch_header.handleTouchStart,{passive:this}),e.addEventListener("touchmove",this.touch_header.handleTouchMove,!1),e.addEventListener("touchend",this.touch_header.handleTouchEnd,!1)}}},T=["data-test-id"],L={key:1,ref:"header",class:"new-modal__header"},g={key:0,class:"new-modal__title"},C={class:"new-modal__body"};function B(e,o,t,l,a,d){const i=k("IconCloseSimple");return h(),r("div",{class:E(["new-modal",{"new-modal_touch":d.touch_event_listener}]),onMousedown:o[1]||(o[1]=w(n=>e.$emit("close"),["self"]))},[_("div",{ref:"content",class:"new-modal__content",style:S({width:t.width}),"data-test-id":t.contentTestId},[t.btnClose?(h(),r("button",{key:0,type:"button",class:"new-modal__btn-close",onClick:o[0]||(o[0]=n=>e.$emit("close"))},[M(i)])):u("",!0),t.header?(h(),r("div",L,[m(e.$slots,"header",{},()=>[t.title?(h(),r("div",g,[m(e.$slots,"title")])):u("",!0)])],512)):u("",!0),_("div",C,[m(e.$slots,"default")])],12,T)],34)}const V=b($,[["render",B]]);export{V as M};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.