text: !function(e){function n(n,o){e("#bp-groups-new-members-list").append('<li data-login="'+o.item.value+'"><a href="#" class="bp-groups-remove-new-member">x</a> '+o.item.label+"</li>")}var o="undefined"!=typeof group_id?"&group_id="+group_id:"";e(document).ready(function(){window.warn_on_leave=!1,e(".bp-suggest-user").autocomplete({source:ajaxurl+"?action=bp_group_admin_member_autocomplete"+o,delay:500,minLength:2,position:"undefined"!=typeof isRtl&&isRtl?{my:"right top",at:"right bottom",offset:"0, -1"}:{offset:"0, -1"},open:function(){e(this).addClass("open")},close:function(){e(this).removeClass("open"),e(this).val("")},select:function(e,o){n(0,o)}}),e("#bp-groups-new-members").prop("placeholder",BP_Group_Admin.add_member_placeholder),e("#bp_group_add_members").on("click",".bp-groups-remove-new-member",function(n){n.preventDefault(),e(n.target.parentNode).remove()}),e(document).on("change",'input#bp-groups-name, input#bp-groups-description, select.bp-groups-role, #bp-groups-settings-section-status input[type="radio"]',function(){window.warn_on_leave=!0}),e("input#save").on("click",function(){var n=[];e("#bp-groups-new-members-list li").each(function(){n.push(e(this).data("login"))}),n.length&&e("#bp-groups-new-members").val("").val(n.join(", ")),window.warn_on_leave=!1}),window.onbeforeunload=function(){if(window.warn_on_leave)return BP_Group_Admin.warn_on_leave}})}(jQuery);