var _____WB$wombat$assign$function_____=function(name){return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name))||self[name];};if(!self.__WB_pmw){self.__WB_pmw=function(obj){this.__WB_source=obj;return this;}}{
let window = _____WB$wombat$assign$function_____("window");
let self = _____WB$wombat$assign$function_____("self");
let document = _____WB$wombat$assign$function_____("document");
let location = _____WB$wombat$assign$function_____("location");
let top = _____WB$wombat$assign$function_____("top");
let parent = _____WB$wombat$assign$function_____("parent");
let frames = _____WB$wombat$assign$function_____("frames");
let opens = _____WB$wombat$assign$function_____("opens");
!function(o){"use strict";function s(t,a){var e;t&&t.length&&(e=t.attr("data-post-id"),t=t.data("like-count"),(e=o(".loftocean-like-meta[data-post-id="+e+"]"))&&e.length&&(t=a?parseInt(t,10)+1:t-1,e.data("like-count",Math.max(0,t)),e.find(".count").text((t=t,(t=parseInt(t,10))<1?0:1e6<=t?(t=Math.floor(t/1e5)/10)+"M":1e3<=t?(t=Math.floor(t/100)/10)+"K":t))))}var l={likes:!1,itemName:"loftocean/liked",init:function(){var t;!o(".post-like").length||(t=l.getItem(l.itemName))&&(l.likes=JSON.parse(t),l.hasLikes()&&o(document).ready(function(){l.addLikedClass()})),o(document).on("loftocean/moreContent/loaded",function(){l.addLikedClass()})},addLikedClass:function(){l.hasLikes()&&l.likes.forEach(function(t){t=o(".post-like[data-post-id="+t+"]");t.length&&t.addClass("liked")})},set:function(t){l.hasLikes()?-1===l.likes.indexOf(t)&&(l.likes.push(t),l.save()):(l.likes=[t],l.save())},isLiked:function(t){return!!l.hasLikes()&&-1!==l.likes.indexOf(t)},remove:function(t){!l.hasLikes()||-1!==(t=l.likes.indexOf(t))&&(l.likes.splice(t,1),l.save())},save:function(){try{window.localStorage.setItem(l.itemName,JSON.stringify(l.likes))}catch(t){}},hasLikes:function(){return l.likes&&Array.isArray(l.likes)},getItem:function(t){try{return window.localStorage.getItem(t)}catch(t){return!1}}};l.init(),o(document).ready(function(){var i,n,t,a,e;o(".post-like").length&&o("body").on("click",".post-like",function(t){t.preventDefault();var a,e,i,n=o(this);return n.data("animating")||(a=n.attr("data-post-id"),(e=o(".post-like[data-post-id="+a+"]")).data("animating",!0),n.hasClass("liked")?(i={action:loftocean_ajax.like.action,post_id:a,unliked:!0},o.post(loftocean_ajax.url,i).done(function(){l.remove(a),0<n.data("like-count")&&(s(n,!1),e.removeClass("liked")),e.data("animating",!1)})):a&&!l.isLiked(a)?(i={action:loftocean_ajax.like.action,post_id:a},e.addClass("liked clicking"),o.post(loftocean_ajax.url,i).done(function(){l.set(a),s(n,!0),e.data("animating",!1),e.removeClass("clicking")})):e.data("animating",!1)),!1}),o(".article-share a.popup-window, .tweet-it, .social-share-icons > a").length&&o("body").on("click",".article-share a.popup-window, .tweet-it, .social-share-icons > a",function(t){t.preventDefault();var a=o(this),t=a.attr("data-props")?a.attr("data-props"):"width=555,height=401";return window.open(a.attr("href"),a.attr("title"),t),!1}),loftocean_ajax&&loftocean_ajax.load_post_metas_dynamically&&(i=o(".loftocean-view-meta"),n=o(".loftocean-like-meta"),(a=o("<div>",{class:"temp-div"}).add(i).add(n).not(".temp-div")).length&&(t=[],e=loftocean_ajax.current_post_id,a.each(function(){o(this).data("post-id")&&!t.includes(o(this).data("post-id"))&&t.push(o(this).data("post-id"))}),e&&!t.includes(parseInt(e,10))&&t.push(e),t.length&&(a=!!loftocean_ajax.need_updating_view_count,e=wpApiSettings.root+"loftocean/v1/get-post-metas/"+t.join(",")+"/"+(e&&a?e:0),o.get(e).done(function(a,t,e){200==e.status&&200==a.status&&(a=a.data,i.each(function(){var t=o(this).data("post-id");a[t]&&a[t]["loftocean-view-count"]&&(t=a[t]["loftocean-view-count"],o(this).find(".count").length&&o(this).find(".count").text(t.format))}),n.each(function(){var t=o(this).data("post-id");a[t]&&a[t]["loftocean-like-count"]&&(t=a[t]["loftocean-like-count"],o(this).data("like-count",Math.max(0,t.raw)),o(this).find(".count").length&&o(this).find(".count").text(t.format))}))}))))})}(jQuery);
}