1
(()=>{"use strict";const e={}
2
;let t=!0,s=(e=500)=>{document.documentElement.classList.contains("lock")?i(e):a(e)}
3
,i=(e=500)=>{let s=document.querySelector("body");if(t){let i=document.querySelectorAll("[data-lp]");setTimeout((()=>{for(let e=0;e<i.length;e++){i[e].style.paddingRight="0px"}
4
s.style.paddingRight="0px",document.documentElement.classList.remove("lock")}
5
),e),t=!1,setTimeout((function(){t=!0}
6
),e)}
7
}
8
,a=(e=500)=>{let s=document.querySelector("body");if(t){let i=document.querySelectorAll("[data-lp]");for(let e=0;e<i.length;e++){i[e].style.paddingRight=window.innerWidth-document.querySelector(".wrapper").offsetWidth+"px"}
9
s.style.paddingRight=window.innerWidth-document.querySelector(".wrapper").offsetWidth+"px",document.documentElement.classList.add("lock"),t=!1,setTimeout((function(){t=!0}
10
),e)}
11
}
12
;function n(e){setTimeout((()=>{window.FLS&&console.log(e)}
13
),0)}
14
e.popup=new class{constructor(e){let t={logging:!0,init:!0,attributeOpenButton:"data-popup",attributeCloseButton:"data-close",fixElementSelector:"[data-lp]",youtubeAttribute:"data-popup-youtube",youtubePlaceAttribute:"data-popup-youtube-place",setAutoplayYoutube:!0,classes:{popup:"popup",popupContent:"popup__content",popupActive:"popup_show",bodyActive:"popup-show"}
15
,focusCatch:!0,closeEsc:!0,bodyLock:!0,hashSettings:{location:!0,goHash:!0}
16
,on:{beforeOpen:function(){}
17
,afterOpen:function(){}
18
,beforeClose:function(){}
19
,afterClose:function(){}
20
}
21
}
22
;this.youTubeCode,this.isOpen=!1,this.targetOpen={selector:!1,element:!1}
23
,this.previousOpen={selector:!1,element:!1}
24
,this.lastClosed={selector:!1,element:!1}
25
,this._dataValue=!1,this.hash=!1,this._reopen=!1,this._selectorOpen=!1,this.lastFocusEl=!1,this._focusEl=["a[href]",'input:not([disabled]):not([type="hidden"]):not([aria-hidden])',"button:not([disabled]):not([aria-hidden])","select:not([disabled]):not([aria-hidden])","textarea:not([disabled]):not([aria-hidden])","area[href]","iframe","object","embed","[contenteditable]",'[tabindex]:not([tabindex^="-"])'],this.options={...t,...e,classes:{...t.classes,...e?.classes}
26
,hashSettings:{...t.hashSettings,...e?.hashSettings}
27
,on:{...t.on,...e?.on}
28
}
29
,this.bodyLock=!1,this.options.init&&this.initPopups()}
30
initPopups(){this.popupLogging("Прокинувся"),this.eventsPopup()}
31
eventsPopup(){document.addEventListener("click",function(e){const t=e.target.closest(`[${this.options.attributeOpenButton}
32
]`);if(t)return e.preventDefault(),this._dataValue=t.getAttribute(this.options.attributeOpenButton)?t.getAttribute(this.options.attributeOpenButton):"error",this.youTubeCode=t.getAttribute(this.options.youtubeAttribute)?t.getAttribute(this.options.youtubeAttribute):null,"error"!==this._dataValue?(this.isOpen||(this.lastFocusEl=t),this.targetOpen.selector=`${this._dataValue}
33
`,this._selectorOpen=!0,void this.open()):void this.popupLogging(`Йой, не заповнено атрибут у ${t.classList}
34
`);return e.target.closest(`[${this.options.attributeCloseButton}
35
]`)||!e.target.closest(`.${this.options.classes.popupContent}
36
`)&&this.isOpen?(e.preventDefault(),void this.close()):void 0}
37
.bind(this)),document.addEventListener("keydown",function(e){if(this.options.closeEsc&&27==e.which&&"Escape"===e.code&&this.isOpen)return e.preventDefault(),void this.close();this.options.focusCatch&&9==e.which&&this.isOpen&&this._focusCatch(e)}
38
.bind(this)),this.options.hashSettings.goHash&&(window.addEventListener("hashchange",function(){window.location.hash?this._openToHash():this.close(this.targetOpen.selector)}
39
.bind(this)),window.addEventListener("load",function(){window.location.hash&&this._openToHash()}
40
.bind(this)))}
...
</html>