!function(e){"use strict";!function(){const e={NODE_ENV:"production"};try{if(process)return process.env=Object.assign({},process.env),void Object.assign(process.env,e)}catch(e){}globalThis.process={env:e}}();var t=window.CustomEvent;function o(e,t){var o="on"+t.type.toLowerCase();return"function"==typeof e[o]&&e[o](t),e.dispatchEvent(t)}function i(e){for(;e;){if("dialog"===e.localName)return e;e=e.parentElement?e.parentElement:e.parentNode?e.parentNode.host:null}return null}function n(e){for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;e&&e.blur&&e!==document.body&&e.blur()}function r(e,t){for(var o=0;o<e.length;++o)if(e[o]===t)return!0;return!1}function a(e){return!(!e||!e.hasAttribute("method"))&&"dialog"===e.getAttribute("method").toLowerCase()}function s(e){var t=["button","input","keygen","select","textarea"].map(function(e){return e+":not([disabled])"});t.push('[tabindex]:not([disabled]):not([tabindex=""])');var o=e.querySelector(t.join(", "));if(!o&&"attachShadow"in Element.prototype)for(var i=e.querySelectorAll("*"),n=0;n<i.length&&!(i[n].tagName&&i[n].shadowRoot&&(o=s(i[n].shadowRoot)));n++);return o}function l(e){return e.isConnected||document.body.contains(e)}function c(e){if(e.submitter)return e.submitter;var t=e.target;if(!(t instanceof HTMLFormElement))return null;var o=h.formSubmitter;if(!o){var i=e.target;o=("getRootNode"in i&&i.getRootNode()||document).activeElement}return o&&o.form===t?o:null}function d(e){if(!e.defaultPrevented){var t=e.target,o=h.imagemapUseValue,n=c(e);null===o&&n&&(o=n.value);var r=i(t);if(r)"dialog"===(n&&n.getAttribute("formmethod")||t.getAttribute("method"))&&(e.preventDefault(),null!=o?r.close(o):r.close())}}function u(e){if(this.dialog_=e,this.replacedStyleTop_=!1,this.openAsModal_=!1,e.hasAttribute("role")||e.setAttribute("role","dialog"),e.show=this.show.bind(this),e.showModal=this.showModal.bind(this),e.close=this.close.bind(this),e.addEventListener("submit",d,!1),"returnValue"in e||(e.returnValue=""),"MutationObserver"in window){new MutationObserver(this.maybeHideModal.bind(this)).observe(e,{attributes:!0,attributeFilter:["open"]})}else{var t,o=!1,i=function(){o?this.downgradeModal():this.maybeHideModal(),o=!1}.bind(this),n=function(n){if(n.target===e){var r="DOMNodeRemoved";o|=n.type.substr(0,14)===r,window.clearTimeout(t),t=window.setTimeout(i,0)}};["DOMAttrModified","DOMNodeRemoved","DOMNodeRemovedFromDocument"].forEach(function(t){e.addEventListener(t,n)})}Object.defineProperty(e,"open",{set:this.setOpen.bind(this),get:e.hasAttribute.bind(e,"open")}),this.backdrop_=document.createElement("div"),this.backdrop_.className="backdrop",this.backdrop_.addEventListener("mouseup",this.backdropMouseEvent_.bind(this)),this.backdrop_.addEventListener("mousedown",this.backdropMouseEvent_.bind(this)),this.backdrop_.addEventListener("click",this.backdropMouseEvent_.bind(this))}t&&"object"!=typeof t||((t=function(e,t){t=t||{};var o=document.createEvent("CustomEvent");return o.initCustomEvent(e,!!t.bubbles,!!t.cancelable,t.detail||null),o}).prototype=window.Event.prototype),u.prototype={get dialog(){return this.dialog_},maybeHideModal:function(){this.dialog_.hasAttribute("open")&&l(this.dialog_)||this.downgradeModal()},downgradeModal:function(){this.openAsModal_&&(this.openAsModal_=!1,this.dialog_.style.zIndex="",this.replacedStyleTop_&&(this.dialog_.style.top="",this.replacedStyleTop_=!1),this.backdrop_.parentNode&&this.backdrop_.parentNode.removeChild(this.backdrop_),h.dm.removeDialog(this))},setOpen:function(e){e?this.dialog_.hasAttribute("open")||this.dialog_.setAttribute("open",""):(this.dialog_.removeAttribute("open"),this.maybeHideModal())},backdropMouseEvent_:function(e){if(this.dialog_.hasAttribute("tabindex"))this.dialog_.focus();else{var t=document.createElement("div");this.dialog_.insertBefore(t,this.dialog_.firstChild),t.tabIndex=-1,t.focus(),this.dialog_.removeChild(t)}var o=document.createEvent("MouseEvents")
;o.initMouseEvent(e.type,e.bubbles,e.cancelable,window,e.detail,e.screenX,e.screenY,e.clientX,e.clientY,e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget),this.dialog_.dispatchEvent(o),e.stopPropagation()},focus_:function(){var e=this.dialog_.querySelector("[autofocus]:not([disabled])");!e&&this.dialog_.tabIndex>=0&&(e=this.dialog_),e||(e=s(this.dialog_)),n(document.activeElement),e&&e.focus()},updateZIndex:function(e,t){if(e<t)throw new Error("dialogZ should never be < backdropZ");this.dialog_.style.zIndex=e,this.backdrop_.style.zIndex=t},show:function(){this.dialog_.open||(this.setOpen(!0),this.focus_())},showModal:function(){if(this.dialog_.hasAttribute("open"))throw new Error("Failed to execute 'showModal' on dialog: The element is already open, and therefore cannot be opened modally.");if(!l(this.dialog_))throw new Error("Failed to execute 'showModal' on dialog: The element is not in a Document.");if(!h.dm.pushDialog(this))throw new Error("Failed to execute 'showModal' on dialog: There are too many open modal dialogs.");(function(e){for(;e&&e!==document.body;){var t=window.getComputedStyle(e),o=function(e,o){return!(void 0===t[e]||t[e]===o)};if(t.opacity<1||o("zIndex","auto")||o("transform","none")||o("mixBlendMode","normal")||o("filter","none")||o("perspective","none")||"isolate"===t.isolation||"fixed"===t.position||"touch"===t.webkitOverflowScrolling)return!0;e=e.parentElement}return!1})(this.dialog_.parentElement)&&console.warn("A dialog is being shown inside a stacking context. This may cause it to be unusable. For more information, see this link: https://github.com/GoogleChrome/dialog-polyfill/#stacking-context"),this.setOpen(!0),this.openAsModal_=!0,h.needsCentering(this.dialog_)?(h.reposition(this.dialog_),this.replacedStyleTop_=!0):this.replacedStyleTop_=!1,this.dialog_.parentNode.insertBefore(this.backdrop_,this.dialog_.nextSibling),this.focus_()},close:function(e){if(!this.dialog_.hasAttribute("open"))throw new Error("Failed to execute 'close' on dialog: The element does not have an 'open' attribute, and therefore cannot be closed.");this.setOpen(!1),void 0!==e&&(this.dialog_.returnValue=e);var i=new t("close",{bubbles:!1,cancelable:!1});o(this.dialog_,i)}};var h={reposition:function(e){var t=document.body.scrollTop||document.documentElement.scrollTop,o=t+(window.innerHeight-e.offsetHeight)/2;e.style.top=Math.max(t,o)+"px"},isInlinePositionSetByStylesheet:function(e){for(var t=0;t<document.styleSheets.length;++t){var o=document.styleSheets[t],i=null;try{i=o.cssRules}catch(e){}if(i)for(var n=0;n<i.length;++n){var a=i[n],s=null;try{s=document.querySelectorAll(a.selectorText)}catch(e){}if(s&&r(s,e)){var l=a.style.getPropertyValue("top"),c=a.style.getPropertyValue("bottom");if(l&&"auto"!==l||c&&"auto"!==c)return!0}}}return!1},needsCentering:function(e){return"absolute"===window.getComputedStyle(e).position&&(!("auto"!==e.style.top&&""!==e.style.top||"auto"!==e.style.bottom&&""!==e.style.bottom)&&!h.isInlinePositionSetByStylesheet(e))},forceRegisterDialog:function(e){if((window.HTMLDialogElement||e.showModal)&&console.warn("This browser already supports <dialog>, the polyfill may not work correctly",e),"dialog"!==e.localName)throw new Error("Failed to register dialog: The element is not a dialog.");new u(e)},registerDialog:function(e){e.showModal||h.forceRegisterDialog(e)},DialogManager:function(){this.pendingDialogStack=[];var e=this.checkDOM_.bind(this);this.overlay=document.createElement("div"),this.overlay.className="_dialog_overlay",this.overlay.addEventListener("click",function(t){this.forwardTab_=void 0,t.stopPropagation(),e([])}.bind(this)),this.handleKey_=this.handleKey_.bind(this),this.handleFocus_=this.handleFocus_.bind(this),this.zIndexLow_=1e5,this.zIndexHigh_=100150,this.forwardTab_=void 0,"MutationObserver"in window&&(this.mo_=new MutationObserver(function(t){var o=[];t.forEach(function(e){for(var t,i=0;t=e.removedNodes[i];++i)t instanceof Element&&("dialog"===t.localName&&o.push(t),
o=o.concat(t.querySelectorAll("dialog")))}),o.length&&e(o)}))}};if(h.DialogManager.prototype.blockDocument=function(){document.documentElement.addEventListener("focus",this.handleFocus_,!0),document.addEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.observe(document,{childList:!0,subtree:!0})},h.DialogManager.prototype.unblockDocument=function(){document.documentElement.removeEventListener("focus",this.handleFocus_,!0),document.removeEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.disconnect()},h.DialogManager.prototype.updateStacking=function(){for(var e,t=this.zIndexHigh_,o=0;e=this.pendingDialogStack[o];++o)e.updateZIndex(--t,--t),0===o&&(this.overlay.style.zIndex=--t);var i=this.pendingDialogStack[0];i?(i.dialog.parentNode||document.body).appendChild(this.overlay):this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay)},h.DialogManager.prototype.containedByTopDialog_=function(e){for(;e=i(e);){for(var t,o=0;t=this.pendingDialogStack[o];++o)if(t.dialog===e)return 0===o;e=e.parentElement}return!1},h.DialogManager.prototype.handleFocus_=function(e){var t=e.composedPath?e.composedPath()[0]:e.target;if(!this.containedByTopDialog_(t)&&document.activeElement!==document.documentElement&&(e.preventDefault(),e.stopPropagation(),n(t),void 0!==this.forwardTab_)){var o=this.pendingDialogStack[0];return o.dialog.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING&&(this.forwardTab_?o.focus_():t!==document.documentElement&&document.documentElement.focus()),!1}},h.DialogManager.prototype.handleKey_=function(e){if(this.forwardTab_=void 0,27===e.keyCode){e.preventDefault(),e.stopPropagation();var i=new t("cancel",{bubbles:!1,cancelable:!0}),n=this.pendingDialogStack[0];n&&o(n.dialog,i)&&n.dialog.close()}else 9===e.keyCode&&(this.forwardTab_=!e.shiftKey)},h.DialogManager.prototype.checkDOM_=function(e){this.pendingDialogStack.slice().forEach(function(t){-1!==e.indexOf(t.dialog)?t.downgradeModal():t.maybeHideModal()})},h.DialogManager.prototype.pushDialog=function(e){var t=(this.zIndexHigh_-this.zIndexLow_)/2-1;return!(this.pendingDialogStack.length>=t)&&(1===this.pendingDialogStack.unshift(e)&&this.blockDocument(),this.updateStacking(),!0)},h.DialogManager.prototype.removeDialog=function(e){var t=this.pendingDialogStack.indexOf(e);-1!==t&&(this.pendingDialogStack.splice(t,1),0===this.pendingDialogStack.length&&this.unblockDocument(),this.updateStacking())},h.dm=new h.DialogManager,h.formSubmitter=null,h.imagemapUseValue=null,void 0===window.HTMLDialogElement){var p=document.createElement("form");if(p.setAttribute("method","dialog"),"dialog"!==p.method){var g=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"method");if(g){var f=g.get;g.get=function(){return a(this)?"dialog":f.call(this)};var m=g.set;g.set=function(e){return"string"==typeof e&&"dialog"===e.toLowerCase()?this.setAttribute("method",e):m.call(this,e)},Object.defineProperty(HTMLFormElement.prototype,"method",g)}}document.addEventListener("click",function(e){if(h.formSubmitter=null,h.imagemapUseValue=null,!e.defaultPrevented){var t=e.target;if("composedPath"in e)t=e.composedPath().shift()||t;if(t&&a(t.form)){if(!("submit"===t.type&&["button","input"].indexOf(t.localName)>-1)){if("input"!==t.localName||"image"!==t.type)return;h.imagemapUseValue=e.offsetX+","+e.offsetY}i(t)&&(h.formSubmitter=t)}}},!1),document.addEventListener("submit",function(e){var t=e.target;if(!i(t)){var o=c(e);"dialog"===(o&&o.getAttribute("formmethod")||t.getAttribute("method"))&&e.preventDefault()}});var y=HTMLFormElement.prototype.submit;HTMLFormElement.prototype.submit=function(){if(!a(this))return y.call(this);var e=i(this);e&&e.close()}}class v{constructor(e){var t;this.dialogElement=e,v.isAlreadyRegistered(e)||(e.showModal||h.registerDialog(e),"BODY"!==this.dialogElement.parentElement.tagName&&document.body.appendChild(this.dialogElement),this.updateFocusableElements(),this.mutationObserver=new MutationObserver(()=>{
this.updateFocusableElements()}),this.mutationObserver.observe(e,{subtree:!0,childList:!0,attributes:!0}),e.addEventListener("click",e=>{void 0!==e.composedPath().find(e=>{var t;return e&&(null===(t=e.classList)||void 0===t?void 0:t.contains("dialog-close"))})&&this.close()}),e.addEventListener("keydown",e=>{var t,o,i,n,r;if("Esc"!==e.key&&"Escape"!==e.key||(e.preventDefault(),e.stopPropagation(),"true"!==this.dialogElement.dataset.noEsc&&this.close()),"Tab"===e.key){e.preventDefault(),this.focusableElements&&0!==this.focusableElements.length||this.updateFocusableElements();const a=this.focusableElements,s=null!==(t=a.findIndex(e=>e===document.activeElement))&&void 0!==t?t:0;e.shiftKey?0===s?null===(o=a[a.length-1])||void 0===o||o.focus():null===(i=a[s-1])||void 0===i||i.focus():s===a.length-1?null===(n=a[0])||void 0===n||n.focus():null===(r=a[s+1])||void 0===r||r.focus()}}),""!==(null===(t=this.dialogElement.id)||void 0===t?void 0:t.trim())&&document.querySelectorAll(`button[aria-controls="${this.dialogElement.id}"], a[aria-controls="${this.dialogElement.id}"]`).forEach(e=>{e.addEventListener("click",e=>{e.preventDefault(),this.open()})}),this.handleDatePickers(),this.dialogElement.dataset.registeredDialog="true")}updateFocusableElements(){this.focusableElements=Array.from(this.dialogElement.querySelectorAll('a:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), input[type="button"]:not([disabled]), select:not([disabled])')).filter(e=>null!==e.offsetParent&&(e.childNodes.length>0||"A"!==e.tagName))}handleDatePickers(){e(this.dialogElement).on("ab.datepicker.opened",e=>{const t=e.target,o=this.dialogElement.querySelector(`#${t.getAttribute("aria-controls")}`);this.dialogElement.appendChild(t);const i=o.getBoundingClientRect(),n=this.dialogElement.getBoundingClientRect();if(t.style.left=i.left-n.left+"px",t.classList.contains("above")){const e=i.top-n.top-t.clientHeight,o=Math.max(-n.top,e);t.style.top=`${o}px`}else{const e=window.innerHeight-n.top-t.clientHeight,o=i.bottom-n.top,r=Math.min(e,o);t.style.top=`${r}px`}})}open(){this.dialogElement.hasAttribute("open")||this.dialogElement.showModal()}close(){this.dialogElement.close()}delete(){this.mutationObserver.disconnect(),this.dialogElement.remove()}static isAlreadyRegistered(e){var t;return"true"===(null===(t=null==e?void 0:e.dataset)||void 0===t?void 0:t.registeredDialog)}static registerAllDialogsInDOM(){document.querySelectorAll("dialog").forEach(e=>{v.isAlreadyRegistered(e)||new v(e)})}static updateDialogTriggers(){document.querySelectorAll("button[aria-controls], a[aria-controls]").forEach(e=>{const t=e.getAttribute("aria-controls"),o=document.querySelector(`dialog#${t}`);o&&e.addEventListener("click",()=>{o.showModal()})})}static blankDialog(e){var t,o;const i=`\n      <dialog${e.dialogId?` id="${e.dialogId}"`:""}${e.dialogClasses?` class="${e.dialogClasses}"`:""}>\n        <div class="dialog-content">\n          <div class="dialog-header">\n            ${(null==e?void 0:e.noTitle)?"":`<h2 class="dialog-title">${null!==(t=e.title)&&void 0!==t?t:""}</h2>`}\n            ${(null==e?void 0:e.hideCloseButtonInHeader)?"":'\n    <div class="dialog-header-buttons">\n        <button type="button" class="dialog-close" title="Close"><i class="far fa-times fa-2x" aria-hidden="true"></i></button>\n    </div>'}\n          </div>\n          <div class="dialog-body">\n            ${null!==(o=null==e?void 0:e.content)&&void 0!==o?o:""}\n          </div>\n          <div class="dialog-footer">\n            ${(null==e?void 0:e.hideCloseButtonInFooter)?"":'<button type="button" class="btn btn-default dialog-close">Cancel</button>'}\n          </div>\n        </div>\n      </dialog>\n    `;return(new DOMParser).parseFromString(i,"text/html").querySelector("dialog")}}
const b=()=>document.getElementById("email-owner-link"),w=()=>document.getElementById("email-page-owner"),_=new DOMParser;function k(){const e=w();e.classList.contains("hidden")?(e.classList.remove("hidden"),e.scrollIntoView(!0)):e.classList.add("hidden")}function E(e){e.querySelector("#message-submit").addEventListener("click",t=>{t.preventDefault(),async function(){const e=b().getAttribute("href"),t=fetch(e,{method:"post",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(new FormData(w().querySelector("form")))});w().innerHTML='<i class="fas fa-spinner-third fa-spin" aria-hidden="true"></i> Sending...';const o=await t;return o.ok?o.text().then(e=>_.parseFromString(e,"text/html")).catch(e=>Promise.reject(`Could not parse response after submitting email page contact form: ${e}`)):Promise.reject("Could not submit email page contact form")}().then(t=>{var o;if("Success"===(null===(o=t.body.querySelector("h1"))||void 0===o?void 0:o.innerText))e.innerHTML='<i class="fas fa-check" aria-hidden="true"></i> Sent';else{e.innerHTML="",e.appendChild(t.body.querySelector("div"));const o=e.querySelector("#emailPageOwnerAntiSpam");o&&window.grecaptcha.render(o,o.dataset.sitekey),E(e)}})}),e.querySelector("#message-cancel").addEventListener("click",e=>{e.preventDefault(),k()})}async function S(e){const t=document.getElementById("emailPageOwnerAntiSpam");if(void 0!==window.grecaptcha&&t)window.grecaptcha.render(t,t.dataset.sitekey);else{const t=await async function(){const e=b().getAttribute("href"),t=await fetch(e);return t.ok?t.text().then(e=>_.parseFromString(e,"text/html")).catch(e=>Promise.reject(`Could not parse page contact email form: ${e}`)):Promise.reject("Could not get page contact email form")}();if(e.appendChild(t.body.querySelector("div")),v.registerAllDialogsInDOM(),document.getElementById("emailPageOwnerAntiSpam")){const e=document.createElement("script");e.async=!0,e.src="https://www.recaptcha.net/recaptcha/api.js",e.onerror=()=>{document.querySelector("#captchaFailure-emailPageOwnerAntiSpam").showModal()},document.querySelector("head").appendChild(e)}E(e)}}const L={x:'\n    <svg class="fa-x" viewBox="0 0 1200 1227" aria-hidden="true">\n    <path id="p" d="M714.163 519.284L1160.89 0H1055.03L667.137 450.887L357.328 0H0L468.492 681.821L0 1226.37H105.866L515.491 750.218L842.672 1226.37H1200L714.137 519.284H714.163ZM569.165 687.828L521.697 619.934L144.011 79.6944H306.615L611.412 515.685L658.88 583.579L1055.08 1150.3H892.476L569.165 687.854V687.828Z" fill="currentColor"/>\n    </svg>\n    '.trim(),"x-square":'\n    <svg class="fa-x-square" viewBox="0 0 512 512" aria-hidden="true">\n    <path id="p" fill="currentColor" d="M 64,0 A 64,64 0 0 0 0,64 v 384 a 64,64 0 0 0 64,64 h 384 a 64,64 0 0 0 64,-64 V 64 A 64,64 0 0 0 448,0 Z m 9.427734,77.443359 H 180.96875 L 274.20703,213.13867 390.94531,77.443359 h 31.85938 L 288.35938,233.72461 h -0.008 L 434.57422,446.52539 H 327.03516 L 228.56836,303.22461 105.28906,446.52539 H 73.427734 L 214.42383,282.64062 Z m 43.341796,23.984371 113.66602,162.58789 14.28515,20.43165 v 0.008 l 97.30274,139.17578 h 48.93554 L 271.7207,253.07422 257.43555,232.64062 165.70508,101.42773 Z"></path>\n    </svg>\n    '.trim()},M=["fa-stack-1x","fa-stack-2x","fa-inverse","fa-fw","fa-2x","fa-3x","fa-4x","fa-5x","fa-flip-vertical","fa-flip-horizontal","fa-rotate-90","fa-rotate-180","fa-rotate-270","fa"],x={keepOriginal:!1};function D(e,t,o,i){o.querySelectorAll(t).forEach(t=>{if(i.keepOriginal&&t.dataset.xCloned)return;const o=function(e){const t=document.createElement("div");return t.innerHTML=L[e],t.querySelector("svg")}(e).cloneNode(!0);M.forEach(e=>{t.classList.contains(e)&&o.classList.add(e)}),i.keepOriginal?(t.dataset.xCloned="true",t.classList.add("hidden"),t.insertAdjacentElement("afterend",o)):t.replaceWith(o)})}const A={fatal:0,error:0,warn:1,log:2,info:3,success:3,fail:3,debug:4,trace:5,verbose:Number.POSITIVE_INFINITY},C={silent:{level:-1},fatal:{level:A.fatal},error:{
level:A.error},warn:{level:A.warn},log:{level:A.log},info:{level:A.info},success:{level:A.success},fail:{level:A.fail},ready:{level:A.info},start:{level:A.info},box:{level:A.info},debug:{level:A.debug},trace:{level:A.trace},verbose:{level:A.verbose}};function T(e){if(null===e||"object"!=typeof e)return!1;const t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&(!(Symbol.iterator in e)&&(!(Symbol.toStringTag in e)||"[object Module]"===Object.prototype.toString.call(e)))}function q(e,t,o=".",i){if(!T(t))return q(e,{},o);const n=Object.assign({},t);for(const t in e){if("__proto__"===t||"constructor"===t)continue;const i=e[t];null!=i&&(Array.isArray(i)&&Array.isArray(n[t])?n[t]=[...i,...n[t]]:T(i)&&T(n[t])?n[t]=q(i,n[t],(o?`${o}.`:"")+t.toString()):n[t]=i)}return n}const O=(...e)=>e.reduce((e,t)=>q(e,t,""),{});function F(e){return t=e,"[object Object]"===Object.prototype.toString.call(t)&&(!(!e.message&&!e.args)&&!e.stack);var t}let I=!1;const P=[];class H{options;_lastLog;_mockFn;constructor(e={}){const t=e.types||C;this.options=O({...e,defaults:{...e.defaults},level:N(e.level,t),reporters:[...e.reporters||[]]},{types:C,throttle:1e3,throttleMin:5,formatOptions:{date:!0,colors:!1,compact:!0}});for(const e in t){const o={type:e,...this.options.defaults,...t[e]};this[e]=this._wrapLogFn(o),this[e].raw=this._wrapLogFn(o,!0)}this.options.mockFn&&this.mockTypes(),this._lastLog={}}get level(){return this.options.level}set level(e){this.options.level=N(e,this.options.types,this.options.level)}prompt(e,t){if(!this.options.prompt)throw new Error("prompt is not supported!");return this.options.prompt(e,t)}create(e){const t=new H({...this.options,...e});return this._mockFn&&t.mockTypes(this._mockFn),t}withDefaults(e){return this.create({...this.options,defaults:{...this.options.defaults,...e}})}withTag(e){return this.withDefaults({tag:this.options.defaults.tag?this.options.defaults.tag+":"+e:e})}addReporter(e){return this.options.reporters.push(e),this}removeReporter(e){if(e){const t=this.options.reporters.indexOf(e);if(-1!==t)return this.options.reporters.splice(t,1)}else this.options.reporters.splice(0);return this}setReporters(e){return this.options.reporters=Array.isArray(e)?e:[e],this}wrapAll(){this.wrapConsole(),this.wrapStd()}restoreAll(){this.restoreConsole(),this.restoreStd()}wrapConsole(){for(const e in this.options.types)console["__"+e]||(console["__"+e]=console[e]),console[e]=this[e].raw}restoreConsole(){for(const e in this.options.types)console["__"+e]&&(console[e]=console["__"+e],delete console["__"+e])}wrapStd(){this._wrapStream(this.options.stdout,"log"),this._wrapStream(this.options.stderr,"log")}_wrapStream(e,t){e&&(e.__write||(e.__write=e.write),e.write=e=>{this[t].raw(String(e).trim())})}restoreStd(){this._restoreStream(this.options.stdout),this._restoreStream(this.options.stderr)}_restoreStream(e){e&&e.__write&&(e.write=e.__write,delete e.__write)}pauseLogs(){I=!0}resumeLogs(){I=!1;const e=P.splice(0);for(const t of e)t[0]._logFn(t[1],t[2])}mockTypes(e){const t=e||this.options.mockFn;if(this._mockFn=t,"function"==typeof t)for(const e in this.options.types)this[e]=t(e,this.options.types[e])||this[e],this[e].raw=this[e]}_wrapLogFn(e,t){return(...o)=>{if(!I)return this._logFn(e,o,t);P.push([this,e,o,t])}}_logFn(e,t,o){if((e.level||0)>this.level)return!1;const i={date:new Date,args:[],...e,level:N(e.level,this.options.types)};!o&&1===t.length&&F(t[0])?Object.assign(i,t[0]):i.args=[...t],i.message&&(i.args.unshift(i.message),delete i.message),i.additional&&(Array.isArray(i.additional)||(i.additional=i.additional.split("\n")),i.args.push("\n"+i.additional.join("\n")),delete i.additional),i.type="string"==typeof i.type?i.type.toLowerCase():"log",i.tag="string"==typeof i.tag?i.tag:"";const n=(e=!1)=>{const t=(this._lastLog.count||0)-this.options.throttleMin;if(this._lastLog.object&&t>0){const e=[...this._lastLog.object.args];t>1&&e.push(`(repeated ${t} times)`),this._log({
...this._lastLog.object,args:e}),this._lastLog.count=1}e&&(this._lastLog.object=i,this._log(i))};clearTimeout(this._lastLog.timeout);const r=this._lastLog.time&&i.date?i.date.getTime()-this._lastLog.time.getTime():0;if(this._lastLog.time=i.date,r<this.options.throttle)try{const e=JSON.stringify([i.type,i.tag,i.args]),t=this._lastLog.serialized===e;if(this._lastLog.serialized=e,t&&(this._lastLog.count=(this._lastLog.count||0)+1,this._lastLog.count>this.options.throttleMin))return void(this._lastLog.timeout=setTimeout(n,this.options.throttle))}catch{}n(!0)}_log(e){for(const t of this.options.reporters)t.log(e,{options:this.options})}}function N(e,t={},o=3){return void 0===e?o:"number"==typeof e?e:t[e]&&void 0!==t[e].level?t[e].level:o}H.prototype.add=H.prototype.addReporter,H.prototype.remove=H.prototype.removeReporter,H.prototype.clear=H.prototype.removeReporter,H.prototype.withScope=H.prototype.withTag,H.prototype.mock=H.prototype.mockTypes,H.prototype.pause=H.prototype.pauseLogs,H.prototype.resume=H.prototype.resumeLogs;class j{options;defaultColor;levelColorMap;typeColorMap;constructor(e){this.options={...e},this.defaultColor="#7f8c8d",this.levelColorMap={0:"#c0392b",1:"#f39c12",3:"#00BCD4"},this.typeColorMap={success:"#2ecc71"}}_getLogFn(e){return e<1?console.__error||console.error:1===e?console.__warn||console.warn:console.__log||console.log}log(e){const t=this._getLogFn(e.level),o="log"===e.type?"":e.type,i=e.tag||"",n=`\n      background: ${this.typeColorMap[e.type]||this.levelColorMap[e.level]||this.defaultColor};\n      border-radius: 0.5em;\n      color: white;\n      font-weight: bold;\n      padding: 2px 0.5em;\n    `,r=`%c${[i,o].filter(Boolean).join(":")}`;"string"==typeof e.args[0]?t(`${r}%c ${e.args[0]}`,n,"",...e.args.slice(1)):t(r,n,...e.args)}}const R=function(e={}){return function(e={}){return new H(e)}({reporters:e.reporters||[new j({})],prompt:(e,t={})=>"confirm"===t.type?Promise.resolve(confirm(e)):Promise.resolve(prompt(e)),...e})}();let $=null;function B(e){e.querySelectorAll(".checkbox").forEach(e=>{e.querySelector('input[type="checkbox"]').checked?e.classList.add("selected"):e.classList.remove("selected")})}function z(e){if("true"!==e.dataset.initialised){e.querySelectorAll('input[type="checkbox"]').forEach(t=>{const o=t.closest(".checkbox"),i=o.classList.contains("disabled")?"fas fa-fw fa-check fa-lg":"far fa-fw fa-check-square fa-2x";t.insertAdjacentHTML("afterend",`<i class="${i}" aria-hidden="true"></i><i class="fal fa-fw fa-square fa-2x" aria-hidden="true"></i>`),t.addEventListener("change",()=>{B(e)}),t.addEventListener("focus",()=>{o.classList.add("focused")}),t.addEventListener("blur",()=>{o.classList.remove("focused")})}),B(e),function(e){null===$&&($={functional:e.querySelector("input#cookie-modal-functional-cookies").checked,advertising:e.querySelector("input#cookie-modal-advertising-cookies").checked,performance:e.querySelector("input#cookie-modal-performance-cookies").checked})}(e),e.dataset.initialised="true"}}function V(){var e;let t=document.querySelector("#cookie-modal");if(t){const o=document.querySelector("#cookie-banner");(null===(e=null==o?void 0:o.style)||void 0===e?void 0:e.zIndex)&&(t.style.zIndex=(parseInt(o.style.zIndex,10)+1).toString());const i=t.querySelector("form");!function(e){e.querySelector("input#cookie-modal-functional-cookies").checked=$.functional,e.querySelector("input#cookie-modal-advertising-cookies").checked=$.advertising,e.querySelector("input#cookie-modal-performance-cookies").checked=$.performance}(i),z(i),B(i),t.showModal()}else{const e=encodeURIComponent(window.location.pathname+window.location.search);fetch(`/sitebuilder2/user/cookiepreference/modal.htm?returnTo=${e}`).then(e=>{e.text().then(e=>{document.querySelector(".cookie-preference-modal-container").innerHTML=e,t=document.querySelector("#cookie-modal"),new v(t);const o=t.querySelector("form");z(o),t.querySelector(".cookie-preference-submit").addEventListener("click",()=>{o.submit()}),t.showModal()
})})}}const K=e=>(t={},...o)=>function(e,t,...o){const i=document.createElement(e);return Object.keys(t).forEach(e=>{i.setAttribute(e,t[e])}),o.forEach(e=>{null==e||("string"==typeof e?i.appendChild(document.createTextNode(e)):Array.isArray(e)?e.forEach(e=>i.appendChild(e)):i.appendChild(e))}),i}(e,t,...o),Z=K("i"),U=K("img");window.SiteBuilderDialog=v,window.addEventListener("DOMContentLoaded",()=>{v.registerAllDialogsInDOM(),function(){const e=w();let t=!1;const o=b();null==o||o.addEventListener("click",async o=>{o.preventDefault(),t||(await S(e),t=!0),k()})}(),function(e,t){const o=Object.assign({},x,t);D("x","i.fa-twitter,em.fa-twitter",e,o),D("x-square","i.fa-twitter-square,em.fa-twitter-square",e,o)}(document.body),function(){document.querySelectorAll(".cookie-banner-modal-button, #cookie-preference-link").forEach(e=>{e.addEventListener("click",e=>{e.preventDefault(),V()})});const e=document.querySelector("#cookie-banner");if(e){const t=()=>{document.documentElement.style.setProperty("--w-sys-cookieBanner-height",`${e.offsetHeight}px`)};t(),window.addEventListener("resize",t),e.showModal()}const t=document.querySelector("#cookiePreferenceForm");if(t){const e=t.querySelector(".btn-accept-all");null==e||e.addEventListener("mouseover",()=>{!function(e){e.querySelectorAll(".checkbox:not(.disabled)").forEach(e=>{e.classList.add("ghostTick")})}(t)}),null==e||e.addEventListener("mouseout",()=>{!function(e){e.querySelectorAll(".checkbox:not(.disabled)").forEach(e=>{e.classList.remove("ghostTick")})}(t)}),z(t)}const o=document.querySelector(".cookie-policy-link a");o&&(null==o||o.addEventListener("click",async e=>{e.preventDefault();let t=document.querySelector("#cookie-policy-dialog");if(t)t.showModal();else{t=v.blankDialog({dialogId:"cookie-policy-dialog",title:"Cookie Policy",hideCloseButtonInFooter:!0,content:'<p><i class="fas fa-spinner fa-pulse" aria-hidden="true"></i> Loading</p>'}),document.body.appendChild(t),new v(t),t.showModal();const e=t.querySelector(".dialog-body");try{const t=await fetch(o.getAttribute("href")+"?xdoplain=true"),i=await t.text();e.innerHTML="",e.insertAdjacentHTML("beforeend",(new DOMParser).parseFromString(i,"text/html").querySelector(".content-text").innerHTML)}catch(t){e.innerHTML='<p class="text-danger"><i class="fas fa-exclamation-triangle" aria-hidden="true"></i> There was an error loading the cookie policy. Refresh the page and try again.</p>',R.error("Error loading cookie policy:",t)}}}))}(),function(){const e=document.querySelectorAll(".id7-main-content-area a[rel^=lightbox]");if(e.length>0){const t=v.blankDialog({dialogId:"image-modal",dialogClasses:"image-modal maximised",noTitle:!0});document.body.appendChild(t),new v(t);const o=t.querySelector(".dialog-body"),i=t.querySelector(".dialog-footer"),n=Z({class:"image-controls left fa fa-chevron-left fa-2x","aria-hidden":"true"}),r=Z({class:"image-controls right fa fa-chevron-right fa-2x","aria-hidden":"true"});function a(t){const i=o.querySelector("img:not(.hidden)");let n=parseInt(i.getAttribute("data-image-index"),10)+t;n<0&&(n=0),n>e.length-1&&(n=e.length-1),s(n,e[n].querySelector("img").getAttribute("title"))}function s(t,a){const s=e[t].href.split("?")[0];if(!o.querySelector(`img[data-image-index="${t}"]`)){const e=U({src:s,"data-image-index":t.toString(10),alt:""});o.appendChild(e)}o.querySelectorAll("img").forEach(e=>{e.classList.toggle("hidden",e.getAttribute("data-image-index")!==t.toString(10))}),i.innerText=a,n.classList.toggle("hidden",0===t),r.classList.toggle("hidden",t===e.length-1)}o.appendChild(n),o.appendChild(r),e.forEach((e,o)=>{e.addEventListener("click",i=>{i.preventDefault(),s(o,e.querySelector("img").getAttribute("title")),t.showModal()})}),n.addEventListener("click",()=>{a(-1)}),r.addEventListener("click",()=>{a(1)}),document.addEventListener("keydown",e=>{t.open&&("ArrowLeft"!==e.key&&"Left"!==e.key||a(-1),"ArrowRight"!==e.key&&"Right"!==e.key||a(1))})}}()})}(jQuery);//# sourceMappingURL=sitebuilder.js.map
