"use strict";(self.webpackChunkgulp_template=self.webpackChunkgulp_template||[]).push([[3895],{4965:function(t,e,n){function o(){const t=document.querySelectorAll(".js-accordion:not(.init)");t.length&&t.forEach(t=>{const e=t.querySelector(".js-accordion-content"),n=t.querySelector(".js-accordion-button");n&&e&&(t.classList.add("init"),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 o}})},3218:function(t,e,n){function o(){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 i(){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 o},W:function(){return i}})},600:function(t,e,n){function o(t,e,n,o,i,s,r){try{var c=t[s](r),a=c.value}catch(t){return void n(t)}c.done?e(a):Promise.resolve(a).then(o,i)}function i(t){return function(){var e=this,n=arguments;return new Promise(function(i,s){var r=t.apply(e,n);function c(t){o(r,i,s,c,a,"next",t)}function a(t){o(r,i,s,c,a,"throw",t)}c(void 0)})}}function s(t){return i(function*(){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}})()}n.d(e,{A:function(){return s}})},1238:function(t,e,n){n.d(e,{A:function(){return a}});var o=n(4965),i=n(600),s=n(3218);function r(t,e,n,o,i,s,r){try{var c=t[s](r),a=c.value}catch(t){return void n(t)}c.done?e(a):Promise.resolve(a).then(o,i)}function c(t){return function(){var e=this,n=arguments;return new Promise(function(o,i){var s=t.apply(e,n);function c(t){r(s,o,i,c,a,"next",t)}function a(t){r(s,o,i,c,a,"throw",t)}c(void 0)})}}function a(){(0,o.A)();const t=document.querySelectorAll(".js-split-price");t.length&&t.forEach(t=>c(function*(){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,i.A)({ACTION:"getHalvaPlanHtml",PRICE:t});let n=document.querySelector(".split-price__cost"),o=document.querySelector(".js-split-price"),s=o?o.querySelector(".card-split-cost"):void 0;"success"===e.STATUS?(s&&s.remove(),n.innerHTML="Разбить на части без переплат",o.closest(".basket-aside__info-split").classList.remove("basket-aside__info-split--without-border"),o.appendChild((new DOMParser).parseFromString(e.html,"text/html").querySelector(".card-split-cost"))):("USER"===e.CODE?o.closest(".basket-aside__info-split").classList.add("basket-aside__info-split--without-border"):o.closest(".basket-aside__info-split").classList.remove("basket-aside__info-split--without-border"),n.innerHTML=e.MESSAGE,s&&s.classList.add("hidden"))}t.addEventListener("click",t=>{t.preventDefault()});const e=t.querySelectorAll('[data-modal="open"]'),n=document.querySelector('[data-modal="container"]'),o=n.querySelectorAll('[data-modal="close"]');e&&e.forEach(t=>{t&&t.addEventListener("click",t=>{t.stopPropagation(),t.preventDefault(),n.classList.add("active"),(0,s.$)()})}),o&&o.forEach(t=>{t&&t.addEventListener("click",t=>{t.stopPropagation(),n.classList.contains("active")&&(n.classList.remove("active"),(0,s.W)())})})})())}},2520:function(t,e,n){var o=n(1238);window.addEventListener("DOMContentLoaded",function(){(0,o.A)()})}},function(t){t(t.s=2520)}]);