/**handles:um_profile**/
jQuery(document).ready(function(){jQuery(".um-profile.um-viewing .um-profile-body .um-row").each(function(){var e=jQuery(this);0==e.find(".um-field").length&amp;&amp;(e.prev(".um-row-heading").remove(),e.remove())}),jQuery(".um-profile.um-viewing .um-profile-body").length&amp;&amp;0==jQuery(".um-profile.um-viewing .um-profile-body").find(".um-field").length&amp;&amp;(jQuery(".um-profile.um-viewing .um-profile-body").find(".um-row-heading,.um-row").remove(),jQuery(".um-profile-note").show()),jQuery(document.body).on("click",".um-profile-save",function(e){return e.preventDefault(),jQuery(this).parents(".um").find("form").trigger("submit"),!1}),jQuery(document.body).on("click",".um-profile-edit-a",function(e){jQuery(this).addClass("active")}),jQuery(document.body).on("click",".um-cover a.um-cover-add, .um-photo a",function(e){e.preventDefault()}),jQuery(document.body).on("click",".um-photo-modal",function(e){e.preventDefault();e=jQuery(this).attr("data-src");return um_new_modal("um_view_photo","fit",!0,e),!1}),jQuery(document.body).on("click",".um-reset-profile-photo",function(e){return jQuery(".um-profile-photo-img img").attr("src",jQuery(this).attr("data-default_src")),user_id=jQuery(this).attr("data-user_id"),metakey="profile_photo",UM.dropdown.hideAll(),jQuery.ajax({url:wp.ajax.settings.url,type:"post",data:{action:"um_delete_profile_photo",metakey:metakey,user_id:user_id,nonce:um_scripts.nonce}}),jQuery(this).parents("li").hide(),!1}),jQuery(document.body).on("click",".um-reset-cover-photo",function(e){var t=jQuery(this);return jQuery(".um-cover-overlay").hide(),jQuery(".um-cover-e").html('<a href="void(0);" class="um-cover-add" style="height: 370px"><span class="um-cover-add-i"><i class="um-icon-plus um-tip-n"></i></span></a>'),um_responsive(),user_id=jQuery(this).attr("data-user_id"),metakey="cover_photo",jQuery.ajax({url:wp.ajax.settings.url,type:"post",data:{action:"um_delete_cover_photo",metakey:metakey,user_id:user_id,nonce:um_scripts.nonce},success:function(e){t.hide()}}),UM.dropdown.hideAll(),!1}),jQuery(document.body).on("change keyup","#um-meta-bio",function(){if(void 0!==jQuery(this).val()){var t=jQuery(this).data("character-limit"),r=jQuery(this).data("html");let e=t-jQuery(this).val().length;e=(e=1===parseInt(r)?t-jQuery(this).val().replace(/(]+)&gt;)/gi,"").length:e)&lt;0?0:e,jQuery(&quot;span.um-meta-bio-character span.um-bio-limit&quot;).text(e);r=e&lt;5?&quot;red&quot;:&quot;&quot;;jQuery(&quot;span.um-meta-bio-character&quot;).css(&quot;color&quot;,r)}}),jQuery(&quot;#um-meta-bio&quot;).trigger(&quot;change&quot;),jQuery(&quot;.um-profile form&quot;).each(function(){let t=jQuery(this).data(&quot;description_key&quot;);jQuery(this).find(&#039;textarea[name=&quot;&#039;+t+&#039;&quot;]&#039;).length&amp;&amp;jQuery(document.body).on(&quot;change input&quot;,&#039;textarea[name=&quot;&#039;+t+&#039;&quot;]&#039;,function(e){jQuery(this).parents(&quot;form&quot;).find(&#039;textarea[name=&quot;&#039;+t+&#039;&quot;]&#039;).each(function(){jQuery(this).val(e.currentTarget.value),jQuery(&quot;#um-meta-bio&quot;)[0]!==e.currentTarget&amp;&amp;jQuery(&quot;#um-meta-bio&quot;)[0]===jQuery(this)[0]&amp;&amp;jQuery(this).trigger(&quot;change&quot;)})})}),jQuery(&quot;.um-profile-edit a.um_delete-item&quot;).on(&quot;click&quot;,function(e){if(e.preventDefault(),!confirm(wp.i18n.__(&quot;Are you sure that you want to delete this user?&quot;,&quot;ultimate-member&quot;)))return!1}),jQuery(&quot;.um-profile-nav a&quot;).on(&quot;touchend&quot;,function(e){jQuery(e.currentTarget).trigger(&quot;click&quot;)})});