(window.webpackJsonp=window.webpackJsonp||[]).push([[23,2,3,7,13,14],{492:function(t,e,r){var content=r(495);content.__esModule&&(content=content.default),"string"==typeof content&&(content=[[t.i,content,""]]),content.locals&&(t.exports=content.locals);(0,r(26).default)("be654a1e",content,!0,{sourceMap:!1})},493:function(t,e,r){"use strict";r.r(e);r(142);var l={inheritAttrs:!1,props:{icon:{default:null,type:Object},iconClass:{type:String,default:""},white:{default:!1,type:Boolean},error:{default:!1,type:Boolean},value:{type:[Number,String],required:!1,default:""},type:{type:String,default:"text"},mask:{type:String,required:!1,default:""}},data:function(){return{innerValue:null}},computed:{computedValue:{get:function(){return this.innerValue},set:function(t){this.innerValue=t,this.$emit("input",t)}}},watch:{value:{immediate:!0,handler:function(t){this.innerValue=t}}},methods:{handleInput:function(t){var e=this;this.$nextTick((function(){t.target&&(e.computedValue=t.target.value)}))}}},o=r(4),component=Object(o.a)(l,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"relative w-full"},[t.icon?e("div",{staticClass:"absolute inset-y-0 flex items-center ml-5 pointer-events-none lg:ml-8",class:t.iconClass},[e("UiSvg",t._b({},"UiSvg",t.icon,!1))],1):t._e(),t._v(" "),e("input",t._b({ref:"input",staticClass:"block w-full max-w-full py-3 border border-[#303655] px-4 rounded-lg bg-transparent text-sm outline-none",class:{"has-icon":t.icon,"bg-white":t.white,"bg-gray-f9f9f9":!t.white},attrs:{type:t.type},domProps:{value:t.computedValue},on:{focus:function(e){return t.$emit("focus")},blur:function(e){return t.$emit("blur")},input:t.handleInput,keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.$emit("enter")}}},"input",t.$attrs,!1))])}),[],!1,null,null,null);e.default=component.exports;installComponents(component,{UiSvg:r(94).default})},494:function(t,e,r){"use strict";r(492)},495:function(t,e,r){var l=r(25)((function(i){return i[1]}));l.push([t.i,".roboto[data-v-952aa7f8]{font-family:Roboto;line-height:120%}.gray-span[data-v-952aa7f8]{color:#a3a6b7}",""]),l.locals={},t.exports=l},496:function(t,e,r){"use strict";r.r(e);var l={inheritAttrs:!1,props:{message:{type:String,required:!1,default:null},numberValue:{type:String,default:null,required:!1},currency:{type:String,default:null,required:!1},label:{type:String,default:null,required:!1},grayMessage:{type:Boolean,default:!1},roboto:{type:Boolean,default:!1},addMarginBottom:{type:Boolean,default:!0},addMarginTop:{type:String,default:null,required:!1},marginTop:{type:String,default:null,required:!1},marginBottom:{type:String,default:null,required:!1},grayLabel:{type:Boolean,default:null,required:!1},messageCenter:{type:Boolean,default:!1,required:!1},messageMarginTop:{type:String,default:null,required:!1},fontSize:{type:String,default:"sm",required:!1}}},o=(r(494),r(4)),component=Object(o.a)(l,(function(){var t=this,e=t._self._c;return e("div",{class:["w-full",t.addMarginBottom?"mb-3":""]},[e("div",{staticClass:"flex text-sm",class:[t.marginTop?"mt-".concat(t.marginTop):"",t.marginBottom?"mb-".concat(t.marginBottom):"",t.grayLabel?"roboto gray-span":""]},["string"==typeof t.label?e("label",t._b({},"label",t.$attrs,!1),[t._v("\n      "+t._s(t.label||" ")+"\n    ")]):t._e()]),t._v(" "),e("div",{staticClass:"flex flex-nowrap gap-4",class:{error:!!t.message}},[t._t("default")],2),t._v(" "),t.message?e("div",{staticClass:"ml-auto text-xs tracking-wide text-error",class:[t.grayMessage?"text-[var(--gl-text-color-gray)]":"",t.roboto?"roboto":"",t.messageCenter?"text-center":"",t.messageMarginTop?"mt-".concat(t.messageMarginTop):"mt-2",t.fontSize?"text-".concat(t.fontSize):""]},[t._v("\n    "+t._s(t.message)+" "+t._s(t.numberValue)+" "+t._s(t.currency)+"\n  ")]):t._e()])}),[],!1,null,"952aa7f8",null);e.default=component.exports},525:function(t,e,r){"use strict";r.r(e);var l={name:"CatalogHeader",props:{title:{type:String,default:null,required:!0},image:{type:String,default:null,required:!0}}},o=r(4),component=Object(o.a)(l,(function(){var t=this,e=t._self._c;return e("div",[e("img",{staticClass:"w-full rounded-3xl",attrs:{src:t.image,alt:""}}),t._v(" "),e("h1",{staticClass:"my-6"},[t._v(t._s(t.title))])])}),[],!1,null,null,null);e.default=component.exports},526:function(t,e,r){"use strict";r.r(e);var l={name:"CatalogHeaderMobile",props:{title:{type:String,default:null,required:!0},image:{type:String,default:null,required:!0}}},o=r(4),component=Object(o.a)(l,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"relative min-h-[360px]"},[e("img",{staticClass:"w-full h-full object-none min-h-[360px]",attrs:{src:t.image,alt:""}}),t._v(" "),e("h1",{staticClass:"my-6 absolute z-10 left-6 bottom-8"},[t._v(t._s(t.title))])])}),[],!1,null,null,null);e.default=component.exports},536:function(t,e,r){"use strict";r.r(e);var l={props:{item:{type:Object,required:!1,default:null}},data:function(){return{propItem:this.item}},mounted:function(){console.log(this.propItem)}},o=r(4),component=Object(o.a)(l,(function(){var t=this,e=t._self._c;return t.item?e("NuxtLink",{staticClass:"products-item",attrs:{to:"/product/".concat(t.item.id)}},[t.item.image?e("img",{staticClass:"w-full rounded-xl",attrs:{src:"https://dev-app.nixbuy.com/cdn/products/".concat(t.item.image),alt:t.item.alt}}):e("UiSvg",{staticClass:"w-full h-[137px] p-4 rounded-xl",attrs:{width:"40",height:"40",fill:"#ccc","icon-name":"ico-noimage"}}),t._v(" "),e("div",{staticClass:"products-body"},[e("div",{staticClass:"products-price"},[t._v(t._s(t.item.price)+"₽")]),t._v(" "),e("div",{staticClass:"products-caption"},[t._v(t._s(t.item.title))])])],1):t._e()}),[],!1,null,null,null);e.default=component.exports;installComponents(component,{UiSvg:r(94).default})},569:function(t,e,r){"use strict";r.r(e);var l=r(8),o=r(0),n=(r(23),r(71),r(37),r(38),r(29),r(22),r(55),r(24),r(11),r(15),r(21)),c=r(525),d=r(526);function f(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(t);e&&(l=l.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,l)}return r}function m(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?f(Object(r),!0).forEach((function(e){Object(l.a)(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var v={name:"SubCatalogPage",components:{CatalogHeader:c.default,CatalogHeaderMobile:d.default},asyncData:function(t){return Object(o.a)(regeneratorRuntime.mark((function e(){var r,l,o,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.app,r=t.route,t.params,t.error,l=t.store,e.prev=1,e.next=4,l.dispatch("categories/getCategory",r.params.url);case 4:if(!(o=e.sent)){e.next=10;break}return e.next=8,l.dispatch("products/getProducts",{categoryIds:[o.id],customFields:null,filterId:null});case 8:return n=l.getters["products/getProducts"],e.abrupt("return",{productsFiltered:n});case 10:e.next=14;break;case 12:e.prev=12,e.t0=e.catch(1);case 14:case"end":return e.stop()}}),e,null,[[1,12]])})))()},data:function(){return{isPortrait:!1,productsFiltered:null,errors:[],selectedFilterId:-1,selectedCustomFieldId:null,selectedOptionId:null,valueFrom:"",valueTo:"",isModalFilters:!1,modalFiltersData:[]}},head:function(){return{title:this.$store.state.meta.catalog.title,meta:[{hid:"description",name:"description",content:this.$store.state.meta.catalog.description},{hid:"keywords",name:"keywords",content:this.$store.state.meta.catalog.keywords}]}},computed:m(m({},Object(n.c)({category:"categories/getCategory",products:"products/getProducts"})),{},{imageUrl:function(){return"".concat("/cdn","/").concat(this.category.headerImage)}}),mounted:function(){this.isPortrait=this.isPortraitOrientation(),window.addEventListener("resize",this.handleResize)},beforeDestroy:function(){window.removeEventListener("resize",this.handleResize)},methods:m(m({},Object(n.b)({getProducts:"products/getProducts"})),{},{isPortraitOrientation:function(){return window.matchMedia("(orientation: portrait)").matches},handleResize:function(){this.isPortrait=this.isPortraitOrientation()},getProductsList:function(t){var e=this;return Object(o.a)(regeneratorRuntime.mark((function r(){var l,o,n,c,d,f,m,v;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return console.log("---------------------------------------------"),console.log("getProductsList"),console.log("inputFilterId",t),console.log("this.selectedFilterId",e.selectedFilterId),console.log("this.modalFiltersData",e.modalFiltersData),console.log("---------------------------------------------"),e.resetOptionsDropdown(),e.selectedFilterId=t,e.selectedCustomFieldId=t,l=e.category.id,console.log("categoryId",l),o=t||e.modalFiltersData.filterId,console.log("filterId",o),n=e.selectedCustomFieldId,console.log("customFieldId",n),c=e.selectedOptionId,console.log("optionId",c),d=e.valueFrom,console.log("valueFrom",e.valueFrom),f=e.valueTo,console.log("valueTo",e.valueTo),m=null,m=o>0?{categoryIds:[l],filterId:o,customFields:JSON.stringify([{customFieldId:n,optionId:c,valueFrom:d,valueTo:f}])}:{categoryIds:[l],filterId:null,customFields:null},r.next=25,e.$store.dispatch("products/getProducts",m);case 25:v=r.sent,e.productsFiltered=null==v?void 0:v.data,console.log("resProducts",null==v?void 0:v.data),e.hideModalFilters();case 29:case"end":return r.stop()}}),r)})))()},showModalFilters:function(input){console.log("modalFiltersData",input),this.modalFiltersData=input,this.isModalFilters=!0},hideModalFilters:function(){this.isModalFilters=!1},selectOptionId:function(input){console.log("selectOptionId",input),this.selectedCustomFieldId=input.customFieldId,this.selectedOptionId=input.optId},resetOptionsDropdown:function(){console.log("resetOptionsDropdown"),this.selectedCustomFieldId=null,this.selectedOptionId=null,this.valueFrom="",this.valueTo=""},handleFilterProducts:function(t){var e;(this.selectedFilterId=t,t>0)?null!==(e=this.products)&&void 0!==e&&e.length&&(this.productsFiltered=this.products.filter((function(e){return e.filterId===t}))):this.productsFiltered=this.products}})},h=r(4),component=Object(h.a)(v,(function(){var t,e,r=this,l=r._self._c;return r.category?l("div",{},[r.isPortrait?l("CatalogHeaderMobile",{attrs:{title:r.category.title,image:r.imageUrl}}):l("CatalogHeader",{attrs:{title:r.category.title,image:r.imageUrl}}),r._v(" "),null!==(t=r.category)&&void 0!==t&&t.filters?l("ul",{staticClass:"filter-inline"},[l("li",[l("button",{staticClass:"whitespace-nowrap btn-filter",class:{active:-1===r.selectedFilterId},on:{click:function(t){return r.getProductsList(-1)}}},[r._v("\n        Все товары\n      ")])]),r._v(" "),r._l(r.category.filters,(function(t,e){return l("li",{key:e},[l("button",{staticClass:"whitespace-nowrap",class:{active:r.selectedFilterId===t.id},on:{click:function(e){return r.getProductsList(t.id)}}},[l("span",[r._v(r._s(t.title))]),r._v(" "),l("span",{staticClass:"ml-1 p-1",on:{click:function(e){return e.stopPropagation(),r.showModalFilters({filterId:t.id,filterTitle:t.title,filterCustomFields:t.customFields})}}},[l("UiSvg",{staticClass:"rounded",attrs:{width:"16",height:"16",fill:"#b0b0b0","icon-name":"ico-options"}})],1)])])}))],2):r._e(),r._v(" "),null!==(e=r.productsFiltered)&&void 0!==e&&e.length?l("div",{staticClass:"grid sm:grid-cols-2 lg:grid-cols-4 gap-4 mb-16"},r._l(r.productsFiltered,(function(t,e){return l("ProductItem",{key:e,attrs:{item:t}})})),1):l("div",{staticClass:"nodata"},[r._v("Товары не добавлены")]),r._v(" "),r.isModalFilters?l("UiModal",{attrs:{"max-width":"420px",top:"50%",translate:!0,closeable:!0},on:{close:r.hideModalFilters}},[l("div",{staticClass:"pt-4 pl-4"},[l("h2",[r._v(r._s(r.modalFiltersData.filterTitle))]),r._v(" "),l("div",{staticClass:"py-4",on:{click:function(t){t.stopPropagation()}}},[r._l(r.modalFiltersData.filterCustomFields,(function(t){return r._t("default",(function(){return["input"===t.type?l("UiField",{attrs:{id:"customField-".concat(t.id),label:t.label,message:""}},[l("UiInput",{attrs:{maxlength:"64",name:"title",placeholder:"от",required:t.required},model:{value:r.valueFrom,callback:function(t){r.valueFrom=t},expression:"valueFrom"}}),r._v(" "),l("UiInput",{attrs:{maxlength:"64",name:"title",placeholder:"до",required:t.required},model:{value:r.valueTo,callback:function(t){r.valueTo=t},expression:"valueTo"}})],1):r._e(),r._v(" "),"dropdown"===t.type?l("div",{key:t.id,staticClass:"grid grid-cols-3 gap-4"},r._l(t.options,(function(t,e){return l("button",{key:e,staticClass:"btn-switch",class:{active:r.selectedOptionId===t.id},on:{click:function(e){return r.selectOptionId({customFieldId:r.modalFiltersData.filterId,optId:t.id})}}},[l("span",[r._v(r._s(t.label))])])})),0):r._e()]}))})),r._v(" "),l("div",{staticClass:"flex flex-col md:flex-row items-center justify-center gap-4 mt-12"},[l("span",{staticClass:"span-label",on:{click:function(t){return r.resetOptionsDropdown()}}},[r._v("Сбросить")]),r._v(" "),l("button",{staticClass:"btn-pay",on:{click:function(t){return r.getProductsList(r.modalFiltersData.filterId)}}},[r._v("\n            Показать товары\n          ")])])],2)])]):r._e()],1):r._e()}),[],!1,null,null,null);e.default=component.exports;installComponents(component,{CatalogHeader:r(525).default,CatalogHeaderMobile:r(526).default,UiSvg:r(94).default,ProductItem:r(536).default,UiInput:r(493).default,UiField:r(496).default,UiModal:r(288).default})}}]);