import b from"jquery";import{d as v}from"./datatables-BMRvz3S3.js";import"./datatables-bbQliV7G.js";/* empty css                                  */document.addEventListener("DOMContentLoaded",function(){const r=b("#domainsTable");r.length!==0&&r.DataTable(v.getDefaultConfig({order:[[0,"desc"]],columnDefs:[{targets:0,responsivePriority:2,orderable:!0},{targets:1,responsivePriority:1,orderable:!0},{targets:2,responsivePriority:3,orderable:!0},{targets:3,responsivePriority:6,orderable:!0,className:"d-none d-md-table-cell"},{targets:4,responsivePriority:4,orderable:!0},{targets:5,responsivePriority:5,orderable:!0,className:"d-none d-md-table-cell"},{targets:-1,responsivePriority:1,orderable:!1,searchable:!1,className:"text-end"}]}))});window.viewDomainDetails=function(r){var a,s,l,d;const o=new bootstrap.Modal(document.getElementById("domainDetailsModal")),e=document.getElementById("domainDetailsContent");e.innerHTML='<div class="text-center py-4"><i class="fas fa-spinner fa-spin"></i> '+(((a=window.translations)==null?void 0:a.loading)||"Yükleniyor...")+"</div>",o.show();const n=(l=(s=window.routes)==null?void 0:s.domainDetails)==null?void 0:l.replace(":id",r);if(!n){e.innerHTML='<div class="alert alert-danger">'+(((d=window.translations)==null?void 0:d.common_error)||"Hata oluştu")+"</div>";return}fetch(n).then(t=>t.json()).then(t=>{var i;t.success?e.innerHTML=t.html:e.innerHTML='<div class="alert alert-danger">'+(t.message||((i=window.translations)==null?void 0:i.error)||"Hata oluştu")+"</div>"}).catch(t=>{var i;console.error("Error:",t),e.innerHTML='<div class="alert alert-danger">'+(((i=window.translations)==null?void 0:i.common_error)||"Hata oluştu")+"</div>"})};window.toggleAutoRenew=async function(r,o){var s,l,d,t,i,c,w,m,u,f;const e=o?((s=window.translations)==null?void 0:s.confirmAutoRenewEnable)||"Otomatik yenileme etkinleştirilsin mi?":((l=window.translations)==null?void 0:l.confirmAutoRenewDisable)||"Otomatik yenileme devre dışı bırakılsın mı?";if(!await window.showConfirm(e,{confirmText:((d=window.translations)==null?void 0:d.confirm)||"Evet",cancelText:((t=window.translations)==null?void 0:t.cancel)||"İptal",icon:"question"}))return;const a=(c=(i=window.routes)==null?void 0:i.domainToggleAutoRenew)==null?void 0:c.replace(":id",r);if(!a){window.showError(((w=window.translations)==null?void 0:w.common_error)||"Hata oluştu");return}try{const p=await(await fetch(a,{method:"POST",headers:{"Content-Type":"application/json","X-CSRF-TOKEN":window.csrfToken||((m=document.querySelector('meta[name="csrf-token"]'))==null?void 0:m.getAttribute("content"))},body:JSON.stringify({auto_renew:o})})).json();p.success?location.reload():window.showError(p.message||((u=window.translations)==null?void 0:u.error)||"Hata oluştu")}catch(g){console.error("Error:",g),window.showError(((f=window.translations)==null?void 0:f.common_error)||"Hata oluştu")}};window.manageDNS=function(r){var e,n;const o=(n=(e=window.routes)==null?void 0:e.domainDNS)==null?void 0:n.replace(":id",r);o&&window.open(o,"_blank")};window.manageEmailForwarding=function(r){var e,n;const o=(n=(e=window.routes)==null?void 0:e.domainEmailForwarding)==null?void 0:n.replace(":id",r);o&&window.open(o,"_blank")};window.managePrivacy=function(r){var e,n;const o=(n=(e=window.routes)==null?void 0:e.domainPrivacy)==null?void 0:n.replace(":id",r);o&&window.open(o,"_blank")};window.renewDomain=function(r){var e,n;const o=(n=(e=window.routes)==null?void 0:e.domainRenew)==null?void 0:n.replace(":id",r);o&&(window.location.href=o)};
