1 2 3/* ==== INCLUDE: /js/blocks.js ==== */ 4 5LazyLoad=function(a){function h(b,c){var e,d=a.createElement(b);for(e in c)c.hasOwnProperty(e)&&d.setAttribute(e,c[e]);return d}function i(a){var c,g,b=d[a];b&&(c=b.callback,g=b.urls,g.shift(),e=0,g.length||(c&&c.call(b.context,b.obj),d[a]=null,f[a].length&&k(a)))}function j(){var c=navigator.userAgent;b={async:a.createElement("script").async===!0},(b.webkit=/AppleWebKit\//.test(c))||(b.ie=/MSIE|Trident/.test(c))||(b.opera=/Opera/.test(c))||(b.gecko=/Gecko\//.test(c))||(b.unknown=!0)}function k(e,g,k,n,o){var s,t,u,v,w,x,p=function(){i(e)},q="css"===e,r=[];if(b||j(),g)if(g="string"==typeof g?[g]:g.concat(),q||b.async||b.gecko||b.opera)f[e].push({urls:g,callback:k,obj:n,context:o});else for(s=0,t=g.length;s<t;++s)f[e].push({urls:[g[s]],callback:s===t-1?k:null,obj:n,context:o});if(!d[e]&&(v=d[e]=f[e].shift())){for(c||(c=a.head||a.getElementsByTagName("head")[0]),w=v.urls.concat(),s=0,t=w.length;s<t;++s)x=w[s],q?u=b.gecko?h("style"):h("link",{href:x,rel:"stylesheet"}):(u=h("script",{src:x}),u.async=!1),u.className="lazyload",u.setAttribute("charset","utf-8"),b.ie&&!q&&"onreadystatechange"in u&&!("draggable"in u)?u.onreadystatechange=function(){/loaded|complete/.test(u.readyState)&&(u.onreadystatechange=null,p())}:q&&(b.gecko||b.webkit)?b.webkit?(v.urls[s]=u.href,m()):(u.innerHTML='@import "'+x+'";',l(u)):u.onload=u.onerror=p,r.push(u);for(s=0,t=r.length;s<t;++s)c.appendChild(r[s])}}function l(a){var b;try{b=!!a.sheet.cssRules}catch(c){return e+=1,void(e<200?setTimeout(function(){l(a)},50):b&&i("css"))}i("css")}function m(){var b,a=d.css;if(a){for(b=g.length;--b>=0;)if(g[b].href===a.urls[0]){i("css");break}e+=1,a&&(e<200?setTimeout(m,50):i("css"))}}var b,c,d={},e=0,f={css:[],js:[]},g=a.styleSheets;return{css:function(a,b,c,d){k("css",a,b,c,d)},js:function(a,b,c,d){k("js",a,b,c,d)}}}(this.document); 6 7window.nanoid=(t=21)=>{let e="",r=crypto.getRandomValues(new Uint8Array(t));for(;t--;){let n=63&r[t];e+=n<36?n.toString(36):n<62?(n-26).toString(36).toUpperCase():n<63?"_":"-"}return e}; 8 9!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(n=n||self).TypeIt=t()}(this,(function(){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n})(t)}var t={strings:[],speed:100,cursor:!0,cursorChar:"|",cursorSpeed:1e3,deleteSpeed:null,lifeLike:!0,breakLines:!0,startDelay:250,startDelete:!1,nextStringDelay:750,loop:!1,loopDelay:750,html:!0,waitUntilVisible:!1,beforeString:function(){},afterString:function(){},beforeStep:function(){},afterStep:function(){},afterComplete:function(){}},e=function(n){return n.map((function(n){return void 0===n[1]&&n.push(null),void 0===n[2]&&n.push({}),n}))},r=function(n,t){return Object.assign({},n,t)},i=function(n){return Array.isArray(n)},o=function(n,t){return n[2]=r(n[2],t)||t,n},u=function(n,t){return i(n[0])?n.map((function(n){return o(n,t)})):o(n,t)},c=function(n,t,e,r){r=r||!1,e=e||{};var o=!i(n),c=n.length;return(n=o?new Array(n).fill(0):n).map((function(n,i){if(o)return t;var a=[t,n,e];return r&&(0===i&&(a=u(a,{isFirst:!0})),i+1===c&&(a=u(a,{isLast:!0}))),a}))};function a(n){this.insert=function(n,e){t.splice(n,0,e)},this.add=function(n,u,a){return n=i(n)?n:[n,null],a=a||!1,u=u||1,i(n[0])||(n=c(u,n)),n=e(n).map((function(n){return n[2]=r(n[2],{id:o}),o++,n})),t=a?n.concat(t):t.concat(n),this},this.set=function(n,e){t[n]=e},this.reset=function(){t=t.map((function(n){return n[2].executed=!1,n}))},this.getItems=function(){return(t=e(t)).filter((function(n){return!n[2].executed}))},this.setMeta=function(n,e){var i=t.findIndex((function(t){return t[2].id===n}));t[i][2]=r(t[i][2],e)};var t=[],o=0;this.add(n)}var f=function(n){return Array.from(n)},s=function(n){var t=[];return t.concat.apply(t,n)},l=function(n){var t=document.implementation.createHTMLDocument("");return t.body.innerHTML=n,t.body},d=function n(t,e,r){e=e||null,r=void 0!==r&&r;var i=f(t.childNodes).map((function(t){return 3===(e=t).nodeType||"BR"===e.tagName?t:n(t);var e}));return i=s(i),e&&(i=i.filter((function(n){return!e.contains(n)}))),r?i.reverse():i},p=function(n){return"BODY"===n.tagName},h=function(n,t){t=t||null;var e=n instanceof HTMLElement;return{node:t,isTopLevelText:(!t||p(t.parentNode))&&!e,isHTMLElement:e,content:n}};function v(n){var t,e=l(n);return t=d(e).map((function(n){return n.nodeValue?f(n.nodeValue).map((function(t){return h(t,n)})):h(n)})),s(t)}function y(n,t){return(t=void 0===t||t)?v(n):f(n).map((function(n){return h(n)}))}var m=function(n){return document.createElement(n)},g=function(n,t){var e=m("style");e.id=t||"",e.appendChild(document.createTextNode(n)),document.head.appendChild(e)},b=function(n){return i(n)||(n=[n/2,n/2]),{before:n[0],after:n[1],total:n[0]+n[1]}},S=function(n,t){return Math.abs(Math.random()*(n+t-(n-t))+(n-t))};var N=function(n){return["textarea","input"].indexOf(n.tagName.toLowerCase())>-1},T=function(n,t){var e=t.querySelectorAll("*");return[t].concat(f(e).reverse()).find((function(t){return t.cloneNode().outerHTML===n.outerHTML}))},L=function(n,t,e,r){e=e||null;var i=t.isHTMLElement,o=i?t.content:document.createTextNode(t.content);if(N(n))n.value="".concat(n.value).concat(t.content);else{if(!t.isTopLevelText&&!i){var u=t.node.parentNode,c=T(u.cloneNode(),n);if(function(n,t){if(!n)return!1;var e=n.nextSibling;return!e||e.isEqualNode(t)}(c,e))n=c;else if((o=u.cloneNode()).innerText=t.content,!p(u.parentNode)){for(var a=u.parentNode,f=a.cloneNode(),s=T(f,n);!s&&!p(a);)f.innerHTML=o.outerHTML,o=f,f=a.parentNode.cloneNode(),a=a.parentNode,s=T(f,n);n=s||n}}var l=d(n,e,!0)[r-1],h=l?l.parentNode:n;h.insertBefore(o,h.contains(e)?e:null)}},M=function(n){var t;return null==n||null===(t=n.parentNode)||void 0===t?void 0:t.removeChild(n)};var x=function(n,t,e){var r,i="string"==typeof n,o=!1,u=-1*n;return i&&(u=(r="END"===n.toUpperCase())?-1:1,o=r?t+u>0:t+u<e.length),{isString:i,numberOfSteps:u,canKeepMoving:o}},w=function(n){var t,e=["font","lineHeight","color"],r=m("SPAN"),i=(t=n,window.getComputedStyle(t,null));for(var o in i)e.indexOf(o)>-1&&i[o]&&(r.style[o]=i[o]);return r.style.cssText};
9function D(n,t,e){return e?t?t(n):n:(n&&n.then||(n=Promise.resolve(n)),t?n.then(t):n)}function H(n){return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];try{return Promise.resolve(n.apply(this,t))}catch(n){return Promise.reject(n)}}}function E(){}function C(n,t){if(!t)return n&&n.then?n.then(E):Promise.resolve()}function A(n,t){var e=n();return e&&e.then?e.then(t):t(e)}function k(n,t,e){if(!n.s){if(e instanceof O){if(!e.s)return void(e.o=k.bind(null,n,t));1&t&&(t=e.s),e=e.v}if(e&&e.then)return void e.then(k.bind(null,n,t),k.bind(null,n,2));n.s=t,n.v=e;var r=n.o;r&&r(n)}}var O=function(){function n(){}return n.prototype.then=function(t,e){var r=new n,i=this.s;if(i){var o=1&i?t:e;if(o){try{k(r,1,o(this.v))}catch(n){k(r,2,n)}return r}return this}return this.o=function(n){try{var i=n.v;1&n.s?k(r,1,t?t(i):i):e?k(r,1,e(i)):k(r,2,i)}catch(n){k(r,2,n)}},r},n}();function P(n,t){return n&&n.then?n.then(t):t(n)}return function(e,o){var u=this,s=this;o=o||{};var p=function(n,t,e){return n=i(n[0])?n:[n],an.add(n,t),function(n){var t=(n=n||{}).delay;t&&an.add([U,t])}(e),s},T=function(t){return t="object"===n(t)?t:{},[[Q,t,{force:!0}],[Q,en,{force:!0}]]},z=function(){return X?f(W.value):d(W,fn,!0)},B=function(n,t){t=t||1;var e=en.nextStringDelay;an.insert(n,[U,e.before]),an.insert(n+t+1,[U,e.after])},I=H((function(){if(fn){var n="[data-typeit-id='".concat(cn,"'] .ti-cursor");g("@keyframes blink-".concat(cn," { 0% {opacity: 0} 49% {opacity: 0} 50% {opacity: 1} } ").concat(n," { animation: blink-").concat(cn," ").concat(en.cursorSpeed/1e3,"s infinite; } ").concat(n,".with-delay { animation-delay: 500ms; } ").concat(n,".disabled { animation: none; }"),cn),W.appendChild(fn);var t="loaded"===document.fonts.status;return D(t||document.fonts.ready,(function(n){var t=fn.getBoundingClientRect().width/2;fn.style.margin="0 -".concat(t+2,"px 0 -").concat(t-2,"px")}),t)}})),R=function(n){fn&&(fn.classList.toggle("disabled",n),fn.classList.toggle("with-delay",!n))},q=H((function(n,t){return $.push(setTimeout(n,t)),D()})),j=H((function(n){var t=_;return D(t&&F(_),(function(t){return an.reset(),an.set(0,[U,n.before]),C(G(!0))}),!t)})),V=H((function(){tn.started=!0;var n,t=an.getItems();return P(function(n,t){try{var e=n()}catch(n){return t(n)}return e&&e.then?e.then(void 0,t):e}((function(){return P(function(n,t,e){var r,i,o=-1;return function u(c){try{for(;++o<n.length&&(!e||!e());)if((c=t(o))&&c.then){if(!((a=c)instanceof O&&1&a.s))return void c.then(u,i||(i=k.bind(null,r=new O,2)));c=c.v}r?k(r,1,c):r=c}catch(n){k(r||(r=new O),2,n)}var a}(),r}(t,(function(e){if(tn.frozen||tn.destroyed)throw"";var r,i,o,c,a=t[e],f=a[2];return n=[a,u],f.freezeCursor&&R(!0),r=en.speed,i=en.deleteSpeed,o=en.lifeLike,c=(i=null!==i?i:r/3)/2,Z=o?[S(r,r/2),S(i,c)]:[r,i],A((function(){var t;if(null==f?void 0:f.isFirst)return C((t=en).beforeString.apply(t,n))}),(function(){var t;return D((t=en).beforeStep.apply(t,n),(function(){return D(a[0].call(u,a[1],f),(function(){return A((function(){var t,e;if(null===(t=a[2])||void 0===t?void 0:t.isLast)return C((e=en).afterString.apply(e,n))}),(function(){var t;return D((t=en).afterStep.apply(t,n),(function(){an.setMeta(f.id,{executed:!0}),R(!1)}))}))}))}))}))}),(function(){return!1})),(function(t){var e;return tn.completed=!0,D((e=en).afterComplete.apply(e,n),(function(){if(!en.loop)throw"";var n=en.loopDelay;q((function(){return D(j(n),(function(){V()}))}),n.after)}))}))}),E),(function(n){return u}))})),U=function(n){return new Promise((function(t){q((function(){return t()}),n||0)}))},F=function n(t){var e=z(),r=x(t,_,e);return _+=r.numberOfSteps,new Promise((function(t){q(H((function(){return function(n,t,e,r){if(e){var i=r,o=t[(i=i>t.length?t.length:i)-1];(n=o?o.parentNode:n).insertBefore(e,o||null)}}(W,z(),fn,_),A((function(){if(r.isString&&r.canKeepMoving)return C(n(r.numberOfSteps>0?"START":"END"))}),(function(){return t()}))})),Z[0])}))},K=function(n){return new Promise((function(t){q((function(){return L(W,n,fn,_),t()}),Z[0])}))},Q=H((function(n){en=r(en,n)})),Y=H((function(){X?W.value="":z().forEach((function(n){M(n)}))})),G=function n(t){return t=!0===t,new Promise((function(e){q(H((function(){var r=!1,i=z();return i.length&&(X?W.value=W.value.slice(0,-1):M(i[_])),f(W.querySelectorAll("*")).forEac
9h((function(n){if(!n.innerHTML&&"BR"!==n.tagName){for(var t=n;1===t.parentNode.childNodes.length&&t.parentNode.childNodes[0].isEqualNode(t);)t=t.parentNode;M(t)}})),A((function(){if(t&&i.length-1>0)return D(n(!0),(function(){return r=!0,e()}))}),(function(n){return r?n:e()}))})),Z[1])}))};this.break=function(n){return p([K,h(m("BR"))],1,n)},this.delete=function(n,t){var e=T(t);return p([e[0]].concat([].concat(Array(Math.abs(n)||1)).fill().map((function(){return[G,!n,nn]})),[e[1]]),1,t)},this.empty=function(){return p(Y,1,arguments)},this.exec=function(n,t){var e=T(t);return p([e[0],[n,null],e[1]],1,t)},this.move=function(n,t){var e=x(n,_,z()),r=T(t),i=e.isString?n:Math.sign(n);return p([r[0]].concat([].concat(Array(Math.abs(n)||1)).fill().map((function(){return[F,i,nn]})),[r[1]]),1,t)},this.options=function(n){return p([Q,n],1,n)},this.pause=function(n,t){return p([U,n],1,t)},this.type=function(n,t){var e=T(t),r=y(n,en.html),i=[e[0]].concat(c(r,K,nn,!0),[e[1]]);return p(i,1,t)},this.is=function(n){return tn[n]},this.destroy=function(n){n=void 0===n||n,$.forEach((function(n){clearTimeout(n)})),$=[],n&&M(fn),tn.destroyed=!0},this.freeze=function(){tn.frozen=!0},this.unfreeze=function(){tn.frozen=!1,V()},this.reset=function(){for(var n in!this.is("destroyed")&&this.destroy(),an.reset(),_=0,tn)tn[n]=!1;return X?W.value="":W.innerHTML="",this},this.go=function(){return tn.started?this:(I(),en.waitUntilVisible?(function(n,t){new IntersectionObserver((function(e,r){e.forEach((function(e){e.isIntersecting&&(t(),r.unobserve(n))}))}),{threshold:1}).observe(n)}(W,V.bind(this)),this):(V(),this))},this.getQueue=function(){return an},this.getOptions=function(){return en},this.getElement=function(){return W};var J,W="string"==typeof(J=e)?document.querySelector(J):J,X=N(W),Z=[],$=[],_=0,nn={freezeCursor:!0},tn={started:!1,completed:!1,frozen:!1,destroyed:!1},en=r(t,o);en=r(en,{html:!X&&en.html,nextStringDelay:b(en.nextStringDelay),loopDelay:b(en.loopDelay)});var rn,on,un,cn=Math.random().toString().substring(2,9),an=new a([U,en.startDelay]);W.setAttribute("data-typeit-id",cn),g("[data-typeit-id]:before {content: '.'; display: inline-block; width: 0; visibility: hidden;}[data-typeit-id]"),en.strings=(un=en.strings,rn=i(un)?un:[un],(on=function(n){return n.innerHTML.replace(/<\!--.*?-->/g,"").trim()}(W))?(W.innerHTML="",en.startDelete?(v(on).forEach((function(n){L(W,n,fn,_)})),an.add([G,!0]),B(1),rn):[on.trim()].concat(rn)):rn);var fn=function(){if(X||!en.cursor)return null;var n=m("span");return n.innerHTML=l(en.cursorChar).innerHTML,n.className="ti-cursor",n.style.cssText="display:inline;".concat(w(W)),n}();en.strings.length&&function(){var n=en.strings.filter((function(n){return!!n}));n.forEach((function(t,e){var r=y(t,en.html);an.add(c(r,K,nn,!0));var i=an.getItems().length;if(e+1!==n.length){if(en.breakLines){var o=h(m("BR"));return an.add([K,o,nn]),void B(i)}an.add(c(r,G,nn)),B(i,t.length)}}))}()}})); 10 11!function(){"use strict";function o(){var o=window,t=document;if(!("scrollBehavior"in t.documentElement.style&&!0!==o.__forceSmoothScrollPolyfill__)){var l,e=o.HTMLElement||o.Element,r=468,i={scroll:o.scroll||o.scrollTo,scrollBy:o.scrollBy,elementScroll:e.prototype.scroll||n,scrollIntoView:e.prototype.scrollIntoView},s=o.performance&&o.performance.now?o.performance.now.bind(o.performance):Date.now,c=(l=o.navigator.userAgent,new RegExp(["MSIE ","Trident/","Edge/"].join("|")).test(l)?1:0);o.scroll=o.scrollTo=function(){void 0!==arguments[0]&&(!0!==f(arguments[0])?h.call(o,t.body,void 0!==arguments[0].left?~~arguments[0].left:o.scrollX||o.pageXOffset,void 0!==arguments[0].top?~~arguments[0].top:o.scrollY||o.pageYOffset):i.scroll.call(o,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:o.scrollX||o.pageXOffset,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:o.scrollY||o.pageYOffset))},o.scrollBy=function(){void 0!==arguments[0]&&(f(arguments[0])?i.scrollBy.call(o,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:0,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:0):h.call(o,t.body,~~arguments[0].left+(o.scrollX||o.pageXOffset),~~arguments[0].top+(o.scrollY||o.pageYOffset)))},e.prototype.scroll=e.prototype.scrollTo=function(){if(void 0!==arguments[0])if(!0!==f(arguments[0])){var o=arguments[0].left,t=arguments[0].top;h.call(this,this,void 0===o?this.scrollLeft:~~o,void 0===t?this.scrollTop:~~t)}else{if("number"==typeof arguments[0]&&void 0===arguments[1])throw new SyntaxError("Value could not be converted");i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left:"object"!=typeof arguments[0]?~~arguments[0]:this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top:void 0!==arguments[1]?~~arguments[1]:this.scrollTop)}},e.prototype.scrollBy=function(){void 0!==arguments[0]&&(!0!==f(arguments[0])?this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior}):i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop))},e.prototype.scrollIntoView=function(){if(!0!==f(arguments[0])){var l=function(o){for(;o!==t.body&&!1===(e=p(l=o,"Y")&&a(l,"Y"),r=p(l,"X")&&a(l,"X"),e||r);)o=o.parentNode||o.host;var l,e,r;return o}(this),e=l.getBoundingClientRect(),r=this.getBoundingClientRect();l!==t.body?(h.call(this,l,l.scrollLeft+r.left-e.left,l.scrollTop+r.top-e.top),"fixed"!==o.getComputedStyle(l).position&&o.scrollBy({left:e.left,top:e.top,behavior:"smooth"})):o.scrollBy({left:r.left,top:r.top,behavior:"smooth"})}else i.scrollIntoView.call(this,void 0===arguments[0]||arguments[0])}}function n(o,t){this.scrollLeft=o,this.scrollTop=t}function f(o){if(null===o||"object"!=typeof o||void 0===o.behavior||"auto"===o.behavior||"instant"===o.behavior)return!0;
11if("object"==typeof o&&"smooth"===o.behavior)return!1;throw new TypeError("behavior member of ScrollOptions "+o.behavior+" is not a valid value for enumeration ScrollBehavior.")}function p(o,t){return"Y"===t?o.clientHeight+c<o.scrollHeight:"X"===t?o.clientWidth+c<o.scrollWidth:void 0}function a(t,l){var e=o.getComputedStyle(t,null)["overflow"+l];return"auto"===e||"scroll"===e}function d(t){var l,e,i,c,n=(s()-t.startTime)/r;c=n=n>1?1:n,l=.5*(1-Math.cos(Math.PI*c)),e=t.startX+(t.x-t.startX)*l,i=t.startY+(t.y-t.startY)*l,t.method.call(t.scrollable,e,i),e===t.x&&i===t.y||o.requestAnimationFrame(d.bind(o,t))}function h(l,e,r){var c,f,p,a,h=s();l===t.body?(c=o,f=o.scrollX||o.pageXOffset,p=o.scrollY||o.pageYOffset,a=i.scroll):(c=l,f=l.scrollLeft,p=l.scrollTop,a=n),d({scrollable:c,method:a,startTime:h,startX:f,startY:p,x:e,y:r})}}"object"==typeof exports&&"undefined"!=typeof module?module.exports={polyfill:o}:o()}(); 12/** 13 * @popperjs/core v2.4.4 - MIT License 14 */ 15 16"use strict";!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).Popper={})}(this,(function(e){function t(e){return{width:(e=e.getBoundingClientRect()).width,height:e.height,top:e.top,right:e.right,bottom:e.bottom,left:e.left,x:e.left,y:e.top}}function n(e){return"[object Window]"!==e.toString()?(e=e.ownerDocument)?e.defaultView:window:e}function r(e){return{scrollLeft:(e=n(e)).pageXOffset,scrollTop:e.pageYOffset}}function o(e){return e instanceof n(e).Element||e instanceof Element}function i(e){return e instanceof n(e).HTMLElement||e instanceof HTMLElement}function a(e){return e?(e.nodeName||"").toLowerCase():null}function s(e){return(o(e)?e.ownerDocument:e.document).documentElement}function f(e){return t(s(e)).left+r(e).scrollLeft}function c(e){return n(e).getComputedStyle(e)}function p(e){return e=c(e),/auto|scroll|overlay|hidden/.test(e.overflow+e.overflowY+e.overflowX)}function l(e,o,c){void 0===c&&(c=!1);var l=s(o);e=t(e);var u=i(o),d={scrollLeft:0,scrollTop:0},m={x:0,y:0};return(u||!u&&!c)&&(("body"!==a(o)||p(l))&&(d=o!==n(o)&&i(o)?{scrollLeft:o.scrollLeft,scrollTop:o.scrollTop}:r(o)),i(o)?((m=t(o)).x+=o.clientLeft,m.y+=o.clientTop):l&&(m.x=f(l))),{x:e.left+d.scrollLeft-m.x,y:e.top+d.scrollTop-m.y,width:e.width,height:e.height}}function u(e){return{x:e.offsetLeft,y:e.offsetTop,width:e.offsetWidth,height:e.offsetHeight}}function d(e){return"html"===a(e)?e:e.assignedSlot||e.parentNode||e.host||s(e)}function m(e,t){void 0===t&&(t=[]);var r=function e(t){return 0<=["html","body","#document"].indexOf(a(t))?t.ownerDocument.body:i(t)&&p(t)?t:e(d(t))}(e);e="body"===a(r);var o=n(r);return r=e?[o].concat(o.visualViewport||[],p(r)?r:[]):r,t=t.concat(r),e?t:t.concat(m(d(r)))}function h(e){if(!i(e)||"fixed"===c(e).position)return null;if(e=e.offsetParent){var t=s(e);if("body"===a(e)&&"static"===c(e).position&&"static"!==c(t).position)return t}return e}function g(e){for(var t=n(e),r=h(e);r&&0<=["table","td","th"].indexOf(a(r))&&"static"===c(r).position;)r=h(r);if(r&&"body"===a(r)&&"static"===c(r).position)return t;if(!r)e:{for(e=d(e);i(e)&&0>["html","body"].indexOf(a(e));){if("none"!==(r=c(e)).transform||"none"!==r.perspective||r.willChange&&"auto"!==r.willChange){r=e;break e}e=e.parentNode}r=null}return r||t}function b(e){var t=new Map,n=new Set,r=[];return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||function e(o){n.add(o.name),[].concat(o.requires||[],o.requiresIfExists||[]).forEach((function(r){n.has(r)||(r=t.get(r))&&e(r)})),r.push(o)}(e)})),r}function v(e){var t;return function(){return t||(t=new Promise((function(n){Promise.resolve().then((function(){t=void 0,n(e())}))}))),t}}function y(e){return e.split("-")[0]}function O(e,t){var n=!(!t.getRootNode||!t.getRootNode().host);if(e.contains(t))return!0;if(n)do{if(t&&e.isSameNode(t))return!0;t=t.parentNode||t.host}while(t);return!1}function x(e){return Object.assign(Object.assign({},e),{},{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function w(e,o){if("viewport"===o){o=n(e);var a=s(e);
16o=o.visualViewport;var p=a.clientWidth;a=a.clientHeight;var l=0,u=0;o&&(p=o.width,a=o.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(l=o.offsetLeft,u=o.offsetTop)),e=x(e={width:p,height:a,x:l+f(e),y:u})}else i(o)?((e=t(o)).top+=o.clientTop,e.left+=o.clientLeft,e.bottom=e.top+o.clientHeight,e.right=e.left+o.clientWidth,e.width=o.clientWidth,e.height=o.clientHeight,e.x=e.left,e.y=e.top):(u=s(e),e=s(u),l=r(u),o=u.ownerDocument.body,p=Math.max(e.scrollWidth,e.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=Math.max(e.scrollHeight,e.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),u=-l.scrollLeft+f(u),l=-l.scrollTop,"rtl"===c(o||e).direction&&(u+=Math.max(e.clientWidth,o?o.clientWidth:0)-p),e=x({width:p,height:a,x:u,y:l}));return e}function j(e,t,n){return t="clippingParents"===t?function(e){var t=m(d(e)),n=0<=["absolute","fixed"].indexOf(c(e).position)&&i(e)?g(e):e;return o(n)?t.filter((function(e){return o(e)&&O(e,n)&&"body"!==a(e)})):[]}(e):[].concat(t),(n=(n=[].concat(t,[n])).reduce((function(t,n){return n=w(e,n),t.top=Math.max(n.top,t.top),t.right=Math.min(n.right,t.right),t.bottom=Math.min(n.bottom,t.bottom),t.left=Math.max(n.left,t.left),t}),w(e,n[0]))).width=n.right-n.left,n.height=n.bottom-n.top,n.x=n.left,n.y=n.top,n}function M(e){return 0<=["top","bottom"].indexOf(e)?"x":"y"}function E(e){var t=e.reference,n=e.element,r=(e=e.placement)?y(e):null;e=e?e.split("-")[1]:null;var o=t.x+t.width/2-n.width/2,i=t.y+t.height/2-n.height/2;switch(r){case"top":o={x:o,y:t.y-n.height};break;case"bottom":o={x:o,y:t.y+t.height};break;case"right":o={x:t.x+t.width,y:i};break;case"left":o={x:t.x-n.width,y:i};break;default:o={x:t.x,y:t.y}}if(null!=(r=r?M(r):null))switch(i="y"===r?"height":"width",e){case"start":o[r]=Math.floor(o[r])-Math.floor(t[i]/2-n[i]/2);break;case"end":o[r]=Math.floor(o[r])+Math.ceil(t[i]/2-n[i]/2)}return o}function D(e){return Object.assign(Object.assign({},{top:0,right:0,bottom:0,left:0}),e)}function P(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function k(e,n){void 0===n&&(n={});var r=n;n=void 0===(n=r.placement)?e.placement:n;var i=r.boundary,a=void 0===i?"clippingParents":i,f=void 0===(i=r.rootBoundary)?"viewport":i;i=void 0===(i=r.elementContext)?"popper":i;var c=r.altBoundary,p=void 0!==c&&c;r=D("number"!=typeof(r=void 0===(r=r.padding)?0:r)?r:P(r,q));var l=e.elements.reference;c=e.rects.popper,a=j(o(p=e.elements[p?"popper"===i?"reference":"popper":i])?p:p.contextElement||s(e.elements.popper),a,f),p=E({reference:f=t(l),element:c,strategy:"absolute",placement:n}),c=x(Object.assign(Object.assign({},c),p)),f="popper"===i?c:f;
16var u={top:a.top-f.top+r.top,bottom:f.bottom-a.bottom+r.bottom,left:a.left-f.left+r.left,right:f.right-a.right+r.right};if(e=e.modifiersData.offset,"popper"===i&&e){var d=e[n];Object.keys(u).forEach((function(e){var t=0<=["right","bottom"].indexOf(e)?1:-1,n=0<=["top","bottom"].indexOf(e)?"y":"x";u[e]+=d[n]*t}))}return u}function L(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function B(e){void 0===e&&(e={});var t=e.defaultModifiers,n=void 0===t?[]:t,r=void 0===(e=e.defaultOptions)?V:e;return function(e,t,i){function a(){f.forEach((function(e){return e()})),f=[]}void 0===i&&(i=r);var s={placement:"bottom",orderedModifiers:[],options:Object.assign(Object.assign({},V),r),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},f=[],c=!1,p={state:s,setOptions:function(i){return a(),s.options=Object.assign(Object.assign(Object.assign({},r),s.options),i),s.scrollParents={reference:o(e)?m(e):e.contextElement?m(e.contextElement):[],popper:m(t)},i=function(e){var t=b(e);return N.reduce((function(e,n){return e.concat(t.filter((function(e){return e.phase===n})))}),[])}(function(e){var t=e.reduce((function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign(Object.assign(Object.assign({},n),t),{},{options:Object.assign(Object.assign({},n.options),t.options),data:Object.assign(Object.assign({},n.data),t.data)}):t,e}),{});return Object.keys(t).map((function(e){return t[e]}))}([].concat(n,s.options.modifiers))),s.orderedModifiers=i.filter((function(e){return e.enabled})),s.orderedModifiers.forEach((function(e){var t=e.name,n=e.options;n=void 0===n?{}:n,"function"==typeof(e=e.effect)&&(t=e({state:s,name:t,instance:p,options:n}),f.push(t||function(){}))})),p.update()},forceUpdate:function(){if(!c){var e=s.elements,t=e.reference;if(L(t,e=e.popper))for(s.rects={reference:l(t,g(e),"fixed"===s.options.strategy),popper:u(e)},s.reset=!1,s.placement=s.options.placement,s.orderedModifiers.forEach((function(e){return s.modifiersData[e.name]=Object.assign({},e.data)})),t=0;t<s.orderedModifiers.length;t++)if(!0===s.reset)s.reset=!1,t=-1;else{var n=s.orderedModifiers[t];e=n.fn;var r=n.options;r=void 0===r?{}:r,n=n.name,"function"==typeof e&&(s=e({state:s,options:r,name:n,instance:p})||s)}}},update:v((function(){return new Promise((function(e){p.forceUpdate(),e(s)}))})),destroy:function(){a(),c=!0}};return L(e,t)?(p.setOptions(i).then((function(e){!c&&i.onFirstUpdate&&i.onFirstUpdate(e)})),p):p}}function W(e){var t,r=e.popper,o=e.popperRect,i=e.placement,a=e.offsets,f=e.position,c=e.gpuAcceleration,p=e.adaptive,l=window.devicePixelRatio||1;e=Math.round(a.x*l)/l||0,l=Math.round(a.y*l)/l||0;var u=a.hasOwnProperty("x");a=a.hasOwnProperty("y");var d,m="left",h="top",b=window;if(p){var v=g(r);v===n(r)&&(v=s(r)),"top"===i&&(h="bottom",l-=v.clientHeight-o.height,l*=c?1:-1),"left"===i&&(m="right",e-=v.clientWidth-o.width,e*=c?1:-1)}return r=Object.assign({position:f},p&&_),c?Object.assign(Object.assign({},r),{},((d={})[h]=a?"0":"",d[m]=u?"0":"",d.transform=2>(b.devicePixelRatio||1)?"translate("+e+"px, "+l+"px)":"translate3d("+e+"px, "+l+"px, 0)",d)):Object.assign(Object.assign({},r),{},((t={})[h]=a?l+"px":"",t[m]=u?e+"px":"",t.transform="",t))}function A(e){return e.replace(/left|right|bottom|top/g,(function(e){return U[e]}))}function H(e){return e.replace(/start|end/g,(function(e){return z[e]}))}function T(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function R(e){return["top","right","bottom","left"].some((function(t){return 0<=e[t]}))}var q=["top","bottom","right","left"],C=q.reduce((function(e,t){return e.concat([t+"-start",t+"-end"])}),[]),S=[].concat(q,["auto"]).reduce((function(e,t){return e.concat([t,t+"-start",t+"-end"])}),[]),N="beforeRead read afterRead beforeMain main afterMain beforeWrite write afterWrite".split(" "),V={placement:"bottom",modifiers:[],strategy:"absolute"},I={passive:!0},_={top:"auto",right:"auto",bottom:"auto",left:"auto"}
16,U={left:"right",right:"left",bottom:"top",top:"bottom"},z={start:"end",end:"start"},F=[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,r=e.instance,o=(e=e.options).scroll,i=void 0===o||o,a=void 0===(e=e.resize)||e,s=n(t.elements.popper),f=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&f.forEach((function(e){e.addEventListener("scroll",r.update,I)})),a&&s.addEventListener("resize",r.update,I),function(){i&&f.forEach((function(e){e.removeEventListener("scroll",r.update,I)})),a&&s.removeEventListener("resize",r.update,I)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state;t.modifiersData[e.name]=E({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options;e=void 0===(e=n.gpuAcceleration)||e,n=void 0===(n=n.adaptive)||n,e={placement:y(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:e},null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign(Object.assign({},t.styles.popper),W(Object.assign(Object.assign({},e),{},{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:n})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign(Object.assign({},t.styles.arrow),W(Object.assign(Object.assign({},e),{},{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1})))),t.attributes.popper=Object.assign(Object.assign({},t.attributes.popper),{},{"data-popper-placement":t.placement})},data:{}},{name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},o=t.elements[e];i(o)&&a(o)&&(Object.assign(o.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?o.removeAttribute(e):o.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],o=t.attributes[e]||{};e=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{}),i(r)&&a(r)&&(Object.assign(r.style,e),Object.keys(o).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]},{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.name,r=void 0===(e=e.options.offset)?[0,0]:e,o=(e=S.reduce((function(e,n){var o=t.rects,i=y(n),a=0<=["left","top"].indexOf(i)?-1:1,s="function"==typeof r?r(Object.assign(Object.assign({},o),{},{placement:n})):r;return o=(o=s[0])||0,s=((s=s[1])||0)*a,i=0<=["left","right"].indexOf(i)?{x:s,y:o}:{x:o,y:s},e[n]=i,e}),{}))[t.placement],i=o.x;o=o.y,null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=i,t.modifiersData.popperOffsets.y+=o),t.modifiersData[n]=e}},{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options;if(e=e.name,!t.modifiersData[e]._skip){var r=n.mainAxis;r=void 0===r||r;var o=n.altAxis;o=void 0===o||o;var i=n.fallbackPlacements,a=n.padding,s=n.boundary,f=n.rootBoundary,c=n.altBoundary,p=n.flipVariations,l=void 0===p||p,u=n.allowedAutoPlacements;p=y(n=t.options.placement),i=i||(p!==n&&l?function(e){if("auto"===y(e))return[];var t=A(e);return[H(e),t,H(t)]}(n):[A(n)]);var d=[n].concat(i).reduce((function(e,n){return e.concat("auto"===y(n)?function(e,t){void 0===t&&(t={});var n=t.boundary,r=t.rootBoundary,o=t.padding,i=t.flipVariations,a=t.allowedAutoPlacements,s=void 0===a?S:a,f=t.placement.split("-")[1];0===(i=(t=f?i?C:C.filter((function(e){return e.split("-")[1]===f})):q).filter((function(e){return 0<=s.indexOf(e)}))).length&&(i=t);var c=i.reduce((function(t,i){return t[i]=k(e,{placement:i,boundary:n,rootBoundary:r,padding:o})[y(i)],t}),{});return Object.keys(c).sort((function(e,t){return c[e]-c[t]}))}(t,{placement:n,boundary:s,rootBoundary:f,padding:a,flipVariations:l,allowedAutoPlacements:u}):n)}),[]);n=t.rects.reference,i=t.rects.popper;var m=new Map;p=!0;for(var h=d[0],g=0;g<d.length;g++){var b=d[g],v=y(b),O="start"===b.split("-")[1],x=0<=["top","bottom"].indexOf(v),w=x?"width":"height",j=k(t,{placement:b,boundary:s,rootBoundary:f,altBoundary:c,padding:a});if(O=x?O?"right":"left":O?"bottom":"top",n[w]>i[w]&&(O=A(O)),w=A(O),x=[],r&&x.push(0>=j[v]),o&&x.push(0>=j[O],0>=j[w]),x.every((function(e){return e}))){h=b,p=!1;break}m.set(b,x)}if(p)for(r=function(e){var t=d.find((function(t){if(t=m.get(t))return t.slice(0,e).every((function(e){return e}))}));if(t)return h=t,"break"},o=l?3:1;0<o&&"break"!==r(o);o--);t.placement!==h&&(t.modifiersData[e]._skip=!0,t.placement=h,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options;e=e.name;var r=n.mainAxis,o=void 0===r||r;r=void 0!==(r=n.altAxis)&&r;var i=n.tether;i=void 0===i||i;var a=n.tetherOffset,s=void 0===a?0:a;n=k(t,{boundary:n.boundary,rootBoundary:n.rootBoundary,padding:n.padding,altBoundary:n.altBoundary}),a=y(t.placement);var f=t.placement.split("-")[1],c=!f,p=M(a);a="x"===p?"y":"x";var l=t.modifiersData.popperOffsets,d=t.rects.reference,m=t.rects.popper,h="function"==typeof s?s(Object.assign(Object.assign({},t.rects),{},{placement:t.placement})):s;if(s={x:0,y:0}
16,l){if(o){var b="y"===p?"top":"left",v="y"===p?"bottom":"right",O="y"===p?"height":"width";o=l[p];var x=l[p]+n[b],w=l[p]-n[v],j=i?-m[O]/2:0,E="start"===f?d[O]:m[O];f="start"===f?-m[O]:-d[O],m=t.elements.arrow,m=i&&m?u(m):{width:0,height:0};var D=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0};b=D[b],v=D[v],m=Math.max(0,Math.min(d[O],m[O])),E=c?d[O]/2-j-m-b-h:E-m-b-h,c=c?-d[O]/2+j+m+v+h:f+m+v+h,h=t.elements.arrow&&g(t.elements.arrow),d=t.modifiersData.offset?t.modifiersData.offset[t.placement][p]:0,h=l[p]+E-d-(h?"y"===p?h.clientTop||0:h.clientLeft||0:0),c=l[p]+c-d,i=Math.max(i?Math.min(x,h):x,Math.min(o,i?Math.max(w,c):w)),l[p]=i,s[p]=i-o}r&&(r=l[a],i=Math.max(r+n["x"===p?"top":"left"],Math.min(r,r-n["x"===p?"bottom":"right"])),l[a]=i,s[a]=i-r),t.modifiersData[e]=s}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state;e=e.name;var r=n.elements.arrow,o=n.modifiersData.popperOffsets,i=y(n.placement),a=M(i);if(i=0<=["left","right"].indexOf(i)?"height":"width",r&&o){var s=n.modifiersData[e+"#persistent"].padding,f
16=u(r),c="y"===a?"top":"left",p="y"===a?"bottom":"right",l=n.rects.reference[i]+n.rects.reference[a]-o[a]-n.rects.popper[i];o=o[a]-n.rects.reference[a],l=(r=(r=g(r))?"y"===a?r.clientHeight||0:r.clientWidth||0:0)/2-f[i]/2+(l/2-o/2),i=Math.max(s[c],Math.min(l,r-f[i]-s[p])),n.modifiersData[e]=((t={})[a]=i,t.centerOffset=i-l,t)}},effect:function(e){var t=e.state,n=e.options;e=e.name;var r=n.element;if(r=void 0===r?"[data-popper-arrow]":r,n=void 0===(n=n.padding)?0:n,null!=r){if("string"==typeof r&&!(r=t.elements.popper.querySelector(r)))return;O(t.elements.popper,r)&&(t.elements.arrow=r,t.modifiersData[e+"#persistent"]={padding:D("number"!=typeof n?n:P(n,q))})}},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state;e=e.name;var n=t.rects.reference,r=t.rects.popper,o=t.modifiersData.preventOverflow,i=k(t,{elementContext:"reference"}),a=k(t,{altBoundary:!0});n=T(i,n),r=T(a,r,o),o=R(n),a=R(r),t.modifiersData[e]={referenceClippingOffsets:n,popperEscapeOffsets:r,isReferenceHidden:o,hasPopperEscaped:a},t.attributes.popper=Object.assign(Object.assign({},t.attributes.popper),{},{"data-popper-reference-hidden":o,"data-popper-escaped":a})}}],X=B({defaultModifiers:F});e.createPopper=X,e.defaultModifiers=F,e.detectOverflow=k,e.popperGenerator=B,Object.defineProperty(e,"__esModule",{value:!0})})); 17; 18 19window.mrp_open_new_window = function( url, width, height, name ) { 20 21 function optimalWindowHeight( desired ) 22 { 23 if( desired && desired < screen.availHeight ) { 24 return desired; 25 } 26 27 var h = 500; 28 if( screen.availHeight > 600 ) { 29 h = 700; 30 } 31 if( screen.availHeight > 800 ) { 32 h = 800; 33 } 34 return h; 35 } 36 37 if( !height ) { 38 height = optimalWindowHeight(); 39 } 40 41 var left = parseInt((screen.availWidth/2) - (width/2)); 42 var top = parseInt((screen.availHeight/2) - (height/2)); 43 44 if( !name ) { 45 name = "" + parseInt( ( Math.random() * 100000 ) ); 46 } 47 var w = window.open( url, name, "width=" + width + ",height=" + height + 48 ",scrollbars=1,location=1,left=" + left + ",top=" + top + ",screenX=" + left + ",screenY=" + top ); 49 50 if( w == null ) { 51 alert( "Please enable popups in your browser" ); 52 } 53 else { 54 w.focus(); 55 } 56 57 return w; 58}; 59 60// DOMParser patch for IOS Safari 61(function(DOMParser) { 62 "use strict"; 63 64 var proto = DOMParser.prototype, 65 nativeParse = proto.parseFromString; 66 67 // Firefox/Opera/IE throw errors on unsupported types 68 try { 69 // WebKit returns null on unsupported types 70 if ((new DOMParser()).parseFromString("", "text/html")) { 71 // text/html parsing is natively supported 72 return; 73 } 74 } catch (ex) {} 75 76 proto.parseFromString = function(markup, type) { 77 if (/^\s*text\/html\s*(?:;|$)/i.test(type)) { 78 var doc = document.implementation.createHTMLDocument(""); 79 if (markup.toLowerCase().indexOf('<!doctype') > -1) { 80 doc.documentElement.innerHTML = markup; 81 } else { 82 doc.body.innerHTML = markup; 83 } 84 return doc; 85 } else { 86 return nativeParse.apply(this, arguments); 87 } 88 }; 89}(DOMParser)); 90 91function get_if_exist(obj){ 92 if( !obj ) { 93 return undefined; 94 } 95 return arguments.length==1 || (obj[arguments[1]] && get_if_exist.apply(this,[obj[arguments[1]]].concat([].slice.call(arguments,2)))); 96} 97 98const _G = { 99 reinitHandlers: [], 100 isMobile: () => /iPhone|iPad|iPod|Android/i.test(navigator.userAgent), 101} 102 103;(function() { 104 _G.visibilityService = (function() { 105 106 const options = { 107 threshold: [0,0.1,0.2,0.4,0.6,0.8] 108 } 109 110 const observer = new IntersectionObserver( entries => { 111 (entries || []).forEach( entry => { 112 if( typeof entry.target.__visibility === 'function' ) { 113 114 const isLikelyMobile = window.innerWidth < window.innerHeight 115 const defaultVisibilityRatio = isLikelyMobile ? 0.01 : 0.2; 116 117 const ratio = getComputedStyle(entry.target) 118 .getPropertyValue('--visibility-ratio') || defaultVisibilityRatio; 119 120 if( entry.intersectionRatio >= ratio /* && !document.querySelector('html').classList.contains('editing') */ ) { 121 entry.target.__visibility(entry) 122 } 123 } 124 }) 125 }, options ) 126 127 const observe = ( el, callback ) => { 128 el.__visibility = callback 129 observer.observe(el) 130 } 131 132 const unobserve = ( el ) => { 133 observer.unobserve(el) 134 } 135 136 return { 137 observe, 138 unobserve, 139 } 140 })() 141})() 142 143 144function _initBlocks() { 145 for (let m of (window.block_code_modules || [])) { 146 try { 147 m && m.init && m.init(m.id, m) 148 } catch (err) { 149 console.log('Error initing module', m.id, err) 150 } 151 } 152} 153 154function _destroyBlocks() { 155 for (let m of (window.block_code_modules || [])) { 156 try { 157 m && m.destroy && m.destroy() 158 } catch (err) { 159 console.log('Error destroying module', m.id, err) 160 } 161 } 162} 163 164_G.parallaxService = (function () { 165 166 const BASE_SPEED = 0.7 167 168 let stopped = false 169 const elements = [] 170 const observer = new IntersectionObserver((entries) => {
171 entries.forEach(entry => { 172 entry.target._parallaxVisible = entry.isIntersecting 173 recalc(entry.target) 174 }) 175 }, { 176 // blank options 177 }) 178 179 window.addEventListener('scroll', (ev) => { 180 requestAnimationFrame(() => { 181 recalcAll() 182 }) 183 184 }, { passive: true }) 185 186 const calcShift = (elem) => { 187 /* 188 * calculates a number -1..0..1 where 0 is dead center of the element in viewport 189 * -1 is when the element touches with its top the top edge of the viewport 190 * 1 is when the element touches with its bottom the bottom edge of the viewport 191 * 192 * */ 193 const rect = elem.parentElement.getBoundingClientRect() 194 const bgRect = elem.getBoundingClientRect() 195 const elemFreeHeight = window.innerHeight - rect.height 196 const bgFreeHeight = window.innerHeight - bgRect.height 197 const shapeCenterY = rect.top + (rect.height / 2) 198 const viewportCenterY = window.innerHeight / 2 199 const delta = viewportCenterY - shapeCenterY 200 201 // adjusting speed is necessary for containers that are shorter than 202 // viewport height and have bg element with some spare space top and 203 // bottom to allow for differential scroll speeds. If these conditions 204 // are not met, we fall back to the base speed. Otherwise, we calculate the 205 // ideal speed based on the amount of spare image space and size of 206 // container. The idea is that the top of bg image reach the top 207 // of the viewport at exactly the same time as the container to avoid exposing 208 // any areas uncovered by the image. 209 const shouldAdjustSpeed = bgRect.height < window.innerHeight 210 && rect.height < window.innerHeight 211 && bgRect.height >= rect.height 212 213 const baseSpeed = shouldAdjustSpeed 214 ? bgFreeHeight / elemFreeHeight 215 : BASE_SPEED 216 217 const translateValue = ( 1 - baseSpeed ) * delta 218 219 // console.log( delta, acceleration, adjustedRatio, translateValue ) 220 221 return translateValue.toFixed(4) 222 } 223 224 const recalcAll = () => { 225 if( stopped ) { 226 return 227 } 228 elements.forEach(elem => { 229 recalc(elem) 230 }) 231 } 232 233 const recalc = (elem) => { 234 if( stopped ) { 235 return 236 } 237 if (elem._parallaxVisible) { 238 elem.style.transform = 'translate(0,' + calcShift(elem) + 'px)' + 239 (elem.classList.contains('blur') ? ' scale(1.1)' : '' ) 240 } 241 } 242 243 const add = (elem) => { 244 if (!elem) { 245 return 246 } 247 elem._parallaxVisible = false 248 elements.push(elem) 249 observer.observe(elem) 250 recalc(elem) 251 } 252 253 const remove = (elem) => { 254 const index = elements.indexOf(elem) 255 if (index !== -1) { 256 elements.splice(index, 1) 257 } 258 observer.unobserve(elem) 259 } 260 261 const setStopped = (flag) => { 262 stopped = flag 263 } 264 265 const refresh = () => { 266 recalcAll() 267 } 268 269 const cleanup = () => { 270 // cleanup potentially stale elements, i.e. detached from DOM 271 // may happen after a block was re-inserted in the editor 272 elements.slice().filter(elem => { 273 if (!document.body.contains(elem)) { 274 remove(elem) 275 } 276 }) 277 } 278 279 return { 280 setStopped, 281 refresh, 282 add, 283 remove, 284 cleanup, 285 } 286})() 287 288_G.fxService = (function() { 289 290 let queue = [] 291 let revealLaunched = null 292 293 function cleanupFastScrolled() { 294 // const snapshot = queue.map( el => { 295 // let rect = el.getBoundingClientRect() 296 // let top = rect.top 297 // let bottom = rect.bottom 298 // return { 299 // el, 300 // top, 301 // bottom, 302 // scrolledOutOfView: bottom < 0, 303 // } 304 // }) 305 // console.log( 'REVEAL', snapshot ) 306 while(queue.length > 0) { 307 let el = queue.at(0) 308 if( !el ) { 309 break; 310 } 311 let rect = el.getBoundingClientRect() 312 if( rect.bottom < 0 ) { 313 queue.shift().classList.remove('fx') 314 } 315 else { 316 break; 317 } 318 } 319 } 320 321 function revealStaggered() { 322 if( revealLaunched !== null ) { 323 return 324 } 325 if( queue.length === 0 ) { 326 return 327 } 328 revealLaunched = setInterval( () => { 329 if( queue.length === 0 ) { 330 clearInterval( revealLaunched ) 331 revealLaunched = null 332 return 333 } 334 cleanupFastScrolled() 335 queue.shift().classList.remove( 'fx' ) 336 }, 100 ) 337 } 338 339 function initElem( el ) { 340 if( !el || el.__fx_inited ) { 341 return 342 } 343 344 if( el.closest('.managed-fx')) { 345 return 346 } 347 348 el.__fx_inited = true 349 _G.visibilityService.observe( el, result => { 350 351 if( !el.classList.contains('fx')) { 352 return // probably already revealed 353 } 354 queue.push(el) 355 revealStaggered() 356 _G.visibilityService.unobserve(el) 357 }) 358 } 359
360 function init() { 361 document.querySelectorAll('.fx' ).forEach( initElem ) 362 } 363 364 return { 365 init, 366 initElem 367 } 368})() 369 370 371document.addEventListener('DOMContentLoaded', () => { 372 373 if( window.customOnLoads ) { 374 window.customOnLoads.forEach( f => { 375 try { 376 if( typeof f === 'function' ) { 377 f() 378 } 379 } 380 catch( ex ) { 381 console.error( 'ERROR: failed to run customOnLoad: ', ex ); 382 } 383 }) 384 } 385 386 function initVideo( v ) { 387 if( v.__videoInited ) { 388 return 389 } 390 v.__videoInited = true 391 v.addEventListener('pause', () => { 392 v.__paused = true 393 }) 394 _G.visibilityService.observe(v, result => { 395 if( result.isIntersecting ) { 396 if( v.__paused ) { 397 return 398 } 399 v.muted = true 400 v.play() 401 if(v.getAttribute("data-speed")) { 402 v.playbackRate = parseFloat(v.getAttribute("data-speed")) 403 } 404 // if( document.querySelector('html').classList.contains('editing') ) { 405 //v.pause() 406 // } 407 } 408 }) 409 } 410 411 _G.fxService.init() 412 _G.reinitHandlers.push( id => { 413 document.getElementById(id).querySelectorAll('.fx').forEach( el => { 414 _G.fxService.initElem(el) 415 }) 416 document.querySelectorAll('video[data-autoplay="true"]').forEach(initVideo ) 417 }) 418 419 420 document.querySelectorAll('.with-scroll-parallax').forEach(elem => { 421 _G.parallaxService.add(elem) 422 }) 423 document.querySelectorAll( '.with-smart-bg.with-bg-video video' ).forEach(( v => { 424 v.muted = true 425 v.play() 426 })) 427 428 document.querySelectorAll('video.video[data-autoplay="true"]').forEach(initVideo ) 429 430 document.addEventListener( 'editor.on', () => { 431 }) 432 433 _G.quickMessage = ( msg, options={} ) => { 434 const m = document.createElement('div') 435 m.classList.add('quick-message') 436 if( options.error ) { 437 m.classList.add( 'error' ) 438 } 439 m.style.opacity = '0' 440 m.innerText = msg 441 document.body.appendChild( m ) 442 setTimeout( () => { 443 m.style.opacity = '1' 444 }, 10 ) 445 setTimeout( () => { 446 m.style.opacity = '0' 447 m.addEventListener( 'transitionend', () => { 448 m.remove() 449 },{once:true}) 450 }, 3000 ) 451 m.addEventListener('click', ev => { 452 m.style.opacity = '0' 453 m.addEventListener( 'transitionend', () => { 454 m.remove() 455 },{once:true}) 456 }, {once: true}) 457 } 458 459 _G.applyRipple = function( event, button ) { 460 461 const circle = document.createElement("span") 462 const diameter = Math.max(button.clientWidth, button.clientHeight) 463 const radius = diameter / 2; 464 465 circle.style.width = circle.style.height = `${diameter}px` 466 const rect = button.getBoundingClientRect() 467 circle.style.left = `${event.clientX - (rect.left + radius)}px` 468 circle.style.top = `${event.clientY - (rect.top + radius)}px` 469 circle.classList.add("ripple") 470 471 const ripple = button.getElementsByClassName("ripple")[0] 472 if (ripple) { 473 ripple.remove() 474 } 475 476 button.appendChild(circle) 477 478 circle.addEventListener( 'animationend', () => { 479 circle.remove() 480 }, { once: true }) 481 } 482 483 _G.createFragment = htmlStr => { 484 var frag = document.createDocumentFragment(), temp = document.createElement('div'); 485 temp.innerHTML = htmlStr; 486 while (temp.firstChild) { 487 frag.appendChild(temp.firstChild); 488 } 489 return frag; 490 } 491 492 function scrollToBlock( id ) { 493 console.log( 'will scroll to ', id ) 494 const elem = document.querySelector(id) 495 if( elem ) { 496 elem.scrollIntoView({ 497 behavior: 'smooth', 498 block: 'start',
499 inline: 'nearest', 500 }) 501 history.pushState({}, '', id) 502 // window.location.hash = id 503 } 504 } 505 506 document.addEventListener( 'click', event => { 507 if( event.target && ( event.target.matches( '.block-layout .button' ) || event.target.matches( '.block-layout .button *' ))) { 508 const button = event.target.closest('.button') 509 if( button ) { 510 _G.applyRipple(event, button ) 511 if( button.tagName === 'BUTTON' ) { 512 const form = button.closest('form') 513 if( form && form.getAttribute('action') && 514 form.getAttribute('action').indexOf('#bid_') === 0 ) { 515 event.stopPropagation() 516 event.preventDefault() 517 scrollToBlock(form.getAttribute('action')) 518 } 519 } 520 } 521 } 522 if( event.target && ( event.target.matches( '.block-layout a' ) || event.target.matches('.block-layout a *'))) { 523 const link = event.target.closest('a') 524 if( link && link.getAttribute('href') && link.getAttribute('href').indexOf('#bid_') === 0 ) { 525 event.stopPropagation() 526 event.preventDefault() 527 scrollToBlock(link.getAttribute('href')) 528 } 529 } 530 }) 531}) 532 533function debounce(func, wait, immediate) { 534 var timeout; 535 return function() { 536 var context = this, args = arguments; 537 var later = function() { 538 timeout = null; 539 if (!immediate) func.apply(context, args); 540 }; 541 var callNow = immediate && !timeout; 542 clearTimeout(timeout); 543 timeout = setTimeout(later, wait); 544 if (callNow) func.apply(context, args); 545 }; 546} 547 548function openTranslate( toLang ) { 549 toLang = toLang || "en"; 550 window.open("https://" + window.location.hostname.replaceAll("-","--") 551 .replaceAll(".","-") + ".translate.goog" + window.location.pathname + 552 "?_x_tr_sl=auto&_x_tr_tl=" + toLang + "&_x_tr_hl=en&_x_tr_pto=wapp' target='_blank'>Translate Page") 553} 554 555function mrp_basic_auth_logout( safelocation ) { 556 const c = ''; 557 var a, b = "You should be logged out now."; 558 try { 559 a = document.execCommand("ClearAuthenticationCache", 'false') 560 } catch (d) { 561 } 562 a || ((a = window.XMLHttpRequest ? new window.XMLHttpRequest : window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : void 0) ? 563 (a.open("HEAD", c || location.href, !0, "logout", (new Date).getTime().toString()), a.send(""), a = 1) : a = void 0); 564 a || (b = "Your browser is too old or too weird to support log out functionality. Close all windows and restart the browser."); 565 // alert(b) 566 document.body.innerHTML = ''; 567 setTimeout(() => { 568 const url = window.location.href; 569 const fake = btoa('logout:logout') 570 // history.replaceState({}, '', url + '?t' + Date.now() ); 571 window.location = safelocation || 'https://private-office.myrealpage.com' 572 // fetch( url, { 573 // headers: { 574 // 'Authorization': 'Basic fake' 575 // } 576 // }) 577 // .finally( () => { 578 // 579 // }); 580 }, 1000 ) 581} 582 583/* ==== INCLUDE: /js/responsive-containers-mod.js ==== */ 584 585/* 586MIT Licensed. 587Copyright (c) 2011 Andy Hume (http://andyhume.net, [email protected]). 588 589Permission is hereby granted, free of charge, to any person obtaining a copy 590of this software and associated documentation files (the "Software"), to deal 591in the Software without restriction, including without limitation the rights 592to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 593copies of the Software, and to permit persons to whom the Software is 594furnished to do so, subject to the following conditions: 595 596The above copyright notice and this permission notice shall be included in 597all copies or substantial portions of the Software. 598 599THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 600IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 601FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 602AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 603LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 604OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 605THE SOFTWARE. 606*/ 607 608(function(win) { 609 610 if( window.responsiveContainersLoaded ) { 611 return; 612 } 613 614 window.responsiveContainersLoaded = true; 615 616 var doc = win.document, 617 els = [], 618 check_data_attributes = true, 619 loaded = false;
620 621 622 if( window.mrp_v2_ready ) { 623 window.mrp_v2_ready( function() { 624 _gmrp.$( document ).on( "mrp.responsify.containers mrp.popup.close", 625 function(e) { 626 //console.log( "mrp.ajax-idx.show" ); 627 for( var i=0; i<els.length; ++i ) { 628 delete els[i].cq_rules; 629 } 630 els = []; 631 //var b = new Date().getTime(); 632 findContainerQueries(); 633 applyRules(); 634 //console.log( ( new Date().getTime() - b ) + "ms" ); 635 } 636 ); 637 }); 638 } 639 640 function add(elements, query, value, class_name) { 641 var split_value = /([0-9]*)(px|em)/.exec(value); 642 for (var i = 0, j = elements.length; i<j; ++i) { 643 var el = elements[i]; 644 el.cq_rules = el.cq_rules || []; 645 el.cq_rules.push([null, query, split_value[1], split_value[2], class_name]); 646 els.push(el); 647 } 648 if (loaded) { // if we're not 'loaded' yet, domLoaded will run applyRules() for us. 649 applyRules(); 650 } 651 } 652 653 function ignoreDataAttributes() { 654 check_data_attributes = false; 655 } 656 657 function findContainerQueries() { 658 if (check_data_attributes) { 659 // Find data-squery attributes. 660 var nodes = []; 661 if (doc.querySelectorAll) { 662 var nodes = doc.querySelectorAll("[data-squery]"); 663 } else { 664 // If no query selectors. 665 var e = doc.getElementsByTagName("*"); 666 for (var i = 0, j = e.length; i<j; ++i) { 667 if (e[i].getAttribute("data-squery")) { 668 nodes.push(e[i]); 669 } 670 } 671 } 672 // Parse the data-squery attribute and store resulting rules on the element. 673 for (var i = 0, j = nodes.length; i<j; ++i) { 674 var el = nodes[i]; 675 if( el.cq_rules && el.cq_rules.length > 0 ) { 676 continue; 677 } 678 var cq_rules = []; 679 var raw_rules = el.getAttribute("data-squery").split(" "); 680 for (var k = 0, l = raw_rules.length; k<l; ++k) { 681 var rule = /(.*):([0-9]*)(px|em)=(.*)/.exec(raw_rules[k]); 682 if (rule) { 683 cq_rules.push(rule); 684 } 685 } 686 el.cq_rules = el.cq_rules || []; 687 el.cq_rules = el.cq_rules.concat(cq_rules); 688 els.push(el); 689 } 690 } 691 } 692 693 function applyRules() { 694 // For each element, apply the rules to the class name. 695 console.log( "els:", els.length ); 696 for (var i = 0, j = els.length; i<j; ++i) { 697 el = els[i]; 698 console.log( "els.cq_rules:",el.cq_rules.length ); 699 for (var k = 0, l = el.cq_rules.length; k<l; ++k) { 700 var rule = el.cq_rules[k]; 701 702 // Get a target width value in pixels. 703 var width = parseInt(rule[2]); 704 if (rule[3] === "em") { 705 width = emsToPixels(parseFloat(rule[2]), el); 706 } 707 708 // Calculate the width of the target without the class added. 709 var defaultWidth = getDefaultWidth(el, rule[4]); 710 // Test current width against target width and add/remove class values. 711 if ( compareFunction[rule[1]](defaultWidth, width) ) { 712 window._gmrp && _gmrp.$ && _gmrp.$( document ).trigger( "mrp.resp.container.change", "+" + rule[4] ); 713 if (el.className.indexOf(rule[4]) < 0) { 714 el.className += " " + rule[4]; 715 } 716 } else { 717 window._gmrp && _gmrp.$ && _gmrp.$( document ).trigger( "mrp.resp.container.change", "-" + rule[4] ); 718 var class_name = el.className.replace(new RegExp('(^| )'+rule[4]+'( |$)'), '$1'); 719 class_name = class_name.replace(/ $/, ''); 720 el.className = class_name; 721 } 722 } 723 } 724 } 725 726 var compareFunction = { 727 "min-width": function(a, b) { 728 return a > b; 729 }, 730 "max-width": function(a, b) { 731 return a < b; 732 } 733 } 734 735 function contentReady() { 736 if (loaded) { 737 return; 738 } 739 loaded = true; 740 findContainerQueries(); 741 applyRules(); 742 if (win.addEventListener) { 743 win.addEventListener("resize", applyRules, false); 744 745 } 746 // Allow for resizing text after the page has loaded. 747 var current_em = emsToPixels(1, doc.body); 748 win.setInterval(function() { 749 var new_em = emsToPixels(1, doc.body); 750 if (new_em !== current_em) { 751 applyRules(); 752 current_em = new_em; 753 } 754 }, 2000); 755 } 756 757 function memoize( f ) { 758 return function () { 759 var args = Array.prototype.slice.call(arguments); 760 f.memoize = f.memoize || {}; 761 return (args in f.memoize) ? f.memoize[args] : f.memoize[args] = f.apply(this, args); 762 }; 763 } 764 765 var emsToPixels = memoize(function(em, scope) { 766 var test = doc.createElement("div"); 767 test.style.fontSize = "1em"; 768 test.style.margin = "0"; 769 test.style.padding = "0"; 770 test.style.border = "none"; 771 test.style.width = "1em"; 772 scope.appendChild(test); 773 var val = test.offsetWidth; 774 scope.removeChild(test); 775 return Math.round(val * em); 776 }); 777 778 var getDefaultWidth = function(el, class_name) { 779 if( true ) { 780 // we don't need to be fancy, simple width is ok, all the resp containers are flexible 781 return el.offsetWidth; 782 } 783 //console.log( "hit width", el ); 784 var test = el.cloneNode(true); 785 test.className = (" " + test.className + " ").replace(" " + class_name + " ", " "); 786 test.style.height = 0; 787 test.style.visibility = "hidden"; 788 test.style.overflow = "hidden"; 789 test.style.clear = "both"; 790 var parent = el.parentNode; 791 parent.insertBefore(test, el); 792 var val = test.offsetWidth; 793 parent.removeChild(test); 794 return val; 795 } 796 797 if( window.addEventListener ) { 798 console.log( "installing mrpRescanResponsifyContainers listener" ); 799 window.addEventListener("mrpRescanResponsifyContainers", function() { 800 console.log( "mrpRescanResponsifyContainers" ); 801 findContainerQueries(); 802 applyRules(); 803 }, false); 804 } 805 else if (window.attachEvent) { 806 window.attachEvent("mrpRescanResponsifyContainers", function() { 807 findContainerQueries(); 808 applyRules(); 809 }); 810 } 811 812 if( /loaded|complete|interactive/.test(doc.readyState) ) { 813 contentReady(); 814 } 815 else if (doc.addEventListener) { 816 doc.addEventListener("DOMContentLoaded", contentReady, false); 817 // or 818 win.addEventListener("load", contentReady, false); 819 } 820 // If old IE 821 else if (doc.attachEvent) { 822 doc.attachEvent("onreadystatechange", contentReady); 823 // or 824 win.attachEvent("onload", contentReady); 825 } 826 827 828 win["SelectorQueries"] = { 829 "add": add, 830 "ignoreDataAttributes": ignoreDataAttributes 831 } 832 833})(this); 834 835 836 837/* ==== INCLUDE: /js/blocks/sticky-menu.js ==== */ 838 839 840document.addEventListener( 'DOMContentLoaded', function() { 841 842 function initBlock(id) { 843 const block = document.getElementById(id) 844 if( block.querySelector('.sticky-menu')) { 845 init( block.querySelector( '.sticky-menu' ) ) 846 } 847 } 848 849 function isMenuVisible (el) { 850 var rect = el.getBoundingClientRect(); 851 852 if( rect.top < 0 ) { 853 return false;
854 } 855 else { 856 return true; 857 } 858 } 859 860 function floatMenu( el ) { 861 if( el.querySelector('.sticky' ).classList.contains( 'floated')) { 862 return 863 } 864 if( document.querySelector('html').classList.contains('editing') ) { 865 return unfloatMenu(el) 866 } 867 el.querySelector('.sticky' ).style.opacity = '1' 868 el.querySelector('.sticky' ).classList.add( 'floating', 'floated', 'elevation3' ) 869 el.classList.add( 'sticky-on' ) 870 } 871 872 function unfloatMenu( el ) { 873 if( !el.querySelector('.sticky' ).classList.contains( 'floated')) { 874 return 875 } 876 el.querySelector('.sticky' ).classList.remove( 'floating', 'floated', 'elevation3' ) 877 el.classList.remove( 'sticky-on' ) 878 } 879 880 function init( el ) { 881 if( !el || !el.querySelector( '.sticky' )) { 882 return 883 } 884 885 window.addEventListener( 'scroll', function() { 886 isMenuVisible( el ) ? unfloatMenu(el) : floatMenu(el) 887 }, { passive: true }) 888 889 890 if( !isMenuVisible(el) ) { 891 floatMenu(el) 892 } 893 894 document.addEventListener( 'editor.on', function() { 895 unfloatMenu( el ) 896 }) 897 document.addEventListener( 'editor.off', function() { 898 if( !isMenuVisible( el ) ) { 899 floatMenu( el ) 900 } 901 }) 902 } 903 904 document.querySelectorAll( '.sticky-menu' ).forEach( function(el) { 905 init( el ) 906 }) 907 908 _G.reinitHandlers.push(initBlock) 909}) 910 911 912/* ==== INCLUDE: /js/blocks/hmenu.js ==== */ 913 914document.addEventListener( 'DOMContentLoaded', ev => { 915 916 document.body.addEventListener( 'click', ev => { 917 918 if( document.querySelector('html').classList.contains('editing')) { 919 return 920 } 921 if( !ev.target.matches( '.hmenu li.has-submenu, .hmenu li.has-submenu > *' ) ) { 922 return 923 } 924 const el = ev.target.closest( 'li' ) 925 ev.preventDefault() 926 ev.stopPropagation() 927 928 document.querySelectorAll( '.hmenu li.open' ).forEach( open => { 929 if( open.contains(el) ) { 930 return 931 } 932 open.classList.remove('open') 933 open.classList.remove('visible') 934 }) 935 if( el.classList.contains('open')) { 936 // toggle 937 el.classList.remove('open'); 938 el.classList.remove('visible'); 939 return; 940 } 941 // open -> does display: block which acquires dimension for popper 942 el.classList.add( 'open' ) 943 setTimeout( () => { 944 // then we fade it in 945 el.classList.add( 'visible' ) 946 }, 100 ) 947 948 if( el.__popper ) { 949 el.__popper.update() 950 return 951 } 952 953 console.log( 'placement', el.closest('ul' ).classList.contains('mrp-menu-level-0') ? 'bottom-start' : 'right-start' ) 954 955 el.__popper = Popper.createPopper( el, el.querySelector( 'ul'), { 956 placement: el.closest('ul' ).classList.contains('mrp-menu-level-0') ? 'bottom-start' : 'right-start', 957 }) 958 }) 959 960 document.body.addEventListener('keydown', ev => { 961 if( ev.key === 'Enter' ) { 962 if( !ev.target.closest( 'li.has-submenu') ) { 963 return 964 } 965 ev.stopPropagation() 966 ev.preventDefault() 967 ev.target.closest( 'li.has-submenu').click() 968 } 969 else if( ev.key === 'Escape' ) { 970 document.querySelectorAll( '.hmenu li.open' ).forEach( el => { 971 el.classList.remove('open') 972 el.classList.remove('visible') 973 }) 974 } 975 }) 976 977 document.body.addEventListener('click', ev => { 978 if( ev.target.closest( 'li.has-submenu') ) { 979 return 980 } 981 document.querySelectorAll( '.hmenu li.open' ).forEach( el => { 982 el.classList.remove('open') 983 el.classList.remove('visible') 984 }) 985 }) 986 987 document.querySelectorAll('.hmenu').forEach( menu => { 988 menu.querySelectorAll( '.hmenu li.has-submenu' ).forEach( item => { 989 item.addEventListener('click', ev => { 990 991 }) 992 993 }) 994 }) 995}) 996 997 998/* ==== INCLUDE: /js/blocks/vmenu.js ==== */ 999
1000/*! 1001 * Mmenu Light 1002 * mmenujs.com/mmenu-light 1003 * 1004 * Copyright (c) Fred Heusschen 1005 * www.frebsite.nl 1006 * 1007 * License: CC-BY-4.0 1008 * http://creativecommons.org/licenses/by/4.0/ 1009 */ 1010 1011!function(t){var e={};function n(i){if(e[i])return e[i].exports;var s=e[i]={i:i,l:!1,exports:{}};return t[i].call(s.exports,s,s.exports,n),s.l=!0,s.exports}n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)n.d(i,s,function(e){return t[e]}.bind(null,s));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){"use strict";n.r(e);var i=function(){function t(t){var e=this;this.listener=function(t){(t.matches?e.matchFns:e.unmatchFns).forEac
1011h((function(t){t()}))},this.toggler=window.matchMedia(t),this.toggler.addListener(this.listener),this.matchFns=[],this.unmatchFns=[]}return t.prototype.add=function(t,e){this.matchFns.push(t),this.unmatchFns.push(e),(this.toggler.matches?t:e)()},t}(),s=function(t){return Array.prototype.slice.call(t)},o=function(t,e){return s((e||document).querySelectorAll(t))},r=("ontouchstart"in window||navigator.msMaxTouchPoints,navigator.userAgent.indexOf("MSIE")>-1||navigator.appVersion.indexOf("Trident/")>-1),a="mm-spn",c=function(){function t(t,e,n,i,s){this.node=t,this.title=e,this.slidingSubmenus=i,this.selectedClass=n,this.node.classList.add(a),r&&(this.slidingSubmenus=!1),this.node.classList.add(a+"--"+s),this.node.classList.add(a+"--"+(this.slidingSubmenus?"navbar":"vertical")),this._setSelectedl(),this._initAnchors()}return Object.defineProperty(t.prototype,"prefix",{get:function(){return a},enumerable:!1,configurable:!0}),t.prototype.openPanel=function(t){var e=t.parentElement;if(this.slidingSubmenus){var n=t.dataset.mmSpnTitle;e===this.node?this.node.classList.add(a+"--main"):(this.node.classList.remove(a+"--main"),n||s(e.children).forEach((function(t){t.matches("a, span")&&(n=t.textContent)}))),n||(n=this.title),this.node.dataset.mmSpnTitle=n,o(".mm-spn--open",this.node).forEach((function(t){t.classList.remove(a+"--open"),t.classList.remove(a+"--parent")})),t.classList.add(a+"--open"),t.classList.remove(a+"--parent");for(var i=t.parentElement.closest("ul");i;)i.classList.add(a+"--open"),i.classList.add(a+"--parent"),i=i.parentElement.closest("ul")}else{var r=t.matches(".mm-spn--open");r?e.classList.remove(a+"--open-parent"):e.classList.add(a+"--open-parent"),t.classList[r?"remove":"add"](a+"--open");for(var c=t.parentElement.closest("ul");c;)c.classList.add(a+"--open"),c=c.parentElement.closest("ul")}},t.prototype._setSelectedl=function(){var t=o("."+this.selectedClass,this.node),e=t[t.length-1],n=null;e&&(n=e.closest("ul")),n||(n=this.node.querySelector("ul")),this.openPanel(n)},t.prototype._initAnchors=function(){var t=this;this.node.addEventListener("click",(function(e){var n=e.target,i=!1;(i=(i=(i=i||function(t){return!!t.matches("a")}(n))||function(e){var n;return!!(n=e.closest("span")?e.parentElement:!!e.closest("li")&&e)&&(s(n.children).forEach((function(e){e.matches("ul")&&t.openPanel(e)})),!0)}(n))||function(e){var n=o(".mm-spn--open",e),i=n[n.length-1];if(i){var s=i.parentElement.closest("ul");
1011if(s)return t.openPanel(s),!0}return!1}(n))&&e.stopImmediatePropagation()}))},t}(),d=function(){function t(t,e){var n=this;void 0===t&&(t=null),this.wrapper=document.createElement("div"),this.wrapper.classList.add("mm-ocd"),this.wrapper.classList.add("mm-ocd--"+e),this.content=document.createElement("div"),this.content.classList.add("mm-ocd__content"),this.wrapper.append(this.content),this.backdrop=document.createElement("div"),this.backdrop.classList.add("mm-ocd__backdrop"),this.wrapper.append(this.backdrop),document.body.append(this.wrapper),t&&this.content.append(t);var i=function(t){n.close(),t.stopImmediatePropagation()};this.backdrop.addEventListener("touchstart",i,{passive:!0}),this.backdrop.addEventListener("mousedown",i,{passive:!0})}return Object.defineProperty(t.prototype,"prefix",{get:function(){return"mm-ocd"},enumerable:!1,configurable:!0}),t.prototype.open=function(){this.wrapper.classList.add("mm-ocd--open"),document.querySelector('html').classList.add("mm-ocd-opened")},t.prototype.close=function(){this.wrapper.classList.remove("mm-ocd--open"),document.querySelector('html').classList.remove("mm-ocd-opened")},t}(),l=function(){function t(t,e){void 0===e&&(e="all"),this.menu=t,this.toggler=new i(e)}return t.prototype.navigation=function(t){var e=this;if(!this.navigator){var n=(t=t||{}).title,i=void 0===n?"Menu":n,s=t.selectedClass,o=void 0===s?"Selected":s,r=t.slidingSubmenus,a=void 0===r||r,d=t.theme,l=void 0===d?"light":d;this.navigator=new c(this.menu,i,o,a,l),this.toggler.add((function(){return e.menu.classList.add(e.navigator.prefix)}),(function(){return e.menu.classList.remove(e.navigator.prefix)}))}return this.navigator},t.prototype.offcanvas=function(t){var e=this;if(!this.drawer){var n=(t=t||{}).position,i=void 0===n?"left":n;this.drawer=new d(null,i);var s=document.createComment("original menu location");this.menu.after(s),this.toggler.add((function(){e.drawer.content.append(e.menu)}),(function(){e.drawer.close(),s.after(e.menu)}))}return this.drawer},t}();e.default=l;window.MmenuLight=l}]); 1012 1013;(function () { 1014 1015 const menus = {} 1016 1017 const init = (id) => { 1018 // re-entrant 1019 1020 if( id ) { 1021 // re-init 1022 // first destroy all existing (after apply in-place changes) constructs 1023 document.querySelectorAll( '[data-rel="' + id + '"]').forEach( existing => { 1024 existing.remove() 1025 }) 1026 } 1027 1028 document.querySelectorAll( '.vmenu').forEach( (el, index) => { 1029 if( el.classList.contains('inited')) { 1030 return 1031 } 1032 el.classList.add('inited') 1033 1034 const blockId = el.closest( '.block-layout' ).getAttribute('id') 1035 1036 1037 1038 const menu = new MmenuLight( el, 'all' ) 1039 const navigation = menu.navigation({ 1040 selected: 'selected', 1041 slidingSubmenus: 'true' === el.getAttribute('data-slide'), 1042 theme: 'true' === el.getAttribute('data-dark') ? 'dark' : 'light', 1043 title: '' 1044 }) 1045 1046 const drawer = menu.offcanvas({ 1047 position: 'right' === el.getAttribute('data-position') ? 'right' : 'left', 1048 }) 1049 1050 drawer.wrapper.setAttribute( 'data-rel', blockId ) 1051 1052 el.classList.remove('initial') 1053 1054 // if id was given to us in init(id), then we are reiniting 1055 if( id && index === 0 ) { 1056 menus[blockId] = [] 1057 } 1058 if( !menus[blockId] ) { 1059 // array for potentially multiple per block 1060 menus[blockId] = [] 1061 } 1062 menus[blockId].push({ navigation, drawer }) 1063 }) 1064 } 1065 1066 document.addEventListener('DOMContentLoaded', () => { 1067 init() 1068 1069 document.addEventListener('editor.on', () => { 1070 Reflect.ownKeys(menus).forEach( m => { 1071 const handlers = menus[m] 1072 handlers.forEach( h => { 1073 try { 1074 h.drawer.close() 1075 } 1076 catch( e ) {} 1077 }) 1078 }) 1079 }) 1080 1081 document.addEventListener('keydown', ev => { 1082 if( ev.key === 'Escape' ) {
1083 Reflect.ownKeys(menus).forEach( m => { 1084 const handlers = menus[m] 1085 handlers.forEach( h => { 1086 try { 1087 h.drawer.close() 1088 } 1089 catch( e ) {} 1090 }) 1091 }) 1092 } 1093 }) 1094 1095 document.addEventListener('click', ev => { 1096 if( ev.target && ev.target && 1097 ev.target.closest('.vmenu-opener')) { 1098 1099 if( document.querySelector('html').classList.contains('editing')) { 1100 return 1101 } 1102 const blockId = ev.target.closest('.block-layout').getAttribute('id') 1103 const index = parseInt(ev.target.closest('.vmenu-opener').getAttribute( 'data-index')) || 0 1104 const handlers = menus[blockId] 1105 if( Array.isArray(handlers) && handlers[index]) { 1106 handlers[index].drawer.open() 1107 if( handlers[index].navigation.slidingSubmenus ) { 1108 handlers[index].navigation.openPanel(handlers[index].navigation.node.querySelector('ul')) 1109 } 1110 handlers[index].drawer.content.querySelector('.vmenu').focus() 1111 } 1112 } 1113 }) 1114 }) 1115 1116 _G.reinitHandlers.push(init) 1117 1118})() 1119 1120 1121/* ==== INCLUDE: /js/blocks/vmenu-fix.js ==== */ 1122 1123document.addEventListener("DOMContentLoaded", function () { 1124 const isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent); 1125 if (!isIOS) return; 1126 1127 const html = document.documentElement; 1128 1129 const syncViewport = () => { 1130 // Force Safari to sync visual + layout viewport 1131 window.scrollTo(0, 1); 1132 window.scrollTo(0, 0); 1133 1134 // Force reflow 1135 html.style.transform = "translateZ(0)"; 1136 void html.offsetHeight; 1137 html.style.transform = ""; 1138 }; 1139 1140 // Watch for mmenu open class on <html> 1141 const obs = new MutationObserver(() => { 1142 if (html.classList.contains("mm-ocd-opened")) { 1143 syncViewport(); 1144 } 1145 }); 1146 1147 obs.observe(html, { attributes: true, attributeFilter: ["class"] }); 1148}); 1149 1150/* ==== INCLUDE: /js/weblets/blog.js ==== */ 1151 1152 1153function toggle(divName){ 1154 1155 var row = document.getElementById(divName); 1156 var image = document.getElementById('img' + divName); 1157 1158 if(row.style.display == 'none'){ 1159 row.style.display = 'block'; 1160 image.src = '/img/collapseall.gif'; 1161 } 1162 else{ 1163 row.style.display = 'none'; 1164 image.src = '/img/expandall.gif'; 1165 } 1166 1167} 1168 1169function timestampToString(timestamp, skipTime) { 1170 if (timestamp) { 1171 var a = new Date(timestamp); 1172 var year = a.getFullYear(); 1173 var month = ''; 1174 if (skipTime) { 1175 var months = ['January','February','March','April','May','June','July','August','September','October','November','December']; 1176 month = months[a.getMonth()]; 1177 } else { 1178 var months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']; 1179 month = months[a.getMonth()]; 1180 } 1181 var date = a.getDate(); 1182 if (skipTime) 1183 return month+' '+date+', '+year; 1184 var hour = a.getHours(); 1185 var min = a.getMinutes(); 1186 var am = ''; 1187 if (hour==0) { 1188 hour = 12; 1189 am = 'PM'; 1190 } else if (hour<=12) { 1191 am = 'AM'; 1192 } else { 1193 hour -= 12; 1194 am = 'PM'; 1195 } 1196 if (min<10) { 1197 min = "0"+min; 1198 } 1199 return month+' '+date+', '+year+' '+hour+':'+min+' '+am; 1200 } 1201 return ""; 1202} 1203 1204function updateAllTimestamps() { 1205 var dates = document.querySelectorAll( '.weblet_blog-date-friendly' ); 1206 for (var i=0; i<dates.length; i++) { 1207 var timestamp = dates[i].getAttribute('timestamp'); 1208 if (timestamp) { 1209 dates[i].innerHTML = timestampToString( parseInt( timestamp ), true ); 1210 } 1211 } 1212 dates = document.querySelectorAll( '.weblet_blog-date-full, .weblet_blog-comment-date-full' ); 1213 for (var i=0; i<dates.length; i++) { 1214 var timestamp = dates[i].getAttribute('timestamp'); 1215 if (timestamp) { 1216 dates[i].innerHTML = 'on '+timestampToString( parseInt( timestamp ) ); 1217 } 1218 } 1219} 1220 1221function updateListingBanners() { 1222 var banners = document.querySelectorAll( ".weblet_blog-entry-text .listing-banner" ); 1223 for( var i=0; i<banners.length; ++i ) { 1224 var article = banners[i].closest( ".weblet_blog-blog-entry"); 1225 if( article ) { 1226 var imageLink = article.querySelector( "a.weblet_blog-main-image-link" ); 1227 if( imageLink ) { 1228 imageLink.appendChild( banners[i] ); 1229 banners[i].classList.add( "ready" ); 1230 } 1231 } 1232 } 1233} 1234 1235function createScrollParallaxForBlogImages() { 1236 var images = document.querySelectorAll( ".blog-post-full .blog-with-parallax .weblet_blog-entry-image-container" ); 1237 for (i = 0; i < images.length; i++) { 1238 var p = document.createElement("div"); 1239 p.classList.add( "weblet_blog-entry-image-container-parallax"); 1240 p.classList.add( "with-scroll-parallax" ); 1241 images[i].appendChild(p); 1242 _G.parallaxService.add(p); 1243 } 1244} 1245 1246 1247function mrp_shareBlogWindow(target) { 1248 var url = target.getAttribute( "data-url" ); 1249 mrp_open_new_window( url, 600, 400, "share-blog-post" ); 1250} 1251 1252window.customOnLoads = window.customOnLoads || []; 1253 1254window.customOnLoads.push( function() {
1255 var images = document.querySelectorAll( ".blog-entry-list .weblet_blog-entry-image-container" ); 1256 for (i = 0; i < images.length; i++) { 1257 if( images[i].parentElement && images[i].parentElement.nodeName === 'A' ) { 1258 continue; 1259 } 1260 images[i].style.cursor = "pointer"; 1261 images[i].addEventListener( "click", function(ev,elem) { 1262 var url = ev.target.getAttribute( "data-link" ); 1263 if( url ) { 1264 window.location = url; 1265 } 1266 }); 1267 } 1268}); 1269 1270window.customOnLoads.push( function() { 1271 updateAllTimestamps(); 1272 updateListingBanners(); 1273 createScrollParallaxForBlogImages(); 1274}); 1275 1276 1277 1278 1279/* ==== INCLUDE: /js/weblets/responsive/blog-resp.js ==== */ 1280 1281;(function() { 1282 1283 function launchLightbox( thumb ) { 1284 var index = Array.prototype.indexOf.call(thumb.parentNode.childNodes, thumb); 1285 var lightbox = new FsLightbox() 1286 var sources = [] 1287 var captions = [] 1288 thumb.parentElement.querySelectorAll('img' ).forEach( function(img) { 1289 sources.push( img.getAttribute('src')) 1290 captions.push( img.getAttribute( 'alt') || '') 1291 }) 1292 lightbox.props.captions = captions 1293 lightbox.props.sources = sources 1294 lightbox.props.disableThumbs = true 1295 lightbox.props.slideChangeAnimation = 'slide-change-animation' 1296 lightbox.open(index || 0) 1297 } 1298 1299 function initThumb( el ) { 1300 if( el.getAttribute("inited") ) { 1301 return 1302 } 1303 el.setAttribute('inited', true ) 1304 el.addEventListener( 'click', function(event) { 1305 if( document.querySelector("html.editing")) { 1306 return; 1307 } 1308 launchLightbox(el) 1309 }) 1310 } 1311 1312 document.addEventListener( 'DOMContentLoaded', function() { 1313 document.querySelectorAll( '[data-type="gallery"] > img' ).forEach( function(el) { 1314 initThumb(el) 1315 }) 1316 }) 1317})(); 1318 1319/* ==== INCLUDE: /js/blocks/forms.js ==== */ 1320 1321;(function() { 1322 1323 // --- WAF attestation token (alpha) -------------------------------------- 1324 // Active only when the server emits window._wafTokenEndpoint (blank 1325 // waf.token.url in wps-application.properties = never emitted = inert). 1326 // Contract: never block, never break a submission -- any failure means no 1327 // token, the form submits exactly as before and the server scores "missing". 1328 const wafToken = (function() { 1329 let cached = null // { token, exp } 1330 let inflight = null 1331 1332 const endpoint = () => window._wafTokenEndpoint 1333 const fresh = () => cached && (cached.exp - 30) > Math.floor(Date.now() / 1000) 1334 1335 function request() { 1336 if( !endpoint() || !window.fetch ) { 1337 return Promise.resolve(null) 1338 } 1339 if( inflight ) { 1340 return inflight 1341 } 1342 const ctrl = window.AbortController ? new AbortController() : null 1343 const timer = ctrl && setTimeout( () => ctrl.abort(), 3000 ) 1344 inflight = fetch( endpoint(), { mode: 'cors', credentials: 'omit', 1345 signal: ctrl ? ctrl.signal : undefined } ) 1346 .then( r => r.ok ? r.json() : null ) 1347 .then( j => { 1348 if( j && j.token ) { 1349 cached = j 1350 } 1351 return j && j.token 1352 }) 1353 .catch( () => null ) // unreachable/CORS/timeout -> no token 1354 .finally( () => { 1355 if( timer ) clearTimeout(timer) 1356 inflight = null 1357 }) 1358 return inflight 1359 } 1360 1361 // mint on first interaction with any dynamic form; re-mint when stale 1362 document.addEventListener( 'focusin', ev => { 1363 if( endpoint() && ev.target.closest 1364 && ev.target.closest('.mrp-dynamic-form') && !fresh() ) { 1365 request() 1366 } 1367 }) 1368 1369 return { get: () => fresh() ? cached.token : null, request } 1370 })() 1371 1372 1373 function processSubmitResponse( origForm, html ) { 1374 1375 const targetFormEl = origForm.querySelector('[name=__targetForm]') 1376 if( !targetFormEl ) { 1377 console.error( "Failed to find __targetForm" ) 1378 return 1379 } 1380 1381 const targetForm = targetFormEl.getAttribute('value') 1382 1383 const htmlFragment = _G.createFragment(html) 1384 1385 const newTargetFormEl = htmlFragment.querySelector('[name=__targetForm][value="' + targetForm + '"]') 1386
1387 if( !newTargetFormEl ) { 1388 console.error( "Failed to find targetForm in the returned response" ) 1389 return 1390 } 1391 const newForm = newTargetFormEl.closest('form') 1392 // const newForm = _G.createFragment( html ).querySelector('form') 1393 newForm.querySelectorAll('.form-error').forEach( el => { 1394 el.remove() 1395 }) 1396 origForm.parentElement.replaceChild( newForm, origForm ) 1397 1398 setTimeout(function() { 1399 const firstError = newForm.querySelector('.control-error') 1400 if( firstError ) { 1401 const top = firstError.getBoundingClientRect().top 1402 if( top < 0 ) { 1403 window.scrollTo( {top: window.scrollY + top - 100, behavior: 'smooth'}) 1404 } 1405 } 1406 }, 50) 1407 } 1408 1409 _G.onSubmitForm = ( form, customCallback ) => { 1410 1411 let submitting = true 1412 1413 function submitFeedback( form ) { 1414 setTimeout( () => { 1415 1416 if( !submitting ) { 1417 return 1418 } 1419 const submit = form.querySelector( '[type=submit]') 1420 if( submit ) { 1421 // const submitText = submit.innerText; 1422 // submit.setAttribute('data-submit-text', submitText ) 1423 // submit.innerText = 'Sending' 1424 submit.classList.add('submitting') 1425 submit.setAttribute('disabled', 'disabled') 1426 } 1427 }, 100 ) 1428 } 1429 1430 function undoSubmitFeedback( form ) { 1431 // note that we are passing our original form, not the new replaced form 1432 // so this will only fire if there was a network issue and no form 1433 // arrived back; otherwise, the new form would have had reset submit anyways 1434 const submit = form.querySelector( '[type=submit]') 1435 if( submit ) { 1436 // submit.innerText = submit.getAttribute('data-submit-text') 1437 submit.classList.remove('submitting') 1438 submit.removeAttribute('disabled') 1439 } 1440 } 1441 1442 let authTk = form.getAttribute('data-tk') 1443 if( !authTk ) { 1444 // try hidden 1445 const hidden = form.querySelector('input[name=__sh]') 1446 if( hidden ) { 1447 authTk = hidden.getAttribute('value') 1448 } 1449 if( !authTk ) { 1450 // bail 1451 console.error( 'auth token missing' ) 1452 return 1453 } 1454 } 1455 1456 const data = new URLSearchParams() 1457 for (const pair of new FormData(form)) { 1458 data.append(pair[0], pair[1].toString()) 1459 } 1460 data.append( '__src_url', window.location.href ) 1461 data.append( '__sh', authTk ) 1462 1463 if( !wafToken.get() ) { 1464 wafToken.request() // last-chance mint; races the submit delay below 1465 } 1466 1467 submitFeedback( form ) 1468 1469 setTimeout( () => { 1470 const wafTk = wafToken.get() 1471 if( wafTk ) { 1472 data.append( '__waf_tk', wafTk ) 1473 } 1474 fetch( window.location.href, { 1475 method: 'post', 1476 body: data, 1477 headers: { 1478 'X-Requested-With': 'fetch', 1479 'X-Form-Submit': 'true', 1480 'X-Form-Submit-From': window.location.href, 1481 } 1482 }).then( response => { 1483 if( customCallback ) { 1484 return customCallback(response) 1485 } 1486 const redir = response.headers.get('Location') 1487 if( redir ) { 1488 return window.location = redir 1489 } 1490 response.text().then( html => { 1491 // console.log( 'form html', html ) 1492 1493 const error = response.headers.get('X-Form-Error') 1494 const successURL = response.headers.get( 'X-Success-URL') 1495 const success = response.headers.get( 'X-Success-Message' ) 1496 1497 if( !error && success && successURL ) { 1498 window.location = successURL 1499 return 1500 } 1501 1502 processSubmitResponse( form, html ) 1503 1504 if( error ) { 1505 _G.quickMessage(error, { error: true } ); 1506 } 1507 else if( success ) { 1508 _G.quickMessage(success) 1509 1510 if( window.dataLayer ) { 1511 window.dataLayer.push( { 1512 event: 'formSubmitted', 1513 formURL: window.location.href, 1514 title: document.title, 1515 formName: data.get( '__formName') || '' 1516 }) 1517 } 1518 1519 window.dispatchEvent( new CustomEvent( "mrp.webFormSubmitted", { 1520 detail: { 1521 formURL: window.location.href, 1522 title: document.title, 1523 formName: data.get( '__formName') || '' 1524 } 1525 })); 1526 } 1527 }) 1528 }).catch( err => { 1529 console.error( "error occurred during form submission", err ) 1530 _G.quickMessage('Error occurred during form submission', { error: true } ); 1531 }).finally( () => { 1532 submitting = false 1533 undoSubmitFeedback(form) 1534 }) 1535 }, 1000 ) 1536 1537 1538 return false;
1539 } 1540 1541 1542 function processBlogCommentSubmitResponse( origForm, html ) { 1543 1544 const formID = origForm.getAttribute("id"); 1545 1546 const htmlFragment = _G.createFragment(html) 1547 1548 const newForm = htmlFragment.querySelector('#' + formID) 1549 1550 // const successEl = newForm.querySelector(".form-success"); 1551 // if( successEl && successEl.innerText ) { 1552 // const message = successEl.innerText; 1553 // setTimeout(() => { 1554 // _G.quickMessage( message, { 1555 // 1556 // }); 1557 // }, 100 ); 1558 // successEl.remove(); 1559 // } 1560 1561 // const newForm = _G.createFragment( html ).querySelector('form') 1562 newForm.querySelectorAll('.form-error').forEach( el => { 1563 el.remove() 1564 }) 1565 const authTk = newForm.getAttribute("data-tk"); 1566 if( authTk ) { 1567 const authTkEl = document.createElement("input"); 1568 authTkEl.setAttribute( "type", "hidden" ); 1569 authTkEl.setAttribute( "value", authTk ); 1570 newForm.appendChild( authTkEl ); 1571 } 1572 const srcUrlEl = document.createElement("input"); 1573 srcUrlEl.setAttribute( "type", "hidden" ); 1574 srcUrlEl.setAttribute( "value", window.location.href ); 1575 newForm.appendChild( srcUrlEl ); 1576 origForm.parentElement.replaceChild( newForm, origForm ); 1577 1578 1579 setTimeout(function() { 1580 const firstError = newForm.querySelector('.control-error') 1581 if( firstError ) { 1582 const top = firstError.getBoundingClientRect().top 1583 if( top < 0 ) { 1584 window.scrollTo( {top: window.scrollY + top - 100, behavior: 'smooth'}) 1585 } 1586 } 1587 }, 50) 1588 } 1589 1590 _G.onBlogCommentSubmitForm = ( form, customCallback ) => { 1591 1592 let submitting = true 1593 1594 function submitFeedback( form ) { 1595 setTimeout( () => { 1596 1597 if( !submitting ) { 1598 return 1599 } 1600 const submit = form.querySelector( '[type=submit]') 1601 if( submit ) { 1602 // const submitText = submit.innerText; 1603 // submit.setAttribute('data-submit-text', submitText ) 1604 // submit.innerText = 'Sending' 1605 submit.classList.add('submitting') 1606 submit.setAttribute('disabled', 'disabled') 1607 } 1608 }, 100 ) 1609 } 1610 1611 function undoSubmitFeedback( form ) { 1612 // note that we are passing our original form, not the new replaced form 1613 // so this will only fire if there was a network issue and no form 1614 // arrived back; otherwise, the new form would have had reset submit anyways 1615 const submit = form.querySelector( '[type=submit]') 1616 if( submit ) { 1617 // submit.innerText = submit.getAttribute('data-submit-text') 1618 submit.classList.remove('submitting') 1619 submit.removeAttribute('disabled') 1620 } 1621 } 1622 1623 let authTk = form.getAttribute('data-tk') 1624 if( !authTk ) { 1625 // try hidden 1626 const hidden = form.querySelector('input[name=__sh]') 1627 if( hidden ) { 1628 authTk = hidden.getAttribute('value') 1629 } 1630 if( !authTk ) { 1631 // bail 1632 console.error( 'auth token missing' ) 1633 return 1634 } 1635 } 1636 1637 const data = new URLSearchParams() 1638 for (const pair of new FormData(form)) { 1639 data.append(pair[0], pair[1].toString()) 1640 } 1641 data.append( '__src_url', window.location.href ) 1642 data.append( '__sh', authTk ) 1643 1644 submitFeedback( form ) 1645 1646 setTimeout( () => { 1647 fetch( window.location.href, { 1648 method: 'post', 1649 body: data, 1650 headers: { 1651 'X-Requested-With': 'fetch', 1652 'X-Form-Submit': 'true', 1653 'X-Form-Submit-From': window.location.href, 1654 } 1655 }).then( response => { 1656 if( customCallback ) { 1657 return customCallback(response) 1658 } 1659 const redir = response.headers.get('Location') 1660 if( redir ) { 1661 return window.location = redir 1662 } 1663 response.text().then( html => { 1664 // console.log( 'form html', html ) 1665 1666 const error = response.headers.get('X-Form-Error') 1667 const successURL = response.headers.get( 'X-Success-URL') 1668 const success = true; 1669 // const success = "Comment submitted. It will be reviewed and published shortly." 1670 1671 if( !error && success && successURL ) { 1672 window.location = successURL 1673 return 1674 } 1675 1676 processBlogCommentSubmitResponse( form, html ) 1677 1678 if( error ) { 1679 _G.quickMessage(error, { error: true } ); 1680 } 1681 else { 1682 // _G.quickMessage(success) 1683 1684 if( window.dataLayer ) { 1685 window.dataLayer.push( { 1686 event: 'formSubmitted', 1687 formURL: window.location.href, 1688 title: document.title, 1689 formName: data.get( '__formName') || '' 1690 }) 1691 } 1692 } 1693 }) 1694 }).catch( err => { 1695 console.error( "error occurred during form submission", err ) 1696 _G.quickMessage('Error occurred during form submission', { error: true } ); 1697 }).finally( () => { 1698 submitting = false 1699 undoSubmitFeedback(form) 1700 }) 1701 }, 1000 ) 1702 1703 1704 return false;
1705 } 1706})() 1707 1708/* ==== INCLUDE: /js/blocks/maps.js ==== */ 1709 1710 1711window.mapboxJsLoaded = false 1712window.mapboxCssLoaded = false 1713 1714function initMaps() { 1715 _G.maps = [] 1716 1717 // const BG_IMG = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAATCAYAAABPwleqAAAAZUlEQVQ4T+2TQQ7AIAgEl88WnyR+lgbSNGotCT31IEezs+IkEgDFxyGDVfM8EWHDCetbWEKWRX8grN9YasXB/HhEEwGXMpzbx5hH54IOHPIr2MrugjfQpQWSveBadZmLYN8guuAEQo5PBQyQLMoAAAAASUVORK5CYII=" 1718 // const BG_IMG = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAYAAAA71pVKAAAAL0lEQVQ4T2NkYGD4z0AmYARp/v+fdP2MjIwMo5pJCPXRACMhsEBKB0GAkehiuHIAy842AX0JUPAAAAAASUVORK5CYII=" 1719 const BG_IMG = "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAMCAgMCAgMDAwMEAwMEBQgFBQQEBQoHBwYIDAoMDAsKCwsNDhIQDQ4RDgsLEBYQERMUFRUVDA8XGBYUGBIUFRT/2wBDAQMEBAUEBQkFBQkUDQsNFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBT/wAARCAAPAA8DASIAAhEBAxEB/8QAFgABAQEAAAAAAAAAAAAAAAAABgAI/8QAJRAAAQMEAQQCAwAAAAAAAAAAAQIDBAUGBxEUAAgSExUxISJB/8QAFAEBAAAAAAAAAAAAAAAAAAAAAP/EABQRAQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhEDEQA/AN54ixFYtSxPZUyZZdvSpciiQnXn36UwtxxamEFSlKKNkkkkk/e+iXdZi+zbdwHdFQpVpUKmT2eL6pUOmssuo3KZSfFaUgjYJB0fokdWL+6zFtu40tKlVC6OPPg0iJFkM/HyleDiGUJWnaWiDogjYJHRnuT7k8cX/hW4qDQbi59Wl8b0x+DJb8/GS0tX7LbCRpKVH8n+dB//2Q==" 1720 1721 const sources = document.querySelectorAll( '[data-rel=block-map]') 1722 const promises = [] 1723 1724 const resizeObserver = new ResizeObserver((entries) => { 1725 entries.forEach( entry => { 1726 const map = entry && entry.target && entry.target['__map'] 1727 if( map ) { 1728 try { 1729 map.resize() 1730 } 1731 catch( e ) { 1732 console.warn( 'ERROR in maps', e ) 1733 } 1734 } 1735 }) 1736 }) 1737 1738 function addMarker(map, marker) { 1739 // console.log('to add marker', marker) 1740 var m = new mapboxgl.Marker({ 1741 color: "#d9534f" 1742 }).setLngLat([marker.geometry.coordinates[0], marker.geometry.coordinates[1]]) 1743 1744 try { 1745 m.getElement().setAttribute('data-id', marker.id) 1746 } 1747 catch( e ) { 1748 console.error( e ) 1749 } 1750 1751 if (marker.properties && marker.properties.label) { 1752 1753 try { 1754 m.getElement().setAttribute('data-label', marker.properties.label) 1755 } 1756 catch( e ) { 1757 console.error( e ) 1758 } 1759 1760 const popup = new mapboxgl.Popup({offset: 25,focusAfterOpen:false}) 1761 if (marker.properties.link) { 1762 const link = document.createElement('a') 1763 link.setAttribute('href', marker.properties.link ) 1764 link.innerText = marker.properties.label 1765 if( marker.properties.openInNewWindow ) { 1766 link.setAttribute('target', '_blank') 1767 } 1768 popup.setHTML(link.outerHTML) 1769 1770 m.getElement().classList.add("has-link") 1771 } else { 1772 popup.setText( 1773 `${marker.properties.label}` 1774 ) 1775 } 1776 m.setPopup(popup) 1777 } 1778 m.addTo(map); 1779 if (marker.properties && !marker.properties.hideInitially) { 1780 m.togglePopup(); 1781 } 1782 return m 1783 } 1784 1785 function addMarkers( map, geojson ) { 1786 1787 // console.log( 'to add markers', geojson ) 1788 geojson.__markers = {} 1789 geojson.__markerDefs = {} 1790 geojson.features.forEach( f => { 1791 if( f.geometry && f.geometry.type === 'Point' ) { 1792 const marker = addMarker( map, f ) 1793 geojson.__markers[f.id] = marker 1794 geojson.__markerDefs[f.id] = f 1795 } 1796 }) 1797 } 1798 1799 1800 function hideAllMarkers( geojson ) { 1801 Object.keys(geojson.__markers || {}).forEach( key => { 1802 const m = geojson.__markers[key] 1803 const p = m.getPopup() 1804 if( p && p.isOpen() ) { 1805 // p.remove() 1806 try { 1807 // p.getElement().style.opacity = '0' 1808 // setTimeout(() => { 1809 m.togglePopup() 1810 // }, 200) 1811 } 1812 catch( e ) { 1813 console.error(e) 1814 } 1815 } 1816 }) 1817 } 1818 1819 function showAllMarkers( geojson ) { 1820 Object.keys(geojson.__markers || {}
1820).forEach( key => { 1821 const m = geojson.__markers[key] 1822 const p = m.getPopup() 1823 if( p && !p.isOpen() ) { 1824 try { 1825 m.togglePopup() 1826 } 1827 catch( e ) { 1828 console.error(e) 1829 } 1830 } 1831 }) 1832 } 1833 1834 function restoreAllMarkers( geojson ) { 1835 Object.keys(geojson.__markers || {}).forEach( key => { 1836 const m = geojson.__markers[key] 1837 const p = m.getPopup() 1838 if( p && !p.isOpen() ) { 1839 try { 1840 m.togglePopup() 1841 } 1842 catch( e ) { 1843 console.error(e) 1844 } 1845 } 1846 }) 1847 } 1848 1849 1850 if( sources.length > 0 ) { 1851 promises.push( new Promise( (resolve, reject) => { 1852 if( window.mapboxJsLoaded ) { 1853 window.mapboxJsLoaded = true 1854 return resolve() 1855 } 1856 // LazyLoad.js( "https://api.mapbox.com/mapbox-gl-js/v1.11.1/mapbox-gl.js", () => { 1857 // resolve() 1858 // }) 1859 LazyLoad.js( "https://api.tiles.mapbox.com/mapbox-gl-js/v2.6.1/mapbox-gl.js", () => { 1860 resolve() 1861 }) 1862 // LazyLoad.js( "https://api.tiles.mapbox.com/mapbox-gl-js/v2.6.0-beta.1/mapbox-gl.js", () => { 1863 // resolve() 1864 // }) 1865 })) 1866 promises.push( new Promise( (resolve, reject) => { 1867 if( window.mapboxCssLoaded ) { 1868 return resolve() 1869 } 1870 // LazyLoad.css( "https://api.mapbox.com/mapbox-gl-js/v1.11.1/mapbox-gl.css", () => { 1871 // window.mapboxCssLoaded = true 1872 // resolve() 1873 // }) 1874 LazyLoad.css( "https://api.tiles.mapbox.com/mapbox-gl-js/v2.6.1/mapbox-gl.css", () => { 1875 window.mapboxCssLoaded = true 1876 resolve() 1877 }) 1878 // LazyLoad.css( "https://api.tiles.mapbox.com/mapbox-gl-js/v2.6.0-beta.1/mapbox-gl.css", () => { 1879 // window.mapboxCssLoaded = true 1880 // resolve() 1881 // }) 1882 })) 1883 Promise.all(promises).then( () => { 1884 sources.forEach( source => { 1885 try { 1886 const jsonSource = source.querySelector('script') 1887 if( !jsonSource ) { 1888 return 1889 } 1890 const json = JSON.parse( jsonSource.innerHTML ) 1891 mapboxgl.accessToken = json.key 1892 source.innerHTML = '' 1893 1894 // this is dumb by mapbox doesn't recognize non-numeric IDs on features 1895 let id = 1 1896 json.geoJson.features = json.geoJson.features.map( f => ({ 1897 ...f, 1898 id: ++id, 1899 state: { hover: false }, 1900 })) 1901 1902 console.log( 'geojson', json.geoJson ) 1903 1904 const map = new mapboxgl.Map({ 1905 container: source, 1906 style: 'mapbox://styles/mapbox/streets-v11', 1907 center: [json.centerLng, json.centerLat], 1908 zoom : json.zoom, 1909 pitch: json.pitch, 1910 scrollZoom: false, 1911 attributionControl : false, 1912 trackResize : true, 1913 cooperativeGestures: true, 1914 }) 1915 const nav = new mapboxgl.NavigationControl(); 1916 map.addControl(nav, 'top-left'); 1917 source['__map'] = map 1918 resizeObserver.observe(source) 1919 map.on( 'load', () => { 1920 map.loadImage( BG_IMG, (error, image) => { 1921 console.log( 'loaded image', image, error ) 1922 map.addImage('mrp_label_bg', image, { 1923 content: [3, 3, 13, 13], 1924 stretchX: [[3, 5],[10,12]], 1925 stretchY: [[3, 5], [8,13]] 1926 }) 1927 1928 map.addSource( 'data', { 1929 type: 'geojson', 1930 data: json.geoJson, 1931 }) 1932 map.addLayer({ 1933 id: 'line', 1934 source: 'data', 1935 type: 'line', 1936 filter: ['==', ['geometry-type'], 'LineString'], 1937 layout: { 1938 'line-cap': 'round', 1939 'line-join': 'round' 1940 }, 1941 paint: { 1942 'line-color': '#3e81a9', 1943 'line-width': 2, 1944 } 1945 }) 1946 map.addLayer({ 1947 id: 'polygon-fill', 1948 source: 'data', 1949 type: 'fill', 1950 filter: ['==', ['geometry-type'], 'Polygon'], 1951 paint: { 1952 'fill-color': '#3e81a9', 1953 'fill-outline-color': '#3e81a9', 1954 // 'fill-opacity': 0.1 1955 'fill-opacity': [ 1956 'case', 1957 ['==', ['feature-state', 'hover'], true], 1958 0.3, 1959 0.1 1960 ] 1961 } 1962 }) 1963 map.addLayer({ 1964 id: 'polygon-line', 1965 source: 'data', 1966 type: 'line', 1967 filter: ['==', ['geometry-type'], 'Polygon'], 1968 layout: { 1969 'line-cap': 'round', 1970 'line-join': 'round' 1971 }, 1972 paint: { 1973 'line-color': '#3e81a9', 1974 // 'line-width': 2 1975 'line-width': [ 1976 'case', 1977 ['==', ['feature-state', 'hover'], true], 1978 5, 1979 2 1980 ] 1981 } 1982 }) 1983 map.addLayer({ 1984 id: 'marker-halo', 1985 source: 'data', 1986 type: 'circle', 1987 filter: ['==', ['geometry-type'], 'Point'], 1988 paint: { 1989 'circle-radius': 9, 1990 'circle-opacity': 1, 1991 // 'circle-color': '#fff', 1992 'circle-color': 'transparent' // making transparent 1993 }, 1994 }) 1995 map.addLayer({ 1996 id: 'marker', 1997 source: 'data', 1998 type: 'circle', 1999 filter: ['==', ['geometry-type'], 'Point'], 2000 paint: { 2001 'circle-radius': 20, 2002 'circle-opacity': 1, 2003 // 'circle-color': '#3e81a9', 2004 'circle-color': 'transparent' // making transparent 2005 }, 2006 }) 2007 // map.addLayer({ 2008 // id: 'marker-label', 2009 // source: 'data', 2010 // type: 'symbol', 2011 // filter: ['all', ['has', 'label'], ['!=', 'label', '']], 2012 // paint: { 2013 // 'text-halo-color': '#fff', 2014 // 'text-halo-width': 2, 2015 // 'text-halo-blur': 2, 2016 // // 'text-color': '#3e81a9', 2017 // 'text-color': '#333333', 2018 // }, 2019 // layout: { 2020 // 'text-field': ['get', 'label'], 2021 // 'text-font': [ 2022 // 'Open Sans Semibold', 2023 // ], 2024 // 'text-offset': [0, -3], 2025 // 'text-anchor': 'bottom', 2026 // 'text-size': 16, 2027 // 'text-allow-overlap': true, 2028 // 'text-ignore-placement': true, 2029 // 'text-variable-anchor': ['bottom', 'top'], 2030 // 'text-justify': 'auto', 2031 // 'icon-image' : 'mrp_label_bg', 2032 // 'icon-text-fit' : 'both', 2033 // 'icon-text-fit-padding': [8,8,8,8], 2034 // } 2035 // }) 2036 addMarkers(map, json.geoJson) 2037 2038 map.on( 'click', 'polygon-fill', e => { 2039 // console.log( 'click on', e, e.features ) 2040 if( e.features && e.features[0] ) { 2041 const props = e.features[0].properties || {} 2042 if (props.link) { 2043 if( props.openInNewWindow ) { 2044 window.open( props.link, '_blank' ) 2045 } 2046 else { 2047 window.location = props.link 2048 } 2049 } 2050 } 2051 }) 2052 let hoverId = -1; 2053 map.on( 'mousemove', 'polygon-fill', e => { 2054 // console.log( 'hoverId', hoverId ) 2055 if( e.features && e.features[0] ) { 2056 const props = e.features[0].properties || {} 2057 if( props.link ) { 2058 if( hoverId >= 0 ) { 2059 map.setFeatureState( 2060 { source: 'data', id: hoverId }, 2061 { hover: false } 2062 ) 2063 } 2064 hoverId = e.features[0].id 2065 map.setFeatureState( 2066 { source: 'data', id: hoverId }, 2067 { hover: true } 2068 ) 2069 map.getCanvas().style.cursor = 'pointer' 2070 } 2071 } 2072 }) 2073 map.on( 'mouseleave', 'polygon-fill', e => { 2074 // console.log( 'mouse out', e ) 2075 map.getCanvas().style.cursor = '' 2076 if( hoverId >= 0 ) { 2077 map.setFeatureState( 2078 { source: 'data', id: hoverId }, 2079 { hover: false } 2080 ) 2081 hoverId = -1 2082 } 2083 // console.log( 'hoverId', hoverId ) 2084 }) 2085 map.on( 'click', e => { 2086 //showAllMarkers(json.geoJson) 2087 }) 2088 map.on( 'mouseleave', 'marker', e => { 2089 //showAllMarkers(json.geoJson) 2090 }) 2091 // let hoverPopup = null; 2092 map.on( 'mouseenter', 'marker', e => { 2093 if( e.features && e.features[0] ) { 2094 // console.log( 'marker', json.geoJson.__markers[e.features[0].id] ) 2095 // if( hoverPopup ) { 2096 // hoverPopup.remove() 2097 // hoverPopup = null; 2098 // } 2099 hideAllMarkers(json.geoJson) 2100 const marker = json.geoJson.__markers[e.features[0].id] 2101 if( marker ) { 2102 const popup = marker.getPopup() 2103 if( popup && !popup.isOpen() ) { 2104 // popup.addTo(map) 2105 // hoverPopup = popup 2106 marker.togglePopup() 2107 } 2108 } 2109 } 2110 }) 2111 // setTimeout(() => { 2112 // map.resize() 2113 // }, 1000) 2114 // map.on( 'mouseleave', 'marker', e => { 2115 // if( hoverPopup ) { 2116 // hoverPopup.remove() 2117 // hoverPopup = null; 2118 // } 2119 // }) 2120 }) 2121 }) 2122 //console.log( 'geoJSON', json ) 2123 } 2124 catch( e ) { 2125 console.error( 'Failed to init maps', e ) 2126 } 2127 }) 2128 }) 2129 } 2130} 2131 2132document.addEventListener('DOMContentLoaded', () => { 2133 initMaps() 2134 2135 _G.reinitHandlers.push(initMaps) 2136});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.