um_friends_ajax=!1,jQuery(document).ready(function(){jQuery(".um-friends-m").length&&(jQuery(".um-friends-m").each(function(){var e=jQuery(this).attr("data-max");0e&&(e=e-1,jQuery(this).find(".um-friends-m-user:gt("+e+")").hide(),e=jQuery(this).find(".um-friends-m-user").length-jQuery(this).find(".um-friends-m-user:visible").length,jQuery('
+'+e+"
").insertAfter(jQuery(this).find(".um-friends-m-user:visible:last")))}),jQuery(document.body).on("click",".um-friends-m-user.show-all",function(e){return e.preventDefault(),jQuery(this).parents(".um-friends-m").find(".um-friends-m-user").show(),jQuery(this).hide(),!1})),jQuery(document.body).on("mouseenter",".um-unfriend-btn",function(e){jQuery(this).hasClass("um_friends_ajax")||(jQuery(this).addClass("um-unfriend-btn2"),jQuery(this).html(jQuery(this).attr("data-unfriend")))}),jQuery(document.body).on("mouseleave",".um-unfriend-btn2",function(e){jQuery(this).hasClass("um_friends_ajax")||(jQuery(this).removeClass("um-unfriend-btn2"),jQuery(this).html(jQuery(this).attr("data-friends")))}),jQuery(document.body).on("mouseenter",".um-friend-pending-btn",function(){jQuery(this).addClass("cancel-friend-request"),jQuery(this).html(jQuery(this).attr("data-cancel-friend-request"))}),jQuery(document.body).on("mouseleave",".um-friend-pending-btn",function(){jQuery(this).removeClass("cancel-friend-request"),jQuery(this).html(jQuery(this).attr("data-pending-friend-request"))}),jQuery(document.body).on("click",".um-friend-btn",function(e){var n;return e.preventDefault(),um_friends_ajax||(um_friends_ajax=!0,(n=jQuery(this)).addClass("um_friends_ajax"),e=n.data("user_id"),wp.ajax.send("um_friends_add",{data:{user_id:e,nonce:um_scripts.nonce},success:function(e){n.replaceWith(e.btn),um_friends_ajax=!1,jQuery(".um-profile").length&&jQuery(".um-profile-friends-requests-sent").html(e.requests_sent)},error:function(e){console.log(e),um_friends_ajax=!1}})),!1}),jQuery(document.body).on("click",".um-unfriend-btn",function(e){var n;return e.preventDefault(),confirm(wp.i18n.__("Please confirm that you want to remove this user from your friends list.","um-friends"))&&!um_friends_ajax&&(um_friends_ajax=!0,(n=jQuery(this)).addClass("um_friends_ajax"),e=n.data("user_id"),wp.ajax.send("um_friends_unfriend",{data:{user_id:e,nonce:um_scripts.nonce},success:function(e){n.replaceWith(e.btn),um_friends_ajax=!1,jQuery(".um-profile").length&&jQuery(".um-profile-friends").html(e.friends)},error:function(e){console.log(e),um_friends_ajax=!1}})),!1}),jQuery(document.body).on("click",".um-friend-accept-btn",function(e){var n,r;return e.preventDefault(),in_dropdown=!1,um_friends_ajax||(um_friends_ajax=!0,(n=jQuery(this)).addClass("um_friends_ajax"),e=n.data("user_id"),r=n.parent().find(".um-friend-reject-btn"),0