!function(t){t(document).ready(function(){var o=window,e=o.history,a={lock:!1,load:function(e,n){if(a.lock)return!1;a.lock=!0,e=void 0!==e?e:cpage,t.ajax({url:ajaxurl,data:{action:"google-get-comments",postid:gpid,cpage:e},xhrFields:{withCredentials:!0},complete:function(){a.lock=!1},success:function(a){if(t("#comments-loading").hide(),t("#comments-loaded").html(a).slideDown(),void 0!==n){var i={cpage:e};""==n?history.replaceState(i,o.title,n):history.pushState(i,o.title,n)}var c=o.location.toString().split("#");void 0!==c[1]&&t("html, body").animate({scrollTop:t("#"+c[1]).offset().top},200)}})},cpage:function(t){return match=/([&?]|\/comment-page-)([0-9]+)/.exec(t),!!match&&match[2]},loading:function(){t("#comments-loaded").hide(),t("#comments-loading").show().css("height","500px"),t("html, body").animate({scrollTop:t("#comments-loading").offset().top},200)}};a.load(cpage,"",!0),e&&e.pushState&&(t(o).bind("popstate",function(t){var o=t.originalEvent.state;o&&void 0!==o.cpage&&(a.loading(),a.load(o.cpage))}),t("body").on("click",'a[href*="/comment-page-"], a[href*="cpage"], #comments .navigation a',function(o){var e=t(this).attr("href");if(0==e.indexOf(t("link[rel=canonical]").attr("href"))&&-1==e.indexOf("#respond")){var n=a.cpage(e);n!=cpage&&(o.preventDefault(),a.loading(),a.load(n,e),cpage=n)}}))})}(jQuery);