var basePageHref=window.location.href.replace(/\#.*$/,"").replace(/\/$/,"").replace(/\/skin-([\w_-]+?)(?:\/|\?|$)/,"");$(function(){if(qs.init(),$("#qs_Colour").length&&$("#qs_Collection").length&&$("#qs_Colour").parent().insertBefore($("#qs_Collection").parent()),$(document).on("click",".filter-item div.qsheader",function(){$(this).find("img.plus").toggle(),$(this).find("img.minus").toggle(),$(this).parent().find("> :not(.qsheader):not(#priceSlider)").addClass("showQuickSearchItem"),$(this).toggleClass("openDropDown")}),$(document).find("div.qsheader").click(),$(document).find("div.qsheader img").toggle(),setTimeout(function(){filtersConfig(),$(".chooser-filters").addClass("config-set")},1e3),$(".filter-launch").on("click",function(){$(".chooser-filters").addClass("active"),$("body").addClass("filter-active")}),$(".filter-close").on("click",function(){closeFilters()}),$(document).on("click",".filter-item .qsheader",function(){$(".filter-item").not($(this).closest(".filter-item")).find('[data-type="filter-list"]').removeClass("active"),$(this).closest(".filter-item").find('[data-type="filter-list"]').toggleClass("active"),$(".filter-item .qsheader").not($(this)).removeClass("active"),$(this).toggleClass("active")}),$(document).on("click",".filter-title .title",function(){$(this).closest('[data-type="filter-list"]').removeClass("active"),$(".chooser-filters").addClass("active")}),$(document).on("click",".button-clear-all",function(){location.hash&&(hash="",qs.clearAllFilters()),$(".qsheader").removeClass("selected").removeClass("active")}),$(document).on("qs-filters-updated",function(e){$(".sale-filter-grid").children().removeClass("sale-filter-link--active"),updateFilterHeader()}),$(".sale-filter").length&&$("body").addClass("sale-filter-page"),$("#slider-range").on("slidechange",function(e,t){$("#slider-range").slider("option","min")+","+$("#slider-range").slider("option","max")!=t.values?($("#slider-range").closest(".filter-item").find(".qsheader").addClass("selected"),"desktop"!=getDeviceType()&&"wide"!=getDeviceType()||$(this).closest(".filter-item").find(".filter-title .title").text("Price Range Selected")):($("#slider-range").closest(".filter-item").find(".qsheader").removeClass("selected"),"desktop"!=getDeviceType()&&"wide"!=getDeviceType()||$(this).closest(".filter-item").find(".filter-title .title").text("All Prices"))}),$(document).on("click",".apply-filters",function(){hash&&applyHashFilters(hash),closeFilters()}),$(".sort-title").on("click",function(){$(".sod_select ").click()}),"mobile"!=getDeviceType()&&"tablet"!=getDeviceType()||$('select[name="chooser-sort"] :selected').is(":first-child")||$(".sort-title").text($('select[name="chooser-sort"] :selected').text()),$('select[name="chooser-sort"]').change(function(){"mobile"!=getDeviceType()&&"tablet"!=getDeviceType()||$(".sort-title").text($('select[name="chooser-sort"] :selected').text()),$(this).val()&&(window.location.href=$(this).val())}),$(document).on("click",".sale-filter-link",function(){$(".sale-filter-grid").children().removeClass("sale-filter-link--active"),$(this).addClass("sale-filter-link--active"),qs.clearAllFilters()}),$(document).on("change",".sale-filter-select",function(){var e=this.options[this.selectedIndex],t=e&&e.value;t&&(qs.clearAllFilters(),window.location.href=skinJS_SiteURL+"/"+t)}),$(".chooser-banner").length&&($(".chooser-banner").find(".main-banner-button").length>1&&$(".chooser-banner").find(".main-banner-button").show(),$(".chooser-banner .main-banner-main-title-link").length?-1===$(".chooser-banner .main-banner-main-title").html().indexOf("none")&&$("h1.listingsH1").remove():getDeviceWidth()>800&&($("h1.listingsH1").prependTo(".chooser-banner .main-banner-elements"),$(".chooser-banner .main-banner-elements h1.listingsH1").wrap('<div class="main-banner-main-title-link"></div>').wrap('<div class="main-banner-main-title"></div>')),$(".chooser-banner .main-banner-sub-title-link").length||"wide"!=getDeviceType()||$(".product-listing-header-text").length&&$.trim($(".product-listing-header-text").text()).length&&($(".product-listing-header-text").length>1&&$(".product-listing-header-text").each(function(e,t){e>0&&t.remove()}),$('<div class="main-banner-sub-title"></div>').insertAfter($(".chooser-banner .main-banner-main-title-link")),$(".chooser-banner .main-banner-sub-title").append($(".product-listing-header-text, .product-listing-header-text + .truncate-link")),$(".chooser-banner .main-banner-elements").data("links_color")&&$(".chooser-banner .main-banner-sub-title .product-listing-header-text a").css("color","#"+$(".chooser-banner .main-banner-elements").attr("data-links_color"))),getDeviceWidth()>800&&($(".chooser-banner .main-banner-elements").attr("data-title-color").length&&$(".chooser-banner .main-banner-main-title").css("color","#"+$(".chooser-banner .main-banner-elements").attr("data-title-color")),$(".chooser-banner").attr("data-bg-color").length&&$(".chooser-banner").css("background-color","#"+$(".chooser-banner").attr("data-bg-color"))),"wide"==getDeviceType())){$(".chooser-banner .main-banner-elements").attr("data-body-color").length&&$(".chooser-banner .main-banner-sub-title").css("color","#"+$(".chooser-banner .main-banner-elements").attr("data-body-color"));var e=$(".chooser-banner .main-banner-elements").attr("data-links_color");void 0!==e&&!1!==e&&$(".chooser-banner .main-banner-sub-title").find("a").css("color","#"+$(".main-banner-elements").attr("data-links_color"))}var t;$(document).on({mouseenter:function(){let e=$(this);if("mobile"==getDeviceType()||"tablet"==getDeviceType())return!1;t=setTimeout(function(){e.find(".colours-block").length&&e.find(".item-colourways").addClass("expanded")},200)},mouseleave:function(){if("mobile"==getDeviceType()||"tablet"==getDeviceType())return!1;let e=$(this),i=e.data("current"),s=e.find(".image img");if(0==e.find(".colours-block").length)return!1;s.attr("src",s.attr("src").replaceAll(i,e.data("id"))),s.attr("srcset",s.attr("srcset").replaceAll(i,e.data("id"))),e.find("a.main").each(function(){$(this).attr("href",e.data("href"))}),e.find(".price").text(e.data("price")),e.find(".rrp").remove(),e.data("rrp")&&e.find(".item-price").append('<div class="rrp">'+e.data("rrp")+"</div>"),e.find(".rrp").text(e.data("rrp")),e.find(".free-id-badge").show(),e.find(".product-class").show(),e.data("current",e.data("id")),clearTimeout(t),setTimeout(function(){e.find(".item-colourways").removeClass("expanded")},400)}},"#quicksearchresults .item"),$(document).on({mouseenter:function(){let e=$(this).closest(".item"),t=e.find(".image img"),i=$(this),s=i.data("id"),r=e.data("current");t.attr("src",t.attr("src").replaceAll(r,s)),t.attr("srcset",t.attr("srcset").replaceAll(r,s)),e.find("a.main").each(function(){$(this).attr("href",i.find("a").attr("href"))}),e.find(".price").text(i.data("price")),e.find(".rrp").remove(),i.data("rrp")&&e.find(".item-price").append('<div class="rrp">'+i.data("rrp")+"</div>"),e.find(".free-id-badge").hide(),e.find(".product-class").hide(),e.data("current",s)}},".productColourLink:not(.more)")});var updatePrices,qs={itemtypes:[],brands:[],demographics:[],sizes:[],tags:[],filter:{},products:[],availableProducts:[],productsPerPage:60,mouseDown:0,page:1,warehouses:[],init:function(){var e=this;document.body.onmousedown=function(){e.mouseDown++},document.body.onmouseup=function(){e.mouseDown--},setupPaginationLinks(),this.addFilters(),this.applyFilters(),setFavouritedItems()},addFilters:function(){for(var e="",t=0;t<this.itemtypes.length;t++)e+='<a href="#itemtype='+this.itemtypes[t]+'" id="itemtypelink'+t+'" class="qsoff">'+this.itemtypes[t]+"</a> ";$("#itemtype").html(e+'<div class="clearFix"></div>');var i="";for(t=0;t<this.demographics.length;t++)i+='<a href="#demographic='+this.demographics[t]+'" id="demographiclink'+t+'" class="qsoff">'+this.demographics[t]+"</a> ";$("#demographic").html(i+'<div class="clearFix"></div>');var s="";for(t=0;t<this.brands.length;t++)s+='<a href="#brand='+this.brands[t]+'" id="brandlink'+t+'" class="qsoff">'+this.brands[t]+"</a> ";$("#brand").html(s+'<div class="clearFix"></div>');var r="";for(t=0;t<this.sizes.length;t++)r+='<a href="#size='+this.sizes[t]+'" id="sizelink'+t+'" class="qsoff">'+formatDisplaySize(this.sizes[t],1)+"</a> ";$("#sizes").html(r+'<div class="clearFix"></div>');var a="";for(t=0;t<this.warehouses.length;t++)a+='<a href="#warehouse='+this.warehouses[t]+'" id="warehouse'+t+'" class="qsoff">'+this.warehouses[t]+"</a> ";$("#warehouse").html(a+'<div class="clearFix"></div>'),addTagFilters()},clearAllFilters:function(){this.filter={},this.filterProducts("update"),this.sortProducts();var e=$("#slider-range").slider("option");$("#slider-range").slider("values",[e.min,e.max]),$("#slideMin").val(e.min),$("#slideMax").val(e.max)},applyFilters:function(){this.getFilter(),this.filter.size&&(this.filter.size=this.filter.size.replace(/%20/g," ")),this.filterProducts("update"),this.sortProducts(),this.displayProducts().then(()=>{this.addPageLinks(),this.updateFilters()})},getFilter:function(){for(var e=location.hash.replace(/^#/,"").split(","),t=0;t<e.length;t++){var i=e[t].split("="),s=i[0],r=i[1];r&&"all"!=r||(r=""),this.filter[s]=r}},filterProducts:function(e,t){var i=[];t||(t=this.filter);var s=t.size?t.size.split("~"):[],r=t.tag?t.tag.replace(/%20/g," ").replace(/[^0-9~]/g,"").split("~"):[],a=t.pricerange?t.pricerange.split("-"):[],l=t.itemtype;l&&(l=(l=(l=l.toLowerCase()).replace(/&nbsp;/g," ")).replace(/%20/g," "));var n=t.brand;n&&(n=(n=n.toLowerCase()).replace(/%20/g," "));for(var o=t.warehouse,c=0;c<this.products.length;c++){var d=1,h=this.products[c];if(l&&"all"!=l&&!l.split("~").includes(h.type.toLowerCase())&&(d=0),n&&!n.split("~").includes(h.brand.toLowerCase())&&(d=0),t.demographic&&"undefined"!=t.demographic&&t.demographic.toLowerCase()!=h.demographic.toLowerCase()&&(d=0),s.length){var u=0,f=JSON.parse(h.lcSizes);s.forEach(function(e){f.includes(e.toLowerCase())&&(u=1)}),u||(d=0)}o&&(h.warehouses.includes(o)||(d=0)),a[0]&&h.price<a[0]&&(d=0),a[1]&&h.price>a[1]&&(d=0);for(var p=0;p<r.length;p++)r[p]&&-1==h.tagIDs.indexOf(r[p])&&(d=0);d&&i.push(h)}return e&&(this.availableProducts=i),i},sortProducts:function(){var e=this.filter.sort;e&&this.availableProducts.sort(function(t,i){if("rank"==e){if(t.rank<i.rank)return-1;if(t.rank>i.rank)return 1}else if("name"==e){if(t.name<i.name)return-1;if(t.name>i.name)return 1}else if("price"==e){if(t.price<i.price)return-1;if(t.price>i.price)return 1}else if("pricehightolow"==e){if(t.price>i.price)return-1;if(t.price<i.price)return 1}else if("newest"==e){var s=t.pid,r=i.pid;if(s>r)return-1;if(s<r)return 1}else if("biggestsaving"==e){var a=t.rrp?t.rrp-t.price:0,l=i.rrp?i.rrp-i.price:0;if(a>l)return-1;if(a<l)return 1}return 0})},displayProducts:function(){return new Promise((e,t)=>{var i,s;"all"!=this.page&&(i=(this.page-1)*this.productsPerPage+1,s=this.page*this.productsPerPage);for(var r=[],a=0;a<this.availableProducts.length;a++)("all"==this.page||a+1>=i&&a+1<=s)&&r.push(layoutChooserProduct(this.availableProducts[a]));Promise.all(r).then(t=>{var i=t.join("");if($("#quicksearchresults").html(i),$(".products-available").html(this.availableProducts.length+" "+jslocalstrings["products available"]),this.availableProducts.length||$(".products-available").html(jslocalstrings["No products match your options."]),$(".filter-wrapper").length){var s=$(".filter-wrapper");if(!isScrolledIntoView(s)&&!this.mouseDown&&"all"!=this.page){var r=s.offset().top;$("body").animate({scrollTop:r},500)}}e(!0),window.document.dispatchEvent(new Event("DOMContentLoaded",{bubbles:!0,cancelable:!0}))}).catch(e=>{console.error("Error in displayProducts:",e),t(e)})})},addPageLinks:function(){$("#pager").remove();var e=window.location.href,t=(e=(e=e.replace(/\/page\/[\dal]+\/?/,"")).replace(/#.*/,"")).match(/(\?.*)/),i="";if(null!=t&&(i=t[0]||""),"?"==(i=(i=(i=(i=i.replace(/p=(\d+|all)/,"")).replace(/&+/,"&")).replace(/^\?&/,"?")).replace(/&$/,""))&&(i=""),e=e.replace(/\?.*/,""),"all"!=this.page&&!$("#quicksearchresults #pager").length&&this.availableProducts.length){var s=this.page+1,r="";if(this.page*this.productsPerPage<this.availableProducts.length){var a=i?i+"&p="+s:"?p="+s;r='\n        <div class="loadMoreResults">\n          <p>You\'ve viewed '+(this.page*this.productsPerPage>this.availableProducts.length?this.availableProducts.length:this.page*this.productsPerPage)+" of "+this.availableProducts.length+' products</p>\n          <a id="loadChooserResultsButton" href="'+e+a+'" onclick="qs.loadMoreResults(event)">'+jslocalstrings["Load more products"]+"</a>\n        </div>"}$(".loadMoreResults").html(r)}},updateFilters:function(){var e,t,i=this;$(".qsoff, .qson").each(function(){var s=$(this),r=Object.create(i.filter),a=s.closest(".showQuickSearchItem").attr("id");if(a&&-1==a.indexOf("qslinks_")){var l=a;"sizes"==l&&(l="size"),l!=t&&(e=0),t=l;var n=l+"s",o=i[n]?i[n][e]:"";r[l]=o;var c=i.filter[l]&&i.filter[l].replace("%20"," ")==o;"brand"!=l&&"itemtype"!=l||!i.filter[l]||(i.filter[l]=i.filter[l].replace(/%20/g," ")),i.filter[l]&&("brand"==l&&i.filter[l].split("~").includes(o)||"itemtype"==l&&i.filter[l].split("~").includes(o)||"size"==l&&i.filter[l].split("~").includes(o)||"warehouses"==l&&-1!=i.filter[l].indexOf(o))&&(c=1),s.attr("class",c?"qson":"qsoff")}else if(a){var d=a.substring(a.indexOf("_")+1);d=d.replace("-"," ");var h=new RegExp("(^|~)"+d+".[0-9]+","i");r.tag=r.tag?r.tag.replace(h,""):"";for(var u=i.tags.split(","),f=0;f<u.length;f++){var p=u[f].split(":"),g=this.innerText;if(this.className.includes("qson")&&(g=g.replace(/\s*check$/,"")),p[0]==d&&p[1]==g){i.filter.tag&&(i.filter.tag=i.filter.tag.replace(/%20/g," ")),r.tag+="~"+p[0]+"."+p[2];c=!(!i.filter.tag||-1==i.filter.tag.indexOf(p[0]+"."+p[2]));s.attr("class",c?"qson":"qsoff"),p[0]==jslocalstrings.Colour&&s.addClass("color-filter")}}}i.filterProducts(0,r).length||s.hasClass("qson")?(s.removeClass("disabled-filter"),this.onclick=function(){}):(s.addClass("disabled-filter"),this.onclick=function(e){e.preventDefault()}),e++}),$(".filter-item").each(function(){var e=$(this),t=!!e.find(".qson").length;e.find(".qsheader")[(t?"add":"remove")+"Class"]("selected")}),$(document.body).trigger("qs-filters-updated")},loadMoreResults:function(e,t){e.preventDefault(),this.getFilter(),this.filterProducts("update"),this.sortProducts(),this.page++,this.addPageLinks();for(var i=(this.page-1)*this.productsPerPage+1,s=t?this.availableProducts.length:this.page*this.productsPerPage,r=[],a=0;a<this.availableProducts.length;a++)a+1>=i&&a+1<=s&&r.push(layoutChooserProduct(this.availableProducts[a]));Promise.all(r).then(e=>{var t=e.join("");$("#quicksearchresults").append(t),s>=this.availableProducts.length&&$(".loadMoreResults").html(""),window.document.dispatchEvent(new Event("DOMContentLoaded",{bubbles:!0,cancelable:!0}))})}},qsColours={Black:"000000",Noir:"000000",Negro:"000000",Blue:"2391c6",Bleu:"2391c6",Azul:"2391c6",Brown:"663300",Marron:"663300",Gold:"CC9900",Or:"CC9900",Oro:"CC9900",Green:"7db845",Vert:"7db845",Verde:"7db845",Grey:"777878",Gris:"777878",Navy:"000099",Marine:"000099",AzulMarino:"000099",Orange:"f16b33",Naranja:"f16b33",Pink:"ee3d96",Rose:"ee3d96",Rosa:"ee3d96",Purple:"912CEE",Pourpre:"912CEE","Púrpura":"912CEE",Red:"e43733",Rouge:"e43733",Rojo:"e43733",Silver:"CCCCCC",Argent:"CCCCCC",Plata:"CCCCCC",White:"FFFFFF",Blanc:"FFFFFF",Blanco:"FFFFFF",Yellow:"FDD446",Jaune:"FDD446",Amarillo:"FDD446",Turquoise:"73d7d7",Spearmint:"73d7d7",Turquesa:"73d7d7",Royal:"283FDA",Bleuroi:"283FDA",Azulreal:"283FDA",Maroon:"8B1C62",Bordeaux:"8B1C62",Granate:"8B1C62",Charcoal:"222222",Carbon:"222222",Gunmetal:"555555",Multi:"white","Hyper Punch":"FF1493"};function addTagFilters(){var e="",t={},i={},s=[];if(!$.trim($("#resultsTags").html()).length){for(var r,a=qs.tags.split(","),l="",n=a.filter(function(e){return e.split(":")[0].length>0}),o=[],c=0;c<n.length;c++){var d=n[c].split(":");d[0]!=r?o[d[0]]=1:o[d[0]]++,r=d[0]}for(c=0;c<a.length;c++){var h=[];if(!("Boot Type"==(h=a[c].split(":"))[0]||o[h[0]]<2)&&h[0]!=l){if("Type"==(u=(l=h[0]).replace(/\s/g,"-")))continue;e+='\n</div>\n<div class="filter-item">\n<div class="qsheader openDropDown" id="qs_'+u+'">\n  <span class="qsTagType">'+l+'</span>\n</div>\n<div id="qslinks_'+u+'" class="showQuickSearchItem"></div>'}}}if(qs.tags){l="";var u="",f="";s=qs.tags.split(",");for(c=0;c<s.length;c++){h=[];var p=(h=s[c].split(":"))[1],g=p.replace(/\s/,""),v=h[2];if(h[0]==l||(t[u=(l=h[0]).replace(/\s/g,"-")]="",!(h.length<2)&&h[0])){var m="#tag="+stripAccentedCharacters(l+"."+v);i[u]=1,f="","Colour"==u||"Coloris"==u||"Color"==u?(f=' style="background-color: #'+qsColours[g]+'"',t[u]+='<div class="color-filter-wrapper '+g.toLowerCase()+'"><div class="color-label hidden">'+p+'</div><a href="'+m+'" id="taglink'+c+'" class="color-filter qsoff"'+f+'><div class="color-text">'+p+"</div></a></div>"):t[u]+='<a href="'+m+'" id="taglink'+c+'" class="qsoff">'+p+"</a>",qs.tags[c]=stripAccentedCharacters(s[c])}}}document.getElementById("resultsTags")&&($.trim($("#resultsTags").html()).length||(document.getElementById("resultsTags").innerHTML='<div class="filter-item">'+e+"</div>"),$("#resultsTags .filter-item").css("display","none"),$.each(t,function(e,t){$("#qslinks_"+e).html(t)}),$.each(i,function(e,t){$("#qslinks_"+e).parent().css("display","block")}),$("#resultsTags .filter-item").each(function(){"qslinks_Collection"==$(".showQuickSearchItem",this).attr("id")&&"qslinks_Colour"==$(this).next().find(".showQuickSearchItem").attr("id")&&$(this).next().after($(this))}),$("#resultsTags .filter-item").unwrap())}function slidePrice(e){$("#slideMin").attr("size",$("#slideMin").val().length),$("#slideMax").attr("size",$("#slideMax").val().length);var t="",i=location.hash.replace(/^#/,"");i&&(t=getPageLinks(i,"pricerange")),99!=e&&(location.href="#"+t+"pricerange="+$("#slideMin").val()+"-"+$("#slideMax").val())}function updatePricesFromSlider(){updatePrices&&clearTimeout(updatePrices),updatePrices=setTimeout("slidePrice(0)",150)}function qsSortBy(e){var t=["rank","price","pricehightolow","name","newest","biggestsaving"];e||(e="rank");for(var i=0;i<t.length;i++)sortoff="sort"+t[i].toString(),document.getElementById(sortoff)&&(e==t[i]?($("#"+sortoff).addClass("sorton"),$("#"+sortoff).blur(),"OPTION"==$("#"+sortoff).prop("nodeName")&&$("#"+sortoff).prop("selected",!0)):$("#"+sortoff).removeClass("sorton"))}function applyHashFilters(e,t){for(var i={itemtype:"",brand:"",demographic:"",sort:"",size:"",pricerange:"",tag:"",page:1},s=(e=replaceNbsps(e)).split(","),r=0;r<s.length;r++){var a=s[r].split("="),l=a[0],n=a[1],o="";n&&(o=(o=n.replace(/%20/g," ")).replace(/%C2%A0/g," "),"size"!=l&&"tag"!=l&&(o=o.replace(/\/.+/,"")),"page"==l&&(qs.page="all"==n?"all":parseInt(n))),i[l]=o}previousFiltersList=e,i.sort?qsSortBy(i.sort):qsSortBy();var c=[],d=[],h=[];c=qs.tags.split(",");for(var u=0;u<c.length;u++){var f=new Array;if((f=c[u].split(":"))[0]&&f[1]){var p=stripAccentedCharacters(f[0]+"."+f[2]);d[p]=f[0],h[p]=u}}var g=[];if(i.tag){g=i.tag.split("~");for(var v=0;v<g.length;v++)d[g[v]]&&openQuickSearchBlock("#qslinks_"+d[g[v]])}var m=getPageLinks(e,"itemtype"),b=i.itemtype.split("~");for(r=0;r<qs.itemtypes.length;r++){var k=document.getElementById("itemtypelink"+r),y="";b.includes(qs.itemtypes[r])||(y=qs.itemtypes[r]);for(var C=0;C<qs.itemtypes.length;C++)qs.itemtypes[r]!=qs.itemtypes[C]&&b.includes(qs.itemtypes[C])&&(y+="~"+qs.itemtypes[C]);y||(y="all"),k&&(k.href="#"+m+"itemtype="+y)}var q=getPageLinks(e,"size"),w=i.size.split("~");for(r=0;r<qs.sizes.length;r++){for(k=document.getElementById("sizelink"+r),y="",C=0;C<qs.sizes.length;C++)w.includes(qs.sizes[r])||qs.sizes[C]!==qs.sizes[r]||(y+="~"+qs.sizes[C]),w.includes(qs.sizes[C])&&qs.sizes[C]!==qs.sizes[r]&&(y+="~"+qs.sizes[C]);(y=y.replace(/^~/,""))||(y="all"),k&&(k.href="#"+q+"size="+y)}var P=getPageLinks(e,"demographic");for(var r in qs.demographics){if(k=document.getElementById("demographiclink"+r)){var F=qs.demographics[r]==i.demographic?"all":qs.demographics[r];k.href="#"+P+"demographic="+F}}var x=getPageLinks(e,"brand");for(r=0;r<qs.brands.length;r++){k=document.getElementById("brandlink"+r),y="";var L=i.brand.split("~");L.includes(qs.brands[r])||(y=qs.brands[r]);for(C=0;C<qs.brands.length;C++)qs.brands[r]!=qs.brands[C]&&L.includes(qs.brands[C])&&(y+="~"+qs.brands[C]);y||(y="all"),k&&(k.href="#"+x+"brand="+y)}var T="#"+getPageLinks(e,"sort");$("#sortrank").val(T+"sort=rank"),$("#sortprice").val(T+"sort=price"),$("#sortname").val(T+"sort=name"),$("#sortpricehightolow").val(T+"sort=pricehightolow"),$("#sortnewest").val(T+"sort=newest"),$("#sortbiggestsaving").val(T+"sort=biggestsaving");var D=getPageLinks(e,"tag");$.each(c,function(){var e=this.split(":"),t=stripAccentedCharacters(e[0]+"."+e[2]),s="taglink"+h[t],r="";-1==i.tag.indexOf(t)&&(r=t),$.each(g,function(){this!=t&&-1!=i.tag.indexOf(this)&&d[t]!=d[this]&&""!=this&&(r+="~"+this)}),$("#"+s).attr("href","#"+D+"tag="+r)}),slidePrice(99),t||qs.applyFilters(),setFavouritedItems(),$("#slider-range").length&&$(".ui-slider-range").length&&($("#slider-range").innerWidth()>0&&$(".ui-slider-range").outerWidth()>0&&$("#slider-range").innerWidth()!=$(".ui-slider-range").outerWidth()?($("#priceSlider .qson").remove(),$("#priceSlider").append('<div class="qson hidden"></div>')):$("#priceSlider .qson").remove())}function getPageLinks(e,t){for(var i="page=1,",s=e.split(","),r=0;r<s.length;r++){var a=s[r].split("="),l=a[0],n=a[1];n&&"page"!=l&&(i+=l+"="+(n=(n=n.replace(/%20/g," ")).replace(/%C2%A0/g," "))+",")}var o=new RegExp(t+"=[0-9a-z-~&.' ]*,?","i");return t&&(i=i.replace(o,"")),i}function openQuickSearchBlock(e){$(e).siblings(".qsheader").find(".plus").hide(0),$(e).siblings(".qsheader").find(".minus").show(0),$(e).addClass("showQuickSearchItem"),$(e).siblings(".qsheader").addClass("openDropDown")}function setupPaginationLinks(){$(document).on("click","#pageLink2,#pageLink1,#pageLinkAll",function(e){e.stopPropagation();var t=$(this).attr("data-hash-target");return t&&(window.location.hash=t),!1})}async function layoutChooserProduct(e){var t="",i="",s="";e.flashColour&&(s='style = "background:#'+e.flashColour+'"');var r=e.offerFlashTxt;if(e.qualifyFreeItem){r||(r=jslocalstrings["Free gift"]);var a="";"fr"!=skinJS_Language&&"es"!=skinJS_Language||(a=skinJS_Language),t='<div class="chooser-discount-flash free-item-flash'+a+'" '+s+">"+r+"</div>"}else if(e.freeID)t='<div class="free-id-badge chooser-discount-flash free-item-flash '+e.type.toLowerCase()+'" '+s+'><img src="'+skinJS_SiteURL+'/images/freebootpersonalisation/freeid-badge.png" alt="Free ID" /></div>';else if(e.freePremiumPersn){r||(r=jslocalstrings["Free premium personalisation"]);a="";"fr"!=skinJS_Language&&"es"!=skinJS_Language||(a=skinJS_Language),t='<div class="chooser-discount-flash free-item-flash'+a+'" '+s+">"+r+"</div>"}else if(1==e.buyOneGetOneFree)t="fr"==skinJS_Language?'<div class="chooser-discount-flash bogof fr" '+s+">1 acheté 1 gratuit</div>":"es"==skinJS_Language?'<div class="chooser-discount-flash bogof es" '+s+">2 x 1</div>":'<div class="chooser-discount-flash bogof" '+s+">Buy 1 get 1 FREE</div>";else if(e.buyOneGetOneFree){var l=e.buyOneGetOneFree;"en"==skinJS_Language&&(t='<div class="chooser-discount-flash bogof" '+s+">Buy "+l+" get 1 FREE</div>")}else if(e.discount>=5){var n="";t='<div class="chooser-discount-flash discounted" '+s+">"+(n="en"==skinJS_Language?e.showDiscount+" off":"-"+e.showDiscount)+"</div>",i='<div class="chooser-discount-flash discounted" '+s+">"+n+"</div>"}var o="";1==e.preOrder&&(o='<div class="chooser-status chooser-status-preorder">'+jslocalstrings["Pre-order"]+"</div>"),1==e.multiBuy&&(o='<div class="chooser-status chooser-status-multibuy">'+jslocalstrings["Multi-buy"]+"</div>");var c=`onmousedown="analyticsProductClick({\n    item_id: ${e.pid},\n    item_name: \`${e.analyticsName}\`,\n    item_brand: \`${e.brand}\`,\n    item_category: \`${e.type}\`,\n    price: ${e.price},\n    index: ${e.position}\n  }, \`${gaListType}\`\n  , \`${gaListID}\`)"`,d="";wishlistEnabled&&(d='<button type="button" title="Wishlist" onclick="updateWishlist(event, \''+e.pid+"', '1', '"+customerID+"', $(this), $(this).hasClass('active'))\" class=\"wishlist-button wishlist-item-"+e.pid+'" data-productid="'+e.pid+'"></button>');var h="";e.flashTxt&&(h='<div class="product-class product-class--flash" data-content="'+e.flashTxt+'">'+e.flashTxt+"</div>");var u=e.name;!e.isVGV&&e.freeExpress&&((r=e.freeExpressFlashTxt)&&(t='<div class="chooser-discount-flash free-item-flash" '+s+">"+r+"</div>"));var f="";isTradeAccount>0&&(u=e.pid+": "+u+" - "+e.colours,f="CURRENTSTOCKLEVEL:"+e.pid);var p="";if(bazaarVoiceID&&bazaarVoiceVisible&&(p=`<div class="average-rating" data-bv-show="inline_rating" data-bv-product-id="${e.pid}"></div>`),e.colourLinkedProducts){e.colourways="";var g=0,v=e.colourLinkedProducts.split(",");for(var m in v.unshift(e.pid),v){var $=v[m],b=qs.colourBlockData[$];b&&void 0!==b.price&&(++g>3||(e.colourways+='\n      <div class="productColourLink" data-id="'+$+'" data-price="'+b.price+'" data-rrp="'+b.rrp+'">\n        <a href="'+skinJS_SiteURL+"/"+b.url+'" title="'+b.title+'">'+b.thumb+"</a>\n      </div>"))}g>3&&(e.colourways+='<div class="productColourLink more">+'+(g-3)+"</div>"),e.colourways&&(e.colourways='<div class="colours-block">'+e.colourways+"</div>")}var k="";return Number.isInteger(e.coloursCount)&&(k='<div class="colours-count">'+e.coloursCount+(1==e.coloursCount?" Colour</div>":" Colours</div>")),'\n  <div\n    class="item"\n    data-id="'+e.pid+'"\n    data-current="'+e.pid+'"\n    data-freeid="'+(e.freeID?"1":"0")+'"\n    data-price="'+e.formatted_price+'"\n    data-rrp="'+(void 0!==e.formatted_rrp?e.formatted_rrp:"")+'"\n    data-href="'+skinJS_SiteURL+"/"+e.url+'"\n  >\n    <div class="item-image">\n      <a href="'+skinJS_SiteURL+"/"+e.url+'" '+c+' class="main">\n        <div class="image">\n        <div class="loader-dark"></div>'+e.imageTag+"</div>"+h+i+d+'\n        <div class="item-flashes">'+o+t+f+'\n        </div>\n      </a>\n    </div>\n\n    <div class="item-colourways">'+(void 0!==e.colourways?e.colourways:"")+'</div>\n\n    <div class="item-content">\n      <a href="'+skinJS_SiteURL+"/"+e.url+'" '+c+' class="main">\n        <div class="item-title">\n          <h4>'+u+"</h4>"+k+'\n    </div>\n    <div class="item-price">'+e.cost+"</div>"+p+"\n      </a>\n    </div>\n  </div>"}function filtersConfig(){$(".chooser-filters").find('[data-type="filter-list"]').length||$(".chooser-filters .filter-item").each(function(e,t){if($(".sale-filter-wrapper").length){if(!$(this).find(["#demographic","#itemtype","#brand","#priceSlider","#sizes"].join(",")).length)return void $(this).remove()}var i;$(this).find("a").length<=1&&!$(this).hasClass("filter-item-slider")&&$(this).remove();var s=$(this).find(".qson").length;"mobile"==getDeviceType()||"tablet"==getDeviceType()?i=$(this).find(".qsheader span:first-child").text():(i=s+" selected",$(this).hasClass("filter-item-slider")&&(i="All Prices")),$(this).find("div.showQuickSearchItem").attr("data-type","filter-list").prepend('<div class="filter-title"><div class="title">'+i+'</div><a href="#page=1" class="button button-clear-all">'+jslocalstrings["Clear All"]+"</a></div>"),$(".chooser-filters > .filter-actions").clone().appendTo($('[data-type="filter-list"]',this)),$(this).find("a.qsoff, a.qson").append('<ion-icon name="checkmark-outline"></ion-icon>'),$(".color-filter").each(function(){if(!$(this).find(".color-sample").length){var e=$(this).css("background-color");$(".color-text",this).prepend('<div class="color-sample" style="background-color: '+e+'"></div>'),$(this).css("background-color","transparent")}})})}function updateFilterHeader(){$(".filter-item").each(function(){if("desktop"==getDeviceType()||"wide"==getDeviceType()){var e=$(this).find(".qson").length;$(this).find(".filter-title .title").text(e+" selected")}})}function closeFilters(){$(".chooser-filters").removeClass("active"),$('[data-type="filter-list"]').removeClass("active"),$("body").removeClass("filter-active")}