/* Do not modify this file directly. It is compiled from other files. */ /** The MIT License Copyright (c) 2010 Daniel Park (http://metaweb.com, http://postmessage.freebaseapps.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **/ var NO_JQUERY={};!function(e,a,s){if(!("console"in e)){var t=e.console={};t.log=t.warn=t.error=t.debug=function(){}}a===NO_JQUERY&&(a={fn:{},extend:function(){for(var e=arguments[0],a=1,s=arguments.length;a-1)&&jetpackIsScrolledIntoView(this)){jetpackLikesWidgetBatch.push(this.id);var t,i=/like-(post|comment)-wrapper-(\d+)-(\d+)-(\w+)/.exec(this.id);i&&5===i.length&&(t={blog_id:i[2],width:this.width},"post"===i[1]?t.post_id=i[3]:"comment"===i[1]&&(t.comment_id=i[3]),t.obj_id=i[4],e.push(t))}}),e.length>0&&JetpackLikesPostMessage({event:"initialBatch",requests:e},window.frames["likes-master"])}function JetpackLikesMessageListener(e,t){var i,a,s,d,o,r;if(void 0!==e.event&&("https://widgets.wp.com","https://widgets.wp.com"===t.origin))switch(e.event){case"masterReady":jQuery(document).ready(function(){jetpackLikesMasterReady=!0;var e={event:"injectStyles"},t=jQuery(".sd-text-color"),i=jQuery(".sd-link-color");jQuery("iframe.admin-bar-likes-widget").length>0&&(JetpackLikesPostMessage({event:"adminBarEnabled"},window.frames["likes-master"]),e.adminBarStyles={background:jQuery("#wpadminbar .quicklinks li#wp-admin-bar-wpl-like > a").css("background"),isRtl:"rtl"===jQuery("#wpadminbar").css("direction")}),window.addEventListener||jQuery("#wp-admin-bar-admin-bar-likes-widget").hide(),e.textStyles={color:t.css("color"),fontFamily:t.css("font-family"),fontSize:t.css("font-size"),direction:t.css("direction"),fontWeight:t.css("font-weight"),fontStyle:t.css("font-style"),textDecoration:t.css("text-decoration")},e.linkStyles={color:i.css("color"),fontFamily:i.css("font-family"),fontSize:i.css("font-size"),textDecoration:i.css("text-decoration"),fontWeight:i.css("font-weight"),fontStyle:i.css("font-style")},JetpackLikesPostMessage(e,window.frames["likes-master"]),JetpackLikesBatchHandler()});break;case"showLikeWidget":case"showCommentLikeWidget":jQuery("#"+e.id+" .likes-widget-placeholder").fadeOut("fast");break;case"killCommentLikes":jQuery(".jetpack-comment-likes-widget-wrapper").remove();break;case"clickReblogFlair":wpcom_reblog.toggle_reblog_box_flair(e.obj_id);break;case"showOtherGravatars":i=jQuery("#likes-other-gravatars"),a=i.find("ul"),i.hide(),a.html(""),i.find(".likes-text span").text(e.total),jQuery.each(e.likers,function(e,t){var i;"http"===t.profile_URL.substr(0,4)&&((i=jQuery("
  • ")).addClass(t.css_class),i.find("a").attr({href:t.profile_URL,rel:"nofollow",target:"_parent"}).addClass("wpl-liker"),i.find("img").attr({src:t.avatar_URL,alt:t.name}).css({width:"30px",height:"30px",paddingRight:"3px"}),a.append(i))}),s=jQuery("body").find("[name='"+e.parent+"']").offset(),i.css("left",s.left+e.position.left-10+"px"),i.css("top",s.top+e.position.top-33+"px"),d=Math.floor(e.width/37),(o=37*Math.ceil(e.likers.length/d)+13)>204&&(o=204),i.css("height",o+"px"),i.css("width",37*d-7+"px"),a.css("width",37*d+"px"),i.fadeIn("slow"),(r=a[0].offsetWidth-a[0].clientWidth)>0&&(i.width(i.width()+r),a.width(a.width()+r))}}function JetpackLikesWidgetQueueHandler(){var e;if(jetpackLikesMasterReady){jetpackUnloadScrolledOutWidgets();var t=jetpackGetUnloadedWidgetsInView();t.length>0&&JetpackLikesBatchHandler();for(var i=0,a=t.length;i<=a-1;i++)(e=t[i].id)&&jetpackLoadLikeWidgetIframe(e)}else setTimeout(JetpackLikesWidgetQueueHandler,500)}function jetpackLoadLikeWidgetIframe(e){var t;if(void 0!==e){(t=jQuery("#"+e)).find("iframe").remove();var i=t.find(".likes-widget-placeholder");if(i.hasClass("post-likes-widget-placeholder")){var a=document.createElement("iframe");a.classList.add("post-likes-widget","jetpack-likes-widget"),a.name=t.data("name"),a.src=t.data("src"),a.height="55px",a.width="100%",a.frameBorder="0",a.scrolling="no",a.title=t.data("title"),t.hasClass("slim-likes-widget")&&(a.height="22px",a.width="68px",a.scrolling="no"),i.after(a)}if(i.hasClass("comment-likes-widget-placeholder")){var s=document.createElement("iframe");s.class="comment-likes-widget-frame jetpack-likes-widget-frame",s.name=t.data("name"),s.src=t.data("src"),s.height="18px",s.width="100%",s.frameBorder="0",s.scrolling="no",t.find(".comment-like-feedback").after(s),jetpackCommentLikesLoadedWidgets.push(s)}t.removeClass("jetpack-likes-widget-unloaded").addClass("jetpack-likes-widget-loading"),t.find("iframe").load(function(e){var i=jQuery(e.target);JetpackLikesPostMessage({event:"loadLikeWidget",name:i.attr("name"),width:i.width()},window.frames["likes-master"]),t.removeClass("jetpack-likes-widget-loading").addClass("jetpack-likes-widget-loaded"),t.hasClass("slim-likes-widget")&&t.find("iframe").Jetpack("resizeable")})}}function jetpackGetUnloadedWidgetsInView(){return jQuery("div.jetpack-likes-widget-unloaded").filter(function(){return jetpackIsScrolledIntoView(this)})}function jetpackIsScrolledIntoView(e){var t=e.getBoundingClientRect().top,i=e.getBoundingClientRect().bottom;return t+jetpackLikesLookAhead>=0&&i<=window.innerHeight+jetpackLikesLookAhead}function jetpackUnloadScrolledOutWidgets(){for(var e=jetpackCommentLikesLoadedWidgets.length-1;e>=0;e--){var t=jetpackCommentLikesLoadedWidgets[e];if(!jetpackIsScrolledIntoView(t)){var i=jQuery(t).parent().parent();i.removeClass("jetpack-likes-widget-loaded jetpack-likes-widget-loading").addClass("jetpack-likes-widget-unloaded"),i.children(".comment-likes-widget-placeholder").fadeIn(),jetpackCommentLikesLoadedWidgets.splice(e,1),jQuery(t).remove()}}}pm.bind("likesMessage",JetpackLikesMessageListener),jQuery(document).click(function(e){var t=jQuery("#likes-other-gravatars");0===t.has(e.target).length&&t.fadeOut("slow")});var jetpackWidgetsDelayedExec=function(e,t){var i;return function(){i&&clearTimeout(i),i=setTimeout(t,e)}},jetpackOnScrollStopped=jetpackWidgetsDelayedExec(250,JetpackLikesWidgetQueueHandler);JetpackLikesWidgetQueueHandler(),window.addEventListener("scroll",jetpackOnScrollStopped,!0);; /*! This file is auto-generated */ !function(c,d){"use strict";var e=!1,n=!1;if(d.querySelector)if(c.addEventListener)e=!0;if(c.wp=c.wp||{},!c.wp.receiveEmbedMessage)if(c.wp.receiveEmbedMessage=function(e){var t=e.data;if(t)if(t.secret||t.message||t.value)if(!/[^a-zA-Z0-9]/.test(t.secret)){for(var r,a,i,s=d.querySelectorAll('iframe[data-secret="'+t.secret+'"]'),n=d.querySelectorAll('blockquote[data-secret="'+t.secret+'"]'),o=0;o1?1:p)*s;if(t.scrollTop=l+m,d<=i+n&&a)return requestAnimationFrame(e);r&&r(),o&&(o.style.minHeight=""),a=!1,t.removeEventListener("wheel",c)}()},getJSONAttribute:function(e,t){if(e&&e.hasAttribute(t))try{return JSON.parse(e.getAttribute(t))}catch(e){return}},convertToPlainText:function(e){var t=document.createElement("div");return t.textContent=e,t.innerHTML},stripHTML:function(e){return e.replace(/<[^>]*>?/gm,"")},emitEvent:function(e,t,r){var o;try{o=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r||null})}catch(e){(o=document.createEvent("CustomEvent")).initCustomEvent(t,!0,!0,r||null)}e.dispatchEvent(o)},isTouch:function(){return"ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch}}}();function o(){var o,a,i,n,l="",s=!1,c="div.gallery, div.tiled-gallery, ul.wp-block-gallery, ul.blocks-gallery-grid, figure.blocks-gallery-grid, div.wp-block-jetpack-tiled-gallery, a.single-image-gallery",u=".gallery-item, .tiled-gallery-item, .blocks-gallery-item, .tiled-gallery__item, .wp-block-image",d={},p="undefined"!=typeof wpcom&&wpcom.carousel&&wpcom.carousel.stat?wpcom.carousel.stat:t.noop,m="undefined"!=typeof wpcom&&wpcom.carousel&&wpcom.carousel.pageview?wpcom.carousel.pageview:t.noop;function g(t){if(!s)switch(t.which){case 38:t.preventDefault(),d.overlay.scrollTop-=100;break;case 40:t.preventDefault(),d.overlay.scrollTop+=100;break;case 39:t.preventDefault(),e.slideNext();break;case 37:case 8:t.preventDefault(),e.slidePrev();break;case 27:t.preventDefault(),S()}}function h(){s=!0}function f(){s=!1}function v(){d.overlay||(d.overlay=document.querySelector(".jp-carousel-overlay"),d.container=d.overlay.querySelector(".jp-carousel-wrap"),d.gallery=d.container.querySelector(".jp-carousel"),d.info=d.overlay.querySelector(".jp-carousel-info"),d.caption=d.info.querySelector(".jp-carousel-caption"),d.commentField=d.overlay.querySelector("#jp-carousel-comment-form-comment-field"),d.emailField=d.overlay.querySelector("#jp-carousel-comment-form-email-field"),d.authorField=d.overlay.querySelector("#jp-carousel-comment-form-author-field"),d.urlField=d.overlay.querySelector("#jp-carousel-comment-form-url-field"),110,window.innerWidth<=760&&Math.round(window.innerWidth/760*110)<40&&r.isTouch()&&0,[d.commentField,d.emailField,d.authorField,d.urlField].forEach(function(e){e&&(e.addEventListener("focus",h),e.addEventListener("blur",f))}),d.overlay.addEventListener("click",function(e){var t,o,a=e.target,i=!!r.closest(a,".jp-carousel-close-hint"),n=!!window.matchMedia("(max-device-width: 760px)").matches;if(a===d.overlay){if(n)return;S()}else if(i)S();else if(a.classList.contains("jp-carousel-image-download"))p("download_original_click");else if(a.classList.contains("jp-carousel-comment-login"))t=d.currentSlide,o=t?t.attrs.attachmentId:"0",window.location.href=jetpackCarouselStrings.login_url+"%23jp-carousel-"+o;else if(r.closest(a,"#jp-carousel-comment-form-container"))!function(e){var t=e.target,o=r.getJSONAttribute(d.container,"data-carousel-extra")||{},a=d.currentSlide.attrs.attachmentId,i=document.querySelector("#jp-carousel-comment-form-submit-and-info-wrapper"),n=document.querySelector("#jp-carousel-comment-form-spinner"),l=document.querySelector("#jp-carousel-comment-form-button-submit"),s=document.querySelector("#jp-carousel-comment-form");if(d.commentField&&d.commentField.getAttribute("id")===t.getAttribute("id"))h(),r.show(i);else if(r.matches(t,'input[type="submit"]')){e.preventDefault(),e.stopPropagation(),r.show(n),s.classList.add("jp-carousel-is-disabled");var c={action:"post_attachment_comment",nonce:jetpackCarouselStrings.nonce,blog_id:o.blog_id,id:a,comment:d.commentField.value};if(!c.comment.length)return void y(jetpackCarouselStrings.no_comment_text,!1);if(1!==Number(jetpackCarouselStrings.is_logged_in)&&(c.email=d.emailField.value,c.author=d.authorField.value,c.url=d.urlField.value,1===Number(jetpackCarouselStrings.require_name_email))){if(!c.email.length||!c.email.match("@"))return void y(jetpackCarouselStrings.no_comment_email,!1);if(!c.author.length)return void y(jetpackCarouselStrings.no_comment_author,!1)}var u=new XMLHttpRequest;u.open("POST",jetpackCarouselStrings.ajaxurl,!0),u.setRequestHeader("X-Requested-With","XMLHttpRequest"),u.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),u.onreadystatechange=function(){if(this.readyState===XMLHttpRequest.DONE&&this.status>=200&&this.status<300){var e;try{e=JSON.parse(this.response)}catch(e){return void y(jetpackCarouselStrings.comment_post_error,!1)}"approved"===e.comment_status?y(jetpackCarouselStrings.comment_approved,!0):"unapproved"===e.comment_status?y(jetpackCarouselStrings.comment_unapproved,!0):y(jetpackCarouselStrings.comment_post_error,!1),A(),q(a),l.value=jetpackCarouselStrings.post_comment,r.hide(n),s.classList.remove("jp-carousel-is-disabled")}else y(jetpackCarouselStrings.comment_post_error,!1)};var p=[];for(var m in c)if(m){var g=encodeURIComponent(m)+"="+encodeURIComponent(c[m]);p.push(g.replace(/%20/g,"+"))}var f=p.join("&");u.send(f)}}(e);else if(r.closest(a,".jp-carousel-photo-icons-container")||a.classList.contains("jp-carousel-photo-title"))!function(e){e.preventDefault();var t=e.target,o=d.info.querySelector(".jp-carousel-info-extra"),a=d.info.querySelector(".jp-carousel-image-meta"),i=d.info.querySelector(".jp-carousel-comments-wrapper"),n=d.info.querySelector(".jp-carousel-icon-info"),l=d.info.querySelector(".jp-carousel-icon-comments");function s(){l&&l.classList.remove("jp-carousel-selected"),n.classList.toggle("jp-carousel-selected"),i&&i.classList.remove("jp-carousel-show"),a&&(a.classList.toggle("jp-carousel-show"),a.classList.contains("jp-carousel-show")?o.classList.add("jp-carousel-show"):o.classList.remove("jp-carousel-show"))}function c(){n&&n.classList.remove("jp-carousel-selected"),l.classList.toggle("jp-carousel-selected"),a&&a.classList.remove("jp-carousel-show"),i&&(i.classList.toggle("jp-carousel-show"),i.classList.contains("jp-carousel-show")?o.classList.add("jp-carousel-show"):o.classList.remove("jp-carousel-show"))}(r.closest(t,".jp-carousel-icon-info")||t.classList.contains("jp-carousel-photo-title"))&&(a&&a.classList.contains("jp-carousel-show")?r.scrollToElement(d.overlay,d.overlay,s):(s(),r.scrollToElement(d.info,d.overlay)));r.closest(t,".jp-carousel-icon-comments")&&(i&&i.classList.contains("jp-carousel-show")?r.scrollToElement(d.overlay,d.overlay,c):(c(),r.scrollToElement(d.info,d.overlay)))}(e);else if(!r.closest(a,".jp-carousel-info"))return}),window.addEventListener("keydown",g),d.overlay.addEventListener("jp_carousel.afterOpen",function(){f(),d.slides.length<=5?r.show(d.info.querySelector(".jp-swiper-pagination")):r.show(d.info.querySelector(".jp-carousel-pagination"))}),d.overlay.addEventListener("jp_carousel.beforeClose",function(){h(),document.documentElement.style.removeProperty("height"),r.hide(d.info.querySelector(".jp-swiper-pagination")),r.hide(d.info.querySelector(".jp-carousel-pagination"))}),d.overlay.addEventListener("jp_carousel.afterClose",function(){window.history.pushState?history.pushState("",document.title,window.location.pathname+window.location.search):window.location.href="",l="",d.isOpen=!1}),d.overlay.addEventListener("touchstart",function(e){e.touches.length>1&&e.preventDefault()}))}function y(e,t){var o=d.overlay.querySelector("#jp-carousel-comment-post-results"),a="jp-carousel-comment-post-"+(t?"success":"error");o.innerHTML=''+e+"",r.hide(d.overlay.querySelector("#jp-carousel-comment-form-spinner")),d.overlay.querySelector("#jp-carousel-comment-form").classList.remove("jp-carousel-is-disabled"),r.show(o)}function w(){var e=document.querySelectorAll("a img[data-attachment-id]");Array.prototype.forEach.call(e,function(e){var t=e.parentElement;if(!t.parentElement.classList.contains("gallery-icon")&&t.hasAttribute("href")){var r=!1;t.getAttribute("href").split("?")[0]===e.getAttribute("data-orig-file").split("?")[0]&&1===Number(jetpackCarouselStrings.single_image_gallery_media_file)&&(r=!0),t.getAttribute("href")===e.getAttribute("data-permalink")&&(r=!0),r&&(t.classList.add("single-image-gallery"),t.setAttribute("data-carousel-extra",JSON.stringify({blog_id:Number(jetpackCarouselStrings.blog_id)})))}})}function j(o){(!o||o<0||o>d.slides.length)&&(o=0),d.currentSlide=d.slides[o];var a,i,n=d.currentSlide,s=n.attrs.attachmentId,c=d.info.querySelector(".jp-carousel-info-extra"),u=d.info.querySelector(".jp-carousel-image-meta"),p=d.info.querySelector(".jp-carousel-comments-wrapper"),g=d.info.querySelector(".jp-carousel-icon-info"),h=d.info.querySelector(".jp-carousel-icon-comments");c&&c.classList.remove("jp-carousel-show"),u&&u.classList.remove("jp-carousel-show"),g&&g.classList.remove("jp-carousel-selected"),p&&p.classList.remove("jp-carousel-show"),h&&h.classList.remove("jp-carousel-selected"),function(e){var t=e.el,r=e.attrs,o=t.querySelector("img");if(!o.hasAttribute("data-loaded")){var a=!!r.previewImage,i=r.thumbSize;!a||i&&t.offsetWidth>i.width?o.src=r.src:o.src=r.previewImage,o.setAttribute("itemprop","image"),o.setAttribute("data-loaded",1)}}(d.slides[o]),1!==Number(jetpackCarouselStrings.display_background_image)||d.slides[o].backgroundImage||function(t){var r=t.el;e&&e.slides&&(r=e.slides[e.activeIndex]);var o=t.attrs.originalElement;if(o.complete&&0!==o.naturalHeight)return void k(t,r,o);o.onload=function(){k(t,r,o)}}(d.slides[o]),r.hide(d.caption),function(e){var t,o,a,i,n="",l="",s="";if(t=d.overlay.querySelector(".jp-carousel-photo-caption"),o=d.overlay.querySelector(".jp-carousel-caption"),a=d.overlay.querySelector(".jp-carousel-photo-title"),i=d.overlay.querySelector(".jp-carousel-photo-description"),r.hide(t),r.hide(o),r.hide(a),r.hide(i),n=x(e.caption)||"",l=x(e.title)||"",s=x(e.desc)||"",(n||l||s)&&(n&&(t.innerHTML=n,o.innerHTML=n,r.show(t),r.show(o)),r.stripHTML(n)===r.stripHTML(l)&&(l=""),r.stripHTML(n)===r.stripHTML(s)&&(s=""),r.stripHTML(l)===r.stripHTML(s)&&(s=""),s&&(i.innerHTML=s,r.show(i)),l)){var c=r.stripHTML(l);a.innerHTML=c,n||(t.innerHTML=c,o.innerHTML=c,r.show(t)),r.show(a)}}({caption:n.attrs.caption,title:n.attrs.title,desc:n.attrs.desc}),function(e){if(!e||1!==Number(jetpackCarouselStrings.display_exif))return!1;var t=d.info.querySelector(".jp-carousel-image-meta ul.jp-carousel-image-exif"),r="";for(var o in e){var a=e[o],i=jetpackCarouselStrings.meta_data||[];if(0!==parseFloat(a)&&a.length&&-1!==i.indexOf(o)){switch(o){case"focal_length":a+="mm";break;case"shutter_speed":a=L(a);break;case"aperture":a="f/"+a}r+="
  • "+jetpackCarouselStrings[o]+"
    "+a+"
  • "}}t.innerHTML=r,t.style.removeProperty("display")}(d.slides[o].attrs.imageMeta),function(e){if(!e)return!1;var r,o=[e.attrs.origWidth,e.attrs.origHeight],a=document.createElement("a");a.href=e.attrs.src.replace(/\?.+$/,""),r=null!==a.hostname.match(/^i[\d]{1}\.wp\.com$/i)?a.href:e.attrs.origFile.replace(/\?.+$/,"");var i=d.info.querySelector(".jp-carousel-download-text"),n=d.info.querySelector(".jp-carousel-image-download");i.innerHTML=t.applyReplacements(jetpackCarouselStrings.download_original,o),n.setAttribute("href",r),n.style.removeProperty("display")}(n),1===Number(jetpackCarouselStrings.display_comments)&&(a=d.slides[o].attrs.commentsOpened,i=d.container.querySelector(".jp-carousel-comment-form-container"),1===parseInt(a,10)?r.fadeIn(i):r.fadeOut(i),q(s),r.hide(d.info.querySelector("#jp-carousel-comment-post-results")));var f=d.info.querySelector(".jp-carousel-pagination");if(f&&d.slides.length>5){var v=o+1;f.innerHTML=""+v+" / "+d.slides.length+""}jetpackCarouselStrings.stats&&((new Image).src=document.location.protocol+"//pixel.wp.com/g.gif?"+jetpackCarouselStrings.stats+"&post="+encodeURIComponent(s)+"&rand="+Math.random()),m(s),window.location.hash=l="#jp-carousel-"+s}function S(){document.body.style.overflow=a,document.documentElement.style.overflow=i,A(),h(),r.emitEvent(d.overlay,"jp_carousel.beforeClose"),window.scrollTo(window.scrollX||window.pageXOffset||0,n||0),e.destroy(),d.isOpen=!1,d.slides=[],d.currentSlide=void 0,d.gallery.innerHTML="",r.fadeOut(d.overlay,function(){r.emitEvent(d.overlay,"jp_carousel.afterClose")})}function b(e,t,r){var o=r?e.replace(/.*=([\d]+%2C[\d]+).*$/,"$1"):e.replace(/.*-([\d]+x[\d]+)\..+$/,"$1"),a=o!==e?r?o.split("%2C"):o.split("x"):[t,0];return"9999"===a[0]&&(a[0]="0"),"9999"===a[1]&&(a[1]="0"),a}function L(e){return e>=1?Math.round(10*e)/10+"s":"1/"+Math.round(1/e)+"s"}function x(e){return!e.match(" ")&&e.match("_")?"":e}function q(e,t){var a=void 0===t,i=d.info.querySelector(".jp-carousel-icon-comments .jp-carousel-has-comments-indicator");if(i.classList.remove("jp-carousel-show"),clearInterval(o),e){(!t||t<1)&&(t=0);var n=d.info.querySelector(".jp-carousel-comments"),l=d.info.querySelector("#jp-carousel-comments-loading");r.show(l),a&&(r.hide(n),n.innerHTML="");var s=new XMLHttpRequest,c=jetpackCarouselStrings.ajaxurl+"?action=get_attachment_comments&nonce="+jetpackCarouselStrings.nonce+"&id="+e+"&offset="+t;s.open("GET",c),s.setRequestHeader("X-Requested-With","XMLHttpRequest");var u=function(){r.fadeIn(n),r.fadeOut(l)};s.onload=function(){if(d.currentSlide&&d.currentSlide.attrs.attachmentId===e){var c,p=s.status>=200&&s.status<300;try{c=JSON.parse(s.responseText)}catch(e){}if(!p||!c||!Array.isArray(c))return u();a&&(n.innerHTML="");for(var m=0;m'+g.gravatar_markup+'
    '+g.author_markup+'
    '+g.date_gmt+"
    "+g.content+"
    ",n.appendChild(h),clearInterval(o),o=setInterval(function(){d.container.scrollTop+150>window.innerHeight&&(q(e,t+10),clearInterval(o))},300)}c.length>0&&(r.show(n),i.innerText=c.length,i.classList.add("jp-carousel-show")),r.hide(l)}},s.onerror=u,s.send()}}function k(e,r,o){var a=t.getBackgroundImage(o);e.backgroundImage=a,r.style.backgroundImage="url("+a+")",r.style.backgroundSize="cover"}function A(){d.commentField&&(d.commentField.value="")}function E(e,o){d.slides=[];var a={width:window.innerWidth,height:window.innerHeight-64};0!==o&&((new Image).src=e[o].getAttribute("data-gallery-src"));var i=!!r.closest(e[0],".tiled-gallery.type-rectangular");Array.prototype.forEach.call(e,function(e,o){var n=r.closest(e,"a"),l=e.getAttribute("data-orig-file")||e.getAttribute("src-orig"),s=e.getAttribute("data-attachment-id")||e.getAttribute("data-id")||"0",c=document.querySelector('img[data-attachment-id="'+s+'"] + figcaption');c=c?c.innerHTML:e.getAttribute("data-image-caption");var u={originalElement:e,attachmentId:s,commentsOpened:e.getAttribute("data-comments-opened")||"0",imageMeta:r.getJSONAttribute(e,"data-image-meta")||{},title:e.getAttribute("data-image-title")||"",desc:e.getAttribute("data-image-description")||"",mediumFile:e.getAttribute("data-medium-file")||"",largeFile:e.getAttribute("data-large-file")||"",origFile:l||"",thumbSize:{width:e.naturalWidth,height:e.naturalHeight},caption:c||"",permalink:n&&n.getAttribute("href"),src:l||e.getAttribute("src")||""},p=r.closest(e,".tiled-gallery-item"),m=p&&p.querySelector(".tiled-gallery-caption"),g=m&&m.innerHTML;g&&(u.caption=g);var h=function(e){var t=e.getAttribute("data-orig-size")||"";if(t){var r=t.split(",");return{width:parseInt(r[0],10),height:parseInt(r[1],10)}}return{width:e.getAttribute("data-original-width")||e.getAttribute("width")||void 0,height:e.getAttribute("data-original-height")||e.getAttribute("height")||void 0}}(e);if(u.origWidth=h.width||u.thumbSize.width,u.origHeight=h.height||u.thumbSize.height,"undefined"!=typeof wpcom&&wpcom.carousel&&wpcom.carousel.generateImgSrc?u.src=wpcom.carousel.generateImgSrc(e,a):u.src=function(e){if("object"!=typeof e&&(e={}),void 0===e.origFile)return"";if(void 0===e.origWidth||void 0===e.maxWidth)return e.origFile;if(void 0===e.mediumFile||void 0===e.largeFile)return e.origFile;var t=document.createElement("a");t.href=e.largeFile;var r=/^i[0-2]\.wp\.com$/i.test(t.hostname),o=b(e.mediumFile,e.origWidth,r),a=b(e.largeFile,e.origWidth,r),i=parseInt(a[0],10),n=parseInt(a[1],10),l=parseInt(o[0],10),s=parseInt(o[1],10);if(e.origMaxWidth=e.maxWidth,e.origMaxHeight=e.maxHeight,void 0!==window.devicePixelRatio&&window.devicePixelRatio>1&&(e.maxWidth=e.maxWidth*window.devicePixelRatio,e.maxHeight=e.maxHeight*window.devicePixelRatio),i>=e.maxWidth||n>=e.maxHeight)return e.largeFile;if(l>=e.maxWidth||s>=e.maxHeight)return e.mediumFile;if(r){var c=e.largeFile.lastIndexOf("?"),u=e.largeFile;return-1!==c&&(u=e.largeFile.substring(0,c),(e.origWidth>e.maxWidth||e.origHeight>e.maxHeight)&&((e.origMaxWidth<1e3||e.origMaxWidth<1e3)&&(e.origMaxWidth=2*e.maxWidth,e.origMaxHeight=2*e.maxHeight),u+="?fit="+e.origMaxWidth+"%2C"+e.origMaxHeight)),u}return e.origFile}({origFile:u.src,origWidth:u.origWidth,origHeight:u.origHeight,maxWidth:a.width,maxHeight:a.height,mediumFile:u.mediumFile,largeFile:u.largeFile}),e.setAttribute("data-gallery-src",u.src),"0"!==u.attachmentId){u.title=t.texturize(u.title),u.desc=t.texturize(u.desc),u.caption=t.texturize(u.caption);var f=new Image;f.src=u.src;var v=document.createElement("div");v.classList.add("swiper-slide"),v.setAttribute("itemprop","associatedMedia"),v.setAttribute("itemscope",""),v.setAttribute("itemtype","https://schema.org/ImageObject");var y=document.createElement("div");y.classList.add("swiper-zoom-container"),d.gallery.appendChild(v),v.appendChild(y),y.appendChild(f),v.setAttribute("data-attachment-id",u.attachmentId),v.setAttribute("data-permalink",u.permalink),v.setAttribute("data-orig-file",u.origFile),i&&(u.previewImage=u.src);var w={el:v,attrs:u,index:o};d.slides.push(w)}})}function H(e,t){if(!window.Swiper){var o=document.querySelector("#jp-carousel-loading-overlay");r.show(o);var a=document.createElement("script");return a.id="jetpack-carousel-swiper-js",a.src=window.jetpackSwiperLibraryPath.url,a.async=!0,a.onload=function(){r.hide(o),T(e,t)},a.onerror=function(){r.hide(o)},void document.head.appendChild(a)}T(e,t)}function T(t,o){var l,s={imgSelector:".gallery-item [data-attachment-id], .tiled-gallery-item [data-attachment-id], img[data-attachment-id], img[data-id]",startIndex:0},c=r.getJSONAttribute(t,"data-carousel-extra");if(c&&(v(),!d.isOpen)){for(var u in d.isOpen=!0,a=getComputedStyle(document.body).overflow,document.body.style.overflow="hidden",i=getComputedStyle(document.documentElement).overflow,document.documentElement.style.overflow="hidden",n=window.scrollY||window.pageYOffset||0,d.container.setAttribute("data-carousel-extra",JSON.stringify(c)),p(["open","view_image"]),o||{})s[u]=o[u];-1===s.startIndex&&(s.startIndex=0),r.emitEvent(d.overlay,"jp_carousel.beforeOpen"),d.gallery.innerHTML="",d.overlay.style.opacity=1,d.overlay.style.display="block",E(t.querySelectorAll(s.imgSelector),s.startIndex),(e=new window.Swiper(".jp-carousel-swiper-container",{centeredSlides:!0,zoom:!0,loop:d.slides.length>1,pagination:{el:".jp-swiper-pagination",clickable:!0},navigation:{nextEl:".jp-swiper-button-next",prevEl:".jp-swiper-button-prev"},initialSlide:s.startIndex,on:{init:function(){j(s.startIndex)}},preventClicks:!1,preventClicksPropagation:!1,preventInteractionOnTransition:!r.isTouch(),threshold:5})).on("slideChange",function(e){j(0===e.activeIndex?d.slides.length-1:e.activeIndex===d.slides.length+1?0:e.activeIndex-1),d.overlay.classList.remove("jp-carousel-hide-controls")}),e.on("zoomChange",function(e,t){t>1&&d.overlay.classList.add("jp-carousel-hide-controls"),1===t&&d.overlay.classList.remove("jp-carousel-hide-controls")}),e.on("doubleTap",function(e){if(clearTimeout(l),1===e.zoom.scale)var t=setTimeout(function(){d.overlay.classList.remove("jp-carousel-hide-controls"),clearTimeout(t)},150)}),e.on("tap",function(){e.zoom.scale>1&&(l=setTimeout(function(){d.overlay.classList.toggle("jp-carousel-hide-controls")},150))}),r.fadeIn(d.overlay,function(){r.emitEvent(d.overlay,"jp_carousel.afterOpen")})}}document.body.addEventListener("click",function(e){if(window.CSS&&window.CSS.supports&&window.CSS.supports("display","grid")){var t,o=e.target,a=r.closest(o,c);if(a){if(!(t=a)||!t.getAttribute("data-carousel-extra"))return;var i=o.parentElement,n=i.parentElement;if(n&&n.classList.contains("wp-block-image")){var l=i.getAttribute("href");if(l.split("?")[0]!==o.getAttribute("data-orig-file").split("?")[0]&&l!==o.getAttribute("data-permalink"))return}if(i.classList.contains("gallery-caption"))return;if(r.matches(i,"figcaption"))return;document.documentElement.style.height="auto",e.preventDefault(),e.stopPropagation();var s=r.closest(o,u),d=Array.prototype.indexOf.call(a.querySelectorAll(u),s);H(a,{startIndex:d})}}}),1===Number(jetpackCarouselStrings.single_image_gallery)&&(w(),document.body.addEventListener("is.post-load",function(){w()})),window.addEventListener("hashchange",function(){var t=/jp-carousel-(\d+)/;if(window.location.hash&&t.test(window.location.hash)){if(window.location.hash!==l||!d.isOpen)if(window.location.hash&&d.gallery&&!d.isOpen&&history.back)history.back();else{l=window.location.hash;for(var r,o,a=window.location.hash.match(t),i=parseInt(a[1],10),n=document.querySelectorAll(c),s=0;s 0 ) { children[0].appendChild( ak_js ); } } }; function socializer_addbookmark(t){var e=navigator.userAgent.toLowerCase(),s=-1!=e.indexOf("mac"),r="";t.preventDefault(),r=(s?"Command/Cmd":"CTRL")+" + D",alert("Press "+r+" to bookmark this page")}function socializer_shortlink(t,e){t.preventDefault(),link=e.getAttribute("href"),"#"!=link&&prompt("Short link",link)}window.wpsr_helpers={addClass:function(t,e){t.classList?t.classList.add(e):t.className+=" "+e},removeClass:function(t,e){t.classList?t.classList.remove(e):t.className=t.className.replace(new RegExp("(^|\\b)"+e.split(" ").join("|")+"(\\b|$)","gi")," ")},popup:function(t,e,s,r){var a=screen.width/2-s/2,n=screen.height/2-r/2;return window.open(t,e,"toolbar=no,location=no,menubar=no,scrollbars=yes,width="+s+",height="+r+",top="+n+",left="+a)},offset:function(t){var e=t.getBoundingClientRect();return{top:e.top+document.body.scrollTop,left:e.left+document.body.scrollLeft}},ajax:function(t,e,s,r,a){var n=new XMLHttpRequest;n.props=a,n.open(e,t,!0),"POST"==e&&n.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),n.onreadystatechange=function(){if(4==n.readyState&&200==n.status)return r(n)},n.send(s)},format_num:function(t){if(t<1e3)return t;for(var e=["k","m","b","t"],s=t,r=0;r1e3)){s=Math.round(100*t)/100+e[r];break}return s},is_mobile:function(){return/Mobi|Android/i.test(navigator.userAgent)}},document.addEventListener("DOMContentLoaded",function(){var t=document.querySelectorAll(".socializer.sr-popup a");for(_=0;_"'\/\\=&%]/g,""),f=document.querySelectorAll(w),_=0;_0&&["resize","load"].forEach(function(t){window.addEventListener(t,function(){for(var t=0;t0)for(_=0;_0){var k={},A=wpsr_ajax_url+"?action=wpsr_share_count";for(_=0;_0&&(r.innerHTML=wpsr_helpers.format_num(n))}};for(var x in k)k.hasOwnProperty(x)&&(send_data={url:x,services:k[x]},to_send="data="+JSON.stringify(send_data),wpsr_helpers.ajax(A,"POST",to_send,S,{forURL:x}))}}});;