"use strict";var articleContainers=document.querySelectorAll("#pd-articles");function initSearch(t){var e=new Com.PepperDigital.SearchFilterSystem;e.dataset=t,e.search.type="client";var i=document.querySelectorAll(".pd-filter-container"),a=[{property:"title",relevance:2},{property:"summary",relevance:1}],r=[];i.forEach((function(t){a.push({property:t.id,relevance:2}),r.push({type:"dynamic",selectType:"multi",property:t.id,viewAll:"View all"})})),e.search.properties=a,e.search.minMatchRatio=.2,e.filters.set(r),e.highlights.highlightProperty="summary",e.stopWords.disable(),e.stopWords.add(["Tommy","Arnott"]),e.stopWords.remove(["Tommy"]),e.stopWords.enable(),e.pagination.resultsPerPage=12,e.onUpdate=function(t){!function(t){var e=document.querySelector("#pd-articles");if(0==t.length)return void(e.innerHTML='
No results found
');var i="",a=e.getAttribute("data-pageColor"),r=e.getAttribute("data-blackBg"),n="";r&&(n="pd-bg__black__button");for(var s in t)i+='',i+='',i+='',i+='
',i+='
'+t[s].typecategory+"",i+='
'+t[s].title+"
",i+='
'+t[s].summary+"
",i+="
",i+='
',i+="
",i+="";e.innerHTML=i}(t.results.paged);document.querySelector("#timestamp_filter"),document.querySelector("#timestamp_filter_clear");i.forEach((function(e){var i=e.getAttribute("data-filtername");renderfilterSetDropdown(e,t.filters.getFilter(e.id),t.filters.hasSelection(e.id),i)})),renderPagination(t.pagination)},e.deeplinks.process=!0,e.onError=function(t){console.log("Error: "+t)},e.init(),window.searchSystem=e}null!=articleContainers&&articleContainers.forEach((function(t){var e=t.getAttribute("data-jsonSrc"),i=t.getAttribute("data-pageColor"),a=t.getAttribute("data-blackBg"),r="";if(a&&(r="pd-bg__black__button"),null!=e){var n=new XMLHttpRequest;n.open("GET",e),n.send(),n.onload=function(){var e=JSON.parse(n.response);e.forEach((function(t){Object.keys(t).forEach((function(e){if(-1!==e.indexOf("category")){var i=t[e].split(",");t["filter_"+e]=i}}))}));var a="";e.forEach((function(t){void 0!==t&&(a+='',a+='',a+='',a+='
',a+='
'+t.typecategory+"",a+='
'+t.title+"
",a+='
'+t.summary+"
",a+="
",a+='
',a+="
",a+="")})),t.innerHTML=a,initSearch(e)}}}));