@iamproperty/components 3.7.5 → 3.7.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * iamKey v3.7.5
2
+ * iamKey v3.7.6
3
3
  * Copyright 2022-2023 iamproperty
4
4
  */
5
- !function(t){"function"==typeof define&&define.amd?define(t):t()}((function(){"use strict";class t{constructor(t){document.body.classList.contains("youtubeLoaded")?t.addEventListener("click",(function(t){for(var a=t.target;a&&a!=this;a=a.parentNode)if(a.matches("a")){t.preventDefault(),e(a);break}}),!1):this.loadScripts(t,this.createEmbed)}loadScripts(t){return new Promise(((a,r)=>{var o=new Image;o.onload=function(){var r=document.createElement("script");r.src="https://www.youtube.com/iframe_api";var o=document.getElementsByTagName("script")[0];o.parentNode.insertBefore(r,o),document.body.classList.add("youtubeLoaded"),a(!0),r.onload=()=>{t.addEventListener("click",(function(t){console.log("click"),t&&t.target instanceof HTMLElement&&t.target.closest("a")&&(t.preventDefault(),e(t.target.closest("a")))}),!1)}},o.onerror=function(){r(!1)},o.src="https://youtube.com/favicon.ico"}))}}var e=function(t){typeof window.player<"u"&&"function"==typeof window.player.pauseVideo&&window.player.pauseVideo();var e=t.getAttribute("data-id"),a=t.getAttribute("id");if(typeof a>"u"||null==a){var r=String.fromCharCode(65+Math.floor(26*Math.random()));a=r+Date.now(),t.setAttribute("id",a)}window.player=new YT.Player(a,{height:"100%",width:"100%",videoId:e,playerVars:{modestbranding:1,playsinline:1,rel:0,showinfo:0},events:{onReady:function(t){t.target.playVideo()},onStateChange:function(t){t.data!=YT.PlayerState.PLAYING||o||(document.getElementById(a).classList.add("player-ready"),o=!0)}}});var o=!1},a=t=>{var e="",a=Array.from(t.querySelectorAll("fieldset[data-title]"));a.forEach(((t,r)=>{e+='<button data-title="'.concat(t.getAttribute("data-title"),'" type="button" class="').concat(0==r?"active":"",'">').concat(t.getAttribute("data-title"),"</button>");var o=document.createElement("div");o.classList.add("btn--wrapper"),t.appendChild(o),0!=r&&(o.innerHTML+='<button data-title="'.concat(a[r-1].getAttribute("data-title"),'" class="btn btn-secondary mb-0" type="button">Previous</button>')),r!=a.length-1&&(o.innerHTML+='<button data-title="'.concat(a[r+1].getAttribute("data-title"),'" class="btn btn-primary mb-0" type="button">Next</button>')),r==a.length-1&&(o.innerHTML+='<button class="btn btn-primary mb-0">Submit</button>')})),t.innerHTML='<div class="steps bg-primary">'.concat(e,"</div>").concat(t.innerHTML),t.addEventListener("click",(e=>{if(e&&e.target instanceof HTMLElement&&e.target.closest("button[data-title]")){var a=e.target.closest("button[data-title]"),r=t.querySelector('fieldset[data-title="'.concat(a.getAttribute("data-title"),'"]')),o=t.querySelector('.steps button[data-title="'.concat(a.getAttribute("data-title"),'"]'));Array.from(t.querySelectorAll("button")).forEach(((t,e)=>{t.classList.remove("active")})),Array.from(t.querySelectorAll("fieldset")).forEach(((t,e)=>{t.classList.remove("active")})),o.classList.add("active"),r.classList.add("active")}return null}))};window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"header"});class r extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});var t=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",e=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):"".concat(t,"/css/core.min.css"),a='@import "'.concat(t,'/css/components/header.css";'),r=document.createElement("template");r.innerHTML='\n <style>\n @import "'.concat(e,'";\n ').concat(a,"\n ").concat(this.hasAttribute("css")?'@import "'.concat(this.getAttribute("css"),'";'):"",'\n </style>\n <div class="header-banner">\n <div class="container" part="container">\n <slot name="breadcrumb"></slot>\n <div class="header-banner__inner">\n <slot></slot>\n </div>\n </div>\n <picture>\n \x3c!-- Actual image only loaded on desktops --\x3e\n <source srcset="" media="(min-width: 62em)">\n \x3c!-- Placeholder image --\x3e\n <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" alt="" lazy="" />\n </picture>\n </div>\n '),this.shadowRoot.appendChild(r.content.cloneNode(!0))}connectedCallback(){this.classList.add("loaded");var t=this.shadowRoot.querySelector("picture"),e=this.shadowRoot.querySelector("picture source");this.hasAttribute("image")?e.setAttribute("srcset",this.getAttribute("image")):t.remove()}}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"accordion"});class o extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});var t=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",e=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):"".concat(t,"/css/core.min.css"),a='@import "'.concat(t,'/css/components/accordion.css";'),r=document.createElement("template");r.innerHTML='\n <style>\n @import "'.concat(e,'";\n ').concat(a,"\n ").concat(this.hasAttribute("css")?'@import "'.concat(this.getAttribute("css"),'";'):"",'\n </style>\n <div class="accordion">\n <slot></slot>\n </div>\n '),this.shadowRoot.appendChild(r.content.cloneNode(!0))}connectedCallback(){!function(t){var e=t.querySelectorAll("details"),a=t.querySelectorAll("summary");if(e.forEach((t=>{t.classList.add("accordion-item")})),a.forEach((t=>{t.classList.add("accordion-header"),t.classList.add("accordion-button"),t.classList.add("h4")})),!t.classList.contains("accordion--keep-open")){var r=t.querySelectorAll(":scope > details");r.forEach((t=>{t.addEventListener("click",(()=>{r.forEach((e=>{e!==t&&e.removeAttribute("open")}))}))}))}}(this)}}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"tabs"});class s extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});var t=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",e=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):"".concat(t,"/css/core.min.css"),a=document.createElement("template");a.innerHTML='\n <style>\n @import "'.concat(e,'";\n\n :host(.admin-panel){\n display: contents!important;\n }\n \n ').concat(this.hasAttribute("css")?'@import "'.concat(this.getAttribute("css"),'";'):"",'\n </style>\n <div class="tabs">\n <div class="tabs__links"></div>\n <slot></slot>\n </div>\n '),this.shadowRoot.appendChild(a.content.cloneNode(!0))}connectedCallback(){var t=this.classList.toString().replace("container","");this.shadowRoot.querySelector(".tabs").setAttribute("class","tabs ".concat(t)),function(t){(function(t){var e=t.querySelectorAll(":scope > details");t.querySelectorAll(":scope > details > summary");var a=t.querySelector(":scope > .tabs__links");t.shadowRoot&&t.shadowRoot.querySelector(".tabs__links")&&(a=t.shadowRoot.querySelector(".tabs__links")),a||((a=document.createElement("div")).classList.add("tabs__links"),t.prepend(a)),e.forEach(((t,e)=>{var r=t.querySelector(":scope > summary");r.classList.add("visually-hidden");var o=document.createElement("button");t.hasAttribute("id")&&(o=document.createElement("a")).setAttribute("href","#".concat(t.getAttribute("id"))),t.hasAttribute("open")&&o.setAttribute("aria-pressed",!0),o.innerHTML="".concat(r.innerText),o.classList.add("link"),o.setAttribute("data-index",e),o.setAttribute("tabindex","-1"),a.appendChild(o)}))})(t),function(t){var e=t.querySelectorAll(":scope > details"),a=t.querySelectorAll(":scope > details > summary"),r=t.querySelectorAll(":scope .tabs__links > .link");t.shadowRoot&&(r=t.shadowRoot.querySelectorAll(".tabs__links > .link")),r.forEach((t=>{t.addEventListener("click",(a=>{a.preventDefault(),r.forEach((e=>{var a=e==t;e.setAttribute("aria-pressed",a)})),e.forEach(((e,a)=>{var r=t.getAttribute("data-index")==a;r?e.setAttribute("open",r):e.removeAttribute("open")})),t.hasAttribute("href")&&history.pushState(void 0,void 0,t.getAttribute("href")),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"openTab",tabTitle:t.textContent})}))})),a.forEach(((t,e)=>{t.addEventListener("focus",(t=>{r.forEach((t=>{t.classList.remove("focus")})),r[e].classList.add("focus")})),t.addEventListener("click",(t=>{t.preventDefault(),r[e].click()}))}))}(t),function(t){var e=t.querySelectorAll(":scope > details"),a=t.querySelectorAll(":scope > .tabs__links > button, .tabs__links > a");t.shadowRoot&&(a=t.shadowRoot.querySelectorAll(".tabs__links > button, .tabs__links > a")),location.hash&&t.querySelector('.tabs__links [href="'.concat(location.hash,'"]'))?(t.querySelector('[href="'.concat(location.hash,'"]')).setAttribute("open",!0),t.querySelector('details[id="'.concat(location.hash.replace("#",""),'"]')).setAttribute("open",!0)):t.querySelector("details[open]")||(e[0].setAttribute("open",!0),a[0].setAttribute("aria-pressed",!0))}(t)}(this)}}var n=function(t,e){if(!t.getAttribute("data-pages"))return!1;t.getAttribute("data-page")||t.setAttribute("data-page",1);var a=t.getAttribute("data-page"),r=t.getAttribute("data-pages"),o=t.getAttribute("data-total"),s=t.getAttribute("data-show"),n=t.getAttribute("data-increment");if(r<=1)return e.innerHTML="",!1;for(var i="",c=1;c<=r;c++)i+=c==a?'<li class="page-item active" aria-current="page"><span class="page-link">'.concat(c,"</span></li>"):'<li class="page-item"><a href="?page='.concat(c,'" class="page-link" data-page="').concat(c,'">').concat(c,"</a></li>");return e.innerHTML='<ul class="pagination mb-0 d-none d-sm-flex">\n '.concat(1==a?'<li class="page-item disabled"><span class="page-link">Previous</span></li>':'<li class="page-item"><a href="?page='.concat(parseInt(a)-1,'" class="page-link" data-page="').concat(parseInt(a)-1,'">Previous</a></li>'),"\n ").concat(i,"\n ").concat(a==r?'<li class="page-item disabled"><span class="page-link">Next</span></li>':'<li class="page-item"><a href="?page='.concat(parseInt(a)+1,'" class="page-link" data-page="').concat(parseInt(a)+1,'">Next</a></li>'),"\n </ul>"),e.innerHTML+='<div class="d-sm-none text-center">\n <span class="d-block pb-2">You\'ve viewed '.concat(s," of ").concat(o,' results</span>\n <a href="?show=').concat(parseInt(s)+parseInt(n),'" class="btn btn-primary w-100 m-0" data-show="').concat(parseInt(s)+parseInt(n),'">Load more results</a>\n </div>'),!0},i=t=>{var e=Array.from(t.querySelectorAll("thead th"));Array.from(t.querySelectorAll("tbody tr")).forEach(((t,a)=>{var r=Array.from(t.querySelectorAll("th, td")),o=["0","low","medium","high","unknown","n/a","pending","verified","overdue","incomplete","complete","completed","approval required","requires approval","to do","not started","warning","error"];r.forEach(((t,a)=>{var r=e[a];if(typeof r<"u"){var s=document.createElement("div");s.innerHTML=r.innerHTML;var n=s.textContent||s.innerText||"";t.setAttribute("data-label",n),r.hasAttribute("data-td-class")&&t.setAttribute("class",r.getAttribute("data-td-class")),r.hasAttribute("data-format")&&(t.setAttribute("data-format",r.getAttribute("data-format")),t.innerHTML=b(r.getAttribute("data-format"),t.textContent.trim())),o.includes(t.textContent.trim().toLowerCase())&&t.setAttribute("data-content",t.textContent.trim().toLowerCase())}}))}))},c=(t,e)=>{var a=e.querySelector("[data-search]");if(!a)return!1;var r=a.getAttribute("id"),o=a.getAttribute("data-search").split(","),s=a.parentNode,n={};o.forEach(((e,a)=>{Array.from(t.querySelectorAll('td[data-label="'+e.trim()+'"]')).forEach(((t,e)=>{t.querySelector(".td__content")?n[t.querySelector(".td__content").textContent]=t.querySelector(".td__content").textContent:n[t.textContent]=t.textContent}))})),a.setAttribute("list","".concat(r,"_list")),a.setAttribute("autocomplete","off"),s.querySelector("datalist")||(s.innerHTML+='<datalist id="'.concat(r,'_list"></datalist>')),s.querySelector("datalist").innerHTML="".concat(Object.keys(n).map((t=>'<option value="'.concat(t,'"></option>'))).join(""))},l=(t,e,a)=>{if(e.getAttribute("data-ajax"))return!1;var r=t.querySelector("tbody"),o=e.querySelector("[data-sort]"),s=o.querySelector("option:nth-child(".concat(o.selectedIndex+1,")")),n=s.getAttribute("data-sort"),c=s.getAttribute("data-order"),l=s.getAttribute("data-format");if(!n)return r.innerHTML=a.innerHTML,i(t),!1;var d=[];["asc","desc","descending"].includes(c)||(d=c.split(","));var u=[];Array.from(r.querySelectorAll("tr")).forEach(((t,e)=>{var a=t.querySelector('td[data-label="'+n+'"], th[data-label="'+n+'"]').textContent.trim();d.length&&d.includes(a)&&(a=d.indexOf(a)),function(t){return"string"==typeof t&&!isNaN(t)&&!isNaN(parseFloat(t))}(a)&&(a=((t,e)=>String(t).padStart(10,"0"))(a)),l&&"date"==l&&(a=new Date(a));var r={index:a,row:t};u.push(r)})),u.sort(((t,e)=>t.index>e.index?1:-1)),("descending"==c||"desc"==c)&&(u=u.reverse());var h="";u.forEach(((t,e)=>{h+=t.row.outerHTML})),r.innerHTML=h},d=(t,e,a)=>{t.classList.remove("table--filtered");var r=[],o=[],s=0,n=e.querySelector("[data-pagination]")?parseInt(e.querySelector("[data-pagination]").value):1,i=e.querySelector("[data-show]")?parseInt(e.querySelector("[data-show]").value):15;if(Array.from(t.querySelectorAll("tbody tr")).forEach(((t,e)=>{t.classList.remove("filtered"),t.classList.remove("filtered--matched"),t.classList.remove("filtered--show"),t.removeAttribute("data-filtered-by")})),Array.from(e.querySelectorAll("[data-filter]")).forEach(((t,e)=>{if(("radio"!=t.type||t.checked)&&("checkbox"!=t.type||t.checked))if("multi"==t.getAttribute("data-filter"))for(var[a,o]of Object.entries(JSON.parse(t.value)))r[t.getAttribute("data-filter")].push(o);else if(t&&t.value){var s=t.getAttribute("data-filter");r[s]||(r[s]=new Array),r[s].push(t.value)}})),e.querySelector("[data-search]")){var c=e.querySelector("[data-search]");e.querySelector("[data-search]").getAttribute("data-search").split(",").forEach(((t,e)=>{o.push({column:"".concat(t.trim()),value:"".concat(c.value)})}))}Array.from(e.querySelectorAll("[data-filter-count]")).forEach(((t,e)=>{t.innerHTML=""})),r.length&&Array.from(e.querySelectorAll("[data-filter-count]")).forEach(((t,e)=>{t.innerHTML+="(".concat(r.length,")")})),t.classList.add("table--filtered");var l=function(e,a){Array.from(t.querySelectorAll("tbody tr:not(.filtered)")).forEach(((t,r)=>{var o=!1;a.forEach(((a,r)=>{var s=t.querySelector('[data-label="'.concat(e,'"]'));if(a&&"$today"==a)a=b("date",new Date);else if(a&&"$yesterday"==a){var n=new Date;n.setDate(n.getDate()-1),a=b("date",n)}else if(!a||"$thisWeek"!=a&&"$lastWeek"!=a){if(a&&"$thisMonth"==a){var i=new Date,c=i.getFullYear(),l=i.getMonth(),d=new Date(c,l,1),u=new Date(c,l+1,0),h=new Date(s.textContent.toLowerCase());d.setHours(0,0,0,0),u.setHours(0,0,0,0),h.setHours(0,0,0,0),o=h>=d&&h<=u}else if(a&&"$lastMonth"==a){var m=new Date,p=m.getFullYear(),f=m.getMonth(),g=new Date(p,f-1,1),y=new Date(p,f,0),v=new Date(s.textContent.toLowerCase());g.setHours(0,0,0,0),y.setHours(0,0,0,0),v.setHours(0,0,0,0),o=v>=g&&v<=y}}else{var A=new Date,w=new Date(A.setDate(A.getDate()-(A.getDay()-1))),L=new Date(A.setDate(A.getDate()-A.getDay()+7)),S=new Date(s.textContent.toLowerCase());if(A.setHours(0,0,0,0),w.setHours(0,0,0,0),L.setHours(0,0,0,0),S.setHours(0,0,0,0),"$thisWeek"==a)o=S>=w&&S<=L;else{var E=new Date(w.setDate(w.getDate()-7)),q=new Date(L.setDate(L.getDate()-7));E.setHours(0,0,0,0),q.setHours(0,0,0,0),o=S>=E&&S<=q}}s&&s.textContent.toLowerCase().includes(a.toLowerCase())&&(o=!0)})),o||(t.classList.add("filtered"),t.setAttribute("data-filtered-by",e))}))};for(var[d,u]of Object.entries(r))l(d,u);Array.from(t.querySelectorAll("tbody tr:not(.filtered)")).forEach(((t,e)=>{var a=!(o.length>0&&o[0].value.length>=3);o.forEach(((e,r)=>{var o=t.querySelector('[data-label="'.concat(e.column,'"]'));o&&e.value.length>=3&&o.textContent.toLowerCase().includes(e.value.toLowerCase())&&(a=!0)})),a||t.classList.add("filtered")})),Array.from(t.querySelectorAll("tbody tr:not(.filtered")).forEach(((t,e)=>{s++,t.classList.add("filtered--matched"),Math.ceil(s/i)==parseInt(n)&&t.classList.add("filtered--show")})),a&&(a.setAttribute("data-page",n),a.setAttribute("data-pages",Math.ceil(s/i)),a.setAttribute("data-total",s),a.setAttribute("data-show",i))},u=(t,e,a)=>{Array.from(e.querySelectorAll("[data-query]")).forEach(((e,r)=>{var o,s=e.getAttribute("data-query");if("total"==s)a.hasAttribute("data-total")?o=a.getAttribute("data-total"):(t.classList.contains("table--filtered"),o=t.querySelectorAll("tbody tr").length);else if(!s.includes(" == ")&&s.includes(" & ")){var n=s.split(" & "),i="";n.forEach((t=>{i+=':not([data-filtered-by="'.concat(t,'"])')})),o=Array.from(t.querySelectorAll("tbody tr".concat(i))).length}else if(s.includes(" == "))if(s.includes(" && ")){var c=s.split(" && ");o=Array.from(t.querySelectorAll("tbody tr:not(.filtered)")).filter((function(t){var e=!0;for(var[a,r]of Object.entries(c)){var o=r.split(" == ");(!t.querySelector('td[data-label="'.concat(o[0],'"]'))||t.querySelector('td[data-label="'.concat(o[0],'"]')).textContent!="".concat(o[1]))&&(e=!1)}return e})).length}else{var l=s.split(" == ");o=Array.from(t.querySelectorAll('tbody tr.filtered--matched td[data-label="'.concat(l[0],'"], tbody tr[data-filtered-by="').concat(l[0],'"] td[data-label="').concat(l[0],'"]'))).filter((function(t){return t.textContent===l[1]})).length}else o=Array.from(t.querySelectorAll('tbody tr:not([data-filtered-by="'.concat(s,'"])'))).length;e.hasAttribute("data-total")?e.setAttribute("data-total",o):e.innerHTML=o}))},h=function(t,e,a,r){if(i(t),(t=>{if(t.closest(".table--fullwidth")||t.querySelectorAll("thead tr th").length<4)return!1;Array.from(t.querySelectorAll("tbody tr")).forEach(((t,e)=>{var a=t.querySelector(":scope > :is(td,th):first-child"),r=a.textContent;if(""!=r)a.innerHTML='<span class="td__content">'.concat(r,'</span><button type="button" class="d-none">').concat(r,"</button>");else{var o=t.querySelector(":scope > :is(td,th):nth-child(2)"),s=o.textContent;o.innerHTML='<span class="td__content">'.concat(s,'</span><button type="button" class="d-none">').concat(s,"</button>")}}))})(t),u(t,e,r),r&&r.classList.contains("table--cta")){let e=function(){Array.from(t.querySelectorAll("tr")).forEach(((t,e)=>{var a=t.offsetHeight;t.style.setProperty("--row-height","".concat(a,"px"))}))};if(!r.hasAttribute("data-cta-width")){var o=(t=>{var e=0;return Array.from(t.querySelectorAll("tbody tr")).forEach(((t,a)=>{var r=window.getComputedStyle(document.querySelector("html")),o=t.querySelector(":scope > *:last-child > *:first-child");if(o){o.classList.add("text-nowrap");var s=o.offsetWidth/parseFloat(r.fontSize);e=e>(s+=1.7)?e:s}})),e})(t);r.style.setProperty("--cta-width","".concat(o,"rem")),r.setAttribute("data-cta-width","".concat(o,"rem"))}new ResizeObserver(e).observe(t)}},m=function(t,e,a,r){return function(t,e,a,r){return new(a||(a=Promise))((function(o,s){function n(t){try{c(r.next(t))}catch(t){s(t)}}function i(t){try{c(r.throw(t))}catch(t){s(t)}}function c(t){t.done?o(t.value):function(t){return t instanceof a?t:new a((function(e){e(t)}))}(t.value).then(n,i)}c((r=r.apply(t,e||[])).next())}))}(this,void 0,void 0,(function*(){var o=(t,e,a)=>e.split(/[\.\[\]\'\"]/).filter((t=>t)).reduce(((t,e)=>t?t[e]:a),t),s=new FormData(e),i=new URLSearchParams(s).toString(),l=t.querySelectorAll("thead tr th"),d=t.querySelector("tbody"),u=e.getAttribute("data-ajax");r.classList.add("table--loading"),window.controller||(window.controller=[]),window.controller[u]&&window.controller[u].abort(),window.controller[u]=new AbortController;var{signal:m}=controller[u];try{yield fetch(u+"?"+i,{signal:m,method:"get",credentials:"same-origin",headers:new Headers({"Content-Type":"application/json",Accept:"application/json","X-Requested-With":"XMLHttpRequest"})}).then((t=>t.json())).then((s=>{var m=e.hasAttribute("data-schema")?e.getAttribute("data-schema"):"data",b=e.hasAttribute("data-schema-total")?e.getAttribute("data-schema-total"):"meta.total",p=e.hasAttribute("data-schema-page")?e.getAttribute("data-schema-page"):"meta.current_page",f=o(s,b,1),g=o(s,p,1),y=o(s,m),v=r.hasAttribute("data-empty-msg")?r.getAttribute("data-empty-msg"):"No results found";if(y?(d.innerHTML="",y.forEach(((t,e)=>{var a=document.createElement("tr");l.forEach(((e,r)=>{var s="",n=document.createElement("td");if(n.setAttribute("data-label",e.innerText),e.getAttribute("data-output")){var i=e.getAttribute("data-output");s=i.replace(new RegExp(/{(.*?)}/,"gm"),(function(e){return o(t,e.replace("{","").replace("}",""))}))}if(e.hasAttribute("data-output-array")){i=e.getAttribute("data-output");var c=o(t,i.replace("{","").replace("}",""));s="",c.forEach(((t,a)=>{var r=e.getAttribute("data-output-array"),n="";if(e.hasAttribute("data-output-array-property")&&e.hasAttribute("data-output-array-transform")){var i=o(t,e.getAttribute("data-output-array-property")),c=JSON.parse(e.getAttribute("data-output-array-transform"))[i];n=r.replace("{".concat(e.getAttribute("data-output-array-property"),"}"),c)}n=n.replace(new RegExp(/{(.*?)}/,"gm"),(function(e){return o(t,e.replace("{","").replace("}",""))})),s+=n}))}if(e.hasAttribute("data-transform")){var l=JSON.parse(e.getAttribute("data-transform"));!(s=l[s])&&e.hasAttribute("data-default")&&(s=e.getAttribute("data-default"))}n.innerHTML=s,a.appendChild(n)})),d.appendChild(a)})),c(t,e),r.setAttribute("data-total",parseInt(f)),r.setAttribute("data-page",parseInt(g)),r.setAttribute("data-pages",Math.ceil(r.getAttribute("data-total")/r.getAttribute("data-show"))),h(t,e,0,r),n(r,a),0==parseInt(f)&&(d.innerHTML='<tr><td colspan="100%"><span>'.concat(v,"</span></td></tr>")),r.classList.remove("table--loading"),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"Ajax table loaded",url:u,formData:i})):d.innerHTML='<tr><td colspan="100%"><span>Error loading table</span></td></tr>',e.hasAttribute("data-ajax-post")){var A=new XMLHttpRequest;A.open("GET","".concat(window.location.href,"?ajax=true&").concat(i)),A.send()}}))}catch(t){console.log(t)}}))},b=(t,e)=>{switch(t){case"datetime":return new Date(e).toLocaleDateString("en-gb",{weekday:"short",year:"2-digit",month:"long",day:"numeric"})+" "+new Date(e).toLocaleTimeString("en-gb",{hour:"2-digit",minute:"2-digit"});case"date":return new Date(e).toLocaleDateString("en-gb",{year:"2-digit",month:"long",day:"numeric"});case"capitalise":return(t=>t.charAt(0).toUpperCase()+t.slice(1))(e)}};class p extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});var t=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",e=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):"".concat(t,"/css/core.min.css"),a=this.classList.contains("table--cta"),r=this.classList.contains("table--export"),o=this.classList.toString();o=(o=o.replace("table--cta","")).replace("table--loading","");var s=document.createElement("template");s.innerHTML='\n <style>\n @import "'.concat(e,'";\n\n :host(.mh-sm){\n max-height: none!important;\n }\n :host(.mh-md){\n max-height: none!important;\n }\n :host(.mh-lg){\n max-height: none!important;\n }\n \n ').concat(this.hasAttribute("css")?'@import "'.concat(this.getAttribute("css"),'";'):"","\n </style>\n ").concat(a?'<div class="table--cta">':"",'\n <div class="table__wrapper ').concat(o,'">\n <slot></slot>\n </div>\n ').concat(a?"</div>":"","\n ").concat(r?'<button class="link" type="button" data-export>Export table as CSV</button>':"",'\n <div class="table__pagination"></div>\n '),this.shadowRoot.appendChild(s.content.cloneNode(!0))}connectedCallback(){var t=new URLSearchParams(window.location.search);this.hasAttribute("data-total")||this.setAttribute("data-total",this.querySelectorAll("table tbody tr").length),this.hasAttribute("data-page")||this.setAttribute("data-page",t.has("page")?t.get("page"):1),this.hasAttribute("data-show")||this.setAttribute("data-show",15),this.hasAttribute("data-increment")||this.setAttribute("data-increment",15),this.setAttribute("data-pages",Math.ceil(this.getAttribute("data-total")/this.getAttribute("data-show"))),this.table=this.querySelector("table"),this.savedTableBody=this.table.querySelector("tbody").cloneNode(!0),this.pagination=this.shadowRoot.querySelector(".table__pagination"),this.form=document.createElement("form"),this.hasAttribute("data-filterby")?this.form=document.querySelector("#".concat(this.getAttribute("data-filterby"))):this.table.parentNode.insertBefore(this.form,this.table.nextSibling),this.form.hasAttribute("data-ajax")&&this.table.classList.add("table--ajax"),c(this.table,this.form),this.form.querySelector("[data-page]")||(this.form.innerHTML+='<input name="page" type="hidden" value="'.concat(this.getAttribute("data-page"),'" data-pagination="true" />')),this.form.querySelector("[data-show]")||(this.form.innerHTML+='<input name="show" type="hidden" value="'.concat(this.getAttribute("data-show"),'" data-show="true" />')),this.table.addEventListener("click",(t=>{if(t&&t.target instanceof HTMLElement&&t.target.closest("tr > :is(td,th):first-child button")){var e=t.target.closest("tr > :is(td,th):first-child button"),a=e.parentNode.closest("tr");"full"==a.getAttribute("data-view")?a.setAttribute("data-view","default"):a.setAttribute("data-view","full"),e.blur()}})),((t,e,a,r,o)=>{var s,i=function(){var o=arguments.length>0&&void 0!==arguments[0]&&arguments[0];e.hasAttribute("data-ajax")?(o||(e.querySelector("[data-pagination]").value=1,r.setAttribute("data-page",1)),m(t,e,a,r)):e.hasAttribute("data-submit")?e.submit():(d(t,e,r),n(r,a),u(t,e))};e.addEventListener("keyup",(t=>{clearTimeout(s),t&&t.target instanceof HTMLElement&&t.target.closest("[data-search]")&&(s=setTimeout((function(){i()}),500))})),e.addEventListener("change",(a=>{clearTimeout(s),a&&a.target instanceof HTMLElement&&a.target.closest("[data-sort]")&&(e.hasAttribute("data-submit")||l(t,e,o),i()),a&&a.target instanceof HTMLElement&&a.target.closest("[data-search]")&&i(),a&&a.target instanceof HTMLElement&&a.target.closest("[data-filter]")&&a.target.closest("form .dialog__wrapper > dialog")&&i(),a&&a.target instanceof HTMLElement&&a.target.closest("[data-filter]")&&!a.target.closest("form dialog")&&i(),a&&a.target instanceof HTMLElement&&a.target.closest("[data-show]")&&i(),a&&a.target instanceof HTMLElement&&a.target.closest("[data-mimic]")&&i()})),e.addEventListener("click",(a=>{clearTimeout(s),a&&a.target instanceof HTMLElement&&a.target.closest('dialog button:not([type="button"])')&&a.target.closest('dialog button:not([type="button"])').closest("dialog").close(),a&&a.target instanceof HTMLElement&&a.target.closest(".dialog__close")&&(a.preventDefault(),a.stopPropagation()),a&&a.target instanceof HTMLElement&&a.target.closest("[data-clear]")&&(e.reset(),e.hasAttribute("data-submit")||l(t,e,o),i())})),e.addEventListener("submit",(t=>{clearTimeout(s),e.hasAttribute("data-submit")||t.preventDefault(),i()})),e.addEventListener("force",(t=>{i()})),e.addEventListener("paginate",(t=>{i(!0)}));var c=[],h=[];Array.from(e.querySelectorAll("[data-mimic]")).forEach(((t,e)=>{var a=t.getAttribute("data-mimic");Array.from(document.querySelectorAll('[name="'.concat(a,'"]'))).forEach(((t,e)=>{var r=t.closest("form");c.includes(r)||c.push(r),h.includes(a)||h.push(a)}))})),c.forEach(((t,a)=>{var r=function(){var a=[],r=new FormData(t);for(var[o,s]of r)document.querySelector('[data-mimic="'.concat(o,'"]'))&&!a.includes(o)?(a.push(o),document.querySelector('[data-mimic="'.concat(o,'"]')).value=s):document.querySelector('[data-mimic="'.concat(o,'"]'))&&(document.querySelector('[data-mimic="'.concat(o,'"]')).value+=","+s);for(var n of a){var i=new Event("force");e.dispatchEvent(i)}for(var c of h)if(!r.has(c)&&t.querySelector('[name="'.concat(c,'"]'))){document.querySelector('[data-mimic="'.concat(c,'"]')).value="";var l=new Event("force");e.dispatchEvent(l)}};t.addEventListener("force",(t=>{r()})),t.addEventListener("change",(t=>{r()}))}))})(this.table,this.form,this.pagination,this,this.savedTableBody),function(t,e,a,r){a.addEventListener("click",(a=>{if(a&&a.target instanceof HTMLElement&&a.target.closest("[data-page]")){a.preventDefault();var o=e.querySelector("[data-pagination]"),s=a.target.closest("[data-page]").getAttribute("data-page");if(o.value=s,r.setAttribute("data-page",s),e.dispatchEvent(new Event("paginate")),t.hasAttribute("data-show-history")){var n=new URL(location);n.searchParams.set("page",s),history.pushState({type:"pagination",form:e.getAttribute("id"),page:s},"",n)}var i=t.getBoundingClientRect().top+window.pageYOffset+-250;window.scrollTo({top:i,behavior:"smooth"})}if(a&&a.target instanceof HTMLElement&&a.target.closest("[data-show]")){a.preventDefault();var c=e.querySelector("[data-show]"),l=a.target.closest("[data-show]").getAttribute("data-show");c.value=l,r.setAttribute("data-show",l),e.dispatchEvent(new Event("submit"))}}))}(this.table,this.form,this.pagination,this),((t,e)=>{if(!t)return!1;t.addEventListener("click",(t=>{!function(t){for(var e=[],a=t.getElementsByTagName("tr"),r=0;r<a.length;r++){for(var o=a[r].querySelectorAll("td,th"),s=[],n=0;n<o.length;n++)s.push('"'.concat(o[n].textContent,'"'));e.push(s.join(","))}e=e.join("\n");var i=new Blob([e],{type:"text/csv"}),c=document.createElement("a");c.download="export.csv";var l=window.URL.createObjectURL(i);c.href=l,c.style.display="none",document.body.appendChild(c),c.click(),document.body.removeChild(c)}(e)}))})(this.shadowRoot.querySelector("[data-export]"),this.table),this.form.getAttribute("data-ajax")?m(this.table,this.form,this.pagination,this):(h(this.table,this.form,this.pagination,this),d(this.table,this.form,this),n(this,this.pagination),u(this.table,this.form)),this.shadowRoot.querySelector(".table__wrapper").addEventListener("scroll",(t=>{this.table.querySelector("dialog[open]")&&(this.table.querySelector("dialog[open]").close(),this.table.querySelector(".dialog__wrapper > button.active").classList.remove("active"))}))}static get observedAttributes(){return["data-total","data-pages","data-page","data-show"]}attributeChangedCallback(t,e,a){}}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"Card"});class f extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.querySelector('[class*="fa-"]')&&this.classList.add("card--has-icon");var t=this.classList.toString(),e=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",a=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):"".concat(e,"/css/core.min.css"),r='@import "'.concat(e,'/css/components/card.css";'),o=document.createElement("template");o.innerHTML='\n <style>\n @import "'.concat(a,'";\n ').concat(r,"\n ").concat(this.hasAttribute("css")?'@import "'.concat(this.getAttribute("css"),'";'):"",'\n </style>\n <div class="card ').concat(t,'" tabindex="0" role="button">\n ').concat(this.hasAttribute("data-image")?'<div class="card__head"><img src="'.concat(this.getAttribute("data-image"),'" alt="" loading="lazy" /></div>'):"",'\n <div class="card__body">\n ').concat(this.classList.contains("card--filter")&&this.hasAttribute("data-total")?'<div class="card__total">'.concat(this.getAttribute("data-total"),"</div>"):"","\n ").concat(this.hasAttribute("data-illustration")?'<div class="card__illustration"><img src="'.concat(this.getAttribute("data-illustration"),'" alt="" loading="lazy" /></div>'):"","\n <slot></slot>\n </div>\n ").concat(this.hasAttribute("data-cta")?'<div class="card__footer"><span class="link">'.concat(this.getAttribute("data-cta"),"</span></div>"):"","\n </div>\n "),this.shadowRoot.appendChild(o.content.cloneNode(!0))}connectedCallback(){this.classList.add("loaded");var t=this.parentNode.closest("a, button, label"),e=this.shadowRoot.querySelector(".card");t.setAttribute("tabindex","-1"),t.matches("label[for]")&&document.getElementById(t.getAttribute("for")).checked&&e.classList.add("active"),e.addEventListener("click",(a=>{t.matches("label[for]")?document.getElementById(t.getAttribute("for")).checked?e.classList.remove("active"):e.classList.add("active"):t.click()})),e.addEventListener("keydown",(a=>{switch(a.keyCode){case 32:case 13:t.matches("label[for]")?document.getElementById(t.getAttribute("for")).checked?e.classList.remove("active"):e.classList.add("active"):t.click()}}))}static get observedAttributes(){return["data-total","class"]}attributeChangedCallback(t,e,a){switch(t){case"data-total":this.shadowRoot.querySelector(".card__total").innerHTML=a;break;case"class":var r=this.classList.toString();this.querySelector('[class*="fa-"]')&&(r+=" card--has-icon"),this.shadowRoot.querySelector(".card").setAttribute("class","card ".concat(r))}}}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"Applied Filters"});class g extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});var t=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",e=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):"".concat(t,"/css/core.min.css"),a='@import "'.concat(t,'/css/components/applied-filters.css";'),r=this.classList.toString(),o=document.createElement("template");o.innerHTML='\n <style>\n @import "'.concat(e,'";\n ').concat(a,"\n ").concat(this.hasAttribute("css")?'@import "'.concat(this.getAttribute("css"),'";'):"",'\n </style>\n <div class="applied-filters ').concat(r,'"></div>\n <slot></slot>\n '),this.shadowRoot.appendChild(o.content.cloneNode(!0))}connectedCallback(){!function(t,e){function a(t,e){var a=!1,r=e.getAttribute("name");r.includes("[]")&&(r=r.replace("[]","[".concat(e.value,"]")));var o=t.querySelector('[data-name="'.concat(r,'"]'));o&&"checkbox"==e.getAttribute("type")&&(a=!0);var s=e.getAttribute("data-filter-text");if(o||(o=document.createElement("button"),t.appendChild(o)),o.setAttribute("type","button"),o.classList.add("filter"),o.setAttribute("data-name",r),o.innerHTML=s.replace("$value",e.value),(!e.value||a)&&o.remove(),e.parentNode.closest("[data-filter-text]")){var n=e.parentNode.closest("[data-filter-text]"),i=!0;if(r="",n.querySelectorAll("input").forEach(((e,a)=>{var o=e.getAttribute("name");if(r+="".concat(0!=a?",":"").concat(o),t.querySelector('[data-name="'.concat(o,'"]'))&&t.querySelector('[data-name="'.concat(o,'"]')).remove(),e.value){var n=document.createElement("button");n.setAttribute("type","button"),n.classList.add("filter"),n.setAttribute("data-name",o),n.innerHTML=s.replace("$value",e.value),t.appendChild(n)}else i=!1})),t.querySelector('[data-name="'.concat(r,'"]'))&&t.querySelector('[data-name="'.concat(r,'"]')).remove(),i){var c=n.getAttribute("data-filter-text");n.querySelectorAll("input").forEach(((e,a)=>{var r=e.getAttribute("name");t.querySelector('[data-name="'.concat(r,'"]'))&&t.querySelector('[data-name="'.concat(r,'"]')).remove(),c=c.replace("$".concat(a+1),e.value)}));var l=document.createElement("button");l.setAttribute("type","button"),l.classList.add("filter"),l.setAttribute("data-name",r),l.innerHTML=c,t.appendChild(l)}}}Array.from(t.querySelectorAll('input[type="checkbox"]:checked')).forEach(((t,r)=>{a(e,t)})),t.addEventListener("change",(function(t){if(t&&t.target instanceof HTMLElement&&t.target.closest("input[data-filter-text]")){var r=t.target.closest("input[data-filter-text]");a(e,r)}}),!1),e.addEventListener("click",(function(e){if(e&&e.target instanceof HTMLElement&&e.target.closest(".filter")){for(var a=e.target.closest(".filter"),r=a.getAttribute("data-name").split(","),o=0;o<r.length;o++){var s=r[o],n='[name="'.concat(s,'"]');if(s.match(/\[(.*)\]/)){s.replace(/\[(.*)\]/,"[]");var i=s.replace(/.*\[(.*)\]/,"$1");n='[value="'.concat(i,'"]')}for(var c=t.querySelectorAll(n),l=0;l<c.length;l++){var d=c[l];"radio"!=d.getAttribute("type")&&"checkbox"!=d.getAttribute("type")?d.value="":(d.checked=!1,e=new Event("force"),d.closest("form").dispatchEvent(e))}}a.remove()}}),!1)}(this,this.shadowRoot.querySelector(".applied-filters"))}}class y extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});var t=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",e=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):"".concat(t,"/css/core.min.css"),a=document.createElement("template");a.innerHTML='\n <style>\n @import "'.concat(e,'";\n \n ').concat(this.hasAttribute("css")?'@import "'.concat(this.getAttribute("css"),'";'):"",'\n </style>\n <div class="pagination__wrapper d-none">\n </div>\n '),this.shadowRoot.appendChild(a.content.cloneNode(!0))}connectedCallback(){var t=new URLSearchParams(window.location.search);this.hasAttribute("data-total")||this.setAttribute("data-total",this.querySelectorAll("table tbody tr").length),this.hasAttribute("data-page")||this.setAttribute("data-page",t.has("page")?t.get("page"):1),this.hasAttribute("data-show")||this.setAttribute("data-show",t.has("show")?t.get("show"):15),this.hasAttribute("data-increment")||this.setAttribute("data-increment",15),this.setAttribute("data-pages",Math.ceil(this.getAttribute("data-total")/this.getAttribute("data-show"))),n(this,this.shadowRoot.querySelector(".pagination__wrapper")),this.shadowRoot.querySelector(".pagination__wrapper").classList.remove("d-none")}}var v=function(t,e){Array.from(t.querySelectorAll(":scope > li")).forEach(((t,a)=>{var r=t.textContent.toLowerCase();t.classList.add("d-none"),r.includes(e.toLowerCase())&&t.classList.remove("d-none")})),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"Filtered list",value:e})};window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"filterlist"});class A extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});var t=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",e=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):"".concat(t,"/css/core.min.css"),a=document.createElement("template");a.innerHTML='\n <style>\n @import "'.concat(e,'";\n ').concat(this.hasAttribute("css")?'@import "'.concat(this.getAttribute("css"),'";'):"",'\n \n :host {\n margin-bottom: 1rem;\n display:block;\n }\n :host(.mh-sm){\n max-height: none!important;\n }\n :host(.mh-md){\n max-height: none!important;\n }\n :host(.mh-lg){\n max-height: none!important;\n }\n </style>\n <div class="form-control__wrapper">\n <label for="search" class="visually-hidden">Search</label>\n <span class="suffix" role="presentation"><slot name="icon"></slot></span>\n <input name="search" id="search" type="text" class="form-control" autocomplete="off" placeholder="Search" />\n </div>\n <div class="list__wrapper">\n <slot></slot>\n </div>\n '),this.shadowRoot.appendChild(a.content.cloneNode(!0))}connectedCallback(){var t=this.classList.toString();this.shadowRoot.querySelector(".list__wrapper").setAttribute("class","list__wrapper ".concat(t)),this.querySelector("i.fa-search")||(this.innerHTML+='<i class="fa fa-light fa-search" aria-hidden="true" slot="icon"></i>'),function(t,e){!function(t,e){var a;e.addEventListener("keyup",(r=>{clearTimeout(a),a=setTimeout((function(){v(t,e.value)}),500)})),e.addEventListener("change",(r=>{clearTimeout(a),v(t,e.value)}))}(t,e)}(this.querySelector("ul"),this.shadowRoot.querySelector("#search"))}}function w(t,e){var a,r,o=e;this.pause=function(){window.clearTimeout(a),o-=new Date-r},this.resume=function(){r=new Date,window.clearTimeout(a),a=window.setTimeout(t,o)},this.resume()}var L=function(t){t.classList.add("d-none")};window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"Notification"});class S extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});var t=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",e=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):"".concat(t,"/css/core.min.css"),a='@import "'.concat(t,'/css/components/notification.css";'),r=this.querySelectorAll("a,button");Array.from(r).forEach(((t,e)=>{t.setAttribute("slot","btns"),t.classList.add("link")})),(r.length||this.hasAttribute("data-dismiss"))&&this.classList.add("notification--dismissable");var o=document.createElement("template");o.innerHTML='\n <style>\n @import "'.concat(e,'";\n ').concat(a,"\n ").concat(this.hasAttribute("data-css")?"".concat(this.getAttribute("data-css")):"",'\n </style>\n\n <div class="notification">\n <div class="notification__icon"><slot name="icon"></slot></div>\n <div class="notification__inner"><div class="notification__text"><slot></slot></div>').concat(r.length?'<div class="notification__btns"><slot name="btns"></slot></div>':"","</div>\n ").concat(this.hasAttribute("data-dismiss")?'<div class="notification__dismiss"><button data-dismiss-button>Dismiss</button></div>':"","\n </div>\n "),this.shadowRoot.appendChild(o.content.cloneNode(!0))}connectedCallback(){var t=this.shadowRoot.querySelector("[data-dismiss-button]"),e=this.hasAttribute("data-status")?this.getAttribute("data-status"):"white";this.hasAttribute("data-type")?this.classList.add("bg-".concat(e)):this.classList.add("colour-".concat(e));var a=this;if(!this.querySelector("i"))switch(e){case"danger":this.innerHTML+='<i class="fa-solid fa-circle-exclamation" aria-hidden="true" slot="icon"></i>';break;case"warning":this.innerHTML+='<i class="fa-solid fa-triangle-exclamation" aria-hidden="true" slot="icon"></i>';break;case"success":this.innerHTML+='<i class="fa-solid fa-check-circle" aria-hidden="true" slot="icon"></i>';break;default:this.innerHTML+='<i class="fa-solid fa-circle-info" aria-hidden="true" slot="icon"></i>'}(function(t){if(t.hasAttribute("data-type")&&"toast"==t.getAttribute("data-type")){var e=document.querySelector(".notification__holder");e||((e=document.createElement("div")).classList.add("notification__holder"),e.classList.add("container"),document.querySelector("body").appendChild(e)),t.closest(".notification__holder")||e.appendChild(t)}if(t.setAttribute("role","alert"),t.addEventListener("click",(function(e){event&&event.target instanceof HTMLElement&&event.target.closest("[data-dismiss-button]")&&(e.preventDefault(),L(t))}),!1),t.hasAttribute("data-timeout")){var a=new w((function(){L(t)}),t.getAttribute("data-timeout"));t.addEventListener("mouseenter",(t=>{a.pause()})),t.addEventListener("mouseleave",(t=>{a.resume()}))}})(a),t&&t.addEventListener("click",(function(t){L(a)}),!1)}}document.addEventListener("DOMContentLoaded",(function(){var n;window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"Pageview",pageTitle:document.title}),document.addEventListener("click",(t=>{t&&t.target instanceof HTMLElement&&t.target.closest("[open] summary")?window.dataLayer.push({event:"closeDetails",detailsTitle:t.target.closest("summary").textContent}):t&&t.target instanceof HTMLElement&&t.target.closest("summary")&&window.dataLayer.push({event:"openDetails",detailsTitle:t.target.closest("summary").textContent}),t&&t.target instanceof HTMLElement&&t.target.closest("a")&&window.dataLayer.push({event:"linkClicked",linkText:t.target.closest("a").hasAttribute("title")?t.target.closest("a").getAttribute("title"):t.target.closest("a").textContent,class:t.target.closest("a").hasAttribute("class")?t.target.closest("a").getAttribute("class"):"",href:t.target.closest("a").getAttribute("href")}),t&&t.target instanceof HTMLElement&&t.target.closest("button")&&window.dataLayer.push({event:"buttonClicked",buttonText:t.target.closest("button").textContent,class:t.target.closest("button").hasAttribute("class")?t.target.closest("button").getAttribute("class"):""})})),(t=>{t.classList.add("js-enabled"),(-1!==navigator.userAgent.indexOf("MSIE")||navigator.appVersion.indexOf("Trident/")>0)&&t.classList.add("ie");var e=document.querySelector("nav");if(e){let t=function(){a=e.offsetHeight,document.querySelector("body").style.setProperty("--nav-height","".concat(a,"px"))};var a=e.offsetHeight;document.querySelector("body").style.setProperty("--nav-height","".concat(a,"px")),new ResizeObserver(t).observe(e)}else document.querySelector("body").style.setProperty("--nav-height","0px")})(document.body),n=function(t){var e=document.querySelector('label[for="'.concat(t.replace("#",""),'"]')),a=document.querySelector(t+" summary"),r=document.querySelector("dialog".concat(t));e instanceof HTMLElement?e.click():a instanceof HTMLElement?a.click():r instanceof HTMLElement&&r.showModal()},location.hash&&n(location.hash),window.addEventListener("hashchange",(function(){n(location.hash)}),!1),addEventListener("popstate",(t=>{if(t&&t.state.type&&"pagination"==t.state.type){var e=document.querySelector("#".concat(t.state.form)),a=document.querySelector("#".concat(t.state.form," [data-pagination]"));a?a.value=t.state.page:e.innerHTML+='<input name="page" type="hidden" data-pagination="true" value="'.concat(t.state.page,'" />'),e.dispatchEvent(new Event("submit"))}})),document.body.addEventListener("click",(t=>{if(t&&t.target instanceof HTMLElement&&t.target.closest("[data-modal]")){var r=t.target.closest("[data-modal]"),o=r.hasAttribute("data-modal")?r.getAttribute("data-modal"):r.getAttribute("data-filter"),s=document.querySelector("dialog#".concat(o));(t=>{if(t.classList.contains("dialog--multi")&&!t.querySelector(":scope > .steps")&&a(t),!t.querySelector(":scope > .mh-lg")&&!t.classList.contains("dialog--multi")){t.innerHTML='<div class="mh-lg">'.concat(t.innerHTML,"</div>");var e=t.querySelector(".mh-lg"),r=t.querySelector(".mh-lg :is(.h1,.h2,.h3,.h4,.h5,.h6)");if(r){var o=r.previousSibling;e.before(r),o&&r.before(o)}}t.querySelector(":scope > button:first-child")||(t.innerHTML='<button class="dialog__close">Close</button>'.concat(t.innerHTML))})(s),s.querySelector(":scope > .mh-lg > form:last-child > button:last-child, :scope > .mh-lg > button:last-child")&&!s.classList.contains("dialog--multi")&&s.addEventListener("cancel",(t=>{t.preventDefault()}));var n=s.querySelector(".youtube-embed a");n&&e(n),s.showModal(),s.focus(),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"openModal",id:o})}if(t&&t.target instanceof HTMLElement&&t.target.closest("button.dialog__close")){var i=t.target.closest("dialog[open]");t.preventDefault(),i.close(),Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach(((t,e)=>{t.classList.remove("active")})),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:i.getAttribute("id")})}if(t&&t.target instanceof HTMLElement&&t.target.closest('button[formmethod="dialog"]')){var c=t.target.closest("dialog[open]");Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach(((t,e)=>{t.classList.remove("active")})),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:c.getAttribute("id")})}if(t&&t.target instanceof HTMLElement&&t.target.closest("dialog[open]")){var l=t.target.closest("dialog[open]");if(!l.querySelector(":scope > .mh-lg > form:last-child > button:last-child, :scope > .mh-lg > button:last-child")||l.classList.contains("dialog--multi")){var d=l.getBoundingClientRect();(t.clientX<d.left||t.clientX>d.right||t.clientY<d.top||t.clientY>d.bottom)&&(l.close(),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:l.getAttribute("id")}))}}if(t&&t.target instanceof HTMLElement&&t.target.closest(".dialog__wrapper > button")){var u=t.target.closest(".dialog__wrapper > button"),h="openPopover",m=t.target.closest(".dialog__wrapper > button").parentNode.querySelector(":scope > dialog");if(document.querySelector("dialog[open]")&&document.querySelector("dialog[open]")!=m&&document.querySelector("dialog[open]").close(),Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach(((t,e)=>{t.classList.remove("active")})),m.hasAttribute("open"))m.close(),h="closePopover",m.removeAttribute("style"),u.classList.remove("active");else{m.show(),u.classList.add("active");var b=u.getBoundingClientRect(),p=b.top,f=b.left;if(u.closest("iam-table")){var g=u.closest("iam-table").parentNode.getBoundingClientRect();p-=g.top,f-=g.left}m.classList.contains("dialog--fix")&&m.setAttribute("style","position:fixed;top: ".concat(p,"px; left: ").concat(f,"px; margin: 3rem 0 0 0;"))}if(m.getBoundingClientRect().bottom-window.scrollY>window.innerHeight-window.scrollY){var y=m.getAttribute("style");m.setAttribute("style",y+"transform: translate(0, calc(-100% - 4rem))")}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:h,id:u.textContent})}t&&t.target instanceof HTMLElement&&!t.target.closest("dialog[open]")&&!t.target.closest(".dialog__wrapper > button")&&(document.querySelector(".dialog__wrapper:not([data-keep-open]) > dialog[open]")&&document.querySelector(".dialog__wrapper:not([data-keep-open]) > dialog[open]").close(),Array.from(document.querySelectorAll(".dialog__wrapper:not([data-keep-open]) > button")).forEach(((t,e)=>{t.classList.remove("active")})))})),window.customElements.get("iam-header")||window.customElements.define("iam-header",r),window.customElements.get("iam-accordion")||window.customElements.define("iam-accordion",o),window.customElements.get("iam-tabs")||window.customElements.define("iam-tabs",s),window.customElements.get("iam-table")||window.customElements.define("iam-table",p),window.customElements.get("iam-card")||window.customElements.define("iam-card",f),window.customElements.get("iam-filterlist")||window.customElements.define("iam-filterlist",A),window.customElements.get("iam-pagination")||window.customElements.define("iam-pagination",y),window.customElements.get("iam-applied-filters")||window.customElements.define("iam-applied-filters",g),window.customElements.get("iam-notification")||window.customElements.define("iam-notification",S),Array.from(document.querySelectorAll(".nav")).forEach((t=>{(t=>{Array.from(t.querySelectorAll("details")).forEach(((t,e)=>{t.addEventListener("mouseenter",(function(e){window.matchMedia("(min-width: 62em)").matches&&t.setAttribute("open","true")}),!1),t.addEventListener("mouseleave",(function(e){window.matchMedia("(min-width: 62em)").matches&&t.removeAttribute("open")}),!1)})),"IntersectionObserver"in window&&new IntersectionObserver((t=>{var[e]=t;return e.target.classList.toggle("is-stuck",e.intersectionRatio<1)}),{threshold:[1]}).observe(t)})(t)})),Array.from(document.querySelectorAll(".testimonial")).forEach((t=>{!function(t){var e,a=t.querySelector(".testimonial__images"),r=a.querySelectorAll("img").length;if(1==r)return!1;t.classList.add("testimonial--multi"),a.addEventListener("scroll",(function(o){clearTimeout(e),e=setTimeout((function(){var e=a.scrollWidth,o=a.scrollHeight,s=a.scrollLeft,n=a.scrollTop,i=Math.round(s/e*r)+1;0==s&&0!=n&&(i=Math.round(n/o*r)+1),t.setAttribute("data-show",i),function(e){var a=t.querySelector(".btn-next"),o=t.querySelector(".btn-prev");a.setAttribute("data-go",e+1),o.setAttribute("data-go",e-1),a.removeAttribute("disabled"),o.removeAttribute("disabled"),1==e?o.setAttribute("disabled",!0):e==r&&a.setAttribute("disabled",!0)}(i)}),300)}),!1),t.addEventListener("click",(function(t){for(var e=t.target;e&&e!=this;e=e.parentNode)if(e.matches("[data-go]")){var o=parseInt(e.getAttribute("data-go")),s=0,n=0,i=a.scrollWidth,c=a.scrollHeight;i>c?n=Math.floor(i*((o-1)/r)):s=Math.floor(c*((o-1)/r)),a.scroll({top:s,left:n,behavior:"smooth"});break}}),!1)}(t)})),Array.from(document.querySelectorAll(".carousel")).forEach((t=>{!function(t){var e,a=t.querySelector(".carousel__inner"),r=t.querySelectorAll(".carousel__item").length;t.getAttribute("data-cols");var o=t.getAttribute("data-sm-cols"),s=t.getAttribute("data-md-cols");t.querySelector(".carousel__controls a").classList.add("active"),a.addEventListener("scroll",(function(o){clearTimeout(e),e=setTimeout((function(){var e=a.clientWidth,o=a.scrollWidth,s=a.scrollLeft,n=Math.round(s/o*r)+1,i=t.querySelector(".carousel__item:last-child").offsetLeft;Array.from(t.querySelectorAll(".carousel__controls a")).forEach(((t,e)=>{t.classList.remove("active")})),t.querySelector(".control-"+n).classList.add("active"),1==n?t.querySelector(".btn-prev").setAttribute("disabled","disabled"):t.querySelector(".btn-prev").removeAttribute("disabled"),a.scrollLeft+e>i?t.querySelector(".btn-next").setAttribute("disabled","disabled"):t.querySelector(".btn-next").removeAttribute("disabled")}),100)}),!1),t.addEventListener("click",(function(e){for(var r=e.target;r&&r!=this;r=r.parentNode)if(r.matches(".carousel__controls a")){e.preventDefault(),Array.from(t.querySelectorAll(".carousel__controls a")).forEach(((t,e)=>{t.classList.remove("active")})),r.classList.add("active");var o=document.querySelector(r.getAttribute("href"));a.scroll({top:0,left:o.offsetLeft,behavior:"smooth"});break}}),!1),t.addEventListener("click",(function(t){for(var e=t.target;e&&e!=this;e=e.parentNode)if(e.matches(".btn-next, .btn-prev")){t.preventDefault();var r=e.classList.contains("btn-prev")?a.scrollLeft-a.clientWidth:a.scrollLeft+a.clientWidth;a.scroll({top:0,left:r,behavior:"smooth"});break}}),!1),1==r&&t.classList.add("hide-btns"),o>=r&&t.classList.add("hide-sm-btns"),s>=r&&t.classList.add("hide-md-btns")}(t)})),Array.from(document.querySelectorAll("form")).forEach((t=>{!function(t){Array.from(t.querySelectorAll("[data-input-range]")).forEach(((t,e)=>{!function(t){t.addEventListener("change",(function(e){var a=parseInt(t.querySelector("[data-min] select,[data-min] input").value),r=parseInt(t.querySelector("[data-max] select,[data-max] input").value);Array.from(t.querySelectorAll("[data-min] input")).forEach(((t,e)=>{t.setAttribute("max",r)})),Array.from(t.querySelectorAll("[data-max] input")).forEach(((t,e)=>{t.setAttribute("min",a)})),Array.from(t.querySelectorAll("[data-min] select option")).forEach(((t,e)=>{parseInt(t.getAttribute("value"))>r?t.classList.add("d-none"):t.classList.remove("d-none")})),Array.from(t.querySelectorAll("[data-max] select option")).forEach(((t,e)=>{parseInt(t.getAttribute("value"))<a?t.classList.add("d-none"):t.classList.remove("d-none")}))}),!1)}(t)})),Array.from(t.querySelectorAll("[data-redirect]")).forEach(((t,e)=>{!function(t){t.addEventListener("change",(function(e){if(t.matches("[data-value-if]")){var a=t.getAttribute("data-redirect"),r=t.getAttribute("data-value-if");t.value==r&&(document.location.href=a)}else typeof t.value<"u"&&(document.location.href=t.value)}),!1)}(t)})),Array.from(t.querySelectorAll(".multiple-file-uploads")).forEach(((t,e)=>{!function(t){var e=t.querySelector(".row").cloneNode(!0),a=t.querySelector("[data-add]");t.addEventListener("click",(function(r){for(var o=r.target;o&&o!=this;o=o.parentNode){if(o.matches("[data-add]")){var s=e.cloneNode(!0);t.insertBefore(s,o),a.matches("[data-maxfiles]")&&Array.from(t.querySelectorAll(":scope > .row")).length>=a.dataset.maxfiles&&a.setAttribute("disabled","disabled");break}if(o.matches("[data-delete]")){o.closest(".row").remove(),a.matches("[data-maxfiles]")&&Array.from(t.querySelectorAll(":scope > .row")).length<a.dataset.maxfiles&&a.removeAttribute("disabled");break}}}),!1)}(t)})),t.addEventListener("change",(function(t){for(var e=t.target;e&&e!=this;e=e.parentNode)if(e.matches('[type="file"][data-filesize]')&&e.files&&e.files[0]){var a=e.dataset.filesize;e.files[0].size>a&&(e.value="",alert("File too large"));break}}),!1),t.addEventListener("change",(function(e){Array.from(t.querySelectorAll("select[data-activeif][data-equals],input[data-activeif][data-equals]")).forEach(((e,a)=>{var r=e.closest("[data-group]")?e.closest("[data-group]"):t,o=e.dataset.activeif,s=e.dataset.equals;r.querySelector('select[data-id="'.concat(o,'"],input[data-id="').concat(o,'"]')).value==s?e.removeAttribute("disabled"):(e.setAttribute("disabled","disabled"),e.value="")})),Array.from(t.querySelectorAll(".form-control__wrapper[data-displayif][data-equals]")).forEach(((e,a)=>{var r=e.closest("[data-group]")?e.closest("[data-group]"):t,o=e.dataset.activeif,s=e.dataset.equals;r.querySelector('select[data-id="'.concat(o,'"],input[data-id="').concat(o,'"]')).value==s?e.classList.remove("d-none"):e.classList.add("d-none")}))}),!1)}(t)})),Array.from(document.querySelectorAll(".youtube-embed")).forEach((e=>{new t(e)})),window.addEventListener("hashchange",(function(){var t=location.hash.replace("#",""),e=document.querySelector('label[for="'.concat(t,'"]'));e instanceof HTMLElement&&e.click()}),!1)}))}));
5
+ !function(t){"function"==typeof define&&define.amd?define(t):t()}((function(){"use strict";class t{constructor(t){document.body.classList.contains("youtubeLoaded")?t.addEventListener("click",(function(t){for(var a=t.target;a&&a!=this;a=a.parentNode)if(a.matches("a")){t.preventDefault(),e(a);break}}),!1):this.loadScripts(t,this.createEmbed)}loadScripts(t){return new Promise(((a,r)=>{var o=new Image;o.onload=function(){var r=document.createElement("script");r.src="https://www.youtube.com/iframe_api";var o=document.getElementsByTagName("script")[0];o.parentNode.insertBefore(r,o),document.body.classList.add("youtubeLoaded"),a(!0),r.onload=()=>{t.addEventListener("click",(function(t){console.log("click"),t&&t.target instanceof HTMLElement&&t.target.closest("a")&&(t.preventDefault(),e(t.target.closest("a")))}),!1)}},o.onerror=function(){r(!1)},o.src="https://youtube.com/favicon.ico"}))}}var e=function(t){typeof window.player<"u"&&"function"==typeof window.player.pauseVideo&&window.player.pauseVideo();var e=t.getAttribute("data-id"),a=t.getAttribute("id");if(typeof a>"u"||null==a){var r=String.fromCharCode(65+Math.floor(26*Math.random()));a=r+Date.now(),t.setAttribute("id",a)}window.player=new YT.Player(a,{height:"100%",width:"100%",videoId:e,playerVars:{modestbranding:1,playsinline:1,rel:0,showinfo:0},events:{onReady:function(t){t.target.playVideo()},onStateChange:function(t){t.data!=YT.PlayerState.PLAYING||o||(document.getElementById(a).classList.add("player-ready"),o=!0)}}});var o=!1},a=t=>{var e="",a=Array.from(t.querySelectorAll("fieldset[data-title]"));a.forEach(((t,r)=>{e+='<button data-title="'.concat(t.getAttribute("data-title"),'" type="button" class="').concat(0==r?"active":"",'">').concat(t.getAttribute("data-title"),"</button>");var o=document.createElement("div");o.classList.add("btn--wrapper"),t.appendChild(o),0!=r&&(o.innerHTML+='<button data-title="'.concat(a[r-1].getAttribute("data-title"),'" class="btn btn-secondary mb-0" type="button">Previous</button>')),r!=a.length-1&&(o.innerHTML+='<button data-title="'.concat(a[r+1].getAttribute("data-title"),'" class="btn btn-primary mb-0" type="button">Next</button>')),r==a.length-1&&(o.innerHTML+='<button class="btn btn-primary mb-0">Submit</button>')})),t.innerHTML='<div class="steps bg-primary">'.concat(e,"</div>").concat(t.innerHTML),t.addEventListener("click",(e=>{if(e&&e.target instanceof HTMLElement&&e.target.closest("button[data-title]")){var a=e.target.closest("button[data-title]"),r=t.querySelector('fieldset[data-title="'.concat(a.getAttribute("data-title"),'"]')),o=t.querySelector('.steps button[data-title="'.concat(a.getAttribute("data-title"),'"]'));Array.from(t.querySelectorAll("button")).forEach(((t,e)=>{t.classList.remove("active")})),Array.from(t.querySelectorAll("fieldset")).forEach(((t,e)=>{t.classList.remove("active")})),o.classList.add("active"),r.classList.add("active")}return null}))};window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"header"});class r extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});var t=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",e=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):"".concat(t,"/css/core.min.css"),a='@import "'.concat(t,'/css/components/header.css";'),r=document.createElement("template");r.innerHTML='\n <style>\n @import "'.concat(e,'";\n ').concat(a,"\n ").concat(this.hasAttribute("css")?'@import "'.concat(this.getAttribute("css"),'";'):"",'\n </style>\n <div class="header-banner">\n <div class="container" part="container">\n <slot name="breadcrumb"></slot>\n <div class="header-banner__inner">\n <slot></slot>\n </div>\n </div>\n <picture>\n \x3c!-- Actual image only loaded on desktops --\x3e\n <source srcset="" media="(min-width: 62em)">\n \x3c!-- Placeholder image --\x3e\n <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" alt="" lazy="" />\n </picture>\n </div>\n '),this.shadowRoot.appendChild(r.content.cloneNode(!0))}connectedCallback(){this.classList.add("loaded");var t=this.shadowRoot.querySelector("picture"),e=this.shadowRoot.querySelector("picture source");this.hasAttribute("image")?e.setAttribute("srcset",this.getAttribute("image")):t.remove()}}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"accordion"});class o extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});var t=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",e=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):"".concat(t,"/css/core.min.css"),a='@import "'.concat(t,'/css/components/accordion.css";'),r=document.createElement("template");r.innerHTML='\n <style>\n @import "'.concat(e,'";\n ').concat(a,"\n ").concat(this.hasAttribute("css")?'@import "'.concat(this.getAttribute("css"),'";'):"",'\n </style>\n <div class="accordion">\n <slot></slot>\n </div>\n '),this.shadowRoot.appendChild(r.content.cloneNode(!0))}connectedCallback(){!function(t){var e=t.querySelectorAll("details"),a=t.querySelectorAll("summary");if(e.forEach((t=>{t.classList.add("accordion-item")})),a.forEach((t=>{t.classList.add("accordion-header"),t.classList.add("accordion-button"),t.classList.add("h4")})),!t.classList.contains("accordion--keep-open")){var r=t.querySelectorAll(":scope > details");r.forEach((t=>{t.addEventListener("click",(()=>{r.forEach((e=>{e!==t&&e.removeAttribute("open")}))}))}))}}(this)}}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"tabs"});class s extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});var t=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",e=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):"".concat(t,"/css/core.min.css"),a=document.createElement("template");a.innerHTML='\n <style>\n @import "'.concat(e,'";\n\n :host(.admin-panel){\n display: contents!important;\n }\n \n ').concat(this.hasAttribute("css")?'@import "'.concat(this.getAttribute("css"),'";'):"",'\n </style>\n <div class="tabs">\n <div class="tabs__links"></div>\n <slot></slot>\n </div>\n '),this.shadowRoot.appendChild(a.content.cloneNode(!0))}connectedCallback(){var t=this.classList.toString().replace("container","");this.shadowRoot.querySelector(".tabs").setAttribute("class","tabs ".concat(t)),function(t){(function(t){var e=t.querySelectorAll(":scope > details");t.querySelectorAll(":scope > details > summary");var a=t.querySelector(":scope > .tabs__links");t.shadowRoot&&t.shadowRoot.querySelector(".tabs__links")&&(a=t.shadowRoot.querySelector(".tabs__links")),a||((a=document.createElement("div")).classList.add("tabs__links"),t.prepend(a)),e.forEach(((t,e)=>{var r=t.querySelector(":scope > summary");r.classList.add("visually-hidden");var o=document.createElement("button");t.hasAttribute("id")&&(o=document.createElement("a")).setAttribute("href","#".concat(t.getAttribute("id"))),t.hasAttribute("open")&&o.setAttribute("aria-pressed",!0),o.innerHTML="".concat(r.innerText),o.classList.add("link"),o.setAttribute("data-index",e),o.setAttribute("tabindex","-1"),a.appendChild(o)}))})(t),function(t){var e=t.querySelectorAll(":scope > details"),a=t.querySelectorAll(":scope > details > summary"),r=t.querySelectorAll(":scope .tabs__links > .link");t.shadowRoot&&(r=t.shadowRoot.querySelectorAll(".tabs__links > .link")),r.forEach((t=>{t.addEventListener("click",(a=>{a.preventDefault(),r.forEach((e=>{var a=e==t;e.setAttribute("aria-pressed",a)})),e.forEach(((e,a)=>{var r=t.getAttribute("data-index")==a;r?e.setAttribute("open",r):e.removeAttribute("open")})),t.hasAttribute("href")&&history.pushState(void 0,void 0,t.getAttribute("href")),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"openTab",tabTitle:t.textContent})}))})),a.forEach(((t,e)=>{t.addEventListener("focus",(t=>{r.forEach((t=>{t.classList.remove("focus")})),r[e].classList.add("focus")})),t.addEventListener("click",(t=>{t.preventDefault(),r[e].click()}))}))}(t),function(t){var e=t.querySelectorAll(":scope > details"),a=t.querySelectorAll(":scope > .tabs__links > button, .tabs__links > a");t.shadowRoot&&(a=t.shadowRoot.querySelectorAll(".tabs__links > button, .tabs__links > a")),location.hash&&t.querySelector('.tabs__links [href="'.concat(location.hash,'"]'))?(t.querySelector('[href="'.concat(location.hash,'"]')).setAttribute("open",!0),t.querySelector('details[id="'.concat(location.hash.replace("#",""),'"]')).setAttribute("open",!0)):t.querySelector("details[open]")||(e[0].setAttribute("open",!0),a[0].setAttribute("aria-pressed",!0))}(t)}(this)}}var n=function(t,e){if(!t.getAttribute("data-pages"))return!1;t.getAttribute("data-page")||t.setAttribute("data-page",1);var a=t.getAttribute("data-page"),r=t.getAttribute("data-pages"),o=t.getAttribute("data-total"),s=t.getAttribute("data-show"),n=t.getAttribute("data-increment");if(r<=1)return e.innerHTML="",!1;for(var i="",c=1;c<=r;c++)i+=c==a?'<li class="page-item active" aria-current="page"><span class="page-link">'.concat(c,"</span></li>"):'<li class="page-item"><a href="?page='.concat(c,'" class="page-link" data-page="').concat(c,'">').concat(c,"</a></li>");return e.innerHTML='<ul class="pagination mb-0 d-none d-sm-flex">\n '.concat(1==a?'<li class="page-item disabled"><span class="page-link">Previous</span></li>':'<li class="page-item"><a href="?page='.concat(parseInt(a)-1,'" class="page-link" data-page="').concat(parseInt(a)-1,'">Previous</a></li>'),"\n ").concat(i,"\n ").concat(a==r?'<li class="page-item disabled"><span class="page-link">Next</span></li>':'<li class="page-item"><a href="?page='.concat(parseInt(a)+1,'" class="page-link" data-page="').concat(parseInt(a)+1,'">Next</a></li>'),"\n </ul>"),e.innerHTML+='<div class="d-sm-none text-center">\n <span class="d-block pb-2">You\'ve viewed '.concat(s," of ").concat(o,' results</span>\n <a href="?show=').concat(parseInt(s)+parseInt(n),'" class="btn btn-primary w-100 m-0" data-show="').concat(parseInt(s)+parseInt(n),'">Load more results</a>\n </div>'),!0},i=t=>{var e=Array.from(t.querySelectorAll("thead th"));Array.from(t.querySelectorAll("tbody tr")).forEach(((t,a)=>{var r=Array.from(t.querySelectorAll("th, td")),o=["0","low","medium","high","unknown","n/a","pending","verified","overdue","incomplete","complete","completed","approval required","requires approval","to do","not started","warning","error"];r.forEach(((t,a)=>{var r=e[a];if(typeof r<"u"){var s=document.createElement("div");s.innerHTML=r.innerHTML;var n=s.textContent||s.innerText||"";t.setAttribute("data-label",n),r.hasAttribute("data-td-class")&&t.setAttribute("class",r.getAttribute("data-td-class")),r.hasAttribute("data-format")&&(t.setAttribute("data-format",r.getAttribute("data-format")),t.innerHTML=b(r.getAttribute("data-format"),t.textContent.trim())),o.includes(t.textContent.trim().toLowerCase())&&t.setAttribute("data-content",t.textContent.trim().toLowerCase())}}))}))},c=(t,e)=>{var a=e.querySelector("[data-search]");if(!a)return!1;var r=a.getAttribute("id"),o=a.getAttribute("data-search").split(","),s=a.parentNode,n={};o.forEach(((e,a)=>{Array.from(t.querySelectorAll('td[data-label="'+e.trim()+'"]')).forEach(((t,e)=>{t.querySelector(".td__content")?n[t.querySelector(".td__content").textContent]=t.querySelector(".td__content").textContent:n[t.textContent]=t.textContent}))})),a.setAttribute("list","".concat(r,"_list")),a.setAttribute("autocomplete","off"),s.querySelector("datalist")||(s.innerHTML+='<datalist id="'.concat(r,'_list"></datalist>')),s.querySelector("datalist").innerHTML="".concat(Object.keys(n).map((t=>'<option value="'.concat(t,'"></option>'))).join(""))},l=(t,e,a)=>{if(e.getAttribute("data-ajax"))return!1;var r=t.querySelector("tbody"),o=e.querySelector("[data-sort]"),s=o.querySelector("option:nth-child(".concat(o.selectedIndex+1,")")),n=s.getAttribute("data-sort"),c=s.getAttribute("data-order"),l=s.getAttribute("data-format");if(!n)return r.innerHTML=a.innerHTML,i(t),!1;var d=[];["asc","desc","descending"].includes(c)||(d=c.split(","));var u=[];Array.from(r.querySelectorAll("tr")).forEach(((t,e)=>{var a=t.querySelector('td[data-label="'+n+'"], th[data-label="'+n+'"]').textContent.trim();d.length&&d.includes(a)&&(a=d.indexOf(a)),function(t){return"string"==typeof t&&!isNaN(t)&&!isNaN(parseFloat(t))}(a)&&(a=((t,e)=>String(t).padStart(10,"0"))(a)),l&&"date"==l&&(a=new Date(a));var r={index:a,row:t};u.push(r)})),u.sort(((t,e)=>t.index>e.index?1:-1)),("descending"==c||"desc"==c)&&(u=u.reverse());var h="";u.forEach(((t,e)=>{h+=t.row.outerHTML})),r.innerHTML=h},d=(t,e,a)=>{t.classList.remove("table--filtered");var r=[],o=[],s=0,n=e.querySelector("[data-pagination]")?parseInt(e.querySelector("[data-pagination]").value):1,i=e.querySelector("[data-show]")?parseInt(e.querySelector("[data-show]").value):15;if(Array.from(t.querySelectorAll("tbody tr")).forEach(((t,e)=>{t.classList.remove("filtered"),t.classList.remove("filtered--matched"),t.classList.remove("filtered--show"),t.removeAttribute("data-filtered-by")})),Array.from(e.querySelectorAll("[data-filter]")).forEach(((t,e)=>{if(("radio"!=t.type||t.checked)&&("checkbox"!=t.type||t.checked))if("multi"==t.getAttribute("data-filter"))for(var[a,o]of Object.entries(JSON.parse(t.value)))r[t.getAttribute("data-filter")].push(o);else if(t&&t.value){var s=t.getAttribute("data-filter");r[s]||(r[s]=new Array),r[s].push(t.value)}})),e.querySelector("[data-search]")){var c=e.querySelector("[data-search]");e.querySelector("[data-search]").getAttribute("data-search").split(",").forEach(((t,e)=>{o.push({column:"".concat(t.trim()),value:"".concat(c.value)})}))}Array.from(e.querySelectorAll("[data-filter-count]")).forEach(((t,e)=>{t.innerHTML=""})),r.length&&Array.from(e.querySelectorAll("[data-filter-count]")).forEach(((t,e)=>{t.innerHTML+="(".concat(r.length,")")})),t.classList.add("table--filtered");var l=function(e,a){Array.from(t.querySelectorAll("tbody tr:not(.filtered)")).forEach(((t,r)=>{var o=!1;a.forEach(((a,r)=>{var s=t.querySelector('[data-label="'.concat(e,'"]'));if(a&&"$today"==a)a=b("date",new Date);else if(a&&"$yesterday"==a){var n=new Date;n.setDate(n.getDate()-1),a=b("date",n)}else if(!a||"$thisWeek"!=a&&"$lastWeek"!=a){if(a&&"$thisMonth"==a){var i=new Date,c=i.getFullYear(),l=i.getMonth(),d=new Date(c,l,1),u=new Date(c,l+1,0),h=new Date(s.textContent.toLowerCase());d.setHours(0,0,0,0),u.setHours(0,0,0,0),h.setHours(0,0,0,0),o=h>=d&&h<=u}else if(a&&"$lastMonth"==a){var m=new Date,p=m.getFullYear(),f=m.getMonth(),g=new Date(p,f-1,1),y=new Date(p,f,0),v=new Date(s.textContent.toLowerCase());g.setHours(0,0,0,0),y.setHours(0,0,0,0),v.setHours(0,0,0,0),o=v>=g&&v<=y}}else{var A=new Date,w=new Date(A.setDate(A.getDate()-(A.getDay()-1))),L=new Date(A.setDate(A.getDate()-A.getDay()+7)),S=new Date(s.textContent.toLowerCase());if(A.setHours(0,0,0,0),w.setHours(0,0,0,0),L.setHours(0,0,0,0),S.setHours(0,0,0,0),"$thisWeek"==a)o=S>=w&&S<=L;else{var E=new Date(w.setDate(w.getDate()-7)),q=new Date(L.setDate(L.getDate()-7));E.setHours(0,0,0,0),q.setHours(0,0,0,0),o=S>=E&&S<=q}}s&&s.textContent.toLowerCase().includes(a.toLowerCase())&&(o=!0)})),o||(t.classList.add("filtered"),t.setAttribute("data-filtered-by",e))}))};for(var[d,u]of Object.entries(r))l(d,u);Array.from(t.querySelectorAll("tbody tr:not(.filtered)")).forEach(((t,e)=>{var a=!(o.length>0&&o[0].value.length>=3);o.forEach(((e,r)=>{var o=t.querySelector('[data-label="'.concat(e.column,'"]'));o&&e.value.length>=3&&o.textContent.toLowerCase().includes(e.value.toLowerCase())&&(a=!0)})),a||t.classList.add("filtered")})),Array.from(t.querySelectorAll("tbody tr:not(.filtered")).forEach(((t,e)=>{s++,t.classList.add("filtered--matched"),Math.ceil(s/i)==parseInt(n)&&t.classList.add("filtered--show")})),a&&(a.setAttribute("data-page",n),a.setAttribute("data-pages",Math.ceil(s/i)),a.setAttribute("data-total",s),a.setAttribute("data-show",i))},u=(t,e,a)=>{Array.from(e.querySelectorAll("[data-query]")).forEach(((e,r)=>{var o,s=e.getAttribute("data-query");if("total"==s)a.hasAttribute("data-total")?o=a.getAttribute("data-total"):(t.classList.contains("table--filtered"),o=t.querySelectorAll("tbody tr").length);else if(!s.includes(" == ")&&s.includes(" & ")){var n=s.split(" & "),i="";n.forEach((t=>{i+=':not([data-filtered-by="'.concat(t,'"])')})),o=Array.from(t.querySelectorAll("tbody tr".concat(i))).length}else if(s.includes(" == "))if(s.includes(" && ")){var c=s.split(" && ");o=Array.from(t.querySelectorAll("tbody tr:not(.filtered)")).filter((function(t){var e=!0;for(var[a,r]of Object.entries(c)){var o=r.split(" == ");(!t.querySelector('td[data-label="'.concat(o[0],'"]'))||t.querySelector('td[data-label="'.concat(o[0],'"]')).textContent!="".concat(o[1]))&&(e=!1)}return e})).length}else{var l=s.split(" == ");o=Array.from(t.querySelectorAll('tbody tr.filtered--matched td[data-label="'.concat(l[0],'"], tbody tr[data-filtered-by="').concat(l[0],'"] td[data-label="').concat(l[0],'"]'))).filter((function(t){return t.textContent===l[1]})).length}else o=Array.from(t.querySelectorAll('tbody tr:not([data-filtered-by="'.concat(s,'"])'))).length;e.hasAttribute("data-total")?e.setAttribute("data-total",o):e.innerHTML=o}))},h=function(t,e,a,r){if(i(t),(t=>{if(t.closest(".table--fullwidth")||t.querySelectorAll("thead tr th").length<4)return!1;Array.from(t.querySelectorAll("tbody tr")).forEach(((t,e)=>{var a=t.querySelector(":scope > :is(td,th):first-child"),r=a.textContent;if(""!=r)a.innerHTML='<span class="td__content">'.concat(r,'</span><button type="button" class="d-none">').concat(r,"</button>");else{var o=t.querySelector(":scope > :is(td,th):nth-child(2)"),s=o.textContent;o.innerHTML='<span class="td__content">'.concat(s,'</span><button type="button" class="d-none">').concat(s,"</button>")}}))})(t),u(t,e,r),r&&r.classList.contains("table--cta")){let e=function(){Array.from(t.querySelectorAll("tr")).forEach(((t,e)=>{var a=t.offsetHeight;t.style.setProperty("--row-height","".concat(a,"px"))}))};if(!r.hasAttribute("data-cta-width")){var o=(t=>{var e=0;return Array.from(t.querySelectorAll("tbody tr")).forEach(((t,a)=>{var r=window.getComputedStyle(document.querySelector("html")),o=t.querySelector(":scope > *:last-child > *:first-child");if(o){o.classList.add("text-nowrap");var s=o.offsetWidth/parseFloat(r.fontSize);e=e>(s+=1.7)?e:s}})),e})(t);r.style.setProperty("--cta-width","".concat(o,"rem")),r.setAttribute("data-cta-width","".concat(o,"rem"))}new ResizeObserver(e).observe(t)}},m=function(t,e,a,r){return function(t,e,a,r){return new(a||(a=Promise))((function(o,s){function n(t){try{c(r.next(t))}catch(t){s(t)}}function i(t){try{c(r.throw(t))}catch(t){s(t)}}function c(t){t.done?o(t.value):function(t){return t instanceof a?t:new a((function(e){e(t)}))}(t.value).then(n,i)}c((r=r.apply(t,e||[])).next())}))}(this,void 0,void 0,(function*(){var o=(t,e,a)=>e.split(/[\.\[\]\'\"]/).filter((t=>t)).reduce(((t,e)=>t?t[e]:a),t),s=new FormData(e),i=new URLSearchParams(s).toString(),l=t.querySelectorAll("thead tr th"),d=t.querySelector("tbody"),u=e.getAttribute("data-ajax");r.classList.add("table--loading"),window.controller||(window.controller=[]),window.controller[u]&&window.controller[u].abort(),window.controller[u]=new AbortController;var{signal:m}=controller[u];try{yield fetch(u+"?"+i,{signal:m,method:"get",credentials:"same-origin",headers:new Headers({"Content-Type":"application/json",Accept:"application/json","X-Requested-With":"XMLHttpRequest"})}).then((t=>t.json())).then((s=>{var m=e.hasAttribute("data-schema")?e.getAttribute("data-schema"):"data",b=e.hasAttribute("data-schema-total")?e.getAttribute("data-schema-total"):"meta.total",p=e.hasAttribute("data-schema-page")?e.getAttribute("data-schema-page"):"meta.current_page",f=o(s,b,1),g=o(s,p,1),y=o(s,m),v=r.hasAttribute("data-empty-msg")?r.getAttribute("data-empty-msg"):"No results found";if(y?(d.innerHTML="",y.forEach(((t,e)=>{var a=document.createElement("tr");l.forEach(((e,r)=>{var s="",n=document.createElement("td");if(n.setAttribute("data-label",e.innerText),e.getAttribute("data-output")){var i=e.getAttribute("data-output");s=i.replace(new RegExp(/{(.*?)}/,"gm"),(function(e){return o(t,e.replace("{","").replace("}",""))}))}if(e.hasAttribute("data-output-array")){i=e.getAttribute("data-output");var c=o(t,i.replace("{","").replace("}",""));s="",c.forEach(((t,a)=>{var r=e.getAttribute("data-output-array"),n="";if(e.hasAttribute("data-output-array-property")&&e.hasAttribute("data-output-array-transform")){var i=o(t,e.getAttribute("data-output-array-property")),c=JSON.parse(e.getAttribute("data-output-array-transform"))[i];n=r.replace("{".concat(e.getAttribute("data-output-array-property"),"}"),c)}n=n.replace(new RegExp(/{(.*?)}/,"gm"),(function(e){return o(t,e.replace("{","").replace("}",""))})),s+=n}))}if(e.hasAttribute("data-transform")){var l=JSON.parse(e.getAttribute("data-transform"));!(s=l[s])&&e.hasAttribute("data-default")&&(s=e.getAttribute("data-default"))}n.innerHTML=s,a.appendChild(n)})),d.appendChild(a)})),c(t,e),r.setAttribute("data-total",parseInt(f)),r.setAttribute("data-page",parseInt(g)),r.setAttribute("data-pages",Math.ceil(r.getAttribute("data-total")/r.getAttribute("data-show"))),h(t,e,0,r),n(r,a),0==parseInt(f)&&(d.innerHTML='<tr><td colspan="100%"><span>'.concat(v,"</span></td></tr>")),r.classList.remove("table--loading"),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"Ajax table loaded",url:u,formData:i})):d.innerHTML='<tr><td colspan="100%"><span>Error loading table</span></td></tr>',e.hasAttribute("data-ajax-post")){var A=new XMLHttpRequest;A.open("GET","".concat(window.location.href,"?ajax=true&").concat(i)),A.send()}}))}catch(t){console.log(t)}}))},b=(t,e)=>{switch(t){case"datetime":return new Date(e).toLocaleDateString("en-gb",{weekday:"short",year:"2-digit",month:"long",day:"numeric"})+" "+new Date(e).toLocaleTimeString("en-gb",{hour:"2-digit",minute:"2-digit"});case"date":return new Date(e).toLocaleDateString("en-gb",{year:"2-digit",month:"long",day:"numeric"});case"capitalise":return(t=>t.charAt(0).toUpperCase()+t.slice(1))(e)}};class p extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});var t=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",e=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):"".concat(t,"/css/core.min.css"),a=document.createElement("template");a.innerHTML='\n <style>\n @import "'.concat(e,'";\n\n :host(.mh-sm){\n max-height: none!important;\n }\n :host(.mh-md){\n max-height: none!important;\n }\n :host(.mh-lg){\n max-height: none!important;\n }\n \n ').concat(this.hasAttribute("css")?'@import "'.concat(this.getAttribute("css"),'";'):"",'\n </style>\n <div class="table--cta">\n <div class="table__wrapper">\n <slot></slot>\n </div>\n </div>\n <div class="table__pagination"></div>\n '),this.shadowRoot.appendChild(a.content.cloneNode(!0))}connectedCallback(){var t=new URLSearchParams(window.location.search);this.hasAttribute("data-total")||this.setAttribute("data-total",this.querySelectorAll("table tbody tr").length),this.hasAttribute("data-page")||this.setAttribute("data-page",t.has("page")?t.get("page"):1),this.hasAttribute("data-show")||this.setAttribute("data-show",15),this.hasAttribute("data-increment")||this.setAttribute("data-increment",15),this.setAttribute("data-pages",Math.ceil(this.getAttribute("data-total")/this.getAttribute("data-show")));var e=this.classList.toString();e=(e=e.replace("table--cta","")).replace("table--loading",""),this.shadowRoot.querySelector(".table__wrapper").className+=" ".concat(e),this.table=this.querySelector("table"),this.savedTableBody=this.table.querySelector("tbody").cloneNode(!0),this.pagination=this.shadowRoot.querySelector(".table__pagination"),this.classList.contains("table--cta")||this.shadowRoot.querySelector(".table--cta").classList.remove("table--cta"),this.form=document.createElement("form"),this.hasAttribute("data-filterby")?this.form=document.querySelector("#".concat(this.getAttribute("data-filterby"))):this.table.parentNode.insertBefore(this.form,this.table.nextSibling),this.form.hasAttribute("data-ajax")&&this.table.classList.add("table--ajax"),c(this.table,this.form),this.form.querySelector("[data-page]")||(this.form.innerHTML+='<input name="page" type="hidden" value="'.concat(this.getAttribute("data-page"),'" data-pagination="true" />')),this.form.querySelector("[data-show]")||(this.form.innerHTML+='<input name="show" type="hidden" value="'.concat(this.getAttribute("data-show"),'" data-show="true" />')),this.table.addEventListener("click",(t=>{if(t&&t.target instanceof HTMLElement&&t.target.closest("tr > :is(td,th):first-child button")){var e=t.target.closest("tr > :is(td,th):first-child button"),a=e.parentNode.closest("tr");"full"==a.getAttribute("data-view")?a.setAttribute("data-view","default"):a.setAttribute("data-view","full"),e.blur()}})),((t,e,a,r,o)=>{var s,i=function(){var o=arguments.length>0&&void 0!==arguments[0]&&arguments[0];e.hasAttribute("data-ajax")?(o||(e.querySelector("[data-pagination]").value=1,r.setAttribute("data-page",1)),m(t,e,a,r)):e.hasAttribute("data-submit")?e.submit():(d(t,e,r),n(r,a),u(t,e))};e.addEventListener("keyup",(t=>{clearTimeout(s),t&&t.target instanceof HTMLElement&&t.target.closest("[data-search]")&&(s=setTimeout((function(){i()}),500))})),e.addEventListener("change",(a=>{clearTimeout(s),a&&a.target instanceof HTMLElement&&a.target.closest("[data-sort]")&&(e.hasAttribute("data-submit")||l(t,e,o),i()),a&&a.target instanceof HTMLElement&&a.target.closest("[data-search]")&&i(),a&&a.target instanceof HTMLElement&&a.target.closest("[data-filter]")&&a.target.closest("form .dialog__wrapper > dialog")&&i(),a&&a.target instanceof HTMLElement&&a.target.closest("[data-filter]")&&!a.target.closest("form dialog")&&i(),a&&a.target instanceof HTMLElement&&a.target.closest("[data-show]")&&i(),a&&a.target instanceof HTMLElement&&a.target.closest("[data-mimic]")&&i()})),e.addEventListener("click",(a=>{clearTimeout(s),a&&a.target instanceof HTMLElement&&a.target.closest('dialog button:not([type="button"])')&&a.target.closest('dialog button:not([type="button"])').closest("dialog").close(),a&&a.target instanceof HTMLElement&&a.target.closest(".dialog__close")&&(a.preventDefault(),a.stopPropagation()),a&&a.target instanceof HTMLElement&&a.target.closest("[data-clear]")&&(e.reset(),e.hasAttribute("data-submit")||l(t,e,o),i())})),e.addEventListener("submit",(t=>{clearTimeout(s),e.hasAttribute("data-submit")||t.preventDefault(),i()})),e.addEventListener("force",(t=>{i()})),e.addEventListener("paginate",(t=>{i(!0)}));var c=[],h=[];Array.from(e.querySelectorAll("[data-mimic]")).forEach(((t,e)=>{var a=t.getAttribute("data-mimic");Array.from(document.querySelectorAll('[name="'.concat(a,'"]'))).forEach(((t,e)=>{var r=t.closest("form");c.includes(r)||c.push(r),h.includes(a)||h.push(a)}))})),c.forEach(((t,a)=>{var r=function(){var a=[],r=new FormData(t);for(var[o,s]of r)document.querySelector('[data-mimic="'.concat(o,'"]'))&&!a.includes(o)?(a.push(o),document.querySelector('[data-mimic="'.concat(o,'"]')).value=s):document.querySelector('[data-mimic="'.concat(o,'"]'))&&(document.querySelector('[data-mimic="'.concat(o,'"]')).value+=","+s);for(var n of a){var i=new Event("force");e.dispatchEvent(i)}for(var c of h)if(!r.has(c)&&t.querySelector('[name="'.concat(c,'"]'))){document.querySelector('[data-mimic="'.concat(c,'"]')).value="";var l=new Event("force");e.dispatchEvent(l)}};t.addEventListener("force",(t=>{r()})),t.addEventListener("change",(t=>{r()}))}))})(this.table,this.form,this.pagination,this,this.savedTableBody),function(t,e,a,r){a.addEventListener("click",(a=>{if(a&&a.target instanceof HTMLElement&&a.target.closest("[data-page]")){a.preventDefault();var o=e.querySelector("[data-pagination]"),s=a.target.closest("[data-page]").getAttribute("data-page");if(o.value=s,r.setAttribute("data-page",s),e.dispatchEvent(new Event("paginate")),t.hasAttribute("data-show-history")){var n=new URL(location);n.searchParams.set("page",s),history.pushState({type:"pagination",form:e.getAttribute("id"),page:s},"",n)}var i=t.getBoundingClientRect().top+window.pageYOffset+-250;window.scrollTo({top:i,behavior:"smooth"})}if(a&&a.target instanceof HTMLElement&&a.target.closest("[data-show]")){a.preventDefault();var c=e.querySelector("[data-show]"),l=a.target.closest("[data-show]").getAttribute("data-show");c.value=l,r.setAttribute("data-show",l),e.dispatchEvent(new Event("submit"))}}))}(this.table,this.form,this.pagination,this),((t,e)=>{if(!t)return!1;t.addEventListener("click",(t=>{!function(t){for(var e=[],a=t.getElementsByTagName("tr"),r=0;r<a.length;r++){for(var o=a[r].querySelectorAll("td,th"),s=[],n=0;n<o.length;n++)s.push('"'.concat(o[n].textContent,'"'));e.push(s.join(","))}e=e.join("\n");var i=new Blob([e],{type:"text/csv"}),c=document.createElement("a");c.download="export.csv";var l=window.URL.createObjectURL(i);c.href=l,c.style.display="none",document.body.appendChild(c),c.click(),document.body.removeChild(c)}(e)}))})(this.shadowRoot.querySelector("[data-export]"),this.table),this.form.getAttribute("data-ajax")?m(this.table,this.form,this.pagination,this):(h(this.table,this.form,this.pagination,this),d(this.table,this.form,this),n(this,this.pagination),u(this.table,this.form)),this.shadowRoot.querySelector(".table__wrapper").addEventListener("scroll",(t=>{this.table.querySelector("dialog[open]")&&(this.table.querySelector("dialog[open]").close(),this.table.querySelector(".dialog__wrapper > button.active").classList.remove("active"))}))}static get observedAttributes(){return["data-total","data-pages","data-page","data-show"]}attributeChangedCallback(t,e,a){}}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"Card"});class f extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.querySelector('[class*="fa-"]')&&this.classList.add("card--has-icon");var t=this.classList.toString(),e=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",a=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):"".concat(e,"/css/core.min.css"),r='@import "'.concat(e,'/css/components/card.css";'),o=document.createElement("template");o.innerHTML='\n <style>\n @import "'.concat(a,'";\n ').concat(r,"\n ").concat(this.hasAttribute("css")?'@import "'.concat(this.getAttribute("css"),'";'):"",'\n </style>\n <div class="card ').concat(t,'" tabindex="0" role="button">\n ').concat(this.hasAttribute("data-image")?'<div class="card__head"><img src="'.concat(this.getAttribute("data-image"),'" alt="" loading="lazy" /></div>'):"",'\n <div class="card__body">\n ').concat(this.classList.contains("card--filter")&&this.hasAttribute("data-total")?'<div class="card__total">'.concat(this.getAttribute("data-total"),"</div>"):"","\n ").concat(this.hasAttribute("data-illustration")?'<div class="card__illustration"><img src="'.concat(this.getAttribute("data-illustration"),'" alt="" loading="lazy" /></div>'):"","\n <slot></slot>\n </div>\n ").concat(this.hasAttribute("data-cta")?'<div class="card__footer"><span class="link">'.concat(this.getAttribute("data-cta"),"</span></div>"):"","\n </div>\n "),this.shadowRoot.appendChild(o.content.cloneNode(!0))}connectedCallback(){this.classList.add("loaded");var t=this.parentNode.closest("a, button, label"),e=this.shadowRoot.querySelector(".card");t.setAttribute("tabindex","-1"),t.matches("label[for]")&&document.getElementById(t.getAttribute("for")).checked&&e.classList.add("active"),e.addEventListener("click",(a=>{t.matches("label[for]")?document.getElementById(t.getAttribute("for")).checked?e.classList.remove("active"):e.classList.add("active"):t.click()})),e.addEventListener("keydown",(a=>{switch(a.keyCode){case 32:case 13:t.matches("label[for]")?document.getElementById(t.getAttribute("for")).checked?e.classList.remove("active"):e.classList.add("active"):t.click()}}))}static get observedAttributes(){return["data-total","class"]}attributeChangedCallback(t,e,a){switch(t){case"data-total":this.shadowRoot.querySelector(".card__total").innerHTML=a;break;case"class":var r=this.classList.toString();this.querySelector('[class*="fa-"]')&&(r+=" card--has-icon"),this.shadowRoot.querySelector(".card").setAttribute("class","card ".concat(r))}}}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"Applied Filters"});class g extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});var t=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",e=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):"".concat(t,"/css/core.min.css"),a='@import "'.concat(t,'/css/components/applied-filters.css";'),r=this.classList.toString(),o=document.createElement("template");o.innerHTML='\n <style>\n @import "'.concat(e,'";\n ').concat(a,"\n ").concat(this.hasAttribute("css")?'@import "'.concat(this.getAttribute("css"),'";'):"",'\n </style>\n <div class="applied-filters ').concat(r,'"></div>\n <slot></slot>\n '),this.shadowRoot.appendChild(o.content.cloneNode(!0))}connectedCallback(){!function(t,e){function a(t,e){var a=!1,r=e.getAttribute("name");r.includes("[]")&&(r=r.replace("[]","[".concat(e.value,"]")));var o=t.querySelector('[data-name="'.concat(r,'"]'));o&&"checkbox"==e.getAttribute("type")&&(a=!0);var s=e.getAttribute("data-filter-text");if(o||(o=document.createElement("button"),t.appendChild(o)),o.setAttribute("type","button"),o.classList.add("filter"),o.setAttribute("data-name",r),o.innerHTML=s.replace("$value",e.value),(!e.value||a)&&o.remove(),e.parentNode.closest("[data-filter-text]")){var n=e.parentNode.closest("[data-filter-text]"),i=!0;if(r="",n.querySelectorAll("input").forEach(((e,a)=>{var o=e.getAttribute("name");if(r+="".concat(0!=a?",":"").concat(o),t.querySelector('[data-name="'.concat(o,'"]'))&&t.querySelector('[data-name="'.concat(o,'"]')).remove(),e.value){var n=document.createElement("button");n.setAttribute("type","button"),n.classList.add("filter"),n.setAttribute("data-name",o),n.innerHTML=s.replace("$value",e.value),t.appendChild(n)}else i=!1})),t.querySelector('[data-name="'.concat(r,'"]'))&&t.querySelector('[data-name="'.concat(r,'"]')).remove(),i){var c=n.getAttribute("data-filter-text");n.querySelectorAll("input").forEach(((e,a)=>{var r=e.getAttribute("name");t.querySelector('[data-name="'.concat(r,'"]'))&&t.querySelector('[data-name="'.concat(r,'"]')).remove(),c=c.replace("$".concat(a+1),e.value)}));var l=document.createElement("button");l.setAttribute("type","button"),l.classList.add("filter"),l.setAttribute("data-name",r),l.innerHTML=c,t.appendChild(l)}}}Array.from(t.querySelectorAll('input[type="checkbox"]:checked')).forEach(((t,r)=>{a(e,t)})),t.addEventListener("change",(function(t){if(t&&t.target instanceof HTMLElement&&t.target.closest("input[data-filter-text]")){var r=t.target.closest("input[data-filter-text]");a(e,r)}}),!1),e.addEventListener("click",(function(e){if(e&&e.target instanceof HTMLElement&&e.target.closest(".filter")){for(var a=e.target.closest(".filter"),r=a.getAttribute("data-name").split(","),o=0;o<r.length;o++){var s=r[o],n='[name="'.concat(s,'"]');if(s.match(/\[(.*)\]/)){s.replace(/\[(.*)\]/,"[]");var i=s.replace(/.*\[(.*)\]/,"$1");n='[value="'.concat(i,'"]')}for(var c=t.querySelectorAll(n),l=0;l<c.length;l++){var d=c[l];"radio"!=d.getAttribute("type")&&"checkbox"!=d.getAttribute("type")?d.value="":(d.checked=!1,e=new Event("force"),d.closest("form").dispatchEvent(e))}}a.remove()}}),!1)}(this,this.shadowRoot.querySelector(".applied-filters"))}}class y extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});var t=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",e=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):"".concat(t,"/css/core.min.css"),a=document.createElement("template");a.innerHTML='\n <style>\n @import "'.concat(e,'";\n \n ').concat(this.hasAttribute("css")?'@import "'.concat(this.getAttribute("css"),'";'):"",'\n </style>\n <div class="pagination__wrapper d-none">\n </div>\n '),this.shadowRoot.appendChild(a.content.cloneNode(!0))}connectedCallback(){var t=new URLSearchParams(window.location.search);this.hasAttribute("data-total")||this.setAttribute("data-total",this.querySelectorAll("table tbody tr").length),this.hasAttribute("data-page")||this.setAttribute("data-page",t.has("page")?t.get("page"):1),this.hasAttribute("data-show")||this.setAttribute("data-show",t.has("show")?t.get("show"):15),this.hasAttribute("data-increment")||this.setAttribute("data-increment",15),this.setAttribute("data-pages",Math.ceil(this.getAttribute("data-total")/this.getAttribute("data-show"))),n(this,this.shadowRoot.querySelector(".pagination__wrapper")),this.shadowRoot.querySelector(".pagination__wrapper").classList.remove("d-none")}}var v=function(t,e){Array.from(t.querySelectorAll(":scope > li")).forEach(((t,a)=>{var r=t.textContent.toLowerCase();t.classList.add("d-none"),r.includes(e.toLowerCase())&&t.classList.remove("d-none")})),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"Filtered list",value:e})};window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"filterlist"});class A extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});var t=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",e=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):"".concat(t,"/css/core.min.css"),a=document.createElement("template");a.innerHTML='\n <style>\n @import "'.concat(e,'";\n ').concat(this.hasAttribute("css")?'@import "'.concat(this.getAttribute("css"),'";'):"",'\n \n :host {\n margin-bottom: 1rem;\n display:block;\n }\n :host(.mh-sm){\n max-height: none!important;\n }\n :host(.mh-md){\n max-height: none!important;\n }\n :host(.mh-lg){\n max-height: none!important;\n }\n </style>\n <div class="form-control__wrapper">\n <label for="search" class="visually-hidden">Search</label>\n <span class="suffix" role="presentation"><slot name="icon"></slot></span>\n <input name="search" id="search" type="text" class="form-control" autocomplete="off" placeholder="Search" />\n </div>\n <div class="list__wrapper">\n <slot></slot>\n </div>\n '),this.shadowRoot.appendChild(a.content.cloneNode(!0))}connectedCallback(){var t=this.classList.toString();this.shadowRoot.querySelector(".list__wrapper").setAttribute("class","list__wrapper ".concat(t)),this.querySelector("i.fa-search")||(this.innerHTML+='<i class="fa fa-light fa-search" aria-hidden="true" slot="icon"></i>'),function(t,e){!function(t,e){var a;e.addEventListener("keyup",(r=>{clearTimeout(a),a=setTimeout((function(){v(t,e.value)}),500)})),e.addEventListener("change",(r=>{clearTimeout(a),v(t,e.value)}))}(t,e)}(this.querySelector("ul"),this.shadowRoot.querySelector("#search"))}}function w(t,e){var a,r,o=e;this.pause=function(){window.clearTimeout(a),o-=new Date-r},this.resume=function(){r=new Date,window.clearTimeout(a),a=window.setTimeout(t,o)},this.resume()}var L=function(t){t.classList.add("d-none")};window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"Notification"});class S extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});var t=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",e=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):"".concat(t,"/css/core.min.css"),a='@import "'.concat(t,'/css/components/notification.css";'),r=this.querySelectorAll("a,button");Array.from(r).forEach(((t,e)=>{t.setAttribute("slot","btns"),t.classList.add("link")})),(r.length||this.hasAttribute("data-dismiss"))&&this.classList.add("notification--dismissable");var o=document.createElement("template");o.innerHTML='\n <style>\n @import "'.concat(e,'";\n ').concat(a,"\n ").concat(this.hasAttribute("data-css")?"".concat(this.getAttribute("data-css")):"",'\n </style>\n\n <div class="notification">\n <div class="notification__icon"><slot name="icon"></slot></div>\n <div class="notification__inner"><div class="notification__text"><slot></slot></div>').concat(r.length?'<div class="notification__btns"><slot name="btns"></slot></div>':"","</div>\n ").concat(this.hasAttribute("data-dismiss")?'<div class="notification__dismiss"><button data-dismiss-button>Dismiss</button></div>':"","\n </div>\n "),this.shadowRoot.appendChild(o.content.cloneNode(!0))}connectedCallback(){var t=this.shadowRoot.querySelector("[data-dismiss-button]"),e=this.hasAttribute("data-status")?this.getAttribute("data-status"):"white";this.hasAttribute("data-type")?this.classList.add("bg-".concat(e)):this.classList.add("colour-".concat(e));var a=this;if(!this.querySelector("i"))switch(e){case"danger":this.innerHTML+='<i class="fa-solid fa-circle-exclamation" aria-hidden="true" slot="icon"></i>';break;case"warning":this.innerHTML+='<i class="fa-solid fa-triangle-exclamation" aria-hidden="true" slot="icon"></i>';break;case"success":this.innerHTML+='<i class="fa-solid fa-check-circle" aria-hidden="true" slot="icon"></i>';break;default:this.innerHTML+='<i class="fa-solid fa-circle-info" aria-hidden="true" slot="icon"></i>'}(function(t){if(t.hasAttribute("data-type")&&"toast"==t.getAttribute("data-type")){var e=document.querySelector(".notification__holder");e||((e=document.createElement("div")).classList.add("notification__holder"),e.classList.add("container"),document.querySelector("body").appendChild(e)),t.closest(".notification__holder")||e.appendChild(t)}if(t.setAttribute("role","alert"),t.addEventListener("click",(function(e){event&&event.target instanceof HTMLElement&&event.target.closest("[data-dismiss-button]")&&(e.preventDefault(),L(t))}),!1),t.hasAttribute("data-timeout")){var a=new w((function(){L(t)}),t.getAttribute("data-timeout"));t.addEventListener("mouseenter",(t=>{a.pause()})),t.addEventListener("mouseleave",(t=>{a.resume()}))}})(a),t&&t.addEventListener("click",(function(t){L(a)}),!1)}}document.addEventListener("DOMContentLoaded",(function(){var n;window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"Pageview",pageTitle:document.title}),document.addEventListener("click",(t=>{t&&t.target instanceof HTMLElement&&t.target.closest("[open] summary")?window.dataLayer.push({event:"closeDetails",detailsTitle:t.target.closest("summary").textContent}):t&&t.target instanceof HTMLElement&&t.target.closest("summary")&&window.dataLayer.push({event:"openDetails",detailsTitle:t.target.closest("summary").textContent}),t&&t.target instanceof HTMLElement&&t.target.closest("a")&&window.dataLayer.push({event:"linkClicked",linkText:t.target.closest("a").hasAttribute("title")?t.target.closest("a").getAttribute("title"):t.target.closest("a").textContent,class:t.target.closest("a").hasAttribute("class")?t.target.closest("a").getAttribute("class"):"",href:t.target.closest("a").getAttribute("href")}),t&&t.target instanceof HTMLElement&&t.target.closest("button")&&window.dataLayer.push({event:"buttonClicked",buttonText:t.target.closest("button").textContent,class:t.target.closest("button").hasAttribute("class")?t.target.closest("button").getAttribute("class"):""})})),(t=>{t.classList.add("js-enabled"),(-1!==navigator.userAgent.indexOf("MSIE")||navigator.appVersion.indexOf("Trident/")>0)&&t.classList.add("ie");var e=document.querySelector("nav");if(e){let t=function(){a=e.offsetHeight,document.querySelector("body").style.setProperty("--nav-height","".concat(a,"px"))};var a=e.offsetHeight;document.querySelector("body").style.setProperty("--nav-height","".concat(a,"px")),new ResizeObserver(t).observe(e)}else document.querySelector("body").style.setProperty("--nav-height","0px")})(document.body),n=function(t){var e=document.querySelector('label[for="'.concat(t.replace("#",""),'"]')),a=document.querySelector(t+" summary"),r=document.querySelector("dialog".concat(t));e instanceof HTMLElement?e.click():a instanceof HTMLElement?a.click():r instanceof HTMLElement&&r.showModal()},location.hash&&n(location.hash),window.addEventListener("hashchange",(function(){n(location.hash)}),!1),addEventListener("popstate",(t=>{if(t&&t.state.type&&"pagination"==t.state.type){var e=document.querySelector("#".concat(t.state.form)),a=document.querySelector("#".concat(t.state.form," [data-pagination]"));a?a.value=t.state.page:e.innerHTML+='<input name="page" type="hidden" data-pagination="true" value="'.concat(t.state.page,'" />'),e.dispatchEvent(new Event("submit"))}})),document.body.addEventListener("click",(t=>{if(t&&t.target instanceof HTMLElement&&t.target.closest("[data-modal]")){var r=t.target.closest("[data-modal]"),o=r.hasAttribute("data-modal")?r.getAttribute("data-modal"):r.getAttribute("data-filter"),s=document.querySelector("dialog#".concat(o));(t=>{if(t.classList.contains("dialog--multi")&&!t.querySelector(":scope > .steps")&&a(t),!t.querySelector(":scope > .mh-lg")&&!t.classList.contains("dialog--multi")){t.innerHTML='<div class="mh-lg">'.concat(t.innerHTML,"</div>");var e=t.querySelector(".mh-lg"),r=t.querySelector(".mh-lg :is(.h1,.h2,.h3,.h4,.h5,.h6)");if(r){var o=r.previousSibling;e.before(r),o&&r.before(o)}}t.querySelector(":scope > button:first-child")||(t.innerHTML='<button class="dialog__close">Close</button>'.concat(t.innerHTML))})(s),s.querySelector(":scope > .mh-lg > form:last-child > button:last-child, :scope > .mh-lg > button:last-child")&&!s.classList.contains("dialog--multi")&&s.addEventListener("cancel",(t=>{t.preventDefault()}));var n=s.querySelector(".youtube-embed a");n&&e(n),s.showModal(),s.focus(),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"openModal",id:o})}if(t&&t.target instanceof HTMLElement&&t.target.closest("button.dialog__close")){var i=t.target.closest("dialog[open]");t.preventDefault(),i.close(),Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach(((t,e)=>{t.classList.remove("active")})),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:i.getAttribute("id")})}if(t&&t.target instanceof HTMLElement&&t.target.closest('button[formmethod="dialog"]')){var c=t.target.closest("dialog[open]");Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach(((t,e)=>{t.classList.remove("active")})),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:c.getAttribute("id")})}if(t&&t.target instanceof HTMLElement&&t.target.closest("dialog[open]")){var l=t.target.closest("dialog[open]");if(!l.querySelector(":scope > .mh-lg > form:last-child > button:last-child, :scope > .mh-lg > button:last-child")||l.classList.contains("dialog--multi")){var d=l.getBoundingClientRect();(t.clientX<d.left||t.clientX>d.right||t.clientY<d.top||t.clientY>d.bottom)&&(l.close(),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:l.getAttribute("id")}))}}if(t&&t.target instanceof HTMLElement&&t.target.closest(".dialog__wrapper > button")){var u=t.target.closest(".dialog__wrapper > button"),h="openPopover",m=t.target.closest(".dialog__wrapper > button").parentNode.querySelector(":scope > dialog");if(document.querySelector("dialog[open]")&&document.querySelector("dialog[open]")!=m&&document.querySelector("dialog[open]").close(),Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach(((t,e)=>{t.classList.remove("active")})),m.hasAttribute("open"))m.close(),h="closePopover",m.removeAttribute("style"),u.classList.remove("active");else{m.show(),u.classList.add("active");var b=u.getBoundingClientRect(),p=b.top,f=b.left;if(u.closest("iam-table")){var g=u.closest("iam-table").parentNode.getBoundingClientRect();p-=g.top,f-=g.left}m.classList.contains("dialog--fix")&&m.setAttribute("style","position:fixed;top: ".concat(p,"px; left: ").concat(f,"px; margin: 3rem 0 0 0;"))}if(m.getBoundingClientRect().bottom-window.scrollY>window.innerHeight-window.scrollY){var y=m.getAttribute("style");m.setAttribute("style",y+"transform: translate(0, calc(-100% - 4rem))")}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:h,id:u.textContent})}t&&t.target instanceof HTMLElement&&!t.target.closest("dialog[open]")&&!t.target.closest(".dialog__wrapper > button")&&(document.querySelector(".dialog__wrapper:not([data-keep-open]) > dialog[open]")&&document.querySelector(".dialog__wrapper:not([data-keep-open]) > dialog[open]").close(),Array.from(document.querySelectorAll(".dialog__wrapper:not([data-keep-open]) > button")).forEach(((t,e)=>{t.classList.remove("active")})))})),window.customElements.get("iam-header")||window.customElements.define("iam-header",r),window.customElements.get("iam-accordion")||window.customElements.define("iam-accordion",o),window.customElements.get("iam-tabs")||window.customElements.define("iam-tabs",s),window.customElements.get("iam-table")||window.customElements.define("iam-table",p),window.customElements.get("iam-card")||window.customElements.define("iam-card",f),window.customElements.get("iam-filterlist")||window.customElements.define("iam-filterlist",A),window.customElements.get("iam-pagination")||window.customElements.define("iam-pagination",y),window.customElements.get("iam-applied-filters")||window.customElements.define("iam-applied-filters",g),window.customElements.get("iam-notification")||window.customElements.define("iam-notification",S),Array.from(document.querySelectorAll(".nav")).forEach((t=>{(t=>{Array.from(t.querySelectorAll("details")).forEach(((t,e)=>{t.addEventListener("mouseenter",(function(e){window.matchMedia("(min-width: 62em)").matches&&t.setAttribute("open","true")}),!1),t.addEventListener("mouseleave",(function(e){window.matchMedia("(min-width: 62em)").matches&&t.removeAttribute("open")}),!1)})),"IntersectionObserver"in window&&new IntersectionObserver((t=>{var[e]=t;return e.target.classList.toggle("is-stuck",e.intersectionRatio<1)}),{threshold:[1]}).observe(t)})(t)})),Array.from(document.querySelectorAll(".testimonial")).forEach((t=>{!function(t){var e,a=t.querySelector(".testimonial__images"),r=a.querySelectorAll("img").length;if(1==r)return!1;t.classList.add("testimonial--multi"),a.addEventListener("scroll",(function(o){clearTimeout(e),e=setTimeout((function(){var e=a.scrollWidth,o=a.scrollHeight,s=a.scrollLeft,n=a.scrollTop,i=Math.round(s/e*r)+1;0==s&&0!=n&&(i=Math.round(n/o*r)+1),t.setAttribute("data-show",i),function(e){var a=t.querySelector(".btn-next"),o=t.querySelector(".btn-prev");a.setAttribute("data-go",e+1),o.setAttribute("data-go",e-1),a.removeAttribute("disabled"),o.removeAttribute("disabled"),1==e?o.setAttribute("disabled",!0):e==r&&a.setAttribute("disabled",!0)}(i)}),300)}),!1),t.addEventListener("click",(function(t){for(var e=t.target;e&&e!=this;e=e.parentNode)if(e.matches("[data-go]")){var o=parseInt(e.getAttribute("data-go")),s=0,n=0,i=a.scrollWidth,c=a.scrollHeight;i>c?n=Math.floor(i*((o-1)/r)):s=Math.floor(c*((o-1)/r)),a.scroll({top:s,left:n,behavior:"smooth"});break}}),!1)}(t)})),Array.from(document.querySelectorAll(".carousel")).forEach((t=>{!function(t){var e,a=t.querySelector(".carousel__inner"),r=t.querySelectorAll(".carousel__item").length;t.getAttribute("data-cols");var o=t.getAttribute("data-sm-cols"),s=t.getAttribute("data-md-cols");t.querySelector(".carousel__controls a").classList.add("active"),a.addEventListener("scroll",(function(o){clearTimeout(e),e=setTimeout((function(){var e=a.clientWidth,o=a.scrollWidth,s=a.scrollLeft,n=Math.round(s/o*r)+1,i=t.querySelector(".carousel__item:last-child").offsetLeft;Array.from(t.querySelectorAll(".carousel__controls a")).forEach(((t,e)=>{t.classList.remove("active")})),t.querySelector(".control-"+n).classList.add("active"),1==n?t.querySelector(".btn-prev").setAttribute("disabled","disabled"):t.querySelector(".btn-prev").removeAttribute("disabled"),a.scrollLeft+e>i?t.querySelector(".btn-next").setAttribute("disabled","disabled"):t.querySelector(".btn-next").removeAttribute("disabled")}),100)}),!1),t.addEventListener("click",(function(e){for(var r=e.target;r&&r!=this;r=r.parentNode)if(r.matches(".carousel__controls a")){e.preventDefault(),Array.from(t.querySelectorAll(".carousel__controls a")).forEach(((t,e)=>{t.classList.remove("active")})),r.classList.add("active");var o=document.querySelector(r.getAttribute("href"));a.scroll({top:0,left:o.offsetLeft,behavior:"smooth"});break}}),!1),t.addEventListener("click",(function(t){for(var e=t.target;e&&e!=this;e=e.parentNode)if(e.matches(".btn-next, .btn-prev")){t.preventDefault();var r=e.classList.contains("btn-prev")?a.scrollLeft-a.clientWidth:a.scrollLeft+a.clientWidth;a.scroll({top:0,left:r,behavior:"smooth"});break}}),!1),1==r&&t.classList.add("hide-btns"),o>=r&&t.classList.add("hide-sm-btns"),s>=r&&t.classList.add("hide-md-btns")}(t)})),Array.from(document.querySelectorAll("form")).forEach((t=>{!function(t){Array.from(t.querySelectorAll("[data-input-range]")).forEach(((t,e)=>{!function(t){t.addEventListener("change",(function(e){var a=parseInt(t.querySelector("[data-min] select,[data-min] input").value),r=parseInt(t.querySelector("[data-max] select,[data-max] input").value);Array.from(t.querySelectorAll("[data-min] input")).forEach(((t,e)=>{t.setAttribute("max",r)})),Array.from(t.querySelectorAll("[data-max] input")).forEach(((t,e)=>{t.setAttribute("min",a)})),Array.from(t.querySelectorAll("[data-min] select option")).forEach(((t,e)=>{parseInt(t.getAttribute("value"))>r?t.classList.add("d-none"):t.classList.remove("d-none")})),Array.from(t.querySelectorAll("[data-max] select option")).forEach(((t,e)=>{parseInt(t.getAttribute("value"))<a?t.classList.add("d-none"):t.classList.remove("d-none")}))}),!1)}(t)})),Array.from(t.querySelectorAll("[data-redirect]")).forEach(((t,e)=>{!function(t){t.addEventListener("change",(function(e){if(t.matches("[data-value-if]")){var a=t.getAttribute("data-redirect"),r=t.getAttribute("data-value-if");t.value==r&&(document.location.href=a)}else typeof t.value<"u"&&(document.location.href=t.value)}),!1)}(t)})),Array.from(t.querySelectorAll(".multiple-file-uploads")).forEach(((t,e)=>{!function(t){var e=t.querySelector(".row").cloneNode(!0),a=t.querySelector("[data-add]");t.addEventListener("click",(function(r){for(var o=r.target;o&&o!=this;o=o.parentNode){if(o.matches("[data-add]")){var s=e.cloneNode(!0);t.insertBefore(s,o),a.matches("[data-maxfiles]")&&Array.from(t.querySelectorAll(":scope > .row")).length>=a.dataset.maxfiles&&a.setAttribute("disabled","disabled");break}if(o.matches("[data-delete]")){o.closest(".row").remove(),a.matches("[data-maxfiles]")&&Array.from(t.querySelectorAll(":scope > .row")).length<a.dataset.maxfiles&&a.removeAttribute("disabled");break}}}),!1)}(t)})),t.addEventListener("change",(function(t){for(var e=t.target;e&&e!=this;e=e.parentNode)if(e.matches('[type="file"][data-filesize]')&&e.files&&e.files[0]){var a=e.dataset.filesize;e.files[0].size>a&&(e.value="",alert("File too large"));break}}),!1),t.addEventListener("change",(function(e){Array.from(t.querySelectorAll("select[data-activeif][data-equals],input[data-activeif][data-equals]")).forEach(((e,a)=>{var r=e.closest("[data-group]")?e.closest("[data-group]"):t,o=e.dataset.activeif,s=e.dataset.equals;r.querySelector('select[data-id="'.concat(o,'"],input[data-id="').concat(o,'"]')).value==s?e.removeAttribute("disabled"):(e.setAttribute("disabled","disabled"),e.value="")})),Array.from(t.querySelectorAll(".form-control__wrapper[data-displayif][data-equals]")).forEach(((e,a)=>{var r=e.closest("[data-group]")?e.closest("[data-group]"):t,o=e.dataset.activeif,s=e.dataset.equals;r.querySelector('select[data-id="'.concat(o,'"],input[data-id="').concat(o,'"]')).value==s?e.classList.remove("d-none"):e.classList.add("d-none")}))}),!1)}(t)})),Array.from(document.querySelectorAll(".youtube-embed")).forEach((e=>{new t(e)})),window.addEventListener("hashchange",(function(){var t=location.hash.replace("#",""),e=document.querySelector('label[for="'.concat(t,'"]'));e instanceof HTMLElement&&e.click()}),!1)}))}));
6
6
  //# sourceMappingURL=scripts.bundle.min.js.map