From 177e827793efcc7859a548030060646818d4893c Mon Sep 17 00:00:00 2001 From: mdobprv Date: Mon, 31 Aug 2026 09:23:56 +0200 Subject: [PATCH] i18n: use existing translations in VMware dashboard --- web/index.html | 10 +-- web/src/dashboard.js | 166 +++++++++++++++++++++---------------------- 2 files changed, 88 insertions(+), 88 deletions(-) diff --git a/web/index.html b/web/index.html index dcfc8ae..d0fc6b4 100644 --- a/web/index.html +++ b/web/index.html @@ -7637,10 +7637,10 @@

PBS Encryption Key — Recovery Sheet

// #751 — some PBS builds emit it lowercase ("passed"), so match case-insensitively // or a healthy disk turns red. const smart=disk.status||disk.health||(disk.wearout!=null?`${disk.wearout}%`:'');const su=String(smart).toUpperCase();const ok=su==='PASSED'||su==='OK';const unk=!smart||su==='UNKNOWN';return/*#__PURE__*/React.createElement("span",{className:`px-2 py-0.5 rounded text-xs ${ok?'bg-green-500/20 text-green-400':unk?'bg-gray-500/20 text-gray-400':'bg-red-500/20 text-red-400'}`},smart||'N/A');})()))))))),pbsTasks.length>0&&/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("h2",{className:isCorporate?'corp-section-header':'text-sm font-semibold text-gray-400 uppercase tracking-wider mb-4'},"Recent Tasks"),/*#__PURE__*/React.createElement("div",{className:isCorporate?'overflow-hidden':'bg-proxmox-card border border-proxmox-border rounded-xl overflow-hidden'},/*#__PURE__*/React.createElement("table",{className:isCorporate?'corp-datagrid':'w-full text-sm'},/*#__PURE__*/React.createElement("thead",null,/*#__PURE__*/React.createElement("tr",{className:isCorporate?'':'border-b border-proxmox-border text-gray-500 text-xs'},/*#__PURE__*/React.createElement("th",{className:isCorporate?'':'text-left p-3'},"Type"),/*#__PURE__*/React.createElement("th",{className:isCorporate?'':'text-left p-3'},"Status"),/*#__PURE__*/React.createElement("th",{className:isCorporate?'':'text-left p-3'},"Started"),/*#__PURE__*/React.createElement("th",{className:isCorporate?'':'text-left p-3'},"Duration"),/*#__PURE__*/React.createElement("th",{className:isCorporate?'':'text-left p-3'},"Worker"))),/*#__PURE__*/React.createElement("tbody",null,pbsTasks.slice(0,10).map((task,i)=>/*#__PURE__*/React.createElement("tr",{key:i,className:"border-b border-proxmox-border/50 hover:bg-proxmox-hover/30 cursor-pointer",onClick:()=>viewPBSTaskLog(task.upid)},/*#__PURE__*/React.createElement("td",{className:"p-3 text-white font-medium"},task.worker_type||'-'),/*#__PURE__*/React.createElement("td",{className:"p-3"},/*#__PURE__*/React.createElement("span",{className:`px-2 py-0.5 rounded text-xs font-medium ${task.status==='OK'||task.status==='ok'?'bg-green-500/20 text-green-400':task.status&&task.status.startsWith&&task.status.startsWith('WARNINGS')?'bg-yellow-500/20 text-yellow-400':!task.endtime?'bg-blue-500/20 text-blue-400':'bg-red-500/20 text-red-400'}`},!task.endtime?'running':task.status||'?')),/*#__PURE__*/React.createElement("td",{className:"p-3 text-gray-400"},task.starttime?fmtDate(task.starttime*1000):'-'),/*#__PURE__*/React.createElement("td",{className:"p-3 text-gray-400"},task.starttime?pbsFormatDuration(task.starttime,task.endtime):'-'),/*#__PURE__*/React.createElement("td",{className:"p-3 text-gray-500 truncate max-w-[200px]"},task.worker_id||'-'))))))),selectedPBS.linked_clusters&&selectedPBS.linked_clusters.length>0&&/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("h2",{className:"text-sm font-semibold text-gray-400 uppercase tracking-wider mb-4"},"Linked PVE Clusters"),/*#__PURE__*/React.createElement("div",{className:"flex gap-2 flex-wrap"},selectedPBS.linked_clusters.map(cid=>{const cl=clusters.find(c=>c.id===cid);return cl?/*#__PURE__*/React.createElement("button",{key:cid,onClick:()=>{setSelectedCluster(cl);setSelectedPBS(null);},className:"px-3 py-2 rounded-lg bg-proxmox-card border border-proxmox-border text-sm text-gray-300 hover:text-white hover:border-proxmox-orange/30 transition-all flex items-center gap-2"},/*#__PURE__*/React.createElement(Icons.Server,{className:"w-4 h-4 text-proxmox-orange"}),cl.display_name||cl.name):null;}))),pbsTrafficControl&&pbsTrafficControl.length>0&&/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("h2",{className:isCorporate?'corp-section-header':'text-sm font-semibold text-gray-400 uppercase tracking-wider mb-4'},"Traffic Control"),/*#__PURE__*/React.createElement("div",{className:isCorporate?'overflow-hidden':'bg-proxmox-card border border-proxmox-border rounded-xl overflow-hidden'},/*#__PURE__*/React.createElement("table",{className:isCorporate?'corp-datagrid':'w-full text-sm'},/*#__PURE__*/React.createElement("thead",null,/*#__PURE__*/React.createElement("tr",{className:isCorporate?'':'border-b border-proxmox-border text-gray-500 text-xs'},/*#__PURE__*/React.createElement("th",{className:isCorporate?'':'text-left p-3'},"Name"),/*#__PURE__*/React.createElement("th",{className:isCorporate?'':'text-left p-3'},"Rate In"),/*#__PURE__*/React.createElement("th",{className:isCorporate?'':'text-left p-3'},"Rate Out"),/*#__PURE__*/React.createElement("th",{className:isCorporate?'':'text-left p-3'},"Burst In"),/*#__PURE__*/React.createElement("th",{className:isCorporate?'':'text-left p-3'},"Burst Out"),/*#__PURE__*/React.createElement("th",{className:isCorporate?'':'text-left p-3'},"Network"),/*#__PURE__*/React.createElement("th",{className:isCorporate?'':'text-left p-3'},"Timeframe"))),/*#__PURE__*/React.createElement("tbody",null,pbsTrafficControl.map((tc,i)=>/*#__PURE__*/React.createElement("tr",{key:i,className:"border-b border-proxmox-border/50 hover:bg-proxmox-hover/30"},/*#__PURE__*/React.createElement("td",{className:"p-3 text-white font-medium"},tc.name||'-'),/*#__PURE__*/React.createElement("td",{className:"p-3 text-cyan-400"},tc['rate-in']?formatBytes(tc['rate-in'])+'/s':'unlimited'),/*#__PURE__*/React.createElement("td",{className:"p-3 text-cyan-400"},tc['rate-out']?formatBytes(tc['rate-out'])+'/s':'unlimited'),/*#__PURE__*/React.createElement("td",{className:"p-3 text-gray-400"},tc['burst-in']?formatBytes(tc['burst-in']):'-'),/*#__PURE__*/React.createElement("td",{className:"p-3 text-gray-400"},tc['burst-out']?formatBytes(tc['burst-out']):'-'),/*#__PURE__*/React.createElement("td",{className:"p-3 text-gray-400"},(tc.network||[]).join(', ')||'all'),/*#__PURE__*/React.createElement("td",{className:"p-3 text-gray-500"},tc.timeframe||'always'))))))),pbsNotifications&&(pbsNotifications.targets?.length>0||pbsNotifications.matchers?.length>0)&&/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("h2",{className:"text-sm font-semibold text-gray-400 uppercase tracking-wider mb-4"},"Notifications"),/*#__PURE__*/React.createElement("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4"},pbsNotifications.targets?.length>0&&/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl p-4"},/*#__PURE__*/React.createElement("h3",{className:"text-sm font-medium text-gray-300 mb-3 flex items-center gap-2"},/*#__PURE__*/React.createElement(Icons.Bell,{className:"w-4 h-4 text-blue-400"}),"Targets (",pbsNotifications.targets.length,")"),/*#__PURE__*/React.createElement("div",{className:"space-y-2"},pbsNotifications.targets.map((t,i)=>/*#__PURE__*/React.createElement("div",{key:i,className:"flex items-center justify-between p-2 rounded bg-proxmox-dark/50"},/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-2"},/*#__PURE__*/React.createElement("span",{className:`px-2 py-0.5 rounded text-xs font-medium ${t.type==='sendmail'?'bg-green-500/20 text-green-400':t.type==='smtp'?'bg-blue-500/20 text-blue-400':t.type==='gotify'?'bg-purple-500/20 text-purple-400':t.type==='webhook'?'bg-orange-500/20 text-orange-400':'bg-gray-500/20 text-gray-400'}`},t.type||'unknown'),/*#__PURE__*/React.createElement("span",{className:"text-white text-sm"},t.name||t.endpoint||'-')),t.disable&&/*#__PURE__*/React.createElement("span",{className:"text-xs text-red-400"},"disabled"))))),pbsNotifications.matchers?.length>0&&/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl p-4"},/*#__PURE__*/React.createElement("h3",{className:"text-sm font-medium text-gray-300 mb-3 flex items-center gap-2"},/*#__PURE__*/React.createElement(Icons.Filter,{className:"w-4 h-4 text-yellow-400"}),"Matchers (",pbsNotifications.matchers.length,")"),/*#__PURE__*/React.createElement("div",{className:"space-y-2"},pbsNotifications.matchers.map((m,i)=>/*#__PURE__*/React.createElement("div",{key:i,className:"flex items-center justify-between p-2 rounded bg-proxmox-dark/50"},/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("span",{className:"text-white text-sm"},m.name||'-'),m.target&&/*#__PURE__*/React.createElement("span",{className:"text-xs text-gray-500 ml-2"},"to: ",Array.isArray(m.target)?m.target.join(', '):m.target)),m.disable&&/*#__PURE__*/React.createElement("span",{className:"text-xs text-red-400"},"disabled"))))))),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("div",{className:"flex items-center justify-between mb-4"},/*#__PURE__*/React.createElement("h2",{className:"text-sm font-semibold text-gray-400 uppercase tracking-wider"},"System Log"),/*#__PURE__*/React.createElement("button",{onClick:()=>fetchPBSSyslog(selectedPBS.id,200),className:"text-xs text-gray-500 hover:text-white transition-colors flex items-center gap-1"},/*#__PURE__*/React.createElement(Icons.RefreshCw,{className:"w-3 h-3"}),"Load More")),pbsSyslog.length>0?/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-dark border border-proxmox-border rounded-xl p-3 max-h-64 overflow-y-auto font-mono text-xs"},pbsSyslog.map((entry,i)=>/*#__PURE__*/React.createElement("div",{key:i,className:`py-0.5 ${(entry.t||entry.n||'').toLowerCase().includes('error')?'text-red-400':(entry.t||entry.n||'').toLowerCase().includes('warn')?'text-yellow-400':'text-gray-400'}`},entry.t||entry.n||JSON.stringify(entry)))):/*#__PURE__*/React.createElement("button",{onClick:()=>fetchPBSSyslog(selectedPBS.id),className:"w-full text-center py-6 text-gray-500 bg-proxmox-card border border-proxmox-border rounded-xl hover:border-blue-500/30 transition-all cursor-pointer"},/*#__PURE__*/React.createElement(Icons.Terminal,{className:"w-6 h-6 mx-auto mb-2 opacity-30"}),/*#__PURE__*/React.createElement("span",{className:"text-sm"},"Click to load syslog")))),pbsActiveTab==='datastores'&&/*#__PURE__*/React.createElement("div",{className:"flex gap-6"},/*#__PURE__*/React.createElement("div",{className:"w-64 shrink-0 space-y-2"},/*#__PURE__*/React.createElement("h3",{className:"text-sm font-semibold text-gray-400 uppercase tracking-wider mb-2"},"Datastores"),/*#__PURE__*/React.createElement(PbsCapacityForecast,{pbsId:selectedPBS.id,authFetch:authFetch,apiUrl:API_URL}),pbsDatastores.map(ds=>{const name=ds.name||ds.store;const used=ds.used||0;const total=ds.used&&ds.avail?ds.used+ds.avail:1;const pct=total>0?(used/total*100).toFixed(0):0;return/*#__PURE__*/React.createElement("button",{key:name,onClick:()=>{setPbsSelectedStore(name);setPbsSelectedGroup(null);setPbsSelectedNs('');},className:`w-full text-left px-3 py-2.5 rounded-xl transition-all ${pbsSelectedStore===name?'bg-blue-500/20 border border-blue-500/30 text-white':'bg-proxmox-card border border-proxmox-border text-gray-300 hover:border-blue-500/20'}`},/*#__PURE__*/React.createElement("div",{className:"flex items-center justify-between"},/*#__PURE__*/React.createElement("span",{className:"text-sm font-medium truncate"},name),/*#__PURE__*/React.createElement("span",{className:"text-xs text-gray-500"},pct,"%")),/*#__PURE__*/React.createElement("div",{className:"w-full h-1 bg-proxmox-dark rounded-full mt-1.5 overflow-hidden"},/*#__PURE__*/React.createElement("div",{className:"h-full bg-blue-500 rounded-full",style:{width:`${pct}%`}})));})),/*#__PURE__*/React.createElement("div",{className:"flex-1 min-w-0 space-y-6"},pbsSelectedStore?/*#__PURE__*/React.createElement(React.Fragment,null,isAdmin&&/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-2 flex-wrap"},/*#__PURE__*/React.createElement("button",{onClick:()=>{setPbsActionLoading(p=>({...p,gc:true}));pbsAction('gc',pbsSelectedStore).finally(()=>setPbsActionLoading(p=>({...p,gc:false})));},disabled:pbsActionLoading.gc,className:"px-3 py-2 rounded-lg bg-proxmox-card border border-proxmox-border text-sm text-gray-300 hover:text-white hover:border-blue-500/30 transition-all flex items-center gap-2 disabled:opacity-50"},/*#__PURE__*/React.createElement(Icons.Trash,{className:"w-4 h-4"})," ",pbsActionLoading.gc?'Starting...':'Garbage Collection'),/*#__PURE__*/React.createElement("button",{onClick:()=>{setPbsActionLoading(p=>({...p,verify:true}));pbsAction('verify',pbsSelectedStore).finally(()=>setPbsActionLoading(p=>({...p,verify:false})));},disabled:pbsActionLoading.verify,className:"px-3 py-2 rounded-lg bg-proxmox-card border border-proxmox-border text-sm text-gray-300 hover:text-white hover:border-green-500/30 transition-all flex items-center gap-2 disabled:opacity-50"},/*#__PURE__*/React.createElement(Icons.CheckCircle,{className:"w-4 h-4"})," ",pbsActionLoading.verify?'Starting...':'Verify'),/*#__PURE__*/React.createElement("button",{onClick:()=>setShowPbsPrune(pbsSelectedStore),className:"px-3 py-2 rounded-lg bg-proxmox-card border border-proxmox-border text-sm text-gray-300 hover:text-white hover:border-yellow-500/30 transition-all flex items-center gap-2"},/*#__PURE__*/React.createElement(Icons.Archive,{className:"w-4 h-4"})," Prune")),(()=>{const currentDs=pbsDatastores.find(d=>(d.name||d.store)===pbsSelectedStore);const gcStatus=currentDs?.detail?.['gc-status']||{};return/*#__PURE__*/React.createElement("div",{className:"flex flex-wrap gap-4 items-start"},pbsNamespaces.length>0&&/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl p-3 flex items-center gap-2"},/*#__PURE__*/React.createElement("span",{className:"text-xs text-gray-500"},"Namespace:"),/*#__PURE__*/React.createElement("select",{className:"bg-proxmox-dark border border-proxmox-border rounded px-2 py-1 text-sm text-white",value:pbsSelectedNs,onChange:e=>{const ns=e.target.value;setPbsSelectedNs(ns);setPbsGroups([]);setPbsSnapshots([]);fetchPBSGroups(selectedPBS.id,pbsSelectedStore,ns);}},/*#__PURE__*/React.createElement("option",{value:""},"Root"),pbsNamespaces.map((ns,i)=>/*#__PURE__*/React.createElement("option",{key:i,value:ns.ns||ns.name},ns.ns||ns.name)))),gcStatus['last-run-endtime']&&/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl p-3 flex-1 min-w-[300px]"},/*#__PURE__*/React.createElement("span",{className:"text-xs text-gray-500 block mb-1.5"},"Garbage Collection"),/*#__PURE__*/React.createElement("div",{className:"grid grid-cols-2 gap-x-4 gap-y-1 text-xs"},/*#__PURE__*/React.createElement("span",{className:"text-gray-500"},"Last GC:"),/*#__PURE__*/React.createElement("span",{className:"text-gray-300"},fmtDate(gcStatus['last-run-endtime']*1000)),/*#__PURE__*/React.createElement("span",{className:"text-gray-500"},"Duration:"),/*#__PURE__*/React.createElement("span",{className:"text-gray-300"},gcStatus['last-run-duration']?`${Math.floor(gcStatus['last-run-duration']/60)}m ${gcStatus['last-run-duration']%60}s`:'-'),/*#__PURE__*/React.createElement("span",{className:"text-gray-500"},"Dedup Factor:"),/*#__PURE__*/React.createElement("span",{className:"text-cyan-400 font-medium"},(gcStatus['dedup-factor']||1).toFixed(2),"x"),/*#__PURE__*/React.createElement("span",{className:"text-gray-500"},"Disk Chunks:"),/*#__PURE__*/React.createElement("span",{className:"text-gray-300"},(gcStatus['disk-chunks']||0).toLocaleString()),/*#__PURE__*/React.createElement("span",{className:"text-gray-500"},"Disk Bytes:"),/*#__PURE__*/React.createElement("span",{className:"text-gray-300"},formatBytes(gcStatus['disk-bytes']||0)),gcStatus['pending-chunks']>0&&/*#__PURE__*/React.createElement(React.Fragment,null,/*#__PURE__*/React.createElement("span",{className:"text-gray-500"},"Pending:"),/*#__PURE__*/React.createElement("span",{className:"text-yellow-400"},gcStatus['pending-chunks']," chunks (",formatBytes(gcStatus['pending-bytes']||0),")")),gcStatus['removed-chunks']>0&&/*#__PURE__*/React.createElement(React.Fragment,null,/*#__PURE__*/React.createElement("span",{className:"text-gray-500"},"Removed:"),/*#__PURE__*/React.createElement("span",{className:"text-green-400"},gcStatus['removed-chunks']," chunks (",formatBytes(gcStatus['removed-bytes']||0),")")))));})(),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("h3",{className:"text-sm font-semibold text-gray-400 uppercase tracking-wider mb-3"},"Backup Groups (",pbsGroups.length,")"),pbsGroups.length>0?/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl overflow-hidden"},/*#__PURE__*/React.createElement("table",{className:"w-full text-sm"},/*#__PURE__*/React.createElement("thead",null,/*#__PURE__*/React.createElement("tr",{className:"border-b border-proxmox-border text-gray-500 text-xs"},/*#__PURE__*/React.createElement("th",{className:"text-left p-3"},t('type')||'Type'),/*#__PURE__*/React.createElement("th",{className:"text-left p-3"},t('vmid')||'ID'," / ",t('name')||'Name'),/*#__PURE__*/React.createElement("th",{className:"text-left p-3"},t('snapshots')||'Backups'),/*#__PURE__*/React.createElement("th",{className:"text-left p-3"},t('lastBackup')||'Last Backup'),/*#__PURE__*/React.createElement("th",{className:"text-left p-3"},t('size')||'Size'),/*#__PURE__*/React.createElement("th",{className:"text-right p-3"},t('notes')||'Notes'))),/*#__PURE__*/React.createElement("tbody",null,pbsGroups.sort((a,b)=>`${a['backup-type']}/${a['backup-id']}`.localeCompare(`${b['backup-type']}/${b['backup-id']}`)).map((grp,i)=>/*#__PURE__*/React.createElement("tr",{key:i,className:`border-b border-proxmox-border/50 hover:bg-proxmox-hover/30 cursor-pointer ${pbsSelectedGroup===`${grp['backup-type']}/${grp['backup-id']}`?'bg-blue-500/10':''}`,onClick:()=>setPbsSelectedGroup(`${grp['backup-type']}/${grp['backup-id']}`)},/*#__PURE__*/React.createElement("td",{className:"p-3"},/*#__PURE__*/React.createElement("span",{className:`px-2 py-0.5 rounded text-xs font-medium ${grp['backup-type']==='vm'?'bg-blue-500/20 text-blue-400':grp['backup-type']==='ct'?'bg-green-500/20 text-green-400':'bg-purple-500/20 text-purple-400'}`},grp['backup-type'])),/*#__PURE__*/React.createElement("td",{className:"p-3 text-white font-medium"},/*#__PURE__*/React.createElement("span",{className:"font-mono"},grp['backup-id']),(()=>{const nm=grp.vm_name||pbsLookupName(grp['backup-type'],grp['backup-id']);return nm?/*#__PURE__*/React.createElement("span",{className:"ml-2 text-gray-400 font-normal",title:nm},"\xB7 ",nm):null;})()),/*#__PURE__*/React.createElement("td",{className:"p-3 text-gray-300"},grp['backup-count']||grp.count||'-'),/*#__PURE__*/React.createElement("td",{className:"p-3 text-gray-400"},grp['last-backup']?fmtDate(grp['last-backup']*1000):'-'),/*#__PURE__*/React.createElement("td",{className:"p-3 text-gray-400"},grp.size?formatBytes(grp.size):'-'),/*#__PURE__*/React.createElement("td",{className:"p-3 text-right",onClick:e=>e.stopPropagation()},/*#__PURE__*/React.createElement("button",{onClick:()=>{const nm=pbsLookupName(grp['backup-type'],grp['backup-id']);const lbl=nm?`${grp['backup-type']}/${grp['backup-id']} (${nm})`:`${grp['backup-type']}/${grp['backup-id']}`;setPbsEditingNotes({type:'group',params:{'backup-type':grp['backup-type'],'backup-id':grp['backup-id']},label:lbl});setPbsNotesText(grp.comment||grp.notes||'');},className:"px-2 py-1 rounded text-xs text-gray-500 hover:text-cyan-400 hover:bg-cyan-500/10 transition-all",title:t('groupNotes')||'Group Notes'},/*#__PURE__*/React.createElement(Icons.FileText,{className:"w-3.5 h-3.5"})))))))):/*#__PURE__*/React.createElement("div",{className:"text-center py-8 text-gray-500 bg-proxmox-card border border-proxmox-border rounded-xl"},"No backup groups found")),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("div",{className:"flex items-center justify-between mb-3"},/*#__PURE__*/React.createElement("h3",{className:"text-sm font-semibold text-gray-400 uppercase tracking-wider"},t('snapshots')||'Snapshots'," ",pbsSelectedGroup?(()=>{const[bt,bid]=pbsSelectedGroup.split('/');const nm=pbsLookupName(bt,bid);return` - ${pbsSelectedGroup}${nm?` · ${nm}`:''}`;})():`(${t('all')||'All'})`),pbsSelectedGroup&&/*#__PURE__*/React.createElement("button",{onClick:()=>setPbsSelectedGroup(null),className:"text-xs text-gray-500 hover:text-white transition-colors"},"Show All")),(()=>{const filtered=pbsSelectedGroup?pbsSnapshots.filter(s=>`${s['backup-type']}/${s['backup-id']}`===pbsSelectedGroup):pbsSnapshots;const sorted=[...filtered].sort((a,b)=>(b['backup-time']||0)-(a['backup-time']||0));return sorted.length>0?/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl overflow-hidden"},/*#__PURE__*/React.createElement("table",{className:"w-full text-sm"},/*#__PURE__*/React.createElement("thead",null,/*#__PURE__*/React.createElement("tr",{className:"border-b border-proxmox-border text-gray-500 text-xs"},/*#__PURE__*/React.createElement("th",{className:"text-left p-3"},t('type')||'Type'," / ",t('vmid')||'ID'," / ",t('name')||'Name'),/*#__PURE__*/React.createElement("th",{className:"text-left p-3"},t('timestamp')||'Time'),/*#__PURE__*/React.createElement("th",{className:"text-left p-3"},t('size')||'Size'),/*#__PURE__*/React.createElement("th",{className:"text-left p-3"},t('verified')||'Verified'),/*#__PURE__*/React.createElement("th",{className:"text-center p-3"},t('protected')||'Protected'),/*#__PURE__*/React.createElement("th",{className:"text-right p-3"},t('actions')||'Actions'))),/*#__PURE__*/React.createElement("tbody",null,sorted.slice(0,50).map((snap,i)=>/*#__PURE__*/React.createElement("tr",{key:i,className:"border-b border-proxmox-border/50 hover:bg-proxmox-hover/30"},/*#__PURE__*/React.createElement("td",{className:"p-3"},/*#__PURE__*/React.createElement("span",{className:"text-white font-mono"},snap['backup-type'],"/",snap['backup-id']),(()=>{const nm=snap.vm_name||pbsLookupName(snap['backup-type'],snap['backup-id']);return nm?/*#__PURE__*/React.createElement("span",{className:"ml-2 text-gray-400",title:nm},"\xB7 ",nm):null;})()),/*#__PURE__*/React.createElement("td",{className:"p-3 text-gray-300"},snap['backup-time']?fmtDate(snap['backup-time']*1000):'-'),/*#__PURE__*/React.createElement("td",{className:"p-3 text-gray-400"},snap.size?formatBytes(snap.size):'-'),/*#__PURE__*/React.createElement("td",{className:"p-3"},snap.verification?/*#__PURE__*/React.createElement("span",{className:`px-2 py-0.5 rounded text-xs ${snap.verification.state==='ok'?'bg-green-500/20 text-green-400':'bg-red-500/20 text-red-400'}`},snap.verification.state):/*#__PURE__*/React.createElement("span",{className:"text-gray-600"},"-")),/*#__PURE__*/React.createElement("td",{className:"p-3 text-center"},/*#__PURE__*/React.createElement("button",{onClick:()=>isAdmin&&pbsToggleProtected(snap),className:`px-2 py-0.5 rounded text-xs transition-all ${snap.protected?'bg-yellow-500/20 text-yellow-400 border border-yellow-500/30':'bg-proxmox-dark text-gray-600 border border-proxmox-border'} ${isAdmin?'cursor-pointer hover:opacity-80':'cursor-default'}`,title:isAdmin?'Toggle protection':snap.protected?'Protected':'Unprotected'},snap.protected?Icons.Shield?/*#__PURE__*/React.createElement(Icons.Shield,{className:"w-3.5 h-3.5 inline"}):'Yes':'-')),/*#__PURE__*/React.createElement("td",{className:"p-3 text-right flex items-center justify-end gap-1"},snap['backup-type']==='host'?/*#__PURE__*/React.createElement("button",{onClick:()=>pbsOpenFileBrowser(snap),className:"px-2 py-1 rounded text-xs text-gray-500 hover:text-blue-400 hover:bg-blue-500/10 transition-all",title:"Browse Files"},Icons.FolderOpen?/*#__PURE__*/React.createElement(Icons.FolderOpen,{className:"w-3.5 h-3.5"}):/*#__PURE__*/React.createElement(Icons.Folder,{className:"w-3.5 h-3.5"})):/*#__PURE__*/React.createElement("button",{onClick:()=>pbsOpenFileBrowser(snap),className:"px-2 py-1 rounded text-xs text-gray-600 hover:text-blue-400 hover:bg-blue-500/10 transition-all",title:"Browse Catalog (if available)"},/*#__PURE__*/React.createElement(Icons.Folder,{className:"w-3.5 h-3.5"})),/*#__PURE__*/React.createElement("button",{onClick:()=>{const nm=pbsLookupName(snap['backup-type'],snap['backup-id']);const lbl=nm?`${snap['backup-type']}/${snap['backup-id']} (${nm})`:`${snap['backup-type']}/${snap['backup-id']}`;setPbsEditingNotes({type:'snapshot',params:{'backup-type':snap['backup-type'],'backup-id':snap['backup-id'],'backup-time':snap['backup-time']},label:lbl});setPbsNotesText(snap.comment||snap.notes||'');},className:"px-2 py-1 rounded text-xs text-gray-500 hover:text-cyan-400 hover:bg-cyan-500/10 transition-all",title:t('notes')||'Notes'},/*#__PURE__*/React.createElement(Icons.FileText,{className:"w-3.5 h-3.5"})),can('vm.backup')&&/*#__PURE__*/React.createElement("button",{onClick:()=>{const isoTime=new Date(snap['backup-time']*1000).toISOString().replace(/\.\d{3}Z$/,'Z');setShowRestoreWizard({snapshot:{volid:`pbs-${selectedPBS.name.toLowerCase().replace(/[^a-z0-9-]/g,'-')}:backup/${snap['backup-type']}/${snap['backup-id']}/${isoTime}`,vmid:parseInt(snap['backup-id']),type:snap['backup-type'],backup_time:snap['backup-time'],backup_time_iso:isoTime},datastoreName:pbsSelectedStore,clusterId:(selectedPBS.linked_clusters||[])[0],nodes:[]});},className:"px-2 py-1 rounded text-xs text-gray-500 hover:text-green-400 hover:bg-green-500/10 transition-all",title:t('restoreBackup')||'Restore'},/*#__PURE__*/React.createElement(Icons.RotateCcw,{className:"w-3.5 h-3.5"})),isAdmin&&/*#__PURE__*/React.createElement("button",{onClick:()=>{const nm=pbsLookupName(snap['backup-type'],snap['backup-id']);const label=nm?`${snap['backup-type']}/${snap['backup-id']} (${nm})`:`${snap['backup-type']}/${snap['backup-id']}`;if(confirm(`${t('deleteSnapshot')||'Delete snapshot'} ${label} @ ${fmtDate(snap['backup-time']*1000)}?`))pbsAction('delete-snapshot',pbsSelectedStore,{backup_type:snap['backup-type'],backup_id:snap['backup-id'],backup_time:snap['backup-time']});},className:"px-2 py-1 rounded text-xs text-gray-500 hover:text-red-400 hover:bg-red-500/10 transition-all",title:t('delete')||'Delete'},/*#__PURE__*/React.createElement(Icons.Trash,{className:"w-3.5 h-3.5"}))))))),sorted.length>50&&/*#__PURE__*/React.createElement("div",{className:"text-center py-2 text-xs text-gray-500"},"Showing 50 of ",sorted.length," snapshots")):/*#__PURE__*/React.createElement("div",{className:"text-center py-8 text-gray-500 bg-proxmox-card border border-proxmox-border rounded-xl"},"No snapshots found");})())):/*#__PURE__*/React.createElement("div",{className:"text-center py-16 text-gray-500"},/*#__PURE__*/React.createElement(Icons.Database,{className:"w-12 h-12 mx-auto mb-4 opacity-30"}),/*#__PURE__*/React.createElement("p",null,"Select a datastore to view details")))),pbsActiveTab==='tasks'&&/*#__PURE__*/React.createElement("div",{className:"space-y-4"},/*#__PURE__*/React.createElement("div",{className:"flex items-center justify-between"},/*#__PURE__*/React.createElement("h3",{className:"text-sm font-semibold text-gray-400 uppercase tracking-wider"},"Tasks (",pbsTasks.length,")"),/*#__PURE__*/React.createElement("button",{onClick:()=>fetchPBSTasks(selectedPBS.id),className:"text-xs text-gray-500 hover:text-white transition-colors flex items-center gap-1"},/*#__PURE__*/React.createElement(Icons.RefreshCw,{className:"w-3 h-3"})," Refresh")),/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl overflow-hidden"},/*#__PURE__*/React.createElement("table",{className:"w-full text-sm"},/*#__PURE__*/React.createElement("thead",null,/*#__PURE__*/React.createElement("tr",{className:"border-b border-proxmox-border text-gray-500 text-xs"},/*#__PURE__*/React.createElement("th",{className:"text-left p-3"},"Type"),/*#__PURE__*/React.createElement("th",{className:"text-left p-3"},"Worker ID"),/*#__PURE__*/React.createElement("th",{className:"text-left p-3"},"Status"),/*#__PURE__*/React.createElement("th",{className:"text-left p-3"},"Started"),/*#__PURE__*/React.createElement("th",{className:"text-left p-3"},"Duration"),/*#__PURE__*/React.createElement("th",{className:"text-left p-3"},"User"))),/*#__PURE__*/React.createElement("tbody",null,pbsTasks.map((task,i)=>/*#__PURE__*/React.createElement("tr",{key:i,className:`border-b border-proxmox-border/50 hover:bg-proxmox-hover/30 cursor-pointer ${pbsTaskLog?.upid===task.upid?'bg-blue-500/10':''}`,onClick:()=>viewPBSTaskLog(task.upid)},/*#__PURE__*/React.createElement("td",{className:"p-3 text-white font-medium"},task.worker_type||'-'),/*#__PURE__*/React.createElement("td",{className:"p-3 text-gray-300 truncate max-w-[200px]"},task.worker_id||'-'),/*#__PURE__*/React.createElement("td",{className:"p-3"},/*#__PURE__*/React.createElement("span",{className:`px-2 py-0.5 rounded text-xs font-medium ${task.status==='OK'||task.status==='ok'?'bg-green-500/20 text-green-400':task.status&&task.status.startsWith&&task.status.startsWith('WARNINGS')?'bg-yellow-500/20 text-yellow-400':!task.endtime?'bg-blue-500/20 text-blue-400 animate-pulse':'bg-red-500/20 text-red-400'}`},!task.endtime?'running':task.status||'?')),/*#__PURE__*/React.createElement("td",{className:"p-3 text-gray-400"},task.starttime?fmtDate(task.starttime*1000):'-'),/*#__PURE__*/React.createElement("td",{className:"p-3 text-gray-400"},task.starttime?pbsFormatDuration(task.starttime,task.endtime):'-'),/*#__PURE__*/React.createElement("td",{className:"p-3 text-gray-500"},task.user||'-'))))),pbsTasks.length===0&&/*#__PURE__*/React.createElement("div",{className:"text-center py-8 text-gray-500"},"No tasks found")),pbsTaskLog&&/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl overflow-hidden"},/*#__PURE__*/React.createElement("div",{className:"flex items-center justify-between p-3 border-b border-proxmox-border"},/*#__PURE__*/React.createElement("span",{className:"text-sm font-medium text-white"},"Task Log"),/*#__PURE__*/React.createElement("button",{onClick:()=>setPbsTaskLog(null),className:"text-gray-500 hover:text-white"},/*#__PURE__*/React.createElement(Icons.X,{className:"w-4 h-4"}))),/*#__PURE__*/React.createElement("div",{className:"p-3"},/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500 mb-2"},"Status: ",/*#__PURE__*/React.createElement("span",{className:pbsTaskLog.status?.status==='stopped'?'text-green-400':'text-blue-400'},pbsTaskLog.status?.status||'?'),pbsTaskLog.status?.exitstatus&&/*#__PURE__*/React.createElement("span",null," | Exit: ",pbsTaskLog.status.exitstatus)),/*#__PURE__*/React.createElement("pre",{className:"text-xs text-gray-300 font-mono bg-proxmox-dark rounded p-3 max-h-64 overflow-auto whitespace-pre-wrap"},(pbsTaskLog.log||[]).map(l=>l.t||l.d||'').join('\n')||'No log output')))),pbsActiveTab==='jobs'&&/*#__PURE__*/React.createElement("div",{className:"space-y-6"},/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("h3",{className:"text-sm font-semibold text-gray-400 uppercase tracking-wider mb-3"},"Sync Jobs (",(pbsJobs.sync||[]).length,")"),(pbsJobs.sync||[]).length>0?/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl overflow-hidden"},/*#__PURE__*/React.createElement("table",{className:"w-full text-sm"},/*#__PURE__*/React.createElement("thead",null,/*#__PURE__*/React.createElement("tr",{className:"border-b border-proxmox-border text-gray-500 text-xs"},/*#__PURE__*/React.createElement("th",{className:"text-left p-3"},"ID"),/*#__PURE__*/React.createElement("th",{className:"text-left p-3"},"Store"),/*#__PURE__*/React.createElement("th",{className:"text-left p-3"},"Remote"),/*#__PURE__*/React.createElement("th",{className:"text-left p-3"},"Schedule"),/*#__PURE__*/React.createElement("th",{className:"text-left p-3"},"Last Run"),isAdmin&&/*#__PURE__*/React.createElement("th",{className:"text-right p-3"},"Actions"))),/*#__PURE__*/React.createElement("tbody",null,(pbsJobs.sync||[]).map((job,i)=>/*#__PURE__*/React.createElement("tr",{key:i,className:"border-b border-proxmox-border/50 hover:bg-proxmox-hover/30"},/*#__PURE__*/React.createElement("td",{className:"p-3 text-white font-medium"},job.id),/*#__PURE__*/React.createElement("td",{className:"p-3 text-gray-300"},job.store),/*#__PURE__*/React.createElement("td",{className:"p-3 text-gray-400"},job.remote||'-'," / ",job['remote-store']||'-'),/*#__PURE__*/React.createElement("td",{className:"p-3 text-gray-400"},job.schedule||'manual'),/*#__PURE__*/React.createElement("td",{className:"p-3 text-gray-500"},job['last-run-endtime']?fmtDate(job['last-run-endtime']*1000):'-'),isAdmin&&/*#__PURE__*/React.createElement("td",{className:"p-3 text-right"},/*#__PURE__*/React.createElement("button",{onClick:()=>pbsRunJob('sync',job.id),className:"px-2 py-1 rounded text-xs bg-blue-500/20 text-blue-400 hover:bg-blue-500/30 transition-all flex items-center gap-1 ml-auto"},/*#__PURE__*/React.createElement(Icons.Play,{className:"w-3 h-3"})," Run"))))))):/*#__PURE__*/React.createElement("div",{className:"text-center py-6 text-gray-500 bg-proxmox-card border border-proxmox-border rounded-xl text-sm"},"No sync jobs configured")),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("h3",{className:"text-sm font-semibold text-gray-400 uppercase tracking-wider mb-3"},"Verify Jobs (",(pbsJobs.verify||[]).length,")"),(pbsJobs.verify||[]).length>0?/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl overflow-hidden"},/*#__PURE__*/React.createElement("table",{className:"w-full text-sm"},/*#__PURE__*/React.createElement("thead",null,/*#__PURE__*/React.createElement("tr",{className:"border-b border-proxmox-border text-gray-500 text-xs"},/*#__PURE__*/React.createElement("th",{className:"text-left p-3"},"ID"),/*#__PURE__*/React.createElement("th",{className:"text-left p-3"},"Store"),/*#__PURE__*/React.createElement("th",{className:"text-left p-3"},"Schedule"),/*#__PURE__*/React.createElement("th",{className:"text-left p-3"},"Ignore Verified"),/*#__PURE__*/React.createElement("th",{className:"text-left p-3"},"Last Run"),isAdmin&&/*#__PURE__*/React.createElement("th",{className:"text-right p-3"},"Actions"))),/*#__PURE__*/React.createElement("tbody",null,(pbsJobs.verify||[]).map((job,i)=>/*#__PURE__*/React.createElement("tr",{key:i,className:"border-b border-proxmox-border/50 hover:bg-proxmox-hover/30"},/*#__PURE__*/React.createElement("td",{className:"p-3 text-white font-medium"},job.id),/*#__PURE__*/React.createElement("td",{className:"p-3 text-gray-300"},job.store),/*#__PURE__*/React.createElement("td",{className:"p-3 text-gray-400"},job.schedule||'manual'),/*#__PURE__*/React.createElement("td",{className:"p-3 text-gray-400"},job['ignore-verified']?'Yes':'No'),/*#__PURE__*/React.createElement("td",{className:"p-3 text-gray-500"},job['last-run-endtime']?fmtDate(job['last-run-endtime']*1000):'-'),isAdmin&&/*#__PURE__*/React.createElement("td",{className:"p-3 text-right"},/*#__PURE__*/React.createElement("button",{onClick:()=>pbsRunJob('verify',job.id),className:"px-2 py-1 rounded text-xs bg-green-500/20 text-green-400 hover:bg-green-500/30 transition-all flex items-center gap-1 ml-auto"},/*#__PURE__*/React.createElement(Icons.Play,{className:"w-3 h-3"})," Run"))))))):/*#__PURE__*/React.createElement("div",{className:"text-center py-6 text-gray-500 bg-proxmox-card border border-proxmox-border rounded-xl text-sm"},"No verify jobs configured")),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("h3",{className:"text-sm font-semibold text-gray-400 uppercase tracking-wider mb-3"},"Prune Jobs (",(pbsJobs.prune||[]).length,")"),(pbsJobs.prune||[]).length>0?/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl overflow-hidden"},/*#__PURE__*/React.createElement("table",{className:"w-full text-sm"},/*#__PURE__*/React.createElement("thead",null,/*#__PURE__*/React.createElement("tr",{className:"border-b border-proxmox-border text-gray-500 text-xs"},/*#__PURE__*/React.createElement("th",{className:"text-left p-3"},"ID"),/*#__PURE__*/React.createElement("th",{className:"text-left p-3"},"Store"),/*#__PURE__*/React.createElement("th",{className:"text-left p-3"},"Schedule"),/*#__PURE__*/React.createElement("th",{className:"text-left p-3"},"Retention"),/*#__PURE__*/React.createElement("th",{className:"text-left p-3"},"Last Run"),isAdmin&&/*#__PURE__*/React.createElement("th",{className:"text-right p-3"},"Actions"))),/*#__PURE__*/React.createElement("tbody",null,(pbsJobs.prune||[]).map((job,i)=>/*#__PURE__*/React.createElement("tr",{key:i,className:"border-b border-proxmox-border/50 hover:bg-proxmox-hover/30"},/*#__PURE__*/React.createElement("td",{className:"p-3 text-white font-medium"},job.id),/*#__PURE__*/React.createElement("td",{className:"p-3 text-gray-300"},job.store),/*#__PURE__*/React.createElement("td",{className:"p-3 text-gray-400"},job.schedule||'manual'),/*#__PURE__*/React.createElement("td",{className:"p-3 text-gray-400 text-xs"},[job['keep-last']&&`L:${job['keep-last']}`,job['keep-daily']&&`D:${job['keep-daily']}`,job['keep-weekly']&&`W:${job['keep-weekly']}`,job['keep-monthly']&&`M:${job['keep-monthly']}`,job['keep-yearly']&&`Y:${job['keep-yearly']}`].filter(Boolean).join(' ')||'-'),/*#__PURE__*/React.createElement("td",{className:"p-3 text-gray-500"},job['last-run-endtime']?fmtDate(job['last-run-endtime']*1000):'-'),isAdmin&&/*#__PURE__*/React.createElement("td",{className:"p-3 text-right"},/*#__PURE__*/React.createElement("button",{onClick:()=>pbsRunJob('prune',job.id),className:"px-2 py-1 rounded text-xs bg-yellow-500/20 text-yellow-400 hover:bg-yellow-500/30 transition-all flex items-center gap-1 ml-auto"},/*#__PURE__*/React.createElement(Icons.Play,{className:"w-3 h-3"})," Run"))))))):/*#__PURE__*/React.createElement("div",{className:"text-center py-6 text-gray-500 bg-proxmox-card border border-proxmox-border rounded-xl text-sm"},"No prune jobs configured")),pbsRemotes.length>0&&/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("h3",{className:"text-sm font-semibold text-gray-400 uppercase tracking-wider mb-3"},"Remotes (",pbsRemotes.length,")"),/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl overflow-hidden"},/*#__PURE__*/React.createElement("table",{className:"w-full text-sm"},/*#__PURE__*/React.createElement("thead",null,/*#__PURE__*/React.createElement("tr",{className:"border-b border-proxmox-border text-gray-500 text-xs"},/*#__PURE__*/React.createElement("th",{className:"text-left p-3"},"Name"),/*#__PURE__*/React.createElement("th",{className:"text-left p-3"},"Host"),/*#__PURE__*/React.createElement("th",{className:"text-left p-3"},"Auth ID"),/*#__PURE__*/React.createElement("th",{className:"text-left p-3"},"Fingerprint"))),/*#__PURE__*/React.createElement("tbody",null,pbsRemotes.map((remote,i)=>/*#__PURE__*/React.createElement("tr",{key:i,className:"border-b border-proxmox-border/50"},/*#__PURE__*/React.createElement("td",{className:"p-3 text-white font-medium"},remote.name),/*#__PURE__*/React.createElement("td",{className:"p-3 text-gray-300"},remote.host||'-'),/*#__PURE__*/React.createElement("td",{className:"p-3 text-gray-400"},remote['auth-id']||remote.userid||'-'),/*#__PURE__*/React.createElement("td",{className:"p-3 text-gray-500 font-mono text-xs truncate max-w-[200px]"},remote.fingerprint?remote.fingerprint.substring(0,23)+'...':'-')))))))),showPbsPrune&&/*#__PURE__*/React.createElement("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/70 backdrop-blur-sm"},/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-2xl shadow-2xl w-full max-w-md animate-scale-in"},/*#__PURE__*/React.createElement("div",{className:"p-6"},/*#__PURE__*/React.createElement("h2",{className:"text-xl font-bold text-white mb-1"},"Prune Datastore"),/*#__PURE__*/React.createElement("p",{className:"text-sm text-gray-400 mb-4"},showPbsPrune),/*#__PURE__*/React.createElement("div",{className:"space-y-3"},[{k:'keep_last',l:'Keep Last'},{k:'keep_daily',l:'Keep Daily'},{k:'keep_weekly',l:'Keep Weekly'},{k:'keep_monthly',l:'Keep Monthly'},{k:'keep_yearly',l:'Keep Yearly'}].map(f=>/*#__PURE__*/React.createElement("div",{key:f.k,className:"flex items-center justify-between"},/*#__PURE__*/React.createElement("label",{className:"text-sm text-gray-300"},f.l),/*#__PURE__*/React.createElement("input",{type:"number",min:"0",max:"365",value:pbsPruneForm[f.k]||'',onChange:e=>setPbsPruneForm(p=>({...p,[f.k]:parseInt(e.target.value)||0})),className:"w-20 bg-proxmox-dark border border-proxmox-border rounded px-2 py-1 text-sm text-white text-center"}))),/*#__PURE__*/React.createElement("div",{className:"flex items-center justify-between pt-2"},/*#__PURE__*/React.createElement("label",{className:"text-sm text-gray-300"},"Dry Run (preview only)"),/*#__PURE__*/React.createElement("button",{onClick:()=>setPbsPruneForm(p=>({...p,dry_run:!p.dry_run})),className:`w-10 h-5 rounded-full transition-all ${pbsPruneForm.dry_run?'bg-blue-500':'bg-red-500'}`},/*#__PURE__*/React.createElement("div",{className:`w-4 h-4 bg-white rounded-full transition-transform ${pbsPruneForm.dry_run?'translate-x-5':'translate-x-0.5'}`}))),!pbsPruneForm.dry_run&&/*#__PURE__*/React.createElement("div",{className:"bg-red-500/10 border border-red-500/30 rounded-lg p-3 text-xs text-red-400"},"Warning: This will permanently delete backups that don't match the retention policy!")),/*#__PURE__*/React.createElement("div",{className:"flex justify-end gap-2 mt-6"},/*#__PURE__*/React.createElement("button",{onClick:()=>setShowPbsPrune(null),className:"px-4 py-2 rounded-lg bg-proxmox-dark text-gray-400 hover:text-white transition-colors text-sm"},"Cancel"),/*#__PURE__*/React.createElement("button",{onClick:()=>{pbsAction('prune',showPbsPrune,pbsPruneForm);setShowPbsPrune(null);},className:`px-4 py-2 rounded-lg text-white text-sm font-medium ${pbsPruneForm.dry_run?'bg-blue-500 hover:bg-blue-600':'bg-red-500 hover:bg-red-600'}`},pbsPruneForm.dry_run?'Preview Prune':'Execute Prune'))))),pbsActiveTab==='reports'&&/*#__PURE__*/React.createElement("div",{id:"pbs-report-content",className:isCorporate?'space-y-3':'space-y-5'},/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-3 flex-wrap"},/*#__PURE__*/React.createElement("div",{className:"flex gap-1"},[{id:'summary',label:t('reportSummary')||'Summary'},{id:'inventory',label:t('reportInventory')||'Inventory'},{id:'gap',label:t('reportGap')||'Gap Analysis'}].map(sub=>/*#__PURE__*/React.createElement("button",{key:sub.id,onClick:()=>setPbsReportSubTab(sub.id),className:`px-3 py-1.5 rounded text-xs font-medium transition-colors ${pbsReportSubTab===sub.id?'bg-blue-500 text-white':'bg-proxmox-dark text-gray-400 hover:text-white border border-proxmox-border'}`},sub.label))),pbsReportSubTab!=='inventory'&&/*#__PURE__*/React.createElement("select",{value:pbsReportDays,onChange:e=>setPbsReportDays(parseInt(e.target.value)),className:"bg-proxmox-dark border border-proxmox-border rounded px-2 py-1.5 text-xs text-white",title:t('reportWindow')||'Time window'},/*#__PURE__*/React.createElement("option",{value:1},t('last24h')||'Last 24h'),/*#__PURE__*/React.createElement("option",{value:7},t('last7d')||'Last 7 days'),/*#__PURE__*/React.createElement("option",{value:30},t('last30d')||'Last 30 days'),/*#__PURE__*/React.createElement("option",{value:90},t('last90d')||'Last 90 days'),/*#__PURE__*/React.createElement("option",{value:365},t('last365d')||'Last 365 days')),pbsReportSubTab==='gap'&&/*#__PURE__*/React.createElement("select",{value:pbsReportGapCluster,onChange:e=>setPbsReportGapCluster(e.target.value),className:"bg-proxmox-dark border border-proxmox-border rounded px-2 py-1.5 text-xs text-white"},/*#__PURE__*/React.createElement("option",{value:""},t('selectCluster')||'Select cluster...'),(clusters||[]).filter(c=>(selectedPBS?.linked_clusters||[]).includes(c.id)).map(c=>/*#__PURE__*/React.createElement("option",{key:c.id,value:c.id},c.name)),(selectedPBS?.linked_clusters||[]).length===0&&(clusters||[]).map(c=>/*#__PURE__*/React.createElement("option",{key:c.id,value:c.id},c.name))),/*#__PURE__*/React.createElement("div",{className:"flex-1"}),/*#__PURE__*/React.createElement("button",{onClick:()=>{if(pbsReportSubTab==='summary')fetchPBSReportSummary(selectedPBS.id,pbsReportDays);else if(pbsReportSubTab==='inventory')fetchPBSReportInventory(selectedPBS.id,0);else if(pbsReportSubTab==='gap')fetchPBSReportGap(selectedPBS.id,pbsReportGapCluster,pbsReportDays);},className:"px-2.5 py-1 text-xs rounded border border-proxmox-border text-gray-400 hover:text-white hover:border-gray-500",title:t('refresh')||'Refresh'},/*#__PURE__*/React.createElement(Icons.RefreshCw,{className:`w-3.5 h-3.5 ${pbsReportLoading?'animate-spin':''}`})),/*#__PURE__*/React.createElement("button",{onClick:()=>{const el=document.getElementById('pbs-report-content');if(!el)return;const run=()=>window.html2canvas(el,{backgroundColor:'#111a21',scale:2,useCORS:true}).then(c=>{const a=document.createElement('a');a.download=`pegaprox-pbs-${selectedPBS.name}-${pbsReportSubTab}-${new Date().toISOString().slice(0,10)}.png`;a.href=c.toDataURL('image/png');a.click();});if(window.html2canvas){run();return;}const s=document.createElement('script');s.src='/static/js/html2canvas.min.js';s.onload=run;s.onerror=()=>{const _ag=(()=>{try{return localStorage.getItem('pegaprox-air-gap')==='1';}catch(_){return false;}})();if(_ag){console.error('[air-gap] html2canvas missing locally; PNG export disabled');return;}const s2=document.createElement('script');s2.src='https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.4.1/html2canvas.min.js';s2.onload=run;document.head.appendChild(s2);};document.head.appendChild(s);},className:"px-2.5 py-1 text-xs rounded border border-proxmox-border text-gray-400 hover:text-white hover:border-gray-500",title:t('exportPng')||'Export as PNG'},"PNG"),/*#__PURE__*/React.createElement("button",{onClick:()=>{const blocks=[];const fmtB=n=>!n?'0 B':formatBytes(n);const fmtD=ts=>ts?new Date(ts*1000).toLocaleString():'—';if(pbsReportSubTab==='summary'&&pbsReportSummary){const r=pbsReportSummary;blocks.push({type:'stats',data:[{label:t('totalJobs')||'Jobs',value:String(r.totals?.jobs||0),color:'#3c82c8'},{label:t('success')||'Success',value:String(r.totals?.success||0),color:'#2a9f2a'},{label:t('warning')||'Warning',value:String(r.totals?.warning||0),color:'#c89600'},{label:t('failed')||'Failed',value:String(r.totals?.failed||0),color:'#dc3232'},{label:(t('successRate')||'Success rate')+' %',value:`${r.totals?.success_rate||0}%`,color:'#2a9f2a'}]});blocks.push({type:'spacer',height:4});blocks.push({type:'table',title:`${t('perVmRollup')||'Per-VM last backup'} (${t('reportWindow')||'Window'}: ${r.window?.days||pbsReportDays}d)`,columns:[t('type')||'Type',t('vmid')||'VMID',t('name')||'Name',t('lastBackup')||'Last backup',t('status')||'Status',t('size')||'Size',t('duration')||'Duration',`${t('datastore')||'Datastore'}/NS`,t('verified')||'Verified'],rows:(r.per_vm||[]).map(v=>[v.type||'-',String(v.vmid||'-'),v.vm_name||'-',fmtD(v.last_backup_ts),v.status||'-',fmtB(v.size),v.duration_s?`${Math.floor(v.duration_s/60)}m ${v.duration_s%60}s`:'-',`${v.datastore||'-'}${v.namespace?'/'+v.namespace:''}`,v.verified?'yes':'no'])});}else if(pbsReportSubTab==='inventory'&&pbsReportInventory){const r=pbsReportInventory;blocks.push({type:'stats',data:[{label:t('snapshots')||'Snapshots',value:String(r.count||0),color:'#3c82c8'}]});blocks.push({type:'spacer',height:4});blocks.push({type:'table',title:t('backupInventory')||'Backup Inventory',columns:[t('type')||'Type',t('vmid')||'VMID',t('name')||'Name',t('timestamp')||'Timestamp',t('datastore')||'Datastore',t('namespace')||'Namespace',t('size')||'Size',t('verified')||'Verified',t('protected')||'Protected'],rows:(r.entries||[]).map(e=>[e.type||'-',String(e.vmid||'-'),e.vm_name||'-',fmtD(e.backup_time),e.datastore||'-',e.namespace||'-',fmtB(e.size),e.verified?'ok':e.verified_state||'none',e.protected?'yes':'no'])});}else if(pbsReportSubTab==='gap'&&pbsReportGap){const r=pbsReportGap;blocks.push({type:'stats',data:[{label:t('protected')||'Protected',value:String(r.counts?.protected||0),color:'#2a9f2a'},{label:t('stale')||'Stale',value:String(r.counts?.stale||0),color:'#c89600'},{label:t('unprotected')||'Unprotected',value:String(r.counts?.unprotected||0),color:'#dc3232'}]});blocks.push({type:'spacer',height:4});blocks.push({type:'table',title:t('unprotectedVms')||'Unprotected VMs',columns:[t('type')||'Type',t('vmid')||'VMID',t('name')||'Name',t('node')||'Node',t('status')||'Status'],rows:(r.unprotected||[]).map(v=>[v.type,v.vmid,v.vm_name||'-',v.node,v.status])});blocks.push({type:'table',title:t('staleBackups')||'Stale (last backup older than window)',columns:[t('type')||'Type',t('vmid')||'VMID',t('name')||'Name',t('lastBackup')||'Last backup',`${t('datastore')||'Datastore'}/NS`],rows:(r.stale||[]).map(v=>[v.type,v.vmid,v.vm_name||'-',fmtD(v.last_backup_ts),`${v.datastore}${v.namespace?'/'+v.namespace:''}`])});blocks.push({type:'table',title:t('protected')||'Protected',columns:[t('type')||'Type',t('vmid')||'VMID',t('name')||'Name',t('lastBackup')||'Last backup',`${t('datastore')||'Datastore'}/NS`],rows:(r.protected||[]).map(v=>[v.type,v.vmid,v.vm_name||'-',fmtD(v.last_backup_ts),`${v.datastore}${v.namespace?'/'+v.namespace:''}`])});}generatePegaProxPDF({title:`PBS Report — ${pbsReportSubTab}`,subtitle:selectedPBS?.name,clusterName:pbsReportSubTab==='gap'&&pbsReportGapCluster?clusters.find(c=>c.id===pbsReportGapCluster)?.name||'':'',filename:`pegaprox-pbs-${selectedPBS?.name}-${pbsReportSubTab}-${new Date().toISOString().slice(0,10)}.pdf`,content:blocks,orientation:pbsReportSubTab==='inventory'?'landscape':'portrait'});},className:"px-2.5 py-1 text-xs rounded border border-proxmox-border text-gray-400 hover:text-white hover:border-gray-500",title:t('exportPdf')||'Export as PDF'},"PDF")),pbsReportLoading&&/*#__PURE__*/React.createElement("div",{className:"flex items-center justify-center py-12"},/*#__PURE__*/React.createElement(Icons.RotateCw,{className:"animate-spin w-6 h-6 text-gray-500"})),!pbsReportLoading&&pbsReportSubTab==='summary'&&pbsReportSummary&&(()=>{const r=pbsReportSummary;const t_total=r.totals?.jobs||0;const succ=r.totals?.success||0;const warn=r.totals?.warning||0;const fail=r.totals?.failed||0;const rate=r.totals?.success_rate||0;const perDayMax=Math.max(1,...(r.per_day||[]).map(d=>d.success+d.warning+d.failed));return/*#__PURE__*/React.createElement(React.Fragment,null,/*#__PURE__*/React.createElement("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-3"},/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl p-4 text-center"},/*#__PURE__*/React.createElement("div",{className:"text-3xl font-bold text-blue-400"},t_total),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500 mt-1"},t('totalJobs')||'Total jobs')),/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl p-4 text-center"},/*#__PURE__*/React.createElement("div",{className:"text-3xl font-bold text-green-400"},succ),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500 mt-1"},t('success')||'Success')),/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl p-4 text-center"},/*#__PURE__*/React.createElement("div",{className:"text-3xl font-bold text-yellow-400"},warn),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500 mt-1"},t('warning')||'Warning')),/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl p-4 text-center"},/*#__PURE__*/React.createElement("div",{className:"text-3xl font-bold text-red-400"},fail),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500 mt-1"},t('failed')||'Failed')),/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl p-4 text-center"},/*#__PURE__*/React.createElement("div",{className:`text-3xl font-bold ${rate>=95?'text-green-400':rate>=80?'text-yellow-400':'text-red-400'}`},rate,"%"),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500 mt-1"},t('successRate')||'Success rate'))),/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl p-4"},/*#__PURE__*/React.createElement("div",{className:"text-sm font-medium text-gray-300 mb-3"},t('perDayActivity')||'Per-day activity'),/*#__PURE__*/React.createElement("div",{className:"flex items-end gap-0.5 h-24"},(r.per_day||[]).map((d,i)=>{const totalDay=d.success+d.warning+d.failed;const h=totalDay/perDayMax*100;return/*#__PURE__*/React.createElement("div",{key:i,className:"flex-1 flex flex-col-reverse gap-0.5",title:`${d.date}: ${d.success} ok / ${d.warning} warn / ${d.failed} fail`},d.success>0&&/*#__PURE__*/React.createElement("div",{style:{height:`${d.success/perDayMax*100}%`,minHeight:2},className:"bg-green-500/80"}),d.warning>0&&/*#__PURE__*/React.createElement("div",{style:{height:`${d.warning/perDayMax*100}%`,minHeight:2},className:"bg-yellow-500/80"}),d.failed>0&&/*#__PURE__*/React.createElement("div",{style:{height:`${d.failed/perDayMax*100}%`,minHeight:2},className:"bg-red-500/80"}),totalDay===0&&/*#__PURE__*/React.createElement("div",{className:"bg-gray-700/30",style:{height:'2px'}}));})),/*#__PURE__*/React.createElement("div",{className:"flex justify-between text-[10px] text-gray-600 mt-1"},/*#__PURE__*/React.createElement("span",null,r.window?.days," ",t('daysAgo')||'days ago'),/*#__PURE__*/React.createElement("span",null,t('now')||'now'))),r.unverified_older_than_30d>0&&/*#__PURE__*/React.createElement("div",{className:"bg-yellow-500/10 border border-yellow-500/30 rounded-lg p-3 text-sm text-yellow-300 flex items-start gap-2"},/*#__PURE__*/React.createElement(Icons.AlertTriangle,{className:"w-4 h-4 flex-shrink-0 mt-0.5"}),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("span",{className:"font-medium"},r.unverified_older_than_30d)," ",t('unverifiedOld')||'snapshot(s) older than 30 days without successful verification.')),/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl overflow-hidden"},/*#__PURE__*/React.createElement("div",{className:"px-4 py-3 border-b border-proxmox-border flex items-center justify-between"},/*#__PURE__*/React.createElement("div",{className:"text-sm font-medium text-gray-300"},t('perVmRollup')||'Per-VM last backup'),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500"},(r.per_vm||[]).length," ",t('entries')||'entries')),/*#__PURE__*/React.createElement("div",{className:"max-h-96 overflow-auto"},/*#__PURE__*/React.createElement("table",{className:"w-full text-xs"},/*#__PURE__*/React.createElement("thead",{className:"bg-proxmox-dark text-gray-500 sticky top-0"},/*#__PURE__*/React.createElement("tr",null,/*#__PURE__*/React.createElement("th",{className:"text-left p-2 pl-4"},t('type')||'Type'),/*#__PURE__*/React.createElement("th",{className:"text-left p-2"},t('vmid')||'VMID'),/*#__PURE__*/React.createElement("th",{className:"text-left p-2"},t('name')||'Name'),/*#__PURE__*/React.createElement("th",{className:"text-left p-2"},t('lastBackup')||'Last backup'),/*#__PURE__*/React.createElement("th",{className:"text-left p-2"},t('status')||'Status'),/*#__PURE__*/React.createElement("th",{className:"text-left p-2"},t('size')||'Size'),/*#__PURE__*/React.createElement("th",{className:"text-left p-2"},t('duration')||'Duration'),/*#__PURE__*/React.createElement("th",{className:"text-left p-2"},t('location')||'Location'),/*#__PURE__*/React.createElement("th",{className:"text-left p-2"},t('verified')||'Verified'))),/*#__PURE__*/React.createElement("tbody",null,(r.per_vm||[]).map((v,i)=>/*#__PURE__*/React.createElement("tr",{key:i,className:"border-t border-proxmox-border/30 hover:bg-proxmox-hover/30"},/*#__PURE__*/React.createElement("td",{className:"p-2 pl-4 text-gray-400 font-mono"},v.type),/*#__PURE__*/React.createElement("td",{className:"p-2 text-gray-300 font-mono"},v.vmid),/*#__PURE__*/React.createElement("td",{className:"p-2 text-white"},v.vm_name||/*#__PURE__*/React.createElement("span",{className:"text-gray-600"},"\u2014")),/*#__PURE__*/React.createElement("td",{className:"p-2 text-gray-400"},v.last_backup_ts?fmtDate(v.last_backup_ts*1000):'—'),/*#__PURE__*/React.createElement("td",{className:"p-2"},/*#__PURE__*/React.createElement("span",{className:`px-1.5 py-0.5 rounded text-[10px] ${v.status==='success'?'bg-green-500/20 text-green-400':v.status==='warning'?'bg-yellow-500/20 text-yellow-400':'bg-red-500/20 text-red-400'}`},v.status)),/*#__PURE__*/React.createElement("td",{className:"p-2 text-gray-400"},formatBytes(v.size)),/*#__PURE__*/React.createElement("td",{className:"p-2 text-gray-500"},v.duration_s?`${Math.floor(v.duration_s/60)}m ${v.duration_s%60}s`:'—'),/*#__PURE__*/React.createElement("td",{className:"p-2 text-gray-500"},v.datastore||'—',v.namespace?`/${v.namespace}`:''),/*#__PURE__*/React.createElement("td",{className:"p-2"},v.verified?/*#__PURE__*/React.createElement(Icons.Check,{className:"w-3.5 h-3.5 text-green-400"}):/*#__PURE__*/React.createElement("span",{className:"text-gray-600"},"\u2014")))),(r.per_vm||[]).length===0&&/*#__PURE__*/React.createElement("tr",null,/*#__PURE__*/React.createElement("td",{colSpan:"9",className:"p-8 text-center text-gray-500"},t('noBackupsInWindow')||'No backups in selected window')))))));})(),!pbsReportLoading&&pbsReportSubTab==='inventory'&&pbsReportInventory&&(()=>{const inv=pbsReportInventory;const q=(pbsReportSearch||'').toLowerCase();const filtered=(inv.entries||[]).filter(e=>!q||(e.vm_name||'').toLowerCase().includes(q)||String(e.vmid||'').includes(q)||(e.datastore||'').toLowerCase().includes(q)||(e.namespace||'').toLowerCase().includes(q));return/*#__PURE__*/React.createElement(React.Fragment,null,/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-3"},/*#__PURE__*/React.createElement("input",{value:pbsReportSearch,onChange:e=>setPbsReportSearch(e.target.value),placeholder:t('searchBackups')||'Search by VM name, ID, datastore…',className:"flex-1 max-w-md bg-proxmox-dark border border-proxmox-border rounded px-3 py-1.5 text-sm text-white"}),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500"},filtered.length," / ",inv.count||0)),/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl overflow-hidden"},/*#__PURE__*/React.createElement("div",{className:"max-h-[600px] overflow-auto"},/*#__PURE__*/React.createElement("table",{className:"w-full text-xs"},/*#__PURE__*/React.createElement("thead",{className:"bg-proxmox-dark text-gray-500 sticky top-0"},/*#__PURE__*/React.createElement("tr",null,/*#__PURE__*/React.createElement("th",{className:"text-left p-2 pl-4"},t('type')||'Type'),/*#__PURE__*/React.createElement("th",{className:"text-left p-2"},t('vmid')||'VMID'),/*#__PURE__*/React.createElement("th",{className:"text-left p-2"},t('name')||'Name'),/*#__PURE__*/React.createElement("th",{className:"text-left p-2"},t('timestamp')||'Timestamp'),/*#__PURE__*/React.createElement("th",{className:"text-left p-2"},t('datastore')||'Datastore'),/*#__PURE__*/React.createElement("th",{className:"text-left p-2",title:t('namespace')||'Namespace'},t('namespaceShort')||'NS'),/*#__PURE__*/React.createElement("th",{className:"text-left p-2"},t('size')||'Size'),/*#__PURE__*/React.createElement("th",{className:"text-left p-2"},t('verified')||'Verified'),/*#__PURE__*/React.createElement("th",{className:"text-left p-2"},t('protected')||'Prot.'))),/*#__PURE__*/React.createElement("tbody",null,filtered.map((e,i)=>/*#__PURE__*/React.createElement("tr",{key:i,className:"border-t border-proxmox-border/30 hover:bg-proxmox-hover/30"},/*#__PURE__*/React.createElement("td",{className:"p-2 pl-4 text-gray-400 font-mono"},e.type),/*#__PURE__*/React.createElement("td",{className:"p-2 text-gray-300 font-mono"},e.vmid),/*#__PURE__*/React.createElement("td",{className:"p-2 text-white"},e.vm_name||/*#__PURE__*/React.createElement("span",{className:"text-gray-600"},"\u2014")),/*#__PURE__*/React.createElement("td",{className:"p-2 text-gray-400"},fmtDate(e.backup_time*1000)),/*#__PURE__*/React.createElement("td",{className:"p-2 text-gray-300"},e.datastore),/*#__PURE__*/React.createElement("td",{className:"p-2 text-gray-500"},e.namespace||/*#__PURE__*/React.createElement("span",{className:"text-gray-700"},"root")),/*#__PURE__*/React.createElement("td",{className:"p-2 text-gray-400"},formatBytes(e.size)),/*#__PURE__*/React.createElement("td",{className:"p-2"},e.verified?/*#__PURE__*/React.createElement("span",{className:"text-green-400 text-[10px]"},"ok"):e.verified_state?/*#__PURE__*/React.createElement("span",{className:"text-yellow-400 text-[10px]"},e.verified_state):/*#__PURE__*/React.createElement("span",{className:"text-gray-600 text-[10px]"},"\u2014")),/*#__PURE__*/React.createElement("td",{className:"p-2"},e.protected?/*#__PURE__*/React.createElement(Icons.Lock,{className:"w-3 h-3 text-blue-400"}):/*#__PURE__*/React.createElement("span",{className:"text-gray-700"},"\u2014")))),filtered.length===0&&/*#__PURE__*/React.createElement("tr",null,/*#__PURE__*/React.createElement("td",{colSpan:"9",className:"p-8 text-center text-gray-500"},t('noMatchingBackups')||'No matching backups')))))));})(),!pbsReportLoading&&pbsReportSubTab==='gap'&&!pbsReportGapCluster&&/*#__PURE__*/React.createElement("div",{className:"text-center py-16"},/*#__PURE__*/React.createElement(Icons.AlertCircle,{className:"w-10 h-10 text-gray-700 mx-auto mb-3"}),/*#__PURE__*/React.createElement("p",{className:"text-gray-400"},t('pickClusterForGap')||'Pick a cluster above to run gap analysis'),/*#__PURE__*/React.createElement("p",{className:"text-xs text-gray-600 mt-1"},t('pickClusterForGapDesc')||'Shows which VMs in the chosen cluster are protected, stale, or completely unprotected on this PBS.')),!pbsReportLoading&&pbsReportSubTab==='gap'&&pbsReportGap&&(()=>{const g=pbsReportGap;// NS May 2026 — null-safe defaults; backend may omit empty arrays/counts -const counts=g.counts||{};const winDays=g.window?.days??pbsReportDays;const unprotectedArr=Array.isArray(g.unprotected)?g.unprotected:[];const staleArr=Array.isArray(g.stale)?g.stale:[];const protectedArr=Array.isArray(g.protected)?g.protected:[];return/*#__PURE__*/React.createElement(React.Fragment,null,/*#__PURE__*/React.createElement("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3"},/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-green-500/30 rounded-xl p-4"},/*#__PURE__*/React.createElement("div",{className:"text-2xl font-bold text-green-400"},counts.protected||0),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500 mt-1"},t('protected')||'Protected'," ",/*#__PURE__*/React.createElement("span",{className:"text-gray-600"},"(< ",winDays,"d)"))),/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-yellow-500/30 rounded-xl p-4"},/*#__PURE__*/React.createElement("div",{className:"text-2xl font-bold text-yellow-400"},counts.stale||0),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500 mt-1"},t('stale')||'Stale'," ",/*#__PURE__*/React.createElement("span",{className:"text-gray-600"},"(> ",winDays,"d)"))),/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-red-500/30 rounded-xl p-4"},/*#__PURE__*/React.createElement("div",{className:"text-2xl font-bold text-red-400"},counts.unprotected||0),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500 mt-1"},t('unprotected')||'No backups at all'))),unprotectedArr.length>0&&/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-red-500/30 rounded-xl overflow-hidden"},/*#__PURE__*/React.createElement("div",{className:"px-4 py-2 bg-red-500/10 text-red-300 text-sm font-medium"},"\uD83D\uDD34 ",t('unprotectedVms')||'Unprotected VMs'," (",unprotectedArr.length,")"),/*#__PURE__*/React.createElement("table",{className:"w-full text-xs"},/*#__PURE__*/React.createElement("thead",{className:"text-gray-500"},/*#__PURE__*/React.createElement("tr",null,/*#__PURE__*/React.createElement("th",{className:"text-left p-2 pl-4"},t('type')||'Type'),/*#__PURE__*/React.createElement("th",{className:"text-left p-2"},t('vmid')||'VMID'),/*#__PURE__*/React.createElement("th",{className:"text-left p-2"},t('name')||'Name'),/*#__PURE__*/React.createElement("th",{className:"text-left p-2"},t('node')||'Node'),/*#__PURE__*/React.createElement("th",{className:"text-left p-2"},t('status')||'Status'))),/*#__PURE__*/React.createElement("tbody",null,unprotectedArr.map((v,i)=>/*#__PURE__*/React.createElement("tr",{key:i,className:"border-t border-proxmox-border/30"},/*#__PURE__*/React.createElement("td",{className:"p-2 pl-4 text-gray-400 font-mono"},v.type),/*#__PURE__*/React.createElement("td",{className:"p-2 text-gray-300 font-mono"},v.vmid),/*#__PURE__*/React.createElement("td",{className:"p-2 text-white"},v.vm_name||'—'),/*#__PURE__*/React.createElement("td",{className:"p-2 text-gray-400"},v.node),/*#__PURE__*/React.createElement("td",{className:"p-2 text-gray-500"},v.status)))))),staleArr.length>0&&/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-yellow-500/30 rounded-xl overflow-hidden"},/*#__PURE__*/React.createElement("div",{className:"px-4 py-2 bg-yellow-500/10 text-yellow-300 text-sm font-medium"},"\uD83D\uDFE1 ",t('staleBackups')||'Stale (last backup older than window)'," (",staleArr.length,")"),/*#__PURE__*/React.createElement("table",{className:"w-full text-xs"},/*#__PURE__*/React.createElement("thead",{className:"text-gray-500"},/*#__PURE__*/React.createElement("tr",null,/*#__PURE__*/React.createElement("th",{className:"text-left p-2 pl-4"},t('type')||'Type'),/*#__PURE__*/React.createElement("th",{className:"text-left p-2"},t('vmid')||'VMID'),/*#__PURE__*/React.createElement("th",{className:"text-left p-2"},t('name')||'Name'),/*#__PURE__*/React.createElement("th",{className:"text-left p-2"},t('lastBackup')||'Last backup'),/*#__PURE__*/React.createElement("th",{className:"text-left p-2"},t('location')||'Location'))),/*#__PURE__*/React.createElement("tbody",null,staleArr.map((v,i)=>/*#__PURE__*/React.createElement("tr",{key:i,className:"border-t border-proxmox-border/30"},/*#__PURE__*/React.createElement("td",{className:"p-2 pl-4 text-gray-400 font-mono"},v.type),/*#__PURE__*/React.createElement("td",{className:"p-2 text-gray-300 font-mono"},v.vmid),/*#__PURE__*/React.createElement("td",{className:"p-2 text-white"},v.vm_name||'—'),/*#__PURE__*/React.createElement("td",{className:"p-2 text-gray-400"},fmtDate(v.last_backup_ts*1000)),/*#__PURE__*/React.createElement("td",{className:"p-2 text-gray-500"},v.datastore,v.namespace?`/${v.namespace}`:'')))))),protectedArr.length>0&&/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-green-500/30 rounded-xl overflow-hidden"},/*#__PURE__*/React.createElement("div",{className:"px-4 py-2 bg-green-500/10 text-green-300 text-sm font-medium"},"\uD83D\uDFE2 ",t('protected')||'Protected'," (",protectedArr.length,")"),/*#__PURE__*/React.createElement("div",{className:"max-h-72 overflow-auto"},/*#__PURE__*/React.createElement("table",{className:"w-full text-xs"},/*#__PURE__*/React.createElement("thead",{className:"bg-proxmox-dark text-gray-500 sticky top-0"},/*#__PURE__*/React.createElement("tr",null,/*#__PURE__*/React.createElement("th",{className:"text-left p-2 pl-4"},t('type')||'Type'),/*#__PURE__*/React.createElement("th",{className:"text-left p-2"},t('vmid')||'VMID'),/*#__PURE__*/React.createElement("th",{className:"text-left p-2"},t('name')||'Name'),/*#__PURE__*/React.createElement("th",{className:"text-left p-2"},t('lastBackup')||'Last backup'),/*#__PURE__*/React.createElement("th",{className:"text-left p-2"},t('location')||'Location'))),/*#__PURE__*/React.createElement("tbody",null,protectedArr.map((v,i)=>/*#__PURE__*/React.createElement("tr",{key:i,className:"border-t border-proxmox-border/30"},/*#__PURE__*/React.createElement("td",{className:"p-2 pl-4 text-gray-400 font-mono"},v.type),/*#__PURE__*/React.createElement("td",{className:"p-2 text-gray-300 font-mono"},v.vmid),/*#__PURE__*/React.createElement("td",{className:"p-2 text-white"},v.vm_name||'—'),/*#__PURE__*/React.createElement("td",{className:"p-2 text-gray-400"},fmtDate(v.last_backup_ts*1000)),/*#__PURE__*/React.createElement("td",{className:"p-2 text-gray-500"},v.datastore,v.namespace?`/${v.namespace}`:''))))))));})(),!pbsReportLoading&&(pbsReportSubTab==='summary'&&!pbsReportSummary||pbsReportSubTab==='inventory'&&!pbsReportInventory)&&/*#__PURE__*/React.createElement("div",{className:"text-center py-8 text-sm text-gray-500"},t('noReportData')||'No report data. Try Refresh or a different window.'))):selectedVMware?/*#__PURE__*//* VMware Server Management View */React.createElement("div",{className:isCorporate?'space-y-4':'space-y-6'},/*#__PURE__*/React.createElement("div",{className:`flex items-center justify-between ${isCorporate?'px-4 py-3 border-b':''}`,style:isCorporate?{borderColor:'var(--corp-border-medium)',background:'var(--corp-header-bg)'}:{}},/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-4"},isCorporate?/*#__PURE__*/React.createElement(Icons.Cloud,{className:"w-5 h-5 flex-shrink-0",style:{color:'var(--corp-accent)'}}):/*#__PURE__*/React.createElement("div",{className:"w-12 h-12 rounded-xl bg-gradient-to-br from-emerald-500/20 to-green-500/10 border border-emerald-500/30 flex items-center justify-center"},/*#__PURE__*/React.createElement(Icons.Cloud,{className:"w-6 h-6 text-emerald-400"})),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("h1",{className:isCorporate?'text-[15px] font-medium':'text-2xl font-bold',style:{color:'#e9ecef'}},selectedVMware.name||selectedVMware.host),/*#__PURE__*/React.createElement("div",{className:`flex items-center gap-3 ${isCorporate?'text-[12px]':'text-sm'}`,style:{color:'#adbbc4'}},/*#__PURE__*/React.createElement("span",null,selectedVMware.host,":",selectedVMware.port||443),/*#__PURE__*/React.createElement("span",null,"\u2022"),/*#__PURE__*/React.createElement("span",null,vmwareVms.length," VMs"),/*#__PURE__*/React.createElement("span",null,"\u2022"),/*#__PURE__*/React.createElement("span",null,vmwareHosts.length," Hosts"),/*#__PURE__*/React.createElement("span",null,"\u2022"),/*#__PURE__*/React.createElement("span",null,vmwareDatastores.length," Datastores")))),/*#__PURE__*/React.createElement("div",{className:isCorporate?'corp-toolbar flex items-center gap-1':'flex items-center gap-2'},isAdmin&&/*#__PURE__*/React.createElement(React.Fragment,null,/*#__PURE__*/React.createElement("button",{onClick:()=>{setEditingVMware(selectedVMware);setVmwareForm({name:selectedVMware.name||'',host:selectedVMware.host,port:selectedVMware.port||443,username:selectedVMware.username||'root',password:'',ssl_verify:selectedVMware.ssl_verify||false,notes:selectedVMware.notes||''});setShowAddVMware(true);},className:isCorporate?'':'px-3 py-2 rounded-lg bg-proxmox-card border border-proxmox-border text-gray-400 hover:text-white text-sm'},/*#__PURE__*/React.createElement(Icons.Settings,{className:"w-4 h-4"})),/*#__PURE__*/React.createElement("button",{onClick:()=>handleDeleteVMware(selectedVMware.id),className:isCorporate?'':'px-3 py-2 rounded-lg bg-proxmox-card border border-proxmox-border text-red-400 hover:text-red-300 text-sm'},/*#__PURE__*/React.createElement(Icons.Trash,{className:"w-4 h-4"}))),/*#__PURE__*/React.createElement("button",{onClick:()=>fetchVMwareVms(selectedVMware.id),className:isCorporate?'':'px-3 py-2 rounded-lg bg-proxmox-card border border-proxmox-border text-gray-400 hover:text-white text-sm'},/*#__PURE__*/React.createElement(Icons.RefreshCw,{className:`w-4 h-4 ${vmwareLoading?'animate-spin':''}`})))),/*#__PURE__*/React.createElement("div",{className:isCorporate?'corp-tab-strip':'flex items-center gap-1 p-1 bg-proxmox-card border border-proxmox-border rounded-xl w-fit'},[{id:'vms',label:'Virtual Machines',icon:Icons.Monitor},{id:'hosts',label:'Hosts',icon:Icons.Server},{id:'datastores',label:'Datastores',icon:Icons.Database},{id:'networks',label:'Networks',icon:Icons.Globe},{id:'clusters',label:'Clusters',icon:Icons.Layers},{id:'tasks',label:'Tasks & Events',icon:Icons.ClipboardList}].map(tab=>/*#__PURE__*/React.createElement("button",{key:tab.id,onClick:()=>{setVmwareActiveTab(tab.id);setVmwareSelectedVm(null);setVmwareSelectedDs(null);},className:isCorporate?`flex items-center gap-1 ${vmwareActiveTab===tab.id?'active':''}`:`flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-medium transition-all ${vmwareActiveTab===tab.id?'bg-emerald-500 text-white':'text-gray-400 hover:text-white hover:bg-proxmox-hover'}`},/*#__PURE__*/React.createElement(tab.icon,{className:isCorporate?'w-3 h-3':'w-4 h-4'}),tab.label))),!vmwareConnectionOk&&/*#__PURE__*/React.createElement("div",{className:"bg-yellow-500/10 border border-yellow-500/30 rounded-xl p-3 flex items-center gap-3"},/*#__PURE__*/React.createElement(Icons.AlertTriangle,{className:"w-5 h-5 text-yellow-400 flex-shrink-0"}),/*#__PURE__*/React.createElement("div",{className:"flex-1"},/*#__PURE__*/React.createElement("span",{className:"text-yellow-300 text-sm font-medium"},"Connection lost"),/*#__PURE__*/React.createElement("span",{className:"text-yellow-400/70 text-sm ml-2"},"Session expired - data may be stale")),/*#__PURE__*/React.createElement("button",{onClick:()=>{fetchVMwareVms(selectedVMware.id);fetchVMwareHosts(selectedVMware.id);fetchVMwareDatastores(selectedVMware.id);},className:"px-3 py-1.5 bg-yellow-500/20 hover:bg-yellow-500/30 text-yellow-300 rounded-lg text-xs font-medium"},"Reconnect")),vmwareActiveTab==='vms'&&!vmwareSelectedVm&&/*#__PURE__*/React.createElement("div",{className:"space-y-4"},/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-3"},/*#__PURE__*/React.createElement("div",{className:"flex-1 relative"},/*#__PURE__*/React.createElement(Icons.Search,{className:"absolute top-1/2 -translate-y-1/2 w-4 h-4",style:{left:isCorporate?10:12,color:'var(--corp-text-muted)',pointerEvents:'none'}}),/*#__PURE__*/React.createElement("input",{value:vmwareSearch,onChange:e=>setVmwareSearch(e.target.value),placeholder:"Search VMs...",className:isCorporate?'w-full pr-4 py-2 text-[13px] text-white placeholder-gray-500 focus:outline-none':'w-full pl-10 pr-4 py-2.5 bg-proxmox-card border border-proxmox-border rounded-xl text-white placeholder-gray-500 focus:outline-none focus:border-emerald-500/50 text-sm',style:isCorporate?{paddingLeft:'32px',background:'var(--corp-header-bg)',border:'1px solid var(--corp-border-medium)',borderRadius:'2px'}:{}})),/*#__PURE__*/React.createElement("div",{className:isCorporate?'flex items-center gap-0':'flex items-center gap-1 p-1 bg-proxmox-card border border-proxmox-border rounded-xl',style:isCorporate?{border:'1px solid #485764',borderRadius:'2px'}:{}},['all','running','stopped'].map(f=>/*#__PURE__*/React.createElement("button",{key:f,onClick:()=>setVmwareFilter(f),className:isCorporate?`px-3 py-1.5 text-[12px] font-medium ${vmwareFilter===f?'text-white':'hover:text-white'}`:`px-3 py-1.5 rounded-lg text-xs font-medium transition-all ${vmwareFilter===f?'bg-emerald-500/20 text-emerald-400':'text-gray-500 hover:text-white'}`,style:isCorporate?{color:vmwareFilter===f?'#e9ecef':'#728b9a',background:vmwareFilter===f?'#324f61':'transparent',borderRight:'1px solid #485764'}:{}},f==='all'?`All (${vmwareVms.length})`:f==='running'?`Running (${vmwareVms.filter(v=>v.power_state==='POWERED_ON').length})`:`Stopped (${vmwareVms.filter(v=>v.power_state!=='POWERED_ON').length})`)))),vmwareLoading&&vmwareVms.length===0?/*#__PURE__*/React.createElement("div",{className:"text-center py-12 text-gray-500"},"Loading VMs..."):/*#__PURE__*/React.createElement("div",{className:isCorporate?'overflow-hidden':'bg-proxmox-card border border-proxmox-border rounded-xl overflow-hidden'},/*#__PURE__*/React.createElement("table",{className:isCorporate?'corp-datagrid':'w-full'},/*#__PURE__*/React.createElement("thead",null,/*#__PURE__*/React.createElement("tr",{className:isCorporate?'':'border-b border-proxmox-border'},/*#__PURE__*/React.createElement("th",{className:isCorporate?'':'text-left p-3 text-xs font-semibold text-gray-500 uppercase'},"Status"),/*#__PURE__*/React.createElement("th",{className:isCorporate?'':'text-left p-3 text-xs font-semibold text-gray-500 uppercase'},"Name"),/*#__PURE__*/React.createElement("th",{className:isCorporate?'':'text-left p-3 text-xs font-semibold text-gray-500 uppercase'},"Guest OS"),/*#__PURE__*/React.createElement("th",{className:isCorporate?'':'text-left p-3 text-xs font-semibold text-gray-500 uppercase'},"CPUs"),/*#__PURE__*/React.createElement("th",{className:isCorporate?'':'text-left p-3 text-xs font-semibold text-gray-500 uppercase'},"Memory"),/*#__PURE__*/React.createElement("th",{className:isCorporate?'':'text-left p-3 text-xs font-semibold text-gray-500 uppercase'},"IP Address"),/*#__PURE__*/React.createElement("th",{className:isCorporate?'':'text-left p-3 text-xs font-semibold text-gray-500 uppercase'},"Host"),/*#__PURE__*/React.createElement("th",{className:isCorporate?'text-right':'text-right p-3 text-xs font-semibold text-gray-500 uppercase'},"Actions"))),/*#__PURE__*/React.createElement("tbody",null,vmwareVms.filter(vm=>{if(vmwareFilter==='running')return vm.power_state==='POWERED_ON';if(vmwareFilter==='stopped')return vm.power_state!=='POWERED_ON';return true;}).filter(vm=>!vmwareSearch||(vm.name||'').toLowerCase().includes(vmwareSearch.toLowerCase())||(vm.guest_os||'').toLowerCase().includes(vmwareSearch.toLowerCase())).sort((a,b)=>{if(vmwareSortBy==='status')return(a.power_state||'').localeCompare(b.power_state||'');return(a.name||'').localeCompare(b.name||'');}).map(vm=>{const isOn=vm.power_state==='POWERED_ON';const isSuspended=vm.power_state==='SUSPENDED';const memGB=vm.memory_size_MiB?(vm.memory_size_MiB/1024).toFixed(1):vm.memory_mb?(vm.memory_mb/1024).toFixed(1):'-';const ip=vm.guest_info?.ip_address||vm.ip_address||vm.guest_ip||'-';const actionLoading=vmwareActionLoading[vm.vm||vm.vm_id||vm.id];return/*#__PURE__*/React.createElement("tr",{key:vm.vm||vm.vm_id||vm.id,className:"border-b border-proxmox-border/50 hover:bg-proxmox-hover/50 cursor-pointer transition-colors",onClick:()=>setVmwareSelectedVm(vm.vm||vm.vm_id||vm.id)},/*#__PURE__*/React.createElement("td",{className:"p-3"},/*#__PURE__*/React.createElement("div",{className:`w-3 h-3 rounded-full ${isOn?'bg-green-400 shadow-lg shadow-green-400/30':isSuspended?'bg-yellow-400':'bg-gray-500'}`,title:vm.power_state})),/*#__PURE__*/React.createElement("td",{className:"p-3"},/*#__PURE__*/React.createElement("div",{className:"font-medium text-white text-sm"},vm.name)),/*#__PURE__*/React.createElement("td",{className:"p-3 text-gray-400 text-sm"},(vm.guest_OS||vm.guest_os||'-').replace('Guest','').replace('_',' ').substring(0,25)),/*#__PURE__*/React.createElement("td",{className:"p-3 text-gray-400 text-sm"},vm.cpu_count||vm.num_cpu||'-'),/*#__PURE__*/React.createElement("td",{className:"p-3 text-gray-400 text-sm"},memGB," GB"),/*#__PURE__*/React.createElement("td",{className:"p-3 text-gray-400 text-sm font-mono text-xs"},ip),/*#__PURE__*/React.createElement("td",{className:"p-3 text-gray-400 text-sm"},(vm.host||vm.host_name||'-').split('.')[0]),/*#__PURE__*/React.createElement("td",{className:"p-3 text-right",onClick:e=>e.stopPropagation()},/*#__PURE__*/React.createElement("div",{className:"flex items-center justify-end gap-1"},!isOn?/*#__PURE__*/React.createElement("button",{onClick:()=>vmwarePowerAction(vm.vm||vm.vm_id||vm.id,'start'),disabled:!!actionLoading,className:"p-1.5 rounded-lg text-green-400 hover:bg-green-500/10 disabled:opacity-50",title:"Start"},actionLoading==='start'?/*#__PURE__*/React.createElement(Icons.RefreshCw,{className:"w-4 h-4 animate-spin"}):/*#__PURE__*/React.createElement(Icons.Play,{className:"w-4 h-4"})):/*#__PURE__*/React.createElement(React.Fragment,null,/*#__PURE__*/React.createElement("button",{onClick:()=>vmwarePowerAction(vm.vm||vm.vm_id||vm.id,'stop'),disabled:!!actionLoading,className:"p-1.5 rounded-lg text-red-400 hover:bg-red-500/10 disabled:opacity-50",title:"Shutdown"},actionLoading==='stop'?/*#__PURE__*/React.createElement(Icons.RefreshCw,{className:"w-4 h-4 animate-spin"}):/*#__PURE__*/React.createElement(Icons.Square,{className:"w-4 h-4"})),/*#__PURE__*/React.createElement("button",{onClick:()=>vmwarePowerAction(vm.vm||vm.vm_id||vm.id,'reset'),disabled:!!actionLoading,className:"p-1.5 rounded-lg text-yellow-400 hover:bg-yellow-500/10 disabled:opacity-50",title:"Reset"},/*#__PURE__*/React.createElement(Icons.RotateCw,{className:"w-4 h-4"})),/*#__PURE__*/React.createElement("button",{onClick:()=>vmwarePowerAction(vm.vm||vm.vm_id||vm.id,'suspend'),disabled:!!actionLoading,className:"p-1.5 rounded-lg text-blue-400 hover:bg-blue-500/10 disabled:opacity-50",title:"Suspend"},/*#__PURE__*/React.createElement(Icons.Pause,{className:"w-4 h-4"}))))));}))),vmwareVms.length===0&&!vmwareLoading&&/*#__PURE__*/React.createElement("div",{className:"text-center py-12 text-gray-500"},"No virtual machines found"))),vmwareActiveTab==='vms'&&vmwareSelectedVm&&/*#__PURE__*/React.createElement("div",{className:"space-y-4"},/*#__PURE__*/React.createElement("button",{onClick:()=>{setVmwareSelectedVm(null);setVmwareVmTab('overview');},className:"flex items-center gap-2 text-gray-400 hover:text-white text-sm"},/*#__PURE__*/React.createElement("span",{style:{display:"inline-block",transform:"rotate(180deg)"}},/*#__PURE__*/React.createElement(Icons.ChevronRight,{className:"w-4 h-4"}))," Back to VM List"),vmwareVmDetail?(()=>{const vm=vmwareVmDetail;const isOn=vm.power_state==='POWERED_ON';const isSuspended=vm.power_state==='SUSPENDED';const memMiB=vm.memory?.size_MiB||vm.memory_size_MiB||vm.memory_mb||0;const memGB=memMiB?(memMiB/1024).toFixed(1):'-';const cpuCount=vm.cpu?.count||vm.cpu_count||vm.num_cpu||0;const guestOS=vm.guest_OS||vm.guest_os||'-';const toolsStatus=vm.guest_info?.tools_status||vm.vmware_tools_status||'';const ipAddr=vm.guest_info?.ip_address||vm.ip_address||vm.guest_ip||'';const hostName=vm.guest_info?.host_name||vm.hostname||'';const hwVersion=vm.hardware?.version||'';const disksList=vm.disks?Array.isArray(vm.disks)?vm.disks:Object.values(vm.disks):[];const netsList=vm.networks?Array.isArray(vm.networks)?vm.networks:Object.values(vm.networks):[];const snapsList=vm.snapshots&&Array.isArray(vm.snapshots)?vm.snapshots:[];const totalDiskGB=disksList.reduce((sum,d)=>sum+(d.capacity?d.capacity/(1024*1024*1024):d.capacity_gb||0),0);return/*#__PURE__*/React.createElement("div",{className:"space-y-4"},/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl p-5"},/*#__PURE__*/React.createElement("div",{className:"flex items-center justify-between"},/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-4"},/*#__PURE__*/React.createElement("div",{className:`w-14 h-14 rounded-xl flex items-center justify-center ${isOn?'bg-green-500/10 border border-green-500/30':isSuspended?'bg-yellow-500/10 border border-yellow-500/30':'bg-gray-500/10 border border-gray-500/30'}`},/*#__PURE__*/React.createElement(Icons.Monitor,{className:`w-7 h-7 ${isOn?'text-green-400':isSuspended?'text-yellow-400':'text-gray-500'}`})),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-3"},/*#__PURE__*/React.createElement("h2",{className:"text-xl font-bold text-white"},vm.name),/*#__PURE__*/React.createElement("span",{className:`px-2 py-0.5 rounded text-xs font-semibold ${isOn?'bg-green-500/20 text-green-400':isSuspended?'bg-yellow-500/20 text-yellow-400':'bg-gray-500/20 text-gray-400'}`},isOn?'ON':isSuspended?'SUSPENDED':'OFF'),hwVersion&&/*#__PURE__*/React.createElement("span",{className:"text-xs text-gray-600"},hwVersion)),/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-4 text-xs text-gray-500 mt-1"},/*#__PURE__*/React.createElement("span",null,guestOS),cpuCount>0&&/*#__PURE__*/React.createElement("span",null,cpuCount," vCPU"),memGB!=='-'&&/*#__PURE__*/React.createElement("span",null,memGB," GB RAM"),totalDiskGB>0&&/*#__PURE__*/React.createElement("span",null,totalDiskGB.toFixed(0)," GB Disk"),toolsStatus&&/*#__PURE__*/React.createElement("span",{className:toolsStatus.includes('Not')?'text-yellow-500':'text-gray-500'},"Tools: ",toolsStatus.replace('toolsStatus','').replace('tools',''))))),/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-2"},!isOn?/*#__PURE__*/React.createElement("button",{onClick:()=>vmwarePowerAction(vmwareSelectedVm,'start'),className:"px-4 py-2 rounded-lg bg-green-500/20 text-green-400 hover:bg-green-500/30 text-sm font-medium flex items-center gap-1.5"},/*#__PURE__*/React.createElement(Icons.Play,{className:"w-4 h-4"})," Start"):/*#__PURE__*/React.createElement(React.Fragment,null,/*#__PURE__*/React.createElement("button",{onClick:()=>vmwarePowerAction(vmwareSelectedVm,'stop'),className:"px-3 py-2 rounded-lg bg-red-500/20 text-red-400 hover:bg-red-500/30 text-sm font-medium flex items-center gap-1.5"},/*#__PURE__*/React.createElement(Icons.Square,{className:"w-3.5 h-3.5"})," Stop"),/*#__PURE__*/React.createElement("button",{onClick:()=>vmwarePowerAction(vmwareSelectedVm,'reset'),className:"p-2 rounded-lg bg-yellow-500/10 text-yellow-400 hover:bg-yellow-500/20",title:"Reset"},/*#__PURE__*/React.createElement(Icons.RotateCw,{className:"w-4 h-4"})),/*#__PURE__*/React.createElement("button",{onClick:()=>vmwarePowerAction(vmwareSelectedVm,'suspend'),className:"p-2 rounded-lg bg-blue-500/10 text-blue-400 hover:bg-blue-500/20",title:"Suspend"},/*#__PURE__*/React.createElement(Icons.Pause,{className:"w-4 h-4"}))),/*#__PURE__*/React.createElement("div",{className:"w-px h-8 bg-proxmox-border mx-1"}),isOn&&/*#__PURE__*/React.createElement("button",{onClick:()=>openVmwareConsole(vmwareSelectedVm),className:"p-2 rounded-lg bg-purple-500/10 text-purple-400 hover:bg-purple-500/20",title:"Console (VMRC)"},/*#__PURE__*/React.createElement(Icons.Terminal,{className:"w-4 h-4"})),/*#__PURE__*/React.createElement("div",{className:"relative group"},/*#__PURE__*/React.createElement("button",{className:"p-2 rounded-lg bg-proxmox-dark border border-proxmox-border text-gray-400 hover:text-white"},/*#__PURE__*/React.createElement(Icons.Settings,{className:"w-4 h-4"})),/*#__PURE__*/React.createElement("div",{className:"absolute right-0 top-full mt-1 w-48 bg-proxmox-card border border-proxmox-border rounded-xl shadow-xl z-50 hidden group-hover:block"},/*#__PURE__*/React.createElement("div",{className:"py-1"},/*#__PURE__*/React.createElement("button",{onClick:()=>{setVmwareRenameName(vm.name||'');setShowVmwareRename(true);},className:"w-full text-left px-4 py-2 text-sm text-gray-300 hover:bg-proxmox-hover flex items-center gap-2"},/*#__PURE__*/React.createElement(Icons.Edit,{className:"w-3.5 h-3.5"})," Rename"),/*#__PURE__*/React.createElement("button",{onClick:()=>{setVmwareCloneName(`${vm.name}-clone`);setShowVmwareClone(true);},className:"w-full text-left px-4 py-2 text-sm text-gray-300 hover:bg-proxmox-hover flex items-center gap-2"},/*#__PURE__*/React.createElement(Icons.Copy,{className:"w-3.5 h-3.5"})," Clone"),/*#__PURE__*/React.createElement("button",{onClick:()=>{fetchMigrationPlan(vmwareSelectedVm);},className:"w-full text-left px-4 py-2 text-sm text-emerald-400 hover:bg-proxmox-hover flex items-center gap-2"},/*#__PURE__*/React.createElement(Icons.FolderInput,{className:"w-3.5 h-3.5"})," Migrate to Proxmox"),/*#__PURE__*/React.createElement("div",{className:"border-t border-proxmox-border my-1"}),/*#__PURE__*/React.createElement("button",{onClick:()=>setShowVmwareDelete(true),disabled:isOn,className:"w-full text-left px-4 py-2 text-sm text-red-400 hover:bg-proxmox-hover flex items-center gap-2 disabled:opacity-30 disabled:cursor-not-allowed"},/*#__PURE__*/React.createElement(Icons.Trash,{className:"w-3.5 h-3.5"})," Delete VM ",isOn?'(stop first)':''))))))),/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-1 border-b border-proxmox-border"},[{id:'overview',label:'Overview'},{id:'settings',label:'Settings'},{id:'config',label:'Hardware'},{id:'snapshots',label:`Snapshots (${snapsList.length})`},{id:'migrate',label:'Migration'}].map(tab=>/*#__PURE__*/React.createElement("button",{key:tab.id,onClick:()=>setVmwareVmTab(tab.id),className:`px-4 py-2.5 text-sm font-medium border-b-2 transition-all ${vmwareVmTab===tab.id?'border-emerald-400 text-emerald-400':'border-transparent text-gray-500 hover:text-gray-300'}`},tab.label))),vmwareVmTab==='overview'&&/*#__PURE__*/React.createElement("div",{className:"space-y-4"},/*#__PURE__*/React.createElement("div",{className:"grid grid-cols-2 xl:grid-cols-4 gap-3"},/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl p-4"},/*#__PURE__*/React.createElement("div",{className:"flex items-center justify-between mb-2"},/*#__PURE__*/React.createElement("span",{className:"text-xs text-gray-500 uppercase font-semibold"},"CPU"),/*#__PURE__*/React.createElement(Icons.Cpu,{className:"w-4 h-4 text-blue-400"})),/*#__PURE__*/React.createElement("div",{className:"text-2xl font-bold text-white"},cpuCount),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500"},"vCPUs")),/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl p-4"},/*#__PURE__*/React.createElement("div",{className:"flex items-center justify-between mb-2"},/*#__PURE__*/React.createElement("span",{className:"text-xs text-gray-500 uppercase font-semibold"},"Memory"),/*#__PURE__*/React.createElement(Icons.Memory,{className:"w-4 h-4 text-purple-400"})),/*#__PURE__*/React.createElement("div",{className:"text-2xl font-bold text-white"},memGB),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500"},"GB RAM")),/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl p-4"},/*#__PURE__*/React.createElement("div",{className:"flex items-center justify-between mb-2"},/*#__PURE__*/React.createElement("span",{className:"text-xs text-gray-500 uppercase font-semibold"},"Storage"),/*#__PURE__*/React.createElement(Icons.HardDrive,{className:"w-4 h-4 text-emerald-400"})),/*#__PURE__*/React.createElement("div",{className:"text-2xl font-bold text-white"},totalDiskGB>0?totalDiskGB.toFixed(0):'-'),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500"},"GB (",disksList.length," disks)")),/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl p-4"},/*#__PURE__*/React.createElement("div",{className:"flex items-center justify-between mb-2"},/*#__PURE__*/React.createElement("span",{className:"text-xs text-gray-500 uppercase font-semibold"},"Network"),/*#__PURE__*/React.createElement(Icons.Globe,{className:"w-4 h-4 text-cyan-400"})),/*#__PURE__*/React.createElement("div",{className:"text-lg font-mono font-bold text-white"},ipAddr||'-'),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500"},hostName||`${netsList.length} adapters`))),/*#__PURE__*/React.createElement("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4"},/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl p-4"},/*#__PURE__*/React.createElement("h3",{className:"text-sm font-semibold text-gray-400 uppercase mb-3"},"VM Information"),/*#__PURE__*/React.createElement("div",{className:"space-y-2 text-sm"},[['VM ID',vm.vm||vmwareSelectedVm],['Guest OS',guestOS],['Hardware Version',hwVersion||'-'],['Guest Tools',toolsStatus||'Not installed'],['Power State',vm.power_state||'-'],['IP Address',ipAddr||'N/A'],['Hostname',hostName||'N/A']].map(([label,value])=>/*#__PURE__*/React.createElement("div",{key:label,className:"flex justify-between"},/*#__PURE__*/React.createElement("span",{className:"text-gray-500"},label),/*#__PURE__*/React.createElement("span",{className:"text-white font-mono text-xs"},value))))),/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl p-4"},/*#__PURE__*/React.createElement("h3",{className:"text-sm font-semibold text-gray-400 uppercase mb-3"},"Disks"),disksList.length>0?/*#__PURE__*/React.createElement("div",{className:"space-y-2"},disksList.map((disk,idx)=>{const capGB=disk.capacity?(disk.capacity/(1024*1024*1024)).toFixed(1):disk.capacity_gb||'?';return/*#__PURE__*/React.createElement("div",{key:idx,className:"flex items-center justify-between p-2.5 bg-proxmox-dark rounded-lg"},/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-2"},/*#__PURE__*/React.createElement(Icons.HardDrive,{className:"w-4 h-4 text-gray-500"}),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("div",{className:"text-sm text-white"},disk.label||`Disk ${idx}`),disk.backing?.thin_provisioned&&/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-600"},"Thin provisioned"))),/*#__PURE__*/React.createElement("div",{className:"text-right"},/*#__PURE__*/React.createElement("div",{className:"text-sm text-white font-medium"},capGB," GB"),disk.backing?.datastore&&/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-600"},disk.backing.datastore)));})):/*#__PURE__*/React.createElement("div",{className:"text-gray-600 text-sm"},"No disks found"))),netsList.length>0&&/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl p-4"},/*#__PURE__*/React.createElement("h3",{className:"text-sm font-semibold text-gray-400 uppercase mb-3"},"Network Adapters"),/*#__PURE__*/React.createElement("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2"},netsList.map((nic,idx)=>/*#__PURE__*/React.createElement("div",{key:idx,className:"flex items-center justify-between p-2.5 bg-proxmox-dark rounded-lg"},/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-2"},/*#__PURE__*/React.createElement(Icons.Globe,{className:"w-4 h-4 text-gray-500"}),/*#__PURE__*/React.createElement("span",{className:"text-sm text-white"},nic.label||nic.name||`NIC ${idx}`)),/*#__PURE__*/React.createElement("span",{className:"text-xs text-gray-400 font-mono"},nic.mac_address||'-')))))),vmwareVmTab==='settings'&&(()=>{// Initialize edit form from VM detail -const initCpu=vmwareConfigEdit.cpu||cpuCount||1;const initMem=vmwareConfigEdit.memory||memGB*1024||2048;const initNotes=vmwareConfigEdit.notes!==undefined&&vmwareConfigEdit.notes!==''?vmwareConfigEdit.notes:vm.annotation||vm.notes||vm.config?.annotation||'';const perfData=vm.performance||{};return/*#__PURE__*/React.createElement("div",{className:"space-y-4"},isOn&&/*#__PURE__*/React.createElement("div",{className:"bg-yellow-500/10 border border-yellow-500/20 rounded-xl p-3"},/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-2 text-yellow-400 text-sm"},/*#__PURE__*/React.createElement(Icons.AlertTriangle,{className:"w-4 h-4"}),/*#__PURE__*/React.createElement("span",null,"VM is powered on - some changes (CPU, Memory) may require the VM to be powered off or need hot-add enabled."))),/*#__PURE__*/React.createElement("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4"},/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl p-4"},/*#__PURE__*/React.createElement("h3",{className:"text-sm font-semibold text-gray-400 uppercase mb-4 flex items-center gap-2"},/*#__PURE__*/React.createElement(Icons.Cpu,{className:"w-4 h-4"})," Compute Resources"),/*#__PURE__*/React.createElement("div",{className:"space-y-4"},/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"block text-xs text-gray-500 mb-1.5"},"vCPUs"),/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-2"},/*#__PURE__*/React.createElement("input",{type:"number",min:"1",max:"128",value:vmwareConfigEdit.cpu||cpuCount||'',onChange:e=>setVmwareConfigEdit(p=>({...p,cpu:e.target.value})),className:"flex-1 bg-proxmox-dark border border-proxmox-border rounded-lg px-3 py-2 text-white text-sm"}),/*#__PURE__*/React.createElement("span",{className:"text-xs text-gray-500 w-16"},"cores"))),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"block text-xs text-gray-500 mb-1.5"},"Memory (MB)"),/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-2"},/*#__PURE__*/React.createElement("input",{type:"number",min:"256",step:"256",value:vmwareConfigEdit.memory||memGB*1024||'',onChange:e=>setVmwareConfigEdit(p=>({...p,memory:e.target.value})),className:"flex-1 bg-proxmox-dark border border-proxmox-border rounded-lg px-3 py-2 text-white text-sm"}),/*#__PURE__*/React.createElement("span",{className:"text-xs text-gray-500 w-16"},"MB")),/*#__PURE__*/React.createElement("div",{className:"flex gap-2 mt-1"},[1024,2048,4096,8192,16384].map(v=>/*#__PURE__*/React.createElement("button",{key:v,onClick:()=>setVmwareConfigEdit(p=>({...p,memory:String(v)})),className:`px-2 py-0.5 rounded text-xs ${parseInt(vmwareConfigEdit.memory||memGB*1024)===v?'bg-emerald-500/20 text-emerald-400':'bg-proxmox-dark text-gray-500 hover:text-white'}`},v>=1024?`${v/1024}G`:`${v}M`)))),/*#__PURE__*/React.createElement("div",{className:"pt-2 border-t border-proxmox-border/50 space-y-2"},/*#__PURE__*/React.createElement("label",{className:"flex items-center justify-between cursor-pointer"},/*#__PURE__*/React.createElement("span",{className:"text-sm text-gray-400"},"CPU Hot-Add"),/*#__PURE__*/React.createElement("div",{onClick:()=>setVmwareConfigEdit(p=>({...p,cpu_hot_add:!p.cpu_hot_add})),className:`w-10 h-5 rounded-full transition-colors cursor-pointer flex items-center ${vmwareConfigEdit.cpu_hot_add?'bg-emerald-500':'bg-gray-700'}`},/*#__PURE__*/React.createElement("div",{className:`w-4 h-4 rounded-full bg-white shadow transition-transform ${vmwareConfigEdit.cpu_hot_add?'translate-x-5':'translate-x-0.5'}`}))),/*#__PURE__*/React.createElement("label",{className:"flex items-center justify-between cursor-pointer"},/*#__PURE__*/React.createElement("span",{className:"text-sm text-gray-400"},"Memory Hot-Add"),/*#__PURE__*/React.createElement("div",{onClick:()=>setVmwareConfigEdit(p=>({...p,memory_hot_add:!p.memory_hot_add})),className:`w-10 h-5 rounded-full transition-colors cursor-pointer flex items-center ${vmwareConfigEdit.memory_hot_add?'bg-emerald-500':'bg-gray-700'}`},/*#__PURE__*/React.createElement("div",{className:`w-4 h-4 rounded-full bg-white shadow transition-transform ${vmwareConfigEdit.memory_hot_add?'translate-x-5':'translate-x-0.5'}`})))))),/*#__PURE__*/React.createElement("div",{className:"space-y-4"},/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl p-4"},/*#__PURE__*/React.createElement("h3",{className:"text-sm font-semibold text-gray-400 uppercase mb-4 flex items-center gap-2"},/*#__PURE__*/React.createElement(Icons.FileText,{className:"w-4 h-4"})," Notes"),/*#__PURE__*/React.createElement("textarea",{value:vmwareConfigEdit.notes!==undefined&&vmwareConfigEdit.notes!==''?vmwareConfigEdit.notes:vm.annotation||vm.notes||vm.config?.annotation||'',onChange:e=>setVmwareConfigEdit(p=>({...p,notes:e.target.value})),placeholder:"VM description / notes...",rows:4,className:"w-full bg-proxmox-dark border border-proxmox-border rounded-lg px-3 py-2 text-white text-sm resize-none"})),/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl p-4"},/*#__PURE__*/React.createElement("h3",{className:"text-sm font-semibold text-gray-400 uppercase mb-4 flex items-center gap-2"},/*#__PURE__*/React.createElement(Icons.Play,{className:"w-4 h-4"})," Boot Order"),/*#__PURE__*/React.createElement("div",{className:"space-y-2"},[{key:'disk',label:'Hard Disk',icon:'💾'},{key:'cdrom',label:'CD-ROM',icon:'💿'},{key:'net',label:'Network (PXE)',icon:'🌐'}].map((item,idx)=>/*#__PURE__*/React.createElement("div",{key:item.key,className:"flex items-center gap-3 p-2.5 bg-proxmox-dark rounded-lg"},/*#__PURE__*/React.createElement("span",{className:"text-xs text-gray-500 w-5"},idx+1,"."),/*#__PURE__*/React.createElement("span",null,item.icon),/*#__PURE__*/React.createElement("span",{className:"text-sm text-white flex-1"},item.label))),/*#__PURE__*/React.createElement("button",{onClick:()=>handleVmwareBootOrderSave(vmwareSelectedVm,['disk','cdrom','net']),className:"text-xs text-gray-500 hover:text-emerald-400 transition-colors"},"Reset to default (Disk \u2192 CD \u2192 Network)"))),netsList.length>0&&/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl p-4"},/*#__PURE__*/React.createElement("h3",{className:"text-sm font-semibold text-gray-400 uppercase mb-4 flex items-center gap-2"},/*#__PURE__*/React.createElement(Icons.Globe,{className:"w-4 h-4"})," Network Adapters"),/*#__PURE__*/React.createElement("div",{className:"space-y-3"},netsList.map((nic,idx)=>/*#__PURE__*/React.createElement("div",{key:idx,className:"p-3 bg-proxmox-dark rounded-lg"},/*#__PURE__*/React.createElement("div",{className:"flex items-center justify-between mb-2"},/*#__PURE__*/React.createElement("span",{className:"text-sm text-white font-medium"},nic.label||`NIC ${idx+1}`),/*#__PURE__*/React.createElement("span",{className:"text-xs text-gray-500 font-mono"},nic.mac_address||'')),/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-2"},/*#__PURE__*/React.createElement("select",{value:nic.network||nic.backing?.network_name||'',onChange:e=>handleVmwareNetworkChange(vmwareSelectedVm,nic.key||0,e.target.value),className:"flex-1 bg-proxmox-card border border-proxmox-border rounded px-2 py-1.5 text-sm text-gray-300"},/*#__PURE__*/React.createElement("option",{value:nic.network||nic.backing?.network_name||''},nic.network||nic.backing?.network_name||'Current Network'),vmwareNetworks.filter(n=>n.name!==(nic.network||nic.backing?.network_name)).map(n=>/*#__PURE__*/React.createElement("option",{key:n.network||n.name,value:n.name},n.name)))))))))),perfData.cpu_usage_mhz!==undefined&&/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl p-4"},/*#__PURE__*/React.createElement("h3",{className:"text-sm font-semibold text-gray-400 uppercase mb-3"},"Live Performance"),/*#__PURE__*/React.createElement("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3"},/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-dark rounded-lg p-3 text-center"},/*#__PURE__*/React.createElement("div",{className:"text-lg font-bold text-blue-400"},perfData.cpu_usage_mhz||0," MHz"),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500"},"CPU Usage")),/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-dark rounded-lg p-3 text-center"},/*#__PURE__*/React.createElement("div",{className:"text-lg font-bold text-purple-400"},perfData.memory_usage_mb||0," MB"),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500"},"Memory Used")),/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-dark rounded-lg p-3 text-center"},/*#__PURE__*/React.createElement("div",{className:"text-lg font-bold text-emerald-400"},perfData.disk_committed?(perfData.disk_committed/1024**3).toFixed(1):'0'," GB"),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500"},"Disk Used")),/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-dark rounded-lg p-3 text-center"},/*#__PURE__*/React.createElement("div",{className:"text-lg font-bold text-cyan-400"},perfData.uptime_seconds?Math.floor(perfData.uptime_seconds/3600)+'h':'0h'),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500"},"Uptime")))),/*#__PURE__*/React.createElement("div",{className:"flex justify-end gap-3"},/*#__PURE__*/React.createElement("button",{onClick:()=>setVmwareConfigEdit({cpu:'',memory:'',notes:'',cpu_hot_add:false,memory_hot_add:false}),className:"px-4 py-2 rounded-lg bg-proxmox-card border border-proxmox-border text-gray-400 hover:text-white text-sm"},"Reset"),/*#__PURE__*/React.createElement("button",{onClick:()=>handleVmwareConfigSave(vmwareSelectedVm),disabled:vmwareConfigSaving,className:"px-6 py-2 rounded-lg bg-emerald-500 hover:bg-emerald-600 text-white text-sm font-medium disabled:opacity-50 flex items-center gap-2"},vmwareConfigSaving?/*#__PURE__*/React.createElement(Icons.RefreshCw,{className:"w-4 h-4 animate-spin"}):/*#__PURE__*/React.createElement(Icons.Check,{className:"w-4 h-4"}),"Save Changes")));})(),vmwareVmTab==='config'&&/*#__PURE__*/React.createElement("div",{className:"space-y-4"},/*#__PURE__*/React.createElement("div",{className:"bg-blue-500/10 border border-blue-500/20 rounded-xl p-3"},/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-2 text-blue-400 text-sm"},/*#__PURE__*/React.createElement(Icons.Info,{className:"w-4 h-4"}),/*#__PURE__*/React.createElement("span",null,"Hardware overview (read-only). Use the Settings tab to change CPU, Memory, and Network."))),/*#__PURE__*/React.createElement("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4"},/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl p-4"},/*#__PURE__*/React.createElement("h3",{className:"text-sm font-semibold text-gray-400 uppercase mb-4"},"Current Configuration"),/*#__PURE__*/React.createElement("div",{className:"space-y-3"},/*#__PURE__*/React.createElement("div",{className:"flex items-center justify-between p-3 bg-proxmox-dark rounded-lg"},/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-3"},/*#__PURE__*/React.createElement("div",{className:"w-8 h-8 rounded-lg bg-blue-500/10 flex items-center justify-center"},/*#__PURE__*/React.createElement(Icons.Cpu,{className:"w-4 h-4 text-blue-400"})),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("div",{className:"text-sm text-white font-medium"},"CPU"),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500"},"Virtual CPUs"))),/*#__PURE__*/React.createElement("div",{className:"text-lg font-bold text-white"},cpuCount)),/*#__PURE__*/React.createElement("div",{className:"flex items-center justify-between p-3 bg-proxmox-dark rounded-lg"},/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-3"},/*#__PURE__*/React.createElement("div",{className:"w-8 h-8 rounded-lg bg-purple-500/10 flex items-center justify-center"},/*#__PURE__*/React.createElement(Icons.Memory,{className:"w-4 h-4 text-purple-400"})),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("div",{className:"text-sm text-white font-medium"},"Memory"),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500"},"RAM allocation"))),/*#__PURE__*/React.createElement("div",{className:"text-lg font-bold text-white"},memGB," GB")),disksList.map((disk,idx)=>{const capGB=disk.capacity?(disk.capacity/(1024*1024*1024)).toFixed(1):disk.capacity_gb||'?';return/*#__PURE__*/React.createElement("div",{key:idx,className:"flex items-center justify-between p-3 bg-proxmox-dark rounded-lg"},/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-3"},/*#__PURE__*/React.createElement("div",{className:"w-8 h-8 rounded-lg bg-emerald-500/10 flex items-center justify-center"},/*#__PURE__*/React.createElement(Icons.HardDrive,{className:"w-4 h-4 text-emerald-400"})),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("div",{className:"text-sm text-white font-medium"},disk.label||`Disk ${idx}`),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500"},disk.backing?.thin_provisioned?'Thin':'Thick'," - ",disk.backing?.datastore||''))),/*#__PURE__*/React.createElement("div",{className:"text-lg font-bold text-white"},capGB," GB"));}),netsList.map((nic,idx)=>/*#__PURE__*/React.createElement("div",{key:idx,className:"flex items-center justify-between p-3 bg-proxmox-dark rounded-lg"},/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-3"},/*#__PURE__*/React.createElement("div",{className:"w-8 h-8 rounded-lg bg-cyan-500/10 flex items-center justify-center"},/*#__PURE__*/React.createElement(Icons.Globe,{className:"w-4 h-4 text-cyan-400"})),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("div",{className:"text-sm text-white font-medium"},nic.label||nic.name||`NIC ${idx}`),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500 font-mono"},nic.mac_address||''))),/*#__PURE__*/React.createElement("div",{className:"text-sm text-gray-400"},nic.network||nic.name||''))))),/*#__PURE__*/React.createElement("div",{className:"space-y-4"},vm.hardware&&(vm.hardware.firmware||vm.hardware.scsi_controller)&&/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl p-4"},/*#__PURE__*/React.createElement("h3",{className:"text-sm font-semibold text-gray-400 uppercase mb-4"},"Hardware Details"),/*#__PURE__*/React.createElement("div",{className:"space-y-2 text-sm"},/*#__PURE__*/React.createElement("div",{className:"flex justify-between p-2 bg-proxmox-dark rounded-lg"},/*#__PURE__*/React.createElement("span",{className:"text-gray-400"},"Firmware"),/*#__PURE__*/React.createElement("span",{className:"text-white font-medium"},(vm.hardware.firmware||'BIOS').toUpperCase())),/*#__PURE__*/React.createElement("div",{className:"flex justify-between p-2 bg-proxmox-dark rounded-lg"},/*#__PURE__*/React.createElement("span",{className:"text-gray-400"},"SCSI Controller"),/*#__PURE__*/React.createElement("div",{className:"text-right"},/*#__PURE__*/React.createElement("div",{className:"text-white font-medium"},vm.hardware.scsi_controller||'N/A'),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500"},"\u2192 Proxmox: ",vm.hardware.scsi_controller_pve||'auto'))),/*#__PURE__*/React.createElement("div",{className:"flex justify-between p-2 bg-proxmox-dark rounded-lg"},/*#__PURE__*/React.createElement("span",{className:"text-gray-400"},"Network Adapter"),/*#__PURE__*/React.createElement("div",{className:"text-right"},/*#__PURE__*/React.createElement("div",{className:"text-white font-medium"},vm.hardware.nic_type||'N/A'),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500"},"\u2192 Proxmox: ",vm.hardware.nic_type_pve||'auto'))),/*#__PURE__*/React.createElement("div",{className:"flex justify-between p-2 bg-proxmox-dark rounded-lg"},/*#__PURE__*/React.createElement("span",{className:"text-gray-400"},"Disk Bus"),/*#__PURE__*/React.createElement("span",{className:"text-white font-medium"},(vm.hardware.disk_bus||'SCSI').toUpperCase())),vm.hardware.version&&/*#__PURE__*/React.createElement("div",{className:"flex justify-between p-2 bg-proxmox-dark rounded-lg"},/*#__PURE__*/React.createElement("span",{className:"text-gray-400"},"HW Version"),/*#__PURE__*/React.createElement("span",{className:"text-white font-medium"},vm.hardware.version)))),/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl p-4"},/*#__PURE__*/React.createElement("h3",{className:"text-sm font-semibold text-gray-400 uppercase mb-4"},t('quickActions')||'Quick Actions'),/*#__PURE__*/React.createElement("div",{className:"space-y-2"},/*#__PURE__*/React.createElement("button",{onClick:()=>{setVmwareRenameName(vm.name||'');setShowVmwareRename(true);},className:"w-full flex items-center gap-3 p-3 bg-proxmox-dark rounded-lg hover:bg-proxmox-hover transition-colors text-left"},/*#__PURE__*/React.createElement(Icons.Edit,{className:"w-5 h-5 text-blue-400"}),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("div",{className:"text-sm text-white"},t('renameVm')||'Rename VM'),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500"},t('renameVmDesc')||'Change the display name'))),/*#__PURE__*/React.createElement("button",{onClick:()=>{setVmwareCloneName(`${vm.name}-clone`);setShowVmwareClone(true);},className:"w-full flex items-center gap-3 p-3 bg-proxmox-dark rounded-lg hover:bg-proxmox-hover transition-colors text-left"},/*#__PURE__*/React.createElement(Icons.Copy,{className:"w-5 h-5 text-green-400"}),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("div",{className:"text-sm text-white"},t('cloneVm')||'Clone VM'),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500"},t('cloneVmDesc')||'Create an identical copy'))),/*#__PURE__*/React.createElement("button",{onClick:()=>fetchMigrationPlan(vmwareSelectedVm),disabled:vmwareMigrateLoading,className:"w-full flex items-center gap-3 p-3 bg-proxmox-dark rounded-lg hover:bg-proxmox-hover transition-colors text-left"},/*#__PURE__*/React.createElement(Icons.FolderInput,{className:"w-5 h-5 text-emerald-400"}),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("div",{className:"text-sm text-white"},t('migrateToProxmox')||'Migrate to Proxmox'),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500"},t('v2pMigrationDesc')||'Near-zero downtime V2P migration'))),/*#__PURE__*/React.createElement("button",{onClick:()=>setShowVmwareDelete(true),disabled:isOn,className:"w-full flex items-center gap-3 p-3 bg-proxmox-dark rounded-lg hover:bg-red-500/5 transition-colors text-left disabled:opacity-40"},/*#__PURE__*/React.createElement(Icons.Trash,{className:"w-5 h-5 text-red-400"}),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("div",{className:"text-sm text-red-400"},t('deleteVm')||'Delete VM'),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500"},isOn?t('powerOffFirst')||'Power off first to delete':t('permanentlyRemoveVm')||'Permanently remove this VM')))))))),vmwareVmTab==='snapshots'&&/*#__PURE__*/React.createElement("div",{className:"space-y-4"},/*#__PURE__*/React.createElement("div",{className:"flex items-center justify-between"},/*#__PURE__*/React.createElement("h3",{className:"text-sm font-semibold text-gray-400"},"Snapshots (",snapsList.length,")"),/*#__PURE__*/React.createElement("button",{onClick:async()=>{const name=prompt('Snapshot name:');if(name){await vmwareSnapshotAction(vmwareSelectedVm,'create',{name,description:''});fetchVMwareVmDetail(selectedVMware.id,vmwareSelectedVm);}},className:"px-3 py-1.5 rounded-lg bg-emerald-500/20 text-emerald-400 hover:bg-emerald-500/30 text-sm font-medium"},"+ Create Snapshot")),snapsList.length>0?/*#__PURE__*/React.createElement("div",{className:"space-y-2"},snapsList.map((snap,idx)=>/*#__PURE__*/React.createElement("div",{key:idx,className:"bg-proxmox-card border border-proxmox-border rounded-xl p-4 flex items-center justify-between"},/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-3"},/*#__PURE__*/React.createElement("div",{className:"w-8 h-8 rounded-lg bg-blue-500/10 flex items-center justify-center"},/*#__PURE__*/React.createElement(Icons.Camera,{className:"w-4 h-4 text-blue-400"})),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("div",{className:"text-sm font-medium text-white"},snap.name),snap.description&&/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500"},snap.description),snap.created&&/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-600"},fmtDate(snap.created)))),/*#__PURE__*/React.createElement("button",{onClick:()=>vmwareSnapshotAction(vmwareSelectedVm,'delete',{snapshot_id:snap.id||snap.snapshot}),className:"p-2 text-red-400 hover:bg-red-500/10 rounded-lg",title:"Delete snapshot"},/*#__PURE__*/React.createElement(Icons.Trash,{className:"w-4 h-4"}))))):/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl p-8 text-center text-gray-500"},/*#__PURE__*/React.createElement(Icons.Camera,{className:"w-8 h-8 mx-auto mb-2 opacity-30"}),/*#__PURE__*/React.createElement("div",{className:"text-sm"},"No snapshots. Create one to save the current VM state."))),vmwareVmTab==='migrate'&&/*#__PURE__*/React.createElement("div",{className:"space-y-4"},/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl p-5"},/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-3 mb-4"},/*#__PURE__*/React.createElement("div",{className:"w-10 h-10 rounded-xl bg-emerald-500/10 flex items-center justify-center"},/*#__PURE__*/React.createElement(Icons.FolderInput,{className:"w-5 h-5 text-emerald-400"})),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("h3",{className:"text-white font-semibold"},"Migrate to Proxmox VE"),/*#__PURE__*/React.createElement("p",{className:"text-xs text-gray-500"},"Near-zero downtime ESXi to Proxmox migration using block-level delta sync"))),/*#__PURE__*/React.createElement("div",{className:"grid grid-cols-3 gap-3 mb-4"},/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-dark rounded-lg p-3 text-center"},/*#__PURE__*/React.createElement("div",{className:"text-lg font-bold text-white"},totalDiskGB.toFixed(0)," GB"),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500"},"Total Disk")),/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-dark rounded-lg p-3 text-center"},/*#__PURE__*/React.createElement("div",{className:"text-lg font-bold text-emerald-400"},"~",Math.max(2,Math.round(totalDiskGB*0.08))," min"),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500"},"Est. Downtime")),/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-dark rounded-lg p-3 text-center"},/*#__PURE__*/React.createElement("div",{className:"text-lg font-bold text-white"},disksList.length),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500"},"Disks to Transfer"))),/*#__PURE__*/React.createElement("div",{className:"space-y-2 mb-4 text-xs text-gray-400"},/*#__PURE__*/React.createElement("div",{className:"font-semibold text-gray-300 mb-1"},t('howItWorks')||'How it works:'),/*#__PURE__*/React.createElement("div",null,"1. ",t('migStep1')||'Snapshot or live-mirror the source VMDKs depending on transfer mode'),/*#__PURE__*/React.createElement("div",null,"2. ",t('migStep2')||'Stream disks to Proxmox storage (SSH dd / drive-mirror / SSHFS)'),/*#__PURE__*/React.createElement("div",null,"3. ",t('migStep3')||'Import VM config (CPU, RAM, network) — ESXi power-state handled automatically'),/*#__PURE__*/React.createElement("div",null,"4. ",t('migStep4')||'Atomic cutover and start VM on Proxmox')),/*#__PURE__*/React.createElement("button",{onClick:()=>fetchMigrationPlan(vmwareSelectedVm),disabled:vmwareMigrateLoading,className:"w-full py-2.5 rounded-lg bg-emerald-500 text-white font-medium hover:bg-emerald-600 disabled:opacity-50 text-sm"},vmwareMigrateLoading?'Loading Migration Plan...':'Start Migration Wizard')),vmwareMigrations.length>0&&/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl p-4"},/*#__PURE__*/React.createElement("h3",{className:"text-sm font-semibold text-gray-400 uppercase mb-3"},"Active Migrations"),/*#__PURE__*/React.createElement("div",{className:"space-y-2"},vmwareMigrations.map(m=>/*#__PURE__*/React.createElement("div",{key:m.id,className:"p-3 bg-proxmox-dark rounded-lg"},/*#__PURE__*/React.createElement("div",{className:"flex items-center justify-between mb-2"},/*#__PURE__*/React.createElement("span",{className:"text-sm text-white font-medium"},m.vm_name||m.id),/*#__PURE__*/React.createElement("span",{className:`px-2 py-0.5 rounded text-xs font-medium ${m.status==='completed'?'bg-green-500/20 text-green-400':m.status==='failed'?'bg-red-500/20 text-red-400':m.status==='running'?'bg-blue-500/20 text-blue-400':'bg-gray-500/20 text-gray-400'}`},m.status)),m.progress!==undefined&&/*#__PURE__*/React.createElement("div",{className:"w-full h-1.5 bg-proxmox-dark rounded-full overflow-hidden"},/*#__PURE__*/React.createElement("div",{className:"h-full bg-emerald-400 rounded-full transition-all",style:{width:`${m.progress}%`}})),m.current_step&&/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500 mt-1"},m.current_step),m.phase==='awaiting_confirmation'&&/*#__PURE__*/React.createElement("div",{className:"mt-2 flex items-center gap-2"},/*#__PURE__*/React.createElement("span",{className:"text-xs text-amber-300 flex-1"},t('awaitingCutoverShort')||'Ready to switch over — source still running.'),/*#__PURE__*/React.createElement("button",{onClick:()=>confirmVmwareCutover(m.id),className:"px-2 py-1 rounded text-xs font-semibold bg-emerald-500/20 text-emerald-300 hover:bg-emerald-500/30 border border-emerald-500/40"},t('commitSwitchover')||'Commit switchover now'),/*#__PURE__*/React.createElement("button",{onClick:()=>cancelVmwareCutover(m.id),className:"px-2 py-1 rounded text-xs font-semibold bg-red-500/10 text-red-300 hover:bg-red-500/20 border border-red-500/30"},t('cancel')||'Cancel'))))))));})():/*#__PURE__*/React.createElement("div",{className:"text-center py-12 text-gray-500"},/*#__PURE__*/React.createElement(Icons.RefreshCw,{className:"w-6 h-6 mx-auto mb-2 animate-spin opacity-30"}),"Loading VM details..."),showVmwareClone&&/*#__PURE__*/React.createElement("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-50",onClick:()=>setShowVmwareClone(false)},/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-2xl p-6 w-full max-w-md",onClick:e=>e.stopPropagation()},/*#__PURE__*/React.createElement("h3",{className:"text-lg font-bold text-white mb-4"},"Clone VM"),/*#__PURE__*/React.createElement("input",{value:vmwareCloneName,onChange:e=>setVmwareCloneName(e.target.value),placeholder:"Clone name...",className:"w-full px-4 py-2.5 bg-proxmox-dark border border-proxmox-border rounded-xl text-white mb-4 focus:outline-none focus:border-emerald-500/50"}),/*#__PURE__*/React.createElement("div",{className:"flex gap-2 justify-end"},/*#__PURE__*/React.createElement("button",{onClick:()=>setShowVmwareClone(false),className:"px-4 py-2 rounded-lg bg-proxmox-dark text-gray-400 text-sm"},"Cancel"),/*#__PURE__*/React.createElement("button",{onClick:()=>handleVmwareClone(vmwareSelectedVm,vmwareCloneName),disabled:!vmwareCloneName.trim(),className:"px-4 py-2 rounded-lg bg-emerald-500 text-white text-sm font-medium disabled:opacity-50"},"Clone")))),showVmwareRename&&/*#__PURE__*/React.createElement("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-50",onClick:()=>setShowVmwareRename(false)},/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-2xl p-6 w-full max-w-md",onClick:e=>e.stopPropagation()},/*#__PURE__*/React.createElement("h3",{className:"text-lg font-bold text-white mb-4"},"Rename VM"),/*#__PURE__*/React.createElement("input",{value:vmwareRenameName,onChange:e=>setVmwareRenameName(e.target.value),placeholder:"New name...",className:"w-full px-4 py-2.5 bg-proxmox-dark border border-proxmox-border rounded-xl text-white mb-4 focus:outline-none focus:border-emerald-500/50"}),/*#__PURE__*/React.createElement("div",{className:"flex gap-2 justify-end"},/*#__PURE__*/React.createElement("button",{onClick:()=>setShowVmwareRename(false),className:"px-4 py-2 rounded-lg bg-proxmox-dark text-gray-400 text-sm"},"Cancel"),/*#__PURE__*/React.createElement("button",{onClick:()=>handleVmwareRename(vmwareSelectedVm,vmwareRenameName),disabled:!vmwareRenameName.trim(),className:"px-4 py-2 rounded-lg bg-blue-500 text-white text-sm font-medium disabled:opacity-50"},"Rename")))),showVmwareDelete&&/*#__PURE__*/React.createElement("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-50",onClick:()=>setShowVmwareDelete(false)},/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-red-500/30 rounded-2xl p-6 w-full max-w-md",onClick:e=>e.stopPropagation()},/*#__PURE__*/React.createElement("h3",{className:"text-lg font-bold text-red-400 mb-2"},"Delete VM"),/*#__PURE__*/React.createElement("p",{className:"text-gray-400 text-sm mb-4"},"Are you sure you want to permanently delete ",/*#__PURE__*/React.createElement("strong",{className:"text-white"},vmwareVmDetail?.name),"? This action cannot be undone."),/*#__PURE__*/React.createElement("div",{className:"flex gap-2 justify-end"},/*#__PURE__*/React.createElement("button",{onClick:()=>setShowVmwareDelete(false),className:"px-4 py-2 rounded-lg bg-proxmox-dark text-gray-400 text-sm"},"Cancel"),/*#__PURE__*/React.createElement("button",{onClick:()=>handleVmwareDeleteVm(vmwareSelectedVm),className:"px-4 py-2 rounded-lg bg-red-500 text-white text-sm font-medium"},"Delete VM")))),showVmwareMigrate&&vmwareMigrationPlan&&/*#__PURE__*/React.createElement("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-50",onClick:()=>setShowVmwareMigrate(false)},/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-emerald-500/30 rounded-2xl p-6 w-full max-w-2xl max-h-[85vh] overflow-y-auto",onClick:e=>e.stopPropagation()},/*#__PURE__*/React.createElement("h3",{className:"text-lg font-bold text-white mb-1"},"Migrate to Proxmox"),/*#__PURE__*/React.createElement("p",{className:"text-xs text-gray-500 mb-3"},"Method: ",vmwareMigrationPlan.method||'HTTPS + Delta Sync'),/*#__PURE__*/React.createElement("div",{className:"flex gap-1 mb-4 border-b border-proxmox-border pb-2"},[{id:'target',label:'Target',icon:'🎯'},{id:'hardware',label:'Hardware',icon:'🔧'},{id:'advanced',label:'Advanced',icon:'⚙️'}].map(tab=>/*#__PURE__*/React.createElement("button",{key:tab.id,onClick:()=>setMigrateWizardStep(tab.id),className:`px-3 py-1.5 rounded-lg text-xs font-medium transition-all ${migrateWizardStep===tab.id?'bg-emerald-500/20 text-emerald-400':'text-gray-500 hover:text-gray-300'}`},tab.icon," ",tab.label))),migrateWizardStep==='target'&&/*#__PURE__*/React.createElement("div",{className:"space-y-3"},/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"text-xs text-gray-500 mb-1 block"},"Target Cluster"),/*#__PURE__*/React.createElement("select",{value:vmwareMigrateForm.target_cluster,onChange:e=>{setVmwareMigrateForm({...vmwareMigrateForm,target_cluster:e.target.value,target_node:'',target_storage:''});},className:"w-full px-3 py-2 bg-proxmox-dark border border-proxmox-border rounded-lg text-white text-sm"},/*#__PURE__*/React.createElement("option",{value:""},"Select cluster..."),(vmwareMigrationPlan.targets||[]).map(t=>/*#__PURE__*/React.createElement("option",{key:t.cluster_id,value:t.cluster_id},t.cluster_name)))),vmwareMigrateForm.target_cluster&&/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"text-xs text-gray-500 mb-1 block"},"Target Node"),/*#__PURE__*/React.createElement("select",{value:vmwareMigrateForm.target_node,onChange:e=>{setVmwareMigrateForm({...vmwareMigrateForm,target_node:e.target.value,target_storage:''});},className:"w-full px-3 py-2 bg-proxmox-dark border border-proxmox-border rounded-lg text-white text-sm"},/*#__PURE__*/React.createElement("option",{value:""},"Select node..."),((vmwareMigrationPlan.targets||[]).find(t=>t.cluster_id===vmwareMigrateForm.target_cluster)?.nodes||[]).map(n=>/*#__PURE__*/React.createElement("option",{key:n,value:n},n)))),vmwareMigrateForm.target_node&&/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"text-xs text-gray-500 mb-1 block"},"Target Storage"),/*#__PURE__*/React.createElement("select",{value:vmwareMigrateForm.target_storage,onChange:e=>setVmwareMigrateForm({...vmwareMigrateForm,target_storage:e.target.value}),className:"w-full px-3 py-2 bg-proxmox-dark border border-proxmox-border rounded-lg text-white text-sm"},/*#__PURE__*/React.createElement("option",{value:""},"Select storage..."),((vmwareMigrationPlan.targets||[]).find(t=>t.cluster_id===vmwareMigrateForm.target_cluster)?.storages?.[vmwareMigrateForm.target_node]||[]).map(s=>/*#__PURE__*/React.createElement("option",{key:s,value:s},s)))),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"text-xs text-gray-500 mb-1 block"},"ESXi SSH User"),/*#__PURE__*/React.createElement("input",{value:vmwareMigrateForm.esxi_user,onChange:e=>setVmwareMigrateForm({...vmwareMigrateForm,esxi_user:e.target.value}),placeholder:"root",className:"w-full px-3 py-2 bg-proxmox-dark border border-proxmox-border rounded-lg text-white text-sm"})),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"text-xs text-gray-500 mb-1 block"},"ESXi Password (for SSH access)"),/*#__PURE__*/React.createElement("input",{type:"password",value:vmwareMigrateForm.esxi_password,onChange:e=>setVmwareMigrateForm({...vmwareMigrateForm,esxi_password:e.target.value}),placeholder:"ESXi password",className:"w-full px-3 py-2 bg-proxmox-dark border border-proxmox-border rounded-lg text-white text-sm"})),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"text-xs text-gray-500 mb-1 block"},"Network Bridge"),/*#__PURE__*/React.createElement("input",{value:vmwareMigrateForm.network_bridge,onChange:e=>setVmwareMigrateForm({...vmwareMigrateForm,network_bridge:e.target.value}),className:"w-full px-3 py-2 bg-proxmox-dark border border-proxmox-border rounded-lg text-white text-sm"})),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"text-xs text-gray-500 mb-1 block"},"VLAN Tag ",/*#__PURE__*/React.createElement("span",{className:"text-gray-600"},"(optional, 1-4094)")),/*#__PURE__*/React.createElement("input",{type:"number",min:"1",max:"4094",value:vmwareMigrateForm.net_vlan_tag,onChange:e=>setVmwareMigrateForm({...vmwareMigrateForm,net_vlan_tag:e.target.value}),placeholder:"none",className:"w-full px-3 py-2 bg-proxmox-dark border border-proxmox-border rounded-lg text-white text-sm"})),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"text-xs text-gray-500 mb-1 block"},"Firmware"),/*#__PURE__*/React.createElement("select",{value:vmwareMigrateForm.bios,onChange:e=>setVmwareMigrateForm({...vmwareMigrateForm,bios:e.target.value}),className:"w-full px-3 py-2 bg-proxmox-dark border border-proxmox-border rounded-lg text-white text-sm"},/*#__PURE__*/React.createElement("option",{value:"auto"},"Auto-detect (",vmwareMigrationPlan?.source?.hardware?.firmware||'bios',")"),/*#__PURE__*/React.createElement("option",{value:"seabios"},"Legacy BIOS (SeaBIOS)"),/*#__PURE__*/React.createElement("option",{value:"ovmf"},"UEFI (OVMF)"))),vmwareMigrationPlan?.source?.nics?.length>0&&/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"text-xs text-gray-500 mb-1 block"},"Network Interfaces (",vmwareMigrationPlan.source.nics.length," detected)"),/*#__PURE__*/React.createElement("div",{className:"space-y-1 p-2 bg-proxmox-dark rounded-lg border border-proxmox-border max-h-32 overflow-y-auto"},vmwareMigrationPlan.source.nics.map((nic,i)=>/*#__PURE__*/React.createElement("div",{key:i,className:"flex items-center gap-2 text-xs text-gray-300 py-1"},/*#__PURE__*/React.createElement("span",{className:"text-green-400"},"\u25CF"),/*#__PURE__*/React.createElement("span",{className:"font-mono"},nic.pve_model||nic.type),/*#__PURE__*/React.createElement("span",{className:"text-gray-500"},"\u2014"),/*#__PURE__*/React.createElement("span",{className:"text-gray-400"},nic.network||'N/A'),nic.mac_address&&/*#__PURE__*/React.createElement("span",{className:"text-gray-600 font-mono ml-auto"},nic.mac_address)))),/*#__PURE__*/React.createElement("label",{className:"flex items-center gap-2 text-xs text-gray-400 mt-2"},/*#__PURE__*/React.createElement("input",{type:"checkbox",checked:vmwareMigrateForm.preserve_mac,onChange:e=>setVmwareMigrateForm({...vmwareMigrateForm,preserve_mac:e.target.checked}),className:"rounded"}),"Preserve MAC addresses")),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"text-xs text-gray-500 mb-1 block"},t('transferMode')||'Transfer Mode'),/*#__PURE__*/React.createElement("select",{value:vmwareMigrateForm.transfer_mode,onChange:e=>setVmwareMigrateForm({...vmwareMigrateForm,transfer_mode:e.target.value}),className:"w-full px-3 py-2 bg-proxmox-dark border border-proxmox-border rounded-lg text-white text-sm"},/*#__PURE__*/React.createElement("option",{value:"vmkfstools_clone"},t('transferModeVmkClone')||'Live Clone — Near-Zero Downtime (recommended)'),/*#__PURE__*/React.createElement("option",{value:"auto"},t('transferModeAuto')||'Auto (Pre-Sync + Delta)'),/*#__PURE__*/React.createElement("option",{value:"sshfs_boot"},t('transferModeSshfsBoot')||'Live Mirror — Near-Zero Downtime'),/*#__PURE__*/React.createElement("option",{value:"snapshot_zero"},t('transferModeSnapshotZero')||'Snapshot-Iterative — Zero Downtime (experimental)'),/*#__PURE__*/React.createElement("option",{value:"offline"},t('transferModeOffline')||'Offline Copy (Full Downtime)')),/*#__PURE__*/React.createElement("p",{className:"text-xs text-gray-300 mt-1 leading-relaxed"},vmwareMigrateForm.transfer_mode==='auto'&&(t('transferModeAutoDesc')||'Tries pre-sync while VM runs, falls back to live-mirror if VMDK is locked'),vmwareMigrateForm.transfer_mode==='sshfs_boot'&&(t('transferModeSshfsBootDesc')||'QEMU drive-mirror live-pivots disks from SSHFS-mounted source to local LVM. ~30s real downtime. Multi-disk capable. Recommended for most workloads — limit to 1-2 concurrent VMs to keep mirror throughput high.'),vmwareMigrateForm.transfer_mode==='vmkfstools_clone'&&(t('transferModeVmkCloneDesc')||'Snapshots the running VM and clones the frozen base disk at the vmkernel level on the ESXi host, then imports to Proxmox and cuts over. VM stays up until a short cutover. Works where Live-Mirror / Snapshot-Iterative fail (no locked-base-disk problem). Supports all Proxmox storage types (Ceph/RBD, LVM, LVM-Thin, dir). Needs ESXi SSH enabled.'),vmwareMigrateForm.transfer_mode==='snapshot_zero'&&(t('transferModeSnapshotZeroDesc')||'ESXi snapshot rotation — VM stays running through pre-sync + iterative delta sync, only ~10s downtime at cutover. ⚠️ May not work on your system (e.g. ESXi 6.x or VMFS6 with strict locking) — requires ESXi setup that releases base-VMDK lock after snapshot.'),vmwareMigrateForm.transfer_mode==='offline'&&(t('transferModeOfflineDesc')||'Stops ESXi VM, copies disks via SSH dd, then starts on Proxmox (full downtime ~ disk-size / network-speed)'))),/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-4"},/*#__PURE__*/React.createElement("label",{className:"flex items-center gap-2 text-sm text-gray-400"},/*#__PURE__*/React.createElement("input",{type:"checkbox",checked:vmwareMigrateForm.start_after,onChange:e=>setVmwareMigrateForm({...vmwareMigrateForm,start_after:e.target.checked}),className:"rounded"}),"Start VM after migration"),/*#__PURE__*/React.createElement("label",{className:"flex items-center gap-2 text-sm text-gray-400"},/*#__PURE__*/React.createElement("input",{type:"checkbox",checked:vmwareMigrateForm.remove_source,onChange:e=>setVmwareMigrateForm({...vmwareMigrateForm,remove_source:e.target.checked}),className:"rounded"}),"Remove source VM")),/*#__PURE__*/React.createElement("label",{className:"flex items-start gap-2 text-sm text-gray-400 bg-proxmox-dark/40 border border-proxmox-border rounded-lg p-3 cursor-pointer"},/*#__PURE__*/React.createElement("input",{type:"checkbox",checked:vmwareMigrateForm.wait_for_confirmation,onChange:e=>setVmwareMigrateForm({...vmwareMigrateForm,wait_for_confirmation:e.target.checked}),className:"rounded mt-0.5"}),/*#__PURE__*/React.createElement("span",null,/*#__PURE__*/React.createElement("span",{className:"text-gray-200"},t('waitForConfirmation')||'Wait for my confirmation before switchover'),/*#__PURE__*/React.createElement("span",{className:"block text-xs text-gray-500 mt-0.5"},t('waitForConfirmationDesc')||'The migration pauses right before the final cutover — with the source VM still running — and waits for you to commit the switchover, so you schedule the seconds of downtime yourself (drain monitoring, flip DNS, then commit). Most effective on the near-zero-downtime modes (vmkfstools-clone / auto / snapshot-zero).'))),vmwareMigrationPlan.requirements&&/*#__PURE__*/React.createElement("div",{className:"bg-yellow-500/5 border border-yellow-500/20 rounded-lg p-3"},/*#__PURE__*/React.createElement("div",{className:"text-xs text-yellow-400 font-semibold mb-1"},"Requirements:"),vmwareMigrationPlan.requirements.map((r,i)=>/*#__PURE__*/React.createElement("div",{key:i,className:"text-xs text-yellow-400/70"},"- ",r)))),migrateWizardStep==='hardware'&&/*#__PURE__*/React.createElement("div",{className:"space-y-3"},/*#__PURE__*/React.createElement("p",{className:"text-xs text-gray-500 mb-2"},"Auto-detected from ESXi. Override if needed."),/*#__PURE__*/React.createElement("div",{className:"grid grid-cols-2 gap-3"},/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"text-xs text-gray-500 mb-1 block"},"BIOS / Firmware"),/*#__PURE__*/React.createElement("select",{value:vmwareMigrateForm.bios,onChange:e=>setVmwareMigrateForm(f=>({...f,bios:e.target.value})),className:"w-full bg-proxmox-dark border border-proxmox-border rounded-lg px-3 py-2 text-sm text-white"},/*#__PURE__*/React.createElement("option",{value:"auto"},"Auto (",vmwareMigrationPlan.source?.hardware?.firmware||'bios',")"),/*#__PURE__*/React.createElement("option",{value:"seabios"},"SeaBIOS (Legacy)"),/*#__PURE__*/React.createElement("option",{value:"ovmf"},"OVMF (UEFI)"))),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"text-xs text-gray-500 mb-1 block"},"OS Type"),/*#__PURE__*/React.createElement("select",{value:vmwareMigrateForm.ostype,onChange:e=>setVmwareMigrateForm(f=>({...f,ostype:e.target.value})),className:"w-full bg-proxmox-dark border border-proxmox-border rounded-lg px-3 py-2 text-sm text-white"},/*#__PURE__*/React.createElement("option",{value:"auto"},"Auto (",vmwareMigrationPlan.source?.guest_OS||'detect',")"),/*#__PURE__*/React.createElement("option",{value:"l26"},"Linux (2.6-6.x)"),/*#__PURE__*/React.createElement("option",{value:"win11"},"Windows 11/Server 2022+"),/*#__PURE__*/React.createElement("option",{value:"win10"},"Windows 10/Server 2016-2019"),/*#__PURE__*/React.createElement("option",{value:"win8"},"Windows 8/Server 2012"),/*#__PURE__*/React.createElement("option",{value:"win7"},"Windows 7/Server 2008 R2"),/*#__PURE__*/React.createElement("option",{value:"other"},"Other"))),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"text-xs text-gray-500 mb-1 block"},"SCSI Controller"),/*#__PURE__*/React.createElement("select",{value:vmwareMigrateForm.scsihw,onChange:e=>setVmwareMigrateForm(f=>({...f,scsihw:e.target.value})),className:"w-full bg-proxmox-dark border border-proxmox-border rounded-lg px-3 py-2 text-sm text-white"},/*#__PURE__*/React.createElement("option",{value:"auto"},"Auto (",vmwareMigrationPlan.source?.hardware?.scsi_controller||'detect',")"),/*#__PURE__*/React.createElement("option",{value:"virtio-scsi-single"},"VirtIO SCSI Single (recommended)"),/*#__PURE__*/React.createElement("option",{value:"virtio-scsi-pci"},"VirtIO SCSI"),/*#__PURE__*/React.createElement("option",{value:"lsi"},"LSI 53C895A"),/*#__PURE__*/React.createElement("option",{value:"pvscsi"},"VMware PVSCSI"),/*#__PURE__*/React.createElement("option",{value:"megasas"},"MegaRAID SAS"))),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"text-xs text-gray-500 mb-1 block"},"Disk Bus"),/*#__PURE__*/React.createElement("select",{value:vmwareMigrateForm.disk_bus,onChange:e=>setVmwareMigrateForm(f=>({...f,disk_bus:e.target.value})),className:"w-full bg-proxmox-dark border border-proxmox-border rounded-lg px-3 py-2 text-sm text-white"},/*#__PURE__*/React.createElement("option",{value:"auto"},"Auto (",vmwareMigrationPlan.source?.hardware?.disk_bus||'scsi',")"),/*#__PURE__*/React.createElement("option",{value:"scsi"},"SCSI"),/*#__PURE__*/React.createElement("option",{value:"sata"},"SATA"),/*#__PURE__*/React.createElement("option",{value:"ide"},"IDE"),/*#__PURE__*/React.createElement("option",{value:"virtio"},"VirtIO Block"))),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"text-xs text-gray-500 mb-1 block"},"VGA Display"),/*#__PURE__*/React.createElement("select",{value:vmwareMigrateForm.vga,onChange:e=>setVmwareMigrateForm(f=>({...f,vga:e.target.value})),className:"w-full bg-proxmox-dark border border-proxmox-border rounded-lg px-3 py-2 text-sm text-white"},/*#__PURE__*/React.createElement("option",{value:"vmware"},"VMware SVGA (recommended)"),/*#__PURE__*/React.createElement("option",{value:"std"},"Standard VGA"),/*#__PURE__*/React.createElement("option",{value:"virtio"},"VirtIO GPU"),/*#__PURE__*/React.createElement("option",{value:"virtio-gl"},"VirtIO-GPU (virgl)"),/*#__PURE__*/React.createElement("option",{value:"qxl"},"QXL (SPICE)"),/*#__PURE__*/React.createElement("option",{value:"qxl2"},"QXL 2 heads"),/*#__PURE__*/React.createElement("option",{value:"qxl3"},"QXL 3 heads"),/*#__PURE__*/React.createElement("option",{value:"qxl4"},"QXL 4 heads"),/*#__PURE__*/React.createElement("option",{value:"cirrus"},"Cirrus Logic"),/*#__PURE__*/React.createElement("option",{value:"serial0"},"Serial 0"),/*#__PURE__*/React.createElement("option",{value:"serial1"},"Serial 1"),/*#__PURE__*/React.createElement("option",{value:"serial2"},"Serial 2"),/*#__PURE__*/React.createElement("option",{value:"serial3"},"Serial 3"),/*#__PURE__*/React.createElement("option",{value:"none"},"None (headless)"))),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"text-xs text-gray-500 mb-1 block"},"Network Model"),/*#__PURE__*/React.createElement("select",{value:vmwareMigrateForm.net_driver,onChange:e=>setVmwareMigrateForm(f=>({...f,net_driver:e.target.value})),className:"w-full bg-proxmox-dark border border-proxmox-border rounded-lg px-3 py-2 text-sm text-white"},/*#__PURE__*/React.createElement("option",{value:"auto"},"Auto (",vmwareMigrationPlan.source?.hardware?.nic_type||'detect',")"),/*#__PURE__*/React.createElement("option",{value:"e1000"},"Intel E1000"),/*#__PURE__*/React.createElement("option",{value:"e1000e"},"Intel E1000e"),/*#__PURE__*/React.createElement("option",{value:"virtio"},"VirtIO (best perf)"),/*#__PURE__*/React.createElement("option",{value:"vmxnet3"},"VMware vmxnet3"))),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"text-xs text-gray-500 mb-1 block"},"CPU Sockets"),/*#__PURE__*/React.createElement("input",{type:"number",min:"1",max:"8",value:vmwareMigrateForm.sockets||vmwareMigrationPlan.source?.cpu?.sockets||1,onChange:e=>setVmwareMigrateForm(f=>({...f,sockets:parseInt(e.target.value)||1})),className:"w-full bg-proxmox-dark border border-proxmox-border rounded-lg px-3 py-2 text-sm text-white"})),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"text-xs text-gray-500 mb-1 block"},"Cores per Socket"),/*#__PURE__*/React.createElement("input",{type:"number",min:"1",max:"128",value:vmwareMigrateForm.cores_per_socket||vmwareMigrationPlan.source?.cpu?.cores_per_socket||1,onChange:e=>setVmwareMigrateForm(f=>({...f,cores_per_socket:parseInt(e.target.value)||1})),className:"w-full bg-proxmox-dark border border-proxmox-border rounded-lg px-3 py-2 text-sm text-white"})),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"text-xs text-gray-500 mb-1 block"},"Memory (MB)"),/*#__PURE__*/React.createElement("input",{type:"number",min:"128",value:vmwareMigrateForm.memory||vmwareMigrationPlan.source?.memory?.size_MiB||2048,onChange:e=>setVmwareMigrateForm(f=>({...f,memory:parseInt(e.target.value)||2048})),className:"w-full bg-proxmox-dark border border-proxmox-border rounded-lg px-3 py-2 text-sm text-white"})),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"text-xs text-gray-500 mb-1 block"},"CPU Type"),/*#__PURE__*/React.createElement("select",{value:vmwareMigrateForm.cpu_type,onChange:e=>setVmwareMigrateForm(f=>({...f,cpu_type:e.target.value})),className:"w-full bg-proxmox-dark border border-proxmox-border rounded-lg px-3 py-2 text-sm text-white"},/*#__PURE__*/React.createElement("option",{value:"host"},"host (match physical CPU)"),/*#__PURE__*/React.createElement("option",{value:"kvm64"},"kvm64 (safe default)"),/*#__PURE__*/React.createElement("option",{value:"x86-64-v2-AES"},"x86-64-v2-AES"),/*#__PURE__*/React.createElement("option",{value:"x86-64-v3"},"x86-64-v3"))))),migrateWizardStep==='advanced'&&/*#__PURE__*/React.createElement("div",{className:"space-y-3"},/*#__PURE__*/React.createElement("p",{className:"text-xs text-gray-500 mb-2"},"Fine-tune disk, security, and runtime options."),/*#__PURE__*/React.createElement("details",{className:"group"},/*#__PURE__*/React.createElement("summary",{className:"text-xs font-medium text-gray-400 cursor-pointer hover:text-gray-300 list-none flex items-center gap-1"},/*#__PURE__*/React.createElement("svg",{className:"w-3 h-3 transition-transform group-open:rotate-90",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},/*#__PURE__*/React.createElement("path",{d:"M9 18l6-6-6-6"})),"\uD83D\uDCBE Disk Options"),/*#__PURE__*/React.createElement("div",{className:"grid grid-cols-2 gap-3 mt-2 ml-4"},/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"text-xs text-gray-500 mb-1 block"},"Format"),/*#__PURE__*/React.createElement("select",{value:vmwareMigrateForm.disk_format,onChange:e=>setVmwareMigrateForm(f=>({...f,disk_format:e.target.value})),className:"w-full bg-proxmox-dark border border-proxmox-border rounded px-2 py-1.5 text-xs text-white"},/*#__PURE__*/React.createElement("option",{value:"raw"},"raw (best perf)"),/*#__PURE__*/React.createElement("option",{value:"qcow2"},"qcow2 (snapshots)"))),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"text-xs text-gray-500 mb-1 block"},"Cache"),/*#__PURE__*/React.createElement("select",{value:vmwareMigrateForm.disk_cache,onChange:e=>setVmwareMigrateForm(f=>({...f,disk_cache:e.target.value})),className:"w-full bg-proxmox-dark border border-proxmox-border rounded px-2 py-1.5 text-xs text-white"},/*#__PURE__*/React.createElement("option",{value:"none"},"none (recommended)"),/*#__PURE__*/React.createElement("option",{value:"writethrough"},"writethrough"),/*#__PURE__*/React.createElement("option",{value:"writeback"},"writeback"),/*#__PURE__*/React.createElement("option",{value:"directsync"},"directsync"))),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"text-xs text-gray-500 mb-1 block"},"AIO Mode"),/*#__PURE__*/React.createElement("select",{value:vmwareMigrateForm.aio_mode,onChange:e=>setVmwareMigrateForm(f=>({...f,aio_mode:e.target.value})),className:"w-full bg-proxmox-dark border border-proxmox-border rounded px-2 py-1.5 text-xs text-white"},/*#__PURE__*/React.createElement("option",{value:""},"default (io_uring)"),/*#__PURE__*/React.createElement("option",{value:"io_uring"},"io_uring"),/*#__PURE__*/React.createElement("option",{value:"native"},"native"),/*#__PURE__*/React.createElement("option",{value:"threads"},"threads")),/*#__PURE__*/React.createElement("p",{className:"text-[10px] text-gray-600 mt-1"},"native needs cache=none/directsync; io_uring needs a modern kernel. Leave default unless you know you need it.")),/*#__PURE__*/React.createElement("label",{className:"flex items-center gap-2 text-xs text-gray-400"},/*#__PURE__*/React.createElement("input",{type:"checkbox",checked:vmwareMigrateForm.disk_iothread,onChange:e=>setVmwareMigrateForm(f=>({...f,disk_iothread:e.target.checked})),className:"rounded"}),"IO Thread (per-disk)"),/*#__PURE__*/React.createElement("label",{className:"flex items-center gap-2 text-xs text-gray-400"},/*#__PURE__*/React.createElement("input",{type:"checkbox",checked:vmwareMigrateForm.disk_ssd,onChange:e=>setVmwareMigrateForm(f=>({...f,disk_ssd:e.target.checked})),className:"rounded"}),"SSD Emulation"),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"text-xs text-gray-500 mb-1 block"},"Discard (TRIM)"),/*#__PURE__*/React.createElement("select",{value:vmwareMigrateForm.disk_discard,onChange:e=>setVmwareMigrateForm(f=>({...f,disk_discard:e.target.value})),className:"w-full bg-proxmox-dark border border-proxmox-border rounded px-2 py-1.5 text-xs text-white"},/*#__PURE__*/React.createElement("option",{value:"on"},"on"),/*#__PURE__*/React.createElement("option",{value:"ignore"},"ignore"))))),/*#__PURE__*/React.createElement("details",{className:"group"},/*#__PURE__*/React.createElement("summary",{className:"text-xs font-medium text-gray-400 cursor-pointer hover:text-gray-300 list-none flex items-center gap-1"},/*#__PURE__*/React.createElement("svg",{className:"w-3 h-3 transition-transform group-open:rotate-90",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},/*#__PURE__*/React.createElement("path",{d:"M9 18l6-6-6-6"})),"\uD83D\uDD12 Security"),/*#__PURE__*/React.createElement("div",{className:"grid grid-cols-2 gap-3 mt-2 ml-4"},/*#__PURE__*/React.createElement("label",{className:"flex items-center gap-2 text-xs text-gray-400"},/*#__PURE__*/React.createElement("input",{type:"checkbox",checked:vmwareMigrateForm.secure_boot??(vmwareMigrationPlan.source?.hardware?.secure_boot||false),onChange:e=>setVmwareMigrateForm(f=>({...f,secure_boot:e.target.checked})),className:"rounded"}),"EFI Secure Boot ",vmwareMigrationPlan.source?.hardware?.secure_boot?'(detected)':''),/*#__PURE__*/React.createElement("label",{className:"flex items-center gap-2 text-xs text-gray-400"},/*#__PURE__*/React.createElement("input",{type:"checkbox",checked:vmwareMigrateForm.tpm_enabled??(vmwareMigrationPlan.source?.hardware?.has_tpm||false),onChange:e=>setVmwareMigrateForm(f=>({...f,tpm_enabled:e.target.checked})),className:"rounded"}),"TPM ",vmwareMigrationPlan.source?.hardware?.has_tpm?'(detected)':''),/*#__PURE__*/React.createElement("label",{className:"flex items-center gap-2 text-xs text-gray-400"},/*#__PURE__*/React.createElement("input",{type:"checkbox",checked:vmwareMigrateForm.protection,onChange:e=>setVmwareMigrateForm(f=>({...f,protection:e.target.checked})),className:"rounded"}),"Delete Protection"))),/*#__PURE__*/React.createElement("details",{className:"group"},/*#__PURE__*/React.createElement("summary",{className:"text-xs font-medium text-gray-400 cursor-pointer hover:text-gray-300 list-none flex items-center gap-1"},/*#__PURE__*/React.createElement("svg",{className:"w-3 h-3 transition-transform group-open:rotate-90",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},/*#__PURE__*/React.createElement("path",{d:"M9 18l6-6-6-6"})),"\u26A1 Runtime"),/*#__PURE__*/React.createElement("div",{className:"grid grid-cols-2 gap-3 mt-2 ml-4"},/*#__PURE__*/React.createElement("label",{className:"flex items-center gap-2 text-xs text-gray-400"},/*#__PURE__*/React.createElement("input",{type:"checkbox",checked:vmwareMigrateForm.numa,onChange:e=>setVmwareMigrateForm(f=>({...f,numa:e.target.checked})),className:"rounded"}),"NUMA"),/*#__PURE__*/React.createElement("label",{className:"flex items-center gap-2 text-xs text-gray-400"},/*#__PURE__*/React.createElement("input",{type:"checkbox",checked:vmwareMigrateForm.agent,onChange:e=>setVmwareMigrateForm(f=>({...f,agent:e.target.checked})),className:"rounded"}),"QEMU Guest Agent"),/*#__PURE__*/React.createElement("label",{className:"flex items-center gap-2 text-xs text-gray-400"},/*#__PURE__*/React.createElement("input",{type:"checkbox",checked:vmwareMigrateForm.onboot,onChange:e=>setVmwareMigrateForm(f=>({...f,onboot:e.target.checked})),className:"rounded"}),"Start on Boot"),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"text-xs text-gray-500 mb-1 block"},"Memory Balloon (MB, 0=off)"),/*#__PURE__*/React.createElement("input",{type:"number",min:"0",value:vmwareMigrateForm.balloon,onChange:e=>setVmwareMigrateForm(f=>({...f,balloon:parseInt(e.target.value)||0})),className:"w-full bg-proxmox-dark border border-proxmox-border rounded px-2 py-1.5 text-xs text-white"})))),/*#__PURE__*/React.createElement("details",{className:"group"},/*#__PURE__*/React.createElement("summary",{className:"text-xs font-medium text-gray-400 cursor-pointer hover:text-gray-300 list-none flex items-center gap-1"},/*#__PURE__*/React.createElement("svg",{className:"w-3 h-3 transition-transform group-open:rotate-90",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},/*#__PURE__*/React.createElement("path",{d:"M9 18l6-6-6-6"})),"\uD83C\uDFF7\uFE0F Metadata"),/*#__PURE__*/React.createElement("div",{className:"space-y-2 mt-2 ml-4"},/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"text-xs text-gray-500 mb-1 block"},"Tags"),/*#__PURE__*/React.createElement("input",{type:"text",value:vmwareMigrateForm.tags,onChange:e=>setVmwareMigrateForm(f=>({...f,tags:e.target.value})),placeholder:"e.g. migrated;production",className:"w-full bg-proxmox-dark border border-proxmox-border rounded px-2 py-1.5 text-xs text-white"})),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"text-xs text-gray-500 mb-1 block"},"Description"),/*#__PURE__*/React.createElement("textarea",{value:vmwareMigrateForm.description||vmwareMigrationPlan.source?.notes||'',onChange:e=>setVmwareMigrateForm(f=>({...f,description:e.target.value})),rows:"2",className:"w-full bg-proxmox-dark border border-proxmox-border rounded px-2 py-1.5 text-xs text-white resize-none"}))))),/*#__PURE__*/React.createElement("div",{className:"mt-3 p-3 rounded-lg border border-proxmox-border",style:{background:'rgba(30,30,40,0.4)'}},/*#__PURE__*/React.createElement("label",{className:"flex items-start gap-2 cursor-pointer"},/*#__PURE__*/React.createElement("input",{type:"checkbox",checked:!!vmwareMigrateForm.install_virtio_drivers,onChange:e=>setVmwareMigrateForm(f=>({...f,install_virtio_drivers:e.target.checked})),className:"rounded mt-0.5"}),/*#__PURE__*/React.createElement("div",{className:"flex-1 min-w-0"},/*#__PURE__*/React.createElement("span",{className:"text-sm text-gray-200"},t('installVirtioDrivers')||'Pre-stage VirtIO drivers (Windows)'),/*#__PURE__*/React.createElement("p",{className:"text-xs text-gray-400 mt-1 leading-snug"},t('installVirtioDriversDesc')||'Stages virtio-win-gt-x64.msi onto the disk and installs the full driver stack (storage, network, balloon, qemu-ga) silently as LocalSystem at first boot. Best-effort fallback when the source VM doesn\'t have the drivers yet. Requires virtio-win.iso on the target node.'))),/*#__PURE__*/React.createElement("div",{className:"mt-3 p-3 rounded border border-amber-500/50",style:{background:'rgba(234,179,8,0.10)'}},/*#__PURE__*/React.createElement("div",{className:"flex items-start gap-2"},/*#__PURE__*/React.createElement("span",{className:"text-amber-300 text-base leading-none mt-0.5"},"\u26A0"),/*#__PURE__*/React.createElement("div",{className:"flex-1 min-w-0"},/*#__PURE__*/React.createElement("p",{className:"text-xs text-amber-200 font-semibold mb-1"},t('virtioPreInstallWarnTitle')||'Treiber besser VOR der Migration installieren'),/*#__PURE__*/React.createElement("p",{className:"text-xs text-amber-100/90 leading-snug"},t('virtioPreInstallWarnBody')||'Lade virtio-win.iso in der laufenden Quell-VM auf VMware, mounte sie als CD und führe virtio-win-guest-tools.exe aus — dann migriere. Unsere Inject-Variante ist Best-Effort: Windows 11 / Server 2025 binden vioscsi im Early-Boot nicht zuverlässig (Proxmox/QEMU-Limitation), Boot-Disk muss dann auf pvscsi bleiben. VMs die vor Migration die Treiber installiert haben, lassen sich danach problemlos auf virtio-scsi umstellen.')))),vmwareMigrateForm.install_virtio_drivers&&/*#__PURE__*/React.createElement("div",{className:"mt-2 pl-6"},/*#__PURE__*/React.createElement("label",{className:"text-xs text-gray-500 mb-1 block"},t('virtioIsoPath')||'virtio-win.iso path on node'),/*#__PURE__*/React.createElement("input",{type:"text",value:vmwareMigrateForm.virtio_iso_path,onChange:e=>setVmwareMigrateForm(f=>({...f,virtio_iso_path:e.target.value})),placeholder:"/var/lib/vz/template/iso/virtio-win.iso (default)",className:"w-full px-2 py-1 bg-proxmox-dark border border-proxmox-border rounded text-white text-xs"})),vmwareMigrateForm.install_virtio_drivers&&vmwareMigrateForm.transfer_mode==='sshfs_boot'&&/*#__PURE__*/React.createElement("div",{className:"mt-2 pl-6 p-2 rounded border border-yellow-500/40",style:{background:'rgba(234,179,8,0.07)'}},/*#__PURE__*/React.createElement("p",{className:"text-xs text-yellow-300 leading-snug"},"\u26A0 ",t('virtioSshfsBootWarn')||'Live-mirror mode boots the VM before disks are settled — offline driver injection would corrupt the running NTFS. Pre-staging is skipped here. Use offline / auto / snapshot_zero for pre-stage, or install drivers post-boot from the mounted virtio-win.iso.'))),/*#__PURE__*/React.createElement("div",{className:"mt-4 p-3 rounded-lg border border-proxmox-border",style:{background:'rgba(99, 110, 250, 0.06)'}},/*#__PURE__*/React.createElement("div",{className:"flex items-start gap-3"},/*#__PURE__*/React.createElement("a",{href:"https://opencollective.com/pegaprox",target:"_blank",rel:"noopener noreferrer",className:"shrink-0"},/*#__PURE__*/React.createElement("img",{src:"/images/oc_contribute_button.png",alt:"Open Collective",className:"h-8 w-auto opacity-90 hover:opacity-100 transition-opacity"})),/*#__PURE__*/React.createElement("div",{className:"flex-1 min-w-0"},/*#__PURE__*/React.createElement("p",{className:"text-xs text-gray-300 leading-snug"},t('v2pSupportNote')||'Nur mit eurer Unterstützung können wir diese Funktion kostenlos halten.'),/*#__PURE__*/React.createElement("label",{className:"flex items-center gap-2 mt-2 text-xs text-gray-400 cursor-pointer"},/*#__PURE__*/React.createElement("input",{type:"checkbox",checked:!!vmwareMigrateForm.oc_acknowledge,onChange:e=>setVmwareMigrateForm(f=>({...f,oc_acknowledge:e.target.checked})),className:"rounded"}),/*#__PURE__*/React.createElement("span",null,t('v2pSupportAck')||'Verstanden — ich behalte das im Hinterkopf.'))))),/*#__PURE__*/React.createElement("div",{className:"flex gap-2 justify-end mt-4"},/*#__PURE__*/React.createElement("button",{onClick:()=>setShowVmwareMigrate(false),className:"px-4 py-2 rounded-lg bg-proxmox-dark text-gray-400 text-sm"},"Cancel"),/*#__PURE__*/React.createElement("button",{onClick:()=>startVmwareMigration(vmwareSelectedVm),disabled:!vmwareMigrateForm.target_cluster||!vmwareMigrateForm.target_node||!vmwareMigrateForm.target_storage||!vmwareMigrateForm.esxi_password||!vmwareMigrateForm.oc_acknowledge||vmwareMigrateLoading,title:!vmwareMigrateForm.oc_acknowledge?t('v2pSupportAckRequired')||'Bitte den Hinweis kurz bestätigen':'',className:"px-4 py-2 rounded-lg bg-emerald-500 text-white text-sm font-medium disabled:opacity-50"},vmwareMigrateLoading?'Starting...':'Start Migration'))))),vmwareActiveTab==='hosts'&&/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl overflow-hidden"},/*#__PURE__*/React.createElement("table",{className:"w-full"},/*#__PURE__*/React.createElement("thead",null,/*#__PURE__*/React.createElement("tr",{className:"border-b border-proxmox-border"},/*#__PURE__*/React.createElement("th",{className:"text-left p-3 text-xs font-semibold text-gray-500 uppercase"},"Status"),/*#__PURE__*/React.createElement("th",{className:"text-left p-3 text-xs font-semibold text-gray-500 uppercase"},"Name"),/*#__PURE__*/React.createElement("th",{className:"text-left p-3 text-xs font-semibold text-gray-500 uppercase"},"Model"),/*#__PURE__*/React.createElement("th",{className:"text-left p-3 text-xs font-semibold text-gray-500 uppercase"},"CPUs"),/*#__PURE__*/React.createElement("th",{className:"text-left p-3 text-xs font-semibold text-gray-500 uppercase"},"Memory"),/*#__PURE__*/React.createElement("th",{className:"text-left p-3 text-xs font-semibold text-gray-500 uppercase"},"VMs"))),/*#__PURE__*/React.createElement("tbody",null,vmwareHosts.map(host=>/*#__PURE__*/React.createElement("tr",{key:host.host_id||host.name,className:"border-b border-proxmox-border/50 hover:bg-proxmox-hover/50"},/*#__PURE__*/React.createElement("td",{className:"p-3"},/*#__PURE__*/React.createElement("div",{className:`w-3 h-3 rounded-full ${host.connection_state==='CONNECTED'||host.connection_state==='connected'?'bg-green-400':'bg-red-400'}`})),/*#__PURE__*/React.createElement("td",{className:"p-3 text-white text-sm font-medium"},host.name),/*#__PURE__*/React.createElement("td",{className:"p-3 text-gray-400 text-sm"},host.model||'-'),/*#__PURE__*/React.createElement("td",{className:"p-3 text-gray-400 text-sm"},/*#__PURE__*/React.createElement("div",null,host.cpu_cores||host.num_cpu_cores||'-'," cores"),host.cpu_usage!==undefined&&/*#__PURE__*/React.createElement("div",{className:"w-20 h-1.5 bg-proxmox-dark rounded-full mt-1 overflow-hidden"},/*#__PURE__*/React.createElement("div",{className:`h-full rounded-full ${host.cpu_usage>80?'bg-red-400':host.cpu_usage>60?'bg-yellow-400':'bg-emerald-400'}`,style:{width:`${Math.min(100,host.cpu_usage||0)}%`}}))),/*#__PURE__*/React.createElement("td",{className:"p-3 text-gray-400 text-sm"},/*#__PURE__*/React.createElement("div",null,host.memory_gb?`${host.memory_gb} GB`:host.memory_bytes?`${(host.memory_bytes/(1024*1024*1024)).toFixed(0)} GB`:'-'),host.memory_usage_pct!==undefined&&/*#__PURE__*/React.createElement("div",{className:"w-20 h-1.5 bg-proxmox-dark rounded-full mt-1 overflow-hidden"},/*#__PURE__*/React.createElement("div",{className:`h-full rounded-full ${host.memory_usage_pct>80?'bg-red-400':host.memory_usage_pct>60?'bg-yellow-400':'bg-purple-400'}`,style:{width:`${Math.min(100,host.memory_usage_pct||0)}%`}}))),/*#__PURE__*/React.createElement("td",{className:"p-3 text-gray-400 text-sm"},host.vm_count||'-'))))),vmwareHosts.length===0&&/*#__PURE__*/React.createElement("div",{className:"text-center py-8 text-gray-500"},"No hosts found")),vmwareActiveTab==='datastores'&&!vmwareSelectedDs&&/*#__PURE__*/React.createElement("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4"},vmwareDatastores.map(ds=>{const capGB=ds.capacity?(ds.capacity/(1024*1024*1024)).toFixed(1):ds.capacity_gb||0;const freeGB=ds.free_space?(ds.free_space/(1024*1024*1024)).toFixed(1):ds.free_gb||0;const usedGB=capGB&&freeGB?(capGB-freeGB).toFixed(1):0;const pct=ds.capacity&&ds.free_space?((1-ds.free_space/ds.capacity)*100).toFixed(0):null;return/*#__PURE__*/React.createElement("div",{key:ds.datastore_id||ds.datastore||ds.name,onClick:()=>setVmwareSelectedDs(ds),className:"bg-proxmox-card border border-proxmox-border rounded-xl p-4 hover:border-emerald-500/30 cursor-pointer transition-all group"},/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-3 mb-3"},/*#__PURE__*/React.createElement("div",{className:"w-10 h-10 rounded-xl bg-blue-500/10 border border-blue-500/20 flex items-center justify-center"},/*#__PURE__*/React.createElement(Icons.Database,{className:"w-5 h-5 text-blue-400"})),/*#__PURE__*/React.createElement("div",{className:"flex-1 min-w-0"},/*#__PURE__*/React.createElement("div",{className:"text-sm font-semibold text-white truncate group-hover:text-emerald-400 transition-colors"},ds.name),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500"},ds.type||'VMFS'))),pct!==null&&/*#__PURE__*/React.createElement("div",{className:"mb-2"},/*#__PURE__*/React.createElement("div",{className:"h-2 bg-proxmox-dark rounded-full overflow-hidden"},/*#__PURE__*/React.createElement("div",{className:`h-full rounded-full ${parseInt(pct)>85?'bg-red-400':parseInt(pct)>65?'bg-yellow-400':'bg-emerald-400'}`,style:{width:`${pct}%`}})),/*#__PURE__*/React.createElement("div",{className:"flex justify-between text-xs text-gray-500 mt-1"},/*#__PURE__*/React.createElement("span",null,usedGB," GB used"),/*#__PURE__*/React.createElement("span",null,freeGB," GB free / ",capGB," GB"))));}),vmwareDatastores.length===0&&/*#__PURE__*/React.createElement("div",{className:"col-span-3 text-center py-12 text-gray-500"},"No datastores found")),vmwareActiveTab==='datastores'&&vmwareSelectedDs&&(()=>{const ds=vmwareSelectedDs;const detail=vmwareDsDetail||{};const capGB=ds.capacity||detail.capacity?((ds.capacity||detail.capacity)/(1024*1024*1024)).toFixed(1):ds.capacity_gb||0;const freeGB=ds.free_space||detail.free_space?((ds.free_space||detail.free_space)/(1024*1024*1024)).toFixed(1):ds.free_gb||0;const usedGB=capGB&&freeGB?(capGB-freeGB).toFixed(1):0;const pct=(ds.capacity||detail.capacity)&&(ds.free_space||detail.free_space)?((1-(ds.free_space||detail.free_space)/(ds.capacity||detail.capacity))*100).toFixed(0):0;// Use server-side VMs if available, else client-side filter -const dsVms=detail.vms&&detail.vms.length>0?detail.vms:vmwareVms.filter(v=>{const vmDs=(v.datastore||'').toLowerCase();return vmDs.includes((ds.name||'').toLowerCase());});const dsHosts=detail.hosts||[];return/*#__PURE__*/React.createElement("div",{className:"space-y-4"},/*#__PURE__*/React.createElement("button",{onClick:()=>{setVmwareSelectedDs(null);setVmwareDsDetail(null);},className:"flex items-center gap-2 text-gray-400 hover:text-white text-sm"},/*#__PURE__*/React.createElement("span",{style:{display:"inline-block",transform:"rotate(180deg)"}},/*#__PURE__*/React.createElement(Icons.ChevronRight,{className:"w-4 h-4"}))," Back to Datastores"),/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl p-5"},/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-4 mb-4"},/*#__PURE__*/React.createElement("div",{className:"w-14 h-14 rounded-xl bg-blue-500/10 border border-blue-500/30 flex items-center justify-center"},/*#__PURE__*/React.createElement(Icons.Database,{className:"w-7 h-7 text-blue-400"})),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("h2",{className:"text-xl font-bold text-white"},ds.name),/*#__PURE__*/React.createElement("div",{className:"text-sm text-gray-500"},ds.type||detail.type||'VMFS'," \u2022 ",capGB," GB total",detail.multiple_host_access?' • Shared':''))),/*#__PURE__*/React.createElement("div",{className:"mb-4"},/*#__PURE__*/React.createElement("div",{className:"h-4 bg-proxmox-dark rounded-full overflow-hidden"},/*#__PURE__*/React.createElement("div",{className:`h-full rounded-full ${parseInt(pct)>85?'bg-red-400':parseInt(pct)>65?'bg-yellow-400':'bg-emerald-400'}`,style:{width:`${pct}%`}})),/*#__PURE__*/React.createElement("div",{className:"flex justify-between mt-1 text-sm"},/*#__PURE__*/React.createElement("span",{className:"text-gray-400"},usedGB," GB used (",pct,"%)"),/*#__PURE__*/React.createElement("span",{className:"text-emerald-400"},freeGB," GB free"))),/*#__PURE__*/React.createElement("div",{className:"grid grid-cols-4 gap-3"},[['Capacity',capGB,'text-white'],['Used',usedGB,'text-white'],['Free',freeGB,'text-emerald-400'],['VMs',dsVms.length,'text-white']].map(([l,v,c])=>/*#__PURE__*/React.createElement("div",{key:l,className:"bg-proxmox-dark rounded-lg p-3 text-center"},/*#__PURE__*/React.createElement("div",{className:`text-lg font-bold ${c}`},v),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500"},l==='VMs'?l:`GB ${l}`))))),dsHosts.length>0&&/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl overflow-hidden"},/*#__PURE__*/React.createElement("div",{className:"p-4 border-b border-proxmox-border"},/*#__PURE__*/React.createElement("h3",{className:"text-sm font-semibold text-gray-400 uppercase"},"Connected Hosts (",dsHosts.length,")")),/*#__PURE__*/React.createElement("div",{className:"divide-y divide-proxmox-border/50"},dsHosts.map(h=>/*#__PURE__*/React.createElement("div",{key:h.host||h.name,className:"px-4 py-2.5 flex items-center gap-3"},/*#__PURE__*/React.createElement("div",{className:"w-2 h-2 rounded-full bg-green-400"}),/*#__PURE__*/React.createElement("span",{className:"text-sm text-white"},h.name))))),/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl overflow-hidden"},/*#__PURE__*/React.createElement("div",{className:"p-4 border-b border-proxmox-border"},/*#__PURE__*/React.createElement("h3",{className:"text-sm font-semibold text-gray-400 uppercase"},"VMs on ",ds.name," (",dsVms.length,")")),dsVms.length>0?/*#__PURE__*/React.createElement("table",{className:"w-full"},/*#__PURE__*/React.createElement("thead",null,/*#__PURE__*/React.createElement("tr",{className:"border-b border-proxmox-border"},/*#__PURE__*/React.createElement("th",{className:"text-left p-3 text-xs font-semibold text-gray-500 uppercase"},"Status"),/*#__PURE__*/React.createElement("th",{className:"text-left p-3 text-xs font-semibold text-gray-500 uppercase"},"Name"),/*#__PURE__*/React.createElement("th",{className:"text-left p-3 text-xs font-semibold text-gray-500 uppercase"},"OS"))),/*#__PURE__*/React.createElement("tbody",null,dsVms.map(vm=>/*#__PURE__*/React.createElement("tr",{key:vm.vm||vm.vm_id||vm.name,className:"border-b border-proxmox-border/50 hover:bg-proxmox-hover/50 cursor-pointer",onClick:()=>{setVmwareActiveTab('vms');setVmwareSelectedVm(vm.vm||vm.vm_id);setVmwareSelectedDs(null);}},/*#__PURE__*/React.createElement("td",{className:"p-3"},/*#__PURE__*/React.createElement("div",{className:`w-3 h-3 rounded-full ${vm.power_state==='POWERED_ON'?'bg-green-400':'bg-gray-500'}`})),/*#__PURE__*/React.createElement("td",{className:"p-3 text-white text-sm font-medium"},vm.name),/*#__PURE__*/React.createElement("td",{className:"p-3 text-gray-400 text-sm"},(vm.guest_OS||vm.guest_os||'-').substring(0,25)))))):/*#__PURE__*/React.createElement("div",{className:"p-8 text-center text-gray-500 text-sm"},"No VMs on this datastore")));})(),vmwareActiveTab==='networks'&&/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl overflow-hidden"},/*#__PURE__*/React.createElement("table",{className:"w-full"},/*#__PURE__*/React.createElement("thead",null,/*#__PURE__*/React.createElement("tr",{className:"border-b border-proxmox-border"},/*#__PURE__*/React.createElement("th",{className:"text-left p-3 text-xs font-semibold text-gray-500 uppercase"},"Name"),/*#__PURE__*/React.createElement("th",{className:"text-left p-3 text-xs font-semibold text-gray-500 uppercase"},"Type"),/*#__PURE__*/React.createElement("th",{className:"text-left p-3 text-xs font-semibold text-gray-500 uppercase"},"VLAN"))),/*#__PURE__*/React.createElement("tbody",null,vmwareNetworks.map(net=>/*#__PURE__*/React.createElement("tr",{key:net.network_id||net.name,className:"border-b border-proxmox-border/50 hover:bg-proxmox-hover/50"},/*#__PURE__*/React.createElement("td",{className:"p-3 text-white text-sm font-medium"},net.name),/*#__PURE__*/React.createElement("td",{className:"p-3 text-gray-400 text-sm"},net.type||'Standard'),/*#__PURE__*/React.createElement("td",{className:"p-3 text-gray-400 text-sm"},net.vlan_id||'-'))))),vmwareNetworks.length===0&&/*#__PURE__*/React.createElement("div",{className:"text-center py-8 text-gray-500"},"No networks found")),vmwareActiveTab==='clusters'&&/*#__PURE__*/React.createElement("div",{className:"space-y-4"},vmwareClusters.length===0?/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl p-8 text-center text-gray-500"},/*#__PURE__*/React.createElement(Icons.Layers,{className:"w-12 h-12 mx-auto mb-3 opacity-30"}),/*#__PURE__*/React.createElement("p",null,"No compute clusters found"),/*#__PURE__*/React.createElement("p",{className:"text-xs mt-1"},"Clusters are only available on connected management servers (not on standalone hosts)")):vmwareClusters.map(cl=>/*#__PURE__*/React.createElement("div",{key:cl.cluster||cl.name,className:"bg-proxmox-card border border-proxmox-border rounded-xl overflow-hidden"},/*#__PURE__*/React.createElement("div",{className:"p-4 border-b border-proxmox-border"},/*#__PURE__*/React.createElement("div",{className:"flex items-center justify-between"},/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-3"},/*#__PURE__*/React.createElement("div",{className:"w-10 h-10 rounded-lg bg-purple-500/20 flex items-center justify-center"},/*#__PURE__*/React.createElement(Icons.Layers,{className:"w-5 h-5 text-purple-400"})),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("h3",{className:"text-white font-semibold"},cl.name),/*#__PURE__*/React.createElement("p",{className:"text-xs text-gray-500"},cl.num_hosts||0," Hosts \u2022 ",cl.cluster))),/*#__PURE__*/React.createElement("button",{onClick:()=>fetchVMwareClusters(selectedVMware.id),className:"text-gray-500 hover:text-white"},/*#__PURE__*/React.createElement(Icons.RefreshCw,{className:"w-4 h-4"})))),/*#__PURE__*/React.createElement("div",{className:"grid grid-cols-3 gap-4 p-4 border-b border-proxmox-border/50"},/*#__PURE__*/React.createElement("div",{className:"text-center"},/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500"},"CPU"),/*#__PURE__*/React.createElement("div",{className:"text-sm text-white font-medium"},cl.total_cpu?(cl.total_cpu/1000).toFixed(1)+' GHz':'N/A')),/*#__PURE__*/React.createElement("div",{className:"text-center"},/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500"},"Memory"),/*#__PURE__*/React.createElement("div",{className:"text-sm text-white font-medium"},cl.total_memory?(cl.total_memory/1024**3).toFixed(0)+' GB':'N/A')),/*#__PURE__*/React.createElement("div",{className:"text-center"},/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500"},"Hosts"),/*#__PURE__*/React.createElement("div",{className:"text-sm text-white font-medium"},cl.num_hosts||0))),/*#__PURE__*/React.createElement("div",{className:"p-4 space-y-4"},/*#__PURE__*/React.createElement("div",{className:"flex items-center justify-between p-3 rounded-lg bg-proxmox-dark/50"},/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-3"},/*#__PURE__*/React.createElement("div",{className:`w-8 h-8 rounded-lg flex items-center justify-center ${cl.drs_enabled?'bg-blue-500/20':'bg-gray-800'}`},/*#__PURE__*/React.createElement(Icons.RotateCw,{className:`w-4 h-4 ${cl.drs_enabled?'text-blue-400':'text-gray-600'}`})),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("div",{className:"text-sm text-white font-medium"},"DRS (Distributed Resource Scheduler)"),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500"},cl.drs_enabled?`Active - ${(cl.drs_automation||'MANUAL').replace(/_/g,' ').toLowerCase()}`:'Disabled'))),/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-2"},cl.drs_enabled&&/*#__PURE__*/React.createElement("select",{value:cl.drs_automation||'MANUAL',onChange:e=>toggleVMwareDRS(selectedVMware.id,cl.cluster,true,e.target.value),className:"bg-proxmox-card border border-proxmox-border rounded px-2 py-1 text-xs text-gray-300"},/*#__PURE__*/React.createElement("option",{value:"FULLY_AUTOMATED"},"Fully Automated"),/*#__PURE__*/React.createElement("option",{value:"PARTIALLY_AUTOMATED"},"Partially Automated"),/*#__PURE__*/React.createElement("option",{value:"MANUAL"},"Manual")),/*#__PURE__*/React.createElement("button",{onClick:()=>toggleVMwareDRS(selectedVMware.id,cl.cluster,!cl.drs_enabled),className:`px-3 py-1.5 rounded-lg text-xs font-medium transition-colors ${cl.drs_enabled?'bg-red-500/20 text-red-400 hover:bg-red-500/30':'bg-blue-500/20 text-blue-400 hover:bg-blue-500/30'}`},cl.drs_enabled?'Disable':'Enable'))),/*#__PURE__*/React.createElement("div",{className:"flex items-center justify-between p-3 rounded-lg bg-proxmox-dark/50"},/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-3"},/*#__PURE__*/React.createElement("div",{className:`w-8 h-8 rounded-lg flex items-center justify-center ${cl.ha_enabled?'bg-green-500/20':'bg-gray-800'}`},/*#__PURE__*/React.createElement(Icons.Shield,{className:`w-4 h-4 ${cl.ha_enabled?'text-green-400':'text-gray-600'}`})),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("div",{className:"text-sm text-white font-medium"},"HA (High Availability)"),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500"},cl.ha_enabled?`Active${cl.ha_admission_control?' - Admission Control enabled':''}`:'Disabled'))),/*#__PURE__*/React.createElement("button",{onClick:()=>toggleVMwareHA(selectedVMware.id,cl.cluster,!cl.ha_enabled),className:`px-3 py-1.5 rounded-lg text-xs font-medium transition-colors ${cl.ha_enabled?'bg-red-500/20 text-red-400 hover:bg-red-500/30':'bg-green-500/20 text-green-400 hover:bg-green-500/30'}`},cl.ha_enabled?'Disable':'Enable')),cl.hosts&&cl.hosts.length>0&&/*#__PURE__*/React.createElement("div",{className:"mt-2"},/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500 mb-2 font-semibold uppercase"},"Cluster Hosts"),/*#__PURE__*/React.createElement("div",{className:"space-y-1"},cl.hosts.map(h=>/*#__PURE__*/React.createElement("div",{key:h.host||h.name,className:"flex items-center justify-between py-1.5 px-2 rounded bg-proxmox-dark/30"},/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-2"},/*#__PURE__*/React.createElement("div",{className:`w-2 h-2 rounded-full ${h.connection_state==='CONNECTED'?'bg-green-400':'bg-red-400'}`}),/*#__PURE__*/React.createElement("span",{className:"text-sm text-gray-300"},h.name)),/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-2"},h.maintenance&&/*#__PURE__*/React.createElement("span",{className:"text-xs bg-yellow-500/20 text-yellow-400 px-1.5 py-0.5 rounded"},"Maintenance"),/*#__PURE__*/React.createElement("span",{className:"text-xs text-gray-500"},h.connection_state)))))))))),vmwareActiveTab==='tasks'&&/*#__PURE__*/React.createElement("div",{className:"space-y-4"},/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl overflow-hidden"},/*#__PURE__*/React.createElement("div",{className:"p-4 border-b border-proxmox-border flex items-center justify-between"},/*#__PURE__*/React.createElement("h3",{className:"text-sm font-semibold text-gray-400 uppercase flex items-center gap-2"},/*#__PURE__*/React.createElement(Icons.FolderInput,{className:"w-4 h-4 text-emerald-400"})," Migrations (",vmwareMigrations.length,")"),/*#__PURE__*/React.createElement("button",{onClick:fetchVmwareMigrations,className:"text-xs text-gray-500 hover:text-white"},/*#__PURE__*/React.createElement(Icons.RefreshCw,{className:"w-3.5 h-3.5"}))),vmwareMigrations.length>0?/*#__PURE__*/React.createElement("div",{className:"divide-y divide-proxmox-border/50"},vmwareMigrations.map(m=>{const isActive=m.status==='running';const isAwaiting=m.phase==='awaiting_confirmation';// #562 -const phaseLabel={planning:'Planning',pre_sync:'Pre-Sync',delta_sync:'Delta Sync',awaiting_confirmation:t('phaseAwaitingConfirmation')||'Awaiting Confirmation',cutover:'Cutover',verify:'Verify',cleanup:'Cleanup',completed:'Done',failed:'Failed',cancelled:t('phaseCancelled')||'Cancelled'};return/*#__PURE__*/React.createElement("div",{key:m.id,className:`p-4 hover:bg-proxmox-hover/30 cursor-pointer ${vmwareSelectedMigration===m.id?'bg-emerald-500/5 border-l-2 border-l-emerald-400':''}`,onClick:()=>setVmwareSelectedMigration(vmwareSelectedMigration===m.id?null:m.id)},/*#__PURE__*/React.createElement("div",{className:"flex items-center justify-between mb-2"},/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-3"},/*#__PURE__*/React.createElement("div",{className:`w-2.5 h-2.5 rounded-full ${isAwaiting?'bg-amber-400 animate-pulse':isActive?'bg-blue-400 animate-pulse':m.status==='completed'?'bg-green-400':m.status==='failed'?'bg-red-400':'bg-gray-500'}`}),/*#__PURE__*/React.createElement("span",{className:"text-sm font-medium text-white"},m.vm_name||m.vm_id),/*#__PURE__*/React.createElement("span",{className:`text-xs px-1.5 py-0.5 rounded ${isAwaiting?'bg-amber-500/20 text-amber-300':'bg-proxmox-dark text-gray-400'}`},phaseLabel[m.phase]||m.phase)),/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-3"},m.total_downtime_seconds!=null&&/*#__PURE__*/React.createElement("span",{className:"text-xs text-gray-500"},"Downtime: ",m.total_downtime_seconds,"s"),/*#__PURE__*/React.createElement("span",{className:`px-2 py-0.5 rounded text-xs font-semibold ${m.status==='completed'?'bg-green-500/20 text-green-400':m.status==='failed'?'bg-red-500/20 text-red-400':m.status==='cancelled'?'bg-gray-500/20 text-gray-400':'bg-blue-500/20 text-blue-400'}`},m.status))),/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-3 mb-1"},/*#__PURE__*/React.createElement("div",{className:"flex-1 h-1.5 bg-proxmox-dark rounded-full overflow-hidden"},/*#__PURE__*/React.createElement("div",{className:`h-full rounded-full transition-all duration-500 ${m.status==='failed'?'bg-red-400':m.status==='completed'?'bg-green-400':'bg-emerald-400'}`,style:{width:`${m.progress||0}%`}})),/*#__PURE__*/React.createElement("span",{className:"text-xs text-gray-500 w-8 text-right"},m.progress||0,"%")),/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-4 text-xs text-gray-600"},/*#__PURE__*/React.createElement("span",null,"\u2192 ",m.target_node,"/",m.target_storage),m.started_at&&/*#__PURE__*/React.createElement("span",null,fmtDate(m.started_at)),m.proxmox_vmid&&/*#__PURE__*/React.createElement("span",null,"PVE: ",m.proxmox_vmid)),m.phase_times&&Object.keys(m.phase_times).length>1&&/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-0.5 mt-2"},['planning','pre_sync','delta_sync','cutover','verify','cleanup','completed'].map((ph,idx)=>{const pt=m.phase_times[ph];const isCur=m.phase===ph;const isDone=pt&&pt.end;return/*#__PURE__*/React.createElement(React.Fragment,{key:ph},idx>0&&/*#__PURE__*/React.createElement("div",{className:`flex-1 h-px ${isDone?'bg-emerald-500':isCur?'bg-emerald-500/40':'bg-proxmox-border'}`}),/*#__PURE__*/React.createElement("div",{title:`${ph}${pt?.duration?` (${pt.duration}s)`:''}`,className:`w-5 h-5 rounded-full flex items-center justify-center text-[8px] font-bold border ${isDone?'bg-emerald-500/20 border-emerald-500 text-emerald-400':isCur?'bg-blue-500/20 border-blue-400 text-blue-400 animate-pulse':'bg-proxmox-dark border-proxmox-border text-gray-600'}`},isDone?'✓':idx+1));})),isAwaiting&&/*#__PURE__*/React.createElement("div",{className:"mt-3 p-3 rounded-lg bg-amber-500/10 border border-amber-500/30",onClick:e=>e.stopPropagation()},/*#__PURE__*/React.createElement("div",{className:"flex items-start gap-2 text-xs text-amber-300 mb-2"},/*#__PURE__*/React.createElement(Icons.AlertTriangle,{className:"w-3.5 h-3.5 mt-0.5 flex-shrink-0"}),/*#__PURE__*/React.createElement("span",null,t('awaitingCutoverBanner')||'Disks are staged and the source VM is still running. Commit the switchover when you are ready to take the brief downtime.')),/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-2"},/*#__PURE__*/React.createElement("button",{onClick:()=>confirmVmwareCutover(m.id),className:"px-3 py-1.5 rounded-lg text-xs font-semibold bg-emerald-500/20 text-emerald-300 hover:bg-emerald-500/30 border border-emerald-500/40"},t('commitSwitchover')||'Commit switchover now'),/*#__PURE__*/React.createElement("button",{onClick:()=>cancelVmwareCutover(m.id),className:"px-3 py-1.5 rounded-lg text-xs font-semibold bg-red-500/10 text-red-300 hover:bg-red-500/20 border border-red-500/30"},t('cancelMigration')||'Cancel migration'))));})):/*#__PURE__*/React.createElement("div",{className:"p-8 text-center text-gray-600 text-sm"},"No migrations yet. Start one from a VM's Migration tab.")),vmwareSelectedMigration&&vmwareMigrationDetail&&/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl overflow-hidden"},/*#__PURE__*/React.createElement("div",{className:"p-4 border-b border-proxmox-border flex items-center justify-between"},/*#__PURE__*/React.createElement("h3",{className:"text-sm font-semibold text-white"},"Migration Log - ",vmwareMigrationDetail.vm_name," ",/*#__PURE__*/React.createElement("span",{className:"text-gray-500 font-normal"},"(",vmwareSelectedMigration,")")),/*#__PURE__*/React.createElement("button",{onClick:()=>setVmwareSelectedMigration(null),className:"text-xs text-gray-500 hover:text-white px-2 py-1 rounded bg-proxmox-dark"},"Close")),vmwareMigrationDetail.disk_progress&&Object.keys(vmwareMigrationDetail.disk_progress).length>0&&/*#__PURE__*/React.createElement("div",{className:"p-4 border-b border-proxmox-border/50 space-y-2"},/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500 uppercase font-semibold"},"Disk Transfer"),Object.entries(vmwareMigrationDetail.disk_progress).map(([key,dp])=>/*#__PURE__*/React.createElement("div",{key:key},/*#__PURE__*/React.createElement("div",{className:"flex justify-between text-xs text-gray-400 mb-0.5"},/*#__PURE__*/React.createElement("span",null,key),/*#__PURE__*/React.createElement("span",null,dp.pct,"% - ",(dp.copied/(1024*1024*1024)).toFixed(1),"/",(dp.total/(1024*1024*1024)).toFixed(1)," GB")),/*#__PURE__*/React.createElement("div",{className:"h-2 bg-proxmox-dark rounded-full overflow-hidden"},/*#__PURE__*/React.createElement("div",{className:"h-full bg-emerald-400 rounded-full transition-all",style:{width:`${dp.pct}%`}}))))),/*#__PURE__*/React.createElement("div",{className:"p-3 bg-black/30 max-h-60 overflow-y-auto font-mono text-xs leading-relaxed"},(vmwareMigrationDetail.log||[]).map((line,i)=>/*#__PURE__*/React.createElement("div",{key:i,className:line.includes('FAIL')||line.includes('ERROR')?'text-red-400':line.includes('Phase:')?'text-emerald-400 font-bold':line.includes('===')?'text-blue-400':'text-gray-500'},line))),vmwareMigrationDetail.error&&/*#__PURE__*/React.createElement("div",{className:"p-3 bg-red-500/10 border-t border-red-500/20 text-red-400 text-xs"},"Error: ",vmwareMigrationDetail.error),vmwareMigrationDetail.status==='completed'&&/*#__PURE__*/React.createElement("div",{className:"p-3 bg-green-500/10 border-t border-green-500/20 text-green-400 text-xs"},"\u2713 Completed! VMID: ",vmwareMigrationDetail.proxmox_vmid,vmwareMigrationDetail.total_downtime_seconds?` - Downtime: ${vmwareMigrationDetail.total_downtime_seconds}s`:'')),/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl overflow-hidden"},/*#__PURE__*/React.createElement("div",{className:"p-4 border-b border-proxmox-border flex items-center justify-between"},/*#__PURE__*/React.createElement("h3",{className:"text-sm font-semibold text-gray-400 uppercase flex items-center gap-2"},/*#__PURE__*/React.createElement(Icons.FileText,{className:"w-4 h-4 text-blue-400"})," Recent ESXi Events"),/*#__PURE__*/React.createElement("button",{onClick:fetchVmwareEvents,disabled:vmwareEventsLoading,className:"text-xs text-gray-500 hover:text-white"},/*#__PURE__*/React.createElement(Icons.RefreshCw,{className:`w-3.5 h-3.5 ${vmwareEventsLoading?'animate-spin':''}`}))),vmwareEvents.filter(e=>(e.action||'').includes('vmware')).length>0?/*#__PURE__*/React.createElement("div",{className:"divide-y divide-proxmox-border/50 max-h-96 overflow-y-auto"},vmwareEvents.filter(e=>(e.action||'').includes('vmware')).slice(0,50).map((evt,i)=>{const a=evt.action||'';const iconMap={start:'▶',stop:'■',reset:'↻',suspend:'⏸',cloned:'⧉',deleted:'×',renamed:'✎','snapshot.created':'📸','snapshot.deleted':'🗑','migration.started':'→',added:'+',updated:'↑'};const colorMap={start:'text-green-400',stop:'text-red-400',reset:'text-yellow-400',suspend:'text-blue-400',cloned:'text-cyan-400',deleted:'text-red-400',renamed:'text-blue-400','snapshot.created':'text-purple-400','snapshot.deleted':'text-orange-400','migration.started':'text-emerald-400'};const actionKey=Object.keys(iconMap).find(k=>a.includes(k))||'';const icon=iconMap[actionKey]||'•';const color=colorMap[actionKey]||'text-gray-400';const label=a.split('.').pop()||a;return/*#__PURE__*/React.createElement("div",{key:i,className:"px-4 py-2.5 hover:bg-proxmox-hover/30 flex items-start gap-3"},/*#__PURE__*/React.createElement("span",{className:`text-sm leading-none mt-0.5 ${color}`},icon),/*#__PURE__*/React.createElement("div",{className:"flex-1 min-w-0"},/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-2"},/*#__PURE__*/React.createElement("span",{className:`text-xs font-semibold ${color}`},label),/*#__PURE__*/React.createElement("span",{className:"text-xs text-gray-600"},evt.user||'system')),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500 truncate"},evt.details||'-')),/*#__PURE__*/React.createElement("span",{className:"text-xs text-gray-600 whitespace-nowrap"},evt.timestamp?fmtDate(evt.timestamp):''));})):/*#__PURE__*/React.createElement("div",{className:"p-8 text-center text-gray-600 text-sm"},vmwareEventsLoading?'Loading...':'No ESXi events in audit log')))):selectedGroup?/*#__PURE__*/// LW: Feb 2026 - folder overlay for group +const counts=g.counts||{};const winDays=g.window?.days??pbsReportDays;const unprotectedArr=Array.isArray(g.unprotected)?g.unprotected:[];const staleArr=Array.isArray(g.stale)?g.stale:[];const protectedArr=Array.isArray(g.protected)?g.protected:[];return/*#__PURE__*/React.createElement(React.Fragment,null,/*#__PURE__*/React.createElement("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3"},/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-green-500/30 rounded-xl p-4"},/*#__PURE__*/React.createElement("div",{className:"text-2xl font-bold text-green-400"},counts.protected||0),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500 mt-1"},t('protected')||'Protected'," ",/*#__PURE__*/React.createElement("span",{className:"text-gray-600"},"(< ",winDays,"d)"))),/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-yellow-500/30 rounded-xl p-4"},/*#__PURE__*/React.createElement("div",{className:"text-2xl font-bold text-yellow-400"},counts.stale||0),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500 mt-1"},t('stale')||'Stale'," ",/*#__PURE__*/React.createElement("span",{className:"text-gray-600"},"(> ",winDays,"d)"))),/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-red-500/30 rounded-xl p-4"},/*#__PURE__*/React.createElement("div",{className:"text-2xl font-bold text-red-400"},counts.unprotected||0),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500 mt-1"},t('unprotected')||'No backups at all'))),unprotectedArr.length>0&&/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-red-500/30 rounded-xl overflow-hidden"},/*#__PURE__*/React.createElement("div",{className:"px-4 py-2 bg-red-500/10 text-red-300 text-sm font-medium"},"\uD83D\uDD34 ",t('unprotectedVms')||'Unprotected VMs'," (",unprotectedArr.length,")"),/*#__PURE__*/React.createElement("table",{className:"w-full text-xs"},/*#__PURE__*/React.createElement("thead",{className:"text-gray-500"},/*#__PURE__*/React.createElement("tr",null,/*#__PURE__*/React.createElement("th",{className:"text-left p-2 pl-4"},t('type')||'Type'),/*#__PURE__*/React.createElement("th",{className:"text-left p-2"},t('vmid')||'VMID'),/*#__PURE__*/React.createElement("th",{className:"text-left p-2"},t('name')||'Name'),/*#__PURE__*/React.createElement("th",{className:"text-left p-2"},t('node')||'Node'),/*#__PURE__*/React.createElement("th",{className:"text-left p-2"},t('status')||'Status'))),/*#__PURE__*/React.createElement("tbody",null,unprotectedArr.map((v,i)=>/*#__PURE__*/React.createElement("tr",{key:i,className:"border-t border-proxmox-border/30"},/*#__PURE__*/React.createElement("td",{className:"p-2 pl-4 text-gray-400 font-mono"},v.type),/*#__PURE__*/React.createElement("td",{className:"p-2 text-gray-300 font-mono"},v.vmid),/*#__PURE__*/React.createElement("td",{className:"p-2 text-white"},v.vm_name||'—'),/*#__PURE__*/React.createElement("td",{className:"p-2 text-gray-400"},v.node),/*#__PURE__*/React.createElement("td",{className:"p-2 text-gray-500"},v.status)))))),staleArr.length>0&&/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-yellow-500/30 rounded-xl overflow-hidden"},/*#__PURE__*/React.createElement("div",{className:"px-4 py-2 bg-yellow-500/10 text-yellow-300 text-sm font-medium"},"\uD83D\uDFE1 ",t('staleBackups')||'Stale (last backup older than window)'," (",staleArr.length,")"),/*#__PURE__*/React.createElement("table",{className:"w-full text-xs"},/*#__PURE__*/React.createElement("thead",{className:"text-gray-500"},/*#__PURE__*/React.createElement("tr",null,/*#__PURE__*/React.createElement("th",{className:"text-left p-2 pl-4"},t('type')||'Type'),/*#__PURE__*/React.createElement("th",{className:"text-left p-2"},t('vmid')||'VMID'),/*#__PURE__*/React.createElement("th",{className:"text-left p-2"},t('name')||'Name'),/*#__PURE__*/React.createElement("th",{className:"text-left p-2"},t('lastBackup')||'Last backup'),/*#__PURE__*/React.createElement("th",{className:"text-left p-2"},t('location')||'Location'))),/*#__PURE__*/React.createElement("tbody",null,staleArr.map((v,i)=>/*#__PURE__*/React.createElement("tr",{key:i,className:"border-t border-proxmox-border/30"},/*#__PURE__*/React.createElement("td",{className:"p-2 pl-4 text-gray-400 font-mono"},v.type),/*#__PURE__*/React.createElement("td",{className:"p-2 text-gray-300 font-mono"},v.vmid),/*#__PURE__*/React.createElement("td",{className:"p-2 text-white"},v.vm_name||'—'),/*#__PURE__*/React.createElement("td",{className:"p-2 text-gray-400"},fmtDate(v.last_backup_ts*1000)),/*#__PURE__*/React.createElement("td",{className:"p-2 text-gray-500"},v.datastore,v.namespace?`/${v.namespace}`:'')))))),protectedArr.length>0&&/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-green-500/30 rounded-xl overflow-hidden"},/*#__PURE__*/React.createElement("div",{className:"px-4 py-2 bg-green-500/10 text-green-300 text-sm font-medium"},"\uD83D\uDFE2 ",t('protected')||'Protected'," (",protectedArr.length,")"),/*#__PURE__*/React.createElement("div",{className:"max-h-72 overflow-auto"},/*#__PURE__*/React.createElement("table",{className:"w-full text-xs"},/*#__PURE__*/React.createElement("thead",{className:"bg-proxmox-dark text-gray-500 sticky top-0"},/*#__PURE__*/React.createElement("tr",null,/*#__PURE__*/React.createElement("th",{className:"text-left p-2 pl-4"},t('type')||'Type'),/*#__PURE__*/React.createElement("th",{className:"text-left p-2"},t('vmid')||'VMID'),/*#__PURE__*/React.createElement("th",{className:"text-left p-2"},t('name')||'Name'),/*#__PURE__*/React.createElement("th",{className:"text-left p-2"},t('lastBackup')||'Last backup'),/*#__PURE__*/React.createElement("th",{className:"text-left p-2"},t('location')||'Location'))),/*#__PURE__*/React.createElement("tbody",null,protectedArr.map((v,i)=>/*#__PURE__*/React.createElement("tr",{key:i,className:"border-t border-proxmox-border/30"},/*#__PURE__*/React.createElement("td",{className:"p-2 pl-4 text-gray-400 font-mono"},v.type),/*#__PURE__*/React.createElement("td",{className:"p-2 text-gray-300 font-mono"},v.vmid),/*#__PURE__*/React.createElement("td",{className:"p-2 text-white"},v.vm_name||'—'),/*#__PURE__*/React.createElement("td",{className:"p-2 text-gray-400"},fmtDate(v.last_backup_ts*1000)),/*#__PURE__*/React.createElement("td",{className:"p-2 text-gray-500"},v.datastore,v.namespace?`/${v.namespace}`:''))))))));})(),!pbsReportLoading&&(pbsReportSubTab==='summary'&&!pbsReportSummary||pbsReportSubTab==='inventory'&&!pbsReportInventory)&&/*#__PURE__*/React.createElement("div",{className:"text-center py-8 text-sm text-gray-500"},t('noReportData')||'No report data. Try Refresh or a different window.'))):selectedVMware?/*#__PURE__*//* VMware Server Management View */React.createElement("div",{className:isCorporate?'space-y-4':'space-y-6'},/*#__PURE__*/React.createElement("div",{className:`flex items-center justify-between ${isCorporate?'px-4 py-3 border-b':''}`,style:isCorporate?{borderColor:'var(--corp-border-medium)',background:'var(--corp-header-bg)'}:{}},/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-4"},isCorporate?/*#__PURE__*/React.createElement(Icons.Cloud,{className:"w-5 h-5 flex-shrink-0",style:{color:'var(--corp-accent)'}}):/*#__PURE__*/React.createElement("div",{className:"w-12 h-12 rounded-xl bg-gradient-to-br from-emerald-500/20 to-green-500/10 border border-emerald-500/30 flex items-center justify-center"},/*#__PURE__*/React.createElement(Icons.Cloud,{className:"w-6 h-6 text-emerald-400"})),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("h1",{className:isCorporate?'text-[15px] font-medium':'text-2xl font-bold',style:{color:'#e9ecef'}},selectedVMware.name||selectedVMware.host),/*#__PURE__*/React.createElement("div",{className:`flex items-center gap-3 ${isCorporate?'text-[12px]':'text-sm'}`,style:{color:'#adbbc4'}},/*#__PURE__*/React.createElement("span",null,selectedVMware.host,":",selectedVMware.port||443),/*#__PURE__*/React.createElement("span",null,"\u2022"),/*#__PURE__*/React.createElement("span",null,vmwareVms.length," VMs"),/*#__PURE__*/React.createElement("span",null,"\u2022"),/*#__PURE__*/React.createElement("span",null,vmwareHosts.length," Hosts"),/*#__PURE__*/React.createElement("span",null,"\u2022"),/*#__PURE__*/React.createElement("span",null,vmwareDatastores.length," Datastores")))),/*#__PURE__*/React.createElement("div",{className:isCorporate?'corp-toolbar flex items-center gap-1':'flex items-center gap-2'},isAdmin&&/*#__PURE__*/React.createElement(React.Fragment,null,/*#__PURE__*/React.createElement("button",{onClick:()=>{setEditingVMware(selectedVMware);setVmwareForm({name:selectedVMware.name||'',host:selectedVMware.host,port:selectedVMware.port||443,username:selectedVMware.username||'root',password:'',ssl_verify:selectedVMware.ssl_verify||false,notes:selectedVMware.notes||''});setShowAddVMware(true);},className:isCorporate?'':'px-3 py-2 rounded-lg bg-proxmox-card border border-proxmox-border text-gray-400 hover:text-white text-sm'},/*#__PURE__*/React.createElement(Icons.Settings,{className:"w-4 h-4"})),/*#__PURE__*/React.createElement("button",{onClick:()=>handleDeleteVMware(selectedVMware.id),className:isCorporate?'':'px-3 py-2 rounded-lg bg-proxmox-card border border-proxmox-border text-red-400 hover:text-red-300 text-sm'},/*#__PURE__*/React.createElement(Icons.Trash,{className:"w-4 h-4"}))),/*#__PURE__*/React.createElement("button",{onClick:()=>fetchVMwareVms(selectedVMware.id),className:isCorporate?'':'px-3 py-2 rounded-lg bg-proxmox-card border border-proxmox-border text-gray-400 hover:text-white text-sm'},/*#__PURE__*/React.createElement(Icons.RefreshCw,{className:`w-4 h-4 ${vmwareLoading?'animate-spin':''}`})))),/*#__PURE__*/React.createElement("div",{className:isCorporate?'corp-tab-strip':'flex items-center gap-1 p-1 bg-proxmox-card border border-proxmox-border rounded-xl w-fit'},[{id:'vms',label:t('virtualMachines'),icon:Icons.Monitor},{id:'hosts',label:'Hosts',icon:Icons.Server},{id:'datastores',label:t('datastores'),icon:Icons.Database},{id:'networks',label:'Networks',icon:Icons.Globe},{id:'clusters',label:'Clusters',icon:Icons.Layers},{id:'tasks',label:'Tasks & Events',icon:Icons.ClipboardList}].map(tab=>/*#__PURE__*/React.createElement("button",{key:tab.id,onClick:()=>{setVmwareActiveTab(tab.id);setVmwareSelectedVm(null);setVmwareSelectedDs(null);},className:isCorporate?`flex items-center gap-1 ${vmwareActiveTab===tab.id?'active':''}`:`flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-medium transition-all ${vmwareActiveTab===tab.id?'bg-emerald-500 text-white':'text-gray-400 hover:text-white hover:bg-proxmox-hover'}`},/*#__PURE__*/React.createElement(tab.icon,{className:isCorporate?'w-3 h-3':'w-4 h-4'}),tab.label))),!vmwareConnectionOk&&/*#__PURE__*/React.createElement("div",{className:"bg-yellow-500/10 border border-yellow-500/30 rounded-xl p-3 flex items-center gap-3"},/*#__PURE__*/React.createElement(Icons.AlertTriangle,{className:"w-5 h-5 text-yellow-400 flex-shrink-0"}),/*#__PURE__*/React.createElement("div",{className:"flex-1"},/*#__PURE__*/React.createElement("span",{className:"text-yellow-300 text-sm font-medium"},"Connection lost"),/*#__PURE__*/React.createElement("span",{className:"text-yellow-400/70 text-sm ml-2"},"Session expired - data may be stale")),/*#__PURE__*/React.createElement("button",{onClick:()=>{fetchVMwareVms(selectedVMware.id);fetchVMwareHosts(selectedVMware.id);fetchVMwareDatastores(selectedVMware.id);},className:"px-3 py-1.5 bg-yellow-500/20 hover:bg-yellow-500/30 text-yellow-300 rounded-lg text-xs font-medium"},"Reconnect")),vmwareActiveTab==='vms'&&!vmwareSelectedVm&&/*#__PURE__*/React.createElement("div",{className:"space-y-4"},/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-3"},/*#__PURE__*/React.createElement("div",{className:"flex-1 relative"},/*#__PURE__*/React.createElement(Icons.Search,{className:"absolute top-1/2 -translate-y-1/2 w-4 h-4",style:{left:isCorporate?10:12,color:'var(--corp-text-muted)',pointerEvents:'none'}}),/*#__PURE__*/React.createElement("input",{value:vmwareSearch,onChange:e=>setVmwareSearch(e.target.value),placeholder:"Search VMs...",className:isCorporate?'w-full pr-4 py-2 text-[13px] text-white placeholder-gray-500 focus:outline-none':'w-full pl-10 pr-4 py-2.5 bg-proxmox-card border border-proxmox-border rounded-xl text-white placeholder-gray-500 focus:outline-none focus:border-emerald-500/50 text-sm',style:isCorporate?{paddingLeft:'32px',background:'var(--corp-header-bg)',border:'1px solid var(--corp-border-medium)',borderRadius:'2px'}:{}})),/*#__PURE__*/React.createElement("div",{className:isCorporate?'flex items-center gap-0':'flex items-center gap-1 p-1 bg-proxmox-card border border-proxmox-border rounded-xl',style:isCorporate?{border:'1px solid #485764',borderRadius:'2px'}:{}},['all','running','stopped'].map(f=>/*#__PURE__*/React.createElement("button",{key:f,onClick:()=>setVmwareFilter(f),className:isCorporate?`px-3 py-1.5 text-[12px] font-medium ${vmwareFilter===f?'text-white':'hover:text-white'}`:`px-3 py-1.5 rounded-lg text-xs font-medium transition-all ${vmwareFilter===f?'bg-emerald-500/20 text-emerald-400':'text-gray-500 hover:text-white'}`,style:isCorporate?{color:vmwareFilter===f?'#e9ecef':'#728b9a',background:vmwareFilter===f?'#324f61':'transparent',borderRight:'1px solid #485764'}:{}},f==='all'?`${t('all')} (${vmwareVms.length})`:f==='running'?`${t('running')} (${vmwareVms.filter(v=>v.power_state==='POWERED_ON').length})`:`Stopped (${vmwareVms.filter(v=>v.power_state!=='POWERED_ON').length})`)))),vmwareLoading&&vmwareVms.length===0?/*#__PURE__*/React.createElement("div",{className:"text-center py-12 text-gray-500"},"Loading VMs..."):/*#__PURE__*/React.createElement("div",{className:isCorporate?'overflow-hidden':'bg-proxmox-card border border-proxmox-border rounded-xl overflow-hidden'},/*#__PURE__*/React.createElement("table",{className:isCorporate?'corp-datagrid':'w-full'},/*#__PURE__*/React.createElement("thead",null,/*#__PURE__*/React.createElement("tr",{className:isCorporate?'':'border-b border-proxmox-border'},/*#__PURE__*/React.createElement("th",{className:isCorporate?'':'text-left p-3 text-xs font-semibold text-gray-500 uppercase'},t('status')),/*#__PURE__*/React.createElement("th",{className:isCorporate?'':'text-left p-3 text-xs font-semibold text-gray-500 uppercase'},t('name')),/*#__PURE__*/React.createElement("th",{className:isCorporate?'':'text-left p-3 text-xs font-semibold text-gray-500 uppercase'},"Guest OS"),/*#__PURE__*/React.createElement("th",{className:isCorporate?'':'text-left p-3 text-xs font-semibold text-gray-500 uppercase'},"CPUs"),/*#__PURE__*/React.createElement("th",{className:isCorporate?'':'text-left p-3 text-xs font-semibold text-gray-500 uppercase'},"Memory"),/*#__PURE__*/React.createElement("th",{className:isCorporate?'':'text-left p-3 text-xs font-semibold text-gray-500 uppercase'},t('ipAddress')),/*#__PURE__*/React.createElement("th",{className:isCorporate?'':'text-left p-3 text-xs font-semibold text-gray-500 uppercase'},t('host')),/*#__PURE__*/React.createElement("th",{className:isCorporate?'text-right':'text-right p-3 text-xs font-semibold text-gray-500 uppercase'},t('actions')))),/*#__PURE__*/React.createElement("tbody",null,vmwareVms.filter(vm=>{if(vmwareFilter==='running')return vm.power_state==='POWERED_ON';if(vmwareFilter==='stopped')return vm.power_state!=='POWERED_ON';return true;}).filter(vm=>!vmwareSearch||(vm.name||'').toLowerCase().includes(vmwareSearch.toLowerCase())||(vm.guest_os||'').toLowerCase().includes(vmwareSearch.toLowerCase())).sort((a,b)=>{if(vmwareSortBy==='status')return(a.power_state||'').localeCompare(b.power_state||'');return(a.name||'').localeCompare(b.name||'');}).map(vm=>{const isOn=vm.power_state==='POWERED_ON';const isSuspended=vm.power_state==='SUSPENDED';const memGB=vm.memory_size_MiB?(vm.memory_size_MiB/1024).toFixed(1):vm.memory_mb?(vm.memory_mb/1024).toFixed(1):'-';const ip=vm.guest_info?.ip_address||vm.ip_address||vm.guest_ip||'-';const actionLoading=vmwareActionLoading[vm.vm||vm.vm_id||vm.id];return/*#__PURE__*/React.createElement("tr",{key:vm.vm||vm.vm_id||vm.id,className:"border-b border-proxmox-border/50 hover:bg-proxmox-hover/50 cursor-pointer transition-colors",onClick:()=>setVmwareSelectedVm(vm.vm||vm.vm_id||vm.id)},/*#__PURE__*/React.createElement("td",{className:"p-3"},/*#__PURE__*/React.createElement("div",{className:`w-3 h-3 rounded-full ${isOn?'bg-green-400 shadow-lg shadow-green-400/30':isSuspended?'bg-yellow-400':'bg-gray-500'}`,title:vm.power_state})),/*#__PURE__*/React.createElement("td",{className:"p-3"},/*#__PURE__*/React.createElement("div",{className:"font-medium text-white text-sm"},vm.name)),/*#__PURE__*/React.createElement("td",{className:"p-3 text-gray-400 text-sm"},(vm.guest_OS||vm.guest_os||'-').replace('Guest','').replace('_',' ').substring(0,25)),/*#__PURE__*/React.createElement("td",{className:"p-3 text-gray-400 text-sm"},vm.cpu_count||vm.num_cpu||'-'),/*#__PURE__*/React.createElement("td",{className:"p-3 text-gray-400 text-sm"},memGB," GB"),/*#__PURE__*/React.createElement("td",{className:"p-3 text-gray-400 text-sm font-mono text-xs"},ip),/*#__PURE__*/React.createElement("td",{className:"p-3 text-gray-400 text-sm"},(vm.host||vm.host_name||'-').split('.')[0]),/*#__PURE__*/React.createElement("td",{className:"p-3 text-right",onClick:e=>e.stopPropagation()},/*#__PURE__*/React.createElement("div",{className:"flex items-center justify-end gap-1"},!isOn?/*#__PURE__*/React.createElement("button",{onClick:()=>vmwarePowerAction(vm.vm||vm.vm_id||vm.id,'start'),disabled:!!actionLoading,className:"p-1.5 rounded-lg text-green-400 hover:bg-green-500/10 disabled:opacity-50",title:"Start"},actionLoading==='start'?/*#__PURE__*/React.createElement(Icons.RefreshCw,{className:"w-4 h-4 animate-spin"}):/*#__PURE__*/React.createElement(Icons.Play,{className:"w-4 h-4"})):/*#__PURE__*/React.createElement(React.Fragment,null,/*#__PURE__*/React.createElement("button",{onClick:()=>vmwarePowerAction(vm.vm||vm.vm_id||vm.id,'stop'),disabled:!!actionLoading,className:"p-1.5 rounded-lg text-red-400 hover:bg-red-500/10 disabled:opacity-50",title:"Shutdown"},actionLoading==='stop'?/*#__PURE__*/React.createElement(Icons.RefreshCw,{className:"w-4 h-4 animate-spin"}):/*#__PURE__*/React.createElement(Icons.Square,{className:"w-4 h-4"})),/*#__PURE__*/React.createElement("button",{onClick:()=>vmwarePowerAction(vm.vm||vm.vm_id||vm.id,'reset'),disabled:!!actionLoading,className:"p-1.5 rounded-lg text-yellow-400 hover:bg-yellow-500/10 disabled:opacity-50",title:"Reset"},/*#__PURE__*/React.createElement(Icons.RotateCw,{className:"w-4 h-4"})),/*#__PURE__*/React.createElement("button",{onClick:()=>vmwarePowerAction(vm.vm||vm.vm_id||vm.id,'suspend'),disabled:!!actionLoading,className:"p-1.5 rounded-lg text-blue-400 hover:bg-blue-500/10 disabled:opacity-50",title:"Suspend"},/*#__PURE__*/React.createElement(Icons.Pause,{className:"w-4 h-4"}))))));}))),vmwareVms.length===0&&!vmwareLoading&&/*#__PURE__*/React.createElement("div",{className:"text-center py-12 text-gray-500"},"No virtual machines found"))),vmwareActiveTab==='vms'&&vmwareSelectedVm&&/*#__PURE__*/React.createElement("div",{className:"space-y-4"},/*#__PURE__*/React.createElement("button",{onClick:()=>{setVmwareSelectedVm(null);setVmwareVmTab('overview');},className:"flex items-center gap-2 text-gray-400 hover:text-white text-sm"},/*#__PURE__*/React.createElement("span",{style:{display:"inline-block",transform:"rotate(180deg)"}},/*#__PURE__*/React.createElement(Icons.ChevronRight,{className:"w-4 h-4"}))," Back to VM List"),vmwareVmDetail?(()=>{const vm=vmwareVmDetail;const isOn=vm.power_state==='POWERED_ON';const isSuspended=vm.power_state==='SUSPENDED';const memMiB=vm.memory?.size_MiB||vm.memory_size_MiB||vm.memory_mb||0;const memGB=memMiB?(memMiB/1024).toFixed(1):'-';const cpuCount=vm.cpu?.count||vm.cpu_count||vm.num_cpu||0;const guestOS=vm.guest_OS||vm.guest_os||'-';const toolsStatus=vm.guest_info?.tools_status||vm.vmware_tools_status||'';const ipAddr=vm.guest_info?.ip_address||vm.ip_address||vm.guest_ip||'';const hostName=vm.guest_info?.host_name||vm.hostname||'';const hwVersion=vm.hardware?.version||'';const disksList=vm.disks?Array.isArray(vm.disks)?vm.disks:Object.values(vm.disks):[];const netsList=vm.networks?Array.isArray(vm.networks)?vm.networks:Object.values(vm.networks):[];const snapsList=vm.snapshots&&Array.isArray(vm.snapshots)?vm.snapshots:[];const totalDiskGB=disksList.reduce((sum,d)=>sum+(d.capacity?d.capacity/(1024*1024*1024):d.capacity_gb||0),0);return/*#__PURE__*/React.createElement("div",{className:"space-y-4"},/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl p-5"},/*#__PURE__*/React.createElement("div",{className:"flex items-center justify-between"},/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-4"},/*#__PURE__*/React.createElement("div",{className:`w-14 h-14 rounded-xl flex items-center justify-center ${isOn?'bg-green-500/10 border border-green-500/30':isSuspended?'bg-yellow-500/10 border border-yellow-500/30':'bg-gray-500/10 border border-gray-500/30'}`},/*#__PURE__*/React.createElement(Icons.Monitor,{className:`w-7 h-7 ${isOn?'text-green-400':isSuspended?'text-yellow-400':'text-gray-500'}`})),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-3"},/*#__PURE__*/React.createElement("h2",{className:"text-xl font-bold text-white"},vm.name),/*#__PURE__*/React.createElement("span",{className:`px-2 py-0.5 rounded text-xs font-semibold ${isOn?'bg-green-500/20 text-green-400':isSuspended?'bg-yellow-500/20 text-yellow-400':'bg-gray-500/20 text-gray-400'}`},isOn?'ON':isSuspended?'SUSPENDED':'OFF'),hwVersion&&/*#__PURE__*/React.createElement("span",{className:"text-xs text-gray-600"},hwVersion)),/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-4 text-xs text-gray-500 mt-1"},/*#__PURE__*/React.createElement("span",null,guestOS),cpuCount>0&&/*#__PURE__*/React.createElement("span",null,cpuCount," vCPU"),memGB!=='-'&&/*#__PURE__*/React.createElement("span",null,memGB," GB RAM"),totalDiskGB>0&&/*#__PURE__*/React.createElement("span",null,totalDiskGB.toFixed(0)," GB Disk"),toolsStatus&&/*#__PURE__*/React.createElement("span",{className:toolsStatus.includes('Not')?'text-yellow-500':'text-gray-500'},"Tools: ",toolsStatus.replace('toolsStatus','').replace('tools',''))))),/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-2"},!isOn?/*#__PURE__*/React.createElement("button",{onClick:()=>vmwarePowerAction(vmwareSelectedVm,'start'),className:"px-4 py-2 rounded-lg bg-green-500/20 text-green-400 hover:bg-green-500/30 text-sm font-medium flex items-center gap-1.5"},/*#__PURE__*/React.createElement(Icons.Play,{className:"w-4 h-4"})," Start"):/*#__PURE__*/React.createElement(React.Fragment,null,/*#__PURE__*/React.createElement("button",{onClick:()=>vmwarePowerAction(vmwareSelectedVm,'stop'),className:"px-3 py-2 rounded-lg bg-red-500/20 text-red-400 hover:bg-red-500/30 text-sm font-medium flex items-center gap-1.5"},/*#__PURE__*/React.createElement(Icons.Square,{className:"w-3.5 h-3.5"})," Stop"),/*#__PURE__*/React.createElement("button",{onClick:()=>vmwarePowerAction(vmwareSelectedVm,'reset'),className:"p-2 rounded-lg bg-yellow-500/10 text-yellow-400 hover:bg-yellow-500/20",title:"Reset"},/*#__PURE__*/React.createElement(Icons.RotateCw,{className:"w-4 h-4"})),/*#__PURE__*/React.createElement("button",{onClick:()=>vmwarePowerAction(vmwareSelectedVm,'suspend'),className:"p-2 rounded-lg bg-blue-500/10 text-blue-400 hover:bg-blue-500/20",title:"Suspend"},/*#__PURE__*/React.createElement(Icons.Pause,{className:"w-4 h-4"}))),/*#__PURE__*/React.createElement("div",{className:"w-px h-8 bg-proxmox-border mx-1"}),isOn&&/*#__PURE__*/React.createElement("button",{onClick:()=>openVmwareConsole(vmwareSelectedVm),className:"p-2 rounded-lg bg-purple-500/10 text-purple-400 hover:bg-purple-500/20",title:"Console (VMRC)"},/*#__PURE__*/React.createElement(Icons.Terminal,{className:"w-4 h-4"})),/*#__PURE__*/React.createElement("div",{className:"relative group"},/*#__PURE__*/React.createElement("button",{className:"p-2 rounded-lg bg-proxmox-dark border border-proxmox-border text-gray-400 hover:text-white"},/*#__PURE__*/React.createElement(Icons.Settings,{className:"w-4 h-4"})),/*#__PURE__*/React.createElement("div",{className:"absolute right-0 top-full mt-1 w-48 bg-proxmox-card border border-proxmox-border rounded-xl shadow-xl z-50 hidden group-hover:block"},/*#__PURE__*/React.createElement("div",{className:"py-1"},/*#__PURE__*/React.createElement("button",{onClick:()=>{setVmwareRenameName(vm.name||'');setShowVmwareRename(true);},className:"w-full text-left px-4 py-2 text-sm text-gray-300 hover:bg-proxmox-hover flex items-center gap-2"},/*#__PURE__*/React.createElement(Icons.Edit,{className:"w-3.5 h-3.5"})," ",t('rename')),/*#__PURE__*/React.createElement("button",{onClick:()=>{setVmwareCloneName(`${vm.name}-clone`);setShowVmwareClone(true);},className:"w-full text-left px-4 py-2 text-sm text-gray-300 hover:bg-proxmox-hover flex items-center gap-2"},/*#__PURE__*/React.createElement(Icons.Copy,{className:"w-3.5 h-3.5"})," ",t('clone')),/*#__PURE__*/React.createElement("button",{onClick:()=>{fetchMigrationPlan(vmwareSelectedVm);},className:"w-full text-left px-4 py-2 text-sm text-emerald-400 hover:bg-proxmox-hover flex items-center gap-2"},/*#__PURE__*/React.createElement(Icons.FolderInput,{className:"w-3.5 h-3.5"})," ",t('migrateToProxmox')),/*#__PURE__*/React.createElement("div",{className:"border-t border-proxmox-border my-1"}),/*#__PURE__*/React.createElement("button",{onClick:()=>setShowVmwareDelete(true),disabled:isOn,className:"w-full text-left px-4 py-2 text-sm text-red-400 hover:bg-proxmox-hover flex items-center gap-2 disabled:opacity-30 disabled:cursor-not-allowed"},/*#__PURE__*/React.createElement(Icons.Trash,{className:"w-3.5 h-3.5"})," Delete VM ",isOn?'(stop first)':''))))))),/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-1 border-b border-proxmox-border"},[{id:'overview',label:t('overview')},{id:'settings',label:t('settings')},{id:'config',label:t('hardware')},{id:'snapshots',label:`${t('snapshotsTab')} (${snapsList.length})`},{id:'migrate',label:'Migration'}].map(tab=>/*#__PURE__*/React.createElement("button",{key:tab.id,onClick:()=>setVmwareVmTab(tab.id),className:`px-4 py-2.5 text-sm font-medium border-b-2 transition-all ${vmwareVmTab===tab.id?'border-emerald-400 text-emerald-400':'border-transparent text-gray-500 hover:text-gray-300'}`},tab.label))),vmwareVmTab==='overview'&&/*#__PURE__*/React.createElement("div",{className:"space-y-4"},/*#__PURE__*/React.createElement("div",{className:"grid grid-cols-2 xl:grid-cols-4 gap-3"},/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl p-4"},/*#__PURE__*/React.createElement("div",{className:"flex items-center justify-between mb-2"},/*#__PURE__*/React.createElement("span",{className:"text-xs text-gray-500 uppercase font-semibold"},t('cpu')),/*#__PURE__*/React.createElement(Icons.Cpu,{className:"w-4 h-4 text-blue-400"})),/*#__PURE__*/React.createElement("div",{className:"text-2xl font-bold text-white"},cpuCount),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500"},"vCPUs")),/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl p-4"},/*#__PURE__*/React.createElement("div",{className:"flex items-center justify-between mb-2"},/*#__PURE__*/React.createElement("span",{className:"text-xs text-gray-500 uppercase font-semibold"},"Memory"),/*#__PURE__*/React.createElement(Icons.Memory,{className:"w-4 h-4 text-purple-400"})),/*#__PURE__*/React.createElement("div",{className:"text-2xl font-bold text-white"},memGB),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500"},"GB RAM")),/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl p-4"},/*#__PURE__*/React.createElement("div",{className:"flex items-center justify-between mb-2"},/*#__PURE__*/React.createElement("span",{className:"text-xs text-gray-500 uppercase font-semibold"},"Storage"),/*#__PURE__*/React.createElement(Icons.HardDrive,{className:"w-4 h-4 text-emerald-400"})),/*#__PURE__*/React.createElement("div",{className:"text-2xl font-bold text-white"},totalDiskGB>0?totalDiskGB.toFixed(0):'-'),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500"},"GB (",disksList.length," disks)")),/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl p-4"},/*#__PURE__*/React.createElement("div",{className:"flex items-center justify-between mb-2"},/*#__PURE__*/React.createElement("span",{className:"text-xs text-gray-500 uppercase font-semibold"},"Network"),/*#__PURE__*/React.createElement(Icons.Globe,{className:"w-4 h-4 text-cyan-400"})),/*#__PURE__*/React.createElement("div",{className:"text-lg font-mono font-bold text-white"},ipAddr||'-'),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500"},hostName||`${netsList.length} adapters`))),/*#__PURE__*/React.createElement("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4"},/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl p-4"},/*#__PURE__*/React.createElement("h3",{className:"text-sm font-semibold text-gray-400 uppercase mb-3"},"VM Information"),/*#__PURE__*/React.createElement("div",{className:"space-y-2 text-sm"},[['VM ID',vm.vm||vmwareSelectedVm],['Guest OS',guestOS],['Hardware Version',hwVersion||'-'],['Guest Tools',toolsStatus||'Not installed'],['Power State',vm.power_state||'-'],['IP Address',ipAddr||'N/A'],[t('hostname'),hostName||'N/A']].map(([label,value])=>/*#__PURE__*/React.createElement("div",{key:label,className:"flex justify-between"},/*#__PURE__*/React.createElement("span",{className:"text-gray-500"},label),/*#__PURE__*/React.createElement("span",{className:"text-white font-mono text-xs"},value))))),/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl p-4"},/*#__PURE__*/React.createElement("h3",{className:"text-sm font-semibold text-gray-400 uppercase mb-3"},"Disks"),disksList.length>0?/*#__PURE__*/React.createElement("div",{className:"space-y-2"},disksList.map((disk,idx)=>{const capGB=disk.capacity?(disk.capacity/(1024*1024*1024)).toFixed(1):disk.capacity_gb||'?';return/*#__PURE__*/React.createElement("div",{key:idx,className:"flex items-center justify-between p-2.5 bg-proxmox-dark rounded-lg"},/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-2"},/*#__PURE__*/React.createElement(Icons.HardDrive,{className:"w-4 h-4 text-gray-500"}),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("div",{className:"text-sm text-white"},disk.label||`Disk ${idx}`),disk.backing?.thin_provisioned&&/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-600"},"Thin provisioned"))),/*#__PURE__*/React.createElement("div",{className:"text-right"},/*#__PURE__*/React.createElement("div",{className:"text-sm text-white font-medium"},capGB," GB"),disk.backing?.datastore&&/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-600"},disk.backing.datastore)));})):/*#__PURE__*/React.createElement("div",{className:"text-gray-600 text-sm"},"No disks found"))),netsList.length>0&&/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl p-4"},/*#__PURE__*/React.createElement("h3",{className:"text-sm font-semibold text-gray-400 uppercase mb-3"},"Network Adapters"),/*#__PURE__*/React.createElement("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2"},netsList.map((nic,idx)=>/*#__PURE__*/React.createElement("div",{key:idx,className:"flex items-center justify-between p-2.5 bg-proxmox-dark rounded-lg"},/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-2"},/*#__PURE__*/React.createElement(Icons.Globe,{className:"w-4 h-4 text-gray-500"}),/*#__PURE__*/React.createElement("span",{className:"text-sm text-white"},nic.label||nic.name||`NIC ${idx}`)),/*#__PURE__*/React.createElement("span",{className:"text-xs text-gray-400 font-mono"},nic.mac_address||'-')))))),vmwareVmTab==='settings'&&(()=>{// Initialize edit form from VM detail +const initCpu=vmwareConfigEdit.cpu||cpuCount||1;const initMem=vmwareConfigEdit.memory||memGB*1024||2048;const initNotes=vmwareConfigEdit.notes!==undefined&&vmwareConfigEdit.notes!==''?vmwareConfigEdit.notes:vm.annotation||vm.notes||vm.config?.annotation||'';const perfData=vm.performance||{};return/*#__PURE__*/React.createElement("div",{className:"space-y-4"},isOn&&/*#__PURE__*/React.createElement("div",{className:"bg-yellow-500/10 border border-yellow-500/20 rounded-xl p-3"},/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-2 text-yellow-400 text-sm"},/*#__PURE__*/React.createElement(Icons.AlertTriangle,{className:"w-4 h-4"}),/*#__PURE__*/React.createElement("span",null,"VM is powered on - some changes (CPU, Memory) may require the VM to be powered off or need hot-add enabled."))),/*#__PURE__*/React.createElement("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4"},/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl p-4"},/*#__PURE__*/React.createElement("h3",{className:"text-sm font-semibold text-gray-400 uppercase mb-4 flex items-center gap-2"},/*#__PURE__*/React.createElement(Icons.Cpu,{className:"w-4 h-4"})," Compute Resources"),/*#__PURE__*/React.createElement("div",{className:"space-y-4"},/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"block text-xs text-gray-500 mb-1.5"},"vCPUs"),/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-2"},/*#__PURE__*/React.createElement("input",{type:"number",min:"1",max:"128",value:vmwareConfigEdit.cpu||cpuCount||'',onChange:e=>setVmwareConfigEdit(p=>({...p,cpu:e.target.value})),className:"flex-1 bg-proxmox-dark border border-proxmox-border rounded-lg px-3 py-2 text-white text-sm"}),/*#__PURE__*/React.createElement("span",{className:"text-xs text-gray-500 w-16"},"cores"))),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"block text-xs text-gray-500 mb-1.5"},"Memory (MB)"),/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-2"},/*#__PURE__*/React.createElement("input",{type:"number",min:"256",step:"256",value:vmwareConfigEdit.memory||memGB*1024||'',onChange:e=>setVmwareConfigEdit(p=>({...p,memory:e.target.value})),className:"flex-1 bg-proxmox-dark border border-proxmox-border rounded-lg px-3 py-2 text-white text-sm"}),/*#__PURE__*/React.createElement("span",{className:"text-xs text-gray-500 w-16"},"MB")),/*#__PURE__*/React.createElement("div",{className:"flex gap-2 mt-1"},[1024,2048,4096,8192,16384].map(v=>/*#__PURE__*/React.createElement("button",{key:v,onClick:()=>setVmwareConfigEdit(p=>({...p,memory:String(v)})),className:`px-2 py-0.5 rounded text-xs ${parseInt(vmwareConfigEdit.memory||memGB*1024)===v?'bg-emerald-500/20 text-emerald-400':'bg-proxmox-dark text-gray-500 hover:text-white'}`},v>=1024?`${v/1024}G`:`${v}M`)))),/*#__PURE__*/React.createElement("div",{className:"pt-2 border-t border-proxmox-border/50 space-y-2"},/*#__PURE__*/React.createElement("label",{className:"flex items-center justify-between cursor-pointer"},/*#__PURE__*/React.createElement("span",{className:"text-sm text-gray-400"},"CPU Hot-Add"),/*#__PURE__*/React.createElement("div",{onClick:()=>setVmwareConfigEdit(p=>({...p,cpu_hot_add:!p.cpu_hot_add})),className:`w-10 h-5 rounded-full transition-colors cursor-pointer flex items-center ${vmwareConfigEdit.cpu_hot_add?'bg-emerald-500':'bg-gray-700'}`},/*#__PURE__*/React.createElement("div",{className:`w-4 h-4 rounded-full bg-white shadow transition-transform ${vmwareConfigEdit.cpu_hot_add?'translate-x-5':'translate-x-0.5'}`}))),/*#__PURE__*/React.createElement("label",{className:"flex items-center justify-between cursor-pointer"},/*#__PURE__*/React.createElement("span",{className:"text-sm text-gray-400"},"Memory Hot-Add"),/*#__PURE__*/React.createElement("div",{onClick:()=>setVmwareConfigEdit(p=>({...p,memory_hot_add:!p.memory_hot_add})),className:`w-10 h-5 rounded-full transition-colors cursor-pointer flex items-center ${vmwareConfigEdit.memory_hot_add?'bg-emerald-500':'bg-gray-700'}`},/*#__PURE__*/React.createElement("div",{className:`w-4 h-4 rounded-full bg-white shadow transition-transform ${vmwareConfigEdit.memory_hot_add?'translate-x-5':'translate-x-0.5'}`})))))),/*#__PURE__*/React.createElement("div",{className:"space-y-4"},/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl p-4"},/*#__PURE__*/React.createElement("h3",{className:"text-sm font-semibold text-gray-400 uppercase mb-4 flex items-center gap-2"},/*#__PURE__*/React.createElement(Icons.FileText,{className:"w-4 h-4"})," ",t('notes')),/*#__PURE__*/React.createElement("textarea",{value:vmwareConfigEdit.notes!==undefined&&vmwareConfigEdit.notes!==''?vmwareConfigEdit.notes:vm.annotation||vm.notes||vm.config?.annotation||'',onChange:e=>setVmwareConfigEdit(p=>({...p,notes:e.target.value})),placeholder:"VM description / notes...",rows:4,className:"w-full bg-proxmox-dark border border-proxmox-border rounded-lg px-3 py-2 text-white text-sm resize-none"})),/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl p-4"},/*#__PURE__*/React.createElement("h3",{className:"text-sm font-semibold text-gray-400 uppercase mb-4 flex items-center gap-2"},/*#__PURE__*/React.createElement(Icons.Play,{className:"w-4 h-4"})," ",t('bootOrder')),/*#__PURE__*/React.createElement("div",{className:"space-y-2"},[{key:'disk',label:t('hardDisk'),icon:'💾'},{key:'cdrom',label:t('cdrom'),icon:'💿'},{key:'net',label:'Network (PXE)',icon:'🌐'}].map((item,idx)=>/*#__PURE__*/React.createElement("div",{key:item.key,className:"flex items-center gap-3 p-2.5 bg-proxmox-dark rounded-lg"},/*#__PURE__*/React.createElement("span",{className:"text-xs text-gray-500 w-5"},idx+1,"."),/*#__PURE__*/React.createElement("span",null,item.icon),/*#__PURE__*/React.createElement("span",{className:"text-sm text-white flex-1"},item.label))),/*#__PURE__*/React.createElement("button",{onClick:()=>handleVmwareBootOrderSave(vmwareSelectedVm,['disk','cdrom','net']),className:"text-xs text-gray-500 hover:text-emerald-400 transition-colors"},"Reset to default (Disk \u2192 CD \u2192 Network)"))),netsList.length>0&&/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl p-4"},/*#__PURE__*/React.createElement("h3",{className:"text-sm font-semibold text-gray-400 uppercase mb-4 flex items-center gap-2"},/*#__PURE__*/React.createElement(Icons.Globe,{className:"w-4 h-4"})," Network Adapters"),/*#__PURE__*/React.createElement("div",{className:"space-y-3"},netsList.map((nic,idx)=>/*#__PURE__*/React.createElement("div",{key:idx,className:"p-3 bg-proxmox-dark rounded-lg"},/*#__PURE__*/React.createElement("div",{className:"flex items-center justify-between mb-2"},/*#__PURE__*/React.createElement("span",{className:"text-sm text-white font-medium"},nic.label||`NIC ${idx+1}`),/*#__PURE__*/React.createElement("span",{className:"text-xs text-gray-500 font-mono"},nic.mac_address||'')),/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-2"},/*#__PURE__*/React.createElement("select",{value:nic.network||nic.backing?.network_name||'',onChange:e=>handleVmwareNetworkChange(vmwareSelectedVm,nic.key||0,e.target.value),className:"flex-1 bg-proxmox-card border border-proxmox-border rounded px-2 py-1.5 text-sm text-gray-300"},/*#__PURE__*/React.createElement("option",{value:nic.network||nic.backing?.network_name||''},nic.network||nic.backing?.network_name||'Current Network'),vmwareNetworks.filter(n=>n.name!==(nic.network||nic.backing?.network_name)).map(n=>/*#__PURE__*/React.createElement("option",{key:n.network||n.name,value:n.name},n.name)))))))))),perfData.cpu_usage_mhz!==undefined&&/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl p-4"},/*#__PURE__*/React.createElement("h3",{className:"text-sm font-semibold text-gray-400 uppercase mb-3"},"Live Performance"),/*#__PURE__*/React.createElement("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3"},/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-dark rounded-lg p-3 text-center"},/*#__PURE__*/React.createElement("div",{className:"text-lg font-bold text-blue-400"},perfData.cpu_usage_mhz||0," MHz"),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500"},"CPU Usage")),/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-dark rounded-lg p-3 text-center"},/*#__PURE__*/React.createElement("div",{className:"text-lg font-bold text-purple-400"},perfData.memory_usage_mb||0," MB"),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500"},"Memory Used")),/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-dark rounded-lg p-3 text-center"},/*#__PURE__*/React.createElement("div",{className:"text-lg font-bold text-emerald-400"},perfData.disk_committed?(perfData.disk_committed/1024**3).toFixed(1):'0'," GB"),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500"},"Disk Used")),/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-dark rounded-lg p-3 text-center"},/*#__PURE__*/React.createElement("div",{className:"text-lg font-bold text-cyan-400"},perfData.uptime_seconds?Math.floor(perfData.uptime_seconds/3600)+'h':'0h'),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500"},t('uptime'))))),/*#__PURE__*/React.createElement("div",{className:"flex justify-end gap-3"},/*#__PURE__*/React.createElement("button",{onClick:()=>setVmwareConfigEdit({cpu:'',memory:'',notes:'',cpu_hot_add:false,memory_hot_add:false}),className:"px-4 py-2 rounded-lg bg-proxmox-card border border-proxmox-border text-gray-400 hover:text-white text-sm"},"Reset"),/*#__PURE__*/React.createElement("button",{onClick:()=>handleVmwareConfigSave(vmwareSelectedVm),disabled:vmwareConfigSaving,className:"px-6 py-2 rounded-lg bg-emerald-500 hover:bg-emerald-600 text-white text-sm font-medium disabled:opacity-50 flex items-center gap-2"},vmwareConfigSaving?/*#__PURE__*/React.createElement(Icons.RefreshCw,{className:"w-4 h-4 animate-spin"}):/*#__PURE__*/React.createElement(Icons.Check,{className:"w-4 h-4"}),"Save Changes")));})(),vmwareVmTab==='config'&&/*#__PURE__*/React.createElement("div",{className:"space-y-4"},/*#__PURE__*/React.createElement("div",{className:"bg-blue-500/10 border border-blue-500/20 rounded-xl p-3"},/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-2 text-blue-400 text-sm"},/*#__PURE__*/React.createElement(Icons.Info,{className:"w-4 h-4"}),/*#__PURE__*/React.createElement("span",null,"Hardware overview (read-only). Use the Settings tab to change CPU, Memory, and Network."))),/*#__PURE__*/React.createElement("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4"},/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl p-4"},/*#__PURE__*/React.createElement("h3",{className:"text-sm font-semibold text-gray-400 uppercase mb-4"},"Current Configuration"),/*#__PURE__*/React.createElement("div",{className:"space-y-3"},/*#__PURE__*/React.createElement("div",{className:"flex items-center justify-between p-3 bg-proxmox-dark rounded-lg"},/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-3"},/*#__PURE__*/React.createElement("div",{className:"w-8 h-8 rounded-lg bg-blue-500/10 flex items-center justify-center"},/*#__PURE__*/React.createElement(Icons.Cpu,{className:"w-4 h-4 text-blue-400"})),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("div",{className:"text-sm text-white font-medium"},t('cpu')),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500"},"Virtual CPUs"))),/*#__PURE__*/React.createElement("div",{className:"text-lg font-bold text-white"},cpuCount)),/*#__PURE__*/React.createElement("div",{className:"flex items-center justify-between p-3 bg-proxmox-dark rounded-lg"},/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-3"},/*#__PURE__*/React.createElement("div",{className:"w-8 h-8 rounded-lg bg-purple-500/10 flex items-center justify-center"},/*#__PURE__*/React.createElement(Icons.Memory,{className:"w-4 h-4 text-purple-400"})),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("div",{className:"text-sm text-white font-medium"},"Memory"),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500"},"RAM allocation"))),/*#__PURE__*/React.createElement("div",{className:"text-lg font-bold text-white"},memGB," GB")),disksList.map((disk,idx)=>{const capGB=disk.capacity?(disk.capacity/(1024*1024*1024)).toFixed(1):disk.capacity_gb||'?';return/*#__PURE__*/React.createElement("div",{key:idx,className:"flex items-center justify-between p-3 bg-proxmox-dark rounded-lg"},/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-3"},/*#__PURE__*/React.createElement("div",{className:"w-8 h-8 rounded-lg bg-emerald-500/10 flex items-center justify-center"},/*#__PURE__*/React.createElement(Icons.HardDrive,{className:"w-4 h-4 text-emerald-400"})),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("div",{className:"text-sm text-white font-medium"},disk.label||`Disk ${idx}`),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500"},disk.backing?.thin_provisioned?'Thin':'Thick'," - ",disk.backing?.datastore||''))),/*#__PURE__*/React.createElement("div",{className:"text-lg font-bold text-white"},capGB," GB"));}),netsList.map((nic,idx)=>/*#__PURE__*/React.createElement("div",{key:idx,className:"flex items-center justify-between p-3 bg-proxmox-dark rounded-lg"},/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-3"},/*#__PURE__*/React.createElement("div",{className:"w-8 h-8 rounded-lg bg-cyan-500/10 flex items-center justify-center"},/*#__PURE__*/React.createElement(Icons.Globe,{className:"w-4 h-4 text-cyan-400"})),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("div",{className:"text-sm text-white font-medium"},nic.label||nic.name||`NIC ${idx}`),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500 font-mono"},nic.mac_address||''))),/*#__PURE__*/React.createElement("div",{className:"text-sm text-gray-400"},nic.network||nic.name||''))))),/*#__PURE__*/React.createElement("div",{className:"space-y-4"},vm.hardware&&(vm.hardware.firmware||vm.hardware.scsi_controller)&&/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl p-4"},/*#__PURE__*/React.createElement("h3",{className:"text-sm font-semibold text-gray-400 uppercase mb-4"},"Hardware Details"),/*#__PURE__*/React.createElement("div",{className:"space-y-2 text-sm"},/*#__PURE__*/React.createElement("div",{className:"flex justify-between p-2 bg-proxmox-dark rounded-lg"},/*#__PURE__*/React.createElement("span",{className:"text-gray-400"},"Firmware"),/*#__PURE__*/React.createElement("span",{className:"text-white font-medium"},(vm.hardware.firmware||'BIOS').toUpperCase())),/*#__PURE__*/React.createElement("div",{className:"flex justify-between p-2 bg-proxmox-dark rounded-lg"},/*#__PURE__*/React.createElement("span",{className:"text-gray-400"},t('scsiController')),/*#__PURE__*/React.createElement("div",{className:"text-right"},/*#__PURE__*/React.createElement("div",{className:"text-white font-medium"},vm.hardware.scsi_controller||'N/A'),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500"},"\u2192 Proxmox: ",vm.hardware.scsi_controller_pve||'auto'))),/*#__PURE__*/React.createElement("div",{className:"flex justify-between p-2 bg-proxmox-dark rounded-lg"},/*#__PURE__*/React.createElement("span",{className:"text-gray-400"},t('networkAdapter')),/*#__PURE__*/React.createElement("div",{className:"text-right"},/*#__PURE__*/React.createElement("div",{className:"text-white font-medium"},vm.hardware.nic_type||'N/A'),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500"},"\u2192 Proxmox: ",vm.hardware.nic_type_pve||'auto'))),/*#__PURE__*/React.createElement("div",{className:"flex justify-between p-2 bg-proxmox-dark rounded-lg"},/*#__PURE__*/React.createElement("span",{className:"text-gray-400"},"Disk Bus"),/*#__PURE__*/React.createElement("span",{className:"text-white font-medium"},(vm.hardware.disk_bus||'SCSI').toUpperCase())),vm.hardware.version&&/*#__PURE__*/React.createElement("div",{className:"flex justify-between p-2 bg-proxmox-dark rounded-lg"},/*#__PURE__*/React.createElement("span",{className:"text-gray-400"},"HW Version"),/*#__PURE__*/React.createElement("span",{className:"text-white font-medium"},vm.hardware.version)))),/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl p-4"},/*#__PURE__*/React.createElement("h3",{className:"text-sm font-semibold text-gray-400 uppercase mb-4"},t('quickActions')||'Quick Actions'),/*#__PURE__*/React.createElement("div",{className:"space-y-2"},/*#__PURE__*/React.createElement("button",{onClick:()=>{setVmwareRenameName(vm.name||'');setShowVmwareRename(true);},className:"w-full flex items-center gap-3 p-3 bg-proxmox-dark rounded-lg hover:bg-proxmox-hover transition-colors text-left"},/*#__PURE__*/React.createElement(Icons.Edit,{className:"w-5 h-5 text-blue-400"}),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("div",{className:"text-sm text-white"},t('renameVm')||'Rename VM'),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500"},t('renameVmDesc')||'Change the display name'))),/*#__PURE__*/React.createElement("button",{onClick:()=>{setVmwareCloneName(`${vm.name}-clone`);setShowVmwareClone(true);},className:"w-full flex items-center gap-3 p-3 bg-proxmox-dark rounded-lg hover:bg-proxmox-hover transition-colors text-left"},/*#__PURE__*/React.createElement(Icons.Copy,{className:"w-5 h-5 text-green-400"}),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("div",{className:"text-sm text-white"},t('cloneVm')||'Clone VM'),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500"},t('cloneVmDesc')||'Create an identical copy'))),/*#__PURE__*/React.createElement("button",{onClick:()=>fetchMigrationPlan(vmwareSelectedVm),disabled:vmwareMigrateLoading,className:"w-full flex items-center gap-3 p-3 bg-proxmox-dark rounded-lg hover:bg-proxmox-hover transition-colors text-left"},/*#__PURE__*/React.createElement(Icons.FolderInput,{className:"w-5 h-5 text-emerald-400"}),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("div",{className:"text-sm text-white"},t('migrateToProxmox')||'Migrate to Proxmox'),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500"},t('v2pMigrationDesc')||'Near-zero downtime V2P migration'))),/*#__PURE__*/React.createElement("button",{onClick:()=>setShowVmwareDelete(true),disabled:isOn,className:"w-full flex items-center gap-3 p-3 bg-proxmox-dark rounded-lg hover:bg-red-500/5 transition-colors text-left disabled:opacity-40"},/*#__PURE__*/React.createElement(Icons.Trash,{className:"w-5 h-5 text-red-400"}),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("div",{className:"text-sm text-red-400"},t('deleteVm')||'Delete VM'),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500"},isOn?t('powerOffFirst')||'Power off first to delete':t('permanentlyRemoveVm')||'Permanently remove this VM')))))))),vmwareVmTab==='snapshots'&&/*#__PURE__*/React.createElement("div",{className:"space-y-4"},/*#__PURE__*/React.createElement("div",{className:"flex items-center justify-between"},/*#__PURE__*/React.createElement("h3",{className:"text-sm font-semibold text-gray-400"},t('snapshots')," (",snapsList.length,")"),/*#__PURE__*/React.createElement("button",{onClick:async()=>{const name=prompt('Snapshot name:');if(name){await vmwareSnapshotAction(vmwareSelectedVm,'create',{name,description:''});fetchVMwareVmDetail(selectedVMware.id,vmwareSelectedVm);}},className:"px-3 py-1.5 rounded-lg bg-emerald-500/20 text-emerald-400 hover:bg-emerald-500/30 text-sm font-medium"},"+ ",t('createSnapshot'))),snapsList.length>0?/*#__PURE__*/React.createElement("div",{className:"space-y-2"},snapsList.map((snap,idx)=>/*#__PURE__*/React.createElement("div",{key:idx,className:"bg-proxmox-card border border-proxmox-border rounded-xl p-4 flex items-center justify-between"},/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-3"},/*#__PURE__*/React.createElement("div",{className:"w-8 h-8 rounded-lg bg-blue-500/10 flex items-center justify-center"},/*#__PURE__*/React.createElement(Icons.Camera,{className:"w-4 h-4 text-blue-400"})),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("div",{className:"text-sm font-medium text-white"},snap.name),snap.description&&/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500"},snap.description),snap.created&&/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-600"},fmtDate(snap.created)))),/*#__PURE__*/React.createElement("button",{onClick:()=>vmwareSnapshotAction(vmwareSelectedVm,'delete',{snapshot_id:snap.id||snap.snapshot}),className:"p-2 text-red-400 hover:bg-red-500/10 rounded-lg",title:t('deleteSnapshot')},/*#__PURE__*/React.createElement(Icons.Trash,{className:"w-4 h-4"}))))):/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl p-8 text-center text-gray-500"},/*#__PURE__*/React.createElement(Icons.Camera,{className:"w-8 h-8 mx-auto mb-2 opacity-30"}),/*#__PURE__*/React.createElement("div",{className:"text-sm"},"No snapshots. Create one to save the current VM state."))),vmwareVmTab==='migrate'&&/*#__PURE__*/React.createElement("div",{className:"space-y-4"},/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl p-5"},/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-3 mb-4"},/*#__PURE__*/React.createElement("div",{className:"w-10 h-10 rounded-xl bg-emerald-500/10 flex items-center justify-center"},/*#__PURE__*/React.createElement(Icons.FolderInput,{className:"w-5 h-5 text-emerald-400"})),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("h3",{className:"text-white font-semibold"},"Migrate to Proxmox VE"),/*#__PURE__*/React.createElement("p",{className:"text-xs text-gray-500"},"Near-zero downtime ESXi to Proxmox migration using block-level delta sync"))),/*#__PURE__*/React.createElement("div",{className:"grid grid-cols-3 gap-3 mb-4"},/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-dark rounded-lg p-3 text-center"},/*#__PURE__*/React.createElement("div",{className:"text-lg font-bold text-white"},totalDiskGB.toFixed(0)," GB"),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500"},"Total Disk")),/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-dark rounded-lg p-3 text-center"},/*#__PURE__*/React.createElement("div",{className:"text-lg font-bold text-emerald-400"},"~",Math.max(2,Math.round(totalDiskGB*0.08))," min"),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500"},"Est. Downtime")),/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-dark rounded-lg p-3 text-center"},/*#__PURE__*/React.createElement("div",{className:"text-lg font-bold text-white"},disksList.length),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500"},"Disks to Transfer"))),/*#__PURE__*/React.createElement("div",{className:"space-y-2 mb-4 text-xs text-gray-400"},/*#__PURE__*/React.createElement("div",{className:"font-semibold text-gray-300 mb-1"},t('howItWorks')||'How it works:'),/*#__PURE__*/React.createElement("div",null,"1. ",t('migStep1')||'Snapshot or live-mirror the source VMDKs depending on transfer mode'),/*#__PURE__*/React.createElement("div",null,"2. ",t('migStep2')||'Stream disks to Proxmox storage (SSH dd / drive-mirror / SSHFS)'),/*#__PURE__*/React.createElement("div",null,"3. ",t('migStep3')||'Import VM config (CPU, RAM, network) — ESXi power-state handled automatically'),/*#__PURE__*/React.createElement("div",null,"4. ",t('migStep4')||'Atomic cutover and start VM on Proxmox')),/*#__PURE__*/React.createElement("button",{onClick:()=>fetchMigrationPlan(vmwareSelectedVm),disabled:vmwareMigrateLoading,className:"w-full py-2.5 rounded-lg bg-emerald-500 text-white font-medium hover:bg-emerald-600 disabled:opacity-50 text-sm"},vmwareMigrateLoading?'Loading Migration Plan...':'Start Migration Wizard')),vmwareMigrations.length>0&&/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl p-4"},/*#__PURE__*/React.createElement("h3",{className:"text-sm font-semibold text-gray-400 uppercase mb-3"},"Active Migrations"),/*#__PURE__*/React.createElement("div",{className:"space-y-2"},vmwareMigrations.map(m=>/*#__PURE__*/React.createElement("div",{key:m.id,className:"p-3 bg-proxmox-dark rounded-lg"},/*#__PURE__*/React.createElement("div",{className:"flex items-center justify-between mb-2"},/*#__PURE__*/React.createElement("span",{className:"text-sm text-white font-medium"},m.vm_name||m.id),/*#__PURE__*/React.createElement("span",{className:`px-2 py-0.5 rounded text-xs font-medium ${m.status==='completed'?'bg-green-500/20 text-green-400':m.status==='failed'?'bg-red-500/20 text-red-400':m.status==='running'?'bg-blue-500/20 text-blue-400':'bg-gray-500/20 text-gray-400'}`},m.status)),m.progress!==undefined&&/*#__PURE__*/React.createElement("div",{className:"w-full h-1.5 bg-proxmox-dark rounded-full overflow-hidden"},/*#__PURE__*/React.createElement("div",{className:"h-full bg-emerald-400 rounded-full transition-all",style:{width:`${m.progress}%`}})),m.current_step&&/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500 mt-1"},m.current_step),m.phase==='awaiting_confirmation'&&/*#__PURE__*/React.createElement("div",{className:"mt-2 flex items-center gap-2"},/*#__PURE__*/React.createElement("span",{className:"text-xs text-amber-300 flex-1"},t('awaitingCutoverShort')||'Ready to switch over — source still running.'),/*#__PURE__*/React.createElement("button",{onClick:()=>confirmVmwareCutover(m.id),className:"px-2 py-1 rounded text-xs font-semibold bg-emerald-500/20 text-emerald-300 hover:bg-emerald-500/30 border border-emerald-500/40"},t('commitSwitchover')||'Commit switchover now'),/*#__PURE__*/React.createElement("button",{onClick:()=>cancelVmwareCutover(m.id),className:"px-2 py-1 rounded text-xs font-semibold bg-red-500/10 text-red-300 hover:bg-red-500/20 border border-red-500/30"},t('cancel')||'Cancel'))))))));})():/*#__PURE__*/React.createElement("div",{className:"text-center py-12 text-gray-500"},/*#__PURE__*/React.createElement(Icons.RefreshCw,{className:"w-6 h-6 mx-auto mb-2 animate-spin opacity-30"}),"Loading VM details..."),showVmwareClone&&/*#__PURE__*/React.createElement("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-50",onClick:()=>setShowVmwareClone(false)},/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-2xl p-6 w-full max-w-md",onClick:e=>e.stopPropagation()},/*#__PURE__*/React.createElement("h3",{className:"text-lg font-bold text-white mb-4"},t('cloneVm')),/*#__PURE__*/React.createElement("input",{value:vmwareCloneName,onChange:e=>setVmwareCloneName(e.target.value),placeholder:"Clone name...",className:"w-full px-4 py-2.5 bg-proxmox-dark border border-proxmox-border rounded-xl text-white mb-4 focus:outline-none focus:border-emerald-500/50"}),/*#__PURE__*/React.createElement("div",{className:"flex gap-2 justify-end"},/*#__PURE__*/React.createElement("button",{onClick:()=>setShowVmwareClone(false),className:"px-4 py-2 rounded-lg bg-proxmox-dark text-gray-400 text-sm"},t('cancel')),/*#__PURE__*/React.createElement("button",{onClick:()=>handleVmwareClone(vmwareSelectedVm,vmwareCloneName),disabled:!vmwareCloneName.trim(),className:"px-4 py-2 rounded-lg bg-emerald-500 text-white text-sm font-medium disabled:opacity-50"},t('clone'))))),showVmwareRename&&/*#__PURE__*/React.createElement("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-50",onClick:()=>setShowVmwareRename(false)},/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-2xl p-6 w-full max-w-md",onClick:e=>e.stopPropagation()},/*#__PURE__*/React.createElement("h3",{className:"text-lg font-bold text-white mb-4"},t('renameVm')),/*#__PURE__*/React.createElement("input",{value:vmwareRenameName,onChange:e=>setVmwareRenameName(e.target.value),placeholder:"New name...",className:"w-full px-4 py-2.5 bg-proxmox-dark border border-proxmox-border rounded-xl text-white mb-4 focus:outline-none focus:border-emerald-500/50"}),/*#__PURE__*/React.createElement("div",{className:"flex gap-2 justify-end"},/*#__PURE__*/React.createElement("button",{onClick:()=>setShowVmwareRename(false),className:"px-4 py-2 rounded-lg bg-proxmox-dark text-gray-400 text-sm"},t('cancel')),/*#__PURE__*/React.createElement("button",{onClick:()=>handleVmwareRename(vmwareSelectedVm,vmwareRenameName),disabled:!vmwareRenameName.trim(),className:"px-4 py-2 rounded-lg bg-blue-500 text-white text-sm font-medium disabled:opacity-50"},t('rename'))))),showVmwareDelete&&/*#__PURE__*/React.createElement("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-50",onClick:()=>setShowVmwareDelete(false)},/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-red-500/30 rounded-2xl p-6 w-full max-w-md",onClick:e=>e.stopPropagation()},/*#__PURE__*/React.createElement("h3",{className:"text-lg font-bold text-red-400 mb-2"},t('deleteVm')),/*#__PURE__*/React.createElement("p",{className:"text-gray-400 text-sm mb-4"},"Are you sure you want to permanently delete ",/*#__PURE__*/React.createElement("strong",{className:"text-white"},vmwareVmDetail?.name),"? This action cannot be undone."),/*#__PURE__*/React.createElement("div",{className:"flex gap-2 justify-end"},/*#__PURE__*/React.createElement("button",{onClick:()=>setShowVmwareDelete(false),className:"px-4 py-2 rounded-lg bg-proxmox-dark text-gray-400 text-sm"},t('cancel')),/*#__PURE__*/React.createElement("button",{onClick:()=>handleVmwareDeleteVm(vmwareSelectedVm),className:"px-4 py-2 rounded-lg bg-red-500 text-white text-sm font-medium"},t('deleteVm'))))),showVmwareMigrate&&vmwareMigrationPlan&&/*#__PURE__*/React.createElement("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-50",onClick:()=>setShowVmwareMigrate(false)},/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-emerald-500/30 rounded-2xl p-6 w-full max-w-2xl max-h-[85vh] overflow-y-auto",onClick:e=>e.stopPropagation()},/*#__PURE__*/React.createElement("h3",{className:"text-lg font-bold text-white mb-1"},t('migrateToProxmox')),/*#__PURE__*/React.createElement("p",{className:"text-xs text-gray-500 mb-3"},"Method: ",vmwareMigrationPlan.method||'HTTPS + Delta Sync'),/*#__PURE__*/React.createElement("div",{className:"flex gap-1 mb-4 border-b border-proxmox-border pb-2"},[{id:'target',label:t('target'),icon:'🎯'},{id:'hardware',label:t('hardware'),icon:'🔧'},{id:'advanced',label:t('advanced'),icon:'⚙️'}].map(tab=>/*#__PURE__*/React.createElement("button",{key:tab.id,onClick:()=>setMigrateWizardStep(tab.id),className:`px-3 py-1.5 rounded-lg text-xs font-medium transition-all ${migrateWizardStep===tab.id?'bg-emerald-500/20 text-emerald-400':'text-gray-500 hover:text-gray-300'}`},tab.icon," ",tab.label))),migrateWizardStep==='target'&&/*#__PURE__*/React.createElement("div",{className:"space-y-3"},/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"text-xs text-gray-500 mb-1 block"},t('targetCluster')),/*#__PURE__*/React.createElement("select",{value:vmwareMigrateForm.target_cluster,onChange:e=>{setVmwareMigrateForm({...vmwareMigrateForm,target_cluster:e.target.value,target_node:'',target_storage:''});},className:"w-full px-3 py-2 bg-proxmox-dark border border-proxmox-border rounded-lg text-white text-sm"},/*#__PURE__*/React.createElement("option",{value:""},"Select cluster..."),(vmwareMigrationPlan.targets||[]).map(t=>/*#__PURE__*/React.createElement("option",{key:t.cluster_id,value:t.cluster_id},t.cluster_name)))),vmwareMigrateForm.target_cluster&&/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"text-xs text-gray-500 mb-1 block"},t('targetNode')),/*#__PURE__*/React.createElement("select",{value:vmwareMigrateForm.target_node,onChange:e=>{setVmwareMigrateForm({...vmwareMigrateForm,target_node:e.target.value,target_storage:''});},className:"w-full px-3 py-2 bg-proxmox-dark border border-proxmox-border rounded-lg text-white text-sm"},/*#__PURE__*/React.createElement("option",{value:""},"Select node..."),((vmwareMigrationPlan.targets||[]).find(t=>t.cluster_id===vmwareMigrateForm.target_cluster)?.nodes||[]).map(n=>/*#__PURE__*/React.createElement("option",{key:n,value:n},n)))),vmwareMigrateForm.target_node&&/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"text-xs text-gray-500 mb-1 block"},t('targetStorage')),/*#__PURE__*/React.createElement("select",{value:vmwareMigrateForm.target_storage,onChange:e=>setVmwareMigrateForm({...vmwareMigrateForm,target_storage:e.target.value}),className:"w-full px-3 py-2 bg-proxmox-dark border border-proxmox-border rounded-lg text-white text-sm"},/*#__PURE__*/React.createElement("option",{value:""},"Select storage..."),((vmwareMigrationPlan.targets||[]).find(t=>t.cluster_id===vmwareMigrateForm.target_cluster)?.storages?.[vmwareMigrateForm.target_node]||[]).map(s=>/*#__PURE__*/React.createElement("option",{key:s,value:s},s)))),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"text-xs text-gray-500 mb-1 block"},"ESXi SSH User"),/*#__PURE__*/React.createElement("input",{value:vmwareMigrateForm.esxi_user,onChange:e=>setVmwareMigrateForm({...vmwareMigrateForm,esxi_user:e.target.value}),placeholder:"root",className:"w-full px-3 py-2 bg-proxmox-dark border border-proxmox-border rounded-lg text-white text-sm"})),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"text-xs text-gray-500 mb-1 block"},"ESXi Password (for SSH access)"),/*#__PURE__*/React.createElement("input",{type:"password",value:vmwareMigrateForm.esxi_password,onChange:e=>setVmwareMigrateForm({...vmwareMigrateForm,esxi_password:e.target.value}),placeholder:"ESXi password",className:"w-full px-3 py-2 bg-proxmox-dark border border-proxmox-border rounded-lg text-white text-sm"})),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"text-xs text-gray-500 mb-1 block"},"Network Bridge"),/*#__PURE__*/React.createElement("input",{value:vmwareMigrateForm.network_bridge,onChange:e=>setVmwareMigrateForm({...vmwareMigrateForm,network_bridge:e.target.value}),className:"w-full px-3 py-2 bg-proxmox-dark border border-proxmox-border rounded-lg text-white text-sm"})),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"text-xs text-gray-500 mb-1 block"},"VLAN Tag ",/*#__PURE__*/React.createElement("span",{className:"text-gray-600"},"(optional, 1-4094)")),/*#__PURE__*/React.createElement("input",{type:"number",min:"1",max:"4094",value:vmwareMigrateForm.net_vlan_tag,onChange:e=>setVmwareMigrateForm({...vmwareMigrateForm,net_vlan_tag:e.target.value}),placeholder:"none",className:"w-full px-3 py-2 bg-proxmox-dark border border-proxmox-border rounded-lg text-white text-sm"})),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"text-xs text-gray-500 mb-1 block"},"Firmware"),/*#__PURE__*/React.createElement("select",{value:vmwareMigrateForm.bios,onChange:e=>setVmwareMigrateForm({...vmwareMigrateForm,bios:e.target.value}),className:"w-full px-3 py-2 bg-proxmox-dark border border-proxmox-border rounded-lg text-white text-sm"},/*#__PURE__*/React.createElement("option",{value:"auto"},"Auto-detect (",vmwareMigrationPlan?.source?.hardware?.firmware||'bios',")"),/*#__PURE__*/React.createElement("option",{value:"seabios"},"Legacy BIOS (SeaBIOS)"),/*#__PURE__*/React.createElement("option",{value:"ovmf"},"UEFI (OVMF)"))),vmwareMigrationPlan?.source?.nics?.length>0&&/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"text-xs text-gray-500 mb-1 block"},t('networkInterfaces')," (",vmwareMigrationPlan.source.nics.length," detected)"),/*#__PURE__*/React.createElement("div",{className:"space-y-1 p-2 bg-proxmox-dark rounded-lg border border-proxmox-border max-h-32 overflow-y-auto"},vmwareMigrationPlan.source.nics.map((nic,i)=>/*#__PURE__*/React.createElement("div",{key:i,className:"flex items-center gap-2 text-xs text-gray-300 py-1"},/*#__PURE__*/React.createElement("span",{className:"text-green-400"},"\u25CF"),/*#__PURE__*/React.createElement("span",{className:"font-mono"},nic.pve_model||nic.type),/*#__PURE__*/React.createElement("span",{className:"text-gray-500"},"\u2014"),/*#__PURE__*/React.createElement("span",{className:"text-gray-400"},nic.network||'N/A'),nic.mac_address&&/*#__PURE__*/React.createElement("span",{className:"text-gray-600 font-mono ml-auto"},nic.mac_address)))),/*#__PURE__*/React.createElement("label",{className:"flex items-center gap-2 text-xs text-gray-400 mt-2"},/*#__PURE__*/React.createElement("input",{type:"checkbox",checked:vmwareMigrateForm.preserve_mac,onChange:e=>setVmwareMigrateForm({...vmwareMigrateForm,preserve_mac:e.target.checked}),className:"rounded"}),"Preserve MAC addresses")),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"text-xs text-gray-500 mb-1 block"},t('transferMode')||'Transfer Mode'),/*#__PURE__*/React.createElement("select",{value:vmwareMigrateForm.transfer_mode,onChange:e=>setVmwareMigrateForm({...vmwareMigrateForm,transfer_mode:e.target.value}),className:"w-full px-3 py-2 bg-proxmox-dark border border-proxmox-border rounded-lg text-white text-sm"},/*#__PURE__*/React.createElement("option",{value:"vmkfstools_clone"},t('transferModeVmkClone')||'Live Clone — Near-Zero Downtime (recommended)'),/*#__PURE__*/React.createElement("option",{value:"auto"},t('transferModeAuto')||'Auto (Pre-Sync + Delta)'),/*#__PURE__*/React.createElement("option",{value:"sshfs_boot"},t('transferModeSshfsBoot')||'Live Mirror — Near-Zero Downtime'),/*#__PURE__*/React.createElement("option",{value:"snapshot_zero"},t('transferModeSnapshotZero')||'Snapshot-Iterative — Zero Downtime (experimental)'),/*#__PURE__*/React.createElement("option",{value:"offline"},t('transferModeOffline')||'Offline Copy (Full Downtime)')),/*#__PURE__*/React.createElement("p",{className:"text-xs text-gray-300 mt-1 leading-relaxed"},vmwareMigrateForm.transfer_mode==='auto'&&(t('transferModeAutoDesc')||'Tries pre-sync while VM runs, falls back to live-mirror if VMDK is locked'),vmwareMigrateForm.transfer_mode==='sshfs_boot'&&(t('transferModeSshfsBootDesc')||'QEMU drive-mirror live-pivots disks from SSHFS-mounted source to local LVM. ~30s real downtime. Multi-disk capable. Recommended for most workloads — limit to 1-2 concurrent VMs to keep mirror throughput high.'),vmwareMigrateForm.transfer_mode==='vmkfstools_clone'&&(t('transferModeVmkCloneDesc')||'Snapshots the running VM and clones the frozen base disk at the vmkernel level on the ESXi host, then imports to Proxmox and cuts over. VM stays up until a short cutover. Works where Live-Mirror / Snapshot-Iterative fail (no locked-base-disk problem). Supports all Proxmox storage types (Ceph/RBD, LVM, LVM-Thin, dir). Needs ESXi SSH enabled.'),vmwareMigrateForm.transfer_mode==='snapshot_zero'&&(t('transferModeSnapshotZeroDesc')||'ESXi snapshot rotation — VM stays running through pre-sync + iterative delta sync, only ~10s downtime at cutover. ⚠️ May not work on your system (e.g. ESXi 6.x or VMFS6 with strict locking) — requires ESXi setup that releases base-VMDK lock after snapshot.'),vmwareMigrateForm.transfer_mode==='offline'&&(t('transferModeOfflineDesc')||'Stops ESXi VM, copies disks via SSH dd, then starts on Proxmox (full downtime ~ disk-size / network-speed)'))),/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-4"},/*#__PURE__*/React.createElement("label",{className:"flex items-center gap-2 text-sm text-gray-400"},/*#__PURE__*/React.createElement("input",{type:"checkbox",checked:vmwareMigrateForm.start_after,onChange:e=>setVmwareMigrateForm({...vmwareMigrateForm,start_after:e.target.checked}),className:"rounded"}),t('xhmStartAfter')),/*#__PURE__*/React.createElement("label",{className:"flex items-center gap-2 text-sm text-gray-400"},/*#__PURE__*/React.createElement("input",{type:"checkbox",checked:vmwareMigrateForm.remove_source,onChange:e=>setVmwareMigrateForm({...vmwareMigrateForm,remove_source:e.target.checked}),className:"rounded"}),"Remove source VM")),/*#__PURE__*/React.createElement("label",{className:"flex items-start gap-2 text-sm text-gray-400 bg-proxmox-dark/40 border border-proxmox-border rounded-lg p-3 cursor-pointer"},/*#__PURE__*/React.createElement("input",{type:"checkbox",checked:vmwareMigrateForm.wait_for_confirmation,onChange:e=>setVmwareMigrateForm({...vmwareMigrateForm,wait_for_confirmation:e.target.checked}),className:"rounded mt-0.5"}),/*#__PURE__*/React.createElement("span",null,/*#__PURE__*/React.createElement("span",{className:"text-gray-200"},t('waitForConfirmation')||'Wait for my confirmation before switchover'),/*#__PURE__*/React.createElement("span",{className:"block text-xs text-gray-500 mt-0.5"},t('waitForConfirmationDesc')||'The migration pauses right before the final cutover — with the source VM still running — and waits for you to commit the switchover, so you schedule the seconds of downtime yourself (drain monitoring, flip DNS, then commit). Most effective on the near-zero-downtime modes (vmkfstools-clone / auto / snapshot-zero).'))),vmwareMigrationPlan.requirements&&/*#__PURE__*/React.createElement("div",{className:"bg-yellow-500/5 border border-yellow-500/20 rounded-lg p-3"},/*#__PURE__*/React.createElement("div",{className:"text-xs text-yellow-400 font-semibold mb-1"},t('requirements'),":"),vmwareMigrationPlan.requirements.map((r,i)=>/*#__PURE__*/React.createElement("div",{key:i,className:"text-xs text-yellow-400/70"},"- ",r)))),migrateWizardStep==='hardware'&&/*#__PURE__*/React.createElement("div",{className:"space-y-3"},/*#__PURE__*/React.createElement("p",{className:"text-xs text-gray-500 mb-2"},"Auto-detected from ESXi. Override if needed."),/*#__PURE__*/React.createElement("div",{className:"grid grid-cols-2 gap-3"},/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"text-xs text-gray-500 mb-1 block"},"BIOS / Firmware"),/*#__PURE__*/React.createElement("select",{value:vmwareMigrateForm.bios,onChange:e=>setVmwareMigrateForm(f=>({...f,bios:e.target.value})),className:"w-full bg-proxmox-dark border border-proxmox-border rounded-lg px-3 py-2 text-sm text-white"},/*#__PURE__*/React.createElement("option",{value:"auto"},"Auto (",vmwareMigrationPlan.source?.hardware?.firmware||'bios',")"),/*#__PURE__*/React.createElement("option",{value:"seabios"},"SeaBIOS (Legacy)"),/*#__PURE__*/React.createElement("option",{value:"ovmf"},"OVMF (UEFI)"))),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"text-xs text-gray-500 mb-1 block"},t('osType')),/*#__PURE__*/React.createElement("select",{value:vmwareMigrateForm.ostype,onChange:e=>setVmwareMigrateForm(f=>({...f,ostype:e.target.value})),className:"w-full bg-proxmox-dark border border-proxmox-border rounded-lg px-3 py-2 text-sm text-white"},/*#__PURE__*/React.createElement("option",{value:"auto"},"Auto (",vmwareMigrationPlan.source?.guest_OS||'detect',")"),/*#__PURE__*/React.createElement("option",{value:"l26"},"Linux (2.6-6.x)"),/*#__PURE__*/React.createElement("option",{value:"win11"},"Windows 11/Server 2022+"),/*#__PURE__*/React.createElement("option",{value:"win10"},"Windows 10/Server 2016-2019"),/*#__PURE__*/React.createElement("option",{value:"win8"},"Windows 8/Server 2012"),/*#__PURE__*/React.createElement("option",{value:"win7"},"Windows 7/Server 2008 R2"),/*#__PURE__*/React.createElement("option",{value:"other"},t('other')))),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"text-xs text-gray-500 mb-1 block"},t('scsiController')),/*#__PURE__*/React.createElement("select",{value:vmwareMigrateForm.scsihw,onChange:e=>setVmwareMigrateForm(f=>({...f,scsihw:e.target.value})),className:"w-full bg-proxmox-dark border border-proxmox-border rounded-lg px-3 py-2 text-sm text-white"},/*#__PURE__*/React.createElement("option",{value:"auto"},"Auto (",vmwareMigrationPlan.source?.hardware?.scsi_controller||'detect',")"),/*#__PURE__*/React.createElement("option",{value:"virtio-scsi-single"},"VirtIO SCSI Single (recommended)"),/*#__PURE__*/React.createElement("option",{value:"virtio-scsi-pci"},"VirtIO SCSI"),/*#__PURE__*/React.createElement("option",{value:"lsi"},"LSI 53C895A"),/*#__PURE__*/React.createElement("option",{value:"pvscsi"},"VMware PVSCSI"),/*#__PURE__*/React.createElement("option",{value:"megasas"},"MegaRAID SAS"))),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"text-xs text-gray-500 mb-1 block"},"Disk Bus"),/*#__PURE__*/React.createElement("select",{value:vmwareMigrateForm.disk_bus,onChange:e=>setVmwareMigrateForm(f=>({...f,disk_bus:e.target.value})),className:"w-full bg-proxmox-dark border border-proxmox-border rounded-lg px-3 py-2 text-sm text-white"},/*#__PURE__*/React.createElement("option",{value:"auto"},"Auto (",vmwareMigrationPlan.source?.hardware?.disk_bus||'scsi',")"),/*#__PURE__*/React.createElement("option",{value:"scsi"},"SCSI"),/*#__PURE__*/React.createElement("option",{value:"sata"},"SATA"),/*#__PURE__*/React.createElement("option",{value:"ide"},"IDE"),/*#__PURE__*/React.createElement("option",{value:"virtio"},"VirtIO Block"))),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"text-xs text-gray-500 mb-1 block"},"VGA Display"),/*#__PURE__*/React.createElement("select",{value:vmwareMigrateForm.vga,onChange:e=>setVmwareMigrateForm(f=>({...f,vga:e.target.value})),className:"w-full bg-proxmox-dark border border-proxmox-border rounded-lg px-3 py-2 text-sm text-white"},/*#__PURE__*/React.createElement("option",{value:"vmware"},"VMware SVGA (recommended)"),/*#__PURE__*/React.createElement("option",{value:"std"},"Standard VGA"),/*#__PURE__*/React.createElement("option",{value:"virtio"},"VirtIO GPU"),/*#__PURE__*/React.createElement("option",{value:"virtio-gl"},"VirtIO-GPU (virgl)"),/*#__PURE__*/React.createElement("option",{value:"qxl"},"QXL (SPICE)"),/*#__PURE__*/React.createElement("option",{value:"qxl2"},"QXL 2 heads"),/*#__PURE__*/React.createElement("option",{value:"qxl3"},"QXL 3 heads"),/*#__PURE__*/React.createElement("option",{value:"qxl4"},"QXL 4 heads"),/*#__PURE__*/React.createElement("option",{value:"cirrus"},"Cirrus Logic"),/*#__PURE__*/React.createElement("option",{value:"serial0"},"Serial 0"),/*#__PURE__*/React.createElement("option",{value:"serial1"},"Serial 1"),/*#__PURE__*/React.createElement("option",{value:"serial2"},"Serial 2"),/*#__PURE__*/React.createElement("option",{value:"serial3"},"Serial 3"),/*#__PURE__*/React.createElement("option",{value:"none"},"None (headless)"))),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"text-xs text-gray-500 mb-1 block"},"Network Model"),/*#__PURE__*/React.createElement("select",{value:vmwareMigrateForm.net_driver,onChange:e=>setVmwareMigrateForm(f=>({...f,net_driver:e.target.value})),className:"w-full bg-proxmox-dark border border-proxmox-border rounded-lg px-3 py-2 text-sm text-white"},/*#__PURE__*/React.createElement("option",{value:"auto"},"Auto (",vmwareMigrationPlan.source?.hardware?.nic_type||'detect',")"),/*#__PURE__*/React.createElement("option",{value:"e1000"},"Intel E1000"),/*#__PURE__*/React.createElement("option",{value:"e1000e"},"Intel E1000e"),/*#__PURE__*/React.createElement("option",{value:"virtio"},"VirtIO (best perf)"),/*#__PURE__*/React.createElement("option",{value:"vmxnet3"},"VMware vmxnet3"))),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"text-xs text-gray-500 mb-1 block"},t('cpuSockets')),/*#__PURE__*/React.createElement("input",{type:"number",min:"1",max:"8",value:vmwareMigrateForm.sockets||vmwareMigrationPlan.source?.cpu?.sockets||1,onChange:e=>setVmwareMigrateForm(f=>({...f,sockets:parseInt(e.target.value)||1})),className:"w-full bg-proxmox-dark border border-proxmox-border rounded-lg px-3 py-2 text-sm text-white"})),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"text-xs text-gray-500 mb-1 block"},"Cores per Socket"),/*#__PURE__*/React.createElement("input",{type:"number",min:"1",max:"128",value:vmwareMigrateForm.cores_per_socket||vmwareMigrationPlan.source?.cpu?.cores_per_socket||1,onChange:e=>setVmwareMigrateForm(f=>({...f,cores_per_socket:parseInt(e.target.value)||1})),className:"w-full bg-proxmox-dark border border-proxmox-border rounded-lg px-3 py-2 text-sm text-white"})),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"text-xs text-gray-500 mb-1 block"},"Memory (MB)"),/*#__PURE__*/React.createElement("input",{type:"number",min:"128",value:vmwareMigrateForm.memory||vmwareMigrationPlan.source?.memory?.size_MiB||2048,onChange:e=>setVmwareMigrateForm(f=>({...f,memory:parseInt(e.target.value)||2048})),className:"w-full bg-proxmox-dark border border-proxmox-border rounded-lg px-3 py-2 text-sm text-white"})),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"text-xs text-gray-500 mb-1 block"},t('cpuType')),/*#__PURE__*/React.createElement("select",{value:vmwareMigrateForm.cpu_type,onChange:e=>setVmwareMigrateForm(f=>({...f,cpu_type:e.target.value})),className:"w-full bg-proxmox-dark border border-proxmox-border rounded-lg px-3 py-2 text-sm text-white"},/*#__PURE__*/React.createElement("option",{value:"host"},"host (match physical CPU)"),/*#__PURE__*/React.createElement("option",{value:"kvm64"},"kvm64 (safe default)"),/*#__PURE__*/React.createElement("option",{value:"x86-64-v2-AES"},"x86-64-v2-AES"),/*#__PURE__*/React.createElement("option",{value:"x86-64-v3"},"x86-64-v3"))))),migrateWizardStep==='advanced'&&/*#__PURE__*/React.createElement("div",{className:"space-y-3"},/*#__PURE__*/React.createElement("p",{className:"text-xs text-gray-500 mb-2"},"Fine-tune disk, security, and runtime options."),/*#__PURE__*/React.createElement("details",{className:"group"},/*#__PURE__*/React.createElement("summary",{className:"text-xs font-medium text-gray-400 cursor-pointer hover:text-gray-300 list-none flex items-center gap-1"},/*#__PURE__*/React.createElement("svg",{className:"w-3 h-3 transition-transform group-open:rotate-90",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},/*#__PURE__*/React.createElement("path",{d:"M9 18l6-6-6-6"})),"\uD83D\uDCBE ",t('diskOptions')),/*#__PURE__*/React.createElement("div",{className:"grid grid-cols-2 gap-3 mt-2 ml-4"},/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"text-xs text-gray-500 mb-1 block"},t('diskFormat')),/*#__PURE__*/React.createElement("select",{value:vmwareMigrateForm.disk_format,onChange:e=>setVmwareMigrateForm(f=>({...f,disk_format:e.target.value})),className:"w-full bg-proxmox-dark border border-proxmox-border rounded px-2 py-1.5 text-xs text-white"},/*#__PURE__*/React.createElement("option",{value:"raw"},"raw (best perf)"),/*#__PURE__*/React.createElement("option",{value:"qcow2"},"qcow2 (snapshots)"))),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"text-xs text-gray-500 mb-1 block"},t('cache')),/*#__PURE__*/React.createElement("select",{value:vmwareMigrateForm.disk_cache,onChange:e=>setVmwareMigrateForm(f=>({...f,disk_cache:e.target.value})),className:"w-full bg-proxmox-dark border border-proxmox-border rounded px-2 py-1.5 text-xs text-white"},/*#__PURE__*/React.createElement("option",{value:"none"},"none (recommended)"),/*#__PURE__*/React.createElement("option",{value:"writethrough"},"writethrough"),/*#__PURE__*/React.createElement("option",{value:"writeback"},"writeback"),/*#__PURE__*/React.createElement("option",{value:"directsync"},"directsync"))),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"text-xs text-gray-500 mb-1 block"},"AIO Mode"),/*#__PURE__*/React.createElement("select",{value:vmwareMigrateForm.aio_mode,onChange:e=>setVmwareMigrateForm(f=>({...f,aio_mode:e.target.value})),className:"w-full bg-proxmox-dark border border-proxmox-border rounded px-2 py-1.5 text-xs text-white"},/*#__PURE__*/React.createElement("option",{value:""},"default (io_uring)"),/*#__PURE__*/React.createElement("option",{value:"io_uring"},"io_uring"),/*#__PURE__*/React.createElement("option",{value:"native"},"native"),/*#__PURE__*/React.createElement("option",{value:"threads"},"threads")),/*#__PURE__*/React.createElement("p",{className:"text-[10px] text-gray-600 mt-1"},"native needs cache=none/directsync; io_uring needs a modern kernel. Leave default unless you know you need it.")),/*#__PURE__*/React.createElement("label",{className:"flex items-center gap-2 text-xs text-gray-400"},/*#__PURE__*/React.createElement("input",{type:"checkbox",checked:vmwareMigrateForm.disk_iothread,onChange:e=>setVmwareMigrateForm(f=>({...f,disk_iothread:e.target.checked})),className:"rounded"}),"IO Thread (per-disk)"),/*#__PURE__*/React.createElement("label",{className:"flex items-center gap-2 text-xs text-gray-400"},/*#__PURE__*/React.createElement("input",{type:"checkbox",checked:vmwareMigrateForm.disk_ssd,onChange:e=>setVmwareMigrateForm(f=>({...f,disk_ssd:e.target.checked})),className:"rounded"}),t('ssdEmulation')),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"text-xs text-gray-500 mb-1 block"},"Discard (TRIM)"),/*#__PURE__*/React.createElement("select",{value:vmwareMigrateForm.disk_discard,onChange:e=>setVmwareMigrateForm(f=>({...f,disk_discard:e.target.value})),className:"w-full bg-proxmox-dark border border-proxmox-border rounded px-2 py-1.5 text-xs text-white"},/*#__PURE__*/React.createElement("option",{value:"on"},"on"),/*#__PURE__*/React.createElement("option",{value:"ignore"},"ignore"))))),/*#__PURE__*/React.createElement("details",{className:"group"},/*#__PURE__*/React.createElement("summary",{className:"text-xs font-medium text-gray-400 cursor-pointer hover:text-gray-300 list-none flex items-center gap-1"},/*#__PURE__*/React.createElement("svg",{className:"w-3 h-3 transition-transform group-open:rotate-90",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},/*#__PURE__*/React.createElement("path",{d:"M9 18l6-6-6-6"})),"\uD83D\uDD12 Security"),/*#__PURE__*/React.createElement("div",{className:"grid grid-cols-2 gap-3 mt-2 ml-4"},/*#__PURE__*/React.createElement("label",{className:"flex items-center gap-2 text-xs text-gray-400"},/*#__PURE__*/React.createElement("input",{type:"checkbox",checked:vmwareMigrateForm.secure_boot??(vmwareMigrationPlan.source?.hardware?.secure_boot||false),onChange:e=>setVmwareMigrateForm(f=>({...f,secure_boot:e.target.checked})),className:"rounded"}),"EFI Secure Boot ",vmwareMigrationPlan.source?.hardware?.secure_boot?'(detected)':''),/*#__PURE__*/React.createElement("label",{className:"flex items-center gap-2 text-xs text-gray-400"},/*#__PURE__*/React.createElement("input",{type:"checkbox",checked:vmwareMigrateForm.tpm_enabled??(vmwareMigrationPlan.source?.hardware?.has_tpm||false),onChange:e=>setVmwareMigrateForm(f=>({...f,tpm_enabled:e.target.checked})),className:"rounded"}),"TPM ",vmwareMigrationPlan.source?.hardware?.has_tpm?'(detected)':''),/*#__PURE__*/React.createElement("label",{className:"flex items-center gap-2 text-xs text-gray-400"},/*#__PURE__*/React.createElement("input",{type:"checkbox",checked:vmwareMigrateForm.protection,onChange:e=>setVmwareMigrateForm(f=>({...f,protection:e.target.checked})),className:"rounded"}),"Delete Protection"))),/*#__PURE__*/React.createElement("details",{className:"group"},/*#__PURE__*/React.createElement("summary",{className:"text-xs font-medium text-gray-400 cursor-pointer hover:text-gray-300 list-none flex items-center gap-1"},/*#__PURE__*/React.createElement("svg",{className:"w-3 h-3 transition-transform group-open:rotate-90",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},/*#__PURE__*/React.createElement("path",{d:"M9 18l6-6-6-6"})),"\u26A1 Runtime"),/*#__PURE__*/React.createElement("div",{className:"grid grid-cols-2 gap-3 mt-2 ml-4"},/*#__PURE__*/React.createElement("label",{className:"flex items-center gap-2 text-xs text-gray-400"},/*#__PURE__*/React.createElement("input",{type:"checkbox",checked:vmwareMigrateForm.numa,onChange:e=>setVmwareMigrateForm(f=>({...f,numa:e.target.checked})),className:"rounded"}),"NUMA"),/*#__PURE__*/React.createElement("label",{className:"flex items-center gap-2 text-xs text-gray-400"},/*#__PURE__*/React.createElement("input",{type:"checkbox",checked:vmwareMigrateForm.agent,onChange:e=>setVmwareMigrateForm(f=>({...f,agent:e.target.checked})),className:"rounded"}),t('qemuGuestAgent')),/*#__PURE__*/React.createElement("label",{className:"flex items-center gap-2 text-xs text-gray-400"},/*#__PURE__*/React.createElement("input",{type:"checkbox",checked:vmwareMigrateForm.onboot,onChange:e=>setVmwareMigrateForm(f=>({...f,onboot:e.target.checked})),className:"rounded"}),t('startOnBoot')),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"text-xs text-gray-500 mb-1 block"},"Memory Balloon (MB, 0=off)"),/*#__PURE__*/React.createElement("input",{type:"number",min:"0",value:vmwareMigrateForm.balloon,onChange:e=>setVmwareMigrateForm(f=>({...f,balloon:parseInt(e.target.value)||0})),className:"w-full bg-proxmox-dark border border-proxmox-border rounded px-2 py-1.5 text-xs text-white"})))),/*#__PURE__*/React.createElement("details",{className:"group"},/*#__PURE__*/React.createElement("summary",{className:"text-xs font-medium text-gray-400 cursor-pointer hover:text-gray-300 list-none flex items-center gap-1"},/*#__PURE__*/React.createElement("svg",{className:"w-3 h-3 transition-transform group-open:rotate-90",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},/*#__PURE__*/React.createElement("path",{d:"M9 18l6-6-6-6"})),"\uD83C\uDFF7\uFE0F Metadata"),/*#__PURE__*/React.createElement("div",{className:"space-y-2 mt-2 ml-4"},/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"text-xs text-gray-500 mb-1 block"},t('tags')),/*#__PURE__*/React.createElement("input",{type:"text",value:vmwareMigrateForm.tags,onChange:e=>setVmwareMigrateForm(f=>({...f,tags:e.target.value})),placeholder:"e.g. migrated;production",className:"w-full bg-proxmox-dark border border-proxmox-border rounded px-2 py-1.5 text-xs text-white"})),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"text-xs text-gray-500 mb-1 block"},t('description')),/*#__PURE__*/React.createElement("textarea",{value:vmwareMigrateForm.description||vmwareMigrationPlan.source?.notes||'',onChange:e=>setVmwareMigrateForm(f=>({...f,description:e.target.value})),rows:"2",className:"w-full bg-proxmox-dark border border-proxmox-border rounded px-2 py-1.5 text-xs text-white resize-none"}))))),/*#__PURE__*/React.createElement("div",{className:"mt-3 p-3 rounded-lg border border-proxmox-border",style:{background:'rgba(30,30,40,0.4)'}},/*#__PURE__*/React.createElement("label",{className:"flex items-start gap-2 cursor-pointer"},/*#__PURE__*/React.createElement("input",{type:"checkbox",checked:!!vmwareMigrateForm.install_virtio_drivers,onChange:e=>setVmwareMigrateForm(f=>({...f,install_virtio_drivers:e.target.checked})),className:"rounded mt-0.5"}),/*#__PURE__*/React.createElement("div",{className:"flex-1 min-w-0"},/*#__PURE__*/React.createElement("span",{className:"text-sm text-gray-200"},t('installVirtioDrivers')||'Pre-stage VirtIO drivers (Windows)'),/*#__PURE__*/React.createElement("p",{className:"text-xs text-gray-400 mt-1 leading-snug"},t('installVirtioDriversDesc')||'Stages virtio-win-gt-x64.msi onto the disk and installs the full driver stack (storage, network, balloon, qemu-ga) silently as LocalSystem at first boot. Best-effort fallback when the source VM doesn\'t have the drivers yet. Requires virtio-win.iso on the target node.'))),/*#__PURE__*/React.createElement("div",{className:"mt-3 p-3 rounded border border-amber-500/50",style:{background:'rgba(234,179,8,0.10)'}},/*#__PURE__*/React.createElement("div",{className:"flex items-start gap-2"},/*#__PURE__*/React.createElement("span",{className:"text-amber-300 text-base leading-none mt-0.5"},"\u26A0"),/*#__PURE__*/React.createElement("div",{className:"flex-1 min-w-0"},/*#__PURE__*/React.createElement("p",{className:"text-xs text-amber-200 font-semibold mb-1"},t('virtioPreInstallWarnTitle')||'Treiber besser VOR der Migration installieren'),/*#__PURE__*/React.createElement("p",{className:"text-xs text-amber-100/90 leading-snug"},t('virtioPreInstallWarnBody')||'Lade virtio-win.iso in der laufenden Quell-VM auf VMware, mounte sie als CD und führe virtio-win-guest-tools.exe aus — dann migriere. Unsere Inject-Variante ist Best-Effort: Windows 11 / Server 2025 binden vioscsi im Early-Boot nicht zuverlässig (Proxmox/QEMU-Limitation), Boot-Disk muss dann auf pvscsi bleiben. VMs die vor Migration die Treiber installiert haben, lassen sich danach problemlos auf virtio-scsi umstellen.')))),vmwareMigrateForm.install_virtio_drivers&&/*#__PURE__*/React.createElement("div",{className:"mt-2 pl-6"},/*#__PURE__*/React.createElement("label",{className:"text-xs text-gray-500 mb-1 block"},t('virtioIsoPath')||'virtio-win.iso path on node'),/*#__PURE__*/React.createElement("input",{type:"text",value:vmwareMigrateForm.virtio_iso_path,onChange:e=>setVmwareMigrateForm(f=>({...f,virtio_iso_path:e.target.value})),placeholder:"/var/lib/vz/template/iso/virtio-win.iso (default)",className:"w-full px-2 py-1 bg-proxmox-dark border border-proxmox-border rounded text-white text-xs"})),vmwareMigrateForm.install_virtio_drivers&&vmwareMigrateForm.transfer_mode==='sshfs_boot'&&/*#__PURE__*/React.createElement("div",{className:"mt-2 pl-6 p-2 rounded border border-yellow-500/40",style:{background:'rgba(234,179,8,0.07)'}},/*#__PURE__*/React.createElement("p",{className:"text-xs text-yellow-300 leading-snug"},"\u26A0 ",t('virtioSshfsBootWarn')||'Live-mirror mode boots the VM before disks are settled — offline driver injection would corrupt the running NTFS. Pre-staging is skipped here. Use offline / auto / snapshot_zero for pre-stage, or install drivers post-boot from the mounted virtio-win.iso.'))),/*#__PURE__*/React.createElement("div",{className:"mt-4 p-3 rounded-lg border border-proxmox-border",style:{background:'rgba(99, 110, 250, 0.06)'}},/*#__PURE__*/React.createElement("div",{className:"flex items-start gap-3"},/*#__PURE__*/React.createElement("a",{href:"https://opencollective.com/pegaprox",target:"_blank",rel:"noopener noreferrer",className:"shrink-0"},/*#__PURE__*/React.createElement("img",{src:"/images/oc_contribute_button.png",alt:"Open Collective",className:"h-8 w-auto opacity-90 hover:opacity-100 transition-opacity"})),/*#__PURE__*/React.createElement("div",{className:"flex-1 min-w-0"},/*#__PURE__*/React.createElement("p",{className:"text-xs text-gray-300 leading-snug"},t('v2pSupportNote')||'Nur mit eurer Unterstützung können wir diese Funktion kostenlos halten.'),/*#__PURE__*/React.createElement("label",{className:"flex items-center gap-2 mt-2 text-xs text-gray-400 cursor-pointer"},/*#__PURE__*/React.createElement("input",{type:"checkbox",checked:!!vmwareMigrateForm.oc_acknowledge,onChange:e=>setVmwareMigrateForm(f=>({...f,oc_acknowledge:e.target.checked})),className:"rounded"}),/*#__PURE__*/React.createElement("span",null,t('v2pSupportAck')||'Verstanden — ich behalte das im Hinterkopf.'))))),/*#__PURE__*/React.createElement("div",{className:"flex gap-2 justify-end mt-4"},/*#__PURE__*/React.createElement("button",{onClick:()=>setShowVmwareMigrate(false),className:"px-4 py-2 rounded-lg bg-proxmox-dark text-gray-400 text-sm"},t('cancel')),/*#__PURE__*/React.createElement("button",{onClick:()=>startVmwareMigration(vmwareSelectedVm),disabled:!vmwareMigrateForm.target_cluster||!vmwareMigrateForm.target_node||!vmwareMigrateForm.target_storage||!vmwareMigrateForm.esxi_password||!vmwareMigrateForm.oc_acknowledge||vmwareMigrateLoading,title:!vmwareMigrateForm.oc_acknowledge?t('v2pSupportAckRequired')||'Bitte den Hinweis kurz bestätigen':'',className:"px-4 py-2 rounded-lg bg-emerald-500 text-white text-sm font-medium disabled:opacity-50"},vmwareMigrateLoading?t('starting'):t('xhmStartMigration')))))),vmwareActiveTab==='hosts'&&/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl overflow-hidden"},/*#__PURE__*/React.createElement("table",{className:"w-full"},/*#__PURE__*/React.createElement("thead",null,/*#__PURE__*/React.createElement("tr",{className:"border-b border-proxmox-border"},/*#__PURE__*/React.createElement("th",{className:"text-left p-3 text-xs font-semibold text-gray-500 uppercase"},t('status')),/*#__PURE__*/React.createElement("th",{className:"text-left p-3 text-xs font-semibold text-gray-500 uppercase"},t('name')),/*#__PURE__*/React.createElement("th",{className:"text-left p-3 text-xs font-semibold text-gray-500 uppercase"},t('model')),/*#__PURE__*/React.createElement("th",{className:"text-left p-3 text-xs font-semibold text-gray-500 uppercase"},"CPUs"),/*#__PURE__*/React.createElement("th",{className:"text-left p-3 text-xs font-semibold text-gray-500 uppercase"},"Memory"),/*#__PURE__*/React.createElement("th",{className:"text-left p-3 text-xs font-semibold text-gray-500 uppercase"},t('vms')))),/*#__PURE__*/React.createElement("tbody",null,vmwareHosts.map(host=>/*#__PURE__*/React.createElement("tr",{key:host.host_id||host.name,className:"border-b border-proxmox-border/50 hover:bg-proxmox-hover/50"},/*#__PURE__*/React.createElement("td",{className:"p-3"},/*#__PURE__*/React.createElement("div",{className:`w-3 h-3 rounded-full ${host.connection_state==='CONNECTED'||host.connection_state==='connected'?'bg-green-400':'bg-red-400'}`})),/*#__PURE__*/React.createElement("td",{className:"p-3 text-white text-sm font-medium"},host.name),/*#__PURE__*/React.createElement("td",{className:"p-3 text-gray-400 text-sm"},host.model||'-'),/*#__PURE__*/React.createElement("td",{className:"p-3 text-gray-400 text-sm"},/*#__PURE__*/React.createElement("div",null,host.cpu_cores||host.num_cpu_cores||'-'," cores"),host.cpu_usage!==undefined&&/*#__PURE__*/React.createElement("div",{className:"w-20 h-1.5 bg-proxmox-dark rounded-full mt-1 overflow-hidden"},/*#__PURE__*/React.createElement("div",{className:`h-full rounded-full ${host.cpu_usage>80?'bg-red-400':host.cpu_usage>60?'bg-yellow-400':'bg-emerald-400'}`,style:{width:`${Math.min(100,host.cpu_usage||0)}%`}}))),/*#__PURE__*/React.createElement("td",{className:"p-3 text-gray-400 text-sm"},/*#__PURE__*/React.createElement("div",null,host.memory_gb?`${host.memory_gb} GB`:host.memory_bytes?`${(host.memory_bytes/(1024*1024*1024)).toFixed(0)} GB`:'-'),host.memory_usage_pct!==undefined&&/*#__PURE__*/React.createElement("div",{className:"w-20 h-1.5 bg-proxmox-dark rounded-full mt-1 overflow-hidden"},/*#__PURE__*/React.createElement("div",{className:`h-full rounded-full ${host.memory_usage_pct>80?'bg-red-400':host.memory_usage_pct>60?'bg-yellow-400':'bg-purple-400'}`,style:{width:`${Math.min(100,host.memory_usage_pct||0)}%`}}))),/*#__PURE__*/React.createElement("td",{className:"p-3 text-gray-400 text-sm"},host.vm_count||'-'))))),vmwareHosts.length===0&&/*#__PURE__*/React.createElement("div",{className:"text-center py-8 text-gray-500"},"No hosts found")),vmwareActiveTab==='datastores'&&!vmwareSelectedDs&&/*#__PURE__*/React.createElement("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4"},vmwareDatastores.map(ds=>{const capGB=ds.capacity?(ds.capacity/(1024*1024*1024)).toFixed(1):ds.capacity_gb||0;const freeGB=ds.free_space?(ds.free_space/(1024*1024*1024)).toFixed(1):ds.free_gb||0;const usedGB=capGB&&freeGB?(capGB-freeGB).toFixed(1):0;const pct=ds.capacity&&ds.free_space?((1-ds.free_space/ds.capacity)*100).toFixed(0):null;return/*#__PURE__*/React.createElement("div",{key:ds.datastore_id||ds.datastore||ds.name,onClick:()=>setVmwareSelectedDs(ds),className:"bg-proxmox-card border border-proxmox-border rounded-xl p-4 hover:border-emerald-500/30 cursor-pointer transition-all group"},/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-3 mb-3"},/*#__PURE__*/React.createElement("div",{className:"w-10 h-10 rounded-xl bg-blue-500/10 border border-blue-500/20 flex items-center justify-center"},/*#__PURE__*/React.createElement(Icons.Database,{className:"w-5 h-5 text-blue-400"})),/*#__PURE__*/React.createElement("div",{className:"flex-1 min-w-0"},/*#__PURE__*/React.createElement("div",{className:"text-sm font-semibold text-white truncate group-hover:text-emerald-400 transition-colors"},ds.name),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500"},ds.type||'VMFS'))),pct!==null&&/*#__PURE__*/React.createElement("div",{className:"mb-2"},/*#__PURE__*/React.createElement("div",{className:"h-2 bg-proxmox-dark rounded-full overflow-hidden"},/*#__PURE__*/React.createElement("div",{className:`h-full rounded-full ${parseInt(pct)>85?'bg-red-400':parseInt(pct)>65?'bg-yellow-400':'bg-emerald-400'}`,style:{width:`${pct}%`}})),/*#__PURE__*/React.createElement("div",{className:"flex justify-between text-xs text-gray-500 mt-1"},/*#__PURE__*/React.createElement("span",null,usedGB," GB used"),/*#__PURE__*/React.createElement("span",null,freeGB," GB free / ",capGB," GB"))));}),vmwareDatastores.length===0&&/*#__PURE__*/React.createElement("div",{className:"col-span-3 text-center py-12 text-gray-500"},"No datastores found")),vmwareActiveTab==='datastores'&&vmwareSelectedDs&&(()=>{const ds=vmwareSelectedDs;const detail=vmwareDsDetail||{};const capGB=ds.capacity||detail.capacity?((ds.capacity||detail.capacity)/(1024*1024*1024)).toFixed(1):ds.capacity_gb||0;const freeGB=ds.free_space||detail.free_space?((ds.free_space||detail.free_space)/(1024*1024*1024)).toFixed(1):ds.free_gb||0;const usedGB=capGB&&freeGB?(capGB-freeGB).toFixed(1):0;const pct=(ds.capacity||detail.capacity)&&(ds.free_space||detail.free_space)?((1-(ds.free_space||detail.free_space)/(ds.capacity||detail.capacity))*100).toFixed(0):0;// Use server-side VMs if available, else client-side filter +const dsVms=detail.vms&&detail.vms.length>0?detail.vms:vmwareVms.filter(v=>{const vmDs=(v.datastore||'').toLowerCase();return vmDs.includes((ds.name||'').toLowerCase());});const dsHosts=detail.hosts||[];return/*#__PURE__*/React.createElement("div",{className:"space-y-4"},/*#__PURE__*/React.createElement("button",{onClick:()=>{setVmwareSelectedDs(null);setVmwareDsDetail(null);},className:"flex items-center gap-2 text-gray-400 hover:text-white text-sm"},/*#__PURE__*/React.createElement("span",{style:{display:"inline-block",transform:"rotate(180deg)"}},/*#__PURE__*/React.createElement(Icons.ChevronRight,{className:"w-4 h-4"}))," Back to Datastores"),/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl p-5"},/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-4 mb-4"},/*#__PURE__*/React.createElement("div",{className:"w-14 h-14 rounded-xl bg-blue-500/10 border border-blue-500/30 flex items-center justify-center"},/*#__PURE__*/React.createElement(Icons.Database,{className:"w-7 h-7 text-blue-400"})),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("h2",{className:"text-xl font-bold text-white"},ds.name),/*#__PURE__*/React.createElement("div",{className:"text-sm text-gray-500"},ds.type||detail.type||'VMFS'," \u2022 ",capGB," GB total",detail.multiple_host_access?' • Shared':''))),/*#__PURE__*/React.createElement("div",{className:"mb-4"},/*#__PURE__*/React.createElement("div",{className:"h-4 bg-proxmox-dark rounded-full overflow-hidden"},/*#__PURE__*/React.createElement("div",{className:`h-full rounded-full ${parseInt(pct)>85?'bg-red-400':parseInt(pct)>65?'bg-yellow-400':'bg-emerald-400'}`,style:{width:`${pct}%`}})),/*#__PURE__*/React.createElement("div",{className:"flex justify-between mt-1 text-sm"},/*#__PURE__*/React.createElement("span",{className:"text-gray-400"},usedGB," GB used (",pct,"%)"),/*#__PURE__*/React.createElement("span",{className:"text-emerald-400"},freeGB," GB free"))),/*#__PURE__*/React.createElement("div",{className:"grid grid-cols-4 gap-3"},[['Capacity',capGB,'text-white'],['Used',usedGB,'text-white'],['Free',freeGB,'text-emerald-400'],['VMs',dsVms.length,'text-white']].map(([l,v,c])=>/*#__PURE__*/React.createElement("div",{key:l,className:"bg-proxmox-dark rounded-lg p-3 text-center"},/*#__PURE__*/React.createElement("div",{className:`text-lg font-bold ${c}`},v),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500"},l==='VMs'?l:`GB ${l}`))))),dsHosts.length>0&&/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl overflow-hidden"},/*#__PURE__*/React.createElement("div",{className:"p-4 border-b border-proxmox-border"},/*#__PURE__*/React.createElement("h3",{className:"text-sm font-semibold text-gray-400 uppercase"},"Connected Hosts (",dsHosts.length,")")),/*#__PURE__*/React.createElement("div",{className:"divide-y divide-proxmox-border/50"},dsHosts.map(h=>/*#__PURE__*/React.createElement("div",{key:h.host||h.name,className:"px-4 py-2.5 flex items-center gap-3"},/*#__PURE__*/React.createElement("div",{className:"w-2 h-2 rounded-full bg-green-400"}),/*#__PURE__*/React.createElement("span",{className:"text-sm text-white"},h.name))))),/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl overflow-hidden"},/*#__PURE__*/React.createElement("div",{className:"p-4 border-b border-proxmox-border"},/*#__PURE__*/React.createElement("h3",{className:"text-sm font-semibold text-gray-400 uppercase"},"VMs on ",ds.name," (",dsVms.length,")")),dsVms.length>0?/*#__PURE__*/React.createElement("table",{className:"w-full"},/*#__PURE__*/React.createElement("thead",null,/*#__PURE__*/React.createElement("tr",{className:"border-b border-proxmox-border"},/*#__PURE__*/React.createElement("th",{className:"text-left p-3 text-xs font-semibold text-gray-500 uppercase"},t('status')),/*#__PURE__*/React.createElement("th",{className:"text-left p-3 text-xs font-semibold text-gray-500 uppercase"},t('name')),/*#__PURE__*/React.createElement("th",{className:"text-left p-3 text-xs font-semibold text-gray-500 uppercase"},"OS"))),/*#__PURE__*/React.createElement("tbody",null,dsVms.map(vm=>/*#__PURE__*/React.createElement("tr",{key:vm.vm||vm.vm_id||vm.name,className:"border-b border-proxmox-border/50 hover:bg-proxmox-hover/50 cursor-pointer",onClick:()=>{setVmwareActiveTab('vms');setVmwareSelectedVm(vm.vm||vm.vm_id);setVmwareSelectedDs(null);}},/*#__PURE__*/React.createElement("td",{className:"p-3"},/*#__PURE__*/React.createElement("div",{className:`w-3 h-3 rounded-full ${vm.power_state==='POWERED_ON'?'bg-green-400':'bg-gray-500'}`})),/*#__PURE__*/React.createElement("td",{className:"p-3 text-white text-sm font-medium"},vm.name),/*#__PURE__*/React.createElement("td",{className:"p-3 text-gray-400 text-sm"},(vm.guest_OS||vm.guest_os||'-').substring(0,25)))))):/*#__PURE__*/React.createElement("div",{className:"p-8 text-center text-gray-500 text-sm"},"No VMs on this datastore")));})(),vmwareActiveTab==='networks'&&/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl overflow-hidden"},/*#__PURE__*/React.createElement("table",{className:"w-full"},/*#__PURE__*/React.createElement("thead",null,/*#__PURE__*/React.createElement("tr",{className:"border-b border-proxmox-border"},/*#__PURE__*/React.createElement("th",{className:"text-left p-3 text-xs font-semibold text-gray-500 uppercase"},t('name')),/*#__PURE__*/React.createElement("th",{className:"text-left p-3 text-xs font-semibold text-gray-500 uppercase"},t('type')),/*#__PURE__*/React.createElement("th",{className:"text-left p-3 text-xs font-semibold text-gray-500 uppercase"},"VLAN"))),/*#__PURE__*/React.createElement("tbody",null,vmwareNetworks.map(net=>/*#__PURE__*/React.createElement("tr",{key:net.network_id||net.name,className:"border-b border-proxmox-border/50 hover:bg-proxmox-hover/50"},/*#__PURE__*/React.createElement("td",{className:"p-3 text-white text-sm font-medium"},net.name),/*#__PURE__*/React.createElement("td",{className:"p-3 text-gray-400 text-sm"},net.type||'Standard'),/*#__PURE__*/React.createElement("td",{className:"p-3 text-gray-400 text-sm"},net.vlan_id||'-'))))),vmwareNetworks.length===0&&/*#__PURE__*/React.createElement("div",{className:"text-center py-8 text-gray-500"},"No networks found")),vmwareActiveTab==='clusters'&&/*#__PURE__*/React.createElement("div",{className:"space-y-4"},vmwareClusters.length===0?/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl p-8 text-center text-gray-500"},/*#__PURE__*/React.createElement(Icons.Layers,{className:"w-12 h-12 mx-auto mb-3 opacity-30"}),/*#__PURE__*/React.createElement("p",null,"No compute clusters found"),/*#__PURE__*/React.createElement("p",{className:"text-xs mt-1"},"Clusters are only available on connected management servers (not on standalone hosts)")):vmwareClusters.map(cl=>/*#__PURE__*/React.createElement("div",{key:cl.cluster||cl.name,className:"bg-proxmox-card border border-proxmox-border rounded-xl overflow-hidden"},/*#__PURE__*/React.createElement("div",{className:"p-4 border-b border-proxmox-border"},/*#__PURE__*/React.createElement("div",{className:"flex items-center justify-between"},/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-3"},/*#__PURE__*/React.createElement("div",{className:"w-10 h-10 rounded-lg bg-purple-500/20 flex items-center justify-center"},/*#__PURE__*/React.createElement(Icons.Layers,{className:"w-5 h-5 text-purple-400"})),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("h3",{className:"text-white font-semibold"},cl.name),/*#__PURE__*/React.createElement("p",{className:"text-xs text-gray-500"},cl.num_hosts||0," Hosts \u2022 ",cl.cluster))),/*#__PURE__*/React.createElement("button",{onClick:()=>fetchVMwareClusters(selectedVMware.id),className:"text-gray-500 hover:text-white"},/*#__PURE__*/React.createElement(Icons.RefreshCw,{className:"w-4 h-4"})))),/*#__PURE__*/React.createElement("div",{className:"grid grid-cols-3 gap-4 p-4 border-b border-proxmox-border/50"},/*#__PURE__*/React.createElement("div",{className:"text-center"},/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500"},t('cpu')),/*#__PURE__*/React.createElement("div",{className:"text-sm text-white font-medium"},cl.total_cpu?(cl.total_cpu/1000).toFixed(1)+' GHz':'N/A')),/*#__PURE__*/React.createElement("div",{className:"text-center"},/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500"},"Memory"),/*#__PURE__*/React.createElement("div",{className:"text-sm text-white font-medium"},cl.total_memory?(cl.total_memory/1024**3).toFixed(0)+' GB':'N/A')),/*#__PURE__*/React.createElement("div",{className:"text-center"},/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500"},"Hosts"),/*#__PURE__*/React.createElement("div",{className:"text-sm text-white font-medium"},cl.num_hosts||0))),/*#__PURE__*/React.createElement("div",{className:"p-4 space-y-4"},/*#__PURE__*/React.createElement("div",{className:"flex items-center justify-between p-3 rounded-lg bg-proxmox-dark/50"},/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-3"},/*#__PURE__*/React.createElement("div",{className:`w-8 h-8 rounded-lg flex items-center justify-center ${cl.drs_enabled?'bg-blue-500/20':'bg-gray-800'}`},/*#__PURE__*/React.createElement(Icons.RotateCw,{className:`w-4 h-4 ${cl.drs_enabled?'text-blue-400':'text-gray-600'}`})),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("div",{className:"text-sm text-white font-medium"},"DRS (Distributed Resource Scheduler)"),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500"},cl.drs_enabled?`Active - ${(cl.drs_automation||'MANUAL').replace(/_/g,' ').toLowerCase()}`:'Disabled'))),/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-2"},cl.drs_enabled&&/*#__PURE__*/React.createElement("select",{value:cl.drs_automation||'MANUAL',onChange:e=>toggleVMwareDRS(selectedVMware.id,cl.cluster,true,e.target.value),className:"bg-proxmox-card border border-proxmox-border rounded px-2 py-1 text-xs text-gray-300"},/*#__PURE__*/React.createElement("option",{value:"FULLY_AUTOMATED"},"Fully Automated"),/*#__PURE__*/React.createElement("option",{value:"PARTIALLY_AUTOMATED"},"Partially Automated"),/*#__PURE__*/React.createElement("option",{value:"MANUAL"},t('manual'))),/*#__PURE__*/React.createElement("button",{onClick:()=>toggleVMwareDRS(selectedVMware.id,cl.cluster,!cl.drs_enabled),className:`px-3 py-1.5 rounded-lg text-xs font-medium transition-colors ${cl.drs_enabled?'bg-red-500/20 text-red-400 hover:bg-red-500/30':'bg-blue-500/20 text-blue-400 hover:bg-blue-500/30'}`},cl.drs_enabled?'Disable':'Enable'))),/*#__PURE__*/React.createElement("div",{className:"flex items-center justify-between p-3 rounded-lg bg-proxmox-dark/50"},/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-3"},/*#__PURE__*/React.createElement("div",{className:`w-8 h-8 rounded-lg flex items-center justify-center ${cl.ha_enabled?'bg-green-500/20':'bg-gray-800'}`},/*#__PURE__*/React.createElement(Icons.Shield,{className:`w-4 h-4 ${cl.ha_enabled?'text-green-400':'text-gray-600'}`})),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("div",{className:"text-sm text-white font-medium"},"HA (High Availability)"),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500"},cl.ha_enabled?`Active${cl.ha_admission_control?' - Admission Control enabled':''}`:'Disabled'))),/*#__PURE__*/React.createElement("button",{onClick:()=>toggleVMwareHA(selectedVMware.id,cl.cluster,!cl.ha_enabled),className:`px-3 py-1.5 rounded-lg text-xs font-medium transition-colors ${cl.ha_enabled?'bg-red-500/20 text-red-400 hover:bg-red-500/30':'bg-green-500/20 text-green-400 hover:bg-green-500/30'}`},cl.ha_enabled?'Disable':'Enable')),cl.hosts&&cl.hosts.length>0&&/*#__PURE__*/React.createElement("div",{className:"mt-2"},/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500 mb-2 font-semibold uppercase"},"Cluster Hosts"),/*#__PURE__*/React.createElement("div",{className:"space-y-1"},cl.hosts.map(h=>/*#__PURE__*/React.createElement("div",{key:h.host||h.name,className:"flex items-center justify-between py-1.5 px-2 rounded bg-proxmox-dark/30"},/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-2"},/*#__PURE__*/React.createElement("div",{className:`w-2 h-2 rounded-full ${h.connection_state==='CONNECTED'?'bg-green-400':'bg-red-400'}`}),/*#__PURE__*/React.createElement("span",{className:"text-sm text-gray-300"},h.name)),/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-2"},h.maintenance&&/*#__PURE__*/React.createElement("span",{className:"text-xs bg-yellow-500/20 text-yellow-400 px-1.5 py-0.5 rounded"},t('maintenance')),/*#__PURE__*/React.createElement("span",{className:"text-xs text-gray-500"},h.connection_state)))))))))),vmwareActiveTab==='tasks'&&/*#__PURE__*/React.createElement("div",{className:"space-y-4"},/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl overflow-hidden"},/*#__PURE__*/React.createElement("div",{className:"p-4 border-b border-proxmox-border flex items-center justify-between"},/*#__PURE__*/React.createElement("h3",{className:"text-sm font-semibold text-gray-400 uppercase flex items-center gap-2"},/*#__PURE__*/React.createElement(Icons.FolderInput,{className:"w-4 h-4 text-emerald-400"})," Migrations (",vmwareMigrations.length,")"),/*#__PURE__*/React.createElement("button",{onClick:fetchVmwareMigrations,className:"text-xs text-gray-500 hover:text-white"},/*#__PURE__*/React.createElement(Icons.RefreshCw,{className:"w-3.5 h-3.5"}))),vmwareMigrations.length>0?/*#__PURE__*/React.createElement("div",{className:"divide-y divide-proxmox-border/50"},vmwareMigrations.map(m=>{const isActive=m.status==='running';const isAwaiting=m.phase==='awaiting_confirmation';// #562 +const phaseLabel={planning:'Planning',pre_sync:'Pre-Sync',delta_sync:'Delta Sync',awaiting_confirmation:t('phaseAwaitingConfirmation')||'Awaiting Confirmation',cutover:'Cutover',verify:'Verify',cleanup:'Cleanup',completed:'Done',failed:'Failed',cancelled:t('phaseCancelled')||'Cancelled'};return/*#__PURE__*/React.createElement("div",{key:m.id,className:`p-4 hover:bg-proxmox-hover/30 cursor-pointer ${vmwareSelectedMigration===m.id?'bg-emerald-500/5 border-l-2 border-l-emerald-400':''}`,onClick:()=>setVmwareSelectedMigration(vmwareSelectedMigration===m.id?null:m.id)},/*#__PURE__*/React.createElement("div",{className:"flex items-center justify-between mb-2"},/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-3"},/*#__PURE__*/React.createElement("div",{className:`w-2.5 h-2.5 rounded-full ${isAwaiting?'bg-amber-400 animate-pulse':isActive?'bg-blue-400 animate-pulse':m.status==='completed'?'bg-green-400':m.status==='failed'?'bg-red-400':'bg-gray-500'}`}),/*#__PURE__*/React.createElement("span",{className:"text-sm font-medium text-white"},m.vm_name||m.vm_id),/*#__PURE__*/React.createElement("span",{className:`text-xs px-1.5 py-0.5 rounded ${isAwaiting?'bg-amber-500/20 text-amber-300':'bg-proxmox-dark text-gray-400'}`},phaseLabel[m.phase]||m.phase)),/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-3"},m.total_downtime_seconds!=null&&/*#__PURE__*/React.createElement("span",{className:"text-xs text-gray-500"},"Downtime: ",m.total_downtime_seconds,"s"),/*#__PURE__*/React.createElement("span",{className:`px-2 py-0.5 rounded text-xs font-semibold ${m.status==='completed'?'bg-green-500/20 text-green-400':m.status==='failed'?'bg-red-500/20 text-red-400':m.status==='cancelled'?'bg-gray-500/20 text-gray-400':'bg-blue-500/20 text-blue-400'}`},m.status))),/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-3 mb-1"},/*#__PURE__*/React.createElement("div",{className:"flex-1 h-1.5 bg-proxmox-dark rounded-full overflow-hidden"},/*#__PURE__*/React.createElement("div",{className:`h-full rounded-full transition-all duration-500 ${m.status==='failed'?'bg-red-400':m.status==='completed'?'bg-green-400':'bg-emerald-400'}`,style:{width:`${m.progress||0}%`}})),/*#__PURE__*/React.createElement("span",{className:"text-xs text-gray-500 w-8 text-right"},m.progress||0,"%")),/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-4 text-xs text-gray-600"},/*#__PURE__*/React.createElement("span",null,"\u2192 ",m.target_node,"/",m.target_storage),m.started_at&&/*#__PURE__*/React.createElement("span",null,fmtDate(m.started_at)),m.proxmox_vmid&&/*#__PURE__*/React.createElement("span",null,"PVE: ",m.proxmox_vmid)),m.phase_times&&Object.keys(m.phase_times).length>1&&/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-0.5 mt-2"},['planning','pre_sync','delta_sync','cutover','verify','cleanup','completed'].map((ph,idx)=>{const pt=m.phase_times[ph];const isCur=m.phase===ph;const isDone=pt&&pt.end;return/*#__PURE__*/React.createElement(React.Fragment,{key:ph},idx>0&&/*#__PURE__*/React.createElement("div",{className:`flex-1 h-px ${isDone?'bg-emerald-500':isCur?'bg-emerald-500/40':'bg-proxmox-border'}`}),/*#__PURE__*/React.createElement("div",{title:`${ph}${pt?.duration?` (${pt.duration}s)`:''}`,className:`w-5 h-5 rounded-full flex items-center justify-center text-[8px] font-bold border ${isDone?'bg-emerald-500/20 border-emerald-500 text-emerald-400':isCur?'bg-blue-500/20 border-blue-400 text-blue-400 animate-pulse':'bg-proxmox-dark border-proxmox-border text-gray-600'}`},isDone?'✓':idx+1));})),isAwaiting&&/*#__PURE__*/React.createElement("div",{className:"mt-3 p-3 rounded-lg bg-amber-500/10 border border-amber-500/30",onClick:e=>e.stopPropagation()},/*#__PURE__*/React.createElement("div",{className:"flex items-start gap-2 text-xs text-amber-300 mb-2"},/*#__PURE__*/React.createElement(Icons.AlertTriangle,{className:"w-3.5 h-3.5 mt-0.5 flex-shrink-0"}),/*#__PURE__*/React.createElement("span",null,t('awaitingCutoverBanner')||'Disks are staged and the source VM is still running. Commit the switchover when you are ready to take the brief downtime.')),/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-2"},/*#__PURE__*/React.createElement("button",{onClick:()=>confirmVmwareCutover(m.id),className:"px-3 py-1.5 rounded-lg text-xs font-semibold bg-emerald-500/20 text-emerald-300 hover:bg-emerald-500/30 border border-emerald-500/40"},t('commitSwitchover')||'Commit switchover now'),/*#__PURE__*/React.createElement("button",{onClick:()=>cancelVmwareCutover(m.id),className:"px-3 py-1.5 rounded-lg text-xs font-semibold bg-red-500/10 text-red-300 hover:bg-red-500/20 border border-red-500/30"},t('cancelMigration')||'Cancel migration'))));})):/*#__PURE__*/React.createElement("div",{className:"p-8 text-center text-gray-600 text-sm"},"No migrations yet. Start one from a VM's Migration tab.")),vmwareSelectedMigration&&vmwareMigrationDetail&&/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl overflow-hidden"},/*#__PURE__*/React.createElement("div",{className:"p-4 border-b border-proxmox-border flex items-center justify-between"},/*#__PURE__*/React.createElement("h3",{className:"text-sm font-semibold text-white"},"Migration Log - ",vmwareMigrationDetail.vm_name," ",/*#__PURE__*/React.createElement("span",{className:"text-gray-500 font-normal"},"(",vmwareSelectedMigration,")")),/*#__PURE__*/React.createElement("button",{onClick:()=>setVmwareSelectedMigration(null),className:"text-xs text-gray-500 hover:text-white px-2 py-1 rounded bg-proxmox-dark"},t('close'))),vmwareMigrationDetail.disk_progress&&Object.keys(vmwareMigrationDetail.disk_progress).length>0&&/*#__PURE__*/React.createElement("div",{className:"p-4 border-b border-proxmox-border/50 space-y-2"},/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500 uppercase font-semibold"},"Disk Transfer"),Object.entries(vmwareMigrationDetail.disk_progress).map(([key,dp])=>/*#__PURE__*/React.createElement("div",{key:key},/*#__PURE__*/React.createElement("div",{className:"flex justify-between text-xs text-gray-400 mb-0.5"},/*#__PURE__*/React.createElement("span",null,key),/*#__PURE__*/React.createElement("span",null,dp.pct,"% - ",(dp.copied/(1024*1024*1024)).toFixed(1),"/",(dp.total/(1024*1024*1024)).toFixed(1)," GB")),/*#__PURE__*/React.createElement("div",{className:"h-2 bg-proxmox-dark rounded-full overflow-hidden"},/*#__PURE__*/React.createElement("div",{className:"h-full bg-emerald-400 rounded-full transition-all",style:{width:`${dp.pct}%`}}))))),/*#__PURE__*/React.createElement("div",{className:"p-3 bg-black/30 max-h-60 overflow-y-auto font-mono text-xs leading-relaxed"},(vmwareMigrationDetail.log||[]).map((line,i)=>/*#__PURE__*/React.createElement("div",{key:i,className:line.includes('FAIL')||line.includes('ERROR')?'text-red-400':line.includes('Phase:')?'text-emerald-400 font-bold':line.includes('===')?'text-blue-400':'text-gray-500'},line))),vmwareMigrationDetail.error&&/*#__PURE__*/React.createElement("div",{className:"p-3 bg-red-500/10 border-t border-red-500/20 text-red-400 text-xs"},t('error'),": ",vmwareMigrationDetail.error),vmwareMigrationDetail.status==='completed'&&/*#__PURE__*/React.createElement("div",{className:"p-3 bg-green-500/10 border-t border-green-500/20 text-green-400 text-xs"},"\u2713 Completed! VMID: ",vmwareMigrationDetail.proxmox_vmid,vmwareMigrationDetail.total_downtime_seconds?` - Downtime: ${vmwareMigrationDetail.total_downtime_seconds}s`:'')),/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl overflow-hidden"},/*#__PURE__*/React.createElement("div",{className:"p-4 border-b border-proxmox-border flex items-center justify-between"},/*#__PURE__*/React.createElement("h3",{className:"text-sm font-semibold text-gray-400 uppercase flex items-center gap-2"},/*#__PURE__*/React.createElement(Icons.FileText,{className:"w-4 h-4 text-blue-400"})," Recent ESXi Events"),/*#__PURE__*/React.createElement("button",{onClick:fetchVmwareEvents,disabled:vmwareEventsLoading,className:"text-xs text-gray-500 hover:text-white"},/*#__PURE__*/React.createElement(Icons.RefreshCw,{className:`w-3.5 h-3.5 ${vmwareEventsLoading?'animate-spin':''}`}))),vmwareEvents.filter(e=>(e.action||'').includes('vmware')).length>0?/*#__PURE__*/React.createElement("div",{className:"divide-y divide-proxmox-border/50 max-h-96 overflow-y-auto"},vmwareEvents.filter(e=>(e.action||'').includes('vmware')).slice(0,50).map((evt,i)=>{const a=evt.action||'';const iconMap={start:'▶',stop:'■',reset:'↻',suspend:'⏸',cloned:'⧉',deleted:'×',renamed:'✎','snapshot.created':'📸','snapshot.deleted':'🗑','migration.started':'→',added:'+',updated:'↑'};const colorMap={start:'text-green-400',stop:'text-red-400',reset:'text-yellow-400',suspend:'text-blue-400',cloned:'text-cyan-400',deleted:'text-red-400',renamed:'text-blue-400','snapshot.created':'text-purple-400','snapshot.deleted':'text-orange-400','migration.started':'text-emerald-400'};const actionKey=Object.keys(iconMap).find(k=>a.includes(k))||'';const icon=iconMap[actionKey]||'•';const color=colorMap[actionKey]||'text-gray-400';const label=a.split('.').pop()||a;return/*#__PURE__*/React.createElement("div",{key:i,className:"px-4 py-2.5 hover:bg-proxmox-hover/30 flex items-start gap-3"},/*#__PURE__*/React.createElement("span",{className:`text-sm leading-none mt-0.5 ${color}`},icon),/*#__PURE__*/React.createElement("div",{className:"flex-1 min-w-0"},/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-2"},/*#__PURE__*/React.createElement("span",{className:`text-xs font-semibold ${color}`},label),/*#__PURE__*/React.createElement("span",{className:"text-xs text-gray-600"},evt.user||'system')),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500 truncate"},evt.details||'-')),/*#__PURE__*/React.createElement("span",{className:"text-xs text-gray-600 whitespace-nowrap"},evt.timestamp?fmtDate(evt.timestamp):''));})):/*#__PURE__*/React.createElement("div",{className:"p-8 text-center text-gray-600 text-sm"},vmwareEventsLoading?'Loading...':'No ESXi events in audit log')))):selectedGroup?/*#__PURE__*/// LW: Feb 2026 - folder overlay for group React.createElement(GroupOverview,{group:selectedGroup,clusters:clusters,allMetrics:allClusterMetrics,clusterGroups:clusterGroups,topGuests:topGuests,onSelectCluster:cluster=>{setSelectedGroup(null);setSelectedCluster(cluster);},onSelectVm:(cluster,vmid,node,guest)=>{setSelectedGroup(null);setSelectedCluster(cluster);setSelectedSidebarVm({...(guest||{vmid,node,type:'qemu'}),_clusterId:cluster.id});setSelectedSidebarNode(null);setActiveTab('resources');setResourcesSubTab('management');},onOpenSettings:()=>setShowGroupSettings(selectedGroup),authFetch:authFetch,API_URL:API_URL}):sidebarTopology?/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("div",{className:"corp-content-header"},/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-2"},/*#__PURE__*/React.createElement(Icons.Network,{className:"w-4 h-4",style:{color:'var(--corp-accent)'}}),/*#__PURE__*/React.createElement("span",{className:"corp-header-title"},t('topologyView')||'Topology'))),/*#__PURE__*/React.createElement("div",{className:"p-2"},/*#__PURE__*/React.createElement(TopologyView,{clusterName:"PegaProx",multiCluster:clusters.filter(c=>c.connected).map(cluster=>{const metrics=sidebarClusterData[cluster.id]?.metrics||{};let nodes=Object.entries(metrics).filter(([k])=>k!=='error'&&k!=='offline').map(([name,m])=>({name,...m}));const resources=sidebarClusterData[cluster.id]?.resources||allClusterGuests[cluster.id]||[];// LW May 2026: the topology often opens before sidebarClusterData // finishes loading, so we'd render synthetic "node-1, node-2" // placeholders that don't match the VM `r.node` foreign key → @@ -7654,7 +7654,7 @@

PBS Encryption Key — Recovery Sheet

const cid=xhmForm.source_cluster;const metrics=cid===selectedCluster?.id?clusterMetrics:sidebarClusterData[cid]?.metrics||{};let nodeNames=Object.keys(metrics).filter(k=>k!=='error'&&k!=='offline');if(nodeNames.length===0){// fallback: extract from resources const nodes=new Set();xhmSourceVms.forEach(v=>{if(v.node)nodes.add(v.node);});nodeNames=[...nodes];}if(nodeNames.length===0)return[/*#__PURE__*/React.createElement("option",{key:"_loading",value:"",disabled:true},"Loading nodes...")];return nodeNames.map(n=>/*#__PURE__*/React.createElement("option",{key:n,value:n},n));})())),xhmForm.source_cluster&&/*#__PURE__*/React.createElement("div",{className:"mb-3"},/*#__PURE__*/React.createElement("label",{className:"text-xs text-gray-500 mb-1 block"},t('xhmSourceVm')||'Source VM'),/*#__PURE__*/React.createElement("select",{value:xhmForm.source_vmid,onChange:e=>{const vmid=e.target.value;const vm=xhmSourceVms.find(v=>String(v.vmid)===vmid);const node=vm?.node||xhmForm.source_node;setXhmForm({...xhmForm,source_vmid:vmid,source_node:node||xhmForm.source_node});setXhmPlan(null);},className:"w-full px-3 py-2 bg-proxmox-dark border border-proxmox-border rounded-lg text-white text-sm"},/*#__PURE__*/React.createElement("option",{value:""},"Select VM..."),xhmSourceVms.filter(v=>v.status==='stopped'||v.power_state==='Halted').map(v=>/*#__PURE__*/React.createElement("option",{key:v.vmid,value:v.vmid},v.name||`VM ${v.vmid}`," (ID: ",v.vmid,")"))),xhmSourceVms.length>0&&xhmSourceVms.filter(v=>v.status==='stopped'||v.power_state==='Halted').length===0&&/*#__PURE__*/React.createElement("div",{className:"text-xs text-amber-400 mt-1"},"No stopped VMs found. VMs must be stopped for cross-hypervisor migration.")),/*#__PURE__*/React.createElement("button",{onClick:fetchXhmPlan,disabled:xhmLoading||!xhmForm.source_cluster||!xhmForm.source_vmid||!xhmForm.target_cluster||!(clusters.find(c=>c.id===xhmForm.source_cluster)?.type==='xcpng'||clusters.find(c=>c.id===xhmForm.source_cluster)?.cluster_type==='xcpng')&&!xhmForm.source_node,className:"w-full py-2.5 rounded-lg bg-purple-500 text-white font-medium hover:bg-purple-600 disabled:opacity-50 text-sm mb-4"},xhmLoading?'Analyzing...':t('xhmAnalyze')||'Analyze VM'),xhmPlan&&xhmPlan.source&&/*#__PURE__*/React.createElement("div",{className:"border border-purple-500/20 rounded-xl p-4 space-y-4"},/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-2 text-sm text-white font-medium"},/*#__PURE__*/React.createElement("span",null,xhmPlan.source.name),/*#__PURE__*/React.createElement("span",{className:"text-purple-400"},xhmPlan.direction==='xcpng_to_pve'?'→ Proxmox':'→ XCP-ng')),/*#__PURE__*/React.createElement("div",{className:"grid grid-cols-4 gap-2 text-center"},/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-dark rounded-lg p-2"},/*#__PURE__*/React.createElement("div",{className:"text-sm font-bold text-white"},xhmPlan.source.vcpus),/*#__PURE__*/React.createElement("div",{className:"text-[10px] text-gray-500"},"vCPUs")),/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-dark rounded-lg p-2"},/*#__PURE__*/React.createElement("div",{className:"text-sm font-bold text-white"},xhmPlan.source.memory_mb," MB"),/*#__PURE__*/React.createElement("div",{className:"text-[10px] text-gray-500"},"RAM")),/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-dark rounded-lg p-2"},/*#__PURE__*/React.createElement("div",{className:"text-sm font-bold text-white"},(xhmPlan.source.disks||[]).length),/*#__PURE__*/React.createElement("div",{className:"text-[10px] text-gray-500"},"Disks")),/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-dark rounded-lg p-2"},/*#__PURE__*/React.createElement("div",{className:"text-sm font-bold text-purple-400"},xhmPlan.estimated_seconds?`~${Math.ceil(xhmPlan.estimated_seconds/60)} min`:'?'),/*#__PURE__*/React.createElement("div",{className:"text-[10px] text-gray-500"},t('xhmEstTransferTime')||'Est. Time'))),/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500"},/*#__PURE__*/React.createElement("div",{className:"font-semibold text-gray-400 mb-1"},"Disks:"),(xhmPlan.source.disks||[]).map((d,i)=>/*#__PURE__*/React.createElement("div",{key:i},d.name||d.key||`disk-${i}`,": ",d.size_gb||(d.size/(1024*1024*1024)).toFixed(1)," GB"))),xhmPlan.direction==='xcpng_to_pve'&&xhmPlan.targets&&/*#__PURE__*/React.createElement("div",{className:"space-y-2"},/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"text-xs text-gray-500 mb-1 block"},t('xhmTargetNode')||'Target Node'),/*#__PURE__*/React.createElement("select",{value:xhmForm.target_node,onChange:e=>setXhmForm({...xhmForm,target_node:e.target.value,target_storage:''}),className:"w-full px-3 py-2 bg-proxmox-dark border border-proxmox-border rounded-lg text-white text-sm"},/*#__PURE__*/React.createElement("option",{value:""},"Select node..."),(xhmPlan.targets[0]?.nodes||[]).map(n=>/*#__PURE__*/React.createElement("option",{key:n,value:n},n)))),xhmForm.target_node&&/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"text-xs text-gray-500 mb-1 block"},t('xhmTargetStorage')||'Target Storage'),/*#__PURE__*/React.createElement("select",{value:xhmForm.target_storage,onChange:e=>setXhmForm({...xhmForm,target_storage:e.target.value}),className:"w-full px-3 py-2 bg-proxmox-dark border border-proxmox-border rounded-lg text-white text-sm"},/*#__PURE__*/React.createElement("option",{value:""},"Select storage..."),(xhmPlan.targets[0]?.storages?.[xhmForm.target_node]||[]).map(s=>/*#__PURE__*/React.createElement("option",{key:s,value:s},s))))),xhmPlan.direction==='pve_to_xcpng'&&xhmPlan.targets&&/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"text-xs text-gray-500 mb-1 block"},t('xhmTargetStorage')||'Target Storage'),/*#__PURE__*/React.createElement("select",{value:xhmForm.target_storage,onChange:e=>setXhmForm({...xhmForm,target_storage:e.target.value}),className:"w-full px-3 py-2 bg-proxmox-dark border border-proxmox-border rounded-lg text-white text-sm"},/*#__PURE__*/React.createElement("option",{value:""},"Select SR..."),(xhmPlan.targets[0]?.storages||[]).map(s=>/*#__PURE__*/React.createElement("option",{key:s.uuid||s.name,value:s.name},s.name," (",s.type,", ",((s.avail||0)/(1024*1024*1024)).toFixed(0)," GB free)")))),(xhmPlan.source.networks||[]).length>0&&/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("div",{className:"text-xs font-semibold text-gray-400 mb-2"},t('xhmNetworkMapping')||'Network Mapping'),xhmPlan.source.networks.map((net,i)=>/*#__PURE__*/React.createElement("div",{key:i,className:"flex items-center gap-2 mb-1"},/*#__PURE__*/React.createElement("span",{className:"text-xs text-gray-400 w-28 truncate"},net.bridge||net.network||`net${i}`),/*#__PURE__*/React.createElement("span",{className:"text-gray-600"},"\u2192"),xhmPlan.direction==='xcpng_to_pve'?/*#__PURE__*/React.createElement("select",{value:xhmForm.network_map[net.network||net.bridge||String(i)]||'',onChange:e=>setXhmForm({...xhmForm,network_map:{...xhmForm.network_map,[net.network||net.bridge||String(i)]:e.target.value}}),className:"flex-1 px-2 py-1 bg-proxmox-dark border border-proxmox-border rounded text-white text-xs"},/*#__PURE__*/React.createElement("option",{value:""},"vmbr0 (default)"),(xhmPlan.targets[0]?.bridges?.[xhmForm.target_node]||['vmbr0']).map(b=>/*#__PURE__*/React.createElement("option",{key:b,value:b},b))):/*#__PURE__*/React.createElement("select",{value:xhmForm.network_map[net.bridge||String(i)]||'',onChange:e=>setXhmForm({...xhmForm,network_map:{...xhmForm.network_map,[net.bridge||String(i)]:e.target.value}}),className:"flex-1 px-2 py-1 bg-proxmox-dark border border-proxmox-border rounded text-white text-xs"},/*#__PURE__*/React.createElement("option",{value:""},"Select network..."),(xhmPlan.targets[0]?.networks||[]).map(n=>/*#__PURE__*/React.createElement("option",{key:n.uuid||n.name,value:n.name},n.name," (",n.bridge,")")))))),/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-4 text-xs"},/*#__PURE__*/React.createElement("label",{className:"flex items-center gap-1.5 text-gray-400 cursor-pointer"},/*#__PURE__*/React.createElement("input",{type:"checkbox",checked:xhmForm.start_after,onChange:e=>setXhmForm({...xhmForm,start_after:e.target.checked}),className:"rounded border-gray-600"}),t('xhmStartAfter')||'Start VM after migration'),/*#__PURE__*/React.createElement("label",{className:"flex items-center gap-1.5 text-gray-400 cursor-pointer"},/*#__PURE__*/React.createElement("input",{type:"checkbox",checked:xhmForm.remove_source,onChange:e=>setXhmForm({...xhmForm,remove_source:e.target.checked}),className:"rounded border-gray-600"}),t('xhmRemoveSource')||'Remove source VM')),/*#__PURE__*/React.createElement("button",{onClick:startXhmMigration,disabled:xhmLoading||!xhmForm.target_storage||xhmPlan?.direction==='xcpng_to_pve'&&!xhmForm.target_node,className:"w-full py-2.5 rounded-lg bg-purple-500 text-white font-medium hover:bg-purple-600 disabled:opacity-50 text-sm"},xhmLoading?'Starting...':t('xhmStartMigration')||'Start Migration'))),/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl overflow-hidden"},/*#__PURE__*/React.createElement("div",{className:"p-4 border-b border-proxmox-border flex items-center justify-between"},/*#__PURE__*/React.createElement("h3",{className:"text-sm font-semibold text-gray-400 uppercase flex items-center gap-2"},/*#__PURE__*/React.createElement(Icons.FolderInput,{className:"w-4 h-4 text-purple-400"})," Migrations (",xhmMigrations.length,")"),/*#__PURE__*/React.createElement("button",{onClick:fetchXhmMigrations,className:"text-xs text-gray-500 hover:text-white"},/*#__PURE__*/React.createElement(Icons.RefreshCw,{className:"w-3.5 h-3.5"}))),xhmMigrations.length>0?/*#__PURE__*/React.createElement("div",{className:"divide-y divide-proxmox-border/50"},xhmMigrations.map(m=>{const isActive=m.status==='running';const phases=['planning','transfer','creating','attaching','completed'];const phaseLabel={planning:'Planning',transfer:'Transfer',creating:'Creating',attaching:'Attaching',completed:'Done',failed:'Failed'};const dirLabel=m.direction==='xcpng_to_pve'?'XCP→PVE':'PVE→XCP';return/*#__PURE__*/React.createElement("div",{key:m.id,className:`p-4 hover:bg-proxmox-hover/30 cursor-pointer ${xhmSelectedMigration===m.id?'bg-purple-500/5 border-l-2 border-l-purple-400':''}`,onClick:()=>setXhmSelectedMigration(xhmSelectedMigration===m.id?null:m.id)},/*#__PURE__*/React.createElement("div",{className:"flex items-center justify-between mb-2"},/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-3"},/*#__PURE__*/React.createElement("div",{className:`w-2.5 h-2.5 rounded-full ${isActive?'bg-purple-400 animate-pulse':m.status==='completed'?'bg-green-400':m.status==='failed'?'bg-red-400':'bg-gray-500'}`}),/*#__PURE__*/React.createElement("span",{className:"text-sm font-medium text-white"},m.vm_name||m.source_vmid),/*#__PURE__*/React.createElement("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-purple-500/20 text-purple-300 font-medium"},dirLabel),/*#__PURE__*/React.createElement("span",{className:"text-xs px-1.5 py-0.5 rounded bg-proxmox-dark text-gray-400"},phaseLabel[m.phase]||m.phase)),/*#__PURE__*/React.createElement("span",{className:`px-2 py-0.5 rounded text-xs font-semibold ${m.status==='completed'?'bg-green-500/20 text-green-400':m.status==='failed'?'bg-red-500/20 text-red-400':'bg-purple-500/20 text-purple-400'}`},m.status)),/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-3 mb-1"},/*#__PURE__*/React.createElement("div",{className:"flex-1 h-1.5 bg-proxmox-dark rounded-full overflow-hidden"},/*#__PURE__*/React.createElement("div",{className:`h-full rounded-full transition-all duration-500 ${m.status==='failed'?'bg-red-400':m.status==='completed'?'bg-green-400':'bg-purple-400'}`,style:{width:`${m.progress||0}%`}})),/*#__PURE__*/React.createElement("span",{className:"text-xs text-gray-500 w-8 text-right"},m.progress||0,"%")),/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-4 text-xs text-gray-600"},/*#__PURE__*/React.createElement("span",null,"\u2192 ",m.target_node,"/",m.target_storage),m.started_at&&/*#__PURE__*/React.createElement("span",null,fmtDate(m.started_at)),m.target_vmid&&/*#__PURE__*/React.createElement("span",null,"VMID: ",m.target_vmid)),m.phase_times&&Object.keys(m.phase_times).length>0&&/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-0.5 mt-2"},phases.map((ph,idx)=>{const pt=m.phase_times[ph];const isCur=m.phase===ph;const isDone=pt&&pt.end;return/*#__PURE__*/React.createElement(React.Fragment,{key:ph},idx>0&&/*#__PURE__*/React.createElement("div",{className:`flex-1 h-px ${isDone?'bg-purple-500':isCur?'bg-purple-500/40':'bg-proxmox-border'}`}),/*#__PURE__*/React.createElement("div",{title:`${ph}${pt?.duration?` (${pt.duration}s)`:''}`,className:`w-5 h-5 rounded-full flex items-center justify-center text-[8px] font-bold border ${isDone?'bg-purple-500/20 border-purple-500 text-purple-400':isCur?'bg-purple-500/20 border-purple-400 text-purple-400 animate-pulse':'bg-proxmox-dark border-proxmox-border text-gray-600'}`},isDone?'✓':idx+1));})));})):/*#__PURE__*/React.createElement("div",{className:"p-8 text-center text-gray-600 text-sm"},t('xhmNoMigrations')||'No migrations yet.')),xhmSelectedMigration&&xhmMigrationDetail&&/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl overflow-hidden"},/*#__PURE__*/React.createElement("div",{className:"p-4 border-b border-proxmox-border flex items-center justify-between"},/*#__PURE__*/React.createElement("h3",{className:"text-sm font-semibold text-white"},"Migration Log - ",xhmMigrationDetail.vm_name," ",/*#__PURE__*/React.createElement("span",{className:"text-gray-500 font-normal"},"(",xhmSelectedMigration,")")),/*#__PURE__*/React.createElement("button",{onClick:()=>setXhmSelectedMigration(null),className:"text-xs text-gray-500 hover:text-white px-2 py-1 rounded bg-proxmox-dark"},"Close")),xhmMigrationDetail.disk_progress&&Object.keys(xhmMigrationDetail.disk_progress).length>0&&/*#__PURE__*/React.createElement("div",{className:"p-4 border-b border-proxmox-border/50 space-y-2"},/*#__PURE__*/React.createElement("div",{className:"text-xs text-gray-500 uppercase font-semibold"},"Disk Transfer"),Object.entries(xhmMigrationDetail.disk_progress).map(([key,dp])=>/*#__PURE__*/React.createElement("div",{key:key},/*#__PURE__*/React.createElement("div",{className:"flex justify-between text-xs text-gray-400 mb-0.5"},/*#__PURE__*/React.createElement("span",null,key),/*#__PURE__*/React.createElement("span",null,dp.pct,"% - ",(dp.copied/(1024*1024*1024)).toFixed(1),"/",(dp.total/(1024*1024*1024)).toFixed(1)," GB")),/*#__PURE__*/React.createElement("div",{className:"h-2 bg-proxmox-dark rounded-full overflow-hidden"},/*#__PURE__*/React.createElement("div",{className:"h-full bg-purple-400 rounded-full transition-all",style:{width:`${dp.pct}%`}}))))),/*#__PURE__*/React.createElement("div",{className:"p-3 bg-black/30 max-h-60 overflow-y-auto font-mono text-xs leading-relaxed"},(xhmMigrationDetail.log||[]).map((line,i)=>/*#__PURE__*/React.createElement("div",{key:i,className:line.includes('FAIL')||line.includes('ERROR')?'text-red-400':line.includes('Phase:')?'text-purple-400 font-bold':line.includes('===')?'text-blue-400':'text-gray-500'},line))),xhmMigrationDetail.error&&/*#__PURE__*/React.createElement("div",{className:"p-3 bg-red-500/10 border-t border-red-500/20 text-red-400 text-xs"},"Error: ",xhmMigrationDetail.error),xhmMigrationDetail.status==='completed'&&/*#__PURE__*/React.createElement("div",{className:"p-3 bg-green-500/10 border-t border-green-500/20 text-green-400 text-xs"},"Migration complete! Target: ",xhmMigrationDetail.target_vmid)))):sidebarMultiSdn?/*#__PURE__*//* #612 — Multi-Cluster EVPN fullscreen route */React.createElement("div",{className:isCorporate?'':'space-y-4'},isCorporate&&/*#__PURE__*/React.createElement("div",{className:"corp-content-header"},/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-2"},/*#__PURE__*/React.createElement(Icons.Network,{className:"w-4 h-4",style:{color:'var(--corp-accent)'}}),/*#__PURE__*/React.createElement("span",{className:"corp-header-title"},t('mcevpnTitle')||'Multi-Cluster EVPN'))),/*#__PURE__*/React.createElement(MultiClusterEvpnView,{clusters:clusters,authFetch:authFetch,API_URL:API_URL,addToast:addToast,canAdminSettings:isAdmin||Array.isArray(user?.permissions)&&user.permissions.includes('admin.settings'),canManage:isAdmin||Array.isArray(user?.permissions)&&user.permissions.includes('sdn.manage')&&user.permissions.includes('admin.settings')})):/*#__PURE__*/React.createElement(AllClustersOverview,{clusters:clusters,allMetrics:allClusterMetrics,clusterGroups:clusterGroups,topGuests:topGuests,allClusterGuests:allClusterGuests,pbsServers:pbsServers,onSelectCluster:setSelectedCluster,onSelectVm:(cluster,vmid,node,guest)=>{setSelectedCluster(cluster);setSelectedSidebarVm({...(guest||{vmid,node,type:'qemu'}),_clusterId:cluster.id});setSelectedSidebarNode(null);setActiveTab('resources');setResourcesSubTab('management');}})))),showAddPBS&&/*#__PURE__*/React.createElement("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/70 backdrop-blur-sm"},/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-2xl shadow-2xl w-full max-w-lg animate-scale-in max-h-[90vh] overflow-y-auto"},/*#__PURE__*/React.createElement("div",{className:"p-6"},/*#__PURE__*/React.createElement("h2",{className:"text-xl font-bold text-white mb-4"},editingPBS?'Edit PBS Server':'Add Proxmox Backup Server'),/*#__PURE__*/React.createElement("div",{className:"space-y-4"},/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"block text-sm text-gray-400 mb-1"},"Name *"),/*#__PURE__*/React.createElement("input",{value:pbsForm.name,onChange:e=>setPbsForm(p=>({...p,name:e.target.value})),placeholder:"My PBS Server",className:"w-full bg-proxmox-dark border border-proxmox-border rounded-lg p-2.5 text-sm text-white"})),/*#__PURE__*/React.createElement("div",{className:"grid grid-cols-3 gap-3"},/*#__PURE__*/React.createElement("div",{className:"col-span-2"},/*#__PURE__*/React.createElement("label",{className:"block text-sm text-gray-400 mb-1"},"Host *"),/*#__PURE__*/React.createElement("input",{value:pbsForm.host,onChange:e=>setPbsForm(p=>({...p,host:e.target.value})),placeholder:"pbs.example.com",className:"w-full bg-proxmox-dark border border-proxmox-border rounded-lg p-2.5 text-sm text-white"})),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"block text-sm text-gray-400 mb-1"},"Port"),/*#__PURE__*/React.createElement("input",{type:"number",value:pbsForm.port,onChange:e=>setPbsForm(p=>({...p,port:parseInt(e.target.value)||8007})),className:"w-full bg-proxmox-dark border border-proxmox-border rounded-lg p-2.5 text-sm text-white"}))),/*#__PURE__*/React.createElement("div",{className:"border-t border-proxmox-border pt-4"},/*#__PURE__*/React.createElement("p",{className:"text-xs text-gray-500 mb-3"},"Provide either Username + Password OR API Token (recommended)"),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"block text-sm text-gray-400 mb-1"},"Username"),/*#__PURE__*/React.createElement("input",{value:pbsForm.user,onChange:e=>setPbsForm(p=>({...p,user:e.target.value})),placeholder:"root@pam",className:"w-full bg-proxmox-dark border border-proxmox-border rounded-lg p-2.5 text-sm text-white"})),/*#__PURE__*/React.createElement("div",{className:"mt-3"},/*#__PURE__*/React.createElement("label",{className:"block text-sm text-gray-400 mb-1"},"Password"),/*#__PURE__*/React.createElement("input",{type:"password",value:pbsForm.password,onChange:e=>setPbsForm(p=>({...p,password:e.target.value})),placeholder:"Password",className:"w-full bg-proxmox-dark border border-proxmox-border rounded-lg p-2.5 text-sm text-white"})),/*#__PURE__*/React.createElement("div",{className:"mt-3"},/*#__PURE__*/React.createElement("label",{className:"block text-sm text-gray-400 mb-1"},"API Token ID"),/*#__PURE__*/React.createElement("input",{value:pbsForm.api_token_id,onChange:e=>setPbsForm(p=>({...p,api_token_id:e.target.value})),placeholder:"user@pam!tokenname",className:"w-full bg-proxmox-dark border border-proxmox-border rounded-lg p-2.5 text-sm text-white"})),/*#__PURE__*/React.createElement("div",{className:"mt-3"},/*#__PURE__*/React.createElement("label",{className:"block text-sm text-gray-400 mb-1"},"API Token Secret"),/*#__PURE__*/React.createElement("input",{type:"password",value:pbsForm.api_token_secret,onChange:e=>setPbsForm(p=>({...p,api_token_secret:e.target.value})),placeholder:"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",className:"w-full bg-proxmox-dark border border-proxmox-border rounded-lg p-2.5 text-sm text-white"}))),/*#__PURE__*/React.createElement("div",{className:"border-t border-proxmox-border pt-4"},/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"block text-sm text-gray-400 mb-1 flex items-center justify-between"},/*#__PURE__*/React.createElement("span",null,"Fingerprint (optional)"),/*#__PURE__*/React.createElement(FingerprintFetcher,{host:pbsForm.host,port:pbsForm.port,authFetch:authFetch,apiUrl:API_URL,onFetched:fp=>setPbsForm(p=>({...p,fingerprint:fp}))})),/*#__PURE__*/React.createElement("input",{value:pbsForm.fingerprint,onChange:e=>setPbsForm(p=>({...p,fingerprint:e.target.value})),placeholder:"AA:BB:CC:...",className:"w-full bg-proxmox-dark border border-proxmox-border rounded-lg p-2.5 text-sm text-white font-mono text-xs"})),/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-3 mt-3"},/*#__PURE__*/React.createElement("button",{onClick:()=>setPbsForm(p=>({...p,ssl_verify:!p.ssl_verify})),className:`w-10 h-5 rounded-full transition-all ${pbsForm.ssl_verify?'bg-green-500':'bg-gray-600'}`},/*#__PURE__*/React.createElement("div",{className:`w-4 h-4 bg-white rounded-full transition-transform ${pbsForm.ssl_verify?'translate-x-5':'translate-x-0.5'}`})),/*#__PURE__*/React.createElement("span",{className:"text-sm text-gray-300"},"Verify SSL Certificate"))),clusters.length>0&&/*#__PURE__*/React.createElement("div",{className:"border-t border-proxmox-border pt-4"},/*#__PURE__*/React.createElement("label",{className:"block text-sm text-gray-400 mb-2"},"Link to PVE Clusters"),/*#__PURE__*/React.createElement("div",{className:"space-y-1.5"},clusters.map(cl=>/*#__PURE__*/React.createElement("label",{key:cl.id,className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-proxmox-dark hover:bg-proxmox-hover cursor-pointer transition-colors"},/*#__PURE__*/React.createElement("input",{type:"checkbox",checked:(pbsForm.linked_clusters||[]).includes(cl.id),onChange:e=>{const linked=pbsForm.linked_clusters||[];setPbsForm(p=>({...p,linked_clusters:e.target.checked?[...linked,cl.id]:linked.filter(id=>id!==cl.id)}));},className:"rounded border-proxmox-border"}),/*#__PURE__*/React.createElement(Icons.Server,{className:"w-4 h-4 text-proxmox-orange"}),/*#__PURE__*/React.createElement("span",{className:"text-sm text-gray-300"},cl.display_name||cl.name))))),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"block text-sm text-gray-400 mb-1"},"Notes"),/*#__PURE__*/React.createElement("textarea",{value:pbsForm.notes,onChange:e=>setPbsForm(p=>({...p,notes:e.target.value})),rows:2,placeholder:"Optional notes...",className:"w-full bg-proxmox-dark border border-proxmox-border rounded-lg p-2.5 text-sm text-white resize-none"})),/*#__PURE__*/React.createElement("div",{className:"pt-3 border-t border-proxmox-border"},/*#__PURE__*/React.createElement("button",{type:"button",onClick:()=>setPbsForm(p=>({...p,_showSsh:!p._showSsh})),className:"flex items-center gap-2 text-sm text-gray-400 hover:text-white transition-colors"},/*#__PURE__*/React.createElement(Icons.ChevronRight,{className:`w-3 h-3 transform transition-transform ${pbsForm._showSsh?'rotate-90':''}`}),"SSH (Optional \u2014 needed for Update Manager)"),pbsForm._showSsh&&/*#__PURE__*/React.createElement("div",{className:"mt-3 space-y-3 p-3 bg-proxmox-dark/50 rounded-lg"},/*#__PURE__*/React.createElement("p",{className:"text-xs text-gray-400"},"SSH is only used for apt dist-upgrade. If blank, PegaProx falls back to the PBS web password. Use a key if password login is disabled."),/*#__PURE__*/React.createElement("div",{className:"grid grid-cols-2 gap-2"},/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"block text-xs text-gray-400 mb-1"},"SSH User"),/*#__PURE__*/React.createElement("input",{type:"text",value:pbsForm.ssh_user||'',onChange:e=>setPbsForm(p=>({...p,ssh_user:e.target.value})),placeholder:"root",className:"w-full px-3 py-2 bg-proxmox-dark border border-proxmox-border rounded-lg text-white text-sm"})),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"block text-xs text-gray-400 mb-1"},"SSH Port"),/*#__PURE__*/React.createElement("input",{type:"number",value:pbsForm.ssh_port||22,onChange:e=>setPbsForm(p=>({...p,ssh_port:parseInt(e.target.value)||22})),className:"w-full px-3 py-2 bg-proxmox-dark border border-proxmox-border rounded-lg text-white text-sm"}))),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"block text-xs text-gray-400 mb-1"},"SSH Private Key"),/*#__PURE__*/React.createElement("textarea",{value:pbsForm.ssh_key||'',onChange:e=>setPbsForm(p=>({...p,ssh_key:e.target.value})),className:"w-full px-3 py-2 bg-proxmox-dark border border-proxmox-border rounded-lg text-white placeholder-gray-500 font-mono text-xs",placeholder:editingPBS?"Leave blank to keep existing key":"-----BEGIN OPENSSH PRIVATE KEY-----",rows:4})))),pbsTestResult&&/*#__PURE__*/React.createElement("div",{className:`p-3 rounded-lg text-sm ${pbsTestResult.success?'bg-green-500/10 border border-green-500/30 text-green-400':'bg-red-500/10 border border-red-500/30 text-red-400'}`},pbsTestResult.success?/*#__PURE__*/React.createElement("span",null,"Connection successful! PBS v",pbsTestResult.version?.version," - ",pbsTestResult.datastores," datastore(s)"):/*#__PURE__*/React.createElement("span",null,"Connection failed: ",pbsTestResult.error))),/*#__PURE__*/React.createElement("div",{className:"flex justify-between mt-6"},/*#__PURE__*/React.createElement("button",{onClick:async()=>{setPbsTestLoading(true);setPbsTestResult(null);const result=await handleTestPBS(pbsForm);setPbsTestResult(result);setPbsTestLoading(false);},disabled:pbsTestLoading||!pbsForm.host,className:"px-4 py-2 rounded-lg bg-proxmox-dark border border-proxmox-border text-gray-300 hover:text-white text-sm flex items-center gap-2 disabled:opacity-50"},pbsTestLoading?/*#__PURE__*/React.createElement(Icons.Loader,{className:"w-4 h-4 animate-spin"}):/*#__PURE__*/React.createElement(Icons.Zap,{className:"w-4 h-4"}),"Test Connection"),/*#__PURE__*/React.createElement("div",{className:"flex gap-2"},/*#__PURE__*/React.createElement("button",{onClick:()=>{setShowAddPBS(false);setEditingPBS(null);setPbsTestResult(null);setPbsForm({name:'',host:'',port:8007,user:'root@pam',password:'',api_token_id:'',api_token_secret:'',fingerprint:'',ssl_verify:false,linked_clusters:[],notes:'',ssh_user:'',ssh_port:22,ssh_key:'',_showSsh:false});},className:"px-4 py-2 rounded-lg bg-proxmox-dark text-gray-400 hover:text-white transition-colors text-sm"},"Cancel"),/*#__PURE__*/React.createElement("button",{onClick:async()=>{if(!pbsForm.name||!pbsForm.host){addToast('Name and host are required','error');return;}if(!pbsForm.api_token_id&&!pbsForm.password){addToast('Provide password or API token','error');return;}let result;if(editingPBS){result=await handleUpdatePBS(editingPBS.id,pbsForm);}else{result=await handleAddPBS(pbsForm);}if(result?.success){setShowAddPBS(false);setEditingPBS(null);setPbsTestResult(null);setPbsForm({name:'',host:'',port:8007,user:'root@pam',password:'',api_token_id:'',api_token_secret:'',fingerprint:'',ssl_verify:false,linked_clusters:[],notes:'',ssh_user:'',ssh_port:22,ssh_key:'',_showSsh:false});}else if(result?.error){addToast(result.error,'error');}},disabled:!pbsForm.name||!pbsForm.host,className:"px-4 py-2 rounded-lg bg-blue-500 hover:bg-blue-600 text-white text-sm font-medium disabled:opacity-50"},editingPBS?'Save Changes':'Add Server')))))),pbsEditingNotes&&/*#__PURE__*/React.createElement("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-4 bg-black/70 backdrop-blur-sm",onClick:()=>setPbsEditingNotes(null)},/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-2xl shadow-2xl max-w-lg w-full animate-scale-in",onClick:e=>e.stopPropagation()},/*#__PURE__*/React.createElement("div",{className:"p-6"},/*#__PURE__*/React.createElement("div",{className:"flex items-center justify-between mb-4"},/*#__PURE__*/React.createElement("h2",{className:"text-lg font-bold text-white flex items-center gap-2"},/*#__PURE__*/React.createElement(Icons.FileText,{className:"w-5 h-5 text-cyan-400"}),pbsEditingNotes.type==='snapshot'?'Snapshot':'Group'," Notes"),/*#__PURE__*/React.createElement("button",{onClick:()=>setPbsEditingNotes(null),className:"text-gray-500 hover:text-white transition-colors"},/*#__PURE__*/React.createElement(Icons.X,{className:"w-5 h-5"}))),/*#__PURE__*/React.createElement("p",{className:"text-sm text-gray-400 mb-3"},pbsEditingNotes.label),/*#__PURE__*/React.createElement("textarea",{value:pbsNotesText,onChange:e=>setPbsNotesText(e.target.value),className:"w-full h-40 p-3 bg-proxmox-dark border border-proxmox-border rounded-lg text-white text-sm resize-y focus:outline-none focus:border-cyan-500/50",placeholder:"Enter notes..."}),/*#__PURE__*/React.createElement("div",{className:"flex justify-end gap-3 mt-4"},/*#__PURE__*/React.createElement("button",{onClick:()=>setPbsEditingNotes(null),className:"px-4 py-2 rounded-lg bg-proxmox-dark text-gray-400 hover:text-white transition-colors text-sm"},"Cancel"),/*#__PURE__*/React.createElement("button",{onClick:()=>pbsSaveNotes(pbsEditingNotes.type,pbsEditingNotes.params),className:"px-4 py-2 rounded-lg bg-cyan-600 hover:bg-cyan-500 text-white transition-colors text-sm font-medium"},"Save Notes"))))),showPbsFileBrowser&&pbsCatalogSnapshot&&/*#__PURE__*/React.createElement("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-4 bg-black/70 backdrop-blur-sm",onClick:()=>setShowPbsFileBrowser(false)},/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-2xl shadow-2xl max-w-3xl w-full max-h-[80vh] flex flex-col animate-scale-in",onClick:e=>e.stopPropagation()},/*#__PURE__*/React.createElement("div",{className:"p-4 border-b border-proxmox-border flex items-center justify-between shrink-0"},/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("h2",{className:"text-lg font-bold text-white flex items-center gap-2"},/*#__PURE__*/React.createElement(Icons.Folder,{className:"w-5 h-5 text-blue-400"}),"File Browser"),/*#__PURE__*/React.createElement("p",{className:"text-xs text-gray-500 mt-1"},/*#__PURE__*/React.createElement("span",{className:"font-mono"},pbsCatalogSnapshot['backup-type'],"/",pbsCatalogSnapshot['backup-id']),(()=>{const nm=pbsLookupName(pbsCatalogSnapshot['backup-type'],pbsCatalogSnapshot['backup-id']);return nm?/*#__PURE__*/React.createElement("span",{className:"ml-1 text-gray-300"},"\xB7 ",nm):null;})(),/*#__PURE__*/React.createElement("span",{className:"ml-2"},"@ ",fmtDate(pbsCatalogSnapshot['backup-time']*1000)))),/*#__PURE__*/React.createElement("button",{onClick:()=>setShowPbsFileBrowser(false),className:"text-gray-500 hover:text-white transition-colors"},/*#__PURE__*/React.createElement(Icons.X,{className:"w-5 h-5"}))),/*#__PURE__*/React.createElement("div",{className:"px-4 py-2 border-b border-proxmox-border/50 flex items-center gap-1 text-sm bg-proxmox-dark/50 shrink-0 overflow-x-auto"},/*#__PURE__*/React.createElement("button",{onClick:()=>pbsNavigateCatalog('/'),className:"text-blue-400 hover:text-blue-300 transition-colors"},"/"),pbsCatalogPath.split('/').filter(Boolean).map((seg,i,arr)=>{const path='/'+arr.slice(0,i+1).join('/');return/*#__PURE__*/React.createElement("span",{key:i,className:"flex items-center gap-1"},/*#__PURE__*/React.createElement("span",{className:"text-gray-600"},"/"),/*#__PURE__*/React.createElement("button",{onClick:()=>pbsNavigateCatalog(path),className:"text-blue-400 hover:text-blue-300 transition-colors"},seg));})),/*#__PURE__*/React.createElement("div",{className:"flex-1 overflow-y-auto p-2"},pbsCatalogPath!=='/'&&/*#__PURE__*/React.createElement("div",{onClick:()=>{const parts=pbsCatalogPath.split('/').filter(Boolean);parts.pop();pbsNavigateCatalog('/'+parts.join('/'));},className:"flex items-center gap-3 px-3 py-2 rounded-lg hover:bg-proxmox-hover/30 cursor-pointer text-sm text-gray-400 hover:text-white transition-all"},/*#__PURE__*/React.createElement(Icons.ArrowLeft,{className:"w-4 h-4"}),/*#__PURE__*/React.createElement("span",null,"..")),pbsCatalog.length>0?pbsCatalog.sort((a,b)=>{// Directories first, then files const aDir=a.type==='Directory'||a.type==='d'?0:1;const bDir=b.type==='Directory'||b.type==='d'?0:1;if(aDir!==bDir)return aDir-bDir;return(a.text||a.filename||'').localeCompare(b.text||b.filename||'');}).map((entry,i)=>{const name=entry.text||entry.filename||entry.name||'-';const isDir=entry.type==='Directory'||entry.type==='d';const size=entry.size||entry.leaf_size||0;const mtime=entry.mtime?fmtDate(entry.mtime*1000):'';const fullPath=(pbsCatalogPath==='/'?'/':pbsCatalogPath+'/')+name;return/*#__PURE__*/React.createElement("div",{key:i,onClick:()=>isDir?pbsNavigateCatalog(fullPath):null,className:`flex items-center gap-3 px-3 py-2 rounded-lg hover:bg-proxmox-hover/30 text-sm transition-all ${isDir?'cursor-pointer':''}`},isDir?/*#__PURE__*/React.createElement(Icons.Folder,{className:"w-4 h-4 text-yellow-400 shrink-0"}):/*#__PURE__*/React.createElement(Icons.File,{className:"w-4 h-4 text-gray-500 shrink-0"}),/*#__PURE__*/React.createElement("span",{className:`flex-1 truncate ${isDir?'text-white':'text-gray-300'}`},name),!isDir&&size>0&&/*#__PURE__*/React.createElement("span",{className:"text-xs text-gray-500 shrink-0"},formatBytes(size)),mtime&&/*#__PURE__*/React.createElement("span",{className:"text-xs text-gray-600 shrink-0"},mtime),!isDir&&/*#__PURE__*/React.createElement("button",{onClick:e=>{e.stopPropagation();pbsDownloadFile(fullPath);},className:"px-2 py-1 rounded text-xs text-gray-500 hover:text-green-400 hover:bg-green-500/10 transition-all shrink-0",title:"Download"},/*#__PURE__*/React.createElement(Icons.Download,{className:"w-3.5 h-3.5"})));}):/*#__PURE__*/React.createElement("div",{className:"text-center py-12 text-gray-500"},/*#__PURE__*/React.createElement(Icons.Folder,{className:"w-8 h-8 mx-auto mb-3 opacity-30"}),/*#__PURE__*/React.createElement("p",{className:"text-sm"},"No files found or catalog unavailable"),/*#__PURE__*/React.createElement("p",{className:"text-xs text-gray-600 mt-1"},"File browsing is only available for host/file-level (pxar) backups"))))),showUpdateNotification&&pendingUpdate&&/*#__PURE__*/React.createElement("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-4 bg-black/70 backdrop-blur-sm"},/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-2xl shadow-2xl max-w-md w-full animate-scale-in overflow-hidden"},/*#__PURE__*/React.createElement("div",{className:"p-6 text-center"},/*#__PURE__*/React.createElement("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-gradient-to-br from-green-500/20 to-emerald-500/20 flex items-center justify-center"},/*#__PURE__*/React.createElement(Icons.Download,{className:"w-8 h-8 text-green-400"})),/*#__PURE__*/React.createElement("h2",{className:"text-xl font-bold text-white mb-2"},t('newVersionAvailable')||'New Version Available!'),/*#__PURE__*/React.createElement("p",{className:"text-gray-400 mb-2"},t('updateTo')||'Update to'," ",/*#__PURE__*/React.createElement("span",{className:"text-green-400 font-semibold"},pendingUpdate.latest_version)),/*#__PURE__*/React.createElement("p",{className:"text-sm text-gray-500 mb-6"},t('currentVersion')||'Current version',": ",pendingUpdate.current_version),/*#__PURE__*/React.createElement("div",{className:"flex gap-3"},/*#__PURE__*/React.createElement("button",{onClick:()=>setShowUpdateNotification(false),className:"flex-1 px-4 py-2.5 bg-proxmox-dark hover:bg-proxmox-hover border border-proxmox-border rounded-lg text-gray-300 transition-colors"},t('later')||'Later'),/*#__PURE__*/React.createElement("button",{onClick:()=>{setShowUpdateNotification(false);setShowSettings(true);// Small delay to let settings modal open, then navigate to updates tab -setTimeout(()=>{const event=new CustomEvent('pegaprox-navigate-updates');window.dispatchEvent(event);},100);},className:"flex-1 px-4 py-2.5 bg-gradient-to-r from-green-500 to-emerald-500 hover:from-green-600 hover:to-emerald-600 rounded-lg text-white font-medium transition-all"},t('viewUpdate')||'View Update'))))),configVm&&(configVm._clusterId||selectedCluster)&&/*#__PURE__*/React.createElement(ConfigModal,{vm:configVm,clusterId:configVm._clusterId||selectedCluster.id,allClusters:clusters,dashboardAuthFetch:authFetch,onClose:handleCloseConfig,addToast:addToast,isCorporate:isCorporate}),configNode&&selectedCluster&&/*#__PURE__*/React.createElement(NodeModal,{node:configNode,clusterId:selectedCluster.id,clusterType:selectedCluster.cluster_type||'proxmox',onClose:()=>setConfigNode(null),addToast:addToast}),showRemoveNodeDash&&nodeToRemoveDash&&selectedCluster&&/*#__PURE__*/React.createElement(RemoveNodeConfirmModal,{isOpen:showRemoveNodeDash,onClose:()=>{setShowRemoveNodeDash(false);setNodeToRemoveDash(null);},node:nodeToRemoveDash,clusterId:selectedCluster.id,onSuccess:()=>{fetchClusterMetrics(selectedCluster.id);fetchClusterResources(selectedCluster.id);},addToast:addToast}),showMoveNodeDash&&nodeToMoveDash&&selectedCluster&&/*#__PURE__*/React.createElement(MoveNodeModal,{isOpen:showMoveNodeDash,onClose:()=>{setShowMoveNodeDash(false);setNodeToMoveDash(null);},nodeName:nodeToMoveDash,currentClusterId:selectedCluster.id,clusters:clusters,onSuccess:()=>{fetchClusterMetrics(selectedCluster.id);fetchClusterResources(selectedCluster.id);},addToast:addToast}),dashMigrateVm&&/*#__PURE__*/React.createElement(MigrateModal,{vm:dashMigrateVm,nodes:Object.keys(clusterMetrics),clusterId:dashMigrateVm._clusterId||selectedCluster?.id,onMigrate:handleMigrate,onClose:()=>setDashMigrateVm(null)}),dashCloneVm&&/*#__PURE__*/React.createElement(CloneVmModal,{vm:dashCloneVm,nodes:Object.keys(clusterMetrics),clusterId:dashCloneVm._clusterId||selectedCluster?.id,storages:clusterDatastores,onClone:handleCloneVm,onClose:()=>setDashCloneVm(null)}),dashDeleteVm&&/*#__PURE__*/React.createElement(DeleteVmModal,{vm:dashDeleteVm,clusterId:dashDeleteVm._clusterId||selectedCluster?.id,onDelete:handleDeleteVm,onClose:()=>setDashDeleteVm(null)}),dashCrossClusterVm&&clusters.length>1&&/*#__PURE__*/React.createElement(CrossClusterMigrateModal,{vm:dashCrossClusterVm,sourceCluster:selectedCluster,clusters:clusters,onMigrate:handleCrossClusterMigrate,onClose:()=>setDashCrossClusterVm(null)}),dashSnapshotVm&&/*#__PURE__*/React.createElement(CreateSnapshotModal,{isQemu:dashSnapshotVm.type==='qemu',loading:dashSnapshotLoading,onSubmit:handleDashSnapshotSubmit,onClose:()=>setDashSnapshotVm(null)}),showCreateVm&&selectedCluster&&/*#__PURE__*/React.createElement(CreateVmModal,{vmType:showCreateVm,clusterId:selectedCluster.id,clusterType:selectedCluster.cluster_type||'proxmox',nodes:Object.keys(clusterMetrics),onCreate:handleCreateVm,onClose:()=>setShowCreateVm(null)}),ctxMenu&&isCorporate&&/*#__PURE__*/React.createElement(ContextMenu,{items:buildContextMenuItems(ctxMenu.type,ctxMenu.target),position:ctxMenu.position,onClose:()=>setCtxMenu(null)}),showAddVMware&&/*#__PURE__*/React.createElement("div",{className:"fixed inset-0 bg-black/70 flex items-center justify-center z-50 p-4"},/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-2xl w-full max-w-lg shadow-2xl"},/*#__PURE__*/React.createElement("div",{className:"p-6 border-b border-proxmox-border flex items-center justify-between"},/*#__PURE__*/React.createElement("h2",{className:"text-lg font-bold text-white"},editingVMware?'Edit ESXi Server':'Add ESXi Server'),/*#__PURE__*/React.createElement("button",{onClick:()=>{setShowAddVMware(false);setEditingVMware(null);setVmwareTestResult(null);},className:"p-1 text-gray-500 hover:text-white rounded"},/*#__PURE__*/React.createElement(Icons.X,{className:"w-5 h-5"}))),/*#__PURE__*/React.createElement("div",{className:"p-6 space-y-4"},/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"block text-sm text-gray-400 mb-1"},"Name"),/*#__PURE__*/React.createElement("input",{value:vmwareForm.name,onChange:e=>setVmwareForm(f=>({...f,name:e.target.value})),placeholder:"My ESXi Host",className:"w-full px-3 py-2 bg-proxmox-dark border border-proxmox-border rounded-lg text-white text-sm focus:outline-none focus:border-emerald-500/50"})),/*#__PURE__*/React.createElement("div",{className:"grid grid-cols-3 gap-3"},/*#__PURE__*/React.createElement("div",{className:"col-span-2"},/*#__PURE__*/React.createElement("label",{className:"block text-sm text-gray-400 mb-1"},"Host"),/*#__PURE__*/React.createElement("input",{value:vmwareForm.host,onChange:e=>setVmwareForm(f=>({...f,host:e.target.value})),placeholder:"192.168.1.100",className:"w-full px-3 py-2 bg-proxmox-dark border border-proxmox-border rounded-lg text-white text-sm focus:outline-none focus:border-emerald-500/50"})),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"block text-sm text-gray-400 mb-1"},"Port"),/*#__PURE__*/React.createElement("input",{type:"number",value:vmwareForm.port,onChange:e=>setVmwareForm(f=>({...f,port:parseInt(e.target.value)||443})),className:"w-full px-3 py-2 bg-proxmox-dark border border-proxmox-border rounded-lg text-white text-sm focus:outline-none focus:border-emerald-500/50"}))),/*#__PURE__*/React.createElement("div",{className:"grid grid-cols-2 gap-3"},/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"block text-sm text-gray-400 mb-1"},"Username"),/*#__PURE__*/React.createElement("input",{value:vmwareForm.username,onChange:e=>setVmwareForm(f=>({...f,username:e.target.value})),placeholder:"root",className:"w-full px-3 py-2 bg-proxmox-dark border border-proxmox-border rounded-lg text-white text-sm focus:outline-none focus:border-emerald-500/50"})),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"block text-sm text-gray-400 mb-1"},"Password"),/*#__PURE__*/React.createElement("input",{type:"password",value:vmwareForm.password,onChange:e=>setVmwareForm(f=>({...f,password:e.target.value})),placeholder:editingVMware?'(unchanged)':'Password',className:"w-full px-3 py-2 bg-proxmox-dark border border-proxmox-border rounded-lg text-white text-sm focus:outline-none focus:border-emerald-500/50"}))),/*#__PURE__*/React.createElement("label",{className:"flex items-center gap-2 cursor-pointer"},/*#__PURE__*/React.createElement("input",{type:"checkbox",checked:vmwareForm.ssl_verify,onChange:e=>setVmwareForm(f=>({...f,ssl_verify:e.target.checked})),className:"rounded"}),/*#__PURE__*/React.createElement("span",{className:"text-sm text-gray-400"},"Verify SSL certificate")),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"block text-sm text-gray-400 mb-1"},"Notes"),/*#__PURE__*/React.createElement("textarea",{value:vmwareForm.notes,onChange:e=>setVmwareForm(f=>({...f,notes:e.target.value})),rows:2,className:"w-full px-3 py-2 bg-proxmox-dark border border-proxmox-border rounded-lg text-white text-sm focus:outline-none focus:border-emerald-500/50 resize-none"})),/*#__PURE__*/React.createElement("div",{className:"bg-blue-500/5 border border-blue-500/20 rounded-lg p-3"},/*#__PURE__*/React.createElement("div",{className:"text-xs text-blue-300 font-semibold mb-1"},t('requirements')||'Requirements'),/*#__PURE__*/React.createElement("div",{className:"text-xs text-blue-300/80"},"- ",t('reqSshEnabled')||'SSH must be enabled on the ESXi host'),/*#__PURE__*/React.createElement("div",{className:"text-xs text-blue-300/80"},"- ",t('reqEsxiRoot')||'ESXi root credentials are required for VM migration'),/*#__PURE__*/React.createElement("div",{className:"text-xs text-blue-300/80"},"- ",t('reqVmwareTools')||'VMware Tools recommended for clean shutdown during cutover (not strictly required)')),vmwareTestResult&&/*#__PURE__*/React.createElement("div",{className:`p-3 rounded-lg text-sm ${vmwareTestResult.error?'bg-red-500/10 border border-red-500/30 text-red-400':'bg-green-500/10 border border-green-500/30 text-green-400'}`},vmwareTestResult.error?`Connection failed: ${vmwareTestResult.error}`:'Connection successful!')),/*#__PURE__*/React.createElement("div",{className:"p-6 border-t border-proxmox-border flex items-center justify-between"},/*#__PURE__*/React.createElement("button",{onClick:()=>handleTestVMware(vmwareForm),disabled:vmwareTestLoading||!vmwareForm.host,className:"px-4 py-2 rounded-lg bg-proxmox-dark border border-proxmox-border text-gray-400 hover:text-white text-sm disabled:opacity-50"},vmwareTestLoading?'Testing...':'Test Connection'),/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-2"},/*#__PURE__*/React.createElement("button",{onClick:()=>{setShowAddVMware(false);setEditingVMware(null);setVmwareTestResult(null);},className:"px-4 py-2 rounded-lg text-gray-400 hover:text-white text-sm"},"Cancel"),/*#__PURE__*/React.createElement("button",{onClick:()=>editingVMware?handleUpdateVMware(editingVMware.id,vmwareForm):handleAddVMware(vmwareForm),disabled:!vmwareForm.host||!editingVMware&&!vmwareForm.password,className:"px-4 py-2 rounded-lg bg-emerald-500 text-white text-sm font-medium hover:bg-emerald-600 disabled:opacity-50"},editingVMware?'Update':'Add Server'))))),consoleStack.map(c=>c.info?/*#__PURE__*/React.createElement(ConsoleModal,{key:c.id,vm:c.vm,consoleInfo:c.info,clusterId:c.vm._clusterId||selectedCluster?.id,onClose:()=>handleCloseConsole(c.id),hidden:c.id!==activeConsoleId}):null),consoleStack.length>=2&&/*#__PURE__*/React.createElement("div",{style:{position:'fixed',bottom:0,left:0,right:0,zIndex:60,pointerEvents:'none',display:'flex',justifyContent:'center'}},/*#__PURE__*/React.createElement("div",{style:{pointerEvents:'auto',background:'var(--corp-surface, #1c2733)',border:'1px solid var(--corp-border, #29414e)',borderBottom:'none',borderTopLeftRadius:'8px',borderTopRightRadius:'8px',boxShadow:'0 -4px 12px rgba(0,0,0,0.3)',padding:'6px 8px',display:'flex',gap:'4px',maxWidth:'90vw',overflowX:'auto'}},consoleStack.map(c=>{const active=c.id===activeConsoleId;const label=c.vm.name||`${c.vm.type==='qemu'?'VM':c.vm.type==='lxc'?'CT':''} ${c.vm.vmid}`;return/*#__PURE__*/React.createElement("div",{key:c.id,onClick:()=>setActiveConsoleId(c.id),className:"flex items-center gap-2 px-3 py-1.5 text-xs cursor-pointer",style:{background:active?'var(--corp-accent, #0078a8)':'var(--corp-surface-2, #29414e)',color:'#fff',borderRadius:'4px',fontWeight:active?600:500,whiteSpace:'nowrap',userSelect:'none'}},/*#__PURE__*/React.createElement(Icons.Monitor,{className:"w-3 h-3"}),/*#__PURE__*/React.createElement("span",{style:{maxWidth:'180px',overflow:'hidden',textOverflow:'ellipsis'}},label),/*#__PURE__*/React.createElement("button",{onClick:e=>{e.stopPropagation();handleCloseConsole(c.id);},style:{background:'rgba(255,255,255,0.15)',color:'#fff',border:'none',borderRadius:'50%',width:'16px',height:'16px',lineHeight:'14px',fontSize:'10px',padding:0,cursor:'pointer'},title:"Close"},"\xD7"));}))),lxcShellVm&&/*#__PURE__*/React.createElement(LxcShellModal,{vm:lxcShellVm,clusterId:lxcShellVm._clusterId||selectedCluster?.id,addToast:addToast,onClose:()=>setLxcShellVm(null)}),corpMetricsVm&&selectedCluster&&/*#__PURE__*/React.createElement(VmMetricsModal,{vm:corpMetricsVm,clusterId:selectedCluster.id,onClose:()=>setCorpMetricsVm(null)}),showHaSettings&&selectedCluster&&/*#__PURE__*/React.createElement("div",{className:"fixed inset-0 bg-black/70 flex items-center justify-center z-50 p-4",onClick:()=>setShowHaSettings(false)},/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl w-full max-w-xl max-h-[85vh] overflow-hidden",onClick:e=>e.stopPropagation()},/*#__PURE__*/React.createElement("div",{className:"flex justify-between items-center p-4 border-b border-proxmox-border bg-proxmox-dark"},/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("h2",{className:"text-lg font-semibold text-white flex items-center gap-2"},/*#__PURE__*/React.createElement(Icons.Shield,{className:"text-green-400"}),t('splitBrainProtection')),/*#__PURE__*/React.createElement("p",{className:"text-sm text-gray-500"},selectedCluster.name)),/*#__PURE__*/React.createElement("button",{onClick:()=>setShowHaSettings(false),className:"p-2 hover:bg-proxmox-hover rounded-lg"},/*#__PURE__*/React.createElement(Icons.X,null))),/*#__PURE__*/React.createElement("div",{className:"p-4 overflow-y-auto",style:{maxHeight:'calc(85vh - 140px)'}},(()=>{const fs=haStatus?.split_brain_prevention?.fence_strategy;const warn=haStatus?.split_brain_prevention?.fence_strategy_warning;if(!fs&&!warn)return null;const strat=fs?.strategy||'unknown';const colour=strat==='wait'?'bg-yellow-500/10 border-yellow-500/30 text-yellow-300':strat==='quorum'?'bg-blue-500/10 border-blue-500/30 text-blue-300':'bg-gray-500/10 border-gray-500/30 text-gray-300';const icon=strat==='wait'?'⚠️':strat==='quorum'?'🛡️':'ℹ️';return/*#__PURE__*/React.createElement("div",{className:`p-4 ${colour} border rounded-xl mb-4`},/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-2 mb-2"},/*#__PURE__*/React.createElement("span",{className:"text-xl"},icon),/*#__PURE__*/React.createElement("h4",{className:"font-medium"},t('fenceStrategyLabel')||'Fence strategy',": ",/*#__PURE__*/React.createElement("span",{className:"font-mono text-sm uppercase"},strat)),fs?.expected_votes!=null&&/*#__PURE__*/React.createElement("span",{className:"text-xs opacity-70 ml-auto"},fs.expected_votes," votes \xB7 qdevice: ",fs.has_qdevice?'yes':'no')),warn&&/*#__PURE__*/React.createElement("p",{className:"text-sm mb-2"},warn),fs?.reason&&/*#__PURE__*/React.createElement("p",{className:"text-xs opacity-80"},fs.reason),fs?.detected_at&&/*#__PURE__*/React.createElement("p",{className:"text-xs opacity-60 mt-2"},t('detectedAt')||'detected',": ",new Date(fs.detected_at).toLocaleString()));})(),/*#__PURE__*/React.createElement("div",{className:"p-4 bg-green-500/10 border border-green-500/30 rounded-xl mb-4"},/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-2 mb-3"},/*#__PURE__*/React.createElement("span",{className:"text-2xl"},"\uD83D\uDEE1\uFE0F"),/*#__PURE__*/React.createElement("h4",{className:"text-green-400 font-medium"},t('selfFenceProtection')),/*#__PURE__*/React.createElement("span",{className:"px-2 py-1 rounded text-xs bg-green-500/20 text-green-400 ml-auto"},t('recommended'))),/*#__PURE__*/React.createElement("p",{className:"text-sm text-gray-300 mb-3"},t('selfFenceExplain')),haStatus?.self_fence_installed?/*#__PURE__*/React.createElement("div",{className:"p-3 bg-green-500/20 rounded-lg"},/*#__PURE__*/React.createElement("div",{className:"flex items-center justify-between"},/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("p",{className:"text-green-400 font-medium"},"\u2705 ",t('selfFenceActive')),/*#__PURE__*/React.createElement("p",{className:"text-xs text-gray-400 mt-1"},t('agentInstalledOnNodes'),": ",haStatus.self_fence_nodes?.join(', ')||t('allNodes'))),/*#__PURE__*/React.createElement("button",{onClick:async()=>{if(!confirm(t('confirmUninstallAgent')))return;try{const res=await authFetch(`${API_URL}/clusters/${selectedCluster.id}/ha/uninstall-self-fence`,{method:'POST'});if(res.ok){addToast(t('selfFenceUninstalling'),'success');setTimeout(()=>fetchHAStatus(selectedCluster.id),3000);}}catch(e){addToast(t('error')+': '+e.message,'error');}},className:"px-3 py-1 text-xs bg-red-500/20 hover:bg-red-500/30 text-red-400 rounded-lg"},t('uninstall')))):/*#__PURE__*/React.createElement("div",{className:"space-y-3"},/*#__PURE__*/React.createElement("div",{className:"p-3 bg-yellow-500/20 rounded-lg"},/*#__PURE__*/React.createElement("p",{className:"text-yellow-400 font-medium"},"\u26A1 ",t('selfFenceNotInstalled')),/*#__PURE__*/React.createElement("p",{className:"text-xs text-gray-300 mt-1"},t('selfFenceInstallHint'))),/*#__PURE__*/React.createElement("button",{onClick:async()=>{try{const res=await authFetch(`${API_URL}/clusters/${selectedCluster.id}/ha/install-self-fence`,{method:'POST'});if(res.ok){addToast(t('selfFenceInstalling'),'success');setTimeout(()=>fetchHAStatus(selectedCluster.id),5000);}}catch(e){addToast(t('error')+': '+e.message,'error');}},className:"w-full px-4 py-2 bg-green-600 hover:bg-green-500 rounded-lg text-white font-medium"},"\uD83D\uDEE1\uFE0F ",t('installSelfFenceAgent'))),/*#__PURE__*/React.createElement("div",{className:"mt-3 text-xs text-gray-400"},"\u2713 ",t('noSharedStorageNeeded')," \u2022 \u2713 ",t('worksWithLvmIscsi')),haStatus?.self_fence_installed&&/*#__PURE__*/React.createElement("div",{className:"mt-3 p-3 bg-blue-500/10 border border-blue-500/30 rounded-lg"},/*#__PURE__*/React.createElement("label",{className:"block text-sm text-blue-400 font-medium mb-1"},t('pegaproxVmRecovery')),/*#__PURE__*/React.createElement("p",{className:"text-xs text-gray-400 mb-2"},t('pegaproxVmRecoveryDesc')),/*#__PURE__*/React.createElement("select",{value:haSettings.pegaprox_vmid,onChange:e=>setHaSettings({...haSettings,pegaprox_vmid:e.target.value}),className:"w-full bg-proxmox-dark border border-proxmox-border rounded px-3 py-2 text-white text-sm"},/*#__PURE__*/React.createElement("option",{value:""},t('noVmSelected')),(clusterResources||[]).filter(v=>v.type==='qemu').sort((a,b)=>a.vmid-b.vmid).map(v=>/*#__PURE__*/React.createElement("option",{key:v.vmid,value:v.vmid},v.vmid," - ",v.name," (",v.node,")"))),haSettings.pegaprox_vmid&&/*#__PURE__*/React.createElement("p",{className:"text-xs text-blue-300 mt-1"},t('pegaproxVmRecoveryActive')))),/*#__PURE__*/React.createElement("label",{className:"flex items-center gap-3 p-3 bg-proxmox-dark border border-proxmox-border rounded-xl mb-4 cursor-pointer hover:border-proxmox-orange/50"},/*#__PURE__*/React.createElement("input",{type:"checkbox",checked:haSettings.two_node_mode,onChange:e=>setHaSettings({...haSettings,two_node_mode:e.target.checked}),className:"w-5 h-5 rounded border-proxmox-border bg-proxmox-darker text-proxmox-orange"}),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("span",{className:"text-white font-medium"},t('enable2NodeMode')),/*#__PURE__*/React.createElement("p",{className:"text-xs text-gray-500"},t('twoNodeModeDesc')))),/*#__PURE__*/React.createElement("div",{className:"grid grid-cols-2 gap-4 mb-4"},/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"block text-sm text-gray-400 mb-1"},t('recoveryDelay')),/*#__PURE__*/React.createElement("input",{type:"number",min:"10",max:"300",value:haSettings.recovery_delay,onChange:e=>setHaSettings({...haSettings,recovery_delay:parseInt(e.target.value)||30}),className:"w-full bg-proxmox-dark border border-proxmox-border rounded-lg px-3 py-2 text-white"}),/*#__PURE__*/React.createElement("p",{className:"text-xs text-gray-500 mt-1"},t('recoveryDelayHint'))),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"block text-sm text-gray-400 mb-1"},t('failureThreshold')),/*#__PURE__*/React.createElement("input",{type:"number",min:"1",max:"10",value:haSettings.failure_threshold,onChange:e=>setHaSettings({...haSettings,failure_threshold:parseInt(e.target.value)||3}),className:"w-full bg-proxmox-dark border border-proxmox-border rounded-lg px-3 py-2 text-white"}),/*#__PURE__*/React.createElement("p",{className:"text-xs text-gray-500 mt-1"},t('failureThresholdHint')))),/*#__PURE__*/React.createElement("details",{className:"group bg-proxmox-dark border border-proxmox-border rounded-xl overflow-hidden"},/*#__PURE__*/React.createElement("summary",{className:"p-3 cursor-pointer hover:bg-proxmox-hover flex items-center justify-between text-sm"},/*#__PURE__*/React.createElement("span",{className:"text-gray-400"},t('advancedSettings')),/*#__PURE__*/React.createElement(Icons.ChevronDown,{className:"w-4 h-4 text-gray-400 transition-transform group-open:rotate-180"})),/*#__PURE__*/React.createElement("div",{className:"p-3 pt-0 space-y-3 border-t border-proxmox-border"},/*#__PURE__*/React.createElement("div",{className:"grid grid-cols-2 gap-3"},/*#__PURE__*/React.createElement("label",{className:"flex items-center gap-2 p-2 bg-proxmox-darker rounded-lg"},/*#__PURE__*/React.createElement("input",{type:"checkbox",checked:haSettings.self_fence_enabled,onChange:e=>setHaSettings({...haSettings,self_fence_enabled:e.target.checked}),className:"w-4 h-4 rounded"}),/*#__PURE__*/React.createElement("span",{className:"text-sm text-white"},t('selfFencing'))),/*#__PURE__*/React.createElement("label",{className:"flex items-center gap-2 p-2 bg-proxmox-darker rounded-lg"},/*#__PURE__*/React.createElement("input",{type:"checkbox",checked:haSettings.verify_network,onChange:e=>setHaSettings({...haSettings,verify_network:e.target.checked}),className:"w-4 h-4 rounded"}),/*#__PURE__*/React.createElement("span",{className:"text-sm text-white"},t('networkCheck')))),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"block text-xs text-gray-400 mb-1"},t('additionalQuorumHosts')),/*#__PURE__*/React.createElement("input",{type:"text",value:haSettings.quorum_hosts,onChange:e=>setHaSettings({...haSettings,quorum_hosts:e.target.value}),placeholder:"8.8.8.8, 1.1.1.1",className:"w-full bg-proxmox-darker border border-proxmox-border rounded-lg px-3 py-2 text-white text-sm"})),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"block text-xs text-gray-400 mb-1"},t('gatewayIp')),/*#__PURE__*/React.createElement("input",{type:"text",value:haSettings.quorum_gateway,onChange:e=>setHaSettings({...haSettings,quorum_gateway:e.target.value}),placeholder:"192.168.1.1",className:"w-full bg-proxmox-darker border border-proxmox-border rounded-lg px-3 py-2 text-white text-sm"}))))),/*#__PURE__*/React.createElement("div",{className:"flex justify-end gap-2 p-4 border-t border-proxmox-border bg-proxmox-dark"},/*#__PURE__*/React.createElement("button",{onClick:()=>setShowHaSettings(false),className:"px-4 py-2 bg-proxmox-dark hover:bg-proxmox-hover border border-proxmox-border rounded-lg"},t('cancel')),/*#__PURE__*/React.createElement("button",{onClick:handleSaveHASettings,className:"flex items-center gap-2 px-4 py-2 bg-proxmox-orange hover:bg-orange-600 rounded-lg"},/*#__PURE__*/React.createElement(Icons.Save,{className:"w-4 h-4"}),t('saveSettings'))))),/*#__PURE__*/React.createElement("footer",{className:"border-t border-proxmox-border bg-proxmox-dark/50 mt-8"},/*#__PURE__*/React.createElement("div",{className:"max-w-[800px] mx-auto px-6 py-6"},/*#__PURE__*/React.createElement("div",{className:"text-center mb-4"},/*#__PURE__*/React.createElement("p",{className:"text-sm text-gray-400"},"\u2764\uFE0F ",t('thanksToSponsors')||'Thanks to our Sponsors')),/*#__PURE__*/React.createElement("div",{className:"flex justify-center gap-3 flex-wrap"},[1,2,3,4,5,6,7,8].map(num=>/*#__PURE__*/React.createElement(SponsorSlot,{key:num,num:num}))),/*#__PURE__*/React.createElement("div",{className:"flex justify-center mt-4"},/*#__PURE__*/React.createElement("a",{href:"https://opencollective.com/pegaprox",target:"_blank",rel:"noopener noreferrer",title:"Contribute on Open Collective"},/*#__PURE__*/React.createElement("img",{src:"/images/oc_contribute_button.png",alt:"Contribute to our Collective",className:"h-8 w-auto hover:opacity-90 transition-opacity"}))),/*#__PURE__*/React.createElement("div",{className:"text-center mt-4 text-xs text-gray-600"},/*#__PURE__*/React.createElement("p",null,"PegaProx ",PEGAPROX_VERSION," \u2022 ",t('madeWithLove')||'Made with ❤️ for the Proxmox community')))),isCorporate&&showEventLog&&corpEventLog.length>0&&/*#__PURE__*/React.createElement("div",{className:"corp-event-log"},corpEventLog.map(evt=>/*#__PURE__*/React.createElement("div",{key:evt.id,className:"corp-event-item"},/*#__PURE__*/React.createElement("span",{className:"corp-event-time"},evt.time.toLocaleTimeString([],{hour:'2-digit',minute:'2-digit',second:'2-digit'})),/*#__PURE__*/React.createElement("span",{className:`corp-event-type-${evt.type}`},"\u25CF"),/*#__PURE__*/React.createElement("span",null,evt.msg),evt.user&&/*#__PURE__*/React.createElement("span",{style:{color:'#5a7a8a',marginLeft:'auto'}},evt.user)))),isCorporate&&/*#__PURE__*/React.createElement("div",{className:"corp-status-bar"},/*#__PURE__*/React.createElement("div",{className:"corp-status-bar-item"},/*#__PURE__*/React.createElement("div",{className:`w-1.5 h-1.5 rounded-full ${wsConnected?'bg-green-500':'bg-yellow-500'}`}),/*#__PURE__*/React.createElement("span",null,wsConnected?t('connectionLive')||'Live':t('connectionPolling')||'Polling')),/*#__PURE__*/React.createElement("div",{className:"corp-status-bar-item"},selectedCluster?/*#__PURE__*/React.createElement("span",null,selectedCluster.display_name||selectedCluster.name):/*#__PURE__*/React.createElement("span",null,clusters.length," ",t('clusters'))),(()=>{const runningTasks=tasks.filter(t=>t&&t.status==='running').length;return runningTasks>0?/*#__PURE__*/React.createElement("div",{className:"corp-status-bar-item"},/*#__PURE__*/React.createElement(Icons.Layers,{style:{width:11,height:11}}),/*#__PURE__*/React.createElement("span",null,/*#__PURE__*/React.createElement("strong",null,runningTasks)," ",runningTasks===1?'Task':'Tasks')):null;})(),/*#__PURE__*/React.createElement("div",{className:"corp-status-bar-item"},(()=>{const vms=clusterResources.filter(r=>r.type==='qemu'||r.type==='lxc');const running=vms.filter(r=>r.status==='running').length;return/*#__PURE__*/React.createElement("span",null,/*#__PURE__*/React.createElement("strong",null,running),"/",vms.length," VMs");})()),/*#__PURE__*/React.createElement("div",{className:"corp-status-bar-item"},user?.username," (",user?.role,")"),/*#__PURE__*/React.createElement("div",{style:{flex:1}}),corpEventLog.length>0&&/*#__PURE__*/React.createElement("div",{className:"corp-status-bar-item",style:{cursor:'pointer'},onClick:()=>setShowEventLog(v=>!v)},/*#__PURE__*/React.createElement(Icons.Activity,{style:{width:11,height:11}}),/*#__PURE__*/React.createElement("span",null,corpEventLog.length," ",showEventLog?'▾':'▴')),lastUpdate&&/*#__PURE__*/React.createElement("div",{className:"corp-status-bar-item"},/*#__PURE__*/React.createElement("span",null,lastUpdate.toLocaleTimeString([],{hour:'2-digit',minute:'2-digit'}))),/*#__PURE__*/React.createElement("div",{className:"corp-status-bar-item",style:{borderRight:'none'}},"PegaProx ",PEGAPROX_VERSION)),ReactDOM.createPortal(React.createElement('div',{style:{position:'fixed',bottom:isCorporate?64:24,right:24,zIndex:99999,display:'flex',flexDirection:'column',gap:8}},toasts.map(toast=>React.createElement(Toast,{key:toast.id,message:toast.message,type:toast.type,onClose:()=>removeToast(toast.id)}))),document.body),sessionExpired&&ReactDOM.createPortal(/*#__PURE__*/React.createElement("div",{className:"fixed inset-0 flex items-center justify-center p-4",style:{zIndex:100000,background:'rgba(0,0,0,0.8)',backdropFilter:'blur(2px)'}},/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl w-full max-w-sm p-7 text-center"},/*#__PURE__*/React.createElement("div",{className:"mx-auto mb-4 rounded-full bg-yellow-500/15 flex items-center justify-center",style:{width:52,height:52}},/*#__PURE__*/React.createElement(Icons.Lock,{className:"w-6 h-6 text-yellow-400"})),/*#__PURE__*/React.createElement("h3",{className:"text-lg font-semibold mb-5"},t('sessionExpired')||'Session expired'),/*#__PURE__*/React.createElement("button",{onClick:()=>{setSessionExpired(false);logout();},className:"w-full px-4 py-2.5 bg-proxmox-orange hover:bg-orange-600 rounded-lg font-medium"},t('login')||'Log in'))),document.body),showScheduleModal&&/*#__PURE__*/React.createElement("div",{className:"fixed inset-0 bg-black/70 flex items-center justify-center z-50 p-4"},/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl w-full max-w-md"},/*#__PURE__*/React.createElement("div",{className:"p-4 border-b border-proxmox-border flex justify-between items-center"},/*#__PURE__*/React.createElement("h3",{className:"text-lg font-semibold"},editingSchedule?t('editSchedule')||'Edit Schedule':t('newSchedule')||'New Schedule'),/*#__PURE__*/React.createElement("button",{onClick:()=>setShowScheduleModal(false),className:"p-1 hover:bg-proxmox-hover rounded"},/*#__PURE__*/React.createElement(Icons.X,null))),/*#__PURE__*/React.createElement("form",{key:editingSchedule?.id||'new',onSubmit:async e=>{e.preventDefault();const form=e.target;const data={cluster_id:selectedCluster?.id,vmid:parseInt(form.vmid.value),vm_type:form.vm_type.value,action:form.action.value,schedule_type:form.schedule_type.value,time:form.time.value,name:form.name.value||`${form.action.value} VM ${form.vmid.value}`,date:form.date?.value,days:Array.from(form.querySelectorAll('input[name="days"]:checked')).map(cb=>cb.value)};const success=await createSchedule(data);if(success)setShowScheduleModal(false);},className:"p-4 space-y-4"},/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"block text-sm text-gray-400 mb-1"},t('name')||'Name'),/*#__PURE__*/React.createElement("input",{name:"name",type:"text",placeholder:t('optionalName')||'Optional name',defaultValue:editingSchedule?.name||'',className:"w-full px-3 py-2 bg-proxmox-dark border border-proxmox-border rounded-lg"})),/*#__PURE__*/React.createElement("div",{className:"grid grid-cols-2 gap-4"},/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"block text-sm text-gray-400 mb-1"},"VMID"),/*#__PURE__*/React.createElement("input",{name:"vmid",type:"number",required:true,defaultValue:editingSchedule?.vmid||'',className:"w-full px-3 py-2 bg-proxmox-dark border border-proxmox-border rounded-lg"})),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"block text-sm text-gray-400 mb-1"},t('type')||'Type'),/*#__PURE__*/React.createElement("select",{name:"vm_type",defaultValue:editingSchedule?.vm_type||'qemu',className:"w-full px-3 py-2 bg-proxmox-dark border border-proxmox-border rounded-lg"},/*#__PURE__*/React.createElement("option",{value:"qemu"},"VM (QEMU)"),/*#__PURE__*/React.createElement("option",{value:"lxc"},"Container (LXC)")))),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"block text-sm text-gray-400 mb-1"},t('action')||'Action'),/*#__PURE__*/React.createElement("select",{name:"action",required:true,defaultValue:editingSchedule?.action||'start',className:"w-full px-3 py-2 bg-proxmox-dark border border-proxmox-border rounded-lg"},/*#__PURE__*/React.createElement("option",{value:"start"},t('start')||'Start'),/*#__PURE__*/React.createElement("option",{value:"stop"},t('stop')||'Stop'),/*#__PURE__*/React.createElement("option",{value:"shutdown"},t('shutdown')||'Shutdown'),/*#__PURE__*/React.createElement("option",{value:"reboot"},t('reboot')||'Reboot'),/*#__PURE__*/React.createElement("option",{value:"snapshot"},t('snapshot')||'Snapshot'))),/*#__PURE__*/React.createElement("div",{className:"grid grid-cols-2 gap-4"},/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"block text-sm text-gray-400 mb-1"},t('scheduleType')||'Schedule Type'),/*#__PURE__*/React.createElement("select",{name:"schedule_type",required:true,defaultValue:editingSchedule?.schedule_type||'daily',className:"w-full px-3 py-2 bg-proxmox-dark border border-proxmox-border rounded-lg"},/*#__PURE__*/React.createElement("option",{value:"daily"},t('daily')||'Daily'),/*#__PURE__*/React.createElement("option",{value:"weekdays"},t('weekdays')||'Weekdays'),/*#__PURE__*/React.createElement("option",{value:"weekends"},t('weekends')||'Weekends'),/*#__PURE__*/React.createElement("option",{value:"weekly"},t('weekly')||'Weekly'),/*#__PURE__*/React.createElement("option",{value:"once"},t('once')||'Once'))),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"block text-sm text-gray-400 mb-1"},t('time')||'Time'),/*#__PURE__*/React.createElement("input",{name:"time",type:"time",required:true,defaultValue:editingSchedule?.time||'',className:"w-full px-3 py-2 bg-proxmox-dark border border-proxmox-border rounded-lg"}))),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"block text-sm text-gray-400 mb-1"},t('date')||'Date'," (",t('forOnce')||'for once',")"),/*#__PURE__*/React.createElement("input",{name:"date",type:"date",defaultValue:editingSchedule?.date||'',className:"w-full px-3 py-2 bg-proxmox-dark border border-proxmox-border rounded-lg"})),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"block text-sm text-gray-400 mb-1"},t('days')||'Days'," (",t('forWeekly')||'for weekly',")"),/*#__PURE__*/React.createElement("div",{className:"flex flex-wrap gap-2"},['monday','tuesday','wednesday','thursday','friday','saturday','sunday'].map(day=>/*#__PURE__*/React.createElement("label",{key:day,className:"flex items-center gap-1 text-sm"},/*#__PURE__*/React.createElement("input",{type:"checkbox",name:"days",value:day,className:"rounded",defaultChecked:editingSchedule?.days?.includes(day)}),day.slice(0,3))))),/*#__PURE__*/React.createElement("div",{className:"flex gap-2 justify-end pt-2"},/*#__PURE__*/React.createElement("button",{type:"button",onClick:()=>setShowScheduleModal(false),className:"px-4 py-2 bg-proxmox-dark hover:bg-proxmox-hover rounded-lg"},t('cancel')||'Cancel'),/*#__PURE__*/React.createElement("button",{type:"submit",className:"px-4 py-2 bg-proxmox-orange hover:bg-orange-600 rounded-lg"},t('save')||'Save'))))),showTagEditor&&/*#__PURE__*/React.createElement("div",{className:"fixed inset-0 bg-black/70 flex items-center justify-center z-50 p-4",onClick:()=>setShowTagEditor(null)},/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl w-full max-w-sm",onClick:e=>e.stopPropagation()},/*#__PURE__*/React.createElement("div",{className:"p-4 border-b border-proxmox-border"},/*#__PURE__*/React.createElement("h3",{className:"font-semibold flex items-center gap-2"},/*#__PURE__*/React.createElement(Icons.Tag,null),t('manageTags')||'Manage Tags',": ",showTagEditor.vmName)),/*#__PURE__*/React.createElement("div",{className:"p-4 space-y-4"},/*#__PURE__*/React.createElement("div",{className:"flex flex-wrap gap-2"},getVmTags(showTagEditor.clusterId,showTagEditor.vmid).map((tag,idx)=>/*#__PURE__*/React.createElement("span",{key:idx,className:"flex items-center gap-1 px-2 py-1 rounded-full text-xs",style:{backgroundColor:(tag.color||'#6b7280')+'30',color:tag.color||'#9ca3af'}},tag.name||tag,/*#__PURE__*/React.createElement("button",{onClick:()=>removeTagFromVm(showTagEditor.clusterId,showTagEditor.vmid,tag.name||tag),className:"hover:text-red-400"},/*#__PURE__*/React.createElement(Icons.X,{className:"w-3 h-3"})))),getVmTags(showTagEditor.clusterId,showTagEditor.vmid).length===0&&/*#__PURE__*/React.createElement("span",{className:"text-gray-500 text-sm"},t('noTags')||'No tags')),/*#__PURE__*/React.createElement("div",{className:"flex gap-2"},/*#__PURE__*/React.createElement("input",{type:"text",value:newTagName,onChange:e=>setNewTagName(e.target.value),onKeyDown:async e=>{if(e.key==='Enter'&&newTagName.trim()){await addTagToVm(showTagEditor.clusterId,showTagEditor.vmid,newTagName.trim());setNewTagName('');}},placeholder:t('newTag')||'New tag...',className:"flex-1 px-3 py-2 bg-proxmox-dark border border-proxmox-border rounded-lg text-sm"}),/*#__PURE__*/React.createElement("button",{onClick:async()=>{if(newTagName.trim()){await addTagToVm(showTagEditor.clusterId,showTagEditor.vmid,newTagName.trim());setNewTagName('');}},className:"px-3 py-2 bg-proxmox-orange hover:bg-orange-600 rounded-lg"},/*#__PURE__*/React.createElement(Icons.Plus,{className:"w-4 h-4"}))),clusterTags.length>0&&/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("p",{className:"text-xs text-gray-500 mb-2"},t('existingTags')||'Existing tags',":"),/*#__PURE__*/React.createElement("div",{className:"flex flex-wrap gap-1"},clusterTags.filter(t=>!getVmTags(showTagEditor.clusterId,showTagEditor.vmid).some(vt=>(vt.name||vt)===t.name)).slice(0,10).map((tag,idx)=>/*#__PURE__*/React.createElement("button",{key:idx,onClick:()=>addTagToVm(showTagEditor.clusterId,showTagEditor.vmid,tag.name,tag.color),className:"px-2 py-0.5 rounded-full text-xs hover:opacity-80",style:{backgroundColor:(tag.color||'#6b7280')+'30',color:tag.color||'#9ca3af'}},"+ ",tag.name))))),/*#__PURE__*/React.createElement("div",{className:"p-4 border-t border-proxmox-border"},/*#__PURE__*/React.createElement("button",{onClick:()=>setShowTagEditor(null),className:"w-full px-4 py-2 bg-proxmox-dark hover:bg-proxmox-hover rounded-lg"},t('close')||'Close')))),showAlertModal&&/*#__PURE__*/React.createElement("div",{className:"fixed inset-0 bg-black/70 flex items-center justify-center z-50 p-4",onClick:()=>{setShowAlertModal(false);setEditingAlert(null);}},/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl w-full max-w-md",onClick:e=>e.stopPropagation()},/*#__PURE__*/React.createElement("div",{className:"p-4 border-b border-proxmox-border flex justify-between items-center"},/*#__PURE__*/React.createElement("h3",{className:"text-lg font-semibold"},editingAlert?t('editAlert')||'Edit Alert':t('newAlert')||'New Alert'),/*#__PURE__*/React.createElement("button",{onClick:()=>{setShowAlertModal(false);setEditingAlert(null);},className:"p-1 hover:bg-proxmox-hover rounded"},/*#__PURE__*/React.createElement(Icons.X,null))),/*#__PURE__*/React.createElement("form",{key:editingAlert?'edit-'+editingAlert.id:'new-alert',onSubmit:async e=>{e.preventDefault();const form=e.target;// NS Apr 2026 #213 — channels is the new field; keep `action` +setTimeout(()=>{const event=new CustomEvent('pegaprox-navigate-updates');window.dispatchEvent(event);},100);},className:"flex-1 px-4 py-2.5 bg-gradient-to-r from-green-500 to-emerald-500 hover:from-green-600 hover:to-emerald-600 rounded-lg text-white font-medium transition-all"},t('viewUpdate')||'View Update'))))),configVm&&(configVm._clusterId||selectedCluster)&&/*#__PURE__*/React.createElement(ConfigModal,{vm:configVm,clusterId:configVm._clusterId||selectedCluster.id,allClusters:clusters,dashboardAuthFetch:authFetch,onClose:handleCloseConfig,addToast:addToast,isCorporate:isCorporate}),configNode&&selectedCluster&&/*#__PURE__*/React.createElement(NodeModal,{node:configNode,clusterId:selectedCluster.id,clusterType:selectedCluster.cluster_type||'proxmox',onClose:()=>setConfigNode(null),addToast:addToast}),showRemoveNodeDash&&nodeToRemoveDash&&selectedCluster&&/*#__PURE__*/React.createElement(RemoveNodeConfirmModal,{isOpen:showRemoveNodeDash,onClose:()=>{setShowRemoveNodeDash(false);setNodeToRemoveDash(null);},node:nodeToRemoveDash,clusterId:selectedCluster.id,onSuccess:()=>{fetchClusterMetrics(selectedCluster.id);fetchClusterResources(selectedCluster.id);},addToast:addToast}),showMoveNodeDash&&nodeToMoveDash&&selectedCluster&&/*#__PURE__*/React.createElement(MoveNodeModal,{isOpen:showMoveNodeDash,onClose:()=>{setShowMoveNodeDash(false);setNodeToMoveDash(null);},nodeName:nodeToMoveDash,currentClusterId:selectedCluster.id,clusters:clusters,onSuccess:()=>{fetchClusterMetrics(selectedCluster.id);fetchClusterResources(selectedCluster.id);},addToast:addToast}),dashMigrateVm&&/*#__PURE__*/React.createElement(MigrateModal,{vm:dashMigrateVm,nodes:Object.keys(clusterMetrics),clusterId:dashMigrateVm._clusterId||selectedCluster?.id,onMigrate:handleMigrate,onClose:()=>setDashMigrateVm(null)}),dashCloneVm&&/*#__PURE__*/React.createElement(CloneVmModal,{vm:dashCloneVm,nodes:Object.keys(clusterMetrics),clusterId:dashCloneVm._clusterId||selectedCluster?.id,storages:clusterDatastores,onClone:handleCloneVm,onClose:()=>setDashCloneVm(null)}),dashDeleteVm&&/*#__PURE__*/React.createElement(DeleteVmModal,{vm:dashDeleteVm,clusterId:dashDeleteVm._clusterId||selectedCluster?.id,onDelete:handleDeleteVm,onClose:()=>setDashDeleteVm(null)}),dashCrossClusterVm&&clusters.length>1&&/*#__PURE__*/React.createElement(CrossClusterMigrateModal,{vm:dashCrossClusterVm,sourceCluster:selectedCluster,clusters:clusters,onMigrate:handleCrossClusterMigrate,onClose:()=>setDashCrossClusterVm(null)}),dashSnapshotVm&&/*#__PURE__*/React.createElement(CreateSnapshotModal,{isQemu:dashSnapshotVm.type==='qemu',loading:dashSnapshotLoading,onSubmit:handleDashSnapshotSubmit,onClose:()=>setDashSnapshotVm(null)}),showCreateVm&&selectedCluster&&/*#__PURE__*/React.createElement(CreateVmModal,{vmType:showCreateVm,clusterId:selectedCluster.id,clusterType:selectedCluster.cluster_type||'proxmox',nodes:Object.keys(clusterMetrics),onCreate:handleCreateVm,onClose:()=>setShowCreateVm(null)}),ctxMenu&&isCorporate&&/*#__PURE__*/React.createElement(ContextMenu,{items:buildContextMenuItems(ctxMenu.type,ctxMenu.target),position:ctxMenu.position,onClose:()=>setCtxMenu(null)}),showAddVMware&&/*#__PURE__*/React.createElement("div",{className:"fixed inset-0 bg-black/70 flex items-center justify-center z-50 p-4"},/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-2xl w-full max-w-lg shadow-2xl"},/*#__PURE__*/React.createElement("div",{className:"p-6 border-b border-proxmox-border flex items-center justify-between"},/*#__PURE__*/React.createElement("h2",{className:"text-lg font-bold text-white"},editingVMware?'Edit ESXi Server':t('addEsxiServer')),/*#__PURE__*/React.createElement("button",{onClick:()=>{setShowAddVMware(false);setEditingVMware(null);setVmwareTestResult(null);},className:"p-1 text-gray-500 hover:text-white rounded"},/*#__PURE__*/React.createElement(Icons.X,{className:"w-5 h-5"}))),/*#__PURE__*/React.createElement("div",{className:"p-6 space-y-4"},/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"block text-sm text-gray-400 mb-1"},t('name')),/*#__PURE__*/React.createElement("input",{value:vmwareForm.name,onChange:e=>setVmwareForm(f=>({...f,name:e.target.value})),placeholder:"My ESXi Host",className:"w-full px-3 py-2 bg-proxmox-dark border border-proxmox-border rounded-lg text-white text-sm focus:outline-none focus:border-emerald-500/50"})),/*#__PURE__*/React.createElement("div",{className:"grid grid-cols-3 gap-3"},/*#__PURE__*/React.createElement("div",{className:"col-span-2"},/*#__PURE__*/React.createElement("label",{className:"block text-sm text-gray-400 mb-1"},t('host')),/*#__PURE__*/React.createElement("input",{value:vmwareForm.host,onChange:e=>setVmwareForm(f=>({...f,host:e.target.value})),placeholder:"192.168.1.100",className:"w-full px-3 py-2 bg-proxmox-dark border border-proxmox-border rounded-lg text-white text-sm focus:outline-none focus:border-emerald-500/50"})),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"block text-sm text-gray-400 mb-1"},t('port')),/*#__PURE__*/React.createElement("input",{type:"number",value:vmwareForm.port,onChange:e=>setVmwareForm(f=>({...f,port:parseInt(e.target.value)||443})),className:"w-full px-3 py-2 bg-proxmox-dark border border-proxmox-border rounded-lg text-white text-sm focus:outline-none focus:border-emerald-500/50"}))),/*#__PURE__*/React.createElement("div",{className:"grid grid-cols-2 gap-3"},/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"block text-sm text-gray-400 mb-1"},t('esxiUsername')),/*#__PURE__*/React.createElement("input",{value:vmwareForm.username,onChange:e=>setVmwareForm(f=>({...f,username:e.target.value})),placeholder:"root",className:"w-full px-3 py-2 bg-proxmox-dark border border-proxmox-border rounded-lg text-white text-sm focus:outline-none focus:border-emerald-500/50"})),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"block text-sm text-gray-400 mb-1"},t('esxiPassword')),/*#__PURE__*/React.createElement("input",{type:"password",value:vmwareForm.password,onChange:e=>setVmwareForm(f=>({...f,password:e.target.value})),placeholder:editingVMware?'(unchanged)':'Password',className:"w-full px-3 py-2 bg-proxmox-dark border border-proxmox-border rounded-lg text-white text-sm focus:outline-none focus:border-emerald-500/50"}))),/*#__PURE__*/React.createElement("label",{className:"flex items-center gap-2 cursor-pointer"},/*#__PURE__*/React.createElement("input",{type:"checkbox",checked:vmwareForm.ssl_verify,onChange:e=>setVmwareForm(f=>({...f,ssl_verify:e.target.checked})),className:"rounded"}),/*#__PURE__*/React.createElement("span",{className:"text-sm text-gray-400"},"Verify SSL certificate")),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"block text-sm text-gray-400 mb-1"},t('notes')),/*#__PURE__*/React.createElement("textarea",{value:vmwareForm.notes,onChange:e=>setVmwareForm(f=>({...f,notes:e.target.value})),rows:2,className:"w-full px-3 py-2 bg-proxmox-dark border border-proxmox-border rounded-lg text-white text-sm focus:outline-none focus:border-emerald-500/50 resize-none"})),/*#__PURE__*/React.createElement("div",{className:"bg-blue-500/5 border border-blue-500/20 rounded-lg p-3"},/*#__PURE__*/React.createElement("div",{className:"text-xs text-blue-300 font-semibold mb-1"},t('requirements')||'Requirements'),/*#__PURE__*/React.createElement("div",{className:"text-xs text-blue-300/80"},"- ",t('reqSshEnabled')||'SSH must be enabled on the ESXi host'),/*#__PURE__*/React.createElement("div",{className:"text-xs text-blue-300/80"},"- ",t('reqEsxiRoot')||'ESXi root credentials are required for VM migration'),/*#__PURE__*/React.createElement("div",{className:"text-xs text-blue-300/80"},"- ",t('reqVmwareTools')||'VMware Tools recommended for clean shutdown during cutover (not strictly required)')),vmwareTestResult&&/*#__PURE__*/React.createElement("div",{className:`p-3 rounded-lg text-sm ${vmwareTestResult.error?'bg-red-500/10 border border-red-500/30 text-red-400':'bg-green-500/10 border border-green-500/30 text-green-400'}`},vmwareTestResult.error?`Connection failed: ${vmwareTestResult.error}`:'Connection successful!')),/*#__PURE__*/React.createElement("div",{className:"p-6 border-t border-proxmox-border flex items-center justify-between"},/*#__PURE__*/React.createElement("button",{onClick:()=>handleTestVMware(vmwareForm),disabled:vmwareTestLoading||!vmwareForm.host,className:"px-4 py-2 rounded-lg bg-proxmox-dark border border-proxmox-border text-gray-400 hover:text-white text-sm disabled:opacity-50"},vmwareTestLoading?'Testing...':t('testConnection')),/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-2"},/*#__PURE__*/React.createElement("button",{onClick:()=>{setShowAddVMware(false);setEditingVMware(null);setVmwareTestResult(null);},className:"px-4 py-2 rounded-lg text-gray-400 hover:text-white text-sm"},t('cancel')),/*#__PURE__*/React.createElement("button",{onClick:()=>editingVMware?handleUpdateVMware(editingVMware.id,vmwareForm):handleAddVMware(vmwareForm),disabled:!vmwareForm.host||!editingVMware&&!vmwareForm.password,className:"px-4 py-2 rounded-lg bg-emerald-500 text-white text-sm font-medium hover:bg-emerald-600 disabled:opacity-50"},editingVMware?t('update'):'Add Server'))))),consoleStack.map(c=>c.info?/*#__PURE__*/React.createElement(ConsoleModal,{key:c.id,vm:c.vm,consoleInfo:c.info,clusterId:c.vm._clusterId||selectedCluster?.id,onClose:()=>handleCloseConsole(c.id),hidden:c.id!==activeConsoleId}):null),consoleStack.length>=2&&/*#__PURE__*/React.createElement("div",{style:{position:'fixed',bottom:0,left:0,right:0,zIndex:60,pointerEvents:'none',display:'flex',justifyContent:'center'}},/*#__PURE__*/React.createElement("div",{style:{pointerEvents:'auto',background:'var(--corp-surface, #1c2733)',border:'1px solid var(--corp-border, #29414e)',borderBottom:'none',borderTopLeftRadius:'8px',borderTopRightRadius:'8px',boxShadow:'0 -4px 12px rgba(0,0,0,0.3)',padding:'6px 8px',display:'flex',gap:'4px',maxWidth:'90vw',overflowX:'auto'}},consoleStack.map(c=>{const active=c.id===activeConsoleId;const label=c.vm.name||`${c.vm.type==='qemu'?'VM':c.vm.type==='lxc'?'CT':''} ${c.vm.vmid}`;return/*#__PURE__*/React.createElement("div",{key:c.id,onClick:()=>setActiveConsoleId(c.id),className:"flex items-center gap-2 px-3 py-1.5 text-xs cursor-pointer",style:{background:active?'var(--corp-accent, #0078a8)':'var(--corp-surface-2, #29414e)',color:'#fff',borderRadius:'4px',fontWeight:active?600:500,whiteSpace:'nowrap',userSelect:'none'}},/*#__PURE__*/React.createElement(Icons.Monitor,{className:"w-3 h-3"}),/*#__PURE__*/React.createElement("span",{style:{maxWidth:'180px',overflow:'hidden',textOverflow:'ellipsis'}},label),/*#__PURE__*/React.createElement("button",{onClick:e=>{e.stopPropagation();handleCloseConsole(c.id);},style:{background:'rgba(255,255,255,0.15)',color:'#fff',border:'none',borderRadius:'50%',width:'16px',height:'16px',lineHeight:'14px',fontSize:'10px',padding:0,cursor:'pointer'},title:"Close"},"\xD7"));}))),lxcShellVm&&/*#__PURE__*/React.createElement(LxcShellModal,{vm:lxcShellVm,clusterId:lxcShellVm._clusterId||selectedCluster?.id,addToast:addToast,onClose:()=>setLxcShellVm(null)}),corpMetricsVm&&selectedCluster&&/*#__PURE__*/React.createElement(VmMetricsModal,{vm:corpMetricsVm,clusterId:selectedCluster.id,onClose:()=>setCorpMetricsVm(null)}),showHaSettings&&selectedCluster&&/*#__PURE__*/React.createElement("div",{className:"fixed inset-0 bg-black/70 flex items-center justify-center z-50 p-4",onClick:()=>setShowHaSettings(false)},/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl w-full max-w-xl max-h-[85vh] overflow-hidden",onClick:e=>e.stopPropagation()},/*#__PURE__*/React.createElement("div",{className:"flex justify-between items-center p-4 border-b border-proxmox-border bg-proxmox-dark"},/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("h2",{className:"text-lg font-semibold text-white flex items-center gap-2"},/*#__PURE__*/React.createElement(Icons.Shield,{className:"text-green-400"}),t('splitBrainProtection')),/*#__PURE__*/React.createElement("p",{className:"text-sm text-gray-500"},selectedCluster.name)),/*#__PURE__*/React.createElement("button",{onClick:()=>setShowHaSettings(false),className:"p-2 hover:bg-proxmox-hover rounded-lg"},/*#__PURE__*/React.createElement(Icons.X,null))),/*#__PURE__*/React.createElement("div",{className:"p-4 overflow-y-auto",style:{maxHeight:'calc(85vh - 140px)'}},(()=>{const fs=haStatus?.split_brain_prevention?.fence_strategy;const warn=haStatus?.split_brain_prevention?.fence_strategy_warning;if(!fs&&!warn)return null;const strat=fs?.strategy||'unknown';const colour=strat==='wait'?'bg-yellow-500/10 border-yellow-500/30 text-yellow-300':strat==='quorum'?'bg-blue-500/10 border-blue-500/30 text-blue-300':'bg-gray-500/10 border-gray-500/30 text-gray-300';const icon=strat==='wait'?'⚠️':strat==='quorum'?'🛡️':'ℹ️';return/*#__PURE__*/React.createElement("div",{className:`p-4 ${colour} border rounded-xl mb-4`},/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-2 mb-2"},/*#__PURE__*/React.createElement("span",{className:"text-xl"},icon),/*#__PURE__*/React.createElement("h4",{className:"font-medium"},t('fenceStrategyLabel')||'Fence strategy',": ",/*#__PURE__*/React.createElement("span",{className:"font-mono text-sm uppercase"},strat)),fs?.expected_votes!=null&&/*#__PURE__*/React.createElement("span",{className:"text-xs opacity-70 ml-auto"},fs.expected_votes," votes \xB7 qdevice: ",fs.has_qdevice?'yes':'no')),warn&&/*#__PURE__*/React.createElement("p",{className:"text-sm mb-2"},warn),fs?.reason&&/*#__PURE__*/React.createElement("p",{className:"text-xs opacity-80"},fs.reason),fs?.detected_at&&/*#__PURE__*/React.createElement("p",{className:"text-xs opacity-60 mt-2"},t('detectedAt')||'detected',": ",new Date(fs.detected_at).toLocaleString()));})(),/*#__PURE__*/React.createElement("div",{className:"p-4 bg-green-500/10 border border-green-500/30 rounded-xl mb-4"},/*#__PURE__*/React.createElement("div",{className:"flex items-center gap-2 mb-3"},/*#__PURE__*/React.createElement("span",{className:"text-2xl"},"\uD83D\uDEE1\uFE0F"),/*#__PURE__*/React.createElement("h4",{className:"text-green-400 font-medium"},t('selfFenceProtection')),/*#__PURE__*/React.createElement("span",{className:"px-2 py-1 rounded text-xs bg-green-500/20 text-green-400 ml-auto"},t('recommended'))),/*#__PURE__*/React.createElement("p",{className:"text-sm text-gray-300 mb-3"},t('selfFenceExplain')),haStatus?.self_fence_installed?/*#__PURE__*/React.createElement("div",{className:"p-3 bg-green-500/20 rounded-lg"},/*#__PURE__*/React.createElement("div",{className:"flex items-center justify-between"},/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("p",{className:"text-green-400 font-medium"},"\u2705 ",t('selfFenceActive')),/*#__PURE__*/React.createElement("p",{className:"text-xs text-gray-400 mt-1"},t('agentInstalledOnNodes'),": ",haStatus.self_fence_nodes?.join(', ')||t('allNodes'))),/*#__PURE__*/React.createElement("button",{onClick:async()=>{if(!confirm(t('confirmUninstallAgent')))return;try{const res=await authFetch(`${API_URL}/clusters/${selectedCluster.id}/ha/uninstall-self-fence`,{method:'POST'});if(res.ok){addToast(t('selfFenceUninstalling'),'success');setTimeout(()=>fetchHAStatus(selectedCluster.id),3000);}}catch(e){addToast(t('error')+': '+e.message,'error');}},className:"px-3 py-1 text-xs bg-red-500/20 hover:bg-red-500/30 text-red-400 rounded-lg"},t('uninstall')))):/*#__PURE__*/React.createElement("div",{className:"space-y-3"},/*#__PURE__*/React.createElement("div",{className:"p-3 bg-yellow-500/20 rounded-lg"},/*#__PURE__*/React.createElement("p",{className:"text-yellow-400 font-medium"},"\u26A1 ",t('selfFenceNotInstalled')),/*#__PURE__*/React.createElement("p",{className:"text-xs text-gray-300 mt-1"},t('selfFenceInstallHint'))),/*#__PURE__*/React.createElement("button",{onClick:async()=>{try{const res=await authFetch(`${API_URL}/clusters/${selectedCluster.id}/ha/install-self-fence`,{method:'POST'});if(res.ok){addToast(t('selfFenceInstalling'),'success');setTimeout(()=>fetchHAStatus(selectedCluster.id),5000);}}catch(e){addToast(t('error')+': '+e.message,'error');}},className:"w-full px-4 py-2 bg-green-600 hover:bg-green-500 rounded-lg text-white font-medium"},"\uD83D\uDEE1\uFE0F ",t('installSelfFenceAgent'))),/*#__PURE__*/React.createElement("div",{className:"mt-3 text-xs text-gray-400"},"\u2713 ",t('noSharedStorageNeeded')," \u2022 \u2713 ",t('worksWithLvmIscsi')),haStatus?.self_fence_installed&&/*#__PURE__*/React.createElement("div",{className:"mt-3 p-3 bg-blue-500/10 border border-blue-500/30 rounded-lg"},/*#__PURE__*/React.createElement("label",{className:"block text-sm text-blue-400 font-medium mb-1"},t('pegaproxVmRecovery')),/*#__PURE__*/React.createElement("p",{className:"text-xs text-gray-400 mb-2"},t('pegaproxVmRecoveryDesc')),/*#__PURE__*/React.createElement("select",{value:haSettings.pegaprox_vmid,onChange:e=>setHaSettings({...haSettings,pegaprox_vmid:e.target.value}),className:"w-full bg-proxmox-dark border border-proxmox-border rounded px-3 py-2 text-white text-sm"},/*#__PURE__*/React.createElement("option",{value:""},t('noVmSelected')),(clusterResources||[]).filter(v=>v.type==='qemu').sort((a,b)=>a.vmid-b.vmid).map(v=>/*#__PURE__*/React.createElement("option",{key:v.vmid,value:v.vmid},v.vmid," - ",v.name," (",v.node,")"))),haSettings.pegaprox_vmid&&/*#__PURE__*/React.createElement("p",{className:"text-xs text-blue-300 mt-1"},t('pegaproxVmRecoveryActive')))),/*#__PURE__*/React.createElement("label",{className:"flex items-center gap-3 p-3 bg-proxmox-dark border border-proxmox-border rounded-xl mb-4 cursor-pointer hover:border-proxmox-orange/50"},/*#__PURE__*/React.createElement("input",{type:"checkbox",checked:haSettings.two_node_mode,onChange:e=>setHaSettings({...haSettings,two_node_mode:e.target.checked}),className:"w-5 h-5 rounded border-proxmox-border bg-proxmox-darker text-proxmox-orange"}),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("span",{className:"text-white font-medium"},t('enable2NodeMode')),/*#__PURE__*/React.createElement("p",{className:"text-xs text-gray-500"},t('twoNodeModeDesc')))),/*#__PURE__*/React.createElement("div",{className:"grid grid-cols-2 gap-4 mb-4"},/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"block text-sm text-gray-400 mb-1"},t('recoveryDelay')),/*#__PURE__*/React.createElement("input",{type:"number",min:"10",max:"300",value:haSettings.recovery_delay,onChange:e=>setHaSettings({...haSettings,recovery_delay:parseInt(e.target.value)||30}),className:"w-full bg-proxmox-dark border border-proxmox-border rounded-lg px-3 py-2 text-white"}),/*#__PURE__*/React.createElement("p",{className:"text-xs text-gray-500 mt-1"},t('recoveryDelayHint'))),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"block text-sm text-gray-400 mb-1"},t('failureThreshold')),/*#__PURE__*/React.createElement("input",{type:"number",min:"1",max:"10",value:haSettings.failure_threshold,onChange:e=>setHaSettings({...haSettings,failure_threshold:parseInt(e.target.value)||3}),className:"w-full bg-proxmox-dark border border-proxmox-border rounded-lg px-3 py-2 text-white"}),/*#__PURE__*/React.createElement("p",{className:"text-xs text-gray-500 mt-1"},t('failureThresholdHint')))),/*#__PURE__*/React.createElement("details",{className:"group bg-proxmox-dark border border-proxmox-border rounded-xl overflow-hidden"},/*#__PURE__*/React.createElement("summary",{className:"p-3 cursor-pointer hover:bg-proxmox-hover flex items-center justify-between text-sm"},/*#__PURE__*/React.createElement("span",{className:"text-gray-400"},t('advancedSettings')),/*#__PURE__*/React.createElement(Icons.ChevronDown,{className:"w-4 h-4 text-gray-400 transition-transform group-open:rotate-180"})),/*#__PURE__*/React.createElement("div",{className:"p-3 pt-0 space-y-3 border-t border-proxmox-border"},/*#__PURE__*/React.createElement("div",{className:"grid grid-cols-2 gap-3"},/*#__PURE__*/React.createElement("label",{className:"flex items-center gap-2 p-2 bg-proxmox-darker rounded-lg"},/*#__PURE__*/React.createElement("input",{type:"checkbox",checked:haSettings.self_fence_enabled,onChange:e=>setHaSettings({...haSettings,self_fence_enabled:e.target.checked}),className:"w-4 h-4 rounded"}),/*#__PURE__*/React.createElement("span",{className:"text-sm text-white"},t('selfFencing'))),/*#__PURE__*/React.createElement("label",{className:"flex items-center gap-2 p-2 bg-proxmox-darker rounded-lg"},/*#__PURE__*/React.createElement("input",{type:"checkbox",checked:haSettings.verify_network,onChange:e=>setHaSettings({...haSettings,verify_network:e.target.checked}),className:"w-4 h-4 rounded"}),/*#__PURE__*/React.createElement("span",{className:"text-sm text-white"},t('networkCheck')))),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"block text-xs text-gray-400 mb-1"},t('additionalQuorumHosts')),/*#__PURE__*/React.createElement("input",{type:"text",value:haSettings.quorum_hosts,onChange:e=>setHaSettings({...haSettings,quorum_hosts:e.target.value}),placeholder:"8.8.8.8, 1.1.1.1",className:"w-full bg-proxmox-darker border border-proxmox-border rounded-lg px-3 py-2 text-white text-sm"})),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"block text-xs text-gray-400 mb-1"},t('gatewayIp')),/*#__PURE__*/React.createElement("input",{type:"text",value:haSettings.quorum_gateway,onChange:e=>setHaSettings({...haSettings,quorum_gateway:e.target.value}),placeholder:"192.168.1.1",className:"w-full bg-proxmox-darker border border-proxmox-border rounded-lg px-3 py-2 text-white text-sm"}))))),/*#__PURE__*/React.createElement("div",{className:"flex justify-end gap-2 p-4 border-t border-proxmox-border bg-proxmox-dark"},/*#__PURE__*/React.createElement("button",{onClick:()=>setShowHaSettings(false),className:"px-4 py-2 bg-proxmox-dark hover:bg-proxmox-hover border border-proxmox-border rounded-lg"},t('cancel')),/*#__PURE__*/React.createElement("button",{onClick:handleSaveHASettings,className:"flex items-center gap-2 px-4 py-2 bg-proxmox-orange hover:bg-orange-600 rounded-lg"},/*#__PURE__*/React.createElement(Icons.Save,{className:"w-4 h-4"}),t('saveSettings'))))),/*#__PURE__*/React.createElement("footer",{className:"border-t border-proxmox-border bg-proxmox-dark/50 mt-8"},/*#__PURE__*/React.createElement("div",{className:"max-w-[800px] mx-auto px-6 py-6"},/*#__PURE__*/React.createElement("div",{className:"text-center mb-4"},/*#__PURE__*/React.createElement("p",{className:"text-sm text-gray-400"},"\u2764\uFE0F ",t('thanksToSponsors')||'Thanks to our Sponsors')),/*#__PURE__*/React.createElement("div",{className:"flex justify-center gap-3 flex-wrap"},[1,2,3,4,5,6,7,8].map(num=>/*#__PURE__*/React.createElement(SponsorSlot,{key:num,num:num}))),/*#__PURE__*/React.createElement("div",{className:"flex justify-center mt-4"},/*#__PURE__*/React.createElement("a",{href:"https://opencollective.com/pegaprox",target:"_blank",rel:"noopener noreferrer",title:"Contribute on Open Collective"},/*#__PURE__*/React.createElement("img",{src:"/images/oc_contribute_button.png",alt:"Contribute to our Collective",className:"h-8 w-auto hover:opacity-90 transition-opacity"}))),/*#__PURE__*/React.createElement("div",{className:"text-center mt-4 text-xs text-gray-600"},/*#__PURE__*/React.createElement("p",null,"PegaProx ",PEGAPROX_VERSION," \u2022 ",t('madeWithLove')||'Made with ❤️ for the Proxmox community')))),isCorporate&&showEventLog&&corpEventLog.length>0&&/*#__PURE__*/React.createElement("div",{className:"corp-event-log"},corpEventLog.map(evt=>/*#__PURE__*/React.createElement("div",{key:evt.id,className:"corp-event-item"},/*#__PURE__*/React.createElement("span",{className:"corp-event-time"},evt.time.toLocaleTimeString([],{hour:'2-digit',minute:'2-digit',second:'2-digit'})),/*#__PURE__*/React.createElement("span",{className:`corp-event-type-${evt.type}`},"\u25CF"),/*#__PURE__*/React.createElement("span",null,evt.msg),evt.user&&/*#__PURE__*/React.createElement("span",{style:{color:'#5a7a8a',marginLeft:'auto'}},evt.user)))),isCorporate&&/*#__PURE__*/React.createElement("div",{className:"corp-status-bar"},/*#__PURE__*/React.createElement("div",{className:"corp-status-bar-item"},/*#__PURE__*/React.createElement("div",{className:`w-1.5 h-1.5 rounded-full ${wsConnected?'bg-green-500':'bg-yellow-500'}`}),/*#__PURE__*/React.createElement("span",null,wsConnected?t('connectionLive')||'Live':t('connectionPolling')||'Polling')),/*#__PURE__*/React.createElement("div",{className:"corp-status-bar-item"},selectedCluster?/*#__PURE__*/React.createElement("span",null,selectedCluster.display_name||selectedCluster.name):/*#__PURE__*/React.createElement("span",null,clusters.length," ",t('clusters'))),(()=>{const runningTasks=tasks.filter(t=>t&&t.status==='running').length;return runningTasks>0?/*#__PURE__*/React.createElement("div",{className:"corp-status-bar-item"},/*#__PURE__*/React.createElement(Icons.Layers,{style:{width:11,height:11}}),/*#__PURE__*/React.createElement("span",null,/*#__PURE__*/React.createElement("strong",null,runningTasks)," ",runningTasks===1?'Task':'Tasks')):null;})(),/*#__PURE__*/React.createElement("div",{className:"corp-status-bar-item"},(()=>{const vms=clusterResources.filter(r=>r.type==='qemu'||r.type==='lxc');const running=vms.filter(r=>r.status==='running').length;return/*#__PURE__*/React.createElement("span",null,/*#__PURE__*/React.createElement("strong",null,running),"/",vms.length," VMs");})()),/*#__PURE__*/React.createElement("div",{className:"corp-status-bar-item"},user?.username," (",user?.role,")"),/*#__PURE__*/React.createElement("div",{style:{flex:1}}),corpEventLog.length>0&&/*#__PURE__*/React.createElement("div",{className:"corp-status-bar-item",style:{cursor:'pointer'},onClick:()=>setShowEventLog(v=>!v)},/*#__PURE__*/React.createElement(Icons.Activity,{style:{width:11,height:11}}),/*#__PURE__*/React.createElement("span",null,corpEventLog.length," ",showEventLog?'▾':'▴')),lastUpdate&&/*#__PURE__*/React.createElement("div",{className:"corp-status-bar-item"},/*#__PURE__*/React.createElement("span",null,lastUpdate.toLocaleTimeString([],{hour:'2-digit',minute:'2-digit'}))),/*#__PURE__*/React.createElement("div",{className:"corp-status-bar-item",style:{borderRight:'none'}},"PegaProx ",PEGAPROX_VERSION)),ReactDOM.createPortal(React.createElement('div',{style:{position:'fixed',bottom:isCorporate?64:24,right:24,zIndex:99999,display:'flex',flexDirection:'column',gap:8}},toasts.map(toast=>React.createElement(Toast,{key:toast.id,message:toast.message,type:toast.type,onClose:()=>removeToast(toast.id)}))),document.body),sessionExpired&&ReactDOM.createPortal(/*#__PURE__*/React.createElement("div",{className:"fixed inset-0 flex items-center justify-center p-4",style:{zIndex:100000,background:'rgba(0,0,0,0.8)',backdropFilter:'blur(2px)'}},/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl w-full max-w-sm p-7 text-center"},/*#__PURE__*/React.createElement("div",{className:"mx-auto mb-4 rounded-full bg-yellow-500/15 flex items-center justify-center",style:{width:52,height:52}},/*#__PURE__*/React.createElement(Icons.Lock,{className:"w-6 h-6 text-yellow-400"})),/*#__PURE__*/React.createElement("h3",{className:"text-lg font-semibold mb-5"},t('sessionExpired')||'Session expired'),/*#__PURE__*/React.createElement("button",{onClick:()=>{setSessionExpired(false);logout();},className:"w-full px-4 py-2.5 bg-proxmox-orange hover:bg-orange-600 rounded-lg font-medium"},t('login')||'Log in'))),document.body),showScheduleModal&&/*#__PURE__*/React.createElement("div",{className:"fixed inset-0 bg-black/70 flex items-center justify-center z-50 p-4"},/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl w-full max-w-md"},/*#__PURE__*/React.createElement("div",{className:"p-4 border-b border-proxmox-border flex justify-between items-center"},/*#__PURE__*/React.createElement("h3",{className:"text-lg font-semibold"},editingSchedule?t('editSchedule')||'Edit Schedule':t('newSchedule')||'New Schedule'),/*#__PURE__*/React.createElement("button",{onClick:()=>setShowScheduleModal(false),className:"p-1 hover:bg-proxmox-hover rounded"},/*#__PURE__*/React.createElement(Icons.X,null))),/*#__PURE__*/React.createElement("form",{key:editingSchedule?.id||'new',onSubmit:async e=>{e.preventDefault();const form=e.target;const data={cluster_id:selectedCluster?.id,vmid:parseInt(form.vmid.value),vm_type:form.vm_type.value,action:form.action.value,schedule_type:form.schedule_type.value,time:form.time.value,name:form.name.value||`${form.action.value} VM ${form.vmid.value}`,date:form.date?.value,days:Array.from(form.querySelectorAll('input[name="days"]:checked')).map(cb=>cb.value)};const success=await createSchedule(data);if(success)setShowScheduleModal(false);},className:"p-4 space-y-4"},/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"block text-sm text-gray-400 mb-1"},t('name')||'Name'),/*#__PURE__*/React.createElement("input",{name:"name",type:"text",placeholder:t('optionalName')||'Optional name',defaultValue:editingSchedule?.name||'',className:"w-full px-3 py-2 bg-proxmox-dark border border-proxmox-border rounded-lg"})),/*#__PURE__*/React.createElement("div",{className:"grid grid-cols-2 gap-4"},/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"block text-sm text-gray-400 mb-1"},"VMID"),/*#__PURE__*/React.createElement("input",{name:"vmid",type:"number",required:true,defaultValue:editingSchedule?.vmid||'',className:"w-full px-3 py-2 bg-proxmox-dark border border-proxmox-border rounded-lg"})),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"block text-sm text-gray-400 mb-1"},t('type')||'Type'),/*#__PURE__*/React.createElement("select",{name:"vm_type",defaultValue:editingSchedule?.vm_type||'qemu',className:"w-full px-3 py-2 bg-proxmox-dark border border-proxmox-border rounded-lg"},/*#__PURE__*/React.createElement("option",{value:"qemu"},"VM (QEMU)"),/*#__PURE__*/React.createElement("option",{value:"lxc"},"Container (LXC)")))),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"block text-sm text-gray-400 mb-1"},t('action')||'Action'),/*#__PURE__*/React.createElement("select",{name:"action",required:true,defaultValue:editingSchedule?.action||'start',className:"w-full px-3 py-2 bg-proxmox-dark border border-proxmox-border rounded-lg"},/*#__PURE__*/React.createElement("option",{value:"start"},t('start')||'Start'),/*#__PURE__*/React.createElement("option",{value:"stop"},t('stop')||'Stop'),/*#__PURE__*/React.createElement("option",{value:"shutdown"},t('shutdown')||'Shutdown'),/*#__PURE__*/React.createElement("option",{value:"reboot"},t('reboot')||'Reboot'),/*#__PURE__*/React.createElement("option",{value:"snapshot"},t('snapshot')||'Snapshot'))),/*#__PURE__*/React.createElement("div",{className:"grid grid-cols-2 gap-4"},/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"block text-sm text-gray-400 mb-1"},t('scheduleType')||'Schedule Type'),/*#__PURE__*/React.createElement("select",{name:"schedule_type",required:true,defaultValue:editingSchedule?.schedule_type||'daily',className:"w-full px-3 py-2 bg-proxmox-dark border border-proxmox-border rounded-lg"},/*#__PURE__*/React.createElement("option",{value:"daily"},t('daily')||'Daily'),/*#__PURE__*/React.createElement("option",{value:"weekdays"},t('weekdays')||'Weekdays'),/*#__PURE__*/React.createElement("option",{value:"weekends"},t('weekends')||'Weekends'),/*#__PURE__*/React.createElement("option",{value:"weekly"},t('weekly')||'Weekly'),/*#__PURE__*/React.createElement("option",{value:"once"},t('once')||'Once'))),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"block text-sm text-gray-400 mb-1"},t('time')||'Time'),/*#__PURE__*/React.createElement("input",{name:"time",type:"time",required:true,defaultValue:editingSchedule?.time||'',className:"w-full px-3 py-2 bg-proxmox-dark border border-proxmox-border rounded-lg"}))),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"block text-sm text-gray-400 mb-1"},t('date')||'Date'," (",t('forOnce')||'for once',")"),/*#__PURE__*/React.createElement("input",{name:"date",type:"date",defaultValue:editingSchedule?.date||'',className:"w-full px-3 py-2 bg-proxmox-dark border border-proxmox-border rounded-lg"})),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("label",{className:"block text-sm text-gray-400 mb-1"},t('days')||'Days'," (",t('forWeekly')||'for weekly',")"),/*#__PURE__*/React.createElement("div",{className:"flex flex-wrap gap-2"},['monday','tuesday','wednesday','thursday','friday','saturday','sunday'].map(day=>/*#__PURE__*/React.createElement("label",{key:day,className:"flex items-center gap-1 text-sm"},/*#__PURE__*/React.createElement("input",{type:"checkbox",name:"days",value:day,className:"rounded",defaultChecked:editingSchedule?.days?.includes(day)}),day.slice(0,3))))),/*#__PURE__*/React.createElement("div",{className:"flex gap-2 justify-end pt-2"},/*#__PURE__*/React.createElement("button",{type:"button",onClick:()=>setShowScheduleModal(false),className:"px-4 py-2 bg-proxmox-dark hover:bg-proxmox-hover rounded-lg"},t('cancel')||'Cancel'),/*#__PURE__*/React.createElement("button",{type:"submit",className:"px-4 py-2 bg-proxmox-orange hover:bg-orange-600 rounded-lg"},t('save')||'Save'))))),showTagEditor&&/*#__PURE__*/React.createElement("div",{className:"fixed inset-0 bg-black/70 flex items-center justify-center z-50 p-4",onClick:()=>setShowTagEditor(null)},/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl w-full max-w-sm",onClick:e=>e.stopPropagation()},/*#__PURE__*/React.createElement("div",{className:"p-4 border-b border-proxmox-border"},/*#__PURE__*/React.createElement("h3",{className:"font-semibold flex items-center gap-2"},/*#__PURE__*/React.createElement(Icons.Tag,null),t('manageTags')||'Manage Tags',": ",showTagEditor.vmName)),/*#__PURE__*/React.createElement("div",{className:"p-4 space-y-4"},/*#__PURE__*/React.createElement("div",{className:"flex flex-wrap gap-2"},getVmTags(showTagEditor.clusterId,showTagEditor.vmid).map((tag,idx)=>/*#__PURE__*/React.createElement("span",{key:idx,className:"flex items-center gap-1 px-2 py-1 rounded-full text-xs",style:{backgroundColor:(tag.color||'#6b7280')+'30',color:tag.color||'#9ca3af'}},tag.name||tag,/*#__PURE__*/React.createElement("button",{onClick:()=>removeTagFromVm(showTagEditor.clusterId,showTagEditor.vmid,tag.name||tag),className:"hover:text-red-400"},/*#__PURE__*/React.createElement(Icons.X,{className:"w-3 h-3"})))),getVmTags(showTagEditor.clusterId,showTagEditor.vmid).length===0&&/*#__PURE__*/React.createElement("span",{className:"text-gray-500 text-sm"},t('noTags')||'No tags')),/*#__PURE__*/React.createElement("div",{className:"flex gap-2"},/*#__PURE__*/React.createElement("input",{type:"text",value:newTagName,onChange:e=>setNewTagName(e.target.value),onKeyDown:async e=>{if(e.key==='Enter'&&newTagName.trim()){await addTagToVm(showTagEditor.clusterId,showTagEditor.vmid,newTagName.trim());setNewTagName('');}},placeholder:t('newTag')||'New tag...',className:"flex-1 px-3 py-2 bg-proxmox-dark border border-proxmox-border rounded-lg text-sm"}),/*#__PURE__*/React.createElement("button",{onClick:async()=>{if(newTagName.trim()){await addTagToVm(showTagEditor.clusterId,showTagEditor.vmid,newTagName.trim());setNewTagName('');}},className:"px-3 py-2 bg-proxmox-orange hover:bg-orange-600 rounded-lg"},/*#__PURE__*/React.createElement(Icons.Plus,{className:"w-4 h-4"}))),clusterTags.length>0&&/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("p",{className:"text-xs text-gray-500 mb-2"},t('existingTags')||'Existing tags',":"),/*#__PURE__*/React.createElement("div",{className:"flex flex-wrap gap-1"},clusterTags.filter(t=>!getVmTags(showTagEditor.clusterId,showTagEditor.vmid).some(vt=>(vt.name||vt)===t.name)).slice(0,10).map((tag,idx)=>/*#__PURE__*/React.createElement("button",{key:idx,onClick:()=>addTagToVm(showTagEditor.clusterId,showTagEditor.vmid,tag.name,tag.color),className:"px-2 py-0.5 rounded-full text-xs hover:opacity-80",style:{backgroundColor:(tag.color||'#6b7280')+'30',color:tag.color||'#9ca3af'}},"+ ",tag.name))))),/*#__PURE__*/React.createElement("div",{className:"p-4 border-t border-proxmox-border"},/*#__PURE__*/React.createElement("button",{onClick:()=>setShowTagEditor(null),className:"w-full px-4 py-2 bg-proxmox-dark hover:bg-proxmox-hover rounded-lg"},t('close')||'Close')))),showAlertModal&&/*#__PURE__*/React.createElement("div",{className:"fixed inset-0 bg-black/70 flex items-center justify-center z-50 p-4",onClick:()=>{setShowAlertModal(false);setEditingAlert(null);}},/*#__PURE__*/React.createElement("div",{className:"bg-proxmox-card border border-proxmox-border rounded-xl w-full max-w-md",onClick:e=>e.stopPropagation()},/*#__PURE__*/React.createElement("div",{className:"p-4 border-b border-proxmox-border flex justify-between items-center"},/*#__PURE__*/React.createElement("h3",{className:"text-lg font-semibold"},editingAlert?t('editAlert')||'Edit Alert':t('newAlert')||'New Alert'),/*#__PURE__*/React.createElement("button",{onClick:()=>{setShowAlertModal(false);setEditingAlert(null);},className:"p-1 hover:bg-proxmox-hover rounded"},/*#__PURE__*/React.createElement(Icons.X,null))),/*#__PURE__*/React.createElement("form",{key:editingAlert?'edit-'+editingAlert.id:'new-alert',onSubmit:async e=>{e.preventDefault();const form=e.target;// NS Apr 2026 #213 — channels is the new field; keep `action` // populated as a legacy fallback so older versions still read it. const channels=pickedChannels.length?pickedChannels:[];const legacyAction=channels.length===0?'log':channels.length===1&&channels[0]==='email'?'email':'all';const payload={name:form.name.value,target_type:form.target_type.value,target_id:form.target_id.value||null,metric:form.metric.value,operator:form.operator.value,threshold:parseInt(form.threshold.value),channels,severity:form.severity.value,// NS #501 escalation:escSteps.filter(s=>s.after_minutes>0),// NS #501 diff --git a/web/src/dashboard.js b/web/src/dashboard.js index c4c418f..fbfbf9a 100644 --- a/web/src/dashboard.js +++ b/web/src/dashboard.js @@ -20082,9 +20082,9 @@ : 'flex items-center gap-1 p-1 bg-proxmox-card border border-proxmox-border rounded-xl w-fit' }> {[ - { id: 'vms', label: 'Virtual Machines', icon: Icons.Monitor }, + { id: 'vms', label: t('virtualMachines'), icon: Icons.Monitor }, { id: 'hosts', label: 'Hosts', icon: Icons.Server }, - { id: 'datastores', label: 'Datastores', icon: Icons.Database }, + { id: 'datastores', label: t('datastores'), icon: Icons.Database }, { id: 'networks', label: 'Networks', icon: Icons.Globe }, { id: 'clusters', label: 'Clusters', icon: Icons.Layers }, { id: 'tasks', label: 'Tasks & Events', icon: Icons.ClipboardList }, @@ -20146,7 +20146,7 @@ } style={isCorporate ? {color: vmwareFilter === f ? '#e9ecef' : '#728b9a', background: vmwareFilter === f ? '#324f61' : 'transparent', borderRight: '1px solid #485764'} : {}} > - {f === 'all' ? `All (${vmwareVms.length})` : f === 'running' ? `Running (${vmwareVms.filter(v => v.power_state === 'POWERED_ON').length})` : `Stopped (${vmwareVms.filter(v => v.power_state !== 'POWERED_ON').length})`} + {f === 'all' ? `${t('all')} (${vmwareVms.length})` : f === 'running' ? `${t('running')} (${vmwareVms.filter(v => v.power_state === 'POWERED_ON').length})` : `Stopped (${vmwareVms.filter(v => v.power_state !== 'POWERED_ON').length})`} ))} @@ -20160,14 +20160,14 @@ - - + + - - - + + + @@ -20320,13 +20320,13 @@
StatusName{t('status')}{t('name')} Guest OS CPUs MemoryIP AddressHostActions{t('ipAddress')}{t('host')}{t('actions')}