(function(n,t){function u(n){var t=n.find("input.steps");return{steps:t.length===0?[]:t.val().split(";"),min:n.find("input.SelectedFacetMinPrice").val(),max:n.find("input.SelectedFacetMaxPrice").val(),valueName:n.find("input.valueName").val()}}function f(n){var t=n.find("input.steps");return{steps:t.length===0?[]:t.val().split(";"),min:n.find("input.SelectedMinPrice").val(),max:n.find("input.SelectedMaxPrice").val(),valueName:n.find("input.valueName").val()}}var r=[],i=[];shop.productlist_filter=function(t){if(!t)throw new Error("options need to be set for shop.productlist_filter");t=n.extend({autoInit:!0},t);this.shown=!0;this.animating=!1;this.rangeSliderSetup=!1;this.rangeFacetSliderSetup=!1;this.opt=t;t.autoInit&&this.init()};shop.productlist_filter.getFacetGroupIndex=function(n){for(var t=0;t<r.length;t++)if(r[t]==n)return t;return-1};shop.productlist_filter.prototype.init=function(){var t=this,e,u,o,f,h,c,s;if(t.$wrap=t.opt.$wrap,t.$filter=t.opt.$filter,t.$filterContent=t.$filter.find(".content"),t.$header=t.$filter.find(".filter-header"),t.$list=t.opt.$list,t.$toTop=t.opt.$filter.find(".to-top"),t.$sortColumn=t.$wrap.find("#SortColumn"),t.$sortOrder=t.$wrap.find("#SortOrder"),t.$totalProductCount=t.$wrap.find("#TotalProductCount"),e=hLib.getMedia()==="mobile",t.shown=!e,u=t.$filter.find(".filter-group"),u.length>=1)if(e){o=!1;for(f in shop.productListOpenFilterBlocks)shop.productListOpenFilterBlocks.hasOwnProperty(f)&&(h=shop.productListOpenFilterBlocks[f],h&&(o=!0,t.toggleFilterBlock(u.filter("[data-filterid='"+f+"']"))));o?t.show():t.hide()}else t.setupRangeSlider(),t.setupFacetRangeSlider();else c=!1,c?(t.show(),t.$wrap.find("#filter-list-toggle").show(),t.$wrap.removeClass("no-filter")):(t.hide(),t.$wrap.find("#filter-list-toggle").hide(),t.$wrap.addClass("no-filter")),t.$wrap.find(".ss-kit-list.masonry")&&shop.kitList.updateMasonryLayout(t.$wrap.find(".ss-kit-list.masonry"));s=10;u.each(function(t){var f=n(this).find(".filter-unit"),e=n(),o=n(this).closest(".filter-group").data("filterid"),u,h;f.length>s&&(e=f.filter(":gt("+(s-1)+")"));u=shop.productlist_filter.getFacetGroupIndex(o);u==-1&&(u=t);i.length<=u&&(i.push(!1),r.push(o));e.length>0&&(e.addClass("filter-unit-hide"),i[u]&&n(this).closest(".filter-group").toggleClass("show-all-units"),n("<span class='toggle-hidden-units' data-index='"+u+"'><span class='show-text'>"+shop.translations.showAll+"<\/span><span class='hide-text'>"+shop.translations.hideAll+"<\/span><\/span>").insertAfter(e.last()));h=n(this).find(".toggle-all");f.find(":checked").length===f.length&&h.html(shop.translations.chooseAllRemove)});t.$filter.addClass("filter-ready");t.bindEvents();t.setHeight()};shop.productlist_filter.prototype.setHeight=function(){var n=this,t=n.$filter.height(),i=n.$list.height(),r=t>i?t:i;n.$filter.css({minHeight:r+80});n.$list.css({minHeight:t+80})};shop.productlist_filter.prototype.toggleFilterBlock=function(n){var t=n.data("filterid"),i=n.data("filteropen");i?(n.data("filteropen",!1),n.removeClass("open"),shop.productListOpenFilterBlocks&&delete shop.productListOpenFilterBlocks[t]):(n.data("filteropen",!0),n.addClass("open"),shop.productListOpenFilterBlocks||(shop.productListOpenFilterBlocks={}),shop.productListOpenFilterBlocks[t]=!0,this.setupRangeSlider(),this.setupFacetRangeSlider())};shop.productlist_filter.prototype.bindEvents=function(){var r=this;n("#filter-sort").on("change",function(){var t=n(this).find("option:selected");r.$sortColumn.val(t.data("column"));r.$sortOrder.val(t.data("direction"));r.resetPageNumber();shop.productlist.history.update()});n(t).on("listupdated",function(){r.setHeight()});this.$filter.find(".filter-group header").hClick(function(t){hLib.getMedia()==="mobile"&&(t.gesture&&(t.gesture.preventDefault(),t.gesture.stopPropagation()),r.toggleFilterBlock(n(this).closest(".filter-group")))});this.$filter.find(".toggle-all").hClick(function(t){var f=n(t.target).closest(".filter-group"),i=f.find("input[type=checkbox]"),u=0,e=i.length;i.each(function(n,t){t.checked&&(u+=1)});i.attr("checked",u<e);r.resetPageNumber();shop.productlist.history.update()});this.$filter.find("input:checkbox").change(function(){r.refreshSelectedFilters();r.resetPageNumber();shop.productlist.history.update()});this.$filter.find(".reset-filter").hClick(function(){r.reset();hLib.getMedia()==="mobile"&&shop.productlist.history.update()});this.$filter.find("#list-form").submit(function(n){n.preventDefault();shop.productlist.history.update()});r.$filter.find(".toggle-hidden-units").click(function(){var u=n(this),r;u.closest(".filter-group").toggleClass("show-all-units");r=u.data("index");i[r]=i[r]?!1:!0;n(t).trigger(n.Event("listupdated"))});r.$filter.find(".filter-hide").hClick(function(){r.hide()});r.$toTop.hClick(function(){r.scrollToListTop()});n(t).scroll(function(){r.handleToTopVisibility()})};shop.productlist_filter.prototype.handleToTopVisibility=function(){this.$filterContent.is(":in-viewport")?this.$toTop.removeClass("stick"):this.$toTop.addClass("stick")};shop.productlist_filter.prototype.scrollToListTop=function(){n.scrollTo(this.$filter,{offset:{top:-10}})};shop.productlist_filter.prototype.reset=function(){this.$filter.find("input:checkbox").each(function(){this.checked=!1});this.resetRangeSlider();this.resetFacetRangeSlider();this.$filter.find(".filter-group").removeClass("open")};shop.productlist_filter.prototype.resetRangeSlider=function(){this.$filter.find(".rangeSlider").each(function(){var t=n(this),i=f(t),r=hLib.rangeSlider.getSliderByID(t.attr("id"));r?r.reset():hLib.getMedia()!="mobile"&&(t.find(".SelectedMinPrice").val(i.steps[0]),t.find(".SelectedMaxPrice").val(i.steps[i.steps.length-1]))});this.$filter.find(".rangeSlider").length===0&&(this.refreshSelectedFilters(),this.resetPageNumber(),shop.productlist.history.update())};shop.productlist_filter.prototype.resetFacetRangeSlider=function(){this.$filter.find(".rangeFacetSlider").each(function(){var t=n(this),i=u(t),r=hLib.rangeSlider.getSliderByID(t.attr("id"));r?r.reset():(t.find(".SelectedFacetMinPrice").val(i.steps[0]),t.find(".SelecteFacetdMaxPrice").val(i.steps[i.steps.length-1]))})};shop.productlist_filter.prototype.setupFacetRangeSlider=function(){function f(){i.each(function(){var r=n(this),i;if(t.rangeFacetSliderSetup=!0,i=u(r),i.steps.length===0){r.hide();return}hLib.initRangeSlider(r,{arrSteps:i.steps,minValueInit:i.min,maxValueInit:i.max,valueName:i.valueName,onRangeSet:function(){t.refreshSelectedFilters();t.resetPageNumber();shop.productlist.history.update()}})})}var t=this,i,r;this.rangeFacetSliderSetup||this.shown&&(i=this.$filter.find(".rangeFacetSlider"),r=i.closest(".filter-group"),hLib.getMedia()==="mobile"?r.hasClass("open")&&f():f())};shop.productlist_filter.prototype.setupRangeSlider=function(){function u(){i.rangeSliderSetup=!0;var r=f(t);if(r.steps.length===0){t.hide();return}hLib.initRangeSlider(t,{arrSteps:r.steps,minValueInit:r.min,maxValueInit:r.max,valueName:r.valueName,onRangeSet:function(){n("#IsPriceFilter").val("true");i.refreshSelectedFilters();i.resetPageNumber();shop.productlist.history.update()}})}var i=this,t,r;this.rangeSliderSetup||this.shown&&(t=this.$filter.find(".rangeSlider"),r=t.closest(".filter-group"),hLib.getMedia()==="mobile"?r.hasClass("open")&&u():u())};shop.productlist_filter.prototype.resetPageNumber=function(){n("#Page").val(1)};shop.productlist_filter.prototype.refreshSelectedFilters=function(){this.$filter.find(".filter-group").each(function(){function l(n){n?e.filter(".range").addClass("show"):e.filter(".range").removeClass("show")}var r=n(this),e=r.find(".chosen"),a=r.find("input:checkbox:checked").length,o,s,t,h,c,i;a===0?e.removeClass("show"):e.addClass("show").find(".amt").text(a);o=r.find(".rangeSlider.price-range");o.length>0&&(s=hLib.rangeSlider.getSliderByID(o.attr("id")),s&&s.isShowingFullRange?l(!s.isShowingFullRange()):(t=f(o),t&&l(t.min!==t.steps[0]||t.max!==t.steps[t.steps.length-1])));h=r.find(".rangeFacetSlider");h.length>0&&(c=hLib.rangeSlider.getSliderByID(h.attr("id")),c&&c.isShowingFullRange?l(!c.isShowingFullRange()):(i=u(h),i&&l(i.min!==i.steps[0]||i.max!==i.steps[i.steps.length-1])))})};shop.productlist_filter.prototype.toggle=function(){this.shown?this.hide():this.show()};shop.productlist_filter.prototype.show=function(){var n=this;n.refreshSelectedFilters();n.$wrap.removeClass("filter-hidden");n.$wrap.addClass("filter-shown");n.shown=!0;n.setupRangeSlider();n.setupFacetRangeSlider();n.opt.onShow&&n.opt.onShow()};shop.productlist_filter.prototype.hide=function(){var n=this;n.$wrap.removeClass("filter-shown");n.$wrap.addClass("filter-hidden");n.shown=!1;setTimeout(function(){n.opt.onHide&&n.opt.onHide()},25)};shop.productlist_filter.prototype.setData=function(){};shop.productlist_filter.prototype.getData=function(){function u(){function u(n){return n?n.replace(".",""):""}var n={SelectedLowerPrice:null,SelectedUpperPrice:null},o=t.$filter.find(".rangeSlider.price-range"),i=hLib.rangeSlider.getSliderByID(o.attr("id")),r=shop.productlist.history.getData(),f=t.$filter.find(".SelectedMinPrice").val(),e=t.$filter.find(".SelectedMaxPrice").val();return i.arrSteps&&f===i.arrSteps[0]?r.SelectedLowerPrice&&r.SelectedLowerPrice!=="null"&&(n.SelectedLowerPrice=u(f)):n.SelectedLowerPrice=u(f),i.arrSteps&&e===i.arrSteps[i.arrSteps.length-1]?r.SelectedUpperPrice&&r.SelectedUpperPrice!=="null"&&(n.SelectedUpperPrice=u(e)):n.SelectedUpperPrice=u(e),n}var t=this,i={},r;return n.extend(i,u()),n.extend(i,{IsProductGroupPage:n("#IsProductGroupPage").val(),AllPriceSteps:n("#AllPriceSteps").val(),ProductGroupId:n("#ProductGroupId").val(),Search:n("#SearchText").val(),Column:t.$sortColumn.val(),Order:t.$sortOrder.val()}),i.EnabledFacets=[],this.$filter.find(".filter-unit :checked").each(function(){i.EnabledFacets.push(n(this).attr("name"))}),r=t.$filter.find(".rangeFacetSlider"),r.each(function(){var f=n(this),u=hLib.rangeSlider.getSliderByID(f.attr("id")),r=u.arrSteps,e=n.inArray(u.intCurrentMinPrice,r),o=n.inArray(u.intCurrentMaxPrice,r),h=f.find(".ids").val(),s=h.split(";"),t;if(r&&(e>0||o<r.length-1))for(t=0;t<s.length;t++)t>=e&&t<=o&&i.EnabledFacets.push(s[t])}),i}})(jQuery,window),function(n){shop.productlist_infoBar=function(t){if(!t)throw new Error("options need to be set for shop.productlist_infoBar");t=n.extend({autoInit:!0},t);this.opt=t;t.autoInit&&this.init()};shop.productlist_infoBar.prototype.init=function(){this.$infoBar=this.opt.$list.find(".list-info");this.$infoBar.find("#sortColumn").change(shop.productlist.history.update)};shop.productlist_infoBar.prototype.getData=function(){var n={};return n.Column=this.$infoBar.find("#sortColumn").val(),n.Order=this.$infoBar.find("#sortOrder").val(),n.ProductGroupId=this.$infoBar.find("#ProductGroupId").val(),n}}(jQuery,window),function(n){shop.productlist_infinityScroll=function(t){if(!t)throw new Error("options need to be set for shop.productlist_infinityScroll");t=n.extend({autoInit:!0},t);this.opt=t;this.init()};shop.productlist_infinityScroll.prototype.init=function(){this.scroller=hLib.infinityScroll({pageItemSelector:this.opt.pageItemSelector||".product-list-item",saveBackState:!0,waitForImageLoad:!1,$target:this.opt.$target,pageSize:this.opt.pageSize,getPage:this.opt.getPage,onPageInserted:this.opt.onPageInserted,onReplaced:this.opt.onReplaced,threshold:700,itemClickEvent:function(t){var i=this;i.saveBackState&&t.find("a").hClick(function(t){var r=n(this),u=n(t.target);u.closest(".compare").length===0&&i.saveScrollPosition(r.closest(i.pageItemSelector))})}});this.destroy=this.scroller.destroy}}(jQuery,window),function(n){function t(t){t.closest(".list-bottom").length>0&&n("html, body").animate({scrollTop:0},1e3)}shop.productlist_paging=function(t){if(!t)throw new Error("options need to be set for shop.productlist_paging");t=n.extend({autoInit:!0},t);this.opt=t;t.autoInit&&this.init()};shop.productlist_paging.prototype.init=function(){var n=this;n.$page=n.opt.$wrap.find("#Page");n.$ispaging=n.opt.$wrap.find("#IsPaging");this.$paging=this.opt.$list.find(".list-paging");this.bindEvents();n.setSelected()};shop.productlist_paging.prototype.bindEvents=function(){var i=this,r=this.$paging.data("maxpage");this.$paging.find(".paging-elements li a").hClick(function(){t(n(this));i.updateSelected(n(this).data("page"))},{preventDefault:!0});this.$paging.find("button.next").hClick(function(){i.$page.val()<r&&(t(n(this)),i.updateSelected(parseFloat(i.$page.val())+1))},{preventDefault:!0});this.$paging.find("button.previous").hClick(function(){i.$page.val()>1&&(t(n(this)),i.updateSelected(parseFloat(i.$page.val())-1))},{preventDefault:!0});(hLib.getMedia()==="mobile"||hLib.getMedia()==="tablet-portrait")&&this.$paging.find(".mobile-paging select").change(function(){i.updateSelected(n(this).val())})};shop.productlist_paging.prototype.updateSelected=function(n){var t=this;t.$page.val(n);shop.productlist.history.update();t.setSelected()};shop.productlist_paging.prototype.updateIsPaging=function(){var n=this;n.$ispaging.val()==="true"?n.$ispaging.val(!1):n.$ispaging.val(!0);n.updateSelected(1)};shop.productlist_paging.prototype.setSelected=function(){var t=this,n;this.$paging.find(".paging-elements li a").removeClass("selected");n=t.$page;this.$paging.find(".paging-elements li a[data-page="+n.val()+"]").addClass("selected");this.$paging.find(".mobile-paging select").val(n.val())};shop.productlist_paging.prototype.getData=function(){var t=this,n={};return n.Page=t.$page.val(),n.IsPaging=t.$ispaging.val(),n};shop.productlist_paging.prototype.hide=function(){this.$paging.hide()};shop.productlist_paging.prototype.show=function(){this.$paging.show()}}(jQuery,window);shop.productlist_history=function(){function t(){var n=i();n===!1?shop.productlist.refresh(!1,!0):shop.productlist.refresh(n)}function i(){var n={},f=location.href.split("?")[1],e,u,i;if(!f)return!1;for(e=decodeURIComponent(f),u=e.split("&"),i=0;i<u.length;i++){var o=u[i].split("="),t=o[0],r=o[1];n.hasOwnProperty(t)?($.isArray(n[t])||(n[t]=[n[t]]),n[t].push(r)):(r==="null"&&(r=null),n[t]=r)}return n}function u(){var i=location.href.split("?");r?(history.pushState(null,null,n()),t()):location.href=i[0]+n()}function n(n){var i=shop.productlist.getModelData(),r=[],t,u,f;for(t in i)if(i.hasOwnProperty(t)&&i[t].length>0)if($.isArray(i[t]))for(u=0;u<i[t].length;u++)r.push(t+"="+encodeURIComponent(i[t][u]));else r.push(t+"="+encodeURIComponent(i[t]));return n&&(f=r.indexOf("Page="+i.Page),f>-1&&(r[f]="Page="+n)),"?"+r.join("&")}function f(t){var i=location.href.split("?");return i[0]+n(t)}var r="history"in window&&window.history.pushState;$(window).off("popstate.productlisthistory").on("popstate.productlisthistory",t);return{getData:i,update:u,getPaginationLink:f}},function(n,t){shop.compareProducts=function(){function u(){n.find("tr.prop-line").each(function(){var n=t(this),r=!1,i;n.find("td[data-productid]").each(function(){var n=t(this).find(".value").text();i?i!==n&&(r=!0):i=n});r?n.addClass("different-values"):n.removeClass("different-values")})}function f(){var t=n.find(".remove-product");t.length===1&&(t.hide(),i.parent().hide(),r(!0))}function r(t){var r=n.find("tr.prop-line:not(.different-values)");!i.is(":checked")||t?r.show():r.hide()}var n=t("#compare-products"),i;n.find(".link-back").hClick(function(){hLib.modal2.close()});i=n.find(".show-only-diff input").change(function(){r()});n.find(".remove-product .btn").hClick(function(){var i=t(this).closest(".header-product").index();n.find("tr").each(function(){t(this).children(":eq("+i+")").remove()});u();r();f()});f();u()}}(window,jQuery),function(n,t,i){shop.productlist_setActiveProductGroup=function(t){var i=hLib.getMedia()==="mobile";i||t.ProductGroupId&&n("#main-menu").find("a[data-productgroup-id="+t.ProductGroupId+"]").closest(".main-menu-item").addClass("main-menu-active-item")};var r=!0;shop.productlist_init=function(u){u=n.extend({filter:!0,paging:!0,infoBar:!0,infinityScroll:!0,masonry:!1,pageSize:1},u);shop.productlist=function(){function b(){var t,p,b,k,v;f=n(u.wrapper);l=f.find(".list-filter");o=f.find(".list-content");s=f.find(".list-info");h=f.find(".list-paging");c=f.find(".ss-kit-list.masonry");u.filter?shop.productlist.filter=new shop.productlist_filter({$list:o,$wrap:f,$filter:l}):(f.addClass("filter-hidden"),l.remove());u.infoBar?shop.productlist.infoBar=new shop.productlist_infoBar({$list:o,$wrap:f}):s.hide();u.paging?(e.getData().IsPaging!=i&&s.find("#IsPaging").val(e.getData().IsPaging),shop.productlist.paging=new shop.productlist_paging({$list:o,$wrap:f}),r&&(t=parseInt(n("#Page").val()),t>1&&(p=e.getPaginationLink(t-1),n("head").append("<link rel='prev' id='prevLink' href='"+p+"'>")),b=h.data("maxpage"),t<b&&(k=e.getPaginationLink(t+1),n("head").append("<link rel='next' id='nextLink' href='"+k+"'>")),r=!1)):h.hide();u.infinityScroll&&(v=f.find(".infinityScroll-toggle"),s.find("#IsPaging").val()==="true"?(shop.productlist.paging.show(),v.html(v.data("default-text"))):(shop.productlist.paging.hide(),v.html(v.data("new-text")),shop.productlist.infinityScroll=new shop.productlist_infinityScroll({$target:o.find("ul.product-list"),getPage:function(t){return n.ajax({url:shop.url.productListPage,method:"post",data:w(y({Page:t}))})},onPageInserted:function(n){a(n,o);shop.lazyload.init()},pageSize:u.pageSize,onReplaced:function(){shop.lazyload.init()}})),f.find(".infinityScroll-toggle").hClick(function(){shop.productlist.paging.updateIsPaging()},{preventDefault:!0}));u.masonry&&shop.kitList.initMasonry(c);a();g();u.filter?f.find("#filter-list-toggle").hClick(function(){shop.productlist.filter.toggle();u.masonry&&shop.kitList.updateMasonryLayout(c)},{preventDefault:!0}):f.find("#filter-toggle").hide();n(".read-more-mobile").hClick(function(){n(this).closest(".list-header").toggleClass("read-more-chosen")})}function a(t,i){if(shop.modalLinks.init(t),u.masonry){var r=n(t||c);shop.kitList.bindMasonryHoverEvents(r)}else d(i||t),shop.sharedMoodboard.bindAddToMoodboard(i||t),shop.social.bindSocialMediaButtons(i||t)}function k(r,o){if(!v){v=hLib.getTime();var s=f,c=.7;u.masonry&&(c=.9);p=setTimeout(function(){s.hLoading({autoHide:6e5,opacity:c,text:shop.translations.productListUpdating,textBoxCss:{marginTop:"20px"},msgBoxCss:{top:"200px",marginTop:"0"}})},100);f.find(".infinityScroll-toggle").hasClass("loaded-infinity")&&shop.productlist.infinityScroll.destroy();setTimeout(function(){var c=y(i,o),u;r&&n.extend(c,r);c.PageId=n("[data-pageid]").data("pageid");u=n.ajax({url:shop.url.productListFilterAndPage,method:"post",data:w(c)});u.then(function(i){var r,u,o,s;(n("#nextLink").length||n("#prevLink").length)&&(n("#nextLink").remove(),n("#prevLink").remove(),r=parseInt(n("#Page").val()),r>1&&(u=e.getPaginationLink(r-1),n("head").append("<link rel='prev' id='prevLink' href='"+u+"'>")),o=h.data("maxpage"),r<o&&(s=e.getPaginationLink(r+1),n("head").append("<link rel='next' id='nextLink' href='"+s+"'>")));n(t).trigger(n.Event("listupdated"));n(".product-group-headline").remove();n(".js-raptor-list-content-block").remove();f.replaceWith(i);shop.lazyload.init()});u.fail(function(){hLib.growl({type:"error",msg:shop.translations.productListAnErrorOccurredWhenLoading})});u.always(function(){clearTimeout(p);s.hLoading(!1);v=!1})},25)}}function y(t,i){var r={EnabledFacets:[],Page:1};return(n.extend(r,shop.productlist.infoBar.getData()),i)?r:(n.extend(r,shop.productlist.filter.getData()),n.extend(r,shop.productlist.paging.getData()),t&&n.extend(r,t),r)}function w(t){var i,u,r;for(i in t)if(t.hasOwnProperty(i)&&n.isArray(t[i])&&(u=t[i],u.length>0)){for(r=0;r<u.length;r++)t[i+"["+r+"]"]=u[r];delete t[i]}return t}function d(t){t=n(t||f);shop.listproduct.bind(t)}function g(){}var f,l,o,s,h,c,e=shop.productlist_history(),v=!1,p;return{history:e,refresh:k,pageLoad:b,getModelData:y,bindItemEvents:a}}();shop.productlist.pageLoad()}}(jQuery,window)