@iamproperty/components 3.7.8--beta → 3.7.8--beta-2

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.
@@ -923,7 +923,7 @@ export const loadAjaxTable = async function (table, form, pagination, wrapper){
923
923
  wrapper.setAttribute('data-page', parseInt(currentPage));
924
924
  wrapper.setAttribute('data-pages', Math.ceil(wrapper.getAttribute('data-total') / wrapper.getAttribute('data-show')));
925
925
 
926
- filterTable(table, form, wrapper);
926
+
927
927
  makeTableFunctional(table, form, pagination, wrapper);
928
928
  createPaginationButttons(wrapper, pagination);
929
929
 
@@ -1,4 +1,4 @@
1
- import { openBlock as u, createElementBlock as m, normalizeClass as A, createElementVNode as d, toDisplayString as $, createCommentVNode as g, Fragment as T, renderList as M, renderSlot as _, withDirectives as z, mergeProps as H, vModelDynamic as G, vModelText as ct, vModelSelect as dt, resolveComponent as N, createVNode as x, createTextVNode as ut, withModifiers as mt } from "vue";
1
+ import { openBlock as u, createElementBlock as m, normalizeClass as A, createElementVNode as d, toDisplayString as $, createCommentVNode as g, Fragment as T, renderList as M, renderSlot as _, withDirectives as z, mergeProps as H, vModelDynamic as W, vModelText as ct, vModelSelect as dt, resolveComponent as N, createVNode as x, createTextVNode as ut, withModifiers as mt } from "vue";
2
2
  const k = (e, a) => {
3
3
  const t = e.__vccOpts || e;
4
4
  for (const [r, s] of a)
@@ -48,7 +48,7 @@ function pt(e, a, t, r, s, i) {
48
48
  }
49
49
  const yt = /* @__PURE__ */ k(ht, [["render", pt]]);
50
50
  /*!
51
- * iamKey v3.7.8--beta
51
+ * iamKey v3.7.8--beta-2
52
52
  * Copyright 2022-2023 iamproperty
53
53
  */
54
54
  const gt = function(e) {
@@ -163,14 +163,14 @@ const Q = (e) => {
163
163
  }
164
164
  at(e, a, t, r);
165
165
  } else
166
- a.hasAttribute("data-submit") ? a.submit() : (j(e, a, r), F(r, t), O(e, a));
166
+ a.hasAttribute("data-submit") ? a.submit() : (G(e, a, r), F(r, t), j(e, a));
167
167
  };
168
168
  a.addEventListener("keyup", (l) => {
169
169
  clearTimeout(i), l && l.target instanceof HTMLElement && l.target.closest("[data-search]") && (i = setTimeout(function() {
170
170
  o();
171
171
  }, 500));
172
172
  }), a.addEventListener("change", (l) => {
173
- clearTimeout(i), l && l.target instanceof HTMLElement && l.target.closest("[data-sort]") && (a.hasAttribute("data-submit") || J(e, a, s), o()), l && l.target instanceof HTMLElement && l.target.closest("[data-search]") && o(), l && l.target instanceof HTMLElement && l.target.closest("[data-filter][data-no-ajax]") ? (j(e, a, r), F(r, t), O(e, a)) : (l && l.target instanceof HTMLElement && l.target.closest("[data-filter]") && l.target.closest("form .dialog__wrapper > dialog") || l && l.target instanceof HTMLElement && l.target.closest("[data-filter]") && !l.target.closest("form dialog")) && o(), l && l.target instanceof HTMLElement && l.target.closest("[data-show]") && o(), l && l.target instanceof HTMLElement && l.target.closest("[data-mimic]") && o();
173
+ clearTimeout(i), l && l.target instanceof HTMLElement && l.target.closest("[data-sort]") && (a.hasAttribute("data-submit") || J(e, a, s), o()), l && l.target instanceof HTMLElement && l.target.closest("[data-search]") && o(), l && l.target instanceof HTMLElement && l.target.closest("[data-filter][data-no-ajax]") ? (G(e, a, r), F(r, t), j(e, a)) : (l && l.target instanceof HTMLElement && l.target.closest("[data-filter]") && l.target.closest("form .dialog__wrapper > dialog") || l && l.target instanceof HTMLElement && l.target.closest("[data-filter]") && !l.target.closest("form dialog")) && o(), l && l.target instanceof HTMLElement && l.target.closest("[data-show]") && o(), l && l.target instanceof HTMLElement && l.target.closest("[data-mimic]") && o();
174
174
  }), a.addEventListener("click", (l) => {
175
175
  clearTimeout(i), l && l.target instanceof HTMLElement && l.target.closest('dialog button:not([type="button"])') && l.target.closest('dialog button:not([type="button"])').closest("dialog").close(), l && l.target instanceof HTMLElement && l.target.closest(".dialog__close") && (l.preventDefault(), l.stopPropagation()), l && l.target instanceof HTMLElement && l.target.closest("[data-clear]") && (a.reset(), a.hasAttribute("data-submit") || J(e, a, s), o());
176
176
  }), a.addEventListener("submit", (l) => {
@@ -228,7 +228,7 @@ const Q = (e) => {
228
228
  h.forEach((b, y) => {
229
229
  f += b.row.outerHTML;
230
230
  }), r.innerHTML = f;
231
- }, j = (e, a, t) => {
231
+ }, G = (e, a, t) => {
232
232
  e.classList.remove("table--filtered");
233
233
  let r = [], s = [], i = 0, o = a.querySelector("[data-pagination]") ? parseInt(a.querySelector("[data-pagination]").value) : 1, c = a.querySelector("[data-show]") ? parseInt(a.querySelector("[data-show]").value) : 15;
234
234
  if (Array.from(e.querySelectorAll("tbody tr")).forEach((n, l) => {
@@ -295,7 +295,7 @@ const Q = (e) => {
295
295
  }), Array.from(e.querySelectorAll("tbody tr:not(.filtered")).forEach((n, l) => {
296
296
  i++, n.classList.add("filtered--matched"), Math.ceil(i / c) == parseInt(o) && n.classList.add("filtered--show");
297
297
  }), t && (t.setAttribute("data-page", o), t.setAttribute("data-pages", Math.ceil(i / c)), t.setAttribute("data-total", i), t.setAttribute("data-show", c));
298
- }, O = (e, a, t) => {
298
+ }, j = (e, a, t) => {
299
299
  Array.from(a.querySelectorAll("[data-query]")).forEach((r, s) => {
300
300
  let i = r.getAttribute("data-query"), o;
301
301
  if (i == "total")
@@ -363,7 +363,7 @@ const Q = (e) => {
363
363
  var l = window.URL.createObjectURL(c);
364
364
  n.href = l, n.style.display = "none", document.body.appendChild(n), n.click(), document.body.removeChild(n);
365
365
  }, et = function(e, a, t, r) {
366
- if (Q(e), kt(e), O(e, a, r), r && r.classList.contains("table--cta")) {
366
+ if (Q(e), kt(e), j(e, a, r), r && r.classList.contains("table--cta")) {
367
367
  let s = function() {
368
368
  Array.from(e.querySelectorAll("tr")).forEach((o, c) => {
369
369
  let n = o.offsetHeight;
@@ -388,28 +388,28 @@ const Q = (e) => {
388
388
  let E = "";
389
389
  var D = document.createElement("td");
390
390
  if (D.setAttribute("data-label", v.innerText), v.getAttribute("data-output")) {
391
- var U = v.getAttribute("data-output");
392
- E = U.replace(new RegExp(/{(.*?)}/, "gm"), function(it) {
391
+ var V = v.getAttribute("data-output");
392
+ E = V.replace(new RegExp(/{(.*?)}/, "gm"), function(it) {
393
393
  return s(C, it.replace("{", "").replace("}", ""));
394
394
  });
395
395
  }
396
396
  if (v.hasAttribute("data-output-array")) {
397
- var U = v.getAttribute("data-output");
398
- let st = s(C, U.replace("{", "").replace("}", ""));
397
+ var V = v.getAttribute("data-output");
398
+ let st = s(C, V.replace("{", "").replace("}", ""));
399
399
  E = "", st.forEach((Z, no) => {
400
400
  let nt = v.getAttribute("data-output-array"), B = "";
401
401
  if (v.hasAttribute("data-output-array-property") && v.hasAttribute("data-output-array-transform")) {
402
- const W = s(Z, v.getAttribute("data-output-array-property")), lt = JSON.parse(v.getAttribute("data-output-array-transform"))[W];
402
+ const U = s(Z, v.getAttribute("data-output-array-property")), lt = JSON.parse(v.getAttribute("data-output-array-transform"))[U];
403
403
  B = nt.replace(`{${v.getAttribute("data-output-array-property")}}`, lt);
404
404
  }
405
- B = B.replace(new RegExp(/{(.*?)}/, "gm"), function(W) {
406
- return s(Z, W.replace("{", "").replace("}", ""));
405
+ B = B.replace(new RegExp(/{(.*?)}/, "gm"), function(U) {
406
+ return s(Z, U.replace("{", "").replace("}", ""));
407
407
  }), E += B;
408
408
  });
409
409
  }
410
410
  v.hasAttribute("data-transform") && (E = JSON.parse(v.getAttribute("data-transform"))[E], !E && v.hasAttribute("data-default") && (E = v.getAttribute("data-default"))), D.innerHTML = E, q.appendChild(D);
411
411
  }), n.appendChild(q);
412
- }), tt(e, a), r.setAttribute("data-total", parseInt(w)), r.setAttribute("data-page", parseInt(I)), r.setAttribute("data-pages", Math.ceil(r.getAttribute("data-total") / r.getAttribute("data-show"))), j(e, a, r), et(e, a, t, r), F(r, t), parseInt(w) == 0 && (n.innerHTML = `<tr><td colspan="100%"><span>${P}</span></td></tr>`), r.classList.remove("table--loading"), window.dataLayer = window.dataLayer || [], window.dataLayer.push({ event: "Ajax table loaded", url: l, formData: o })) : n.innerHTML = '<tr><td colspan="100%"><span>Error loading table</span></td></tr>', a.hasAttribute("data-ajax-post")) {
412
+ }), tt(e, a), r.setAttribute("data-total", parseInt(w)), r.setAttribute("data-page", parseInt(I)), r.setAttribute("data-pages", Math.ceil(r.getAttribute("data-total") / r.getAttribute("data-show"))), et(e, a, t, r), F(r, t), parseInt(w) == 0 && (n.innerHTML = `<tr><td colspan="100%"><span>${P}</span></td></tr>`), r.classList.remove("table--loading"), window.dataLayer = window.dataLayer || [], window.dataLayer.push({ event: "Ajax table loaded", url: l, formData: o })) : n.innerHTML = '<tr><td colspan="100%"><span>Error loading table</span></td></tr>', a.hasAttribute("data-ajax-post")) {
413
413
  const C = new XMLHttpRequest();
414
414
  C.open("GET", `${window.location.href}?ajax=true&${o}`), C.send();
415
415
  }
@@ -460,7 +460,7 @@ class Et extends HTMLElement {
460
460
  const a = new URLSearchParams(window.location.search);
461
461
  this.hasAttribute("data-total") || this.setAttribute("data-total", this.querySelectorAll("table tbody tr").length), this.hasAttribute("data-page") || this.setAttribute("data-page", a.has("page") ? a.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")));
462
462
  let t = this.classList.toString();
463
- t = t.replace("table--cta", ""), t = t.replace("table--loading", ""), this.shadowRoot.querySelector(".table__wrapper").className += ` ${t}`, 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(`#${this.getAttribute("data-filterby")}`) : this.table.parentNode.insertBefore(this.form, this.table.nextSibling), this.form.hasAttribute("data-ajax") && this.table.classList.add("table--ajax"), tt(this.table, this.form), this.form.querySelector("[data-page]") || (this.form.innerHTML += `<input name="page" type="hidden" value="${this.getAttribute("data-page")}" data-pagination="true" />`), this.form.querySelector("[data-show]") || (this.form.innerHTML += `<input name="show" type="hidden" value="${this.getAttribute("data-show")}" data-show="true" />`), St(this.table), Lt(this.table, this.form, this.pagination, this, this.savedTableBody), xt(this.table, this.form, this.pagination, this), qt(this.shadowRoot.querySelector("[data-export]"), this.table), this.form.getAttribute("data-ajax") ? at(this.table, this.form, this.pagination, this) : (et(this.table, this.form, this.pagination, this), j(this.table, this.form, this), F(this, this.pagination), O(this.table, this.form)), this.shadowRoot.querySelector(".table__wrapper").addEventListener("scroll", (r) => {
463
+ t = t.replace("table--cta", ""), t = t.replace("table--loading", ""), this.shadowRoot.querySelector(".table__wrapper").className += ` ${t}`, 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(`#${this.getAttribute("data-filterby")}`) : this.table.parentNode.insertBefore(this.form, this.table.nextSibling), this.form.hasAttribute("data-ajax") && this.table.classList.add("table--ajax"), tt(this.table, this.form), this.form.querySelector("[data-page]") || (this.form.innerHTML += `<input name="page" type="hidden" value="${this.getAttribute("data-page")}" data-pagination="true" />`), this.form.querySelector("[data-show]") || (this.form.innerHTML += `<input name="show" type="hidden" value="${this.getAttribute("data-show")}" data-show="true" />`), St(this.table), Lt(this.table, this.form, this.pagination, this, this.savedTableBody), xt(this.table, this.form, this.pagination, this), qt(this.shadowRoot.querySelector("[data-export]"), this.table), this.form.getAttribute("data-ajax") ? at(this.table, this.form, this.pagination, this) : (et(this.table, this.form, this.pagination, this), G(this.table, this.form, this), F(this, this.pagination), j(this.table, this.form)), this.shadowRoot.querySelector(".table__wrapper").addEventListener("scroll", (r) => {
464
464
  this.table.querySelector("dialog[open]") && (this.table.querySelector("dialog[open]").close(), this.table.querySelector(".dialog__wrapper > button.active").classList.remove("active"));
465
465
  });
466
466
  }
@@ -752,7 +752,7 @@ function ne(e, a, t, r, s, i) {
752
752
  }, e.$attrs, {
753
753
  onKeyup: a[1] || (a[1] = (...o) => i.inputKeyup && i.inputKeyup(...o))
754
754
  }), null, 16, Vt)), [
755
- [G, i.inputVal]
755
+ [W, i.inputVal]
756
756
  ]) : g("", !0),
757
757
  t.type == "textarea" ? z((u(), m("textarea", H({
758
758
  key: 4,
@@ -775,7 +775,7 @@ function ne(e, a, t, r, s, i) {
775
775
  pattern: i.needPattern(),
776
776
  list: i.hasOptions()
777
777
  }, e.$attrs, { oninput: "this.nextElementSibling.value=this.value;" }), null, 16, Gt), [
778
- [G, i.inputVal]
778
+ [W, i.inputVal]
779
779
  ]),
780
780
  d("output", Kt, $(t.value), 1)
781
781
  ])) : g("", !0),
@@ -789,7 +789,7 @@ function ne(e, a, t, r, s, i) {
789
789
  pattern: i.needPattern(),
790
790
  list: i.hasOptions()
791
791
  }, e.$attrs, { oninput: "this.nextElementSibling.value=this.value;" }), null, 16, Zt), [
792
- [G, i.inputVal]
792
+ [W, i.inputVal]
793
793
  ]),
794
794
  d("output", Jt, $(t.value ? e.vale : "#000000"), 1)
795
795
  ])) : g("", !0),
@@ -854,9 +854,9 @@ function ne(e, a, t, r, s, i) {
854
854
  ], 8, ie)) : g("", !0)
855
855
  ], 2);
856
856
  }
857
- const V = /* @__PURE__ */ k(Bt, [["render", ne]]), le = {
857
+ const O = /* @__PURE__ */ k(Bt, [["render", ne]]), le = {
858
858
  components: {
859
- Input: V
859
+ Input: O
860
860
  },
861
861
  name: "FileUploads",
862
862
  props: {
@@ -917,7 +917,7 @@ function fe(e, a, t, r, s, i) {
917
917
  }
918
918
  const co = /* @__PURE__ */ k(le, [["render", fe]]);
919
919
  /*!
920
- * iamKey v3.7.8--beta
920
+ * iamKey v3.7.8--beta-2
921
921
  * Copyright 2022-2023 iamproperty
922
922
  */
923
923
  function be(e) {
@@ -1066,7 +1066,7 @@ function Me(e, a, t, r, s, i) {
1066
1066
  }
1067
1067
  const fo = /* @__PURE__ */ k(Se, [["render", Me]]);
1068
1068
  /*!
1069
- * iamKey v3.7.8--beta
1069
+ * iamKey v3.7.8--beta-2
1070
1070
  * Copyright 2022-2023 iamproperty
1071
1071
  */
1072
1072
  window.dataLayer = window.dataLayer || [], window.dataLayer.push({ event: "customElementRegistered", element: "Card" });
@@ -1340,7 +1340,7 @@ function We(e, a, t, r, s, i) {
1340
1340
  }
1341
1341
  const po = /* @__PURE__ */ k(ze, [["render", We]]);
1342
1342
  /*!
1343
- * iamKey v3.7.8--beta
1343
+ * iamKey v3.7.8--beta-2
1344
1344
  * Copyright 2022-2023 iamproperty
1345
1345
  */
1346
1346
  window.dataLayer = window.dataLayer || [], window.dataLayer.push({ event: "customElementRegistered", element: "header" });
@@ -1512,7 +1512,7 @@ function ha(e, a, t, r, s, i) {
1512
1512
  const go = /* @__PURE__ */ k(Qe, [["render", ha]]);
1513
1513
  const fa = {
1514
1514
  components: {
1515
- Input: V
1515
+ Input: O
1516
1516
  },
1517
1517
  name: "PropertySearchbar",
1518
1518
  props: {
@@ -1773,7 +1773,7 @@ const _o = /* @__PURE__ */ k(fa, [["render", qa]]), $a = (e) => {
1773
1773
  };
1774
1774
  const Ea = {
1775
1775
  components: {
1776
- Input: V,
1776
+ Input: O,
1777
1777
  Logo: yt
1778
1778
  },
1779
1779
  name: "Nav",
@@ -2118,7 +2118,7 @@ function qr(e, a, t, r, s, i) {
2118
2118
  }
2119
2119
  const Ao = /* @__PURE__ */ k(Sr, [["render", qr]]);
2120
2120
  /*!
2121
- * iamKey v3.7.8--beta
2121
+ * iamKey v3.7.8--beta-2
2122
2122
  * Copyright 2022-2023 iamproperty
2123
2123
  */
2124
2124
  const $r = function(e) {
@@ -2228,7 +2228,7 @@ ot.fields.required = !1;
2228
2228
  const Br = {
2229
2229
  components: {
2230
2230
  Table: rt,
2231
- Input: V
2231
+ Input: O
2232
2232
  },
2233
2233
  data() {
2234
2234
  return {
@@ -2307,7 +2307,7 @@ function Wr(e, a, t, r, s, i) {
2307
2307
  }
2308
2308
  const Lo = /* @__PURE__ */ k(Br, [["render", Wr]]);
2309
2309
  /*!
2310
- * iamKey v3.7.8--beta
2310
+ * iamKey v3.7.8--beta-2
2311
2311
  * Copyright 2022-2023 iamproperty
2312
2312
  */
2313
2313
  function Gr(e, a) {
@@ -2399,7 +2399,7 @@ function Zr(e, a, t, r, s, i) {
2399
2399
  }
2400
2400
  const xo = /* @__PURE__ */ k(Yr, [["render", Zr]]);
2401
2401
  /*!
2402
- * iamKey v3.7.8--beta
2402
+ * iamKey v3.7.8--beta-2
2403
2403
  * Copyright 2022-2023 iamproperty
2404
2404
  */
2405
2405
  function Jr(e, a) {
@@ -2575,7 +2575,7 @@ export {
2575
2575
  co as FileUploads,
2576
2576
  qo as Filterlist,
2577
2577
  yo as Header,
2578
- V as Input,
2578
+ O as Input,
2579
2579
  yt as Logo,
2580
2580
  vo as Nav,
2581
2581
  Lo as NoteFeed,
@@ -1,5 +1,5 @@
1
1
  (function(b,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(b=typeof globalThis<"u"?globalThis:b||self,e(b.iamkey={},b.Vue))})(this,function(b,e){"use strict";const _=(a,o)=>{const t=a.__vccOpts||a;for(const[r,s]of o)t[r]=s;return t},Y={name:"Logo",props:{id:{type:String,required:!1,default:"property"},path:{type:String,required:!1,default:"/svg/logo.svg"},desc:{type:String}},computed:{src:function(){return"#logo-"+this.id},className:function(){return"brand brand--"+this.id}}},Z=["xlink:href"],J=["innerHTML"];function X(a,o,t,r,s,i){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(i.className)},[(e.openBlock(),e.createElementBlock("svg",null,[e.createElementVNode("title",null,"iam "+e.toDisplayString(t.id),1),e.createElementVNode("use",{"xlink:href":t.path+i.src},null,8,Z)])),t.desc?(e.openBlock(),e.createElementBlock("span",{key:0,innerHTML:t.desc},null,8,J)):e.createCommentVNode("",!0)],2)}const R=_(Y,[["render",X]]);/*!
2
- * iamKey v3.7.8--beta
2
+ * iamKey v3.7.8--beta-2
3
3
  * Copyright 2022-2023 iamproperty
4
4
  */const Q=function(a){return typeof a!="string"?!1:!isNaN(a)&&!isNaN(parseFloat(a))},ee=(a,o)=>String(a).padStart(o,"0"),te=a=>a.charAt(0).toUpperCase()+a.slice(1),x=function(a,o){if(!a.getAttribute("data-pages"))return!1;a.getAttribute("data-page")||a.setAttribute("data-page",1);let t=a.getAttribute("data-page"),r=a.getAttribute("data-pages"),s=a.getAttribute("data-total"),i=a.getAttribute("data-show"),n=a.getAttribute("data-increment");if(r<=1)return o.innerHTML="",!1;let d="";for(let l=1;l<=r;l++)l==t?d+=`<li class="page-item active" aria-current="page"><span class="page-link">${l}</span></li>`:d+=`<li class="page-item"><a href="?page=${l}" class="page-link" data-page="${l}">${l}</a></li>`;return o.innerHTML=`<ul class="pagination mb-0 d-none d-sm-flex">
5
5
  ${t==1?'<li class="page-item disabled"><span class="page-link">Previous</span></li>':`<li class="page-item"><a href="?page=${parseInt(t)-1}" class="page-link" data-page="${parseInt(t)-1}">Previous</a></li>`}
@@ -8,8 +8,8 @@
8
8
  </ul>`,o.innerHTML+=`<div class="d-sm-none text-center">
9
9
  <span class="d-block pb-2">You've viewed ${i} of ${s} results</span>
10
10
  <a href="?show=${parseInt(i)+parseInt(n)}" class="btn btn-primary w-100 m-0" data-show="${parseInt(i)+parseInt(n)}">Load more results</a>
11
- </div>`,!0};var ae=function(a,o,t,r){function s(i){return i instanceof t?i:new t(function(n){n(i)})}return new(t||(t=Promise))(function(i,n){function d(m){try{c(r.next(m))}catch(u){n(u)}}function l(m){try{c(r.throw(m))}catch(u){n(u)}}function c(m){m.done?i(m.value):s(m.value).then(d,l)}c((r=r.apply(a,o||[])).next())})};const P=a=>{const o=Array.from(a.querySelectorAll("thead th"));Array.from(a.querySelectorAll("tbody tr")).forEach((t,r)=>{const s=Array.from(t.querySelectorAll("th, td")),i=["0","low","medium","high","unknown","n/a","pending","verified","due","overdue","incomplete","complete","completed","approval required","upcoming","requires approval","to do","on track","not started","warning","error"];s.forEach((n,d)=>{const l=o[d];if(typeof l<"u"){let c=document.createElement("div");c.innerHTML=l.innerHTML;let m=c.textContent||c.innerText||"";n.setAttribute("data-label",m),l.hasAttribute("data-td-class")&&n.setAttribute("class",l.getAttribute("data-td-class")),l.hasAttribute("data-format")&&(n.setAttribute("data-format",l.getAttribute("data-format")),n.innerHTML=T(l.getAttribute("data-format"),n.textContent.trim())),i.includes(n.textContent.trim().toLowerCase())&&n.setAttribute("data-content",n.textContent.trim().toLowerCase())}})})},oe=a=>{let o=0;return Array.from(a.querySelectorAll("tbody tr")).forEach((t,r)=>{let s=window.getComputedStyle(document.querySelector("html")),i=t.querySelector(":scope > *:last-child > *:first-child");if(i){i.classList.add("text-nowrap");let n=i.offsetWidth/parseFloat(s.fontSize);n+=1.7,o=o>n?o:n}}),o},re=a=>{if(a.closest(".table--fullwidth")||a.querySelectorAll("thead tr th").length<4)return!1;Array.from(a.querySelectorAll("tbody tr")).forEach((o,t)=>{let r=o.querySelector(":scope > :is(td,th):first-child"),s=r.textContent;if(s!="")r.innerHTML=`<span class="td__content">${s}</span><button type="button" class="d-none">${s}</button>`;else{let i=o.querySelector(":scope > :is(td,th):nth-child(2)"),n=i.textContent;i.innerHTML=`<span class="td__content">${n}</span><button type="button" class="d-none">${n}</button>`}})},ne=a=>{a.addEventListener("click",o=>{if(o&&o.target instanceof HTMLElement&&o.target.closest("tr > :is(td,th):first-child button")){let t=o.target.closest("tr > :is(td,th):first-child button"),r=t.parentNode.closest("tr");r.getAttribute("data-view")=="full"?r.setAttribute("data-view","default"):r.setAttribute("data-view","full"),t.blur()}})},I=(a,o)=>{let t=o.querySelector("[data-search]");if(!t)return!1;const r=t.getAttribute("id"),s=t.getAttribute("data-search").split(",");let i=t.parentNode,n={};s.forEach((d,l)=>{Array.from(a.querySelectorAll('td[data-label="'+d.trim()+'"]')).forEach((c,m)=>{c.querySelector(".td__content")?n[c.querySelector(".td__content").textContent]=c.querySelector(".td__content").textContent:n[c.textContent]=c.textContent})}),t.setAttribute("list",`${r}_list`),t.setAttribute("autocomplete","off"),i.querySelector("datalist")||(i.innerHTML+=`<datalist id="${r}_list"></datalist>`),i.querySelector("datalist").innerHTML=`${Object.keys(n).map(d=>`<option value="${d}"></option>`).join("")}`},ie=(a,o,t,r,s)=>{var i;let n=function(c=!1){if(o.hasAttribute("data-ajax")){if(!c){let m=o.querySelector("[data-pagination]");m.value=1,r.setAttribute("data-page",1)}O(a,o,t,r)}else o.hasAttribute("data-submit")?o.submit():(v(a,o,r),x(r,t),N(a,o))};o.addEventListener("keyup",c=>{clearTimeout(i),c&&c.target instanceof HTMLElement&&c.target.closest("[data-search]")&&(i=setTimeout(function(){n()},500))}),o.addEventListener("change",c=>{clearTimeout(i),c&&c.target instanceof HTMLElement&&c.target.closest("[data-sort]")&&(o.hasAttribute("data-submit")||F(a,o,s),n()),c&&c.target instanceof HTMLElement&&c.target.closest("[data-search]")&&n(),c&&c.target instanceof HTMLElement&&c.target.closest("[data-filter][data-no-ajax]")?(v(a,o,r),x(r,t),N(a,o)):(c&&c.target instanceof HTMLElement&&c.target.closest("[data-filter]")&&c.target.closest("form .dialog__wrapper > dialog")||c&&c.target instanceof HTMLElement&&c.target.closest("[data-filter]")&&!c.target.closest("form dialog"))&&n(),c&&c.target instanceof HTMLElement&&c.target.closest("[data-show]")&&n(),c&&c.target instanceof HTMLElement&&c.target.closest("[data-mimic]")&&n()}),o.addEventListener("click",c=>{clearTimeout(i),c&&c.target instanceof HTMLElement&&c.target.closest('dialog button:not([type="button"])')&&c.target.closest('dialog button:not([type="button"])').closest("dialog").close(),c&&c.target instanceof HTMLElement&&c.target.closest(".dialog__close")&&(c.preventDefault(),c.stopPropagation()),c&&c.target instanceof HTMLElement&&c.target.closest("[data-clear]")&&(o.reset(),o.hasAttribute("data-submit")||F(a,o,s),n())}),o.addEventListener("submit",c=>{clearTimeout(i),o.hasAttribute("data-submit")||c.preventDefault(),n()}),o.addEventListener("force",c=>{n()}),o.addEventListener("paginate",c=>{n(!0)});let d=[],l=[];Array.from(o.querySelectorAll("[data-mimic]")).forEach((c,m)=>{let u=c.getAttribute("data-mimic");Array.from(document.querySelectorAll(`[name="${u}"]`)).forEach((h,f)=>{let p=h.closest("form");d.includes(p)||d.push(p),l.includes(u)||l.push(u)})}),d.forEach((c,m)=>{const u=function(){let h=[],f=new FormData(c);for(const[p,g]of f)document.querySelector(`[data-mimic="${p}"]`)&&!h.includes(p)?(h.push(p),document.querySelector(`[data-mimic="${p}"]`).value=g):document.querySelector(`[data-mimic="${p}"]`)&&(document.querySelector(`[data-mimic="${p}"]`).value+=","+g);for(const p of h){const g=new Event("force");o.dispatchEvent(g)}for(const p of l)if(!f.has(p)&&c.querySelector(`[name="${p}"]`)){document.querySelector(`[data-mimic="${p}"]`).value="";const g=new Event("force");o.dispatchEvent(g)}};c.addEventListener("force",h=>{u()}),c.addEventListener("change",h=>{u()})})},F=(a,o,t)=>{if(o.getAttribute("data-ajax"))return!1;let r=a.querySelector("tbody"),s=o.querySelector("[data-sort]"),i=s.querySelector(`option:nth-child(${s.selectedIndex+1})`),n=i.getAttribute("data-sort"),d=i.getAttribute("data-order"),l=i.getAttribute("data-format");if(!n)return r.innerHTML=t.innerHTML,P(a),!1;let c=[];["asc","desc","descending"].includes(d)||(c=d.split(","));let m=[];Array.from(r.querySelectorAll("tr")).forEach((h,f)=>{let p=h.querySelector('td[data-label="'+n+'"], th[data-label="'+n+'"]').textContent.trim();h.querySelector('[data-label="'+n+'"] .td__content')&&(p=h.querySelector('[data-label="'+n+'"] .td__content').textContent.trim()),c.length&&c.includes(p)&&(p=c.indexOf(p)),Q(p)&&(p=ee(p,10)),l&&l=="date"&&(p=new Date(p));const g={index:p,row:h};m.push(g)}),m.sort((h,f)=>h.index>f.index?1:-1),(d=="descending"||d=="desc")&&(m=m.reverse());let u="";m.forEach((h,f)=>{u+=h.row.outerHTML}),r.innerHTML=u},v=(a,o,t)=>{a.classList.remove("table--filtered");let r=[],s=[],i=0,n=o.querySelector("[data-pagination]")?parseInt(o.querySelector("[data-pagination]").value):1,d=o.querySelector("[data-show]")?parseInt(o.querySelector("[data-show]").value):15;if(Array.from(a.querySelectorAll("tbody tr")).forEach((l,c)=>{l.classList.remove("filtered"),l.classList.remove("filtered--matched"),l.classList.remove("filtered--show"),l.removeAttribute("data-filtered-by")}),Array.from(o.querySelectorAll("[data-filter]")).forEach((l,c)=>{if(!(l.type=="radio"&&!l.checked)&&!(l.type=="checkbox"&&!l.checked)){if(l.getAttribute("data-filter")=="multi")for(const[m,u]of Object.entries(JSON.parse(l.value)))r[l.getAttribute("data-filter")].push(u);else if(l&&l.value){let m=l.getAttribute("data-filter");r[m]||(r[m]=new Array),r[m].push(l.value)}}}),o.querySelector("[data-search]")){let l=o.querySelector("[data-search]");o.querySelector("[data-search]").getAttribute("data-search").split(",").forEach((c,m)=>{s.push({column:`${c.trim()}`,value:`${l.value}`})})}Array.from(o.querySelectorAll("[data-filter-count]")).forEach((l,c)=>{l.innerHTML=""}),r.length&&Array.from(o.querySelectorAll("[data-filter-count]")).forEach((l,c)=>{l.innerHTML+=`(${r.length})`}),a.classList.add("table--filtered");for(const[l,c]of Object.entries(r))Array.from(a.querySelectorAll("tbody tr:not(.filtered)")).forEach((m,u)=>{let h=!1;c.forEach((f,p)=>{let g=m.querySelector(`[data-label="${l}"]`);if(f&&f=="$today")f=T("date",new Date);else if(f&&f=="$yesterday"){let k=new Date;k.setDate(k.getDate()-1),f=T("date",k)}else if(f&&(f=="$thisWeek"||f=="$lastWeek")){let k=new Date,A=new Date(k.setDate(k.getDate()-(k.getDay()-1))),y=new Date(k.setDate(k.getDate()-k.getDay()+7)),w=new Date(g.textContent.toLowerCase());if(k.setHours(0,0,0,0),A.setHours(0,0,0,0),y.setHours(0,0,0,0),w.setHours(0,0,0,0),f=="$thisWeek")h=w>=A&&w<=y;else{let S=new Date(A.setDate(A.getDate()-7)),L=new Date(y.setDate(y.getDate()-7));S.setHours(0,0,0,0),L.setHours(0,0,0,0),h=w>=S&&w<=L}}else if(f&&f=="$thisMonth"){let k=new Date,A=k.getFullYear(),y=k.getMonth();var B=new Date(A,y,1),$=new Date(A,y+1,0);let w=new Date(g.textContent.toLowerCase());B.setHours(0,0,0,0),$.setHours(0,0,0,0),w.setHours(0,0,0,0),h=w>=B&&w<=$}else if(f&&f=="$lastMonth"){let k=new Date,A=k.getFullYear(),y=k.getMonth();var C=new Date(A,y-1,1),E=new Date(A,y,0);let w=new Date(g.textContent.toLowerCase());C.setHours(0,0,0,0),E.setHours(0,0,0,0),w.setHours(0,0,0,0),h=w>=C&&w<=E}g&&g.textContent.toLowerCase().includes(f.toLowerCase())&&(h=!0)}),h||(m.classList.add("filtered"),m.setAttribute("data-filtered-by",l))});Array.from(a.querySelectorAll("tbody tr:not(.filtered)")).forEach((l,c)=>{let m=!(s.length>0&&s[0].value.length>=3);s.forEach((u,h)=>{let f=l.querySelector(`[data-label="${u.column}"]`);f&&u.value.length>=3&&f.textContent.toLowerCase().includes(u.value.toLowerCase())&&(m=!0)}),m||l.classList.add("filtered")}),Array.from(a.querySelectorAll("tbody tr:not(.filtered")).forEach((l,c)=>{i++,l.classList.add("filtered--matched"),Math.ceil(i/d)==parseInt(n)&&l.classList.add("filtered--show")}),t&&(t.setAttribute("data-page",n),t.setAttribute("data-pages",Math.ceil(i/d)),t.setAttribute("data-total",i),t.setAttribute("data-show",d))},N=(a,o,t)=>{Array.from(o.querySelectorAll("[data-query]")).forEach((r,s)=>{let i=r.getAttribute("data-query"),n;if(i=="total")t.hasAttribute("data-total")?n=t.getAttribute("data-total"):n=(a.classList.contains("table--filtered"),a.querySelectorAll("tbody tr").length);else if(!i.includes(" == ")&&i.includes(" & ")){let d=i.split(" & "),l="";d.forEach(c=>{l+=`:not([data-filtered-by="${c}"])`}),n=Array.from(a.querySelectorAll(`tbody tr${l}`)).length}else if(!i.includes(" == "))n=Array.from(a.querySelectorAll(`tbody tr:not([data-filtered-by="${i}"])`)).length;else if(i.includes(" && ")){let d=i.split(" && ");n=Array.from(a.querySelectorAll("tbody tr:not(.filtered)")).filter(function(l){let c=!0;for(const[m,u]of Object.entries(d)){let h=u.split(" == ");(!l.querySelector(`td[data-label="${h[0]}"]`)||l.querySelector(`td[data-label="${h[0]}"]`).textContent!=`${h[1]}`)&&(c=!1)}return c}).length}else{let d=i.split(" == ");n=Array.from(a.querySelectorAll(`tbody tr.filtered--matched td[data-label="${d[0]}"], tbody tr[data-filtered-by="${d[0]}"] td[data-label="${d[0]}"]`)).filter(function(l){return l.textContent===d[1]}).length}r.hasAttribute("data-total")?r.setAttribute("data-total",n):r.innerHTML=n})},se=function(a,o,t,r){t.addEventListener("click",s=>{if(s&&s.target instanceof HTMLElement&&s.target.closest("[data-page]")){s.preventDefault();let i=o.querySelector("[data-pagination]"),n=s.target.closest("[data-page]").getAttribute("data-page");if(i.value=n,r.setAttribute("data-page",n),o.dispatchEvent(new Event("paginate")),a.hasAttribute("data-show-history")){const c=new URL(location);c.searchParams.set("page",n),history.pushState({type:"pagination",form:o.getAttribute("id"),page:n},"",c)}const d=-250,l=a.getBoundingClientRect().top+window.pageYOffset+d;window.scrollTo({top:l,behavior:"smooth"})}if(s&&s.target instanceof HTMLElement&&s.target.closest("[data-show]")){s.preventDefault();let i=o.querySelector("[data-show]"),n=s.target.closest("[data-show]").getAttribute("data-show");i.value=n,r.setAttribute("data-show",n),o.dispatchEvent(new Event("submit"))}})},le=(a,o)=>{if(!a)return!1;a.addEventListener("click",t=>{ce(o)})},ce=function(a){for(var o=[],t=a.getElementsByTagName("tr"),r=0;r<t.length;r++){for(var s=t[r].querySelectorAll("td,th"),i=[],n=0;n<s.length;n++)i.push(`"${s[n].textContent}"`);o.push(i.join(","))}o=o.join(`
12
- `);let d=new Blob([o],{type:"text/csv"});var l=document.createElement("a");l.download="export.csv";var c=window.URL.createObjectURL(d);l.href=c,l.style.display="none",document.body.appendChild(l),l.click(),document.body.removeChild(l)},j=function(a,o,t,r){if(P(a),re(a),N(a,o,r),r&&r.classList.contains("table--cta")){let s=function(){Array.from(a.querySelectorAll("tr")).forEach((n,d)=>{let l=n.offsetHeight;n.style.setProperty("--row-height",`${l}px`)})};const i=oe(a);r.style.setProperty("--cta-width",`${i}rem`),new ResizeObserver(s).observe(a)}},O=function(a,o,t,r){return ae(this,void 0,void 0,function*(){const s=(u,h,f)=>h.split(/[\.\[\]\'\"]/).filter(p=>p).reduce((p,g)=>p?p[g]:f,u);let i=new FormData(o),n=new URLSearchParams(i).toString(),d=a.querySelectorAll("thead tr th"),l=a.querySelector("tbody"),c=o.getAttribute("data-ajax");r.classList.add("table--loading"),window.controller||(window.controller=[]),window.controller[c]&&window.controller[c].abort(),window.controller[c]=new AbortController;const{signal:m}=controller[c];try{yield fetch(c+"?"+n,{signal:m,method:"get",credentials:"same-origin",headers:new Headers({"Content-Type":"application/json",Accept:"application/json","X-Requested-With":"XMLHttpRequest"})}).then(u=>u.json()).then(u=>{let h=o.hasAttribute("data-schema")?o.getAttribute("data-schema"):"data",f=o.hasAttribute("data-schema-total")?o.getAttribute("data-schema-total"):"meta.total",p=o.hasAttribute("data-schema-page")?o.getAttribute("data-schema-page"):"meta.current_page",g=s(u,f,1),B=s(u,p,1),$=s(u,h),C=r.hasAttribute("data-empty-msg")?r.getAttribute("data-empty-msg"):"No results found";if($?(l.innerHTML="",$.forEach((E,k)=>{var A=document.createElement("tr");d.forEach((y,w)=>{let S="";var L=document.createElement("td");if(L.setAttribute("data-label",y.innerText),y.getAttribute("data-output")){var D=y.getAttribute("data-output");S=D.replace(new RegExp(/{(.*?)}/,"gm"),function(or){return s(E,or.replace("{","").replace("}",""))})}if(y.hasAttribute("data-output-array")){var D=y.getAttribute("data-output");let rr=s(E,D.replace("{","").replace("}",""));S="",rr.forEach((K,br)=>{let nr=y.getAttribute("data-output-array"),V="";if(y.hasAttribute("data-output-array-property")&&y.hasAttribute("data-output-array-transform")){const z=s(K,y.getAttribute("data-output-array-property")),ir=JSON.parse(y.getAttribute("data-output-array-transform"))[z];V=nr.replace(`{${y.getAttribute("data-output-array-property")}}`,ir)}V=V.replace(new RegExp(/{(.*?)}/,"gm"),function(z){return s(K,z.replace("{","").replace("}",""))}),S+=V})}y.hasAttribute("data-transform")&&(S=JSON.parse(y.getAttribute("data-transform"))[S],!S&&y.hasAttribute("data-default")&&(S=y.getAttribute("data-default"))),L.innerHTML=S,A.appendChild(L)}),l.appendChild(A)}),I(a,o),r.setAttribute("data-total",parseInt(g)),r.setAttribute("data-page",parseInt(B)),r.setAttribute("data-pages",Math.ceil(r.getAttribute("data-total")/r.getAttribute("data-show"))),v(a,o,r),j(a,o,t,r),x(r,t),parseInt(g)==0&&(l.innerHTML=`<tr><td colspan="100%"><span>${C}</span></td></tr>`),r.classList.remove("table--loading"),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"Ajax table loaded",url:c,formData:n})):l.innerHTML='<tr><td colspan="100%"><span>Error loading table</span></td></tr>',o.hasAttribute("data-ajax-post")){const E=new XMLHttpRequest;E.open("GET",`${window.location.href}?ajax=true&${n}`),E.send()}})}catch(u){console.log(u)}})},T=(a,o)=>{switch(a){case"datetime":return new Date(o).toLocaleDateString("en-gb",{weekday:"short",year:"2-digit",month:"long",day:"numeric"})+" "+new Date(o).toLocaleTimeString("en-gb",{hour:"2-digit",minute:"2-digit"});case"date":return new Date(o).toLocaleDateString("en-gb",{year:"2-digit",month:"long",day:"numeric"});case"capitalise":return o=te(o)}};class de extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const o=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",t=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${o}/css/core.min.css`,r=document.createElement("template");r.innerHTML=`
11
+ </div>`,!0};var ae=function(a,o,t,r){function s(i){return i instanceof t?i:new t(function(n){n(i)})}return new(t||(t=Promise))(function(i,n){function d(m){try{c(r.next(m))}catch(u){n(u)}}function l(m){try{c(r.throw(m))}catch(u){n(u)}}function c(m){m.done?i(m.value):s(m.value).then(d,l)}c((r=r.apply(a,o||[])).next())})};const P=a=>{const o=Array.from(a.querySelectorAll("thead th"));Array.from(a.querySelectorAll("tbody tr")).forEach((t,r)=>{const s=Array.from(t.querySelectorAll("th, td")),i=["0","low","medium","high","unknown","n/a","pending","verified","due","overdue","incomplete","complete","completed","approval required","upcoming","requires approval","to do","on track","not started","warning","error"];s.forEach((n,d)=>{const l=o[d];if(typeof l<"u"){let c=document.createElement("div");c.innerHTML=l.innerHTML;let m=c.textContent||c.innerText||"";n.setAttribute("data-label",m),l.hasAttribute("data-td-class")&&n.setAttribute("class",l.getAttribute("data-td-class")),l.hasAttribute("data-format")&&(n.setAttribute("data-format",l.getAttribute("data-format")),n.innerHTML=T(l.getAttribute("data-format"),n.textContent.trim())),i.includes(n.textContent.trim().toLowerCase())&&n.setAttribute("data-content",n.textContent.trim().toLowerCase())}})})},oe=a=>{let o=0;return Array.from(a.querySelectorAll("tbody tr")).forEach((t,r)=>{let s=window.getComputedStyle(document.querySelector("html")),i=t.querySelector(":scope > *:last-child > *:first-child");if(i){i.classList.add("text-nowrap");let n=i.offsetWidth/parseFloat(s.fontSize);n+=1.7,o=o>n?o:n}}),o},re=a=>{if(a.closest(".table--fullwidth")||a.querySelectorAll("thead tr th").length<4)return!1;Array.from(a.querySelectorAll("tbody tr")).forEach((o,t)=>{let r=o.querySelector(":scope > :is(td,th):first-child"),s=r.textContent;if(s!="")r.innerHTML=`<span class="td__content">${s}</span><button type="button" class="d-none">${s}</button>`;else{let i=o.querySelector(":scope > :is(td,th):nth-child(2)"),n=i.textContent;i.innerHTML=`<span class="td__content">${n}</span><button type="button" class="d-none">${n}</button>`}})},ne=a=>{a.addEventListener("click",o=>{if(o&&o.target instanceof HTMLElement&&o.target.closest("tr > :is(td,th):first-child button")){let t=o.target.closest("tr > :is(td,th):first-child button"),r=t.parentNode.closest("tr");r.getAttribute("data-view")=="full"?r.setAttribute("data-view","default"):r.setAttribute("data-view","full"),t.blur()}})},I=(a,o)=>{let t=o.querySelector("[data-search]");if(!t)return!1;const r=t.getAttribute("id"),s=t.getAttribute("data-search").split(",");let i=t.parentNode,n={};s.forEach((d,l)=>{Array.from(a.querySelectorAll('td[data-label="'+d.trim()+'"]')).forEach((c,m)=>{c.querySelector(".td__content")?n[c.querySelector(".td__content").textContent]=c.querySelector(".td__content").textContent:n[c.textContent]=c.textContent})}),t.setAttribute("list",`${r}_list`),t.setAttribute("autocomplete","off"),i.querySelector("datalist")||(i.innerHTML+=`<datalist id="${r}_list"></datalist>`),i.querySelector("datalist").innerHTML=`${Object.keys(n).map(d=>`<option value="${d}"></option>`).join("")}`},ie=(a,o,t,r,s)=>{var i;let n=function(c=!1){if(o.hasAttribute("data-ajax")){if(!c){let m=o.querySelector("[data-pagination]");m.value=1,r.setAttribute("data-page",1)}O(a,o,t,r)}else o.hasAttribute("data-submit")?o.submit():(V(a,o,r),x(r,t),v(a,o))};o.addEventListener("keyup",c=>{clearTimeout(i),c&&c.target instanceof HTMLElement&&c.target.closest("[data-search]")&&(i=setTimeout(function(){n()},500))}),o.addEventListener("change",c=>{clearTimeout(i),c&&c.target instanceof HTMLElement&&c.target.closest("[data-sort]")&&(o.hasAttribute("data-submit")||F(a,o,s),n()),c&&c.target instanceof HTMLElement&&c.target.closest("[data-search]")&&n(),c&&c.target instanceof HTMLElement&&c.target.closest("[data-filter][data-no-ajax]")?(V(a,o,r),x(r,t),v(a,o)):(c&&c.target instanceof HTMLElement&&c.target.closest("[data-filter]")&&c.target.closest("form .dialog__wrapper > dialog")||c&&c.target instanceof HTMLElement&&c.target.closest("[data-filter]")&&!c.target.closest("form dialog"))&&n(),c&&c.target instanceof HTMLElement&&c.target.closest("[data-show]")&&n(),c&&c.target instanceof HTMLElement&&c.target.closest("[data-mimic]")&&n()}),o.addEventListener("click",c=>{clearTimeout(i),c&&c.target instanceof HTMLElement&&c.target.closest('dialog button:not([type="button"])')&&c.target.closest('dialog button:not([type="button"])').closest("dialog").close(),c&&c.target instanceof HTMLElement&&c.target.closest(".dialog__close")&&(c.preventDefault(),c.stopPropagation()),c&&c.target instanceof HTMLElement&&c.target.closest("[data-clear]")&&(o.reset(),o.hasAttribute("data-submit")||F(a,o,s),n())}),o.addEventListener("submit",c=>{clearTimeout(i),o.hasAttribute("data-submit")||c.preventDefault(),n()}),o.addEventListener("force",c=>{n()}),o.addEventListener("paginate",c=>{n(!0)});let d=[],l=[];Array.from(o.querySelectorAll("[data-mimic]")).forEach((c,m)=>{let u=c.getAttribute("data-mimic");Array.from(document.querySelectorAll(`[name="${u}"]`)).forEach((h,f)=>{let p=h.closest("form");d.includes(p)||d.push(p),l.includes(u)||l.push(u)})}),d.forEach((c,m)=>{const u=function(){let h=[],f=new FormData(c);for(const[p,g]of f)document.querySelector(`[data-mimic="${p}"]`)&&!h.includes(p)?(h.push(p),document.querySelector(`[data-mimic="${p}"]`).value=g):document.querySelector(`[data-mimic="${p}"]`)&&(document.querySelector(`[data-mimic="${p}"]`).value+=","+g);for(const p of h){const g=new Event("force");o.dispatchEvent(g)}for(const p of l)if(!f.has(p)&&c.querySelector(`[name="${p}"]`)){document.querySelector(`[data-mimic="${p}"]`).value="";const g=new Event("force");o.dispatchEvent(g)}};c.addEventListener("force",h=>{u()}),c.addEventListener("change",h=>{u()})})},F=(a,o,t)=>{if(o.getAttribute("data-ajax"))return!1;let r=a.querySelector("tbody"),s=o.querySelector("[data-sort]"),i=s.querySelector(`option:nth-child(${s.selectedIndex+1})`),n=i.getAttribute("data-sort"),d=i.getAttribute("data-order"),l=i.getAttribute("data-format");if(!n)return r.innerHTML=t.innerHTML,P(a),!1;let c=[];["asc","desc","descending"].includes(d)||(c=d.split(","));let m=[];Array.from(r.querySelectorAll("tr")).forEach((h,f)=>{let p=h.querySelector('td[data-label="'+n+'"], th[data-label="'+n+'"]').textContent.trim();h.querySelector('[data-label="'+n+'"] .td__content')&&(p=h.querySelector('[data-label="'+n+'"] .td__content').textContent.trim()),c.length&&c.includes(p)&&(p=c.indexOf(p)),Q(p)&&(p=ee(p,10)),l&&l=="date"&&(p=new Date(p));const g={index:p,row:h};m.push(g)}),m.sort((h,f)=>h.index>f.index?1:-1),(d=="descending"||d=="desc")&&(m=m.reverse());let u="";m.forEach((h,f)=>{u+=h.row.outerHTML}),r.innerHTML=u},V=(a,o,t)=>{a.classList.remove("table--filtered");let r=[],s=[],i=0,n=o.querySelector("[data-pagination]")?parseInt(o.querySelector("[data-pagination]").value):1,d=o.querySelector("[data-show]")?parseInt(o.querySelector("[data-show]").value):15;if(Array.from(a.querySelectorAll("tbody tr")).forEach((l,c)=>{l.classList.remove("filtered"),l.classList.remove("filtered--matched"),l.classList.remove("filtered--show"),l.removeAttribute("data-filtered-by")}),Array.from(o.querySelectorAll("[data-filter]")).forEach((l,c)=>{if(!(l.type=="radio"&&!l.checked)&&!(l.type=="checkbox"&&!l.checked)){if(l.getAttribute("data-filter")=="multi")for(const[m,u]of Object.entries(JSON.parse(l.value)))r[l.getAttribute("data-filter")].push(u);else if(l&&l.value){let m=l.getAttribute("data-filter");r[m]||(r[m]=new Array),r[m].push(l.value)}}}),o.querySelector("[data-search]")){let l=o.querySelector("[data-search]");o.querySelector("[data-search]").getAttribute("data-search").split(",").forEach((c,m)=>{s.push({column:`${c.trim()}`,value:`${l.value}`})})}Array.from(o.querySelectorAll("[data-filter-count]")).forEach((l,c)=>{l.innerHTML=""}),r.length&&Array.from(o.querySelectorAll("[data-filter-count]")).forEach((l,c)=>{l.innerHTML+=`(${r.length})`}),a.classList.add("table--filtered");for(const[l,c]of Object.entries(r))Array.from(a.querySelectorAll("tbody tr:not(.filtered)")).forEach((m,u)=>{let h=!1;c.forEach((f,p)=>{let g=m.querySelector(`[data-label="${l}"]`);if(f&&f=="$today")f=T("date",new Date);else if(f&&f=="$yesterday"){let k=new Date;k.setDate(k.getDate()-1),f=T("date",k)}else if(f&&(f=="$thisWeek"||f=="$lastWeek")){let k=new Date,A=new Date(k.setDate(k.getDate()-(k.getDay()-1))),y=new Date(k.setDate(k.getDate()-k.getDay()+7)),w=new Date(g.textContent.toLowerCase());if(k.setHours(0,0,0,0),A.setHours(0,0,0,0),y.setHours(0,0,0,0),w.setHours(0,0,0,0),f=="$thisWeek")h=w>=A&&w<=y;else{let S=new Date(A.setDate(A.getDate()-7)),L=new Date(y.setDate(y.getDate()-7));S.setHours(0,0,0,0),L.setHours(0,0,0,0),h=w>=S&&w<=L}}else if(f&&f=="$thisMonth"){let k=new Date,A=k.getFullYear(),y=k.getMonth();var N=new Date(A,y,1),$=new Date(A,y+1,0);let w=new Date(g.textContent.toLowerCase());N.setHours(0,0,0,0),$.setHours(0,0,0,0),w.setHours(0,0,0,0),h=w>=N&&w<=$}else if(f&&f=="$lastMonth"){let k=new Date,A=k.getFullYear(),y=k.getMonth();var B=new Date(A,y-1,1),E=new Date(A,y,0);let w=new Date(g.textContent.toLowerCase());B.setHours(0,0,0,0),E.setHours(0,0,0,0),w.setHours(0,0,0,0),h=w>=B&&w<=E}g&&g.textContent.toLowerCase().includes(f.toLowerCase())&&(h=!0)}),h||(m.classList.add("filtered"),m.setAttribute("data-filtered-by",l))});Array.from(a.querySelectorAll("tbody tr:not(.filtered)")).forEach((l,c)=>{let m=!(s.length>0&&s[0].value.length>=3);s.forEach((u,h)=>{let f=l.querySelector(`[data-label="${u.column}"]`);f&&u.value.length>=3&&f.textContent.toLowerCase().includes(u.value.toLowerCase())&&(m=!0)}),m||l.classList.add("filtered")}),Array.from(a.querySelectorAll("tbody tr:not(.filtered")).forEach((l,c)=>{i++,l.classList.add("filtered--matched"),Math.ceil(i/d)==parseInt(n)&&l.classList.add("filtered--show")}),t&&(t.setAttribute("data-page",n),t.setAttribute("data-pages",Math.ceil(i/d)),t.setAttribute("data-total",i),t.setAttribute("data-show",d))},v=(a,o,t)=>{Array.from(o.querySelectorAll("[data-query]")).forEach((r,s)=>{let i=r.getAttribute("data-query"),n;if(i=="total")t.hasAttribute("data-total")?n=t.getAttribute("data-total"):n=(a.classList.contains("table--filtered"),a.querySelectorAll("tbody tr").length);else if(!i.includes(" == ")&&i.includes(" & ")){let d=i.split(" & "),l="";d.forEach(c=>{l+=`:not([data-filtered-by="${c}"])`}),n=Array.from(a.querySelectorAll(`tbody tr${l}`)).length}else if(!i.includes(" == "))n=Array.from(a.querySelectorAll(`tbody tr:not([data-filtered-by="${i}"])`)).length;else if(i.includes(" && ")){let d=i.split(" && ");n=Array.from(a.querySelectorAll("tbody tr:not(.filtered)")).filter(function(l){let c=!0;for(const[m,u]of Object.entries(d)){let h=u.split(" == ");(!l.querySelector(`td[data-label="${h[0]}"]`)||l.querySelector(`td[data-label="${h[0]}"]`).textContent!=`${h[1]}`)&&(c=!1)}return c}).length}else{let d=i.split(" == ");n=Array.from(a.querySelectorAll(`tbody tr.filtered--matched td[data-label="${d[0]}"], tbody tr[data-filtered-by="${d[0]}"] td[data-label="${d[0]}"]`)).filter(function(l){return l.textContent===d[1]}).length}r.hasAttribute("data-total")?r.setAttribute("data-total",n):r.innerHTML=n})},se=function(a,o,t,r){t.addEventListener("click",s=>{if(s&&s.target instanceof HTMLElement&&s.target.closest("[data-page]")){s.preventDefault();let i=o.querySelector("[data-pagination]"),n=s.target.closest("[data-page]").getAttribute("data-page");if(i.value=n,r.setAttribute("data-page",n),o.dispatchEvent(new Event("paginate")),a.hasAttribute("data-show-history")){const c=new URL(location);c.searchParams.set("page",n),history.pushState({type:"pagination",form:o.getAttribute("id"),page:n},"",c)}const d=-250,l=a.getBoundingClientRect().top+window.pageYOffset+d;window.scrollTo({top:l,behavior:"smooth"})}if(s&&s.target instanceof HTMLElement&&s.target.closest("[data-show]")){s.preventDefault();let i=o.querySelector("[data-show]"),n=s.target.closest("[data-show]").getAttribute("data-show");i.value=n,r.setAttribute("data-show",n),o.dispatchEvent(new Event("submit"))}})},le=(a,o)=>{if(!a)return!1;a.addEventListener("click",t=>{ce(o)})},ce=function(a){for(var o=[],t=a.getElementsByTagName("tr"),r=0;r<t.length;r++){for(var s=t[r].querySelectorAll("td,th"),i=[],n=0;n<s.length;n++)i.push(`"${s[n].textContent}"`);o.push(i.join(","))}o=o.join(`
12
+ `);let d=new Blob([o],{type:"text/csv"});var l=document.createElement("a");l.download="export.csv";var c=window.URL.createObjectURL(d);l.href=c,l.style.display="none",document.body.appendChild(l),l.click(),document.body.removeChild(l)},j=function(a,o,t,r){if(P(a),re(a),v(a,o,r),r&&r.classList.contains("table--cta")){let s=function(){Array.from(a.querySelectorAll("tr")).forEach((n,d)=>{let l=n.offsetHeight;n.style.setProperty("--row-height",`${l}px`)})};const i=oe(a);r.style.setProperty("--cta-width",`${i}rem`),new ResizeObserver(s).observe(a)}},O=function(a,o,t,r){return ae(this,void 0,void 0,function*(){const s=(u,h,f)=>h.split(/[\.\[\]\'\"]/).filter(p=>p).reduce((p,g)=>p?p[g]:f,u);let i=new FormData(o),n=new URLSearchParams(i).toString(),d=a.querySelectorAll("thead tr th"),l=a.querySelector("tbody"),c=o.getAttribute("data-ajax");r.classList.add("table--loading"),window.controller||(window.controller=[]),window.controller[c]&&window.controller[c].abort(),window.controller[c]=new AbortController;const{signal:m}=controller[c];try{yield fetch(c+"?"+n,{signal:m,method:"get",credentials:"same-origin",headers:new Headers({"Content-Type":"application/json",Accept:"application/json","X-Requested-With":"XMLHttpRequest"})}).then(u=>u.json()).then(u=>{let h=o.hasAttribute("data-schema")?o.getAttribute("data-schema"):"data",f=o.hasAttribute("data-schema-total")?o.getAttribute("data-schema-total"):"meta.total",p=o.hasAttribute("data-schema-page")?o.getAttribute("data-schema-page"):"meta.current_page",g=s(u,f,1),N=s(u,p,1),$=s(u,h),B=r.hasAttribute("data-empty-msg")?r.getAttribute("data-empty-msg"):"No results found";if($?(l.innerHTML="",$.forEach((E,k)=>{var A=document.createElement("tr");d.forEach((y,w)=>{let S="";var L=document.createElement("td");if(L.setAttribute("data-label",y.innerText),y.getAttribute("data-output")){var D=y.getAttribute("data-output");S=D.replace(new RegExp(/{(.*?)}/,"gm"),function(or){return s(E,or.replace("{","").replace("}",""))})}if(y.hasAttribute("data-output-array")){var D=y.getAttribute("data-output");let rr=s(E,D.replace("{","").replace("}",""));S="",rr.forEach((K,br)=>{let nr=y.getAttribute("data-output-array"),C="";if(y.hasAttribute("data-output-array-property")&&y.hasAttribute("data-output-array-transform")){const z=s(K,y.getAttribute("data-output-array-property")),ir=JSON.parse(y.getAttribute("data-output-array-transform"))[z];C=nr.replace(`{${y.getAttribute("data-output-array-property")}}`,ir)}C=C.replace(new RegExp(/{(.*?)}/,"gm"),function(z){return s(K,z.replace("{","").replace("}",""))}),S+=C})}y.hasAttribute("data-transform")&&(S=JSON.parse(y.getAttribute("data-transform"))[S],!S&&y.hasAttribute("data-default")&&(S=y.getAttribute("data-default"))),L.innerHTML=S,A.appendChild(L)}),l.appendChild(A)}),I(a,o),r.setAttribute("data-total",parseInt(g)),r.setAttribute("data-page",parseInt(N)),r.setAttribute("data-pages",Math.ceil(r.getAttribute("data-total")/r.getAttribute("data-show"))),j(a,o,t,r),x(r,t),parseInt(g)==0&&(l.innerHTML=`<tr><td colspan="100%"><span>${B}</span></td></tr>`),r.classList.remove("table--loading"),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"Ajax table loaded",url:c,formData:n})):l.innerHTML='<tr><td colspan="100%"><span>Error loading table</span></td></tr>',o.hasAttribute("data-ajax-post")){const E=new XMLHttpRequest;E.open("GET",`${window.location.href}?ajax=true&${n}`),E.send()}})}catch(u){console.log(u)}})},T=(a,o)=>{switch(a){case"datetime":return new Date(o).toLocaleDateString("en-gb",{weekday:"short",year:"2-digit",month:"long",day:"numeric"})+" "+new Date(o).toLocaleTimeString("en-gb",{hour:"2-digit",minute:"2-digit"});case"date":return new Date(o).toLocaleDateString("en-gb",{year:"2-digit",month:"long",day:"numeric"});case"capitalise":return o=te(o)}};class de extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const o=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",t=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${o}/css/core.min.css`,r=document.createElement("template");r.innerHTML=`
13
13
  <style>
14
14
  @import "${t}";
15
15
 
@@ -31,8 +31,8 @@
31
31
  </div>
32
32
  </div>
33
33
  <div class="table__pagination"></div>
34
- `,this.shadowRoot.appendChild(r.content.cloneNode(!0))}connectedCallback(){const o=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",o.has("page")?o.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")));let t=this.classList.toString();t=t.replace("table--cta",""),t=t.replace("table--loading",""),this.shadowRoot.querySelector(".table__wrapper").className+=` ${t}`,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(`#${this.getAttribute("data-filterby")}`):this.table.parentNode.insertBefore(this.form,this.table.nextSibling),this.form.hasAttribute("data-ajax")&&this.table.classList.add("table--ajax"),I(this.table,this.form),this.form.querySelector("[data-page]")||(this.form.innerHTML+=`<input name="page" type="hidden" value="${this.getAttribute("data-page")}" data-pagination="true" />`),this.form.querySelector("[data-show]")||(this.form.innerHTML+=`<input name="show" type="hidden" value="${this.getAttribute("data-show")}" data-show="true" />`),ne(this.table),ie(this.table,this.form,this.pagination,this,this.savedTableBody),se(this.table,this.form,this.pagination,this),le(this.shadowRoot.querySelector("[data-export]"),this.table),this.form.getAttribute("data-ajax")?O(this.table,this.form,this.pagination,this):(j(this.table,this.form,this.pagination,this),v(this.table,this.form,this),x(this,this.pagination),N(this.table,this.form)),this.shadowRoot.querySelector(".table__wrapper").addEventListener("scroll",r=>{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(o,t,r){}}const me=a=>a.charAt(0).toUpperCase()+a.slice(1),ue=a=>a.replace(/_/g," "),he=a=>a.replace(/ /g,"_"),pe=function(a){return a=a.toLowerCase(),a=he(a),a=a.replace(/\W/g,""),a},fe={name:"Table",props:{items:{type:Array,required:!1},fields:{type:Array,required:!1}},computed:{cellHeading(){return a=>`${me(ue(a))}`}},created(){this.$nextTick(function(){window.customElements.get("iam-table")||window.customElements.define("iam-table",de)})},updated(){}},be={key:0},ye={key:0},ge=["data-row-id"],_e=["innerHTML"];function ke(a,o,t,r,s,i){return e.openBlock(),e.createElementBlock("iam-table",null,[t.fields?(e.openBlock(),e.createElementBlock("table",be,[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.fields,n=>(e.openBlock(),e.createElementBlock("th",{key:n.key},e.toDisplayString(i.cellHeading(n.key)),1))),128))])]),t.items?(e.openBlock(),e.createElementBlock("tbody",ye,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(n,d)=>(e.openBlock(),e.createElementBlock("tr",{key:d,"data-row-id":n.rowid},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Object.fromEntries(Object.entries(n).filter(([l])=>l!=="rowid")),(l,c)=>(e.openBlock(),e.createElementBlock("td",{key:c,innerHTML:l},null,8,_e))),128))],8,ge))),128))])):e.createCommentVNode("",!0)])):e.renderSlot(a.$slots,"default",{key:1})])}const M=_(fe,[["render",ke]]),we={name:"Input",props:{value:{type:String,required:!1},id:{type:String,required:!0},name:{type:String,required:!1},list:{type:String,required:!1},label:{type:String,required:!1},labelclass:{type:String,required:!1},inputclass:{type:String,required:!1},type:{type:String,required:!1,default:"text"},size:{type:String,required:!1},errormsg:{type:String,required:!1},options:{type:Array,required:!1},prefix:{type:String,required:!1},prefixClass:{type:String,required:!1},suffix:{type:String,required:!1},pattern:{type:String,required:!1},suffixClass:{type:String,required:!1},title:{type:String,required:!1},hint:{type:String,required:!1},multiple:{type:String,required:!1}},computed:{displayLabel(){return()=>this.$attrs.multiple?this.label+'<span class="small d-block text-body font-body fw-normal">Hold down the Ctrl (windows) or Command (Mac) button to select multiple options.</span>':this.hint?this.label+`<span class="small d-block text-body font-body fw-normal">${this.hint}</span>`:this.label},wrapperClass(){return()=>{switch(this.type){case"radio":case"checkbox":return"form-check";case"radio-btn":case"checkbox-btn":return!1;default:return"form-control__wrapper"}}},needPattern(){return()=>{if(this.pattern)return this.pattern;switch(this.type){case"datetime-local":return"[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}"}return"(.*?)"}},needsLabel(){return()=>{switch(this.type){case"radio":case"radio-btn":case"checkbox":case"checkbox-btn":return!1;default:return!0}}},isInput(){return()=>{switch(this.type){case"textarea":case"select":case"radio":case"radio-btn":case"checkbox":case"checkbox-btn":case"range":case"color":return!1;default:return!0}}},allowDatalist(){return()=>{switch(this.type){case"select":case"radio":case"radio-btn":case"checkbox":case"checkbox-btn":return!1;default:return!0}}},hasOptions(){return()=>{if(this.list)return this.list;if(this.options)return this.id+"-list"}},inputVal:{get(){return this.value==null&&this.options!=null&&this.type=="select"?this.$attrs.multiple?[]:this.options[0].value:this.value},set(a){this.$emit("input",a)}}},mounted(){this.$nextTick(function(){let a=this.$refs.wrapper;if(a.parentNode&&a.parentNode.classList.contains("form-check")||a.classList.length==0){const o=document.createDocumentFragment();Array.from(a.childNodes).forEach(t=>o.appendChild(t)),a.parentNode.insertBefore(o,a),a.parentNode.removeChild(a)}})},methods:{inputKeyup(a){this.$emit("keyupEvent",a)},clickEvent(){this.$emit("bus")}}},Ae=["for","innerHTML","title"],Se=["innerHTML"],Ee=["innerHTML"],Le=["type","name","id","pattern","list"],qe=["type","name","id","pattern"],$e={key:5,class:"input-group"},xe=["type","name","id","pattern","list"],ve={class:"input-group-text border-0 col-2 col-sm-1 px-0"},Ne={key:6,class:"input-group"},Be=["type","name","id","pattern","list"],Ce={class:"input-group-text flex-fill"},Ve=["type","name","id","pattern"],Te=["value"],Me=["type","name","id"],He=["for","innerHTML"],De=["type","name","id"],ze=["for","innerHTML"],Re=["innerHTML"],Pe=["id"],Ie=["value"];function Fe(a,o,t,r,s,i){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(i.wrapperClass()),ref:"wrapper"},[i.needsLabel()?(e.openBlock(),e.createElementBlock("label",{key:0,class:e.normalizeClass(`form-label${t.labelclass?` ${t.labelclass}`:""}`),for:t.id,innerHTML:i.displayLabel(),title:t.title},null,10,Ae)):e.createCommentVNode("",!0),t.prefix?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(`prefix ${this.prefixClass} ${t.size?`prefix-${t.size}`:""}`),innerHTML:t.prefix,role:"presentation"},null,10,Se)):e.createCommentVNode("",!0),t.suffix?(e.openBlock(),e.createElementBlock("span",{key:2,class:e.normalizeClass(`suffix ${this.suffixClass} ${t.size?`suffix-${t.size}`:""}`),innerHTML:t.suffix,role:"presentation"},null,10,Ee)):e.createCommentVNode("",!0),i.isInput()?e.withDirectives((e.openBlock(),e.createElementBlock("input",e.mergeProps({key:3,"onUpdate:modelValue":o[0]||(o[0]=n=>i.inputVal=n),class:`form-control${t.size?` form-control-${t.size}`:""}${t.inputclass?` ${t.inputclass}`:""}`,type:t.type,name:t.name?t.name:t.id,id:t.id,pattern:i.needPattern(),list:i.hasOptions()},a.$attrs,{onKeyup:o[1]||(o[1]=(...n)=>i.inputKeyup&&i.inputKeyup(...n))}),null,16,Le)),[[e.vModelDynamic,i.inputVal]]):e.createCommentVNode("",!0),t.type=="textarea"?e.withDirectives((e.openBlock(),e.createElementBlock("textarea",e.mergeProps({key:4,"onUpdate:modelValue":o[2]||(o[2]=n=>i.inputVal=n),class:`form-control${t.size?` form-control-${t.size}`:""}${t.inputclass?` ${t.inputclass}`:""}`,type:t.type,name:t.name?t.name:t.id,id:t.id,pattern:i.needPattern()},a.$attrs),null,16,qe)),[[e.vModelText,i.inputVal]]):e.createCommentVNode("",!0),t.type=="range"?(e.openBlock(),e.createElementBlock("div",$e,[e.withDirectives(e.createElementVNode("input",e.mergeProps({"onUpdate:modelValue":o[3]||(o[3]=n=>i.inputVal=n),class:`form-range${t.inputclass?` ${t.inputclass}`:""}`,type:t.type,name:t.name?t.name:t.id,id:t.id,pattern:i.needPattern(),list:i.hasOptions()},a.$attrs,{oninput:"this.nextElementSibling.value=this.value;"}),null,16,xe),[[e.vModelDynamic,i.inputVal]]),e.createElementVNode("output",ve,e.toDisplayString(t.value),1)])):e.createCommentVNode("",!0),t.type=="color"?(e.openBlock(),e.createElementBlock("div",Ne,[e.withDirectives(e.createElementVNode("input",e.mergeProps({"onUpdate:modelValue":o[4]||(o[4]=n=>i.inputVal=n),class:`form-control form-control-color${t.inputclass?` ${t.inputclass}`:""}`,type:t.type,name:t.name?t.name:t.id,id:t.id,pattern:i.needPattern(),list:i.hasOptions()},a.$attrs,{oninput:"this.nextElementSibling.value=this.value;"}),null,16,Be),[[e.vModelDynamic,i.inputVal]]),e.createElementVNode("output",Ce,e.toDisplayString(t.value?a.vale:"#000000"),1)])):e.createCommentVNode("",!0),t.type=="select"?e.withDirectives((e.openBlock(),e.createElementBlock("select",e.mergeProps({key:7,"onUpdate:modelValue":o[5]||(o[5]=n=>i.inputVal=n),class:`form-select${t.size?` form-select-${t.size}`:""}${t.inputclass?` ${t.inputclass}`:""}`,type:t.type,name:t.id,id:t.id,pattern:i.needPattern()},a.$attrs),[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,(n,d)=>(e.openBlock(),e.createElementBlock("option",{key:d,value:n.value},e.toDisplayString(n.display?n.display:n.value),9,Te))),128))],16,Ve)),[[e.vModelSelect,i.inputVal]]):e.createCommentVNode("",!0),t.type=="checkbox"||t.type=="radio"?(e.openBlock(),e.createElementBlock("input",e.mergeProps({key:8,class:"form-check-input",type:t.type,name:t.name?t.name:t.id,id:t.id},a.$attrs),null,16,Me)):e.createCommentVNode("",!0),t.type=="checkbox"||t.type=="radio"?(e.openBlock(),e.createElementBlock("label",{key:9,class:e.normalizeClass(`form-label form-check-label${t.labelclass?` ${t.labelclass}`:""}`),for:t.id,innerHTML:t.label},null,10,He)):e.createCommentVNode("",!0),t.type=="checkbox-btn"||t.type=="radio-btn"?(e.openBlock(),e.createElementBlock("input",e.mergeProps({key:10,class:`btn-check${t.inputclass?` ${t.inputclass}`:""}`,type:t.type.replace("-btn",""),autocomplete:"off",name:t.name?t.name:t.id,id:t.id},a.$attrs),null,16,De)):e.createCommentVNode("",!0),t.type=="checkbox-btn"||t.type=="radio-btn"?(e.openBlock(),e.createElementBlock("label",{key:11,class:e.normalizeClass(`btn${t.labelclass?` ${t.labelclass}`:""}`),for:t.id,innerHTML:t.label,onClick:o[6]||(o[6]=(...n)=>i.clickEvent&&i.clickEvent(...n))},null,10,ze)):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"default"),t.errormsg?(e.openBlock(),e.createElementBlock("span",{key:12,class:"invalid-feedback mb-0",innerHTML:t.errormsg},null,8,Re)):e.createCommentVNode("",!0),i.allowDatalist()?(e.openBlock(),e.createElementBlock("datalist",{key:13,id:t.id+"-list"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,(n,d)=>(e.openBlock(),e.createElementBlock("option",{key:d,value:n.value},e.toDisplayString(n.value),9,Ie))),128))],8,Pe)):e.createCommentVNode("",!0)],2)}const q=_(we,[["render",Fe]]),je={components:{Input:q},name:"FileUploads",props:{id:{type:String,required:!0},inputcolclass:{type:String,required:!1},maxfilesize:{type:Number,required:!1},maxfiles:{type:Number,required:!1}}},Oe={class:"multiple-file-uploads mb-4"},Ue={class:"row"},We={class:"col-12 col-md me-auto"},Ge=e.createElementVNode("div",{class:"col mw-fit-content"},[e.createElementVNode("button",{type:"button",class:"btn btn-tertiary me-0","data-delete":""},"Delete")],-1),Ke=["data-maxfiles"];function Ye(a,o,t,r,s,i){const n=e.resolveComponent("Input");return e.openBlock(),e.createElementBlock("div",Oe,[e.createElementVNode("div",Ue,[e.createElementVNode("div",{class:e.normalizeClass(`${t.inputcolclass?t.inputcolclass:"col-12 col-sm-4"}`)},[e.createVNode(n,{type:"file",id:t.id,name:`${t.id}[]`,label:"Add new file",labelclass:"d-none",class:"form-control-inline col",required:"","data-filesize":t.maxfilesize},null,8,["id","name","data-filesize"])],2),e.createElementVNode("div",We,[e.renderSlot(a.$slots,"default")]),Ge]),e.createElementVNode("button",{type:"button",class:"btn btn-secondary me-0","data-add":"","data-maxfiles":t.maxfiles},"+ Add file",8,Ke)])}const Ze=_(je,[["render",Ye]]);/*!
35
- * iamKey v3.7.8--beta
34
+ `,this.shadowRoot.appendChild(r.content.cloneNode(!0))}connectedCallback(){const o=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",o.has("page")?o.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")));let t=this.classList.toString();t=t.replace("table--cta",""),t=t.replace("table--loading",""),this.shadowRoot.querySelector(".table__wrapper").className+=` ${t}`,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(`#${this.getAttribute("data-filterby")}`):this.table.parentNode.insertBefore(this.form,this.table.nextSibling),this.form.hasAttribute("data-ajax")&&this.table.classList.add("table--ajax"),I(this.table,this.form),this.form.querySelector("[data-page]")||(this.form.innerHTML+=`<input name="page" type="hidden" value="${this.getAttribute("data-page")}" data-pagination="true" />`),this.form.querySelector("[data-show]")||(this.form.innerHTML+=`<input name="show" type="hidden" value="${this.getAttribute("data-show")}" data-show="true" />`),ne(this.table),ie(this.table,this.form,this.pagination,this,this.savedTableBody),se(this.table,this.form,this.pagination,this),le(this.shadowRoot.querySelector("[data-export]"),this.table),this.form.getAttribute("data-ajax")?O(this.table,this.form,this.pagination,this):(j(this.table,this.form,this.pagination,this),V(this.table,this.form,this),x(this,this.pagination),v(this.table,this.form)),this.shadowRoot.querySelector(".table__wrapper").addEventListener("scroll",r=>{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(o,t,r){}}const me=a=>a.charAt(0).toUpperCase()+a.slice(1),ue=a=>a.replace(/_/g," "),he=a=>a.replace(/ /g,"_"),pe=function(a){return a=a.toLowerCase(),a=he(a),a=a.replace(/\W/g,""),a},fe={name:"Table",props:{items:{type:Array,required:!1},fields:{type:Array,required:!1}},computed:{cellHeading(){return a=>`${me(ue(a))}`}},created(){this.$nextTick(function(){window.customElements.get("iam-table")||window.customElements.define("iam-table",de)})},updated(){}},be={key:0},ye={key:0},ge=["data-row-id"],_e=["innerHTML"];function ke(a,o,t,r,s,i){return e.openBlock(),e.createElementBlock("iam-table",null,[t.fields?(e.openBlock(),e.createElementBlock("table",be,[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.fields,n=>(e.openBlock(),e.createElementBlock("th",{key:n.key},e.toDisplayString(i.cellHeading(n.key)),1))),128))])]),t.items?(e.openBlock(),e.createElementBlock("tbody",ye,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(n,d)=>(e.openBlock(),e.createElementBlock("tr",{key:d,"data-row-id":n.rowid},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Object.fromEntries(Object.entries(n).filter(([l])=>l!=="rowid")),(l,c)=>(e.openBlock(),e.createElementBlock("td",{key:c,innerHTML:l},null,8,_e))),128))],8,ge))),128))])):e.createCommentVNode("",!0)])):e.renderSlot(a.$slots,"default",{key:1})])}const M=_(fe,[["render",ke]]),we={name:"Input",props:{value:{type:String,required:!1},id:{type:String,required:!0},name:{type:String,required:!1},list:{type:String,required:!1},label:{type:String,required:!1},labelclass:{type:String,required:!1},inputclass:{type:String,required:!1},type:{type:String,required:!1,default:"text"},size:{type:String,required:!1},errormsg:{type:String,required:!1},options:{type:Array,required:!1},prefix:{type:String,required:!1},prefixClass:{type:String,required:!1},suffix:{type:String,required:!1},pattern:{type:String,required:!1},suffixClass:{type:String,required:!1},title:{type:String,required:!1},hint:{type:String,required:!1},multiple:{type:String,required:!1}},computed:{displayLabel(){return()=>this.$attrs.multiple?this.label+'<span class="small d-block text-body font-body fw-normal">Hold down the Ctrl (windows) or Command (Mac) button to select multiple options.</span>':this.hint?this.label+`<span class="small d-block text-body font-body fw-normal">${this.hint}</span>`:this.label},wrapperClass(){return()=>{switch(this.type){case"radio":case"checkbox":return"form-check";case"radio-btn":case"checkbox-btn":return!1;default:return"form-control__wrapper"}}},needPattern(){return()=>{if(this.pattern)return this.pattern;switch(this.type){case"datetime-local":return"[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}"}return"(.*?)"}},needsLabel(){return()=>{switch(this.type){case"radio":case"radio-btn":case"checkbox":case"checkbox-btn":return!1;default:return!0}}},isInput(){return()=>{switch(this.type){case"textarea":case"select":case"radio":case"radio-btn":case"checkbox":case"checkbox-btn":case"range":case"color":return!1;default:return!0}}},allowDatalist(){return()=>{switch(this.type){case"select":case"radio":case"radio-btn":case"checkbox":case"checkbox-btn":return!1;default:return!0}}},hasOptions(){return()=>{if(this.list)return this.list;if(this.options)return this.id+"-list"}},inputVal:{get(){return this.value==null&&this.options!=null&&this.type=="select"?this.$attrs.multiple?[]:this.options[0].value:this.value},set(a){this.$emit("input",a)}}},mounted(){this.$nextTick(function(){let a=this.$refs.wrapper;if(a.parentNode&&a.parentNode.classList.contains("form-check")||a.classList.length==0){const o=document.createDocumentFragment();Array.from(a.childNodes).forEach(t=>o.appendChild(t)),a.parentNode.insertBefore(o,a),a.parentNode.removeChild(a)}})},methods:{inputKeyup(a){this.$emit("keyupEvent",a)},clickEvent(){this.$emit("bus")}}},Ae=["for","innerHTML","title"],Se=["innerHTML"],Ee=["innerHTML"],Le=["type","name","id","pattern","list"],qe=["type","name","id","pattern"],$e={key:5,class:"input-group"},xe=["type","name","id","pattern","list"],ve={class:"input-group-text border-0 col-2 col-sm-1 px-0"},Ne={key:6,class:"input-group"},Be=["type","name","id","pattern","list"],Ce={class:"input-group-text flex-fill"},Ve=["type","name","id","pattern"],Te=["value"],Me=["type","name","id"],He=["for","innerHTML"],De=["type","name","id"],ze=["for","innerHTML"],Re=["innerHTML"],Pe=["id"],Ie=["value"];function Fe(a,o,t,r,s,i){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(i.wrapperClass()),ref:"wrapper"},[i.needsLabel()?(e.openBlock(),e.createElementBlock("label",{key:0,class:e.normalizeClass(`form-label${t.labelclass?` ${t.labelclass}`:""}`),for:t.id,innerHTML:i.displayLabel(),title:t.title},null,10,Ae)):e.createCommentVNode("",!0),t.prefix?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(`prefix ${this.prefixClass} ${t.size?`prefix-${t.size}`:""}`),innerHTML:t.prefix,role:"presentation"},null,10,Se)):e.createCommentVNode("",!0),t.suffix?(e.openBlock(),e.createElementBlock("span",{key:2,class:e.normalizeClass(`suffix ${this.suffixClass} ${t.size?`suffix-${t.size}`:""}`),innerHTML:t.suffix,role:"presentation"},null,10,Ee)):e.createCommentVNode("",!0),i.isInput()?e.withDirectives((e.openBlock(),e.createElementBlock("input",e.mergeProps({key:3,"onUpdate:modelValue":o[0]||(o[0]=n=>i.inputVal=n),class:`form-control${t.size?` form-control-${t.size}`:""}${t.inputclass?` ${t.inputclass}`:""}`,type:t.type,name:t.name?t.name:t.id,id:t.id,pattern:i.needPattern(),list:i.hasOptions()},a.$attrs,{onKeyup:o[1]||(o[1]=(...n)=>i.inputKeyup&&i.inputKeyup(...n))}),null,16,Le)),[[e.vModelDynamic,i.inputVal]]):e.createCommentVNode("",!0),t.type=="textarea"?e.withDirectives((e.openBlock(),e.createElementBlock("textarea",e.mergeProps({key:4,"onUpdate:modelValue":o[2]||(o[2]=n=>i.inputVal=n),class:`form-control${t.size?` form-control-${t.size}`:""}${t.inputclass?` ${t.inputclass}`:""}`,type:t.type,name:t.name?t.name:t.id,id:t.id,pattern:i.needPattern()},a.$attrs),null,16,qe)),[[e.vModelText,i.inputVal]]):e.createCommentVNode("",!0),t.type=="range"?(e.openBlock(),e.createElementBlock("div",$e,[e.withDirectives(e.createElementVNode("input",e.mergeProps({"onUpdate:modelValue":o[3]||(o[3]=n=>i.inputVal=n),class:`form-range${t.inputclass?` ${t.inputclass}`:""}`,type:t.type,name:t.name?t.name:t.id,id:t.id,pattern:i.needPattern(),list:i.hasOptions()},a.$attrs,{oninput:"this.nextElementSibling.value=this.value;"}),null,16,xe),[[e.vModelDynamic,i.inputVal]]),e.createElementVNode("output",ve,e.toDisplayString(t.value),1)])):e.createCommentVNode("",!0),t.type=="color"?(e.openBlock(),e.createElementBlock("div",Ne,[e.withDirectives(e.createElementVNode("input",e.mergeProps({"onUpdate:modelValue":o[4]||(o[4]=n=>i.inputVal=n),class:`form-control form-control-color${t.inputclass?` ${t.inputclass}`:""}`,type:t.type,name:t.name?t.name:t.id,id:t.id,pattern:i.needPattern(),list:i.hasOptions()},a.$attrs,{oninput:"this.nextElementSibling.value=this.value;"}),null,16,Be),[[e.vModelDynamic,i.inputVal]]),e.createElementVNode("output",Ce,e.toDisplayString(t.value?a.vale:"#000000"),1)])):e.createCommentVNode("",!0),t.type=="select"?e.withDirectives((e.openBlock(),e.createElementBlock("select",e.mergeProps({key:7,"onUpdate:modelValue":o[5]||(o[5]=n=>i.inputVal=n),class:`form-select${t.size?` form-select-${t.size}`:""}${t.inputclass?` ${t.inputclass}`:""}`,type:t.type,name:t.id,id:t.id,pattern:i.needPattern()},a.$attrs),[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,(n,d)=>(e.openBlock(),e.createElementBlock("option",{key:d,value:n.value},e.toDisplayString(n.display?n.display:n.value),9,Te))),128))],16,Ve)),[[e.vModelSelect,i.inputVal]]):e.createCommentVNode("",!0),t.type=="checkbox"||t.type=="radio"?(e.openBlock(),e.createElementBlock("input",e.mergeProps({key:8,class:"form-check-input",type:t.type,name:t.name?t.name:t.id,id:t.id},a.$attrs),null,16,Me)):e.createCommentVNode("",!0),t.type=="checkbox"||t.type=="radio"?(e.openBlock(),e.createElementBlock("label",{key:9,class:e.normalizeClass(`form-label form-check-label${t.labelclass?` ${t.labelclass}`:""}`),for:t.id,innerHTML:t.label},null,10,He)):e.createCommentVNode("",!0),t.type=="checkbox-btn"||t.type=="radio-btn"?(e.openBlock(),e.createElementBlock("input",e.mergeProps({key:10,class:`btn-check${t.inputclass?` ${t.inputclass}`:""}`,type:t.type.replace("-btn",""),autocomplete:"off",name:t.name?t.name:t.id,id:t.id},a.$attrs),null,16,De)):e.createCommentVNode("",!0),t.type=="checkbox-btn"||t.type=="radio-btn"?(e.openBlock(),e.createElementBlock("label",{key:11,class:e.normalizeClass(`btn${t.labelclass?` ${t.labelclass}`:""}`),for:t.id,innerHTML:t.label,onClick:o[6]||(o[6]=(...n)=>i.clickEvent&&i.clickEvent(...n))},null,10,ze)):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"default"),t.errormsg?(e.openBlock(),e.createElementBlock("span",{key:12,class:"invalid-feedback mb-0",innerHTML:t.errormsg},null,8,Re)):e.createCommentVNode("",!0),i.allowDatalist()?(e.openBlock(),e.createElementBlock("datalist",{key:13,id:t.id+"-list"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,(n,d)=>(e.openBlock(),e.createElementBlock("option",{key:d,value:n.value},e.toDisplayString(n.value),9,Ie))),128))],8,Pe)):e.createCommentVNode("",!0)],2)}const q=_(we,[["render",Fe]]),je={components:{Input:q},name:"FileUploads",props:{id:{type:String,required:!0},inputcolclass:{type:String,required:!1},maxfilesize:{type:Number,required:!1},maxfiles:{type:Number,required:!1}}},Oe={class:"multiple-file-uploads mb-4"},Ue={class:"row"},We={class:"col-12 col-md me-auto"},Ge=e.createElementVNode("div",{class:"col mw-fit-content"},[e.createElementVNode("button",{type:"button",class:"btn btn-tertiary me-0","data-delete":""},"Delete")],-1),Ke=["data-maxfiles"];function Ye(a,o,t,r,s,i){const n=e.resolveComponent("Input");return e.openBlock(),e.createElementBlock("div",Oe,[e.createElementVNode("div",Ue,[e.createElementVNode("div",{class:e.normalizeClass(`${t.inputcolclass?t.inputcolclass:"col-12 col-sm-4"}`)},[e.createVNode(n,{type:"file",id:t.id,name:`${t.id}[]`,label:"Add new file",labelclass:"d-none",class:"form-control-inline col",required:"","data-filesize":t.maxfilesize},null,8,["id","name","data-filesize"])],2),e.createElementVNode("div",We,[e.renderSlot(a.$slots,"default")]),Ge]),e.createElementVNode("button",{type:"button",class:"btn btn-secondary me-0","data-add":"","data-maxfiles":t.maxfiles},"+ Add file",8,Ke)])}const Ze=_(je,[["render",Ye]]);/*!
35
+ * iamKey v3.7.8--beta-2
36
36
  * Copyright 2022-2023 iamproperty
37
37
  */function Je(a){let o=a.querySelectorAll("details"),t=a.querySelectorAll("summary");if(o.forEach(r=>{r.classList.add("accordion-item")}),t.forEach(r=>{r.classList.add("accordion-header"),r.classList.add("accordion-button"),r.classList.add("h4")}),!a.classList.contains("accordion--keep-open")){const r=a.querySelectorAll(":scope > details");r.forEach(s=>{s.addEventListener("click",()=>{r.forEach(i=>{i!==s&&i.removeAttribute("open")})})})}}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"accordion"});let Xe=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const o=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",t=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${o}/css/core.min.css`,r=document.createElement("template");r.innerHTML=`
38
38
  <style>
@@ -45,7 +45,7 @@
45
45
  <slot></slot>
46
46
  </div>
47
47
  `,this.shadowRoot.appendChild(r.content.cloneNode(!0))}connectedCallback(){Je(this)}};const sr="";window.customElements.get("iam-accordion")||window.customElements.define("iam-accordion",Xe);const Qe={name:"Accordion",props:{},mounted(){}},et={ref:"wrapper"};function tt(a,o,t,r,s,i){return e.openBlock(),e.createElementBlock("iam-accordion",et,[e.renderSlot(a.$slots,"default")],512)}const at=_(Qe,[["render",tt]]),ot={name:"AccordionItem",props:{title:{type:String,required:!0},titlecolour:{type:String,required:!1},badge:{type:[Number,String],required:!1},badgecolour:{type:String,required:!1,default:"light"},lazy:{type:Boolean,required:!1}},computed:{createID(){return a=>`${pe(a)}`}},data(){return{show:!this.lazy}}},rt=["id"],nt=["classList"];function it(a,o,t,r,s,i){return e.openBlock(),e.createElementBlock("details",{id:i.createID(t.title)},[e.createElementVNode("summary",{classList:`${t.titlecolour?`bg-${t.titlecolour}`:""}`},[e.createTextVNode(e.toDisplayString(t.title),1),t.badge?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(`badge bg-${t.badgecolour}`)},e.toDisplayString(t.badge),3)):e.createCommentVNode("",!0)],8,nt),e.renderSlot(a.$slots,"default")],8,rt)}const st=_(ot,[["render",it]]),lt={name:"Header",props:{title:{type:String,required:!0},image:{type:String,required:!1},background:{type:String,default:"light",required:!1}}},ct={class:"container"},dt={class:"row"},mt={class:"col-sm-6"},ut={class:"pt-5 pb-3 px-4"},ht={class:"col-sm-6 col-md-5 ms-auto"},pt=["src"];function ft(a,o,t,r,s,i){return e.openBlock(),e.createElementBlock("div",ct,[e.createElementVNode("div",{class:e.normalizeClass("bg-"+t.background+" mb-4")},[e.createElementVNode("div",dt,[e.createElementVNode("div",mt,[e.createElementVNode("div",ut,[e.createElementVNode("h2",null,e.toDisplayString(t.title),1),e.renderSlot(a.$slots,"default")])]),e.createElementVNode("div",ht,[t.image?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.image,alt:"",class:"h-100 w-100 object-cover"},null,8,pt)):e.createCommentVNode("",!0)])])],2)])}const bt=_(lt,[["render",ft]]);/*!
48
- * iamKey v3.7.8--beta
48
+ * iamKey v3.7.8--beta-2
49
49
  * Copyright 2022-2023 iamproperty
50
50
  */window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"Card"});let yt=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.querySelector('[class*="fa-"]')&&this.classList.add("card--has-icon");let o=this.classList.toString();const t=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",r=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${t}/css/core.min.css`,s=document.createElement("template");s.innerHTML=`
51
51
  <style>
@@ -64,7 +64,7 @@
64
64
  ${this.hasAttribute("data-cta")?`<div class="card__footer"><span class="link">${this.getAttribute("data-cta")}</span></div>`:""}
65
65
  </div>
66
66
  `,this.shadowRoot.appendChild(s.content.cloneNode(!0))}connectedCallback(){this.classList.add("loaded");const o=this.parentNode.closest("a, button, label"),t=this.shadowRoot.querySelector(".card");o.setAttribute("tabindex","-1"),o.matches("label[for]")&&(document.getElementById(o.getAttribute("for")).checked?t.classList.add("checked"):t.classList.remove("checked")),t.addEventListener("click",r=>{if(o.matches("label[for]")){r.stopPropagation(),r.preventDefault();const s=document.getElementById(o.getAttribute("for")),i=s.getAttribute("name"),n=s.getAttribute("id");Array.from(document.querySelectorAll(`[name="${i}"]:not([id="${n}"])`)).forEach((d,l)=>{document.querySelector(`[for="${d.getAttribute("id")}"] iam-card`).dispatchEvent(new Event("inactive"))}),o.click(),s.checked?t.classList.add("checked"):t.classList.remove("checked")}}),this.addEventListener("inactive",r=>{t.classList.remove("checked")}),t.addEventListener("keydown",r=>{switch(r.keyCode){case 32:case 13:if(o.matches("label[for]")){r.stopPropagation(),r.preventDefault();const s=document.getElementById(o.getAttribute("for")),i=s.getAttribute("name"),n=s.getAttribute("id");Array.from(document.querySelectorAll(`[name="${i}"]:not([id="${n}"])`)).forEach((d,l)=>{document.querySelector(`[for="${d.getAttribute("id")}"] iam-card`).dispatchEvent(new Event("inactive"))}),o.click(),s.checked?t.classList.add("checked"):t.classList.remove("checked")}else o.click();break}})}static get observedAttributes(){return["data-total","class"]}attributeChangedCallback(o,t,r){switch(o){case"data-total":{this.shadowRoot.querySelector(".card__total").innerHTML=r;break}case"class":{let s=this.classList.toString();this.querySelector('[class*="fa-"]')&&(s+=" card--has-icon"),this.shadowRoot.querySelector(".card").setAttribute("class",`card ${s}`);break}}}};const gt={name:"Card",mounted(){this.$nextTick(function(){window.customElements.get("iam-card")||window.customElements.define("iam-card",yt)})}};function _t(a,o,t,r,s,i){return e.openBlock(),e.createElementBlock("iam-card",null,[e.renderSlot(a.$slots,"default")])}const U=_(gt,[["render",_t]]);function kt(a){var o;let t=a.querySelector(".carousel__inner"),r=a.querySelectorAll(".carousel__item").length;a.getAttribute("data-cols");let s=a.getAttribute("data-sm-cols"),i=a.getAttribute("data-md-cols");a.querySelector(".carousel__controls a").classList.add("active"),t.addEventListener("scroll",function(n){clearTimeout(o),o=setTimeout(function(){let d=t.clientWidth,l=t.scrollWidth,c=t.scrollLeft,m=Math.round(c/l*r)+1,u=a.querySelector(".carousel__item:last-child").offsetLeft;Array.from(a.querySelectorAll(".carousel__controls a")).forEach((h,f)=>{h.classList.remove("active")}),a.querySelector(".control-"+m).classList.add("active"),m==1?a.querySelector(".btn-prev").setAttribute("disabled","disabled"):a.querySelector(".btn-prev").removeAttribute("disabled"),t.scrollLeft+d>u?a.querySelector(".btn-next").setAttribute("disabled","disabled"):a.querySelector(".btn-next").removeAttribute("disabled")},100)},!1),a.addEventListener("click",function(n){for(var d=n.target;d&&d!=this;d=d.parentNode)if(d.matches(".carousel__controls a")){n.preventDefault(),Array.from(a.querySelectorAll(".carousel__controls a")).forEach((c,m)=>{c.classList.remove("active")}),d.classList.add("active");const l=document.querySelector(d.getAttribute("href"));t.scroll({top:0,left:l.offsetLeft,behavior:"smooth"});break}},!1),a.addEventListener("click",function(n){for(var d=n.target;d&&d!=this;d=d.parentNode)if(d.matches(".btn-next, .btn-prev")){n.preventDefault();let l=d.classList.contains("btn-prev")?t.scrollLeft-t.clientWidth:t.scrollLeft+t.clientWidth;t.scroll({top:0,left:l,behavior:"smooth"});break}},!1),r==1&&a.classList.add("hide-btns"),s>=r&&a.classList.add("hide-sm-btns"),i>=r&&a.classList.add("hide-md-btns")}const lr="",wt={components:{Card:U},name:"Carousel",data(){return{id:null}},props:{items:{type:Array,required:!1},cols:{type:Number,required:!1,default:1},smcols:{type:Number,required:!1,default:1},mdcols:{type:Number,required:!1,default:3},gap:{type:Number,required:!1,default:4},cardtype:{type:String,required:!1},cardclass:{type:String,required:!1},btntype:{type:String,required:!1},titleclass:{type:String,required:!1},ctatext:{type:String,required:!1},hidectatext:{type:Boolean,required:!1,default:!1},colclass:{type:String,required:!1},type:{type:String,required:!1}},computed:{content(){return a=>`${a.image?`<img src="${a.image}" alt="" />`:""}${a.content?a.content:""}`}},mounted(){this.id=this._uid,this.$nextTick(function(){kt(this.$refs.wrapper)})}},At=["id","data-cols","data-sm-cols","data-md-cols"],St={class:"carousel__wrapper"},Et={class:"carousel__inner"},Lt=["id"],qt=["innerHTML","id"],$t=["href"],xt=e.createElementVNode("button",{class:"btn btn-prev","data-go":"0",disabled:""},"Prev",-1),vt=e.createElementVNode("button",{class:"btn btn-next","data-go":"2"},"Next",-1);function Nt(a,o,t,r,s,i){const n=e.resolveComponent("Card");return e.openBlock(),e.createElementBlock("div",{class:"container carousel",id:"carousel"+s.id,ref:"wrapper","data-cols":t.cols,"data-sm-cols":t.smcols,"data-md-cols":t.mdcols},[e.renderSlot(a.$slots,"default"),e.createElementVNode("div",St,[e.createElementVNode("div",Et,[t.type=="card"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(`row row-cols-${t.cols} row-cols-sm-${t.smcols} row-cols-md-${t.mdcols} ${t.gap?`g-${t.gap}`:""}`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(d,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`col carousel__item${t.colclass?` ${t.colclass}`:""}`),key:l,id:"carousel"+s.id+"slide"+(l+1)},[e.createVNode(n,e.mergeProps(d,{class:t.cardclass,type:t.cardtype,btnyype:t.btntype,titleclass:t.titleclass,ctatext:t.ctatext,hidectatext:t.hidectatext}),null,16,["class","type","btnyype","titleclass","ctatext","hidectatext"])],10,Lt))),128))],2)):e.createCommentVNode("",!0),t.type!="card"?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(`row row-cols-${t.cols} row-cols-sm-${t.smcols} row-cols-md-${t.mdcols} ${t.gap?`g-${t.gap}`:""}`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(d,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`col carousel__item${t.colclass?` ${t.colclass}`:""}`),key:l,innerHTML:i.content(d),id:"carousel"+s.id+"slide"+(l+1)},null,10,qt))),128))],2)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(`carousel__controls cols-${t.cols} cols-sm-${t.smcols} cols-md-${t.mdcols}`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(d,l)=>(e.openBlock(),e.createElementBlock("a",{key:l,href:"#carousel"+s.id+"slide"+(l+1),class:e.normalizeClass(`control-${l+1}`)},"Slide "+e.toDisplayString(l+1),11,$t))),128))],2),xt,vt])],8,At)}const Bt=_(wt,[["render",Nt]]);/*!
67
- * iamKey v3.7.8--beta
67
+ * iamKey v3.7.8--beta-2
68
68
  * Copyright 2022-2023 iamproperty
69
69
  */window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"header"});class Ct extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const o=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",t=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${o}/css/core.min.css`,r=document.createElement("template");r.innerHTML=`
70
70
  <style>
@@ -88,7 +88,7 @@
88
88
  </picture>
89
89
  </div>
90
90
  `,this.shadowRoot.appendChild(r.content.cloneNode(!0))}connectedCallback(){this.classList.add("loaded");const o=this.shadowRoot.querySelector("picture"),t=this.shadowRoot.querySelector("picture source");this.hasAttribute("image")?t.setAttribute("srcset",this.getAttribute("image")):o.remove()}}const Vt={name:"Header",props:{title:{type:String,required:!0},image:{type:String,required:!1}},mounted(){this.$nextTick(function(){window.customElements.get("iam-header")||window.customElements.define("iam-header",Ct)})}},Tt=["image"],Mt=["innerHTML"];function Ht(a,o,t,r,s,i){return e.openBlock(),e.createElementBlock("iam-header",{class:"bg-secondary",image:t.image},[e.renderSlot(a.$slots,"breadcrumb"),t.title?(e.openBlock(),e.createElementBlock("h1",{key:0,innerHTML:t.title},null,8,Mt)):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"default")],8,Tt)}const Dt=_(Vt,[["render",Ht]]);function zt(a){var o;const t=a.querySelector(".testimonial__images"),r=t.querySelectorAll("img").length;if(r==1)return!1;a.classList.add("testimonial--multi");const s=function(i){const n=a.querySelector(".btn-next"),d=a.querySelector(".btn-prev");n.setAttribute("data-go",i+1),d.setAttribute("data-go",i-1),n.removeAttribute("disabled"),d.removeAttribute("disabled"),i==1?d.setAttribute("disabled",!0):i==r&&n.setAttribute("disabled",!0)};t.addEventListener("scroll",function(i){clearTimeout(o),o=setTimeout(function(){let n=t.scrollWidth,d=t.scrollHeight,l=t.scrollLeft,c=t.scrollTop,m=Math.round(l/n*r)+1;l==0&&c!=0&&(m=Math.round(c/d*r)+1),a.setAttribute("data-show",m),s(m)},300)},!1),a.addEventListener("click",function(i){for(var n=i.target;n&&n!=this;n=n.parentNode)if(n.matches("[data-go]")){let d=parseInt(n.getAttribute("data-go")),l=0,c=0,m=t.scrollWidth,u=t.scrollHeight;m>u?c=Math.floor(m*((d-1)/r)):l=Math.floor(u*((d-1)/r)),t.scroll({top:l,left:c,behavior:"smooth"});break}},!1)}const cr="",Rt={name:"Testimonial",props:{items:{type:Array,required:!0},background:{type:String,default:"light",required:!1}},mounted(){zt(this.$refs.wrapper)}},Pt={class:"container testimonial mb-5","data-show":"1",ref:"wrapper"},It={class:"row"},Ft={class:"col-md-5 position-relative"},jt={class:"testimonial__images"},Ot=["src"],Ut=e.createElementVNode("div",{class:"testimonial__controls"},[e.createElementVNode("button",{"data-go":"0",disabled:"",class:"btn-prev"},"Previous"),e.createElementVNode("button",{"data-go":"2",class:"btn-next"},"Next")],-1),Wt={class:"col-md-7"},Gt=e.createElementVNode("h2",null,"What our customers think…",-1),Kt={class:"testimonial__content"},Yt=["innerHTML"],Zt=["innerHTML"],Jt={class:"testimonial__after"},Xt=e.createElementVNode("span",{class:"circle circle--dots d-none d-md-block"},null,-1);function Qt(a,o,t,r,s,i){return e.openBlock(),e.createElementBlock("div",Pt,[e.createElementVNode("div",{class:e.normalizeClass("bg-"+t.background)},[e.createElementVNode("div",It,[e.createElementVNode("div",Ft,[e.createElementVNode("div",jt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(n,d)=>(e.openBlock(),e.createElementBlock("img",{key:d,src:n.image?n.image:"data:image/gif;base64,R0lGODlhAQABAIAAAHd3dwAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",alt:"",class:e.normalizeClass("h-100 w-100 object-cover"+(n.image?"":" opacity-0"))},null,10,Ot))),128))]),Ut]),e.createElementVNode("div",Wt,[Gt,e.createElementVNode("div",Kt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(n,d)=>(e.openBlock(),e.createElementBlock("blockquote",{key:d,class:e.normalizeClass(n.class)},[e.createElementVNode("div",{innerHTML:n.quote},null,8,Yt),e.createElementVNode("cite",{innerHTML:n.cite},null,8,Zt)],2))),128))]),e.createElementVNode("div",Jt,[e.renderSlot(a.$slots,"default")])])]),Xt],2)],512)}const ea=_(Rt,[["render",Qt]]),dr="",ta={components:{Input:q},name:"PropertySearchbar",props:{formaction:{type:String,required:!1},formmethod:{type:String,required:!1},location:{type:String,required:!1},locations:{type:Array,required:!1},distances:{type:Array,required:!1,default(){return[{value:"0.25",display:"+¼ mi"},{value:"0.5",display:"+½ mi"},{value:"1",display:"+1 mi"},{value:"2",display:"+2 mi"},{value:"3",display:"+3 mi"},{value:"4",display:"+4 mi"},{value:"5",display:"+5 mi"}]}},pricemin:{type:Array,required:!1,default(){return[{value:"0",display:"No min"},{value:"50000",display:"£50k min"},{value:"75000",display:"£75k min"},{value:"100000",display:"£100k min"},{value:"150000",display:"£150k min"},{value:"200000",display:"£200k min"},{value:"250000",display:"£250k min"}]}},pricemax:{type:Array,required:!1,default(){return[{value:"any",display:"No max"},{value:"50000",display:"£50k max"},{value:"75000",display:"£75k max"},{value:"100000",display:"£100k max"},{value:"150000",display:"£150k max"},{value:"200000",display:"£200k max"},{value:"250000",display:"£250k max"}]}},bedsmin:{type:Array,required:!1,default(){return[{value:"any",display:"No min"},{value:"0",display:"Studio min"},{value:"1",display:"1 bed min"},{value:"2",display:"2 beds min"},{value:"3",display:"3 beds min"},{value:"4",display:"4 beds min"},{value:"5",display:"5 beds min"},{value:"6",display:"6 beds min"}]}},bedsmax:{type:Array,required:!1,default(){return[{value:"any",display:"No max"},{value:"0",display:"Studio max"},{value:"1",display:"1 bed max"},{value:"2",display:"2 beds max"},{value:"3",display:"3 beds max"},{value:"4",display:"4 beds max"},{value:"5",display:"5 beds max"},{value:"6",display:"6 beds max"}]}},propertytypes:{type:Array,required:!1,default(){return[{value:"all",display:"Show all"},{value:"Bungalow",display:"Bungalow"},{value:"Character Property",display:"Character Property"},{value:"Commercial Property",display:"Commercial Property"},{value:"Flat / Apartment",display:"Flat / Apartment"},{value:"Garage / Parking",display:"Garage / Parking"},{value:"Guest House / Hotel",display:"Guest House / Hotel"},{value:"House",display:"House"},{value:"House / Flat Share",display:"House / Flat Share"},{value:"Land",display:"Land"},{value:"Mobile / Park Home",display:"Mobile / Park Home"},{value:"Private Halls",display:"Private Halls"},{value:"Retirement Property",display:"Retirement Property"}]}}},data(){return{locationSave:""}},methods:{locationKeyup:function(a){this.$emit("locationKeyup",a)}},computed:{locationSet:{get(){return this.locationSave?this.locationSave:this.location},set(a){this.locationSave=a,this.$emit("input",a)}},locationsList(){return()=>this.locations?this.locations:[{value:"Newcastle"}]}}},aa={class:"container",ref:"wrapper"},oa={class:"property-searchbar"},ra=["action","method"],na={class:"col-12 col-md-3"},ia={class:"col-12 col-md"},sa=e.createElementVNode("span",{class:"form-label d-none d-md-block"},"Price range",-1),la={class:"row","data-input-range":""},ca={class:"col-12 col-md"},da=e.createElementVNode("span",{class:"form-label d-none d-md-block"},"Number of beds",-1),ma={class:"row","data-input-range":""},ua={class:"col-12 col-md-2"},ha=e.createElementVNode("div",{class:"col-12 col-md mw-md-fit-content d-flex property-searchbar__btn"},[e.createElementVNode("button",{class:"btn w-100 me-0",type:"submit",value:"submit"},"Search")],-1);function pa(a,o,t,r,s,i){const n=e.resolveComponent("Input");return e.openBlock(),e.createElementBlock("div",aa,[e.renderSlot(a.$slots,"default"),e.createElementVNode("div",oa,[e.createElementVNode("form",{class:"row",action:t.formaction,method:t.formmethod},[e.createElementVNode("fieldset",na,[e.createVNode(n,{inputClass:"input--locations",modelValue:i.locationSet,"onUpdate:modelValue":o[0]||(o[0]=d=>i.locationSet=d),label:"Location",id:"location",options:i.locationsList(),required:"",placeholder:"i.e. Newcastle or NE1",onKeyupEvent:o[1]||(o[1]=d=>i.locationKeyup(...arguments)),ref:"search"},null,8,["modelValue","options"]),e.createVNode(n,{class:"select--miles",label:"Miles",id:"miles",type:"select",options:t.distances},null,8,["options"])]),e.createElementVNode("fieldset",ia,[sa,e.createElementVNode("div",la,[e.createVNode(n,{class:"col-6",label:"Minimum price",id:"price-min","data-min":"true",type:"select",options:t.pricemin},null,8,["options"]),e.createVNode(n,{class:"col-6",label:"Maximum price",id:"price-max","data-max":"true",type:"select",options:t.pricemax},null,8,["options"])])]),e.createElementVNode("fieldset",ca,[da,e.createElementVNode("div",ma,[e.createVNode(n,{class:"col-6",label:"Minimum beds",id:"beds-min","data-min":"true",type:"select",options:t.bedsmin},null,8,["options"]),e.createVNode(n,{class:"col-6",label:"Maximum beds",id:"beds-max","data-max":"true",type:"select",options:t.bedsmax},null,8,["options"])])]),e.createElementVNode("fieldset",ua,[e.createVNode(n,{label:"Property type",id:"property-type",type:"select",options:t.propertytypes},null,8,["options"])]),ha],8,ra)]),e.renderSlot(a.$slots,"after")],512)}const fa=_(ta,[["render",pa]]),ba=a=>{Array.from(a.querySelectorAll("details")).forEach((o,t)=>{o.addEventListener("mouseenter",function(r){window.matchMedia("(min-width: 62em)").matches&&o.setAttribute("open","true")},!1),o.addEventListener("mouseleave",function(r){window.matchMedia("(min-width: 62em)").matches&&o.removeAttribute("open")},!1)}),"IntersectionObserver"in window&&new IntersectionObserver(([t])=>t.target.classList.toggle("is-stuck",t.intersectionRatio<1),{threshold:[1]}).observe(a)},mr="",ya={components:{Input:q,Logo:R},name:"Nav",props:{logo:{type:String,required:!1},logotext:{type:String,required:!1},logopath:{type:String,required:!1},search:{type:String,required:!1},btnlink:{type:String,required:!1},btntext:{type:String,required:!1},propertylink:{type:String,required:!1},movebutlerlink:{type:String,required:!1},iamsoldlink:{type:String,required:!1}},data(){return{locationSave:""}},methods:{subIsActive(a){return(Array.isArray(a)?a:[a]).some(t=>this.$route.path.indexOf(t)===0)}},computed:{hasLogoSlot(){return!!this.$slots.logo},hasSecondarySlot(){return!!this.$slots.secondary},hasSearchSlot(){return!!this.$slots.search},hasAccountSlot(){return!!this.$slots.account},isMarketplace(){return!1}},mounted(){this.$nextTick(function(){ba(this.$refs.wrapper)})}},ga=e.createElementVNode("input",{type:"checkbox",name:"showMenu",id:"showMenu",class:"d-none"},null,-1),_a=e.createElementVNode("input",{type:"checkbox",name:"showSearch",id:"showSearch",class:"d-none"},null,-1),ka=e.createElementVNode("input",{type:"checkbox",name:"showAccount",id:"showAccount",class:"d-none"},null,-1),wa={class:"nav__mobile-bar"},Aa={class:"container"},Sa={class:"row"},Ea={key:0,class:"col mw-md-fit-content nav__logo"},La={key:1,class:"col mw-md-fit-content nav__logo"},qa={href:"/",class:"text-decoration-none mb-0"},$a=e.createElementVNode("div",{class:"col mw-fit-content d-md-none flex-row align-items-center nav__menu-btn"},[e.createElementVNode("label",{for:"showMenu"},"Menu")],-1),xa={class:"nav__inner"},va={class:"container"},Na={class:"row"},Ba={key:0,class:"col mw-md-fit-content nav__logo"},Ca={key:1,class:"col mw-md-fit-content nav__logo"},Va={href:"/",class:"text-decoration-none mb-0"},Ta={key:2,class:"col mw-fit-content nav__search-btn flex-row align-items-center"},Ma=[e.createElementVNode("label",{for:"showSearch"},[e.createElementVNode("svg",{class:"icon",viewBox:"0 0 32 32"},[e.createElementVNode("title",null,"Search"),e.createElementVNode("ellipse",{cx:"14.92",cy:"13.81",rx:"11.92",ry:"11.81",class:"icon__outline"}),e.createElementVNode("line",{x1:"22.68",y1:"22.75",x2:"30",y2:"30",class:"icon__outline"})])],-1)],Ha=e.createElementVNode("div",{class:"col mw-fit-content d-md-none flex-row align-items-center nav__menu-btn"},[e.createElementVNode("label",{for:"showMenu"},"Menu")],-1),Da={class:"col-12 col-md nav__menu ms-auto flex-row align-items-center"},za={key:3,class:"col nav__account-btn flex-row align-items-center"},Ra=[e.createElementVNode("label",{for:"showAccount"},[e.createElementVNode("svg",{class:"icon",viewBox:"0 0 28 28"},[e.createElementVNode("path",{d:"M14,28a13.861,13.861,0,0,1-9.268-3.533l-.023.047-.721-.738L3.62,23.4l.012-.023a14,14,0,1,1,20.735,0l.012.023-.367.377-.722.738-.024-.045A13.855,13.855,0,0,1,14,28Zm0-9.58a10.5,10.5,0,0,0-1.368.092c-.085.012-.17.03-.252.047-.061.013-.124.026-.187.037l-.077.013c-.266.047-.54.095-.8.165-.108.029-.215.065-.318.1-.063.022-.125.043-.188.063l-.08.026c-.223.071-.454.144-.671.234-.125.05-.245.11-.362.168l-.146.072-.045.021c-.208.1-.423.2-.623.312-.131.074-.257.158-.379.239l-.106.07-.068.044c-.176.114-.359.232-.528.359-.137.1-.267.218-.393.327l-.054.047c-.174.15-.355.306-.519.47-.132.134-.258.277-.38.416l-.018.021c-.16.184-.3.35-.437.527-.12.161-.23.33-.337.494-.076.117-.146.238-.214.356a12.495,12.495,0,0,0,17.109,0l-.022-.037c-.061-.1-.125-.212-.192-.315-.1-.156-.214-.333-.338-.5-.141-.188-.293-.363-.436-.526-.113-.13-.253-.292-.4-.438-.161-.162-.337-.314-.517-.468l-.08-.069c-.118-.1-.24-.209-.368-.307-.183-.137-.379-.264-.568-.387l-.026-.017-.106-.07c-.125-.083-.251-.166-.381-.24-.207-.118-.429-.222-.643-.322l-.024-.011-.152-.074c-.116-.057-.235-.116-.356-.165-.214-.087-.438-.159-.656-.229l-.1-.031c-.066-.021-.132-.043-.2-.066-.1-.035-.2-.07-.309-.1-.264-.07-.538-.118-.8-.165l-.078-.014c-.063-.011-.126-.024-.187-.037-.082-.017-.167-.035-.252-.047A10.483,10.483,0,0,0,14,18.421Zm0-1.473a11.871,11.871,0,0,1,1.54.1c.1.013.192.033.284.052.069.014.139.028.209.04.34.058.672.118,1,.2.14.036.278.082.412.127l.151.05c.309.1.587.188.859.3.148.059.293.127.433.194l.13.061c.306.142.553.266.775.389.188.107.368.22.535.328.26.166.489.322.7.478.156.117.316.244.49.389.209.176.412.361.622.567.156.154.3.293.43.443.209.23.4.472.542.657l.051.066c.1.134.21.272.308.416.021.031.045.061.068.09a1.267,1.267,0,0,1,.085.117,12.525,12.525,0,1,0-19.24,0c.026-.04.056-.078.084-.114s.05-.064.073-.1c.1-.141.2-.278.3-.409l.046-.059c.2-.264.378-.478.555-.672.137-.152.281-.3.417-.43.215-.21.422-.4.635-.578.18-.15.332-.271.479-.381.208-.155.433-.31.709-.486.174-.111.346-.219.526-.319.274-.153.55-.285.783-.393l.112-.053c.144-.069.293-.14.445-.2.282-.113.578-.208.864-.3l.159-.052c.132-.044.265-.088.4-.124.331-.087.675-.148,1-.2.068-.012.137-.026.2-.039.094-.019.191-.039.288-.052A11.827,11.827,0,0,1,14,16.948Z",transform:"translate(0 -0.001)"}),e.createElementVNode("path",{d:"M5.2,10.4a5.2,5.2,0,1,1,5.2-5.2A5.206,5.206,0,0,1,5.2,10.4Zm0-8.915A3.714,3.714,0,1,0,8.915,5.2,3.719,3.719,0,0,0,5.2,1.486Z",transform:"translate(8.8 4.8)"})]),e.createElementVNode("span",null,"My account")],-1)],Pa={key:4,class:"col-12 col-md nav__btn mw-md-fit-content flex-row align-items-center"},Ia=["href","innerHTML"],Fa={key:0,class:"nav__menu--secondary"},ja={class:"container"},Oa={key:1,class:"nav__menu--search"},Ua={class:"bg-gradient pt-4"},Wa={class:"container"},Ga={key:0,class:"nav__menu--account"},Ka={class:"container"},Ya={class:"row mb-4"},Za={key:0,class:"col mw-md-fit-content nav__logo"},Ja={key:1,class:"col mw-md-fit-content nav__logo"},Xa={href:"/",class:"text-decoration-none mb-0"},Qa=e.createElementVNode("div",{class:"col mw-fit-content d-md-none flex-row align-items-center nav__menu-btn"},[e.createElementVNode("label",{for:"showAccount"},"Account")],-1),eo={class:"container"},to=e.createElementVNode("span",{class:"nav__bg"},null,-1);function ao(a,o,t,r,s,i){const n=e.resolveComponent("Logo");return e.openBlock(),e.createElementBlock("nav",{class:e.normalizeClass(`nav${i.hasSecondarySlot?" has-secondary":""}`),ref:"wrapper"},[ga,_a,ka,e.createElementVNode("div",wa,[e.createElementVNode("div",Aa,[e.createElementVNode("div",Sa,[i.hasLogoSlot?(e.openBlock(),e.createElementBlock("div",Ea,[e.renderSlot(a.$slots,"logo")])):(e.openBlock(),e.createElementBlock("div",La,[e.createElementVNode("a",qa,[e.createVNode(n,{id:t.logo,path:t.logopath,desc:t.logotext,class:"pb-0"},null,8,["id","path","desc"])])])),$a])])]),e.createElementVNode("div",xa,[e.createElementVNode("div",va,[e.createElementVNode("div",Na,[i.hasLogoSlot?(e.openBlock(),e.createElementBlock("div",Ba,[e.renderSlot(a.$slots,"logo")])):(e.openBlock(),e.createElementBlock("div",Ca,[e.createElementVNode("a",Va,[e.createVNode(n,{id:t.logo,path:t.logopath,desc:t.logotext,class:"pb-0"},null,8,["id","path","desc"])])])),i.hasSearchSlot?(e.openBlock(),e.createElementBlock("div",Ta,Ma)):e.createCommentVNode("",!0),Ha,e.createElementVNode("div",Da,[e.renderSlot(a.$slots,"default")]),i.hasAccountSlot?(e.openBlock(),e.createElementBlock("div",za,Ra)):e.createCommentVNode("",!0),t.btnlink?(e.openBlock(),e.createElementBlock("div",Pa,[e.createElementVNode("a",{href:t.btnlink,class:"btn me-0",innerHTML:t.btntext},null,8,Ia)])):e.createCommentVNode("",!0)])]),i.hasSecondarySlot?(e.openBlock(),e.createElementBlock("div",Fa,[e.createElementVNode("div",ja,[e.renderSlot(a.$slots,"secondary")])])):e.createCommentVNode("",!0),i.hasSearchSlot?(e.openBlock(),e.createElementBlock("div",Oa,[e.createElementVNode("div",Ua,[e.createElementVNode("div",Wa,[e.renderSlot(a.$slots,"search")])])])):e.createCommentVNode("",!0)]),i.hasAccountSlot?(e.openBlock(),e.createElementBlock("div",Ga,[e.createElementVNode("div",Ka,[e.createElementVNode("div",Ya,[i.hasLogoSlot?(e.openBlock(),e.createElementBlock("div",Za,[e.renderSlot(a.$slots,"logo")])):(e.openBlock(),e.createElementBlock("div",Ja,[e.createElementVNode("a",Xa,[e.createVNode(n,{id:t.logo,path:t.logopath,desc:t.logotext,class:"pb-0"},null,8,["id","path","desc"])])])),Qa])]),e.createElementVNode("div",eo,[e.renderSlot(a.$slots,"account")])])):e.createCommentVNode("",!0),to],2)}const oo=_(ya,[["render",ao]]),pr="",ro={name:"Stepper",props:{label:{type:String,required:!1},endlabel:{type:String,required:!1,default:"Complete"}}},no={class:"container"},io=["aria-label"],so={key:0,class:"h6 stepper__start"},lo={class:"list-unstyled"},co={class:"h6 stepper__end"};function mo(a,o,t,r,s,i){return e.openBlock(),e.createElementBlock("div",no,[e.createElementVNode("nav",{class:"stepper","aria-label":t.label?t.label:"Progress"},[t.label?(e.openBlock(),e.createElementBlock("span",so,e.toDisplayString(t.label),1)):e.createCommentVNode("",!0),e.createElementVNode("ol",lo,[e.renderSlot(a.$slots,"default")]),e.createElementVNode("span",co,e.toDisplayString(t.endlabel),1)],8,io)])}const uo=_(ro,[["render",mo]]),ho={name:"Stepper",props:{url:{type:String,required:!1},status:{type:String,required:!1},current:{type:String,required:!1}}},po=["href","aria-current"],fo={key:0,class:"visually-hidden"};function bo(a,o,t,r,s,i){return e.openBlock(),e.createElementBlock("li",null,[e.createElementVNode("a",{href:t.url,class:e.normalizeClass(`${t.status?"bg-"+t.status:""}${typeof t.current<"u"?"current":""}`),"aria-current":typeof t.current<"u"},[e.createElementVNode("span",null,[e.renderSlot(a.$slots,"default")]),t.status?(e.openBlock(),e.createElementBlock("em",fo," - status: "+e.toDisplayString(t.status),1)):e.createCommentVNode("",!0)],10,po)])}const yo=_(ho,[["render",bo]]);/*!
91
- * iamKey v3.7.8--beta
91
+ * iamKey v3.7.8--beta-2
92
92
  * Copyright 2022-2023 iamproperty
93
93
  */const go=function(a){const o=a.querySelectorAll(":scope > details");a.querySelectorAll(":scope > details > summary");let t=a.querySelector(":scope > .tabs__links");a.shadowRoot&&a.shadowRoot.querySelector(".tabs__links")&&(t=a.shadowRoot.querySelector(".tabs__links")),t||(t=document.createElement("div"),t.classList.add("tabs__links"),a.prepend(t)),o.forEach((r,s)=>{let i=r.querySelector(":scope > summary");i.classList.add("visually-hidden");let n=document.createElement("button");r.hasAttribute("id")&&(n=document.createElement("a"),n.setAttribute("href",`#${r.getAttribute("id")}`)),r.hasAttribute("open")&&n.setAttribute("aria-pressed",!0),n.innerHTML=`${i.innerText}`,n.classList.add("link"),n.setAttribute("data-index",s),n.setAttribute("tabindex","-1"),t.appendChild(n)})},_o=function(a){let o=a.querySelectorAll(":scope > details"),t=a.querySelectorAll(":scope > details > summary"),r=a.querySelectorAll(":scope .tabs__links > .link");a.shadowRoot&&(r=a.shadowRoot.querySelectorAll(".tabs__links > .link")),r.forEach(s=>{s.addEventListener("click",i=>{i.preventDefault(),r.forEach(n=>{let d=n==s;n.setAttribute("aria-pressed",d)}),o.forEach((n,d)=>{let l=s.getAttribute("data-index")==d;l?n.setAttribute("open",l):n.removeAttribute("open")}),s.hasAttribute("href")&&history.pushState(void 0,void 0,s.getAttribute("href")),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"openTab",tabTitle:s.textContent})})}),t.forEach((s,i)=>{s.addEventListener("focus",n=>{r.forEach(d=>{d.classList.remove("focus")}),r[i].classList.add("focus")}),s.addEventListener("click",n=>{n.preventDefault(),r[i].click()})})},ko=function(a){let o=a.querySelectorAll(":scope > details"),t=a.querySelectorAll(":scope > .tabs__links > button, .tabs__links > a");a.shadowRoot&&(t=a.shadowRoot.querySelectorAll(".tabs__links > button, .tabs__links > a")),location.hash&&a.querySelector(`.tabs__links [href="${location.hash}"]`)?(a.querySelector(`[href="${location.hash}"]`).setAttribute("open",!0),a.querySelector(`details[id="${location.hash.replace("#","")}"]`).setAttribute("open",!0)):a.querySelector("details[open]")||(o[0].setAttribute("open",!0),t[0].setAttribute("aria-pressed",!0))},wo=function(a){go(a),_o(a),ko(a)};window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"tabs"});class Ao extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const o=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",t=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${o}/css/core.min.css`,r=document.createElement("template");r.innerHTML=`
94
94
  <style>
@@ -105,7 +105,7 @@
105
105
  <slot></slot>
106
106
  </div>
107
107
  `,this.shadowRoot.appendChild(r.content.cloneNode(!0))}connectedCallback(){let o=this.classList.toString().replace("container","");this.shadowRoot.querySelector(".tabs").setAttribute("class",`tabs ${o}`),wo(this)}}const fr="";window.customElements.get("iam-tabs")||window.customElements.define("iam-tabs",Ao);const So={name:"Tabs"},Eo={ref:"wrapper"};function Lo(a,o,t,r,s,i){return e.openBlock(),e.createElementBlock("iam-tabs",Eo,[e.renderSlot(a.$slots,"default")],512)}const qo=_(So,[["render",Lo]]),$o={name:"Tab",props:{title:{type:String,required:!0},lazy:{type:Boolean,required:!1}},data(){return{show:!this.lazy}},watch:{show(a,o){console.log(a)}}},xo={class:"tab"},vo=["innerHTML"];function No(a,o,t,r,s,i){return e.openBlock(),e.createElementBlock("details",xo,[e.createElementVNode("summary",{innerHTML:t.title},null,8,vo),e.renderSlot(a.$slots,"default")])}const Bo=_($o,[["render",No]]);let W=M.props;W.fields.required=!1;const Co={components:{Table:M,Input:q},data(){return{itemsData:[...this.items]}},methods:{submitForm:function(a){console.log(this);const o=new FormData(a.target);let t=new Date;const r=t.getFullYear();let s=t.getMonth()+1,i=t.getDate();i<10&&(i="0"+i),s<10&&(s="0"+s),t=i+"/"+s+"/"+r,this.itemsData.unshift({date_added:t,user:o.get("user"),note:o.get("addNote")}),this.$emit("formSubmitted",a)}},name:"NoteFeed",props:{user:{type:String,required:!0},...W,title:{type:String,required:!1},method:{type:String,required:!1,default:"post"},action:{type:String,required:!1}}},Vo={class:"container note-feed mb-2"},To=["innerHTML"],Mo=["action","method"],Ho=["value"],Do=e.createElementVNode("button",{class:"btn btn-tertiary"},"Submit note",-1);function zo(a,o,t,r,s,i){const n=e.resolveComponent("Table"),d=e.resolveComponent("Input");return e.openBlock(),e.createElementBlock("div",Vo,[t.title?(e.openBlock(),e.createElementBlock("span",{key:0,class:"h3",innerHTML:t.title},null,8,To)):e.createCommentVNode("",!0),e.createVNode(n,e.mergeProps({fields:[{key:"date_added"},{key:"user"},{key:"note"}],items:s.itemsData},a.$props,{class:"mb-0"}),null,16,["items"]),e.createElementVNode("form",{action:t.action,method:t.method,onSubmit:o[0]||(o[0]=e.withModifiers(l=>i.submitForm(...arguments),["prevent"]))},[e.createElementVNode("input",{type:"hidden",value:t.user,name:"user"},null,8,Ho),e.createVNode(d,{id:"addNote",type:"textarea",label:"Add note",required:"",class:"mw-100"}),Do],40,Mo)])}const Ro=_(Co,[["render",zo]]);/*!
108
- * iamKey v3.7.8--beta
108
+ * iamKey v3.7.8--beta-2
109
109
  * Copyright 2022-2023 iamproperty
110
110
  */function Po(a,o){function t(r,s){let i=!1,n=s.getAttribute("name");n.includes("[]")&&(n=n.replace("[]",`[${s.value}]`));let d=r.querySelector(`[data-name="${n}"]`);d&&s.getAttribute("type")=="checkbox"&&(i=!0);let l=s.getAttribute("data-filter-text");if(d||(d=document.createElement("button"),r.appendChild(d)),d.setAttribute("type","button"),d.classList.add("filter"),d.setAttribute("data-name",n),d.innerHTML=l.replace("$value",s.value),(!s.value||i)&&d.remove(),s.parentNode.closest("[data-filter-text]")){let c=s.parentNode.closest("[data-filter-text]"),m=!0;if(n="",c.querySelectorAll("input").forEach((u,h)=>{let f=u.getAttribute("name");if(n+=`${h!=0?",":""}${f}`,r.querySelector(`[data-name="${f}"]`)&&r.querySelector(`[data-name="${f}"]`).remove(),u.value){let p=document.createElement("button");p.setAttribute("type","button"),p.classList.add("filter"),p.setAttribute("data-name",f),p.innerHTML=l.replace("$value",u.value),r.appendChild(p)}else m=!1}),r.querySelector(`[data-name="${n}"]`)&&r.querySelector(`[data-name="${n}"]`).remove(),m){let u=c.getAttribute("data-filter-text");c.querySelectorAll("input").forEach((f,p)=>{let g=f.getAttribute("name");r.querySelector(`[data-name="${g}"]`)&&r.querySelector(`[data-name="${g}"]`).remove(),u=u.replace(`$${p+1}`,f.value)});let h=document.createElement("button");h.setAttribute("type","button"),h.classList.add("filter"),h.setAttribute("data-name",n),h.innerHTML=u,r.appendChild(h)}}}Array.from(a.querySelectorAll('input[type="checkbox"]:checked')).forEach((r,s)=>{t(o,r)}),a.addEventListener("change",function(r){if(r&&r.target instanceof HTMLElement&&r.target.closest("input[data-filter-text]")){let s=r.target.closest("input[data-filter-text]");t(o,s)}},!1),o.addEventListener("click",function(r){if(r&&r.target instanceof HTMLElement&&r.target.closest(".filter")){let n=r.target.closest(".filter"),d=n.getAttribute("data-name").split(",");for(var s=0;s<d.length;s++){let l=d[s],c=`[name="${l}"]`;l.match(/\[(.*)\]/)&&(l.replace(/\[(.*)\]/,"[]"),c=`[value="${l.replace(/.*\[(.*)\]/,"$1")}"]`);let m=a.querySelectorAll(c);for(var i=0;i<m.length;i++){let u=m[i];if(u.getAttribute("type")!="radio"&&u.getAttribute("type")!="checkbox")u.value="";else{u.checked=!1;var r=new Event("force");u.closest("form").dispatchEvent(r)}}}n.remove()}},!1)}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"Applied Filters"});class Io extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const o=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",t=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${o}/css/core.min.css`;let r=this.classList.toString();const s=document.createElement("template");s.innerHTML=`
111
111
  <style>
@@ -117,7 +117,7 @@
117
117
  <div class="applied-filters ${r}"></div>
118
118
  <slot></slot>
119
119
  `,this.shadowRoot.appendChild(s.content.cloneNode(!0))}connectedCallback(){Po(this,this.shadowRoot.querySelector(".applied-filters"))}}window.customElements.get("iam-applied-filters")||window.customElements.define("iam-applied-filters",Io);const Fo={name:"Header"};function jo(a,o,t,r,s,i){return e.openBlock(),e.createElementBlock("iam-applied-filters",null,[e.renderSlot(a.$slots,"default")])}const Oo=_(Fo,[["render",jo]]);/*!
120
- * iamKey v3.7.8--beta
120
+ * iamKey v3.7.8--beta-2
121
121
  * Copyright 2022-2023 iamproperty
122
122
  */function Uo(a,o){Wo(a,o)}function Wo(a,o){var t;o.addEventListener("keyup",r=>{clearTimeout(t),t=setTimeout(function(){G(a,o.value)},500)}),o.addEventListener("change",r=>{clearTimeout(t),G(a,o.value)})}const G=function(a,o){Array.from(a.querySelectorAll(":scope > li")).forEach((t,r)=>{let s=t.textContent.toLowerCase();t.classList.add("d-none"),s.includes(o.toLowerCase())&&t.classList.remove("d-none")}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"Filtered list",value:o})};window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"filterlist"});class Go extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const o=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",t=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${o}/css/core.min.css`,r=document.createElement("template");r.innerHTML=`
123
123
  <style>
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "name": "iamproperty"
6
6
  },
7
7
  "private": false,
8
- "version": "3.7.8--beta",
8
+ "version": "3.7.8--beta-2",
9
9
  "scripts": {
10
10
  "bootstrap": "copyfiles -u 2 node_modules/bootstrap/**/* assets/bootstrap",
11
11
  "dev": "npm run copy && node local_modules/delete-assets.js && vite --host",