diff --git a/frontend/src/styles/map-layout.css b/frontend/src/styles/map-layout.css index 40f43c7c..1822ef37 100644 --- a/frontend/src/styles/map-layout.css +++ b/frontend/src/styles/map-layout.css @@ -179,6 +179,11 @@ padding: 0; flex: 1; overflow-y: auto; + scrollbar-width: none; /* Firefox */ + -ms-overflow-style: none; /* IE/Edge */ +} +.ml-player-list::-webkit-scrollbar { + display: none; /* Chrome/Safari */ } .ml-player-row { diff --git a/static/v2/assets/DashboardView-BORJmSpV.js b/static/v2/assets/DashboardView-BlHbVNi9.js similarity index 99% rename from static/v2/assets/DashboardView-BORJmSpV.js rename to static/v2/assets/DashboardView-BlHbVNi9.js index f2e7e461..09ef0fbb 100644 --- a/static/v2/assets/DashboardView-BORJmSpV.js +++ b/static/v2/assets/DashboardView-BlHbVNi9.js @@ -1,4 +1,4 @@ -import{j,R as A,r as N,c as hi,g as ue,a as eO}from"./index-BfimcakA.js";const tO=({children:e})=>j.jsxs("div",{className:"dashboard",children:[j.jsxs("header",{className:"dashboard-header",children:[j.jsx("h1",{className:"dashboard-title",children:"Mosswart Overlord"}),j.jsxs("nav",{className:"dashboard-nav",children:[j.jsx("a",{href:"/",className:"nav-link",children:"Classic View"}),j.jsx("a",{href:"/inventory.html",className:"nav-link",children:"Inventory"}),j.jsx("a",{href:"/suitbuilder.html",className:"nav-link",children:"Suitbuilder"})]})]}),j.jsx("main",{className:"dashboard-main",children:e})]}),rO=({activeChars:e,totalKills:t,totalRares:r,serverHealth:n})=>{var o;const i=((o=n==null?void 0:n.status)==null?void 0:o.toLowerCase())??"unknown",a=i==="online"||i==="up";return j.jsxs("div",{className:"global-stats",children:[j.jsxs("div",{className:"global-stat",children:[j.jsx("span",{className:"global-value",children:e}),j.jsx("span",{className:"global-label",children:"Active Characters"})]}),j.jsxs("div",{className:"global-stat",children:[j.jsx("span",{className:"global-value",children:t.toLocaleString()}),j.jsx("span",{className:"global-label",children:"Total Kills"})]}),j.jsxs("div",{className:"global-stat",children:[j.jsx("span",{className:"global-value",children:r}),j.jsx("span",{className:"global-label",children:"Total Rares"})]}),j.jsxs("div",{className:"global-stat",children:[j.jsx("span",{className:`server-dot ${a?"online":"offline"}`}),j.jsxs("span",{className:"global-value",children:[(n==null?void 0:n.latency_ms)??"--","ms"]}),j.jsx("span",{className:"global-label",children:"Coldeve"})]})]})},Pi=A.memo(({label:e,current:t,max:r,color:n,bgColor:i})=>{const a=r>0?Math.min(100,Math.max(0,t/r*100)):0;return j.jsxs("div",{className:"vital-bar",children:[j.jsx("span",{className:"vital-label",children:e}),j.jsx("div",{className:"vital-track",style:{backgroundColor:i},children:j.jsx("div",{className:"vital-fill",style:{width:`${a}%`,background:n}})}),j.jsxs("span",{className:"vital-text",children:[t,"/",r]})]})});Pi.displayName="VitalBar";const nO=e=>{const t=(e||"idle").toLowerCase();return t==="combat"||t==="hunt"?{label:t==="combat"?"Combat":"Hunt",cls:"badge-combat"}:t==="nav"||t==="navigation"?{label:"Nav",cls:"badge-nav"}:t==="default"||t==="idle"||t===""?{label:"Idle",cls:"badge-idle"}:{label:e,cls:"badge-nav"}},Nb=A.memo(({character:e})=>{var u,s,c,f,l,h;const[t,r]=N.useState(!1),{telemetry:n,vitals:i,combat:a}=e,o=nO((n==null?void 0:n.vt_state)??"");return j.jsxs("div",{className:"char-card",onClick:()=>r(!t),children:[j.jsxs("div",{className:"char-header",children:[j.jsx("span",{className:"char-name",children:e.name}),j.jsx("span",{className:`char-badge ${o.cls}`,children:o.label})]}),i?j.jsxs("div",{className:"char-vitals",children:[j.jsx(Pi,{label:"HP",current:i.health_current,max:i.health_max,color:"linear-gradient(90deg, #ff4444, #ff6666)",bgColor:"#330000"}),j.jsx(Pi,{label:"ST",current:i.stamina_current,max:i.stamina_max,color:"linear-gradient(90deg, #ffaa00, #ffcc44)",bgColor:"#331a00"}),j.jsx(Pi,{label:"MN",current:i.mana_current,max:i.mana_max,color:"linear-gradient(90deg, #4488ff, #66aaff)",bgColor:"#001433"})]}):j.jsx("div",{className:"char-vitals-placeholder",children:"Awaiting vitals..."}),j.jsxs("div",{className:"char-stats-row",children:[j.jsxs("div",{className:"stat",children:[j.jsx("span",{className:"stat-value",children:(n==null?void 0:n.kills_per_hour)??"--"}),j.jsx("span",{className:"stat-label",children:"kills/hr"})]}),j.jsxs("div",{className:"stat",children:[j.jsx("span",{className:"stat-value",children:((u=n==null?void 0:n.kills)==null?void 0:u.toLocaleString())??"--"}),j.jsx("span",{className:"stat-label",children:"kills"})]}),j.jsxs("div",{className:"stat",children:[j.jsx("span",{className:"stat-value",children:(n==null?void 0:n.deaths)??"0"}),j.jsx("span",{className:"stat-label",children:"deaths"})]}),j.jsxs("div",{className:"stat",children:[j.jsx("span",{className:"stat-value",children:((s=n==null?void 0:n.onlinetime)==null?void 0:s.replace(/^00\./,""))??"--"}),j.jsx("span",{className:"stat-label",children:"uptime"})]})]}),n&&j.jsxs("div",{className:"char-location",children:[(c=n.ns)==null?void 0:c.toFixed(1),"N, ",(f=n.ew)==null?void 0:f.toFixed(1),"E"]}),t&&j.jsxs("div",{className:"char-expanded",children:[i!=null&&i.vitae?j.jsxs("div",{className:"vitae-warn",children:["Vitae: ",i.vitae,"%"]}):null,j.jsxs("div",{className:"expanded-row",children:[j.jsxs("span",{children:["Prismatics: ",(n==null?void 0:n.prismatic_taper_count)??"--"]}),j.jsxs("span",{children:["Total Deaths: ",(n==null?void 0:n.total_deaths)??"--"]})]}),(a==null?void 0:a.session)&&j.jsxs("div",{className:"expanded-row",children:[j.jsxs("span",{children:["Session Dmg: ",(l=a.session.total_damage_given)==null?void 0:l.toLocaleString()]}),j.jsxs("span",{children:["Session Kills: ",a.session.total_kills]})]}),j.jsxs("div",{className:"expanded-row",children:[j.jsxs("span",{children:["RAM: ",n!=null&&n.mem_mb?(n.mem_mb/1048576).toFixed(0)+" MB":"--"]}),j.jsxs("span",{children:["CPU: ",((h=n==null?void 0:n.cpu_pct)==null?void 0:h.toFixed(1))??"--","%"]})]})]})]})});Nb.displayName="CharacterCard";const iO=({characters:e})=>{const t=N.useMemo(()=>Array.from(e.values()).sort((r,n)=>r.name.localeCompare(n.name)),[e]);return t.length===0?j.jsx("div",{className:"grid-empty",children:"No active characters"}):j.jsx("div",{className:"char-grid",children:t.map(r=>j.jsx(Nb,{character:r},r.name))})},aO=({tabs:e})=>{var n,i;const[t,r]=N.useState(((n=e[0])==null?void 0:n.id)??"");return j.jsxs("div",{className:"tab-container",children:[j.jsx("div",{className:"tab-bar",children:e.map(a=>j.jsx("button",{className:`tab-btn ${t===a.id?"active":""}`,onClick:()=>r(a.id),children:a.label},a.id))}),j.jsx("div",{className:"tab-content",children:(i=e.find(a=>a.id===t))==null?void 0:i.content})]})};function Rb(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t-1}return Wo=t,Wo}var Ho,wd;function OO(){if(wd)return Ho;wd=1;var e=Ea();function t(r,n){var i=this.__data__,a=e(i,r);return a<0?(++this.size,i.push([r,n])):i[a][1]=n,this}return Ho=t,Ho}var Ko,Od;function Ma(){if(Od)return Ko;Od=1;var e=gO(),t=bO(),r=xO(),n=wO(),i=OO();function a(o){var u=-1,s=o==null?0:o.length;for(this.clear();++uj.jsxs("div",{className:"dashboard",children:[j.jsxs("header",{className:"dashboard-header",children:[j.jsx("h1",{className:"dashboard-title",children:"Mosswart Overlord"}),j.jsxs("nav",{className:"dashboard-nav",children:[j.jsx("a",{href:"/",className:"nav-link",children:"Classic View"}),j.jsx("a",{href:"/inventory.html",className:"nav-link",children:"Inventory"}),j.jsx("a",{href:"/suitbuilder.html",className:"nav-link",children:"Suitbuilder"})]})]}),j.jsx("main",{className:"dashboard-main",children:e})]}),rO=({activeChars:e,totalKills:t,totalRares:r,serverHealth:n})=>{var o;const i=((o=n==null?void 0:n.status)==null?void 0:o.toLowerCase())??"unknown",a=i==="online"||i==="up";return j.jsxs("div",{className:"global-stats",children:[j.jsxs("div",{className:"global-stat",children:[j.jsx("span",{className:"global-value",children:e}),j.jsx("span",{className:"global-label",children:"Active Characters"})]}),j.jsxs("div",{className:"global-stat",children:[j.jsx("span",{className:"global-value",children:t.toLocaleString()}),j.jsx("span",{className:"global-label",children:"Total Kills"})]}),j.jsxs("div",{className:"global-stat",children:[j.jsx("span",{className:"global-value",children:r}),j.jsx("span",{className:"global-label",children:"Total Rares"})]}),j.jsxs("div",{className:"global-stat",children:[j.jsx("span",{className:`server-dot ${a?"online":"offline"}`}),j.jsxs("span",{className:"global-value",children:[(n==null?void 0:n.latency_ms)??"--","ms"]}),j.jsx("span",{className:"global-label",children:"Coldeve"})]})]})},Pi=A.memo(({label:e,current:t,max:r,color:n,bgColor:i})=>{const a=r>0?Math.min(100,Math.max(0,t/r*100)):0;return j.jsxs("div",{className:"vital-bar",children:[j.jsx("span",{className:"vital-label",children:e}),j.jsx("div",{className:"vital-track",style:{backgroundColor:i},children:j.jsx("div",{className:"vital-fill",style:{width:`${a}%`,background:n}})}),j.jsxs("span",{className:"vital-text",children:[t,"/",r]})]})});Pi.displayName="VitalBar";const nO=e=>{const t=(e||"idle").toLowerCase();return t==="combat"||t==="hunt"?{label:t==="combat"?"Combat":"Hunt",cls:"badge-combat"}:t==="nav"||t==="navigation"?{label:"Nav",cls:"badge-nav"}:t==="default"||t==="idle"||t===""?{label:"Idle",cls:"badge-idle"}:{label:e,cls:"badge-nav"}},Nb=A.memo(({character:e})=>{var u,s,c,f,l,h;const[t,r]=N.useState(!1),{telemetry:n,vitals:i,combat:a}=e,o=nO((n==null?void 0:n.vt_state)??"");return j.jsxs("div",{className:"char-card",onClick:()=>r(!t),children:[j.jsxs("div",{className:"char-header",children:[j.jsx("span",{className:"char-name",children:e.name}),j.jsx("span",{className:`char-badge ${o.cls}`,children:o.label})]}),i?j.jsxs("div",{className:"char-vitals",children:[j.jsx(Pi,{label:"HP",current:i.health_current,max:i.health_max,color:"linear-gradient(90deg, #ff4444, #ff6666)",bgColor:"#330000"}),j.jsx(Pi,{label:"ST",current:i.stamina_current,max:i.stamina_max,color:"linear-gradient(90deg, #ffaa00, #ffcc44)",bgColor:"#331a00"}),j.jsx(Pi,{label:"MN",current:i.mana_current,max:i.mana_max,color:"linear-gradient(90deg, #4488ff, #66aaff)",bgColor:"#001433"})]}):j.jsx("div",{className:"char-vitals-placeholder",children:"Awaiting vitals..."}),j.jsxs("div",{className:"char-stats-row",children:[j.jsxs("div",{className:"stat",children:[j.jsx("span",{className:"stat-value",children:(n==null?void 0:n.kills_per_hour)??"--"}),j.jsx("span",{className:"stat-label",children:"kills/hr"})]}),j.jsxs("div",{className:"stat",children:[j.jsx("span",{className:"stat-value",children:((u=n==null?void 0:n.kills)==null?void 0:u.toLocaleString())??"--"}),j.jsx("span",{className:"stat-label",children:"kills"})]}),j.jsxs("div",{className:"stat",children:[j.jsx("span",{className:"stat-value",children:(n==null?void 0:n.deaths)??"0"}),j.jsx("span",{className:"stat-label",children:"deaths"})]}),j.jsxs("div",{className:"stat",children:[j.jsx("span",{className:"stat-value",children:((s=n==null?void 0:n.onlinetime)==null?void 0:s.replace(/^00\./,""))??"--"}),j.jsx("span",{className:"stat-label",children:"uptime"})]})]}),n&&j.jsxs("div",{className:"char-location",children:[(c=n.ns)==null?void 0:c.toFixed(1),"N, ",(f=n.ew)==null?void 0:f.toFixed(1),"E"]}),t&&j.jsxs("div",{className:"char-expanded",children:[i!=null&&i.vitae?j.jsxs("div",{className:"vitae-warn",children:["Vitae: ",i.vitae,"%"]}):null,j.jsxs("div",{className:"expanded-row",children:[j.jsxs("span",{children:["Prismatics: ",(n==null?void 0:n.prismatic_taper_count)??"--"]}),j.jsxs("span",{children:["Total Deaths: ",(n==null?void 0:n.total_deaths)??"--"]})]}),(a==null?void 0:a.session)&&j.jsxs("div",{className:"expanded-row",children:[j.jsxs("span",{children:["Session Dmg: ",(l=a.session.total_damage_given)==null?void 0:l.toLocaleString()]}),j.jsxs("span",{children:["Session Kills: ",a.session.total_kills]})]}),j.jsxs("div",{className:"expanded-row",children:[j.jsxs("span",{children:["RAM: ",n!=null&&n.mem_mb?(n.mem_mb/1048576).toFixed(0)+" MB":"--"]}),j.jsxs("span",{children:["CPU: ",((h=n==null?void 0:n.cpu_pct)==null?void 0:h.toFixed(1))??"--","%"]})]})]})]})});Nb.displayName="CharacterCard";const iO=({characters:e})=>{const t=N.useMemo(()=>Array.from(e.values()).sort((r,n)=>r.name.localeCompare(n.name)),[e]);return t.length===0?j.jsx("div",{className:"grid-empty",children:"No active characters"}):j.jsx("div",{className:"char-grid",children:t.map(r=>j.jsx(Nb,{character:r},r.name))})},aO=({tabs:e})=>{var n,i;const[t,r]=N.useState(((n=e[0])==null?void 0:n.id)??"");return j.jsxs("div",{className:"tab-container",children:[j.jsx("div",{className:"tab-bar",children:e.map(a=>j.jsx("button",{className:`tab-btn ${t===a.id?"active":""}`,onClick:()=>r(a.id),children:a.label},a.id))}),j.jsx("div",{className:"tab-content",children:(i=e.find(a=>a.id===t))==null?void 0:i.content})]})};function Rb(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t-1}return Wo=t,Wo}var Ho,wd;function OO(){if(wd)return Ho;wd=1;var e=Ea();function t(r,n){var i=this.__data__,a=e(i,r);return a<0?(++this.size,i.push([r,n])):i[a][1]=n,this}return Ho=t,Ho}var Ko,Od;function Ma(){if(Od)return Ko;Od=1;var e=gO(),t=bO(),r=xO(),n=wO(),i=OO();function a(o){var u=-1,s=o==null?0:o.length;for(this.clear();++u")&&(N=N.replace("",t.displayName)),N}while(1<=a&&0<=n);break}}}finally{ai=!1,Error.prepareStackTrace=e}return(e=t?t.displayName||t.name:"")?Oe(e):""}function sh(t,l){switch(t.tag){case 26:case 27:case 5:return Oe(t.type);case 16:return Oe("Lazy");case 13:return t.child!==l&&l!==null?Oe("Suspense Fallback"):Oe("Suspense");case 19:return Oe("SuspenseList");case 0:case 15:return ni(t.type,!1);case 11:return ni(t.type.render,!1);case 1:return ni(t.type,!0);case 31:return Oe("Activity");default:return""}}function Rs(t){try{var l="",e=null;do l+=sh(t,e),e=t,t=t.return;while(t);return l}catch(a){return` Error generating stack: `+a.message+` `+a.stack}}var ui=Object.prototype.hasOwnProperty,ii=s.unstable_scheduleCallback,ci=s.unstable_cancelCallback,fh=s.unstable_shouldYield,oh=s.unstable_requestPaint,sl=s.unstable_now,rh=s.unstable_getCurrentPriorityLevel,Ds=s.unstable_ImmediatePriority,Us=s.unstable_UserBlockingPriority,Un=s.unstable_NormalPriority,dh=s.unstable_LowPriority,Bs=s.unstable_IdlePriority,hh=s.log,mh=s.unstable_setDisableYieldValue,Ha=null,fl=null;function ae(t){if(typeof hh=="function"&&mh(t),fl&&typeof fl.setStrictMode=="function")try{fl.setStrictMode(Ha,t)}catch{}}var ol=Math.clz32?Math.clz32:vh,yh=Math.log,gh=Math.LN2;function vh(t){return t>>>=0,t===0?32:31-(yh(t)/gh|0)|0}var Bn=256,Hn=262144,Yn=4194304;function Ce(t){var l=t&42;if(l!==0)return l;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function qn(t,l,e){var a=t.pendingLanes;if(a===0)return 0;var n=0,u=t.suspendedLanes,c=t.pingedLanes;t=t.warmLanes;var f=a&134217727;return f!==0?(a=f&~u,a!==0?n=Ce(a):(c&=f,c!==0?n=Ce(c):e||(e=f&~t,e!==0&&(n=Ce(e))))):(f=a&~u,f!==0?n=Ce(f):c!==0?n=Ce(c):e||(e=a&~t,e!==0&&(n=Ce(e)))),n===0?0:l!==0&&l!==n&&(l&u)===0&&(u=n&-n,e=l&-l,u>=e||u===32&&(e&4194048)!==0)?l:n}function Ya(t,l){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&l)===0}function ph(t,l){switch(t){case 1:case 2:case 4:case 8:case 64:return l+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Hs(){var t=Yn;return Yn<<=1,(Yn&62914560)===0&&(Yn=4194304),t}function si(t){for(var l=[],e=0;31>e;e++)l.push(t);return l}function qa(t,l){t.pendingLanes|=l,l!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function xh(t,l,e,a,n,u){var c=t.pendingLanes;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=e,t.entangledLanes&=e,t.errorRecoveryDisabledLanes&=e,t.shellSuspendCounter=0;var f=t.entanglements,r=t.expirationTimes,j=t.hiddenUpdates;for(e=c&~e;0"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var Eh=/[\n"\\]/g;function Sl(t){return t.replace(Eh,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function mi(t,l,e,a,n,u,c,f){t.name="",c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"?t.type=c:t.removeAttribute("type"),l!=null?c==="number"?(l===0&&t.value===""||t.value!=l)&&(t.value=""+xl(l)):t.value!==""+xl(l)&&(t.value=""+xl(l)):c!=="submit"&&c!=="reset"||t.removeAttribute("value"),l!=null?yi(t,c,xl(l)):e!=null?yi(t,c,xl(e)):a!=null&&t.removeAttribute("value"),n==null&&u!=null&&(t.defaultChecked=!!u),n!=null&&(t.checked=n&&typeof n!="function"&&typeof n!="symbol"),f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"?t.name=""+xl(f):t.removeAttribute("name")}function $s(t,l,e,a,n,u,c,f){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(t.type=u),l!=null||e!=null){if(!(u!=="submit"&&u!=="reset"||l!=null)){hi(t);return}e=e!=null?""+xl(e):"",l=l!=null?""+xl(l):e,f||l===t.value||(t.value=l),t.defaultValue=l}a=a??n,a=typeof a!="function"&&typeof a!="symbol"&&!!a,t.checked=f?t.checked:!!a,t.defaultChecked=!!a,c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(t.name=c),hi(t)}function yi(t,l,e){l==="number"&&Gn(t.ownerDocument)===t||t.defaultValue===""+e||(t.defaultValue=""+e)}function Pe(t,l,e,a){if(t=t.options,l){l={};for(var n=0;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Si=!1;if(Xl)try{var Qa={};Object.defineProperty(Qa,"passive",{get:function(){Si=!0}}),window.addEventListener("test",Qa,Qa),window.removeEventListener("test",Qa,Qa)}catch{Si=!1}var ue=null,bi=null,Zn=null;function ef(){if(Zn)return Zn;var t,l=bi,e=l.length,a,n="value"in ue?ue.value:ue.textContent,u=n.length;for(t=0;t=Va),ff=" ",of=!1;function rf(t,l){switch(t){case"keyup":return Ph.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function df(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var aa=!1;function lm(t,l){switch(t){case"compositionend":return df(l);case"keypress":return l.which!==32?null:(of=!0,ff);case"textInput":return t=l.data,t===ff&&of?null:t;default:return null}}function em(t,l){if(aa)return t==="compositionend"||!Ai&&rf(t,l)?(t=ef(),Zn=bi=ue=null,aa=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1=l)return{node:e,offset:l-t};t=a}t:{for(;e;){if(e.nextSibling){e=e.nextSibling;break t}e=e.parentNode}e=void 0}e=Sf(e)}}function _f(t,l){return t&&l?t===l?!0:t&&t.nodeType===3?!1:l&&l.nodeType===3?_f(t,l.parentNode):"contains"in t?t.contains(l):t.compareDocumentPosition?!!(t.compareDocumentPosition(l)&16):!1:!1}function jf(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var l=Gn(t.document);l instanceof t.HTMLIFrameElement;){try{var e=typeof l.contentWindow.location.href=="string"}catch{e=!1}if(e)t=l.contentWindow;else break;l=Gn(t.document)}return l}function Oi(t){var l=t&&t.nodeName&&t.nodeName.toLowerCase();return l&&(l==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||l==="textarea"||t.contentEditable==="true")}var om=Xl&&"documentMode"in document&&11>=document.documentMode,na=null,Ci=null,$a=null,Ni=!1;function zf(t,l,e){var a=e.window===e?e.document:e.nodeType===9?e:e.ownerDocument;Ni||na==null||na!==Gn(a)||(a=na,"selectionStart"in a&&Oi(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),$a&&Ja($a,a)||($a=a,a=Hu(Ci,"onSelect"),0>=c,n-=c,Dl=1<<32-ol(l)+n|e<rt?(xt=lt,lt=null):xt=lt.sibling;var jt=E(p,lt,_[rt],B);if(jt===null){lt===null&&(lt=xt);break}t&<&&jt.alternate===null&&l(p,lt),g=u(jt,g,rt),_t===null?at=jt:_t.sibling=jt,_t=jt,lt=xt}if(rt===_.length)return e(p,lt),St&&Gl(p,rt),at;if(lt===null){for(;rt<_.length;rt++)lt=Y(p,_[rt],B),lt!==null&&(g=u(lt,g,rt),_t===null?at=lt:_t.sibling=lt,_t=lt);return St&&Gl(p,rt),at}for(lt=a(lt);rt<_.length;rt++)xt=M(lt,p,rt,_[rt],B),xt!==null&&(t&&xt.alternate!==null&<.delete(xt.key===null?rt:xt.key),g=u(xt,g,rt),_t===null?at=xt:_t.sibling=xt,_t=xt);return t&<.forEach(function(Te){return l(p,Te)}),St&&Gl(p,rt),at}function ut(p,g,_,B){if(_==null)throw Error(o(151));for(var at=null,_t=null,lt=g,rt=g=0,xt=null,jt=_.next();lt!==null&&!jt.done;rt++,jt=_.next()){lt.index>rt?(xt=lt,lt=null):xt=lt.sibling;var Te=E(p,lt,jt.value,B);if(Te===null){lt===null&&(lt=xt);break}t&<&&Te.alternate===null&&l(p,lt),g=u(Te,g,rt),_t===null?at=Te:_t.sibling=Te,_t=Te,lt=xt}if(jt.done)return e(p,lt),St&&Gl(p,rt),at;if(lt===null){for(;!jt.done;rt++,jt=_.next())jt=Y(p,jt.value,B),jt!==null&&(g=u(jt,g,rt),_t===null?at=jt:_t.sibling=jt,_t=jt);return St&&Gl(p,rt),at}for(lt=a(lt);!jt.done;rt++,jt=_.next())jt=M(lt,p,rt,jt.value,B),jt!==null&&(t&&jt.alternate!==null&<.delete(jt.key===null?rt:jt.key),g=u(jt,g,rt),_t===null?at=jt:_t.sibling=jt,_t=jt);return t&<.forEach(function(C0){return l(p,C0)}),St&&Gl(p,rt),at}function Ot(p,g,_,B){if(typeof _=="object"&&_!==null&&_.type===tt&&_.key===null&&(_=_.props.children),typeof _=="object"&&_!==null){switch(_.$$typeof){case F:t:{for(var at=_.key;g!==null;){if(g.key===at){if(at=_.type,at===tt){if(g.tag===7){e(p,g.sibling),B=n(g,_.props.children),B.return=p,p=B;break t}}else if(g.elementType===at||typeof at=="object"&&at!==null&&at.$$typeof===Q&&Ge(at)===g.type){e(p,g.sibling),B=n(g,_.props),ln(B,_),B.return=p,p=B;break t}e(p,g);break}else l(p,g);g=g.sibling}_.type===tt?(B=He(_.props.children,p.mode,B,_.key),B.return=p,p=B):(B=Pn(_.type,_.key,_.props,null,p.mode,B),ln(B,_),B.return=p,p=B)}return c(p);case it:t:{for(at=_.key;g!==null;){if(g.key===at)if(g.tag===4&&g.stateNode.containerInfo===_.containerInfo&&g.stateNode.implementation===_.implementation){e(p,g.sibling),B=n(g,_.children||[]),B.return=p,p=B;break t}else{e(p,g);break}else l(p,g);g=g.sibling}B=qi(_,p.mode,B),B.return=p,p=B}return c(p);case Q:return _=Ge(_),Ot(p,g,_,B)}if(W(_))return P(p,g,_,B);if(dt(_)){if(at=dt(_),typeof at!="function")throw Error(o(150));return _=at.call(_),ut(p,g,_,B)}if(typeof _.then=="function")return Ot(p,g,iu(_),B);if(_.$$typeof===w)return Ot(p,g,eu(p,_),B);cu(p,_)}return typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint"?(_=""+_,g!==null&&g.tag===6?(e(p,g.sibling),B=n(g,_),B.return=p,p=B):(e(p,g),B=Yi(_,p.mode,B),B.return=p,p=B),c(p)):e(p,g)}return function(p,g,_,B){try{tn=0;var at=Ot(p,g,_,B);return ya=null,at}catch(lt){if(lt===ma||lt===nu)throw lt;var _t=dl(29,lt,null,p.mode);return _t.lanes=B,_t.return=p,_t}finally{}}}var Ze=kf(!0),Jf=kf(!1),oe=!1;function Wi(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Fi(t,l){t=t.updateQueue,l.updateQueue===t&&(l.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function re(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function de(t,l,e){var a=t.updateQueue;if(a===null)return null;if(a=a.shared,(zt&2)!==0){var n=a.pending;return n===null?l.next=l:(l.next=n.next,n.next=l),a.pending=l,l=In(t),Nf(t,null,e),l}return Fn(t,a,l,e),In(t)}function en(t,l,e){if(l=l.updateQueue,l!==null&&(l=l.shared,(e&4194048)!==0)){var a=l.lanes;a&=t.pendingLanes,e|=a,l.lanes=e,qs(t,e)}}function Ii(t,l){var e=t.updateQueue,a=t.alternate;if(a!==null&&(a=a.updateQueue,e===a)){var n=null,u=null;if(e=e.firstBaseUpdate,e!==null){do{var c={lane:e.lane,tag:e.tag,payload:e.payload,callback:null,next:null};u===null?n=u=c:u=u.next=c,e=e.next}while(e!==null);u===null?n=u=l:u=u.next=l}else n=u=l;e={baseState:a.baseState,firstBaseUpdate:n,lastBaseUpdate:u,shared:a.shared,callbacks:a.callbacks},t.updateQueue=e;return}t=e.lastBaseUpdate,t===null?e.firstBaseUpdate=l:t.next=l,e.lastBaseUpdate=l}var Pi=!1;function an(){if(Pi){var t=ha;if(t!==null)throw t}}function nn(t,l,e,a){Pi=!1;var n=t.updateQueue;oe=!1;var u=n.firstBaseUpdate,c=n.lastBaseUpdate,f=n.shared.pending;if(f!==null){n.shared.pending=null;var r=f,j=r.next;r.next=null,c===null?u=j:c.next=j,c=r;var N=t.alternate;N!==null&&(N=N.updateQueue,f=N.lastBaseUpdate,f!==c&&(f===null?N.firstBaseUpdate=j:f.next=j,N.lastBaseUpdate=r))}if(u!==null){var Y=n.baseState;c=0,N=j=r=null,f=u;do{var E=f.lane&-536870913,M=E!==f.lane;if(M?(pt&E)===E:(a&E)===E){E!==0&&E===da&&(Pi=!0),N!==null&&(N=N.next={lane:0,tag:f.tag,payload:f.payload,callback:null,next:null});t:{var P=t,ut=f;E=l;var Ot=e;switch(ut.tag){case 1:if(P=ut.payload,typeof P=="function"){Y=P.call(Ot,Y,E);break t}Y=P;break t;case 3:P.flags=P.flags&-65537|128;case 0:if(P=ut.payload,E=typeof P=="function"?P.call(Ot,Y,E):P,E==null)break t;Y=H({},Y,E);break t;case 2:oe=!0}}E=f.callback,E!==null&&(t.flags|=64,M&&(t.flags|=8192),M=n.callbacks,M===null?n.callbacks=[E]:M.push(E))}else M={lane:E,tag:f.tag,payload:f.payload,callback:f.callback,next:null},N===null?(j=N=M,r=Y):N=N.next=M,c|=E;if(f=f.next,f===null){if(f=n.shared.pending,f===null)break;M=f,f=M.next,M.next=null,n.lastBaseUpdate=M,n.shared.pending=null}}while(!0);N===null&&(r=Y),n.baseState=r,n.firstBaseUpdate=j,n.lastBaseUpdate=N,u===null&&(n.shared.lanes=0),ve|=c,t.lanes=c,t.memoizedState=Y}}function $f(t,l){if(typeof t!="function")throw Error(o(191,t));t.call(l)}function Wf(t,l){var e=t.callbacks;if(e!==null)for(t.callbacks=null,t=0;tu?u:8;var c=z.T,f={};z.T=f,pc(t,!1,l,e);try{var r=n(),j=z.S;if(j!==null&&j(f,r),r!==null&&typeof r=="object"&&typeof r.then=="function"){var N=xm(r,a);sn(t,l,N,vl(t))}else sn(t,l,a,vl(t))}catch(Y){sn(t,l,{then:function(){},status:"rejected",reason:Y},vl())}finally{m.p=u,c!==null&&f.types!==null&&(c.types=f.types),z.T=c}}function Em(){}function gc(t,l,e,a){if(t.tag!==5)throw Error(o(476));var n=Oo(t).queue;Mo(t,n,l,U,e===null?Em:function(){return Co(t),e(a)})}function Oo(t){var l=t.memoizedState;if(l!==null)return l;l={memoizedState:U,baseState:U,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vl,lastRenderedState:U},next:null};var e={};return l.next={memoizedState:e,baseState:e,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vl,lastRenderedState:e},next:null},t.memoizedState=l,t=t.alternate,t!==null&&(t.memoizedState=l),l}function Co(t){var l=Oo(t);l.next===null&&(l=t.alternate.memoizedState),sn(t,l.next.queue,{},vl())}function vc(){return $t(En)}function No(){return qt().memoizedState}function Ro(){return qt().memoizedState}function Am(t){for(var l=t.return;l!==null;){switch(l.tag){case 24:case 3:var e=vl();t=re(e);var a=de(l,t,e);a!==null&&(cl(a,l,e),en(a,l,e)),l={cache:Ki()},t.payload=l;return}l=l.return}}function Tm(t,l,e){var a=vl();e={lane:a,revertLane:0,gesture:null,action:e,hasEagerState:!1,eagerState:null,next:null},vu(t)?Uo(l,e):(e=Bi(t,l,e,a),e!==null&&(cl(e,t,a),Bo(e,l,a)))}function Do(t,l,e){var a=vl();sn(t,l,e,a)}function sn(t,l,e,a){var n={lane:a,revertLane:0,gesture:null,action:e,hasEagerState:!1,eagerState:null,next:null};if(vu(t))Uo(l,n);else{var u=t.alternate;if(t.lanes===0&&(u===null||u.lanes===0)&&(u=l.lastRenderedReducer,u!==null))try{var c=l.lastRenderedState,f=u(c,e);if(n.hasEagerState=!0,n.eagerState=f,rl(f,c))return Fn(t,l,n,0),Ct===null&&Wn(),!1}catch{}finally{}if(e=Bi(t,l,n,a),e!==null)return cl(e,t,a),Bo(e,l,a),!0}return!1}function pc(t,l,e,a){if(a={lane:2,revertLane:Wc(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},vu(t)){if(l)throw Error(o(479))}else l=Bi(t,e,a,2),l!==null&&cl(l,t,2)}function vu(t){var l=t.alternate;return t===ot||l!==null&&l===ot}function Uo(t,l){va=ou=!0;var e=t.pending;e===null?l.next=l:(l.next=e.next,e.next=l),t.pending=l}function Bo(t,l,e){if((e&4194048)!==0){var a=l.lanes;a&=t.pendingLanes,e|=a,l.lanes=e,qs(t,e)}}var fn={readContext:$t,use:hu,useCallback:Bt,useContext:Bt,useEffect:Bt,useImperativeHandle:Bt,useLayoutEffect:Bt,useInsertionEffect:Bt,useMemo:Bt,useReducer:Bt,useRef:Bt,useState:Bt,useDebugValue:Bt,useDeferredValue:Bt,useTransition:Bt,useSyncExternalStore:Bt,useId:Bt,useHostTransitionStatus:Bt,useFormState:Bt,useActionState:Bt,useOptimistic:Bt,useMemoCache:Bt,useCacheRefresh:Bt};fn.useEffectEvent=Bt;var Ho={readContext:$t,use:hu,useCallback:function(t,l){return Pt().memoizedState=[t,l===void 0?null:l],t},useContext:$t,useEffect:xo,useImperativeHandle:function(t,l,e){e=e!=null?e.concat([t]):null,yu(4194308,4,jo.bind(null,l,t),e)},useLayoutEffect:function(t,l){return yu(4194308,4,t,l)},useInsertionEffect:function(t,l){yu(4,2,t,l)},useMemo:function(t,l){var e=Pt();l=l===void 0?null:l;var a=t();if(we){ae(!0);try{t()}finally{ae(!1)}}return e.memoizedState=[a,l],a},useReducer:function(t,l,e){var a=Pt();if(e!==void 0){var n=e(l);if(we){ae(!0);try{e(l)}finally{ae(!1)}}}else n=l;return a.memoizedState=a.baseState=n,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:n},a.queue=t,t=t.dispatch=Tm.bind(null,ot,t),[a.memoizedState,t]},useRef:function(t){var l=Pt();return t={current:t},l.memoizedState=t},useState:function(t){t=rc(t);var l=t.queue,e=Do.bind(null,ot,l);return l.dispatch=e,[t.memoizedState,e]},useDebugValue:mc,useDeferredValue:function(t,l){var e=Pt();return yc(e,t,l)},useTransition:function(){var t=rc(!1);return t=Mo.bind(null,ot,t.queue,!0,!1),Pt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,l,e){var a=ot,n=Pt();if(St){if(e===void 0)throw Error(o(407));e=e()}else{if(e=l(),Ct===null)throw Error(o(349));(pt&127)!==0||eo(a,l,e)}n.memoizedState=e;var u={value:e,getSnapshot:l};return n.queue=u,xo(no.bind(null,a,u,t),[t]),a.flags|=2048,xa(9,{destroy:void 0},ao.bind(null,a,u,e,l),null),e},useId:function(){var t=Pt(),l=Ct.identifierPrefix;if(St){var e=Ul,a=Dl;e=(a&~(1<<32-ol(a)-1)).toString(32)+e,l="_"+l+"R_"+e,e=ru++,0<\/script>",u=u.removeChild(u.firstChild);break;case"select":u=typeof a.is=="string"?c.createElement("select",{is:a.is}):c.createElement("select"),a.multiple?u.multiple=!0:a.size&&(u.size=a.size);break;default:u=typeof a.is=="string"?c.createElement(n,{is:a.is}):c.createElement(n)}}u[kt]=l,u[ll]=a;t:for(c=l.child;c!==null;){if(c.tag===5||c.tag===6)u.appendChild(c.stateNode);else if(c.tag!==4&&c.tag!==27&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===l)break t;for(;c.sibling===null;){if(c.return===null||c.return===l)break t;c=c.return}c.sibling.return=c.return,c=c.sibling}l.stateNode=u;t:switch(Ft(u,n,a),n){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break t;case"img":a=!0;break t;default:a=!1}a&&kl(l)}}return Dt(l),Rc(l,l.type,t===null?null:t.memoizedProps,l.pendingProps,e),null;case 6:if(t&&l.stateNode!=null)t.memoizedProps!==a&&kl(l);else{if(typeof a!="string"&&l.stateNode===null)throw Error(o(166));if(t=ht.current,oa(l)){if(t=l.stateNode,e=l.memoizedProps,a=null,n=Jt,n!==null)switch(n.tag){case 27:case 5:a=n.memoizedProps}t[kt]=l,t=!!(t.nodeValue===e||a!==null&&a.suppressHydrationWarning===!0||ld(t.nodeValue,e)),t||se(l,!0)}else t=Yu(t).createTextNode(a),t[kt]=l,l.stateNode=t}return Dt(l),null;case 31:if(e=l.memoizedState,t===null||t.memoizedState!==null){if(a=oa(l),e!==null){if(t===null){if(!a)throw Error(o(318));if(t=l.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(o(557));t[kt]=l}else Ye(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Dt(l),t=!1}else e=Qi(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=e),t=!0;if(!t)return l.flags&256?(ml(l),l):(ml(l),null);if((l.flags&128)!==0)throw Error(o(558))}return Dt(l),null;case 13:if(a=l.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(n=oa(l),a!==null&&a.dehydrated!==null){if(t===null){if(!n)throw Error(o(318));if(n=l.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(o(317));n[kt]=l}else Ye(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Dt(l),n=!1}else n=Qi(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=n),n=!0;if(!n)return l.flags&256?(ml(l),l):(ml(l),null)}return ml(l),(l.flags&128)!==0?(l.lanes=e,l):(e=a!==null,t=t!==null&&t.memoizedState!==null,e&&(a=l.child,n=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(n=a.alternate.memoizedState.cachePool.pool),u=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),u!==n&&(a.flags|=2048)),e!==t&&e&&(l.child.flags|=8192),_u(l,l.updateQueue),Dt(l),null);case 4:return Nt(),t===null&&ts(l.stateNode.containerInfo),Dt(l),null;case 10:return Zl(l.type),Dt(l),null;case 19:if(D(Yt),a=l.memoizedState,a===null)return Dt(l),null;if(n=(l.flags&128)!==0,u=a.rendering,u===null)if(n)rn(a,!1);else{if(Ht!==0||t!==null&&(t.flags&128)!==0)for(t=l.child;t!==null;){if(u=fu(t),u!==null){for(l.flags|=128,rn(a,!1),t=u.updateQueue,l.updateQueue=t,_u(l,t),l.subtreeFlags=0,t=e,e=l.child;e!==null;)Rf(e,t),e=e.sibling;return k(Yt,Yt.current&1|2),St&&Gl(l,a.treeForkCount),l.child}t=t.sibling}a.tail!==null&&sl()>Tu&&(l.flags|=128,n=!0,rn(a,!1),l.lanes=4194304)}else{if(!n)if(t=fu(u),t!==null){if(l.flags|=128,n=!0,t=t.updateQueue,l.updateQueue=t,_u(l,t),rn(a,!0),a.tail===null&&a.tailMode==="hidden"&&!u.alternate&&!St)return Dt(l),null}else 2*sl()-a.renderingStartTime>Tu&&e!==536870912&&(l.flags|=128,n=!0,rn(a,!1),l.lanes=4194304);a.isBackwards?(u.sibling=l.child,l.child=u):(t=a.last,t!==null?t.sibling=u:l.child=u,a.last=u)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=sl(),t.sibling=null,e=Yt.current,k(Yt,n?e&1|2:e&1),St&&Gl(l,a.treeForkCount),t):(Dt(l),null);case 22:case 23:return ml(l),lc(),a=l.memoizedState!==null,t!==null?t.memoizedState!==null!==a&&(l.flags|=8192):a&&(l.flags|=8192),a?(e&536870912)!==0&&(l.flags&128)===0&&(Dt(l),l.subtreeFlags&6&&(l.flags|=8192)):Dt(l),e=l.updateQueue,e!==null&&_u(l,e.retryQueue),e=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),a=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(a=l.memoizedState.cachePool.pool),a!==e&&(l.flags|=2048),t!==null&&D(Le),null;case 24:return e=null,t!==null&&(e=t.memoizedState.cache),l.memoizedState.cache!==e&&(l.flags|=2048),Zl(Xt),Dt(l),null;case 25:return null;case 30:return null}throw Error(o(156,l.tag))}function Rm(t,l){switch(Li(l),l.tag){case 1:return t=l.flags,t&65536?(l.flags=t&-65537|128,l):null;case 3:return Zl(Xt),Nt(),t=l.flags,(t&65536)!==0&&(t&128)===0?(l.flags=t&-65537|128,l):null;case 26:case 27:case 5:return Dn(l),null;case 31:if(l.memoizedState!==null){if(ml(l),l.alternate===null)throw Error(o(340));Ye()}return t=l.flags,t&65536?(l.flags=t&-65537|128,l):null;case 13:if(ml(l),t=l.memoizedState,t!==null&&t.dehydrated!==null){if(l.alternate===null)throw Error(o(340));Ye()}return t=l.flags,t&65536?(l.flags=t&-65537|128,l):null;case 19:return D(Yt),null;case 4:return Nt(),null;case 10:return Zl(l.type),null;case 22:case 23:return ml(l),lc(),t!==null&&D(Le),t=l.flags,t&65536?(l.flags=t&-65537|128,l):null;case 24:return Zl(Xt),null;case 25:return null;default:return null}}function ir(t,l){switch(Li(l),l.tag){case 3:Zl(Xt),Nt();break;case 26:case 27:case 5:Dn(l);break;case 4:Nt();break;case 31:l.memoizedState!==null&&ml(l);break;case 13:ml(l);break;case 19:D(Yt);break;case 10:Zl(l.type);break;case 22:case 23:ml(l),lc(),t!==null&&D(Le);break;case 24:Zl(Xt)}}function dn(t,l){try{var e=l.updateQueue,a=e!==null?e.lastEffect:null;if(a!==null){var n=a.next;e=n;do{if((e.tag&t)===t){a=void 0;var u=e.create,c=e.inst;a=u(),c.destroy=a}e=e.next}while(e!==n)}}catch(f){At(l,l.return,f)}}function ye(t,l,e){try{var a=l.updateQueue,n=a!==null?a.lastEffect:null;if(n!==null){var u=n.next;a=u;do{if((a.tag&t)===t){var c=a.inst,f=c.destroy;if(f!==void 0){c.destroy=void 0,n=l;var r=e,j=f;try{j()}catch(N){At(n,r,N)}}}a=a.next}while(a!==u)}}catch(N){At(l,l.return,N)}}function cr(t){var l=t.updateQueue;if(l!==null){var e=t.stateNode;try{Wf(l,e)}catch(a){At(t,t.return,a)}}}function sr(t,l,e){e.props=Ve(t.type,t.memoizedProps),e.state=t.memoizedState;try{e.componentWillUnmount()}catch(a){At(t,l,a)}}function hn(t,l){try{var e=t.ref;if(e!==null){switch(t.tag){case 26:case 27:case 5:var a=t.stateNode;break;case 30:a=t.stateNode;break;default:a=t.stateNode}typeof e=="function"?t.refCleanup=e(a):e.current=a}}catch(n){At(t,l,n)}}function Bl(t,l){var e=t.ref,a=t.refCleanup;if(e!==null)if(typeof a=="function")try{a()}catch(n){At(t,l,n)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof e=="function")try{e(null)}catch(n){At(t,l,n)}else e.current=null}function fr(t){var l=t.type,e=t.memoizedProps,a=t.stateNode;try{t:switch(l){case"button":case"input":case"select":case"textarea":e.autoFocus&&a.focus();break t;case"img":e.src?a.src=e.src:e.srcSet&&(a.srcset=e.srcSet)}}catch(n){At(t,t.return,n)}}function Dc(t,l,e){try{var a=t.stateNode;t0(a,t.type,e,l),a[ll]=l}catch(n){At(t,t.return,n)}}function or(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&_e(t.type)||t.tag===4}function Uc(t){t:for(;;){for(;t.sibling===null;){if(t.return===null||or(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&_e(t.type)||t.flags&2||t.child===null||t.tag===4)continue t;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Bc(t,l,e){var a=t.tag;if(a===5||a===6)t=t.stateNode,l?(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e).insertBefore(t,l):(l=e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.appendChild(t),e=e._reactRootContainer,e!=null||l.onclick!==null||(l.onclick=ql));else if(a!==4&&(a===27&&_e(t.type)&&(e=t.stateNode,l=null),t=t.child,t!==null))for(Bc(t,l,e),t=t.sibling;t!==null;)Bc(t,l,e),t=t.sibling}function ju(t,l,e){var a=t.tag;if(a===5||a===6)t=t.stateNode,l?e.insertBefore(t,l):e.appendChild(t);else if(a!==4&&(a===27&&_e(t.type)&&(e=t.stateNode),t=t.child,t!==null))for(ju(t,l,e),t=t.sibling;t!==null;)ju(t,l,e),t=t.sibling}function rr(t){var l=t.stateNode,e=t.memoizedProps;try{for(var a=t.type,n=l.attributes;n.length;)l.removeAttributeNode(n[0]);Ft(l,a,e),l[kt]=t,l[ll]=e}catch(u){At(t,t.return,u)}}var Jl=!1,Qt=!1,Hc=!1,dr=typeof WeakSet=="function"?WeakSet:Set,Kt=null;function Dm(t,l){if(t=t.containerInfo,as=wu,t=jf(t),Oi(t)){if("selectionStart"in t)var e={start:t.selectionStart,end:t.selectionEnd};else t:{e=(e=t.ownerDocument)&&e.defaultView||window;var a=e.getSelection&&e.getSelection();if(a&&a.rangeCount!==0){e=a.anchorNode;var n=a.anchorOffset,u=a.focusNode;a=a.focusOffset;try{e.nodeType,u.nodeType}catch{e=null;break t}var c=0,f=-1,r=-1,j=0,N=0,Y=t,E=null;l:for(;;){for(var M;Y!==e||n!==0&&Y.nodeType!==3||(f=c+n),Y!==u||a!==0&&Y.nodeType!==3||(r=c+a),Y.nodeType===3&&(c+=Y.nodeValue.length),(M=Y.firstChild)!==null;)E=Y,Y=M;for(;;){if(Y===t)break l;if(E===e&&++j===n&&(f=c),E===u&&++N===a&&(r=c),(M=Y.nextSibling)!==null)break;Y=E,E=Y.parentNode}Y=M}e=f===-1||r===-1?null:{start:f,end:r}}else e=null}e=e||{start:0,end:0}}else e=null;for(ns={focusedElem:t,selectionRange:e},wu=!1,Kt=l;Kt!==null;)if(l=Kt,t=l.child,(l.subtreeFlags&1028)!==0&&t!==null)t.return=l,Kt=t;else for(;Kt!==null;){switch(l=Kt,u=l.alternate,t=l.flags,l.tag){case 0:if((t&4)!==0&&(t=l.updateQueue,t=t!==null?t.events:null,t!==null))for(e=0;e title"))),Ft(u,a,e),u[kt]=t,Vt(u),a=u;break t;case"link":var c=pd("link","href",n).get(a+(e.href||""));if(c){for(var f=0;fOt&&(c=Ot,Ot=ut,ut=c);var p=bf(f,ut),g=bf(f,Ot);if(p&&g&&(M.rangeCount!==1||M.anchorNode!==p.node||M.anchorOffset!==p.offset||M.focusNode!==g.node||M.focusOffset!==g.offset)){var _=Y.createRange();_.setStart(p.node,p.offset),M.removeAllRanges(),ut>Ot?(M.addRange(_),M.extend(g.node,g.offset)):(_.setEnd(g.node,g.offset),M.addRange(_))}}}}for(Y=[],M=f;M=M.parentNode;)M.nodeType===1&&Y.push({element:M,left:M.scrollLeft,top:M.scrollTop});for(typeof f.focus=="function"&&f.focus(),f=0;fe?32:e,z.T=null,e=Zc,Zc=null;var u=xe,c=Pl;if(Zt=0,za=xe=null,Pl=0,(zt&6)!==0)throw Error(o(331));var f=zt;if(zt|=4,jr(u.current),Sr(u,u.current,c,e),zt=f,xn(0,!1),fl&&typeof fl.onPostCommitFiberRoot=="function")try{fl.onPostCommitFiberRoot(Ha,u)}catch{}return!0}finally{m.p=n,z.T=a,Gr(t,l)}}function Zr(t,l,e){l=_l(e,l),l=_c(t.stateNode,l,2),t=de(t,l,2),t!==null&&(qa(t,2),Hl(t))}function At(t,l,e){if(t.tag===3)Zr(t,t,e);else for(;l!==null;){if(l.tag===3){Zr(l,t,e);break}else if(l.tag===1){var a=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(pe===null||!pe.has(a))){t=_l(e,t),e=wo(2),a=de(l,e,2),a!==null&&(Vo(e,a,l,t),qa(a,2),Hl(a));break}}l=l.return}}function kc(t,l,e){var a=t.pingCache;if(a===null){a=t.pingCache=new Hm;var n=new Set;a.set(l,n)}else n=a.get(l),n===void 0&&(n=new Set,a.set(l,n));n.has(e)||(Xc=!0,n.add(e),t=Gm.bind(null,t,l,e),l.then(t,t))}function Gm(t,l,e){var a=t.pingCache;a!==null&&a.delete(l),t.pingedLanes|=t.suspendedLanes&e,t.warmLanes&=~e,Ct===t&&(pt&e)===e&&(Ht===4||Ht===3&&(pt&62914560)===pt&&300>sl()-Au?(zt&2)===0&&Ea(t,0):Lc|=e,ja===pt&&(ja=0)),Hl(t)}function wr(t,l){l===0&&(l=Hs()),t=Be(t,l),t!==null&&(qa(t,l),Hl(t))}function Qm(t){var l=t.memoizedState,e=0;l!==null&&(e=l.retryLane),wr(t,e)}function Zm(t,l){var e=0;switch(t.tag){case 31:case 13:var a=t.stateNode,n=t.memoizedState;n!==null&&(e=n.retryLane);break;case 19:a=t.stateNode;break;case 22:a=t.stateNode._retryCache;break;default:throw Error(o(314))}a!==null&&a.delete(l),wr(t,e)}function wm(t,l){return ii(t,l)}var Du=null,Ta=null,Jc=!1,Uu=!1,$c=!1,be=0;function Hl(t){t!==Ta&&t.next===null&&(Ta===null?Du=Ta=t:Ta=Ta.next=t),Uu=!0,Jc||(Jc=!0,Km())}function xn(t,l){if(!$c&&Uu){$c=!0;do for(var e=!1,a=Du;a!==null;){if(t!==0){var n=a.pendingLanes;if(n===0)var u=0;else{var c=a.suspendedLanes,f=a.pingedLanes;u=(1<<31-ol(42|t)+1)-1,u&=n&~(c&~f),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(e=!0,Jr(a,u))}else u=pt,u=qn(a,a===Ct?u:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(u&3)===0||Ya(a,u)||(e=!0,Jr(a,u));a=a.next}while(e);$c=!1}}function Vm(){Vr()}function Vr(){Uu=Jc=!1;var t=0;be!==0&&e0()&&(t=be);for(var l=sl(),e=null,a=Du;a!==null;){var n=a.next,u=Kr(a,l);u===0?(a.next=null,e===null?Du=n:e.next=n,n===null&&(Ta=e)):(e=a,(t!==0||(u&3)!==0)&&(Uu=!0)),a=n}Zt!==0&&Zt!==5||xn(t),be!==0&&(be=0)}function Kr(t,l){for(var e=t.suspendedLanes,a=t.pingedLanes,n=t.expirationTimes,u=t.pendingLanes&-62914561;0f)break;var N=r.transferSize,Y=r.initiatorType;N&&ed(Y)&&(r=r.responseEnd,c+=N*(r"u"?null:document;function md(t,l,e){var a=Ma;if(a&&typeof l=="string"&&l){var n=Sl(l);n='link[rel="'+t+'"][href="'+n+'"]',typeof e=="string"&&(n+='[crossorigin="'+e+'"]'),hd.has(n)||(hd.add(n),t={rel:t,crossOrigin:e,href:l},a.querySelector(n)===null&&(l=a.createElement("link"),Ft(l,"link",t),Vt(l),a.head.appendChild(l)))}}function r0(t){te.D(t),md("dns-prefetch",t,null)}function d0(t,l){te.C(t,l),md("preconnect",t,l)}function h0(t,l,e){te.L(t,l,e);var a=Ma;if(a&&t&&l){var n='link[rel="preload"][as="'+Sl(l)+'"]';l==="image"&&e&&e.imageSrcSet?(n+='[imagesrcset="'+Sl(e.imageSrcSet)+'"]',typeof e.imageSizes=="string"&&(n+='[imagesizes="'+Sl(e.imageSizes)+'"]')):n+='[href="'+Sl(t)+'"]';var u=n;switch(l){case"style":u=Oa(t);break;case"script":u=Ca(t)}Ml.has(u)||(t=H({rel:"preload",href:l==="image"&&e&&e.imageSrcSet?void 0:t,as:l},e),Ml.set(u,t),a.querySelector(n)!==null||l==="style"&&a.querySelector(jn(u))||l==="script"&&a.querySelector(zn(u))||(l=a.createElement("link"),Ft(l,"link",t),Vt(l),a.head.appendChild(l)))}}function m0(t,l){te.m(t,l);var e=Ma;if(e&&t){var a=l&&typeof l.as=="string"?l.as:"script",n='link[rel="modulepreload"][as="'+Sl(a)+'"][href="'+Sl(t)+'"]',u=n;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=Ca(t)}if(!Ml.has(u)&&(t=H({rel:"modulepreload",href:t},l),Ml.set(u,t),e.querySelector(n)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(e.querySelector(zn(u)))return}a=e.createElement("link"),Ft(a,"link",t),Vt(a),e.head.appendChild(a)}}}function y0(t,l,e){te.S(t,l,e);var a=Ma;if(a&&t){var n=Fe(a).hoistableStyles,u=Oa(t);l=l||"default";var c=n.get(u);if(!c){var f={loading:0,preload:null};if(c=a.querySelector(jn(u)))f.loading=5;else{t=H({rel:"stylesheet",href:t,"data-precedence":l},e),(e=Ml.get(u))&&rs(t,e);var r=c=a.createElement("link");Vt(r),Ft(r,"link",t),r._p=new Promise(function(j,N){r.onload=j,r.onerror=N}),r.addEventListener("load",function(){f.loading|=1}),r.addEventListener("error",function(){f.loading|=2}),f.loading|=4,Xu(c,l,a)}c={type:"stylesheet",instance:c,count:1,state:f},n.set(u,c)}}}function g0(t,l){te.X(t,l);var e=Ma;if(e&&t){var a=Fe(e).hoistableScripts,n=Ca(t),u=a.get(n);u||(u=e.querySelector(zn(n)),u||(t=H({src:t,async:!0},l),(l=Ml.get(n))&&ds(t,l),u=e.createElement("script"),Vt(u),Ft(u,"link",t),e.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},a.set(n,u))}}function v0(t,l){te.M(t,l);var e=Ma;if(e&&t){var a=Fe(e).hoistableScripts,n=Ca(t),u=a.get(n);u||(u=e.querySelector(zn(n)),u||(t=H({src:t,async:!0,type:"module"},l),(l=Ml.get(n))&&ds(t,l),u=e.createElement("script"),Vt(u),Ft(u,"link",t),e.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},a.set(n,u))}}function yd(t,l,e,a){var n=(n=ht.current)?qu(n):null;if(!n)throw Error(o(446));switch(t){case"meta":case"title":return null;case"style":return typeof e.precedence=="string"&&typeof e.href=="string"?(l=Oa(e.href),e=Fe(n).hoistableStyles,a=e.get(l),a||(a={type:"style",instance:null,count:0,state:null},e.set(l,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(e.rel==="stylesheet"&&typeof e.href=="string"&&typeof e.precedence=="string"){t=Oa(e.href);var u=Fe(n).hoistableStyles,c=u.get(t);if(c||(n=n.ownerDocument||n,c={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(t,c),(u=n.querySelector(jn(t)))&&!u._p&&(c.instance=u,c.state.loading=5),Ml.has(t)||(e={rel:"preload",as:"style",href:e.href,crossOrigin:e.crossOrigin,integrity:e.integrity,media:e.media,hrefLang:e.hrefLang,referrerPolicy:e.referrerPolicy},Ml.set(t,e),u||p0(n,t,e,c.state))),l&&a===null)throw Error(o(528,""));return c}if(l&&a!==null)throw Error(o(529,""));return null;case"script":return l=e.async,e=e.src,typeof e=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(l=Ca(e),e=Fe(n).hoistableScripts,a=e.get(l),a||(a={type:"script",instance:null,count:0,state:null},e.set(l,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,t))}}function Oa(t){return'href="'+Sl(t)+'"'}function jn(t){return'link[rel="stylesheet"]['+t+"]"}function gd(t){return H({},t,{"data-precedence":t.precedence,precedence:null})}function p0(t,l,e,a){t.querySelector('link[rel="preload"][as="style"]['+l+"]")?a.loading=1:(l=t.createElement("link"),a.preload=l,l.addEventListener("load",function(){return a.loading|=1}),l.addEventListener("error",function(){return a.loading|=2}),Ft(l,"link",e),Vt(l),t.head.appendChild(l))}function Ca(t){return'[src="'+Sl(t)+'"]'}function zn(t){return"script[async]"+t}function vd(t,l,e){if(l.count++,l.instance===null)switch(l.type){case"style":var a=t.querySelector('style[data-href~="'+Sl(e.href)+'"]');if(a)return l.instance=a,Vt(a),a;var n=H({},e,{"data-href":e.href,"data-precedence":e.precedence,href:null,precedence:null});return a=(t.ownerDocument||t).createElement("style"),Vt(a),Ft(a,"style",n),Xu(a,e.precedence,t),l.instance=a;case"stylesheet":n=Oa(e.href);var u=t.querySelector(jn(n));if(u)return l.state.loading|=4,l.instance=u,Vt(u),u;a=gd(e),(n=Ml.get(n))&&rs(a,n),u=(t.ownerDocument||t).createElement("link"),Vt(u);var c=u;return c._p=new Promise(function(f,r){c.onload=f,c.onerror=r}),Ft(u,"link",a),l.state.loading|=4,Xu(u,e.precedence,t),l.instance=u;case"script":return u=Ca(e.src),(n=t.querySelector(zn(u)))?(l.instance=n,Vt(n),n):(a=e,(n=Ml.get(u))&&(a=H({},e),ds(a,n)),t=t.ownerDocument||t,n=t.createElement("script"),Vt(n),Ft(n,"link",a),t.head.appendChild(n),l.instance=n);case"void":return null;default:throw Error(o(443,l.type))}else l.type==="stylesheet"&&(l.state.loading&4)===0&&(a=l.instance,l.state.loading|=4,Xu(a,e.precedence,t));return l.instance}function Xu(t,l,e){for(var a=e.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),n=a.length?a[a.length-1]:null,u=n,c=0;c title"):null)}function x0(t,l,e){if(e===1||l.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof l.precedence!="string"||typeof l.href!="string"||l.href==="")break;return!0;case"link":if(typeof l.rel!="string"||typeof l.href!="string"||l.href===""||l.onLoad||l.onError)break;switch(l.rel){case"stylesheet":return t=l.disabled,typeof l.precedence=="string"&&t==null;default:return!0}case"script":if(l.async&&typeof l.async!="function"&&typeof l.async!="symbol"&&!l.onLoad&&!l.onError&&l.src&&typeof l.src=="string")return!0}return!1}function Sd(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function S0(t,l,e,a){if(e.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(e.state.loading&4)===0){if(e.instance===null){var n=Oa(a.href),u=l.querySelector(jn(n));if(u){l=u._p,l!==null&&typeof l=="object"&&typeof l.then=="function"&&(t.count++,t=Gu.bind(t),l.then(t,t)),e.state.loading|=4,e.instance=u,Vt(u);return}u=l.ownerDocument||l,a=gd(a),(n=Ml.get(n))&&rs(a,n),u=u.createElement("link"),Vt(u);var c=u;c._p=new Promise(function(f,r){c.onload=f,c.onerror=r}),Ft(u,"link",a),e.instance=u}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(e,l),(l=e.state.preload)&&(e.state.loading&3)===0&&(t.count++,e=Gu.bind(t),l.addEventListener("load",e),l.addEventListener("error",e))}}var hs=0;function b0(t,l){return t.stylesheets&&t.count===0&&Zu(t,t.stylesheets),0hs?50:800)+l);return t.unsuspend=e,function(){t.unsuspend=null,clearTimeout(a),clearTimeout(n)}}:null}function Gu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Zu(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Qu=null;function Zu(t,l){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Qu=new Map,l.forEach(_0,t),Qu=null,Gu.call(t))}function _0(t,l){if(!(l.state.loading&4)){var e=Qu.get(t);if(e)var a=e.get(null);else{e=new Map,Qu.set(t,e);for(var n=t.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(v){console.error(v)}}return s(),_s.exports=X0(),_s.exports}var G0=L0();const Q0="modulepreload",Z0=function(s){return"/v2/"+s},wd={},w0=function(v,S,o){let d=Promise.resolve();if(S&&S.length>0){let T=function(y){return Promise.all(y.map(q=>Promise.resolve(q).then(H=>({status:"fulfilled",value:H}),H=>({status:"rejected",reason:H}))))};document.getElementsByTagName("link");const A=document.querySelector("meta[property=csp-nonce]"),b=(A==null?void 0:A.nonce)||(A==null?void 0:A.getAttribute("nonce"));d=T(S.map(y=>{if(y=Z0(y),y in wd)return;wd[y]=!0;const q=y.endsWith(".css"),H=q?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${y}"]${H}`))return;const L=document.createElement("link");if(L.rel=q?"stylesheet":Q0,q||(L.as="script"),L.crossOrigin="",L.href=y,b&&L.setAttribute("nonce",b),document.head.appendChild(L),q)return new Promise((F,it)=>{L.addEventListener("load",F),L.addEventListener("error",()=>it(new Error(`Unable to preload CSS for ${y}`)))})}))}function x(T){const A=new Event("vite:preloadError",{cancelable:!0});if(A.payload=T,window.dispatchEvent(A),!A.defaultPrevented)throw T}return d.then(T=>{for(const A of T||[])A.status==="rejected"&&x(A.reason);return v().catch(x)})},nh=R.createContext({windows:[],openWindow:()=>{},closeWindow:()=>{},bringToFront:()=>{}}),V0=({children:s})=>{const[v,S]=R.useState([]),o=R.useRef(1e4),d=R.useCallback((A,b,y)=>{S(q=>q.find(L=>L.id===A)?q.map(L=>L.id===A?{...L,zIndex:++o.current}:L):[...q,{id:A,title:b,charName:y,zIndex:++o.current}])},[]),x=R.useCallback(A=>{S(b=>b.filter(y=>y.id!==A))},[]),T=R.useCallback(A=>{S(b=>b.map(y=>y.id===A?{...y,zIndex:++o.current}:y))},[]);return i.jsx(nh.Provider,{value:{windows:v,openWindow:d,closeWindow:x,bringToFront:T},children:s})},ti=()=>R.useContext(nh),Ol={west:-102.1,east:102.1,north:102.1,south:-102.1};function li(s,v,S,o){const d=(s-Ol.west)/(Ol.east-Ol.west)*S,x=(Ol.north-v)/(Ol.north-Ol.south)*o;return{x:d,y:x}}function K0(s,v,S,o,d,x,T){const A=(s-o)/S,b=(v-d)/S,y=Ol.west+A/x*(Ol.east-Ol.west),q=Ol.north-b/T*(Ol.north-Ol.south);return{ew:y,ns:q}}function Os(s,v){const S=s>=0?"N":"S",o=v>=0?"E":"W";return`${Math.abs(s).toFixed(1)}${S}, ${Math.abs(v).toFixed(1)}${o}`}const uh=Pu.memo(({players:s,imgW:v,imgH:S,getColor:o,onHover:d,onSelect:x})=>{const T=R.useMemo(()=>s.filter(A=>A.ew!==void 0&&A.ns!==void 0).map(A=>({...A,pos:li(A.ew,A.ns,v,S),color:o(A.character_name)})),[s,v,S,o]);return i.jsx("div",{className:"ml-dots-layer",children:T.map(A=>i.jsx("div",{className:"ml-dot",style:{left:A.pos.x,top:A.pos.y,backgroundColor:A.color},onMouseEnter:b=>{var q;const y=(q=b.currentTarget.closest(".ml-map-container"))==null?void 0:q.getBoundingClientRect();y&&d(A,b.clientX-y.left,b.clientY-y.top)},onMouseLeave:()=>d(null,0,0),onClick:()=>x(A.character_name)},A.character_name))})});uh.displayName="PlayerDots";const k0="/api";async function tl(s){const v=await fetch(`${k0}${s}`,{credentials:"include"});if(!v.ok)throw new Error(`API ${s}: ${v.status}`);return v.json()}function J0(){return`${location.protocol==="https:"?"wss:":"ws:"}//${location.host}/api/ws/live`}const ih=Pu.memo(({imgW:s,imgH:v,getColor:S})=>{const[o,d]=R.useState([]);R.useEffect(()=>{const T=async()=>{try{const b=await tl("/trails/?seconds=600");d(b.trails??[])}catch{}};T();const A=setInterval(T,2e3);return()=>clearInterval(A)},[]);const x=R.useMemo(()=>{const T={};for(const A of o){const{x:b,y}=li(A.ew,A.ns,s,v);T[A.character_name]||(T[A.character_name]=[]),T[A.character_name].push(`${b},${y}`)}return Object.entries(T).filter(([,A])=>A.length>=2).map(([A,b])=>({name:A,points:b.join(" ")}))},[o,s,v]);return i.jsx("svg",{className:"ml-trails-svg",viewBox:`0 0 ${s} ${v}`,preserveAspectRatio:"none",children:x.map(T=>i.jsx("polyline",{points:T.points,stroke:S(T.name),fill:"none",strokeWidth:2,strokeOpacity:.7,strokeLinecap:"round",strokeLinejoin:"round"},T.name))})});ih.displayName="TrailsSVG";const $0=({imgW:s,imgH:v,enabled:S})=>{const o=R.useRef(null),[d,x]=R.useState([]);return R.useEffect(()=>{if(!S)return;(async()=>{try{const A=await tl("/spawns/heatmap?hours=24&limit=50000");x(A.spawn_points??[])}catch{}})()},[S]),R.useEffect(()=>{const T=o.current;if(!T||!S||d.length===0||s===0)return;T.width=s,T.height=v;const A=T.getContext("2d");if(A){A.clearRect(0,0,s,v);for(const b of d){const{x:y,y:q}=li(b.ew,b.ns,s,v),H=Math.max(5,Math.min(12,5+Math.sqrt(b.intensity*.5))),L=A.createRadialGradient(y,q,0,y,q,H);L.addColorStop(0,`rgba(255, 0, 0, ${Math.min(.9,b.intensity/40)})`),L.addColorStop(.6,`rgba(255, 100, 0, ${Math.min(.4,b.intensity/120)})`),L.addColorStop(1,"rgba(255, 150, 0, 0)"),A.fillStyle=L,A.fillRect(y-H,q-H,H*2,H*2)}}},[d,s,v,S]),S?i.jsx("canvas",{ref:o,className:"ml-heatmap-canvas"}):null},W0=({imgW:s,imgH:v,enabled:S})=>{const[o,d]=R.useState([]);R.useEffect(()=>{if(!S)return;const T=async()=>{try{const b=await tl("/portals");d(b.portals??[])}catch{}};T();const A=setInterval(T,6e4);return()=>clearInterval(A)},[S]);const x=R.useMemo(()=>o.map(T=>({...T,pos:li(T.coordinates.ew,T.coordinates.ns,s,v)})),[o,s,v]);return!S||x.length===0?null:i.jsx("div",{className:"ml-portals-layer",children:x.map((T,A)=>i.jsx("div",{className:"ml-portal-icon",style:{left:T.pos.x,top:T.pos.y},title:`${T.portal_name} (by ${T.discovered_by})`},A))})},F0=20,I0=.3,P0=({players:s,getColor:v,onSelectPlayer:S,showHeatmap:o,showPortals:d})=>{var V;const x=R.useRef(null),T=R.useRef(null),[A,b]=R.useState({w:0,h:0}),[y,q]=R.useState(null),[H,L]=R.useState(null),F=R.useRef({scale:1,offX:0,offY:0}),it=R.useRef({dragging:!1,sx:0,sy:0,startOffX:0,startOffY:0}),tt=R.useCallback(()=>{if(T.current){const{scale:K,offX:X,offY:C}=F.current;T.current.style.transform=`translate(${X}px, ${C}px) scale(${K})`}},[]),bt=R.useCallback(K=>{const X=K.currentTarget;if(b({w:X.naturalWidth,h:X.naturalHeight}),x.current){const C=x.current.clientWidth,Q=x.current.clientHeight,et=Math.min(C/X.naturalWidth,Q/X.naturalHeight);F.current={scale:et,offX:(C-X.naturalWidth*et)/2,offY:(Q-X.naturalHeight*et)/2},tt()}},[tt]),I=R.useCallback(K=>{var mt;K.preventDefault();const X=(mt=x.current)==null?void 0:mt.getBoundingClientRect();if(!X)return;const C=F.current,Q=K.deltaY<0?1.1:.9,et=Math.min(F0,Math.max(I0,C.scale*Q)),J=et/C.scale,st=K.clientX-X.left,dt=K.clientY-X.top;F.current={scale:et,offX:st-(st-C.offX)*J,offY:dt-(dt-C.offY)*J},tt()},[tt]),O=R.useCallback(K=>{if(K.button!==0)return;const X=F.current;it.current={dragging:!0,sx:K.clientX,sy:K.clientY,startOffX:X.offX,startOffY:X.offY}},[]);R.useEffect(()=>{const K=C=>{const Q=it.current;if(Q.dragging&&(F.current.offX=Q.startOffX+(C.clientX-Q.sx),F.current.offY=Q.startOffY+(C.clientY-Q.sy),tt()),x.current&&A.w>0){const et=x.current.getBoundingClientRect(),J=F.current,st=K0(C.clientX-et.left,C.clientY-et.top,J.scale,J.offX,J.offY,A.w,A.h);L(st)}},X=()=>{it.current.dragging=!1};return window.addEventListener("mousemove",K),window.addEventListener("mouseup",X),()=>{window.removeEventListener("mousemove",K),window.removeEventListener("mouseup",X)}},[tt,A.w,A.h]);const w=R.useCallback((K,X,C)=>{q(K?{x:X,y:C,player:K}:null)},[]);return i.jsxs("div",{className:"ml-map-container",ref:x,onWheel:I,onMouseDown:O,children:[i.jsxs("div",{ref:T,className:"ml-map-group",children:[i.jsx("img",{src:"/dereth.png",alt:"Dereth",className:"ml-map-img",onLoad:bt,draggable:!1}),A.w>0&&i.jsxs(i.Fragment,{children:[i.jsx($0,{imgW:A.w,imgH:A.h,enabled:o}),i.jsx(ih,{imgW:A.w,imgH:A.h,getColor:v}),i.jsx(uh,{players:s,imgW:A.w,imgH:A.h,getColor:v,onHover:w,onSelect:S}),i.jsx(W0,{imgW:A.w,imgH:A.h,enabled:d})]})]}),y&&i.jsxs("div",{className:"ml-tooltip",style:{left:y.x+12,top:y.y-10},children:[i.jsx("strong",{children:y.player.character_name}),i.jsx("br",{}),Os(y.player.ns,y.player.ew),i.jsx("br",{}),y.player.kills_per_hour," kph · ",(V=y.player.kills)==null?void 0:V.toLocaleString()," kills"]}),H&&i.jsx("div",{className:"ml-coords",children:Os(H.ns,H.ew)})]})},ch=Pu.memo(({player:s,vitals:v,color:S,onSelect:o})=>{var y,q;const{openWindow:d}=ti(),x=(s.vt_state||"idle").toLowerCase(),T=x==="combat"||x==="hunt",A=(s.total_rares??0)>0?Math.round((s.total_kills??0)/(s.total_rares??1)).toLocaleString():null,b=s.character_name;return i.jsxs("li",{className:"ml-player-row",style:{borderLeftColor:S},children:[i.jsxs("div",{className:"ml-pr-header",onClick:o,children:[i.jsx("span",{className:"ml-pr-name",children:b}),i.jsx("span",{className:"ml-pr-coords",children:Os(s.ns,s.ew)})]}),i.jsxs("div",{className:"ml-pr-vitals",children:[i.jsx("div",{className:"ml-vital-bar hp",children:i.jsx("div",{className:"ml-vital-fill",style:{width:`${(v==null?void 0:v.health_percentage)??0}%`}})}),i.jsx("div",{className:"ml-vital-bar sta",children:i.jsx("div",{className:"ml-vital-fill",style:{width:`${(v==null?void 0:v.stamina_percentage)??0}%`}})}),i.jsx("div",{className:"ml-vital-bar mana",children:i.jsx("div",{className:"ml-vital-fill",style:{width:`${(v==null?void 0:v.mana_percentage)??0}%`}})})]}),i.jsxs("div",{className:"ml-pr-grid",children:[i.jsxs("span",{className:"ml-gs",title:"Session kills",children:["⚔️ ",((y=s.kills)==null?void 0:y.toLocaleString())??0]}),i.jsxs("span",{className:"ml-gs",title:"Total kills",children:["🏆 ",(s.total_kills??0).toLocaleString()]}),i.jsxs("span",{className:"ml-gs",title:"Kills per hour",children:[s.kills_per_hour??"0"," ",i.jsx("span",{className:"ml-suffix",children:"KPH"})]}),i.jsxs("span",{className:"ml-gs",title:"Rares (session / total)",children:["💎 ",s.session_rares??0," / ",s.total_rares??0]}),i.jsx("span",{className:"ml-gs",title:"Kills per rare",children:A?i.jsxs(i.Fragment,{children:["📊 ",A," ",i.jsx("span",{className:"ml-suffix",children:"KPR"})]}):""}),i.jsx("span",{className:`ml-meta-pill ${T?"active":""}`,children:s.vt_state||"idle"}),i.jsxs("span",{className:"ml-gs",title:"Online time",children:["🕐 ",((q=s.onlinetime)==null?void 0:q.replace(/^00\./,""))??"--"]}),i.jsxs("span",{className:"ml-gs",title:"Deaths",children:["☠️ ",s.deaths??"0"]}),i.jsxs("span",{className:"ml-gs",title:"Prismatic tapers",children:[i.jsx("img",{src:"/prismatic-taper-icon.png",className:"ml-taper-icon",alt:""}),s.prismatic_taper_count??"0"]})]}),i.jsxs("div",{className:"ml-pr-buttons",children:[i.jsx("button",{className:"ml-btn accent",onClick:()=>d(`chat-${b}`,`Chat: ${b}`,b),children:"Chat"}),i.jsx("button",{className:"ml-btn accent",onClick:()=>d(`stats-${b}`,`Stats: ${b}`,b),children:"Stats"}),i.jsx("button",{className:"ml-btn accent",onClick:()=>d(`inv-${b}`,`Inventory: ${b}`,b),children:"Inv"}),i.jsx("button",{className:"ml-btn",onClick:()=>d(`char-${b}`,`Character: ${b}`,b),children:"Char"}),i.jsx("button",{className:"ml-btn",onClick:()=>d(`combat-${b}`,`Combat: ${b}`,b),children:"Combat"}),i.jsx("button",{className:"ml-btn",onClick:()=>d(`radar-${b}`,`Radar: ${b}`,b),children:"Radar"})]})]})});ch.displayName="PlayerRow";const ty=({players:s,vitals:v,getColor:S,onSelect:o})=>i.jsx("ul",{className:"ml-player-list",children:s.map(d=>i.jsx(ch,{player:d,vitals:v.get(d.character_name)??null,color:S(d.character_name),onSelect:()=>o(d.character_name)},d.character_name))}),ly=[{key:"name",label:"Name"},{key:"kph",label:"KPH"},{key:"skills",label:"S.Kills"},{key:"srares",label:"S.Rares"},{key:"tkills",label:"T.Kills"},{key:"kpr",label:"KPR"}],ey=({value:s,onChange:v})=>i.jsx("div",{className:"ml-sort-buttons",children:ly.map(S=>i.jsx("button",{className:`ml-sort-btn ${s===S.key?"active":""}`,onClick:()=>v(S.key),children:S.label},S.key))}),ay=()=>{const{openWindow:s}=ti();return i.jsxs("div",{className:"ml-tool-links",children:[i.jsx("span",{className:"ml-tool-link",style:{cursor:"pointer"},onClick:()=>s("issues","Issues Board"),children:"📋 Issues"}),i.jsx("span",{className:"ml-tool-link",style:{cursor:"pointer"},onClick:()=>s("vitalsharing","Vital Sharing"),children:"🤝 Vitals"})]})},ny=({players:s,vitals:v,serverHealth:S,totalRares:o,totalKills:d,getColor:x,onSelectPlayer:T,onViewToggle:A,showHeatmap:b,showPortals:y,onToggleHeatmap:q,onTogglePortals:H})=>{var V,K;const[L,F]=R.useState("name"),[it,tt]=R.useState(""),bt=R.useMemo(()=>s.reduce((X,C)=>X+(parseInt(C.kills_per_hour)||0),0),[s]),I=((V=S==null?void 0:S.status)==null?void 0:V.toLowerCase())==="online"||((K=S==null?void 0:S.status)==null?void 0:K.toLowerCase())==="up",O=R.useDeferredValue(s),w=R.useMemo(()=>{let X=[...O];switch(it&&(X=X.filter(C=>C.character_name.toLowerCase().startsWith(it.toLowerCase()))),L){case"kph":X.sort((C,Q)=>(parseInt(Q.kills_per_hour)||0)-(parseInt(C.kills_per_hour)||0));break;case"skills":X.sort((C,Q)=>(Q.kills||0)-(C.kills||0));break;case"srares":X.sort((C,Q)=>(Q.session_rares??0)-(C.session_rares??0));break;case"tkills":X.sort((C,Q)=>(Q.total_kills??0)-(C.total_kills??0));break;case"kpr":X.sort((C,Q)=>{const et=(C.total_kills??0)/Math.max(1,C.total_rares??1),J=(Q.total_kills??0)/Math.max(1,Q.total_rares??1);return et-J});break;default:X.sort((C,Q)=>C.character_name.localeCompare(Q.character_name))}return X},[O,L,it]);return i.jsxs("div",{className:"ml-sidebar",children:[i.jsxs("div",{className:"ml-sidebar-header",children:[i.jsxs("span",{className:"ml-sidebar-title",children:["Active Mosswart Enjoyers (",s.length,")"]}),i.jsx("button",{className:"ml-view-toggle",onClick:A,children:"Dashboard"})]}),i.jsxs("div",{className:"ml-server-status",children:[i.jsx("span",{className:`ml-status-dot ${I?"online":"offline"}`}),i.jsxs("span",{className:"ml-status-text",children:["Coldeve ",I?"Online":"Offline"]}),(S==null?void 0:S.player_count)!=null&&i.jsxs("span",{className:"ml-status-detail",children:["👥 ",S.player_count]}),(S==null?void 0:S.latency_ms)!=null&&i.jsxs("span",{className:"ml-status-detail",children:[Math.round(S.latency_ms),"ms"]}),(S==null?void 0:S.uptime_seconds)!=null&&i.jsxs("span",{className:"ml-status-detail",children:["Up: ",Math.floor(S.uptime_seconds/3600),"h"]})]}),i.jsxs("div",{className:"ml-counters",children:[i.jsxs("div",{className:"ml-counter rares",children:[i.jsx("span",{className:"ml-counter-val",children:o}),i.jsx("span",{className:"ml-counter-lbl",children:"Rares"})]}),i.jsxs("div",{className:`ml-counter kph ${bt>5e3?"ultra":""}`,children:[i.jsx("span",{className:"ml-counter-val",children:bt.toLocaleString()}),i.jsx("span",{className:"ml-counter-lbl",children:"Server KPH"})]}),i.jsxs("div",{className:"ml-counter kills",children:[i.jsx("span",{className:"ml-counter-val",children:d.toLocaleString()}),i.jsx("span",{className:"ml-counter-lbl",children:"Kills"})]})]}),i.jsxs("div",{className:"ml-tool-links",children:[i.jsx("a",{href:"/inventory.html",className:"ml-tool-link",children:"🔍 Inv Search"}),i.jsx("a",{href:"/suitbuilder.html",className:"ml-tool-link",children:"🛡️ Suitbuilder"}),i.jsx("a",{href:"/debug.html",className:"ml-tool-link",children:"🐛 Debug"}),i.jsx("a",{href:"/quest-status.html",target:"_blank",className:"ml-tool-link",children:"📜 Quests"})]}),i.jsx(ay,{}),i.jsxs("div",{className:"ml-toggles",children:[i.jsxs("label",{className:"ml-toggle-label",children:[i.jsx("input",{type:"checkbox",checked:b,onChange:X=>q(X.target.checked)}),i.jsx("span",{children:"Spawn Heatmap"})]}),i.jsxs("label",{className:"ml-toggle-label",children:[i.jsx("input",{type:"checkbox",checked:y,onChange:X=>H(X.target.checked)}),i.jsx("span",{children:"Portals"})]})]}),i.jsx(ey,{value:L,onChange:F}),i.jsx("input",{className:"ml-filter",type:"text",placeholder:"Filter players...",value:it,onChange:X=>tt(X.target.value)}),i.jsx(ty,{players:w,vitals:v,getColor:x,onSelect:T})]})},le=({id:s,title:v,zIndex:S,width:o=700,height:d=340,children:x})=>{const{closeWindow:T,bringToFront:A}=ti(),b=R.useRef(null),y=R.useRef({dragging:!1,sx:0,sy:0,ox:0,oy:0}),q=R.useRef({x:420,y:10+Math.random()*40}),H=R.useCallback(L=>{var it;L.preventDefault(),A(s);const F=(it=b.current)==null?void 0:it.getBoundingClientRect();F&&(y.current={dragging:!0,sx:L.clientX,sy:L.clientY,ox:F.left,oy:F.top})},[s,A]);return R.useEffect(()=>{const L=it=>{const tt=y.current;!tt.dragging||!b.current||(q.current.x=tt.ox+(it.clientX-tt.sx),q.current.y=tt.oy+(it.clientY-tt.sy),b.current.style.left=`${q.current.x}px`,b.current.style.top=`${q.current.y}px`)},F=()=>{y.current.dragging=!1};return window.addEventListener("mousemove",L),window.addEventListener("mouseup",F),()=>{window.removeEventListener("mousemove",L),window.removeEventListener("mouseup",F)}},[]),i.jsxs("div",{ref:b,className:"ml-window",style:{zIndex:S,width:o,height:d,left:q.current.x,top:q.current.y},onMouseDown:()=>A(s),children:[i.jsxs("div",{className:"ml-window-header",onMouseDown:H,children:[i.jsx("span",{className:"ml-window-title",children:v}),i.jsx("button",{className:"ml-window-close",onClick:()=>T(s),children:"×"})]}),i.jsx("div",{className:"ml-window-content",children:x})]})},uy={0:"#00FF00",2:"#FFFFFF",3:"#FF0000",4:"#FFFFFF",5:"#33CCFF",6:"#CCFF99",7:"#00FFFF",14:"#FFD700",15:"#FF69B4",17:"#AAAAFF",18:"#88FF88",21:"#FF8888",22:"#FFAA66"},iy=({id:s,charName:v,zIndex:S,messages:o,socket:d})=>{const x=R.useRef(null),[T,A]=R.useState("");R.useEffect(()=>{x.current&&(x.current.scrollTop=x.current.scrollHeight)},[o.length]);const b=y=>{y.preventDefault();const q=T.trim();!q||!d||d.readyState!==WebSocket.OPEN||(d.send(JSON.stringify({player_name:v,command:q})),A(""))};return i.jsxs(le,{id:s,title:`Chat: ${v}`,zIndex:S,width:600,height:300,children:[i.jsx("div",{className:"ml-chat-messages",ref:x,children:o.map((y,q)=>i.jsx("div",{className:"ml-chat-line",style:{color:uy[y.color??2]??"#ddd"},children:y.text},q))}),i.jsx("form",{className:"ml-chat-form",onSubmit:b,children:i.jsx("input",{className:"ml-chat-input",value:T,onChange:y=>A(y.target.value),placeholder:"Enter chat..."})})]})},cy=[{title:"Kills per Hour",id:1},{title:"Memory (MB)",id:2},{title:"CPU (%)",id:3},{title:"Mem Handles",id:4}],sy=[{label:"1H",value:"now-1h"},{label:"6H",value:"now-6h"},{label:"24H",value:"now-24h"},{label:"7D",value:"now-7d"}],fy=({id:s,charName:v,zIndex:S})=>{const[o,d]=R.useState("now-24h"),x=T=>`/grafana/d-solo/dereth-tracker/dereth-tracker-dashboard?panelId=${T}&var-character=${encodeURIComponent(v)}&from=${o}&to=now&theme=light`;return i.jsxs(le,{id:s,title:`Stats: ${v}`,zIndex:S,width:750,height:480,children:[i.jsx("div",{className:"ml-stats-controls",children:sy.map(T=>i.jsx("button",{className:`ml-stats-range-btn ${o===T.value?"active":""}`,onClick:()=>d(T.value),children:T.label},T.value))}),i.jsx("div",{className:"ml-stats-grid",children:cy.map(T=>i.jsx("div",{className:"ml-stats-panel",children:i.jsx("iframe",{src:x(T.id),width:"100%",height:"100%",frameBorder:"0",title:T.title})},T.id))})]})},Vd={218:"Reinforcement of the Lugians",219:"Bleeargh's Fortitude",220:"Oswald's Enhancement",221:"Siraluun's Blessing",222:"Enduring Calm",223:"Steadfast Will",224:"Ciandra's Essence",225:"Yoshi's Essence",226:"Jibril's Essence",227:"Celdiseth's Essence",228:"Koga's Essence",229:"Shadow of the Seventh Mule",230:"Might of the Seventh Mule",231:"Clutch of the Miser",232:"Enduring Enchantment",233:"Critical Protection",234:"Quick Learner",235:"Ciandra's Fortune",236:"Charmed Smith",237:"Innate Renewal",238:"Archmage's Endurance",239:"Enhancement of the Blade Turner",240:"Enhancement of the Arrow Turner",241:"Enhancement of the Mace Turner",242:"Caustic Enhancement",243:"Fierce Impaler",244:"Iron Skin of the Invincible",245:"Eye of the Remorseless",246:"Hand of the Remorseless",294:"Master of the Steel Circle",295:"Master of the Focused Eye",296:"Master of the Five Fold Path",297:"Frenzy of the Slayer",298:"Iron Skin of the Invincible",299:"Jack of All Trades",300:"Infused Void Magic",301:"Infused War Magic",302:"Infused Life Magic",309:"Infused Item Magic",310:"Infused Creature Magic",326:"Clutch of the Miser",328:"Enduring Enchantment"},Kd={333:"Valor / Destruction",334:"Protection",335:"Glory / Retribution",336:"Temperance / Hardening",338:"Aetheric Vision",339:"Mana Flow",340:"Mana Infusion",342:"Purity",343:"Craftsman",344:"Specialization",365:"World"},kd={370:"Damage",371:"Damage Resistance",372:"Critical",373:"Critical Resistance",374:"Critical Damage",375:"Critical Damage Resistance",376:"Healing Boost",379:"Vitality"},Jd={287:"Celestial Hand",288:"Eldrytch Web",289:"Radiant Blood"},$d={354:"Melee",355:"Ranged",362:"Summoning"},oy={1:"Unarmed",2:"Swords",3:"Axes",4:"Maces",5:"Spears",6:"Daggers",7:"Staves",8:"Bows",9:"Crossbows",10:"Thrown",11:"Two-Handed",12:"Void",13:"War",14:"Life"},Wd={181:"Chess Rank",192:"Fishing Skill",199:"Total Augmentations",322:"Aetheria Slots",390:"Enlightenment"};function ry(s){return s>=1001?"Master":s>=301?"Lord":s>=151?"Knight":s>=31?"Adept":"Initiate"}const pl="#af7a30",Fu="#000022",dy=({id:s,charName:v,zIndex:S,vitals:o})=>{var W,z;const[d,x]=R.useState(null),[T,A]=R.useState(0),[b,y]=R.useState(0);R.useEffect(()=>{tl(`/character-stats/${encodeURIComponent(v)}`).then(x).catch(()=>{})},[v]);const q=m=>m!=null?Number(m).toLocaleString():"—",H=(d==null?void 0:d.stats_data)||d||{},L=H.attributes||{},F=H.skills||{},it=H.vitals||{},tt=H.titles||[],bt=H.properties||{},I=Object.entries(F).filter(([,m])=>(m==null?void 0:m.training)==="Specialized").sort(([m],[U])=>m.localeCompare(U)),O=Object.entries(F).filter(([,m])=>(m==null?void 0:m.training)==="Trained").sort(([m],[U])=>m.localeCompare(U)),w=Object.entries(bt).filter(([m,U])=>Vd[parseInt(m)]&&Number(U)>0).map(([m,U])=>({name:Vd[parseInt(m)],uses:Number(U)})),V=Object.entries(bt).filter(([m,U])=>Kd[parseInt(m)]&&Number(U)>0).map(([m,U])=>({name:Kd[parseInt(m)],uses:Number(U)})),K=Object.entries(bt).filter(([m,U])=>kd[parseInt(m)]&&Number(U)>0).map(([m,U])=>({name:kd[parseInt(m)],value:Number(U)})),X=[];d!=null&&d.birth&&X.push({name:"Birth",value:d.birth}),(d==null?void 0:d.deaths)!=null&&X.push({name:"Deaths",value:q(d.deaths)}),Object.entries(bt).forEach(([m,U])=>{const Z=parseInt(m);Wd[Z]&&X.push({name:Wd[Z],value:U})});const C=[];Object.entries(bt).forEach(([m,U])=>{const Z=parseInt(m);$d[Z]&&C.push({name:$d[Z],value:oy[Number(U)]||`Unknown (${U})`})});const Q=[];Object.entries(bt).forEach(([m,U])=>{const Z=parseInt(m);Jd[Z]&&Number(U)>0&&Q.push({name:Jd[Z],rank:ry(Number(U)),value:Number(U)})});const et=m=>({padding:"5px 8px",fontSize:12,fontWeight:"bold",color:"#fff",cursor:"pointer",userSelect:"none",borderTop:`2px solid ${m?pl:Fu}`,borderLeft:`2px solid ${m?pl:Fu}`,borderRight:`2px solid ${m?pl:Fu}`,background:m?"rgba(0,100,0,0.4)":"transparent"}),J={background:"#000",border:`2px solid ${pl}`,maxHeight:400,overflowY:"auto",overflowX:"hidden"},st={background:"#222",fontWeight:"bold",fontSize:12,padding:"2px 6px"},dt={padding:"2px 6px",background:"rgba(0,100,0,0.4)",whiteSpace:"nowrap"},mt={padding:"2px 6px",background:"rgba(0,0,100,0.4)",textAlign:"right",whiteSpace:"nowrap"},G={padding:"2px 6px",color:"#ccc"};return i.jsx(le,{id:s,title:`Character: ${v}`,zIndex:S,width:740,height:600,children:i.jsxs("div",{style:{background:Fu,color:"#fff",font:'14px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif',overflowY:"auto",padding:"10px 15px 15px",flex:1},children:[i.jsxs("div",{style:{marginBottom:10},children:[i.jsxs("h1",{style:{margin:"0 0 2px",fontSize:28,fontWeight:"bold"},children:[v,i.jsx("span",{style:{fontSize:"200%",color:"#fff27f",float:"right"},children:(d==null?void 0:d.level)||""})]}),i.jsx("div",{style:{fontSize:"85%",color:"gold"},children:[d==null?void 0:d.gender,d==null?void 0:d.race].filter(Boolean).join(" ")||"Awaiting character data..."})]}),i.jsxs("div",{style:{fontSize:"85%",margin:"6px 0 10px",display:"grid",gridTemplateColumns:"1fr 1fr",gap:"0 20px"},children:[i.jsxs("div",{children:["Total XP: ",q(d==null?void 0:d.total_xp)]}),i.jsxs("div",{style:{textAlign:"right"},children:["Unassigned XP: ",q(d==null?void 0:d.unassigned_xp)]}),i.jsxs("div",{children:["Luminance: ",(d==null?void 0:d.luminance_earned)!=null?`${q(d.luminance_earned)} / ${q(d.luminance_total)}`:"—"]}),i.jsxs("div",{style:{textAlign:"right"},children:["Deaths: ",q(d==null?void 0:d.deaths)]})]}),i.jsxs("div",{style:{display:"flex",gap:13,flexWrap:"wrap"},children:[i.jsxs("div",{style:{width:320},children:[i.jsx("div",{style:{height:30,display:"flex"},children:["Attributes","Skills","Titles"].map((m,U)=>i.jsx("div",{style:et(T===U),onClick:()=>A(U),children:m},m))}),i.jsxs("div",{style:J,children:[T===0&&i.jsxs(i.Fragment,{children:[i.jsx("div",{style:{padding:"6px 8px",display:"flex",flexDirection:"column",gap:8,borderBottom:`2px solid ${pl}`},children:[{label:"Health",pct:(o==null?void 0:o.health_percentage)??0,cur:o==null?void 0:o.health_current,max:o==null?void 0:o.health_max,bg:"#cc3333"},{label:"Stamina",pct:(o==null?void 0:o.stamina_percentage)??0,cur:o==null?void 0:o.stamina_current,max:o==null?void 0:o.stamina_max,bg:"#ccaa33"},{label:"Mana",pct:(o==null?void 0:o.mana_percentage)??0,cur:o==null?void 0:o.mana_current,max:o==null?void 0:o.mana_max,bg:"#3366cc"}].map(m=>i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[i.jsx("span",{style:{width:55,fontSize:12,color:"#ccc"},children:m.label}),i.jsx("div",{style:{flex:1,height:14,overflow:"hidden",position:"relative",border:`1px solid ${pl}`},children:i.jsx("div",{style:{height:"100%",width:`${m.pct}%`,background:m.bg,transition:"width 0.5s ease"}})}),i.jsxs("span",{style:{width:80,textAlign:"right",fontSize:12,color:"#ccc"},children:[m.cur??"—"," / ",m.max??"—"]})]},m.label))}),i.jsxs("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("td",{style:st,children:"Attribute"}),i.jsx("td",{style:st,children:"Creation"}),i.jsx("td",{style:st,children:"Base"})]})}),i.jsx("tbody",{children:["strength","endurance","coordination","quickness","focus","self"].map(m=>{var U,Z;return i.jsxs("tr",{children:[i.jsx("td",{style:dt,children:m.charAt(0).toUpperCase()+m.slice(1)}),i.jsx("td",{style:G,children:((U=L[m])==null?void 0:U.creation)??"—"}),i.jsx("td",{style:mt,children:((Z=L[m])==null?void 0:Z.base)??"—"})]},m)})})]}),i.jsxs("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("td",{style:st,children:"Vital"}),i.jsx("td",{style:st,children:"Base"})]})}),i.jsx("tbody",{children:["health","stamina","mana"].map(m=>{var U;return i.jsxs("tr",{children:[i.jsx("td",{style:dt,children:m.charAt(0).toUpperCase()+m.slice(1)}),i.jsx("td",{style:mt,children:((U=it[m])==null?void 0:U.base)??"—"})]},m)})})]}),i.jsx("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:i.jsx("tbody",{children:i.jsxs("tr",{children:[i.jsx("td",{style:dt,children:"Skill Credits"}),i.jsx("td",{style:mt,children:q(H.skill_credits)})]})})})]}),T===1&&i.jsxs("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("td",{style:st,children:"Skill"}),i.jsx("td",{style:st,children:"Level"})]})}),i.jsxs("tbody",{children:[I.map(([m,U])=>i.jsxs("tr",{children:[i.jsx("td",{style:{padding:"2px 6px",background:"linear-gradient(to right, #392067, #392067, black)"},children:m.replace(/_/g," ").replace(/\b\w/g,Z=>Z.toUpperCase())}),i.jsx("td",{style:{...mt,background:"linear-gradient(to right, #392067, #392067, black)"},children:U.base})]},m)),O.map(([m,U])=>i.jsxs("tr",{children:[i.jsx("td",{style:{padding:"2px 6px",background:"linear-gradient(to right, #0f3c3e, #0f3c3e, black)"},children:m.replace(/_/g," ").replace(/\b\w/g,Z=>Z.toUpperCase())}),i.jsx("td",{style:{...mt,background:"linear-gradient(to right, #0f3c3e, #0f3c3e, black)"},children:U.base})]},m)),I.length===0&&O.length===0&&i.jsx("tr",{children:i.jsx("td",{colSpan:2,style:{padding:10,color:"#666",fontStyle:"italic",textAlign:"center"},children:"No skill data"})})]})]}),T===2&&i.jsx("div",{style:{padding:"6px 10px",fontSize:13},children:tt.length>0?tt.map((m,U)=>i.jsx("div",{style:{padding:"1px 0"},children:m},U)):i.jsx("div",{style:{color:"#666",fontStyle:"italic",textAlign:"center",padding:10},children:"No titles"})})]})]}),i.jsxs("div",{style:{width:320},children:[i.jsx("div",{style:{height:30,display:"flex"},children:["Augmentations","Ratings","Other"].map((m,U)=>i.jsx("div",{style:et(b===U),onClick:()=>y(U),children:m},m))}),i.jsxs("div",{style:J,children:[b===0&&(w.length||V.length?i.jsxs(i.Fragment,{children:[w.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("div",{style:{background:"#222",padding:"4px 8px",fontWeight:"bold",fontSize:13,borderBottom:`1px solid ${pl}`},children:"Augmentations"}),i.jsxs("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("td",{style:st,children:"Name"}),i.jsx("td",{style:st,children:"Uses"})]})}),i.jsx("tbody",{children:w.map(m=>i.jsxs("tr",{children:[i.jsx("td",{style:{padding:"2px 6px"},children:m.name}),i.jsx("td",{style:{padding:"2px 6px",textAlign:"right"},children:m.uses})]},m.name))})]})]}),V.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("div",{style:{background:"#222",padding:"4px 8px",fontWeight:"bold",fontSize:13,borderBottom:`1px solid ${pl}`},children:"Auras"}),i.jsxs("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("td",{style:st,children:"Name"}),i.jsx("td",{style:st,children:"Uses"})]})}),i.jsx("tbody",{children:V.map(m=>i.jsxs("tr",{children:[i.jsx("td",{style:{padding:"2px 6px"},children:m.name}),i.jsx("td",{style:{padding:"2px 6px",textAlign:"right"},children:m.uses})]},m.name))})]})]})]}):i.jsx("div",{style:{color:"#666",fontStyle:"italic",textAlign:"center",padding:10},children:"No augmentation data"})),b===1&&(K.length>0?i.jsxs("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("td",{style:st,children:"Rating"}),i.jsx("td",{style:st,children:"Value"})]})}),i.jsx("tbody",{children:K.map(m=>i.jsxs("tr",{children:[i.jsx("td",{style:{padding:"2px 6px"},children:m.name}),i.jsx("td",{style:{padding:"2px 6px",textAlign:"right"},children:m.value})]},m.name))})]}):i.jsx("div",{style:{color:"#666",fontStyle:"italic",textAlign:"center",padding:10},children:"No rating data"})),b===2&&i.jsxs("div",{children:[X.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("div",{style:{background:"#222",padding:"4px 8px",fontWeight:"bold",fontSize:13,borderBottom:`1px solid ${pl}`},children:"General"}),i.jsx("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:i.jsx("tbody",{children:X.map(m=>i.jsxs("tr",{children:[i.jsx("td",{style:{padding:"2px 6px"},children:m.name}),i.jsx("td",{style:{padding:"2px 6px",textAlign:"right"},children:m.value})]},m.name))})})]}),C.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("div",{style:{background:"#222",padding:"4px 8px",fontWeight:"bold",fontSize:13,borderBottom:`1px solid ${pl}`},children:"Masteries"}),i.jsx("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:i.jsx("tbody",{children:C.map(m=>i.jsxs("tr",{children:[i.jsx("td",{style:{padding:"2px 6px"},children:m.name}),i.jsx("td",{style:{padding:"2px 6px",textAlign:"right"},children:m.value})]},m.name))})})]}),Q.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("div",{style:{background:"#222",padding:"4px 8px",fontWeight:"bold",fontSize:13,borderBottom:`1px solid ${pl}`},children:"Society"}),i.jsx("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:i.jsx("tbody",{children:Q.map(m=>i.jsxs("tr",{children:[i.jsx("td",{style:{padding:"2px 6px"},children:m.name}),i.jsxs("td",{style:{padding:"2px 6px",textAlign:"right"},children:[m.rank," (",m.value,")"]})]},m.name))})})]}),X.length===0&&C.length===0&&Q.length===0&&i.jsx("div",{style:{color:"#666",fontStyle:"italic",textAlign:"center",padding:10},children:"No additional data"})]})]})]})]}),(d==null?void 0:d.allegiance)&&i.jsxs("div",{style:{marginTop:5,border:`2px solid ${pl}`,background:"#000"},children:[i.jsx("div",{style:{background:"#222",padding:"4px 8px",fontWeight:"bold",fontSize:13,borderBottom:`1px solid ${pl}`},children:"Allegiance"}),i.jsx("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:i.jsxs("tbody",{children:[d.allegiance.name&&i.jsxs("tr",{children:[i.jsx("td",{style:{padding:"2px 6px",color:"#ccc",width:100},children:"Name"}),i.jsx("td",{style:{padding:"2px 6px"},children:d.allegiance.name})]}),((W=d.allegiance.monarch)==null?void 0:W.name)&&i.jsxs("tr",{children:[i.jsx("td",{style:{padding:"2px 6px",color:"#ccc"},children:"Monarch"}),i.jsx("td",{style:{padding:"2px 6px"},children:d.allegiance.monarch.name})]}),((z=d.allegiance.patron)==null?void 0:z.name)&&i.jsxs("tr",{children:[i.jsx("td",{style:{padding:"2px 6px",color:"#ccc"},children:"Patron"}),i.jsx("td",{style:{padding:"2px 6px"},children:d.allegiance.patron.name})]}),d.allegiance.rank!=null&&i.jsxs("tr",{children:[i.jsx("td",{style:{padding:"2px 6px",color:"#ccc"},children:"Rank"}),i.jsx("td",{style:{padding:"2px 6px"},children:d.allegiance.rank})]}),d.allegiance.followers!=null&&i.jsxs("tr",{children:[i.jsx("td",{style:{padding:"2px 6px",color:"#ccc"},children:"Followers"}),i.jsx("td",{style:{padding:"2px 6px"},children:d.allegiance.followers})]})]})})]})]})})};function hy(s){var o,d;if(!s)return s;const v=x=>x!=null&&x!==-1&&x!==-1?x:void 0,S=s.IntValues||{};return{item_id:s.item_id??s.Id??0,name:s.name??s.Name??((o=s.StringValues)==null?void 0:o["1"])??"Unknown",icon:s.icon??s.Icon??0,object_class:s.object_class??s.ObjectClass??0,current_wielded_location:s.current_wielded_location??v(s.CurrentWieldedLocation)??v(Number(S[10]))??0,container_id:s.container_id??s.ContainerId??0,items_capacity:s.items_capacity??v(s.ItemsCapacity)??v(Number(S[6]))??((d=s.enhanced_properties)==null?void 0:d.ItemSlots_Decal)??void 0,value:s.value??v(s.Value)??v(Number(S[19]))??0,burden:s.burden??v(s.Burden)??v(Number(S[5]))??0,armor_level:s.armor_level??v(s.ArmorLevel),max_damage:s.max_damage??v(s.MaxDamage),material:s.material??s.material_name??s.Material??void 0,item_set:s.item_set??s.ItemSet??void 0,imbue:s.imbue??s.Imbue??void 0,tinks:s.tinks??v(s.Tinks),workmanship:s.workmanship??v(s.Workmanship),equip_skill:s.equip_skill??s.equip_skill_name??s.EquipSkill??void 0,wield_level:s.wield_level??v(s.WieldLevel),skill_level:s.skill_level??v(s.SkillLevel),lore_requirement:s.lore_requirement??v(s.LoreRequirement),attack_bonus:s.attack_bonus??v(s.AttackBonus),melee_defense_bonus:s.melee_defense_bonus??v(s.MeleeDefenseBonus),magic_defense_bonus:s.magic_defense_bonus??v(s.MagicDBonus),damage_bonus:s.damage_bonus??v(s.DamageBonus),damage_rating:s.damage_rating??v(s.DamRating),crit_rating:s.crit_rating??v(s.CritRating),heal_boost_rating:s.heal_boost_rating??v(s.HealBoostRating),current_mana:s.current_mana??v(Number(S[218103815]))??void 0,max_mana:s.max_mana??v(Number(S[218103814]))??void 0,spellcraft:s.spellcraft??void 0,damage_range:s.damage_range??void 0,damage_type:s.damage_type??void 0,speed_text:s.speed_text??void 0,mana_display:s.mana_display??void 0,spells:s.spells??void 0,icon_overlay_id:s.icon_overlay_id??v(Number(S[218103849]))??void 0,icon_underlay_id:s.icon_underlay_id??v(Number(S[218103850]))??void 0,_raw:s}}function Iu(s){return!s||s<=0?"06000133":(s+100663296).toString(16).toUpperCase().padStart(8,"0")}const Ra={32768:{name:"Neck",row:1,col:1},1:{name:"Head",row:1,col:3},268435456:{name:"Sigil",row:1,col:5},536870912:{name:"Sigil",row:1,col:6},1073741824:{name:"Sigil",row:1,col:7},67108864:{name:"Trinket",row:2,col:1},2048:{name:"U.Arm",row:2,col:2},512:{name:"Chest",row:2,col:3},134217728:{name:"Cloak",row:2,col:7},65536:{name:"Brace L",row:3,col:1},4096:{name:"L.Arm",row:3,col:2},1024:{name:"Abdomen",row:3,col:3},8192:{name:"U.Leg",row:3,col:4},131072:{name:"Brace R",row:3,col:5},2:{name:"Shirt",row:3,col:7},262144:{name:"Ring L",row:4,col:1},32:{name:"Hands",row:4,col:2},16384:{name:"L.Leg",row:4,col:4},524288:{name:"Ring R",row:4,col:5},4:{name:"Pants",row:4,col:7},256:{name:"Feet",row:5,col:4},2097152:{name:"Shield",row:6,col:1},1048576:{name:"Melee",row:6,col:3},4194304:{name:"Missile",row:6,col:3},16777216:{name:"Held",row:6,col:3},33554432:{name:"2H",row:6,col:3},8388608:{name:"Ammo",row:6,col:7}},Da={},my=[32768,67108864,65536,131072,262144,524288],yy=[1,512,2048,1024,4096,8192,16384,32,256],gy=[2,4,134217728,268435456,536870912,1073741824],vy=[2097152,1048576,4194304,16777216,33554432,8388608];(()=>{const s=new Set;Object.entries(Ra).forEach(([v,S])=>{const o=`${S.row}-${S.col}`,d=parseInt(v);s.has(o)||(s.add(o),my.includes(d)?Da[o]="#3a2555":yy.includes(d)?Da[o]="#1e2e55":gy.includes(d)?Da[o]="#1e3e3e":vy.includes(d)?Da[o]="#142040":Da[o]="#2a2a2a")})})();const Ua="#af7a30";function As({item:s,size:v=36}){const S={position:"absolute",top:0,left:0,width:v,height:v,border:"none",background:"transparent",imageRendering:"pixelated"},o=s.icon_underlay_id&&s.icon_underlay_id>100?`/icons/${Iu(s.icon_underlay_id)}.png`:null,d=s.icon_overlay_id&&s.icon_overlay_id>100?`/icons/${Iu(s.icon_overlay_id)}.png`:null;return i.jsxs("div",{style:{width:v,height:v,position:"relative"},children:[o&&i.jsx("img",{src:o,alt:"",style:{...S,zIndex:1},onError:x=>{x.target.style.display="none"}}),i.jsx("img",{src:`/icons/${Iu(s.icon)}.png`,alt:s.name,style:{...S,zIndex:2},onError:x=>{x.target.src="/icons/06000133.png"}}),d&&i.jsx("img",{src:d,alt:"",style:{...S,zIndex:3},onError:x=>{x.target.style.display="none"}})]})}function py({item:s,x:v,y:S}){var T,A;const o=b=>b!=null&&b!==-1&&b!==-1,d=b=>b.toLocaleString(),x=b=>`${((b-1)*100).toFixed(1)}%`;return i.jsxs("div",{style:{position:"fixed",left:v+14,top:S+14,background:"rgba(0,0,0,0.96)",border:"1px solid #555",borderRadius:4,padding:"8px 12px",zIndex:99999,minWidth:200,maxWidth:340,fontSize:13,color:"#ddd",pointerEvents:"none",lineHeight:1.6,fontFamily:'-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif'},children:[i.jsx("div",{style:{color:"#ffcc00",fontWeight:"bold",fontSize:14,marginBottom:4},children:s.name}),i.jsxs("div",{style:{color:"#aaa"},children:["Value: ",d(s.value)," · Burden: ",s.burden]}),s.workmanship&&i.jsxs("div",{style:{color:"#aaa"},children:["Workmanship: ",s.workmanship]}),s.material&&i.jsxs("div",{style:{color:"#88ff88"},children:["Material: ",s.material]}),o(s.armor_level)&&i.jsxs("div",{style:{color:"#88ff88"},children:["Armor Level: ",s.armor_level]}),o(s.max_damage)&&i.jsxs("div",{style:{color:"#88ff88"},children:["Max Damage: ",s.max_damage]}),s.damage_range&&i.jsxs("div",{style:{color:"#88ff88"},children:["Damage: ",s.damage_range,s.damage_type?`, ${s.damage_type}`:""]}),o(s.attack_bonus)&&s.attack_bonus!==1&&i.jsxs("div",{style:{color:"#88ff88"},children:["Attack: +",x(s.attack_bonus)]}),o(s.melee_defense_bonus)&&s.melee_defense_bonus!==1&&i.jsxs("div",{style:{color:"#88ff88"},children:["Melee Def: +",x(s.melee_defense_bonus)]}),o(s.magic_defense_bonus)&&s.magic_defense_bonus!==1&&i.jsxs("div",{style:{color:"#88ff88"},children:["Magic Def: +",x(s.magic_defense_bonus)]}),s.equip_skill&&i.jsxs("div",{style:{color:"#ddd"},children:["Skill: ",s.equip_skill]}),o(s.wield_level)&&i.jsxs("div",{style:{color:"#ffaa00"},children:["Wield Level: ",s.wield_level]}),o(s.lore_requirement)&&i.jsxs("div",{style:{color:"#ffaa00"},children:["Lore: ",s.lore_requirement]}),s.imbue&&i.jsxs("div",{style:{color:"#88ff88"},children:["Imbue: ",s.imbue]}),s.item_set&&i.jsxs("div",{style:{color:"#88ff88"},children:["Set: ",s.item_set]}),o(s.tinks)&&i.jsxs("div",{style:{color:"#88ff88"},children:["Tinks: ",s.tinks]}),o(s.damage_rating)&&i.jsxs("div",{children:["Damage Rating: ",s.damage_rating]}),o(s.crit_rating)&&i.jsxs("div",{children:["Crit Rating: ",s.crit_rating]}),o(s.heal_boost_rating)&&i.jsxs("div",{children:["Heal Boost: ",s.heal_boost_rating]}),s.spellcraft&&i.jsxs("div",{style:{color:"#dda0dd"},children:["Spellcraft: ",s.spellcraft]}),o(s.current_mana)&&o(s.max_mana)&&i.jsxs("div",{style:{color:"#98d7ff"},children:["Mana: ",s.current_mana," / ",s.max_mana]}),((A=(T=s.spells)==null?void 0:T.spells)==null?void 0:A.length)>0&&i.jsxs("div",{style:{color:"#4a90e2",marginTop:4,fontSize:12},children:["Spells: ",s.spells.spells.map(b=>b.name).join(", ")]})]})}function Fd({iconSrc:s,isActive:v,fillPct:S,label:o,onClick:d}){const x=S>90?"#b7432c":S>70?"#d8a431":"#00ff00";return i.jsxs("div",{onClick:d,title:o,style:{display:"flex",alignItems:"flex-start",gap:2,cursor:"pointer",flexShrink:0,marginTop:3,position:"relative"},children:[v&&i.jsx("span",{style:{position:"absolute",left:-11,top:8,color:Ua,fontSize:10},children:"▶"}),i.jsx("div",{style:{width:30,height:30,border:v?"1px solid #00ff00":"1px solid #333",boxShadow:v?"0 0 4px #00ff00":"none",background:"#000",display:"flex",alignItems:"center",justifyContent:"center"},children:i.jsx("img",{src:s,alt:"",style:{width:26,height:26,objectFit:"contain",imageRendering:"pixelated"},onError:T=>{T.target.src="/icons/06001080.png"}})}),i.jsx("div",{style:{width:7,height:30,background:"#222",border:"1px solid #666",position:"relative",overflow:"hidden",borderRadius:2},title:`${Math.round(S)}% full`,children:i.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,height:`${S}%`,background:x,minHeight:S>0?2:0}})})]})}const xy=({id:s,charName:v,zIndex:S})=>{var st,dt,mt;const[o,d]=R.useState([]),[x,T]=R.useState(!0),[A,b]=R.useState(null),[y,q]=R.useState(null),[H,L]=R.useState(null),[F,it]=R.useState(null);R.useEffect(()=>{T(!0),Promise.all([tl(`/inventory/${encodeURIComponent(v)}?limit=1000`).catch(()=>({items:[]})),tl(`/character-stats/${encodeURIComponent(v)}`).catch(()=>null)]).then(([G,W])=>{const z=G.items??[];d(z.map(hy)),L(W)}).finally(()=>T(!1))},[v]);const tt=R.useCallback((G,W)=>{q(G&&W?{item:G,x:W.clientX,y:W.clientY}:null)},[]),bt=R.useMemo(()=>{const G=new Set,W=[];return Object.entries(Ra).forEach(([z,m])=>{const U=`${m.row}-${m.col}`;G.has(U)||(G.add(U),W.push({key:U,...m,mask:parseInt(z)}))}),W},[]),{equippedMap:I,containers:O,packItems:w}=R.useMemo(()=>{const G=new Map,W=[],z=new Set,m=new Map;o.forEach(Z=>{Z.object_class===10&&(W.push(Z),z.add(Z.item_id))}),W.sort((Z,ct)=>(Z.item_id>>>0)-(ct.item_id>>>0));let U=null;return o.forEach(Z=>{Z.current_wielded_location>0&&Z.container_id&&!z.has(Z.container_id)&&(U=Z.container_id)}),o.forEach(Z=>{if(z.has(Z.item_id))return;const ct=Z.current_wielded_location;if(ct>0)if(Z.object_class===2)Object.entries(Ra).forEach(([D,k])=>{if((ct&parseInt(D))===parseInt(D)){const $=`${k.row}-${k.col}`;G.has($)||G.set($,Z)}});else{let D=!1;if(Ra[ct]){const k=Ra[ct],$=`${k.row}-${k.col}`;G.has($)||(G.set($,Z),D=!0)}if(!D){for(const[k,$]of Object.entries(Ra))if((ct&parseInt(k))===parseInt(k)){const nt=`${$.row}-${$.col}`;if(!G.has(nt)){G.set(nt,Z),D=!0;break}}}}else{let h=Z.container_id||0;U&&h===U&&(h=0),m.has(h)||m.set(h,[]),m.get(h).push(Z)}}),{equippedMap:G,containers:W,packItems:m}},[o]);let V=w.get(0)??[],K=0;if(V.length===0){let G=0;for(const[W,z]of w.entries())!O.some(m=>m.item_id===W)&&z.length>G&&(G=z.length,K=W);V=w.get(K)??[]}const X=A!==null?w.get(A)??[]:V,C=(H==null?void 0:H.burden_units)??((st=H==null?void 0:H.stats_data)==null?void 0:st.burden_units)??0,Q=(H==null?void 0:H.encumbrance_capacity)??((dt=H==null?void 0:H.stats_data)==null?void 0:dt.encumbrance_capacity)??0,et=Q>0?Math.min(200,C/Q*100):0,J=et>150?"#b7432c":et>100?"#d8a431":"#2e8b57";return x?i.jsx(le,{id:s,title:`Inventory: ${v}`,zIndex:S,width:572,height:720,children:i.jsx("div",{style:{padding:20,color:"#666",fontStyle:"italic"},children:"Loading inventory..."})}):i.jsxs(le,{id:s,title:`Inventory: ${v}`,zIndex:S,width:572,height:720,children:[i.jsxs("div",{style:{display:"flex",flex:1,overflow:"hidden",background:"rgba(14,14,14,0.96)",fontFamily:'-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif',fontSize:13},children:[i.jsxs("div",{style:{width:316,display:"flex",flexDirection:"column",overflow:"hidden"},children:[i.jsx("div",{style:{position:"relative",height:270,minHeight:270,background:"#0a0a0a",borderBottom:`1px solid ${Ua}`},children:bt.map(G=>{const W=I.get(G.key),z=Da[G.key]??"#2a2a2a";return i.jsx("div",{style:{position:"absolute",left:(G.col-1)*44+4,top:(G.row-1)*44+4,width:36,height:36,background:W?"#5a5a62":z,border:W?"2px solid #00ffff":"2px outset #6a6a72",boxShadow:W?"0 0 5px #00ffff, inset 0 0 5px rgba(0,255,255,0.2)":"none",display:"flex",alignItems:"center",justifyContent:"center",cursor:W?"pointer":"default"},onMouseEnter:m=>W&&tt(W,m),onMouseMove:m=>W&&tt(W,m),onMouseLeave:()=>tt(null),children:W?i.jsx(As,{item:W,size:32}):i.jsx("img",{src:"/icons/06000133.png",alt:"",style:{width:28,height:28,opacity:.15,filter:"grayscale(100%)",imageRendering:"pixelated"}})},G.key)})}),i.jsxs("div",{style:{padding:"3px 6px",fontSize:11,color:"#ccc",background:"#111",borderBottom:`1px solid ${Ua}`},children:["Contents of ",A!==null?((mt=O.find(G=>G.item_id===A))==null?void 0:mt.name)??"Pack":"Backpack"]}),i.jsxs("div",{style:{flex:1,overflowY:"auto",display:"grid",gridTemplateColumns:"repeat(6, 36px)",gridAutoRows:36,gap:2,padding:4,alignContent:"start"},children:[X.map((G,W)=>i.jsx("div",{style:{width:36,height:36,background:"linear-gradient(135deg, #3d007a 0%, #1a0033 100%)",border:"1px solid #4a148c",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},onMouseEnter:z=>tt(G,z),onMouseMove:z=>tt(G,z),onMouseLeave:()=>tt(null),children:i.jsx(As,{item:G,size:32})},G.item_id??W)),Array.from({length:Math.max(0,24-X.length)}).map((G,W)=>i.jsx("div",{style:{width:36,height:36,background:"#0a0a0a",border:"1px solid #1a1a1a"}},`e${W}`))]})]}),i.jsxs("div",{style:{width:42,display:"flex",flexDirection:"column",alignItems:"center",padding:"4px 2px",borderLeft:`1px solid ${Ua}`,borderRight:`1px solid ${Ua}`},children:[i.jsx("div",{style:{textAlign:"center",fontSize:8,color:"#ccc",marginBottom:2},children:Q>0?`${Math.floor(et)}%`:"Burden"}),i.jsx("div",{style:{width:14,height:40,background:"#111",border:"1px solid #555",position:"relative",overflow:"hidden",marginBottom:6,flexShrink:0},title:Q>0?`${C.toLocaleString()} / ${Q.toLocaleString()}`:`Burden: ${o.reduce((G,W)=>G+(W.burden??0),0).toLocaleString()}`,children:i.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,height:`${et/2}%`,background:J,transition:"height 0.3s"}})}),i.jsx(Fd,{iconSrc:"/icons/0600127E.png",isActive:A===null,fillPct:V.length>0?Math.min(100,V.length/102*100):0,label:`Backpack (${V.length}/102)`,onClick:()=>b(null)}),O.map(G=>{const W=G.item_id,z=o.filter(Z=>Z.container_id===W&&Z.item_id!==W).length,m=G.items_capacity||24,U=m>0?Math.min(100,z/m*100):0;return i.jsx(Fd,{iconSrc:`/icons/${Iu(G.icon)}.png`,isActive:A===W,fillPct:U,label:`${G.name} (${z}/${m})`,onClick:()=>b(W)},W)})]}),i.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden",minWidth:160},children:[i.jsx("div",{style:{padding:"4px 8px",fontSize:"0.72rem",fontWeight:600,color:"#aaa",background:"#111",borderBottom:`1px solid ${Ua}`},children:"Mana"}),i.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"2px 0"},children:[Array.from(I.values()).filter(G=>G.current_mana>0||G.max_mana>0).sort((G,W)=>(G.current_mana??999999)-(W.current_mana??999999)).map((G,W)=>i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4,padding:"2px 4px",borderBottom:"1px solid #1a1a1a",cursor:"pointer"},onMouseEnter:z=>tt(G,z),onMouseMove:z=>tt(G,z),onMouseLeave:()=>tt(null),children:[i.jsx("div",{style:{width:20,height:20,flexShrink:0},children:i.jsx(As,{item:G,size:20})}),i.jsx("div",{style:{width:8,height:8,borderRadius:"50%",background:G.current_mana>0?"#4c4":"#c44",flexShrink:0}}),i.jsx("div",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"0.68rem",color:"#ccc"},children:G.name}),i.jsxs("div",{style:{fontSize:"0.65rem",color:"#88bbff",whiteSpace:"nowrap",fontVariantNumeric:"tabular-nums"},children:[G.current_mana??0,"/",G.max_mana??0]}),i.jsx("div",{style:{fontSize:"0.63rem",color:"#9c9",whiteSpace:"nowrap",fontVariantNumeric:"tabular-nums",minWidth:42,textAlign:"right"},children:G.max_mana>0?Sy(G.current_mana??0,G.max_mana??0):""})]},W)),Array.from(I.values()).filter(G=>G.current_mana>0||G.max_mana>0).length===0&&i.jsx("div",{style:{padding:12,color:"#555",textAlign:"center",fontSize:"0.7rem"},children:"No mana items equipped"})]})]})]}),y&&i.jsx(py,{item:y.item,x:y.x,y:y.y})]})};function Sy(s,v){if(v<=0||s<=0)return"0h00m";const S=s*20,o=Math.floor(S/3600),d=Math.floor(S%3600/60);return`~${o}h${String(d).padStart(2,"0")}m`}const Ts=300,Id=.5,Pd={Monster:"#ff4444",Player:"#4488ff",NPC:"#44cc44",Vendor:"#44cc44",Portal:"#aa44ff",Corpse:"#ff8800",Container:"#cccc44",Door:"#888888"};function by(s){const v=(s%360+360)%360;return["N","NE","E","SE","S","SW","W","NW"][Math.round(v/45)%8]}const _y=({id:s,charName:v,zIndex:S,socket:o,radarData:d})=>{const x=R.useRef(null),T=R.useRef(Id),[A,b]=R.useState(Id),[y,q]=R.useState(null),H=R.useRef(null),L=R.useRef([]);R.useEffect(()=>{const I=new Image;I.src="/dereth.png",I.onload=()=>{H.current=I}},[]),R.useEffect(()=>((o==null?void 0:o.readyState)===WebSocket.OPEN&&o.send(JSON.stringify({player_name:v,command:"start_radar"})),()=>{(o==null?void 0:o.readyState)===WebSocket.OPEN&&o.send(JSON.stringify({player_name:v,command:"stop_radar"}))}),[v,o]);const F=R.useCallback(I=>{I.preventDefault();const O=I.deltaY>0?1.25:.8;T.current=Math.max(.02,Math.min(5,T.current*O)),b(T.current)},[]),it=R.useCallback(I=>{const O=x.current;if(!O)return;const w=O.getBoundingClientRect(),V=(I.clientX-w.left)*(O.width/w.width),K=(I.clientY-w.top)*(O.height/w.height);let X=null,C=20;L.current.forEach(Q=>{if(Q._px===void 0)return;const et=Math.sqrt((V-Q._px)**2+(K-Q._py)**2);et{const I=x.current;if(!I||!d)return;const O=I.getContext("2d");if(!O)return;const w=Ts,V=w/2,K=w/2,X=d.objects??[],C=d.player_ew??0,Q=d.player_ns??0,et=d.player_heading??0,J=d.is_dungeon??!1,st=d.player_x??0,dt=d.player_y??0,mt=T.current,G=J?w/2/(mt*240):w/2/mt,W=et*Math.PI/180;if(O.clearRect(0,0,w,w),O.fillStyle="#111",O.beginPath(),O.arc(V,K,V,0,Math.PI*2),O.fill(),O.save(),O.beginPath(),O.arc(V,K,V-1,0,Math.PI*2),O.clip(),!J&&H.current){const Z=H.current,ct=Z.naturalWidth/204.2,h=(C+102.1)*ct,D=(102.1-Q)*ct;O.globalAlpha=.4,O.save(),O.translate(V,K),O.rotate(-W),O.drawImage(Z,h-V/G*ct,D-K/G*ct,w/G*ct,w/G*ct,-V,-K,w,w),O.restore(),O.globalAlpha=1}O.restore(),O.strokeStyle="#333",O.lineWidth=1;for(let Z=1;Z<=4;Z++)O.beginPath(),O.arc(V,K,V/4*Z,0,Math.PI*2),O.stroke();O.beginPath(),O.moveTo(V,0),O.lineTo(V,w),O.moveTo(0,K),O.lineTo(w,K),O.stroke(),O.font="bold 12px monospace",O.textAlign="center",O.textBaseline="middle",[{l:"N",a:0},{l:"E",a:Math.PI/2},{l:"S",a:Math.PI},{l:"W",a:-Math.PI/2}].forEach(({l:Z,a:ct})=>{const h=ct-W;O.fillStyle=Z==="N"?"#cc4444":"#888",O.fillText(Z,V+Math.sin(h)*(V-12),K-Math.cos(h)*(V-12))}),O.strokeStyle="#666",O.lineWidth=1,O.beginPath(),O.moveTo(V,K),O.lineTo(V,K-V*.85),O.stroke();const z=J?Math.PI-W:W,m=Math.cos(z),U=Math.sin(z);X.forEach(Z=>{let ct,h;J&&Z.raw_x!==void 0?(ct=-(Z.raw_x-st),h=Z.raw_y-dt):(ct=(Z.ew??0)-C,h=(Z.ns??0)-Q);const D=ct*m-h*U,k=J?ct*U+h*m:-(ct*U+h*m),$=V+D*G,nt=K+k*G;if(Math.sqrt(($-V)**2+(nt-K)**2)>V-4)return;Z._px=$,Z._py=nt;const vt=Z.object_class??Z.type??"",wt=Pd[vt]??"#888",Nt=Z.id===y,ee=Nt?6:vt==="Monster"||vt==="Player"?4:3;Nt&&(O.strokeStyle="#fff",O.lineWidth=2,O.beginPath(),O.arc($,nt,ee+3,0,Math.PI*2),O.stroke()),O.fillStyle=wt,O.beginPath(),O.arc($,nt,ee,0,Math.PI*2),O.fill(),(vt==="Player"||vt==="Portal"||Nt)&&(O.fillStyle=Nt?"#fff":wt,O.font="9px monospace",O.textAlign="left",O.fillText(Z.name,$+6,nt+3))}),L.current=X,O.fillStyle="#ffcc00",O.beginPath(),O.arc(V,K,5,0,Math.PI*2),O.fill(),O.strokeStyle="#fff",O.lineWidth=1,O.stroke()},[d,A,y]);const tt=((d==null?void 0:d.objects)??[]).map(I=>{const O=(d==null?void 0:d.player_ew)??0,w=(d==null?void 0:d.player_ns)??0,V=(d==null?void 0:d.is_dungeon)??!1,K=(d==null?void 0:d.player_x)??0,X=(d==null?void 0:d.player_y)??0;let C,Q,et;V&&I.raw_x!==void 0?(C=-(I.raw_x-K),Q=I.raw_y-X,et=Math.sqrt(C*C+Q*Q)):(C=(I.ew??0)-O,Q=(I.ns??0)-w,et=Math.sqrt(C*C+Q*Q)*240);const J=Math.atan2(C,Q)*180/Math.PI;return{...I,dist:et,dir:by(J)}}).sort((I,O)=>I.dist-O.dist),bt=Math.round(A*240);return i.jsxs(le,{id:s,title:`Radar: ${v}`,zIndex:S,width:360,height:560,children:[i.jsxs("div",{style:{padding:"4px 8px",display:"flex",justifyContent:"space-between",fontSize:"0.75rem",color:"#888",borderBottom:"1px solid #333",background:"#1a1a1a"},children:[i.jsxs("span",{children:["Range: ~",bt,"m"]}),i.jsx("span",{style:{fontSize:"0.65rem",color:"#555"},children:"Scroll to zoom"})]}),i.jsx("canvas",{ref:x,width:Ts,height:Ts,style:{display:"block",margin:"0 auto",borderBottom:"1px solid #333",cursor:"crosshair",flexShrink:0},onWheel:F,onClick:it}),i.jsxs("div",{style:{flex:1,overflowY:"auto",fontSize:"0.72rem",minHeight:0},children:[i.jsxs("div",{style:{display:"flex",padding:"3px 6px",borderBottom:"1px solid #333",color:"#666",fontSize:"0.65rem",fontWeight:600},children:[i.jsx("span",{style:{width:8}}),i.jsx("span",{style:{flex:1,marginLeft:6},children:"Name"}),i.jsx("span",{style:{width:55,textAlign:"left"},children:"Type"}),i.jsx("span",{style:{width:40,textAlign:"right"},children:"Dist"}),i.jsx("span",{style:{width:24,textAlign:"center"},children:"Dir"})]}),tt.length===0&&i.jsx("div",{style:{padding:12,color:"#555",textAlign:"center",fontSize:"0.7rem"},children:"Waiting for radar data..."}),tt.map(I=>{const O=I.object_class??I.type??"",w=Pd[O]??"#888",V=I.id===y;return i.jsxs("div",{onClick:()=>q(V?null:I.id),style:{display:"flex",alignItems:"center",padding:"2px 6px",borderBottom:"1px solid #1a1a1a",cursor:"pointer",color:"#ccc",background:V?"#1a2a3a":"",borderLeft:V?"2px solid #4488ff":"2px solid transparent"},children:[i.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:w,flexShrink:0}}),i.jsx("span",{style:{flex:1,marginLeft:6,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:I.name}),i.jsx("span",{style:{width:55,color:"#888",fontSize:"0.65rem"},children:O}),i.jsx("span",{style:{width:40,textAlign:"right",fontVariantNumeric:"tabular-nums"},children:I.dist<1e3?`${Math.round(I.dist)}m`:`${(I.dist/1e3).toFixed(1)}km`}),i.jsx("span",{style:{width:24,textAlign:"center",color:"#666"},children:I.dir})]},I.id)})]})]})},Nn=["Typeless","Slash","Pierce","Bludgeon","Fire","Cold","Acid","Electric"];function Me(s,v,S){var o,d,x,T;return(((d=(o=s==null?void 0:s[v])==null?void 0:o[S])==null?void 0:d.total_normal_damage)??0)+(((T=(x=s==null?void 0:s[v])==null?void 0:x[S])==null?void 0:T.total_crit_damage)??0)}function jy(s){let v={attacks:0,failed:0,crits:0,normalDmg:0,maxNormal:0,critDmg:0,maxCrit:0};if(!s)return v;for(const S of Object.values(s))for(const o of Object.values(S))v.attacks+=o.total_attacks??0,v.failed+=o.failed_attacks??0,v.crits+=o.crits??0,v.normalDmg+=o.total_normal_damage??0,v.maxNormal=Math.max(v.maxNormal,o.max_normal_damage??0),v.critDmg+=o.total_crit_damage??0,v.maxCrit=Math.max(v.maxCrit,o.max_crit_damage??0);return v}function th(s,v){let S={attacks:0,failed:0};const o=s==null?void 0:s[v];if(!o)return S;for(const d of Object.values(o))S.attacks+=d.total_attacks??0,S.failed+=d.failed_attacks??0;return S}const zy=({id:s,charName:v,zIndex:S})=>{const[o,d]=R.useState(null),[x,T]=R.useState("session"),[A,b]=R.useState(null);R.useEffect(()=>{tl(`/combat-stats/${encodeURIComponent(v)}`).then(d).catch(()=>{});const C=setInterval(()=>{tl(`/combat-stats/${encodeURIComponent(v)}`).then(d).catch(()=>{})},1e4);return()=>clearInterval(C)},[v]);const y=o==null?void 0:o[x],q=(y==null?void 0:y.monsters)??{},H=Object.keys(q).filter(C=>C!=="__cloak_surges__").sort(),L=R.useMemo(()=>{let C={},Q={},et=0,J=0;const st=A?[q[A]].filter(Boolean):H.map(dt=>q[dt]);for(const dt of st)if(dt){for(const[mt,G]of Object.entries(dt.offense??{})){C[mt]||(C[mt]={});for(const[W,z]of Object.entries(G)){C[mt][W]||(C[mt][W]={total_attacks:0,failed_attacks:0,crits:0,total_normal_damage:0,max_normal_damage:0,total_crit_damage:0,max_crit_damage:0});const m=C[mt][W],U=z;m.total_attacks+=U.total_attacks??0,m.failed_attacks+=U.failed_attacks??0,m.crits+=U.crits??0,m.total_normal_damage+=U.total_normal_damage??0,m.max_normal_damage=Math.max(m.max_normal_damage,U.max_normal_damage??0),m.total_crit_damage+=U.total_crit_damage??0,m.max_crit_damage=Math.max(m.max_crit_damage,U.max_crit_damage??0)}}for(const[mt,G]of Object.entries(dt.defense??{})){Q[mt]||(Q[mt]={});for(const[W,z]of Object.entries(G)){Q[mt][W]||(Q[mt][W]={total_attacks:0,failed_attacks:0,crits:0,total_normal_damage:0,max_normal_damage:0,total_crit_damage:0,max_crit_damage:0});const m=Q[mt][W],U=z;m.total_attacks+=U.total_attacks??0,m.failed_attacks+=U.failed_attacks??0,m.total_normal_damage+=U.total_normal_damage??0,m.max_normal_damage=Math.max(m.max_normal_damage,U.max_normal_damage??0),m.total_crit_damage+=U.total_crit_damage??0,m.max_crit_damage=Math.max(m.max_crit_damage,U.max_crit_damage??0)}}et+=dt.aetheria_surges??0,J+=dt.cloak_surges??0}return q.__cloak_surges__&&!A&&(J+=q.__cloak_surges__.cloak_surges??0),{offense:C,defense:Q,aeth:et,cloak:J}},[q,H,A]),F=jy(L.offense),it=th(L.defense,"MeleeMissile"),tt=th(L.defense,"Magic");F.attacks>0&&((F.attacks-F.failed)/F.attacks*100).toFixed(0);const bt=it.attacks>0?(it.failed/it.attacks*100).toFixed(0):"0",I=tt.attacks>0?(tt.failed/tt.attacks*100).toFixed(0):"0",O=F.attacks-F.failed,w=O-F.crits,V=w>0?Math.round(F.normalDmg/w):0;F.crits>0&&Math.round(F.critDmg/F.crits);const K=O>0?(F.crits/O*100).toFixed(1):"0",X=C=>C===0?"":C.toLocaleString();return i.jsxs(le,{id:s,title:`Combat: ${v}`,zIndex:S,width:640,height:520,children:[i.jsxs("div",{style:{display:"flex",gap:4,padding:"4px 8px",borderBottom:"1px solid #333"},children:[i.jsx("button",{className:`ml-stats-range-btn ${x==="session"?"active":""}`,onClick:()=>T("session"),children:"Session"}),i.jsx("button",{className:`ml-stats-range-btn ${x==="lifetime"?"active":""}`,onClick:()=>T("lifetime"),children:"Lifetime"})]}),i.jsxs("div",{style:{display:"flex",flex:1,overflow:"hidden"},children:[i.jsxs("div",{style:{width:240,borderRight:"1px solid #333",overflowY:"auto",fontSize:"0.72rem"},children:[i.jsxs("div",{style:{display:"flex",padding:"3px 6px",borderBottom:"1px solid #333",color:"#777",fontSize:"0.65rem",fontWeight:600},children:[i.jsx("span",{style:{width:14}}),i.jsx("span",{style:{flex:1},children:"Monster"}),i.jsx("span",{style:{width:40,textAlign:"right"},children:"Kills"}),i.jsx("span",{style:{width:55,textAlign:"right"},children:"Dmg"})]}),i.jsxs("div",{style:{display:"flex",padding:"3px 6px",cursor:"pointer",background:A===null?"#2a3a4a":"",borderBottom:"1px solid #222",color:"#ddd"},onClick:()=>b(null),children:[i.jsx("span",{style:{width:14,color:"#888"},children:A===null?"*":""}),i.jsx("span",{style:{flex:1},children:"All"}),i.jsx("span",{style:{width:40,textAlign:"right"},children:X((y==null?void 0:y.total_kills)??0)}),i.jsx("span",{style:{width:55,textAlign:"right"},children:X((y==null?void 0:y.total_damage_given)??0)})]}),H.map(C=>{const Q=q[C];return i.jsxs("div",{style:{display:"flex",padding:"2px 6px",cursor:"pointer",background:A===C?"#2a3a4a":"",borderBottom:"1px solid #1a1a1a",color:"#ccc"},onClick:()=>b(C),children:[i.jsx("span",{style:{width:14,color:"#888"},children:A===C?"*":""}),i.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:C}),i.jsx("span",{style:{width:40,textAlign:"right"},children:X(Q.kill_count)}),i.jsx("span",{style:{width:55,textAlign:"right"},children:X(Q.damage_given)})]},C)})]}),i.jsx("div",{style:{flex:1,overflowY:"auto",padding:6,fontSize:"0.72rem"},children:i.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[i.jsx("thead",{children:i.jsxs("tr",{style:{color:"#777",fontSize:"0.65rem"},children:[i.jsx("th",{style:{textAlign:"left",padding:"1px 4px"}}),i.jsx("th",{style:{textAlign:"right",padding:"1px 3px"},children:"Given M/M"}),i.jsx("th",{style:{textAlign:"right",padding:"1px 3px"},children:"Given Mag"}),i.jsx("th",{style:{width:4}}),i.jsx("th",{style:{textAlign:"right",padding:"1px 3px"},children:"Recv M/M"}),i.jsx("th",{style:{textAlign:"right",padding:"1px 3px"},children:"Recv Mag"}),i.jsx("th",{style:{width:4}}),i.jsx("th",{style:{textAlign:"left",padding:"1px 3px"},children:"Stats"}),i.jsx("th",{style:{textAlign:"right",padding:"1px 3px"}})]})}),i.jsxs("tbody",{children:[Nn.map((C,Q)=>{const et=[["Evades",it.attacks>0?`${X(it.attacks)} (${bt}%)`:""],["Resists",tt.attacks>0?`${X(tt.attacks)} (${I}%)`:""],["A.Surges",L.aeth>0?`${X(L.aeth)}`:""],["C.Surges",L.cloak>0?`${X(L.cloak)}`:""],["",""],["",""],["Av/Mx",V>0?`${X(V)} / ${X(F.maxNormal)}`:""],["Crits",F.crits>0?`${X(F.crits)} (${K}%)`:""]][Q]??["",""];return i.jsxs("tr",{children:[i.jsx("td",{style:{padding:"1px 4px",color:"#888"},children:C}),i.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:X(Me(L.offense,"MeleeMissile",C))}),i.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:X(Me(L.offense,"Magic",C))}),i.jsx("td",{}),i.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:X(Me(L.defense,"MeleeMissile",C))}),i.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:X(Me(L.defense,"Magic",C))}),i.jsx("td",{}),i.jsx("td",{style:{padding:"1px 3px",color:"#777",fontWeight:600,fontSize:"0.65rem"},children:et[0]}),i.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:et[1]})]},C)}),i.jsx("tr",{children:i.jsx("td",{colSpan:9,style:{height:4}})}),i.jsxs("tr",{children:[i.jsx("td",{style:{padding:"1px 4px",color:"#888",fontWeight:600},children:"Total"}),i.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:X(Nn.reduce((C,Q)=>C+Me(L.offense,"MeleeMissile",Q),0))}),i.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:X(Nn.reduce((C,Q)=>C+Me(L.offense,"Magic",Q),0))}),i.jsx("td",{}),i.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:X(Nn.reduce((C,Q)=>C+Me(L.defense,"MeleeMissile",Q),0))}),i.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:X(Nn.reduce((C,Q)=>C+Me(L.defense,"Magic",Q),0))}),i.jsx("td",{}),i.jsx("td",{style:{padding:"1px 3px",color:"#777",fontWeight:600,fontSize:"0.65rem"},children:"Total"}),i.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:X(F.normalDmg+F.critDmg)})]})]})]})})]})]})},lh={plugin:{label:"Plugin",color:"#8844cc"},overlord:{label:"Overlord",color:"#4488cc"},nav:{label:"Nav",color:"#44aa44"},macro:{label:"Macro",color:"#cc8844"},other:{label:"Other",color:"#888888"}},Ba={padding:"3px 6px",fontSize:"0.8rem",border:"1px solid #555",background:"#2a2a2a",color:"#ddd",borderRadius:0},eh={...Ba,fontSize:"0.75rem"},Ms={padding:"4px 12px",background:"#4a80c0",color:"#fff",border:"1px solid #336699",cursor:"pointer",fontSize:"0.75rem"},Rn={padding:"3px 8px",background:"#444",color:"#ccc",border:"1px solid #555",cursor:"pointer",fontSize:"0.7rem"},Ey=({id:s,zIndex:v})=>{const[S,o]=R.useState([]),[d,x]=R.useState(""),[T,A]=R.useState(""),[b,y]=R.useState("plugin"),[q,H]=R.useState(null),[L,F]=R.useState(""),[it,tt]=R.useState(""),[bt,I]=R.useState(""),[O,w]=R.useState({}),V=R.useCallback(async()=>{try{const J=await tl("/issues");o((J.issues??[]).sort((st,dt)=>(st.resolved?1:0)-(dt.resolved?1:0)))}catch{}},[]);R.useEffect(()=>{V()},[V]);const K=async(J,st)=>{await fetch(`/api${J}`,{...st,credentials:"include",headers:{"Content-Type":"application/json",...st.headers}}),V()},X=async()=>{d.trim()&&(await K("/issues",{method:"POST",body:JSON.stringify({title:d.trim(),description:T.trim(),category:b})}),x(""),A(""))},C=J=>{if(q===J.id){H(null);return}H(J.id),F(J.title),tt(J.description||""),I(J.category||"other")},Q=async J=>{L.trim()&&(await K(`/issues/${J}`,{method:"PATCH",body:JSON.stringify({title:L.trim(),description:it.trim(),category:bt})}),H(null))},et=async J=>{const st=(O[J]||"").trim();st&&(await K(`/issues/${J}/comments`,{method:"POST",body:JSON.stringify({text:st})}),w(dt=>({...dt,[J]:""})))};return i.jsxs(le,{id:s,title:"Issues Board",zIndex:v,width:540,height:520,children:[i.jsxs("div",{style:{flex:1,overflowY:"auto",padding:6,fontSize:"0.8rem"},children:[S.length===0&&i.jsx("div",{style:{padding:10,color:"#888",textAlign:"center"},children:"No open issues"}),S.map(J=>{const st=lh[J.category]||lh.other,dt=J.created?new Date(J.created).toLocaleDateString("sv-SE"):"",mt=J.comments||[];return i.jsxs("div",{style:{padding:"6px 8px",marginBottom:4,background:"#1f1f1f",borderRadius:3,border:"1px solid #333",opacity:J.resolved?.55:1},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[i.jsx("span",{style:{fontSize:"0.65rem",padding:"1px 6px",borderRadius:3,background:st.color,color:"#fff",fontWeight:600},children:st.label}),i.jsx("strong",{style:{fontSize:"0.8rem",flex:1},children:J.title}),i.jsxs("span",{style:{fontSize:"0.65rem",color:"#888"},children:["by ",J.author||"User"]}),i.jsx("span",{style:{color:"#666",fontSize:"0.65rem"},children:dt})]}),J.description&&i.jsx("div",{style:{color:"#999",marginTop:3,fontSize:"0.75rem"},children:J.description}),i.jsxs("div",{style:{display:"flex",gap:4,marginTop:4},children:[J.resolved?i.jsxs(i.Fragment,{children:[i.jsx("button",{style:{...Rn,fontSize:"0.65rem"},onClick:()=>K(`/issues/${J.id}`,{method:"PATCH",body:JSON.stringify({resolved:!1})}),children:"↻ Reopen"}),i.jsx("button",{style:{...Rn,fontSize:"0.65rem",color:"#c66"},onClick:()=>{confirm(`Delete issue "${J.title}"?`)&&K(`/issues/${J.id}`,{method:"DELETE"})},children:"🗑 Delete"})]}):i.jsx("button",{style:{...Rn,fontSize:"0.65rem",background:"rgba(68,204,68,0.15)",color:"#4c4",border:"1px solid rgba(68,204,68,0.3)"},onClick:()=>K(`/issues/${J.id}`,{method:"PATCH",body:JSON.stringify({resolved:!0})}),children:"✓ Resolve"}),i.jsx("button",{style:{...Rn,fontSize:"0.65rem"},onClick:()=>C(J),children:"✎ Edit"})]}),q===J.id&&i.jsxs("div",{style:{marginTop:4,padding:4,background:"#222",borderRadius:3},children:[i.jsxs("div",{style:{display:"flex",gap:4,marginBottom:4},children:[i.jsx("input",{value:L,onChange:G=>F(G.target.value),style:{...Ba,flex:1}}),i.jsxs("select",{value:bt,onChange:G=>I(G.target.value),style:eh,children:[i.jsx("option",{value:"plugin",children:"Plugin"}),i.jsx("option",{value:"overlord",children:"Overlord"}),i.jsx("option",{value:"nav",children:"Nav"}),i.jsx("option",{value:"macro",children:"Macro"}),i.jsx("option",{value:"other",children:"Other"})]})]}),i.jsxs("div",{style:{display:"flex",gap:4},children:[i.jsx("textarea",{value:it,onChange:G=>tt(G.target.value),rows:2,style:{...Ba,flex:1,fontSize:"0.75rem",resize:"vertical"}}),i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[i.jsx("button",{style:{...Ms,fontSize:"0.7rem",padding:"3px 8px"},onClick:()=>Q(J.id),children:"Save"}),i.jsx("button",{style:{...Rn},onClick:()=>H(null),children:"Cancel"})]})]})]}),i.jsxs("div",{style:{marginTop:4,paddingTop:4,borderTop:"1px solid #2a2a2a"},children:[mt.length===0?i.jsx("div",{style:{color:"#555",fontSize:"0.7rem",padding:"2px 0"},children:"No comments yet"}):mt.map(G=>i.jsxs("div",{style:{marginBottom:3,fontSize:"0.72rem"},children:[i.jsx("span",{style:{color:"#8ac",fontWeight:500},children:G.author||"Anonymous"}),i.jsx("span",{style:{color:"#555",marginLeft:6,fontSize:"0.6rem"},children:G.created?new Date(G.created).toLocaleDateString("sv-SE"):""}),i.jsx("div",{style:{color:"#bbb",marginTop:1},children:G.text})]},G.id)),i.jsxs("div",{style:{display:"flex",gap:4,marginTop:3},children:[i.jsx("input",{value:O[J.id]||"",onChange:G=>w(W=>({...W,[J.id]:G.target.value})),placeholder:"Add a comment...",style:{...Ba,flex:1,fontSize:"0.75rem"},onKeyDown:G=>{G.key==="Enter"&&et(J.id)}}),i.jsx("button",{style:{...Ms,fontSize:"0.7rem",padding:"3px 8px"},onClick:()=>et(J.id),children:"Post"})]})]})]},J.id)})]}),i.jsxs("div",{style:{padding:6,borderTop:"1px solid #333"},children:[i.jsxs("div",{style:{display:"flex",gap:4,marginBottom:4},children:[i.jsx("input",{value:d,onChange:J=>x(J.target.value),placeholder:"Issue title...",style:{...Ba,flex:1},onKeyDown:J=>{J.key==="Enter"&&X()}}),i.jsxs("select",{value:b,onChange:J=>y(J.target.value),style:eh,children:[i.jsx("option",{value:"plugin",children:"Plugin"}),i.jsx("option",{value:"overlord",children:"Overlord"}),i.jsx("option",{value:"nav",children:"Nav"}),i.jsx("option",{value:"macro",children:"Macro"}),i.jsx("option",{value:"other",children:"Other"})]})]}),i.jsxs("div",{style:{display:"flex",gap:4},children:[i.jsx("textarea",{value:T,onChange:J=>A(J.target.value),placeholder:"Description (optional)...",rows:2,style:{...Ba,flex:1,fontSize:"0.75rem",resize:"vertical"}}),i.jsx("button",{style:{...Ms,alignSelf:"flex-end"},onClick:X,children:"Add"})]})]})]})},Ay=({id:s,zIndex:v})=>{const[S,o]=R.useState([]);R.useEffect(()=>{const x=async()=>{try{const A=await tl("/vital-sharing/peers");o(A.peers??[])}catch{}};x();const T=setInterval(x,5e3);return()=>clearInterval(T)},[]);const d=(x,T)=>T>0?Math.min(100,x/T*100):0;return i.jsx(le,{id:s,title:"Vital Sharing Network",zIndex:v,width:520,height:450,children:i.jsx("div",{style:{flex:1,overflowY:"auto",padding:6,fontSize:"0.75rem"},children:S.length===0?i.jsx("div",{style:{padding:16,color:"#666",textAlign:"center"},children:"No vital-sharing peers connected"}):S.map(x=>{var T,A,b;return i.jsxs("div",{style:{padding:"6px 8px",marginBottom:4,background:"#1f1f1f",borderRadius:3,border:"1px solid #333"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:3},children:[i.jsx("span",{style:{color:x.plugin_connected?"#4c4":"#a33",fontSize:"0.8rem"},children:"●"}),i.jsx("strong",{style:{flex:1},children:x.character_name}),x.subscribed&&i.jsx("span",{style:{color:"#6bf",fontSize:"0.65rem"},children:"[subscribed]"})]}),i.jsxs("div",{style:{color:"#666",fontSize:"0.68rem",marginBottom:3},children:["tags: ",((T=x.tags)==null?void 0:T.join(", "))||"none"]}),x.vitals&&x.vitals.max_health>0&&i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[{label:"HP",cur:x.vitals.current_health,max:x.vitals.max_health,bg:"#330000",fill:"#c44"},{label:"STA",cur:x.vitals.current_stamina,max:x.vitals.max_stamina,bg:"#331a00",fill:"#ca0"},{label:"MANA",cur:x.vitals.current_mana,max:x.vitals.max_mana,bg:"#001433",fill:"#48f"}].map(y=>i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[i.jsx("span",{style:{width:32,color:"#888",fontSize:"0.65rem"},children:y.label}),i.jsx("div",{style:{flex:1,height:6,background:y.bg,borderRadius:3,overflow:"hidden"},children:i.jsx("div",{style:{width:`${d(y.cur,y.max)}%`,height:"100%",background:y.fill,borderRadius:3}})}),i.jsxs("span",{style:{width:60,textAlign:"right",fontSize:"0.65rem",color:"#888"},children:[y.cur,"/",y.max]})]},y.label))}),x.position&&i.jsxs("div",{style:{color:"#555",fontSize:"0.65rem",marginTop:2},children:[(A=x.position.ns)==null?void 0:A.toFixed(1),"N, ",(b=x.position.ew)==null?void 0:b.toFixed(1),"E"]})]},x.character_name)})})})},Ty=({characters:s,chatMessages:v,nearbyObjects:S,socket:o})=>{const{windows:d}=ti();return i.jsx(i.Fragment,{children:d.map(x=>{var b;const T=x.charName??"";switch(x.id.split("-")[0]){case"chat":return i.jsx(iy,{id:x.id,charName:T,zIndex:x.zIndex,messages:v.get(T)??[],socket:o},x.id);case"stats":return i.jsx(fy,{id:x.id,charName:T,zIndex:x.zIndex},x.id);case"char":return i.jsx(dy,{id:x.id,charName:T,zIndex:x.zIndex,vitals:((b=s.get(T))==null?void 0:b.vitals)??void 0},x.id);case"inv":return i.jsx(xy,{id:x.id,charName:T,zIndex:x.zIndex},x.id);case"radar":return i.jsx(_y,{id:x.id,charName:T,zIndex:x.zIndex,socket:o,radarData:S.get(T)??null},x.id);case"combat":return i.jsx(zy,{id:x.id,charName:T,zIndex:x.zIndex},x.id);case"issues":return i.jsx(Ey,{id:x.id,zIndex:x.zIndex},x.id);case"vitalsharing":return i.jsx(Ay,{id:x.id,zIndex:x.zIndex},x.id);default:return null}})})};let My=0;const Oy=({recentRares:s})=>{const[v,S]=R.useState([]),[o,d]=R.useState(0),[x,T]=R.useState([]);R.useEffect(()=>{if(s.length>o&&o>0){const b=s.slice(0,s.length-o);for(const y of b){const q=++My;S(H=>[...H,{key:q,charName:y.character_name,rareName:y.name,exiting:!1}]),A(),setTimeout(()=>{S(H=>H.map(L=>L.key===q?{...L,exiting:!0}:L)),setTimeout(()=>{S(H=>H.filter(L=>L.key!==q))},500)},6e3)}}d(s.length)},[s.length]);const A=R.useCallback(()=>{const b=Date.now(),y=["#FFD700","#FF4444","#FF8800","#AA44FF","#4488FF"],q=Array.from({length:30},(H,L)=>{const F=Math.PI*2*L/30+(Math.random()-.5)*.5,it=100+Math.random()*200;return{dx:Math.cos(F)*it,dy:Math.sin(F)*it-50,color:y[Math.floor(Math.random()*y.length)]}});T(H=>[...H,{id:b,particles:q}]),setTimeout(()=>T(H=>H.filter(L=>L.id!==b)),2200)},[]);return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"ml-rare-notifications",children:v.map(b=>i.jsxs("div",{className:`ml-rare-notif ${b.exiting?"exiting":""}`,children:[i.jsx("div",{className:"ml-rare-notif-title",children:"LEGENDARY RARE!"}),i.jsx("div",{className:"ml-rare-notif-name",children:b.rareName}),i.jsx("div",{className:"ml-rare-notif-by",children:"found by"}),i.jsx("div",{className:"ml-rare-notif-char",children:b.charName})]},b.key))}),i.jsx("div",{className:"ml-fireworks",children:x.map(b=>i.jsx(Pu.Fragment,{children:b.particles.map((y,q)=>i.jsx("div",{className:"ml-firework-particle",style:{left:"50%",top:"30%",backgroundColor:y.color,"--dx":`${y.dx}px`,"--dy":`${y.dy+200}px`}},q))},b.id))})]})},ah=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf","#ff4444","#44ff44","#4444ff","#ffff44","#ff44ff","#44ffff","#ff8844","#88ff44","#4488ff","#ff4488","#cc3333","#33cc33","#3333cc","#cccc33","#cc33cc","#33cccc","#cc6633","#66cc33","#3366cc","#cc3366","#ff6666","#66ff66","#6666ff","#ffff66","#ff66ff","#66ffff","#ffaa66","#aaff66","#66aaff","#ff66aa","#990099","#009900","#000099","#990000","#009999","#999900","#aa5500","#55aa00","#0055aa","#aa0055","#ffaaaa","#aaffaa","#aaaaff","#ffffaa","#ffaaff","#aaffff","#ffccaa","#ccffaa","#aaccff","#ffaacc"];function Cy(s){let v=0;for(let S=0;S{let d=s.current.get(o);return d||(d=v.current{const S=Ny(),[o,d]=R.useState(!1),[x,T]=R.useState(!1),A=R.useMemo(()=>Array.from(s.characters.values()).filter(q=>q.telemetry).map(q=>q.telemetry),[s.characters]),b=R.useMemo(()=>new Map(Array.from(s.characters.values()).filter(q=>q.vitals).map(q=>[q.name,q.vitals])),[s.characters]),y=R.useCallback(q=>{},[]);return i.jsx(V0,{children:i.jsxs("div",{className:"ml-layout",children:[i.jsx(ny,{players:A,vitals:b,serverHealth:s.serverHealth,totalRares:s.totalRares,totalKills:s.totalKills,getColor:S,onSelectPlayer:y,onViewToggle:v,showHeatmap:o,showPortals:x,onToggleHeatmap:d,onTogglePortals:T}),i.jsx(P0,{players:A,getColor:S,onSelectPlayer:y,showHeatmap:o,showPortals:x}),i.jsx(Ty,{characters:s.characters,chatMessages:s.chatMessages,nearbyObjects:s.nearbyObjects,socket:s.socketRef.current}),i.jsx(Oy,{recentRares:s.recentRares})]})})};function Dy(s){const v=R.useRef(null),S=R.useRef(0),o=R.useRef(s);o.current=s;const d=R.useCallback(()=>{var T;if(((T=v.current)==null?void 0:T.readyState)===WebSocket.OPEN)return;const x=new WebSocket(J0());v.current=x,x.addEventListener("message",A=>{try{const b=JSON.parse(A.data);o.current(b)}catch{}}),x.addEventListener("close",()=>{v.current=null,S.current=window.setTimeout(d,2e3)}),x.addEventListener("error",()=>{x.close()})},[]);return R.useEffect(()=>(d(),()=>{var x;clearTimeout(S.current),(x=v.current)==null||x.close(),v.current=null}),[d]),v}const Uy=()=>tl("/live"),By=()=>tl("/combat-stats"),Hy=()=>tl("/server-health"),Yy=()=>tl("/total-rares"),qy=()=>tl("/total-kills");function Xy(){const[s,v]=R.useState(new Map),[S,o]=R.useState(null),[d,x]=R.useState(0),[T,A]=R.useState(0),[b,y]=R.useState([]),[q,H]=R.useState(new Map),[L,F]=R.useState(new Map),it=R.useRef(s);it.current=s;const tt=R.useCallback((O,w)=>{v(V=>{const K=new Map(V),X=K.get(O)??{name:O,telemetry:null,vitals:null,combat:null,lastUpdate:0};return K.set(O,w(X)),K})},[]),bt=R.useCallback(O=>{if(O.type){if(O.type==="telemetry"){const w=O;tt(w.character_name,V=>({...V,telemetry:w,lastUpdate:Date.now()}))}else if(O.type==="vitals"){const w=O;tt(w.character_name,V=>({...V,vitals:w,lastUpdate:Date.now()}))}else if(O.type==="combat_stats"){const w=O;tt(w.character_name,V=>({...V,combat:w,lastUpdate:Date.now()}))}else if(O.type==="rare"){const w=O;y(V=>[w,...V].slice(0,50))}else if(O.type==="nearby_objects"){const w=O;F(V=>{const K=new Map(V);return K.set(w.character_name,w),K})}else if(O.type==="chat"){const w=O;H(V=>{const K=new Map(V),X=[...K.get(w.character_name)??[],{text:w.text,color:w.color,timestamp:w.timestamp}];return X.length>1e3&&X.splice(0,X.length-1e3),K.set(w.character_name,X),K})}}},[tt]),I=Dy(bt);return R.useEffect(()=>{const O=async()=>{try{const V=await Uy();v(K=>{var C;const X=new Map(K);for(const Q of V.players??[]){const et=X.get(Q.character_name);X.set(Q.character_name,{name:Q.character_name,telemetry:Q,vitals:(et==null?void 0:et.vitals)??null,combat:(et==null?void 0:et.combat)??null,lastUpdate:Date.now()})}for(const Q of X.keys())(C=V.players)!=null&&C.some(et=>et.character_name===Q)||X.delete(Q);return X})}catch{}};O();const w=setInterval(O,5e3);return()=>clearInterval(w)},[]),R.useEffect(()=>{const O=async()=>{try{const V=await By();for(const K of V.stats??[])tt(K.character_name,X=>({...X,combat:{...K,type:"combat_stats"}}))}catch{}};O();const w=setInterval(O,3e4);return()=>clearInterval(w)},[tt]),R.useEffect(()=>{const O=async()=>{try{o(await Hy())}catch{}};O();const w=setInterval(O,3e4);return()=>clearInterval(w)},[]),R.useEffect(()=>{const O=async()=>{try{const[V,K]=await Promise.all([Yy(),qy()]);x(V.all_time??0),A(K.total??0)}catch{}};O();const w=setInterval(O,3e5);return()=>clearInterval(w)},[]),{characters:s,serverHealth:S,totalRares:d,totalKills:T,recentRares:b,chatMessages:q,nearbyObjects:L,socketRef:I}}const Ly=R.lazy(()=>w0(()=>import("./DashboardView-BORJmSpV.js"),[]));function Gy(){const[s,v]=R.useState(()=>localStorage.getItem("v2-view")||"map"),S=Xy(),o=()=>{const d=s==="map"?"dashboard":"map";v(d),localStorage.setItem("v2-view",d)};return s==="map"?i.jsx(Ry,{data:S,onViewToggle:o}):i.jsx(R.Suspense,{fallback:i.jsx("div",{style:{background:"#0d0d0d",color:"#888",padding:40,textAlign:"center"},children:"Loading dashboard..."}),children:i.jsx(Ly,{data:S,onViewToggle:o})})}G0.createRoot(document.getElementById("root")).render(i.jsx(R.StrictMode,{children:i.jsx(Gy,{})}));export{Pu as R,tl as a,Qy as c,N0 as g,i as j,R as r}; +`).replace(Pm,"")}function ld(t,l){return l=td(l),td(t)===l}function Mt(t,l,e,a,n,u){switch(e){case"children":typeof a=="string"?l==="body"||l==="textarea"&&a===""||ta(t,a):(typeof a=="number"||typeof a=="bigint")&&l!=="body"&&ta(t,""+a);break;case"className":Ln(t,"class",a);break;case"tabIndex":Ln(t,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":Ln(t,e,a);break;case"style":Ps(t,a,u);break;case"data":if(l!=="object"){Ln(t,"data",a);break}case"src":case"href":if(a===""&&(l!=="a"||e!=="href")){t.removeAttribute(e);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){t.removeAttribute(e);break}a=Qn(""+a),t.setAttribute(e,a);break;case"action":case"formAction":if(typeof a=="function"){t.setAttribute(e,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof u=="function"&&(e==="formAction"?(l!=="input"&&Mt(t,l,"name",n.name,n,null),Mt(t,l,"formEncType",n.formEncType,n,null),Mt(t,l,"formMethod",n.formMethod,n,null),Mt(t,l,"formTarget",n.formTarget,n,null)):(Mt(t,l,"encType",n.encType,n,null),Mt(t,l,"method",n.method,n,null),Mt(t,l,"target",n.target,n,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){t.removeAttribute(e);break}a=Qn(""+a),t.setAttribute(e,a);break;case"onClick":a!=null&&(t.onclick=ql);break;case"onScroll":a!=null&>("scroll",t);break;case"onScrollEnd":a!=null&>("scrollend",t);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(o(61));if(e=a.__html,e!=null){if(n.children!=null)throw Error(o(60));t.innerHTML=e}}break;case"multiple":t.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":t.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){t.removeAttribute("xlink:href");break}e=Qn(""+a),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":a!=null&&typeof a!="function"&&typeof a!="symbol"?t.setAttribute(e,""+a):t.removeAttribute(e);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":a&&typeof a!="function"&&typeof a!="symbol"?t.setAttribute(e,""):t.removeAttribute(e);break;case"capture":case"download":a===!0?t.setAttribute(e,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?t.setAttribute(e,a):t.removeAttribute(e);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?t.setAttribute(e,a):t.removeAttribute(e);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?t.removeAttribute(e):t.setAttribute(e,a);break;case"popover":gt("beforetoggle",t),gt("toggle",t),Xn(t,"popover",a);break;case"xlinkActuate":Yl(t,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":Yl(t,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":Yl(t,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":Yl(t,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":Yl(t,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":Yl(t,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":Yl(t,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":Yl(t,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":Yl(t,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":Xn(t,"is",a);break;case"innerText":case"textContent":break;default:(!(2f)break;var N=r.transferSize,Y=r.initiatorType;N&&ed(Y)&&(r=r.responseEnd,c+=N*(r"u"?null:document;function md(t,l,e){var a=Ma;if(a&&typeof l=="string"&&l){var n=Sl(l);n='link[rel="'+t+'"][href="'+n+'"]',typeof e=="string"&&(n+='[crossorigin="'+e+'"]'),hd.has(n)||(hd.add(n),t={rel:t,crossOrigin:e,href:l},a.querySelector(n)===null&&(l=a.createElement("link"),Ft(l,"link",t),Vt(l),a.head.appendChild(l)))}}function r0(t){te.D(t),md("dns-prefetch",t,null)}function d0(t,l){te.C(t,l),md("preconnect",t,l)}function h0(t,l,e){te.L(t,l,e);var a=Ma;if(a&&t&&l){var n='link[rel="preload"][as="'+Sl(l)+'"]';l==="image"&&e&&e.imageSrcSet?(n+='[imagesrcset="'+Sl(e.imageSrcSet)+'"]',typeof e.imageSizes=="string"&&(n+='[imagesizes="'+Sl(e.imageSizes)+'"]')):n+='[href="'+Sl(t)+'"]';var u=n;switch(l){case"style":u=Oa(t);break;case"script":u=Ca(t)}Ml.has(u)||(t=H({rel:"preload",href:l==="image"&&e&&e.imageSrcSet?void 0:t,as:l},e),Ml.set(u,t),a.querySelector(n)!==null||l==="style"&&a.querySelector(jn(u))||l==="script"&&a.querySelector(zn(u))||(l=a.createElement("link"),Ft(l,"link",t),Vt(l),a.head.appendChild(l)))}}function m0(t,l){te.m(t,l);var e=Ma;if(e&&t){var a=l&&typeof l.as=="string"?l.as:"script",n='link[rel="modulepreload"][as="'+Sl(a)+'"][href="'+Sl(t)+'"]',u=n;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=Ca(t)}if(!Ml.has(u)&&(t=H({rel:"modulepreload",href:t},l),Ml.set(u,t),e.querySelector(n)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(e.querySelector(zn(u)))return}a=e.createElement("link"),Ft(a,"link",t),Vt(a),e.head.appendChild(a)}}}function y0(t,l,e){te.S(t,l,e);var a=Ma;if(a&&t){var n=Fe(a).hoistableStyles,u=Oa(t);l=l||"default";var c=n.get(u);if(!c){var f={loading:0,preload:null};if(c=a.querySelector(jn(u)))f.loading=5;else{t=H({rel:"stylesheet",href:t,"data-precedence":l},e),(e=Ml.get(u))&&rs(t,e);var r=c=a.createElement("link");Vt(r),Ft(r,"link",t),r._p=new Promise(function(j,N){r.onload=j,r.onerror=N}),r.addEventListener("load",function(){f.loading|=1}),r.addEventListener("error",function(){f.loading|=2}),f.loading|=4,Xu(c,l,a)}c={type:"stylesheet",instance:c,count:1,state:f},n.set(u,c)}}}function g0(t,l){te.X(t,l);var e=Ma;if(e&&t){var a=Fe(e).hoistableScripts,n=Ca(t),u=a.get(n);u||(u=e.querySelector(zn(n)),u||(t=H({src:t,async:!0},l),(l=Ml.get(n))&&ds(t,l),u=e.createElement("script"),Vt(u),Ft(u,"link",t),e.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},a.set(n,u))}}function v0(t,l){te.M(t,l);var e=Ma;if(e&&t){var a=Fe(e).hoistableScripts,n=Ca(t),u=a.get(n);u||(u=e.querySelector(zn(n)),u||(t=H({src:t,async:!0,type:"module"},l),(l=Ml.get(n))&&ds(t,l),u=e.createElement("script"),Vt(u),Ft(u,"link",t),e.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},a.set(n,u))}}function yd(t,l,e,a){var n=(n=ht.current)?qu(n):null;if(!n)throw Error(o(446));switch(t){case"meta":case"title":return null;case"style":return typeof e.precedence=="string"&&typeof e.href=="string"?(l=Oa(e.href),e=Fe(n).hoistableStyles,a=e.get(l),a||(a={type:"style",instance:null,count:0,state:null},e.set(l,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(e.rel==="stylesheet"&&typeof e.href=="string"&&typeof e.precedence=="string"){t=Oa(e.href);var u=Fe(n).hoistableStyles,c=u.get(t);if(c||(n=n.ownerDocument||n,c={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(t,c),(u=n.querySelector(jn(t)))&&!u._p&&(c.instance=u,c.state.loading=5),Ml.has(t)||(e={rel:"preload",as:"style",href:e.href,crossOrigin:e.crossOrigin,integrity:e.integrity,media:e.media,hrefLang:e.hrefLang,referrerPolicy:e.referrerPolicy},Ml.set(t,e),u||p0(n,t,e,c.state))),l&&a===null)throw Error(o(528,""));return c}if(l&&a!==null)throw Error(o(529,""));return null;case"script":return l=e.async,e=e.src,typeof e=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(l=Ca(e),e=Fe(n).hoistableScripts,a=e.get(l),a||(a={type:"script",instance:null,count:0,state:null},e.set(l,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,t))}}function Oa(t){return'href="'+Sl(t)+'"'}function jn(t){return'link[rel="stylesheet"]['+t+"]"}function gd(t){return H({},t,{"data-precedence":t.precedence,precedence:null})}function p0(t,l,e,a){t.querySelector('link[rel="preload"][as="style"]['+l+"]")?a.loading=1:(l=t.createElement("link"),a.preload=l,l.addEventListener("load",function(){return a.loading|=1}),l.addEventListener("error",function(){return a.loading|=2}),Ft(l,"link",e),Vt(l),t.head.appendChild(l))}function Ca(t){return'[src="'+Sl(t)+'"]'}function zn(t){return"script[async]"+t}function vd(t,l,e){if(l.count++,l.instance===null)switch(l.type){case"style":var a=t.querySelector('style[data-href~="'+Sl(e.href)+'"]');if(a)return l.instance=a,Vt(a),a;var n=H({},e,{"data-href":e.href,"data-precedence":e.precedence,href:null,precedence:null});return a=(t.ownerDocument||t).createElement("style"),Vt(a),Ft(a,"style",n),Xu(a,e.precedence,t),l.instance=a;case"stylesheet":n=Oa(e.href);var u=t.querySelector(jn(n));if(u)return l.state.loading|=4,l.instance=u,Vt(u),u;a=gd(e),(n=Ml.get(n))&&rs(a,n),u=(t.ownerDocument||t).createElement("link"),Vt(u);var c=u;return c._p=new Promise(function(f,r){c.onload=f,c.onerror=r}),Ft(u,"link",a),l.state.loading|=4,Xu(u,e.precedence,t),l.instance=u;case"script":return u=Ca(e.src),(n=t.querySelector(zn(u)))?(l.instance=n,Vt(n),n):(a=e,(n=Ml.get(u))&&(a=H({},e),ds(a,n)),t=t.ownerDocument||t,n=t.createElement("script"),Vt(n),Ft(n,"link",a),t.head.appendChild(n),l.instance=n);case"void":return null;default:throw Error(o(443,l.type))}else l.type==="stylesheet"&&(l.state.loading&4)===0&&(a=l.instance,l.state.loading|=4,Xu(a,e.precedence,t));return l.instance}function Xu(t,l,e){for(var a=e.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),n=a.length?a[a.length-1]:null,u=n,c=0;c title"):null)}function x0(t,l,e){if(e===1||l.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof l.precedence!="string"||typeof l.href!="string"||l.href==="")break;return!0;case"link":if(typeof l.rel!="string"||typeof l.href!="string"||l.href===""||l.onLoad||l.onError)break;switch(l.rel){case"stylesheet":return t=l.disabled,typeof l.precedence=="string"&&t==null;default:return!0}case"script":if(l.async&&typeof l.async!="function"&&typeof l.async!="symbol"&&!l.onLoad&&!l.onError&&l.src&&typeof l.src=="string")return!0}return!1}function Sd(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function S0(t,l,e,a){if(e.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(e.state.loading&4)===0){if(e.instance===null){var n=Oa(a.href),u=l.querySelector(jn(n));if(u){l=u._p,l!==null&&typeof l=="object"&&typeof l.then=="function"&&(t.count++,t=Gu.bind(t),l.then(t,t)),e.state.loading|=4,e.instance=u,Vt(u);return}u=l.ownerDocument||l,a=gd(a),(n=Ml.get(n))&&rs(a,n),u=u.createElement("link"),Vt(u);var c=u;c._p=new Promise(function(f,r){c.onload=f,c.onerror=r}),Ft(u,"link",a),e.instance=u}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(e,l),(l=e.state.preload)&&(e.state.loading&3)===0&&(t.count++,e=Gu.bind(t),l.addEventListener("load",e),l.addEventListener("error",e))}}var hs=0;function b0(t,l){return t.stylesheets&&t.count===0&&Zu(t,t.stylesheets),0hs?50:800)+l);return t.unsuspend=e,function(){t.unsuspend=null,clearTimeout(a),clearTimeout(n)}}:null}function Gu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Zu(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Qu=null;function Zu(t,l){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Qu=new Map,l.forEach(_0,t),Qu=null,Gu.call(t))}function _0(t,l){if(!(l.state.loading&4)){var e=Qu.get(t);if(e)var a=e.get(null);else{e=new Map,Qu.set(t,e);for(var n=t.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(v){console.error(v)}}return s(),_s.exports=X0(),_s.exports}var G0=L0();const Q0="modulepreload",Z0=function(s){return"/v2/"+s},wd={},w0=function(v,S,o){let d=Promise.resolve();if(S&&S.length>0){let T=function(y){return Promise.all(y.map(q=>Promise.resolve(q).then(H=>({status:"fulfilled",value:H}),H=>({status:"rejected",reason:H}))))};document.getElementsByTagName("link");const A=document.querySelector("meta[property=csp-nonce]"),b=(A==null?void 0:A.nonce)||(A==null?void 0:A.getAttribute("nonce"));d=T(S.map(y=>{if(y=Z0(y),y in wd)return;wd[y]=!0;const q=y.endsWith(".css"),H=q?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${y}"]${H}`))return;const L=document.createElement("link");if(L.rel=q?"stylesheet":Q0,q||(L.as="script"),L.crossOrigin="",L.href=y,b&&L.setAttribute("nonce",b),document.head.appendChild(L),q)return new Promise((F,it)=>{L.addEventListener("load",F),L.addEventListener("error",()=>it(new Error(`Unable to preload CSS for ${y}`)))})}))}function x(T){const A=new Event("vite:preloadError",{cancelable:!0});if(A.payload=T,window.dispatchEvent(A),!A.defaultPrevented)throw T}return d.then(T=>{for(const A of T||[])A.status==="rejected"&&x(A.reason);return v().catch(x)})},nh=R.createContext({windows:[],openWindow:()=>{},closeWindow:()=>{},bringToFront:()=>{}}),V0=({children:s})=>{const[v,S]=R.useState([]),o=R.useRef(1e4),d=R.useCallback((A,b,y)=>{S(q=>q.find(L=>L.id===A)?q.map(L=>L.id===A?{...L,zIndex:++o.current}:L):[...q,{id:A,title:b,charName:y,zIndex:++o.current}])},[]),x=R.useCallback(A=>{S(b=>b.filter(y=>y.id!==A))},[]),T=R.useCallback(A=>{S(b=>b.map(y=>y.id===A?{...y,zIndex:++o.current}:y))},[]);return i.jsx(nh.Provider,{value:{windows:v,openWindow:d,closeWindow:x,bringToFront:T},children:s})},ti=()=>R.useContext(nh),Ol={west:-102.1,east:102.1,north:102.1,south:-102.1};function li(s,v,S,o){const d=(s-Ol.west)/(Ol.east-Ol.west)*S,x=(Ol.north-v)/(Ol.north-Ol.south)*o;return{x:d,y:x}}function K0(s,v,S,o,d,x,T){const A=(s-o)/S,b=(v-d)/S,y=Ol.west+A/x*(Ol.east-Ol.west),q=Ol.north-b/T*(Ol.north-Ol.south);return{ew:y,ns:q}}function Os(s,v){const S=s>=0?"N":"S",o=v>=0?"E":"W";return`${Math.abs(s).toFixed(1)}${S}, ${Math.abs(v).toFixed(1)}${o}`}const uh=Pu.memo(({players:s,imgW:v,imgH:S,getColor:o,onHover:d,onSelect:x})=>{const T=R.useMemo(()=>s.filter(A=>A.ew!==void 0&&A.ns!==void 0).map(A=>({...A,pos:li(A.ew,A.ns,v,S),color:o(A.character_name)})),[s,v,S,o]);return i.jsx("div",{className:"ml-dots-layer",children:T.map(A=>i.jsx("div",{className:"ml-dot",style:{left:A.pos.x,top:A.pos.y,backgroundColor:A.color},onMouseEnter:b=>{var q;const y=(q=b.currentTarget.closest(".ml-map-container"))==null?void 0:q.getBoundingClientRect();y&&d(A,b.clientX-y.left,b.clientY-y.top)},onMouseLeave:()=>d(null,0,0),onClick:()=>x(A.character_name)},A.character_name))})});uh.displayName="PlayerDots";const k0="/api";async function tl(s){const v=await fetch(`${k0}${s}`,{credentials:"include"});if(!v.ok)throw new Error(`API ${s}: ${v.status}`);return v.json()}function J0(){return`${location.protocol==="https:"?"wss:":"ws:"}//${location.host}/api/ws/live`}const ih=Pu.memo(({imgW:s,imgH:v,getColor:S})=>{const[o,d]=R.useState([]);R.useEffect(()=>{const T=async()=>{try{const b=await tl("/trails/?seconds=600");d(b.trails??[])}catch{}};T();const A=setInterval(T,2e3);return()=>clearInterval(A)},[]);const x=R.useMemo(()=>{const T={};for(const A of o){const{x:b,y}=li(A.ew,A.ns,s,v);T[A.character_name]||(T[A.character_name]=[]),T[A.character_name].push(`${b},${y}`)}return Object.entries(T).filter(([,A])=>A.length>=2).map(([A,b])=>({name:A,points:b.join(" ")}))},[o,s,v]);return i.jsx("svg",{className:"ml-trails-svg",viewBox:`0 0 ${s} ${v}`,preserveAspectRatio:"none",children:x.map(T=>i.jsx("polyline",{points:T.points,stroke:S(T.name),fill:"none",strokeWidth:2,strokeOpacity:.7,strokeLinecap:"round",strokeLinejoin:"round"},T.name))})});ih.displayName="TrailsSVG";const $0=({imgW:s,imgH:v,enabled:S})=>{const o=R.useRef(null),[d,x]=R.useState([]);return R.useEffect(()=>{if(!S)return;(async()=>{try{const A=await tl("/spawns/heatmap?hours=24&limit=50000");x(A.spawn_points??[])}catch{}})()},[S]),R.useEffect(()=>{const T=o.current;if(!T||!S||d.length===0||s===0)return;T.width=s,T.height=v;const A=T.getContext("2d");if(A){A.clearRect(0,0,s,v);for(const b of d){const{x:y,y:q}=li(b.ew,b.ns,s,v),H=Math.max(5,Math.min(12,5+Math.sqrt(b.intensity*.5))),L=A.createRadialGradient(y,q,0,y,q,H);L.addColorStop(0,`rgba(255, 0, 0, ${Math.min(.9,b.intensity/40)})`),L.addColorStop(.6,`rgba(255, 100, 0, ${Math.min(.4,b.intensity/120)})`),L.addColorStop(1,"rgba(255, 150, 0, 0)"),A.fillStyle=L,A.fillRect(y-H,q-H,H*2,H*2)}}},[d,s,v,S]),S?i.jsx("canvas",{ref:o,className:"ml-heatmap-canvas"}):null},W0=({imgW:s,imgH:v,enabled:S})=>{const[o,d]=R.useState([]);R.useEffect(()=>{if(!S)return;const T=async()=>{try{const b=await tl("/portals");d(b.portals??[])}catch{}};T();const A=setInterval(T,6e4);return()=>clearInterval(A)},[S]);const x=R.useMemo(()=>o.map(T=>({...T,pos:li(T.coordinates.ew,T.coordinates.ns,s,v)})),[o,s,v]);return!S||x.length===0?null:i.jsx("div",{className:"ml-portals-layer",children:x.map((T,A)=>i.jsx("div",{className:"ml-portal-icon",style:{left:T.pos.x,top:T.pos.y},title:`${T.portal_name} (by ${T.discovered_by})`},A))})},F0=20,I0=.3,P0=({players:s,getColor:v,onSelectPlayer:S,showHeatmap:o,showPortals:d})=>{var V;const x=R.useRef(null),T=R.useRef(null),[A,b]=R.useState({w:0,h:0}),[y,q]=R.useState(null),[H,L]=R.useState(null),F=R.useRef({scale:1,offX:0,offY:0}),it=R.useRef({dragging:!1,sx:0,sy:0,startOffX:0,startOffY:0}),tt=R.useCallback(()=>{if(T.current){const{scale:K,offX:X,offY:C}=F.current;T.current.style.transform=`translate(${X}px, ${C}px) scale(${K})`}},[]),bt=R.useCallback(K=>{const X=K.currentTarget;if(b({w:X.naturalWidth,h:X.naturalHeight}),x.current){const C=x.current.clientWidth,Q=x.current.clientHeight,et=Math.min(C/X.naturalWidth,Q/X.naturalHeight);F.current={scale:et,offX:(C-X.naturalWidth*et)/2,offY:(Q-X.naturalHeight*et)/2},tt()}},[tt]),I=R.useCallback(K=>{var mt;K.preventDefault();const X=(mt=x.current)==null?void 0:mt.getBoundingClientRect();if(!X)return;const C=F.current,Q=K.deltaY<0?1.1:.9,et=Math.min(F0,Math.max(I0,C.scale*Q)),J=et/C.scale,st=K.clientX-X.left,dt=K.clientY-X.top;F.current={scale:et,offX:st-(st-C.offX)*J,offY:dt-(dt-C.offY)*J},tt()},[tt]),O=R.useCallback(K=>{if(K.button!==0)return;const X=F.current;it.current={dragging:!0,sx:K.clientX,sy:K.clientY,startOffX:X.offX,startOffY:X.offY}},[]);R.useEffect(()=>{const K=C=>{const Q=it.current;if(Q.dragging&&(F.current.offX=Q.startOffX+(C.clientX-Q.sx),F.current.offY=Q.startOffY+(C.clientY-Q.sy),tt()),x.current&&A.w>0){const et=x.current.getBoundingClientRect(),J=F.current,st=K0(C.clientX-et.left,C.clientY-et.top,J.scale,J.offX,J.offY,A.w,A.h);L(st)}},X=()=>{it.current.dragging=!1};return window.addEventListener("mousemove",K),window.addEventListener("mouseup",X),()=>{window.removeEventListener("mousemove",K),window.removeEventListener("mouseup",X)}},[tt,A.w,A.h]);const w=R.useCallback((K,X,C)=>{q(K?{x:X,y:C,player:K}:null)},[]);return i.jsxs("div",{className:"ml-map-container",ref:x,onWheel:I,onMouseDown:O,children:[i.jsxs("div",{ref:T,className:"ml-map-group",children:[i.jsx("img",{src:"/dereth.png",alt:"Dereth",className:"ml-map-img",onLoad:bt,draggable:!1}),A.w>0&&i.jsxs(i.Fragment,{children:[i.jsx($0,{imgW:A.w,imgH:A.h,enabled:o}),i.jsx(ih,{imgW:A.w,imgH:A.h,getColor:v}),i.jsx(uh,{players:s,imgW:A.w,imgH:A.h,getColor:v,onHover:w,onSelect:S}),i.jsx(W0,{imgW:A.w,imgH:A.h,enabled:d})]})]}),y&&i.jsxs("div",{className:"ml-tooltip",style:{left:y.x+12,top:y.y-10},children:[i.jsx("strong",{children:y.player.character_name}),i.jsx("br",{}),Os(y.player.ns,y.player.ew),i.jsx("br",{}),y.player.kills_per_hour," kph · ",(V=y.player.kills)==null?void 0:V.toLocaleString()," kills"]}),H&&i.jsx("div",{className:"ml-coords",children:Os(H.ns,H.ew)})]})},ch=Pu.memo(({player:s,vitals:v,color:S,onSelect:o})=>{var y,q;const{openWindow:d}=ti(),x=(s.vt_state||"idle").toLowerCase(),T=x==="combat"||x==="hunt",A=(s.total_rares??0)>0?Math.round((s.total_kills??0)/(s.total_rares??1)).toLocaleString():null,b=s.character_name;return i.jsxs("li",{className:"ml-player-row",style:{borderLeftColor:S},children:[i.jsxs("div",{className:"ml-pr-header",onClick:o,children:[i.jsx("span",{className:"ml-pr-name",children:b}),i.jsx("span",{className:"ml-pr-coords",children:Os(s.ns,s.ew)})]}),i.jsxs("div",{className:"ml-pr-vitals",children:[i.jsx("div",{className:"ml-vital-bar hp",children:i.jsx("div",{className:"ml-vital-fill",style:{width:`${(v==null?void 0:v.health_percentage)??0}%`}})}),i.jsx("div",{className:"ml-vital-bar sta",children:i.jsx("div",{className:"ml-vital-fill",style:{width:`${(v==null?void 0:v.stamina_percentage)??0}%`}})}),i.jsx("div",{className:"ml-vital-bar mana",children:i.jsx("div",{className:"ml-vital-fill",style:{width:`${(v==null?void 0:v.mana_percentage)??0}%`}})})]}),i.jsxs("div",{className:"ml-pr-grid",children:[i.jsxs("span",{className:"ml-gs",title:"Session kills",children:["⚔️ ",((y=s.kills)==null?void 0:y.toLocaleString())??0]}),i.jsxs("span",{className:"ml-gs",title:"Total kills",children:["🏆 ",(s.total_kills??0).toLocaleString()]}),i.jsxs("span",{className:"ml-gs",title:"Kills per hour",children:[s.kills_per_hour??"0"," ",i.jsx("span",{className:"ml-suffix",children:"KPH"})]}),i.jsxs("span",{className:"ml-gs",title:"Rares (session / total)",children:["💎 ",s.session_rares??0," / ",s.total_rares??0]}),i.jsx("span",{className:"ml-gs",title:"Kills per rare",children:A?i.jsxs(i.Fragment,{children:["📊 ",A," ",i.jsx("span",{className:"ml-suffix",children:"KPR"})]}):""}),i.jsx("span",{className:`ml-meta-pill ${T?"active":""}`,children:s.vt_state||"idle"}),i.jsxs("span",{className:"ml-gs",title:"Online time",children:["🕐 ",((q=s.onlinetime)==null?void 0:q.replace(/^00\./,""))??"--"]}),i.jsxs("span",{className:"ml-gs",title:"Deaths",children:["☠️ ",s.deaths??"0"]}),i.jsxs("span",{className:"ml-gs",title:"Prismatic tapers",children:[i.jsx("img",{src:"/prismatic-taper-icon.png",className:"ml-taper-icon",alt:""}),s.prismatic_taper_count??"0"]})]}),i.jsxs("div",{className:"ml-pr-buttons",children:[i.jsx("button",{className:"ml-btn accent",onClick:()=>d(`chat-${b}`,`Chat: ${b}`,b),children:"Chat"}),i.jsx("button",{className:"ml-btn accent",onClick:()=>d(`stats-${b}`,`Stats: ${b}`,b),children:"Stats"}),i.jsx("button",{className:"ml-btn accent",onClick:()=>d(`inv-${b}`,`Inventory: ${b}`,b),children:"Inv"}),i.jsx("button",{className:"ml-btn",onClick:()=>d(`char-${b}`,`Character: ${b}`,b),children:"Char"}),i.jsx("button",{className:"ml-btn",onClick:()=>d(`combat-${b}`,`Combat: ${b}`,b),children:"Combat"}),i.jsx("button",{className:"ml-btn",onClick:()=>d(`radar-${b}`,`Radar: ${b}`,b),children:"Radar"})]})]})});ch.displayName="PlayerRow";const ty=({players:s,vitals:v,getColor:S,onSelect:o})=>i.jsx("ul",{className:"ml-player-list",children:s.map(d=>i.jsx(ch,{player:d,vitals:v.get(d.character_name)??null,color:S(d.character_name),onSelect:()=>o(d.character_name)},d.character_name))}),ly=[{key:"name",label:"Name"},{key:"kph",label:"KPH"},{key:"skills",label:"S.Kills"},{key:"srares",label:"S.Rares"},{key:"tkills",label:"T.Kills"},{key:"kpr",label:"KPR"}],ey=({value:s,onChange:v})=>i.jsx("div",{className:"ml-sort-buttons",children:ly.map(S=>i.jsx("button",{className:`ml-sort-btn ${s===S.key?"active":""}`,onClick:()=>v(S.key),children:S.label},S.key))}),ay=()=>{const{openWindow:s}=ti();return i.jsxs("div",{className:"ml-tool-links",children:[i.jsx("span",{className:"ml-tool-link",style:{cursor:"pointer"},onClick:()=>s("issues","Issues Board"),children:"📋 Issues"}),i.jsx("span",{className:"ml-tool-link",style:{cursor:"pointer"},onClick:()=>s("vitalsharing","Vital Sharing"),children:"🤝 Vitals"})]})},ny=({players:s,vitals:v,serverHealth:S,totalRares:o,totalKills:d,getColor:x,onSelectPlayer:T,onViewToggle:A,showHeatmap:b,showPortals:y,onToggleHeatmap:q,onTogglePortals:H})=>{var V,K;const[L,F]=R.useState("name"),[it,tt]=R.useState(""),bt=R.useMemo(()=>s.reduce((X,C)=>X+(parseInt(C.kills_per_hour)||0),0),[s]),I=((V=S==null?void 0:S.status)==null?void 0:V.toLowerCase())==="online"||((K=S==null?void 0:S.status)==null?void 0:K.toLowerCase())==="up",O=R.useDeferredValue(s),w=R.useMemo(()=>{let X=[...O];switch(it&&(X=X.filter(C=>C.character_name.toLowerCase().startsWith(it.toLowerCase()))),L){case"kph":X.sort((C,Q)=>(parseInt(Q.kills_per_hour)||0)-(parseInt(C.kills_per_hour)||0));break;case"skills":X.sort((C,Q)=>(Q.kills||0)-(C.kills||0));break;case"srares":X.sort((C,Q)=>(Q.session_rares??0)-(C.session_rares??0));break;case"tkills":X.sort((C,Q)=>(Q.total_kills??0)-(C.total_kills??0));break;case"kpr":X.sort((C,Q)=>{const et=(C.total_kills??0)/Math.max(1,C.total_rares??1),J=(Q.total_kills??0)/Math.max(1,Q.total_rares??1);return et-J});break;default:X.sort((C,Q)=>C.character_name.localeCompare(Q.character_name))}return X},[O,L,it]);return i.jsxs("div",{className:"ml-sidebar",children:[i.jsxs("div",{className:"ml-sidebar-header",children:[i.jsxs("span",{className:"ml-sidebar-title",children:["Active Mosswart Enjoyers (",s.length,")"]}),i.jsx("button",{className:"ml-view-toggle",onClick:A,children:"Dashboard"})]}),i.jsxs("div",{className:"ml-server-status",children:[i.jsx("span",{className:`ml-status-dot ${I?"online":"offline"}`}),i.jsxs("span",{className:"ml-status-text",children:["Coldeve ",I?"Online":"Offline"]}),(S==null?void 0:S.player_count)!=null&&i.jsxs("span",{className:"ml-status-detail",children:["👥 ",S.player_count]}),(S==null?void 0:S.latency_ms)!=null&&i.jsxs("span",{className:"ml-status-detail",children:[Math.round(S.latency_ms),"ms"]}),(S==null?void 0:S.uptime_seconds)!=null&&i.jsxs("span",{className:"ml-status-detail",children:["Up: ",Math.floor(S.uptime_seconds/3600),"h"]})]}),i.jsxs("div",{className:"ml-counters",children:[i.jsxs("div",{className:"ml-counter rares",children:[i.jsx("span",{className:"ml-counter-val",children:o}),i.jsx("span",{className:"ml-counter-lbl",children:"Rares"})]}),i.jsxs("div",{className:`ml-counter kph ${bt>5e3?"ultra":""}`,children:[i.jsx("span",{className:"ml-counter-val",children:bt.toLocaleString()}),i.jsx("span",{className:"ml-counter-lbl",children:"Server KPH"})]}),i.jsxs("div",{className:"ml-counter kills",children:[i.jsx("span",{className:"ml-counter-val",children:d.toLocaleString()}),i.jsx("span",{className:"ml-counter-lbl",children:"Kills"})]})]}),i.jsxs("div",{className:"ml-tool-links",children:[i.jsx("a",{href:"/inventory.html",className:"ml-tool-link",children:"🔍 Inv Search"}),i.jsx("a",{href:"/suitbuilder.html",className:"ml-tool-link",children:"🛡️ Suitbuilder"}),i.jsx("a",{href:"/debug.html",className:"ml-tool-link",children:"🐛 Debug"}),i.jsx("a",{href:"/quest-status.html",target:"_blank",className:"ml-tool-link",children:"📜 Quests"})]}),i.jsx(ay,{}),i.jsxs("div",{className:"ml-toggles",children:[i.jsxs("label",{className:"ml-toggle-label",children:[i.jsx("input",{type:"checkbox",checked:b,onChange:X=>q(X.target.checked)}),i.jsx("span",{children:"Spawn Heatmap"})]}),i.jsxs("label",{className:"ml-toggle-label",children:[i.jsx("input",{type:"checkbox",checked:y,onChange:X=>H(X.target.checked)}),i.jsx("span",{children:"Portals"})]})]}),i.jsx(ey,{value:L,onChange:F}),i.jsx("input",{className:"ml-filter",type:"text",placeholder:"Filter players...",value:it,onChange:X=>tt(X.target.value)}),i.jsx(ty,{players:w,vitals:v,getColor:x,onSelect:T})]})},le=({id:s,title:v,zIndex:S,width:o=700,height:d=340,children:x})=>{const{closeWindow:T,bringToFront:A}=ti(),b=R.useRef(null),y=R.useRef({dragging:!1,sx:0,sy:0,ox:0,oy:0}),q=R.useRef({x:420,y:10+Math.random()*40}),H=R.useCallback(L=>{var it;L.preventDefault(),A(s);const F=(it=b.current)==null?void 0:it.getBoundingClientRect();F&&(y.current={dragging:!0,sx:L.clientX,sy:L.clientY,ox:F.left,oy:F.top})},[s,A]);return R.useEffect(()=>{const L=it=>{const tt=y.current;!tt.dragging||!b.current||(q.current.x=tt.ox+(it.clientX-tt.sx),q.current.y=tt.oy+(it.clientY-tt.sy),b.current.style.left=`${q.current.x}px`,b.current.style.top=`${q.current.y}px`)},F=()=>{y.current.dragging=!1};return window.addEventListener("mousemove",L),window.addEventListener("mouseup",F),()=>{window.removeEventListener("mousemove",L),window.removeEventListener("mouseup",F)}},[]),i.jsxs("div",{ref:b,className:"ml-window",style:{zIndex:S,width:o,height:d,left:q.current.x,top:q.current.y},onMouseDown:()=>A(s),children:[i.jsxs("div",{className:"ml-window-header",onMouseDown:H,children:[i.jsx("span",{className:"ml-window-title",children:v}),i.jsx("button",{className:"ml-window-close",onClick:()=>T(s),children:"×"})]}),i.jsx("div",{className:"ml-window-content",children:x})]})},uy={0:"#00FF00",2:"#FFFFFF",3:"#FF0000",4:"#FFFFFF",5:"#33CCFF",6:"#CCFF99",7:"#00FFFF",14:"#FFD700",15:"#FF69B4",17:"#AAAAFF",18:"#88FF88",21:"#FF8888",22:"#FFAA66"},iy=({id:s,charName:v,zIndex:S,messages:o,socket:d})=>{const x=R.useRef(null),[T,A]=R.useState("");R.useEffect(()=>{x.current&&(x.current.scrollTop=x.current.scrollHeight)},[o.length]);const b=y=>{y.preventDefault();const q=T.trim();!q||!d||d.readyState!==WebSocket.OPEN||(d.send(JSON.stringify({player_name:v,command:q})),A(""))};return i.jsxs(le,{id:s,title:`Chat: ${v}`,zIndex:S,width:600,height:300,children:[i.jsx("div",{className:"ml-chat-messages",ref:x,children:o.map((y,q)=>i.jsx("div",{className:"ml-chat-line",style:{color:uy[y.color??2]??"#ddd"},children:y.text},q))}),i.jsx("form",{className:"ml-chat-form",onSubmit:b,children:i.jsx("input",{className:"ml-chat-input",value:T,onChange:y=>A(y.target.value),placeholder:"Enter chat..."})})]})},cy=[{title:"Kills per Hour",id:1},{title:"Memory (MB)",id:2},{title:"CPU (%)",id:3},{title:"Mem Handles",id:4}],sy=[{label:"1H",value:"now-1h"},{label:"6H",value:"now-6h"},{label:"24H",value:"now-24h"},{label:"7D",value:"now-7d"}],fy=({id:s,charName:v,zIndex:S})=>{const[o,d]=R.useState("now-24h"),x=T=>`/grafana/d-solo/dereth-tracker/dereth-tracker-dashboard?panelId=${T}&var-character=${encodeURIComponent(v)}&from=${o}&to=now&theme=light`;return i.jsxs(le,{id:s,title:`Stats: ${v}`,zIndex:S,width:750,height:480,children:[i.jsx("div",{className:"ml-stats-controls",children:sy.map(T=>i.jsx("button",{className:`ml-stats-range-btn ${o===T.value?"active":""}`,onClick:()=>d(T.value),children:T.label},T.value))}),i.jsx("div",{className:"ml-stats-grid",children:cy.map(T=>i.jsx("div",{className:"ml-stats-panel",children:i.jsx("iframe",{src:x(T.id),width:"100%",height:"100%",frameBorder:"0",title:T.title})},T.id))})]})},Vd={218:"Reinforcement of the Lugians",219:"Bleeargh's Fortitude",220:"Oswald's Enhancement",221:"Siraluun's Blessing",222:"Enduring Calm",223:"Steadfast Will",224:"Ciandra's Essence",225:"Yoshi's Essence",226:"Jibril's Essence",227:"Celdiseth's Essence",228:"Koga's Essence",229:"Shadow of the Seventh Mule",230:"Might of the Seventh Mule",231:"Clutch of the Miser",232:"Enduring Enchantment",233:"Critical Protection",234:"Quick Learner",235:"Ciandra's Fortune",236:"Charmed Smith",237:"Innate Renewal",238:"Archmage's Endurance",239:"Enhancement of the Blade Turner",240:"Enhancement of the Arrow Turner",241:"Enhancement of the Mace Turner",242:"Caustic Enhancement",243:"Fierce Impaler",244:"Iron Skin of the Invincible",245:"Eye of the Remorseless",246:"Hand of the Remorseless",294:"Master of the Steel Circle",295:"Master of the Focused Eye",296:"Master of the Five Fold Path",297:"Frenzy of the Slayer",298:"Iron Skin of the Invincible",299:"Jack of All Trades",300:"Infused Void Magic",301:"Infused War Magic",302:"Infused Life Magic",309:"Infused Item Magic",310:"Infused Creature Magic",326:"Clutch of the Miser",328:"Enduring Enchantment"},Kd={333:"Valor / Destruction",334:"Protection",335:"Glory / Retribution",336:"Temperance / Hardening",338:"Aetheric Vision",339:"Mana Flow",340:"Mana Infusion",342:"Purity",343:"Craftsman",344:"Specialization",365:"World"},kd={370:"Damage",371:"Damage Resistance",372:"Critical",373:"Critical Resistance",374:"Critical Damage",375:"Critical Damage Resistance",376:"Healing Boost",379:"Vitality"},Jd={287:"Celestial Hand",288:"Eldrytch Web",289:"Radiant Blood"},$d={354:"Melee",355:"Ranged",362:"Summoning"},oy={1:"Unarmed",2:"Swords",3:"Axes",4:"Maces",5:"Spears",6:"Daggers",7:"Staves",8:"Bows",9:"Crossbows",10:"Thrown",11:"Two-Handed",12:"Void",13:"War",14:"Life"},Wd={181:"Chess Rank",192:"Fishing Skill",199:"Total Augmentations",322:"Aetheria Slots",390:"Enlightenment"};function ry(s){return s>=1001?"Master":s>=301?"Lord":s>=151?"Knight":s>=31?"Adept":"Initiate"}const pl="#af7a30",Fu="#000022",dy=({id:s,charName:v,zIndex:S,vitals:o})=>{var W,z;const[d,x]=R.useState(null),[T,A]=R.useState(0),[b,y]=R.useState(0);R.useEffect(()=>{tl(`/character-stats/${encodeURIComponent(v)}`).then(x).catch(()=>{})},[v]);const q=m=>m!=null?Number(m).toLocaleString():"—",H=(d==null?void 0:d.stats_data)||d||{},L=H.attributes||{},F=H.skills||{},it=H.vitals||{},tt=H.titles||[],bt=H.properties||{},I=Object.entries(F).filter(([,m])=>(m==null?void 0:m.training)==="Specialized").sort(([m],[U])=>m.localeCompare(U)),O=Object.entries(F).filter(([,m])=>(m==null?void 0:m.training)==="Trained").sort(([m],[U])=>m.localeCompare(U)),w=Object.entries(bt).filter(([m,U])=>Vd[parseInt(m)]&&Number(U)>0).map(([m,U])=>({name:Vd[parseInt(m)],uses:Number(U)})),V=Object.entries(bt).filter(([m,U])=>Kd[parseInt(m)]&&Number(U)>0).map(([m,U])=>({name:Kd[parseInt(m)],uses:Number(U)})),K=Object.entries(bt).filter(([m,U])=>kd[parseInt(m)]&&Number(U)>0).map(([m,U])=>({name:kd[parseInt(m)],value:Number(U)})),X=[];d!=null&&d.birth&&X.push({name:"Birth",value:d.birth}),(d==null?void 0:d.deaths)!=null&&X.push({name:"Deaths",value:q(d.deaths)}),Object.entries(bt).forEach(([m,U])=>{const Z=parseInt(m);Wd[Z]&&X.push({name:Wd[Z],value:U})});const C=[];Object.entries(bt).forEach(([m,U])=>{const Z=parseInt(m);$d[Z]&&C.push({name:$d[Z],value:oy[Number(U)]||`Unknown (${U})`})});const Q=[];Object.entries(bt).forEach(([m,U])=>{const Z=parseInt(m);Jd[Z]&&Number(U)>0&&Q.push({name:Jd[Z],rank:ry(Number(U)),value:Number(U)})});const et=m=>({padding:"5px 8px",fontSize:12,fontWeight:"bold",color:"#fff",cursor:"pointer",userSelect:"none",borderTop:`2px solid ${m?pl:Fu}`,borderLeft:`2px solid ${m?pl:Fu}`,borderRight:`2px solid ${m?pl:Fu}`,background:m?"rgba(0,100,0,0.4)":"transparent"}),J={background:"#000",border:`2px solid ${pl}`,maxHeight:400,overflowY:"auto",overflowX:"hidden"},st={background:"#222",fontWeight:"bold",fontSize:12,padding:"2px 6px"},dt={padding:"2px 6px",background:"rgba(0,100,0,0.4)",whiteSpace:"nowrap"},mt={padding:"2px 6px",background:"rgba(0,0,100,0.4)",textAlign:"right",whiteSpace:"nowrap"},G={padding:"2px 6px",color:"#ccc"};return i.jsx(le,{id:s,title:`Character: ${v}`,zIndex:S,width:740,height:600,children:i.jsxs("div",{style:{background:Fu,color:"#fff",font:'14px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif',overflowY:"auto",padding:"10px 15px 15px",flex:1},children:[i.jsxs("div",{style:{marginBottom:10},children:[i.jsxs("h1",{style:{margin:"0 0 2px",fontSize:28,fontWeight:"bold"},children:[v,i.jsx("span",{style:{fontSize:"200%",color:"#fff27f",float:"right"},children:(d==null?void 0:d.level)||""})]}),i.jsx("div",{style:{fontSize:"85%",color:"gold"},children:[d==null?void 0:d.gender,d==null?void 0:d.race].filter(Boolean).join(" ")||"Awaiting character data..."})]}),i.jsxs("div",{style:{fontSize:"85%",margin:"6px 0 10px",display:"grid",gridTemplateColumns:"1fr 1fr",gap:"0 20px"},children:[i.jsxs("div",{children:["Total XP: ",q(d==null?void 0:d.total_xp)]}),i.jsxs("div",{style:{textAlign:"right"},children:["Unassigned XP: ",q(d==null?void 0:d.unassigned_xp)]}),i.jsxs("div",{children:["Luminance: ",(d==null?void 0:d.luminance_earned)!=null?`${q(d.luminance_earned)} / ${q(d.luminance_total)}`:"—"]}),i.jsxs("div",{style:{textAlign:"right"},children:["Deaths: ",q(d==null?void 0:d.deaths)]})]}),i.jsxs("div",{style:{display:"flex",gap:13,flexWrap:"wrap"},children:[i.jsxs("div",{style:{width:320},children:[i.jsx("div",{style:{height:30,display:"flex"},children:["Attributes","Skills","Titles"].map((m,U)=>i.jsx("div",{style:et(T===U),onClick:()=>A(U),children:m},m))}),i.jsxs("div",{style:J,children:[T===0&&i.jsxs(i.Fragment,{children:[i.jsx("div",{style:{padding:"6px 8px",display:"flex",flexDirection:"column",gap:8,borderBottom:`2px solid ${pl}`},children:[{label:"Health",pct:(o==null?void 0:o.health_percentage)??0,cur:o==null?void 0:o.health_current,max:o==null?void 0:o.health_max,bg:"#cc3333"},{label:"Stamina",pct:(o==null?void 0:o.stamina_percentage)??0,cur:o==null?void 0:o.stamina_current,max:o==null?void 0:o.stamina_max,bg:"#ccaa33"},{label:"Mana",pct:(o==null?void 0:o.mana_percentage)??0,cur:o==null?void 0:o.mana_current,max:o==null?void 0:o.mana_max,bg:"#3366cc"}].map(m=>i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[i.jsx("span",{style:{width:55,fontSize:12,color:"#ccc"},children:m.label}),i.jsx("div",{style:{flex:1,height:14,overflow:"hidden",position:"relative",border:`1px solid ${pl}`},children:i.jsx("div",{style:{height:"100%",width:`${m.pct}%`,background:m.bg,transition:"width 0.5s ease"}})}),i.jsxs("span",{style:{width:80,textAlign:"right",fontSize:12,color:"#ccc"},children:[m.cur??"—"," / ",m.max??"—"]})]},m.label))}),i.jsxs("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("td",{style:st,children:"Attribute"}),i.jsx("td",{style:st,children:"Creation"}),i.jsx("td",{style:st,children:"Base"})]})}),i.jsx("tbody",{children:["strength","endurance","coordination","quickness","focus","self"].map(m=>{var U,Z;return i.jsxs("tr",{children:[i.jsx("td",{style:dt,children:m.charAt(0).toUpperCase()+m.slice(1)}),i.jsx("td",{style:G,children:((U=L[m])==null?void 0:U.creation)??"—"}),i.jsx("td",{style:mt,children:((Z=L[m])==null?void 0:Z.base)??"—"})]},m)})})]}),i.jsxs("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("td",{style:st,children:"Vital"}),i.jsx("td",{style:st,children:"Base"})]})}),i.jsx("tbody",{children:["health","stamina","mana"].map(m=>{var U;return i.jsxs("tr",{children:[i.jsx("td",{style:dt,children:m.charAt(0).toUpperCase()+m.slice(1)}),i.jsx("td",{style:mt,children:((U=it[m])==null?void 0:U.base)??"—"})]},m)})})]}),i.jsx("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:i.jsx("tbody",{children:i.jsxs("tr",{children:[i.jsx("td",{style:dt,children:"Skill Credits"}),i.jsx("td",{style:mt,children:q(H.skill_credits)})]})})})]}),T===1&&i.jsxs("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("td",{style:st,children:"Skill"}),i.jsx("td",{style:st,children:"Level"})]})}),i.jsxs("tbody",{children:[I.map(([m,U])=>i.jsxs("tr",{children:[i.jsx("td",{style:{padding:"2px 6px",background:"linear-gradient(to right, #392067, #392067, black)"},children:m.replace(/_/g," ").replace(/\b\w/g,Z=>Z.toUpperCase())}),i.jsx("td",{style:{...mt,background:"linear-gradient(to right, #392067, #392067, black)"},children:U.base})]},m)),O.map(([m,U])=>i.jsxs("tr",{children:[i.jsx("td",{style:{padding:"2px 6px",background:"linear-gradient(to right, #0f3c3e, #0f3c3e, black)"},children:m.replace(/_/g," ").replace(/\b\w/g,Z=>Z.toUpperCase())}),i.jsx("td",{style:{...mt,background:"linear-gradient(to right, #0f3c3e, #0f3c3e, black)"},children:U.base})]},m)),I.length===0&&O.length===0&&i.jsx("tr",{children:i.jsx("td",{colSpan:2,style:{padding:10,color:"#666",fontStyle:"italic",textAlign:"center"},children:"No skill data"})})]})]}),T===2&&i.jsx("div",{style:{padding:"6px 10px",fontSize:13},children:tt.length>0?tt.map((m,U)=>i.jsx("div",{style:{padding:"1px 0"},children:m},U)):i.jsx("div",{style:{color:"#666",fontStyle:"italic",textAlign:"center",padding:10},children:"No titles"})})]})]}),i.jsxs("div",{style:{width:320},children:[i.jsx("div",{style:{height:30,display:"flex"},children:["Augmentations","Ratings","Other"].map((m,U)=>i.jsx("div",{style:et(b===U),onClick:()=>y(U),children:m},m))}),i.jsxs("div",{style:J,children:[b===0&&(w.length||V.length?i.jsxs(i.Fragment,{children:[w.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("div",{style:{background:"#222",padding:"4px 8px",fontWeight:"bold",fontSize:13,borderBottom:`1px solid ${pl}`},children:"Augmentations"}),i.jsxs("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("td",{style:st,children:"Name"}),i.jsx("td",{style:st,children:"Uses"})]})}),i.jsx("tbody",{children:w.map(m=>i.jsxs("tr",{children:[i.jsx("td",{style:{padding:"2px 6px"},children:m.name}),i.jsx("td",{style:{padding:"2px 6px",textAlign:"right"},children:m.uses})]},m.name))})]})]}),V.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("div",{style:{background:"#222",padding:"4px 8px",fontWeight:"bold",fontSize:13,borderBottom:`1px solid ${pl}`},children:"Auras"}),i.jsxs("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("td",{style:st,children:"Name"}),i.jsx("td",{style:st,children:"Uses"})]})}),i.jsx("tbody",{children:V.map(m=>i.jsxs("tr",{children:[i.jsx("td",{style:{padding:"2px 6px"},children:m.name}),i.jsx("td",{style:{padding:"2px 6px",textAlign:"right"},children:m.uses})]},m.name))})]})]})]}):i.jsx("div",{style:{color:"#666",fontStyle:"italic",textAlign:"center",padding:10},children:"No augmentation data"})),b===1&&(K.length>0?i.jsxs("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("td",{style:st,children:"Rating"}),i.jsx("td",{style:st,children:"Value"})]})}),i.jsx("tbody",{children:K.map(m=>i.jsxs("tr",{children:[i.jsx("td",{style:{padding:"2px 6px"},children:m.name}),i.jsx("td",{style:{padding:"2px 6px",textAlign:"right"},children:m.value})]},m.name))})]}):i.jsx("div",{style:{color:"#666",fontStyle:"italic",textAlign:"center",padding:10},children:"No rating data"})),b===2&&i.jsxs("div",{children:[X.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("div",{style:{background:"#222",padding:"4px 8px",fontWeight:"bold",fontSize:13,borderBottom:`1px solid ${pl}`},children:"General"}),i.jsx("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:i.jsx("tbody",{children:X.map(m=>i.jsxs("tr",{children:[i.jsx("td",{style:{padding:"2px 6px"},children:m.name}),i.jsx("td",{style:{padding:"2px 6px",textAlign:"right"},children:m.value})]},m.name))})})]}),C.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("div",{style:{background:"#222",padding:"4px 8px",fontWeight:"bold",fontSize:13,borderBottom:`1px solid ${pl}`},children:"Masteries"}),i.jsx("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:i.jsx("tbody",{children:C.map(m=>i.jsxs("tr",{children:[i.jsx("td",{style:{padding:"2px 6px"},children:m.name}),i.jsx("td",{style:{padding:"2px 6px",textAlign:"right"},children:m.value})]},m.name))})})]}),Q.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("div",{style:{background:"#222",padding:"4px 8px",fontWeight:"bold",fontSize:13,borderBottom:`1px solid ${pl}`},children:"Society"}),i.jsx("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:i.jsx("tbody",{children:Q.map(m=>i.jsxs("tr",{children:[i.jsx("td",{style:{padding:"2px 6px"},children:m.name}),i.jsxs("td",{style:{padding:"2px 6px",textAlign:"right"},children:[m.rank," (",m.value,")"]})]},m.name))})})]}),X.length===0&&C.length===0&&Q.length===0&&i.jsx("div",{style:{color:"#666",fontStyle:"italic",textAlign:"center",padding:10},children:"No additional data"})]})]})]})]}),(d==null?void 0:d.allegiance)&&i.jsxs("div",{style:{marginTop:5,border:`2px solid ${pl}`,background:"#000"},children:[i.jsx("div",{style:{background:"#222",padding:"4px 8px",fontWeight:"bold",fontSize:13,borderBottom:`1px solid ${pl}`},children:"Allegiance"}),i.jsx("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:i.jsxs("tbody",{children:[d.allegiance.name&&i.jsxs("tr",{children:[i.jsx("td",{style:{padding:"2px 6px",color:"#ccc",width:100},children:"Name"}),i.jsx("td",{style:{padding:"2px 6px"},children:d.allegiance.name})]}),((W=d.allegiance.monarch)==null?void 0:W.name)&&i.jsxs("tr",{children:[i.jsx("td",{style:{padding:"2px 6px",color:"#ccc"},children:"Monarch"}),i.jsx("td",{style:{padding:"2px 6px"},children:d.allegiance.monarch.name})]}),((z=d.allegiance.patron)==null?void 0:z.name)&&i.jsxs("tr",{children:[i.jsx("td",{style:{padding:"2px 6px",color:"#ccc"},children:"Patron"}),i.jsx("td",{style:{padding:"2px 6px"},children:d.allegiance.patron.name})]}),d.allegiance.rank!=null&&i.jsxs("tr",{children:[i.jsx("td",{style:{padding:"2px 6px",color:"#ccc"},children:"Rank"}),i.jsx("td",{style:{padding:"2px 6px"},children:d.allegiance.rank})]}),d.allegiance.followers!=null&&i.jsxs("tr",{children:[i.jsx("td",{style:{padding:"2px 6px",color:"#ccc"},children:"Followers"}),i.jsx("td",{style:{padding:"2px 6px"},children:d.allegiance.followers})]})]})})]})]})})};function hy(s){var o,d;if(!s)return s;const v=x=>x!=null&&x!==-1&&x!==-1?x:void 0,S=s.IntValues||{};return{item_id:s.item_id??s.Id??0,name:s.name??s.Name??((o=s.StringValues)==null?void 0:o["1"])??"Unknown",icon:s.icon??s.Icon??0,object_class:s.object_class??s.ObjectClass??0,current_wielded_location:s.current_wielded_location??v(s.CurrentWieldedLocation)??v(Number(S[10]))??0,container_id:s.container_id??s.ContainerId??0,items_capacity:s.items_capacity??v(s.ItemsCapacity)??v(Number(S[6]))??((d=s.enhanced_properties)==null?void 0:d.ItemSlots_Decal)??void 0,value:s.value??v(s.Value)??v(Number(S[19]))??0,burden:s.burden??v(s.Burden)??v(Number(S[5]))??0,armor_level:s.armor_level??v(s.ArmorLevel),max_damage:s.max_damage??v(s.MaxDamage),material:s.material??s.material_name??s.Material??void 0,item_set:s.item_set??s.ItemSet??void 0,imbue:s.imbue??s.Imbue??void 0,tinks:s.tinks??v(s.Tinks),workmanship:s.workmanship??v(s.Workmanship),equip_skill:s.equip_skill??s.equip_skill_name??s.EquipSkill??void 0,wield_level:s.wield_level??v(s.WieldLevel),skill_level:s.skill_level??v(s.SkillLevel),lore_requirement:s.lore_requirement??v(s.LoreRequirement),attack_bonus:s.attack_bonus??v(s.AttackBonus),melee_defense_bonus:s.melee_defense_bonus??v(s.MeleeDefenseBonus),magic_defense_bonus:s.magic_defense_bonus??v(s.MagicDBonus),damage_bonus:s.damage_bonus??v(s.DamageBonus),damage_rating:s.damage_rating??v(s.DamRating),crit_rating:s.crit_rating??v(s.CritRating),heal_boost_rating:s.heal_boost_rating??v(s.HealBoostRating),current_mana:s.current_mana??v(Number(S[218103815]))??void 0,max_mana:s.max_mana??v(Number(S[218103814]))??void 0,spellcraft:s.spellcraft??void 0,damage_range:s.damage_range??void 0,damage_type:s.damage_type??void 0,speed_text:s.speed_text??void 0,mana_display:s.mana_display??void 0,spells:s.spells??void 0,icon_overlay_id:s.icon_overlay_id??v(Number(S[218103849]))??void 0,icon_underlay_id:s.icon_underlay_id??v(Number(S[218103850]))??void 0,_raw:s}}function Iu(s){return!s||s<=0?"06000133":(s+100663296).toString(16).toUpperCase().padStart(8,"0")}const Ra={32768:{name:"Neck",row:1,col:1},1:{name:"Head",row:1,col:3},268435456:{name:"Sigil",row:1,col:5},536870912:{name:"Sigil",row:1,col:6},1073741824:{name:"Sigil",row:1,col:7},67108864:{name:"Trinket",row:2,col:1},2048:{name:"U.Arm",row:2,col:2},512:{name:"Chest",row:2,col:3},134217728:{name:"Cloak",row:2,col:7},65536:{name:"Brace L",row:3,col:1},4096:{name:"L.Arm",row:3,col:2},1024:{name:"Abdomen",row:3,col:3},8192:{name:"U.Leg",row:3,col:4},131072:{name:"Brace R",row:3,col:5},2:{name:"Shirt",row:3,col:7},262144:{name:"Ring L",row:4,col:1},32:{name:"Hands",row:4,col:2},16384:{name:"L.Leg",row:4,col:4},524288:{name:"Ring R",row:4,col:5},4:{name:"Pants",row:4,col:7},256:{name:"Feet",row:5,col:4},2097152:{name:"Shield",row:6,col:1},1048576:{name:"Melee",row:6,col:3},4194304:{name:"Missile",row:6,col:3},16777216:{name:"Held",row:6,col:3},33554432:{name:"2H",row:6,col:3},8388608:{name:"Ammo",row:6,col:7}},Da={},my=[32768,67108864,65536,131072,262144,524288],yy=[1,512,2048,1024,4096,8192,16384,32,256],gy=[2,4,134217728,268435456,536870912,1073741824],vy=[2097152,1048576,4194304,16777216,33554432,8388608];(()=>{const s=new Set;Object.entries(Ra).forEach(([v,S])=>{const o=`${S.row}-${S.col}`,d=parseInt(v);s.has(o)||(s.add(o),my.includes(d)?Da[o]="#3a2555":yy.includes(d)?Da[o]="#1e2e55":gy.includes(d)?Da[o]="#1e3e3e":vy.includes(d)?Da[o]="#142040":Da[o]="#2a2a2a")})})();const Ua="#af7a30";function As({item:s,size:v=36}){const S={position:"absolute",top:0,left:0,width:v,height:v,border:"none",background:"transparent",imageRendering:"pixelated"},o=s.icon_underlay_id&&s.icon_underlay_id>100?`/icons/${Iu(s.icon_underlay_id)}.png`:null,d=s.icon_overlay_id&&s.icon_overlay_id>100?`/icons/${Iu(s.icon_overlay_id)}.png`:null;return i.jsxs("div",{style:{width:v,height:v,position:"relative"},children:[o&&i.jsx("img",{src:o,alt:"",style:{...S,zIndex:1},onError:x=>{x.target.style.display="none"}}),i.jsx("img",{src:`/icons/${Iu(s.icon)}.png`,alt:s.name,style:{...S,zIndex:2},onError:x=>{x.target.src="/icons/06000133.png"}}),d&&i.jsx("img",{src:d,alt:"",style:{...S,zIndex:3},onError:x=>{x.target.style.display="none"}})]})}function py({item:s,x:v,y:S}){var T,A;const o=b=>b!=null&&b!==-1&&b!==-1,d=b=>b.toLocaleString(),x=b=>`${((b-1)*100).toFixed(1)}%`;return i.jsxs("div",{style:{position:"fixed",left:v+14,top:S+14,background:"rgba(0,0,0,0.96)",border:"1px solid #555",borderRadius:4,padding:"8px 12px",zIndex:99999,minWidth:200,maxWidth:340,fontSize:13,color:"#ddd",pointerEvents:"none",lineHeight:1.6,fontFamily:'-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif'},children:[i.jsx("div",{style:{color:"#ffcc00",fontWeight:"bold",fontSize:14,marginBottom:4},children:s.name}),i.jsxs("div",{style:{color:"#aaa"},children:["Value: ",d(s.value)," · Burden: ",s.burden]}),s.workmanship&&i.jsxs("div",{style:{color:"#aaa"},children:["Workmanship: ",s.workmanship]}),s.material&&i.jsxs("div",{style:{color:"#88ff88"},children:["Material: ",s.material]}),o(s.armor_level)&&i.jsxs("div",{style:{color:"#88ff88"},children:["Armor Level: ",s.armor_level]}),o(s.max_damage)&&i.jsxs("div",{style:{color:"#88ff88"},children:["Max Damage: ",s.max_damage]}),s.damage_range&&i.jsxs("div",{style:{color:"#88ff88"},children:["Damage: ",s.damage_range,s.damage_type?`, ${s.damage_type}`:""]}),o(s.attack_bonus)&&s.attack_bonus!==1&&i.jsxs("div",{style:{color:"#88ff88"},children:["Attack: +",x(s.attack_bonus)]}),o(s.melee_defense_bonus)&&s.melee_defense_bonus!==1&&i.jsxs("div",{style:{color:"#88ff88"},children:["Melee Def: +",x(s.melee_defense_bonus)]}),o(s.magic_defense_bonus)&&s.magic_defense_bonus!==1&&i.jsxs("div",{style:{color:"#88ff88"},children:["Magic Def: +",x(s.magic_defense_bonus)]}),s.equip_skill&&i.jsxs("div",{style:{color:"#ddd"},children:["Skill: ",s.equip_skill]}),o(s.wield_level)&&i.jsxs("div",{style:{color:"#ffaa00"},children:["Wield Level: ",s.wield_level]}),o(s.lore_requirement)&&i.jsxs("div",{style:{color:"#ffaa00"},children:["Lore: ",s.lore_requirement]}),s.imbue&&i.jsxs("div",{style:{color:"#88ff88"},children:["Imbue: ",s.imbue]}),s.item_set&&i.jsxs("div",{style:{color:"#88ff88"},children:["Set: ",s.item_set]}),o(s.tinks)&&i.jsxs("div",{style:{color:"#88ff88"},children:["Tinks: ",s.tinks]}),o(s.damage_rating)&&i.jsxs("div",{children:["Damage Rating: ",s.damage_rating]}),o(s.crit_rating)&&i.jsxs("div",{children:["Crit Rating: ",s.crit_rating]}),o(s.heal_boost_rating)&&i.jsxs("div",{children:["Heal Boost: ",s.heal_boost_rating]}),s.spellcraft&&i.jsxs("div",{style:{color:"#dda0dd"},children:["Spellcraft: ",s.spellcraft]}),o(s.current_mana)&&o(s.max_mana)&&i.jsxs("div",{style:{color:"#98d7ff"},children:["Mana: ",s.current_mana," / ",s.max_mana]}),((A=(T=s.spells)==null?void 0:T.spells)==null?void 0:A.length)>0&&i.jsxs("div",{style:{color:"#4a90e2",marginTop:4,fontSize:12},children:["Spells: ",s.spells.spells.map(b=>b.name).join(", ")]})]})}function Fd({iconSrc:s,isActive:v,fillPct:S,label:o,onClick:d}){const x=S>90?"#b7432c":S>70?"#d8a431":"#00ff00";return i.jsxs("div",{onClick:d,title:o,style:{display:"flex",alignItems:"flex-start",gap:2,cursor:"pointer",flexShrink:0,marginTop:3,position:"relative"},children:[v&&i.jsx("span",{style:{position:"absolute",left:-11,top:8,color:Ua,fontSize:10},children:"▶"}),i.jsx("div",{style:{width:30,height:30,border:v?"1px solid #00ff00":"1px solid #333",boxShadow:v?"0 0 4px #00ff00":"none",background:"#000",display:"flex",alignItems:"center",justifyContent:"center"},children:i.jsx("img",{src:s,alt:"",style:{width:26,height:26,objectFit:"contain",imageRendering:"pixelated"},onError:T=>{T.target.src="/icons/06001080.png"}})}),i.jsx("div",{style:{width:7,height:30,background:"#222",border:"1px solid #666",position:"relative",overflow:"hidden",borderRadius:2},title:`${Math.round(S)}% full`,children:i.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,height:`${S}%`,background:x,minHeight:S>0?2:0}})})]})}const xy=({id:s,charName:v,zIndex:S})=>{var st,dt,mt;const[o,d]=R.useState([]),[x,T]=R.useState(!0),[A,b]=R.useState(null),[y,q]=R.useState(null),[H,L]=R.useState(null),[F,it]=R.useState(null);R.useEffect(()=>{T(!0),Promise.all([tl(`/inventory/${encodeURIComponent(v)}?limit=1000`).catch(()=>({items:[]})),tl(`/character-stats/${encodeURIComponent(v)}`).catch(()=>null)]).then(([G,W])=>{const z=G.items??[];d(z.map(hy)),L(W)}).finally(()=>T(!1))},[v]);const tt=R.useCallback((G,W)=>{q(G&&W?{item:G,x:W.clientX,y:W.clientY}:null)},[]),bt=R.useMemo(()=>{const G=new Set,W=[];return Object.entries(Ra).forEach(([z,m])=>{const U=`${m.row}-${m.col}`;G.has(U)||(G.add(U),W.push({key:U,...m,mask:parseInt(z)}))}),W},[]),{equippedMap:I,containers:O,packItems:w}=R.useMemo(()=>{const G=new Map,W=[],z=new Set,m=new Map;o.forEach(Z=>{Z.object_class===10&&(W.push(Z),z.add(Z.item_id))}),W.sort((Z,ct)=>(Z.item_id>>>0)-(ct.item_id>>>0));let U=null;return o.forEach(Z=>{Z.current_wielded_location>0&&Z.container_id&&!z.has(Z.container_id)&&(U=Z.container_id)}),o.forEach(Z=>{if(z.has(Z.item_id))return;const ct=Z.current_wielded_location;if(ct>0)if(Z.object_class===2)Object.entries(Ra).forEach(([D,k])=>{if((ct&parseInt(D))===parseInt(D)){const $=`${k.row}-${k.col}`;G.has($)||G.set($,Z)}});else{let D=!1;if(Ra[ct]){const k=Ra[ct],$=`${k.row}-${k.col}`;G.has($)||(G.set($,Z),D=!0)}if(!D){for(const[k,$]of Object.entries(Ra))if((ct&parseInt(k))===parseInt(k)){const nt=`${$.row}-${$.col}`;if(!G.has(nt)){G.set(nt,Z),D=!0;break}}}}else{let h=Z.container_id||0;U&&h===U&&(h=0),m.has(h)||m.set(h,[]),m.get(h).push(Z)}}),{equippedMap:G,containers:W,packItems:m}},[o]);let V=w.get(0)??[],K=0;if(V.length===0){let G=0;for(const[W,z]of w.entries())!O.some(m=>m.item_id===W)&&z.length>G&&(G=z.length,K=W);V=w.get(K)??[]}const X=A!==null?w.get(A)??[]:V,C=(H==null?void 0:H.burden_units)??((st=H==null?void 0:H.stats_data)==null?void 0:st.burden_units)??0,Q=(H==null?void 0:H.encumbrance_capacity)??((dt=H==null?void 0:H.stats_data)==null?void 0:dt.encumbrance_capacity)??0,et=Q>0?Math.min(200,C/Q*100):0,J=et>150?"#b7432c":et>100?"#d8a431":"#2e8b57";return x?i.jsx(le,{id:s,title:`Inventory: ${v}`,zIndex:S,width:572,height:720,children:i.jsx("div",{style:{padding:20,color:"#666",fontStyle:"italic"},children:"Loading inventory..."})}):i.jsxs(le,{id:s,title:`Inventory: ${v}`,zIndex:S,width:572,height:720,children:[i.jsxs("div",{style:{display:"flex",flex:1,overflow:"hidden",background:"rgba(14,14,14,0.96)",fontFamily:'-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif',fontSize:13},children:[i.jsxs("div",{style:{width:316,display:"flex",flexDirection:"column",overflow:"hidden"},children:[i.jsx("div",{style:{position:"relative",height:270,minHeight:270,background:"#0a0a0a",borderBottom:`1px solid ${Ua}`},children:bt.map(G=>{const W=I.get(G.key),z=Da[G.key]??"#2a2a2a";return i.jsx("div",{style:{position:"absolute",left:(G.col-1)*44+4,top:(G.row-1)*44+4,width:36,height:36,background:W?"#5a5a62":z,border:W?"2px solid #00ffff":"2px outset #6a6a72",boxShadow:W?"0 0 5px #00ffff, inset 0 0 5px rgba(0,255,255,0.2)":"none",display:"flex",alignItems:"center",justifyContent:"center",cursor:W?"pointer":"default"},onMouseEnter:m=>W&&tt(W,m),onMouseMove:m=>W&&tt(W,m),onMouseLeave:()=>tt(null),children:W?i.jsx(As,{item:W,size:32}):i.jsx("img",{src:"/icons/06000133.png",alt:"",style:{width:28,height:28,opacity:.15,filter:"grayscale(100%)",imageRendering:"pixelated"}})},G.key)})}),i.jsxs("div",{style:{padding:"3px 6px",fontSize:11,color:"#ccc",background:"#111",borderBottom:`1px solid ${Ua}`},children:["Contents of ",A!==null?((mt=O.find(G=>G.item_id===A))==null?void 0:mt.name)??"Pack":"Backpack"]}),i.jsxs("div",{style:{flex:1,overflowY:"auto",display:"grid",gridTemplateColumns:"repeat(6, 36px)",gridAutoRows:36,gap:2,padding:4,alignContent:"start"},children:[X.map((G,W)=>i.jsx("div",{style:{width:36,height:36,background:"linear-gradient(135deg, #3d007a 0%, #1a0033 100%)",border:"1px solid #4a148c",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},onMouseEnter:z=>tt(G,z),onMouseMove:z=>tt(G,z),onMouseLeave:()=>tt(null),children:i.jsx(As,{item:G,size:32})},G.item_id??W)),Array.from({length:Math.max(0,24-X.length)}).map((G,W)=>i.jsx("div",{style:{width:36,height:36,background:"#0a0a0a",border:"1px solid #1a1a1a"}},`e${W}`))]})]}),i.jsxs("div",{style:{width:42,display:"flex",flexDirection:"column",alignItems:"center",padding:"4px 2px",borderLeft:`1px solid ${Ua}`,borderRight:`1px solid ${Ua}`},children:[i.jsx("div",{style:{textAlign:"center",fontSize:8,color:"#ccc",marginBottom:2},children:Q>0?`${Math.floor(et)}%`:"Burden"}),i.jsx("div",{style:{width:14,height:40,background:"#111",border:"1px solid #555",position:"relative",overflow:"hidden",marginBottom:6,flexShrink:0},title:Q>0?`${C.toLocaleString()} / ${Q.toLocaleString()}`:`Burden: ${o.reduce((G,W)=>G+(W.burden??0),0).toLocaleString()}`,children:i.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,height:`${et/2}%`,background:J,transition:"height 0.3s"}})}),i.jsx(Fd,{iconSrc:"/icons/0600127E.png",isActive:A===null,fillPct:V.length>0?Math.min(100,V.length/102*100):0,label:`Backpack (${V.length}/102)`,onClick:()=>b(null)}),O.map(G=>{const W=G.item_id,z=o.filter(Z=>Z.container_id===W&&Z.item_id!==W).length,m=G.items_capacity||24,U=m>0?Math.min(100,z/m*100):0;return i.jsx(Fd,{iconSrc:`/icons/${Iu(G.icon)}.png`,isActive:A===W,fillPct:U,label:`${G.name} (${z}/${m})`,onClick:()=>b(W)},W)})]}),i.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden",minWidth:160},children:[i.jsx("div",{style:{padding:"4px 8px",fontSize:"0.72rem",fontWeight:600,color:"#aaa",background:"#111",borderBottom:`1px solid ${Ua}`},children:"Mana"}),i.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"2px 0"},children:[Array.from(I.values()).filter(G=>G.current_mana>0||G.max_mana>0).sort((G,W)=>(G.current_mana??999999)-(W.current_mana??999999)).map((G,W)=>i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4,padding:"2px 4px",borderBottom:"1px solid #1a1a1a",cursor:"pointer"},onMouseEnter:z=>tt(G,z),onMouseMove:z=>tt(G,z),onMouseLeave:()=>tt(null),children:[i.jsx("div",{style:{width:20,height:20,flexShrink:0},children:i.jsx(As,{item:G,size:20})}),i.jsx("div",{style:{width:8,height:8,borderRadius:"50%",background:G.current_mana>0?"#4c4":"#c44",flexShrink:0}}),i.jsx("div",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"0.68rem",color:"#ccc"},children:G.name}),i.jsxs("div",{style:{fontSize:"0.65rem",color:"#88bbff",whiteSpace:"nowrap",fontVariantNumeric:"tabular-nums"},children:[G.current_mana??0,"/",G.max_mana??0]}),i.jsx("div",{style:{fontSize:"0.63rem",color:"#9c9",whiteSpace:"nowrap",fontVariantNumeric:"tabular-nums",minWidth:42,textAlign:"right"},children:G.max_mana>0?Sy(G.current_mana??0,G.max_mana??0):""})]},W)),Array.from(I.values()).filter(G=>G.current_mana>0||G.max_mana>0).length===0&&i.jsx("div",{style:{padding:12,color:"#555",textAlign:"center",fontSize:"0.7rem"},children:"No mana items equipped"})]})]})]}),y&&i.jsx(py,{item:y.item,x:y.x,y:y.y})]})};function Sy(s,v){if(v<=0||s<=0)return"0h00m";const S=s*20,o=Math.floor(S/3600),d=Math.floor(S%3600/60);return`~${o}h${String(d).padStart(2,"0")}m`}const Ts=300,Id=.5,Pd={Monster:"#ff4444",Player:"#4488ff",NPC:"#44cc44",Vendor:"#44cc44",Portal:"#aa44ff",Corpse:"#ff8800",Container:"#cccc44",Door:"#888888"};function by(s){const v=(s%360+360)%360;return["N","NE","E","SE","S","SW","W","NW"][Math.round(v/45)%8]}const _y=({id:s,charName:v,zIndex:S,socket:o,radarData:d})=>{const x=R.useRef(null),T=R.useRef(Id),[A,b]=R.useState(Id),[y,q]=R.useState(null),H=R.useRef(null),L=R.useRef([]);R.useEffect(()=>{const I=new Image;I.src="/dereth.png",I.onload=()=>{H.current=I}},[]),R.useEffect(()=>((o==null?void 0:o.readyState)===WebSocket.OPEN&&o.send(JSON.stringify({player_name:v,command:"start_radar"})),()=>{(o==null?void 0:o.readyState)===WebSocket.OPEN&&o.send(JSON.stringify({player_name:v,command:"stop_radar"}))}),[v,o]);const F=R.useCallback(I=>{I.preventDefault();const O=I.deltaY>0?1.25:.8;T.current=Math.max(.02,Math.min(5,T.current*O)),b(T.current)},[]),it=R.useCallback(I=>{const O=x.current;if(!O)return;const w=O.getBoundingClientRect(),V=(I.clientX-w.left)*(O.width/w.width),K=(I.clientY-w.top)*(O.height/w.height);let X=null,C=20;L.current.forEach(Q=>{if(Q._px===void 0)return;const et=Math.sqrt((V-Q._px)**2+(K-Q._py)**2);et{const I=x.current;if(!I||!d)return;const O=I.getContext("2d");if(!O)return;const w=Ts,V=w/2,K=w/2,X=d.objects??[],C=d.player_ew??0,Q=d.player_ns??0,et=d.player_heading??0,J=d.is_dungeon??!1,st=d.player_x??0,dt=d.player_y??0,mt=T.current,G=J?w/2/(mt*240):w/2/mt,W=et*Math.PI/180;if(O.clearRect(0,0,w,w),O.fillStyle="#111",O.beginPath(),O.arc(V,K,V,0,Math.PI*2),O.fill(),O.save(),O.beginPath(),O.arc(V,K,V-1,0,Math.PI*2),O.clip(),!J&&H.current){const Z=H.current,ct=Z.naturalWidth/204.2,h=(C+102.1)*ct,D=(102.1-Q)*ct;O.globalAlpha=.4,O.save(),O.translate(V,K),O.rotate(-W),O.drawImage(Z,h-V/G*ct,D-K/G*ct,w/G*ct,w/G*ct,-V,-K,w,w),O.restore(),O.globalAlpha=1}O.restore(),O.strokeStyle="#333",O.lineWidth=1;for(let Z=1;Z<=4;Z++)O.beginPath(),O.arc(V,K,V/4*Z,0,Math.PI*2),O.stroke();O.beginPath(),O.moveTo(V,0),O.lineTo(V,w),O.moveTo(0,K),O.lineTo(w,K),O.stroke(),O.font="bold 12px monospace",O.textAlign="center",O.textBaseline="middle",[{l:"N",a:0},{l:"E",a:Math.PI/2},{l:"S",a:Math.PI},{l:"W",a:-Math.PI/2}].forEach(({l:Z,a:ct})=>{const h=ct-W;O.fillStyle=Z==="N"?"#cc4444":"#888",O.fillText(Z,V+Math.sin(h)*(V-12),K-Math.cos(h)*(V-12))}),O.strokeStyle="#666",O.lineWidth=1,O.beginPath(),O.moveTo(V,K),O.lineTo(V,K-V*.85),O.stroke();const z=J?Math.PI-W:W,m=Math.cos(z),U=Math.sin(z);X.forEach(Z=>{let ct,h;J&&Z.raw_x!==void 0?(ct=-(Z.raw_x-st),h=Z.raw_y-dt):(ct=(Z.ew??0)-C,h=(Z.ns??0)-Q);const D=ct*m-h*U,k=J?ct*U+h*m:-(ct*U+h*m),$=V+D*G,nt=K+k*G;if(Math.sqrt(($-V)**2+(nt-K)**2)>V-4)return;Z._px=$,Z._py=nt;const vt=Z.object_class??Z.type??"",wt=Pd[vt]??"#888",Nt=Z.id===y,ee=Nt?6:vt==="Monster"||vt==="Player"?4:3;Nt&&(O.strokeStyle="#fff",O.lineWidth=2,O.beginPath(),O.arc($,nt,ee+3,0,Math.PI*2),O.stroke()),O.fillStyle=wt,O.beginPath(),O.arc($,nt,ee,0,Math.PI*2),O.fill(),(vt==="Player"||vt==="Portal"||Nt)&&(O.fillStyle=Nt?"#fff":wt,O.font="9px monospace",O.textAlign="left",O.fillText(Z.name,$+6,nt+3))}),L.current=X,O.fillStyle="#ffcc00",O.beginPath(),O.arc(V,K,5,0,Math.PI*2),O.fill(),O.strokeStyle="#fff",O.lineWidth=1,O.stroke()},[d,A,y]);const tt=((d==null?void 0:d.objects)??[]).map(I=>{const O=(d==null?void 0:d.player_ew)??0,w=(d==null?void 0:d.player_ns)??0,V=(d==null?void 0:d.is_dungeon)??!1,K=(d==null?void 0:d.player_x)??0,X=(d==null?void 0:d.player_y)??0;let C,Q,et;V&&I.raw_x!==void 0?(C=-(I.raw_x-K),Q=I.raw_y-X,et=Math.sqrt(C*C+Q*Q)):(C=(I.ew??0)-O,Q=(I.ns??0)-w,et=Math.sqrt(C*C+Q*Q)*240);const J=Math.atan2(C,Q)*180/Math.PI;return{...I,dist:et,dir:by(J)}}).sort((I,O)=>I.dist-O.dist),bt=Math.round(A*240);return i.jsxs(le,{id:s,title:`Radar: ${v}`,zIndex:S,width:360,height:560,children:[i.jsxs("div",{style:{padding:"4px 8px",display:"flex",justifyContent:"space-between",fontSize:"0.75rem",color:"#888",borderBottom:"1px solid #333",background:"#1a1a1a"},children:[i.jsxs("span",{children:["Range: ~",bt,"m"]}),i.jsx("span",{style:{fontSize:"0.65rem",color:"#555"},children:"Scroll to zoom"})]}),i.jsx("canvas",{ref:x,width:Ts,height:Ts,style:{display:"block",margin:"0 auto",borderBottom:"1px solid #333",cursor:"crosshair",flexShrink:0},onWheel:F,onClick:it}),i.jsxs("div",{style:{flex:1,overflowY:"auto",fontSize:"0.72rem",minHeight:0},children:[i.jsxs("div",{style:{display:"flex",padding:"3px 6px",borderBottom:"1px solid #333",color:"#666",fontSize:"0.65rem",fontWeight:600},children:[i.jsx("span",{style:{width:8}}),i.jsx("span",{style:{flex:1,marginLeft:6},children:"Name"}),i.jsx("span",{style:{width:55,textAlign:"left"},children:"Type"}),i.jsx("span",{style:{width:40,textAlign:"right"},children:"Dist"}),i.jsx("span",{style:{width:24,textAlign:"center"},children:"Dir"})]}),tt.length===0&&i.jsx("div",{style:{padding:12,color:"#555",textAlign:"center",fontSize:"0.7rem"},children:"Waiting for radar data..."}),tt.map(I=>{const O=I.object_class??I.type??"",w=Pd[O]??"#888",V=I.id===y;return i.jsxs("div",{onClick:()=>q(V?null:I.id),style:{display:"flex",alignItems:"center",padding:"2px 6px",borderBottom:"1px solid #1a1a1a",cursor:"pointer",color:"#ccc",background:V?"#1a2a3a":"",borderLeft:V?"2px solid #4488ff":"2px solid transparent"},children:[i.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:w,flexShrink:0}}),i.jsx("span",{style:{flex:1,marginLeft:6,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:I.name}),i.jsx("span",{style:{width:55,color:"#888",fontSize:"0.65rem"},children:O}),i.jsx("span",{style:{width:40,textAlign:"right",fontVariantNumeric:"tabular-nums"},children:I.dist<1e3?`${Math.round(I.dist)}m`:`${(I.dist/1e3).toFixed(1)}km`}),i.jsx("span",{style:{width:24,textAlign:"center",color:"#666"},children:I.dir})]},I.id)})]})]})},Nn=["Typeless","Slash","Pierce","Bludgeon","Fire","Cold","Acid","Electric"];function Me(s,v,S){var o,d,x,T;return(((d=(o=s==null?void 0:s[v])==null?void 0:o[S])==null?void 0:d.total_normal_damage)??0)+(((T=(x=s==null?void 0:s[v])==null?void 0:x[S])==null?void 0:T.total_crit_damage)??0)}function jy(s){let v={attacks:0,failed:0,crits:0,normalDmg:0,maxNormal:0,critDmg:0,maxCrit:0};if(!s)return v;for(const S of Object.values(s))for(const o of Object.values(S))v.attacks+=o.total_attacks??0,v.failed+=o.failed_attacks??0,v.crits+=o.crits??0,v.normalDmg+=o.total_normal_damage??0,v.maxNormal=Math.max(v.maxNormal,o.max_normal_damage??0),v.critDmg+=o.total_crit_damage??0,v.maxCrit=Math.max(v.maxCrit,o.max_crit_damage??0);return v}function th(s,v){let S={attacks:0,failed:0};const o=s==null?void 0:s[v];if(!o)return S;for(const d of Object.values(o))S.attacks+=d.total_attacks??0,S.failed+=d.failed_attacks??0;return S}const zy=({id:s,charName:v,zIndex:S})=>{const[o,d]=R.useState(null),[x,T]=R.useState("session"),[A,b]=R.useState(null);R.useEffect(()=>{tl(`/combat-stats/${encodeURIComponent(v)}`).then(d).catch(()=>{});const C=setInterval(()=>{tl(`/combat-stats/${encodeURIComponent(v)}`).then(d).catch(()=>{})},1e4);return()=>clearInterval(C)},[v]);const y=o==null?void 0:o[x],q=(y==null?void 0:y.monsters)??{},H=Object.keys(q).filter(C=>C!=="__cloak_surges__").sort(),L=R.useMemo(()=>{let C={},Q={},et=0,J=0;const st=A?[q[A]].filter(Boolean):H.map(dt=>q[dt]);for(const dt of st)if(dt){for(const[mt,G]of Object.entries(dt.offense??{})){C[mt]||(C[mt]={});for(const[W,z]of Object.entries(G)){C[mt][W]||(C[mt][W]={total_attacks:0,failed_attacks:0,crits:0,total_normal_damage:0,max_normal_damage:0,total_crit_damage:0,max_crit_damage:0});const m=C[mt][W],U=z;m.total_attacks+=U.total_attacks??0,m.failed_attacks+=U.failed_attacks??0,m.crits+=U.crits??0,m.total_normal_damage+=U.total_normal_damage??0,m.max_normal_damage=Math.max(m.max_normal_damage,U.max_normal_damage??0),m.total_crit_damage+=U.total_crit_damage??0,m.max_crit_damage=Math.max(m.max_crit_damage,U.max_crit_damage??0)}}for(const[mt,G]of Object.entries(dt.defense??{})){Q[mt]||(Q[mt]={});for(const[W,z]of Object.entries(G)){Q[mt][W]||(Q[mt][W]={total_attacks:0,failed_attacks:0,crits:0,total_normal_damage:0,max_normal_damage:0,total_crit_damage:0,max_crit_damage:0});const m=Q[mt][W],U=z;m.total_attacks+=U.total_attacks??0,m.failed_attacks+=U.failed_attacks??0,m.total_normal_damage+=U.total_normal_damage??0,m.max_normal_damage=Math.max(m.max_normal_damage,U.max_normal_damage??0),m.total_crit_damage+=U.total_crit_damage??0,m.max_crit_damage=Math.max(m.max_crit_damage,U.max_crit_damage??0)}}et+=dt.aetheria_surges??0,J+=dt.cloak_surges??0}return q.__cloak_surges__&&!A&&(J+=q.__cloak_surges__.cloak_surges??0),{offense:C,defense:Q,aeth:et,cloak:J}},[q,H,A]),F=jy(L.offense),it=th(L.defense,"MeleeMissile"),tt=th(L.defense,"Magic");F.attacks>0&&((F.attacks-F.failed)/F.attacks*100).toFixed(0);const bt=it.attacks>0?(it.failed/it.attacks*100).toFixed(0):"0",I=tt.attacks>0?(tt.failed/tt.attacks*100).toFixed(0):"0",O=F.attacks-F.failed,w=O-F.crits,V=w>0?Math.round(F.normalDmg/w):0;F.crits>0&&Math.round(F.critDmg/F.crits);const K=O>0?(F.crits/O*100).toFixed(1):"0",X=C=>C===0?"":C.toLocaleString();return i.jsxs(le,{id:s,title:`Combat: ${v}`,zIndex:S,width:640,height:520,children:[i.jsxs("div",{style:{display:"flex",gap:4,padding:"4px 8px",borderBottom:"1px solid #333"},children:[i.jsx("button",{className:`ml-stats-range-btn ${x==="session"?"active":""}`,onClick:()=>T("session"),children:"Session"}),i.jsx("button",{className:`ml-stats-range-btn ${x==="lifetime"?"active":""}`,onClick:()=>T("lifetime"),children:"Lifetime"})]}),i.jsxs("div",{style:{display:"flex",flex:1,overflow:"hidden"},children:[i.jsxs("div",{style:{width:240,borderRight:"1px solid #333",overflowY:"auto",fontSize:"0.72rem"},children:[i.jsxs("div",{style:{display:"flex",padding:"3px 6px",borderBottom:"1px solid #333",color:"#777",fontSize:"0.65rem",fontWeight:600},children:[i.jsx("span",{style:{width:14}}),i.jsx("span",{style:{flex:1},children:"Monster"}),i.jsx("span",{style:{width:40,textAlign:"right"},children:"Kills"}),i.jsx("span",{style:{width:55,textAlign:"right"},children:"Dmg"})]}),i.jsxs("div",{style:{display:"flex",padding:"3px 6px",cursor:"pointer",background:A===null?"#2a3a4a":"",borderBottom:"1px solid #222",color:"#ddd"},onClick:()=>b(null),children:[i.jsx("span",{style:{width:14,color:"#888"},children:A===null?"*":""}),i.jsx("span",{style:{flex:1},children:"All"}),i.jsx("span",{style:{width:40,textAlign:"right"},children:X((y==null?void 0:y.total_kills)??0)}),i.jsx("span",{style:{width:55,textAlign:"right"},children:X((y==null?void 0:y.total_damage_given)??0)})]}),H.map(C=>{const Q=q[C];return i.jsxs("div",{style:{display:"flex",padding:"2px 6px",cursor:"pointer",background:A===C?"#2a3a4a":"",borderBottom:"1px solid #1a1a1a",color:"#ccc"},onClick:()=>b(C),children:[i.jsx("span",{style:{width:14,color:"#888"},children:A===C?"*":""}),i.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:C}),i.jsx("span",{style:{width:40,textAlign:"right"},children:X(Q.kill_count)}),i.jsx("span",{style:{width:55,textAlign:"right"},children:X(Q.damage_given)})]},C)})]}),i.jsx("div",{style:{flex:1,overflowY:"auto",padding:6,fontSize:"0.72rem"},children:i.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[i.jsx("thead",{children:i.jsxs("tr",{style:{color:"#777",fontSize:"0.65rem"},children:[i.jsx("th",{style:{textAlign:"left",padding:"1px 4px"}}),i.jsx("th",{style:{textAlign:"right",padding:"1px 3px"},children:"Given M/M"}),i.jsx("th",{style:{textAlign:"right",padding:"1px 3px"},children:"Given Mag"}),i.jsx("th",{style:{width:4}}),i.jsx("th",{style:{textAlign:"right",padding:"1px 3px"},children:"Recv M/M"}),i.jsx("th",{style:{textAlign:"right",padding:"1px 3px"},children:"Recv Mag"}),i.jsx("th",{style:{width:4}}),i.jsx("th",{style:{textAlign:"left",padding:"1px 3px"},children:"Stats"}),i.jsx("th",{style:{textAlign:"right",padding:"1px 3px"}})]})}),i.jsxs("tbody",{children:[Nn.map((C,Q)=>{const et=[["Evades",it.attacks>0?`${X(it.attacks)} (${bt}%)`:""],["Resists",tt.attacks>0?`${X(tt.attacks)} (${I}%)`:""],["A.Surges",L.aeth>0?`${X(L.aeth)}`:""],["C.Surges",L.cloak>0?`${X(L.cloak)}`:""],["",""],["",""],["Av/Mx",V>0?`${X(V)} / ${X(F.maxNormal)}`:""],["Crits",F.crits>0?`${X(F.crits)} (${K}%)`:""]][Q]??["",""];return i.jsxs("tr",{children:[i.jsx("td",{style:{padding:"1px 4px",color:"#888"},children:C}),i.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:X(Me(L.offense,"MeleeMissile",C))}),i.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:X(Me(L.offense,"Magic",C))}),i.jsx("td",{}),i.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:X(Me(L.defense,"MeleeMissile",C))}),i.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:X(Me(L.defense,"Magic",C))}),i.jsx("td",{}),i.jsx("td",{style:{padding:"1px 3px",color:"#777",fontWeight:600,fontSize:"0.65rem"},children:et[0]}),i.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:et[1]})]},C)}),i.jsx("tr",{children:i.jsx("td",{colSpan:9,style:{height:4}})}),i.jsxs("tr",{children:[i.jsx("td",{style:{padding:"1px 4px",color:"#888",fontWeight:600},children:"Total"}),i.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:X(Nn.reduce((C,Q)=>C+Me(L.offense,"MeleeMissile",Q),0))}),i.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:X(Nn.reduce((C,Q)=>C+Me(L.offense,"Magic",Q),0))}),i.jsx("td",{}),i.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:X(Nn.reduce((C,Q)=>C+Me(L.defense,"MeleeMissile",Q),0))}),i.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:X(Nn.reduce((C,Q)=>C+Me(L.defense,"Magic",Q),0))}),i.jsx("td",{}),i.jsx("td",{style:{padding:"1px 3px",color:"#777",fontWeight:600,fontSize:"0.65rem"},children:"Total"}),i.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:X(F.normalDmg+F.critDmg)})]})]})]})})]})]})},lh={plugin:{label:"Plugin",color:"#8844cc"},overlord:{label:"Overlord",color:"#4488cc"},nav:{label:"Nav",color:"#44aa44"},macro:{label:"Macro",color:"#cc8844"},other:{label:"Other",color:"#888888"}},Ba={padding:"3px 6px",fontSize:"0.8rem",border:"1px solid #555",background:"#2a2a2a",color:"#ddd",borderRadius:0},eh={...Ba,fontSize:"0.75rem"},Ms={padding:"4px 12px",background:"#4a80c0",color:"#fff",border:"1px solid #336699",cursor:"pointer",fontSize:"0.75rem"},Rn={padding:"3px 8px",background:"#444",color:"#ccc",border:"1px solid #555",cursor:"pointer",fontSize:"0.7rem"},Ey=({id:s,zIndex:v})=>{const[S,o]=R.useState([]),[d,x]=R.useState(""),[T,A]=R.useState(""),[b,y]=R.useState("plugin"),[q,H]=R.useState(null),[L,F]=R.useState(""),[it,tt]=R.useState(""),[bt,I]=R.useState(""),[O,w]=R.useState({}),V=R.useCallback(async()=>{try{const J=await tl("/issues");o((J.issues??[]).sort((st,dt)=>(st.resolved?1:0)-(dt.resolved?1:0)))}catch{}},[]);R.useEffect(()=>{V()},[V]);const K=async(J,st)=>{await fetch(`/api${J}`,{...st,credentials:"include",headers:{"Content-Type":"application/json",...st.headers}}),V()},X=async()=>{d.trim()&&(await K("/issues",{method:"POST",body:JSON.stringify({title:d.trim(),description:T.trim(),category:b})}),x(""),A(""))},C=J=>{if(q===J.id){H(null);return}H(J.id),F(J.title),tt(J.description||""),I(J.category||"other")},Q=async J=>{L.trim()&&(await K(`/issues/${J}`,{method:"PATCH",body:JSON.stringify({title:L.trim(),description:it.trim(),category:bt})}),H(null))},et=async J=>{const st=(O[J]||"").trim();st&&(await K(`/issues/${J}/comments`,{method:"POST",body:JSON.stringify({text:st})}),w(dt=>({...dt,[J]:""})))};return i.jsxs(le,{id:s,title:"Issues Board",zIndex:v,width:540,height:520,children:[i.jsxs("div",{style:{flex:1,overflowY:"auto",padding:6,fontSize:"0.8rem"},children:[S.length===0&&i.jsx("div",{style:{padding:10,color:"#888",textAlign:"center"},children:"No open issues"}),S.map(J=>{const st=lh[J.category]||lh.other,dt=J.created?new Date(J.created).toLocaleDateString("sv-SE"):"",mt=J.comments||[];return i.jsxs("div",{style:{padding:"6px 8px",marginBottom:4,background:"#1f1f1f",borderRadius:3,border:"1px solid #333",opacity:J.resolved?.55:1},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[i.jsx("span",{style:{fontSize:"0.65rem",padding:"1px 6px",borderRadius:3,background:st.color,color:"#fff",fontWeight:600},children:st.label}),i.jsx("strong",{style:{fontSize:"0.8rem",flex:1},children:J.title}),i.jsxs("span",{style:{fontSize:"0.65rem",color:"#888"},children:["by ",J.author||"User"]}),i.jsx("span",{style:{color:"#666",fontSize:"0.65rem"},children:dt})]}),J.description&&i.jsx("div",{style:{color:"#999",marginTop:3,fontSize:"0.75rem"},children:J.description}),i.jsxs("div",{style:{display:"flex",gap:4,marginTop:4},children:[J.resolved?i.jsxs(i.Fragment,{children:[i.jsx("button",{style:{...Rn,fontSize:"0.65rem"},onClick:()=>K(`/issues/${J.id}`,{method:"PATCH",body:JSON.stringify({resolved:!1})}),children:"↻ Reopen"}),i.jsx("button",{style:{...Rn,fontSize:"0.65rem",color:"#c66"},onClick:()=>{confirm(`Delete issue "${J.title}"?`)&&K(`/issues/${J.id}`,{method:"DELETE"})},children:"🗑 Delete"})]}):i.jsx("button",{style:{...Rn,fontSize:"0.65rem",background:"rgba(68,204,68,0.15)",color:"#4c4",border:"1px solid rgba(68,204,68,0.3)"},onClick:()=>K(`/issues/${J.id}`,{method:"PATCH",body:JSON.stringify({resolved:!0})}),children:"✓ Resolve"}),i.jsx("button",{style:{...Rn,fontSize:"0.65rem"},onClick:()=>C(J),children:"✎ Edit"})]}),q===J.id&&i.jsxs("div",{style:{marginTop:4,padding:4,background:"#222",borderRadius:3},children:[i.jsxs("div",{style:{display:"flex",gap:4,marginBottom:4},children:[i.jsx("input",{value:L,onChange:G=>F(G.target.value),style:{...Ba,flex:1}}),i.jsxs("select",{value:bt,onChange:G=>I(G.target.value),style:eh,children:[i.jsx("option",{value:"plugin",children:"Plugin"}),i.jsx("option",{value:"overlord",children:"Overlord"}),i.jsx("option",{value:"nav",children:"Nav"}),i.jsx("option",{value:"macro",children:"Macro"}),i.jsx("option",{value:"other",children:"Other"})]})]}),i.jsxs("div",{style:{display:"flex",gap:4},children:[i.jsx("textarea",{value:it,onChange:G=>tt(G.target.value),rows:2,style:{...Ba,flex:1,fontSize:"0.75rem",resize:"vertical"}}),i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[i.jsx("button",{style:{...Ms,fontSize:"0.7rem",padding:"3px 8px"},onClick:()=>Q(J.id),children:"Save"}),i.jsx("button",{style:{...Rn},onClick:()=>H(null),children:"Cancel"})]})]})]}),i.jsxs("div",{style:{marginTop:4,paddingTop:4,borderTop:"1px solid #2a2a2a"},children:[mt.length===0?i.jsx("div",{style:{color:"#555",fontSize:"0.7rem",padding:"2px 0"},children:"No comments yet"}):mt.map(G=>i.jsxs("div",{style:{marginBottom:3,fontSize:"0.72rem"},children:[i.jsx("span",{style:{color:"#8ac",fontWeight:500},children:G.author||"Anonymous"}),i.jsx("span",{style:{color:"#555",marginLeft:6,fontSize:"0.6rem"},children:G.created?new Date(G.created).toLocaleDateString("sv-SE"):""}),i.jsx("div",{style:{color:"#bbb",marginTop:1},children:G.text})]},G.id)),i.jsxs("div",{style:{display:"flex",gap:4,marginTop:3},children:[i.jsx("input",{value:O[J.id]||"",onChange:G=>w(W=>({...W,[J.id]:G.target.value})),placeholder:"Add a comment...",style:{...Ba,flex:1,fontSize:"0.75rem"},onKeyDown:G=>{G.key==="Enter"&&et(J.id)}}),i.jsx("button",{style:{...Ms,fontSize:"0.7rem",padding:"3px 8px"},onClick:()=>et(J.id),children:"Post"})]})]})]},J.id)})]}),i.jsxs("div",{style:{padding:6,borderTop:"1px solid #333"},children:[i.jsxs("div",{style:{display:"flex",gap:4,marginBottom:4},children:[i.jsx("input",{value:d,onChange:J=>x(J.target.value),placeholder:"Issue title...",style:{...Ba,flex:1},onKeyDown:J=>{J.key==="Enter"&&X()}}),i.jsxs("select",{value:b,onChange:J=>y(J.target.value),style:eh,children:[i.jsx("option",{value:"plugin",children:"Plugin"}),i.jsx("option",{value:"overlord",children:"Overlord"}),i.jsx("option",{value:"nav",children:"Nav"}),i.jsx("option",{value:"macro",children:"Macro"}),i.jsx("option",{value:"other",children:"Other"})]})]}),i.jsxs("div",{style:{display:"flex",gap:4},children:[i.jsx("textarea",{value:T,onChange:J=>A(J.target.value),placeholder:"Description (optional)...",rows:2,style:{...Ba,flex:1,fontSize:"0.75rem",resize:"vertical"}}),i.jsx("button",{style:{...Ms,alignSelf:"flex-end"},onClick:X,children:"Add"})]})]})]})},Ay=({id:s,zIndex:v})=>{const[S,o]=R.useState([]);R.useEffect(()=>{const x=async()=>{try{const A=await tl("/vital-sharing/peers");o(A.peers??[])}catch{}};x();const T=setInterval(x,5e3);return()=>clearInterval(T)},[]);const d=(x,T)=>T>0?Math.min(100,x/T*100):0;return i.jsx(le,{id:s,title:"Vital Sharing Network",zIndex:v,width:520,height:450,children:i.jsx("div",{style:{flex:1,overflowY:"auto",padding:6,fontSize:"0.75rem"},children:S.length===0?i.jsx("div",{style:{padding:16,color:"#666",textAlign:"center"},children:"No vital-sharing peers connected"}):S.map(x=>{var T,A,b;return i.jsxs("div",{style:{padding:"6px 8px",marginBottom:4,background:"#1f1f1f",borderRadius:3,border:"1px solid #333"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:3},children:[i.jsx("span",{style:{color:x.plugin_connected?"#4c4":"#a33",fontSize:"0.8rem"},children:"●"}),i.jsx("strong",{style:{flex:1},children:x.character_name}),x.subscribed&&i.jsx("span",{style:{color:"#6bf",fontSize:"0.65rem"},children:"[subscribed]"})]}),i.jsxs("div",{style:{color:"#666",fontSize:"0.68rem",marginBottom:3},children:["tags: ",((T=x.tags)==null?void 0:T.join(", "))||"none"]}),x.vitals&&x.vitals.max_health>0&&i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[{label:"HP",cur:x.vitals.current_health,max:x.vitals.max_health,bg:"#330000",fill:"#c44"},{label:"STA",cur:x.vitals.current_stamina,max:x.vitals.max_stamina,bg:"#331a00",fill:"#ca0"},{label:"MANA",cur:x.vitals.current_mana,max:x.vitals.max_mana,bg:"#001433",fill:"#48f"}].map(y=>i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[i.jsx("span",{style:{width:32,color:"#888",fontSize:"0.65rem"},children:y.label}),i.jsx("div",{style:{flex:1,height:6,background:y.bg,borderRadius:3,overflow:"hidden"},children:i.jsx("div",{style:{width:`${d(y.cur,y.max)}%`,height:"100%",background:y.fill,borderRadius:3}})}),i.jsxs("span",{style:{width:60,textAlign:"right",fontSize:"0.65rem",color:"#888"},children:[y.cur,"/",y.max]})]},y.label))}),x.position&&i.jsxs("div",{style:{color:"#555",fontSize:"0.65rem",marginTop:2},children:[(A=x.position.ns)==null?void 0:A.toFixed(1),"N, ",(b=x.position.ew)==null?void 0:b.toFixed(1),"E"]})]},x.character_name)})})})},Ty=({characters:s,chatMessages:v,nearbyObjects:S,socket:o})=>{const{windows:d}=ti();return i.jsx(i.Fragment,{children:d.map(x=>{var b;const T=x.charName??"";switch(x.id.split("-")[0]){case"chat":return i.jsx(iy,{id:x.id,charName:T,zIndex:x.zIndex,messages:v.get(T)??[],socket:o},x.id);case"stats":return i.jsx(fy,{id:x.id,charName:T,zIndex:x.zIndex},x.id);case"char":return i.jsx(dy,{id:x.id,charName:T,zIndex:x.zIndex,vitals:((b=s.get(T))==null?void 0:b.vitals)??void 0},x.id);case"inv":return i.jsx(xy,{id:x.id,charName:T,zIndex:x.zIndex},x.id);case"radar":return i.jsx(_y,{id:x.id,charName:T,zIndex:x.zIndex,socket:o,radarData:S.get(T)??null},x.id);case"combat":return i.jsx(zy,{id:x.id,charName:T,zIndex:x.zIndex},x.id);case"issues":return i.jsx(Ey,{id:x.id,zIndex:x.zIndex},x.id);case"vitalsharing":return i.jsx(Ay,{id:x.id,zIndex:x.zIndex},x.id);default:return null}})})};let My=0;const Oy=({recentRares:s})=>{const[v,S]=R.useState([]),[o,d]=R.useState(0),[x,T]=R.useState([]);R.useEffect(()=>{if(s.length>o&&o>0){const b=s.slice(0,s.length-o);for(const y of b){const q=++My;S(H=>[...H,{key:q,charName:y.character_name,rareName:y.name,exiting:!1}]),A(),setTimeout(()=>{S(H=>H.map(L=>L.key===q?{...L,exiting:!0}:L)),setTimeout(()=>{S(H=>H.filter(L=>L.key!==q))},500)},6e3)}}d(s.length)},[s.length]);const A=R.useCallback(()=>{const b=Date.now(),y=["#FFD700","#FF4444","#FF8800","#AA44FF","#4488FF"],q=Array.from({length:30},(H,L)=>{const F=Math.PI*2*L/30+(Math.random()-.5)*.5,it=100+Math.random()*200;return{dx:Math.cos(F)*it,dy:Math.sin(F)*it-50,color:y[Math.floor(Math.random()*y.length)]}});T(H=>[...H,{id:b,particles:q}]),setTimeout(()=>T(H=>H.filter(L=>L.id!==b)),2200)},[]);return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"ml-rare-notifications",children:v.map(b=>i.jsxs("div",{className:`ml-rare-notif ${b.exiting?"exiting":""}`,children:[i.jsx("div",{className:"ml-rare-notif-title",children:"LEGENDARY RARE!"}),i.jsx("div",{className:"ml-rare-notif-name",children:b.rareName}),i.jsx("div",{className:"ml-rare-notif-by",children:"found by"}),i.jsx("div",{className:"ml-rare-notif-char",children:b.charName})]},b.key))}),i.jsx("div",{className:"ml-fireworks",children:x.map(b=>i.jsx(Pu.Fragment,{children:b.particles.map((y,q)=>i.jsx("div",{className:"ml-firework-particle",style:{left:"50%",top:"30%",backgroundColor:y.color,"--dx":`${y.dx}px`,"--dy":`${y.dy+200}px`}},q))},b.id))})]})},ah=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf","#ff4444","#44ff44","#4444ff","#ffff44","#ff44ff","#44ffff","#ff8844","#88ff44","#4488ff","#ff4488","#cc3333","#33cc33","#3333cc","#cccc33","#cc33cc","#33cccc","#cc6633","#66cc33","#3366cc","#cc3366","#ff6666","#66ff66","#6666ff","#ffff66","#ff66ff","#66ffff","#ffaa66","#aaff66","#66aaff","#ff66aa","#990099","#009900","#000099","#990000","#009999","#999900","#aa5500","#55aa00","#0055aa","#aa0055","#ffaaaa","#aaffaa","#aaaaff","#ffffaa","#ffaaff","#aaffff","#ffccaa","#ccffaa","#aaccff","#ffaacc"];function Cy(s){let v=0;for(let S=0;S{let d=s.current.get(o);return d||(d=v.current{const S=Ny(),[o,d]=R.useState(!1),[x,T]=R.useState(!1),A=R.useMemo(()=>Array.from(s.characters.values()).filter(q=>q.telemetry).map(q=>q.telemetry),[s.characters]),b=R.useMemo(()=>new Map(Array.from(s.characters.values()).filter(q=>q.vitals).map(q=>[q.name,q.vitals])),[s.characters]),y=R.useCallback(q=>{},[]);return i.jsx(V0,{children:i.jsxs("div",{className:"ml-layout",children:[i.jsx(ny,{players:A,vitals:b,serverHealth:s.serverHealth,totalRares:s.totalRares,totalKills:s.totalKills,getColor:S,onSelectPlayer:y,onViewToggle:v,showHeatmap:o,showPortals:x,onToggleHeatmap:d,onTogglePortals:T}),i.jsx(P0,{players:A,getColor:S,onSelectPlayer:y,showHeatmap:o,showPortals:x}),i.jsx(Ty,{characters:s.characters,chatMessages:s.chatMessages,nearbyObjects:s.nearbyObjects,socket:s.socketRef.current}),i.jsx(Oy,{recentRares:s.recentRares})]})})};function Dy(s){const v=R.useRef(null),S=R.useRef(0),o=R.useRef(s);o.current=s;const d=R.useCallback(()=>{var T;if(((T=v.current)==null?void 0:T.readyState)===WebSocket.OPEN)return;const x=new WebSocket(J0());v.current=x,x.addEventListener("message",A=>{try{const b=JSON.parse(A.data);o.current(b)}catch{}}),x.addEventListener("close",()=>{v.current=null,S.current=window.setTimeout(d,2e3)}),x.addEventListener("error",()=>{x.close()})},[]);return R.useEffect(()=>(d(),()=>{var x;clearTimeout(S.current),(x=v.current)==null||x.close(),v.current=null}),[d]),v}const Uy=()=>tl("/live"),By=()=>tl("/combat-stats"),Hy=()=>tl("/server-health"),Yy=()=>tl("/total-rares"),qy=()=>tl("/total-kills");function Xy(){const[s,v]=R.useState(new Map),[S,o]=R.useState(null),[d,x]=R.useState(0),[T,A]=R.useState(0),[b,y]=R.useState([]),[q,H]=R.useState(new Map),[L,F]=R.useState(new Map),it=R.useRef(s);it.current=s;const tt=R.useCallback((O,w)=>{v(V=>{const K=new Map(V),X=K.get(O)??{name:O,telemetry:null,vitals:null,combat:null,lastUpdate:0};return K.set(O,w(X)),K})},[]),bt=R.useCallback(O=>{if(O.type){if(O.type==="telemetry"){const w=O;tt(w.character_name,V=>({...V,telemetry:w,lastUpdate:Date.now()}))}else if(O.type==="vitals"){const w=O;tt(w.character_name,V=>({...V,vitals:w,lastUpdate:Date.now()}))}else if(O.type==="combat_stats"){const w=O;tt(w.character_name,V=>({...V,combat:w,lastUpdate:Date.now()}))}else if(O.type==="rare"){const w=O;y(V=>[w,...V].slice(0,50))}else if(O.type==="nearby_objects"){const w=O;F(V=>{const K=new Map(V);return K.set(w.character_name,w),K})}else if(O.type==="chat"){const w=O;H(V=>{const K=new Map(V),X=[...K.get(w.character_name)??[],{text:w.text,color:w.color,timestamp:w.timestamp}];return X.length>1e3&&X.splice(0,X.length-1e3),K.set(w.character_name,X),K})}}},[tt]),I=Dy(bt);return R.useEffect(()=>{const O=async()=>{try{const V=await Uy();v(K=>{var C;const X=new Map(K);for(const Q of V.players??[]){const et=X.get(Q.character_name);X.set(Q.character_name,{name:Q.character_name,telemetry:Q,vitals:(et==null?void 0:et.vitals)??null,combat:(et==null?void 0:et.combat)??null,lastUpdate:Date.now()})}for(const Q of X.keys())(C=V.players)!=null&&C.some(et=>et.character_name===Q)||X.delete(Q);return X})}catch{}};O();const w=setInterval(O,5e3);return()=>clearInterval(w)},[]),R.useEffect(()=>{const O=async()=>{try{const V=await By();for(const K of V.stats??[])tt(K.character_name,X=>({...X,combat:{...K,type:"combat_stats"}}))}catch{}};O();const w=setInterval(O,3e4);return()=>clearInterval(w)},[tt]),R.useEffect(()=>{const O=async()=>{try{o(await Hy())}catch{}};O();const w=setInterval(O,3e4);return()=>clearInterval(w)},[]),R.useEffect(()=>{const O=async()=>{try{const[V,K]=await Promise.all([Yy(),qy()]);x(V.all_time??0),A(K.total??0)}catch{}};O();const w=setInterval(O,3e5);return()=>clearInterval(w)},[]),{characters:s,serverHealth:S,totalRares:d,totalKills:T,recentRares:b,chatMessages:q,nearbyObjects:L,socketRef:I}}const Ly=R.lazy(()=>w0(()=>import("./DashboardView-BlHbVNi9.js"),[]));function Gy(){const[s,v]=R.useState(()=>localStorage.getItem("v2-view")||"map"),S=Xy(),o=()=>{const d=s==="map"?"dashboard":"map";v(d),localStorage.setItem("v2-view",d)};return s==="map"?i.jsx(Ry,{data:S,onViewToggle:o}):i.jsx(R.Suspense,{fallback:i.jsx("div",{style:{background:"#0d0d0d",color:"#888",padding:40,textAlign:"center"},children:"Loading dashboard..."}),children:i.jsx(Ly,{data:S,onViewToggle:o})})}G0.createRoot(document.getElementById("root")).render(i.jsx(R.StrictMode,{children:i.jsx(Gy,{})}));export{Pu as R,tl as a,Qy as c,N0 as g,i as j,R as r}; diff --git a/static/v2/assets/index-DrsM2PEe.css b/static/v2/assets/index-t3L0RG9a.css similarity index 58% rename from static/v2/assets/index-DrsM2PEe.css rename to static/v2/assets/index-t3L0RG9a.css index a2913733..ac9b2a5d 100644 --- a/static/v2/assets/index-DrsM2PEe.css +++ b/static/v2/assets/index-t3L0RG9a.css @@ -1 +1 @@ -*,*:before,*:after{box-sizing:border-box;margin:0;padding:0}:root{--bg-body: #0d0d0d;--bg-card: #1a1a1a;--bg-card-hover: #222;--bg-header: #111;--border: #333;--text: #ddd;--text-muted: #888;--text-dim: #555;--accent: #4488ff;--hp: linear-gradient(90deg, #ff4444, #ff6666);--hp-bg: #330000;--sta: linear-gradient(90deg, #ffaa00, #ffcc44);--sta-bg: #331a00;--mana: linear-gradient(90deg, #4488ff, #66aaff);--mana-bg: #001433;--badge-combat: #44cc44;--badge-nav: #ffaa00;--badge-idle: #666;--radius: 6px}body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;background:var(--bg-body);color:var(--text);line-height:1.4;min-height:100vh}.dashboard{display:flex;flex-direction:column;min-height:100vh}.dashboard-header{background:var(--bg-header);border-bottom:1px solid var(--border);padding:12px 24px;display:flex;align-items:center;justify-content:space-between;position:sticky;top:0;z-index:100}.dashboard-title{font-size:1.2rem;font-weight:600;color:var(--accent)}.dashboard-nav{display:flex;gap:16px}.nav-link{color:var(--text-muted);text-decoration:none;font-size:.85rem;transition:color .2s}.nav-link:hover{color:var(--text)}.dashboard-main{flex:1;padding:16px 24px;max-width:1600px;margin:0 auto;width:100%}.global-stats{display:flex;gap:24px;padding:12px 0;margin-bottom:16px;border-bottom:1px solid var(--border);flex-wrap:wrap}.global-stat{display:flex;align-items:center;gap:6px}.global-value{font-size:1.1rem;font-weight:600;color:var(--text)}.global-label{font-size:.75rem;color:var(--text-muted)}.server-dot{width:8px;height:8px;border-radius:50%;display:inline-block}.server-dot.online{background:#4c4}.server-dot.offline{background:#c44}.char-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:12px}.grid-empty{text-align:center;color:var(--text-muted);padding:48px;font-size:1rem}.char-card{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);padding:12px 14px;cursor:pointer;transition:background .15s,border-color .15s}.char-card:hover{background:var(--bg-card-hover);border-color:#444}.char-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}.char-name{font-size:.9rem;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.char-badge{font-size:.65rem;font-weight:700;text-transform:uppercase;padding:2px 8px;border-radius:3px;letter-spacing:.5px}.badge-combat{background:#4c43;color:var(--badge-combat)}.badge-nav{background:#fa03;color:var(--badge-nav)}.badge-idle{background:#64646433;color:var(--badge-idle)}.char-vitals{display:flex;flex-direction:column;gap:3px;margin-bottom:8px}.char-vitals-placeholder{font-size:.75rem;color:var(--text-dim);margin-bottom:8px;font-style:italic}.vital-bar{display:flex;align-items:center;gap:6px}.vital-label{font-size:.65rem;color:var(--text-muted);width:20px;text-align:right}.vital-track{flex:1;height:6px;border-radius:3px;overflow:hidden}.vital-fill{height:100%;border-radius:3px;transition:width .3s ease-out}.vital-text{font-size:.65rem;color:var(--text-muted);width:65px;text-align:right;font-variant-numeric:tabular-nums}.char-stats-row{display:flex;gap:12px;margin-bottom:4px}.stat{display:flex;flex-direction:column;align-items:center}.stat-value{font-size:.85rem;font-weight:600;font-variant-numeric:tabular-nums}.stat-label{font-size:.6rem;color:var(--text-muted);text-transform:uppercase;letter-spacing:.3px}.char-location{font-size:.7rem;color:var(--text-dim);text-align:right}.char-expanded{margin-top:8px;padding-top:8px;border-top:1px solid var(--border)}.expanded-row{display:flex;justify-content:space-between;font-size:.75rem;color:var(--text-muted);margin-bottom:2px}.vitae-warn{color:#f66;font-size:.8rem;font-weight:600;margin-bottom:4px}.tab-container{margin-top:24px;border-top:1px solid var(--border);padding-top:16px}.tab-bar{display:flex;gap:4px;margin-bottom:16px;overflow-x:auto;-webkit-overflow-scrolling:touch}.tab-btn{padding:8px 20px;font-size:.85rem;background:var(--bg-card);color:var(--text-muted);border:1px solid var(--border);border-radius:var(--radius) var(--radius) 0 0;cursor:pointer;transition:background .15s,color .15s;white-space:nowrap}.tab-btn:hover{background:var(--bg-card-hover);color:var(--text)}.tab-btn.active{background:var(--bg-card-hover);color:var(--accent);border-bottom-color:var(--bg-body)}.tab-content{min-height:300px}.chart-section{margin-bottom:24px}.chart-title{font-size:.9rem;font-weight:600;color:var(--text);margin-bottom:12px}.rares-summary{display:flex;gap:16px;margin-bottom:20px;flex-wrap:wrap}.rare-stat-card{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);padding:12px 20px;display:flex;flex-direction:column;align-items:center;min-width:140px}.rare-stat-value{font-size:1.3rem;font-weight:700;color:#fc0}.rare-stat-label{font-size:.7rem;color:var(--text-muted);margin-top:4px}.rare-timeline{max-height:200px;overflow-y:auto}.rare-event{display:flex;gap:12px;padding:4px 0;border-bottom:1px solid #222;font-size:.8rem}.rare-time{color:var(--text-dim);width:80px}.rare-char{color:var(--text-muted);width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rare-name{color:#fc0;font-weight:600}.map-tab{display:flex;flex-direction:column;align-items:center}.map-container{position:relative;width:100%;max-width:800px;aspect-ratio:1}.map-image{width:100%;height:100%;object-fit:contain;display:block}.map-overlay{position:absolute;top:0;left:0;width:100%;height:100%}.map-legend{display:flex;gap:16px;align-items:center;margin-top:8px;font-size:.75rem;color:var(--text-muted)}.legend-dot{display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:4px}.legend-dot.hunting{background:#4c4}.legend-dot.other{background:#fa0}.map-count{margin-left:auto}.inventory-tab{width:100%}.search-bar{display:flex;align-items:center;gap:8px;margin-bottom:8px}.search-input{flex:1;padding:8px 12px;font-size:.9rem;background:var(--bg-card);color:var(--text);border:1px solid var(--border);border-radius:var(--radius);outline:none}.search-input:focus{border-color:var(--accent)}.search-spinner{font-size:.75rem;color:var(--text-muted)}.search-count{font-size:.75rem;color:var(--text-muted);margin-bottom:8px}.search-empty{text-align:center;color:var(--text-dim);padding:24px}.results-table{width:100%;border-collapse:collapse;font-size:.8rem}.results-table th{text-align:left;padding:6px 8px;border-bottom:1px solid var(--border);color:var(--text-muted);font-weight:600;font-size:.72rem;text-transform:uppercase;letter-spacing:.3px}.results-table td{padding:4px 8px;border-bottom:1px solid #1a1a1a;color:var(--text)}.results-table tr:hover td{background:var(--bg-card-hover)}.item-name{font-weight:500}@media(max-width:768px){.dashboard-header{flex-direction:column;gap:8px;padding:10px 16px}.dashboard-main{padding:12px}.global-stats{gap:16px}.char-grid{grid-template-columns:1fr}.char-stats-row{gap:8px}}@media(max-width:480px){.dashboard-nav{gap:10px;font-size:.8rem}.char-card{padding:10px}}.ml-layout{display:flex;height:100vh;overflow:hidden;background:#111;color:#eee;font-family:Segoe UI,sans-serif}.ml-sidebar{width:400px;min-width:400px;background:#1a1a1a;border-right:2px solid #333;display:flex;flex-direction:column;overflow-y:auto;padding:12px 14px}.ml-sidebar-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px}.ml-sidebar-title{font-size:.85rem;font-weight:600;color:#88f}.ml-view-toggle{font-size:.7rem;padding:3px 10px;background:#333;color:#aaa;border:1px solid #555;border-radius:3px;cursor:pointer}.ml-view-toggle:hover{background:#444;color:#fff}.ml-server-status{display:flex;align-items:center;gap:6px;padding:4px 0 8px;font-size:.75rem;color:#aaa}.ml-status-dot{width:8px;height:8px;border-radius:50%}.ml-status-dot.online{background:#4c4;animation:ml-pulse 2s ease-in-out infinite}.ml-status-dot.offline{background:#c44}.ml-status-detail{color:#888;font-size:.7rem}.ml-status-latency{margin-left:auto;color:#888}.ml-tool-links{display:flex;flex-wrap:wrap;gap:4px;margin-bottom:8px}.ml-tool-link{font-size:.68rem;color:#8ac;text-decoration:none;padding:2px 6px;background:#4488ff14;border:1px solid rgba(68,136,255,.15);border-radius:3px;transition:all .15s}.ml-tool-link:hover{background:#4488ff2e;color:#adf}@keyframes ml-pulse{0%,to{opacity:1}50%{opacity:.4}}.ml-counters{display:flex;gap:6px;margin-bottom:10px}.ml-counter{flex:1;text-align:center;padding:6px 4px;border-radius:4px;background:#222;border:1px solid #333}.ml-counter-val{display:block;font-size:1rem;font-weight:700;font-variant-numeric:tabular-nums}.ml-counter-lbl{display:block;font-size:.6rem;color:#888;text-transform:uppercase;letter-spacing:.3px}.ml-counter.rares .ml-counter-val{color:#fc0}.ml-counter.kph .ml-counter-val{color:#4af}.ml-counter.kph{border-color:#234;animation:ml-kph-glow 3s ease-in-out infinite}.ml-counter.kph.ultra{background:linear-gradient(135deg,#112,#221);animation:ml-kph-glow 1.5s ease-in-out infinite}.ml-counter.kills .ml-counter-val{color:#f66}@keyframes ml-kph-glow{0%,to{box-shadow:0 0 4px #4af3}50%{box-shadow:0 0 12px #44aaff80}}.ml-sort-buttons{display:flex;gap:2px;margin:8px 0}.ml-sort-btn{flex:1;padding:4px 0;font-size:.65rem;font-weight:600;background:#2a2a2a;color:#888;border:1px solid #444;border-radius:3px;cursor:pointer;text-transform:uppercase;letter-spacing:.3px}.ml-sort-btn:hover{background:#333;color:#ccc}.ml-sort-btn.active{background:#334;color:#88f;border-color:#88f}.ml-filter{width:100%;padding:5px 8px;font-size:.78rem;background:#222;color:#eee;border:1px solid #444;border-radius:3px;outline:none;margin-bottom:8px;box-sizing:border-box}.ml-filter:focus{border-color:#88f}.ml-filter::placeholder{color:#666}.ml-player-list{list-style:none;margin:0;padding:0;flex:1;overflow-y:auto}.ml-player-row{padding:6px 8px;border-bottom:1px solid #2a2a2a;border-left:3px solid transparent;cursor:pointer;transition:background .1s}.ml-player-row:hover{background:#252525}.ml-pr-name{font-size:.82rem;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ml-pr-coords{font-size:.65rem;color:#888;margin-bottom:3px}.ml-pr-vitals{display:flex;gap:3px;margin-bottom:4px}.ml-vital-bar{flex:1;height:4px;border-radius:2px;overflow:hidden}.ml-vital-bar.hp{background:#300}.ml-vital-bar.sta{background:#331a00}.ml-vital-bar.mana{background:#001433}.ml-vital-bar.hp .ml-vital-fill{background:linear-gradient(90deg,#f44,#f66)}.ml-vital-bar.sta .ml-vital-fill{background:linear-gradient(90deg,#fa0,#fc4)}.ml-vital-bar.mana .ml-vital-fill{background:linear-gradient(90deg,#48f,#6af)}.ml-vital-fill{height:100%;border-radius:2px;transition:width .3s ease-out}.ml-pr-header{display:flex;justify-content:space-between;align-items:baseline;cursor:pointer}.ml-pr-grid{display:grid;grid-template-columns:1fr 1fr 1fr;gap:1px 8px;font-size:.68rem;color:#aaa;margin-bottom:4px}.ml-gs{font-variant-numeric:tabular-nums;display:inline-flex;align-items:center;gap:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ml-suffix{font-size:.58rem;color:#666;text-transform:uppercase;letter-spacing:.3px}.ml-taper-icon{width:14px;height:14px;margin-right:2px;vertical-align:text-bottom}.ml-meta-pill{font-size:.6rem;padding:0 6px;border-radius:3px;background:#333;color:#888;text-align:center;justify-self:end}.ml-pr-buttons{display:flex;gap:3px;margin-top:4px}.ml-btn{padding:2px 8px;font-size:.63rem;font-weight:500;border:1px solid #3a3a3a;border-radius:4px;background:#2a2a2a;color:#999;cursor:pointer;white-space:nowrap;transition:all .15s;letter-spacing:.2px}.ml-btn:hover{background:#383838;color:#ddd;border-color:#555}.ml-btn.accent{background:#4488ff1f;color:#6aadff;border-color:#4488ff4d}.ml-btn.accent:hover{background:#4488ff38;color:#8ec5ff;border-color:#4488ff80}.ml-meta-pill.active{background:#44cc4426;color:#4c4}.ml-map-container{flex:1;position:relative;overflow:hidden;background:#000;cursor:grab}.ml-map-container:active{cursor:grabbing}.ml-map-group{position:absolute;top:0;left:0;transform-origin:0 0}.ml-map-img{display:block;-webkit-user-select:none;user-select:none;-webkit-user-drag:none}.ml-dots-layer{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.ml-dot{position:absolute;width:6px;height:6px;border-radius:50%;transform:translate(-50%,-50%);border:1px solid rgba(0,0,0,.5);pointer-events:all;cursor:pointer;z-index:5}.ml-dot:hover{width:10px;height:10px;z-index:10}.ml-tooltip{position:absolute;background:#001e3ceb;color:#eee;padding:6px 10px;border-radius:4px;font-size:.75rem;pointer-events:none;z-index:1000;white-space:nowrap;border:1px solid #335}.ml-coords{position:absolute;bottom:8px;left:8px;background:#003264d9;color:#eee;padding:4px 10px;border-radius:4px;font-size:.75rem;pointer-events:none;z-index:100;font-variant-numeric:tabular-nums}.ml-toggles{display:flex;gap:12px;margin-bottom:8px;font-size:.72rem}.ml-toggle-label{display:flex;align-items:center;gap:4px;color:#aaa;cursor:pointer}.ml-toggle-label input{accent-color:#4488ff}.ml-trails-svg{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.ml-heatmap-canvas{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;opacity:.8}.ml-portals-layer{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.ml-portal-icon{position:absolute;width:6px;height:6px;transform:translate(-50%,-50%);pointer-events:all;cursor:help}.ml-portal-icon:before{content:"🌀";font-size:10px;position:absolute;transform:translate(-50%,-50%)}.ml-window{position:fixed;background:#1a1a1a;border:1px solid #444;border-radius:6px;display:flex;flex-direction:column;overflow:hidden;box-shadow:0 8px 32px #00000080}.ml-window-header{display:flex;justify-content:space-between;align-items:center;padding:6px 12px;background:linear-gradient(135deg,#2a3a5a,#1a2a40);cursor:move;-webkit-user-select:none;user-select:none;border-bottom:1px solid #334}.ml-window-title{font-size:.8rem;font-weight:600;color:#acf}.ml-window-close{background:none;border:none;color:#888;font-size:1.1rem;cursor:pointer;line-height:1;padding:0 4px}.ml-window-close:hover{color:#f66}.ml-window-content{flex:1;overflow:auto;display:flex;flex-direction:column}.ml-stats-controls{display:flex;gap:4px;padding:6px 10px;border-bottom:1px solid #333}.ml-stats-range-btn{padding:3px 10px;font-size:.7rem;background:#2a2a2a;color:#888;border:1px solid #444;border-radius:3px;cursor:pointer}.ml-stats-range-btn.active{background:#4488ff26;color:#6aadff;border-color:#4488ff4d}.ml-stats-grid{display:grid;grid-template-columns:1fr 1fr;gap:4px;padding:4px;flex:1}.ml-stats-panel{min-height:200px;background:#fff;border-radius:3px;overflow:hidden}.ml-stats-panel iframe{border:none}.ml-chat-messages{flex:1;overflow-y:auto;padding:6px 10px;font-size:.75rem;font-family:Consolas,Courier New,monospace;line-height:1.4}.ml-chat-line{word-break:break-word}.ml-chat-form{display:flex;border-top:1px solid #333;padding:4px}.ml-chat-input{flex:1;background:#222;color:#eee;border:1px solid #444;border-radius:3px;padding:4px 8px;font-size:.78rem;outline:none}.ml-chat-input:focus{border-color:#48f}.ml-chat-input::placeholder{color:#666}.ml-rare-notifications{position:fixed;top:20px;left:50%;transform:translate(-50%);z-index:99999;display:flex;flex-direction:column;gap:8px;pointer-events:none}.ml-rare-notif{background:linear-gradient(135deg,#1a0a2e,#2a1040);border:2px solid #ffcc00;border-radius:8px;padding:16px 32px;text-align:center;animation:ml-notif-in .5s ease-out;box-shadow:0 0 40px #ffcc004d}.ml-rare-notif.exiting{animation:ml-notif-out .5s ease-in forwards}.ml-rare-notif-title{font-size:1.4rem;font-weight:800;color:#fc0;text-shadow:0 0 20px rgba(255,204,0,.5);margin-bottom:4px}.ml-rare-notif-name{font-size:1.1rem;font-weight:600;color:#fff;margin-bottom:4px}.ml-rare-notif-by{font-size:.75rem;color:#888}.ml-rare-notif-char{font-size:1rem;font-weight:700;color:#fc0}@keyframes ml-notif-in{0%{transform:translateY(-40px);opacity:0}to{transform:translateY(0);opacity:1}}@keyframes ml-notif-out{to{transform:translateY(-60px);opacity:0}}.ml-fireworks{position:fixed;top:0;left:0;width:100%;height:100%;pointer-events:none;z-index:99998}.ml-firework-particle{position:absolute;width:6px;height:6px;border-radius:50%;animation:ml-particle 2s cubic-bezier(.25,.46,.45,.94) forwards}@keyframes ml-particle{0%{transform:translate(0) scale(1);opacity:1}to{transform:translate(var(--dx),var(--dy)) scale(0);opacity:0}}@media(max-width:768px){.ml-layout{flex-direction:column}.ml-sidebar{width:100%;min-width:100%;max-height:40vh;border-right:none;border-bottom:2px solid #333}.ml-map-container{min-height:60vh}} +*,*:before,*:after{box-sizing:border-box;margin:0;padding:0}:root{--bg-body: #0d0d0d;--bg-card: #1a1a1a;--bg-card-hover: #222;--bg-header: #111;--border: #333;--text: #ddd;--text-muted: #888;--text-dim: #555;--accent: #4488ff;--hp: linear-gradient(90deg, #ff4444, #ff6666);--hp-bg: #330000;--sta: linear-gradient(90deg, #ffaa00, #ffcc44);--sta-bg: #331a00;--mana: linear-gradient(90deg, #4488ff, #66aaff);--mana-bg: #001433;--badge-combat: #44cc44;--badge-nav: #ffaa00;--badge-idle: #666;--radius: 6px}body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;background:var(--bg-body);color:var(--text);line-height:1.4;min-height:100vh}.dashboard{display:flex;flex-direction:column;min-height:100vh}.dashboard-header{background:var(--bg-header);border-bottom:1px solid var(--border);padding:12px 24px;display:flex;align-items:center;justify-content:space-between;position:sticky;top:0;z-index:100}.dashboard-title{font-size:1.2rem;font-weight:600;color:var(--accent)}.dashboard-nav{display:flex;gap:16px}.nav-link{color:var(--text-muted);text-decoration:none;font-size:.85rem;transition:color .2s}.nav-link:hover{color:var(--text)}.dashboard-main{flex:1;padding:16px 24px;max-width:1600px;margin:0 auto;width:100%}.global-stats{display:flex;gap:24px;padding:12px 0;margin-bottom:16px;border-bottom:1px solid var(--border);flex-wrap:wrap}.global-stat{display:flex;align-items:center;gap:6px}.global-value{font-size:1.1rem;font-weight:600;color:var(--text)}.global-label{font-size:.75rem;color:var(--text-muted)}.server-dot{width:8px;height:8px;border-radius:50%;display:inline-block}.server-dot.online{background:#4c4}.server-dot.offline{background:#c44}.char-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:12px}.grid-empty{text-align:center;color:var(--text-muted);padding:48px;font-size:1rem}.char-card{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);padding:12px 14px;cursor:pointer;transition:background .15s,border-color .15s}.char-card:hover{background:var(--bg-card-hover);border-color:#444}.char-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}.char-name{font-size:.9rem;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.char-badge{font-size:.65rem;font-weight:700;text-transform:uppercase;padding:2px 8px;border-radius:3px;letter-spacing:.5px}.badge-combat{background:#4c43;color:var(--badge-combat)}.badge-nav{background:#fa03;color:var(--badge-nav)}.badge-idle{background:#64646433;color:var(--badge-idle)}.char-vitals{display:flex;flex-direction:column;gap:3px;margin-bottom:8px}.char-vitals-placeholder{font-size:.75rem;color:var(--text-dim);margin-bottom:8px;font-style:italic}.vital-bar{display:flex;align-items:center;gap:6px}.vital-label{font-size:.65rem;color:var(--text-muted);width:20px;text-align:right}.vital-track{flex:1;height:6px;border-radius:3px;overflow:hidden}.vital-fill{height:100%;border-radius:3px;transition:width .3s ease-out}.vital-text{font-size:.65rem;color:var(--text-muted);width:65px;text-align:right;font-variant-numeric:tabular-nums}.char-stats-row{display:flex;gap:12px;margin-bottom:4px}.stat{display:flex;flex-direction:column;align-items:center}.stat-value{font-size:.85rem;font-weight:600;font-variant-numeric:tabular-nums}.stat-label{font-size:.6rem;color:var(--text-muted);text-transform:uppercase;letter-spacing:.3px}.char-location{font-size:.7rem;color:var(--text-dim);text-align:right}.char-expanded{margin-top:8px;padding-top:8px;border-top:1px solid var(--border)}.expanded-row{display:flex;justify-content:space-between;font-size:.75rem;color:var(--text-muted);margin-bottom:2px}.vitae-warn{color:#f66;font-size:.8rem;font-weight:600;margin-bottom:4px}.tab-container{margin-top:24px;border-top:1px solid var(--border);padding-top:16px}.tab-bar{display:flex;gap:4px;margin-bottom:16px;overflow-x:auto;-webkit-overflow-scrolling:touch}.tab-btn{padding:8px 20px;font-size:.85rem;background:var(--bg-card);color:var(--text-muted);border:1px solid var(--border);border-radius:var(--radius) var(--radius) 0 0;cursor:pointer;transition:background .15s,color .15s;white-space:nowrap}.tab-btn:hover{background:var(--bg-card-hover);color:var(--text)}.tab-btn.active{background:var(--bg-card-hover);color:var(--accent);border-bottom-color:var(--bg-body)}.tab-content{min-height:300px}.chart-section{margin-bottom:24px}.chart-title{font-size:.9rem;font-weight:600;color:var(--text);margin-bottom:12px}.rares-summary{display:flex;gap:16px;margin-bottom:20px;flex-wrap:wrap}.rare-stat-card{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);padding:12px 20px;display:flex;flex-direction:column;align-items:center;min-width:140px}.rare-stat-value{font-size:1.3rem;font-weight:700;color:#fc0}.rare-stat-label{font-size:.7rem;color:var(--text-muted);margin-top:4px}.rare-timeline{max-height:200px;overflow-y:auto}.rare-event{display:flex;gap:12px;padding:4px 0;border-bottom:1px solid #222;font-size:.8rem}.rare-time{color:var(--text-dim);width:80px}.rare-char{color:var(--text-muted);width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rare-name{color:#fc0;font-weight:600}.map-tab{display:flex;flex-direction:column;align-items:center}.map-container{position:relative;width:100%;max-width:800px;aspect-ratio:1}.map-image{width:100%;height:100%;object-fit:contain;display:block}.map-overlay{position:absolute;top:0;left:0;width:100%;height:100%}.map-legend{display:flex;gap:16px;align-items:center;margin-top:8px;font-size:.75rem;color:var(--text-muted)}.legend-dot{display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:4px}.legend-dot.hunting{background:#4c4}.legend-dot.other{background:#fa0}.map-count{margin-left:auto}.inventory-tab{width:100%}.search-bar{display:flex;align-items:center;gap:8px;margin-bottom:8px}.search-input{flex:1;padding:8px 12px;font-size:.9rem;background:var(--bg-card);color:var(--text);border:1px solid var(--border);border-radius:var(--radius);outline:none}.search-input:focus{border-color:var(--accent)}.search-spinner{font-size:.75rem;color:var(--text-muted)}.search-count{font-size:.75rem;color:var(--text-muted);margin-bottom:8px}.search-empty{text-align:center;color:var(--text-dim);padding:24px}.results-table{width:100%;border-collapse:collapse;font-size:.8rem}.results-table th{text-align:left;padding:6px 8px;border-bottom:1px solid var(--border);color:var(--text-muted);font-weight:600;font-size:.72rem;text-transform:uppercase;letter-spacing:.3px}.results-table td{padding:4px 8px;border-bottom:1px solid #1a1a1a;color:var(--text)}.results-table tr:hover td{background:var(--bg-card-hover)}.item-name{font-weight:500}@media(max-width:768px){.dashboard-header{flex-direction:column;gap:8px;padding:10px 16px}.dashboard-main{padding:12px}.global-stats{gap:16px}.char-grid{grid-template-columns:1fr}.char-stats-row{gap:8px}}@media(max-width:480px){.dashboard-nav{gap:10px;font-size:.8rem}.char-card{padding:10px}}.ml-layout{display:flex;height:100vh;overflow:hidden;background:#111;color:#eee;font-family:Segoe UI,sans-serif}.ml-sidebar{width:400px;min-width:400px;background:#1a1a1a;border-right:2px solid #333;display:flex;flex-direction:column;overflow-y:auto;padding:12px 14px}.ml-sidebar-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px}.ml-sidebar-title{font-size:.85rem;font-weight:600;color:#88f}.ml-view-toggle{font-size:.7rem;padding:3px 10px;background:#333;color:#aaa;border:1px solid #555;border-radius:3px;cursor:pointer}.ml-view-toggle:hover{background:#444;color:#fff}.ml-server-status{display:flex;align-items:center;gap:6px;padding:4px 0 8px;font-size:.75rem;color:#aaa}.ml-status-dot{width:8px;height:8px;border-radius:50%}.ml-status-dot.online{background:#4c4;animation:ml-pulse 2s ease-in-out infinite}.ml-status-dot.offline{background:#c44}.ml-status-detail{color:#888;font-size:.7rem}.ml-status-latency{margin-left:auto;color:#888}.ml-tool-links{display:flex;flex-wrap:wrap;gap:4px;margin-bottom:8px}.ml-tool-link{font-size:.68rem;color:#8ac;text-decoration:none;padding:2px 6px;background:#4488ff14;border:1px solid rgba(68,136,255,.15);border-radius:3px;transition:all .15s}.ml-tool-link:hover{background:#4488ff2e;color:#adf}@keyframes ml-pulse{0%,to{opacity:1}50%{opacity:.4}}.ml-counters{display:flex;gap:6px;margin-bottom:10px}.ml-counter{flex:1;text-align:center;padding:6px 4px;border-radius:4px;background:#222;border:1px solid #333}.ml-counter-val{display:block;font-size:1rem;font-weight:700;font-variant-numeric:tabular-nums}.ml-counter-lbl{display:block;font-size:.6rem;color:#888;text-transform:uppercase;letter-spacing:.3px}.ml-counter.rares .ml-counter-val{color:#fc0}.ml-counter.kph .ml-counter-val{color:#4af}.ml-counter.kph{border-color:#234;animation:ml-kph-glow 3s ease-in-out infinite}.ml-counter.kph.ultra{background:linear-gradient(135deg,#112,#221);animation:ml-kph-glow 1.5s ease-in-out infinite}.ml-counter.kills .ml-counter-val{color:#f66}@keyframes ml-kph-glow{0%,to{box-shadow:0 0 4px #4af3}50%{box-shadow:0 0 12px #44aaff80}}.ml-sort-buttons{display:flex;gap:2px;margin:8px 0}.ml-sort-btn{flex:1;padding:4px 0;font-size:.65rem;font-weight:600;background:#2a2a2a;color:#888;border:1px solid #444;border-radius:3px;cursor:pointer;text-transform:uppercase;letter-spacing:.3px}.ml-sort-btn:hover{background:#333;color:#ccc}.ml-sort-btn.active{background:#334;color:#88f;border-color:#88f}.ml-filter{width:100%;padding:5px 8px;font-size:.78rem;background:#222;color:#eee;border:1px solid #444;border-radius:3px;outline:none;margin-bottom:8px;box-sizing:border-box}.ml-filter:focus{border-color:#88f}.ml-filter::placeholder{color:#666}.ml-player-list{list-style:none;margin:0;padding:0;flex:1;overflow-y:auto;scrollbar-width:none;-ms-overflow-style:none}.ml-player-list::-webkit-scrollbar{display:none}.ml-player-row{padding:6px 8px;border-bottom:1px solid #2a2a2a;border-left:3px solid transparent;cursor:pointer;transition:background .1s}.ml-player-row:hover{background:#252525}.ml-pr-name{font-size:.82rem;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ml-pr-coords{font-size:.65rem;color:#888;margin-bottom:3px}.ml-pr-vitals{display:flex;gap:3px;margin-bottom:4px}.ml-vital-bar{flex:1;height:4px;border-radius:2px;overflow:hidden}.ml-vital-bar.hp{background:#300}.ml-vital-bar.sta{background:#331a00}.ml-vital-bar.mana{background:#001433}.ml-vital-bar.hp .ml-vital-fill{background:linear-gradient(90deg,#f44,#f66)}.ml-vital-bar.sta .ml-vital-fill{background:linear-gradient(90deg,#fa0,#fc4)}.ml-vital-bar.mana .ml-vital-fill{background:linear-gradient(90deg,#48f,#6af)}.ml-vital-fill{height:100%;border-radius:2px;transition:width .3s ease-out}.ml-pr-header{display:flex;justify-content:space-between;align-items:baseline;cursor:pointer}.ml-pr-grid{display:grid;grid-template-columns:1fr 1fr 1fr;gap:1px 8px;font-size:.68rem;color:#aaa;margin-bottom:4px}.ml-gs{font-variant-numeric:tabular-nums;display:inline-flex;align-items:center;gap:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ml-suffix{font-size:.58rem;color:#666;text-transform:uppercase;letter-spacing:.3px}.ml-taper-icon{width:14px;height:14px;margin-right:2px;vertical-align:text-bottom}.ml-meta-pill{font-size:.6rem;padding:0 6px;border-radius:3px;background:#333;color:#888;text-align:center;justify-self:end}.ml-pr-buttons{display:flex;gap:3px;margin-top:4px}.ml-btn{padding:2px 8px;font-size:.63rem;font-weight:500;border:1px solid #3a3a3a;border-radius:4px;background:#2a2a2a;color:#999;cursor:pointer;white-space:nowrap;transition:all .15s;letter-spacing:.2px}.ml-btn:hover{background:#383838;color:#ddd;border-color:#555}.ml-btn.accent{background:#4488ff1f;color:#6aadff;border-color:#4488ff4d}.ml-btn.accent:hover{background:#4488ff38;color:#8ec5ff;border-color:#4488ff80}.ml-meta-pill.active{background:#44cc4426;color:#4c4}.ml-map-container{flex:1;position:relative;overflow:hidden;background:#000;cursor:grab}.ml-map-container:active{cursor:grabbing}.ml-map-group{position:absolute;top:0;left:0;transform-origin:0 0}.ml-map-img{display:block;-webkit-user-select:none;user-select:none;-webkit-user-drag:none}.ml-dots-layer{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.ml-dot{position:absolute;width:6px;height:6px;border-radius:50%;transform:translate(-50%,-50%);border:1px solid rgba(0,0,0,.5);pointer-events:all;cursor:pointer;z-index:5}.ml-dot:hover{width:10px;height:10px;z-index:10}.ml-tooltip{position:absolute;background:#001e3ceb;color:#eee;padding:6px 10px;border-radius:4px;font-size:.75rem;pointer-events:none;z-index:1000;white-space:nowrap;border:1px solid #335}.ml-coords{position:absolute;bottom:8px;left:8px;background:#003264d9;color:#eee;padding:4px 10px;border-radius:4px;font-size:.75rem;pointer-events:none;z-index:100;font-variant-numeric:tabular-nums}.ml-toggles{display:flex;gap:12px;margin-bottom:8px;font-size:.72rem}.ml-toggle-label{display:flex;align-items:center;gap:4px;color:#aaa;cursor:pointer}.ml-toggle-label input{accent-color:#4488ff}.ml-trails-svg{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.ml-heatmap-canvas{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;opacity:.8}.ml-portals-layer{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.ml-portal-icon{position:absolute;width:6px;height:6px;transform:translate(-50%,-50%);pointer-events:all;cursor:help}.ml-portal-icon:before{content:"🌀";font-size:10px;position:absolute;transform:translate(-50%,-50%)}.ml-window{position:fixed;background:#1a1a1a;border:1px solid #444;border-radius:6px;display:flex;flex-direction:column;overflow:hidden;box-shadow:0 8px 32px #00000080}.ml-window-header{display:flex;justify-content:space-between;align-items:center;padding:6px 12px;background:linear-gradient(135deg,#2a3a5a,#1a2a40);cursor:move;-webkit-user-select:none;user-select:none;border-bottom:1px solid #334}.ml-window-title{font-size:.8rem;font-weight:600;color:#acf}.ml-window-close{background:none;border:none;color:#888;font-size:1.1rem;cursor:pointer;line-height:1;padding:0 4px}.ml-window-close:hover{color:#f66}.ml-window-content{flex:1;overflow:auto;display:flex;flex-direction:column}.ml-stats-controls{display:flex;gap:4px;padding:6px 10px;border-bottom:1px solid #333}.ml-stats-range-btn{padding:3px 10px;font-size:.7rem;background:#2a2a2a;color:#888;border:1px solid #444;border-radius:3px;cursor:pointer}.ml-stats-range-btn.active{background:#4488ff26;color:#6aadff;border-color:#4488ff4d}.ml-stats-grid{display:grid;grid-template-columns:1fr 1fr;gap:4px;padding:4px;flex:1}.ml-stats-panel{min-height:200px;background:#fff;border-radius:3px;overflow:hidden}.ml-stats-panel iframe{border:none}.ml-chat-messages{flex:1;overflow-y:auto;padding:6px 10px;font-size:.75rem;font-family:Consolas,Courier New,monospace;line-height:1.4}.ml-chat-line{word-break:break-word}.ml-chat-form{display:flex;border-top:1px solid #333;padding:4px}.ml-chat-input{flex:1;background:#222;color:#eee;border:1px solid #444;border-radius:3px;padding:4px 8px;font-size:.78rem;outline:none}.ml-chat-input:focus{border-color:#48f}.ml-chat-input::placeholder{color:#666}.ml-rare-notifications{position:fixed;top:20px;left:50%;transform:translate(-50%);z-index:99999;display:flex;flex-direction:column;gap:8px;pointer-events:none}.ml-rare-notif{background:linear-gradient(135deg,#1a0a2e,#2a1040);border:2px solid #ffcc00;border-radius:8px;padding:16px 32px;text-align:center;animation:ml-notif-in .5s ease-out;box-shadow:0 0 40px #ffcc004d}.ml-rare-notif.exiting{animation:ml-notif-out .5s ease-in forwards}.ml-rare-notif-title{font-size:1.4rem;font-weight:800;color:#fc0;text-shadow:0 0 20px rgba(255,204,0,.5);margin-bottom:4px}.ml-rare-notif-name{font-size:1.1rem;font-weight:600;color:#fff;margin-bottom:4px}.ml-rare-notif-by{font-size:.75rem;color:#888}.ml-rare-notif-char{font-size:1rem;font-weight:700;color:#fc0}@keyframes ml-notif-in{0%{transform:translateY(-40px);opacity:0}to{transform:translateY(0);opacity:1}}@keyframes ml-notif-out{to{transform:translateY(-60px);opacity:0}}.ml-fireworks{position:fixed;top:0;left:0;width:100%;height:100%;pointer-events:none;z-index:99998}.ml-firework-particle{position:absolute;width:6px;height:6px;border-radius:50%;animation:ml-particle 2s cubic-bezier(.25,.46,.45,.94) forwards}@keyframes ml-particle{0%{transform:translate(0) scale(1);opacity:1}to{transform:translate(var(--dx),var(--dy)) scale(0);opacity:0}}@media(max-width:768px){.ml-layout{flex-direction:column}.ml-sidebar{width:100%;min-width:100%;max-height:40vh;border-right:none;border-bottom:2px solid #333}.ml-map-container{min-height:60vh}} diff --git a/static/v2/index.html b/static/v2/index.html index 1e7f2c29..0e036b49 100644 --- a/static/v2/index.html +++ b/static/v2/index.html @@ -5,8 +5,8 @@ Mosswart Overlord v2 - - + +