require(["jquery"],function(e){function t(){var t,o,n=(document.location.href+"").match(/(?:\?|&)comment=([\d]+)/);null!=n&&2==n.length&&(t=e("#comment-"+parseInt(n[1])),t.length>0&&(t.addClass("comment-emphasized"),o=t.position(),e("html,body").stop().animate({scrollTop:o.top-55},500)))}function o(e){return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}var n=e("article .voting"),a=e(".experts-viewport");n.length>0&&require(["blog-voting"],function(e){e.init(n)}),a.length>0&&require(["blog-experts"],function(e){e.init(a)}),e(".cardhub-edu-table").each(function(t,o){e(o).wrap('<div class="cardhub-edu-table-div" />')}),e(".embedholder a").on("click",function(t){var o=e(this);return o.parent().find(".embedcode").toggle(),o.blur(),t.stopPropagation(),!1});var i={};if(e(".embedholder textarea").on("mouseup mousedown click focus",function(){var t=e(this);t.select(),t.mouseup(function(){return t.unbind("mouseup"),!1})}).on("mouseleave",function(){var t=e(this),o=t.closest(".embedholder").attr("id");i[o]=window.setTimeout(function(){e("#"+o+" .embedcode").hide()},1500)}).on("mouseenter",function(){var t=e(this),o=t.closest(".embedholder").attr("id");o in i&&window.clearTimeout(i[o])}).on("click",function(e){return e.stopPropagation(),!1}),e(".embedholder").on("click",function(e){e.stopPropagation()}),e(window).click(function(){e(".embedholder .embedcode").hide()}),"undefined"!=typeof gChartPackages&&"undefined"!=typeof gChartData&&require(["goog!visualization,1,packages:["+gChartPackages.join(",")+"]"],function(){var t,o,n,a,i,r,l,s,c={geo:"GeoChart",pie:"PieChart",column:"ColumnChart",line:"LineChart",bubble:"BubbleChart"};for(n in c)if(n in gChartData)for(t=0;t<gChartData[n].length;t++)if(a=gChartData[n][t],"id"in a&&"data"in a&&"config"in a){if("ToolTip"==a.data[0][a.data[0].length-1]&&(a.data[0][a.data[0].length-1]={role:"tooltip",p:{html:!0}}),i=google.visualization.arrayToDataTable(a.data),s=e("#"+a.id),r=new google.visualization[c[n]](s.get(0)),e.inArray(n,["column","line","geo"])>-1&&"fmt"in a)for("geo"==n&&(a.config.firstColStr=!0),o=a.config.firstColStr?2:1;o<=a.data[0].length;o++)l=new google.visualization.NumberFormat(a.fmt),l.format(i,o-1);("column"==n||"line"==n||"bubble"==n)&&google.visualization.events.addListener(r,"ready",function(){s.append('<div class="left-border">&nbsp;</div>')}),r.draw(i,a.config)}}),/^\/(blog|edu)\/[^\/]+\/[0-9]+\/$/.test(document.location.pathname)!==!1&&/^\/(blog|edu)\/page\/[0-9]+\/$/.test(document.location.pathname)===!1){require(["blog-comments","fb-init","twitter-sdk","google-sdk"]),e(".social_sidebar a").on("click",function(){var t=575,o=400,n=(e(window).width()-t)/2,a=(e(window).height()-o)/2,i="status=1,width="+t+",height="+o+",top="+a+",left="+n,r=e(this).closest("li"),l=null;return r.hasClass("social-email")?(e(".wallethub a").trigger("publisher_email"),l="wh"):(r.hasClass("facebook")?l="fb":r.hasClass("twitter")?l="tw":r.hasClass("linkedin")&&(l="li"),window.open(this.href,"whpopup",i)),null!=l&&e.get("/ajax.php",{action:"blogpost-clear-count",count:l,uri:document.location.pathname},function(){},"json"),!1}),e(".social-buttons a").on("click",function(){var t=575,o=400,n=(e(window).width()-t)/2,a=(e(window).height()-o)/2,i="status=1,width="+t+",height="+o+",top="+a+",left="+n,r=e(this).closest("div"),l=null;return r.hasClass("social-email")?(e(".wallethub a").trigger("publisher_email"),l="wh"):(r.hasClass("facebook")?l="fb":r.hasClass("twitter")?l="tw":r.hasClass("linkedin")&&(l="li"),window.open(this.href,"whpopup",i)),null!=l&&e.get("/ajax.php",{action:"blogpost-clear-count",count:l,uri:document.location.pathname},function(){},"json"),!1}),e(".social_buttons_footer .el.icon:not(.email)").on("click",function(){var t="."+e(this).attr("data-link");e(".social_sidebar "+t+" a").click()}),e(".social_buttons_footer .el.icon.email").on("click",function(){var t=e(this);e.ajax({url:"/ajax.php",type:"POST",data:{nonce:t.siblings("[name=email_nonce]").val(),"email-by-app":!0,uri:document.location.pathname,action:"share-publish-email"},success:function(e){t.siblings("[name=email_nonce]").val(e.nonce)}})}),e(window).resize(function(){e(window).scrollTop()>150?(e(".social_buttons_footer").addClass("show"),e("#viewport > header").addClass("hide")):(e(".social_buttons_footer").removeClass("show"),e("#viewport > header").removeClass("hide"))}),e(window).scroll(function(){e(window).scrollTop()>150?(e(".social_buttons_footer").addClass("show"),e("#viewport > header").addClass("hide")):(e(".social_buttons_footer").removeClass("show"),e("#viewport > header").removeClass("hide"))});var r=e(".mentioned-authors"),l=e(".social_sidebar ul"),s=e(".social-buttons"),c="https://wallethub.com"+document.location.pathname,u={fb:0,tw:0,li:0,wh:0};l.on("update",function(){l.find("li.facebook .counter").html(o(u.fb)),l.find("li.twitter .counter").html(o(u.tw)),l.find("li.linkedin .counter").html(o(u.li)),l.find("li.social-email .counter").html(o(u.wh));var t=u.fb+u.tw+u.li+u.wh;t>1e3?(t=Math.round(t/1e3*10)/10+"K",l.find("li.totalshares .totalSharesCount").html(t).addClass("reducedSize"),s.find(".totalshares .totalSharesCount").html(t),e(".social_buttons_footer .el").html(t)):(l.find("li.totalshares .totalSharesCount").html(o(t)),s.find(".totalshares .totalSharesCount").html(o(t)),e(".social_buttons_footer .el").html(o(t)))}),e.ajax({url:"https://graph.facebook.com/?ids="+escape(c),dataType:"jsonp",success:function(e){c in e&&"shares"in e[c]&&(u.fb=e[c].shares,l.trigger("update"))}}),e.ajax({url:"https://cdn.api.twitter.com/1/urls/count.json?url="+escape(c),dataType:"jsonp",success:function(e){"count"in e&&(u.tw=e.count,l.trigger("update"))}}),e.ajax({url:"https://www.linkedin.com/countserv/count/share?format=jsonp&url="+escape(c),dataType:"jsonp",success:function(e){"count"in e&&(u.li=e.count,l.trigger("update"))}}),e.ajax({url:document.location.pathname+"?onload",dataType:"json",method:"OPTIONS",success:function(o){if(!o.error){if(t(),e(".comments .comment-form textarea[name=comment]").removeAttr("disabled"),"follows"in o)for(var n in o.follows)o.follows[n]>0&&r.find(".author.a"+n+" .actions").html('<div class="following"><img src="//d2e70e9yced57e.cloudfront.net/wallethub/images/profile/check-green_Va6b533e_.png" width="21" height="17" /> Following</div>');u.wh=parseInt(o.mailpub),l.trigger("update")}}}),e("#smt_floater .social-email a,a[data-publisher]").on("click",function(){return require(["wh.overlay"],function(e){e.show_email_share_overlay()}),!1}),e(".social-buttons .social-email a,a[data-publisher]").on("click",function(){return require(["wh.overlay"],function(e){e.show_email_share_overlay()}),!1}),e(document).scroll(function(){e(this).scrollTop()>100&&e(window).width()>1200?e("#smt_floater").fadeIn():e("#smt_floater").fadeOut()}),require(["wh.overlay","cookie-helper"],function(t,o){var n=e(".mentioned-authors");n.on("click","a[id^=follow-]",function(){var a,i=e(this),r=i.closest(".actions"),l=this.id.replace(/^follow-/,""),s=function(){e.ajax({url:"/ajax.php",data:{action:"check-post-author-follows",uri:document.location.pathname},success:function(e){if(!e.error){if("follows"in e)for(var t in e.follows)e.follows[t]>0&&n.find(".author.a"+t+" .actions").html('<div class="following"><img src="//d2e70e9yced57e.cloudfront.net/wallethub/images/profile/check-green_Va6b533e_.png" width="21" height="17" /> Following</div>');i=n.find("#follow-"+l+".btn"),i.length>0&&("nonce"in e&&i.data("nonce",e.nonce),i.trigger("click"))}}})};return a=i.data("nonce"),"undefined"==typeof a?(s(),!1):o.is_logged_in()?(r.addClass("loading"),e.ajax({url:"/ajax.php",type:"POST",data:{action:"bp_follow",uid:l,_wpnonce:a},success:function(e){r.removeClass("loading"),e.indexOf("You are now following")<0&&e.indexOf("Already following")<0||r.html('<div class="following"><img src="//d2e70e9yced57e.cloudfront.net/wallethub/images/profile/check-green_Va6b533e_.png" width="21" height="17" /> Following</div>')}}),!1):(t.show_login_overlay({after_login:s}),!1)})}),require(["jquery-tablesorter"],function(){var t=e(".cardhub-edu-table.sortable");0!=t.length&&(e.tablesorter.addParser({id:"rank-percentage",is:function(){return!1},format:function(e){var t=e.match(/^([\d]+)\([\d\.]+%\)$/);return null==t?e:t.length>1?parseInt(100*t[1]):e},type:"numeric"}),e.tablesorter.addParser({id:"rank-value",is:function(){return!1},format:function(e){var t=e.match(/([\d]+)\s*\(/);return null==t?e:t.length>1?t[1]:e},type:"numeric"}),e.tablesorter.addParser({id:"value-rank",is:function(){return!1},format:function(e){var t=e.match(/^\$(?:[\d,]+)\(([\d]+)\)$/);return null==t?e:t.length>1?t[1]:e},type:"numeric"}),e.tablesorter.addParser({id:"rank-numeric",is:function(){return!1},format:function(e){var t=e.match(/^\$?([0-9\.,-]+)%?(?:\(\$?([0-9\.,-]+)%?\))?/);return null==t?e:t.length>1?100*t[1].replace(/,/,""):e},type:"numeric"}),t.each(function(){var t,o,n=e(this),a={headers:{}};if(t=n.find("th.rank-percentage"),t.length>0)for(o=0;o<t.length;o++)a.headers[e(t[o]).index()]={sorter:"rank-percentage"};if(t=n.find("th.rank-value"),t.length>0)for(o=0;o<t.length;o++)a.headers[e(t[o]).index()]={sorter:"rank-value"};if(t=n.find("th.value-rank"),t.length>0)for(o=0;o<t.length;o++)a.headers[e(t[o]).index()]={sorter:"value-rank"};if(t=n.find("th.rank-numeric"),t.length>0)for(o=0;o<t.length;o++)a.headers[e(t[o]).index()]={sorter:"rank-numeric"};n.tablesorter(a)}))})}});