"use strict";(self.webpackChunkgulp_template=self.webpackChunkgulp_template||[]).push([[767],{8373:function(e,t,n){var o=n(6014),i=n(270),c=n(1641),r=n(3723),s=n(2048),a=n(50),l=n(7343),d=n(4636),u=n(4228),f=n(3109),m=n(1238),h=n(8180);function p(e,t,n,o,i,c,r){try{var s=e[c](r),a=s.value}catch(e){return void n(e)}s.done?t(a):Promise.resolve(a).then(o,i)}function g(e){return function(){var t=this,n=arguments;return new Promise(function(o,i){var c=e.apply(t,n);function r(e){p(c,o,i,r,s,"next",e)}function s(e){p(c,o,i,r,s,"throw",e)}r(void 0)})}}window.addEventListener("DOMContentLoaded",function(){function e(e){const t=function(e){const t=e[0],n=e[1];let o="";const i=document.location.origin,c=document.location.pathname;let r=document.location.search,s=!1;if(r.includes("min_price")){const e=r.split("&"),n=e.findIndex(e=>e.includes("min_price"));s=e[n].includes("?"),e[n]=`min_price=${t}`,r=e.join("&")}if(r.includes("max_price")){const e=r.split("&"),t=e.findIndex(e=>e.includes("max_price"));e[t]=`max_price=${n}`,r=e.join("&")}if(s&&(r=`?${r}`),!r.includes("min_price")&&!r.includes("max_price")&&t&&n&&(r=r?`${r}&min_price=${t}&max_price=${n}`:`?min_price=${t}&max_price=${n}`),r.includes("min_price")&&!r.includes("max_price")){const e=new URLSearchParams(r);t?e.set("min_price",t):e.delete("min_price"),r=e.size>0?`?${e.toString()}`:""}if(!r.includes("min_price")&&r.includes("max_price")){const e=new URLSearchParams(r);n?e.set("max_price",n):e.delete("max_price"),r=e.size>0?`?${e.toString()}`:""}return r&&(o=`${i}${c||""}${r}`),o}(e);window.location.replace(t)}(0,c.A)(a.A),(0,c.u)(a.A,e),(0,r.A)(a.A),(0,o.A)(i.A,".catalog-collections__grid-item"),function(){const e=document.querySelector(".js-show-more-products"),t=window.collectionsList.params;e&&(e.dispatchEvent(new Event("click")),e.addEventListener("click",()=>g(function*(){const n=document.querySelector(".js-catalog-products-grid"),o=(null==n?void 0:n.dataset.firstPage)||2;e.style.display="none",(0,s.A)("show-global");try{const i=yield BX.ajax.runComponentAction("citfact:collections.list","loadPage",{mode:"class",data:{page:o,signedParameters:t}});if("success"===i.status&&(i.data.nextPage&&(n.dataset.firstPage=i.data.nextPage,e.style.display="inline-block"),n)){n.insertAdjacentHTML("beforeend",i.data.products);const e=n.querySelectorAll(".js-product");if(e.length){const t=i.data.products.match(/data-id="\d*"/)[0].match(/\d/g).join(""),n=Array.from(e).findIndex(e=>Number(e.dataset.id)===Number(t));-1!==n&&(0,d.F)(Array.from(e).slice(n))}}}catch(e){console.log(e)}finally{(0,s.A)("show-global")}})()))}(),(0,h.A)(),(0,m.A)(),window.matchMedia("(min-width: 996px)").matches&&((0,l.A)("catalog-collections__grid"),(0,u.g)()),setTimeout(()=>{(0,f.A)(e,!0)},1e3)})},4965:function(e,t,n){function o(){const e=document.querySelectorAll(".js-accordion:not(.init)");e.length&&e.forEach(e=>{const t=e.querySelector(".js-accordion-content"),n=e.querySelector(".js-accordion-button");n&&t&&(e.classList.add("init"),n.addEventListener("click",function(){e.classList.toggle("show"),e.classList.contains("show")?t.style.maxHeight=`${t.scrollHeight}px`:t.style.maxHeight=0}))})}n.d(t,{A:function(){return o}})},3218:function(e,t,n){function o(){const e=document.body,t=window.innerWidth-e.clientWidth;if(e.style.transition="margin-right 0.3s easy-in-out",e.style.marginRight=`${t}px`,e.style.overflow="hidden",!window.matchMedia("(min-width: 996px)").matches){const t=window.pageYOffset;e.style.top=-t+"px",e.style.position="fixed",e.style.width="100%"}}function i(){const e=document.body;if(e.style.transition="margin-right 0s easy-in-out",e.style.marginRight="0",e.style.overflow="unset",!window.matchMedia("(min-width: 996px)").matches){const t=Math.abs(parseInt(e.style.top||0,10));e.style.position="static",e.style.width="auto",e.style.removeProperty("top"),window.scrollTo(0,t||0)}}n.d(t,{$:function(){return o},W:function(){return i}})},1641:function(e,t,n){n.d(t,{A:function(){return s},u:function(){return a}});var o=n(9743);function i(e,t,n,o,i,c,r){try{var s=e[c](r),a=s.value}catch(e){return void n(e)}s.done?t(a):Promise.resolve(a).then(o,i)}function c(e){return function(){var t=this,n=arguments;return new Promise(function(o,c){var r=e.apply(t,n);function s(e){i(r,o,c,s,a,"next",e)}function a(e){i(r,o,c,s,a,"throw",e)}s(void 0)})}}function r(e){return c(function*(){const t=document.querySelectorAll(".js-filters-container");if(t.length){const n={};localStorage.removeItem("filter"),t.forEach(e=>{const t=e.querySelectorAll(".js-dropdown");e.dataset.type&&(n.type=e.dataset.type),e.dataset.sectionId&&(n.sectionId=e.dataset.sectionId),t.length&&t.forEach(e=>{"brand"===e.getAttribute("data-property")&&e.querySelector(".js-dropdown-all").click();const t=e.querySelectorAll(".js-checkbox"),n=e.querySelector(".js-dropdown-label");n&&(n.innerText=n.dataset.placeholder),t.length&&t.forEach(e=>{e.checked=!1})})}),localStorage.setItem("filter",JSON.stringify(n)),yield e(),window.showMore=!0}})()}function s(e){const t=document.querySelectorAll(".js-filters-container"),n=document.querySelectorAll(".js-clear-filters");if(localStorage.removeItem("filter"),n.length&&n.forEach(t=>{t.addEventListener("click",function(){r(e)})}),t.length){const o={};function i(){let e=!0;if(Object.keys(o).length)for(const t in o)if(Array.isArray(o[t])&&o[t].length){e=!1;break}const t=new URLSearchParams(window.location.search);(t.has("min_price")||t.has("max_price"))&&(e=!1),n.forEach(t=>{e?t.hasAttribute("disabled")||t.setAttribute("disabled",!0):t.hasAttribute("disabled")&&t.removeAttribute("disabled")})}function s(e,t){o[t]?function(e){for(let n=0;n{e.checked&&s(e,t)})}function l(e,t,n){let o=0;t.forEach(e=>{e.checked&&"all"!==e.value&&(0===o&&(n.innerText=""),o++,o>1&&(n.innerText+=", "),n.innerText+=e.dataset.label)}),o>0&&!e.classList.contains("selected")&&e.classList.add("selected"),0===o&&e.classList.contains("selected")&&e.classList.remove("selected")}t.forEach(t=>{const n=t.querySelectorAll(".js-dropdown"),r=t.querySelector(".js-show-more-products");let d=null;t.dataset.type&&(o.type=t.dataset.type),t.dataset.sectionId&&(o.sectionId=t.dataset.sectionId),localStorage.setItem("filter",JSON.stringify(o)),n.length&&n.forEach(t=>{const n=t.querySelectorAll(".js-checkbox"),u=t.querySelector(".js-dropdown-label"),f=t.dataset.property?t.dataset.property:"";if(n.length){const m=Array.from(n).find(e=>"all"===e.value);n.forEach(a=>{a.dispatchEvent(new Event("change")),a.addEventListener("change",function(){if(this.classList.contains("js-checkbox-all"))this.checked?n.forEach(e=>{e.checked||e.closest("label").classList.contains("checkbox__disabled")||(e.checked=!0,s(e,f))}):(n.forEach(e=>{e.checked&&(e.checked=!1)}),o[f].splice(0,o[f].length),u.innerText=u.getAttribute("data-placeholder"));else if(this.checked)s(a,f);else{const e=o[f].findIndex(e=>e===this.value);(0===e||m&&m.checked)&&(m&&(m.checked=!1),o[f][1]||(u.innerText=u.getAttribute("data-placeholder"))),o[f].splice(e,1)}l(t,n,u),i(),localStorage.setItem("filter",JSON.stringify(o)),t.closest(".js-dialog-filters")||(d&&clearTimeout(d),d=setTimeout(()=>c(function*(){yield e(),window.showMore||(window.showMore=!0,r&&(button.style.display="inline-block"))})(),600))})}),l(t,n,u),a(n,f),i()}})})}}function a(e,t){const n=document.querySelector(".js-tags"),i=document.querySelector(".js-tags-scroll");n&&(n.addEventListener("click",n=>c(function*(){const o=n.target.closest(".js-tags-remove"),i=n.target.closest(".js-tags-item"),c=n.target.closest(".js-tags-clear");if(o&&i){const n=JSON.parse(localStorage.getItem("filter")),c=o.dataset.type,r=o.dataset.value;if(n[c]&&"max_price"!==c&&"min_price"!==c&&(n[c]=n[c].filter(e=>e!==r),localStorage.setItem("filter",JSON.stringify(n)),yield e()),("max_price"===c||"min_price"===c)&&t){const e=new URL(window.location.href),n=document.querySelector(".js-filters-container .min-price"),o=document.querySelector(".js-filters-container .max-price");e.searchParams.delete(c);const i=e.searchParams.toString(),r=i?`${e.pathname}?${i}${e.hash}`:`${e.pathname}${e.hash}`;history.replaceState(null,"",r),t(["min_price"===c?n.dataset.min:e.searchParams.get("min_price"),"max_price"===c?o.dataset.max:e.searchParams.get("max_price")])}i.remove()}else c&&r(e)})()),i&&new o.A(i,{autoHide:!1}))}},3109:function(e,t,n){n.d(t,{A:function(){return c}});var o=n(9476);function i(e,t,n){if(e&&t&&n){const o=e.querySelector(".js-dropdown-label"),i={minValue:Number(t.dataset.min),maxValue:Number(n.dataset.max),currentMinValue:Number(t.value)||Number(t.dataset.min),currentMaxValue:Number(n.value)||Number(n.dataset.max)};i.minValue!==i.currentMinValue||i.maxValue!==i.currentMaxValue?(e.classList.contains("selected")||e.classList.add("selected"),o.innerText=`${i.currentMinValue||i.minValue} - ${i.currentMaxValue||i.maxValue}`):(e.classList.contains("selected")&&e.classList.remove("selected"),o.innerText=o.dataset.placeholder)}}function c(e,t){const n=document.querySelectorAll(".js-cost-range");n.length&&n.forEach(n=>{var c,r;const s=n.closest(".js-dropdown"),a=n.querySelector(".js-cost-range-element"),l=n.querySelectorAll(".js-cost-range-value"),d=t?Number(null===(c=n.querySelector("[data-min]"))||void 0===c?void 0:c.dataset.min):"",u=t?Number(null===(r=n.querySelector("[data-max]"))||void 0===r?void 0:r.dataset.max):"";if(a&&2===l.length){const n=[t?Number(l[0].dataset.costRangeValueMin)||d:Number(l[0].nextElementSibling.value),t?Number(l[1].dataset.costRangeValueMax)||u:Number(l[1].nextElementSibling.value)];i(s,l[0].nextElementSibling,l[1].nextElementSibling),o.Ay.create(a,{start:n,range:{min:t?d:Number(l[0].dataset.min),max:t?u:Number(l[1].dataset.max)},step:1,connect:!0}),a.noUiSlider.on("update",function(e,t){l[t].innerText=e[t]}),a.noUiSlider.on("change",function(t,n){l[n].nextElementSibling.value=t[n],i(s,l[0].nextElementSibling,l[1].nextElementSibling),l[n].closest(".js-dialog-filters")||l[n].nextElementSibling.dispatchEvent(new Event("change")),e&&e([...t])})}})}},2585:function(e,t,n){n.r(t),n.d(t,{default:function(){return i}});var o=n(3218);function i(e,t=null,n=[]){const i=document.querySelector(".js-navigation");e&&(i.classList.contains("navigation__fixed--white")||i.classList.add("navigation__fixed--white"),e.on("show",()=>{(0,o.$)(),t&&t(...n)}),e.on("hide",()=>{(0,o.W)(),e.destroy()}),e.show())}},3723:function(e,t,n){n.d(t,{A:function(){return s}});var o=n(7083),i=n(2585);function c(e,t,n,o,i,c,r){try{var s=e[c](r),a=s.value}catch(e){return void n(e)}s.done?t(a):Promise.resolve(a).then(o,i)}function r(e){return function(){var t=this,n=arguments;return new Promise(function(o,i){var r=e.apply(t,n);function s(e){c(r,o,i,s,a,"next",e)}function a(e){c(r,o,i,s,a,"throw",e)}s(void 0)})}}function s(e){const t=document.querySelector(".js-dialog-filters");if(!t)return;const n=document.querySelectorAll(".js-dialog-filters-button"),c=t.querySelector(".js-submit-filters"),s=document.querySelector(".js-show-more-products");c.addEventListener("click",function(){return r(function*(){yield e(),window.showMore||(window.showMore=!0,s&&(button.style.display="inline-block"))})()}),n.forEach(e=>{e.addEventListener("click",function(){if(t){const e=new o.default(t);(0,i.default)(e)}})})}},7343:function(e,t,n){function o(e){const t=document.querySelector(".js-grid-two"),n=document.querySelector(".js-grid-auto");if(n&&t){const o=document.querySelector(".js-catalog-grid");t.addEventListener("click",function(){this.classList.contains("catalog-page-actions__grid-button--active")||(this.classList.add("catalog-page-actions__grid-button--active"),o.classList.add(`${e}--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"),o.classList.remove(`${e}--two-columns`),this.previousElementSibling.classList.remove("catalog-page-actions__grid-button--active"))})}}n.d(t,{A:function(){return o}})},4636:function(e,t,n){n.d(t,{F:function(){return p}});var o=n(600);function i(e,t,n,o,i,c,r){try{var s=e[c](r),a=s.value}catch(e){return void n(e)}s.done?t(a):Promise.resolve(a).then(o,i)}function c(e){return function(){var t=this,n=arguments;return new Promise(function(o,c){var r=e.apply(t,n);function s(e){i(r,o,c,s,a,"next",e)}function a(e){i(r,o,c,s,a,"throw",e)}s(void 0)})}}const r="active",s=document.querySelectorAll(".js-favorites-button-count"),a=document.querySelectorAll(".js-compare-button-count"),l=document.querySelectorAll(".js-basket-button-count");function d(e,t,n=!1){return c(function*(){var i;if((null===(i=window.APP)||void 0===i?void 0:i.FAVORITES)&&window.APP.FAVORITES.includes(Number(t))&&e.classList.add(r),!n)try{const n=yield(0,o.A)({ACTION:"add2favorites",ITEM_ID:t});if("OK"===n.STATUS){if(h(e,s,n.EVENT),m(s),"REMOVE"===n.EVENT){const e=window.APP.FAVORITES.indexOf(+t);-1!==e&&window.APP.FAVORITES.splice(e,1)}else window.APP.FAVORITES.push(+t);"REMOVE"===n.EVENT&&"/favorites/"===window.location.pathname&&(e.closest(".js-product-card").remove(),0===document.querySelectorAll(".js-product-card").length&&(document.querySelector(".js-wrap-favorites").innerHTML="",document.querySelector(".js-empty-info").classList.remove("hidden")))}}catch(e){console.log(e)}})()}function u(e,t,n=!1,i=1){return c(function*(){var c;if((null===(c=window.APP)||void 0===c?void 0:c.BASKET)&&Object.keys(window.APP.BASKET).includes(String(t))&&(e.innerText=e.dataset.incart,e.classList.add("js-added-to-cart")),!n&&e.classList.contains("js-added-to-cart"))window.location.href="/cart/";else if(!n)try{"OK"===(yield(0,o.A)({ACTION:"add2basket",ITEM_ID:t,QUANTITY:i})).STATUS&&(l.forEach(e=>{const t=e.innerText;Number(t)>98?e.innerText="99":e.innerText=Number(t)+1}),e.innerText=e.dataset.incart,e.classList.add("js-added-to-cart"),window.APP.BASKET[t]={PRODUCT_ID:Number(t),QUANTITY:i},e.classList.contains("js-reload-page")&&location.reload())}catch(e){console.log(e)}})()}function f(e,t,n=!1){return c(function*(){var i;if((null===(i=window.APP)||void 0===i?void 0:i.COMPARE)&&window.APP.COMPARE.includes(Number(t))&&e.classList.add(r),!n)try{const n=yield(0,o.A)({ACTION:"add2compare",ITEM_ID:t});if("OK"===n.STATUS)if(h(e,a,n.EVENT),m(a),"REMOVE"===n.EVENT){const e=window.APP.COMPARE.indexOf(+t);-1!==e&&window.APP.COMPARE.splice(e,1)}else window.APP.COMPARE.push(+t)}catch(e){console.log(e)}})()}function m(e){e.forEach(e=>{const t=e.innerText.includes("+")?e.innerText.split("+")[0]:e.innerText;Number(t)<=0?e.classList.add("hidden"):e.classList.remove("hidden")})}function h(e,t,n){e.classList.toggle(r),"REMOVE"===n?t.forEach(e=>{const t=e.innerText.includes("+")?e.innerText.split("+")[0]:e.innerText;e.innerText=Number(t)-1}):t.forEach(e=>{const t=e.innerText.includes("+")?e.innerText.split("+")[0]:e.innerText;e.innerText=Number(t)+1})}function p(e){e.length&&window.APP&&(e.forEach(e=>{const t=e.querySelectorAll(".js-add-to-cart"),n=e.querySelectorAll(".js-add-to-cart-obrazec"),i=e.querySelectorAll(".js-add-to-cart-catalog"),r=e.querySelectorAll(".js-add-to-favorite"),s=e.querySelectorAll(".js-add-to-compare"),a=e.querySelectorAll(".js-one-click-buy"),l=Number(e.dataset.id);t.length&&t.forEach(e=>{u(e,l,!0),e.addEventListener("click",function(){const t=this.closest(".js-actions-container"),n=null==t?void 0:t.querySelector(".js-count-picker-input"),o=n?Number(n.value):1;u(this,e.dataset.id||l,!1,o)})}),r.length&&r.forEach(e=>{d(e,l,!0),e.addEventListener("click",function(t){t.stopPropagation(),d(this,e.dataset.id||l)})}),s.length&&s.forEach(e=>{f(e,l,!0),e.addEventListener("click",function(t){t.stopPropagation(),f(this,e.dataset.id||l)})}),n.length&&n.forEach(e=>{const t=e.dataset.id;if(u(e,t,!0),window.APP.BASKET&&window.APP.BASKET[t]){const n=e.closest(".js-actions-container"),o=null==n?void 0:n.querySelector(".js-obrazec-checkbox");o&&(o.checked=!!window.APP.BASKET[t].NO_CUT)}e.addEventListener("click",function(){return c(function*(){const n=this.closest(".js-actions-container"),i=window.matchMedia("(min-width: 996px)").matches?e.previousElementSibling.querySelector(".js-count-picker-input"):n.querySelector(".js-count-picker-input"),c=Number(i.value);yield u(this,t,!1,c);try{yield(0,o.A)({ACTION:"setDntCut",ITEM_ID:t})}catch(e){console.log(e)}}).call(this)})}),i.length&&i.forEach(e=>{const t=e.dataset.id;u(e,t,!0),e.addEventListener("click",function(){return c(function*(){u(this,t)}).call(this)})}),a.length&&a.forEach(e=>{e.addEventListener("click",function(){return c(function*(){const t=document.querySelector(".js-count-picker-input"),n=t?Number(t.value):1,o=e.dataset.id||l;yield u(this,o,!1,n),window.location.replace("/order/")}).call(this)})})}),m(a),m(s))}},4228:function(e,t,n){function o(){const e=document.querySelector(".js-navigation"),t=document.querySelector(".wrapper"),n=document.querySelector(".js-header-actions");let o=parseInt(window.getComputedStyle(t,null).getPropertyValue("padding-top")),i=window.scrollY;function c(){0===o&&(o=parseInt(window.getComputedStyle(t,null).getPropertyValue("padding-top"))),i>100&&!n.classList.contains("fixed")&&(t.style.paddingTop=`${o+n.clientHeight}px`,n.classList.add("fixed")),i<=100&&n.classList.contains("fixed")&&(t.style.paddingTop=`${o}px`,n.classList.remove("fixed"))}t&&e&&n&&(n.style.top=e.clientHeight-2+"px",c(),window.addEventListener("scroll",function(){n.style.top=e.clientHeight-2+"px",i=window.scrollY,c()},{passive:!0}))}n.d(t,{g:function(){return o}})},2048:function(e,t,n){n.d(t,{A:function(){return i}}),n.dn(i);var o=n(3218);function i(e,t=!0){const n=document.querySelector(".js-loader");n&&(t?n.classList.add("loader-fixed"):n.classList.remove("loader-fixed"),n.classList.toggle(e),n.classList.contains("loader-fixed")&&(n.classList.contains("show-global")?(0,o.$)():(0,o.W)()))}},8180:function(e,t,n){n.d(t,{A:function(){return i}});var o=n(9889);function i(){document.querySelectorAll(".js-quick-links").forEach(c)}function c(e){const t=e.querySelector(".js-quick-links-toggle-item"),n=e.querySelector(".js-quick-links-toggle-btn"),i=Array.from(e.querySelectorAll(".js-quick-links-item"));if(!t||!n||!i.length)return;e.classList.add("init");let c=!1;function r(){a(i,!0),t.classList.add("quick-links__item--hidden");const e=function(e){const t=new Map;return e.forEach(e=>{const n=Math.round(e.getBoundingClientRect().top);t.has(n)||t.set(n,[]),t.get(n).push(e)}),Array.from(t.values())}(i);e.length<=2||(a([...s(e[1]),...e.slice(2).flat()],!1),t.classList.remove("quick-links__item--hidden"),n.textContent="Показать ещё")}function s(e){return[e[e.length-1]]}function a(e,t){e.forEach(e=>e.classList.toggle("quick-links__item--hidden",!t))}t.classList.add("quick-links__item--hidden"),n.addEventListener("click",function(){c=!c,c?(a(i,!0),t.classList.remove("quick-links__item--hidden"),n.textContent="Скрыть"):r()}),r(),window.addEventListener("resize",(0,o.A)(()=>{c||r()},150))}},50:function(e,t,n){n.d(t,{A:function(){return c}}),n.dn(c);var o=n(2048);function i(e,t,n,o,i,c,r){try{var s=e[c](r),a=s.value}catch(e){return void n(e)}s.done?t(a):Promise.resolve(a).then(o,i)}function c(){return(e=function*(){(0,o.A)("show-global");try{const e=localStorage.getItem("filter"),t=e?JSON.parse(e):{},n=window.collectionsList.params,o=yield BX.ajax.runComponentAction("citfact:collections.list","getUrl",{mode:"class",data:{filter:t,signedParameters:n}});"success"===o.status?(localStorage.setItem("lastScrollPosition",window.scrollY),localStorage.setItem("scrollToLastPosition","y"),window.location=window.location.origin+o.data.url):console.log(o.data)}catch(e){console.log(e)}finally{(0,o.A)("show-global")}},function(){var t=this,n=arguments;return new Promise(function(o,c){var r=e.apply(t,n);function s(e){i(r,o,c,s,a,"next",e)}function a(e){i(r,o,c,s,a,"throw",e)}s(void 0)})})();var e}},270:function(e,t,n){function o(e,t,n,o,i,c,r){try{var s=e[c](r),a=s.value}catch(e){return void n(e)}s.done?t(a):Promise.resolve(a).then(o,i)}function i(e){return function(){var t=this,n=arguments;return new Promise(function(i,c){var r=e.apply(t,n);function s(e){o(r,i,c,s,a,"next",e)}function a(e){o(r,i,c,s,a,"throw",e)}s(void 0)})}}function c(e){return i(function*(){const t=document.querySelector(".js-filters-on-page"),n=localStorage.getItem("filter"),o=n?JSON.parse(n):{},i=window.collectionsList.params;var c;o.type||(o.type=(null==t||null===(c=t.dataset)||void 0===c?void 0:c.type)?t.dataset.type:"false",localStorage.setItem("filter",JSON.stringify(o)));try{return yield BX.ajax.runComponentAction("citfact:collections.list","loadPage",{mode:"class",data:{page:e,signedParameters:i}})}catch(e){return console.log(e),!1}})()}n.d(t,{A:function(){return c}}),n.dn(c)},600:function(e,t,n){function o(e,t,n,o,i,c,r){try{var s=e[c](r),a=s.value}catch(e){return void n(e)}s.done?t(a):Promise.resolve(a).then(o,i)}function i(e){return function(){var t=this,n=arguments;return new Promise(function(i,c){var r=e.apply(t,n);function s(e){o(r,i,c,s,a,"next",e)}function a(e){o(r,i,c,s,a,"throw",e)}s(void 0)})}}function c(e){return i(function*(){const t=new FormData;for(let n in e)t.append(n,e[n]);t.append("IS_AJAX_ACTION","Y");try{const e=yield fetch("/",{method:"POST",headers:{"X-Requested-With":"XMLHttpRequest"},body:t});return yield e.json()}catch(e){return console.log("error",e),!1}})()}n.d(t,{A:function(){return c}})},6014:function(e,t,n){n.d(t,{A:function(){return r}});var o=n(2048);function i(e,t,n,o,i,c,r){try{var s=e[c](r),a=s.value}catch(e){return void n(e)}s.done?t(a):Promise.resolve(a).then(o,i)}function c(e){return function(){var t=this,n=arguments;return new Promise(function(o,c){var r=e.apply(t,n);function s(e){i(r,o,c,s,a,"next",e)}function a(e){i(r,o,c,s,a,"throw",e)}s(void 0)})}}function r(e,t,n){const i=document.querySelector(".js-catalog-infinity-scroll"),r=new IntersectionObserver((e,n)=>{e.forEach(e=>{if(e.isIntersecting&&!a){const e=document.querySelectorAll(t);e.length&&(n.unobserve(e[e.length-1]),l())}})},{threshold:.5});let s=i?i.dataset.firstPage:2,a=!1;window.showMore=!0;const l=()=>c(function*(){""!==i.dataset.firstPage&&0===Number(i.dataset.firstPage)||(s=i.dataset.firstPage||2,a=!0,(0,o.A)("show",!1),setTimeout(()=>c(function*(){try{const t=yield e(s);"success"===t.status?(t.data.collections.length&&(s=t.data.nextPage,i.dataset.firstPage=s,(e=>{i.insertAdjacentHTML("beforeend",e)})(t.data.collections),r.observe(i.lastElementChild)),0===Number(t.data.nextPage)&&(window.showMore=!1,r.unobserve(i.lastElementChild))):console.log("error",t)}catch(e){console.log("error",e)}finally{a=!1,(0,o.A)("show",!1),"function"==typeof n&&n()}})(),500))})();null!==i&&r.observe(i.lastElementChild)}},1238:function(e,t,n){n.d(t,{A:function(){return a}});var o=n(4965),i=n(600),c=n(3218);function r(e,t,n,o,i,c,r){try{var s=e[c](r),a=s.value}catch(e){return void n(e)}s.done?t(a):Promise.resolve(a).then(o,i)}function s(e){return function(){var t=this,n=arguments;return new Promise(function(o,i){var c=e.apply(t,n);function s(e){r(c,o,i,s,a,"next",e)}function a(e){r(c,o,i,s,a,"throw",e)}s(void 0)})}}function a(){(0,o.A)();const e=document.querySelectorAll(".js-split-price");e.length&&e.forEach(e=>s(function*(){if(document.querySelector("[data-sum-discount-all-products]")){let e=document.querySelector("[data-sum-discount-all-products]").getAttribute("data-sum-discount-all-products");const t=yield(0,i.A)({ACTION:"getHalvaPlanHtml",PRICE:e});let n=document.querySelector(".split-price__cost"),o=document.querySelector(".js-split-price"),c=o?o.querySelector(".card-split-cost"):void 0;"success"===t.STATUS?(c&&c.remove(),n.innerHTML="Разбить на части без переплат",o.closest(".basket-aside__info-split").classList.remove("basket-aside__info-split--without-border"),o.appendChild((new DOMParser).parseFromString(t.html,"text/html").querySelector(".card-split-cost"))):("USER"===t.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=t.MESSAGE,c&&c.classList.add("hidden"))}e.addEventListener("click",e=>{e.preventDefault()});const t=e.querySelectorAll('[data-modal="open"]'),n=document.querySelector('[data-modal="container"]'),o=n.querySelectorAll('[data-modal="close"]');t&&t.forEach(e=>{e&&e.addEventListener("click",e=>{e.stopPropagation(),e.preventDefault(),n.classList.add("active"),(0,c.$)()})}),o&&o.forEach(e=>{e&&e.addEventListener("click",e=>{e.stopPropagation(),n.classList.contains("active")&&(n.classList.remove("active"),(0,c.W)())})})})())}},9889:function(e,t,n){function o(e,t){let n;return function(){const o=this,i=arguments;clearTimeout(n),n=setTimeout(()=>{e.apply(o,i)},t)}}n.d(t,{A:function(){return o}})}},function(e){e.O(0,[8096],function(){return e(e.s=8373)}),e.O()}]);