1/******/ (function(modules) { // webpackBootstrap 2/******/ // The module cache 3/******/ var installedModules = {}; 4/******/ 5/******/ // The require function 6/******/ function __webpack_require__(moduleId) { 7/******/ 8/******/ // Check if module is in cache 9/******/ if(installedModules[moduleId]) { 10/******/ return installedModules[moduleId].exports; 11/******/ } 12/******/ // Create a new module (and put it into the cache) 13/******/ var module = installedModules[moduleId] = { 14/******/ i: moduleId, 15/******/ l: false, 16/******/ exports: {} 17/******/ }; 18/******/ 19/******/ // Execute the module function 20/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21/******/ 22/******/ // Flag the module as loaded 23/******/ module.l = true; 24/******/ 25/******/ // Return the exports of the module 26/******/ return module.exports; 27/******/ } 28/******/ 29/******/ 30/******/ // expose the modules object (__webpack_modules__) 31/******/ __webpack_require__.m = modules; 32/******/ 33/******/ // expose the module cache 34/******/ __webpack_require__.c = installedModules; 35/******/ 36/******/ // define getter function for harmony exports 37/******/ __webpack_require__.d = function(exports, name, getter) { 38/******/ if(!__webpack_require__.o(exports, name)) { 39/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); 40/******/ } 41/******/ }; 42/******/ 43/******/ // define __esModule on exports 44/******/ __webpack_require__.r = function(exports) { 45/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 46/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 47/******/ } 48/******/ Object.defineProperty(exports, '__esModule', { value: true }); 49/******/ }; 50/******/ 51/******/ // create a fake namespace object 52/******/ // mode & 1: value is a module id, require it 53/******/ // mode & 2: merge all properties of value into the ns 54/******/ // mode & 4: return value when already ns object 55/******/ // mode & 8|1: behave like require 56/******/ __webpack_require__.t = function(value, mode) { 57/******/ if(mode & 1) value = __webpack_require__(value); 58/******/ if(mode & 8) return value; 59/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; 60/******/ var ns = Object.create(null); 61/******/ __webpack_require__.r(ns); 62/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); 63/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); 64/******/ return ns; 65/******/ }; 66/******/ 67/******/ // getDefaultExport function for compatibility with non-harmony modules 68/******/ __webpack_require__.n = function(module) { 69/******/ var getter = module && module.__esModule ? 70/******/ function getDefault() { return module['default']; } : 71/******/ function getModuleExports() { return module; }; 72/******/ __webpack_require__.d(getter, 'a', getter); 73/******/ return getter; 74/******/ }; 75/******/ 76/******/ // Object.prototype.hasOwnProperty.call 77/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 78/******/ 79/******/ // __webpack_public_path__ 80/******/ __webpack_require__.p = ""; 81/******/ 82/******/ 83/******/ // Load entry module and return exports 84/******/ return __webpack_require__(__webpack_require__.s = 44); 85/******/ }) 86/************************************************************************/ 87/******/ ({ 88 89/***/ 16: 90/***/ (function(module, exports, __webpack_require__) { 91 92!function(t,n){ true?module.exports=n():undefined}(this,function(){"use strict";function t(t,n){var e=void 0;return function(){e&&clearTimeout(e),e=setTimeout(t,n)}}function n(t,n){for(var e=t.length,r=e,o=[];e--;)o.push(n(t[r-e-1]));return o}function e(t,n){var e=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(window.Promise)return A(t,n,e);t.recalculate(!0,!0)}function r(t){for(var n=t.options,e=t.responsiveOptions,r=t.keys,o=t.docWidth,i=void 0,s=0;s<r.length;s++){var a=parseInt(r[s],10);o>=a&&(i=n.breakAt[a],O(i,e))}return e}function o(t){for(var n=t.options,e=t.responsiveOptions,r=t.keys,o=t.docWidth,i=void 0,s=r.length-1;s>=0;s--){var a=parseInt(r[s],10);o<=a&&(i=n.breakAt[a],O(i,e))}return e}function i(t){var n=t.useContainerForBreakpoints?t.container.clientWidth:window.innerWidth,e={columns:t.columns};b(t.margin)?e.margin={x:t.margin.x,y:t.margin.y}:e.margin={x:t.margin,y:t.margin};var i=Object.keys(t.breakAt);return t.mobileFirst?r({options:t,responsiveOptions:e,keys:i,docWidth:n}):o({options:t,responsiveOptions:e,keys:i,docWidth:n})}function s(t){return i(t).columns}function a(t){return i(t).margin}function c(t){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],e=s(t),r=a(t).x,o=100/e;if(!n)return o;if(1===e)return"100%";var i="px";if("string"==typeof r){var c=parseFloat(r);i=r.replace(c,""),r=c}return r=(e-1)*r/e,"%"===i?o-r+"%":"calc("+o+"% - "+r+i+")"}function u(t,n){var e=s(t.options),r=0,o=void 0,i=void 0;if(1===++n)return 0;i=a(t.options).x;var u="px";if("string"==typeof i){var l=parseFloat(i,10);u=i.replace(l,""),i=l}return o=(i-(e-1)*i/e)*(n-1),r+=c(t.options,!1)*(n-1),"%"===u?r+o+"%":"calc("+r+"% + "+o+u+")"}function l(t){var n=0,e=t.container;v(t.rows
vendor: 8,800 bytes, line 92
92,function(t){n=t>n?t:n}),e.style.height=n+"px"}function p(t,n){var e=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=s(t.options),i=a(t.options).y;M(t,o,e),v(n,function(n){var e=0,o=parseInt(n.offsetHeight,10);isNaN(o)||(t.rows.forEach(function(n,r){n<t.rows[e]&&(e=r)}),n.style.position="absolute",n.style.top=t.rows[e]+"px",n.style.left=""+t.cols[e],t.rows[e]+=isNaN(o)?0:o+i,r&&(n.dataset.macyComplete=1))}),r&&(t.tmpRows=null),l(t)}function f(t,n){var e=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=s(t.options),i=a(t.options).y;M(t,o,e),v(n,function(n){t.lastcol===o&&(t.lastcol=0);var e=C(n,"height");e=parseInt(n.offsetHeight,10),isNaN(e)||(n.style.position="absolute",n.style.top=t.rows[t.lastcol]+"px",n.style.left=""+t.cols[t.lastcol],t.rows[t.lastcol]+=isNaN(e)?0:e+i,t.lastcol+=1,r&&(n.dataset.macyComplete=1))}),r&&(t.tmpRows=null),l(t)}var h=function t(n,e){if(!(this instanceof t))return new t(n,e);if(n&&n.nodeName)return n;if(n=n.replace(/^\s*/,"").replace(/\s*$/,""),e)return this.byCss(n,e);for(var r in this.selectors)if(e=r.split("/"),new RegExp(e[1],e[2]).test(n))return this.selectors[r](n);return this.byCss(n)};h.prototype.byCss=function(t,n){return(n||document).querySelectorAll(t)},h.prototype.selectors={},h.prototype.selectors[/^\.[\w\-]+$/]=function(t){return document.getElementsByClassName(t.substring(1))},h.prototype.selectors[/^\w+$/]=function(t){return document.getElementsByTagName(t)},h.prototype.selectors[/^\#[\w\-]+$/]=function(t){return document.getElementById(t.substring(1))};var v=function(t,n){for(var e=t.length,r=e;e--;)n(t[r-e-1])},m=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.running=!1,this.events=[],this.add(t)};m.prototype.run=function(){if(!this.running&&this.events.length>0){var t=this.events.shift();this.running=!0,t(),this.running=!1,this.run()}},m.prototype.add=function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return!!n&&(Array.isArray(n)?v(n,function(n){return t.add(n)}):(this.events.push(n),void this.run()))},m.prototype.clear=function(){this.events=[]};var d=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.instance=t,this.data=n,this},y=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.events={},this.instance=t};y.prototype.on=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return!(!t||!n)&&(Array.isArray(this.events[t])||(this.events[t]=[]),this.events[t].push(n))},y.prototype.emit=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t||!Array.isArray(this.events[t]))return!1;var e=new d(this.instance,n);v(this.events[t],function(t){return t(e)})};var g=function(t){return!("naturalHeight"in t&&t.naturalHeight+t.naturalWidth===0)||t.width+t.height!==0},E=function(t,n){var e=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return new Promise(function(t,e){if(n.complete)return g(n)?t(n):e(n);n.addEventListener("load",function(){return g(n)?t(n):e(n)}),n.addEventListener("error",function(){return e(n)})}).then(function(n){e&&t.emit(t.constants.EVENT_IMAGE_LOAD,{img:n})}).catch(function(n){return t.emit(t.constants.EVENT_IMAGE_ERROR,{img:n})})},w=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return n(e,function(n){return E(t,n,r)})},A=function(t,n){var e=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return Promise.all(w(t,n,e)).then(function(){t.emit(t.constants.EVENT_IMAGE_COMPLETE)})},I=function(n){return t(function(){n.emit(n.constants.EVENT_RESIZE),n.queue.add(function(){return n.recalculate(!0,!0)})},100)},N=function(t){if(t.container=h(t.options.container),t.container instanceof h||!t.container)return!!t.options.debug&&console.error("Error: Container not found");t.container.length&&(t.container=t.container[0]),t.options.container=t.container,t.container.style.position="relative"},T=function(t){t.queue=new m,t.events=new y(t),t.rows=[],t.resizer=I(t)},L=function(t){var n=h("img",t.container);window.addEventListener("resize",t.resizer),t.on(t.constants.EVENT_IMAGE_LOAD,function(){return t.recalculate(!1,!1)}),t.on(t.constants.EVENT_IMAGE_COMPLETE,function(){return t.recalculate(!0,!0)}),t.options.useOwnImageLoader||e(t,n,!t.options.waitForImages),t.emit(t.constants.EVENT_INITIALIZED)},_=function(t){N(t),T(t),L(t)},b=function(t){return t===Object(t)&&"[object Array]"!==Object.prototype.toString.call(t)},O=function(t,n){b(t)||(n.columns=t),b(t)&&t.columns&&(n.columns=t.columns),b(t)&&t.margin&&!b(t.margin)&&(n.margin={x:t.margin,y:t.margin}),b(t)&&t.margin&&b(t.margin)&&t.margin.x&&(n.margin.x=t.margin.x),b(t)&&t.margin&&b(t.margin)&&t.margin.y&&(n.margin.y=t.margin.y)},C=function(t,n){return window.getComputedStyle(t,null).getPropertyValue(n)},M=function(t,n){var e=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t.lastcol||(t.lastcol=0),t.rows.length<1&&(e=!0),e){t.rows=[],t.cols=[],t.lastcol=0;for(var r=n-1;r>=0;r--)t.rows[r]=0,t.cols[r]=u(t,r)}else if(t.tmpRows){t.rows=[];for(var r=n-1;r>=0;r--)t.rows[r]=t.tmpRows[r]}else{t.tmpRows=[];for(var r=n-1;r>=0;r--)t.tmpRows[r]=t.rows[r]}},V=function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],e=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=n?t.container.children:h(':scope > *:not([data-macy-complete="1"])',t.container);r=Array.from(r).filter(function(t){return null!==t.offsetParent});var o=c(t.options);return v(r,function(t){n&&(t.dataset.macyComplete=0),t.style.width=o}),t.options.trueOrder?(f(t,r,n,e),t.emit(t.constants.EVENT_RECALCULATED)):(p(t,r,n,e),t.emit(t.constants.EVENT_RECALCULATED))},R=function(){return!!window.Promise},x=Object.assign||function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t};Array.from||(Array.from=function(t){for(var n=0,e=[];n<t.length;)e.push(t[n++]);return e});var k={columns:4,margin:2,trueOrder:!1,waitForImages:!1,useImageLoader:!0,breakAt:{},useOwnImageLoader:!1,onInit:!1,cancelLegacy:!1,useContainerForBreakpoints:!1};!function(){try{document.createElement("a").querySelector(":scope *")}catch(t){!function(){function t(t){return function(e){if(e&&n.test(e)){var r=this.getAttribute("id");r||(this.id="q"+Math.floor(9e6*Math.random())+1e6),arguments[0]=e.replace(n,"#"+this.id);var o=t.apply(this,arguments);return null===r?this.removeAttribute("id"):r||(this.id=r),o}return t.apply(this,arguments)}}var n=/:scope\b/gi,e=t(Element.prototype.querySelector);Element.prototype.querySelector=function(t){return e.apply(this,arguments)};var r=t(Element.prototype.querySelectorAll);Element.prototype.querySelectorAll=function(t){return r.apply(this,arguments)}}()}}();var q=function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:k;if(!(this instanceof t))return new t(n);this.options={},x(this.options,k,n),this.options.cancelLegacy&&!R()||_(this)};return q.init=function(t){return console.warn("Depreciated: Macy.init will be removed in v3.0.0 opt to use Macy directly like so Macy({ /*options here*/ }) "),new q(t)},q.prototype.recalculateOnImageLoad=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return e(this,h("img",this.container),!t)},q.prototype.runOnImageLoad=function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=h("img",this.container);return this.on(this.constants.EVENT_IMAGE_COMPLETE,t),n&&this.on(this.constants.EVENT_IMAGE_LOAD,t),e(this,r,n)},q.prototype.recalculate=function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e&&this.queue.clear(),this.queue.add(function(){return V(t,n,e)})},q.prototype.remove=function(){window.removeEventListener("resize",this.resizer),v(this.container.children,function(t){t.removeAttribute("data-macy-complete"),t.removeAttribute("style")}),this.container.removeAttribute("style")},q.prototype.reInit=function(){this.recalculate(!0,!0),this.emit(this.constants.EVENT_INITIALIZED),window.addEventListener("resize",this.resizer),this.container.style.position="relative"},q.prototype.on=function(t,n){this.events.on(t,n)},q.prototype.emit=function(t,n){this.events.emit(t,n)},q.constants={EVENT_INITIALIZED:"macy.initialized",EVENT_RECALCULATED:"macy.recalculated",EVENT_IMAGE_LOAD:"macy.image.load",EVENT_IMAGE_ERROR:"macy.image.error",EVENT_IMAGE_COMPLETE:"macy.images.complete",EVENT_RESIZE:"macy.resize"},q.prototype.constants=q.constants,q});
93 94 95/***/ }), 96 97/***/ 17: 98/***/ (function(module, exports, __webpack_require__) { 99 100// extracted by mini-css-extract-plugin 101 if(false) { var cssReload; } 102 103 104/***/ }), 105 106/***/ 2: 107/***/ (function(module, __webpack_exports__, __webpack_require__) { 108 109"use strict"; 110/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return getViewportWidth; }); 111/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getScrollHeight; }); 112/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getScrollTop; }); 113var getViewportWidth = function getViewportWidth() { 114 return window.innerWidth && document.documentElement.clientWidth ? Math.min(window.innerWidth, document.documentElement.clientWidth) : window.innerWidth || document.documentElement.clientWidth || document.getElementsByTagName('body')[0].clientWidth; 115}; 116 117var getScrollHeight = function getScrollHeight() { 118 var _document = document, 119 documentElement = _document.documentElement, 120 body = _document.body; 121 var clientHeight = documentElement.clientHeight, 122 offsetHeight = documentElement.offsetHeight; 123 return Math.max(body.scrollHeight, documentElement.scrollHeight, body.offsetHeight, offsetHeight, body.clientHeight, clientHeight); 124}; 125 126var getScrollTop = function getScrollTop() { 127 var _document2 = document, 128 documentElement = _document2.documentElement; 129 return window.pageYOffset || documentElement.scrollTop; 130}; 131 132 133 134/***/ }), 135 136/***/ 3: 137/***/ (function(module, __webpack_exports__, __webpack_require__) { 138 139"use strict"; 140/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getCookie; }); 141/** 142 * ÐÑÐµÑ Ð² cookie запиÑÑ Ð¿Ð¾ имени 143 * @return String || undefined 144 */ 145function getCookie(name) { 146 var matches = document.cookie.match(new RegExp("(?:^|; )".concat(name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, "\\$1") // eslint-disable-line 147 , "=([^;]*)"))); 148 return matches ? decodeURIComponent(matches[1]) : undefined; 149} 150/* unused harmony default export */ var _unused_webpack_default_export = ({ 151 getCookie: getCookie 152}); 153 154/***/ }), 155 156/***/ 44: 157/***/ (function(module, __webpack_exports__, __webpack_require__) { 158 159"use strict"; 160__webpack_require__.r(__webpack_exports__); 161 162// CONCATENATED MODULE: ./app/js/imageLazy.js 163var lazyImagesLoader = function lazyImagesLoader() { 164 var lazyloadImages; 165 166 if ("IntersectionObserver" in window) { 167 lazyloadImages = document.querySelectorAll("[data-background]"); 168 var imageObserver = new IntersectionObserver(function (entries, observer) { 169 entries.forEach(function (entry) { 170 if (entry.isIntersecting) { 171 var image = entry.target; 172 image.style.backgroundImage = "url('".concat(image.dataset.background, "')"); 173 image.removeAttribute("data-background"); 174 imageObserver.unobserve(image); 175 } 176 }); 177 }); 178 lazyloadImages.forEach(function (image) { 179 imageObserver.observe(image); 180 }); 181 } else { 182 var lazyload = function lazyload() { 183 if (lazyloadThrottleTimeout) { 184 clearTimeout(lazyloadThrottleTimeout); 185 } 186 187 lazyloadThrottleTimeout = setTimeout(function () { 188 var scrollTop = window.pageYOffset; 189 lazyloadImages.forEach(function (img) { 190 if (img.offsetTop < window.innerHeight + scrollTop) { 191 if (img.dataset.background) { 192 img.style.backgroundImage = "url('".concat(img.dataset.background, "')"); 193 img.removeAttribute("data-background"); 194 } 195 } 196 }); 197 198 if (lazyloadImages.length == 0) { 199 document.removeEventListener("scroll", lazyload); 200 window.removeEventListener("resize", lazyload); 201 window.removeEventListener("orientationChange", lazyload); 202 } 203 }, 20); 204 }; 205 206 var lazyloadThrottleTimeout; 207 lazyloadImages = document.querySelectorAll("[data-background]"); 208 lazyload(); 209 document.addEventListener("scroll", lazyload); 210 window.addEventListener("resize", lazyload); 211 window.addEventListener("orientationChange", lazyload); 212 } 213}; 214var initImageLazy = function initImageLazy() { 215 try { 216 document.addEventListener("DOMContentLoaded", function () { 217 lazyImagesLoader(); 218 }); 219 } catch (err) { 220 console.log('lazyImages failed:', err); 221 } 222}; 223// CONCATENATED MODULE: ./app/js/navPages.js 224/* 225* 226* ÐавигаÑÐ¸Ð¾Ð½Ð½Ð°Ñ Ð¿Ð°Ð½ÐµÐ»Ñ 227* 228*/ 229var TABLET_BREAKPOINT = 992; 230var MORE_BUTTON_WIDTH = 50; // нам нÑжно Ñ ÑаниÑÑ Ð²Ñе ÑлеменÑÑ 231 232var navListItems = {}; 233var menuItemsAll = {}; 234var menuItemsAllWidth = {}; 235var lastWindowWitdh = 0; 236 237var initMobileMenu = function initMobileMenu(navPagesWrapper, index) { 238 var navPages = navPagesWrapper.querySelector('.nav-pages'); 239 var navPagesContainer = navPages.querySelector('.nav-pages--container'); // нÑжно веÑнÑÑÑ Ð²Ñе ÑлеменÑÑ Ð¸Ð· more в оÑновнÑÑ Ð¼ÐµÐ½Ñ 240 // Ð´Ð»Ñ ÑлÑÑаÑ, еÑли Ð¼Ñ ÑменÑÑили ÑиÑÐ¸Ð½Ñ Ð¸ more бÑло заполнено 241 242 var allUnfitItems = menuItemsAll[index]; 243 var allUnfitItemsWidth = menuItemsAllWidth[index]; 244 245 while (allUnfitItems.length) { 246 navPagesContainer.appendChild(allUnfitItems.pop()); 247 allUnfitItemsWidth.pop(); 248 } // ÑдалÑем moreButton еÑли она еÑÑÑ 249 250 251 var moreButton = navPages.querySelector('.nav-pages__more-list'); 252 253 if (moreButton) { 254 moreButton.remove(); 255 } // нÑжно ÑдалиÑÑ Ð¿ÑоÑлÑе click listeners, клониÑÑем ÐºÐ½Ð¾Ð¿ÐºÑ Ð´Ð»Ñ ÑÑого 256 257 258 var oldButtonNavPages = navPagesWrapper.querySelector('.nav-pages-button-phone'); 259 var newButtonOpenNavPages = oldButtonNavPages.cloneNode(true); 260 oldButtonNavPages.parentNode.replaceChild(newButtonOpenNavPages, oldButtonNavPages); // и беÑем новÑÑ ÐºÐ½Ð¾Ð¿ÐºÑ 261 262 var buttonOpenNavPages = navPagesWrapper.querySelector('.nav-pages-button-phone'); 263 264 if (!navListItems[index]) { 265 navListItems[index] = navPages.querySelectorAll('.nav-pages__item'); 266 } 267 268 var buttonCloseNavPages = navPages.querySelector('.nav-pages-title-phone'); // open sidebar mobile 269 270 buttonOpenNavPages.addEventListener('click', function () { 271 navPages.classList.add('open'); 272 document.body.classList.add('hidden'); 273 }); // close sidebar mobile 274 275 buttonCloseNavPages.addEventListener('click', function () { 276 navPages.classList.remove('open'); 277 document.body.classList.remove('hidden'); 278 }); 279 280 for (var i = 0; i < navListItems[index].length; i++) { 281 navListItems[index][i].classList.remove('openListIn'); 282 } 283 284 navPages.addEventListener('click', function (e) { 285 if (e.target.classList.contains('arrow')) { 286 console.log('open arrow'); 287 e.preventDefault(); 288 e.target.parentElement.parentElement.classList.toggle('openListIn'); 289 } 290 }); 291}; 292 293var initDesktopMenu = function initDesktopMenu(navPagesWrapper, index) { 294 var navPages = navPagesWrapper.querySelector('.nav-pages'); 295 var navPagesWidth = navPages.clientWidth; 296 var navPagesContainer = navPages.querySelector('.nav-pages--container'); 297 var navPagesContainerWidth = navPagesContainer ? navPagesContainer.scrollWidth : 0; 298 var allUnfitItemsWidth = menuItemsAllWidth[index]; 299 var allUnfitItems = menuItemsAll[index]; // Ðам нÑжно ÑÐ¾Ñ ÑаниÑÑ Ð²Ñе "невлезаÑÑие" ÑлеменÑÑ Ð¸ оÑделÑно Ð¸Ñ ÑиÑинÑ. 300 301 while (navPagesContainerWidth > navPagesWidth - MORE_BUTTON_WIDTH) { 302 var menuItems = navPages.querySelectorAll('.nav-pages__item'); 303 var lastItem = menuItems[menuItems.length - 1]; 304 allUnfitItems.push(lastItem); 305 allUnfitItemsWidth.push(lastItem.clientWidth); // поÑле Ñого, как ÑÐ¾Ñ Ñанили ÑÐ»ÐµÐ¼ÐµÐ½Ñ Ð² ÑпиÑке, ÑдалÑем его из Ð¼ÐµÐ½Ñ 306 307 lastItem.remove(); // и ÑменÑÑаем ÑиÑÐ¸Ð½Ñ ÐºÐ¾Ð½ÑейнеÑа. 308 309 navPagesContainerWidth = navPagesContainer ? navPagesContainer.scrollWidth : 0; 310 } // далее нÑжно пÑовеÑиÑÑ, пÑи ÑаÑÑиÑении не Ð²Ð»ÐµÐ·ÐµÑ Ð»Ð¸ еÑе один ÑÐ»ÐµÐ¼ÐµÐ½Ñ Ð² Ð¼ÐµÐ½Ñ 311 312 313 var currentLastItemWidth = allUnfitItemsWidth[allUnfitItemsWidth.length - 1]; 314 315 while (navPagesContainerWidth + currentLastItemWidth <= navPagesWidth - MORE_BUTTON_WIDTH) { 316 // еÑли влезаеÑ, ÑдалÑем ÑÐ»ÐµÐ¼ÐµÐ½Ñ Ð¸Ð· ÑпиÑка и добавлÑем его в Ð¼ÐµÐ½Ñ 317 navPagesContainer.appendChild(allUnfitItems.pop()); 318 allUnfitItemsWidth.pop(); // и нÑжно взÑÑÑ Ð½Ð¾Ð²Ñй "поÑледний ÑлеменÑ" 319 320 currentLastItemWidth = allUnfitItemsWidth[allUnfitItemsWidth.length - 1]; // пеÑеÑÑиÑÑваем ÑиÑÐ¸Ð½Ñ ÐºÐ¾Ð½ÑейнеÑа (в данном ÑлÑÑае оÐ
320½Ð° ÑвелиÑиÑÑÑ) 321 322 navPagesContainerWidth = navPagesContainer ? navPagesContainer.scrollWidth : 0; 323 } // Создаем / модиÑиÑиÑÑем ÐºÐ¾Ð¼Ð¿Ð¾Ð½ÐµÐ½Ñ Ñ Ð¾ÑÑалÑнÑми ÑлеменÑами ÑпиÑка, ÑÑо не влезли 324 325 326 var moreList__ul; 327 var existedMoreButton = navPages.querySelector('.nav-pages__more-list'); 328 329 if (allUnfitItems.length && !existedMoreButton) { 330 // еÑли moreButton еÑе неÑ, Ñо и moreList, moreList__span, moreList__ul Ñоже неÑ, Ñк они - доÑеÑние ÑлеменÑÑ 331 // и нам нÑжно Ð¸Ñ ÑоздаÑÑ 332 var moreList = document.createElement('div'); 333 moreList.classList.add('nav-pages__more-list'); 334 var moreList__span = document.createElement('span'); 335 moreList__span.classList.add('icon'); 336 moreList__ul = document.createElement('ul'); 337 moreList__ul.classList.add('nav-pages__more-list--ul'); 338 moreList.appendChild(moreList__span); 339 moreList.appendChild(moreList__ul); 340 navPages.appendChild(moreList); 341 } else if (!allUnfitItems.length && existedMoreButton) { 342 // еÑли ÑпиÑок невлезÑÐ¸Ñ ÑлеменÑов пÑÑÑ Ð¸ кнопка еÑÑÑ - ÑдалÑем ее 343 existedMoreButton.remove(); 344 } else { 345 // еÑли ÑпиÑок непÑÑÑ, Ñо нÑжно пÑоÑÑо его модиÑиÑиÑоваÑÑ 346 moreList__ul = navPages.querySelector('.nav-pages__more-list--ul'); 347 } // оÑиÑаем ÑпиÑок и добавлÑем вÑе ÑлеменÑÑ Ð¸Ð· ÑпиÑка "невлезÑÐ¸Ñ ÑлеменÑов" 348 // Ñак легÑе, Ñем пÑовеÑÑÑÑ, какие ÑлеменÑÑ Ñам Ñже еÑÑÑ Ð¸ какие нÑжно добавиÑÑ/ÑдалиÑÑ 349 350 351 if (moreList__ul) { 352 moreList__ul.innerHTML = ''; 353 allUnfitItems.forEach(function (item) { 354 moreList__ul.insertBefore(item, moreList__ul.firstChild); 355 }); 356 } 357}; 358 359var initOneMenuBlock = function initOneMenuBlock(navPagesWrapper, index) { 360 if (window.innerWidth <= 992) { 361 if (lastWindowWitdh === 0 || lastWindowWitdh > 992) { 362 initMobileMenu(navPagesWrapper, index); 363 } 364 } else { 365 initDesktopMenu(navPagesWrapper, index); 366 } 367}; 368 369var initNavPages = function initNavPages(navPagesList) { 370 navPagesList.forEach(function (navPagesWrapper, i) { 371 menuItemsAll[i] = []; 372 menuItemsAllWidth[i] = []; 373 initOneMenuBlock(navPagesWrapper, i); 374 }); 375 lastWindowWitdh = window.innerWidth; 376}; 377 378var onResizeNavPages = function onResizeNavPages(navPagesList) { 379 navPagesList.forEach(function (navPagesWrapper, i) { 380 initOneMenuBlock(navPagesWrapper, i); 381 }); 382 lastWindowWitdh = window.innerWidth; 383}; 384 385var initMenu = function initMenu() { 386 try { 387 var navPagesList = document.querySelectorAll('.nav-pages__wrapper'); 388 initNavPages(navPagesList); 389 window.addEventListener('resize', function () { 390 return onResizeNavPages(navPagesList); 391 }); 392 } catch (e) { 393 console.log(e); 394 } 395}; 396// CONCATENATED MODULE: ./app/js/banner.js 397var showBanner = function showBanner() { 398 var banner = "\n <div class=\"smart-app-banner__smartbanner\">\n <div class=\"smart-app-banner__leftPart\">\n <span class=\"smart-app-banner__close\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 11 11\">\n <path fill-rule=\"evenodd\" stroke=\"#7c7a7c\" stroke-linecap=\"square\" stroke-width=\"1.5\"\n d=\"M9.89 1L1 9.89 9.89 1zM1 1l8.89 8.89L1 1z\"></path>\n </svg>\n </span>\n <span class= \"smart-app-banner__icon\"></span>\n <div class=\"smart-app-banner__info\">\n <div class=\"smart-app-banner__title\">SkolCity \"\u0421\u043A\u043E\u043B\u043A\u043E\u0432\u043E\"</div>\n <div>\u041C\u043E\u0431\u0438\u043B\u044C\u043D\u043E\u0435 \u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u0435</div>\n <div class=\"smart-app-banner__price\">\u0411\u0415\u0421\u041F\u041B\u0410\u0422\u041D\u041E</div>\n </div>\n </div>\n <a href=\"https://link.sk.ru/sc\" class=\"smart-app-banner__button\" target=\"_blank\">\n \u0421\u043C\u043E\u0442\u0440\u0435\u0442\u044C\n </a>\n </div>\n "; 399 400 var closeBanner = function closeBanner() { 401 localStorage.setItem("isBannerHidden", true); 402 document.querySelector(".smart-app-banner__smartbanner").remove(); 403 }; 404 405 document.getElementById("sk-menu-header-external").insertAdjacentHTML("beforebegin", banner); 406 document.querySelector(".smart-app-banner__close").addEventListener("click", closeBanner); 407}; 408 409var initBanner = function initBanner() { 410 try { 411 if (!localStorage.getItem("isBannerHidden")) { 412 window.addEventListener("DOMContentLoaded", showBanner); 413 } 414 } catch (error) { 415 console.log("Banner Failed:", error); 416 } 417}; 418// CONCATENATED MODULE: ./app/js/news/typeDropdown.js 419function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } 420 421function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } 422 423function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } 424 425function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } 426
427var TYPE_PARAM_NAME = 'q_type'; 428 429var redirectOnRightPath = function redirectOnRightPath(nextItemId) { 430 if (!nextItemId) { 431 return; 432 } 433 434 var searchParams = new URLSearchParams(window.location.search); 435 436 if (searchParams.has(TYPE_PARAM_NAME)) { 437 searchParams.set(TYPE_PARAM_NAME, nextItemId); 438 } else { 439 searchParams.append(TYPE_PARAM_NAME, nextItemId); 440 } 441 442 window.location.search = searchParams.toString(); 443}; 444 445var onDropdownItemClick = function onDropdownItemClick(ev) { 446 if (!ev || !ev.target) { 447 return; 448 } 449 450 var itemElement = ev.target; 451 var itemId = itemElement.getAttribute('data-type-id'); 452 453 if (!itemId) { 454 return; 455 } 456 457 ev.preventDefault(); 458 redirectOnRightPath(itemId); 459}; 460 461var handleDropdownItems = function handleDropdownItems(items) { 462 if (!items || !items.length) { 463 return; 464 } 465 466 items.forEach(function (item) { 467 item.addEventListener('click', onDropdownItemClick); 468 }); 469}; 470 471var resetType = function resetType(ev) { 472 ev.preventDefault(); 473 var searchParams = new URLSearchParams(window.location.search); 474 searchParams.delete(TYPE_PARAM_NAME); 475 window.location.search = searchParams.toString(); 476}; 477 478var initTypeDropdownHandler = function initTypeDropdownHandler() { 479 var dropdownContainer = document.querySelector('.news-filter-type'); 480 481 if (!dropdownContainer) { 482 return; 483 } 484 485 var resetTypeButton = dropdownContainer.querySelector('.filter_all-info__link_type-reset'); 486 487 if (resetTypeButton) { 488 resetTypeButton.addEventListener('click', resetType); 489 } 490 491 var dropdownItems = _toConsumableArray(dropdownContainer.querySelectorAll('.filter_all-info__link_type')); 492 493 if (dropdownItems && dropdownItems.length !== 0) { 494 handleDropdownItems(dropdownItems); 495 } 496}; 497 498 499/* harmony default export */ var typeDropdown = (initTypeDropdownHandler); 500// CONCATENATED MODULE: ./app/js/news/searchForm.js
501var SEARCH_PARAM_NAME = 'q_text'; 502 503var addSearchActions = function addSearchActions() { 504 var searchFormContainer = document.querySelector('.search-form'); 505 506 if (!searchFormContainer) { 507 return; 508 } 509 510 var inputWrapper = searchFormContainer.querySelector('.search-field-wrap'); 511 512 if (!inputWrapper) { 513 return; 514 } 515 516 var input = inputWrapper.querySelector('.search-field'); 517 var clearButton = inputWrapper.querySelector('.search-field-clear'); 518 var searchButton = inputWrapper.querySelector('.search-form__submit'); 519 520 if (!input) { 521 return; 522 } 523 524 var searchParams = new URLSearchParams(window.location.search); 525 526 var isSearchFilterSet = function isSearchFilterSet() { 527 return searchParams && searchParams.get(SEARCH_PARAM_NAME); 528 }; 529 530 var showClearButton = function showClearButton() { 531 return clearButton.classList.add('active'); 532 }; 533 534 var hideClearButton = function hideClearButton() { 535 return clearButton.classList.remove('active'); 536 }; 537 538 var disableSearchButton = function disableSearchButton() { 539 if (searchButton) { 540 searchButton.disabled = true; 541 } 542 }; 543 544 var activateSearchButton = function activateSearchButton() { 545 if (searchButton) { 546 searchButton.disabled = false; 547 } 548 }; 549 550 var isClearButtonShowing = function isClearButtonShowing() { 551 return clearButton.classList.contains('active'); 552 }; 553 554 var isClearButtonNeedShow = function isClearButtonNeedShow() { 555 return input.value || isSearchFilterSet(); 556 }; 557 558 var resetSearchFilter = function resetSearchFilter() { 559 searchParams.delete(SEARCH_PARAM_NAME); 560 window.location.search = searchParams.toString(); 561 }; 562 563 var onClearClickHandler = function onClearClickHandler(ev) { 564 ev.preventDefault(); 565 566 if (isSearchFilterSet()) { 567 resetSearchFilter(); 568 } else { 569 input.value = ''; 570 disableSearchButton(); 571 hideClearButton(); 572 input.focus(); 573 } 574 }; 575 576 var onInputHandler = function onInputHandler() { 577 if (isClearButtonNeedShow()) { 578 if (!isClearButtonShowing()) { 579 showClearButton(); 580 } 581 } else if (isClearButtonShowing()) { 582 hideClearButton(); 583 } 584 585 if (!input.value) { 586 disableSearchButton(); 587 } else { 588 activateSearchButton(); 589 } 590 }; // if there is an initial value 591 592 593 if (isClearButtonNeedShow()) { 594 showClearButton(); 595 } 596 597 if (clearButton) { 598 clearButton.addEventListener('click', onClearClickHandler); 599 } 600 601 if (!input.value) { 602 disableSearchButton(); 603 } 604 605 input.addEventListener('input', onInputHandler); 606}; 607 608var initOnSearchSubmitHandler = function initOnSearchSubmitHandler() { 609 var searchFormContainer = document.querySelector('.search-form'); 610 611 if (!searchFormContainer) { 612 return; 613 } 614 615 var onSearchFormSubmit = function onSearchFormSubmit(ev) { 616 var input = searchFormContainer.querySelector(".search-field[name=\"".concat(SEARCH_PARAM_NAME, "\"]")); 617 618 if (!input) { 619 return; 620 } 621 622 ev.preventDefault(); 623 var searchValue = input.value; 624 625 if (!searchValue) { 626 return; 627 } 628 629 var searchParams = new URLSearchParams(window.location.search); 630 631 if (searchParams.has(SEARCH_PARAM_NAME)) { 632 searchParams.set(SEARCH_PARAM_NAME, searchValue); 633 } else { 634 searchParams.append(SEARCH_PARAM_NAME, searchValue); 635 } 636 637 window.location.search = searchParams.toString(); 638 }; 639 640 searchFormContainer.addEventListener('submit', onSearchFormSubmit); 641}; 642 643 644// EXTERNAL MODULE: ./app/js/window.js 645var js_window = __webpack_require__(2); 646 647// CONCATENATED MODULE: ./app/js/news/list.js 648function list_toConsumableArray(arr) { return list_arrayWithoutHoles(arr) || list_iterableToArray(arr) || list_nonIterableSpread(); } 649 650function list_nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } 651 652function list_iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } 653 654function list_arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } 655 656// import debounce from './debounce'; 657 658 659 660 661var list_TABLET_BREAKPOINT = 992; 662var MOBILE_BREAKPOINT = 640; 663var lastWidth = window.innerWidth; // QUERY STUFF 664// the value from what we want get the new page of news 665 666var _queryOffset = 0; // current value of limit 667 668var _queryLimit; // limit for first loading 669 670 671var _firstQueryLimit; // flag if we have any more news to download; 672 673 674var _shouldLoadNews = true; 675 676var setQueryLimit = function setQueryLimit(limit) { 677 _queryLimit = limit; 678}; 679 680var setFirstQueryLimit = function setFirstQueryLimit(limit) { 681 _firstQueryLimit = limit; 682}; 683 684var setQueryOffset = function setQueryOffset(offset) { 685 _queryOffset = offset; 686}; 687 688var setInitialQueryData = function setInitialQueryData() { 689 // изменÑем Ð»Ð¾Ð³Ð¸ÐºÑ Ð² ÑооÑвеÑÑÑвии Ñ Ð·Ð°Ð´Ð°Ñей 690 // https://mc.usetech.ru/redmine/issues/53847 691 if (lastWidth > list_TABLET_BREAKPOINT) { 692 setQueryLimit(48); 693 setFirstQueryLimit(48); 694 } else if (lastWidth > MOBILE_BREAKPOINT) { 695 setQueryLimit(24); 696 setFirstQueryLimit(24); 697 } else { 698 setQueryLimit(24); 699 setFirstQueryLimit(24); 700 } 701}; 702 703var addEmptyBlocks = function addEmptyBlocks() { 704 if (window.location.href.indexOf('q_type=2') !== -1) { 705 return; 706 } 707 708 var newsSectionContent = document.querySelector('.news-scrolload-block .sections-page__content'); 709 710 if (newsSectionContent) { 711 var emptyBlock = document.createElement('div'); 712 emptyBlock.classList.add('section_news__item'); 713 emptyBlock.classList.add('sections-page__item'); 714 emptyBlock.classList.add('empty'); 715 emptyBlock.innerHTML = "<div class=\"section_news__item--img\" style=\"width: 100%; height: 232px; background-color: #f9f9fb;\"></div>"; 716 717 if (lastWidth > list_TABLET_BREAKPOINT) { 718 newsSectionContent.append(emptyBlock.cloneNode(true)); 719 newsSectionContent.append(emptyBlock.cloneNode(true)); 720 newsSectionContent.append(emptyBlock.cloneNode(true)); 721 } else if (lastWidth > MOBILE_BREAKPOINT) { 722 newsSectionContent.append(emptyBlock.cloneNode(true)); 723 newsSectionContent.append(emptyBlock.cloneNode(true)); 724 } else { 725 newsSectionContent.append(emptyBlock.cloneNode(true)); 726 } 727 } 728}; // LOADING STATE 729 730 731var addLoadingDots = function addLoadingDots() { 732 var loadMoreButton = document.querySelector(".news__load-more-button"); 733 var newsSection = document.querySelector('.news-scrolload-block'); 734 735 if (!newsSection) { 736 return; 737 } 738 739 if (loadMoreButton) loadMoreButton.style.display = 'none'; 740 addEmptyBlocks(); 741 var elem = document.createElement('div'); 742 elem.classList.add('loader-wrapper'); 743 elem.innerHTML = "\n <div class=\"loader\">\n <div class=\"loader__item\"></div>\n <div class=\"loader__item\"></div>\n <div class=\"loader__item\"></div>\n </div>"; 744 newsSection.appendChild(elem); 745}; 746 747var isThereLoadingDots = function isThereLoadingDots() { 748 var newsSection = document.querySelector('.news-scrolload-block'); 749 750 if (!newsSection) { 751 return false;
752 } 753 754 var loadingDots = newsSection.querySelector('.loader-wrapper'); 755 756 if (loadingDots) { 757 return true; 758 } 759 760 return false; 761}; 762 763var removeLoadingDots = function removeLoadingDots() { 764 var loader = document.querySelector('.loader-wrapper'); 765 var loadMoreButton = document.querySelector(".news__load-more-button"); 766 if (loader) loader.remove(); 767 if (loadMoreButton) loadMoreButton.style.display = 'block'; 768}; 769 770var removeEmptyBlocks = function removeEmptyBlocks() { 771 try { 772 var emptyBlocks = document.getElementsByClassName('section_news__item sections-page__item empty'); 773 774 if (emptyBlocks && emptyBlocks.length) { 775 while (emptyBlocks[0]) { 776 emptyBlocks[0].parentNode.removeChild(emptyBlocks[0]); 777 } 778 } 779 } catch (e) { 780 console.log('removeEmptyBlocks error', e); 781 } 782}; 783 784var setLoadingState = function setLoadingState() { 785 if (!isThereLoadingDots()) { 786 addLoadingDots(); 787 } 788}; 789 790var resetLoadingState = function resetLoadingState() { 791 removeLoadingDots(); 792 removeEmptyBlocks(); 793}; 794 795var setShouldLoadNews = function setShouldLoadNews(value) { 796 _shouldLoadNews = value; 797}; // догÑÑжаем ÑÑолÑко новоÑÑей, ÑÑÐ¾Ð±Ñ Ð¿Ð¾ÑвилÑÑ Ð²ÐµÑÑикалÑнÑй ÑкÑÐ¾Ð»Ð»Ð±Ð°Ñ Ð½Ð° ÑÑÑаниÑе 798 799 800var isNewsEnough = function isNewsEnough() { 801 return window.innerWidth > document.body.clientWidth || document.body.scrollHeight > document.body.offsetHeight; 802}; 803 804var list_isFilteringRequest = function isFilteringRequest(query) { 805 if (!query) { 806 return false; 807 } 808 809 var searchParams = new URLSearchParams(query); 810 return searchParams.get(TYPE_PARAM_NAME) || searchParams.get(SEARCH_PARAM_NAME); 811}; 812 813var isNeedToShowNoNewsMessage = function isNeedToShowNoNewsMessage(query, newsContainer) { 814 return list_isFilteringRequest(query) && newsContainer && newsContainer.children && newsContainer.children.length === 0; 815}; 816 817var showNoNewsMessage = function showNoNewsMessage() { 818 var noNewsMessageContainer = document.querySelector('.no-news-message'); 819 820 if (noNewsMessageContainer && noNewsMessageContainer.classList) { 821 noNewsMessageContainer.classList.add('active'); 822 } 823}; 824/** 825 * Download HTML news fragments using paginaton 826 */ 827 828 829var getNews = function getNews(limit, offset) { 830 return new Promise(function (resolve, reject) { 831 var newsWrapper = document.querySelector('.news-scrolload-block'); 832 833 if (!newsWrapper) { 834 reject(); 835 } 836 837 var url = "/news/list/?per_page=".concat(limit, "&offset=").concat(offset, "&").concat(newsWrapper.dataset.query); 838 fetch(url, { 839 method: 'GET' 840 }).then(function (res) { 841 if (res.status === 404) { 842 var error = new Error('Not found'); 843 reject(error); 844 } 845 846 return res.text(); 847 }).then(function (res) { 848 res = res.trim(); 849 resolve(res); 850 }).catch(function (err) { 851 return reject(err); 852 }); 853 }); 854}; 855 856var loadAndRenderNews = function loadAndRenderNews(limit, offset) { 857 if (!limit && typeof limit !== 'number' || !offset && typeof offset !== 'number') { 858 return; 859 } 860 861 var newsWrapper = document.querySelector('.news-scrolload-block'); 862 var newsContainer = document.querySelector('.news-scrolload-block .sections-page__content'); 863 864 if (!newsWrapper || !newsContainer) { 865 return; 866 } 867 868 setShouldLoadNews(false); 869 setLoadingState(); 870 getNews(limit, offset).then(function (news) { 871 if (news) { 872 list_insertNewsToContainer(news, newsContainer).then(function () { 873 setQueryOffset(offset + limit); 874 875 if (!isNewsEnough()) { 876 loadAndRenderNews(_queryLimit, _queryOffset); 877 } else { 878 resetLoadingState(); 879 setShouldLoadNews(true); 880 } 881 }); 882 } else { 883 // болÑÑе не нÑжно гÑÑзиÑÑ Ð½Ð¾Ð²Ð¾ÑÑи, новоÑÑи конÑилиÑÑ 884 setShouldLoadNews(false); 885 resetLoadingState(); 886 887 if (isNeedToShowNoNewsMessage(newsWrapper.dataset.query, newsContainer)) { 888 showNoNewsMessage(); 889 } 890 } 891 }).catch(function (error) { 892 console.error(error); 893 resetLoadingState(); 894 setShouldLoadNews(false); 895 896 if (isNeedToShowNoNewsMessage(newsWrapper.dataset.query, newsContainer)) { 897 showNoNewsMessage(); 898 } 899 }); 900}; 901 902var onNewsClickHandler = function onNewsClickHandler(newsResultContainer) { 903 try { 904 var _document = document, 905 documentElement = _document.documentElement; 906 907 if (localStorage) { 908 var newsCache = { 909 newsHtml: newsResultContainer.innerHTML, 910 newsContainerHeight: newsResultContainer.offsetHeight, 911 scrollPosition: window.pageYOffset || documentElement.scrollTop 912 }; 913 localStorage.setItem('news-cache', JSON.stringify(newsCache)); 914 } 915 } catch (error) { 916 console.error(error); 917 } 918}; 919 920var list_insertNewsToContainer = function insertNewsToContainer(res, newsResultContainer) { 921 return new Promise(function (insertingResolve) { 922 var imagePromises = []; 923 var shadowNewsElements = []; 924 var shadowNewsNode = document.createElement('div'); 925 shadowNewsNode.setAttribute('style', 'display: none;'); 926 shadowNewsNode.innerHTML += res; 927 shadowNewsElements = list_toConsumableArray(shadowNewsNode.querySelectorAll('.news-item')); 928 var image = null;
928 // shadowNewsElements.forEach((item) => { 929 // image = item.querySelector('[data-background]'); 930 // imagePromises.push(new Promise((resolve) => { 931 // if (image) { 932 // const timeoutId = setTimeout(resolve, 2000); 933 // image.onload = () => { resolve(); clearTimeout(timeoutId); }; 934 // image.onerror = () => { resolve(); clearTimeout(timeoutId); }; 935 // } else { 936 // resolve(); 937 // } 938 // })); 939 // }); 940 // console.log('imagePromises', imagePromises); 941 // Promise.all(imagePromises).then(() => { 942 943 shadowNewsElements.forEach(function (item) { 944 newsResultContainer.appendChild(item); 945 item.addEventListener('click', onNewsClickHandler.bind(null, newsResultContainer)); 946 }); 947 shadowNewsElements = null; 948 insertingResolve(); // }); 949 }).then(function () { 950 lazyImagesLoader(); 951 }); 952}; // SCROLL STUFF 953 954 955var list_isNeedToAddNewsAfterScroll = function isNeedToAddNewsAfterScroll() { 956 var _document2 = document, 957 documentElement = _document2.documentElement; 958 var clientHeight = documentElement.clientHeight; 959 var scrollHeight = Object(js_window["a" /* getScrollHeight */])(); 960 var scrollTop = Object(js_window["b" /* getScrollTop */])(); 961 return _shouldLoadNews && Math.floor(scrollHeight - scrollTop) <= clientHeight + 160; 962}; 963/* 964* checks if we need to load news, load new page of news and modify pagination values 965* @return {void} 966*/ 967 968 969var onScroll = function onScroll() { 970 if (list_isNeedToAddNewsAfterScroll()) { 971 loadAndRenderNews(_queryLimit, _queryOffset); 972 } 973}; 974 975var onButtonClick = function onButtonClick() { 976 loadAndRenderNews(_queryLimit, _queryOffset); 977}; 978/* 979* changes limit value depend on window width 980* @param {Event} e - resize event 981* @return {void} 982*/ 983 984 985var onResize = function onResize(e) { 986 var newWidth = e.target.innerWidth; 987 988 if (lastWidth > list_TABLET_BREAKPOINT && newWidth <= list_TABLET_BREAKPOINT || lastWidth <= list_TABLET_BREAKPOINT && newWidth > list_TABLET_BREAKPOINT) { 989 // recalculate limit only in this case 990 setQueryLimit(newWidth > list_TABLET_BREAKPOINT ? 3 : 2); 991 } 992 993 lastWidth = newWidth; 994}; 995 996var setEventHandlers = function setEventHandlers() { 997 /* const debounceOnResize = debounce(onResize, 200); 998 const debounceOnScroll = debounce(onScroll, 200); 999 window.addEventListener('resize', debounceOnResize); 1000 window.addEventListener('scroll', debounceOnScroll, false); */ 1001 window.addEventListener('resize', onResize); // window.addEventListener('scroll', onScroll, false); 1002 1003 var loadMoreButton = document.querySelector(".news__load-more-button"); 1004 if (loadMoreButton) loadMoreButton.addEventListener("click", onButtonClick); 1005}; // const removeEventHandlers = () => { 1006// window.removeEventListener('resize', onResize); 1007// window.removeEventListener('scroll', onScroll); 1008// }; 1009 1010/* 1011* load first page of news and set scroll & resize listeners for managing limit value 1012* @return {void} 1013*/ 1014 1015 1016var initNews = function initNews() { 1017 loadAndRenderNews(_firstQueryLimit, _queryOffset); 1018 setEventHandlers(); 1019};
1019 // const restoreNewsFromCache = (cache) => { 1020// const newsContainer = document.querySelector('.news-scrolload-block .sections-page__content'); 1021// if (!newsContainer) { 1022// return; 1023// } 1024// const { newsHtml, newsContainerHeight } = cache; 1025// const oldMinHeight = newsContainer.style.minHeight; 1026// if (newsContainerHeight) { 1027// newsContainer.style.minHeight = `${newsContainerHeight}px`; 1028// } 1029// insertNewsToContainer(newsHtml, newsContainer) 1030// .then(() => { 1031// if (newsContainerHeight) { 1032// newsContainer.style.minHeight = oldMinHeight; 1033// } 1034// const offset = newsContainer.children.length; 1035// setQueryOffset(offset); 1036// if (!isNewsEnough()) { 1037// loadAndRenderNews(_queryLimit, _queryOffset); 1038// } 1039// }); 1040// setEventHandlers(); 1041// }; 1042 1043 1044var initNewsList = function initNewsList() { 1045 try { 1046 // пока по кÑÑиÑÐ¾Ð²Ð°Ð½Ð¸Ñ Ð¿ÑиоÑÑÐ°Ð½Ð¾Ð²Ð»ÐµÐ½Ñ ÑабоÑÑ 1047 // if (document.querySelector('.news-scrolload-block .sections-page__content')) { 1048 // setInitialQueryData(); 1049 // if (localStorage && localStorage.getItem('news-cache')) { 1050 // const newsCache = localStorage.getItem('news-cache');
1051 // restoreNewsFromCache(JSON.parse(newsCache)); 1052 // localStorage.removeItem('news-cache'); 1053 // } else { 1054 // initNews(); 1055 // } 1056 // } 1057 setInitialQueryData(); 1058 initNews(); 1059 } catch (error) { 1060 console.error(error); 1061 } 1062}; 1063 1064/* harmony default export */ var news_list = (initNewsList); 1065// CONCATENATED MODULE: ./app/js/news/filters.js 1066 1067 1068 1069var filters_resetAllFilters = function resetAllFilters(searchParams, event) { 1070 event.preventDefault(); 1071 searchParams.delete(TYPE_PARAM_NAME); 1072 searchParams.delete(SEARCH_PARAM_NAME); 1073 window.location.search = searchParams.toString(); 1074}; 1075 1076var filters_initResetAllFilters = function initResetAllFilters() { 1077 var resetAllFiltersButton = document.querySelector('.search-section .search-section__reset-all-filters'); 1078 1079 if (!resetAllFiltersButton) { 1080 return; 1081 } 1082 1083 var searchParams = new URLSearchParams(window.location.search); 1084 1085 if (searchParams.get(TYPE_PARAM_NAME) || searchParams.get(SEARCH_PARAM_NAME)) { 1086 resetAllFiltersButton.classList.add('active'); 1087 } 1088 1089 resetAllFiltersButton.addEventListener('click', filters_resetAllFilters.bind(null, searchParams)); 1090}; 1091 1092var filters_initNewsFilters = function initNewsFilters() { 1093 try { 1094 typeDropdown(); 1095 addSearchActions(); 1096 initOnSearchSubmitHandler(); 1097 filters_initResetAllFilters(); 1098 } catch (error) { 1099 console.log('initNewsFiltersError', error); 1100 } 1101}; 1102 1103/* harmony default export */ var filters = (filters_initNewsFilters); 1104// EXTERNAL MODULE: ./app/scss/main.scss 1105var main = __webpack_require__(17); 1106 1107// CONCATENATED MODULE: ./app/js/eventCarousel.js 1108function eventCarousel_toConsumableArray(arr) { return eventCarousel_arrayWithoutHoles(arr) || eventCarousel_iterableToArray(arr) || eventCarousel_nonIterableSpread(); } 1109 1110function eventCarousel_nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } 1111 1112function eventCarousel_iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } 1113 1114function eventCarousel_arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } 1115 1116var ANIMATION_DURATION = 200; 1117var CHECKING_ARROWS_TIMEOUT = 200; // EaseInOut function for animation 1118// t = current time 1119// b = start value 1120// c = change in value 1121// d = duration 1122 1123var easeInOutQuad = function easeInOutQuad(t, b, c, d) { 1124 t /= d / 2; 1125 if (t < 1) return c / 2 * t * t + b; 1126 t -= 1; 1127 return -c / 2 * (t * (t - 2) - 1) + b; 1128}; 1129 1130var scrollTo = function scrollTo(element, to, duration, callback) { 1131 var start = element.scrollLeft; 1132 var change = to - start; 1133 var increment = 20; 1134 var currentTime = 0; 1135 1136 var animateScroll = function animateScroll() { 1137 currentTime += increment; 1138 var val = easeInOutQuad(currentTime, start, change, duration); 1139 element.scrollLeft = val; 1140 1141 if (currentTime < duration) { 1142 setTimeout(animateScroll, increment); 1143 } else { 1144 callback(); 1145 } 1146 }; 1147 1148 animateScroll(); 1149}; // Slicing long texts 1150 1151 1152var checkRowLength = function checkRowLength(eventsList) { 1153 var pageWidth = window.innerWidth; 1154 var titleLenghtRestrition = 16; 1155 eventsList.forEach(function (item) { 1156 var content = item.lastElementChild.textContent; 1157 var title = item.firstElementChild.textContent; 1158 var contentLengthRestriction = 75; 1159 1160 if (pageWidth > 1160) { 1161 contentLengthRestriction = 60; 1162 } else if (pageWidth > 992) { 1163 contentLengthRestriction = title.length > titleLenghtRestrition ? 35 : 60; 1164 } else if (pageWidth > 850) { 1165 contentLengthRestriction = 110; 1166 } else if (pageWidth > 700) { 1167 contentLengthRestriction = 90; 1168 } else if (pageWidth > 600) { 1169 contentLengthRestriction = 75; 1170 } else { 1171 contentLengthRestriction = title.length > titleLenghtRestrition ? 35 : 60; 1172 } 1173 1174 if (content.length > contentLengthRestriction) { 1175 item.lastElementChild.textContent = "".concat(content.slice(0, contentLengthRestriction - 3), "..."); 1176 } 1177 }); 1178}; // Init one carousel
1179 1180 1181var initEventsCarousel = function initEventsCarousel(eventsWrapper) { 1182 var eventsContainer = eventsWrapper.querySelector('.events-items-box'); 1183 1184 var eventsList = eventCarousel_toConsumableArray(eventsContainer.children); 1185 1186 var rightArrow = eventsWrapper.querySelector('.right-arrow-events'); 1187 var leftArrow = eventsWrapper.querySelector('.left-arrow-events'); 1188 var scrollIsPerformed = false; // we should disabled left arrow if we're on the beginning of the scroll 1189 1190 var isLeftArrowEnabled = function isLeftArrowEnabled() { 1191 var scrollLeft = eventsContainer.scrollLeft; 1192 return scrollLeft > 0; 1193 }; // we should disabled right arrow if we're on the end of the scroll 1194 1195 1196 var isRightArrowEnabled = function isRightArrowEnabled() { 1197 var scrollWidth = eventsContainer.scrollWidth, 1198 scrollLeft = eventsContainer.scrollLeft, 1199 clientWidth = eventsContainer.clientWidth; 1200 return scrollWidth - scrollLeft > clientWidth; 1201 }; // checking and changing arrows enable state 1202 1203 1204 var checkArrowsEnabled = function checkArrowsEnabled() { 1205 if (leftArrow) { 1206 if (isLeftArrowEnabled()) { 1207 leftArrow.classList.add('left-arrow-events-active'); 1208 } else { 1209 leftArrow.classList.remove('left-arrow-events-active'); 1210 } 1211 } 1212 1213 if (rightArrow) { 1214 if (isRightArrowEnabled()) { 1215 rightArrow.classList.add('right-arrow-events-active'); 1216 } else { 1217 rightArrow.classList.remove('right-arrow-events-active'); 1218 } 1219 } 1220 1221 scrollIsPerformed = false; 1222 }; 1223 1224 var getCurrentScrollLeft = function getCurrentScrollLeft() { 1225 var scrollLeft = eventsContainer.scrollLeft; 1226 return scrollLeft; 1227 }; 1228 1229 var getOneItemWidth = function getOneItemWidth(rawIdx) { 1230 var idx = !rawIdx || rawIdx < 0 ? 0 : rawIdx; 1231 1232 if (!eventsList[idx]) { 1233 return 0; 1234 } 1235 1236 return eventsList[idx].offsetWidth; 1237 }; 1238 1239 var getContainerWidth = function getContainerWidth() { 1240 var scrollWidth = Math.max(eventsContainer.scrollWidth, eventsContainer.offsetWidth, eventsContainer.clientWidth); 1241 return scrollWidth; 1242 }; 1243 1244 var onArrowClick = function onArrowClick() { 1245 var dir = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'right'; 1246 var itemWidth = getOneItemWidth(); 1247 var containerWidth = getContainerWidth(); 1248 var currentScrollLeft = getCurrentScrollLeft(); 1249 var selectedArrowCheck = dir === 'left' ? isLeftArrowEnabled() : isRightArrowEnabled(); 1250 var arrowOffset = dir === 'left' ? -1 : 1; 1251 var arrowBase = dir === 'left' ? 0 : containerWidth; 1252 var minMaxFunc = dir === 'left' ? Math.max : Math.min; 1253 1254 if (selectedArrowCheck && !scrollIsPerformed) { 1255 var newCurrentItem = Math.round(currentScrollLeft / itemWidth) + arrowOffset; 1256 var newItemWidth = getOneItemWidth(newCurrentItem); 1257 var newScrollLeftValue = minMaxFunc(newItemWidth * newCurrentItem, arrowBase); 1258 scrollIsPerformed = true; 1259 scrollTo(eventsContainer, newScrollLeftValue, ANIMATION_DURATION, checkArrowsEnabled); 1260 } 1261 }; 1262 1263 var onLeftArrowClick = function onLeftArrowClick() { 1264 onArrowClick('left'); 1265 }; 1266 1267 var onRightArrowClick = function onRightArrowClick() { 1268 onArrowClick('right'); 1269 }; 1270 1271 checkArrowsEnabled(); 1272 checkRowLength(eventsList); 1273 window.addEventListener('resize', function () { 1274 return checkRowLength(eventsList); 1275 }); 1276 leftArrow.addEventListener('click', onLeftArrowClick); 1277 rightArrow.addEventListener('click', onRightArrowClick); 1278 var timeout; 1279 eventsContainer.addEventListener('scroll', function () { 1280 clearTimeout(timeout); 1281 timeout = setTimeout(checkArrowsEnabled, CHECKING_ARROWS_TIMEOUT); 1282 }); 1283}; 1284 1285var initEvents = function initEvents() { 1286 try { 1287 var eventsContainers = document.querySelectorAll('.events-container'); 1288 eventsContainers.forEach(function (container) { 1289 return initEventsCarousel(container); 1290 }); 1291 } catch (e) { 1292 console.log(e); 1293 } 1294}; 1295// EXTERNAL MODULE: ./app/js/langUtils.js 1296var langUtils = __webpack_require__(3); 1297 1298// CONCATENATED MODULE: ./app/js/searchButtons.js 1299 // ÑилÑÑÑ Ð´Ð»Ñ ÑÑÑаниÑÑ Ð½Ð¾Ð²Ð¾ÑÑей 1300 1301var searchButtons_searchButtonsFilter = function searchButtonsFilter(button, list) { 1302 var widthPage = document.querySelector("body").clientWidth; 1303 1304 if (document.querySelectorAll(button).length > 0) { 1305 var searchMenuButton = document.querySelector(button); 1306 var searchMenu = document.querySelector(list); 1307 searchMenuButton.addEventListener("click", function () { 1308 this.classList.toggle("active"); 1309 searchMenu.classList.toggle("active"); 1310 1311 if (button === ".filter_all-info__button" && widthPage <= 992) { 1312 var body = document.querySelector("body"); 1313 var skMenuHeader = document.querySelector('#sk-menu-header-external .sk-universal-header'); // добавлÑем клаÑÑ Ð´Ð»Ñ body ÑÑÐ¾Ð±Ñ Ð½Ðµ ÑкÑоллилÑÑ 1314 1315 if (!body.classList.contains('hidden-secondary')) { 1316 body.classList.add("hidden-secondary"); 1317 1318 if (skMenuHeader) { 1319 skMenuHeader.style.zIndex = 1; 1320 } 1321 } else { 1322 body.classList.remove("hidden-secondary"); 1323 1324 if (skMenuHeader) { 1325 skMenuHeader.style.zIndex = 9; 1326 } 1327 } 1328 1329 this.classList.remove("active"); 1330 var lang = Object(langUtils["a" /* getCookie */])('sk_lang') || 'ru'; 1331 var titleSearchMobile = document.createElement("div"); 1332 titleSearchMobile.className = "filter_all-info__list--title"; 1333 var menuText = lang === 'ru' ? 'ÐÐµÐ½Ñ ÑÑÑаниÑÑ' : 'Menu'; 1334 titleSearchMobile.innerHTML = '<img class="svg-icon" height="18" src="/static/base/img/arrow-left.svg">' + '<p>' + menuText + '</p>'; 1335 searchMenu.insertBefore(titleSearchMobile, searchMenu.children[0]); 1336 titleSearchMobile.addEventListener('click', function () { 1337 var body = document.querySelector("body"); 1338 var skMenuHeader = document.querySelector('#sk-menu-header-external .sk-universal-header'); 1339 1340 if (!body.classList.contains('hidden-secondary')) { 1341 body.classList.add("hidden-secondary"); 1342 1343 if (skMenuHeader) { 1344 skMenuHeader.style.zIndex = 1; 1345 } 1346 } else { 1347 body.classList.remove("hidden-secondary"); 1348 1349 if (skMenuHeader) { 1350 skMenuHeader.style.zIndex = 9; 1351 } 1352 } 1353 1354 searchMenu.classList.toggle("active"); 1355 titleSearchMobile.remove(); 1356 }); 1357 } 1358 }); 1359 var searchButtonToggle = document.querySelector(".search-block-button"); 1360 var searchFormInput = document.querySelector(".search-section"); 1361 searchButtonToggle.addEventListener("click", function () { 1362 searchFormInput.classList.toggle("active"); 1363 this.classList.toggle("active"); 1364 }); 1365 } 1366}; 1367 1368var initSearchButtonsMenu = function initSearchButtonsMenu() { 1369 try { 1370 searchButtons_searchButtonsFilter(".filter_all-info__button", ".filter_all-info__list"); 1371 } catch (e) { 1372 console.log(e); 1373 } 1374};
1375// CONCATENATED MODULE: ./app/js/carousel.js 1376function carousel_toConsumableArray(arr) { return carousel_arrayWithoutHoles(arr) || carousel_iterableToArray(arr) || carousel_nonIterableSpread(); } 1377 1378function carousel_nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } 1379 1380function carousel_iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } 1381 1382function carousel_arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } 1383 1384var init = function init() { 1385 //@author Kholopov Maksim 1386 var carouselMainContainerList = document.querySelectorAll('.carousel-container') && carousel_toConsumableArray(document.querySelectorAll('.carousel-container')); //Integrated function for detect swipes on mobiles; 1387 1388 1389 var swipedetect = function swipedetect(el, callback) { 1390 var touchsurface = el, 1391 swipedir, 1392 startX, 1393 startY, 1394 dist, 1395 distX, 1396 distY, 1397 threshold = 150, 1398 //required min distance traveled to be considered swipe 1399 restraint = 100, 1400 // maximum distance allowed at the same time in perpendicular direction 1401 allowedTime = 300, 1402 // maximum time allowed to travel that distance 1403 elapsedTime, 1404 startTime, 1405 handleswipe = callback || function (swipedir) {}; 1406 1407 touchsurface.addEventListener('touchstart', function (e) { 1408 var touchobj = e.changedTouches[0]; 1409 swipedir = 'none'; 1410 dist = 0; 1411 startX = touchobj.pageX; 1412 startY = touchobj.pageY; 1413 startTime = new Date().getTime(); // record time when finger first makes contact with surface 1414 }, false); 1415 touchsurface.addEventListener('touchmove', function (e) {}, false); 1416 touchsurface.addEventListener('touchend', function (e) { 1417 var touchobj = e.changedTouches[0]; 1418 distX = touchobj.pageX - startX; // get horizontal dist traveled by finger while in contact with surface 1419 1420 distY = touchobj.pageY - startY; // get vertical dist traveled by finger while in contact with surface 1421 1422 elapsedTime = new Date().getTime() - startTime; // get time elapsed 1423 1424 if (elapsedTime <= allowedTime) { 1425 // first condition for awipe met 1426 if (Math.abs(distX) >= threshold && Math.abs(distY) <= restraint) { 1427 // 2nd condition for horizontal swipe met 1428 swipedir = distX < 0 ? 'left' : 'right'; // if dist traveled is negative, it indicates left swipe 1429 } else if (Math.abs(distY) >= threshold && Math.abs(distX) <= restraint) { 1430 // 2nd condition for vertical swipe met 1431 swipedir = distY < 0 ? 'up' : 'down'; // if dist traveled is negative, it indicates up swipe 1432 } 1433 } 1434 1435 handleswipe(swipedir); 1436 }, false); 1437 }; 1438 1439 var mainCarouselAssemble = function mainCarouselAssemble(list) { 1440 if (list) { 1441 list.forEach(function (item) { 1442 var currentCarouselContent = item.querySelector('.carousel-content'); 1443 var previousSlideButton = currentCarouselContent.querySelector('.left-arrow'); 1444 var nextSlideButton = currentCarouselContent.querySelector('.right-arrow'); 1445 var carouselDotsContainer = item.querySelector('.carousel-elements-circles'); 1446 var carouselImagesNode = currentCarouselContent.querySelector('.carousel-image-box'); 1447 var carouselImageDescription = item.querySelector('.carousel-img-description'); 1448 var carouselImageCounter = item.querySelector('.carousel-counter'); 1449 var carouselImagesLinks = carouselImagesNode ? carouselImagesNode.children : []; 1450 1451 var carouselImagesList = carouselImagesLinks && carousel_toConsumableArray(carouselImagesLinks).map(function (link) { 1452 return link.firstElementChild; 1453 }); 1454 1455 var autoSwipe = null; // @todo ÑбÑаÑÑ Ð¸Ð½Ð¸ÑиализаÑÐ¸Ñ ÑÑнкÑии из маÑÑива 1456 1457 var setUpAutoSwipe = function setUpAutoSwipe(timer) { 1458 if (timer) { 1459 try { 1460 autoSwipe = setInterval(function () { 1461 chooseNextSlide(carouselImagesList); 1462 }, parseInt(timer * 1000)); 1463 } catch (e) { 1464 throw Error(e); 1465 } 1466 } 1467 }; // @todo ÑбÑаÑÑ Ð¸Ð½Ð¸ÑиализаÑÐ¸Ñ ÑÑнкÑии из маÑÑива 1468 1469 1470 var carouselInit = function carouselInit(list) { 1471 if (list) { 1472 // обновлÑем ÑÑеÑÑик 1473 if (carouselImageCounter) { 1474 carouselImageCounter.textContent = "1/".concat(list.length); 1475 } // console.log('list: ', list); 1476 1477 1478 list.forEach(function (item) { 1479 // console.log('item: ', item); 1480 if (item.dataset.imageId == '0') { 1481 item.parentElement.classList.add('active'); 1482 1483 if (carouselImageDescription) { 1484 item.dataset.imageDescription ? carouselImageDescription.innerHTML = item.dataset.imageDescription + '' : carouselImageDescription.innerHTML = ''; 1485 } // console.log(carouselImagesList); 1486 1487 1488 carouselImagesList.forEach(function (element) { 1489 element.dataset.imageLink ? element.parentElement.setAttribute('href', element.dataset.imageLink) : null; 1490 }); 1491 currentCarouselContent.dataset.autoplay && setUpAutoSwipe(currentCarouselContent.dataset.autoplay); 1492 } 1493 }); 1494 } 1495 }; 1496 /* 1497 * Chooses new image for displaying 1498 * @param {object}
1498 image - object containing image for display 1499 * @param {function} activeDotSwitcher - function to call after choosing new image for set correct dot active; 1500 * @return {void} 1501 */ 1502 // @todo ÑбÑаÑÑ Ð¸Ð½Ð¸ÑиализаÑÐ¸Ñ ÑÑнкÑии из маÑÑива 1503 1504 1505 var currentImageChooser = function currentImageChooser(image) { 1506 if (image) { 1507 carouselImagesList.forEach(function (item) { 1508 var parent = item.parentElement; 1509 1510 if (item === image) { 1511 parent.classList.add('active'); 1512 } else { 1513 parent.classList.remove('active'); 1514 } 1515 }); 1516 1517 if (carouselImageDescription) { 1518 image.dataset.imageDescription ? carouselImageDescription.innerHTML = image.dataset.imageDescription : carouselImageDescription.innerHTML = ''; 1519 } 1520 1521 activeDotSwitcher(image.dataset.imageId); 1522 autoSwipe && clearInterval(autoSwipe); 1523 currentCarouselContent.dataset.autoplay && setUpAutoSwipe(currentCarouselContent.dataset.autoplay); 1524 } 1525 }; 1526 /* 1527 * Chooses previous slide 1528 * @param {array} list - list of images 1529 * @param {object} currentImage - displaying at this moment image in slider 1530 * @param {function} currentImageChooser - function to call after switching image 1531 * @return {void} 1532 */ 1533 // @todo ÑбÑаÑÑ Ð¸Ð½Ð¸ÑиализаÑÐ¸Ñ ÑÑнкÑии из маÑÑива 1534 1535 1536 var choosePreviousSlide = function choosePreviousSlide(list) { 1537 if (list) { 1538 var currentImage = list.find(function (item) { 1539 return item.parentElement.classList.contains('active') ? item : null; 1540 }); 1541 1542 if (currentImage.dataset.imageId == '0') { 1543 currentImage = list[list.length - 1]; 1544 } else { 1545 currentImage = list[parseInt(currentImage.dataset.imageId) - 1]; 1546 } // обновлÑем ÑÑеÑÑик 1547 1548 1549 if (carouselImageCounter) { 1550 carouselImageCounter.textContent = "".concat(+currentImage.dataset.imageId + 1, "/").concat(list.length); 1551 } 1552 1553 currentImageChooser(currentImage); 1554 } 1555 }; 1556 /* 1557 * Chooses next slide 1558 * @param {array} list - list of images 1559 * @param {object} currentImage - displaying at this moment image in slider 1560 * @param {function} currentImageChooser - function to call after switching image 1561 * @return {void} 1562 */ 1563 // @todo ÑбÑаÑÑ Ð¸Ð½Ð¸ÑиализаÑÐ¸Ñ ÑÑнкÑии из маÑÑива 1564 1565 1566 var chooseNextSlide = function chooseNextSlide(list) { 1567 if (list) { 1568 var currentImage = list.find(function (img) { 1569 return img.parentElement.classList.contains('active') ? img : null; 1570 }); 1571 1572 if (currentImage.dataset.imageId === list[list.length - 1].dataset.imageId) { 1573 currentImage = list[0]; 1574 } else { 1575 currentImage = list[parseInt(currentImage.dataset.imageId) + 1]; 1576 } // обновлÑем ÑÑеÑÑик 1577 1578 1579 if (carouselImageCounter) { 1580 carouselImageCounter.textContent = "".concat(+currentImage.dataset.imageId + 1, "/").concat(list.length); 1581 } 1582 1583 currentImageChooser(currentImage); 1584 } 1585 }; 1586 /* 1587 * Assembles dots 1588 * @param {array} list - list of images 1589 * @param {object} currentImage - displaying at this moment image in slider 1590 * @param {object} newDot - dot element in DOM; 1591 * @param {function} currentImageChooser - function to call after switching image 1592 * @param {object} carouselDotsContainer - DOM element contains dots 1593 * @return {void} 1594 */ 1595 // @todo ÑбÑаÑÑ Ð¸Ð½Ð¸ÑиализаÑÐ¸Ñ ÑÑнкÑии из маÑÑива 1596 1597 1598 var dotsAssembler = function dotsAssembler(list) { 1599 if (list && carouselDotsContainer) { 1600 var currentImage = list.find(function (item) { 1601 return item.parentElement.classList.contains('active') ? item : null; 1602 }); 1603 1604 if (list.length > 1) { 1605 list.forEach(function (item) { 1606 var newDot = document.createElement('div'); 1607 newDot.dataset.circleId = item.dataset.imageId; 1608 newDot.classList.add('dot-element'); 1609 newDot.dataset.circleId === currentImage.dataset.imageId ? newDot.classList.add('active-element') : null; 1610 1611 newDot.onclick = function () { 1612 item.dataset.imageId === newDot.dataset.circleId ? currentImageChooser(item) : null; // обновлÑем ÑÑеÑÑик 1613 1614 if (carouselImageCounter) { 1615 carouselImageCounter.textContent = "".concat(+item.dataset.imageId + 1, "/").concat(list.length); 1616 } 1617 }; 1618 1619 carouselDotsContainer.appendChild(newDot); 1620 }); 1621 } 1622 } 1623 }; 1624 /* 1625 * Switches dots 1626 * @param {String} slideId - id of chosen image 1627 * @param {object} carouselDotsContainer - DOM element contains dots 1628 * @param {array} dotsArray - list of existing dots 1629 * @return {void} 1630 */ 1631 // @todo ÑбÑаÑÑ Ð¸Ð½Ð¸ÑиализаÑÐ¸Ñ ÑÑнкÑии из маÑÑива 1632 1633 1634 var activeDotSwitcher = function activeDotSwitcher(slideId) { 1635 if (slideId && carouselDotsContainer) { 1636 var dotsArray = carousel_toConsumableArray(carouselDotsContainer.childNodes).filter(function (item) { 1637 return item.nodeName === 'DIV' ? item : null; 1638 }); 1639 1640 dotsArray.forEach(function (item) { 1641 slideId == item.dataset.circleId ? item.classList.add('active-element') : item.classList.remove('active-element'); 1642 }); 1643 } 1644 }; 1645 /*
1646 * Checks side arrows necessity 1647 * @param {array} list - list of images 1648 * @param {object} nextSlideButton - DOM element contains right side arrow 1649 * @param {object} previousSlideButton - DOM element contains left side arrow 1650 * @return {void} 1651 */ 1652 // @todo ÑбÑаÑÑ Ð¸Ð½Ð¸ÑиализаÑÐ¸Ñ ÑÑнкÑии из маÑÑива 1653 1654 1655 var checkArrowsNecessity = function checkArrowsNecessity(list) { 1656 if (list) { 1657 if (nextSlideButton && previousSlideButton) { 1658 if (list && list.length >= 2 && screen.width > 992) { 1659 nextSlideButton.style.display = 'block'; 1660 previousSlideButton.style.display = 'block'; 1661 } else { 1662 nextSlideButton.style.display = 'none'; 1663 previousSlideButton.style.display = 'none'; 1664 } 1665 } 1666 } 1667 }; 1668 1669 checkArrowsNecessity(carouselImagesList); 1670 console.log('carouselImagesList', carouselImagesList); 1671 1672 if (carouselImagesList) { 1673 carouselInit(carouselImagesList); 1674 dotsAssembler(carouselImagesList); 1675 previousSlideButton ? previousSlideButton.onclick = function () { 1676 return choosePreviousSlide(carouselImagesList); 1677 } : null; 1678 nextSlideButton ? nextSlideButton.onclick = function () { 1679 return chooseNextSlide(carouselImagesList); 1680 } : null; 1681 } //Integrated function for swipe detection 1682 // 1683 // 1684 1685 1686 if (carouselImagesList) { 1687 swipedetect(carouselImagesNode, function (swipedir) { 1688 if (swipedir === 'left') { 1689 chooseNextSlide(carouselImagesList); 1690 } else if (swipedir === 'right') { 1691 choosePreviousSlide(carouselImagesList); 1692 } 1693 }); 1694 } 1695 }); 1696 } 1697 }; 1698 1699 setTimeout(function () { 1700 var frameInner = document.querySelector('.new-companies-frame .new-projects'); // console.log('frameInner', frameInner); 1701 1702 if (frameInner) { 1703 frameInner.style.padding = '0 !important'; 1704 } 1705 }, 2000); 1706 mainCarouselAssemble(carouselMainContainerList); 1707}; 1708 1709var initCarousel = function initCarousel() { 1710 try { 1711 init(); 1712 } catch (e) { 1713 console.log(e); 1714 } 1715}; 1716// EXTERNAL MODULE: ./node_modules/macy/dist/macy.js 1717var dist_macy = __webpack_require__(16); 1718var macy_default = /*#__PURE__*/__webpack_require__.n(dist_macy); 1719 1720// CONCATENATED MODULE: ./app/js/masonry-gallary/common.js 1721 1722 1723var common_masonryGallery = function masonryGallery() { 1724 var macy = macy_default()({ 1725 container: '.gallery-mas', 1726 trueOrder: false, 1727 waitForImages: false, 1728 margin: 14, 1729 columns: 3 // breakAt: { 1730 // 1200: 5, 1731 // 940: 3, 1732 // 520: 2, 1733 // 400: 1 1734 // } 1735 1736 }); 1737}; 1738 1739var initMasonryGallery = function initMasonryGallery() { 1740 try { 1741 var masonryContainers = document.querySelectorAll('.gallery-mas'); 1742 masonryContainers.forEach(function (container) { 1743 return common_masonryGallery(container); 1744 }); 1745 } catch (e) { 1746 console.log(e); 1747 } 1748}; 1749// CONCATENATED MODULE: ./app/js/tehnoKon.js 1750var tehnoKonList = function tehnoKonList(list) { 1751 if (document.querySelectorAll(list).length > 0) { 1752 var itemsList = document.querySelectorAll(list); 1753 1754 if (itemsList.length == 5) { 1755 itemsList[0].classList.add("big"); 1756 } 1757 1758 if (itemsList.length == 4) { 1759 itemsList[0].classList.add("big"); 1760 } 1761 } 1762}; 1763 1764var initTehnoKonList = function initTehnoKonList() { 1765 try { 1766 tehnoKonList(".section_tehnoKon .sections-page__item"); 1767 } catch (e) { 1768 console.log(e); 1769 } 1770}; 1771// CONCATENATED MODULE: ./app/js/contactsProfiles.js 1772var defaultSelector = '.contact_cart__body'; 1773 1774var initCart = function initCart(element) { 1775 var body = document.querySelector('body'); 1776 element.addEventListener('click', function () { 1777 var contentElement = element.nextElementSibling; 1778 var popupElement = contentElement && contentElement.cloneNode(true); 1779 1780 if (popupElement) { 1781 popupElement.addEventListener('click', function (e) { 1782 if (e.target.classList.contains('contact-prof_bio') || e.target.classList.contains('close-btn')) { 1783 body.classList.remove('popup_opened'); 1784 popupElement.remove(); 1785 } 1786 }); 1787 body.append(popupElement); 1788 body.classList.add('popup_opened'); 1789 popupElement.style.display = 'flex'; 1790 } 1791 }); 1792}; 1793 1794var initContactsProfilesPopup = function initContactsProfilesPopup(selector) { 1795 try { 1796 window && window.addEventListener('DOMContentLoaded', function () { 1797 document.querySelectorAll(selector || defaultSelector).forEach(function (element) { 1798 return initCart(element); 1799 }); 1800 }); 1801 } catch (e) { 1802 console.log(e); 1803 } 1804}; 1805// CONCATENATED MODULE: ./app/js/detailsDropdown.js 1806var detailsDropdown_defaultSelector = '.directions_lists_details'; 1807 1808var initDropdown = function initDropdown(el) { 1809 var target = el.querySelector('.details'); 1810 var trigger = el.querySelector('.summary'); 1811 target.dataset.height = target.offsetHeight; 1812 target.style.height = '0'; 1813 1814 if (el.classList.contains('opened')) { 1815 target.style.height = target.dataset.height + 'px'; 1816 } 1817 1818 trigger.addEventListener('click', function () { 1819 el.classList.toggle('opened'); 1820 1821 if (target.offsetHeight == 0) { 1822 target.style.height = target.dataset.height + 'px'; 1823 } else { 1824 target.style.height = '0'; 1825 } 1826 }); 1827}; 1828 1829var initDetailsDropdown = function initDetailsDropdown(selector) { 1830 try { 1831 window && window.addEventListener('DOMContentLoaded', function () { 1832 document.querySelectorAll(selector || detailsDropdown_defaultSelector).forEach(function (element) { 1833 initDropdown(element); 1834 }); 1835 }); 1836 } catch (e) { 1837 console.log(e); 1838 } 1839}; 1840// CONCATENATED MODULE: ./app/js/scripts/applicants.js 1841var applicants = { 1842 blocks: null, 1843 lines: null, 1844 tabs: null, 1845 activeElements: null,
1846 init: function init() { 1847 applicants.blocks = document.querySelectorAll('.block-applicant'); 1848 applicants.lines = document.querySelectorAll('.block-applicant__line'); 1849 applicants.tabs = document.querySelectorAll('.block-applicant__tabs__tab'); 1850 applicants.activeElements = document.querySelectorAll('[data-show]'); 1851 applicants.initTabs(); 1852 }, 1853 initTabs: function initTabs() { 1854 if (applicants.tabs.length) { 1855 applicants.tabs.forEach(function (tab) { 1856 tab.addEventListener('click', applicants.tabAction); 1857 }); 1858 } 1859 }, 1860 tabAction: function tabAction(event) { 1861 applicants.activeElements.forEach(function (el) { 1862 applicants.checkBlock(event, el); 1863 }); 1864 applicants.tabs.forEach(function (el) { 1865 applicants.checkTab(event, el); 1866 }); 1867 }, 1868 checkBlock: function checkBlock(event, el) { 1869 if (el.dataset.show.split('.')[0] === event.currentTarget.dataset.tab.split('.')[0]) { 1870 if (el.dataset.show.split('.')[1] === event.currentTarget.dataset.tab.split('.')[1]) { 1871 el.classList.remove('hidden'); 1872 } else { 1873 el.classList.add('hidden'); 1874 } 1875 } 1876 }, 1877 checkTab: function checkTab(event, el) { 1878 if (el.dataset.tab.split('.')[0] === event.currentTarget.dataset.tab.split('.')[0]) { 1879 if (el.dataset.tab.split('.')[1] === event.currentTarget.dataset.tab.split('.')[1]) { 1880 el.classList.add('active'); 1881 } else { 1882 el.classList.remove('active'); 1883 } 1884 } 1885 } 1886}; 1887/* harmony default export */ var scripts_applicants = (applicants); 1888// CONCATENATED MODULE: ./app/js/pageNavigation.js 1889var initPageNavigationMenu = function initPageNavigationMenu() { 1890 try { 1891 window && window.addEventListener('DOMContentLoaded', function () { 1892 var body = document.querySelector('body'); 1893 var topButton = document.querySelectorAll('.top-button'); 1894 if (topButton.length > 0) topButton.forEach(function (btn) { 1895 btn.addEventListener('click', function (ev) { 1896 ev.currentTarget.parentElement.classList.toggle('opened'); 1897 body.classList.toggle('no-overflow'); 1898 }); 1899 var menuItems = btn.nextElementSibling.querySelectorAll('.list-item'); 1900 1901 if (menuItems.length > 0) { 1902 menuItems.forEach(function (elm) { 1903 elm.addEventListener('click', function (ev) { 1904 ev.currentTarget.parentElement.parentElement.classList.toggle('opened'); 1905 body.classList.toggle('no-overflow'); 1906 }); 1907 }); 1908 } 1909 }); 1910 }); 1911 } catch (e) { 1912 console.log(e); 1913 } 1914}; 1915// CONCATENATED MODULE: ./app/js/ymapPartners.js 1916var ymP = { 1917 mapId: 'ymap-partners', 1918 settings: { 1919 main: { 1920 center: [55.6923, 37.3475], 1921 zoom: 2, 1922 zoomRange: [0, 19], 1923 copyrights: ["© ЯндекÑ"] 1924 } 1925 }, 1926 map: null, 1927 init: function init() { 1928 window.addEventListener('DOMContentLoaded', function () { 1929 if (ymaps) ymaps.ready(ymP.initMap); 1930 }); 1931 }, 1932 initMap: function initMap() { 1933 ymP.map = new ymaps.Map(ymP.mapId, ymP.settings.main); 1934 } 1935}; 1936/* harmony default export */ var ymapPartners = (ymP); 1937/* Map selector main single object */ 1938// const mb = { 1939// /* Settings */ 1940// mapSelector: '#worldMap', 1941// animationLoopSpeed: 200, 1942// dropdownSelector: '.partners__dropdown-nav', 1943// sliderSelector: '.partners__filter-content', 1944// currentSuffix: '-current', 1945// menuSuffix: '-menu', 1946// activeClass: 'active', 1947// currentClass: 'current', 1948// disableAnimationClass: 'disableActive', 1949// /* Object vars */ 1950// allowClick: true, 1951// svgDoc: null, 1952// svgElements: null, 1953// dropdown: null, 1954// dropdownMain: null, 1955// dropdownMenu: null, 1956// slider: null, 1957// /* Main function */ 1958// initMap: () => { 1959// const worldMap = document.querySelector(mb.mapSelector); 1960// if (worldMap) worldMap.addEventListener('load', () => { 1961// mb.onMapLoad(worldMap); 1962// mb.dropdown = worldMap.parentElement.querySelector(mb.dropdownSelector); 1963// mb.initDropdown(); 1964// mb.slider = worldMap.parentElement.parentElement.querySelector(mb.sliderSelector); 1965// }); 1966// }, 1967// initDropdown: () => { 1968// if (mb.dropdown) { 1969// mb.dropdownMain = mb.dropdown.querySelector(mb.dropdownSelector + mb.currentSuffix); 1970// mb.dropdownMenu = mb.dropdown.querySelector(mb.dropdownSelector + mb.menuSuffix); 1971// if (mb.dropdownMain) mb.dropdownMain.addEventListener('click', mb.showDropdown); 1972// mb.setCloseDropdownListener();
1973// [...mb.dropdownMenu.children].forEach(el => { 1974// el.addEventListener('click', () => mb.clickDropdownElement(el)); 1975// }); 1976// } 1977// }, 1978// onMapLoad: worldMap => { 1979// mb.svgDoc = worldMap.contentDocument; 1980// mb.svgElements = mb.svgDoc.querySelectorAll('g.' + mb.activeClass); 1981// mb.svgElements.forEach(el => { 1982// el.addEventListener('click', () => mb.clickMapElement(el)); 1983// }); 1984// }, 1985// clickMapElement: el => { 1986// if (!el.classList.contains(mb.currentClass)) mb.select(el.id); 1987// }, 1988// clickDropdownElement: el => { 1989// if (!el.classList.contains(mb.currentClass)) mb.select(el.dataset.code); 1990// }, 1991// unSelectCurrentMapElements: () => { 1992// let currents = [...mb.svgElements].filter(el => el.classList.contains(mb.currentClass)); 1993// if (currents.length > 0) { 1994// currents.forEach(el => { 1995// el.classList.add(mb.disableAnimationClass); 1996// el.classList.remove(mb.currentClass); 1997// }); 1998// } 1999// }, 2000// unSelectDropdown: () => { 2001// [...mb.dropdownMenu.children].forEach(el => { 2002// if (el.classList.contains(mb.currentClass)) el.classList.remove(mb.currentClass); 2003// }) 2004// }, 2005// setCurrentMapElement: el => { 2006// setTimeout(() => { 2007// el.classList.add(mb.currentClass); 2008// }, mb.animationLoopSpeed); 2009// }, 2010// setCurrentDropdownElement: (el, code) => { 2011// el.classList.add(mb.currentClass); 2012// mb.dropdownMain.innerHTML = el.innerHTML; 2013// mb.dropdownMain.dataset.value = code; 2014// }, 2015// setCloseDropdownListener: () => { 2016// document.addEventListener('click', ev => { 2017// if (mb.dropdownMenu 2018// && mb.dropdownMenu.classList.contains(mb.activeClass) 2019// && ev.target !== mb.dropdownMain 2020// && ev.target.parentElement !== mb.dropdownMain) { 2021// mb.dropdownMenu.classList.remove(mb.activeClass) 2022// } 2023// }); 2024// mb.svgDoc.addEventListener('click', () => { 2025// mb.dropdownMenu.classList.remove(mb.activeClass) 2026// }) 2027// }, 2028// showDropdown: () => { 2029// if (mb.allowClick) { 2030// if (mb.dropdownMenu) mb.dropdownMenu.classList.toggle(mb.activeClass); 2031// } 2032// }, 2033// select: code => { 2034// if (mb.allowClick) { 2035// mb.allowClick = false; 2036// 2037// mb.unSelectCurrentMapElements(); 2038// const mapElement = [...mb.svgElements].filter(el => el.id === code); 2039// if (mapElement.length === 1) mb.setCurrentMapElement(mapElement[0]); 2040// 2041// mb.unSelectDropdown(); 2042// const dropdownElement = [...mb.dropdownMenu.children].filter(el => el.dataset.code === code); 2043// if (dropdownElement.length === 1) mb.setCurrentDropdownElement(dropdownElement[0], code); 2044// else mb.setCurrentDropdownElement(mb.dropdownMenu.children[0], ''); 2045// 2046// 2047// mb.setFilter(code); 2048// 2049// setTimeout(() => { 2050// mb.allowClick = true; 2051// }, mb.animationLoopSpeed*2); 2052// } 2053// }, 2054// /* jQuery Slick function use */ 2055// setFilter: code => { 2056// if (mb.slider && $) { 2057// $(mb.slider).slick('slickUnfilter'); 2058// $(mb.slider).slick('unslick'); 2059// $(mb.slider).slick(partnerSlickSettings); 2060// if (code !== '' && mb.slider.querySelector(`[data-code="${code}"]`)) { 2061// $(mb.slider).slick('slickFilter', `[data-code="${code}"]`); 2062// } 2063// } 2064// } 2065// }; 2066// CONCATENATED MODULE: ./app/js/logoutPage.js 2067var logoutPage = { 2068 init: function init() { 2069 window.addEventListener('DOMContentLoaded', function () { 2070 if (window.location.pathname === '/logout/') { 2071 var loader = document.createElement('div'); 2072 loader.classList.add('loader'); 2073 var idx = 3; 2074 2075 while (idx--) { 2076 var dot = document.createElement('div'); 2077 dot.classList.add('loader__item'); 2078 loader.append(dot); 2079 } 2080 2081 var loaderContainer = document.querySelector('.loader__container'); 2082 2083 if (loaderContainer) { 2084 loaderContainer.append(loader); 2085 } 2086 2087 setTimeout(function () { 2088 loader.remove(); 2089 document.location.href = '/'; 2090 }, 3000); 2091 } 2092 }); 2093 } 2094}; 2095/* harmony default export */ var js_logoutPage = (logoutPage); 2096// CONCATENATED MODULE: ./app/js/autofaq.js 2097var serviceId = { 2098 '/applicants-actions/': '7e0e1bb2-6dc1-4e9b-b471-47d63751dac7', 2099 '/participant-actions/': '7e0e1bb2-6dc1-4e9b-b471-47d63751dac7', 2100 '/project-participant-benefits/': '7e0e1bb2-6dc1-4e9b-b471-47d63751dac7', 2101 '': '7e0e1bb2-6dc1-4e9b-b471-47d63751dac7', 2102 '/': '7e0e1bb2-6dc1-4e9b-b471-47d63751dac7' 2103}; 2104var channelId = { 2105 '/applicants-actions/': 'ef36c8ee-6b35-489d-b68b-d0b4d8c2799f', 2106 '/participant-actions/': 'fda2b2a9-fada-4ac3-84b1-d7e06e6e439f', 2107 '/project-participant-benefits/': '2c5fc8b8-c7f1-4a4e-9864-7f377d3fdb99', 2108 '/': '4df15c6d-2997-4b80-aa84-af43e1fbce05', 2109 '': '4df15c6d-2997-4b80-aa84-af43e1fbce05' 2110}; 2111var af = { 2112 button: null,
2113 init: function init() { 2114 var currentLocation = window.location.pathname; 2115 2116 if (typeof SK !== 'undefined' && typeof serviceId[currentLocation] !== 'undefined' && typeof channelId[currentLocation] !== 'undefined') { 2117 SK.AutoFAQ({ 2118 cid: channelId[currentLocation], 2119 sid: serviceId[currentLocation] 2120 }); 2121 } else if (typeof serviceId[currentLocation] !== 'undefined' && typeof channelId[currentLocation] !== 'undefined') { 2122 setTimeout(function () { 2123 return af.init(); 2124 }, 1000); 2125 } 2126 } 2127}; 2128/* harmony default export */ var autofaq = (af); 2129// CONCATENATED MODULE: ./app/js/applicationForm.js 2130function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } 2131 2132function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } 2133 2134var showForm = function showForm() { 2135 var form = "\n <div class=\"application-form\">\n <div class=\"application-form__close-icon\">\n <img src=\"/pages/img/business-angels/close.svg\" />\n </div>\n <div class=\"application-form__title\">\n <p>\u0424\u043E\u0440\u043C\u0430 \u043F\u043E\u0434\u0430\u0447\u0438 \u0437\u0430\u044F\u0432\u043A\u0438</p>\n </div>\n <div class=\"application-form__content\">\n <form id=\"application-form-feedback\">\n <input\n id=\"contactName\"\n type=\"text\" \n placeholder=\"\u0424\u0418\u041E\" \n name=\"contact_name\"\n required\n />\n <input\n id=\"contactPhone\"\n type=\"tel\" \n placeholder=\"\u041A\u043E\u043D\u0442\u0430\u043A\u0442\u043D\u044B\u0439 \u0442\u0435\u043B\u0435\u0444\u043E\u043D\"\n name=\"phone_number\"\n required\n />\n <input\n id=\"contactEmail\"\n type=\"email\" \n placeholder=\"\u041A\u043E\u043D\u0442\u0430\u043A\u0442\u043D\u044B\u0439 email\" \n name=\"email\"\n required\n />\n <input\n id=\"comment\"\n type=\"text\" \n placeholder=\"\u041A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0439\"\n name=\"comment\"\n required\n />\n <button type=\"submit\">\u041E\u0442\u043F\u0440\u0430\u0432\u0438\u0442\u044C</button>\n </form>\n </div>\n </div>\n "; 2136 document.querySelector(".application-section").insertAdjacentHTML("beforeEnd", form); 2137 document.querySelector(".overlay").setAttribute("id", "overlay"); 2138 document.body.style.overflow = "hidden"; 2139 var formElement = document.querySelector(".application-form"); 2140 var feedback = document.getElementById("application-form-feedback"); 2141 2142 var closeForm = function closeForm() { 2143 formElement.remove(); 2144 document.querySelector(".overlay").removeAttribute("id", "overlay"); 2145 document.body.style.overflow = "auto"; 2146 }; 2147 2148 document.querySelector(".application-form__close-icon").addEventListener("click", closeForm); 2149 var data = {}; 2150 2151 function serializeForm() { 2152 data.contact_name = document.getElementById("contactName").value; 2153 data.phone_number = document.getElementById("contactPhone").value; 2154 data.email = document.getElementById("contactEmail").value; 2155 data.comment = document.getElementById("comment").value; 2156 return data; 2157 } 2158 2159 function getCookie(name) { 2160 var cookieValue = null; 2161 2162 if (document.cookie && document.cookie !== '') { 2163 var cookies = document.cookie.split(';'); 2164 2165 for (var i = 0; i < cookies.length; i++) { 2166 var cookie = cookies[i].trim(); 2167 2168 if (cookie.substring(0, name.length + 1) === name + '=') { 2169 cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); 2170 break; 2171 } 2172 } 2173 } 2174 2175 return cookieValue; 2176 } 2177 2178 function sendData(_x) { 2179 return _sendData.apply(this, arguments); 2180 } 2181 2182 function _sendData() { 2183 _sendData = _asyncToGenerator( 2184 /*#__PURE__*/ 2185 regeneratorRuntime.mark(function _callee(data) { 2186 var csrftoken; 2187 return regeneratorRuntime.wrap(function _callee$(_context) { 2188 while (1) { 2189 switch (_context.prev = _context.next) { 2190 case 0: 2191 csrftoken = getCookie('csrftoken'); 2192 _context.next = 3; 2193 return fetch('/api/v1/business_angels/investor_application/', { 2194 method: 'POST', 2195 headers: { 2196 'X-CSRFToken': csrftoken, 2197 "Access-Control-Allow-Origin": "*", 2198 'Content-Type': 'application/x-www-form-urlencoded' 2199 },
2200 mode: 'same-origin', 2201 body: new URLSearchParams({ 2202 fio: data.contact_name, 2203 phone: data.phone_number, 2204 email: data.email, 2205 comment: data.comment 2206 }) 2207 }); 2208 2209 case 3: 2210 return _context.abrupt("return", _context.sent); 2211 2212 case 4: 2213 case "end": 2214 return _context.stop(); 2215 } 2216 } 2217 }, _callee); 2218 })); 2219 return _sendData.apply(this, arguments); 2220 } 2221 2222 function handleFormSubmit(_x2) { 2223 return _handleFormSubmit.apply(this, arguments); 2224 } 2225 2226 function _handleFormSubmit() { 2227 _handleFormSubmit = _asyncToGenerator( 2228 /*#__PURE__*/ 2229 regeneratorRuntime.mark(function _callee2(event) { 2230 var data, _ref, status, error; 2231 2232 return regeneratorRuntime.wrap(function _callee2$(_context2) { 2233 while (1) { 2234 switch (_context2.prev = _context2.next) { 2235 case 0: 2236 event.preventDefault(); 2237 data = serializeForm(); 2238 _context2.next = 4; 2239 return sendData(data); 2240 2241 case 4: 2242 _ref = _context2.sent; 2243 status = _ref.status; 2244 error = _ref.error; 2245 closeForm(); 2246 2247 if (status === 200) { 2248 alert("ФоÑма оÑпÑавлена"); 2249 } else { 2250 console.log(error); 2251 alert("ЧÑо-Ñо поÑло не Ñак. ÐопÑобÑйÑе Ñнова"); 2252 } 2253 2254 case 9: 2255 case "end": 2256 return _context2.stop(); 2257 } 2258 } 2259 }, _callee2); 2260 })); 2261 return _handleFormSubmit.apply(this, arguments); 2262 } 2263 2264 feedback.addEventListener("submit", handleFormSubmit); 2265}; 2266 2267var initForm = function initForm() { 2268 var formInitButton = document.querySelector(".form-button"); 2269 2270 try { 2271 if (formInitButton) { 2272 formInitButton.addEventListener("click", showForm); 2273 } 2274 } catch (error) { 2275 console.log("Application Form Failed:", error); 2276 } 2277}; 2278// CONCATENATED MODULE: ./app/js/main.js 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 // import initScrollToTop from './scrollTop'; 2290 2291 2292 2293 2294 2295 2296 // import covidActions from "./covidActions"; 2297 2298 2299 // import toppingPlayer from "./player"; 2300 2301initMenu(); 2302initBanner(); 2303initImageLazy(); 2304initForm(); // news 2305 2306news_list(); 2307filters(); 2308initEvents(); 2309initSearchButtonsMenu(); 2310initCarousel(); 2311initMasonryGallery(); 2312initTehnoKonList(); // scrollToTop button 2313// initScrollToTop(); 2314//contacts profiles popup 2315 2316initContactsProfilesPopup(); //contacts deatils dropdown 2317 2318initDetailsDropdown(); //applicant blocks 2319 2320scripts_applicants.init(); //page navigation 2321 2322initPageNavigationMenu(); //autofaq init 2323 2324autofaq.init(); 2325js_logoutPage.init(); // covidActions.init(); 2326// toppingPlayer.init(); 2327// ymapPartners.init(); 2328 2329/* 2330* sidebar 2331*/ 2332 2333var initSidebar = function initSidebar() { 2334 if (document.querySelectorAll('.sidebar').length > 0) { 2335 (function () { 2336 var buttonOpenSidebarLeft = document.querySelector('.sidebar_left-button-phone') ? document.querySelector('.sidebar_left-button-phone') : false; 2337 var buttonOpenSidebarRight = document.querySelector('.sidebar_right-button-phone') ? document.querySelector('.sidebar_right-button-phone') : false; 2338 var sidebar = document.querySelectorAll('.sidebar__nav'); 2339 var sidebarLeft = document.querySelector('.sidebar__nav'); 2340 var sidebarRight = document.querySelector('.sidebar_right .sidebar__nav'); 2341 var sidebarChildLi = document.querySelectorAll('.sidebar__nav--item'); 2342 var buttonCloseSidebar = document.querySelectorAll('.sidebar-title-phone'); 2343 2344 for (var i = 0; i < sidebar.length; i++) { 2345 // open sidebarLeft mobile 2346 if (buttonOpenSidebarLeft) { 2347 buttonOpenSidebarLeft.addEventListener('click', function () { 2348 sidebarLeft.classList.add('open'); 2349 document.body.classList.add('hidden'); 2350 }); 2351 } // open sidebarRight mobile 2352 2353 2354 if (buttonOpenSidebarRight && sidebarRight) { 2355 buttonOpenSidebarRight.addEventListener('click', function () { 2356 sidebarRight.classList.add('open'); 2357 document.body.classList.add('hidden'); 2358 }); 2359 } // close sidebar mobile 2360 2361 2362 buttonCloseSidebar[i].addEventListener('click', function () { 2363 if (sidebarLeft) { 2364 sidebarLeft.classList.remove('open'); 2365 } 2366 2367 if (sidebarRight) { 2368 sidebarRight.classList.remove('open'); 2369 } 2370 2371 document.body.classList.remove('hidden'); 2372 }); // close sidebarListChildren on mobile 2373 2374 if (window.innerWidth <= 992) { 2375 for (var _i = 0; _i < sidebarChildLi.length; _i++) { 2376 sidebarChildLi[_i].classList.remove('openListIn'); 2377 } 2378 } 2379 2380 sidebar[i].addEventListener('click', function (e) { 2381 if (e.target.classList.contains('sidebar__nav--item-arrow')) { 2382 e.target.parentElement.classList.toggle('openListIn'); 2383 } 2384 }); 2385 } 2386 })(); 2387 } 2388}; 2389 2390try { 2391 initSidebar(); 2392} catch (e) { 2393 console.log(e); 2394} 2395 2396/***/ }) 2397 2398/******/ }); 2399//# sourceMappingURL=main.min.js.map
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.