import"./jquery.e8a081b2.js";import{D as d}from"./dataTables.responsive.8ca70206.js";import{f as l,c}from"./utility.35c60188.js";import"./dataTables.fixedColumns.be792f05.js";import"./_commonjsHelpers.b8add541.js";let i=null;function p(){let t=[{data:"id"},{data:"player_name",render:function(a,s,e,n){return`<span class="list-profile"><img src="${e.avatar}" /><a href="https://steamcommunity.com/profiles/${e.player_steamid}">${a}</a></span>`}},{data:"player_ip"},{data:"admin_steamid",render:function(a,s,e,n){return a!=="Console"?`<a href="https://steamcommunity.com/profiles/${a}">${e.admin_name}</a>`:a}},{data:"reason"},{data:"duration"},{data:"ends"},{data:"created",render:function(a,s,e,n){return l(a)}},{data:"server_id"},{data:"status"},{data:"action",render:function(a,s,e,n){return'<div class="action-container">'+a+"</div>"}},{data:"duration",render:function(a,s,e,n){let r=c(e.created,e.ends),o="bg-warning";return e.status.includes("badge badge-primary")?(o="bg-primary",r=100):e.duration.includes("badge badge-danger")?o="bg-danger":r===100&&(o="bg-success"),r=isNaN(r)?100:r,`
                <div class="progress">
                    <div class="progress-bar progress-bar-striped progress-bar-animated custom-progress ${o}"
                    role="progressbar" style="width: ${r}%" aria-valuenow="${r}"
                    aria-valuemin="0" aria-valuemax="100">
                    </div>
                </div>`}}];isSuperAdmin||(t=t.filter(a=>a.data!=="player_ip")),i=new d("#bansList",{processing:!0,responsive:!0,serverSide:!0,ajax:{url:bansListUrl,headers:{"X-CSRF-TOKEN":$('meta[name="csrf-token"]').attr("content")},type:"POST",dataType:"json"},language:{search:window.translations.searchByPlayernameAndSteamid,processing:'<div class="spinner"></div>'},order:[[0,"desc"]],columns:t})}p();$(document).on("click",".unban-btn",function(){let t=$(this).data("player-steamid");$.ajax({url:getPlayerUnBanUrl(t),type:"PUT",dataType:"json",data:{playerSteamid:t},headers:{"X-CSRF-TOKEN":$('meta[name="csrf-token"]').attr("content")},success:function(a){Snackbar.show({text:"Player unbanned successfully.",actionTextColor:"#fff",backgroundColor:"#00ab55",pos:"top-center"}),i.ajax.reload()},error:function(a,s,e){Snackbar.show({text:"Failed to unban player!",actionTextColor:"#fff",backgroundColor:"#e7515a",pos:"top-center"})}})});
