$(document).ready(function(){$("#server_id").select2({placeholder:window.translations.selectServers}),$("#group_id").select2({placeholder:window.translations.selectGroups}),document.addEventListener("change",function(e){if(e.target.matches("#permanent")){var t=document.getElementById("ends");t.disabled=e.target.checked,e.target.checked&&(t.value="")}}),$("#flagsPermission").on("click",function(){$(".flags").show(),$(".groups").hide(),$("#group_id").attr("disabled","true")}),$("#groups").on("click",function(){$(".flags").hide(),$(".groups").show(),$("#group_id").removeAttr("disabled"),document.querySelectorAll('input[name="permissions[]"]').forEach(function(t){t.checked=!1})})});
