"use strict";(self.webpackChunkgulp_template=self.webpackChunkgulp_template||[]).push([[5999],{4965:function(t,e,n){function i(){const t=document.querySelectorAll(".js-accordion");t.length&&t.forEach((t=>{const e=t.querySelector(".js-accordion-content"),n=t.querySelector(".js-accordion-button");n&&e&&n.addEventListener("click",(function(){t.classList.toggle("show"),t.classList.contains("show")?e.style.maxHeight=`${e.scrollHeight}px`:e.style.maxHeight=0}))}))}n.d(e,{A:function(){return i}})},3218:function(t,e,n){function i(){const t=document.body,e=window.innerWidth-t.clientWidth;if(t.style.transition="margin-right 0.3s easy-in-out",t.style.marginRight=`${e}px`,t.style.overflow="hidden",!window.matchMedia("(min-width: 996px)").matches){const e=window.pageYOffset;t.style.top=-e+"px",t.style.position="fixed",t.style.width="100%"}}function o(){const t=document.body;if(t.style.transition="margin-right 0s easy-in-out",t.style.marginRight="0",t.style.overflow="unset",!window.matchMedia("(min-width: 996px)").matches){const e=Math.abs(parseInt(t.style.top||0,10));t.style.position="static",t.style.width="auto",t.style.removeProperty("top"),window.scrollTo(0,e||0)}}n.d(e,{$:function(){return i},W:function(){return o}})},3109:function(t,e,n){n.d(e,{A:function(){return c}});var i=n(9476);function o(t,e,n){if(t&&e&&n){const i=t.querySelector(".js-dropdown-label"),o={minValue:Number(e.dataset.min),maxValue:Number(n.dataset.max),currentMinValue:Number(e.value)||Number(e.dataset.min),currentMaxValue:Number(n.value)||Number(n.dataset.max)};o.minValue!==o.currentMinValue||o.maxValue!==o.currentMaxValue?(t.classList.contains("selected")||t.classList.add("selected"),i.innerText=`${o.currentMinValue||o.minValue} - ${o.currentMaxValue||o.maxValue}`):(t.classList.contains("selected")&&t.classList.remove("selected"),i.innerText=i.dataset.placeholder)}}function c(t,e){const n=document.querySelectorAll(".js-cost-range");n.length&&n.forEach((n=>{var c,s;const a=n.closest(".js-dropdown"),r=n.querySelector(".js-cost-range-element"),l=n.querySelectorAll(".js-cost-range-value"),u=e?Number(null===(c=n.querySelector("[data-min]"))||void 0===c?void 0:c.dataset.min):"",d=e?Number(null===(s=n.querySelector("[data-max]"))||void 0===s?void 0:s.dataset.max):"";if(r&&2===l.length){const n=[e?Number(l[0].dataset.costRangeValueMin)||u:Number(l[0].nextElementSibling.value),e?Number(l[1].dataset.costRangeValueMax)||d:Number(l[1].nextElementSibling.value)];o(a,l[0].nextElementSibling,l[1].nextElementSibling),i.Ay.create(r,{start:n,range:{min:e?u:Number(l[0].dataset.min),max:e?d:Number(l[1].dataset.max)},step:1,connect:!0}),r.noUiSlider.on("update",(function(t,e){l[e].innerText=t[e]})),r.noUiSlider.on("change",(function(e,n){l[n].nextElementSibling.value=e[n],o(a,l[0].nextElementSibling,l[1].nextElementSibling),l[n].closest(".js-dialog-filters")||l[n].nextElementSibling.dispatchEvent(new Event("change")),t&&t([...e])}))}}))}},2585:function(t,e,n){n.r(e),n.d(e,{default:function(){return o}});var i=n(3218);function o(t,e=null,n=[]){const o=document.querySelector(".js-navigation");t&&(o.classList.contains("navigation__fixed--white")||o.classList.add("navigation__fixed--white"),t.on("show",(()=>{(0,i.$)(),e&&e(...n)})),t.on("hide",(()=>{(0,i.W)(),t.destroy()})),t.show())}},7343:function(t,e,n){function i(t){const e=document.querySelector(".js-grid-two"),n=document.querySelector(".js-grid-auto");if(n&&e){const i=document.querySelector(".js-catalog-grid");e.addEventListener("click",(function(){this.classList.contains("catalog-page-actions__grid-button--active")||(this.classList.add("catalog-page-actions__grid-button--active"),i.classList.add(`${t}--two-columns`),this.nextElementSibling.classList.remove("catalog-page-actions__grid-button--active"))})),n.addEventListener("click",(function(){this.classList.contains("catalog-page-actions__grid-button--active")||(this.classList.add("catalog-page-actions__grid-button--active"),i.classList.remove(`${t}--two-columns`),this.previousElementSibling.classList.remove("catalog-page-actions__grid-button--active"))}))}}n.d(e,{A:function(){return i}})},8180:function(t,e,n){n.d(e,{A:function(){return o}});var i=n(9889);function o(){document.querySelectorAll(".js-quick-links").forEach(c)}function c(t){const e=t.querySelector(".js-quick-links-toggle-item"),n=t.querySelector(".js-quick-links-toggle-btn"),o=Array.from(t.querySelectorAll(".js-quick-links-item"));if(!e||!n||!o.length)return;t.classList.add("init");let c=!1;function s(){r(o,!0),e.classList.add("quick-links__item--hidden");const t=function(t){const e=new Map;return t.forEach((t=>{const n=Math.round(t.getBoundingClientRect().top);e.has(n)||e.set(n,[]),e.get(n).push(t)})),Array.from(e.values())}(o);t.length<=2||(r([...a(t[1]),...t.slice(2).flat()],!1),e.classList.remove("quick-links__item--hidden"),n.textContent="Показать ещё")}function a(t){return[t[t.length-1]]}function r(t,e){t.forEach((t=>t.classList.toggle("quick-links__item--hidden",!e)))}e.classList.add("quick-links__item--hidden"),n.addEventListener("click",(function(){c=!c,c?(r(o,!0),e.classList.remove("quick-links__item--hidden"),n.textContent="Скрыть"):s()})),s(),window.addEventListener("resize",(0,i.A)((()=>{c||s()}),150))}},8342:function(t,e,n){function i(){const t=document.querySelectorAll(".js-read-more-container");if(t.length){const e=document.querySelectorAll(".js-language-radio");let n="RU";if(0!==e.length){const t=Array.from(e).find((t=>t.checked));n=t.value}t.forEach((t=>{const e=t.querySelector(".js-read-more"),i=t.querySelector(".js-read-more-block");i&&e&&e.addEventListener("click",(function(){i.classList.toggle("open"),i.classList.contains("open")?(this.innerText="RU"===n?"Скрыть":"Hide",i.style.maxHeight=`${i.scrollHeight}px`):(this.innerText="RU"===n?"Читать далее":"Read more",i.style.maxHeight="310px")}))}))}}n.d(e,{A:function(){return i}})},600:function(t,e,n){function i(t,e,n,i,o,c,s){try{var a=t[c](s),r=a.value}catch(t){return void n(t)}a.done?e(r):Promise.resolve(r).then(i,o)}function o(t){return c.apply(this,arguments)}function c(){return t=function*(t){const e=new FormData;for(let n in t)e.append(n,t[n]);e.append("IS_AJAX_ACTION","Y");try{const t=yield fetch("/",{method:"POST",headers:{"X-Requested-With":"XMLHttpRequest"},body:e});return yield t.json()}catch(t){return console.log("error",t),!1}},c=function(){var e=this,n=arguments;return new Promise((function(o,c){var s=t.apply(e,n);function a(t){i(s,o,c,a,r,"next",t)}function r(t){i(s,o,c,a,r,"throw",t)}a(void 0)}))},c.apply(this,arguments);var t}n.d(e,{A:function(){return o}})},1238:function(t,e,n){n.d(e,{A:function(){return r}});var i=n(4965),o=n(600),c=n(3218);function s(t,e,n,i,o,c,s){try{var a=t[c](s),r=a.value}catch(t){return void n(t)}a.done?e(r):Promise.resolve(r).then(i,o)}function a(t){return function(){var e=this,n=arguments;return new Promise((function(i,o){var c=t.apply(e,n);function a(t){s(c,i,o,a,r,"next",t)}function r(t){s(c,i,o,a,r,"throw",t)}a(void 0)}))}}function r(){(0,i.A)();const t=document.querySelectorAll(".js-split-price");t.length&&t.forEach(function(){var t=a((function*(t){if(document.querySelector("[data-sum-discount-all-products]")){let t=document.querySelector("[data-sum-discount-all-products]").getAttribute("data-sum-discount-all-products");const e=yield(0,o.A)({ACTION:"getHalvaPlanHtml",PRICE:t});let n=document.querySelector(".split-price__cost"),i=document.querySelector(".js-split-price"),c=i?i.querySelector(".card-split-cost"):void 0;"success"===e.STATUS?(c&&c.remove(),n.innerHTML="Разбить на части без переплат",i.closest(".basket-aside__info-split").classList.remove("basket-aside__info-split--without-border"),i.appendChild((new DOMParser).parseFromString(e.html,"text/html").querySelector(".card-split-cost"))):("USER"===e.CODE?i.closest(".basket-aside__info-split").classList.add("basket-aside__info-split--without-border"):i.closest(".basket-aside__info-split").classList.remove("basket-aside__info-split--without-border"),n.innerHTML=e.MESSAGE,c&&c.classList.add("hidden"))}t.addEventListener("click",(t=>{t.preventDefault()}));const e=t.querySelectorAll('[data-modal="open"]'),n=document.querySelector('[data-modal="container"]'),i=n.querySelectorAll('[data-modal="close"]');e&&e.forEach((t=>{t&&t.addEventListener("click",(t=>{t.stopPropagation(),t.preventDefault(),n.classList.add("active"),(0,c.$)()}))})),i&&i.forEach((t=>{t&&t.addEventListener("click",(t=>{t.stopPropagation(),n.classList.contains("active")&&(n.classList.remove("active"),(0,c.W)())}))}))}));return function(e){return t.apply(this,arguments)}}())}},9681:function(t,e,n){n.d(e,{A:function(){return s},u:function(){return a}});var i=n(9743);function o(t){t.forEach((t=>{"Y"===t.getAttribute("data-clear-active")?t.hasAttribute("disabled")&&(t.removeAttribute("disabled"),t.classList.remove("disabled")):t.hasAttribute("disabled")||(t.setAttribute("disabled",!0),t.classList.add("disabled"))}))}function c(t,e,n){let i=0;e.forEach((t=>{t.checked&&(0===i&&(n.innerText=""),i++,i>1&&(n.innerText+=", "),n.innerText+=t.dataset.label)})),i>0&&!t.classList.contains("selected")&&t.classList.add("selected"),0===i&&(t.classList.contains("selected")&&t.classList.remove("selected"),n.innerText=n.dataset.placeholder)}function s(){const t=document.querySelectorAll(".js-filters-container"),e=document.querySelectorAll(".js-clear-filters");t.length&&(t.forEach((t=>{const n=t.querySelectorAll(".js-dropdown");n.length&&n.forEach((t=>{const n=t.querySelectorAll(".js-checkbox"),i=t.querySelector(".js-dropdown-label");n.length&&(n.forEach((s=>{s.addEventListener("change",(function(){c(t,n,i),o(e)}))})),c(t,n,i))}))})),o(e))}function a(){const t=document.querySelector(".js-tags-scroll");t&&t&&new i.A(t,{autoHide:!1})}},1136:function(t,e,n){function i(t,e){const n=e.querySelector(".js-video-play"),i=e.querySelector(".js-video-poster"),o=e.querySelector(".js-video-dimmer");"play"===t?(o.style.bacgroundColor="transparent",n.style.display="none",i.style.display="none"):(o.style.backgroundColor="rgba(0, 0, 0, 0.35)",n.style.display="flex",i.style.display="block")}function o(){const t=document.querySelectorAll(".js-video");t&&t.length&&t.forEach((t=>{const e=t.closest(".video-block");e.querySelector(".js-video-dimmer").addEventListener("click",(()=>{t.paused?(i("play",e),t.play()):(i("pause",e),t.pause())}))}))}n.d(e,{S:function(){return i},r:function(){return o}})},318:function(t,e,n){var i=n(7083),o=n(2585),c=n(1136),s=n(7343),a=n(8342),r=n(9681),l=n(3109),u=n(1238),d=n(8180);function m(t){const e=[];window.dataLayer=window.dataLayer||[],t.forEach((t=>{if(function(t){const e=t.getBoundingClientRect(),n=window.innerHeight||document.documentElement.clientHeight,i=window.innerWidth||document.documentElement.clientWidth;return e.bottom>0&&e.right>0&&e.top{window.matchMedia("(min-width: 996px)").matches?(0,s.A)("stenova-home-catalog-grid__items"):(0,a.A)(),window.addEventListener("scroll",(()=>m(document.querySelectorAll('.js-catalog-grid [data-ecom="0"]')))),(0,l.A)(),(0,r.A)(),function(){const t=document.querySelector(".js-dialog-filters");document.querySelectorAll(".js-dialog-filters-button").forEach((e=>{e.addEventListener("click",(function(){if(t){const e=new i.default(t);(0,o.default)(e)}}))}))}(),(0,c.r)(),(0,u.A)(),(0,d.A)(),m(document.querySelectorAll('.js-catalog-grid [data-ecom="0"]'))}))},9889:function(t,e,n){function i(t,e){let n;return function(){const i=this,o=arguments;clearTimeout(n),n=setTimeout((()=>{t.apply(i,o)}),e)}}n.d(e,{A:function(){return i}})}},function(t){t.O(0,[8096],(function(){return t(t.s=318)})),t.O()}]);