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/blocks/listings-v2.5.js ==== */ 1151 1152;(function() { 1153 // Function to move elements only if they haven't been moved already 1154 1155 function moveElements() { 1156 const elem = document.querySelector('.mrp-weblet-listings, .mrp-weblet-listing-areas'); 1157 1158 if (elem != null) { 1159 1160 1161// Filtering adjustments 1162const controls = document.querySelectorAll('.idx-basic-control, .basic-control'); 1163 1164// Function to close all collapsible contents 1165function closeAllControls() { 1166 controls.forEach(control => { 1167 const controlContent = control.querySelector('.collapsible-content'); 1168 if (controlContent) { 1169 controlContent.style.display = 'none'; 1170 } 1171 // Remove the active-filter class 1172 control.classList.remove('active-filter'); 1173 }); 1174} 1175 1176// Set up each control 1177controls.forEach(control => { 1178 // Check if .collapsible-content already exists 1179 if (!control.querySelector('.collapsible-content')) { 1180 const label = control.querySelector('label'); 1181 const controlContent = document.createElement('div'); 1182 controlContent.className = 'collapsible-content'; 1183 1184 // Move all elements except the label into the collapsible content 1185 Array.from(control.children).forEach(child => { 1186 if (child !== label) { 1187 controlContent.appendChild(child); 1188 } 1189 }); 1190 1191 // Append the collapsible content back to the control 1192 control.appendChild(controlContent); 1193 1194 // Initially hide the control content 1195 controlContent.style.display = 'none'; 1196 1197 // Event listener to toggle visibility of control content on label click 1198 label.addEventListener('click', (event) => { 1199 event.stopPropagation(); // Prevents the document click from immediately closing the control 1200 1201 // Close all other open controls 1202 controls.forEach(otherControl => { 1203 if (otherControl !== control) { 1204 const otherContent = otherControl.querySelector('.collapsible-content'); 1205 if (otherContent) { 1206 otherContent.style.display = 'none'; 1207 } 1208 otherControl.classList.remove('active-filter'); // Remove active class from other controls 1209 } 1210 }); 1211 1212 // Toggle the clicked control's visibility 1213 const isVisible = controlContent.style.display === 'block'; 1214 controlContent.style.display = isVisible ? 'none' : 'block'; 1215 1216 // Toggle the active-filter class 1217 if (!isVisible) { 1218 control.classList.add('active-filter'); 1219 } else { 1220 control.classList.remove('active-filter'); 1221 } 1222 }); 1223 } 1224 1225 // Detect clicks within the selectize-control dropdown 1226 const selectizeControl = control.querySelector('.selectize-control'); 1227 if (selectizeControl) { 1228 selectizeControl.addEventListener('click', (event) => { 1229 event.stopPropagation(); // Prevent global click listener 1230 1231 // Close all other controls except the one containing the dropdown 1232 closeAllControls(control); 1233 1234 // Ensure the active-filter class is added 1235 control.classList.add('active-filter'); 1236 1237 // Ensure collapsible content stays open 1238 collapsibleContent.style.display = 'block'; 1239 }); 1240 } 1241 1242}); 1243 1244// Global click listener to close all controls when clicking outside 1245document.addEventListener('click', (event) => { 1246 // Check if the click is outside any of the controls 1247 if (![...controls].some(control => control.contains(event.target))) { 1248 closeAllControls(); 1249 } 1250}); 1251 1252 // Function to move price and favorites 1253 function movePriceAndFavorites(container) { 1254 const listingResults = container.querySelectorAll('.mrp-listing-result'); 1255
1256 listingResults.forEach(result => { 1257 if (!result.querySelector('.price-container')) { 1258 const imageAndToolbarWrapper = result.querySelector('.listing-image-and-toolbar-wrapper'); 1259 const priceContainer = document.createElement('div'); 1260 priceContainer.className = 'price-container'; 1261 1262 const priceElement = result.querySelector('.mrp-listing-price-container'); 1263 const topMenuElement = result.querySelector('.listing-item-top-menu'); 1264 1265 if (imageAndToolbarWrapper) { 1266 imageAndToolbarWrapper.insertAdjacentElement('afterend', priceContainer); 1267 } 1268 1269 if (priceElement) { 1270 priceContainer.appendChild(priceElement); 1271 } 1272 if (topMenuElement) { 1273 priceContainer.appendChild(topMenuElement); 1274 } 1275 } 1276 }); 1277 } 1278 1279 // Function to move ribbon 1280 function moveRibbon(container) { 1281 const imageContainers = container.querySelectorAll('.mrp-listing-main-image-container'); 1282 1283 imageContainers.forEach(container => { 1284 const resultsRibbon = container.querySelector('.results-ribbon'); 1285 const innerElement = container.querySelector('.inner'); 1286 1287 if (resultsRibbon && innerElement && resultsRibbon.parentNode !== innerElement) { 1288 innerElement.appendChild(resultsRibbon); 1289 console.log('Moved results ribbon to inner element for a listing'); 1290 } 1291 }); 1292 } 1293 1294 // Apply actions to the .mrp-weblet-listings container 1295 const webletListings = document.querySelector('.mrp-weblet-listings, .mrp-weblet-listing-areas'); 1296 if (webletListings) { 1297 movePriceAndFavorites(webletListings); 1298 moveRibbon(webletListings); 1299 } 1300 1301 // Apply actions to the .mrp-idx-panel-contents container 1302 const idxPanelContents = document.querySelector('.mrp-idx-panel-contents'); 1303 if (idxPanelContents) { 1304 movePriceAndFavorites(idxPanelContents); 1305 moveRibbon(idxPanelContents); 1306 } 1307 1308 1309 // For Listings Details Pages 1310 1311 // Function to process details in a specific parent container
1312function processDetails(parentContainer) { 1313 const detailsElement = parentContainer.querySelector('.listing-details-view'); 1314 1315 if (detailsElement != null) { 1316 1317 1318 // Need to look for inline height variable for menu to align sticky sidebar top height 1319 const variableNames = ['--menu-height-fixed', '--top-bar-height-fixed']; 1320 1321 // Function to find and set the global variable within #mrp-header 1322 function findAndSetGlobalVariableInHeader(variableNames) { 1323 const root = document.documentElement; // `:root` element for global variables 1324 const header = document.querySelector('#mrp-header'); // Narrow search to #mrp-header 1325 1326 if (!header) { 1327 console.warn('Element with ID "mrp-header" not found.'); 1328 return; 1329 } 1330 1331 // Loop through the variable names 1332 for (const variableName of variableNames) { 1333 // Loop through all child elements within #mrp-header 1334 for (const element of header.querySelectorAll('*')) { 1335 const variableValue = getComputedStyle(element).getPropertyValue(variableName).trim(); 1336 1337 if (variableValue) { 1338 // If the variable is found, set it globally on `:root` 1339 root.style.setProperty(variableName, variableValue); 1340 console.log(`Set ${variableName} with value ${variableValue} globally.`); 1341 return; // Exit once a match is found 1342 } 1343 } 1344 } 1345 1346 console.warn('No matching variables were found in #mrp-header.'); 1347 } 1348 1349 // Run the function 1350 findAndSetGlobalVariableInHeader(variableNames); 1351 1352 // Find the main image with the class 'mrp-listing-main-image-container' 1353 const mainImage = detailsElement.querySelector('.mrp-listing-main-image-container'); 1354 1355 if (mainImage) { 1356 const listingDetailsContainer = detailsElement.querySelector('.mrp-details-listing-container'); 1357 const imageThumbnails = detailsElement.querySelector('.mrp-listing-photo-other'); 1358 1359 let mainImageOuter; 1360 1361 if (!detailsElement.querySelector('.main-image-outer')) { 1362 mainImageOuter = document.createElement('div'); 1363 mainImageOuter.className = 'main-image-outer'; 1364 listingDetailsContainer.prepend(mainImageOuter); 1365 1366 mainImageOuter.append(mainImage); 1367 if (imageThumbnails) { 1368 mainImageOuter.append(imageThumbnails); 1369 } 1370 } else { 1371 mainImageOuter = detailsElement.querySelector('.main-image-outer'); 1372 } 1373 1374 1375 // Observe for digitally modified photos warning (late-loaded) 1376function observeModifiedPhotosWarning() { 1377 if (!mainImageOuter) return; 1378 1379 const warningObserver = new MutationObserver(() => { 1380 const warning = detailsElement.querySelector('.has-digitally-modified-photos-warning'); 1381 1382 if (warning) { 1383 if (warning.parentNode !== mainImageOuter) { 1384 mainImageOuter.appendChild(warning); 1385 } 1386 1387 // Stop observing once moved 1388 warningObserver.disconnect(); 1389 } 1390 }); 1391 1392 warningObserver.observe(detailsElement, { 1393 childList: true, 1394 subtree: true 1395 }); 1396} 1397 1398// Run observer 1399observeModifiedPhotosWarning(); 1400 1401 1402 if (!detailsElement.querySelector('.main-listing-content')) { 1403 const mainListingContent = document.createElement('div'); 1404 mainListingContent.className = 'main-listing-content'; 1405 mainImageOuter.insertAdjacentElement('afterend', mainListingContent); 1406 1407 const listingTopContent = detailsElement.querySelector('.top-content'); 1408 const listingTabContent = detailsElement.querySelector('.mrp-listing-details-tab-content'); 1409 const largeSidebar = detailsElement.querySelector('.large-sidebar'); 1410 1411 mainListingContent.append(listingTopContent); 1412 mainListingContent.append(listingTabContent); 1413 mainListingContent.append(largeSidebar); 1414 } 1415 1416 const subInfoElement = detailsElement.querySelector('.sub-info'); 1417 const detailsTabsElement = detailsElement.querySelector('.mrp-listing-details-tabs'); 1418 1419 if (subInfoElement && detailsTabsElement) { 1420 detailsTabsElement.parentNode.insertBefore(subInfoElement, detailsTabsElement); 1421 } 1422 1423 const openHouseDetails = detailsElement.querySelector('.mrp-open-house-full-section'); 1424 if (openHouseDetails && subInfoElement) { 1425 subInfoElement.append(openHouseDetails); 1426 } 1427 1428 const detailsRibbon = detailsElement.querySelector('.mrp-listing-quick-actions .details-ribbon'); 1429 const mainImageInner = detailsElement.querySelector('.mrp-listing-main-image-container .inner'); 1430 1431 if (detailsRibbon && mainImageInner) { 1432 mainImageInner.appendChild(detailsRibbon); 1433 console.log('Moved details ribbon to inner element for a listing'); 1434 } 1435 1436 const subLocation = detailsElement.querySelector('.sub-location'); 1437 const actionRoom = detailsElement.querySelector('.mrp-listing-quick-actions .map'); 1438 1439 if (subLocation && actionRoom) { 1440 subLocation.addEventListener('click', function(event) { 1441 event.preventDefault(); 1442 actionRoom.click(); 1443 }); 1444 } 1445 1446 const priceInfo = detailsElement.querySelector('.mrp-listing-price-info');
1447 if (!detailsElement.querySelector('.calculate-mortgage-link')) { 1448 const actionMortgage = detailsElement.querySelector('.mrp-listing-quick-actions .mortgage'); 1449 const calculateMortgage = document.createElement('div'); 1450 calculateMortgage.className = 'calculate-mortgage-link'; 1451 calculateMortgage.textContent = 'Calculate Mortgage'; 1452 priceInfo.append(calculateMortgage); 1453 1454 if (priceInfo && actionMortgage) { 1455 calculateMortgage.addEventListener('click', function(event) { 1456 event.preventDefault(); 1457 actionMortgage.click(); 1458 }); 1459 } 1460 } 1461 1462 const addressInfo = detailsElement.querySelector('.mrp-listing-title'); 1463 if (!detailsElement.querySelector('.address-price-container')) { 1464 if (addressInfo && priceInfo) { 1465 const addressPriceWrapper = document.createElement('div'); 1466 addressPriceWrapper.className = 'address-price-container'; 1467 addressInfo.parentNode.insertBefore(addressPriceWrapper, addressInfo); 1468 1469 addressPriceWrapper.appendChild(addressInfo); 1470 addressPriceWrapper.appendChild(priceInfo); 1471 } 1472 } 1473 1474 const listingInfoContainer = detailsElement.querySelector('.mrp-listing-info-container'); 1475 const mainSummary = detailsElement.querySelector('.mrp-details-main-summary'); 1476 1477 if (listingInfoContainer && mainSummary) { 1478 listingInfoContainer.append(mainSummary); 1479 } 1480 1481 const areaStats = detailsElement.querySelector('.mrp-area-stats'); 1482 if (listingInfoContainer && areaStats) { 1483 listingInfoContainer.append(areaStats); 1484 } 1485 1486 if (!detailsElement.querySelector('.listing-toolbar-container')) { 1487 const listingToolbarWrapper = document.createElement('div'); 1488 listingToolbarWrapper.className = 'listing-toolbar-container'; 1489 listingDetailsContainer.parentNode.insertBefore(listingToolbarWrapper, listingDetailsContainer); 1490 1491 const listingActions = detailsElement.querySelector('.mrp-listing-quick-actions'); 1492 const listingLogin = detailsElement.querySelector('.mrp-details-vow-toolbar-wrapper'); 1493 1494 if (listingActions) { 1495 listingToolbarWrapper.appendChild(listingActions); 1496 } 1497 if (listingLogin) { 1498 listingToolbarWrapper.appendChild(listingLogin); 1499 } 1500 } 1501 1502 // Function to update the favorite-listing-true class based on the presence of the target class 1503 function updateFavoriteClass() { 1504 const favElement = document.querySelector('.mrp-vow-listing-toolbar-container .mrp-vow-listing-is-fav'); 1505 const listingContent = document.querySelector('.mrp-listing-content'); 1506 1507 if (listingContent) { 1508 if (favElement) { 1509 // Add the favorite-listing-true class if the target class exists 1510 listingContent.classList.add('favorite-listing-true'); 1511 } else { 1512 // Remove the favorite-listing-true class if the target class is removed 1513 listingContent.classList.remove('favorite-listing-true'); 1514 } 1515 } 1516 } 1517 1518 // Move Fav and Category container 1519 1520 const vowFavContainer = detailsElement.querySelector('.mrp-vow-listing-toolbar-container'); 1521 const listingToolbarWrapper = detailsElement.querySelector('.listing-toolbar-container'); 1522 1523 if (vowFavContainer && listingToolbarWrapper) { 1524 listingToolbarWrapper.parentNode.insertBefore(vowFavContainer, listingToolbarWrapper.nextSibling); 1525 } 1526 1527 // Set up a MutationObserver to monitor changes in the target element's parent container 1528 const toolbarContainer = document.querySelector('.mrp-vow-listing-toolbar-container'); 1529 1530 if (toolbarContainer) { 1531 const observer = new MutationObserver(() => { 1532 // Update the favorite-listing-true class whenever mutations are detected 1533 updateFavoriteClass(); 1534 }); 1535 1536 // Observe child list changes and attribute modifications 1537 observer.observe(toolbarContainer, { 1538 childList: true, // Detect when children are added or removed 1539 attributes: true, // Detect attribute changes 1540 subtree: true // Include all descendants in the observation 1541 }); 1542 1543 // Perform an initial check 1544 updateFavoriteClass(); 1545 } 1546 1547 1548 // Check and set up the side form 1549 1550 function setupContactForm() { 1551 const formParent = document.querySelector(".large-sidebar .listing-inquiry-form"); 1552 if (!formParent) return; // Ensure the form is present before proceeding 1553 1554 // Add placeholders to form 1555 const inputName = formParent.querySelector(".mrp-listing-inquiry-name input"); 1556 if (inputName) inputName.setAttribute("placeholder", "Your name *"); 1557 1558 const inputEmail = formParent.querySelector(".mrp-listing-inquiry-email input"); 1559 if (inputEmail) inputEmail.setAttribute("placeholder", "Your email *"); 1560 1561 const inputPhone = formParent.querySelector(".mrp-listing-inquiry-phone-number input"); 1562 if (inputPhone) inputPhone.setAttribute("placeholder", "Your phone # *"); 1563 1564 const inputSubject = formParent.querySelector(".mrp-listing-inquiry-subject input"); 1565 if (inputSubject) inputSubject.setAttribute("placeholder", "Subject"); 1566 1567 const inputMessage = formParent.querySelector(".mrp-listing-inquiry-text textarea"); 1568 if (inputMessage) inputMessage.setAttribute("placeholder", "Message"); 1569 1570 // Add highlight div to labels in viewing-type 1571 const labels = formParent.querySelectorAll(".viewing-type label:not([data-processed])");
1572 labels.forEach(label => { 1573 const highlightDiv = document.createElement("div"); 1574 highlightDiv.className = "viewing-type-highlight"; 1575 label.appendChild(highlightDiv); 1576 label.setAttribute("data-processed", "true"); 1577 }); 1578 1579 // Modify suggested-dates if present 1580 const suggestedDates = formParent.querySelector(".suggested-dates"); 1581 if (!suggestedDates || suggestedDates.parentElement.classList.contains("suggested-dates-wrapper")) return; 1582 1583 const wrapper = document.createElement("div"); 1584 wrapper.classList.add("suggested-dates-wrapper"); 1585 1586 const prevButton = document.createElement("div"); 1587 prevButton.classList.add("scroll-btn", "cal-prev"); 1588 prevButton.innerHTML = "<"; 1589 1590 const nextButton = document.createElement("div"); 1591 nextButton.classList.add("scroll-btn", "cal-next"); 1592 nextButton.innerHTML = ">"; 1593 1594 const navMessage = document.createElement("div"); 1595 navMessage.classList.add("cal-nav-message"); 1596 navMessage.innerHTML = "Change Dates"; 1597 1598 const navContainer = document.createElement("div"); 1599 navContainer.classList.add("cal-nav-container"); 1600 1601 suggestedDates.parentNode.insertBefore(wrapper, suggestedDates); 1602 wrapper.appendChild(suggestedDates); 1603 wrapper.appendChild(navContainer); 1604 navContainer.appendChild(prevButton); 1605 navContainer.appendChild(navMessage); 1606 navContainer.appendChild(nextButton); 1607 1608 // Apply scrolling functionality 1609 const scrollAmount = 150; 1610 prevButton.addEventListener("click", () => suggestedDates.scrollBy({ left: -scrollAmount, behavior: "smooth" })); 1611 nextButton.addEventListener("click", () => suggestedDates.scrollBy({ left: scrollAmount, behavior: "smooth" })); 1612 1613 // Swipe functionality 1614 let startX; 1615 suggestedDates.addEventListener("touchstart", (e) => startX = e.touches[0].clientX); 1616 suggestedDates.addEventListener("touchmove", (e) => { 1617 if (!startX) return; 1618 const deltaX = startX - e.touches[0].clientX; 1619 if (Math.abs(deltaX) > 50) { 1620 suggestedDates.scrollBy({ left: deltaX > 0 ? scrollAmount : -scrollAmount, behavior: "smooth" }); 1621 startX = null; 1622 } 1623 }); 1624 } 1625 1626 // Observe for the form to appear 1627 const observer = new MutationObserver((mutations, obs) => { 1628 if (document.querySelector(".large-sidebar .listing-inquiry-form")) { 1629 setupContactForm(); 1630 obs.disconnect(); // Stop observing once form is found and processed 1631 } 1632 }); 1633 1634 observer.observe(document.body, { childList: true, subtree: true }); 1635 1636 1637 } 1638 } 1639 } 1640 1641// Run the function for each container 1642const detailsWebletListings = document.querySelector('.listings-refresh'); 1643const detailsIdxPanelContents = document.querySelector('.mrp-idx-listing-details'); 1644 1645if (detailsWebletListings) {
1646 processDetails(detailsWebletListings); 1647} 1648 1649if (detailsIdxPanelContents) { 1650 processDetails(detailsIdxPanelContents); 1651} 1652 1653 } 1654 } // End Move 1655 1656 1657 1658 // Function to observe the listings container 1659 function observeListingsContainer() { 1660 const listingsContainer = document.querySelector('body'); 1661 1662 if (listingsContainer) { 1663 const observer = new MutationObserver((mutationsList, observer) => { 1664 // Disconnect observer temporarily 1665 observer.disconnect(); 1666 1667 // Run the move elements function when changes are detected 1668 moveElements(); 1669 1670 // Reconnect after a small delay 1671 setTimeout(() => { 1672 observer.observe(listingsContainer, { childList: true, subtree: true }); 1673 }, 50); // Adds a small delay to prevent excessive callback 1674 }); 1675 1676 // Start observing for changes 1677 observer.observe(listingsContainer, { childList: true, subtree: true }); 1678 1679 // Run initially in case content is already loaded 1680 moveElements(); 1681 } 1682 } 1683 1684 // Initialize observation 1685 observeListingsContainer(); 1686 1687 1688})(); 1689 1690/* ==== INCLUDE: /js/blocks/brand-footer.js ==== */ 1691 1692;(function () { 1693 1694 function hideDelete() { 1695 const deleteElements = document.querySelectorAll('.myrealpage-footer [data-command="delete"]'); 1696 1697 deleteElements.forEach(function (element) { 1698 element.style.display = 'none'; 1699 }); 1700 1701 // const moveupElements = document.querySelectorAll('.myrealpage-footer [data-command="moveup"]'); 1702 // 1703 // moveupElements.forEach(function (element) { 1704 // element.style.display = 'none'; 1705 // }); 1706 // 1707 // const movedownElements = document.querySelectorAll('.myrealpage-footer [data-command="movedown"]'); 1708 // 1709 // movedownElements.forEach(function (element) { 1710 // element.style.display = 'none'; 1711 // }); 1712 1713 const cloneElements = document.querySelectorAll('.myrealpage-footer [data-command="clone"]'); 1714 1715 cloneElements.forEach(function (element) { 1716 element.style.display = 'none'; 1717 }); 1718 } 1719 1720 function addRef() { 1721 const links = document.querySelectorAll( ".myrealpage-footer a[href=\"https://myrealpage.com/\"]" ); 1722 const hostname = window.location.hostname; 1723 links.forEach( link => { 1724 link.setAttribute( "href", "https://myrealpage.com/?ref=" + encodeURIComponent(hostname)); 1725 }) 1726 } 1727 1728 document.addEventListener('DOMContentLoaded', function () { 1729 hideDelete(); 1730 addRef(); 1731 }); 1732})();
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.