"use strict";(self.webpackChunkgulp_template=self.webpackChunkgulp_template||[]).push([[767],{8373:function(t,e,n){var i=n(6014),s=n(270),c=n(1641),o=n(3723),a=n(2048),r=n(50),l=n(7343),d=n(4636),u=n(4228),p=n(3109),f=n(9865),m=n(8180);function h(t,e,n,i,s,c,o){try{var a=t[c](o),r=a.value}catch(t){return void n(t)}a.done?e(r):Promise.resolve(r).then(i,s)}function v(t){return function(){var e=this,n=arguments;return new Promise((function(i,s){var c=t.apply(e,n);function o(t){h(c,i,s,o,a,"next",t)}function a(t){h(c,i,s,o,a,"throw",t)}o(void 0)}))}}window.addEventListener("DOMContentLoaded",(function(){function t(t){const e=function(t){const e=t[0],n=t[1];let i="";const s=document.location.origin,c=document.location.pathname;let o=document.location.search,a=!1;if(o.includes("min_price")){const t=o.split("&"),n=t.findIndex((t=>t.includes("min_price")));a=t[n].includes("?"),t[n]=`min_price=${e}`,o=t.join("&")}if(o.includes("max_price")){const t=o.split("&"),e=t.findIndex((t=>t.includes("max_price")));t[e]=`max_price=${n}`,o=t.join("&")}if(a&&(o=`?${o}`),!o.includes("min_price")&&!o.includes("max_price")&&e&&n&&(o=o?`${o}&min_price=${e}&max_price=${n}`:`?min_price=${e}&max_price=${n}`),o.includes("min_price")&&!o.includes("max_price")){const t=new URLSearchParams(o);e?t.set("min_price",e):t.delete("min_price"),o=t.size>0?`?${t.toString()}`:""}if(!o.includes("min_price")&&o.includes("max_price")){const t=new URLSearchParams(o);n?t.set("max_price",n):t.delete("max_price"),o=t.size>0?`?${t.toString()}`:""}return o&&(i=`${s}${c||""}${o}`),i}(t);window.location.replace(e)}(0,c.A)(r.A),(0,c.u)(r.A,t),(0,o.A)(r.A),(0,i.A)(s.A,".catalog-collections__grid-item"),function(){const t=document.querySelector(".js-show-more-products"),e=window.collectionsList.params;t&&(t.dispatchEvent(new Event("click")),t.addEventListener("click",v((function*(){const n=document.querySelector(".js-catalog-products-grid"),i=(null==n?void 0:n.dataset.firstPage)||2;t.style.display="none",(0,a.A)("show-global");try{const s=yield BX.ajax.runComponentAction("citfact:collections.list","loadPage",{mode:"class",data:{page:i,signedParameters:e}});if("success"===s.status&&(s.data.nextPage&&(n.dataset.firstPage=s.data.nextPage,t.style.display="inline-block"),n)){n.insertAdjacentHTML("beforeend",s.data.products);const t=n.querySelectorAll(".js-product");if(t.length){const e=s.data.products.match(/data-id="\d*"/)[0].match(/\d/g).join(""),n=Array.from(t).findIndex((t=>Number(t.dataset.id)===Number(e)));-1!==n&&(0,d.F)(Array.from(t).slice(n))}}}catch(t){console.log(t)}finally{(0,a.A)("show-global")}}))))}(),(0,m.A)(),(0,f.A)(),window.matchMedia("(min-width: 996px)").matches&&((0,l.A)("catalog-collections__grid"),(0,u.g)()),setTimeout((()=>{(0,p.A)(t,!0)}),1e3)}))},4965:function(t,e,n){function i(){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 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 s(){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 s}})},1641:function(t,e,n){n.d(e,{A:function(){return r},u:function(){return l}});var i=n(9743);function s(t,e,n,i,s,c,o){try{var a=t[c](o),r=a.value}catch(t){return void n(t)}a.done?e(r):Promise.resolve(r).then(i,s)}function c(t){return function(){var e=this,n=arguments;return new Promise((function(i,c){var o=t.apply(e,n);function a(t){s(o,i,c,a,r,"next",t)}function r(t){s(o,i,c,a,r,"throw",t)}a(void 0)}))}}function o(t){return a.apply(this,arguments)}function a(){return a=c((function*(t){const e=document.querySelectorAll(".js-filters-container");if(e.length){const n={};localStorage.removeItem("filter"),e.forEach((t=>{const e=t.querySelectorAll(".js-dropdown");t.dataset.type&&(n.type=t.dataset.type),t.dataset.sectionId&&(n.sectionId=t.dataset.sectionId),e.length&&e.forEach((t=>{"brand"===t.getAttribute("data-property")&&t.querySelector(".js-dropdown-all").click();const e=t.querySelectorAll(".js-checkbox"),n=t.querySelector(".js-dropdown-label");n&&(n.innerText=n.dataset.placeholder),e.length&&e.forEach((t=>{t.checked=!1}))}))})),localStorage.setItem("filter",JSON.stringify(n)),yield t(),window.showMore=!0}})),a.apply(this,arguments)}function r(t){const e=document.querySelectorAll(".js-filters-container"),n=document.querySelectorAll(".js-clear-filters");if(localStorage.removeItem("filter"),n.length&&n.forEach((e=>{e.addEventListener("click",(function(){o(t)}))})),e.length){const i={};function s(){let t=!0;if(Object.keys(i).length)for(const e in i)if(Array.isArray(i[e])&&i[e].length){t=!1;break}const e=new URLSearchParams(window.location.search);(e.has("min_price")||e.has("max_price"))&&(t=!1),n.forEach((e=>{t?e.hasAttribute("disabled")||e.setAttribute("disabled",!0):e.hasAttribute("disabled")&&e.removeAttribute("disabled")}))}function a(t,e){i[e]?function(t){for(let n=0;n{t.checked&&a(t,e)}))}function l(t,e,n){let i=0;e.forEach((t=>{t.checked&&"all"!==t.value&&(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")}e.forEach((e=>{const n=e.querySelectorAll(".js-dropdown"),o=e.querySelector(".js-show-more-products");let d=null;e.dataset.type&&(i.type=e.dataset.type),e.dataset.sectionId&&(i.sectionId=e.dataset.sectionId),localStorage.setItem("filter",JSON.stringify(i)),n.length&&n.forEach((e=>{const n=e.querySelectorAll(".js-checkbox"),u=e.querySelector(".js-dropdown-label"),p=e.dataset.property?e.dataset.property:"";if(n.length){const f=Array.from(n).find((t=>"all"===t.value));n.forEach((r=>{r.dispatchEvent(new Event("change")),r.addEventListener("change",(function(){if(this.classList.contains("js-checkbox-all"))this.checked?n.forEach((t=>{t.checked||t.closest("label").classList.contains("checkbox__disabled")||(t.checked=!0,a(t,p))})):(n.forEach((t=>{t.checked&&(t.checked=!1)})),i[p].splice(0,i[p].length),u.innerText=u.getAttribute("data-placeholder"));else if(this.checked)a(r,p);else{const t=i[p].findIndex((t=>t===this.value));(0===t||f&&f.checked)&&(f&&(f.checked=!1),i[p][1]||(u.innerText=u.getAttribute("data-placeholder"))),i[p].splice(t,1)}l(e,n,u),s(),localStorage.setItem("filter",JSON.stringify(i)),e.closest(".js-dialog-filters")||(d&&clearTimeout(d),d=setTimeout(c((function*(){yield t(),window.showMore||(window.showMore=!0,o&&(button.style.display="inline-block"))})),600))}))})),l(e,n,u),r(n,p),s()}}))}))}}function l(t,e){const n=document.querySelector(".js-tags"),s=document.querySelector(".js-tags-scroll");var a;n&&(n.addEventListener("click",(a=c((function*(n){const i=n.target.closest(".js-tags-remove"),s=n.target.closest(".js-tags-item"),c=n.target.closest(".js-tags-clear");if(i&&s){const n=JSON.parse(localStorage.getItem("filter")),c=i.dataset.type,o=i.dataset.value;if(n[c]&&"max_price"!==c&&"min_price"!==c&&(n[c]=n[c].filter((t=>t!==o)),localStorage.setItem("filter",JSON.stringify(n)),yield t()),("max_price"===c||"min_price"===c)&&e){const t=new URL(window.location.href),n=document.querySelector(".js-filters-container .min-price"),i=document.querySelector(".js-filters-container .max-price");t.searchParams.delete(c);const s=t.searchParams.toString(),o=s?`${t.pathname}?${s}${t.hash}`:`${t.pathname}${t.hash}`;history.replaceState(null,"",o),e(["min_price"===c?n.dataset.min:t.searchParams.get("min_price"),"max_price"===c?i.dataset.max:t.searchParams.get("max_price")])}s.remove()}else c&&o(t)})),function(t){return a.apply(this,arguments)})),s&&new i.A(s,{autoHide:!1}))}},3109:function(t,e,n){n.d(e,{A:function(){return c}});var i=n(9476);function s(t,e,n){if(t&&e&&n){const i=t.querySelector(".js-dropdown-label"),s={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)};s.minValue!==s.currentMinValue||s.maxValue!==s.currentMaxValue?(t.classList.contains("selected")||t.classList.add("selected"),i.innerText=`${s.currentMinValue||s.minValue} - ${s.currentMaxValue||s.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,o;const a=n.closest(".js-dropdown"),r=n.querySelector(".js-cost-range-element"),l=n.querySelectorAll(".js-cost-range-value"),d=e?Number(null===(c=n.querySelector("[data-min]"))||void 0===c?void 0:c.dataset.min):"",u=e?Number(null===(o=n.querySelector("[data-max]"))||void 0===o?void 0:o.dataset.max):"";if(r&&2===l.length){const n=[e?Number(l[0].dataset.costRangeValueMin)||d:Number(l[0].nextElementSibling.value),e?Number(l[1].dataset.costRangeValueMax)||u:Number(l[1].nextElementSibling.value)];s(a,l[0].nextElementSibling,l[1].nextElementSibling),i.Ay.create(r,{start:n,range:{min:e?d:Number(l[0].dataset.min),max:e?u: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],s(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 s}});var i=n(3218);function s(t,e=null,n=[]){const s=document.querySelector(".js-navigation");t&&(s.classList.contains("navigation__fixed--white")||s.classList.add("navigation__fixed--white"),t.on("show",(()=>{(0,i.$)(),e&&e(...n)})),t.on("hide",(()=>{(0,i.W)(),t.destroy()})),t.show())}},3723:function(t,e,n){n.d(e,{A:function(){return a}});var i=n(7083),s=n(2585);function c(t,e,n,i,s,c,o){try{var a=t[c](o),r=a.value}catch(t){return void n(t)}a.done?e(r):Promise.resolve(r).then(i,s)}function o(t){return function(){var e=this,n=arguments;return new Promise((function(i,s){var o=t.apply(e,n);function a(t){c(o,i,s,a,r,"next",t)}function r(t){c(o,i,s,a,r,"throw",t)}a(void 0)}))}}function a(t){const e=document.querySelector(".js-dialog-filters");if(!e)return;const n=document.querySelectorAll(".js-dialog-filters-button"),c=e.querySelector(".js-submit-filters"),a=document.querySelector(".js-show-more-products");c.addEventListener("click",o((function*(){yield t(),window.showMore||(window.showMore=!0,a&&(button.style.display="inline-block"))}))),n.forEach((t=>{t.addEventListener("click",(function(){if(e){const t=new i.default(e);(0,s.default)(t)}}))}))}},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}})},4636:function(t,e,n){n.d(e,{F:function(){return _}});var i=n(600);function s(t,e,n,i,s,c,o){try{var a=t[c](o),r=a.value}catch(t){return void n(t)}a.done?e(r):Promise.resolve(r).then(i,s)}function c(t){return function(){var e=this,n=arguments;return new Promise((function(i,c){var o=t.apply(e,n);function a(t){s(o,i,c,a,r,"next",t)}function r(t){s(o,i,c,a,r,"throw",t)}a(void 0)}))}}const o="active",a=document.querySelectorAll(".js-favorites-button-count"),r=document.querySelectorAll(".js-compare-button-count"),l=document.querySelectorAll(".js-basket-button-count");function d(t,e){return u.apply(this,arguments)}function u(){return u=c((function*(t,e,n=!1){var s;if((null===(s=window.APP)||void 0===s?void 0:s.FAVORITES)&&window.APP.FAVORITES.includes(Number(e))&&t.classList.add(o),!n)try{const n=yield(0,i.A)({ACTION:"add2favorites",ITEM_ID:e});if("OK"===n.STATUS){if(g(t,a,n.EVENT),v(a),"REMOVE"===n.EVENT){const t=window.APP.FAVORITES.indexOf(+e);-1!==t&&window.APP.FAVORITES.splice(t,1)}else window.APP.FAVORITES.push(+e);"REMOVE"===n.EVENT&&"/favorites/"===window.location.pathname&&(t.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(t){console.log(t)}})),u.apply(this,arguments)}function p(t,e){return f.apply(this,arguments)}function f(){return f=c((function*(t,e,n=!1,s=1){var c;if((null===(c=window.APP)||void 0===c?void 0:c.BASKET)&&Object.keys(window.APP.BASKET).includes(String(e))&&(t.innerText=t.dataset.incart,t.classList.add("js-added-to-cart")),!n&&t.classList.contains("js-added-to-cart"))window.location.href="/cart/";else if(!n)try{"OK"===(yield(0,i.A)({ACTION:"add2basket",ITEM_ID:e,QUANTITY:s})).STATUS&&(l.forEach((t=>{const e=t.innerText;Number(e)>98?t.innerText="99":t.innerText=Number(e)+1})),t.innerText=t.dataset.incart,t.classList.add("js-added-to-cart"),window.APP.BASKET[e]={PRODUCT_ID:Number(e),QUANTITY:s},t.classList.contains("js-reload-page")&&location.reload())}catch(t){console.log(t)}})),f.apply(this,arguments)}function m(t,e){return h.apply(this,arguments)}function h(){return h=c((function*(t,e,n=!1){var s;if((null===(s=window.APP)||void 0===s?void 0:s.COMPARE)&&window.APP.COMPARE.includes(Number(e))&&t.classList.add(o),!n)try{const n=yield(0,i.A)({ACTION:"add2compare",ITEM_ID:e});if("OK"===n.STATUS)if(g(t,r,n.EVENT),v(r),"REMOVE"===n.EVENT){const t=window.APP.COMPARE.indexOf(+e);-1!==t&&window.APP.COMPARE.splice(t,1)}else window.APP.COMPARE.push(+e)}catch(t){console.log(t)}})),h.apply(this,arguments)}function v(t){t.forEach((t=>{const e=t.innerText.includes("+")?t.innerText.split("+")[0]:t.innerText;Number(e)<=0?t.classList.add("hidden"):t.classList.remove("hidden")}))}function g(t,e,n){t.classList.toggle(o),"REMOVE"===n?e.forEach((t=>{const e=t.innerText.includes("+")?t.innerText.split("+")[0]:t.innerText;t.innerText=Number(e)-1})):e.forEach((t=>{const e=t.innerText.includes("+")?t.innerText.split("+")[0]:t.innerText;t.innerText=Number(e)+1}))}function _(t){t.length&&window.APP&&(t.forEach((t=>{const e=t.querySelectorAll(".js-add-to-cart"),n=t.querySelectorAll(".js-add-to-cart-obrazec"),s=t.querySelectorAll(".js-add-to-cart-catalog"),o=t.querySelectorAll(".js-add-to-favorite"),a=t.querySelectorAll(".js-add-to-compare"),r=t.querySelectorAll(".js-one-click-buy"),l=Number(t.dataset.id);e.length&&e.forEach((t=>{p(t,l,!0),t.addEventListener("click",(function(){const e=this.closest(".js-actions-container"),n=null==e?void 0:e.querySelector(".js-count-picker-input"),i=n?Number(n.value):1;p(this,t.dataset.id||l,!1,i)}))})),o.length&&o.forEach((t=>{d(t,l,!0),t.addEventListener("click",(function(e){e.stopPropagation(),d(this,t.dataset.id||l)}))})),a.length&&a.forEach((t=>{m(t,l,!0),t.addEventListener("click",(function(e){e.stopPropagation(),m(this,t.dataset.id||l)}))})),n.length&&n.forEach((t=>{const e=t.dataset.id;if(p(t,e,!0),window.APP.BASKET&&window.APP.BASKET[e]){const n=t.closest(".js-actions-container"),i=null==n?void 0:n.querySelector(".js-obrazec-checkbox");i&&(i.checked=!!window.APP.BASKET[e].NO_CUT)}t.addEventListener("click",c((function*(){const n=this.closest(".js-actions-container"),s=window.matchMedia("(min-width: 996px)").matches?t.previousElementSibling.querySelector(".js-count-picker-input"):n.querySelector(".js-count-picker-input"),c=Number(s.value);yield p(this,e,!1,c);try{yield(0,i.A)({ACTION:"setDntCut",ITEM_ID:e})}catch(t){console.log(t)}})))})),s.length&&s.forEach((t=>{const e=t.dataset.id;p(t,e,!0),t.addEventListener("click",c((function*(){p(this,e)})))})),r.length&&r.forEach((t=>{t.addEventListener("click",c((function*(){const e=document.querySelector(".js-count-picker-input"),n=e?Number(e.value):1,i=t.dataset.id||l;yield p(this,i,!1,n),window.location.replace("/order/")})))}))})),v(r),v(a))}},4228:function(t,e,n){function i(){const t=document.querySelector(".js-navigation"),e=document.querySelector(".wrapper"),n=document.querySelector(".js-header-actions");let i=parseInt(window.getComputedStyle(e,null).getPropertyValue("padding-top")),s=window.scrollY;function c(){0===i&&(i=parseInt(window.getComputedStyle(e,null).getPropertyValue("padding-top"))),s>100&&!n.classList.contains("fixed")&&(e.style.paddingTop=`${i+n.clientHeight}px`,n.classList.add("fixed")),s<=100&&n.classList.contains("fixed")&&(e.style.paddingTop=`${i}px`,n.classList.remove("fixed"))}e&&t&&n&&(n.style.top=t.clientHeight-2+"px",c(),window.addEventListener("scroll",(function(){n.style.top=t.clientHeight-2+"px",s=window.scrollY,c()}),{passive:!0}))}n.d(e,{g:function(){return i}})},2048:function(t,e,n){n.d(e,{A:function(){return s}});var i=n(3218);function s(t,e=!0){const n=document.querySelector(".js-loader");n&&(e?n.classList.add("loader-fixed"):n.classList.remove("loader-fixed"),n.classList.toggle(t),n.classList.contains("loader-fixed")&&(n.classList.contains("show-global")?(0,i.$)():(0,i.W)()))}},8180:function(t,e,n){n.d(e,{A:function(){return s}});var i=n(9889);function s(){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"),s=Array.from(t.querySelectorAll(".js-quick-links-item"));if(!e||!n||!s.length)return;t.classList.add("init");let c=!1;function o(){r(s,!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())}(s);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(s,!0),e.classList.remove("quick-links__item--hidden"),n.textContent="Скрыть"):o()})),o(),window.addEventListener("resize",(0,i.A)((()=>{c||o()}),150))}},50:function(t,e,n){n.d(e,{A:function(){return c}});var i=n(2048);function s(t,e,n,i,s,c,o){try{var a=t[c](o),r=a.value}catch(t){return void n(t)}a.done?e(r):Promise.resolve(r).then(i,s)}function c(){return o.apply(this,arguments)}function o(){return t=function*(){(0,i.A)("show-global");try{const t=localStorage.getItem("filter"),e=t?JSON.parse(t):{},n=window.collectionsList.params,i=yield BX.ajax.runComponentAction("citfact:collections.list","getUrl",{mode:"class",data:{filter:e,signedParameters:n}});"success"===i.status?(localStorage.setItem("lastScrollPosition",window.scrollY),localStorage.setItem("scrollToLastPosition","y"),window.location=window.location.origin+i.data.url):console.log(i.data)}catch(t){console.log(t)}finally{(0,i.A)("show-global")}},o=function(){var e=this,n=arguments;return new Promise((function(i,c){var o=t.apply(e,n);function a(t){s(o,i,c,a,r,"next",t)}function r(t){s(o,i,c,a,r,"throw",t)}a(void 0)}))},o.apply(this,arguments);var t}},270:function(t,e,n){function i(t,e,n,i,s,c,o){try{var a=t[c](o),r=a.value}catch(t){return void n(t)}a.done?e(r):Promise.resolve(r).then(i,s)}function s(t){return c.apply(this,arguments)}function c(){return t=function*(t){const e=document.querySelector(".js-filters-on-page"),n=localStorage.getItem("filter"),i=n?JSON.parse(n):{},s=window.collectionsList.params;var c;i.type||(i.type=(null==e||null===(c=e.dataset)||void 0===c?void 0:c.type)?e.dataset.type:"false",localStorage.setItem("filter",JSON.stringify(i)));try{return yield BX.ajax.runComponentAction("citfact:collections.list","loadPage",{mode:"class",data:{page:t,signedParameters:s}})}catch(t){return console.log(t),!1}},c=function(){var e=this,n=arguments;return new Promise((function(s,c){var o=t.apply(e,n);function a(t){i(o,s,c,a,r,"next",t)}function r(t){i(o,s,c,a,r,"throw",t)}a(void 0)}))},c.apply(this,arguments);var t}n.d(e,{A:function(){return s}})},600:function(t,e,n){function i(t,e,n,i,s,c,o){try{var a=t[c](o),r=a.value}catch(t){return void n(t)}a.done?e(r):Promise.resolve(r).then(i,s)}function s(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(s,c){var o=t.apply(e,n);function a(t){i(o,s,c,a,r,"next",t)}function r(t){i(o,s,c,a,r,"throw",t)}a(void 0)}))},c.apply(this,arguments);var t}n.d(e,{A:function(){return s}})},6014:function(t,e,n){n.d(e,{A:function(){return o}});var i=n(2048);function s(t,e,n,i,s,c,o){try{var a=t[c](o),r=a.value}catch(t){return void n(t)}a.done?e(r):Promise.resolve(r).then(i,s)}function c(t){return function(){var e=this,n=arguments;return new Promise((function(i,c){var o=t.apply(e,n);function a(t){s(o,i,c,a,r,"next",t)}function r(t){s(o,i,c,a,r,"throw",t)}a(void 0)}))}}function o(t,e,n){const s=document.querySelector(".js-catalog-infinity-scroll"),o=new IntersectionObserver(((t,n)=>{t.forEach((t=>{if(t.isIntersecting&&!r){const t=document.querySelectorAll(e);t.length&&(n.unobserve(t[t.length-1]),l())}}))}),{threshold:.5});let a=s?s.dataset.firstPage:2,r=!1;window.showMore=!0;const l=function(){var e=c((function*(){""!==s.dataset.firstPage&&0===Number(s.dataset.firstPage)||(a=s.dataset.firstPage||2,r=!0,(0,i.A)("show",!1),setTimeout(c((function*(){try{const e=yield t(a);"success"===e.status?(e.data.collections.length&&(a=e.data.nextPage,s.dataset.firstPage=a,(t=>{s.insertAdjacentHTML("beforeend",t)})(e.data.collections),o.observe(s.lastElementChild)),0===Number(e.data.nextPage)&&(window.showMore=!1,o.unobserve(s.lastElementChild))):console.log("error",e)}catch(t){console.log("error",t)}finally{r=!1,(0,i.A)("show",!1),"function"==typeof n&&n()}})),500))}));return function(){return e.apply(this,arguments)}}();null!==s&&o.observe(s.lastElementChild)}},9865:function(t,e,n){n.d(e,{A:function(){return r}});var i=n(4965),s=n(600),c=n(3218);function o(t,e,n,i,s,c,o){try{var a=t[c](o),r=a.value}catch(t){return void n(t)}a.done?e(r):Promise.resolve(r).then(i,s)}function a(t){return function(){var e=this,n=arguments;return new Promise((function(i,s){var c=t.apply(e,n);function a(t){o(c,i,s,a,r,"next",t)}function r(t){o(c,i,s,a,r,"throw",t)}a(void 0)}))}}function r(){const t=document.querySelectorAll(".js-split-price");t.length&&(document.querySelector('[data-modal="container"]')||document.body.insertAdjacentHTML("beforeend",'\n\n'),(0,i.A)(),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,s.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)}}()))}},9889:function(t,e,n){function i(t,e){let n;return function(){const i=this,s=arguments;clearTimeout(n),n=setTimeout((()=>{t.apply(i,s)}),e)}}n.d(e,{A:function(){return i}})}},function(t){t.O(0,[8096],(function(){return t(t.s=8373)})),t.O()}]);