var disqus_shortname = countVars.disqusShortname; (function () { var nodes = document.getElementsByTagName('span'); for (var i = 0, url; i < nodes.length; i++) { if (nodes[i].className.indexOf('dsq-postid') != -1 && nodes[i].parentNode.tagName == 'A') { nodes[i].parentNode.setAttribute('data-disqus-identifier', nodes[i].getAttribute('data-dsqidentifier')); url = nodes[i].parentNode.href.split('#', 1); if (url.length == 1) { url = url[0]; } else { url = url[1]; } nodes[i].parentNode.href = url + '#disqus_thread'; } } var s = document.createElement('script'); s.async = true; s.type = 'text/javascript'; s.src = 'https://' + disqus_shortname + '.disqus.com/count.js'; (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s); }()); ; var disqus_url = embedVars.disqusUrl; var disqus_identifier = embedVars.disqusIdentifier; var disqus_container_id = 'disqus_thread'; var disqus_shortname = embedVars.disqusShortname; var disqus_title = embedVars.disqusTitle; var disqus_config_custom = window.disqus_config; var disqus_config = function () { /* All currently supported events: onReady: fires when everything is ready, onNewComment: fires when a new comment is posted, onIdentify: fires when user is authenticated */ var dsqConfig = embedVars.disqusConfig; this.page.integration = dsqConfig.integration; this.page.remote_auth_s3 = dsqConfig.remote_auth_s3; this.page.api_key = dsqConfig.api_key; this.sso = dsqConfig.sso; this.language = dsqConfig.language; if (disqus_config_custom) disqus_config_custom.call(this); }; (function() { // Adds the disqus_thread id to the comment section if site is using a WP block theme var commentsBlock = document.querySelector('.wp-block-comments'); if (commentsBlock) { commentsBlock.id = 'disqus_thread'; } if (document.getElementById(disqus_container_id)) { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; dsq.src = 'https://' + disqus_shortname + '.disqus.com/embed.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); } else { console.error("Could not find 'disqus_thread' container to load DISQUS. This is usually the result of a WordPress theme conflicting with the DISQUS plugin. Try switching your site to a Classic Theme, or contact DISQUS support for help."); } })(); ; !function(a,b){var c=function(a,b,c){"use strict";var d,e;if(function(){var b,c={lazyClass:"lazyload",loadedClass:"lazyloaded",loadingClass:"lazyloading",preloadClass:"lazypreload",errorClass:"lazyerror",autosizesClass:"lazyautosizes",srcAttr:"data-src",srcsetAttr:"data-srcset",sizesAttr:"data-sizes",minSize:40,customMedia:{},init:!0,expFactor:1.5,hFac:.8,loadMode:2,loadHidden:!0,ricTimeout:0,throttleDelay:125};e=a.lazySizesConfig||a.lazysizesConfig||{};for(b in c)b in e||(e[b]=c[b])}(),!b||!b.getElementsByClassName)return{init:function(){},cfg:e,noSupport:!0};var f=b.documentElement,g=a.HTMLPictureElement,h=a.addEventListener.bind(a),i=a.setTimeout,j=a.requestAnimationFrame||i,k=a.requestIdleCallback,l=/^picture$/i,m=["load","error","lazyincluded","_lazyloaded"],n={},o=Array.prototype.forEach,p=function(a,b){return n[b]||(n[b]=new RegExp("(\\s|^)"+b+"(\\s|$)")),n[b].test(a.getAttribute("class")||"")&&n[b]},q=function(a,b){p(a,b)||a.setAttribute("class",(a.getAttribute("class")||"").trim()+" "+b)},r=function(a,b){var c;(c=p(a,b))&&a.setAttribute("class",(a.getAttribute("class")||"").replace(c," "))},s=function(a,b,c){var d=c?"addEventListener":"removeEventListener";c&&s(a,b),m.forEach(function(c){a[d](c,b)})},t=function(a,c,e,f,g){var h=b.createEvent("Event");return e||(e={}),e.instance=d,h.initEvent(c,!f,!g),h.detail=e,a.dispatchEvent(h),h},u=function(b,c){var d;!g&&(d=a.picturefill||e.pf)?(c&&c.src&&!b.getAttribute("srcset")&&b.setAttribute("srcset",c.src),d({reevaluate:!0,elements:[b]})):c&&c.src&&(b.src=c.src)},v=function(a,b){return(getComputedStyle(a,null)||{})[b]},w=function(a,b,c){for(c=c||a.offsetWidth;c49?function(){k(h,{timeout:g}),g!==e.ricTimeout&&(g=e.ricTimeout)}:y(function(){i(h)},!0);return function(a){var e;(a=!0===a)&&(g=33),b||(b=!0,e=f-(c.now()-d),e<0&&(e=0),a||e<9?j():i(j,e))}},A=function(a){var b,d,e=function(){b=null,a()},f=function(){var a=c.now()-d;a<99?i(f,99-a):(k||e)(e)};return function(){d=c.now(),b||(b=i(f,99))}},B=function(){var g,k,m,n,w,B,D,E,F,G,H,I,J=/^img$/i,K=/^iframe$/i,L="onscroll"in a&&!/(gle|ing)bot/.test(navigator.userAgent),M=0,N=0,O=-1,P=function(a){N--,(!a||N<0||!a.target)&&(N=0)},Q=function(a){return null==I&&(I="hidden"==v(b.body,"visibility")),I||!("hidden"==v(a.parentNode,"visibility")&&"hidden"==v(a,"visibility"))},R=function(a,c){var d,e=a,g=Q(a);for(E-=c,H+=c,F-=c,G+=c;g&&(e=e.offsetParent)&&e!=b.body&&e!=f;)(g=(v(e,"opacity")||1)>0)&&"visible"!=v(e,"overflow")&&(d=e.getBoundingClientRect(),g=G>d.left&&Fd.top-1&&E500&&f.clientWidth>500?500:370:e.expand,d._defEx=q,r=q*e.expFactor,s=e.hFac,I=null,M2&&n>2&&!b.hidden?(M=r,O=0):M=n>1&&O>1&&N<6?q:0),p!==l&&(B=innerWidth+l*s,D=innerHeight+l,m=-1*l,p=l),h=t[c].getBoundingClientRect(),(H=h.bottom)>=m&&(E=h.top)<=D&&(G=h.right)>=m*s&&(F=h.left)<=B&&(H||G||F||E)&&(e.loadHidden||Q(t[c]))&&(k&&N<3&&!o&&(n<3||O<4)||R(t[c],l))){if($(t[c]),j=!0,N>9)break}else!j&&k&&!i&&N<4&&O<4&&n>2&&(g[0]||e.preloadAfterLoad)&&(g[0]||!o&&(H||G||F||E||"auto"!=t[c].getAttribute(e.sizesAttr)))&&(i=g[0]||t[c]);i&&!j&&$(i)}},T=z(S),U=function(a){var b=a.target;if(b._lazyCache)return void delete b._lazyCache;P(a),q(b,e.loadedClass),r(b,e.loadingClass),s(b,W),t(b,"lazyloaded")},V=y(U),W=function(a){V({target:a.target})},X=function(a,b){try{a.contentWindow.location.replace(b)}catch(c){a.src=b}},Y=function(a){var b,c=a.getAttribute(e.srcsetAttr);(b=e.customMedia[a.getAttribute("data-media")||a.getAttribute("media")])&&a.setAttribute("media",b),c&&a.setAttribute("srcset",c)},Z=y(function(a,b,c,d,f){var g,h,j,k,n,p;(n=t(a,"lazybeforeunveil",b)).defaultPrevented||(d&&(c?q(a,e.autosizesClass):a.setAttribute("sizes",d)),h=a.getAttribute(e.srcsetAttr),g=a.getAttribute(e.srcAttr),f&&(j=a.parentNode,k=j&&l.test(j.nodeName||"")),p=b.firesLoad||"src"in a&&(h||g||k),n={target:a},q(a,e.loadingClass),p&&(clearTimeout(m),m=i(P,2500),s(a,W,!0)),k&&o.call(j.getElementsByTagName("source"),Y),h?a.setAttribute("srcset",h):g&&!k&&(K.test(a.nodeName)?X(a,g):a.src=g),f&&(h||k)&&u(a,{src:g})),a._lazyRace&&delete a._lazyRace,r(a,e.lazyClass),x(function(){var b=a.complete&&a.naturalWidth>1;p&&!b||(b&&q(a,"ls-is-cached"),U(n),a._lazyCache=!0,i(function(){"_lazyCache"in a&&delete a._lazyCache},9)),"lazy"==a.loading&&N--},!0)}),$=function(a){if(!a._lazyRace){var b,c=J.test(a.nodeName),d=c&&(a.getAttribute(e.sizesAttr)||a.getAttribute("sizes")),f="auto"==d;(!f&&k||!c||!a.getAttribute("src")&&!a.srcset||a.complete||p(a,e.errorClass)||!p(a,e.lazyClass))&&(b=t(a,"lazyunveilread").detail,f&&C.updateElem(a,!0,a.offsetWidth),a._lazyRace=!0,N++,Z(a,b,f,d,c))}},_=A(function(){e.loadMode=3,T()}),aa=function(){3==e.loadMode&&(e.loadMode=2),_()},ba=function(){if(!k){if(c.now()-w<999)return void i(ba,999);k=!0,e.loadMode=3,T(),h("scroll",aa,!0)}};return{_:function(){w=c.now(),d.elements=b.getElementsByClassName(e.lazyClass),g=b.getElementsByClassName(e.lazyClass+" "+e.preloadClass),h("scroll",T,!0),h("resize",T,!0),h("pageshow",function(a){if(a.persisted){var c=b.querySelectorAll("."+e.loadingClass);c.length&&c.forEach&&j(function(){c.forEach(function(a){a.complete&&$(a)})})}}),a.MutationObserver?new MutationObserver(T).observe(f,{childList:!0,subtree:!0,attributes:!0}):(f.addEventListener("DOMNodeInserted",T,!0),f.addEventListener("DOMAttrModified",T,!0),setInterval(T,999)),h("hashchange",T,!0),["focus","mouseover","click","load","transitionend","animationend"].forEach(function(a){b.addEventListener(a,T,!0)}),/d$|^c/.test(b.readyState)?ba():(h("load",ba),b.addEventListener("DOMContentLoaded",T),i(ba,2e4)),d.elements.length?(S(),x._lsFlush()):T()},checkElems:T,unveil:$,_aLSL:aa}}(),C=function(){var a,c=y(function(a,b,c,d){var e,f,g;if(a._lazysizesWidth=d,d+="px",a.setAttribute("sizes",d),l.test(b.nodeName||""))for(e=b.getElementsByTagName("source"),f=0,g=e.length;f 0) { setSidebarThumbnailsOffset(currentSidebarCollectionOffset-1); } }); $('.g1-gallery-thumbnails-down').on('click', function(){ if (currentSidebarCollectionOffset < maxSidebarCollectionOffset) { setSidebarThumbnailsOffset(currentSidebarCollectionOffset+1); } }); }; var hideThumbnailsIfTooSmall = function() { $('.g1-gallery-thumbnails').show(); if($('.g1-gallery-thumbnails').height() < 200){ $('.g1-gallery-thumbnails').hide(); } }; var handleNextFrame = function() { if (currentIndex === galleryLength - 1){ return; } switchToIndex(currentIndex + 1); }; var handlePrevFrame = function () { if (currentIndex === 0){ return; } switchToIndex(currentIndex - 1); }; var switchToIndex = function(index, delay){ var item = items[index]; currentIndex = index; updateImageIndex(); $('.g1-gallery-frame-visible').removeClass('g1-gallery-frame-visible'); $('.g1-gallery-wrapper').removeClass('g1-gallery-ad-mode'); if (item.type === 'image') { $('.g1-gallery-thumbnail').removeClass('g1-gallery-thumbnail-active'); $('.g1-gallery-thumbnail-' + currentIndex).addClass('g1-gallery-thumbnail-active'); $('.g1-gallery-frame-' + currentIndex).addClass('g1-gallery-frame-visible'); $('.g1-gallery-wrapper').removeClass('g1-gallery-thumbnails-mode'); $('.g1-gallery-numerator-current').html(currentImageIndex); var imageUrl = $('.g1-gallery-frame-visible').attr('data-g1-share-image'); // Check why calling setupShares() affects slide switching speed. if (delay) { setTimeout(function() { setupShares(imageUrl); }, 500); } else { setupShares(imageUrl); } // set up sidebar thumbs. var row = Math.ceil((currentIndex - 1)/3); var newOffset = row - 1; if (newOffset > maxSidebarCollectionOffset){ newOffset = maxSidebarCollectionOffset; } if (newOffset < 0 ){ newOffset = 0; } setSidebarThumbnailsOffset(newOffset); } if (item.type === 'ad') { var $adFrame = $('.g1-gallery-frame-ad-' + index); $('.g1-gallery-frame-' + currentIndex).removeClass('g1-gallery-frame-visible'); $('.g1-gallery-thumbnail').removeClass('g1-gallery-thumbnail-active'); $adFrame.addClass('g1-gallery-frame-visible'); $('.g1-gallery-wrapper').addClass('g1-gallery-ad-mode'); // Ad not loaded? if ($adFrame.find('.g1-gallery-ad:not(.g1-ad-loaded)').length > 0) { $adFrame.find('.g1-gallery-ad').append(items[index].html).addClass('g1-ad-loaded'); } } }; var updateImageIndex = function() { currentImageIndex = 0; for (var index in items) { if (items[index].type === 'image') { currentImageIndex++; } if (index == currentIndex) { break; } } }; var setupShares = function(imageUrl) { var shareHtml = sharesTemplate; shareHtml = shareHtml.replace(new RegExp(/mace_replace_shortlink/g), encodeURIComponent(ShareUrl)); shareHtml = shareHtml.replace(new RegExp(/mace_replace_title/g), encodeURIComponent(galleryTitle)); shareHtml = shareHtml.replace(new RegExp(/mace_replace_image_url/g), encodeURIComponent(imageUrl)); shareHtml = shareHtml.replace(new RegExp(/mace_replace_noesc_shortlink/g), ShareUrl); shareHtml = shareHtml.replace(new RegExp(/mace_replace_noesc_title/g), galleryTitle); shareHtml = shareHtml.replace(new RegExp(/mace_replace_noesc_image_url/g), imageUrl); shareHtml = shareHtml.replace(new RegExp(/mace_replace_unique/g), Math.random().toString(36).substr(2, 16)); $('.g1-gallery-shares').html(shareHtml); // Remove this one as it forces entire FB SDK to reload! jQuery('body').trigger('maceGalleryItemChanged'); }; var setSidebarThumbnailsOffset = function(offset){ $('.g1-gallery-sidebar .g1-gallery-thumbnail').css('top', offset * - 108); currentSidebarCollectionOffset = offset; }; var captureLightbox = function() { var frames = buildFrames(); var thumbnails = buildThumbnails('thumbnail'); var thumbnails32 = buildThumbnails('3-2-thumbnail'); var numerator = buildNumerator(); var title = galleryTitle; html = html.replace( '{frames}', frames); html = html.replace( '{thumbnails}', thumbnails); html = html.replace( '{thumbnails32}', thumbnails32); html = html.replace( '{numerator}', numerator); html = html.replace( '{title}', title); }; var buildStyle = function() { var out = '