@iamproperty/components 4.1.0 → 4.1.1-beta
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.
- package/assets/js/components/accordion/accordion.component.min.js +1 -1
- package/assets/js/components/actionbar/actionbar.component.min.js +1 -1
- package/assets/js/components/address-lookup/address-lookup.component.js +1 -1
- package/assets/js/components/address-lookup/address-lookup.component.min.js +2 -2
- package/assets/js/components/address-lookup/address-lookup.component.min.js.map +1 -1
- package/assets/js/components/applied-filters/applied-filters.component.min.js +1 -1
- package/assets/js/components/card/card.component.min.js +1 -1
- package/assets/js/components/collapsible-side/collapsible-side.component.min.js +1 -1
- package/assets/js/components/filterlist/filterlist.component.min.js +1 -1
- package/assets/js/components/header/header.component.min.js +1 -1
- package/assets/js/components/nav/nav.component.min.js +1 -1
- package/assets/js/components/notification/notification.component.min.js +1 -1
- package/assets/js/components/pagination/pagination.component.min.js +1 -1
- package/assets/js/components/table/table.component.min.js +1 -1
- package/assets/js/components/tabs/tabs.component.min.js +1 -1
- package/assets/js/dynamic.min.js +1 -1
- package/assets/js/scripts.bundle.js +1 -1
- package/assets/js/scripts.bundle.min.js +1 -1
- package/assets/ts/components/address-lookup/address-lookup.component.ts +1 -1
- package/dist/components.es.js +13 -13
- package/dist/components.umd.js +19 -19
- package/package.json +1 -1
- package/src/components/AddressLookup/AddressLookup.vue +1 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v4.1.
|
|
2
|
+
* iamKey v4.1.1-beta
|
|
3
3
|
* Copyright 2022-2023 iamproperty
|
|
4
4
|
*/function n(r){let a=r.querySelectorAll("details"),e=r.querySelectorAll("summary");if(a.forEach(o=>{o.classList.add("accordion-item")}),e.forEach(o=>{o.classList.add("accordion-header"),o.classList.add("accordion-button"),o.classList.add("h4")}),!r.classList.contains("accordion--keep-open")){const o=r.querySelectorAll(":scope > details");o.forEach(c=>{c.addEventListener("click",()=>{o.forEach(i=>{i!==c&&i.removeAttribute("open")})})})}}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"accordion"});class t extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const a=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",e=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${a}/css/core.min.css`,o=document.createElement("template");o.innerHTML=`
|
|
5
5
|
<style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v4.1.
|
|
2
|
+
* iamKey v4.1.1-beta
|
|
3
3
|
* Copyright 2022-2023 iamproperty
|
|
4
4
|
*/const A=function(o){typeof window.player<"u"&&typeof window.player.pauseVideo=="function"&&window.player.pauseVideo();var e=o.getAttribute("data-id"),n=o.getAttribute("id");if(typeof n>"u"||n==null){var c=String.fromCharCode(65+Math.floor(Math.random()*26));n=c+Date.now(),o.setAttribute("id",n)}function s(){window.player=new YT.Player(n,{height:"100%",width:"100%",videoId:e,playerVars:{modestbranding:1,playsinline:1,rel:0,showinfo:0},events:{onReady:i,onStateChange:a}})}s();function i(r){r.target.playVideo()}var t=!1;function a(r){if(r.data==YT.PlayerState.PLAYING&&!t){var d=document.getElementById(n);d.classList.add("player-ready"),t=!0}}},v=o=>(Array.from(o.querySelectorAll("dialog[open]")).forEach((e,n)=>{e.closest(".dialog__wrapper")||(e.removeAttribute("open"),e.showModal(),e.focus(),g(e))}),o.addEventListener("click",e=>{if(e.target.tagName=="IAM-ACTIONBAR")return!1;if(e&&e.target instanceof HTMLElement&&e.target.closest("[data-modal]")){const s=e.target.closest("[data-modal]"),i=s.hasAttribute("data-modal")?s.getAttribute("data-modal"):s.getAttribute("data-filter"),t=document.querySelector(`dialog#${i}`);g(t),t.showModal(),t.focus();let a=t.offsetWidth;t.setAttribute("style",`max-width: ${a}px;`),Array.from(t.querySelectorAll("[data-duplicate]")).forEach((r,d)=>{const p=r.getAttribute("data-duplicate"),l=document.getElementById(p);if(r.checked!=l.checked){r.checked=l.checked;let f=new Event("change");r.dispatchEvent(f)}}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"openModal",id:i})}if(e&&e.target instanceof HTMLElement&&e.target.closest("button.dialog__close")){const s=e.target.closest("dialog[open]");e.preventDefault(),s.close(),Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach((i,t)=>{i.classList.remove("active")}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:s.getAttribute("id")})}if(e&&e.target instanceof HTMLElement&&e.target.closest('button[formmethod="dialog"]')){const s=e.target.closest("dialog[open]");Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach((i,t)=>{i.classList.remove("active")}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:s.getAttribute("id")})}if(e&&e.target instanceof HTMLElement&&e.target.closest("dialog[open]")){let s=e.target.closest("dialog[open]");var n=window.getComputedStyle(s);if(n.display==="contents"&&(s=s.parentNode.closest("dialog[open]")),!s.querySelector(":scope > .mh-lg > form:last-child > button:last-child, :scope > .mh-lg > button:last-child")||s.classList.contains("dialog--multi")){const i=s.getBoundingClientRect();(e.clientX<i.left||e.clientX>i.right||e.clientY<i.top||e.clientY>i.bottom)&&(e.target.closest('input[type="radio"]')||s.close(),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:s.getAttribute("id")}))}}if(e&&e.target instanceof HTMLElement&&e.target.closest(".dialog__wrapper > button")){e.stopPropagation();let s=e.target.closest(".dialog__wrapper > button"),i=e.target.closest(".dialog__wrapper > button").parentNode,t="openPopover",a=i.querySelector(":scope > dialog");if(document.querySelector("*:not([data-keep-open]) > dialog[open]")&&document.querySelector("*:not([data-keep-open]) > dialog[open]")!=a&&document.querySelector("*:not([data-keep-open]) > dialog[open]").close(),Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach((l,f)=>{l.classList.remove("active")}),a.hasAttribute("open"))a.close(),t="closePopover",a.removeAttribute("style"),s.classList.remove("active");else{a.show(),s.classList.add("active");var c=s.getBoundingClientRect();let l=c.top,f=c.left;if(s.closest("iam-table")){let b=s.closest("iam-table").parentNode.getBoundingClientRect();l-=b.top,f-=b.left}a.classList.contains("dialog--fix")&&a.setAttribute("style",`position:fixed;top: ${l}px; left: ${f}px; margin: 3rem 0 0 0;`)}let r=a.getBoundingClientRect(),d=r.bottom-window.scrollY,p=window.innerHeight-window.scrollY;if(d>p){let l=a.hasAttribute("style")?a.getAttribute("style")+" ":"";a.setAttribute("style",l+"transform: translate(0, calc(-100% - 4rem))"),r=a.getBoundingClientRect(),r.top-window.scrollY<100&&a.removeAttribute("style")}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:t,id:s.textContent})}e&&e.target instanceof HTMLElement&&!e.target.closest("dialog[open]")&&!e.target.closest(".dialog__wrapper > button")&&(document.querySelector(".dialog__wrapper:not([data-keep-open]) > dialog[open]")&&document.querySelector(".dialog__wrapper:not([data-keep-open]) > dialog[open]").close(),Array.from(document.querySelectorAll(".dialog__wrapper:not([data-keep-open]) > button")).forEach((s,i)=>{s.classList.remove("active")}))}),null),g=o=>{o.querySelector(":scope > .mh-lg > form:last-child > button:last-child, :scope > .mh-lg > button:last-child")&&!o.classList.contains("dialog--multi")&&o.addEventListener("cancel",n=>{n.preventDefault()});let e=o.querySelector(".youtube-embed a");if(e&&A(e),o.classList.contains("dialog--multi")&&!o.querySelector(":scope > .steps")&&L(o),!o.querySelector(":scope > .mh-lg")&&!o.classList.contains("dialog--multi")){o.innerHTML=`<div class="mh-lg">${o.innerHTML}</div>`;let n=o.querySelector(".mh-lg"),c=o.querySelector(".mh-lg :is(.h1,.h2,.h3,.h4,.h5,.h6)");if(c){let s=c.previousSibling;n.before(c),s&&c.before(s)}}o.querySelector(":scope > button:first-child")||o.insertAdjacentHTML("afterbegin",'<button class="dialog__close">Close</button>')},L=o=>{let e="",n=Array.from(o.querySelectorAll("fieldset[data-title]")),c=o.querySelector("form");n.forEach((t,a)=>{e+=`<button data-title="${t.getAttribute("data-title")}" type="button" class="${a==0?"active":""}" tabindex="-1">${t.getAttribute("data-title")}</button>`;const r=document.createElement("div");if(r.classList.add("btn--wrapper"),t.appendChild(r),a!=0&&(r.innerHTML+=`<button data-title="${n[a-1].getAttribute("data-title")}" class="btn btn-secondary mb-0" data-previous type="button">Previous</button>`),a!=n.length-1&&(r.innerHTML+=`<button data-title="${n[a+1].getAttribute("data-title")}" class="btn btn-primary mb-0" data-next type="button">Next</button>`),a==n.length-1)if(c&&c.querySelector(':scope > button[type="submit"]')){let d=c.querySelector(':scope > button[type="submit"]');d.classList.add("mb-0"),r.insertAdjacentElement("beforeend",d)}else r.innerHTML+=`<button data-title="${n[a].getAttribute("data-title")}" class="btn btn-primary mb-0" data-next type="submit">Submit</button>`}),o.insertAdjacentHTML("afterbegin",`<div class="steps bg-primary">${e}</div>`);let s=Array.from(o.querySelectorAll("fieldset.was-validated"));for(let t=0;t<s.length;t++){let a=s[t],r=a.getAttribute("data-title");if(a.querySelector(".is-invalid")){Array.from(o.querySelectorAll(`[data-title="${r}"]`)).forEach((d,p)=>{d.classList.add("active")});break}else Array.from(o.querySelectorAll(`[data-title="${r}"]`)).forEach((d,p)=>{d.classList.add("valid")})}o.addEventListener("invalid",function(){return function(t){t.preventDefault()}}(),!0);function i(t){const a=o.querySelector("fieldset.active")?o.querySelector("fieldset.active"):o.querySelector("fieldset[data-title]"),r=a.getAttribute("data-title");let d=!0;if(a.classList.add("was-validated"),Array.from(a.querySelectorAll("input")).forEach((f,b)=>{f.checkValidity()||(d=!1)}),d?Array.from(o.querySelectorAll(`[data-title="${r}"]`)).forEach((f,b)=>{f.classList.add("valid")}):Array.from(o.querySelectorAll(`[data-title="${r}"]`)).forEach((f,b)=>{f.classList.remove("valid")}),d||!t.hasAttribute("data-next")){const f=o.querySelector(`fieldset[data-title="${t.getAttribute("data-title")}"]`),b=o.querySelector(`.steps button[data-title="${t.getAttribute("data-title")}"]`);Array.from(o.querySelectorAll("button")).forEach((h,m)=>{h.classList.remove("active")}),Array.from(o.querySelectorAll("fieldset")).forEach((h,m)=>{h.classList.remove("active")}),b.classList.add("active"),f.classList.add("active")}let p=Array.from(o.querySelectorAll("fieldset")).length,l=Array.from(o.querySelectorAll("fieldset.valid")).length;o.style.setProperty("--progress",`${l/(p-1)*100}%`)}o.addEventListener("keydown",t=>{if(t&&t.target instanceof HTMLElement&&t.target.closest("button")){const a=t.target.closest("button");t.keyCode==13&&a.getAttribute("type")!="submit"&&(t.preventDefault(),i(a))}t&&t.target instanceof HTMLElement&&t.target.closest("input")&&(t.target.closest("input").classList.remove("is-invalid"),t.keyCode==13&&t.preventDefault())}),o.addEventListener("click",t=>{if(t&&t.target instanceof HTMLElement&&t.target.closest('button[type="submit"]'))t.target.closest("form").classList.add("was-validated");else if(t&&t.target instanceof HTMLElement&&t.target.closest("button[data-title]")){const a=t.target.closest("button[data-title]");i(a)}return null})};window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"action bar"});function w(o,e){o&&e=="all"?(o.querySelector("input").indeterminate=!1,o.querySelector("input").checked=!0,o.querySelector("label").textContent="Select all"):o&&e==0?(o.querySelector("input").indeterminate=!1,o.querySelector("input").checked=!1,o.querySelector("label").textContent="Select all"):o&&e?(o.querySelector("input").indeterminate=!0,o.querySelector("input").checked=!1,o.querySelector("label").textContent=`${e} item${e>1?"s":""} selected`):o&&(o.querySelector("input").checked=!1,o.querySelector("input").indeterminate=!1,o.querySelector("label").textContent="Select all")}class S extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const e=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",n=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${e}/css/core.min.css`,c=document.createElement("template");c.innerHTML=`
|
|
5
5
|
<style>
|
|
@@ -59,7 +59,7 @@ class iamAddressLookup extends HTMLElement {
|
|
|
59
59
|
connectedCallback() {
|
|
60
60
|
return __awaiter(this, void 0, void 0, function* () {
|
|
61
61
|
const wrapper = this.shadowRoot.querySelector('.wrapper');
|
|
62
|
-
const lookup = this.shadowRoot.querySelector('
|
|
62
|
+
const lookup = this.shadowRoot.querySelector('[name="postcode"]');
|
|
63
63
|
const lookupWrapper = this.shadowRoot.querySelector('.postcode-lookup');
|
|
64
64
|
const manualWrapper = this.shadowRoot.querySelector('.manual-address');
|
|
65
65
|
const list = this.shadowRoot.querySelector('datalist');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v4.1.
|
|
2
|
+
* iamKey v4.1.1-beta
|
|
3
3
|
* Copyright 2022-2023 iamproperty
|
|
4
4
|
*/import f from"js-cookie";var b=function(m,s,o,r){function u(d){return d instanceof o?d:new o(function(c){c(d)})}return new(o||(o=Promise))(function(d,c){function h(e){try{t(r.next(e))}catch(a){c(a)}}function i(e){try{t(r.throw(e))}catch(a){c(a)}}function t(e){e.done?d(e.value):u(e.value).then(h,i)}t((r=r.apply(m,s||[])).next())})};window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"Address Lookup"});class y extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const s=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",o=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${s}/css/core.min.css`,r=document.createElement("template");r.innerHTML=`
|
|
5
5
|
<style>
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
<button class="btn btn-tertiary switch-to-lookup-btn">Use postcode lookup</button>
|
|
33
33
|
</div>
|
|
34
34
|
</div>
|
|
35
|
-
`,this.shadowRoot.appendChild(r.content.cloneNode(!0))}connectedCallback(){return b(this,void 0,void 0,function*(){this.shadowRoot.querySelector(".wrapper");const s=this.shadowRoot.querySelector("
|
|
35
|
+
`,this.shadowRoot.appendChild(r.content.cloneNode(!0))}connectedCallback(){return b(this,void 0,void 0,function*(){this.shadowRoot.querySelector(".wrapper");const s=this.shadowRoot.querySelector('[name="postcode"]'),o=this.shadowRoot.querySelector(".postcode-lookup"),r=this.shadowRoot.querySelector(".manual-address"),u=this.shadowRoot.querySelector("datalist"),d=this.shadowRoot.querySelector(".switch-to-manual-btn"),c=this.shadowRoot.querySelector(".switch-to-lookup-btn");if(this.hasAttribute("data-use")){let t=`<div><input type="checkbox" name="use" id="use" value="yes"><label for="use">${this.hasAttribute("data-use-label")?this.getAttribute("data-use-label"):"Use saved address"}</label></div>`;o.insertAdjacentHTML("afterbegin",t),this.shadowRoot.addEventListener("change",e=>{if(e&&e.target instanceof HTMLElement&&e.target.closest('[name="use"]')&&e.target.closest('[name="use"]').checked){o.classList.add("js-hide"),r.classList.remove("js-hide");let n=JSON.parse(this.getAttribute("data-use"));Object.keys(n).forEach((l,v)=>{let p=n[l];this.querySelector(`[data-name="${l}"]`)?this.querySelector(`[data-name="${l}"]`).value=p:this.querySelector(`[name="${l}"]`)&&(this.querySelector(`[name="${l}"]`).value=p)})}})}d.addEventListener("click",i=>{o.classList.add("js-hide"),r.classList.remove("js-hide"),Array.from(this.querySelectorAll("[data-required]")).forEach((t,e)=>{t.setAttribute("required","true")})}),c.addEventListener("click",i=>{o.classList.remove("js-hide"),r.classList.add("js-hide")}),s.addEventListener("keyup",i=>{s.value.length>=3&&h(s.value)}),s.addEventListener("change",i=>{if(s.value.length>=3&&(h(s.value),u.querySelector(`[value="${s.value}"]`))){o.classList.add("js-hide"),r.classList.remove("js-hide");let t=JSON.parse(u.querySelector(`[value="${s.value}"]`).getAttribute("data-values"));Object.keys(t).forEach((e,a)=>{let n=t[e];this.querySelector(`[data-name="${e}"]`)?this.querySelector(`[data-name="${e}"]`).value=n:this.querySelector(`[name="${e}"]`)&&(this.querySelector(`[name="${e}"]`).value=n)}),this.querySelector('[data-name="address_1"]').focus(),Array.from(this.querySelectorAll("[data-required]")).forEach((e,a)=>{e.setAttribute("required","true")}),s.removeAttribute("required"),this.shadowRoot.querySelector('[name="use"]')&&(this.shadowRoot.querySelector('[name="use"]').checked=!1)}});const h=i=>b(this,void 0,void 0,function*(){let t=this.getAttribute("data-url");t+=`${encodeURI(i)}`,window.controller||(window.controller=[]),window.controller[t]&&window.controller[t].abort(),window.controller[t]=new AbortController;const{signal:e}=controller[t];try{yield fetch(t,{signal:e,method:"get",credentials:"same-origin",headers:new Headers({"Content-Type":"application/json",Accept:"application/json","X-Requested-With":"XMLHttpRequest","X-XSRF-TOKEN":f.get("XSRF-TOKEN")})}).then(a=>a.json()).then(a=>{let n="";return a.forEach((l,v)=>{let p=JSON.stringify(l.value);n+=`<option value="${l.label}, ${i}" data-values='${p}'></option>`}),u.innerHTML=n,a})}catch(a){console.log(a)}})})}}export{y as default};
|
|
36
36
|
//# sourceMappingURL=address-lookup.component.min.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"address-lookup.component.min.js","sources":["address-lookup.component.js"],"sourcesContent":["var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n// @ts-nocheck\nimport Cookies from 'js-cookie';\n// Data layer Web component created\nwindow.dataLayer = window.dataLayer || [];\nwindow.dataLayer.push({\n \"event\": \"customElementRegistered\",\n \"element\": \"Address Lookup\"\n});\nclass iamAddressLookup extends HTMLElement {\n constructor() {\n super();\n this.attachShadow({ mode: 'open' });\n const assetLocation = document.body.hasAttribute('data-assets-location') ? document.body.getAttribute('data-assets-location') : '/assets';\n const coreCSS = document.body.hasAttribute('data-core-css') ? document.body.getAttribute('data-core-css') : `${assetLocation}/css/core.min.css`;\n const loadCSS = `@import \"${assetLocation}/css/components/address-lookup.css\";`;\n const template = document.createElement('template');\n template.innerHTML = `\n <style>\n @import \"${coreCSS}\";\n ${loadCSS}\n \n ${this.hasAttribute('css') ? `@import \"${this.getAttribute('css')}\";` : ``}\n </style>\n <link rel=\"stylesheet\" href=\"https://kit.fontawesome.com/26fdbf0179.css\" crossorigin=\"anonymous\" />\n <div class=\"wrapper\">\n\n <div class=\"postcode-lookup\">\n <div>\n <label class=\"mb-2\">Search property address <span class=\"optional\">(Optional)</span>\n <span>\n <input type=\"text\" name=\"postcode\" list=\"address-lookup__addressess\" autoComplete=\"new-password\" aria-autocomplete=\"none\" placeholder=\"Postcode\" />\n <span class=\"suffix fa-regular fa-search\"></span>\n </span>\n <span class=\"invalid-feedback\">Required Adddress fields missing</span>\n </label>\n\n </div>\n <button class=\"btn btn-tertiary switch-to-manual-btn\">Or enter address manually</button>\n </div>\n <datalist id=\"address-lookup__addressess\"></datalist>\n\n <div class=\"manual-address pb-2 js-hide\">\n <slot></slot>\n <button class=\"btn btn-tertiary switch-to-lookup-btn\">Use postcode lookup</button>\n </div>\n </div>\n `;\n this.shadowRoot.appendChild(template.content.cloneNode(true));\n }\n connectedCallback() {\n return __awaiter(this, void 0, void 0, function* () {\n const wrapper = this.shadowRoot.querySelector('.wrapper');\n const lookup = this.shadowRoot.querySelector('label');\n const lookupWrapper = this.shadowRoot.querySelector('.postcode-lookup');\n const manualWrapper = this.shadowRoot.querySelector('.manual-address');\n const list = this.shadowRoot.querySelector('datalist');\n const switchManualBtn = this.shadowRoot.querySelector('.switch-to-manual-btn');\n const switchLookupBtn = this.shadowRoot.querySelector('.switch-to-lookup-btn');\n if (this.hasAttribute('data-use')) {\n let useLabel = this.hasAttribute('data-use-label') ? this.getAttribute('data-use-label') : 'Use saved address';\n let useCheckbox = `<div><input type=\"checkbox\" name=\"use\" id=\"use\" value=\"yes\"><label for=\"use\">${useLabel}</label></div>`;\n lookupWrapper.insertAdjacentHTML('afterbegin', useCheckbox);\n this.shadowRoot.addEventListener('change', (event) => {\n if (event && event.target instanceof HTMLElement && event.target.closest('[name=\"use\"]')) {\n let checkbox = event.target.closest('[name=\"use\"]');\n if (checkbox.checked) {\n lookupWrapper.classList.add('js-hide');\n manualWrapper.classList.remove('js-hide');\n let values = JSON.parse(this.getAttribute('data-use'));\n Object.keys(values).forEach((key, index) => {\n let value = values[key];\n if (this.querySelector(`[data-name=\"${key}\"]`))\n this.querySelector(`[data-name=\"${key}\"]`).value = value;\n else if (this.querySelector(`[name=\"${key}\"]`))\n this.querySelector(`[name=\"${key}\"]`).value = value;\n });\n }\n }\n });\n }\n switchManualBtn.addEventListener('click', (event) => {\n lookupWrapper.classList.add('js-hide');\n manualWrapper.classList.remove('js-hide');\n Array.from(this.querySelectorAll('[data-required]')).forEach((input, index) => {\n input.setAttribute('required', 'true');\n });\n });\n switchLookupBtn.addEventListener('click', (event) => {\n lookupWrapper.classList.remove('js-hide');\n manualWrapper.classList.add('js-hide');\n });\n lookup.addEventListener('keyup', (event) => {\n if (lookup.value.length >= 3)\n search(lookup.value);\n });\n lookup.addEventListener('change', (event) => {\n if (lookup.value.length >= 3) {\n search(lookup.value);\n if (list.querySelector(`[value=\"${lookup.value}\"]`)) {\n lookupWrapper.classList.add('js-hide');\n manualWrapper.classList.remove('js-hide');\n let values = JSON.parse(list.querySelector(`[value=\"${lookup.value}\"]`).getAttribute('data-values'));\n Object.keys(values).forEach((key, index) => {\n let value = values[key];\n if (this.querySelector(`[data-name=\"${key}\"]`))\n this.querySelector(`[data-name=\"${key}\"]`).value = value;\n else if (this.querySelector(`[name=\"${key}\"]`))\n this.querySelector(`[name=\"${key}\"]`).value = value;\n });\n // Focus on first input\n this.querySelector('[data-name=\"address_1\"]').focus();\n Array.from(this.querySelectorAll('[data-required]')).forEach((input, index) => {\n input.setAttribute('required', 'true');\n });\n lookup.removeAttribute('required');\n if (this.shadowRoot.querySelector('[name=\"use\"]'))\n this.shadowRoot.querySelector('[name=\"use\"]').checked = false;\n }\n }\n });\n const search = (postcode) => __awaiter(this, void 0, void 0, function* () {\n let ajaxURL = this.getAttribute('data-url');\n ajaxURL += `${encodeURI(postcode)}`;\n // Setup controller vars if not already set\n if (!window.controller)\n window.controller = [];\n // Abort if controller already present for this url\n if (window.controller[ajaxURL])\n window.controller[ajaxURL].abort();\n // Create a new controller so it can be aborted if new fetch made\n window.controller[ajaxURL] = new AbortController();\n const { signal } = controller[ajaxURL];\n try {\n yield fetch(ajaxURL, {\n signal: signal,\n method: 'get',\n credentials: 'same-origin',\n headers: new Headers({\n 'Content-Type': 'application/json',\n Accept: 'application/json',\n 'X-Requested-With': 'XMLHttpRequest',\n 'X-XSRF-TOKEN': Cookies.get('XSRF-TOKEN')\n })\n })\n .then((response) => response.json()).then((response) => {\n // populate datalist\n let listString = '';\n response.forEach((address, index) => {\n let values = JSON.stringify(address.value);\n listString += `<option value=\"${address['label']}, ${postcode}\" data-values='${values}'></option>`;\n });\n list.innerHTML = listString;\n return response;\n });\n }\n catch (error) {\n console.log(error);\n }\n });\n });\n }\n}\nexport default iamAddressLookup;\n"],"names":["__awaiter","thisArg","_arguments","P","generator","adopt","value","resolve","reject","fulfilled","step","e","rejected","result","iamAddressLookup","assetLocation","coreCSS","template","lookup","lookupWrapper","manualWrapper","list","switchManualBtn","switchLookupBtn","useCheckbox","event","values","key","index","input","search","postcode","ajaxURL","signal","Cookies","response","listString","address","error"],"mappings":";;;6BAAA,IAAIA,EAAwC,SAAUC,EAASC,EAAYC,EAAGC,EAAW,CACrF,SAASC,EAAMC,EAAO,CAAE,OAAOA,aAAiBH,EAAIG,EAAQ,IAAIH,EAAE,SAAUI,EAAS,CAAEA,EAAQD,CAAK,CAAE,CAAE,CAAI,CAC5G,OAAO,IAAKH,IAAMA,EAAI,UAAU,SAAUI,EAASC,EAAQ,CACvD,SAASC,EAAUH,EAAO,CAAE,GAAI,CAAEI,EAAKN,EAAU,KAAKE,CAAK,CAAC,CAAE,OAAUK,EAAP,CAAYH,EAAOG,C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CAAO,EACrC,GAAI,CACA,MAAM,MAAMA,EAAS,CACjB,OAAQC,EACR,OAAQ,MACR,YAAa,cACb,QAAS,IAAI,QAAQ,CACjB,eAAgB,mBAChB,OAAQ,mBACR,mBAAoB,iBACpB,eAAgBC,EAAQ,IAAI,YAAY,CACpE,CAAyB,CACzB,CAAqB,EACI,KAAMC,GAAaA,EAAS,KAAI,CAAE,EAAE,KAAMA,GAAa,CAExD,IAAIC,EAAa,GACjB,OAAAD,EAAS,QAAQ,CAACE,EAAST,IAAU,CACjC,IAAIF,EAAS,KAAK,UAAUW,EAAQ,KAAK,EACzCD,GAAc,kBAAkBC,EAAQ,UAAaN,mBAA0BL,cAC3G,CAAyB,EACDL,EAAK,UAAYe,EACVD,CAC/B,CAAqB,CACJ,OACMG,EAAP,CACI,QAAQ,IAAIA,CAAK,CACpB,CACjB,CAAa,CACb,CAAS,CACJ,CACL"}
|
|
1
|
+
{"version":3,"file":"address-lookup.component.min.js","sources":["address-lookup.component.js"],"sourcesContent":["var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n// @ts-nocheck\nimport Cookies from 'js-cookie';\n// Data layer Web component created\nwindow.dataLayer = window.dataLayer || [];\nwindow.dataLayer.push({\n \"event\": \"customElementRegistered\",\n \"element\": \"Address Lookup\"\n});\nclass iamAddressLookup extends HTMLElement {\n constructor() {\n super();\n this.attachShadow({ mode: 'open' });\n const assetLocation = document.body.hasAttribute('data-assets-location') ? document.body.getAttribute('data-assets-location') : '/assets';\n const coreCSS = document.body.hasAttribute('data-core-css') ? document.body.getAttribute('data-core-css') : `${assetLocation}/css/core.min.css`;\n const loadCSS = `@import \"${assetLocation}/css/components/address-lookup.css\";`;\n const template = document.createElement('template');\n template.innerHTML = `\n <style>\n @import \"${coreCSS}\";\n ${loadCSS}\n \n ${this.hasAttribute('css') ? `@import \"${this.getAttribute('css')}\";` : ``}\n </style>\n <link rel=\"stylesheet\" href=\"https://kit.fontawesome.com/26fdbf0179.css\" crossorigin=\"anonymous\" />\n <div class=\"wrapper\">\n\n <div class=\"postcode-lookup\">\n <div>\n <label class=\"mb-2\">Search property address <span class=\"optional\">(Optional)</span>\n <span>\n <input type=\"text\" name=\"postcode\" list=\"address-lookup__addressess\" autoComplete=\"new-password\" aria-autocomplete=\"none\" placeholder=\"Postcode\" />\n <span class=\"suffix fa-regular fa-search\"></span>\n </span>\n <span class=\"invalid-feedback\">Required Adddress fields missing</span>\n </label>\n\n </div>\n <button class=\"btn btn-tertiary switch-to-manual-btn\">Or enter address manually</button>\n </div>\n <datalist id=\"address-lookup__addressess\"></datalist>\n\n <div class=\"manual-address pb-2 js-hide\">\n <slot></slot>\n <button class=\"btn btn-tertiary switch-to-lookup-btn\">Use postcode lookup</button>\n </div>\n </div>\n `;\n this.shadowRoot.appendChild(template.content.cloneNode(true));\n }\n connectedCallback() {\n return __awaiter(this, void 0, void 0, function* () {\n const wrapper = this.shadowRoot.querySelector('.wrapper');\n const lookup = this.shadowRoot.querySelector('[name=\"postcode\"]');\n const lookupWrapper = this.shadowRoot.querySelector('.postcode-lookup');\n const manualWrapper = this.shadowRoot.querySelector('.manual-address');\n const list = this.shadowRoot.querySelector('datalist');\n const switchManualBtn = this.shadowRoot.querySelector('.switch-to-manual-btn');\n const switchLookupBtn = this.shadowRoot.querySelector('.switch-to-lookup-btn');\n if (this.hasAttribute('data-use')) {\n let useLabel = this.hasAttribute('data-use-label') ? this.getAttribute('data-use-label') : 'Use saved address';\n let useCheckbox = `<div><input type=\"checkbox\" name=\"use\" id=\"use\" value=\"yes\"><label for=\"use\">${useLabel}</label></div>`;\n lookupWrapper.insertAdjacentHTML('afterbegin', useCheckbox);\n this.shadowRoot.addEventListener('change', (event) => {\n if (event && event.target instanceof HTMLElement && event.target.closest('[name=\"use\"]')) {\n let checkbox = event.target.closest('[name=\"use\"]');\n if (checkbox.checked) {\n lookupWrapper.classList.add('js-hide');\n manualWrapper.classList.remove('js-hide');\n let values = JSON.parse(this.getAttribute('data-use'));\n Object.keys(values).forEach((key, index) => {\n let value = values[key];\n if (this.querySelector(`[data-name=\"${key}\"]`))\n this.querySelector(`[data-name=\"${key}\"]`).value = value;\n else if (this.querySelector(`[name=\"${key}\"]`))\n this.querySelector(`[name=\"${key}\"]`).value = value;\n });\n }\n }\n });\n }\n switchManualBtn.addEventListener('click', (event) => {\n lookupWrapper.classList.add('js-hide');\n manualWrapper.classList.remove('js-hide');\n Array.from(this.querySelectorAll('[data-required]')).forEach((input, index) => {\n input.setAttribute('required', 'true');\n });\n });\n switchLookupBtn.addEventListener('click', (event) => {\n lookupWrapper.classList.remove('js-hide');\n manualWrapper.classList.add('js-hide');\n });\n lookup.addEventListener('keyup', (event) => {\n if (lookup.value.length >= 3)\n search(lookup.value);\n });\n lookup.addEventListener('change', (event) => {\n if (lookup.value.length >= 3) {\n search(lookup.value);\n if (list.querySelector(`[value=\"${lookup.value}\"]`)) {\n lookupWrapper.classList.add('js-hide');\n manualWrapper.classList.remove('js-hide');\n let values = JSON.parse(list.querySelector(`[value=\"${lookup.value}\"]`).getAttribute('data-values'));\n Object.keys(values).forEach((key, index) => {\n let value = values[key];\n if (this.querySelector(`[data-name=\"${key}\"]`))\n this.querySelector(`[data-name=\"${key}\"]`).value = value;\n else if (this.querySelector(`[name=\"${key}\"]`))\n this.querySelector(`[name=\"${key}\"]`).value = value;\n });\n // Focus on first input\n this.querySelector('[data-name=\"address_1\"]').focus();\n Array.from(this.querySelectorAll('[data-required]')).forEach((input, index) => {\n input.setAttribute('required', 'true');\n });\n lookup.removeAttribute('required');\n if (this.shadowRoot.querySelector('[name=\"use\"]'))\n this.shadowRoot.querySelector('[name=\"use\"]').checked = false;\n }\n }\n });\n const search = (postcode) => __awaiter(this, void 0, void 0, function* () {\n let ajaxURL = this.getAttribute('data-url');\n ajaxURL += `${encodeURI(postcode)}`;\n // Setup controller vars if not already set\n if (!window.controller)\n window.controller = [];\n // Abort if controller already present for this url\n if (window.controller[ajaxURL])\n window.controller[ajaxURL].abort();\n // Create a new controller so it can be aborted if new fetch made\n window.controller[ajaxURL] = new AbortController();\n const { signal } = controller[ajaxURL];\n try {\n yield fetch(ajaxURL, {\n signal: signal,\n method: 'get',\n credentials: 'same-origin',\n headers: new Headers({\n 'Content-Type': 'application/json',\n Accept: 'application/json',\n 'X-Requested-With': 'XMLHttpRequest',\n 'X-XSRF-TOKEN': Cookies.get('XSRF-TOKEN')\n })\n })\n .then((response) => response.json()).then((response) => {\n // populate datalist\n let listString = '';\n response.forEach((address, index) => {\n let values = JSON.stringify(address.value);\n listString += `<option value=\"${address['label']}, ${postcode}\" data-values='${values}'></option>`;\n });\n list.innerHTML = listString;\n return response;\n });\n }\n catch (error) {\n console.log(error);\n }\n });\n });\n }\n}\nexport default iamAddressLookup;\n"],"names":["__awaiter","thisArg","_arguments","P","generator","adopt","value","resolve","reject","fulfilled","step","e","rejected","result","iamAddressLookup","assetLocation","coreCSS","template","lookup","lookupWrapper","manualWrapper","list","switchManualBtn","switchLookupBtn","useCheckbox","event","values","key","index","input","search","postcode","ajaxURL","signal","Cookies","response","listString","address","error"],"mappings":";;;6BAAA,IAAIA,EAAwC,SAAUC,EAASC,EAAYC,EAAGC,EAAW,CACrF,SAASC,EAAMC,EAAO,CAAE,OAAOA,aAAiBH,EAAIG,EAAQ,IAAIH,EAAE,SAAUI,EAAS,CAAEA,EAAQD,CAAK,CAAE,CAAE,CAAI,CAC5G,OAAO,IAAKH,IAAMA,EAAI,UAAU,SAAUI,EAASC,EAAQ,CACvD,SAASC,EAAUH,EAAO,CAAE,GAAI,CAAEI,EAA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A,CAAO,EAAI,IAAI,gBACjC,KAAM,CAAE,OAAAC,CAAM,EAAK,WAAWD,CAAO,EACrC,GAAI,CACA,MAAM,MAAMA,EAAS,CACjB,OAAQC,EACR,OAAQ,MACR,YAAa,cACb,QAAS,IAAI,QAAQ,CACjB,eAAgB,mBAChB,OAAQ,mBACR,mBAAoB,iBACpB,eAAgBC,EAAQ,IAAI,YAAY,CACpE,CAAyB,CACzB,CAAqB,EACI,KAAMC,GAAaA,EAAS,KAAI,CAAE,EAAE,KAAMA,GAAa,CAExD,IAAIC,EAAa,GACjB,OAAAD,EAAS,QAAQ,CAACE,EAAST,IAAU,CACjC,IAAIF,EAAS,KAAK,UAAUW,EAAQ,KAAK,EACzCD,GAAc,kBAAkBC,EAAQ,UAAaN,mBAA0BL,cAC3G,CAAyB,EACDL,EAAK,UAAYe,EACVD,CAC/B,CAAqB,CACJ,OACMG,EAAP,CACI,QAAQ,IAAIA,CAAK,CACpB,CACjB,CAAa,CACb,CAAS,CACJ,CACL"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v4.1.
|
|
2
|
+
* iamKey v4.1.1-beta
|
|
3
3
|
* Copyright 2022-2023 iamproperty
|
|
4
4
|
*/function h(m,p){function b(e,t){let i=!1,r=t.getAttribute("name");r.includes("[]")&&(r=r.replace("[]",`[${t.value}]`));let l=e.querySelector(`[data-name="${r}"]`);l&&t.getAttribute("type")=="checkbox"&&(i=!0);let o=t.getAttribute("data-filter-text");if(l||(l=document.createElement("button"),e.appendChild(l)),l.setAttribute("type","button"),l.classList.add("filter"),l.setAttribute("data-name",r),l.innerHTML=o.replace("$value",t.value),(!t.value||i)&&l.remove(),t.parentNode.closest("[data-filter-text]")){let d=t.parentNode.closest("[data-filter-text]"),u=!0;if(r="",d.querySelectorAll("input").forEach((a,n)=>{let s=a.getAttribute("name");if(r+=`${n!=0?",":""}${s}`,e.querySelector(`[data-name="${s}"]`)&&e.querySelector(`[data-name="${s}"]`).remove(),a.value){let c=document.createElement("button");c.setAttribute("type","button"),c.classList.add("filter"),c.setAttribute("data-name",s),c.innerHTML=o.replace("$value",a.value),e.appendChild(c)}else u=!1}),e.querySelector(`[data-name="${r}"]`)&&e.querySelector(`[data-name="${r}"]`).remove(),u){let a=d.getAttribute("data-filter-text");d.querySelectorAll("input").forEach((s,c)=>{let f=s.getAttribute("name");e.querySelector(`[data-name="${f}"]`)&&e.querySelector(`[data-name="${f}"]`).remove(),a=a.replace(`$${c+1}`,s.value)});let n=document.createElement("button");n.setAttribute("type","button"),n.classList.add("filter"),n.setAttribute("data-name",r),n.innerHTML=a,e.appendChild(n)}}}Array.from(m.querySelectorAll('input[type="checkbox"]:checked')).forEach((e,t)=>{b(p,e)}),Array.from(m.querySelectorAll("input[data-filter-text]")).forEach((e,t)=>{e.addEventListener("change",function(i){b(p,e)})}),p.addEventListener("click",function(e){if(e&&e.target instanceof HTMLElement&&e.target.closest(".filter")){let r=e.target.closest(".filter"),l=r.getAttribute("data-name").split(",");for(var t=0;t<l.length;t++){let o=l[t],d=`[name="${o}"]`;o.match(/\[(.*)\]/)&&(o.replace(/\[(.*)\]/,"[]"),d=`[value="${o.replace(/.*\[(.*)\]/,"$1")}"]`);let u=m.querySelectorAll(d);for(var i=0;i<u.length;i++){let a=u[i];if(a.getAttribute("type")!="radio"&&a.getAttribute("type")!="checkbox")a.value="";else{a.checked=!1;var e=new Event("force");m.hasAttribute("data-nosubmit")||a.closest("form").dispatchEvent(e)}}}r.remove()}},!1)}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"Applied Filters"});class g extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const p=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",b=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${p}/css/core.min.css`;let e=this.classList.toString();const t=document.createElement("template");t.innerHTML=`
|
|
5
5
|
<style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v4.1.
|
|
2
|
+
* iamKey v4.1.1-beta
|
|
3
3
|
* Copyright 2022-2023 iamproperty
|
|
4
4
|
*/window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"Card"});class h extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.querySelector('[class*="fa-"]')&&this.classList.add("card--has-icon");let e=this.classList.toString();const a=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"):`${a}/css/core.min.css`,t=document.createElement("template");t.innerHTML=`
|
|
5
5
|
<style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v4.1.
|
|
2
|
+
* iamKey v4.1.1-beta
|
|
3
3
|
* Copyright 2022-2023 iamproperty
|
|
4
4
|
*/window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"collapsible side menu"});class s extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const e=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"):`${e}/css/core.min.css`,o=document.createElement("template");o.innerHTML=`
|
|
5
5
|
<style class="styles">
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v4.1.
|
|
2
|
+
* iamKey v4.1.1-beta
|
|
3
3
|
* Copyright 2022-2023 iamproperty
|
|
4
4
|
*/function r(s,t){n(s,t)}function n(s,t){var e;t.addEventListener("keyup",a=>{clearTimeout(e),e=setTimeout(function(){o(s,t.value)},500)}),t.addEventListener("change",a=>{clearTimeout(e),o(s,t.value)})}const o=function(s,t){Array.from(s.querySelectorAll(":scope > li")).forEach((e,a)=>{let i=e.textContent.toLowerCase();e.classList.add("d-none"),i.includes(t.toLowerCase())&&e.classList.remove("d-none")}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"Filtered list",value:t})};window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"filterlist"});class l extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const t=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",e=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${t}/css/core.min.css`,a=document.createElement("template");a.innerHTML=`
|
|
5
5
|
<style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v4.1.
|
|
2
|
+
* iamKey v4.1.1-beta
|
|
3
3
|
* Copyright 2022-2023 iamproperty
|
|
4
4
|
*/window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"header"});class t extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const e=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"):`${e}/css/core.min.css`,o=document.createElement("template");o.innerHTML=`
|
|
5
5
|
<style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v4.1.
|
|
2
|
+
* iamKey v4.1.1-beta
|
|
3
3
|
* Copyright 2022-2023 iamproperty
|
|
4
4
|
*/window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"nav"});class p extends HTMLElement{constructor(){super();const d=this.attachShadow({mode:"open"}),n=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"):`${n}/css/core.min.css`,i=document.createElement("template");i.innerHTML=`
|
|
5
5
|
<style class="styles">
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v4.1.
|
|
2
|
+
* iamKey v4.1.1-beta
|
|
3
3
|
* Copyright 2022-2023 iamproperty
|
|
4
4
|
*/function r(i){if(i.hasAttribute("data-type")&&i.getAttribute("data-type")=="toast"){let t=document.querySelector(".notification__holder");t||(t=document.createElement("div"),t.classList.add("notification__holder"),t.classList.add("container"),document.querySelector("body").appendChild(t)),i.closest(".notification__holder")||t.appendChild(i)}if(i.setAttribute("role","alert"),i.addEventListener("click",function(t){event&&event.target instanceof HTMLElement&&event.target.closest("[data-dismiss-button]")&&(t.preventDefault(),n(i))},!1),i.hasAttribute("data-timeout")){let t=i.getAttribute("data-timeout");var e=new c(function(){n(i)},t);i.addEventListener("mouseenter",o=>{e.pause()}),i.addEventListener("mouseleave",o=>{e.resume()})}}function c(i,e){var t,o,a=e;this.pause=function(){window.clearTimeout(t),a-=new Date-o},this.resume=function(){o=new Date,window.clearTimeout(t),t=window.setTimeout(i,a)},this.resume()}const n=function(i){i.classList.add("d-none")};window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"Notification"});class d extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const e=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"):`${e}/css/core.min.css`,o=this.querySelectorAll("a,button");Array.from(o).forEach((s,l)=>{s.setAttribute("slot","btns"),s.classList.add("link")}),(o.length||this.hasAttribute("data-dismiss"))&&this.classList.add("notification--dismissable");const a=document.createElement("template");a.innerHTML=`
|
|
5
5
|
<style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v4.1.
|
|
2
|
+
* iamKey v4.1.1-beta
|
|
3
3
|
* Copyright 2022-2023 iamproperty
|
|
4
4
|
*/class v extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const i=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"):`${i}/css/core.min.css`,e=document.createElement("template");e.innerHTML=`
|
|
5
5
|
<style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v4.1.
|
|
2
|
+
* iamKey v4.1.1-beta
|
|
3
3
|
* Copyright 2022-2023 iamproperty
|
|
4
4
|
*/const B=function(a){return typeof a!="string"?!1:!isNaN(a)&&!isNaN(parseFloat(a))},Q=(a,e)=>String(a).padStart(e,"0"),X=a=>a.charAt(0).toUpperCase()+a.slice(1);var Y=function(a,e,o,r){function b(c){return c instanceof o?c:new o(function(i){i(c)})}return new(o||(o=Promise))(function(c,i){function n(u){try{t(r.next(u))}catch(s){i(s)}}function d(u){try{t(r.throw(u))}catch(s){i(s)}}function t(u){u.done?c(u.value):b(u.value).then(n,d)}t((r=r.apply(a,e||[])).next())})};const R=a=>{const e=Array.from(a.querySelectorAll("thead th"));Array.from(a.querySelectorAll("tbody tr")).forEach((r,b)=>{const c=Array.from(r.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"];c.forEach((n,d)=>{const t=e[d];if(typeof t<"u"){let u=document.createElement("div");u.innerHTML=t.innerHTML;let s=u.textContent||u.innerText||"";n.setAttribute("data-label",s),t.hasAttribute("data-td-class")&&n.setAttribute("class",t.getAttribute("data-td-class")),t.hasAttribute("data-format")&&(n.setAttribute("data-format",t.getAttribute("data-format")),n.innerHTML=M(t.getAttribute("data-format"),n.textContent.trim())),i.includes(n.textContent.trim().toLowerCase())&&n.setAttribute("data-content",n.textContent.trim().toLowerCase())}})})},J=a=>{let e=0;return Array.from(a.querySelectorAll("tbody tr")).forEach((o,r)=>{let b=window.getComputedStyle(document.querySelector("html")),c=o.querySelector(":scope > *:last-child > *:first-child");if(c){c.classList.add("text-nowrap");let i=c.offsetWidth/parseFloat(b.fontSize);i+=1.7,e=e>i?e:i}}),e},G=(a,e)=>{if(e.classList.contains(".table--fullwidth")&&!e.hasAttribute("data-expandable")||a.querySelectorAll("thead tr th").length<4&&!e.hasAttribute("data-expandable"))return!1;Array.from(a.querySelectorAll("thead tr")).forEach((o,r)=>{o.insertAdjacentHTML("afterbegin",'<th class="th--fixed expand-button-heading"></th>')}),Array.from(a.querySelectorAll("tbody tr")).forEach((o,r)=>{o.insertAdjacentHTML("afterbegin",'<td class="td--fixed td--expand"><button class="btn btn-compact btn-secondary" data-expand-button>Expand</button></td>')})},K=a=>{a.addEventListener("click",e=>{if(e&&e.target instanceof HTMLElement&&e.target.closest("[data-expand-button]")){let o=e.target.closest("[data-expand-button]"),r=o.closest("tr");r.getAttribute("data-view")=="full"?r.setAttribute("data-view","default"):r.setAttribute("data-view","full"),o.blur()}})},N=(a,e)=>{let o=e.querySelector("[data-search]");if(!o)return!1;const r=o.getAttribute("id"),b=o.getAttribute("data-search").split(",");let c=o.parentNode,i={};b.forEach((n,d)=>{Array.from(a.querySelectorAll('td[data-label="'+n.trim()+'"]')).forEach((t,u)=>{t.querySelector(".td__content")?i[t.querySelector(".td__content").textContent]=t.querySelector(".td__content").textContent:i[t.textContent]=t.textContent})}),o.setAttribute("list",`${r}_list`),o.setAttribute("autocomplete","off"),c.querySelector("datalist")||(c.innerHTML+=`<datalist id="${r}_list"></datalist>`),c.querySelector("datalist").innerHTML=`${Object.keys(i).map(n=>`<option value="${n}"></option>`).join("")}`},V=(a,e,o,r,b)=>{var c;let i=function(t,u=!1){if(e.classList.contains("processing"))return!1;if(t.type=="submit"&&(e.classList.add("processing"),Array.from(e.querySelectorAll("[data-duplicate]")).forEach((s,m)=>{const h=s.getAttribute("data-duplicate"),l=document.getElementById(h),g=document.querySelector(`[for="${h}"] iam-card`);if(l.checked!=s.checked)if(g){let y=new Event("click");g.dispatchEvent(y)}else l.checked=s.checked}),e.classList.remove("processing")),e.hasAttribute("data-ajax")){if(!u){let s=e.querySelector("[data-pagination]");s.value=1,r.setAttribute("data-page",1)}z(a,e,o,r)}else e.hasAttribute("data-submit")?e.submit():(C(a,e,r),E(a,e));if(e.hasAttribute("data-ajax-post")){let s=new FormData(e),m=new URLSearchParams(s).toString();const h=new XMLHttpRequest;h.open("GET",`${window.location.href}?ajax=true&${m}`),h.send()}};e.addEventListener("keyup",t=>{clearTimeout(c),t&&t.target instanceof HTMLElement&&t.target.closest("[data-search]")&&(c=setTimeout(function(){i(t)},500))}),e.addEventListener("change",t=>{clearTimeout(c),t&&t.target instanceof HTMLElement&&t.target.closest("[data-sort]")&&(e.hasAttribute("data-submit")||O(a,e,b),i(t)),t&&t.target instanceof HTMLElement&&t.target.closest("[data-search]")&&i(t),t&&t.target instanceof HTMLElement&&t.target.closest("[data-filter][data-no-ajax]")?(C(a,e,r),E(a,e)):(t&&t.target instanceof HTMLElement&&t.target.closest("[data-filter]")&&t.target.closest("form .dialog__wrapper > dialog")||t&&t.target instanceof HTMLElement&&t.target.closest("[data-filter]")&&!t.target.closest("form dialog"))&&i(t),t&&t.target instanceof HTMLElement&&t.target.closest("[data-show]")&&i(t),t&&t.target instanceof HTMLElement&&t.target.closest("[data-mimic]")&&i(t)}),e.addEventListener("click",t=>{if(clearTimeout(c),t&&t.target instanceof HTMLElement&&t.target.closest('dialog button:not([type="button"])')&&t.target.closest('dialog button:not([type="button"])').closest("dialog").close(),t&&t.target instanceof HTMLElement&&t.target.closest(".dialog__close")&&(t.preventDefault(),t.stopPropagation()),t&&t.target instanceof HTMLElement&&t.target.closest("[data-clear]")){e.classList.add("processing"),Array.from(e.querySelectorAll(".applied-filters")).forEach((s,m)=>{s.innerHTML=""});let u=e.elements;for(let s=0;s<u.length;s++)switch(u[s].type.toLowerCase()?u[s].type.toLowerCase():"text"){case"text":case"password":case"textarea":u[s].value="";break;case"radio":case"checkbox":if(u[s].checked){let h=u[s],l=h.getAttribute("id"),g=document.querySelector(`[for="${l}"`);if(g.querySelector("iam-card")){let y=g.querySelector("iam-card"),v=new Event("click");y.dispatchEvent(v)}h.checked=!1}break;case"select-one":case"select-multi":u[s].selectedIndex=-1;break}e.classList.remove("processing"),e.hasAttribute("data-submit")||O(a,e,b),i(t)}}),e.addEventListener("submit",t=>{clearTimeout(c),e.hasAttribute("data-submit")||t.preventDefault(),i(t)}),e.addEventListener("force",t=>{i(t)}),e.addEventListener("paginate",t=>{i(t,!0)});let n=[],d=[];Array.from(e.querySelectorAll("[data-mimic]")).forEach((t,u)=>{let s=t.getAttribute("data-mimic");Array.from(document.querySelectorAll(`[name="${s}"]`)).forEach((m,h)=>{let l=m.closest("form");n.includes(l)||n.push(l),d.includes(s)||d.push(s)})}),n.forEach((t,u)=>{const s=function(){let m=[],h=new FormData(t);for(const[l,g]of h)document.querySelector(`[data-mimic="${l}"]`)&&!m.includes(l)?(m.push(l),document.querySelector(`[data-mimic="${l}"]`).value=g):document.querySelector(`[data-mimic="${l}"]`)&&(document.querySelector(`[data-mimic="${l}"]`).value+=","+g);for(const l of m){const g=new Event("force");e.dispatchEvent(g)}for(const l of d)if(!h.has(l)&&t.querySelector(`[name="${l}"]`)){document.querySelector(`[data-mimic="${l}"]`).value="";const g=new Event("force");e.dispatchEvent(g)}};t.addEventListener("force",m=>{s()}),t.addEventListener("change",m=>{s()})})},O=(a,e,o)=>{if(e.getAttribute("data-ajax"))return!1;let r=a.querySelector("tbody"),b=e.querySelector("[data-sort]"),c=b.querySelector(`option:nth-child(${b.selectedIndex+1})`),i=c.getAttribute("data-sort"),n=c.getAttribute("data-order"),d=c.getAttribute("data-format");if(!i)return r.innerHTML=o.innerHTML,R(a),!1;let t=[];["asc","desc","descending"].includes(n)||(t=n.split(","));let u=[];Array.from(r.querySelectorAll("tr")).forEach((m,h)=>{let l=m.querySelector('td[data-label="'+i+'"], th[data-label="'+i+'"]').textContent.trim();m.querySelector('[data-label="'+i+'"] .td__content')&&(l=m.querySelector('[data-label="'+i+'"] .td__content').textContent.trim()),t.length&&t.includes(l)&&(l=t.indexOf(l)),B(l)&&(l=Q(l,10)),d&&d=="date"&&(l=new Date(l));const g={index:l,row:m};u.push(g)}),u.sort((m,h)=>m.index>h.index?1:-1),(n=="descending"||n=="desc")&&(u=u.reverse());let s="";u.forEach((m,h)=>{s+=m.row.outerHTML}),r.innerHTML=s},C=(a,e,o)=>{a.classList.remove("table--filtered");let r=P(e),b=[],c=0,i=e.querySelector("[data-pagination]")?parseInt(e.querySelector("[data-pagination]").value):1,n=e.querySelector("[data-show]")?parseInt(e.querySelector("[data-show]").value):15;if(Array.from(a.querySelectorAll("tbody tr")).forEach((t,u)=>{t.classList.remove("filtered"),t.classList.remove("filtered--matched"),t.classList.remove("filtered--show"),t.removeAttribute("data-filtered-by")}),e.querySelector("[data-search]")){let t=e.querySelector("[data-search]");e.querySelector("[data-search]").getAttribute("data-search").split(",").forEach((s,m)=>{b.push({column:`${s.trim()}`,value:`${t.value}`})})}Array.from(e.querySelectorAll("[data-filter-count]")).forEach((t,u)=>{t.innerHTML="",t.parentNode.classList.remove("hover")});let d=0;Object.values(r).forEach((t,u)=>{typeof t=="object"&&Object.values(t).length?d+=Object.values(t).length:d++}),d&&Array.from(e.querySelectorAll("[data-filter-count]")).forEach((t,u)=>{t.innerHTML+=`(${d})`,t.parentNode.classList.add("hover")}),a.classList.add("table--filtered");for(const[t,u]of Object.entries(r))Array.from(a.querySelectorAll("tbody tr:not(.filtered)")).forEach((s,m)=>{let h=!1;u.forEach((l,g)=>{let y=s.querySelector(`[data-label="${t}"]`);if(l&&l=="$today")l=M("date",new Date);else if(l&&l=="$yesterday"){let f=new Date;f.setDate(f.getDate()-1),l=M("date",f)}else if(l&&(l=="$thisWeek"||l=="$lastWeek")){let f=new Date,x=new Date(f.setDate(f.getDate()-(f.getDay()-1))),w=new Date(f.setDate(f.getDate()-f.getDay()+7)),p=new Date(y.textContent.toLowerCase());if(f.setHours(0,0,0,0),x.setHours(0,0,0,0),w.setHours(0,0,0,0),p.setHours(0,0,0,0),l=="$thisWeek")h=p>=x&&p<=w;else{let T=new Date(x.setDate(x.getDate()-7)),A=new Date(w.setDate(w.getDate()-7));T.setHours(0,0,0,0),A.setHours(0,0,0,0),h=p>=T&&p<=A}}else if(l&&l=="$thisMonth"){let f=new Date,x=f.getFullYear(),w=f.getMonth();var v=new Date(x,w,1),k=new Date(x,w+1,0);let p=new Date(y.textContent.toLowerCase());v.setHours(0,0,0,0),k.setHours(0,0,0,0),p.setHours(0,0,0,0),h=p>=v&&p<=k}else if(l&&l=="$lastMonth"){let f=new Date,x=f.getFullYear(),w=f.getMonth();var S=new Date(x,w-1,1),L=new Date(x,w,0);let p=new Date(y.textContent.toLowerCase());S.setHours(0,0,0,0),L.setHours(0,0,0,0),p.setHours(0,0,0,0),h=p>=S&&p<=L}y&&y.textContent.toLowerCase().includes(l.toLowerCase())&&(h=!0)}),h||(s.classList.add("filtered"),s.setAttribute("data-filtered-by",t))});Array.from(a.querySelectorAll("tbody tr:not(.filtered)")).forEach((t,u)=>{let s=!(b.length>0&&b[0].value.length>=3);b.forEach((m,h)=>{let l=t.querySelector(`[data-label="${m.column}"]`);l&&m.value.length>=3&&l.textContent.toLowerCase().includes(m.value.toLowerCase())&&(s=!0)}),s||t.classList.add("filtered")}),Array.from(a.querySelectorAll("tbody tr:not(.filtered")).forEach((t,u)=>{c++,t.classList.add("filtered--matched"),Math.ceil(c/n)==parseInt(i)&&t.classList.add("filtered--show")}),o&&(o.setAttribute("data-total",c),o.setAttribute("data-show",n),o.setAttribute("data-page",i))},E=(a,e,o)=>{Array.from(e.querySelectorAll("[data-query]")).forEach((b,c)=>{let i=b.getAttribute("data-query"),n;if(i=="total")o.hasAttribute("data-total")?n=o.getAttribute("data-total"):n=(a.classList.contains("table--filtered"),a.querySelectorAll("tbody tr").length);else if(!i.includes(" == ")&&i.includes(" & ")){let d=i.split(" & "),t="";d.forEach(u=>{t+=`:not([data-filtered-by="${u}"])`}),n=Array.from(a.querySelectorAll(`tbody tr${t}`)).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(t){let u=!0;for(const[s,m]of Object.entries(d)){let h=m.split(" == ");(!t.querySelector(`td[data-label="${h[0]}"]`)||t.querySelector(`td[data-label="${h[0]}"]`).textContent!=`${h[1]}`)&&(u=!1)}return u}).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(t){return t.textContent===d[1]}).length}b.hasAttribute("data-total")?b.setAttribute("data-total",n):b.innerHTML=n})},Z=function(a,e,o,r){o.addEventListener("update-page",b=>{let c=e.querySelector("[data-pagination]"),i=b.detail.page;if(c.value=i,e.dispatchEvent(new Event("paginate")),r.setAttribute("data-page",i),a.hasAttribute("data-show-history")){const n=new URL(location);n.searchParams.set("page",i),history.pushState({type:"pagination",form:e.getAttribute("id"),page:i},"",n)}if(!r.hasAttribute("data-no-scroll")){const d=a.getBoundingClientRect().top+window.pageYOffset+-250;window.scrollTo({top:d,behavior:"smooth"})}}),o.addEventListener("update-show",b=>{let c=e.querySelector("[data-show]"),i=b.detail.show;c.value=i,r.setAttribute("data-show",i),e.dispatchEvent(new Event("submit"))})},tt=(a,e)=>{if(!a)return!1;a.addEventListener("click",o=>{et(e)})},et=function(a){for(var e=[],o=a.getElementsByTagName("tr"),r=0;r<o.length;r++){for(var b=o[r].querySelectorAll("td,th"),c=[],i=0;i<b.length;i++)c.push(`"${b[i].textContent}"`);e.push(c.join(","))}e=e.join(`
|
|
5
5
|
`);let n=new Blob([e],{type:"text/csv"});var d=document.createElement("a");d.download="export.csv";var t=window.URL.createObjectURL(n);d.href=t,d.style.display="none",document.body.appendChild(d),d.click(),document.body.removeChild(d)},I=function(a,e,o,r){if(R(a),G(a,r),E(a,e,r),r&&r.classList.contains("table--cta")){let c=function(){Array.from(a.querySelectorAll("tr")).forEach((i,n)=>{let d=i.offsetHeight;i.style.setProperty("--row-height",`${d}px`)})};const b=J(a);r.style.setProperty("--cta-width",`${b}rem`),new ResizeObserver(c).observe(a)}},P=function(a){let e=new Object;return Array.from(a.querySelectorAll("[data-filter]")).forEach((r,b)=>{if(!(r.type=="radio"&&!r.checked)&&!(r.type=="checkbox"&&!r.checked)&&r&&r.value){let c=r.getAttribute("data-filter");e[c]||(e[c]=new Array),e[c].push(r.value)}}),e},z=function(a,e,o,r){return Y(this,void 0,void 0,function*(){const b=(h,l,g)=>l.split(/[\.\[\]\'\"]/).filter(y=>y).reduce((y,v)=>y?y[v]:g,h);let c=new FormData(e),i=new URLSearchParams(c).toString(),n=a.querySelectorAll("thead tr th"),d=a.querySelector("tbody"),t=e.getAttribute("data-ajax");r.classList.add("table--loading");let u=P(e);Array.from(e.querySelectorAll("[data-filter-count]")).forEach((h,l)=>{h.innerHTML="",h.parentNode.classList.remove("hover")});let s=0;Object.values(u).forEach((h,l)=>{typeof h=="object"&&Object.values(h).length?s+=Object.values(h).length:s++}),s&&Array.from(e.querySelectorAll("[data-filter-count]")).forEach((h,l)=>{h.innerHTML+=`(${s})`,h.parentNode.classList.add("hover")}),window.controller||(window.controller=[]),window.controller[t]&&window.controller[t].abort(),window.controller[t]=new AbortController;const{signal:m}=controller[t];o.setAttribute("data-loading","true"),e.classList.add("processing");try{yield fetch(t+"?"+i,{signal:m,method:"get",credentials:"same-origin",headers:new Headers({"Content-Type":"application/json",Accept:"application/json","X-Requested-With":"XMLHttpRequest"})}).then(h=>h.json()).then(h=>{let l=e.hasAttribute("data-schema")?e.getAttribute("data-schema"):"data",g=e.hasAttribute("data-schema-total")?e.getAttribute("data-schema-total"):"meta.total",y=e.hasAttribute("data-schema-page")?e.getAttribute("data-schema-page"):"meta.current_page",v=b(h,g,15),k=b(h,y,1),S=b(h,l),L=r.hasAttribute("data-empty-msg")?r.getAttribute("data-empty-msg"):"No results found";S?(d.innerHTML="",S.forEach((f,x)=>{var w=document.createElement("tr");n.forEach((p,T)=>{let A="";var _=document.createElement("td");if(_.setAttribute("data-label",p.innerText),p.getAttribute("data-output")){var H=p.getAttribute("data-output");A=H.replace(new RegExp(/{(.*?)}/,"gm"),function(D){return b(f,D.replace("{","").replace("}",""))})}if(p.hasAttribute("data-output-array")){var H=p.getAttribute("data-output");let F=b(f,H.replace("{","").replace("}",""));A="",F.forEach((j,it)=>{let W=p.getAttribute("data-output-array"),q="";if(p.hasAttribute("data-output-array-property")&&p.hasAttribute("data-output-array-transform")){const $=b(j,p.getAttribute("data-output-array-property")),U=JSON.parse(p.getAttribute("data-output-array-transform"))[$];q=W.replace(`{${p.getAttribute("data-output-array-property")}}`,U)}q=q.replace(new RegExp(/{(.*?)}/,"gm"),function($){return b(j,$.replace("{","").replace("}",""))}),A+=q})}p.hasAttribute("data-transform")&&(A=JSON.parse(p.getAttribute("data-transform"))[A],!A&&p.hasAttribute("data-default")&&(A=p.getAttribute("data-default"))),_.innerHTML=A,w.appendChild(_)}),d.appendChild(w)}),N(a,e),r.setAttribute("data-total",parseInt(v)),r.setAttribute("data-page",parseInt(k)),I(a,e,o,r),Array.from(e.querySelectorAll("[data-ajax-query]")).forEach((f,x)=>{let w=b(h,f.getAttribute("data-ajax-query"),"");f.hasAttribute("data-total")?f.setAttribute("data-total",w):f.innerHTML=w}),parseInt(v)==0&&(d.innerHTML=`<tr><td colspan="100%"><span>${L}</span></td></tr>`),r.classList.remove("table--loading"),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"Ajax table loaded",url:t,formData:i})):d.innerHTML='<tr><td colspan="100%"><span>Error loading table</span></td></tr>',o.removeAttribute("data-loading"),e.classList.remove("processing")})}catch(h){console.log(h)}})},M=(a,e)=>{switch(a){case"datetime":return new Date(e).toLocaleDateString("en-gb",{weekday:"short",year:"2-digit",month:"long",day:"numeric"})+" "+new Date(e).toLocaleTimeString("en-gb",{hour:"2-digit",minute:"2-digit"});case"date":return new Date(e).toLocaleDateString("en-gb",{year:"2-digit",month:"long",day:"numeric"});case"capitalise":return e=X(e)}};class at extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const e=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",o=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${e}/css/core.min.css`,r=document.createElement("template");r.innerHTML=`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v4.1.
|
|
2
|
+
* iamKey v4.1.1-beta
|
|
3
3
|
* Copyright 2022-2023 iamproperty
|
|
4
4
|
*/const d=function(t){const r=t.querySelectorAll(":scope > details");t.querySelectorAll(":scope > details > summary");let a=t.querySelector(":scope > .tabs__links");if(t.shadowRoot&&t.shadowRoot.querySelector(".tabs__links")&&(a=t.shadowRoot.querySelector(".tabs__links")),!a){a=document.createElement("div"),a.classList.add("tabs__links");let e=document.createElement("div");e.classList.add("tabs__links__wrapper"),e.prepend(a),t.prepend(e)}r.forEach((e,i)=>{let l=e.querySelector(":scope > summary"),o=l.classList.contains("disabled");l.classList.add("visually-hidden");let s=document.createElement("button");e.hasAttribute("id")&&(s=document.createElement("a"),s.setAttribute("href",`#${e.getAttribute("id")}`)),e.hasAttribute("open")&&s.setAttribute("aria-pressed",!0),s.innerHTML=`${l.innerText}`,s.classList.add("link"),s.setAttribute("data-index",i),s.setAttribute("tabindex","-1"),o&&s.classList.add("disabled"),a.appendChild(s)})},n=function(t){let r=t.querySelectorAll(":scope > details"),a=t.querySelectorAll(":scope > details > summary"),e=t.querySelectorAll(":scope .tabs__links > .link");t.shadowRoot&&(e=t.shadowRoot.querySelectorAll(".tabs__links > .link")),e.forEach(i=>{i.addEventListener("click",l=>{if(l.preventDefault(),i.classList.contains("disabled"))return!1;e.forEach(o=>{let s=o==i;o.setAttribute("aria-pressed",s)}),r.forEach((o,s)=>{let c=i.getAttribute("data-index")==s;c?o.setAttribute("open",c):o.removeAttribute("open")}),i.hasAttribute("href")&&history.pushState(void 0,void 0,i.getAttribute("href")),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"openTab",tabTitle:i.textContent})})}),a.forEach((i,l)=>{i.addEventListener("focus",o=>{e.forEach(s=>{s.classList.remove("focus")}),e[l].classList.add("focus")}),i.addEventListener("click",o=>{o.preventDefault(),e[l].click()})})},u=function(t){let r=t.querySelectorAll(":scope > details"),a=t.querySelectorAll(":scope > .tabs__links > button, .tabs__links > a");t.shadowRoot&&(a=t.shadowRoot.querySelectorAll(".tabs__links > button, .tabs__links > a")),location.hash&&t.querySelector(`.tabs__links [href="${location.hash}"]`)?(t.querySelector(`[href="${location.hash}"]`).setAttribute("open",!0),t.querySelector(`details[id="${location.hash.replace("#","")}"]`).setAttribute("open",!0)):t.querySelector("details[open]")||(r[0].setAttribute("open",!0),a[0].setAttribute("aria-pressed",!0))},p=function(t){d(t),n(t),u(t)};window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"tabs"});class h extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const r=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",a=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${r}/css/core.min.css`,e=document.createElement("template");e.innerHTML=`
|
|
5
5
|
<style>
|
package/assets/js/dynamic.min.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v4.1.
|
|
2
|
+
* iamKey v4.1.1-beta
|
|
3
3
|
* Copyright 2022-2023 iamproperty
|
|
4
4
|
*/(function(b){typeof define=="function"&&define.amd?define(b):b()})(function(){"use strict";const b=t=>(t.classList.add("js-enabled"),(navigator.userAgent.indexOf("MSIE")!==-1||navigator.appVersion.indexOf("Trident/")>0)&&t.classList.add("ie"),null),w=t=>{const a=function(e){const o=document.querySelector(`label[for="${e.replace("#","")}"]`),i=document.querySelector(e+" summary"),r=document.querySelector(`dialog${e}`);o instanceof HTMLElement?o.click():i instanceof HTMLElement?i.click():r instanceof HTMLElement&&r.showModal()};return location.hash&&a(location.hash),window.addEventListener("hashchange",function(){a(location.hash)},!1),addEventListener("popstate",e=>{if(e&&e.state.type&&e.state.type=="pagination"){let o=document.querySelector(`#${e.state.form}`),i=document.querySelector(`#${e.state.form} [data-pagination]`);i?i.value=e.state.page:o.innerHTML+=`<input name="page" type="hidden" data-pagination="true" value="${e.state.page}" />`,o.dispatchEvent(new Event("submit"))}}),document.addEventListener("submit",e=>{if(e&&e.target instanceof HTMLElement&&e.target.matches("form")){let o=e.target;o.querySelector(":invalid")&&(o.classList.add("was-validated"),e.preventDefault())}}),null};class v{constructor(a){document.body.classList.contains("youtubeLoaded")?a.addEventListener("click",function(e){for(var o=e.target;o&&o!=this;o=o.parentNode)if(o.matches("a")){e.preventDefault(),p(o);break}},!1):this.loadScripts(a,this.createEmbed)}loadScripts(a){return new Promise((e,o)=>{const i=new Image;i.onload=function(){var r=document.createElement("script");r.src="https://www.youtube.com/iframe_api";var s=document.getElementsByTagName("script")[0];s.parentNode.insertBefore(r,s),document.body.classList.add("youtubeLoaded"),e(!0),r.onload=()=>{a.addEventListener("click",function(l){console.log("click"),l&&l.target instanceof HTMLElement&&l.target.closest("a")&&(l.preventDefault(),p(l.target.closest("a")))},!1)}},i.onerror=function(){o(!1)},i.src="https://youtube.com/favicon.ico"})}}const p=function(t){typeof window.player<"u"&&typeof window.player.pauseVideo=="function"&&window.player.pauseVideo();var a=t.getAttribute("data-id"),e=t.getAttribute("id");if(typeof e>"u"||e==null){var o=String.fromCharCode(65+Math.floor(Math.random()*26));e=o+Date.now(),t.setAttribute("id",e)}function i(){window.player=new YT.Player(e,{height:"100%",width:"100%",videoId:a,playerVars:{modestbranding:1,playsinline:1,rel:0,showinfo:0},events:{onReady:r,onStateChange:l}})}i();function r(n){n.target.playVideo()}var s=!1;function l(n){if(n.data==YT.PlayerState.PLAYING&&!s){var c=document.getElementById(e);c.classList.add("player-ready"),s=!0}}},S=t=>(Array.from(t.querySelectorAll("dialog[open]")).forEach((a,e)=>{a.closest(".dialog__wrapper")||(a.removeAttribute("open"),a.showModal(),a.focus(),A(a))}),t.addEventListener("click",a=>{if(a.target.tagName=="IAM-ACTIONBAR")return!1;if(a&&a.target instanceof HTMLElement&&a.target.closest("[data-modal]")){const i=a.target.closest("[data-modal]"),r=i.hasAttribute("data-modal")?i.getAttribute("data-modal"):i.getAttribute("data-filter"),s=document.querySelector(`dialog#${r}`);A(s),s.showModal(),s.focus();let l=s.offsetWidth;s.setAttribute("style",`max-width: ${l}px;`),Array.from(s.querySelectorAll("[data-duplicate]")).forEach((n,c)=>{const d=n.getAttribute("data-duplicate"),u=document.getElementById(d);if(n.checked!=u.checked){n.checked=u.checked;let f=new Event("change");n.dispatchEvent(f)}}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"openModal",id:r})}if(a&&a.target instanceof HTMLElement&&a.target.closest("button.dialog__close")){const i=a.target.closest("dialog[open]");a.preventDefault(),i.close(),Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach((r,s)=>{r.classList.remove("active")}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:i.getAttribute("id")})}if(a&&a.target instanceof HTMLElement&&a.target.closest('button[formmethod="dialog"]')){const i=a.target.closest("dialog[open]");Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach((r,s)=>{r.classList.remove("active")}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:i.getAttribute("id")})}if(a&&a.target instanceof HTMLElement&&a.target.closest("dialog[open]")){let i=a.target.closest("dialog[open]");var e=window.getComputedStyle(i);if(e.display==="contents"&&(i=i.parentNode.closest("dialog[open]")),!i.querySelector(":scope > .mh-lg > form:last-child > button:last-child, :scope > .mh-lg > button:last-child")||i.classList.contains("dialog--multi")){const r=i.getBoundingClientRect();(a.clientX<r.left||a.clientX>r.right||a.clientY<r.top||a.clientY>r.bottom)&&(a.target.closest('input[type="radio"]')||i.close(),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:i.getAttribute("id")}))}}if(a&&a.target instanceof HTMLElement&&a.target.closest(".dialog__wrapper > button")){a.stopPropagation();let i=a.target.closest(".dialog__wrapper > button"),r=a.target.closest(".dialog__wrapper > button").parentNode,s="openPopover",l=r.querySelector(":scope > dialog");if(document.querySelector("*:not([data-keep-open]) > dialog[open]")&&document.querySelector("*:not([data-keep-open]) > dialog[open]")!=l&&document.querySelector("*:not([data-keep-open]) > dialog[open]").close(),Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach((u,f)=>{u.classList.remove("active")}),l.hasAttribute("open"))l.close(),s="closePopover",l.removeAttribute("style"),i.classList.remove("active");else{l.show(),i.classList.add("active");var o=i.getBoundingClientRect();let u=o.top,f=o.left;if(i.closest("iam-table")){let m=i.closest("iam-table").parentNode.getBoundingClientRect();u-=m.top,f-=m.left}l.classList.contains("dialog--fix")&&l.setAttribute("style",`position:fixed;top: ${u}px; left: ${f}px; margin: 3rem 0 0 0;`)}let n=l.getBoundingClientRect(),c=n.bottom-window.scrollY,d=window.innerHeight-window.scrollY;if(c>d){let u=l.hasAttribute("style")?l.getAttribute("style")+" ":"";l.setAttribute("style",u+"transform: translate(0, calc(-100% - 4rem))"),n=l.getBoundingClientRect(),n.top-window.scrollY<100&&l.removeAttribute("style")}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:s,id:i.textContent})}a&&a.target instanceof HTMLElement&&!a.target.closest("dialog[open]")&&!a.target.closest(".dialog__wrapper > button")&&(document.querySelector(".dialog__wrapper:not([data-keep-open]) > dialog[open]")&&document.querySelector(".dialog__wrapper:not([data-keep-open]) > dialog[open]").close(),Array.from(document.querySelectorAll(".dialog__wrapper:not([data-keep-open]) > button")).forEach((i,r)=>{i.classList.remove("active")}))}),null),A=t=>{t.querySelector(":scope > .mh-lg > form:last-child > button:last-child, :scope > .mh-lg > button:last-child")&&!t.classList.contains("dialog--multi")&&t.addEventListener("cancel",e=>{e.preventDefault()});let a=t.querySelector(".youtube-embed a");if(a&&p(a),t.classList.contains("dialog--multi")&&!t.querySelector(":scope > .steps")&&q(t),!t.querySelector(":scope > .mh-lg")&&!t.classList.contains("dialog--multi")){t.innerHTML=`<div class="mh-lg">${t.innerHTML}</div>`;let e=t.querySelector(".mh-lg"),o=t.querySelector(".mh-lg :is(.h1,.h2,.h3,.h4,.h5,.h6)");if(o){let i=o.previousSibling;e.before(o),i&&o.before(i)}}t.querySelector(":scope > button:first-child")||t.insertAdjacentHTML("afterbegin",'<button class="dialog__close">Close</button>')},q=t=>{let a="",e=Array.from(t.querySelectorAll("fieldset[data-title]")),o=t.querySelector("form");e.forEach((s,l)=>{a+=`<button data-title="${s.getAttribute("data-title")}" type="button" class="${l==0?"active":""}" tabindex="-1">${s.getAttribute("data-title")}</button>`;const n=document.createElement("div");if(n.classList.add("btn--wrapper"),s.appendChild(n),l!=0&&(n.innerHTML+=`<button data-title="${e[l-1].getAttribute("data-title")}" class="btn btn-secondary mb-0" data-previous type="button">Previous</button>`),l!=e.length-1&&(n.innerHTML+=`<button data-title="${e[l+1].getAttribute("data-title")}" class="btn btn-primary mb-0" data-next type="button">Next</button>`),l==e.length-1)if(o&&o.querySelector(':scope > button[type="submit"]')){let c=o.querySelector(':scope > button[type="submit"]');c.classList.add("mb-0"),n.insertAdjacentElement("beforeend",c)}else n.innerHTML+=`<button data-title="${e[l].getAttribute("data-title")}" class="btn btn-primary mb-0" data-next type="submit">Submit</button>`}),t.insertAdjacentHTML("afterbegin",`<div class="steps bg-primary">${a}</div>`);let i=Array.from(t.querySelectorAll("fieldset.was-validated"));for(let s=0;s<i.length;s++){let l=i[s],n=l.getAttribute("data-title");if(l.querySelector(".is-invalid")){Array.from(t.querySelectorAll(`[data-title="${n}"]`)).forEach((c,d)=>{c.classList.add("active")});break}else Array.from(t.querySelectorAll(`[data-title="${n}"]`)).forEach((c,d)=>{c.classList.add("valid")})}t.addEventListener("invalid",function(){return function(s){s.preventDefault()}}(),!0);function r(s){const l=t.querySelector("fieldset.active")?t.querySelector("fieldset.active"):t.querySelector("fieldset[data-title]"),n=l.getAttribute("data-title");let c=!0;if(l.classList.add("was-validated"),Array.from(l.querySelectorAll("input")).forEach((f,m)=>{f.checkValidity()||(c=!1)}),c?Array.from(t.querySelectorAll(`[data-title="${n}"]`)).forEach((f,m)=>{f.classList.add("valid")}):Array.from(t.querySelectorAll(`[data-title="${n}"]`)).forEach((f,m)=>{f.classList.remove("valid")}),c||!s.hasAttribute("data-next")){const f=t.querySelector(`fieldset[data-title="${s.getAttribute("data-title")}"]`),m=t.querySelector(`.steps button[data-title="${s.getAttribute("data-title")}"]`);Array.from(t.querySelectorAll("button")).forEach((g,O)=>{g.classList.remove("active")}),Array.from(t.querySelectorAll("fieldset")).forEach((g,O)=>{g.classList.remove("active")}),m.classList.add("active"),f.classList.add("active")}let d=Array.from(t.querySelectorAll("fieldset")).length,u=Array.from(t.querySelectorAll("fieldset.valid")).length;t.style.setProperty("--progress",`${u/(d-1)*100}%`)}t.addEventListener("keydown",s=>{if(s&&s.target instanceof HTMLElement&&s.target.closest("button")){const l=s.target.closest("button");s.keyCode==13&&l.getAttribute("type")!="submit"&&(s.preventDefault(),r(l))}s&&s.target instanceof HTMLElement&&s.target.closest("input")&&(s.target.closest("input").classList.remove("is-invalid"),s.keyCode==13&&s.preventDefault())}),t.addEventListener("click",s=>{if(s&&s.target instanceof HTMLElement&&s.target.closest('button[type="submit"]'))s.target.closest("form").classList.add("was-validated");else if(s&&s.target instanceof HTMLElement&&s.target.closest("button[data-title]")){const l=s.target.closest("button[data-title]");r(l)}return null})};function E(){window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"Pageview",pageTitle:document.title}),document.addEventListener("click",t=>{const a=t.target.closest("[open] summary");if(a)window.dataLayer.push({event:"closeDetails",detailsTitle:a.textContent||""});else{const e=t.target.closest("summary"),o=t.target.closest("a"),i=t.target.closest("button");e&&window.dataLayer.push({event:"openDetails",detailsTitle:e.textContent||""}),o&&window.dataLayer.push({event:"linkClicked",linkText:o.hasAttribute("title")?o.getAttribute("title")||"":o.textContent||"",class:o.hasAttribute("class")&&o.getAttribute("class")||"",href:o.getAttribute("href")||""}),i&&window.dataLayer.push({event:"buttonClicked",buttonText:i.textContent||"",class:i.hasAttribute("class")&&i.getAttribute("class")||""})}})}const x=t=>{document.addEventListener("load",function(){console.log(Array.from(document.querySelectorAll("input[maxlength]"))),Array.from(document.querySelectorAll("input")).forEach((a,e)=>{a.parentElement,T(a)})}),t.addEventListener("input",a=>{if(a&&a.target instanceof HTMLElement&&a.target.closest("input,textarea,select")){const e=a.target.closest("input,textarea,select");e.parentElement,e.hasAttribute("type")&&e.getAttribute("type")=="color"&&(e.nextElementSibling.value=e.value),e.hasAttribute("maxlength")&&e.nextElementSibling&&e.nextElementSibling.setAttribute("data-count",e.value.length)}}),t.addEventListener("change",a=>{if(a&&a.target instanceof HTMLElement&&a.target.closest("select")){const e=a.target.closest("select");if(console.log(e),e.hasAttribute("data-change-type")&&e.hasAttribute("data-input")){const o=document.getElementById(e.getAttribute("data-input")),i=e.value;L(o,i)}}if(a&&a.target instanceof HTMLElement&&a.target.closest('dialog [type="radio"]')){const e=a.target.closest("dialog");a.target.closest('dialog [type="radio"]'),Array.from(e.querySelectorAll('[type="radio"][autofocus]')).forEach((o,i)=>{o.removeAttribute("autofocus")}),Array.from(e.querySelectorAll('[type="radio"]:checked')).forEach((o,i)=>{o.setAttribute("autofocus",!0)})}}),t.addEventListener("click",a=>{if(a&&a.target instanceof HTMLElement&&a.target.closest("[data-change-type][data-input]:not(select)")){const e=a.target.closest("[data-change-type]"),o=document.getElementById(e.getAttribute("data-input")),i=e.getAttribute("data-change-type");if(e.setAttribute("data-change-type",o.getAttribute("type")),L(o,i),e.hasAttribute("data-alt-class")){const r=e.getAttribute("data-alt-class");e.setAttribute("data-alt-class",e.getAttribute("class")),e.setAttribute("class",r)}}})},T=t=>{let a=t.parentElement,e=t.getAttribute("maxlength");a.style.setProperty("--maxlength",e);let o=t.nextElementSibling;(!o||o&&o.classList.contains("invalid-feedback"))&&(o=document.createElement("span"),a.insertBefore(o,t.nextSibling)),o.setAttribute("data-count",t.value.length)},L=(t,a)=>{t.setAttribute("type",a)},_=t=>{Array.from(t.querySelectorAll("details")).forEach((a,e)=>{a.addEventListener("mouseenter",function(o){window.matchMedia("(min-width: 62em)").matches&&a.setAttribute("open","true")},!1),a.addEventListener("mouseleave",function(o){window.matchMedia("(min-width: 62em)").matches&&a.removeAttribute("open")},!1)}),"IntersectionObserver"in window&&new IntersectionObserver(([e])=>e.target.classList.toggle("is-stuck",e.intersectionRatio<1),{threshold:[1]}).observe(t)};function M(t){var a;const e=t.querySelector(".testimonial__images"),o=e.querySelectorAll("img").length;if(o==1)return!1;t.classList.add("testimonial--multi");const i=function(r){const s=t.querySelector(".btn-next"),l=t.querySelector(".btn-prev");s.setAttribute("data-go",r+1),l.setAttribute("data-go",r-1),s.removeAttribute("disabled"),l.removeAttribute("disabled"),r==1?l.setAttribute("disabled",!0):r==o&&s.setAttribute("disabled",!0)};e.addEventListener("scroll",function(r){clearTimeout(a),a=setTimeout(function(){let s=e.scrollWidth,l=e.scrollHeight,n=e.scrollLeft,c=e.scrollTop,d=Math.round(n/s*o)+1;n==0&&c!=0&&(d=Math.round(c/l*o)+1),t.setAttribute("data-show",d),i(d)},300)},!1),t.addEventListener("click",function(r){for(var s=r.target;s&&s!=this;s=s.parentNode)if(s.matches("[data-go]")){let l=parseInt(s.getAttribute("data-go")),n=0,c=0,d=e.scrollWidth,u=e.scrollHeight;d>u?c=Math.floor(d*((l-1)/o)):n=Math.floor(u*((l-1)/o)),e.scroll({top:n,left:c,behavior:"smooth"});break}},!1)}function k(t){var a;let e=t.querySelector(".carousel__inner"),o=t.querySelectorAll(".carousel__item").length;t.getAttribute("data-cols");let i=t.getAttribute("data-sm-cols"),r=t.getAttribute("data-md-cols");t.querySelector(".carousel__controls a").classList.add("active"),e.addEventListener("scroll",function(s){clearTimeout(a),a=setTimeout(function(){let l=e.clientWidth,n=e.scrollWidth,c=e.scrollLeft,d=Math.round(c/n*o)+1,u=t.querySelector(".carousel__item:last-child").offsetLeft;Array.from(t.querySelectorAll(".carousel__controls a")).forEach((f,m)=>{f.classList.remove("active")}),t.querySelector(".control-"+d).classList.add("active"),d==1?t.querySelector(".btn-prev").setAttribute("disabled","disabled"):t.querySelector(".btn-prev").removeAttribute("disabled"),e.scrollLeft+l>u?t.querySelector(".btn-next").setAttribute("disabled","disabled"):t.querySelector(".btn-next").removeAttribute("disabled")},100)},!1),t.addEventListener("click",function(s){for(var l=s.target;l&&l!=this;l=l.parentNode)if(l.matches(".carousel__controls a")){s.preventDefault(),Array.from(t.querySelectorAll(".carousel__controls a")).forEach((c,d)=>{c.classList.remove("active")}),l.classList.add("active");const n=document.querySelector(l.getAttribute("href"));e.scroll({top:0,left:n.offsetLeft,behavior:"smooth"});break}},!1),t.addEventListener("click",function(s){for(var l=s.target;l&&l!=this;l=l.parentNode)if(l.matches(".btn-next, .btn-prev")){s.preventDefault();let n=l.classList.contains("btn-prev")?e.scrollLeft-e.clientWidth:e.scrollLeft+e.clientWidth;e.scroll({top:0,left:n,behavior:"smooth"});break}},!1),o==1&&t.classList.add("hide-btns"),i>=o&&t.classList.add("hide-sm-btns"),r>=o&&t.classList.add("hide-md-btns")}function $(t){t.addEventListener("change",function(a){var e=parseInt(t.querySelector("[data-min] select,[data-min] input").value),o=parseInt(t.querySelector("[data-max] select,[data-max] input").value);Array.from(t.querySelectorAll("[data-min] input")).forEach((i,r)=>{i.setAttribute("max",o)}),Array.from(t.querySelectorAll("[data-max] input")).forEach((i,r)=>{i.setAttribute("min",e)}),Array.from(t.querySelectorAll("[data-min] select option")).forEach((i,r)=>{parseInt(i.getAttribute("value"))>o?i.classList.add("d-none"):i.classList.remove("d-none")}),Array.from(t.querySelectorAll("[data-max] select option")).forEach((i,r)=>{parseInt(i.getAttribute("value"))<e?i.classList.add("d-none"):i.classList.remove("d-none")})},!1)}function C(t){t.addEventListener("change",function(a){if(t.matches("[data-value-if]")){const e=t.getAttribute("data-redirect"),o=t.getAttribute("data-value-if");t.value==o&&(document.location.href=e)}else typeof t.value<"u"&&(document.location.href=t.value)},!1)}function H(t){const e=t.querySelector(".row").cloneNode(!0),o=t.querySelector("[data-add]");t.addEventListener("click",function(i){for(var r=i.target;r&&r!=this;r=r.parentNode){if(r.matches("[data-add]")){const s=e.cloneNode(!0);t.insertBefore(s,r),o.matches("[data-maxfiles]")&&Array.from(t.querySelectorAll(":scope > .row")).length>=o.dataset.maxfiles&&o.setAttribute("disabled","disabled");break}if(r.matches("[data-delete]")){r.closest(".row").remove(),o.matches("[data-maxfiles]")&&Array.from(t.querySelectorAll(":scope > .row")).length<o.dataset.maxfiles&&o.removeAttribute("disabled");break}}},!1)}function I(t){Array.from(t.querySelectorAll("[data-input-range]")).forEach((a,e)=>{$(a)}),Array.from(t.querySelectorAll("[data-redirect]")).forEach((a,e)=>{C(a)}),Array.from(t.querySelectorAll(".multiple-file-uploads")).forEach((a,e)=>{H(a)}),t.addEventListener("change",function(a){for(var e=a.target;e&&e!=this;e=e.parentNode)if(e.matches('[type="file"][data-filesize]')&&e.files&&e.files[0]){const o=e.dataset.filesize;e.files[0].size>o&&(e.value="",alert("File too large"));break}},!1),t.addEventListener("change",function(a){Array.from(t.querySelectorAll("select[data-activeif][data-equals],input[data-activeif][data-equals]")).forEach((e,o)=>{let i=e.closest("[data-group]")?e.closest("[data-group]"):t,r=e.dataset.activeif,s=e.dataset.equals;i.querySelector(`select[data-id="${r}"],input[data-id="${r}"]`).value==s?e.removeAttribute("disabled"):(e.setAttribute("disabled","disabled"),e.value="")}),Array.from(t.querySelectorAll(".form-control__wrapper[data-displayif][data-equals]")).forEach((e,o)=>{let i=e.closest("[data-group]")?e.closest("[data-group]"):t,r=e.dataset.activeif,s=e.dataset.equals;i.querySelector(`select[data-id="${r}"],input[data-id="${r}"]`).value==s?e.classList.remove("d-none"):e.classList.add("d-none")})},!1)}function D(t){if(t.hasAttribute("data-type")&&t.getAttribute("data-type")=="toast"){let e=document.querySelector(".notification__holder");e||(e=document.createElement("div"),e.classList.add("notification__holder"),e.classList.add("container"),document.querySelector("body").appendChild(e)),t.closest(".notification__holder")||e.appendChild(t)}if(t.setAttribute("role","alert"),t.addEventListener("click",function(e){event&&event.target instanceof HTMLElement&&event.target.closest("[data-dismiss-button]")&&(e.preventDefault(),y(t))},!1),t.hasAttribute("data-timeout")){let e=t.getAttribute("data-timeout");var a=new B(function(){y(t)},e);t.addEventListener("mouseenter",o=>{a.pause()}),t.addEventListener("mouseleave",o=>{a.resume()})}}function B(t,a){var e,o,i=a;this.pause=function(){window.clearTimeout(e),i-=new Date-o},this.resume=function(){o=new Date,window.clearTimeout(e),e=window.setTimeout(t,i)},this.resume()}const y=function(t){t.classList.add("d-none")};window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"Notification"});class N extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const a=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",e=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${a}/css/core.min.css`,o=`@import "${a}/css/components/notification.css";`,i=this.querySelectorAll("a,button");Array.from(i).forEach((s,l)=>{s.setAttribute("slot","btns"),s.classList.add("link")}),(i.length||this.hasAttribute("data-dismiss"))&&this.classList.add("notification--dismissable");const r=document.createElement("template");r.innerHTML=`
|
|
5
5
|
<style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v4.1.
|
|
2
|
+
* iamKey v4.1.1-beta
|
|
3
3
|
* Copyright 2022-2023 iamproperty
|
|
4
4
|
*/(function(R){typeof define=="function"&&define.amd?define(R):R()})(function(){"use strict";var R=a=>(a.classList.add("js-enabled"),(navigator.userAgent.indexOf("MSIE")!==-1||navigator.appVersion.indexOf("Trident/")>0)&&a.classList.add("ie"),null),rt=a=>{var t=function(r){var i=document.querySelector('label[for="'.concat(r.replace("#",""),'"]')),n=document.querySelector(r+" summary"),c=document.querySelector("dialog".concat(r));i instanceof HTMLElement?i.click():n instanceof HTMLElement?n.click():c instanceof HTMLElement&&c.showModal()};return location.hash&&t(location.hash),window.addEventListener("hashchange",function(){t(location.hash)},!1),addEventListener("popstate",e=>{if(e&&e.state.type&&e.state.type=="pagination"){var r=document.querySelector("#".concat(e.state.form)),i=document.querySelector("#".concat(e.state.form," [data-pagination]"));i?i.value=e.state.page:r.innerHTML+='<input name="page" type="hidden" data-pagination="true" value="'.concat(e.state.page,'" />'),r.dispatchEvent(new Event("submit"))}}),document.addEventListener("submit",e=>{if(e&&e.target instanceof HTMLElement&&e.target.matches("form")){var r=e.target;r.querySelector(":invalid")&&(r.classList.add("was-validated"),e.preventDefault())}}),null},st=function(t){return typeof t!="string"?!1:!isNaN(t)&&!isNaN(parseFloat(t))},it=(a,t)=>String(a).padStart(t,"0"),ot=a=>a.charAt(0).toUpperCase()+a.slice(1);class nt{constructor(t){document.body.classList.contains("youtubeLoaded")?t.addEventListener("click",function(e){for(var r=e.target;r&&r!=this;r=r.parentNode)if(r.matches("a")){e.preventDefault(),Y(r);break}},!1):this.loadScripts(t,this.createEmbed)}loadScripts(t){return new Promise((e,r)=>{var i=new Image;i.onload=function(){var n=document.createElement("script");n.src="https://www.youtube.com/iframe_api";var c=document.getElementsByTagName("script")[0];c.parentNode.insertBefore(n,c),document.body.classList.add("youtubeLoaded"),e(!0),n.onload=()=>{t.addEventListener("click",function(o){console.log("click"),o&&o.target instanceof HTMLElement&&o.target.closest("a")&&(o.preventDefault(),Y(o.target.closest("a")))},!1)}},i.onerror=function(){r(!1)},i.src="https://youtube.com/favicon.ico"})}}var Y=function(t){typeof window.player<"u"&&typeof window.player.pauseVideo=="function"&&window.player.pauseVideo();var e=t.getAttribute("data-id"),r=t.getAttribute("id");if(typeof r>"u"||r==null){var i=String.fromCharCode(65+Math.floor(Math.random()*26));r=i+Date.now(),t.setAttribute("id",r)}function n(){window.player=new YT.Player(r,{height:"100%",width:"100%",videoId:e,playerVars:{modestbranding:1,playsinline:1,rel:0,showinfo:0},events:{onReady:c,onStateChange:d}})}n();function c(s){s.target.playVideo()}var o=!1;function d(s){if(s.data==YT.PlayerState.PLAYING&&!o){var l=document.getElementById(r);l.classList.add("player-ready"),o=!0}}},ct=a=>(Array.from(a.querySelectorAll("dialog[open]")).forEach((t,e)=>{var r=t.closest(".dialog__wrapper");r||(t.removeAttribute("open"),t.showModal(),t.focus(),Q(t))}),a.addEventListener("click",t=>{if(t.target.tagName=="IAM-ACTIONBAR")return!1;if(t&&t.target instanceof HTMLElement&&t.target.closest("[data-modal]")){var e=t.target.closest("[data-modal]"),r=e.hasAttribute("data-modal")?e.getAttribute("data-modal"):e.getAttribute("data-filter"),i=document.querySelector("dialog#".concat(r));Q(i),i.showModal(),i.focus();var n=i.offsetWidth;i.setAttribute("style","max-width: ".concat(n,"px;")),Array.from(i.querySelectorAll("[data-duplicate]")).forEach((g,A)=>{var k=g.getAttribute("data-duplicate"),S=document.getElementById(k);if(g.checked!=S.checked){g.checked=S.checked;var E=new Event("change");g.dispatchEvent(E)}}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"openModal",id:r})}if(t&&t.target instanceof HTMLElement&&t.target.closest("button.dialog__close")){var c=t.target.closest("dialog[open]");t.preventDefault(),c.close(),Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach((g,A)=>{g.classList.remove("active")}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:c.getAttribute("id")})}if(t&&t.target instanceof HTMLElement&&t.target.closest('button[formmethod="dialog"]')){var o=t.target.closest("dialog[open]");Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach((g,A)=>{g.classList.remove("active")}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:o.getAttribute("id")})}if(t&&t.target instanceof HTMLElement&&t.target.closest("dialog[open]")){var d=t.target.closest("dialog[open]"),s=window.getComputedStyle(d);if(s.display==="contents"&&(d=d.parentNode.closest("dialog[open]")),!d.querySelector(":scope > .mh-lg > form:last-child > button:last-child, :scope > .mh-lg > button:last-child")||d.classList.contains("dialog--multi")){var l=d.getBoundingClientRect();(t.clientX<l.left||t.clientX>l.right||t.clientY<l.top||t.clientY>l.bottom)&&(t.target.closest('input[type="radio"]')||d.close(),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:d.getAttribute("id")}))}}if(t&&t.target instanceof HTMLElement&&t.target.closest(".dialog__wrapper > button")){t.stopPropagation();var h=t.target.closest(".dialog__wrapper > button"),f=t.target.closest(".dialog__wrapper > button").parentNode,v="openPopover",u=f.querySelector(":scope > dialog");if(document.querySelector("*:not([data-keep-open]) > dialog[open]")&&document.querySelector("*:not([data-keep-open]) > dialog[open]")!=u&&document.querySelector("*:not([data-keep-open]) > dialog[open]").close(),Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach((g,A)=>{g.classList.remove("active")}),u.hasAttribute("open"))u.close(),v="closePopover",u.removeAttribute("style"),h.classList.remove("active");else{u.show(),h.classList.add("active");var m=h.getBoundingClientRect(),b=m.top,p=m.left;if(h.closest("iam-table")){var L=h.closest("iam-table").parentNode.getBoundingClientRect();b-=L.top,p-=L.left}u.classList.contains("dialog--fix")&&u.setAttribute("style","position:fixed;top: ".concat(b,"px; left: ").concat(p,"px; margin: 3rem 0 0 0;"))}var w=u.getBoundingClientRect(),y=w.bottom-window.scrollY,x=window.innerHeight-window.scrollY;if(y>x){var q=u.hasAttribute("style")?u.getAttribute("style")+" ":"";u.setAttribute("style",q+"transform: translate(0, calc(-100% - 4rem))"),w=u.getBoundingClientRect();var T=w.top-window.scrollY;T<100&&u.removeAttribute("style")}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:v,id:h.textContent})}t&&t.target instanceof HTMLElement&&!t.target.closest("dialog[open]")&&!t.target.closest(".dialog__wrapper > button")&&(document.querySelector(".dialog__wrapper:not([data-keep-open]) > dialog[open]")&&document.querySelector(".dialog__wrapper:not([data-keep-open]) > dialog[open]").close(),Array.from(document.querySelectorAll(".dialog__wrapper:not([data-keep-open]) > button")).forEach((g,A)=>{g.classList.remove("active")}))}),null),Q=a=>{a.querySelector(":scope > .mh-lg > form:last-child > button:last-child, :scope > .mh-lg > button:last-child")&&!a.classList.contains("dialog--multi")&&a.addEventListener("cancel",n=>{n.preventDefault()});var t=a.querySelector(".youtube-embed a");if(t&&Y(t),a.classList.contains("dialog--multi")&&!a.querySelector(":scope > .steps")&&dt(a),!a.querySelector(":scope > .mh-lg")&&!a.classList.contains("dialog--multi")){a.innerHTML='<div class="mh-lg">'.concat(a.innerHTML,"</div>");var e=a.querySelector(".mh-lg"),r=a.querySelector(".mh-lg :is(.h1,.h2,.h3,.h4,.h5,.h6)");if(r){var i=r.previousSibling;e.before(r),i&&r.before(i)}}a.querySelector(":scope > button:first-child")||a.insertAdjacentHTML("afterbegin",'<button class="dialog__close">Close</button>')},dt=a=>{var t="",e=Array.from(a.querySelectorAll("fieldset[data-title]")),r=a.querySelector("form");e.forEach((s,l)=>{t+='<button data-title="'.concat(s.getAttribute("data-title"),'" type="button" class="').concat(l==0?"active":"",'" tabindex="-1">').concat(s.getAttribute("data-title"),"</button>");var h=document.createElement("div");if(h.classList.add("btn--wrapper"),s.appendChild(h),l!=0&&(h.innerHTML+='<button data-title="'.concat(e[l-1].getAttribute("data-title"),'" class="btn btn-secondary mb-0" data-previous type="button">Previous</button>')),l!=e.length-1&&(h.innerHTML+='<button data-title="'.concat(e[l+1].getAttribute("data-title"),'" class="btn btn-primary mb-0" data-next type="button">Next</button>')),l==e.length-1)if(r&&r.querySelector(':scope > button[type="submit"]')){var f=r.querySelector(':scope > button[type="submit"]');f.classList.add("mb-0"),h.insertAdjacentElement("beforeend",f)}else h.innerHTML+='<button data-title="'.concat(e[l].getAttribute("data-title"),'" class="btn btn-primary mb-0" data-next type="submit">Submit</button>')}),a.insertAdjacentHTML("afterbegin",'<div class="steps bg-primary">'.concat(t,"</div>"));for(var i=Array.from(a.querySelectorAll("fieldset.was-validated")),n=0;n<i.length;n++){var c=i[n],o=c.getAttribute("data-title");if(c.querySelector(".is-invalid")){Array.from(a.querySelectorAll('[data-title="'.concat(o,'"]'))).forEach((s,l)=>{s.classList.add("active")});break}else Array.from(a.querySelectorAll('[data-title="'.concat(o,'"]'))).forEach((s,l)=>{s.classList.add("valid")})}a.addEventListener("invalid",function(){return function(s){s.preventDefault()}}(),!0);function d(s){var l=a.querySelector("fieldset.active")?a.querySelector("fieldset.active"):a.querySelector("fieldset[data-title]"),h=l.getAttribute("data-title"),f=!0;if(l.classList.add("was-validated"),Array.from(l.querySelectorAll("input")).forEach((p,L)=>{p.checkValidity()||(f=!1)}),f?Array.from(a.querySelectorAll('[data-title="'.concat(h,'"]'))).forEach((p,L)=>{p.classList.add("valid")}):Array.from(a.querySelectorAll('[data-title="'.concat(h,'"]'))).forEach((p,L)=>{p.classList.remove("valid")}),f||!s.hasAttribute("data-next")){var v=a.querySelector('fieldset[data-title="'.concat(s.getAttribute("data-title"),'"]')),u=a.querySelector('.steps button[data-title="'.concat(s.getAttribute("data-title"),'"]'));Array.from(a.querySelectorAll("button")).forEach((p,L)=>{p.classList.remove("active")}),Array.from(a.querySelectorAll("fieldset")).forEach((p,L)=>{p.classList.remove("active")}),u.classList.add("active"),v.classList.add("active")}var m=Array.from(a.querySelectorAll("fieldset")).length,b=Array.from(a.querySelectorAll("fieldset.valid")).length;a.style.setProperty("--progress","".concat(b/(m-1)*100,"%"))}a.addEventListener("keydown",s=>{if(s&&s.target instanceof HTMLElement&&s.target.closest("button")){var l=s.target.closest("button");s.keyCode==13&&l.getAttribute("type")!="submit"&&(s.preventDefault(),d(l))}if(s&&s.target instanceof HTMLElement&&s.target.closest("input")){var h=s.target.closest("input");h.classList.remove("is-invalid"),s.keyCode==13&&s.preventDefault()}}),a.addEventListener("click",s=>{if(s&&s.target instanceof HTMLElement&&s.target.closest('button[type="submit"]')){var l=s.target.closest("form");l.classList.add("was-validated")}else if(s&&s.target instanceof HTMLElement&&s.target.closest("button[data-title]")){var h=s.target.closest("button[data-title]");d(h)}return null})};function lt(){window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"Pageview",pageTitle:document.title}),document.addEventListener("click",a=>{var t=a.target.closest("[open] summary");if(t)window.dataLayer.push({event:"closeDetails",detailsTitle:t.textContent||""});else{var e=a.target.closest("summary"),r=a.target.closest("a"),i=a.target.closest("button");e&&window.dataLayer.push({event:"openDetails",detailsTitle:e.textContent||""}),r&&window.dataLayer.push({event:"linkClicked",linkText:r.hasAttribute("title")?r.getAttribute("title")||"":r.textContent||"",class:r.hasAttribute("class")&&r.getAttribute("class")||"",href:r.getAttribute("href")||""}),i&&window.dataLayer.push({event:"buttonClicked",buttonText:i.textContent||"",class:i.hasAttribute("class")&&i.getAttribute("class")||""})}})}var ut=a=>{document.addEventListener("load",function(){console.log(Array.from(document.querySelectorAll("input[maxlength]"))),Array.from(document.querySelectorAll("input")).forEach((t,e)=>{t.parentElement,ht(t)})}),a.addEventListener("input",t=>{if(t&&t.target instanceof HTMLElement&&t.target.closest("input,textarea,select")){var e=t.target.closest("input,textarea,select");e.parentElement,e.hasAttribute("type")&&e.getAttribute("type")=="color"&&(e.nextElementSibling.value=e.value),e.hasAttribute("maxlength")&&e.nextElementSibling&&e.nextElementSibling.setAttribute("data-count",e.value.length)}}),a.addEventListener("change",t=>{if(t&&t.target instanceof HTMLElement&&t.target.closest("select")){var e=t.target.closest("select");if(console.log(e),e.hasAttribute("data-change-type")&&e.hasAttribute("data-input")){var r=document.getElementById(e.getAttribute("data-input")),i=e.value;J(r,i)}}if(t&&t.target instanceof HTMLElement&&t.target.closest('dialog [type="radio"]')){var n=t.target.closest("dialog");t.target.closest('dialog [type="radio"]'),Array.from(n.querySelectorAll('[type="radio"][autofocus]')).forEach((c,o)=>{c.removeAttribute("autofocus")}),Array.from(n.querySelectorAll('[type="radio"]:checked')).forEach((c,o)=>{c.setAttribute("autofocus",!0)})}}),a.addEventListener("click",t=>{if(t&&t.target instanceof HTMLElement&&t.target.closest("[data-change-type][data-input]:not(select)")){var e=t.target.closest("[data-change-type]"),r=document.getElementById(e.getAttribute("data-input")),i=e.getAttribute("data-change-type");if(e.setAttribute("data-change-type",r.getAttribute("type")),J(r,i),e.hasAttribute("data-alt-class")){var n=e.getAttribute("data-alt-class");e.setAttribute("data-alt-class",e.getAttribute("class")),e.setAttribute("class",n)}}})},ht=a=>{var t=a.parentElement,e=a.getAttribute("maxlength");t.style.setProperty("--maxlength",e);var r=a.nextElementSibling;(!r||r&&r.classList.contains("invalid-feedback"))&&(r=document.createElement("span"),t.insertBefore(r,a.nextSibling)),r.setAttribute("data-count",a.value.length)},J=(a,t)=>{a.setAttribute("type",t)},ft=a=>{if(Array.from(a.querySelectorAll("details")).forEach((e,r)=>{e.addEventListener("mouseenter",function(i){window.matchMedia("(min-width: 62em)").matches&&e.setAttribute("open","true")},!1),e.addEventListener("mouseleave",function(i){window.matchMedia("(min-width: 62em)").matches&&e.removeAttribute("open")},!1)}),"IntersectionObserver"in window){var t=new IntersectionObserver(e=>{var[r]=e;return r.target.classList.toggle("is-stuck",r.intersectionRatio<1)},{threshold:[1]});t.observe(a)}};function mt(a){var t,e=a.querySelector(".testimonial__images"),r=e.querySelectorAll("img").length;if(r==1)return!1;a.classList.add("testimonial--multi");var i=function(c){var o=a.querySelector(".btn-next"),d=a.querySelector(".btn-prev");o.setAttribute("data-go",c+1),d.setAttribute("data-go",c-1),o.removeAttribute("disabled"),d.removeAttribute("disabled"),c==1?d.setAttribute("disabled",!0):c==r&&o.setAttribute("disabled",!0)};e.addEventListener("scroll",function(n){clearTimeout(t),t=setTimeout(function(){var c=e.scrollWidth,o=e.scrollHeight,d=e.scrollLeft,s=e.scrollTop,l=Math.round(d/c*r)+1;d==0&&s!=0&&(l=Math.round(s/o*r)+1),a.setAttribute("data-show",l),i(l)},300)},!1),a.addEventListener("click",function(n){for(var c=n.target;c&&c!=this;c=c.parentNode)if(c.matches("[data-go]")){var o=parseInt(c.getAttribute("data-go")),d=0,s=0,l=e.scrollWidth,h=e.scrollHeight;l>h?s=Math.floor(l*((o-1)/r)):d=Math.floor(h*((o-1)/r)),e.scroll({top:d,left:s,behavior:"smooth"});break}},!1)}function vt(a){var t,e=a.querySelector(".carousel__inner"),r=a.querySelectorAll(".carousel__item").length;a.getAttribute("data-cols");var i=a.getAttribute("data-sm-cols"),n=a.getAttribute("data-md-cols");a.querySelector(".carousel__controls a").classList.add("active"),e.addEventListener("scroll",function(c){clearTimeout(t),t=setTimeout(function(){var o=e.clientWidth,d=e.scrollWidth,s=e.scrollLeft,l=Math.round(s/d*r)+1,h=a.querySelector(".carousel__item:last-child").offsetLeft;Array.from(a.querySelectorAll(".carousel__controls a")).forEach((f,v)=>{f.classList.remove("active")}),a.querySelector(".control-"+l).classList.add("active"),l==1?a.querySelector(".btn-prev").setAttribute("disabled","disabled"):a.querySelector(".btn-prev").removeAttribute("disabled"),e.scrollLeft+o>h?a.querySelector(".btn-next").setAttribute("disabled","disabled"):a.querySelector(".btn-next").removeAttribute("disabled")},100)},!1),a.addEventListener("click",function(c){for(var o=c.target;o&&o!=this;o=o.parentNode)if(o.matches(".carousel__controls a")){c.preventDefault(),Array.from(a.querySelectorAll(".carousel__controls a")).forEach((s,l)=>{s.classList.remove("active")}),o.classList.add("active");var d=document.querySelector(o.getAttribute("href"));e.scroll({top:0,left:d.offsetLeft,behavior:"smooth"});break}},!1),a.addEventListener("click",function(c){for(var o=c.target;o&&o!=this;o=o.parentNode)if(o.matches(".btn-next, .btn-prev")){c.preventDefault();var d=o.classList.contains("btn-prev")?e.scrollLeft-e.clientWidth:e.scrollLeft+e.clientWidth;e.scroll({top:0,left:d,behavior:"smooth"});break}},!1),r==1&&a.classList.add("hide-btns"),i>=r&&a.classList.add("hide-sm-btns"),n>=r&&a.classList.add("hide-md-btns")}function bt(a){a.addEventListener("change",function(t){var e=parseInt(a.querySelector("[data-min] select,[data-min] input").value),r=parseInt(a.querySelector("[data-max] select,[data-max] input").value);Array.from(a.querySelectorAll("[data-min] input")).forEach((i,n)=>{i.setAttribute("max",r)}),Array.from(a.querySelectorAll("[data-max] input")).forEach((i,n)=>{i.setAttribute("min",e)}),Array.from(a.querySelectorAll("[data-min] select option")).forEach((i,n)=>{parseInt(i.getAttribute("value"))>r?i.classList.add("d-none"):i.classList.remove("d-none")}),Array.from(a.querySelectorAll("[data-max] select option")).forEach((i,n)=>{parseInt(i.getAttribute("value"))<e?i.classList.add("d-none"):i.classList.remove("d-none")})},!1)}function pt(a){a.addEventListener("change",function(t){if(a.matches("[data-value-if]")){var e=a.getAttribute("data-redirect"),r=a.getAttribute("data-value-if");a.value==r&&(document.location.href=e)}else typeof a.value<"u"&&(document.location.href=a.value)},!1)}function yt(a){var t=a.querySelector(".row"),e=t.cloneNode(!0),r=a.querySelector("[data-add]");a.addEventListener("click",function(i){for(var n=i.target;n&&n!=this;n=n.parentNode){if(n.matches("[data-add]")){var c=e.cloneNode(!0);a.insertBefore(c,n),r.matches("[data-maxfiles]")&&Array.from(a.querySelectorAll(":scope > .row")).length>=r.dataset.maxfiles&&r.setAttribute("disabled","disabled");break}if(n.matches("[data-delete]")){var o=n.closest(".row");o.remove(),r.matches("[data-maxfiles]")&&Array.from(a.querySelectorAll(":scope > .row")).length<r.dataset.maxfiles&&r.removeAttribute("disabled");break}}},!1)}function gt(a){Array.from(a.querySelectorAll("[data-input-range]")).forEach((t,e)=>{bt(t)}),Array.from(a.querySelectorAll("[data-redirect]")).forEach((t,e)=>{pt(t)}),Array.from(a.querySelectorAll(".multiple-file-uploads")).forEach((t,e)=>{yt(t)}),a.addEventListener("change",function(t){for(var e=t.target;e&&e!=this;e=e.parentNode)if(e.matches('[type="file"][data-filesize]')&&e.files&&e.files[0]){var r=e.dataset.filesize;e.files[0].size>r&&(e.value="",alert("File too large"));break}},!1),a.addEventListener("change",function(t){Array.from(a.querySelectorAll("select[data-activeif][data-equals],input[data-activeif][data-equals]")).forEach((e,r)=>{var i=e.closest("[data-group]")?e.closest("[data-group]"):a,n=e.dataset.activeif,c=e.dataset.equals,o=i.querySelector('select[data-id="'.concat(n,'"],input[data-id="').concat(n,'"]'));o.value==c?e.removeAttribute("disabled"):(e.setAttribute("disabled","disabled"),e.value="")}),Array.from(a.querySelectorAll(".form-control__wrapper[data-displayif][data-equals]")).forEach((e,r)=>{var i=e.closest("[data-group]")?e.closest("[data-group]"):a,n=e.dataset.activeif,c=e.dataset.equals,o=i.querySelector('select[data-id="'.concat(n,'"],input[data-id="').concat(n,'"]'));o.value==c?e.classList.remove("d-none"):e.classList.add("d-none")})},!1)}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"header"});class At extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});var t=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",e=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):"".concat(t,"/css/core.min.css"),r='@import "'.concat(t,'/css/components/header.css";'),i=document.createElement("template");i.innerHTML=`
|
|
5
5
|
<style>
|