diff --git a/frontend/src/components/map/MapLayout.tsx b/frontend/src/components/map/MapLayout.tsx index 4a01be64..c14d0caf 100644 --- a/frontend/src/components/map/MapLayout.tsx +++ b/frontend/src/components/map/MapLayout.tsx @@ -66,7 +66,8 @@ export const MapLayout: React.FC = ({ data }) => { /> + equipmentCantrips={data.equipmentCantrips} characterStats={data.characterStats} + socket={data.socketRef.current} /> diff --git a/frontend/src/components/windows/CharacterWindow.tsx b/frontend/src/components/windows/CharacterWindow.tsx index 8ddb182f..b1fad2a4 100644 --- a/frontend/src/components/windows/CharacterWindow.tsx +++ b/frontend/src/components/windows/CharacterWindow.tsx @@ -2,7 +2,7 @@ import React, { useEffect, useState } from 'react'; import { DraggableWindow } from './DraggableWindow'; import { apiFetch } from '../../api/client'; -interface Props { id: string; charName: string; zIndex: number; vitals?: any; } +interface Props { id: string; charName: string; zIndex: number; vitals?: any; liveStats?: any; } // Property ID maps — verbatim from v1 script.js lines 1843-1876 const TS_AUGMENTATIONS: Record = { @@ -49,15 +49,19 @@ function societyRank(v: number): string { const gold = '#af7a30'; const navy = '#000022'; -export const CharacterWindow: React.FC = ({ id, charName, zIndex, vitals }) => { - const [data, setData] = useState(null); +export const CharacterWindow: React.FC = ({ id, charName, zIndex, vitals, liveStats }) => { + const [fetchedData, setFetchedData] = useState(null); const [leftTab, setLeftTab] = useState(0); const [rightTab, setRightTab] = useState(0); + // Initial fetch from API useEffect(() => { - apiFetch(`/character-stats/${encodeURIComponent(charName)}`).then(setData).catch(() => {}); + apiFetch(`/character-stats/${encodeURIComponent(charName)}`).then(setFetchedData).catch(() => {}); }, [charName]); + // Use live WS data if available (more current), fall back to API fetch + const data = liveStats || fetchedData; + const fmt = (n: any) => n != null ? Number(n).toLocaleString() : '\u2014'; const sd = data?.stats_data || data || {}; const attrs = sd.attributes || {}; diff --git a/frontend/src/components/windows/WindowRenderer.tsx b/frontend/src/components/windows/WindowRenderer.tsx index 44441895..a506cb9a 100644 --- a/frontend/src/components/windows/WindowRenderer.tsx +++ b/frontend/src/components/windows/WindowRenderer.tsx @@ -19,10 +19,11 @@ interface Props { nearbyObjects: Map; inventoryVersion: number; equipmentCantrips: Map; + characterStats: Map; socket: WebSocket | null; } -export const WindowRenderer: React.FC = React.memo(({ characters, chatMessages, nearbyObjects, inventoryVersion, equipmentCantrips, socket }) => { +export const WindowRenderer: React.FC = React.memo(({ characters, chatMessages, nearbyObjects, inventoryVersion, equipmentCantrips, characterStats, socket }) => { const { windows } = useWindowManager(); return ( @@ -39,7 +40,8 @@ export const WindowRenderer: React.FC = React.memo(({ characters, chatMes return ; case 'char': return ; + vitals={characters.get(charName)?.vitals ?? undefined} + liveStats={characterStats.get(charName)} />; case 'inv': return ; diff --git a/frontend/src/hooks/useLiveData.ts b/frontend/src/hooks/useLiveData.ts index a3262cd8..129d965e 100644 --- a/frontend/src/hooks/useLiveData.ts +++ b/frontend/src/hooks/useLiveData.ts @@ -16,6 +16,7 @@ export interface DashboardState { nearbyObjects: Map; inventoryVersion: number; equipmentCantrips: Map; + characterStats: Map; socketRef: React.RefObject; } @@ -30,6 +31,8 @@ export function useLiveData(): DashboardState { const [inventoryVersion, setInventoryVersion] = useState(0); const equipmentCantripRef = useRef(new Map()); const [equipCantripVersion, setEquipCantripVersion] = useState(0); + const characterStatsRef = useRef(new Map()); + const [charStatsVersion, setCharStatsVersion] = useState(0); const [nearbyObjects, setNearbyObjects] = useState>(new Map()); const charsRef = useRef(characters); charsRef.current = characters; @@ -64,6 +67,11 @@ export function useLiveData(): DashboardState { const d = msg as unknown as { character_name: string }; // Bump inventory version so open inventory windows can re-fetch setInventoryVersion(v => v + 1); + } else if (msg.type === 'character_stats') { + // Store full character stats for CharacterWindow live updates + const cs = msg as unknown as { character_name: string }; + characterStatsRef.current.set(cs.character_name, msg); + setCharStatsVersion(v => v + 1); } else if (msg.type === 'equipment_cantrip_state') { const ecs = msg as unknown as { character_name: string; items: any[]; timestamp: string }; equipmentCantripRef.current.set(ecs.character_name, ecs); @@ -182,6 +190,8 @@ export function useLiveData(): DashboardState { // eslint-disable-next-line react-hooks/exhaustive-deps const equipmentCantrips = useMemo(() => equipmentCantripRef.current, [equipCantripVersion]); + // eslint-disable-next-line react-hooks/exhaustive-deps + const characterStats = useMemo(() => characterStatsRef.current, [charStatsVersion]); - return { characters, serverHealth, totalRares, totalKills, recentRares, chatMessages, nearbyObjects, inventoryVersion, equipmentCantrips, socketRef }; + return { characters, serverHealth, totalRares, totalKills, recentRares, chatMessages, nearbyObjects, inventoryVersion, equipmentCantrips, characterStats, socketRef }; } diff --git a/static/assets/CharacterWindow-CyX_tOIF.js b/static/assets/CharacterWindow-CyX_tOIF.js new file mode 100644 index 00000000..2cacb43a --- /dev/null +++ b/static/assets/CharacterWindow-CyX_tOIF.js @@ -0,0 +1 @@ +import{r as f,a as J,j as e,D as K}from"./index-fhoLMRWN.js";import"./react-yfL0ty4i.js";const F={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"},B={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"},$={370:"Damage",371:"Damage Resistance",372:"Critical",373:"Critical Resistance",374:"Critical Damage",375:"Critical Damage Resistance",376:"Healing Boost",379:"Vitality"},W={287:"Celestial Hand",288:"Eldrytch Web",289:"Radiant Blood"},D={354:"Melee",355:"Ranged",362:"Summoning"},q={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"},U={181:"Chess Rank",192:"Fishing Skill",199:"Total Augmentations",322:"Aetheria Slots",390:"Enlightenment"};function Q(c){return c>=1001?"Master":c>=301?"Lord":c>=151?"Knight":c>=31?"Adept":"Initiate"}const d="#af7a30",u="#000022",ee=({id:c,charName:g,zIndex:L,vitals:s,liveStats:O})=>{var _,N;const[H,P]=f.useState(null),[j,V]=f.useState(0),[m,G]=f.useState(0);f.useEffect(()=>{J(`/character-stats/${encodeURIComponent(g)}`).then(P).catch(()=>{})},[g]);const n=O||H,a=t=>t!=null?Number(t).toLocaleString():"—",o=(n==null?void 0:n.stats_data)||n||{},C=o.attributes||{},A=o.skills||{},Y=o.vitals||{},E=o.titles||[],h=o.properties||{},T=Object.entries(A).filter(([,t])=>(t==null?void 0:t.training)==="Specialized").sort(([t],[l])=>t.localeCompare(l)),I=Object.entries(A).filter(([,t])=>(t==null?void 0:t.training)==="Trained").sort(([t],[l])=>t.localeCompare(l)),S=Object.entries(h).filter(([t,l])=>F[parseInt(t)]&&Number(l)>0).map(([t,l])=>({name:F[parseInt(t)],uses:Number(l)})),w=Object.entries(h).filter(([t,l])=>B[parseInt(t)]&&Number(l)>0).map(([t,l])=>({name:B[parseInt(t)],uses:Number(l)})),z=Object.entries(h).filter(([t,l])=>$[parseInt(t)]&&Number(l)>0).map(([t,l])=>({name:$[parseInt(t)],value:Number(l)})),x=[];n!=null&&n.birth&&x.push({name:"Birth",value:n.birth}),(n==null?void 0:n.deaths)!=null&&x.push({name:"Deaths",value:a(n.deaths)}),Object.entries(h).forEach(([t,l])=>{const i=parseInt(t);U[i]&&x.push({name:U[i],value:l})});const y=[];Object.entries(h).forEach(([t,l])=>{const i=parseInt(t);D[i]&&y.push({name:D[i],value:q[Number(l)]||`Unknown (${l})`})});const b=[];Object.entries(h).forEach(([t,l])=>{const i=parseInt(t);W[i]&&Number(l)>0&&b.push({name:W[i],rank:Q(Number(l)),value:Number(l)})});const R=t=>({padding:"5px 8px",fontSize:12,fontWeight:"bold",color:"#fff",cursor:"pointer",userSelect:"none",borderTop:`2px solid ${t?d:u}`,borderLeft:`2px solid ${t?d:u}`,borderRight:`2px solid ${t?d:u}`,background:t?"rgba(0,100,0,0.4)":"transparent"}),M={background:"#000",border:`2px solid ${d}`,maxHeight:400,overflowY:"auto",overflowX:"hidden"},r={background:"#222",fontWeight:"bold",fontSize:12,padding:"2px 6px"},k={padding:"2px 6px",background:"rgba(0,100,0,0.4)",whiteSpace:"nowrap"},p={padding:"2px 6px",background:"rgba(0,0,100,0.4)",textAlign:"right",whiteSpace:"nowrap"},X={padding:"2px 6px",color:"#ccc"};return e.jsx(K,{id:c,title:`Character: ${g}`,zIndex:L,width:740,height:600,children:e.jsxs("div",{style:{background:u,color:"#fff",font:'14px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif',overflowY:"auto",padding:"10px 15px 15px",flex:1},children:[e.jsxs("div",{style:{marginBottom:10},children:[e.jsxs("h1",{style:{margin:"0 0 2px",fontSize:28,fontWeight:"bold"},children:[g,e.jsx("span",{style:{fontSize:"200%",color:"#fff27f",float:"right"},children:(n==null?void 0:n.level)||""})]}),e.jsx("div",{style:{fontSize:"85%",color:"gold"},children:[n==null?void 0:n.gender,n==null?void 0:n.race].filter(Boolean).join(" ")||"Awaiting character data..."})]}),e.jsxs("div",{style:{fontSize:"85%",margin:"6px 0 10px",display:"grid",gridTemplateColumns:"1fr 1fr",gap:"0 20px"},children:[e.jsxs("div",{children:["Total XP: ",a(n==null?void 0:n.total_xp)]}),e.jsxs("div",{style:{textAlign:"right"},children:["Unassigned XP: ",a(n==null?void 0:n.unassigned_xp)]}),e.jsxs("div",{children:["Luminance: ",(n==null?void 0:n.luminance_earned)!=null?`${a(n.luminance_earned)} / ${a(n.luminance_total)}`:"—"]}),e.jsxs("div",{style:{textAlign:"right"},children:["Deaths: ",a(n==null?void 0:n.deaths)]})]}),e.jsxs("div",{style:{display:"flex",gap:13,flexWrap:"wrap"},children:[e.jsxs("div",{style:{width:320},children:[e.jsx("div",{style:{height:30,display:"flex"},children:["Attributes","Skills","Titles"].map((t,l)=>e.jsx("div",{style:R(j===l),onClick:()=>V(l),children:t},t))}),e.jsxs("div",{style:M,children:[j===0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{padding:"6px 8px",display:"flex",flexDirection:"column",gap:8,borderBottom:`2px solid ${d}`},children:[{label:"Health",pct:(s==null?void 0:s.health_percentage)??0,cur:s==null?void 0:s.health_current,max:s==null?void 0:s.health_max,bg:"#cc3333"},{label:"Stamina",pct:(s==null?void 0:s.stamina_percentage)??0,cur:s==null?void 0:s.stamina_current,max:s==null?void 0:s.stamina_max,bg:"#ccaa33"},{label:"Mana",pct:(s==null?void 0:s.mana_percentage)??0,cur:s==null?void 0:s.mana_current,max:s==null?void 0:s.mana_max,bg:"#3366cc"}].map(t=>e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[e.jsx("span",{style:{width:55,fontSize:12,color:"#ccc"},children:t.label}),e.jsx("div",{style:{flex:1,height:14,overflow:"hidden",position:"relative",border:`1px solid ${d}`},children:e.jsx("div",{style:{height:"100%",width:`${t.pct}%`,background:t.bg,transition:"width 0.5s ease"}})}),e.jsxs("span",{style:{width:80,textAlign:"right",fontSize:12,color:"#ccc"},children:[t.cur??"—"," / ",t.max??"—"]})]},t.label))}),e.jsxs("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{style:r,children:"Attribute"}),e.jsx("td",{style:r,children:"Creation"}),e.jsx("td",{style:r,children:"Base"})]})}),e.jsx("tbody",{children:["strength","endurance","coordination","quickness","focus","self"].map(t=>{var l,i;return e.jsxs("tr",{children:[e.jsx("td",{style:k,children:t.charAt(0).toUpperCase()+t.slice(1)}),e.jsx("td",{style:X,children:((l=C[t])==null?void 0:l.creation)??"—"}),e.jsx("td",{style:p,children:((i=C[t])==null?void 0:i.base)??"—"})]},t)})})]}),e.jsxs("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{style:r,children:"Vital"}),e.jsx("td",{style:r,children:"Base"})]})}),e.jsx("tbody",{children:["health","stamina","mana"].map(t=>{var l;return e.jsxs("tr",{children:[e.jsx("td",{style:k,children:t.charAt(0).toUpperCase()+t.slice(1)}),e.jsx("td",{style:p,children:((l=Y[t])==null?void 0:l.base)??"—"})]},t)})})]}),e.jsx("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:e.jsx("tbody",{children:e.jsxs("tr",{children:[e.jsx("td",{style:k,children:"Skill Credits"}),e.jsx("td",{style:p,children:a(o.skill_credits)})]})})})]}),j===1&&e.jsxs("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{style:r,children:"Skill"}),e.jsx("td",{style:r,children:"Level"})]})}),e.jsxs("tbody",{children:[T.map(([t,l])=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px",background:"linear-gradient(to right, #392067, #392067, black)"},children:t.replace(/_/g," ").replace(/\b\w/g,i=>i.toUpperCase())}),e.jsx("td",{style:{...p,background:"linear-gradient(to right, #392067, #392067, black)"},children:l.base})]},t)),I.map(([t,l])=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px",background:"linear-gradient(to right, #0f3c3e, #0f3c3e, black)"},children:t.replace(/_/g," ").replace(/\b\w/g,i=>i.toUpperCase())}),e.jsx("td",{style:{...p,background:"linear-gradient(to right, #0f3c3e, #0f3c3e, black)"},children:l.base})]},t)),T.length===0&&I.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:2,style:{padding:10,color:"#666",fontStyle:"italic",textAlign:"center"},children:"No skill data"})})]})]}),j===2&&e.jsx("div",{style:{padding:"6px 10px",fontSize:13},children:E.length>0?E.map((t,l)=>e.jsx("div",{style:{padding:"1px 0"},children:t},l)):e.jsx("div",{style:{color:"#666",fontStyle:"italic",textAlign:"center",padding:10},children:"No titles"})})]})]}),e.jsxs("div",{style:{width:320},children:[e.jsx("div",{style:{height:30,display:"flex"},children:["Augmentations","Ratings","Other"].map((t,l)=>e.jsx("div",{style:R(m===l),onClick:()=>G(l),children:t},t))}),e.jsxs("div",{style:M,children:[m===0&&(S.length||w.length?e.jsxs(e.Fragment,{children:[S.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{background:"#222",padding:"4px 8px",fontWeight:"bold",fontSize:13,borderBottom:`1px solid ${d}`},children:"Augmentations"}),e.jsxs("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{style:r,children:"Name"}),e.jsx("td",{style:r,children:"Uses"})]})}),e.jsx("tbody",{children:S.map(t=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px"},children:t.name}),e.jsx("td",{style:{padding:"2px 6px",textAlign:"right"},children:t.uses})]},t.name))})]})]}),w.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{background:"#222",padding:"4px 8px",fontWeight:"bold",fontSize:13,borderBottom:`1px solid ${d}`},children:"Auras"}),e.jsxs("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{style:r,children:"Name"}),e.jsx("td",{style:r,children:"Uses"})]})}),e.jsx("tbody",{children:w.map(t=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px"},children:t.name}),e.jsx("td",{style:{padding:"2px 6px",textAlign:"right"},children:t.uses})]},t.name))})]})]})]}):e.jsx("div",{style:{color:"#666",fontStyle:"italic",textAlign:"center",padding:10},children:"No augmentation data"})),m===1&&(z.length>0?e.jsxs("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{style:r,children:"Rating"}),e.jsx("td",{style:r,children:"Value"})]})}),e.jsx("tbody",{children:z.map(t=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px"},children:t.name}),e.jsx("td",{style:{padding:"2px 6px",textAlign:"right"},children:t.value})]},t.name))})]}):e.jsx("div",{style:{color:"#666",fontStyle:"italic",textAlign:"center",padding:10},children:"No rating data"})),m===2&&e.jsxs("div",{children:[x.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{background:"#222",padding:"4px 8px",fontWeight:"bold",fontSize:13,borderBottom:`1px solid ${d}`},children:"General"}),e.jsx("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:e.jsx("tbody",{children:x.map(t=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px"},children:t.name}),e.jsx("td",{style:{padding:"2px 6px",textAlign:"right"},children:t.value})]},t.name))})})]}),y.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{background:"#222",padding:"4px 8px",fontWeight:"bold",fontSize:13,borderBottom:`1px solid ${d}`},children:"Masteries"}),e.jsx("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:e.jsx("tbody",{children:y.map(t=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px"},children:t.name}),e.jsx("td",{style:{padding:"2px 6px",textAlign:"right"},children:t.value})]},t.name))})})]}),b.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{background:"#222",padding:"4px 8px",fontWeight:"bold",fontSize:13,borderBottom:`1px solid ${d}`},children:"Society"}),e.jsx("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:e.jsx("tbody",{children:b.map(t=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px"},children:t.name}),e.jsxs("td",{style:{padding:"2px 6px",textAlign:"right"},children:[t.rank," (",t.value,")"]})]},t.name))})})]}),x.length===0&&y.length===0&&b.length===0&&e.jsx("div",{style:{color:"#666",fontStyle:"italic",textAlign:"center",padding:10},children:"No additional data"})]})]})]})]}),(n==null?void 0:n.allegiance)&&e.jsxs("div",{style:{marginTop:5,border:`2px solid ${d}`,background:"#000"},children:[e.jsx("div",{style:{background:"#222",padding:"4px 8px",fontWeight:"bold",fontSize:13,borderBottom:`1px solid ${d}`},children:"Allegiance"}),e.jsx("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:e.jsxs("tbody",{children:[n.allegiance.name&&e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px",color:"#ccc",width:100},children:"Name"}),e.jsx("td",{style:{padding:"2px 6px"},children:n.allegiance.name})]}),((_=n.allegiance.monarch)==null?void 0:_.name)&&e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px",color:"#ccc"},children:"Monarch"}),e.jsx("td",{style:{padding:"2px 6px"},children:n.allegiance.monarch.name})]}),((N=n.allegiance.patron)==null?void 0:N.name)&&e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px",color:"#ccc"},children:"Patron"}),e.jsx("td",{style:{padding:"2px 6px"},children:n.allegiance.patron.name})]}),n.allegiance.rank!=null&&e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px",color:"#ccc"},children:"Rank"}),e.jsx("td",{style:{padding:"2px 6px"},children:n.allegiance.rank})]}),n.allegiance.followers!=null&&e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px",color:"#ccc"},children:"Followers"}),e.jsx("td",{style:{padding:"2px 6px"},children:n.allegiance.followers})]})]})})]})]})})};export{ee as CharacterWindow}; diff --git a/static/v2/assets/CombatPickerWindow-DMOcilt1.js b/static/assets/CombatPickerWindow-NVeKtlGR.js similarity index 92% rename from static/v2/assets/CombatPickerWindow-DMOcilt1.js rename to static/assets/CombatPickerWindow-NVeKtlGR.js index 3a07907b..bb9e6ab0 100644 --- a/static/v2/assets/CombatPickerWindow-DMOcilt1.js +++ b/static/assets/CombatPickerWindow-NVeKtlGR.js @@ -1 +1 @@ -import{u as c,j as r,D as d}from"./index-BiGwMY76.js";import"./react-yfL0ty4i.js";const p=({id:n,zIndex:i,characters:a})=>{const{openWindow:s}=c(),e=Array.from(a.keys()).sort();return r.jsx(d,{id:n,title:"Combat Stats — Select Character",zIndex:i,width:300,height:400,children:r.jsx("div",{style:{flex:1,overflowY:"auto",padding:6},children:e.length===0?r.jsx("div",{style:{padding:12,color:"#666",textAlign:"center",fontSize:"0.8rem"},children:"No characters online"}):e.map(o=>r.jsx("div",{style:{padding:"5px 8px",cursor:"pointer",borderBottom:"1px solid #222",color:"#ccc",fontSize:"0.82rem"},onMouseEnter:t=>t.currentTarget.style.background="#2a2a2a",onMouseLeave:t=>t.currentTarget.style.background="",onClick:()=>s(`combat-${o}`,`Combat: ${o}`,o),children:o},o))})})};export{p as CombatPickerWindow}; +import{u as c,j as r,D as d}from"./index-fhoLMRWN.js";import"./react-yfL0ty4i.js";const p=({id:n,zIndex:i,characters:a})=>{const{openWindow:s}=c(),e=Array.from(a.keys()).sort();return r.jsx(d,{id:n,title:"Combat Stats — Select Character",zIndex:i,width:300,height:400,children:r.jsx("div",{style:{flex:1,overflowY:"auto",padding:6},children:e.length===0?r.jsx("div",{style:{padding:12,color:"#666",textAlign:"center",fontSize:"0.8rem"},children:"No characters online"}):e.map(o=>r.jsx("div",{style:{padding:"5px 8px",cursor:"pointer",borderBottom:"1px solid #222",color:"#ccc",fontSize:"0.82rem"},onMouseEnter:t=>t.currentTarget.style.background="#2a2a2a",onMouseLeave:t=>t.currentTarget.style.background="",onClick:()=>s(`combat-${o}`,`Combat: ${o}`,o),children:o},o))})})};export{p as CombatPickerWindow}; diff --git a/static/v2/assets/CombatStatsWindow-BOXaCmme.js b/static/assets/CombatStatsWindow-BduiqqZk.js similarity index 99% rename from static/v2/assets/CombatStatsWindow-BOXaCmme.js rename to static/assets/CombatStatsWindow-BduiqqZk.js index 1bf629c9..a7eb456e 100644 --- a/static/v2/assets/CombatStatsWindow-BOXaCmme.js +++ b/static/assets/CombatStatsWindow-BduiqqZk.js @@ -1 +1 @@ -import{r as A,a as B,j as t,D as L}from"./index-BiGwMY76.js";import"./react-yfL0ty4i.js";const w=["Typeless","Slash","Pierce","Bludgeon","Fire","Cold","Acid","Electric"];function _(c,a,x){var o,m,f,k;return(((m=(o=c==null?void 0:c[a])==null?void 0:o[x])==null?void 0:m.total_normal_damage)??0)+(((k=(f=c==null?void 0:c[a])==null?void 0:f[x])==null?void 0:k.total_crit_damage)??0)}function G(c){let a={attacks:0,failed:0,crits:0,normalDmg:0,maxNormal:0,critDmg:0,maxCrit:0};if(!c)return a;for(const x of Object.values(c))for(const o of Object.values(x))a.attacks+=o.total_attacks??0,a.failed+=o.failed_attacks??0,a.crits+=o.crits??0,a.normalDmg+=o.total_normal_damage??0,a.maxNormal=Math.max(a.maxNormal,o.max_normal_damage??0),a.critDmg+=o.total_crit_damage??0,a.maxCrit=Math.max(a.maxCrit,o.max_crit_damage??0);return a}function F(c,a){let x={attacks:0,failed:0};const o=c==null?void 0:c[a];if(!o)return x;for(const m of Object.values(o))x.attacks+=m.total_attacks??0,x.failed+=m.failed_attacks??0;return x}const Y=({id:c,charName:a,zIndex:x})=>{const[o,m]=A.useState(null),[f,k]=A.useState("session"),[h,R]=A.useState(null);A.useEffect(()=>{B(`/combat-stats/${encodeURIComponent(a)}`).then(m).catch(()=>{});const e=setInterval(()=>{B(`/combat-stats/${encodeURIComponent(a)}`).then(m).catch(()=>{})},1e4);return()=>clearInterval(e)},[a]);const p=o==null?void 0:o[f],j=(p==null?void 0:p.monsters)??{},S=Object.keys(j).filter(e=>e!=="__cloak_surges__").sort(),n=A.useMemo(()=>{let e={},l={},v=0,$=0;const T=h?[j[h]].filter(Boolean):S.map(u=>j[u]);for(const u of T)if(u){for(const[g,D]of Object.entries(u.offense??{})){e[g]||(e[g]={});for(const[y,E]of Object.entries(D)){e[g][y]||(e[g][y]={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 i=e[g][y],d=E;i.total_attacks+=d.total_attacks??0,i.failed_attacks+=d.failed_attacks??0,i.crits+=d.crits??0,i.total_normal_damage+=d.total_normal_damage??0,i.max_normal_damage=Math.max(i.max_normal_damage,d.max_normal_damage??0),i.total_crit_damage+=d.total_crit_damage??0,i.max_crit_damage=Math.max(i.max_crit_damage,d.max_crit_damage??0)}}for(const[g,D]of Object.entries(u.defense??{})){l[g]||(l[g]={});for(const[y,E]of Object.entries(D)){l[g][y]||(l[g][y]={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 i=l[g][y],d=E;i.total_attacks+=d.total_attacks??0,i.failed_attacks+=d.failed_attacks??0,i.total_normal_damage+=d.total_normal_damage??0,i.max_normal_damage=Math.max(i.max_normal_damage,d.max_normal_damage??0),i.total_crit_damage+=d.total_crit_damage??0,i.max_crit_damage=Math.max(i.max_crit_damage,d.max_crit_damage??0)}}v+=u.aetheria_surges??0,$+=u.cloak_surges??0}return j.__cloak_surges__&&!h&&($+=j.__cloak_surges__.cloak_surges??0),{offense:e,defense:l,aeth:v,cloak:$}},[j,S,h]),r=G(n.offense),b=F(n.defense,"MeleeMissile"),M=F(n.defense,"Magic");r.attacks>0&&((r.attacks-r.failed)/r.attacks*100).toFixed(0);const N=b.attacks>0?(b.failed/b.attacks*100).toFixed(0):"0",W=M.attacks>0?(M.failed/M.attacks*100).toFixed(0):"0",C=r.attacks-r.failed,O=C-r.crits,z=O>0?Math.round(r.normalDmg/O):0;r.crits>0&&Math.round(r.critDmg/r.crits);const I=C>0?(r.crits/C*100).toFixed(1):"0",s=e=>e===0?"":e.toLocaleString();return t.jsxs(L,{id:c,title:`Combat: ${a}`,zIndex:x,width:640,height:520,children:[t.jsxs("div",{style:{display:"flex",gap:4,padding:"4px 8px",borderBottom:"1px solid #333",alignItems:"center"},children:[t.jsx("button",{className:`ml-stats-range-btn ${f==="session"?"active":""}`,onClick:()=>k("session"),children:"Session"}),t.jsx("button",{className:`ml-stats-range-btn ${f==="lifetime"?"active":""}`,onClick:()=>k("lifetime"),children:"Lifetime"}),t.jsx("div",{style:{flex:1}}),f==="session"&&t.jsx("button",{style:{fontSize:"0.6rem",padding:"2px 8px",background:"rgba(204,68,68,0.15)",color:"#c66",border:"1px solid rgba(204,68,68,0.3)",borderRadius:3,cursor:"pointer"},onClick:()=>{confirm("Clear current session stats?")&&m(e=>e&&{...e,session:{total_damage_given:0,total_damage_received:0,total_kills:0,total_aetheria_surges:0,total_cloak_surges:0,monsters:{}}})},children:"Clear Session"})]}),t.jsxs("div",{style:{display:"flex",flex:1,overflow:"hidden"},children:[t.jsxs("div",{style:{width:240,borderRight:"1px solid #333",overflowY:"auto",fontSize:"0.72rem"},children:[t.jsxs("div",{style:{display:"flex",padding:"3px 6px",borderBottom:"1px solid #333",color:"#777",fontSize:"0.65rem",fontWeight:600},children:[t.jsx("span",{style:{width:14}}),t.jsx("span",{style:{flex:1},children:"Monster"}),t.jsx("span",{style:{width:40,textAlign:"right"},children:"Kills"}),t.jsx("span",{style:{width:55,textAlign:"right"},children:"Dmg"})]}),t.jsxs("div",{style:{display:"flex",padding:"3px 6px",cursor:"pointer",background:h===null?"#2a3a4a":"",borderBottom:"1px solid #222",color:"#ddd"},onClick:()=>R(null),children:[t.jsx("span",{style:{width:14,color:"#888"},children:h===null?"*":""}),t.jsx("span",{style:{flex:1},children:"All"}),t.jsx("span",{style:{width:40,textAlign:"right"},children:s((p==null?void 0:p.total_kills)??0)}),t.jsx("span",{style:{width:55,textAlign:"right"},children:s((p==null?void 0:p.total_damage_given)??0)})]}),S.map(e=>{const l=j[e];return t.jsxs("div",{style:{display:"flex",padding:"2px 6px",cursor:"pointer",background:h===e?"#2a3a4a":"",borderBottom:"1px solid #1a1a1a",color:"#ccc"},onClick:()=>R(e),children:[t.jsx("span",{style:{width:14,color:"#888"},children:h===e?"*":""}),t.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e}),t.jsx("span",{style:{width:40,textAlign:"right"},children:s(l.kill_count)}),t.jsx("span",{style:{width:55,textAlign:"right"},children:s(l.damage_given)})]},e)})]}),t.jsx("div",{style:{flex:1,overflowY:"auto",padding:6,fontSize:"0.72rem"},children:t.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[t.jsx("thead",{children:t.jsxs("tr",{style:{color:"#777",fontSize:"0.65rem"},children:[t.jsx("th",{style:{textAlign:"left",padding:"1px 4px"}}),t.jsx("th",{style:{textAlign:"right",padding:"1px 3px"},children:"Given M/M"}),t.jsx("th",{style:{textAlign:"right",padding:"1px 3px"},children:"Given Mag"}),t.jsx("th",{style:{width:4}}),t.jsx("th",{style:{textAlign:"right",padding:"1px 3px"},children:"Recv M/M"}),t.jsx("th",{style:{textAlign:"right",padding:"1px 3px"},children:"Recv Mag"}),t.jsx("th",{style:{width:4}}),t.jsx("th",{style:{textAlign:"left",padding:"1px 3px"},children:"Stats"}),t.jsx("th",{style:{textAlign:"right",padding:"1px 3px"}})]})}),t.jsxs("tbody",{children:[w.map((e,l)=>{const v=[["Evades",b.attacks>0?`${s(b.attacks)} (${N}%)`:""],["Resists",M.attacks>0?`${s(M.attacks)} (${W}%)`:""],["A.Surges",n.aeth>0?`${s(n.aeth)}`:""],["C.Surges",n.cloak>0?`${s(n.cloak)}`:""],["",""],["",""],["Av/Mx",z>0?`${s(z)} / ${s(r.maxNormal)}`:""],["Crits",r.crits>0?`${s(r.crits)} (${I}%)`:""]][l]??["",""];return t.jsxs("tr",{children:[t.jsx("td",{style:{padding:"1px 4px",color:"#888"},children:e}),t.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:s(_(n.offense,"MeleeMissile",e))}),t.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:s(_(n.offense,"Magic",e))}),t.jsx("td",{}),t.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:s(_(n.defense,"MeleeMissile",e))}),t.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:s(_(n.defense,"Magic",e))}),t.jsx("td",{}),t.jsx("td",{style:{padding:"1px 3px",color:"#777",fontWeight:600,fontSize:"0.65rem"},children:v[0]}),t.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:v[1]})]},e)}),t.jsx("tr",{children:t.jsx("td",{colSpan:9,style:{height:4}})}),t.jsxs("tr",{children:[t.jsx("td",{style:{padding:"1px 4px",color:"#888",fontWeight:600},children:"Total"}),t.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:s(w.reduce((e,l)=>e+_(n.offense,"MeleeMissile",l),0))}),t.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:s(w.reduce((e,l)=>e+_(n.offense,"Magic",l),0))}),t.jsx("td",{}),t.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:s(w.reduce((e,l)=>e+_(n.defense,"MeleeMissile",l),0))}),t.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:s(w.reduce((e,l)=>e+_(n.defense,"Magic",l),0))}),t.jsx("td",{}),t.jsx("td",{style:{padding:"1px 3px",color:"#777",fontWeight:600,fontSize:"0.65rem"},children:"Total"}),t.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:s(r.normalDmg+r.critDmg)})]})]})]})})]})]})};export{Y as CombatStatsWindow}; +import{r as A,a as B,j as t,D as L}from"./index-fhoLMRWN.js";import"./react-yfL0ty4i.js";const w=["Typeless","Slash","Pierce","Bludgeon","Fire","Cold","Acid","Electric"];function _(c,a,x){var o,m,f,k;return(((m=(o=c==null?void 0:c[a])==null?void 0:o[x])==null?void 0:m.total_normal_damage)??0)+(((k=(f=c==null?void 0:c[a])==null?void 0:f[x])==null?void 0:k.total_crit_damage)??0)}function G(c){let a={attacks:0,failed:0,crits:0,normalDmg:0,maxNormal:0,critDmg:0,maxCrit:0};if(!c)return a;for(const x of Object.values(c))for(const o of Object.values(x))a.attacks+=o.total_attacks??0,a.failed+=o.failed_attacks??0,a.crits+=o.crits??0,a.normalDmg+=o.total_normal_damage??0,a.maxNormal=Math.max(a.maxNormal,o.max_normal_damage??0),a.critDmg+=o.total_crit_damage??0,a.maxCrit=Math.max(a.maxCrit,o.max_crit_damage??0);return a}function F(c,a){let x={attacks:0,failed:0};const o=c==null?void 0:c[a];if(!o)return x;for(const m of Object.values(o))x.attacks+=m.total_attacks??0,x.failed+=m.failed_attacks??0;return x}const Y=({id:c,charName:a,zIndex:x})=>{const[o,m]=A.useState(null),[f,k]=A.useState("session"),[h,R]=A.useState(null);A.useEffect(()=>{B(`/combat-stats/${encodeURIComponent(a)}`).then(m).catch(()=>{});const e=setInterval(()=>{B(`/combat-stats/${encodeURIComponent(a)}`).then(m).catch(()=>{})},1e4);return()=>clearInterval(e)},[a]);const p=o==null?void 0:o[f],j=(p==null?void 0:p.monsters)??{},S=Object.keys(j).filter(e=>e!=="__cloak_surges__").sort(),n=A.useMemo(()=>{let e={},l={},v=0,$=0;const T=h?[j[h]].filter(Boolean):S.map(u=>j[u]);for(const u of T)if(u){for(const[g,D]of Object.entries(u.offense??{})){e[g]||(e[g]={});for(const[y,E]of Object.entries(D)){e[g][y]||(e[g][y]={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 i=e[g][y],d=E;i.total_attacks+=d.total_attacks??0,i.failed_attacks+=d.failed_attacks??0,i.crits+=d.crits??0,i.total_normal_damage+=d.total_normal_damage??0,i.max_normal_damage=Math.max(i.max_normal_damage,d.max_normal_damage??0),i.total_crit_damage+=d.total_crit_damage??0,i.max_crit_damage=Math.max(i.max_crit_damage,d.max_crit_damage??0)}}for(const[g,D]of Object.entries(u.defense??{})){l[g]||(l[g]={});for(const[y,E]of Object.entries(D)){l[g][y]||(l[g][y]={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 i=l[g][y],d=E;i.total_attacks+=d.total_attacks??0,i.failed_attacks+=d.failed_attacks??0,i.total_normal_damage+=d.total_normal_damage??0,i.max_normal_damage=Math.max(i.max_normal_damage,d.max_normal_damage??0),i.total_crit_damage+=d.total_crit_damage??0,i.max_crit_damage=Math.max(i.max_crit_damage,d.max_crit_damage??0)}}v+=u.aetheria_surges??0,$+=u.cloak_surges??0}return j.__cloak_surges__&&!h&&($+=j.__cloak_surges__.cloak_surges??0),{offense:e,defense:l,aeth:v,cloak:$}},[j,S,h]),r=G(n.offense),b=F(n.defense,"MeleeMissile"),M=F(n.defense,"Magic");r.attacks>0&&((r.attacks-r.failed)/r.attacks*100).toFixed(0);const N=b.attacks>0?(b.failed/b.attacks*100).toFixed(0):"0",W=M.attacks>0?(M.failed/M.attacks*100).toFixed(0):"0",C=r.attacks-r.failed,O=C-r.crits,z=O>0?Math.round(r.normalDmg/O):0;r.crits>0&&Math.round(r.critDmg/r.crits);const I=C>0?(r.crits/C*100).toFixed(1):"0",s=e=>e===0?"":e.toLocaleString();return t.jsxs(L,{id:c,title:`Combat: ${a}`,zIndex:x,width:640,height:520,children:[t.jsxs("div",{style:{display:"flex",gap:4,padding:"4px 8px",borderBottom:"1px solid #333",alignItems:"center"},children:[t.jsx("button",{className:`ml-stats-range-btn ${f==="session"?"active":""}`,onClick:()=>k("session"),children:"Session"}),t.jsx("button",{className:`ml-stats-range-btn ${f==="lifetime"?"active":""}`,onClick:()=>k("lifetime"),children:"Lifetime"}),t.jsx("div",{style:{flex:1}}),f==="session"&&t.jsx("button",{style:{fontSize:"0.6rem",padding:"2px 8px",background:"rgba(204,68,68,0.15)",color:"#c66",border:"1px solid rgba(204,68,68,0.3)",borderRadius:3,cursor:"pointer"},onClick:()=>{confirm("Clear current session stats?")&&m(e=>e&&{...e,session:{total_damage_given:0,total_damage_received:0,total_kills:0,total_aetheria_surges:0,total_cloak_surges:0,monsters:{}}})},children:"Clear Session"})]}),t.jsxs("div",{style:{display:"flex",flex:1,overflow:"hidden"},children:[t.jsxs("div",{style:{width:240,borderRight:"1px solid #333",overflowY:"auto",fontSize:"0.72rem"},children:[t.jsxs("div",{style:{display:"flex",padding:"3px 6px",borderBottom:"1px solid #333",color:"#777",fontSize:"0.65rem",fontWeight:600},children:[t.jsx("span",{style:{width:14}}),t.jsx("span",{style:{flex:1},children:"Monster"}),t.jsx("span",{style:{width:40,textAlign:"right"},children:"Kills"}),t.jsx("span",{style:{width:55,textAlign:"right"},children:"Dmg"})]}),t.jsxs("div",{style:{display:"flex",padding:"3px 6px",cursor:"pointer",background:h===null?"#2a3a4a":"",borderBottom:"1px solid #222",color:"#ddd"},onClick:()=>R(null),children:[t.jsx("span",{style:{width:14,color:"#888"},children:h===null?"*":""}),t.jsx("span",{style:{flex:1},children:"All"}),t.jsx("span",{style:{width:40,textAlign:"right"},children:s((p==null?void 0:p.total_kills)??0)}),t.jsx("span",{style:{width:55,textAlign:"right"},children:s((p==null?void 0:p.total_damage_given)??0)})]}),S.map(e=>{const l=j[e];return t.jsxs("div",{style:{display:"flex",padding:"2px 6px",cursor:"pointer",background:h===e?"#2a3a4a":"",borderBottom:"1px solid #1a1a1a",color:"#ccc"},onClick:()=>R(e),children:[t.jsx("span",{style:{width:14,color:"#888"},children:h===e?"*":""}),t.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e}),t.jsx("span",{style:{width:40,textAlign:"right"},children:s(l.kill_count)}),t.jsx("span",{style:{width:55,textAlign:"right"},children:s(l.damage_given)})]},e)})]}),t.jsx("div",{style:{flex:1,overflowY:"auto",padding:6,fontSize:"0.72rem"},children:t.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[t.jsx("thead",{children:t.jsxs("tr",{style:{color:"#777",fontSize:"0.65rem"},children:[t.jsx("th",{style:{textAlign:"left",padding:"1px 4px"}}),t.jsx("th",{style:{textAlign:"right",padding:"1px 3px"},children:"Given M/M"}),t.jsx("th",{style:{textAlign:"right",padding:"1px 3px"},children:"Given Mag"}),t.jsx("th",{style:{width:4}}),t.jsx("th",{style:{textAlign:"right",padding:"1px 3px"},children:"Recv M/M"}),t.jsx("th",{style:{textAlign:"right",padding:"1px 3px"},children:"Recv Mag"}),t.jsx("th",{style:{width:4}}),t.jsx("th",{style:{textAlign:"left",padding:"1px 3px"},children:"Stats"}),t.jsx("th",{style:{textAlign:"right",padding:"1px 3px"}})]})}),t.jsxs("tbody",{children:[w.map((e,l)=>{const v=[["Evades",b.attacks>0?`${s(b.attacks)} (${N}%)`:""],["Resists",M.attacks>0?`${s(M.attacks)} (${W}%)`:""],["A.Surges",n.aeth>0?`${s(n.aeth)}`:""],["C.Surges",n.cloak>0?`${s(n.cloak)}`:""],["",""],["",""],["Av/Mx",z>0?`${s(z)} / ${s(r.maxNormal)}`:""],["Crits",r.crits>0?`${s(r.crits)} (${I}%)`:""]][l]??["",""];return t.jsxs("tr",{children:[t.jsx("td",{style:{padding:"1px 4px",color:"#888"},children:e}),t.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:s(_(n.offense,"MeleeMissile",e))}),t.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:s(_(n.offense,"Magic",e))}),t.jsx("td",{}),t.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:s(_(n.defense,"MeleeMissile",e))}),t.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:s(_(n.defense,"Magic",e))}),t.jsx("td",{}),t.jsx("td",{style:{padding:"1px 3px",color:"#777",fontWeight:600,fontSize:"0.65rem"},children:v[0]}),t.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:v[1]})]},e)}),t.jsx("tr",{children:t.jsx("td",{colSpan:9,style:{height:4}})}),t.jsxs("tr",{children:[t.jsx("td",{style:{padding:"1px 4px",color:"#888",fontWeight:600},children:"Total"}),t.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:s(w.reduce((e,l)=>e+_(n.offense,"MeleeMissile",l),0))}),t.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:s(w.reduce((e,l)=>e+_(n.offense,"Magic",l),0))}),t.jsx("td",{}),t.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:s(w.reduce((e,l)=>e+_(n.defense,"MeleeMissile",l),0))}),t.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:s(w.reduce((e,l)=>e+_(n.defense,"Magic",l),0))}),t.jsx("td",{}),t.jsx("td",{style:{padding:"1px 3px",color:"#777",fontWeight:600,fontSize:"0.65rem"},children:"Total"}),t.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:s(r.normalDmg+r.critDmg)})]})]})]})})]})]})};export{Y as CombatStatsWindow}; diff --git a/static/v2/assets/InventoryWindow-C9mxhtJV.js b/static/assets/InventoryWindow-YNou026w.js similarity index 99% rename from static/v2/assets/InventoryWindow-C9mxhtJV.js rename to static/assets/InventoryWindow-YNou026w.js index 949b0ad1..cb8aacc4 100644 --- a/static/v2/assets/InventoryWindow-C9mxhtJV.js +++ b/static/assets/InventoryWindow-YNou026w.js @@ -1 +1 @@ -import{r as _,a as T,j as n,D as Q}from"./index-BiGwMY76.js";import"./react-yfL0ty4i.js";function X(e){var s,d;if(!e)return e;const o=c=>c!=null&&c!==-1&&c!==-1?c:void 0,r=e.IntValues||{};return{item_id:e.item_id??e.Id??0,name:e.name??e.Name??((s=e.StringValues)==null?void 0:s["1"])??"Unknown",icon:e.icon??e.Icon??0,object_class:e.object_class??e.ObjectClass??0,current_wielded_location:e.current_wielded_location??o(e.CurrentWieldedLocation)??o(Number(r[10]))??0,container_id:e.container_id??e.ContainerId??0,items_capacity:e.items_capacity??o(e.ItemsCapacity)??o(Number(r[6]))??((d=e.enhanced_properties)==null?void 0:d.ItemSlots_Decal)??void 0,value:e.value??o(e.Value)??o(Number(r[19]))??0,burden:e.burden??o(e.Burden)??o(Number(r[5]))??0,armor_level:e.armor_level??o(e.ArmorLevel),max_damage:e.max_damage??o(e.MaxDamage),material:e.material??e.material_name??e.Material??void 0,item_set:e.item_set??e.ItemSet??void 0,imbue:e.imbue??e.Imbue??void 0,tinks:e.tinks??o(e.Tinks),workmanship:e.workmanship??o(e.Workmanship),equip_skill:e.equip_skill??e.equip_skill_name??e.EquipSkill??void 0,wield_level:e.wield_level??o(e.WieldLevel),skill_level:e.skill_level??o(e.SkillLevel),lore_requirement:e.lore_requirement??o(e.LoreRequirement),attack_bonus:e.attack_bonus??o(e.AttackBonus),melee_defense_bonus:e.melee_defense_bonus??o(e.MeleeDefenseBonus),magic_defense_bonus:e.magic_defense_bonus??o(e.MagicDBonus),damage_bonus:e.damage_bonus??o(e.DamageBonus),damage_rating:e.damage_rating??o(e.DamRating),crit_rating:e.crit_rating??o(e.CritRating),heal_boost_rating:e.heal_boost_rating??o(e.HealBoostRating),current_mana:e.current_mana??o(Number(r[218103815]))??void 0,max_mana:e.max_mana??o(Number(r[218103814]))??void 0,spellcraft:e.spellcraft??void 0,damage_range:e.damage_range??void 0,damage_type:e.damage_type??void 0,speed_text:e.speed_text??void 0,mana_display:e.mana_display??void 0,spells:e.spells??void 0,icon_overlay_id:e.icon_overlay_id??o(Number(r[218103849]))??void 0,icon_underlay_id:e.icon_underlay_id??o(Number(r[218103850]))??void 0,_raw:e}}function C(e){return!e||e<=0?"06000133":(e+100663296).toString(16).toUpperCase().padStart(8,"0")}const M={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}},I={},ne=[32768,67108864,65536,131072,262144,524288],oe=[1,512,2048,1024,4096,8192,16384,32,256],te=[2,4,134217728,268435456,536870912,1073741824],ie=[2097152,1048576,4194304,16777216,33554432,8388608];(()=>{const e=new Set;Object.entries(M).forEach(([o,r])=>{const s=`${r.row}-${r.col}`,d=parseInt(o);e.has(s)||(e.add(s),ne.includes(d)?I[s]="#3a2555":oe.includes(d)?I[s]="#1e2e55":te.includes(d)?I[s]="#1e3e3e":ie.includes(d)?I[s]="#142040":I[s]="#2a2a2a")})})();const $="#af7a30";function W({item:e,size:o=36}){const r={position:"absolute",top:0,left:0,width:o,height:o,border:"none",background:"transparent",imageRendering:"pixelated"},s=e.icon_underlay_id&&e.icon_underlay_id>100?`/icons/${C(e.icon_underlay_id)}.png`:null,d=e.icon_overlay_id&&e.icon_overlay_id>100?`/icons/${C(e.icon_overlay_id)}.png`:null;return n.jsxs("div",{style:{width:o,height:o,position:"relative"},children:[s&&n.jsx("img",{src:s,alt:"",style:{...r,zIndex:1},onError:c=>{c.target.style.display="none"}}),n.jsx("img",{src:`/icons/${C(e.icon)}.png`,alt:e.name,style:{...r,zIndex:2},onError:c=>{c.target.src="/icons/06000133.png"}}),d&&n.jsx("img",{src:d,alt:"",style:{...r,zIndex:3},onError:c=>{c.target.style.display="none"}})]})}function le({item:e,x:o,y:r}){var j,L;const s=g=>g!=null&&g!==-1&&g!==-1,d=g=>g.toLocaleString(),c=g=>`${((g-1)*100).toFixed(1)}%`;return n.jsxs("div",{style:{position:"fixed",left:o+14,top:r+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:[n.jsx("div",{style:{color:"#ffcc00",fontWeight:"bold",fontSize:14,marginBottom:4},children:e.name}),n.jsxs("div",{style:{color:"#aaa"},children:["Value: ",d(e.value)," · Burden: ",e.burden]}),e.workmanship&&n.jsxs("div",{style:{color:"#aaa"},children:["Workmanship: ",e.workmanship]}),e.material&&n.jsxs("div",{style:{color:"#88ff88"},children:["Material: ",e.material]}),s(e.armor_level)&&n.jsxs("div",{style:{color:"#88ff88"},children:["Armor Level: ",e.armor_level]}),s(e.max_damage)&&n.jsxs("div",{style:{color:"#88ff88"},children:["Max Damage: ",e.max_damage]}),e.damage_range&&n.jsxs("div",{style:{color:"#88ff88"},children:["Damage: ",e.damage_range,e.damage_type?`, ${e.damage_type}`:""]}),s(e.attack_bonus)&&e.attack_bonus!==1&&n.jsxs("div",{style:{color:"#88ff88"},children:["Attack: +",c(e.attack_bonus)]}),s(e.melee_defense_bonus)&&e.melee_defense_bonus!==1&&n.jsxs("div",{style:{color:"#88ff88"},children:["Melee Def: +",c(e.melee_defense_bonus)]}),s(e.magic_defense_bonus)&&e.magic_defense_bonus!==1&&n.jsxs("div",{style:{color:"#88ff88"},children:["Magic Def: +",c(e.magic_defense_bonus)]}),e.equip_skill&&n.jsxs("div",{style:{color:"#ddd"},children:["Skill: ",e.equip_skill]}),s(e.wield_level)&&n.jsxs("div",{style:{color:"#ffaa00"},children:["Wield Level: ",e.wield_level]}),s(e.lore_requirement)&&n.jsxs("div",{style:{color:"#ffaa00"},children:["Lore: ",e.lore_requirement]}),e.imbue&&n.jsxs("div",{style:{color:"#88ff88"},children:["Imbue: ",e.imbue]}),e.item_set&&n.jsxs("div",{style:{color:"#88ff88"},children:["Set: ",e.item_set]}),s(e.tinks)&&n.jsxs("div",{style:{color:"#88ff88"},children:["Tinks: ",e.tinks]}),s(e.damage_rating)&&n.jsxs("div",{children:["Damage Rating: ",e.damage_rating]}),s(e.crit_rating)&&n.jsxs("div",{children:["Crit Rating: ",e.crit_rating]}),s(e.heal_boost_rating)&&n.jsxs("div",{children:["Heal Boost: ",e.heal_boost_rating]}),e.spellcraft&&n.jsxs("div",{style:{color:"#dda0dd"},children:["Spellcraft: ",e.spellcraft]}),s(e.current_mana)&&s(e.max_mana)&&n.jsxs("div",{style:{color:"#98d7ff"},children:["Mana: ",e.current_mana," / ",e.max_mana]}),((L=(j=e.spells)==null?void 0:j.spells)==null?void 0:L.length)>0&&n.jsxs("div",{style:{color:"#4a90e2",marginTop:4,fontSize:12},children:["Spells: ",e.spells.spells.map(g=>g.name).join(", ")]})]})}function G({iconSrc:e,isActive:o,fillPct:r,label:s,onClick:d}){const c=r>90?"#b7432c":r>70?"#d8a431":"#00ff00";return n.jsxs("div",{onClick:d,title:s,style:{display:"flex",alignItems:"flex-start",gap:2,cursor:"pointer",flexShrink:0,marginTop:3,position:"relative"},children:[o&&n.jsx("span",{style:{position:"absolute",left:-11,top:8,color:$,fontSize:10},children:"▶"}),n.jsx("div",{style:{width:30,height:30,border:o?"1px solid #00ff00":"1px solid #333",boxShadow:o?"0 0 4px #00ff00":"none",background:"#000",display:"flex",alignItems:"center",justifyContent:"center"},children:n.jsx("img",{src:e,alt:"",style:{width:26,height:26,objectFit:"contain",imageRendering:"pixelated"},onError:j=>{j.target.src="/icons/06001080.png"}})}),n.jsx("div",{style:{width:7,height:30,background:"#222",border:"1px solid #666",position:"relative",overflow:"hidden",borderRadius:2},title:`${Math.round(r)}% full`,children:n.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,height:`${r}%`,background:c,minHeight:r>0?2:0}})})]})}const ce=({id:e,charName:o,zIndex:r,inventoryVersion:s,equipmentCantrips:d})=>{var V,q,Y;const[c,j]=_.useState([]),[L,g]=_.useState(!0),[k,H]=_.useState(null),[B,U]=_.useState(null),[f,J]=_.useState(null),D=_.useRef(0),O=_.useRef(!1);_.useEffect(()=>{g(!0),Promise.all([T(`/inventory/${encodeURIComponent(o)}?limit=1000`).catch(()=>({items:[]})),T(`/character-stats/${encodeURIComponent(o)}`).catch(()=>null)]).then(([t,i])=>{j((t.items??[]).map(X)),J(i),O.current=!0}).finally(()=>g(!1))},[o]),_.useEffect(()=>{if(!(!O.current||!s))return clearTimeout(D.current),D.current=window.setTimeout(()=>{T(`/inventory/${encodeURIComponent(o)}?limit=1000`).then(t=>j((t.items??[]).map(X))).catch(()=>{})},2e3),()=>clearTimeout(D.current)},[o,s]);const y=_.useCallback((t,i)=>{U(t&&i?{item:t,x:i.clientX,y:i.clientY}:null)},[]),Z=_.useMemo(()=>{const t=new Set,i=[];return Object.entries(M).forEach(([u,m])=>{const a=`${m.row}-${m.col}`;t.has(a)||(t.add(a),i.push({key:a,...m,mask:parseInt(u)}))}),i},[]),{equippedMap:A,containers:z,packItems:w}=_.useMemo(()=>{const t=new Map,i=[],u=new Set,m=new Map;c.forEach(l=>{l.object_class===10&&(i.push(l),u.add(l.item_id))}),i.sort((l,h)=>(l.item_id>>>0)-(h.item_id>>>0));let a=null;return c.forEach(l=>{l.current_wielded_location>0&&l.container_id&&!u.has(l.container_id)&&(a=l.container_id)}),c.forEach(l=>{if(u.has(l.item_id))return;const h=l.current_wielded_location;if(h>0)if(l.object_class===2)Object.entries(M).forEach(([b,x])=>{if((h&parseInt(b))===parseInt(b)){const v=`${x.row}-${x.col}`;t.has(v)||t.set(v,l)}});else{let b=!1;if(M[h]){const x=M[h],v=`${x.row}-${x.col}`;t.has(v)||(t.set(v,l),b=!0)}if(!b){for(const[x,v]of Object.entries(M))if((h&parseInt(x))===parseInt(x)){const K=`${v.row}-${v.col}`;if(!t.has(K)){t.set(K,l),b=!0;break}}}}else{let p=l.container_id||0;a&&p===a&&(p=0),m.has(p)||m.set(p,[]),m.get(p).push(l)}}),{equippedMap:t,containers:i,packItems:m}},[c]);let S=w.get(0)??[],F=0;if(S.length===0){let t=0;for(const[i,u]of w.entries())!z.some(m=>m.item_id===i)&&u.length>t&&(t=u.length,F=i);S=w.get(F)??[]}const P=k!==null?w.get(k)??[]:S,N=(f==null?void 0:f.burden_units)??((V=f==null?void 0:f.stats_data)==null?void 0:V.burden_units)??0,R=(f==null?void 0:f.encumbrance_capacity)??((q=f==null?void 0:f.stats_data)==null?void 0:q.encumbrance_capacity)??0,E=R>0?Math.min(200,N/R*100):0,ee=E>150?"#b7432c":E>100?"#d8a431":"#2e8b57";return L?n.jsx(Q,{id:e,title:`Inventory: ${o}`,zIndex:r,width:572,height:720,children:n.jsx("div",{style:{padding:20,color:"#666",fontStyle:"italic"},children:"Loading inventory..."})}):n.jsxs(Q,{id:e,title:`Inventory: ${o}`,zIndex:r,width:572,height:720,children:[n.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:[n.jsxs("div",{style:{width:316,display:"flex",flexDirection:"column",overflow:"hidden"},children:[n.jsx("div",{style:{position:"relative",height:270,minHeight:270,background:"#0a0a0a",borderBottom:`1px solid ${$}`},children:Z.map(t=>{const i=A.get(t.key),u=I[t.key]??"#2a2a2a";return n.jsx("div",{style:{position:"absolute",left:(t.col-1)*44+4,top:(t.row-1)*44+4,width:36,height:36,background:i?"#5a5a62":u,border:i?"2px solid #00ffff":"2px outset #6a6a72",boxShadow:i?"0 0 5px #00ffff, inset 0 0 5px rgba(0,255,255,0.2)":"none",display:"flex",alignItems:"center",justifyContent:"center",cursor:i?"pointer":"default"},onMouseEnter:m=>i&&y(i,m),onMouseMove:m=>i&&y(i,m),onMouseLeave:()=>y(null),children:i?n.jsx(W,{item:i,size:32}):n.jsx("img",{src:"/icons/06000133.png",alt:"",style:{width:28,height:28,opacity:.15,filter:"grayscale(100%)",imageRendering:"pixelated"}})},t.key)})}),n.jsxs("div",{style:{padding:"3px 6px",fontSize:11,color:"#ccc",background:"#111",borderBottom:`1px solid ${$}`},children:["Contents of ",k!==null?((Y=z.find(t=>t.item_id===k))==null?void 0:Y.name)??"Pack":"Backpack"]}),n.jsxs("div",{style:{flex:1,overflowY:"auto",display:"grid",gridTemplateColumns:"repeat(6, 36px)",gridAutoRows:36,gap:2,padding:4,alignContent:"start"},children:[P.map((t,i)=>n.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:u=>y(t,u),onMouseMove:u=>y(t,u),onMouseLeave:()=>y(null),children:n.jsx(W,{item:t,size:32})},t.item_id??i)),Array.from({length:Math.max(0,24-P.length)}).map((t,i)=>n.jsx("div",{style:{width:36,height:36,background:"#0a0a0a",border:"1px solid #1a1a1a"}},`e${i}`))]})]}),n.jsxs("div",{style:{width:42,display:"flex",flexDirection:"column",alignItems:"center",padding:"4px 2px",borderLeft:`1px solid ${$}`,borderRight:`1px solid ${$}`},children:[n.jsx("div",{style:{textAlign:"center",fontSize:8,color:"#ccc",marginBottom:2},children:R>0?`${Math.floor(E)}%`:"Burden"}),n.jsx("div",{style:{width:14,height:40,background:"#111",border:"1px solid #555",position:"relative",overflow:"hidden",marginBottom:6,flexShrink:0},title:R>0?`${N.toLocaleString()} / ${R.toLocaleString()}`:`Burden: ${c.reduce((t,i)=>t+(i.burden??0),0).toLocaleString()}`,children:n.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,height:`${E/2}%`,background:ee,transition:"height 0.3s"}})}),n.jsx(G,{iconSrc:"/icons/0600127E.png",isActive:k===null,fillPct:S.length>0?Math.min(100,S.length/102*100):0,label:`Backpack (${S.length}/102)`,onClick:()=>H(null)}),z.map(t=>{const i=t.item_id,u=c.filter(l=>l.container_id===i&&l.item_id!==i).length,m=t.items_capacity||24,a=m>0?Math.min(100,u/m*100):0;return n.jsx(G,{iconSrc:`/icons/${C(t.icon)}.png`,isActive:k===i,fillPct:a,label:`${t.name} (${u}/${m})`,onClick:()=>H(i)},i)})]}),n.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden",minWidth:160},children:[n.jsx("div",{style:{padding:"4px 8px",fontSize:"0.72rem",fontWeight:600,color:"#aaa",background:"#111",borderBottom:`1px solid ${$}`},children:"Mana"}),n.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"2px 0"},children:[(()=>{const t=(d==null?void 0:d.items)??[],i=new Map(t.map(a=>[a.item_id,a])),u=d!=null&&d.timestamp?new Date(d.timestamp).getTime():0,m=u>0?Math.max(0,(Date.now()-u)/1e3):0;return Array.from(A.values()).map(a=>{const l=i.get(a.item_id),h=(l==null?void 0:l.current_mana)??a.current_mana??0,p=(l==null?void 0:l.max_mana)??a.max_mana??0,b=(l==null?void 0:l.mana_time_remaining_seconds)??null,x=b!=null?Math.max(0,b-m):null,v=(l==null?void 0:l.state)??(h>0?"active":"not_active");return{...a,current_mana:h,max_mana:p,liveRemaining:x,manaState:v}}).filter(a=>a.current_mana>0||a.max_mana>0).sort((a,l)=>(a.liveRemaining??999999)-(l.liveRemaining??999999)).map((a,l)=>{const h=a.manaState==="active"?"#4c4":a.manaState==="not_active"?"#c44":"#da8";return n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4,padding:"2px 4px",borderBottom:"1px solid #1a1a1a",cursor:"pointer"},onMouseEnter:p=>y(a,p),onMouseMove:p=>y(a,p),onMouseLeave:()=>y(null),children:[n.jsx("div",{style:{width:20,height:20,flexShrink:0},children:n.jsx(W,{item:a,size:20})}),n.jsx("div",{style:{width:8,height:8,borderRadius:"50%",background:h,flexShrink:0}}),n.jsx("div",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"0.68rem",color:"#ccc"},children:a.name}),n.jsxs("div",{style:{fontSize:"0.65rem",color:"#88bbff",whiteSpace:"nowrap",fontVariantNumeric:"tabular-nums"},children:[a.current_mana,"/",a.max_mana]}),n.jsx("div",{style:{fontSize:"0.63rem",color:"#9c9",whiteSpace:"nowrap",fontVariantNumeric:"tabular-nums",minWidth:42,textAlign:"right"},children:a.liveRemaining!=null?se(a.liveRemaining):""})]},l)})})(),Array.from(A.values()).filter(t=>t.current_mana>0||t.max_mana>0).length===0&&n.jsx("div",{style:{padding:12,color:"#555",textAlign:"center",fontSize:"0.7rem"},children:"No mana items equipped"})]})]})]}),B&&n.jsx(le,{item:B.item,x:B.x,y:B.y})]})};function se(e){if(e<=0)return"0h00m";const o=Math.floor(e),r=Math.floor(o/3600),s=Math.floor(o%3600/60);return`${r}h${String(s).padStart(2,"0")}m`}export{ce as InventoryWindow}; +import{r as _,a as T,j as n,D as Q}from"./index-fhoLMRWN.js";import"./react-yfL0ty4i.js";function X(e){var s,d;if(!e)return e;const o=c=>c!=null&&c!==-1&&c!==-1?c:void 0,r=e.IntValues||{};return{item_id:e.item_id??e.Id??0,name:e.name??e.Name??((s=e.StringValues)==null?void 0:s["1"])??"Unknown",icon:e.icon??e.Icon??0,object_class:e.object_class??e.ObjectClass??0,current_wielded_location:e.current_wielded_location??o(e.CurrentWieldedLocation)??o(Number(r[10]))??0,container_id:e.container_id??e.ContainerId??0,items_capacity:e.items_capacity??o(e.ItemsCapacity)??o(Number(r[6]))??((d=e.enhanced_properties)==null?void 0:d.ItemSlots_Decal)??void 0,value:e.value??o(e.Value)??o(Number(r[19]))??0,burden:e.burden??o(e.Burden)??o(Number(r[5]))??0,armor_level:e.armor_level??o(e.ArmorLevel),max_damage:e.max_damage??o(e.MaxDamage),material:e.material??e.material_name??e.Material??void 0,item_set:e.item_set??e.ItemSet??void 0,imbue:e.imbue??e.Imbue??void 0,tinks:e.tinks??o(e.Tinks),workmanship:e.workmanship??o(e.Workmanship),equip_skill:e.equip_skill??e.equip_skill_name??e.EquipSkill??void 0,wield_level:e.wield_level??o(e.WieldLevel),skill_level:e.skill_level??o(e.SkillLevel),lore_requirement:e.lore_requirement??o(e.LoreRequirement),attack_bonus:e.attack_bonus??o(e.AttackBonus),melee_defense_bonus:e.melee_defense_bonus??o(e.MeleeDefenseBonus),magic_defense_bonus:e.magic_defense_bonus??o(e.MagicDBonus),damage_bonus:e.damage_bonus??o(e.DamageBonus),damage_rating:e.damage_rating??o(e.DamRating),crit_rating:e.crit_rating??o(e.CritRating),heal_boost_rating:e.heal_boost_rating??o(e.HealBoostRating),current_mana:e.current_mana??o(Number(r[218103815]))??void 0,max_mana:e.max_mana??o(Number(r[218103814]))??void 0,spellcraft:e.spellcraft??void 0,damage_range:e.damage_range??void 0,damage_type:e.damage_type??void 0,speed_text:e.speed_text??void 0,mana_display:e.mana_display??void 0,spells:e.spells??void 0,icon_overlay_id:e.icon_overlay_id??o(Number(r[218103849]))??void 0,icon_underlay_id:e.icon_underlay_id??o(Number(r[218103850]))??void 0,_raw:e}}function C(e){return!e||e<=0?"06000133":(e+100663296).toString(16).toUpperCase().padStart(8,"0")}const M={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}},I={},ne=[32768,67108864,65536,131072,262144,524288],oe=[1,512,2048,1024,4096,8192,16384,32,256],te=[2,4,134217728,268435456,536870912,1073741824],ie=[2097152,1048576,4194304,16777216,33554432,8388608];(()=>{const e=new Set;Object.entries(M).forEach(([o,r])=>{const s=`${r.row}-${r.col}`,d=parseInt(o);e.has(s)||(e.add(s),ne.includes(d)?I[s]="#3a2555":oe.includes(d)?I[s]="#1e2e55":te.includes(d)?I[s]="#1e3e3e":ie.includes(d)?I[s]="#142040":I[s]="#2a2a2a")})})();const $="#af7a30";function W({item:e,size:o=36}){const r={position:"absolute",top:0,left:0,width:o,height:o,border:"none",background:"transparent",imageRendering:"pixelated"},s=e.icon_underlay_id&&e.icon_underlay_id>100?`/icons/${C(e.icon_underlay_id)}.png`:null,d=e.icon_overlay_id&&e.icon_overlay_id>100?`/icons/${C(e.icon_overlay_id)}.png`:null;return n.jsxs("div",{style:{width:o,height:o,position:"relative"},children:[s&&n.jsx("img",{src:s,alt:"",style:{...r,zIndex:1},onError:c=>{c.target.style.display="none"}}),n.jsx("img",{src:`/icons/${C(e.icon)}.png`,alt:e.name,style:{...r,zIndex:2},onError:c=>{c.target.src="/icons/06000133.png"}}),d&&n.jsx("img",{src:d,alt:"",style:{...r,zIndex:3},onError:c=>{c.target.style.display="none"}})]})}function le({item:e,x:o,y:r}){var j,L;const s=g=>g!=null&&g!==-1&&g!==-1,d=g=>g.toLocaleString(),c=g=>`${((g-1)*100).toFixed(1)}%`;return n.jsxs("div",{style:{position:"fixed",left:o+14,top:r+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:[n.jsx("div",{style:{color:"#ffcc00",fontWeight:"bold",fontSize:14,marginBottom:4},children:e.name}),n.jsxs("div",{style:{color:"#aaa"},children:["Value: ",d(e.value)," · Burden: ",e.burden]}),e.workmanship&&n.jsxs("div",{style:{color:"#aaa"},children:["Workmanship: ",e.workmanship]}),e.material&&n.jsxs("div",{style:{color:"#88ff88"},children:["Material: ",e.material]}),s(e.armor_level)&&n.jsxs("div",{style:{color:"#88ff88"},children:["Armor Level: ",e.armor_level]}),s(e.max_damage)&&n.jsxs("div",{style:{color:"#88ff88"},children:["Max Damage: ",e.max_damage]}),e.damage_range&&n.jsxs("div",{style:{color:"#88ff88"},children:["Damage: ",e.damage_range,e.damage_type?`, ${e.damage_type}`:""]}),s(e.attack_bonus)&&e.attack_bonus!==1&&n.jsxs("div",{style:{color:"#88ff88"},children:["Attack: +",c(e.attack_bonus)]}),s(e.melee_defense_bonus)&&e.melee_defense_bonus!==1&&n.jsxs("div",{style:{color:"#88ff88"},children:["Melee Def: +",c(e.melee_defense_bonus)]}),s(e.magic_defense_bonus)&&e.magic_defense_bonus!==1&&n.jsxs("div",{style:{color:"#88ff88"},children:["Magic Def: +",c(e.magic_defense_bonus)]}),e.equip_skill&&n.jsxs("div",{style:{color:"#ddd"},children:["Skill: ",e.equip_skill]}),s(e.wield_level)&&n.jsxs("div",{style:{color:"#ffaa00"},children:["Wield Level: ",e.wield_level]}),s(e.lore_requirement)&&n.jsxs("div",{style:{color:"#ffaa00"},children:["Lore: ",e.lore_requirement]}),e.imbue&&n.jsxs("div",{style:{color:"#88ff88"},children:["Imbue: ",e.imbue]}),e.item_set&&n.jsxs("div",{style:{color:"#88ff88"},children:["Set: ",e.item_set]}),s(e.tinks)&&n.jsxs("div",{style:{color:"#88ff88"},children:["Tinks: ",e.tinks]}),s(e.damage_rating)&&n.jsxs("div",{children:["Damage Rating: ",e.damage_rating]}),s(e.crit_rating)&&n.jsxs("div",{children:["Crit Rating: ",e.crit_rating]}),s(e.heal_boost_rating)&&n.jsxs("div",{children:["Heal Boost: ",e.heal_boost_rating]}),e.spellcraft&&n.jsxs("div",{style:{color:"#dda0dd"},children:["Spellcraft: ",e.spellcraft]}),s(e.current_mana)&&s(e.max_mana)&&n.jsxs("div",{style:{color:"#98d7ff"},children:["Mana: ",e.current_mana," / ",e.max_mana]}),((L=(j=e.spells)==null?void 0:j.spells)==null?void 0:L.length)>0&&n.jsxs("div",{style:{color:"#4a90e2",marginTop:4,fontSize:12},children:["Spells: ",e.spells.spells.map(g=>g.name).join(", ")]})]})}function G({iconSrc:e,isActive:o,fillPct:r,label:s,onClick:d}){const c=r>90?"#b7432c":r>70?"#d8a431":"#00ff00";return n.jsxs("div",{onClick:d,title:s,style:{display:"flex",alignItems:"flex-start",gap:2,cursor:"pointer",flexShrink:0,marginTop:3,position:"relative"},children:[o&&n.jsx("span",{style:{position:"absolute",left:-11,top:8,color:$,fontSize:10},children:"▶"}),n.jsx("div",{style:{width:30,height:30,border:o?"1px solid #00ff00":"1px solid #333",boxShadow:o?"0 0 4px #00ff00":"none",background:"#000",display:"flex",alignItems:"center",justifyContent:"center"},children:n.jsx("img",{src:e,alt:"",style:{width:26,height:26,objectFit:"contain",imageRendering:"pixelated"},onError:j=>{j.target.src="/icons/06001080.png"}})}),n.jsx("div",{style:{width:7,height:30,background:"#222",border:"1px solid #666",position:"relative",overflow:"hidden",borderRadius:2},title:`${Math.round(r)}% full`,children:n.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,height:`${r}%`,background:c,minHeight:r>0?2:0}})})]})}const ce=({id:e,charName:o,zIndex:r,inventoryVersion:s,equipmentCantrips:d})=>{var V,q,Y;const[c,j]=_.useState([]),[L,g]=_.useState(!0),[k,H]=_.useState(null),[B,U]=_.useState(null),[f,J]=_.useState(null),D=_.useRef(0),O=_.useRef(!1);_.useEffect(()=>{g(!0),Promise.all([T(`/inventory/${encodeURIComponent(o)}?limit=1000`).catch(()=>({items:[]})),T(`/character-stats/${encodeURIComponent(o)}`).catch(()=>null)]).then(([t,i])=>{j((t.items??[]).map(X)),J(i),O.current=!0}).finally(()=>g(!1))},[o]),_.useEffect(()=>{if(!(!O.current||!s))return clearTimeout(D.current),D.current=window.setTimeout(()=>{T(`/inventory/${encodeURIComponent(o)}?limit=1000`).then(t=>j((t.items??[]).map(X))).catch(()=>{})},2e3),()=>clearTimeout(D.current)},[o,s]);const y=_.useCallback((t,i)=>{U(t&&i?{item:t,x:i.clientX,y:i.clientY}:null)},[]),Z=_.useMemo(()=>{const t=new Set,i=[];return Object.entries(M).forEach(([u,m])=>{const a=`${m.row}-${m.col}`;t.has(a)||(t.add(a),i.push({key:a,...m,mask:parseInt(u)}))}),i},[]),{equippedMap:A,containers:z,packItems:w}=_.useMemo(()=>{const t=new Map,i=[],u=new Set,m=new Map;c.forEach(l=>{l.object_class===10&&(i.push(l),u.add(l.item_id))}),i.sort((l,h)=>(l.item_id>>>0)-(h.item_id>>>0));let a=null;return c.forEach(l=>{l.current_wielded_location>0&&l.container_id&&!u.has(l.container_id)&&(a=l.container_id)}),c.forEach(l=>{if(u.has(l.item_id))return;const h=l.current_wielded_location;if(h>0)if(l.object_class===2)Object.entries(M).forEach(([b,x])=>{if((h&parseInt(b))===parseInt(b)){const v=`${x.row}-${x.col}`;t.has(v)||t.set(v,l)}});else{let b=!1;if(M[h]){const x=M[h],v=`${x.row}-${x.col}`;t.has(v)||(t.set(v,l),b=!0)}if(!b){for(const[x,v]of Object.entries(M))if((h&parseInt(x))===parseInt(x)){const K=`${v.row}-${v.col}`;if(!t.has(K)){t.set(K,l),b=!0;break}}}}else{let p=l.container_id||0;a&&p===a&&(p=0),m.has(p)||m.set(p,[]),m.get(p).push(l)}}),{equippedMap:t,containers:i,packItems:m}},[c]);let S=w.get(0)??[],F=0;if(S.length===0){let t=0;for(const[i,u]of w.entries())!z.some(m=>m.item_id===i)&&u.length>t&&(t=u.length,F=i);S=w.get(F)??[]}const P=k!==null?w.get(k)??[]:S,N=(f==null?void 0:f.burden_units)??((V=f==null?void 0:f.stats_data)==null?void 0:V.burden_units)??0,R=(f==null?void 0:f.encumbrance_capacity)??((q=f==null?void 0:f.stats_data)==null?void 0:q.encumbrance_capacity)??0,E=R>0?Math.min(200,N/R*100):0,ee=E>150?"#b7432c":E>100?"#d8a431":"#2e8b57";return L?n.jsx(Q,{id:e,title:`Inventory: ${o}`,zIndex:r,width:572,height:720,children:n.jsx("div",{style:{padding:20,color:"#666",fontStyle:"italic"},children:"Loading inventory..."})}):n.jsxs(Q,{id:e,title:`Inventory: ${o}`,zIndex:r,width:572,height:720,children:[n.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:[n.jsxs("div",{style:{width:316,display:"flex",flexDirection:"column",overflow:"hidden"},children:[n.jsx("div",{style:{position:"relative",height:270,minHeight:270,background:"#0a0a0a",borderBottom:`1px solid ${$}`},children:Z.map(t=>{const i=A.get(t.key),u=I[t.key]??"#2a2a2a";return n.jsx("div",{style:{position:"absolute",left:(t.col-1)*44+4,top:(t.row-1)*44+4,width:36,height:36,background:i?"#5a5a62":u,border:i?"2px solid #00ffff":"2px outset #6a6a72",boxShadow:i?"0 0 5px #00ffff, inset 0 0 5px rgba(0,255,255,0.2)":"none",display:"flex",alignItems:"center",justifyContent:"center",cursor:i?"pointer":"default"},onMouseEnter:m=>i&&y(i,m),onMouseMove:m=>i&&y(i,m),onMouseLeave:()=>y(null),children:i?n.jsx(W,{item:i,size:32}):n.jsx("img",{src:"/icons/06000133.png",alt:"",style:{width:28,height:28,opacity:.15,filter:"grayscale(100%)",imageRendering:"pixelated"}})},t.key)})}),n.jsxs("div",{style:{padding:"3px 6px",fontSize:11,color:"#ccc",background:"#111",borderBottom:`1px solid ${$}`},children:["Contents of ",k!==null?((Y=z.find(t=>t.item_id===k))==null?void 0:Y.name)??"Pack":"Backpack"]}),n.jsxs("div",{style:{flex:1,overflowY:"auto",display:"grid",gridTemplateColumns:"repeat(6, 36px)",gridAutoRows:36,gap:2,padding:4,alignContent:"start"},children:[P.map((t,i)=>n.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:u=>y(t,u),onMouseMove:u=>y(t,u),onMouseLeave:()=>y(null),children:n.jsx(W,{item:t,size:32})},t.item_id??i)),Array.from({length:Math.max(0,24-P.length)}).map((t,i)=>n.jsx("div",{style:{width:36,height:36,background:"#0a0a0a",border:"1px solid #1a1a1a"}},`e${i}`))]})]}),n.jsxs("div",{style:{width:42,display:"flex",flexDirection:"column",alignItems:"center",padding:"4px 2px",borderLeft:`1px solid ${$}`,borderRight:`1px solid ${$}`},children:[n.jsx("div",{style:{textAlign:"center",fontSize:8,color:"#ccc",marginBottom:2},children:R>0?`${Math.floor(E)}%`:"Burden"}),n.jsx("div",{style:{width:14,height:40,background:"#111",border:"1px solid #555",position:"relative",overflow:"hidden",marginBottom:6,flexShrink:0},title:R>0?`${N.toLocaleString()} / ${R.toLocaleString()}`:`Burden: ${c.reduce((t,i)=>t+(i.burden??0),0).toLocaleString()}`,children:n.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,height:`${E/2}%`,background:ee,transition:"height 0.3s"}})}),n.jsx(G,{iconSrc:"/icons/0600127E.png",isActive:k===null,fillPct:S.length>0?Math.min(100,S.length/102*100):0,label:`Backpack (${S.length}/102)`,onClick:()=>H(null)}),z.map(t=>{const i=t.item_id,u=c.filter(l=>l.container_id===i&&l.item_id!==i).length,m=t.items_capacity||24,a=m>0?Math.min(100,u/m*100):0;return n.jsx(G,{iconSrc:`/icons/${C(t.icon)}.png`,isActive:k===i,fillPct:a,label:`${t.name} (${u}/${m})`,onClick:()=>H(i)},i)})]}),n.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden",minWidth:160},children:[n.jsx("div",{style:{padding:"4px 8px",fontSize:"0.72rem",fontWeight:600,color:"#aaa",background:"#111",borderBottom:`1px solid ${$}`},children:"Mana"}),n.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"2px 0"},children:[(()=>{const t=(d==null?void 0:d.items)??[],i=new Map(t.map(a=>[a.item_id,a])),u=d!=null&&d.timestamp?new Date(d.timestamp).getTime():0,m=u>0?Math.max(0,(Date.now()-u)/1e3):0;return Array.from(A.values()).map(a=>{const l=i.get(a.item_id),h=(l==null?void 0:l.current_mana)??a.current_mana??0,p=(l==null?void 0:l.max_mana)??a.max_mana??0,b=(l==null?void 0:l.mana_time_remaining_seconds)??null,x=b!=null?Math.max(0,b-m):null,v=(l==null?void 0:l.state)??(h>0?"active":"not_active");return{...a,current_mana:h,max_mana:p,liveRemaining:x,manaState:v}}).filter(a=>a.current_mana>0||a.max_mana>0).sort((a,l)=>(a.liveRemaining??999999)-(l.liveRemaining??999999)).map((a,l)=>{const h=a.manaState==="active"?"#4c4":a.manaState==="not_active"?"#c44":"#da8";return n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4,padding:"2px 4px",borderBottom:"1px solid #1a1a1a",cursor:"pointer"},onMouseEnter:p=>y(a,p),onMouseMove:p=>y(a,p),onMouseLeave:()=>y(null),children:[n.jsx("div",{style:{width:20,height:20,flexShrink:0},children:n.jsx(W,{item:a,size:20})}),n.jsx("div",{style:{width:8,height:8,borderRadius:"50%",background:h,flexShrink:0}}),n.jsx("div",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"0.68rem",color:"#ccc"},children:a.name}),n.jsxs("div",{style:{fontSize:"0.65rem",color:"#88bbff",whiteSpace:"nowrap",fontVariantNumeric:"tabular-nums"},children:[a.current_mana,"/",a.max_mana]}),n.jsx("div",{style:{fontSize:"0.63rem",color:"#9c9",whiteSpace:"nowrap",fontVariantNumeric:"tabular-nums",minWidth:42,textAlign:"right"},children:a.liveRemaining!=null?se(a.liveRemaining):""})]},l)})})(),Array.from(A.values()).filter(t=>t.current_mana>0||t.max_mana>0).length===0&&n.jsx("div",{style:{padding:12,color:"#555",textAlign:"center",fontSize:"0.7rem"},children:"No mana items equipped"})]})]})]}),B&&n.jsx(le,{item:B.item,x:B.x,y:B.y})]})};function se(e){if(e<=0)return"0h00m";const o=Math.floor(e),r=Math.floor(o/3600),s=Math.floor(o%3600/60);return`${r}h${String(s).padStart(2,"0")}m`}export{ce as InventoryWindow}; diff --git a/static/v2/assets/IssuesWindow-BspsADhQ.js b/static/assets/IssuesWindow-BtrdDjRr.js similarity index 99% rename from static/v2/assets/IssuesWindow-BspsADhQ.js rename to static/assets/IssuesWindow-BtrdDjRr.js index 7fe7adf4..f077ad95 100644 --- a/static/v2/assets/IssuesWindow-BspsADhQ.js +++ b/static/assets/IssuesWindow-BtrdDjRr.js @@ -1 +1 @@ -import{r as n,a as W,j as e,D as L}from"./index-BiGwMY76.js";import"./react-yfL0ty4i.js";const O={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"}},i={padding:"3px 6px",fontSize:"0.8rem",border:"1px solid #555",background:"#2a2a2a",color:"#ddd",borderRadius:0},N={...i,fontSize:"0.75rem"},g={padding:"4px 12px",background:"#4a80c0",color:"#fff",border:"1px solid #336699",cursor:"pointer",fontSize:"0.75rem"},a={padding:"3px 8px",background:"#444",color:"#ccc",border:"1px solid #555",cursor:"pointer",fontSize:"0.7rem"},F=({id:P,zIndex:A})=>{const[h,R]=n.useState([]),[c,m]=n.useState(""),[y,u]=n.useState(""),[f,$]=n.useState("plugin"),[v,d]=n.useState(null),[p,j]=n.useState(""),[b,S]=n.useState(""),[C,z]=n.useState(""),[T,k]=n.useState({}),x=n.useCallback(async()=>{try{const t=await W("/issues");R((t.issues??[]).sort((r,s)=>(r.resolved?1:0)-(s.resolved?1:0)))}catch{}},[]);n.useEffect(()=>{x()},[x]);const l=async(t,r)=>{await fetch(`/api${t}`,{...r,credentials:"include",headers:{"Content-Type":"application/json",...r.headers}}),x()},E=async()=>{c.trim()&&(await l("/issues",{method:"POST",body:JSON.stringify({title:c.trim(),description:y.trim(),category:f})}),m(""),u(""))},B=t=>{if(v===t.id){d(null);return}d(t.id),j(t.title),S(t.description||""),z(t.category||"other")},I=async t=>{p.trim()&&(await l(`/issues/${t}`,{method:"PATCH",body:JSON.stringify({title:p.trim(),description:b.trim(),category:C})}),d(null))},w=async t=>{const r=(T[t]||"").trim();r&&(await l(`/issues/${t}/comments`,{method:"POST",body:JSON.stringify({text:r})}),k(s=>({...s,[t]:""})))};return e.jsxs(L,{id:P,title:"Issues Board",zIndex:A,width:540,height:520,children:[e.jsxs("div",{style:{flex:1,overflowY:"auto",padding:6,fontSize:"0.8rem"},children:[h.length===0&&e.jsx("div",{style:{padding:10,color:"#888",textAlign:"center"},children:"No open issues"}),h.map(t=>{const r=O[t.category]||O.other,s=t.created?new Date(t.created).toLocaleDateString("sv-SE"):"",D=t.comments||[];return e.jsxs("div",{style:{padding:"6px 8px",marginBottom:4,background:"#1f1f1f",borderRadius:3,border:"1px solid #333",opacity:t.resolved?.55:1},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[e.jsx("span",{style:{fontSize:"0.65rem",padding:"1px 6px",borderRadius:3,background:r.color,color:"#fff",fontWeight:600},children:r.label}),e.jsx("strong",{style:{fontSize:"0.8rem",flex:1},children:t.title}),e.jsxs("span",{style:{fontSize:"0.65rem",color:"#888"},children:["by ",t.author||"User"]}),e.jsx("span",{style:{color:"#666",fontSize:"0.65rem"},children:s})]}),t.description&&e.jsx("div",{style:{color:"#999",marginTop:3,fontSize:"0.75rem"},children:t.description}),e.jsxs("div",{style:{display:"flex",gap:4,marginTop:4},children:[t.resolved?e.jsxs(e.Fragment,{children:[e.jsx("button",{style:{...a,fontSize:"0.65rem"},onClick:()=>l(`/issues/${t.id}`,{method:"PATCH",body:JSON.stringify({resolved:!1})}),children:"↻ Reopen"}),e.jsx("button",{style:{...a,fontSize:"0.65rem",color:"#c66"},onClick:()=>{confirm(`Delete issue "${t.title}"?`)&&l(`/issues/${t.id}`,{method:"DELETE"})},children:"🗑 Delete"})]}):e.jsx("button",{style:{...a,fontSize:"0.65rem",background:"rgba(68,204,68,0.15)",color:"#4c4",border:"1px solid rgba(68,204,68,0.3)"},onClick:()=>l(`/issues/${t.id}`,{method:"PATCH",body:JSON.stringify({resolved:!0})}),children:"✓ Resolve"}),e.jsx("button",{style:{...a,fontSize:"0.65rem"},onClick:()=>B(t),children:"✎ Edit"})]}),v===t.id&&e.jsxs("div",{style:{marginTop:4,padding:4,background:"#222",borderRadius:3},children:[e.jsxs("div",{style:{display:"flex",gap:4,marginBottom:4},children:[e.jsx("input",{value:p,onChange:o=>j(o.target.value),style:{...i,flex:1}}),e.jsxs("select",{value:C,onChange:o=>z(o.target.value),style:N,children:[e.jsx("option",{value:"plugin",children:"Plugin"}),e.jsx("option",{value:"overlord",children:"Overlord"}),e.jsx("option",{value:"nav",children:"Nav"}),e.jsx("option",{value:"macro",children:"Macro"}),e.jsx("option",{value:"other",children:"Other"})]})]}),e.jsxs("div",{style:{display:"flex",gap:4},children:[e.jsx("textarea",{value:b,onChange:o=>S(o.target.value),rows:2,style:{...i,flex:1,fontSize:"0.75rem",resize:"vertical"}}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[e.jsx("button",{style:{...g,fontSize:"0.7rem",padding:"3px 8px"},onClick:()=>I(t.id),children:"Save"}),e.jsx("button",{style:{...a},onClick:()=>d(null),children:"Cancel"})]})]})]}),e.jsxs("div",{style:{marginTop:4,paddingTop:4,borderTop:"1px solid #2a2a2a"},children:[D.length===0?e.jsx("div",{style:{color:"#555",fontSize:"0.7rem",padding:"2px 0"},children:"No comments yet"}):D.map(o=>e.jsxs("div",{style:{marginBottom:3,fontSize:"0.72rem"},children:[e.jsx("span",{style:{color:"#8ac",fontWeight:500},children:o.author||"Anonymous"}),e.jsx("span",{style:{color:"#555",marginLeft:6,fontSize:"0.6rem"},children:o.created?new Date(o.created).toLocaleDateString("sv-SE"):""}),e.jsx("div",{style:{color:"#bbb",marginTop:1},children:o.text})]},o.id)),e.jsxs("div",{style:{display:"flex",gap:4,marginTop:3},children:[e.jsx("input",{value:T[t.id]||"",onChange:o=>k(J=>({...J,[t.id]:o.target.value})),placeholder:"Add a comment...",style:{...i,flex:1,fontSize:"0.75rem"},onKeyDown:o=>{o.key==="Enter"&&w(t.id)}}),e.jsx("button",{style:{...g,fontSize:"0.7rem",padding:"3px 8px"},onClick:()=>w(t.id),children:"Post"})]})]})]},t.id)})]}),e.jsxs("div",{style:{padding:6,borderTop:"1px solid #333"},children:[e.jsxs("div",{style:{display:"flex",gap:4,marginBottom:4},children:[e.jsx("input",{value:c,onChange:t=>m(t.target.value),placeholder:"Issue title...",style:{...i,flex:1},onKeyDown:t=>{t.key==="Enter"&&E()}}),e.jsxs("select",{value:f,onChange:t=>$(t.target.value),style:N,children:[e.jsx("option",{value:"plugin",children:"Plugin"}),e.jsx("option",{value:"overlord",children:"Overlord"}),e.jsx("option",{value:"nav",children:"Nav"}),e.jsx("option",{value:"macro",children:"Macro"}),e.jsx("option",{value:"other",children:"Other"})]})]}),e.jsxs("div",{style:{display:"flex",gap:4},children:[e.jsx("textarea",{value:y,onChange:t=>u(t.target.value),placeholder:"Description (optional)...",rows:2,style:{...i,flex:1,fontSize:"0.75rem",resize:"vertical"}}),e.jsx("button",{style:{...g,alignSelf:"flex-end"},onClick:E,children:"Add"})]})]})]})};export{F as IssuesWindow}; +import{r as n,a as W,j as e,D as L}from"./index-fhoLMRWN.js";import"./react-yfL0ty4i.js";const O={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"}},i={padding:"3px 6px",fontSize:"0.8rem",border:"1px solid #555",background:"#2a2a2a",color:"#ddd",borderRadius:0},N={...i,fontSize:"0.75rem"},g={padding:"4px 12px",background:"#4a80c0",color:"#fff",border:"1px solid #336699",cursor:"pointer",fontSize:"0.75rem"},a={padding:"3px 8px",background:"#444",color:"#ccc",border:"1px solid #555",cursor:"pointer",fontSize:"0.7rem"},F=({id:P,zIndex:A})=>{const[h,R]=n.useState([]),[c,m]=n.useState(""),[y,u]=n.useState(""),[f,$]=n.useState("plugin"),[v,d]=n.useState(null),[p,j]=n.useState(""),[b,S]=n.useState(""),[C,z]=n.useState(""),[T,k]=n.useState({}),x=n.useCallback(async()=>{try{const t=await W("/issues");R((t.issues??[]).sort((r,s)=>(r.resolved?1:0)-(s.resolved?1:0)))}catch{}},[]);n.useEffect(()=>{x()},[x]);const l=async(t,r)=>{await fetch(`/api${t}`,{...r,credentials:"include",headers:{"Content-Type":"application/json",...r.headers}}),x()},E=async()=>{c.trim()&&(await l("/issues",{method:"POST",body:JSON.stringify({title:c.trim(),description:y.trim(),category:f})}),m(""),u(""))},B=t=>{if(v===t.id){d(null);return}d(t.id),j(t.title),S(t.description||""),z(t.category||"other")},I=async t=>{p.trim()&&(await l(`/issues/${t}`,{method:"PATCH",body:JSON.stringify({title:p.trim(),description:b.trim(),category:C})}),d(null))},w=async t=>{const r=(T[t]||"").trim();r&&(await l(`/issues/${t}/comments`,{method:"POST",body:JSON.stringify({text:r})}),k(s=>({...s,[t]:""})))};return e.jsxs(L,{id:P,title:"Issues Board",zIndex:A,width:540,height:520,children:[e.jsxs("div",{style:{flex:1,overflowY:"auto",padding:6,fontSize:"0.8rem"},children:[h.length===0&&e.jsx("div",{style:{padding:10,color:"#888",textAlign:"center"},children:"No open issues"}),h.map(t=>{const r=O[t.category]||O.other,s=t.created?new Date(t.created).toLocaleDateString("sv-SE"):"",D=t.comments||[];return e.jsxs("div",{style:{padding:"6px 8px",marginBottom:4,background:"#1f1f1f",borderRadius:3,border:"1px solid #333",opacity:t.resolved?.55:1},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[e.jsx("span",{style:{fontSize:"0.65rem",padding:"1px 6px",borderRadius:3,background:r.color,color:"#fff",fontWeight:600},children:r.label}),e.jsx("strong",{style:{fontSize:"0.8rem",flex:1},children:t.title}),e.jsxs("span",{style:{fontSize:"0.65rem",color:"#888"},children:["by ",t.author||"User"]}),e.jsx("span",{style:{color:"#666",fontSize:"0.65rem"},children:s})]}),t.description&&e.jsx("div",{style:{color:"#999",marginTop:3,fontSize:"0.75rem"},children:t.description}),e.jsxs("div",{style:{display:"flex",gap:4,marginTop:4},children:[t.resolved?e.jsxs(e.Fragment,{children:[e.jsx("button",{style:{...a,fontSize:"0.65rem"},onClick:()=>l(`/issues/${t.id}`,{method:"PATCH",body:JSON.stringify({resolved:!1})}),children:"↻ Reopen"}),e.jsx("button",{style:{...a,fontSize:"0.65rem",color:"#c66"},onClick:()=>{confirm(`Delete issue "${t.title}"?`)&&l(`/issues/${t.id}`,{method:"DELETE"})},children:"🗑 Delete"})]}):e.jsx("button",{style:{...a,fontSize:"0.65rem",background:"rgba(68,204,68,0.15)",color:"#4c4",border:"1px solid rgba(68,204,68,0.3)"},onClick:()=>l(`/issues/${t.id}`,{method:"PATCH",body:JSON.stringify({resolved:!0})}),children:"✓ Resolve"}),e.jsx("button",{style:{...a,fontSize:"0.65rem"},onClick:()=>B(t),children:"✎ Edit"})]}),v===t.id&&e.jsxs("div",{style:{marginTop:4,padding:4,background:"#222",borderRadius:3},children:[e.jsxs("div",{style:{display:"flex",gap:4,marginBottom:4},children:[e.jsx("input",{value:p,onChange:o=>j(o.target.value),style:{...i,flex:1}}),e.jsxs("select",{value:C,onChange:o=>z(o.target.value),style:N,children:[e.jsx("option",{value:"plugin",children:"Plugin"}),e.jsx("option",{value:"overlord",children:"Overlord"}),e.jsx("option",{value:"nav",children:"Nav"}),e.jsx("option",{value:"macro",children:"Macro"}),e.jsx("option",{value:"other",children:"Other"})]})]}),e.jsxs("div",{style:{display:"flex",gap:4},children:[e.jsx("textarea",{value:b,onChange:o=>S(o.target.value),rows:2,style:{...i,flex:1,fontSize:"0.75rem",resize:"vertical"}}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[e.jsx("button",{style:{...g,fontSize:"0.7rem",padding:"3px 8px"},onClick:()=>I(t.id),children:"Save"}),e.jsx("button",{style:{...a},onClick:()=>d(null),children:"Cancel"})]})]})]}),e.jsxs("div",{style:{marginTop:4,paddingTop:4,borderTop:"1px solid #2a2a2a"},children:[D.length===0?e.jsx("div",{style:{color:"#555",fontSize:"0.7rem",padding:"2px 0"},children:"No comments yet"}):D.map(o=>e.jsxs("div",{style:{marginBottom:3,fontSize:"0.72rem"},children:[e.jsx("span",{style:{color:"#8ac",fontWeight:500},children:o.author||"Anonymous"}),e.jsx("span",{style:{color:"#555",marginLeft:6,fontSize:"0.6rem"},children:o.created?new Date(o.created).toLocaleDateString("sv-SE"):""}),e.jsx("div",{style:{color:"#bbb",marginTop:1},children:o.text})]},o.id)),e.jsxs("div",{style:{display:"flex",gap:4,marginTop:3},children:[e.jsx("input",{value:T[t.id]||"",onChange:o=>k(J=>({...J,[t.id]:o.target.value})),placeholder:"Add a comment...",style:{...i,flex:1,fontSize:"0.75rem"},onKeyDown:o=>{o.key==="Enter"&&w(t.id)}}),e.jsx("button",{style:{...g,fontSize:"0.7rem",padding:"3px 8px"},onClick:()=>w(t.id),children:"Post"})]})]})]},t.id)})]}),e.jsxs("div",{style:{padding:6,borderTop:"1px solid #333"},children:[e.jsxs("div",{style:{display:"flex",gap:4,marginBottom:4},children:[e.jsx("input",{value:c,onChange:t=>m(t.target.value),placeholder:"Issue title...",style:{...i,flex:1},onKeyDown:t=>{t.key==="Enter"&&E()}}),e.jsxs("select",{value:f,onChange:t=>$(t.target.value),style:N,children:[e.jsx("option",{value:"plugin",children:"Plugin"}),e.jsx("option",{value:"overlord",children:"Overlord"}),e.jsx("option",{value:"nav",children:"Nav"}),e.jsx("option",{value:"macro",children:"Macro"}),e.jsx("option",{value:"other",children:"Other"})]})]}),e.jsxs("div",{style:{display:"flex",gap:4},children:[e.jsx("textarea",{value:y,onChange:t=>u(t.target.value),placeholder:"Description (optional)...",rows:2,style:{...i,flex:1,fontSize:"0.75rem",resize:"vertical"}}),e.jsx("button",{style:{...g,alignSelf:"flex-end"},onClick:E,children:"Add"})]})]})]})};export{F as IssuesWindow}; diff --git a/static/v2/assets/PlayerDashboardWindow-BfZp59uQ.js b/static/assets/PlayerDashboardWindow-D5m2YCrZ.js similarity index 98% rename from static/v2/assets/PlayerDashboardWindow-BfZp59uQ.js rename to static/assets/PlayerDashboardWindow-D5m2YCrZ.js index 56c056b1..e3984066 100644 --- a/static/v2/assets/PlayerDashboardWindow-BfZp59uQ.js +++ b/static/assets/PlayerDashboardWindow-D5m2YCrZ.js @@ -1 +1 @@ -import{r as d,j as t,D as y}from"./index-BiGwMY76.js";import"./react-yfL0ty4i.js";const A=({id:u,zIndex:f,characters:h})=>{const[o,k]=d.useState("kph"),[c,x]=d.useState(!1),p=d.useMemo(()=>{const e=Array.from(h.values()).filter(r=>r.telemetry).map(r=>{var i,g,m;const s=r.telemetry;return{name:r.name,kills:s.kills??0,kph:parseInt(s.kills_per_hour)||0,totalKills:s.total_kills??0,rares:s.total_rares??0,sessionRares:s.session_rares??0,deaths:parseInt(s.deaths)||0,totalDeaths:parseInt(s.total_deaths)||0,uptime:((i=s.onlinetime)==null?void 0:i.replace(/^00\./,""))??"",state:s.vt_state??"idle",tapers:parseInt(s.prismatic_taper_count)||0,hp:((g=r.vitals)==null?void 0:g.health_percentage)??0,vitae:((m=r.vitals)==null?void 0:m.vitae)??0}});return e.sort((r,s)=>{let i=0;switch(o){case"name":i=r.name.localeCompare(s.name);break;case"kills":i=r.kills-s.kills;break;case"kph":i=r.kph-s.kph;break;case"rares":i=r.rares-s.rares;break;case"deaths":i=r.totalDeaths-s.totalDeaths;break;case"uptime":i=r.uptime.localeCompare(s.uptime);break;case"state":i=r.state.localeCompare(s.state);break}return c?i:-i}),e},[h,o,c]),l=e=>{o===e?x(!c):(k(e),x(!1))},a=e=>({padding:"4px 6px",cursor:"pointer",userSelect:"none",color:o===e?"#6af":"#888",fontSize:"0.65rem",fontWeight:600,whiteSpace:"nowrap",borderBottom:"1px solid #444"}),n=e=>o===e?c?" ▲":" ▼":"";return t.jsx(y,{id:u,title:"Player Dashboard",zIndex:f,width:850,height:500,children:t.jsxs("div",{style:{flex:1,overflow:"auto",fontSize:"0.73rem"},children:[t.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[t.jsx("thead",{children:t.jsxs("tr",{style:{position:"sticky",top:0,background:"#1a1a1a",zIndex:1},children:[t.jsxs("th",{style:{...a("name"),textAlign:"left"},onClick:()=>l("name"),children:["Character",n("name")]}),t.jsxs("th",{style:{...a("state"),textAlign:"center"},onClick:()=>l("state"),children:["State",n("state")]}),t.jsxs("th",{style:{...a("kph"),textAlign:"right"},onClick:()=>l("kph"),children:["KPH",n("kph")]}),t.jsxs("th",{style:{...a("kills"),textAlign:"right"},onClick:()=>l("kills"),children:["Session",n("kills")]}),t.jsx("th",{style:{textAlign:"right",padding:"4px 6px",color:"#888",fontSize:"0.65rem",fontWeight:600,borderBottom:"1px solid #444"},children:"Total"}),t.jsxs("th",{style:{...a("rares"),textAlign:"right"},onClick:()=>l("rares"),children:["Rares",n("rares")]}),t.jsxs("th",{style:{...a("deaths"),textAlign:"right"},onClick:()=>l("deaths"),children:["Deaths",n("deaths")]}),t.jsxs("th",{style:{...a("uptime"),textAlign:"right"},onClick:()=>l("uptime"),children:["Uptime",n("uptime")]}),t.jsx("th",{style:{textAlign:"right",padding:"4px 6px",color:"#888",fontSize:"0.65rem",fontWeight:600,borderBottom:"1px solid #444"},children:"HP%"}),t.jsx("th",{style:{textAlign:"right",padding:"4px 6px",color:"#888",fontSize:"0.65rem",fontWeight:600,borderBottom:"1px solid #444"},children:"Vitae"}),t.jsx("th",{style:{textAlign:"right",padding:"4px 6px",color:"#888",fontSize:"0.65rem",fontWeight:600,borderBottom:"1px solid #444"},children:"Tapers"})]})}),t.jsx("tbody",{children:p.map(e=>{const r=e.state.toLowerCase(),s=r==="combat"||r==="hunt";return t.jsxs("tr",{style:{borderBottom:"1px solid #1a1a1a"},children:[t.jsx("td",{style:{padding:"3px 6px",color:"#ccc",fontWeight:500,maxWidth:180,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.name}),t.jsx("td",{style:{textAlign:"center",padding:"3px 6px"},children:t.jsx("span",{style:{fontSize:"0.6rem",padding:"1px 6px",borderRadius:3,background:s?"rgba(68,204,68,0.15)":r==="idle"||r==="default"?"rgba(100,100,100,0.2)":"rgba(204,68,68,0.15)",color:s?"#4c4":r==="idle"||r==="default"?"#888":"#c44"},children:e.state})}),t.jsx("td",{style:{textAlign:"right",padding:"3px 6px",color:"#4c4",fontVariantNumeric:"tabular-nums"},children:e.kph.toLocaleString()}),t.jsx("td",{style:{textAlign:"right",padding:"3px 6px",color:"#ccc",fontVariantNumeric:"tabular-nums"},children:e.kills.toLocaleString()}),t.jsx("td",{style:{textAlign:"right",padding:"3px 6px",color:"#888",fontVariantNumeric:"tabular-nums"},children:e.totalKills.toLocaleString()}),t.jsxs("td",{style:{textAlign:"right",padding:"3px 6px",color:"#fc0",fontVariantNumeric:"tabular-nums"},children:[e.rares,e.sessionRares>0?` (${e.sessionRares})`:""]}),t.jsx("td",{style:{textAlign:"right",padding:"3px 6px",color:e.totalDeaths>0?"#c66":"#555",fontVariantNumeric:"tabular-nums"},children:e.totalDeaths}),t.jsx("td",{style:{textAlign:"right",padding:"3px 6px",color:"#888",fontVariantNumeric:"tabular-nums"},children:e.uptime}),t.jsxs("td",{style:{textAlign:"right",padding:"3px 6px",fontVariantNumeric:"tabular-nums",color:e.hp>80?"#4c4":e.hp>40?"#ca0":"#c44"},children:[e.hp.toFixed(0),"%"]}),t.jsx("td",{style:{textAlign:"right",padding:"3px 6px",fontVariantNumeric:"tabular-nums",color:e.vitae>0?"#f66":"#333"},children:e.vitae>0?`${e.vitae}%`:""}),t.jsx("td",{style:{textAlign:"right",padding:"3px 6px",color:"#888",fontVariantNumeric:"tabular-nums"},children:e.tapers.toLocaleString()})]},e.name)})})]}),p.length===0&&t.jsx("div",{style:{padding:20,color:"#666",textAlign:"center"},children:"No characters online"})]})})};export{A as PlayerDashboardWindow}; +import{r as d,j as t,D as y}from"./index-fhoLMRWN.js";import"./react-yfL0ty4i.js";const A=({id:u,zIndex:f,characters:h})=>{const[o,k]=d.useState("kph"),[c,x]=d.useState(!1),p=d.useMemo(()=>{const e=Array.from(h.values()).filter(r=>r.telemetry).map(r=>{var i,g,m;const s=r.telemetry;return{name:r.name,kills:s.kills??0,kph:parseInt(s.kills_per_hour)||0,totalKills:s.total_kills??0,rares:s.total_rares??0,sessionRares:s.session_rares??0,deaths:parseInt(s.deaths)||0,totalDeaths:parseInt(s.total_deaths)||0,uptime:((i=s.onlinetime)==null?void 0:i.replace(/^00\./,""))??"",state:s.vt_state??"idle",tapers:parseInt(s.prismatic_taper_count)||0,hp:((g=r.vitals)==null?void 0:g.health_percentage)??0,vitae:((m=r.vitals)==null?void 0:m.vitae)??0}});return e.sort((r,s)=>{let i=0;switch(o){case"name":i=r.name.localeCompare(s.name);break;case"kills":i=r.kills-s.kills;break;case"kph":i=r.kph-s.kph;break;case"rares":i=r.rares-s.rares;break;case"deaths":i=r.totalDeaths-s.totalDeaths;break;case"uptime":i=r.uptime.localeCompare(s.uptime);break;case"state":i=r.state.localeCompare(s.state);break}return c?i:-i}),e},[h,o,c]),l=e=>{o===e?x(!c):(k(e),x(!1))},a=e=>({padding:"4px 6px",cursor:"pointer",userSelect:"none",color:o===e?"#6af":"#888",fontSize:"0.65rem",fontWeight:600,whiteSpace:"nowrap",borderBottom:"1px solid #444"}),n=e=>o===e?c?" ▲":" ▼":"";return t.jsx(y,{id:u,title:"Player Dashboard",zIndex:f,width:850,height:500,children:t.jsxs("div",{style:{flex:1,overflow:"auto",fontSize:"0.73rem"},children:[t.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[t.jsx("thead",{children:t.jsxs("tr",{style:{position:"sticky",top:0,background:"#1a1a1a",zIndex:1},children:[t.jsxs("th",{style:{...a("name"),textAlign:"left"},onClick:()=>l("name"),children:["Character",n("name")]}),t.jsxs("th",{style:{...a("state"),textAlign:"center"},onClick:()=>l("state"),children:["State",n("state")]}),t.jsxs("th",{style:{...a("kph"),textAlign:"right"},onClick:()=>l("kph"),children:["KPH",n("kph")]}),t.jsxs("th",{style:{...a("kills"),textAlign:"right"},onClick:()=>l("kills"),children:["Session",n("kills")]}),t.jsx("th",{style:{textAlign:"right",padding:"4px 6px",color:"#888",fontSize:"0.65rem",fontWeight:600,borderBottom:"1px solid #444"},children:"Total"}),t.jsxs("th",{style:{...a("rares"),textAlign:"right"},onClick:()=>l("rares"),children:["Rares",n("rares")]}),t.jsxs("th",{style:{...a("deaths"),textAlign:"right"},onClick:()=>l("deaths"),children:["Deaths",n("deaths")]}),t.jsxs("th",{style:{...a("uptime"),textAlign:"right"},onClick:()=>l("uptime"),children:["Uptime",n("uptime")]}),t.jsx("th",{style:{textAlign:"right",padding:"4px 6px",color:"#888",fontSize:"0.65rem",fontWeight:600,borderBottom:"1px solid #444"},children:"HP%"}),t.jsx("th",{style:{textAlign:"right",padding:"4px 6px",color:"#888",fontSize:"0.65rem",fontWeight:600,borderBottom:"1px solid #444"},children:"Vitae"}),t.jsx("th",{style:{textAlign:"right",padding:"4px 6px",color:"#888",fontSize:"0.65rem",fontWeight:600,borderBottom:"1px solid #444"},children:"Tapers"})]})}),t.jsx("tbody",{children:p.map(e=>{const r=e.state.toLowerCase(),s=r==="combat"||r==="hunt";return t.jsxs("tr",{style:{borderBottom:"1px solid #1a1a1a"},children:[t.jsx("td",{style:{padding:"3px 6px",color:"#ccc",fontWeight:500,maxWidth:180,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.name}),t.jsx("td",{style:{textAlign:"center",padding:"3px 6px"},children:t.jsx("span",{style:{fontSize:"0.6rem",padding:"1px 6px",borderRadius:3,background:s?"rgba(68,204,68,0.15)":r==="idle"||r==="default"?"rgba(100,100,100,0.2)":"rgba(204,68,68,0.15)",color:s?"#4c4":r==="idle"||r==="default"?"#888":"#c44"},children:e.state})}),t.jsx("td",{style:{textAlign:"right",padding:"3px 6px",color:"#4c4",fontVariantNumeric:"tabular-nums"},children:e.kph.toLocaleString()}),t.jsx("td",{style:{textAlign:"right",padding:"3px 6px",color:"#ccc",fontVariantNumeric:"tabular-nums"},children:e.kills.toLocaleString()}),t.jsx("td",{style:{textAlign:"right",padding:"3px 6px",color:"#888",fontVariantNumeric:"tabular-nums"},children:e.totalKills.toLocaleString()}),t.jsxs("td",{style:{textAlign:"right",padding:"3px 6px",color:"#fc0",fontVariantNumeric:"tabular-nums"},children:[e.rares,e.sessionRares>0?` (${e.sessionRares})`:""]}),t.jsx("td",{style:{textAlign:"right",padding:"3px 6px",color:e.totalDeaths>0?"#c66":"#555",fontVariantNumeric:"tabular-nums"},children:e.totalDeaths}),t.jsx("td",{style:{textAlign:"right",padding:"3px 6px",color:"#888",fontVariantNumeric:"tabular-nums"},children:e.uptime}),t.jsxs("td",{style:{textAlign:"right",padding:"3px 6px",fontVariantNumeric:"tabular-nums",color:e.hp>80?"#4c4":e.hp>40?"#ca0":"#c44"},children:[e.hp.toFixed(0),"%"]}),t.jsx("td",{style:{textAlign:"right",padding:"3px 6px",fontVariantNumeric:"tabular-nums",color:e.vitae>0?"#f66":"#333"},children:e.vitae>0?`${e.vitae}%`:""}),t.jsx("td",{style:{textAlign:"right",padding:"3px 6px",color:"#888",fontVariantNumeric:"tabular-nums"},children:e.tapers.toLocaleString()})]},e.name)})})]}),p.length===0&&t.jsx("div",{style:{padding:20,color:"#666",textAlign:"center"},children:"No characters online"})]})})};export{A as PlayerDashboardWindow}; diff --git a/static/v2/assets/QuestStatusWindow-C_sQPwJQ.js b/static/assets/QuestStatusWindow-B4lCEc6-.js similarity index 96% rename from static/v2/assets/QuestStatusWindow-C_sQPwJQ.js rename to static/assets/QuestStatusWindow-B4lCEc6-.js index 99198845..bb7498e1 100644 --- a/static/v2/assets/QuestStatusWindow-C_sQPwJQ.js +++ b/static/assets/QuestStatusWindow-B4lCEc6-.js @@ -1 +1 @@ -import{r as c,j as t,D as u,a as f}from"./index-BiGwMY76.js";import"./react-yfL0ty4i.js";const j=({id:p,zIndex:x})=>{const[s,h]=c.useState(null);c.useEffect(()=>{const e=async()=>{try{h(await f("/quest-status"))}catch{}};e();const o=setInterval(e,3e4);return()=>clearInterval(o)},[]);const i=s?Object.keys(s.quest_data).sort():[],l=new Set;if(s)for(const e of Object.values(s.quest_data))for(const o of Object.keys(e))l.add(o);const n=Array.from(l).sort();return t.jsx(u,{id:p,title:"Quest Status",zIndex:x,width:780,height:500,children:t.jsx("div",{style:{flex:1,overflow:"auto",fontSize:"0.72rem"},children:s?i.length===0?t.jsx("div",{style:{padding:20,color:"#666",textAlign:"center"},children:"No quest data available"}):t.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[t.jsx("thead",{children:t.jsxs("tr",{style:{position:"sticky",top:0,background:"#1a1a1a",zIndex:1},children:[t.jsx("th",{style:{textAlign:"left",padding:"4px 8px",borderBottom:"1px solid #444",color:"#888",fontSize:"0.65rem",fontWeight:600,minWidth:140},children:"Character"}),n.map(e=>t.jsx("th",{style:{textAlign:"center",padding:"4px 6px",borderBottom:"1px solid #444",color:"#888",fontSize:"0.6rem",fontWeight:600,maxWidth:120,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:e,children:e.replace(" Timer","").replace(" Pickup","")},e))]})}),t.jsx("tbody",{children:i.map(e=>{const o=s.quest_data[e]||{};return t.jsxs("tr",{style:{borderBottom:"1px solid #222"},children:[t.jsx("td",{style:{padding:"3px 8px",color:"#ccc",fontWeight:500,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:160},children:e}),n.map(d=>{const r=o[d],a=r==="READY";return t.jsx("td",{style:{textAlign:"center",padding:"3px 6px",color:a?"#4c4":r?"#ca0":"#333",fontWeight:a?600:400,fontSize:a?"0.7rem":"0.68rem"},children:r||"—"},d)})]},e)})})]}):t.jsx("div",{style:{padding:20,color:"#666",textAlign:"center"},children:"Loading quest data..."})})})};export{j as QuestStatusWindow}; +import{r as c,j as t,D as u,a as f}from"./index-fhoLMRWN.js";import"./react-yfL0ty4i.js";const j=({id:p,zIndex:x})=>{const[s,h]=c.useState(null);c.useEffect(()=>{const e=async()=>{try{h(await f("/quest-status"))}catch{}};e();const o=setInterval(e,3e4);return()=>clearInterval(o)},[]);const i=s?Object.keys(s.quest_data).sort():[],l=new Set;if(s)for(const e of Object.values(s.quest_data))for(const o of Object.keys(e))l.add(o);const n=Array.from(l).sort();return t.jsx(u,{id:p,title:"Quest Status",zIndex:x,width:780,height:500,children:t.jsx("div",{style:{flex:1,overflow:"auto",fontSize:"0.72rem"},children:s?i.length===0?t.jsx("div",{style:{padding:20,color:"#666",textAlign:"center"},children:"No quest data available"}):t.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[t.jsx("thead",{children:t.jsxs("tr",{style:{position:"sticky",top:0,background:"#1a1a1a",zIndex:1},children:[t.jsx("th",{style:{textAlign:"left",padding:"4px 8px",borderBottom:"1px solid #444",color:"#888",fontSize:"0.65rem",fontWeight:600,minWidth:140},children:"Character"}),n.map(e=>t.jsx("th",{style:{textAlign:"center",padding:"4px 6px",borderBottom:"1px solid #444",color:"#888",fontSize:"0.6rem",fontWeight:600,maxWidth:120,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:e,children:e.replace(" Timer","").replace(" Pickup","")},e))]})}),t.jsx("tbody",{children:i.map(e=>{const o=s.quest_data[e]||{};return t.jsxs("tr",{style:{borderBottom:"1px solid #222"},children:[t.jsx("td",{style:{padding:"3px 8px",color:"#ccc",fontWeight:500,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:160},children:e}),n.map(d=>{const r=o[d],a=r==="READY";return t.jsx("td",{style:{textAlign:"center",padding:"3px 6px",color:a?"#4c4":r?"#ca0":"#333",fontWeight:a?600:400,fontSize:a?"0.7rem":"0.68rem"},children:r||"—"},d)})]},e)})})]}):t.jsx("div",{style:{padding:20,color:"#666",textAlign:"center"},children:"Loading quest data..."})})})};export{j as QuestStatusWindow}; diff --git a/static/v2/assets/RadarWindow-BwlMNi8v.js b/static/assets/RadarWindow-zG0PV0Ia.js similarity index 99% rename from static/v2/assets/RadarWindow-BwlMNi8v.js rename to static/assets/RadarWindow-zG0PV0Ia.js index dcb52683..6e62f5b2 100644 --- a/static/v2/assets/RadarWindow-BwlMNi8v.js +++ b/static/assets/RadarWindow-zG0PV0Ia.js @@ -1 +1 @@ -import{r as x,j as c,D as ne}from"./index-BiGwMY76.js";import"./react-yfL0ty4i.js";const q=300,H=.5,se={walls:{r:0,g:0,b:255},innerWalls:{r:127,g:127,b:255},rampedWalls:{r:77,g:255,b:255},floors:{r:0,g:127,b:255},stairs:{r:0,g:63,b:255}},le={walls:{r:140,g:140,b:180},innerWalls:{r:100,g:100,b:140},rampedWalls:{r:120,g:160,b:120},floors:{r:60,g:80,b:60},stairs:{r:180,g:160,b:80}};function oe(d){const g=document.createElement("canvas");g.width=10,g.height=10;const w=g.getContext("2d");w.drawImage(d,0,0,10,10);const a=w.getImageData(0,0,10,10),t=a.data;for(let p=0;p240&&R>240&&k>240){t[p+3]=0;continue}let E=!1;for(const[L,I]of Object.entries(se))if(Math.abs(_-I.r)<15&&Math.abs(R-I.g)<15&&Math.abs(k-I.b)<15){const W=le[L];t[p]=W.r,t[p+1]=W.g,t[p+2]=W.b,E=!0;break}!E&&_<15&&R<15&&k<15&&(t[p+3]=100)}return w.putImageData(a,0,0),g}function ie(d){return d===1?Math.PI:d<-.7&&d>-.8?Math.PI/2:d>.7&&d<.8?-Math.PI/2:0}let A=null;function ce(){A||(A={},fetch("/dungeon_tiles.json").then(d=>d.json()).then(d=>{Object.entries(d).forEach(([g,w])=>{const a=new Image;a.onload=()=>{A[g]=oe(a)},a.src=w})}).catch(()=>{}))}const K={Monster:"#ff4444",Player:"#4488ff",NPC:"#44cc44",Vendor:"#44cc44",Portal:"#aa44ff",Corpse:"#ff8800",Container:"#cccc44",Door:"#888888"};function re(d){const g=(d%360+360)%360;return["N","NE","E","SE","S","SW","W","NW"][Math.round(g/45)%8]}const fe=({id:d,charName:g,zIndex:w,socket:a,radarData:t})=>{const p=x.useRef(null),_=x.useRef(H),[R,k]=x.useState(H),[E,L]=x.useState(null),I=x.useRef(null),W=x.useRef([]);x.useEffect(()=>{const n=new Image;n.src="/dereth.png",n.onload=()=>{I.current=n},ce()},[]),x.useEffect(()=>((a==null?void 0:a.readyState)===WebSocket.OPEN&&a.send(JSON.stringify({player_name:g,command:"start_radar"})),()=>{(a==null?void 0:a.readyState)===WebSocket.OPEN&&a.send(JSON.stringify({player_name:g,command:"stop_radar"}))}),[g,a]);const Q=x.useCallback(n=>{n.preventDefault();const e=n.deltaY>0?1.25:.8;_.current=Math.max(.02,Math.min(5,_.current*e)),k(_.current)},[]),D=x.useCallback(n=>{const e=p.current;if(!e)return;const o=e.getBoundingClientRect(),s=(n.clientX-o.left)*(e.width/o.width),r=(n.clientY-o.top)*(e.height/o.height);let M=null,u=20;W.current.forEach(f=>{if(f._px===void 0)return;const S=Math.sqrt((s-f._px)**2+(r-f._py)**2);S{var G;const n=p.current;if(!n||!t)return;const e=n.getContext("2d");if(!e)return;const o=q,s=o/2,r=o/2,M=t.objects??[],u=t.player_ew??0,f=t.player_ns??0,S=t.player_heading??0,b=t.is_dungeon??!1,V=t.player_x??0,Z=t.player_y??0,Y=_.current,z=b?o/2/(Y*240):o/2/Y,j=S*Math.PI/180;e.clearRect(0,0,o,o),e.fillStyle="#111",e.beginPath(),e.arc(s,r,s,0,Math.PI*2),e.fill(),e.save(),e.beginPath(),e.arc(s,r,s-1,0,Math.PI*2),e.clip();const B=t.landblock??null,te=t.player_raw_z??0;if(b&&B&&((G=window.__dungeonMapCache)!=null&&G[B])){const l=window.__dungeonMapCache[B],h=Math.floor((te+3)/6)*6;e.translate(s,r),e.rotate(-(S-180)*Math.PI/180);const i=10*z,O=A&&Object.keys(A).length>0;(l.z_levels||[]).slice().sort((y,m)=>(y.z===h?1:0)-(m.z===h?1:0)).forEach(y=>{const m=y.z===h;e.globalAlpha=m?.85:.12,(y.cells||[]).forEach(T=>{const P=-(T.x-V)*z,N=(T.y-Z)*z,C=O?A[String(T.env_id)]:null;C?(e.save(),e.translate(P,N),e.rotate(ie(T.rotation)),e.drawImage(C,-i/2,-i/2,i,i),e.restore()):(e.fillStyle=m?"#3a5a3a":"#1a2a1a",e.fillRect(P-i/2,N-i/2,i,i))})}),e.globalAlpha=1,e.setTransform(1,0,0,1,0,0)}else if(!b&&I.current){const l=I.current,h=l.naturalWidth/204.2,i=(u+102.1)*h,O=(102.1-f)*h;e.globalAlpha=.4,e.save(),e.translate(s,r),e.rotate(-j);const v=Y*h*2;e.drawImage(l,i-v/2,O-v/2,v,v,-s,-r,o,o),e.restore(),e.globalAlpha=1}e.restore(),e.strokeStyle="#333",e.lineWidth=1;for(let l=1;l<=4;l++)e.beginPath(),e.arc(s,r,s/4*l,0,Math.PI*2),e.stroke();e.beginPath(),e.moveTo(s,0),e.lineTo(s,o),e.moveTo(0,r),e.lineTo(o,r),e.stroke(),e.font="bold 12px monospace",e.textAlign="center",e.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,a:h})=>{const i=h-j;e.fillStyle=l==="N"?"#cc4444":"#888",e.fillText(l,s+Math.sin(i)*(s-12),r-Math.cos(i)*(s-12))}),e.strokeStyle="#666",e.lineWidth=1,e.beginPath(),e.moveTo(s,r),e.lineTo(s,r-s*.85),e.stroke();const $=b?Math.PI-j:j,X=Math.cos($),F=Math.sin($);M.forEach(l=>{let h,i;b&&l.raw_x!==void 0?(h=-(l.raw_x-V),i=l.raw_y-Z):(h=(l.ew??0)-u,i=(l.ns??0)-f);const O=h*X-i*F,v=b?h*F+i*X:-(h*F+i*X),y=s+O*z,m=r+v*z;if(Math.sqrt((y-s)**2+(m-r)**2)>s-4)return;l._px=y,l._py=m;const P=l.object_class??l.type??"",N=K[P]??"#888",C=l.id===E,J=C?6:P==="Monster"||P==="Player"?4:3;C&&(e.strokeStyle="#fff",e.lineWidth=2,e.beginPath(),e.arc(y,m,J+3,0,Math.PI*2),e.stroke()),e.fillStyle=N,e.beginPath(),e.arc(y,m,J,0,Math.PI*2),e.fill(),(P==="Player"||P==="Portal"||C)&&(e.fillStyle=C?"#fff":N,e.font="9px monospace",e.textAlign="left",e.fillText(l.name,y+6,m+3))}),W.current=M,e.fillStyle="#ffcc00",e.beginPath(),e.arc(s,r,5,0,Math.PI*2),e.fill(),e.strokeStyle="#fff",e.lineWidth=1,e.stroke()},[t,R,E]);const U=((t==null?void 0:t.objects)??[]).map(n=>{const e=(t==null?void 0:t.player_ew)??0,o=(t==null?void 0:t.player_ns)??0,s=(t==null?void 0:t.is_dungeon)??!1,r=(t==null?void 0:t.player_x)??0,M=(t==null?void 0:t.player_y)??0;let u,f,S;s&&n.raw_x!==void 0?(u=-(n.raw_x-r),f=n.raw_y-M,S=Math.sqrt(u*u+f*f)):(u=(n.ew??0)-e,f=(n.ns??0)-o,S=Math.sqrt(u*u+f*f)*240);const b=Math.atan2(u,f)*180/Math.PI;return{...n,dist:S,dir:re(b)}}).sort((n,e)=>n.dist-e.dist),ee=Math.round(R*240);return c.jsxs(ne,{id:d,title:`Radar: ${g}`,zIndex:w,width:360,height:560,children:[c.jsxs("div",{style:{padding:"4px 8px",display:"flex",justifyContent:"space-between",fontSize:"0.75rem",color:"#888",borderBottom:"1px solid #333",background:"#1a1a1a"},children:[c.jsxs("span",{children:["Range: ~",ee,"m"]}),c.jsx("span",{style:{fontSize:"0.65rem",color:"#555"},children:"Scroll to zoom"})]}),c.jsx("canvas",{ref:p,width:q,height:q,style:{display:"block",margin:"0 auto",borderBottom:"1px solid #333",cursor:"crosshair",flexShrink:0},onWheel:Q,onClick:D}),c.jsxs("div",{style:{flex:1,overflowY:"auto",fontSize:"0.72rem",minHeight:0},children:[c.jsxs("div",{style:{display:"flex",padding:"3px 6px",borderBottom:"1px solid #333",color:"#666",fontSize:"0.65rem",fontWeight:600},children:[c.jsx("span",{style:{width:8}}),c.jsx("span",{style:{flex:1,marginLeft:6},children:"Name"}),c.jsx("span",{style:{width:55,textAlign:"left"},children:"Type"}),c.jsx("span",{style:{width:40,textAlign:"right"},children:"Dist"}),c.jsx("span",{style:{width:24,textAlign:"center"},children:"Dir"})]}),U.length===0&&c.jsx("div",{style:{padding:12,color:"#555",textAlign:"center",fontSize:"0.7rem"},children:"Waiting for radar data..."}),U.map(n=>{const e=n.object_class??n.type??"",o=K[e]??"#888",s=n.id===E;return c.jsxs("div",{onClick:()=>L(s?null:n.id),style:{display:"flex",alignItems:"center",padding:"2px 6px",borderBottom:"1px solid #1a1a1a",cursor:"pointer",color:"#ccc",background:s?"#1a2a3a":"",borderLeft:s?"2px solid #4488ff":"2px solid transparent"},children:[c.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:o,flexShrink:0}}),c.jsx("span",{style:{flex:1,marginLeft:6,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.name}),c.jsx("span",{style:{width:55,color:"#888",fontSize:"0.65rem"},children:e}),c.jsx("span",{style:{width:40,textAlign:"right",fontVariantNumeric:"tabular-nums"},children:n.dist<1e3?`${Math.round(n.dist)}m`:`${(n.dist/1e3).toFixed(1)}km`}),c.jsx("span",{style:{width:24,textAlign:"center",color:"#666"},children:n.dir})]},n.id)})]})]})};export{fe as RadarWindow}; +import{r as x,j as c,D as ne}from"./index-fhoLMRWN.js";import"./react-yfL0ty4i.js";const q=300,H=.5,se={walls:{r:0,g:0,b:255},innerWalls:{r:127,g:127,b:255},rampedWalls:{r:77,g:255,b:255},floors:{r:0,g:127,b:255},stairs:{r:0,g:63,b:255}},le={walls:{r:140,g:140,b:180},innerWalls:{r:100,g:100,b:140},rampedWalls:{r:120,g:160,b:120},floors:{r:60,g:80,b:60},stairs:{r:180,g:160,b:80}};function oe(d){const g=document.createElement("canvas");g.width=10,g.height=10;const w=g.getContext("2d");w.drawImage(d,0,0,10,10);const a=w.getImageData(0,0,10,10),t=a.data;for(let p=0;p240&&R>240&&k>240){t[p+3]=0;continue}let E=!1;for(const[L,I]of Object.entries(se))if(Math.abs(_-I.r)<15&&Math.abs(R-I.g)<15&&Math.abs(k-I.b)<15){const W=le[L];t[p]=W.r,t[p+1]=W.g,t[p+2]=W.b,E=!0;break}!E&&_<15&&R<15&&k<15&&(t[p+3]=100)}return w.putImageData(a,0,0),g}function ie(d){return d===1?Math.PI:d<-.7&&d>-.8?Math.PI/2:d>.7&&d<.8?-Math.PI/2:0}let A=null;function ce(){A||(A={},fetch("/dungeon_tiles.json").then(d=>d.json()).then(d=>{Object.entries(d).forEach(([g,w])=>{const a=new Image;a.onload=()=>{A[g]=oe(a)},a.src=w})}).catch(()=>{}))}const K={Monster:"#ff4444",Player:"#4488ff",NPC:"#44cc44",Vendor:"#44cc44",Portal:"#aa44ff",Corpse:"#ff8800",Container:"#cccc44",Door:"#888888"};function re(d){const g=(d%360+360)%360;return["N","NE","E","SE","S","SW","W","NW"][Math.round(g/45)%8]}const fe=({id:d,charName:g,zIndex:w,socket:a,radarData:t})=>{const p=x.useRef(null),_=x.useRef(H),[R,k]=x.useState(H),[E,L]=x.useState(null),I=x.useRef(null),W=x.useRef([]);x.useEffect(()=>{const n=new Image;n.src="/dereth.png",n.onload=()=>{I.current=n},ce()},[]),x.useEffect(()=>((a==null?void 0:a.readyState)===WebSocket.OPEN&&a.send(JSON.stringify({player_name:g,command:"start_radar"})),()=>{(a==null?void 0:a.readyState)===WebSocket.OPEN&&a.send(JSON.stringify({player_name:g,command:"stop_radar"}))}),[g,a]);const Q=x.useCallback(n=>{n.preventDefault();const e=n.deltaY>0?1.25:.8;_.current=Math.max(.02,Math.min(5,_.current*e)),k(_.current)},[]),D=x.useCallback(n=>{const e=p.current;if(!e)return;const o=e.getBoundingClientRect(),s=(n.clientX-o.left)*(e.width/o.width),r=(n.clientY-o.top)*(e.height/o.height);let M=null,u=20;W.current.forEach(f=>{if(f._px===void 0)return;const S=Math.sqrt((s-f._px)**2+(r-f._py)**2);S{var G;const n=p.current;if(!n||!t)return;const e=n.getContext("2d");if(!e)return;const o=q,s=o/2,r=o/2,M=t.objects??[],u=t.player_ew??0,f=t.player_ns??0,S=t.player_heading??0,b=t.is_dungeon??!1,V=t.player_x??0,Z=t.player_y??0,Y=_.current,z=b?o/2/(Y*240):o/2/Y,j=S*Math.PI/180;e.clearRect(0,0,o,o),e.fillStyle="#111",e.beginPath(),e.arc(s,r,s,0,Math.PI*2),e.fill(),e.save(),e.beginPath(),e.arc(s,r,s-1,0,Math.PI*2),e.clip();const B=t.landblock??null,te=t.player_raw_z??0;if(b&&B&&((G=window.__dungeonMapCache)!=null&&G[B])){const l=window.__dungeonMapCache[B],h=Math.floor((te+3)/6)*6;e.translate(s,r),e.rotate(-(S-180)*Math.PI/180);const i=10*z,O=A&&Object.keys(A).length>0;(l.z_levels||[]).slice().sort((y,m)=>(y.z===h?1:0)-(m.z===h?1:0)).forEach(y=>{const m=y.z===h;e.globalAlpha=m?.85:.12,(y.cells||[]).forEach(T=>{const P=-(T.x-V)*z,N=(T.y-Z)*z,C=O?A[String(T.env_id)]:null;C?(e.save(),e.translate(P,N),e.rotate(ie(T.rotation)),e.drawImage(C,-i/2,-i/2,i,i),e.restore()):(e.fillStyle=m?"#3a5a3a":"#1a2a1a",e.fillRect(P-i/2,N-i/2,i,i))})}),e.globalAlpha=1,e.setTransform(1,0,0,1,0,0)}else if(!b&&I.current){const l=I.current,h=l.naturalWidth/204.2,i=(u+102.1)*h,O=(102.1-f)*h;e.globalAlpha=.4,e.save(),e.translate(s,r),e.rotate(-j);const v=Y*h*2;e.drawImage(l,i-v/2,O-v/2,v,v,-s,-r,o,o),e.restore(),e.globalAlpha=1}e.restore(),e.strokeStyle="#333",e.lineWidth=1;for(let l=1;l<=4;l++)e.beginPath(),e.arc(s,r,s/4*l,0,Math.PI*2),e.stroke();e.beginPath(),e.moveTo(s,0),e.lineTo(s,o),e.moveTo(0,r),e.lineTo(o,r),e.stroke(),e.font="bold 12px monospace",e.textAlign="center",e.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,a:h})=>{const i=h-j;e.fillStyle=l==="N"?"#cc4444":"#888",e.fillText(l,s+Math.sin(i)*(s-12),r-Math.cos(i)*(s-12))}),e.strokeStyle="#666",e.lineWidth=1,e.beginPath(),e.moveTo(s,r),e.lineTo(s,r-s*.85),e.stroke();const $=b?Math.PI-j:j,X=Math.cos($),F=Math.sin($);M.forEach(l=>{let h,i;b&&l.raw_x!==void 0?(h=-(l.raw_x-V),i=l.raw_y-Z):(h=(l.ew??0)-u,i=(l.ns??0)-f);const O=h*X-i*F,v=b?h*F+i*X:-(h*F+i*X),y=s+O*z,m=r+v*z;if(Math.sqrt((y-s)**2+(m-r)**2)>s-4)return;l._px=y,l._py=m;const P=l.object_class??l.type??"",N=K[P]??"#888",C=l.id===E,J=C?6:P==="Monster"||P==="Player"?4:3;C&&(e.strokeStyle="#fff",e.lineWidth=2,e.beginPath(),e.arc(y,m,J+3,0,Math.PI*2),e.stroke()),e.fillStyle=N,e.beginPath(),e.arc(y,m,J,0,Math.PI*2),e.fill(),(P==="Player"||P==="Portal"||C)&&(e.fillStyle=C?"#fff":N,e.font="9px monospace",e.textAlign="left",e.fillText(l.name,y+6,m+3))}),W.current=M,e.fillStyle="#ffcc00",e.beginPath(),e.arc(s,r,5,0,Math.PI*2),e.fill(),e.strokeStyle="#fff",e.lineWidth=1,e.stroke()},[t,R,E]);const U=((t==null?void 0:t.objects)??[]).map(n=>{const e=(t==null?void 0:t.player_ew)??0,o=(t==null?void 0:t.player_ns)??0,s=(t==null?void 0:t.is_dungeon)??!1,r=(t==null?void 0:t.player_x)??0,M=(t==null?void 0:t.player_y)??0;let u,f,S;s&&n.raw_x!==void 0?(u=-(n.raw_x-r),f=n.raw_y-M,S=Math.sqrt(u*u+f*f)):(u=(n.ew??0)-e,f=(n.ns??0)-o,S=Math.sqrt(u*u+f*f)*240);const b=Math.atan2(u,f)*180/Math.PI;return{...n,dist:S,dir:re(b)}}).sort((n,e)=>n.dist-e.dist),ee=Math.round(R*240);return c.jsxs(ne,{id:d,title:`Radar: ${g}`,zIndex:w,width:360,height:560,children:[c.jsxs("div",{style:{padding:"4px 8px",display:"flex",justifyContent:"space-between",fontSize:"0.75rem",color:"#888",borderBottom:"1px solid #333",background:"#1a1a1a"},children:[c.jsxs("span",{children:["Range: ~",ee,"m"]}),c.jsx("span",{style:{fontSize:"0.65rem",color:"#555"},children:"Scroll to zoom"})]}),c.jsx("canvas",{ref:p,width:q,height:q,style:{display:"block",margin:"0 auto",borderBottom:"1px solid #333",cursor:"crosshair",flexShrink:0},onWheel:Q,onClick:D}),c.jsxs("div",{style:{flex:1,overflowY:"auto",fontSize:"0.72rem",minHeight:0},children:[c.jsxs("div",{style:{display:"flex",padding:"3px 6px",borderBottom:"1px solid #333",color:"#666",fontSize:"0.65rem",fontWeight:600},children:[c.jsx("span",{style:{width:8}}),c.jsx("span",{style:{flex:1,marginLeft:6},children:"Name"}),c.jsx("span",{style:{width:55,textAlign:"left"},children:"Type"}),c.jsx("span",{style:{width:40,textAlign:"right"},children:"Dist"}),c.jsx("span",{style:{width:24,textAlign:"center"},children:"Dir"})]}),U.length===0&&c.jsx("div",{style:{padding:12,color:"#555",textAlign:"center",fontSize:"0.7rem"},children:"Waiting for radar data..."}),U.map(n=>{const e=n.object_class??n.type??"",o=K[e]??"#888",s=n.id===E;return c.jsxs("div",{onClick:()=>L(s?null:n.id),style:{display:"flex",alignItems:"center",padding:"2px 6px",borderBottom:"1px solid #1a1a1a",cursor:"pointer",color:"#ccc",background:s?"#1a2a3a":"",borderLeft:s?"2px solid #4488ff":"2px solid transparent"},children:[c.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:o,flexShrink:0}}),c.jsx("span",{style:{flex:1,marginLeft:6,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.name}),c.jsx("span",{style:{width:55,color:"#888",fontSize:"0.65rem"},children:e}),c.jsx("span",{style:{width:40,textAlign:"right",fontVariantNumeric:"tabular-nums"},children:n.dist<1e3?`${Math.round(n.dist)}m`:`${(n.dist/1e3).toFixed(1)}km`}),c.jsx("span",{style:{width:24,textAlign:"center",color:"#666"},children:n.dir})]},n.id)})]})]})};export{fe as RadarWindow}; diff --git a/static/v2/assets/StatsWindow-C5XFDqVx.js b/static/assets/StatsWindow-CX6kEX-g.js similarity index 93% rename from static/v2/assets/StatsWindow-C5XFDqVx.js rename to static/assets/StatsWindow-CX6kEX-g.js index b25e9cd8..f222a874 100644 --- a/static/v2/assets/StatsWindow-C5XFDqVx.js +++ b/static/assets/StatsWindow-CX6kEX-g.js @@ -1 +1 @@ -import{r as o,j as t,D as d}from"./index-BiGwMY76.js";import"./react-yfL0ty4i.js";const c=[{title:"Kills per Hour",id:1},{title:"Memory (MB)",id:2},{title:"CPU (%)",id:3},{title:"Mem Handles",id:4}],m=[{label:"1H",value:"now-1h"},{label:"6H",value:"now-6h"},{label:"24H",value:"now-24h"},{label:"7D",value:"now-7d"}],v=({id:s,charName:a,zIndex:i})=>{const[l,r]=o.useState("now-24h"),n=e=>`/grafana/d-solo/dereth-tracker/dereth-tracker-dashboard?panelId=${e}&var-character=${encodeURIComponent(a)}&from=${l}&to=now&theme=light`;return t.jsxs(d,{id:s,title:`Stats: ${a}`,zIndex:i,width:750,height:480,children:[t.jsx("div",{className:"ml-stats-controls",children:m.map(e=>t.jsx("button",{className:`ml-stats-range-btn ${l===e.value?"active":""}`,onClick:()=>r(e.value),children:e.label},e.value))}),t.jsx("div",{className:"ml-stats-grid",children:c.map(e=>t.jsx("div",{className:"ml-stats-panel",children:t.jsx("iframe",{src:n(e.id),width:"100%",height:"100%",frameBorder:"0",title:e.title})},e.id))})]})};export{v as StatsWindow}; +import{r as o,j as t,D as d}from"./index-fhoLMRWN.js";import"./react-yfL0ty4i.js";const c=[{title:"Kills per Hour",id:1},{title:"Memory (MB)",id:2},{title:"CPU (%)",id:3},{title:"Mem Handles",id:4}],m=[{label:"1H",value:"now-1h"},{label:"6H",value:"now-6h"},{label:"24H",value:"now-24h"},{label:"7D",value:"now-7d"}],v=({id:s,charName:a,zIndex:i})=>{const[l,r]=o.useState("now-24h"),n=e=>`/grafana/d-solo/dereth-tracker/dereth-tracker-dashboard?panelId=${e}&var-character=${encodeURIComponent(a)}&from=${l}&to=now&theme=light`;return t.jsxs(d,{id:s,title:`Stats: ${a}`,zIndex:i,width:750,height:480,children:[t.jsx("div",{className:"ml-stats-controls",children:m.map(e=>t.jsx("button",{className:`ml-stats-range-btn ${l===e.value?"active":""}`,onClick:()=>r(e.value),children:e.label},e.value))}),t.jsx("div",{className:"ml-stats-grid",children:c.map(e=>t.jsx("div",{className:"ml-stats-panel",children:t.jsx("iframe",{src:n(e.id),width:"100%",height:"100%",frameBorder:"0",title:e.title})},e.id))})]})};export{v as StatsWindow}; diff --git a/static/v2/assets/VitalSharingWindow-CSqjZNf-.js b/static/assets/VitalSharingWindow-CkWl7Mtm.js similarity index 97% rename from static/v2/assets/VitalSharingWindow-CSqjZNf-.js rename to static/assets/VitalSharingWindow-CkWl7Mtm.js index 83a3421c..ff1f5358 100644 --- a/static/v2/assets/VitalSharingWindow-CSqjZNf-.js +++ b/static/assets/VitalSharingWindow-CkWl7Mtm.js @@ -1 +1 @@ -import{r as n,j as t,D as x,a as m}from"./index-BiGwMY76.js";import"./react-yfL0ty4i.js";const v=({id:o,zIndex:c})=>{const[a,d]=n.useState([]);n.useEffect(()=>{const e=async()=>{try{const s=await m("/vital-sharing/peers");d(s.peers??[])}catch{}};e();const l=setInterval(e,5e3);return()=>clearInterval(l)},[]);const h=(e,l)=>l>0?Math.min(100,e/l*100):0;return t.jsx(x,{id:o,title:"Vital Sharing Network",zIndex:c,width:520,height:450,children:t.jsx("div",{style:{flex:1,overflowY:"auto",padding:6,fontSize:"0.75rem"},children:a.length===0?t.jsx("div",{style:{padding:16,color:"#666",textAlign:"center"},children:"No vital-sharing peers connected"}):a.map(e=>{var l,s,r;return t.jsxs("div",{style:{padding:"6px 8px",marginBottom:4,background:"#1f1f1f",borderRadius:3,border:"1px solid #333"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:3},children:[t.jsx("span",{style:{color:e.plugin_connected?"#4c4":"#a33",fontSize:"0.8rem"},children:"●"}),t.jsx("strong",{style:{flex:1},children:e.character_name}),e.subscribed&&t.jsx("span",{style:{color:"#6bf",fontSize:"0.65rem"},children:"[subscribed]"})]}),t.jsxs("div",{style:{color:"#666",fontSize:"0.68rem",marginBottom:3},children:["tags: ",((l=e.tags)==null?void 0:l.join(", "))||"none"]}),e.vitals&&e.vitals.max_health>0&&t.jsx("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[{label:"HP",cur:e.vitals.current_health,max:e.vitals.max_health,bg:"#330000",fill:"#c44"},{label:"STA",cur:e.vitals.current_stamina,max:e.vitals.max_stamina,bg:"#331a00",fill:"#ca0"},{label:"MANA",cur:e.vitals.current_mana,max:e.vitals.max_mana,bg:"#001433",fill:"#48f"}].map(i=>t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[t.jsx("span",{style:{width:32,color:"#888",fontSize:"0.65rem"},children:i.label}),t.jsx("div",{style:{flex:1,height:6,background:i.bg,borderRadius:3,overflow:"hidden"},children:t.jsx("div",{style:{width:`${h(i.cur,i.max)}%`,height:"100%",background:i.fill,borderRadius:3}})}),t.jsxs("span",{style:{width:60,textAlign:"right",fontSize:"0.65rem",color:"#888"},children:[i.cur,"/",i.max]})]},i.label))}),e.position&&t.jsxs("div",{style:{color:"#555",fontSize:"0.65rem",marginTop:2},children:[(s=e.position.ns)==null?void 0:s.toFixed(1),"N, ",(r=e.position.ew)==null?void 0:r.toFixed(1),"E"]})]},e.character_name)})})})};export{v as VitalSharingWindow}; +import{r as n,j as t,D as x,a as m}from"./index-fhoLMRWN.js";import"./react-yfL0ty4i.js";const v=({id:o,zIndex:c})=>{const[a,d]=n.useState([]);n.useEffect(()=>{const e=async()=>{try{const s=await m("/vital-sharing/peers");d(s.peers??[])}catch{}};e();const l=setInterval(e,5e3);return()=>clearInterval(l)},[]);const h=(e,l)=>l>0?Math.min(100,e/l*100):0;return t.jsx(x,{id:o,title:"Vital Sharing Network",zIndex:c,width:520,height:450,children:t.jsx("div",{style:{flex:1,overflowY:"auto",padding:6,fontSize:"0.75rem"},children:a.length===0?t.jsx("div",{style:{padding:16,color:"#666",textAlign:"center"},children:"No vital-sharing peers connected"}):a.map(e=>{var l,s,r;return t.jsxs("div",{style:{padding:"6px 8px",marginBottom:4,background:"#1f1f1f",borderRadius:3,border:"1px solid #333"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:3},children:[t.jsx("span",{style:{color:e.plugin_connected?"#4c4":"#a33",fontSize:"0.8rem"},children:"●"}),t.jsx("strong",{style:{flex:1},children:e.character_name}),e.subscribed&&t.jsx("span",{style:{color:"#6bf",fontSize:"0.65rem"},children:"[subscribed]"})]}),t.jsxs("div",{style:{color:"#666",fontSize:"0.68rem",marginBottom:3},children:["tags: ",((l=e.tags)==null?void 0:l.join(", "))||"none"]}),e.vitals&&e.vitals.max_health>0&&t.jsx("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[{label:"HP",cur:e.vitals.current_health,max:e.vitals.max_health,bg:"#330000",fill:"#c44"},{label:"STA",cur:e.vitals.current_stamina,max:e.vitals.max_stamina,bg:"#331a00",fill:"#ca0"},{label:"MANA",cur:e.vitals.current_mana,max:e.vitals.max_mana,bg:"#001433",fill:"#48f"}].map(i=>t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[t.jsx("span",{style:{width:32,color:"#888",fontSize:"0.65rem"},children:i.label}),t.jsx("div",{style:{flex:1,height:6,background:i.bg,borderRadius:3,overflow:"hidden"},children:t.jsx("div",{style:{width:`${h(i.cur,i.max)}%`,height:"100%",background:i.fill,borderRadius:3}})}),t.jsxs("span",{style:{width:60,textAlign:"right",fontSize:"0.65rem",color:"#888"},children:[i.cur,"/",i.max]})]},i.label))}),e.position&&t.jsxs("div",{style:{color:"#555",fontSize:"0.65rem",marginTop:2},children:[(s=e.position.ns)==null?void 0:s.toFixed(1),"N, ",(r=e.position.ew)==null?void 0:r.toFixed(1),"E"]})]},e.character_name)})})})};export{v as VitalSharingWindow}; diff --git a/static/assets/index-fhoLMRWN.js b/static/assets/index-fhoLMRWN.js new file mode 100644 index 00000000..5845e0c5 --- /dev/null +++ b/static/assets/index-fhoLMRWN.js @@ -0,0 +1,34 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/StatsWindow-CX6kEX-g.js","assets/react-yfL0ty4i.js","assets/CharacterWindow-CyX_tOIF.js","assets/InventoryWindow-YNou026w.js","assets/RadarWindow-zG0PV0Ia.js","assets/CombatStatsWindow-BduiqqZk.js","assets/CombatPickerWindow-NVeKtlGR.js","assets/IssuesWindow-BtrdDjRr.js","assets/VitalSharingWindow-CkWl7Mtm.js","assets/QuestStatusWindow-B4lCEc6-.js","assets/PlayerDashboardWindow-D5m2YCrZ.js"])))=>i.map(i=>d[i]); +import{r as _m,g as er,a as ur}from"./react-yfL0ty4i.js";(function(){const x=document.createElement("link").relList;if(x&&x.supports&&x.supports("modulepreload"))return;for(const C of document.querySelectorAll('link[rel="modulepreload"]'))d(C);new MutationObserver(C=>{for(const N of C)if(N.type==="childList")for(const O of N.addedNodes)O.tagName==="LINK"&&O.rel==="modulepreload"&&d(O)}).observe(document,{childList:!0,subtree:!0});function D(C){const N={};return C.integrity&&(N.integrity=C.integrity),C.referrerPolicy&&(N.referrerPolicy=C.referrerPolicy),C.crossOrigin==="use-credentials"?N.credentials="include":C.crossOrigin==="anonymous"?N.credentials="omit":N.credentials="same-origin",N}function d(C){if(C.ep)return;C.ep=!0;const N=D(C);fetch(C.href,N)}})();var sf={exports:{}},gu={};/** + * @license React + * react-jsx-runtime.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var vm;function nr(){if(vm)return gu;vm=1;var o=Symbol.for("react.transitional.element"),x=Symbol.for("react.fragment");function D(d,C,N){var O=null;if(N!==void 0&&(O=""+N),C.key!==void 0&&(O=""+C.key),"key"in C){N={};for(var j in C)j!=="key"&&(N[j]=C[j])}else N=C;return C=N.ref,{$$typeof:o,type:d,key:O,ref:C!==void 0?C:null,props:N}}return gu.Fragment=x,gu.jsx=D,gu.jsxs=D,gu}var gm;function cr(){return gm||(gm=1,sf.exports=nr()),sf.exports}var g=cr(),T=_m();const bu=er(T);var of={exports:{}},Su={},df={exports:{}},mf={};/** + * @license React + * scheduler.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Sm;function ir(){return Sm||(Sm=1,(function(o){function x(h,_){var B=h.length;h.push(_);l:for(;0>>1,ul=h[ml];if(0>>1;mlC(fl,B))qlC(Et,fl)?(h[ml]=Et,h[ql]=B,ml=ql):(h[ml]=fl,h[Tl]=B,ml=Tl);else if(qlC(Et,B))h[ml]=Et,h[ql]=B,ml=ql;else break l}}return _}function C(h,_){var B=h.sortIndex-_.sortIndex;return B!==0?B:h.id-_.id}if(o.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var N=performance;o.unstable_now=function(){return N.now()}}else{var O=Date,j=O.now();o.unstable_now=function(){return O.now()-j}}var b=[],M=[],q=1,z=null,U=3,H=!1,k=!1,tl=!1,dl=!1,gl=typeof setTimeout=="function"?setTimeout:null,Z=typeof clearTimeout=="function"?clearTimeout:null,L=typeof setImmediate<"u"?setImmediate:null;function Ol(h){for(var _=D(M);_!==null;){if(_.callback===null)d(M);else if(_.startTime<=h)d(M),_.sortIndex=_.expirationTime,x(b,_);else break;_=D(M)}}function Ll(h){if(tl=!1,Ol(h),!k)if(D(b)!==null)k=!0,w||(w=!0,El());else{var _=D(M);_!==null&&Al(Ll,_.startTime-h)}}var w=!1,F=-1,X=5,W=-1;function el(){return dl?!0:!(o.unstable_now()-Wh&&el());){var ml=z.callback;if(typeof ml=="function"){z.callback=null,U=z.priorityLevel;var ul=ml(z.expirationTime<=h);if(h=o.unstable_now(),typeof ul=="function"){z.callback=ul,Ol(h),_=!0;break t}z===D(b)&&d(b),Ol(h)}else d(b);z=D(b)}if(z!==null)_=!0;else{var zl=D(M);zl!==null&&Al(Ll,zl.startTime-h),_=!1}}break l}finally{z=null,U=B,H=!1}_=void 0}}finally{_?El():w=!1}}}var El;if(typeof L=="function")El=function(){L(Rl)};else if(typeof MessageChannel<"u"){var Ot=new MessageChannel,V=Ot.port2;Ot.port1.onmessage=Rl,El=function(){V.postMessage(null)}}else El=function(){gl(Rl,0)};function Al(h,_){F=gl(function(){h(o.unstable_now())},_)}o.unstable_IdlePriority=5,o.unstable_ImmediatePriority=1,o.unstable_LowPriority=4,o.unstable_NormalPriority=3,o.unstable_Profiling=null,o.unstable_UserBlockingPriority=2,o.unstable_cancelCallback=function(h){h.callback=null},o.unstable_forceFrameRate=function(h){0>h||125ml?(h.sortIndex=B,x(M,h),D(b)===null&&h===D(M)&&(tl?(Z(F),F=-1):tl=!0,Al(Ll,B-ml))):(h.sortIndex=ul,x(b,h),k||H||(k=!0,w||(w=!0,El()))),h},o.unstable_shouldYield=el,o.unstable_wrapCallback=function(h){var _=U;return function(){var B=U;U=_;try{return h.apply(this,arguments)}finally{U=B}}}})(mf)),mf}var bm;function fr(){return bm||(bm=1,df.exports=ir()),df.exports}/** + * @license React + * react-dom-client.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var zm;function sr(){if(zm)return Su;zm=1;var o=fr(),x=_m(),D=ur();function d(l){var t="https://react.dev/errors/"+l;if(1ul||(l.current=ml[ul],ml[ul]=null,ul--)}function fl(l,t){ul++,ml[ul]=l.current,l.current=t}var ql=zl(null),Et=zl(null),Wt=zl(null),Tu=zl(null);function Eu(l,t){switch(fl(Wt,t),fl(Et,l),fl(ql,null),t.nodeType){case 9:case 11:l=(l=t.documentElement)&&(l=l.namespaceURI)?Xd(l):0;break;default:if(l=t.tagName,t=t.namespaceURI)t=Xd(t),l=Gd(t,l);else switch(l){case"svg":l=1;break;case"math":l=2;break;default:l=0}}Tl(ql),fl(ql,l)}function Ga(){Tl(ql),Tl(Et),Tl(Wt)}function Vn(l){l.memoizedState!==null&&fl(Tu,l);var t=ql.current,a=Gd(t,l.type);t!==a&&(fl(Et,l),fl(ql,a))}function Au(l){Et.current===l&&(Tl(ql),Tl(Et)),Tu.current===l&&(Tl(Tu),hu._currentValue=B)}var Ln,rf;function pa(l){if(Ln===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);Ln=t&&t[1]||"",rf=-1)":-1u||f[e]!==y[u]){var p=` +`+f[e].replace(" at new "," at ");return l.displayName&&p.includes("")&&(p=p.replace("",l.displayName)),p}while(1<=e&&0<=u);break}}}finally{Kn=!1,Error.prepareStackTrace=a}return(a=l?l.displayName||l.name:"")?pa(a):""}function Rm(l,t){switch(l.tag){case 26:case 27:case 5:return pa(l.type);case 16:return pa("Lazy");case 13:return l.child!==t&&t!==null?pa("Suspense Fallback"):pa("Suspense");case 19:return pa("SuspenseList");case 0:case 15:return Jn(l.type,!1);case 11:return Jn(l.type.render,!1);case 1:return Jn(l.type,!0);case 31:return pa("Activity");default:return""}}function yf(l){try{var t="",a=null;do t+=Rm(l,a),a=l,l=l.return;while(l);return t}catch(e){return` +Error generating stack: `+e.message+` +`+e.stack}}var wn=Object.prototype.hasOwnProperty,Wn=o.unstable_scheduleCallback,kn=o.unstable_cancelCallback,Hm=o.unstable_shouldYield,qm=o.unstable_requestPaint,Pl=o.unstable_now,Bm=o.unstable_getCurrentPriorityLevel,vf=o.unstable_ImmediatePriority,gf=o.unstable_UserBlockingPriority,Mu=o.unstable_NormalPriority,Ym=o.unstable_LowPriority,Sf=o.unstable_IdlePriority,Xm=o.log,Gm=o.unstable_setDisableYieldValue,Me=null,lt=null;function kt(l){if(typeof Xm=="function"&&Gm(l),lt&&typeof lt.setStrictMode=="function")try{lt.setStrictMode(Me,l)}catch{}}var tt=Math.clz32?Math.clz32:Vm,Qm=Math.log,Zm=Math.LN2;function Vm(l){return l>>>=0,l===0?32:31-(Qm(l)/Zm|0)|0}var _u=256,xu=262144,Du=4194304;function Ta(l){var t=l&42;if(t!==0)return t;switch(l&-l){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 l&261888;case 262144:case 524288:case 1048576:case 2097152:return l&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return l&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return l}}function Ou(l,t,a){var e=l.pendingLanes;if(e===0)return 0;var u=0,n=l.suspendedLanes,c=l.pingedLanes;l=l.warmLanes;var i=e&134217727;return i!==0?(e=i&~n,e!==0?u=Ta(e):(c&=i,c!==0?u=Ta(c):a||(a=i&~l,a!==0&&(u=Ta(a))))):(i=e&~n,i!==0?u=Ta(i):c!==0?u=Ta(c):a||(a=e&~l,a!==0&&(u=Ta(a)))),u===0?0:t!==0&&t!==u&&(t&n)===0&&(n=u&-u,a=t&-t,n>=a||n===32&&(a&4194048)!==0)?t:u}function _e(l,t){return(l.pendingLanes&~(l.suspendedLanes&~l.pingedLanes)&t)===0}function Lm(l,t){switch(l){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 bf(){var l=Du;return Du<<=1,(Du&62914560)===0&&(Du=4194304),l}function Fn(l){for(var t=[],a=0;31>a;a++)t.push(l);return t}function xe(l,t){l.pendingLanes|=t,t!==268435456&&(l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0)}function Km(l,t,a,e,u,n){var c=l.pendingLanes;l.pendingLanes=a,l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0,l.expiredLanes&=a,l.entangledLanes&=a,l.errorRecoveryDisabledLanes&=a,l.shellSuspendCounter=0;var i=l.entanglements,f=l.expirationTimes,y=l.hiddenUpdates;for(a=c&~a;0"u")return null;try{return l.activeElement||l.body}catch{return l.body}}var $m=/[\n"\\]/g;function ot(l){return l.replace($m,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function ac(l,t,a,e,u,n,c,i){l.name="",c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"?l.type=c:l.removeAttribute("type"),t!=null?c==="number"?(t===0&&l.value===""||l.value!=t)&&(l.value=""+st(t)):l.value!==""+st(t)&&(l.value=""+st(t)):c!=="submit"&&c!=="reset"||l.removeAttribute("value"),t!=null?ec(l,c,st(t)):a!=null?ec(l,c,st(a)):e!=null&&l.removeAttribute("value"),u==null&&n!=null&&(l.defaultChecked=!!n),u!=null&&(l.checked=u&&typeof u!="function"&&typeof u!="symbol"),i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"?l.name=""+st(i):l.removeAttribute("name")}function jf(l,t,a,e,u,n,c,i){if(n!=null&&typeof n!="function"&&typeof n!="symbol"&&typeof n!="boolean"&&(l.type=n),t!=null||a!=null){if(!(n!=="submit"&&n!=="reset"||t!=null)){tc(l);return}a=a!=null?""+st(a):"",t=t!=null?""+st(t):a,i||t===l.value||(l.value=t),l.defaultValue=t}e=e??u,e=typeof e!="function"&&typeof e!="symbol"&&!!e,l.checked=i?l.checked:!!e,l.defaultChecked=!!e,c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(l.name=c),tc(l)}function ec(l,t,a){t==="number"&&ju(l.ownerDocument)===l||l.defaultValue===""+a||(l.defaultValue=""+a)}function Ja(l,t,a,e){if(l=l.options,t){t={};for(var u=0;u"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),fc=!1;if(jt)try{var Ue={};Object.defineProperty(Ue,"passive",{get:function(){fc=!0}}),window.addEventListener("test",Ue,Ue),window.removeEventListener("test",Ue,Ue)}catch{fc=!1}var $t=null,sc=null,Ru=null;function Xf(){if(Ru)return Ru;var l,t=sc,a=t.length,e,u="value"in $t?$t.value:$t.textContent,n=u.length;for(l=0;l=Re),Kf=" ",Jf=!1;function wf(l,t){switch(l){case"keyup":return M0.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Wf(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var Fa=!1;function x0(l,t){switch(l){case"compositionend":return Wf(t);case"keypress":return t.which!==32?null:(Jf=!0,Kf);case"textInput":return l=t.data,l===Kf&&Jf?null:l;default:return null}}function D0(l,t){if(Fa)return l==="compositionend"||!rc&&wf(l,t)?(l=Xf(),Ru=sc=$t=null,Fa=!1,l):null;switch(l){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:a,offset:t-l};l=e}l:{for(;a;){if(a.nextSibling){a=a.nextSibling;break l}a=a.parentNode}a=void 0}a=as(a)}}function us(l,t){return l&&t?l===t?!0:l&&l.nodeType===3?!1:t&&t.nodeType===3?us(l,t.parentNode):"contains"in l?l.contains(t):l.compareDocumentPosition?!!(l.compareDocumentPosition(t)&16):!1:!1}function ns(l){l=l!=null&&l.ownerDocument!=null&&l.ownerDocument.defaultView!=null?l.ownerDocument.defaultView:window;for(var t=ju(l.document);t instanceof l.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)l=t.contentWindow;else break;t=ju(l.document)}return t}function gc(l){var t=l&&l.nodeName&&l.nodeName.toLowerCase();return t&&(t==="input"&&(l.type==="text"||l.type==="search"||l.type==="tel"||l.type==="url"||l.type==="password")||t==="textarea"||l.contentEditable==="true")}var q0=jt&&"documentMode"in document&&11>=document.documentMode,$a=null,Sc=null,Ye=null,bc=!1;function cs(l,t,a){var e=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;bc||$a==null||$a!==ju(e)||(e=$a,"selectionStart"in e&&gc(e)?e={start:e.selectionStart,end:e.selectionEnd}:(e=(e.ownerDocument&&e.ownerDocument.defaultView||window).getSelection(),e={anchorNode:e.anchorNode,anchorOffset:e.anchorOffset,focusNode:e.focusNode,focusOffset:e.focusOffset}),Ye&&Be(Ye,e)||(Ye=e,e=Dn(Sc,"onSelect"),0>=c,u-=c,At=1<<32-tt(t)+u|a<J?(ll=Y,Y=null):ll=Y.sibling;var cl=v(m,Y,r[J],E);if(cl===null){Y===null&&(Y=ll);break}l&&Y&&cl.alternate===null&&t(m,Y),s=n(cl,s,J),nl===null?G=cl:nl.sibling=cl,nl=cl,Y=ll}if(J===r.length)return a(m,Y),al&&Rt(m,J),G;if(Y===null){for(;JJ?(ll=Y,Y=null):ll=Y.sibling;var ba=v(m,Y,cl.value,E);if(ba===null){Y===null&&(Y=ll);break}l&&Y&&ba.alternate===null&&t(m,Y),s=n(ba,s,J),nl===null?G=ba:nl.sibling=ba,nl=ba,Y=ll}if(cl.done)return a(m,Y),al&&Rt(m,J),G;if(Y===null){for(;!cl.done;J++,cl=r.next())cl=A(m,cl.value,E),cl!==null&&(s=n(cl,s,J),nl===null?G=cl:nl.sibling=cl,nl=cl);return al&&Rt(m,J),G}for(Y=e(Y);!cl.done;J++,cl=r.next())cl=S(Y,m,J,cl.value,E),cl!==null&&(l&&cl.alternate!==null&&Y.delete(cl.key===null?J:cl.key),s=n(cl,s,J),nl===null?G=cl:nl.sibling=cl,nl=cl);return l&&Y.forEach(function(ar){return t(m,ar)}),al&&Rt(m,J),G}function yl(m,s,r,E){if(typeof r=="object"&&r!==null&&r.type===tl&&r.key===null&&(r=r.props.children),typeof r=="object"&&r!==null){switch(r.$$typeof){case H:l:{for(var G=r.key;s!==null;){if(s.key===G){if(G=r.type,G===tl){if(s.tag===7){a(m,s.sibling),E=u(s,r.props.children),E.return=m,m=E;break l}}else if(s.elementType===G||typeof G=="object"&&G!==null&&G.$$typeof===X&&Ca(G)===s.type){a(m,s.sibling),E=u(s,r.props),Le(E,r),E.return=m,m=E;break l}a(m,s);break}else t(m,s);s=s.sibling}r.type===tl?(E=Da(r.props.children,m.mode,E,r.key),E.return=m,m=E):(E=Lu(r.type,r.key,r.props,null,m.mode,E),Le(E,r),E.return=m,m=E)}return c(m);case k:l:{for(G=r.key;s!==null;){if(s.key===G)if(s.tag===4&&s.stateNode.containerInfo===r.containerInfo&&s.stateNode.implementation===r.implementation){a(m,s.sibling),E=u(s,r.children||[]),E.return=m,m=E;break l}else{a(m,s);break}else t(m,s);s=s.sibling}E=_c(r,m.mode,E),E.return=m,m=E}return c(m);case X:return r=Ca(r),yl(m,s,r,E)}if(Al(r))return R(m,s,r,E);if(El(r)){if(G=El(r),typeof G!="function")throw Error(d(150));return r=G.call(r),Q(m,s,r,E)}if(typeof r.then=="function")return yl(m,s,$u(r),E);if(r.$$typeof===L)return yl(m,s,wu(m,r),E);Iu(m,r)}return typeof r=="string"&&r!==""||typeof r=="number"||typeof r=="bigint"?(r=""+r,s!==null&&s.tag===6?(a(m,s.sibling),E=u(s,r),E.return=m,m=E):(a(m,s),E=Mc(r,m.mode,E),E.return=m,m=E),c(m)):a(m,s)}return function(m,s,r,E){try{Ve=0;var G=yl(m,s,r,E);return fe=null,G}catch(Y){if(Y===ie||Y===ku)throw Y;var nl=et(29,Y,null,m.mode);return nl.lanes=E,nl.return=m,nl}finally{}}}var Ha=Os(!0),Ns=Os(!1),aa=!1;function Yc(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Xc(l,t){l=l.updateQueue,t.updateQueue===l&&(t.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,callbacks:null})}function ea(l){return{lane:l,tag:0,payload:null,callback:null,next:null}}function ua(l,t,a){var e=l.updateQueue;if(e===null)return null;if(e=e.shared,(il&2)!==0){var u=e.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),e.pending=t,t=Vu(l),hs(l,null,a),t}return Zu(l,e,t,a),Vu(l)}function Ke(l,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var e=t.lanes;e&=l.pendingLanes,a|=e,t.lanes=a,pf(l,a)}}function Gc(l,t){var a=l.updateQueue,e=l.alternate;if(e!==null&&(e=e.updateQueue,a===e)){var u=null,n=null;if(a=a.firstBaseUpdate,a!==null){do{var c={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};n===null?u=n=c:n=n.next=c,a=a.next}while(a!==null);n===null?u=n=t:n=n.next=t}else u=n=t;a={baseState:e.baseState,firstBaseUpdate:u,lastBaseUpdate:n,shared:e.shared,callbacks:e.callbacks},l.updateQueue=a;return}l=a.lastBaseUpdate,l===null?a.firstBaseUpdate=t:l.next=t,a.lastBaseUpdate=t}var Qc=!1;function Je(){if(Qc){var l=ce;if(l!==null)throw l}}function we(l,t,a,e){Qc=!1;var u=l.updateQueue;aa=!1;var n=u.firstBaseUpdate,c=u.lastBaseUpdate,i=u.shared.pending;if(i!==null){u.shared.pending=null;var f=i,y=f.next;f.next=null,c===null?n=y:c.next=y,c=f;var p=l.alternate;p!==null&&(p=p.updateQueue,i=p.lastBaseUpdate,i!==c&&(i===null?p.firstBaseUpdate=y:i.next=y,p.lastBaseUpdate=f))}if(n!==null){var A=u.baseState;c=0,p=y=f=null,i=n;do{var v=i.lane&-536870913,S=v!==i.lane;if(S?(P&v)===v:(e&v)===v){v!==0&&v===ne&&(Qc=!0),p!==null&&(p=p.next={lane:0,tag:i.tag,payload:i.payload,callback:null,next:null});l:{var R=l,Q=i;v=t;var yl=a;switch(Q.tag){case 1:if(R=Q.payload,typeof R=="function"){A=R.call(yl,A,v);break l}A=R;break l;case 3:R.flags=R.flags&-65537|128;case 0:if(R=Q.payload,v=typeof R=="function"?R.call(yl,A,v):R,v==null)break l;A=z({},A,v);break l;case 2:aa=!0}}v=i.callback,v!==null&&(l.flags|=64,S&&(l.flags|=8192),S=u.callbacks,S===null?u.callbacks=[v]:S.push(v))}else S={lane:v,tag:i.tag,payload:i.payload,callback:i.callback,next:null},p===null?(y=p=S,f=A):p=p.next=S,c|=v;if(i=i.next,i===null){if(i=u.shared.pending,i===null)break;S=i,i=S.next,S.next=null,u.lastBaseUpdate=S,u.shared.pending=null}}while(!0);p===null&&(f=A),u.baseState=f,u.firstBaseUpdate=y,u.lastBaseUpdate=p,n===null&&(u.shared.lanes=0),sa|=c,l.lanes=c,l.memoizedState=A}}function Us(l,t){if(typeof l!="function")throw Error(d(191,l));l.call(t)}function js(l,t){var a=l.callbacks;if(a!==null)for(l.callbacks=null,l=0;ln?n:8;var c=h.T,i={};h.T=i,ci(l,!1,t,a);try{var f=u(),y=h.S;if(y!==null&&y(i,f),f!==null&&typeof f=="object"&&typeof f.then=="function"){var p=K0(f,e);Fe(l,t,p,ft(l))}else Fe(l,t,e,ft(l))}catch(A){Fe(l,t,{then:function(){},status:"rejected",reason:A},ft())}finally{_.p=n,c!==null&&i.types!==null&&(c.types=i.types),h.T=c}}function $0(){}function ui(l,t,a,e){if(l.tag!==5)throw Error(d(476));var u=oo(l).queue;so(l,u,t,B,a===null?$0:function(){return mo(l),a(e)})}function oo(l){var t=l.memoizedState;if(t!==null)return t;t={memoizedState:B,baseState:B,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yt,lastRenderedState:B},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yt,lastRenderedState:a},next:null},l.memoizedState=t,l=l.alternate,l!==null&&(l.memoizedState=t),t}function mo(l){var t=oo(l);t.next===null&&(t=l.alternate.memoizedState),Fe(l,t.next.queue,{},ft())}function ni(){return Ql(hu)}function ho(){return Dl().memoizedState}function ro(){return Dl().memoizedState}function I0(l){for(var t=l.return;t!==null;){switch(t.tag){case 24:case 3:var a=ft();l=ea(a);var e=ua(t,l,a);e!==null&&(Il(e,t,a),Ke(e,t,a)),t={cache:Rc()},l.payload=t;return}t=t.return}}function P0(l,t,a){var e=ft();a={lane:e,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},sn(l)?vo(t,a):(a=Ec(l,t,a,e),a!==null&&(Il(a,l,e),go(a,t,e)))}function yo(l,t,a){var e=ft();Fe(l,t,a,e)}function Fe(l,t,a,e){var u={lane:e,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(sn(l))vo(t,u);else{var n=l.alternate;if(l.lanes===0&&(n===null||n.lanes===0)&&(n=t.lastRenderedReducer,n!==null))try{var c=t.lastRenderedState,i=n(c,a);if(u.hasEagerState=!0,u.eagerState=i,at(i,c))return Zu(l,t,u,0),vl===null&&Qu(),!1}catch{}finally{}if(a=Ec(l,t,u,e),a!==null)return Il(a,l,e),go(a,t,e),!0}return!1}function ci(l,t,a,e){if(e={lane:2,revertLane:Yi(),gesture:null,action:e,hasEagerState:!1,eagerState:null,next:null},sn(l)){if(t)throw Error(d(479))}else t=Ec(l,a,e,2),t!==null&&Il(t,l,2)}function sn(l){var t=l.alternate;return l===K||t!==null&&t===K}function vo(l,t){oe=tn=!0;var a=l.pending;a===null?t.next=t:(t.next=a.next,a.next=t),l.pending=t}function go(l,t,a){if((a&4194048)!==0){var e=t.lanes;e&=l.pendingLanes,a|=e,t.lanes=a,pf(l,a)}}var $e={readContext:Ql,use:un,useCallback:Ml,useContext:Ml,useEffect:Ml,useImperativeHandle:Ml,useLayoutEffect:Ml,useInsertionEffect:Ml,useMemo:Ml,useReducer:Ml,useRef:Ml,useState:Ml,useDebugValue:Ml,useDeferredValue:Ml,useTransition:Ml,useSyncExternalStore:Ml,useId:Ml,useHostTransitionStatus:Ml,useFormState:Ml,useActionState:Ml,useOptimistic:Ml,useMemoCache:Ml,useCacheRefresh:Ml};$e.useEffectEvent=Ml;var So={readContext:Ql,use:un,useCallback:function(l,t){return Kl().memoizedState=[l,t===void 0?null:t],l},useContext:Ql,useEffect:lo,useImperativeHandle:function(l,t,a){a=a!=null?a.concat([l]):null,cn(4194308,4,uo.bind(null,t,l),a)},useLayoutEffect:function(l,t){return cn(4194308,4,l,t)},useInsertionEffect:function(l,t){cn(4,2,l,t)},useMemo:function(l,t){var a=Kl();t=t===void 0?null:t;var e=l();if(qa){kt(!0);try{l()}finally{kt(!1)}}return a.memoizedState=[e,t],e},useReducer:function(l,t,a){var e=Kl();if(a!==void 0){var u=a(t);if(qa){kt(!0);try{a(t)}finally{kt(!1)}}}else u=t;return e.memoizedState=e.baseState=u,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:u},e.queue=l,l=l.dispatch=P0.bind(null,K,l),[e.memoizedState,l]},useRef:function(l){var t=Kl();return l={current:l},t.memoizedState=l},useState:function(l){l=Pc(l);var t=l.queue,a=yo.bind(null,K,t);return t.dispatch=a,[l.memoizedState,a]},useDebugValue:ai,useDeferredValue:function(l,t){var a=Kl();return ei(a,l,t)},useTransition:function(){var l=Pc(!1);return l=so.bind(null,K,l.queue,!0,!1),Kl().memoizedState=l,[!1,l]},useSyncExternalStore:function(l,t,a){var e=K,u=Kl();if(al){if(a===void 0)throw Error(d(407));a=a()}else{if(a=t(),vl===null)throw Error(d(349));(P&127)!==0||Ys(e,t,a)}u.memoizedState=a;var n={value:a,getSnapshot:t};return u.queue=n,lo(Gs.bind(null,e,n,l),[l]),e.flags|=2048,me(9,{destroy:void 0},Xs.bind(null,e,n,a,t),null),a},useId:function(){var l=Kl(),t=vl.identifierPrefix;if(al){var a=Mt,e=At;a=(e&~(1<<32-tt(e)-1)).toString(32)+a,t="_"+t+"R_"+a,a=an++,0<\/script>",n=n.removeChild(n.firstChild);break;case"select":n=typeof e.is=="string"?c.createElement("select",{is:e.is}):c.createElement("select"),e.multiple?n.multiple=!0:e.size&&(n.size=e.size);break;default:n=typeof e.is=="string"?c.createElement(u,{is:e.is}):c.createElement(u)}}n[Xl]=t,n[Jl]=e;l:for(c=t.child;c!==null;){if(c.tag===5||c.tag===6)n.appendChild(c.stateNode);else if(c.tag!==4&&c.tag!==27&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===t)break l;for(;c.sibling===null;){if(c.return===null||c.return===t)break l;c=c.return}c.sibling.return=c.return,c=c.sibling}t.stateNode=n;l:switch(Vl(n,u,e),u){case"button":case"input":case"select":case"textarea":e=!!e.autoFocus;break l;case"img":e=!0;break l;default:e=!1}e&&Gt(t)}}return bl(t),zi(t,t.type,l===null?null:l.memoizedProps,t.pendingProps,a),null;case 6:if(l&&t.stateNode!=null)l.memoizedProps!==e&&Gt(t);else{if(typeof e!="string"&&t.stateNode===null)throw Error(d(166));if(l=Wt.current,ee(t)){if(l=t.stateNode,a=t.memoizedProps,e=null,u=Gl,u!==null)switch(u.tag){case 27:case 5:e=u.memoizedProps}l[Xl]=t,l=!!(l.nodeValue===a||e!==null&&e.suppressHydrationWarning===!0||Bd(l.nodeValue,a)),l||la(t,!0)}else l=On(l).createTextNode(e),l[Xl]=t,t.stateNode=l}return bl(t),null;case 31:if(a=t.memoizedState,l===null||l.memoizedState!==null){if(e=ee(t),a!==null){if(l===null){if(!e)throw Error(d(318));if(l=t.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(d(557));l[Xl]=t}else Oa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;bl(t),l=!1}else a=Nc(),l!==null&&l.memoizedState!==null&&(l.memoizedState.hydrationErrors=a),l=!0;if(!l)return t.flags&256?(nt(t),t):(nt(t),null);if((t.flags&128)!==0)throw Error(d(558))}return bl(t),null;case 13:if(e=t.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(u=ee(t),e!==null&&e.dehydrated!==null){if(l===null){if(!u)throw Error(d(318));if(u=t.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(d(317));u[Xl]=t}else Oa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;bl(t),u=!1}else u=Nc(),l!==null&&l.memoizedState!==null&&(l.memoizedState.hydrationErrors=u),u=!0;if(!u)return t.flags&256?(nt(t),t):(nt(t),null)}return nt(t),(t.flags&128)!==0?(t.lanes=a,t):(a=e!==null,l=l!==null&&l.memoizedState!==null,a&&(e=t.child,u=null,e.alternate!==null&&e.alternate.memoizedState!==null&&e.alternate.memoizedState.cachePool!==null&&(u=e.alternate.memoizedState.cachePool.pool),n=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),n!==u&&(e.flags|=2048)),a!==l&&a&&(t.child.flags|=8192),rn(t,t.updateQueue),bl(t),null);case 4:return Ga(),l===null&&Zi(t.stateNode.containerInfo),bl(t),null;case 10:return qt(t.type),bl(t),null;case 19:if(Tl(xl),e=t.memoizedState,e===null)return bl(t),null;if(u=(t.flags&128)!==0,n=e.rendering,n===null)if(u)Pe(e,!1);else{if(_l!==0||l!==null&&(l.flags&128)!==0)for(l=t.child;l!==null;){if(n=ln(l),n!==null){for(t.flags|=128,Pe(e,!1),l=n.updateQueue,t.updateQueue=l,rn(t,l),t.subtreeFlags=0,l=a,a=t.child;a!==null;)rs(a,l),a=a.sibling;return fl(xl,xl.current&1|2),al&&Rt(t,e.treeForkCount),t.child}l=l.sibling}e.tail!==null&&Pl()>bn&&(t.flags|=128,u=!0,Pe(e,!1),t.lanes=4194304)}else{if(!u)if(l=ln(n),l!==null){if(t.flags|=128,u=!0,l=l.updateQueue,t.updateQueue=l,rn(t,l),Pe(e,!0),e.tail===null&&e.tailMode==="hidden"&&!n.alternate&&!al)return bl(t),null}else 2*Pl()-e.renderingStartTime>bn&&a!==536870912&&(t.flags|=128,u=!0,Pe(e,!1),t.lanes=4194304);e.isBackwards?(n.sibling=t.child,t.child=n):(l=e.last,l!==null?l.sibling=n:t.child=n,e.last=n)}return e.tail!==null?(l=e.tail,e.rendering=l,e.tail=l.sibling,e.renderingStartTime=Pl(),l.sibling=null,a=xl.current,fl(xl,u?a&1|2:a&1),al&&Rt(t,e.treeForkCount),l):(bl(t),null);case 22:case 23:return nt(t),Vc(),e=t.memoizedState!==null,l!==null?l.memoizedState!==null!==e&&(t.flags|=8192):e&&(t.flags|=8192),e?(a&536870912)!==0&&(t.flags&128)===0&&(bl(t),t.subtreeFlags&6&&(t.flags|=8192)):bl(t),a=t.updateQueue,a!==null&&rn(t,a.retryQueue),a=null,l!==null&&l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(a=l.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(t.flags|=2048),l!==null&&Tl(ja),null;case 24:return a=null,l!==null&&(a=l.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),qt(Nl),bl(t),null;case 25:return null;case 30:return null}throw Error(d(156,t.tag))}function uh(l,t){switch(Dc(t),t.tag){case 1:return l=t.flags,l&65536?(t.flags=l&-65537|128,t):null;case 3:return qt(Nl),Ga(),l=t.flags,(l&65536)!==0&&(l&128)===0?(t.flags=l&-65537|128,t):null;case 26:case 27:case 5:return Au(t),null;case 31:if(t.memoizedState!==null){if(nt(t),t.alternate===null)throw Error(d(340));Oa()}return l=t.flags,l&65536?(t.flags=l&-65537|128,t):null;case 13:if(nt(t),l=t.memoizedState,l!==null&&l.dehydrated!==null){if(t.alternate===null)throw Error(d(340));Oa()}return l=t.flags,l&65536?(t.flags=l&-65537|128,t):null;case 19:return Tl(xl),null;case 4:return Ga(),null;case 10:return qt(t.type),null;case 22:case 23:return nt(t),Vc(),l!==null&&Tl(ja),l=t.flags,l&65536?(t.flags=l&-65537|128,t):null;case 24:return qt(Nl),null;case 25:return null;default:return null}}function Zo(l,t){switch(Dc(t),t.tag){case 3:qt(Nl),Ga();break;case 26:case 27:case 5:Au(t);break;case 4:Ga();break;case 31:t.memoizedState!==null&&nt(t);break;case 13:nt(t);break;case 19:Tl(xl);break;case 10:qt(t.type);break;case 22:case 23:nt(t),Vc(),l!==null&&Tl(ja);break;case 24:qt(Nl)}}function lu(l,t){try{var a=t.updateQueue,e=a!==null?a.lastEffect:null;if(e!==null){var u=e.next;a=u;do{if((a.tag&l)===l){e=void 0;var n=a.create,c=a.inst;e=n(),c.destroy=e}a=a.next}while(a!==u)}}catch(i){ol(t,t.return,i)}}function ia(l,t,a){try{var e=t.updateQueue,u=e!==null?e.lastEffect:null;if(u!==null){var n=u.next;e=n;do{if((e.tag&l)===l){var c=e.inst,i=c.destroy;if(i!==void 0){c.destroy=void 0,u=t;var f=a,y=i;try{y()}catch(p){ol(u,f,p)}}}e=e.next}while(e!==n)}}catch(p){ol(t,t.return,p)}}function Vo(l){var t=l.updateQueue;if(t!==null){var a=l.stateNode;try{js(t,a)}catch(e){ol(l,l.return,e)}}}function Lo(l,t,a){a.props=Ba(l.type,l.memoizedProps),a.state=l.memoizedState;try{a.componentWillUnmount()}catch(e){ol(l,t,e)}}function tu(l,t){try{var a=l.ref;if(a!==null){switch(l.tag){case 26:case 27:case 5:var e=l.stateNode;break;case 30:e=l.stateNode;break;default:e=l.stateNode}typeof a=="function"?l.refCleanup=a(e):a.current=e}}catch(u){ol(l,t,u)}}function _t(l,t){var a=l.ref,e=l.refCleanup;if(a!==null)if(typeof e=="function")try{e()}catch(u){ol(l,t,u)}finally{l.refCleanup=null,l=l.alternate,l!=null&&(l.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(u){ol(l,t,u)}else a.current=null}function Ko(l){var t=l.type,a=l.memoizedProps,e=l.stateNode;try{l:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&e.focus();break l;case"img":a.src?e.src=a.src:a.srcSet&&(e.srcset=a.srcSet)}}catch(u){ol(l,l.return,u)}}function pi(l,t,a){try{var e=l.stateNode;_h(e,l.type,a,t),e[Jl]=t}catch(u){ol(l,l.return,u)}}function Jo(l){return l.tag===5||l.tag===3||l.tag===26||l.tag===27&&ra(l.type)||l.tag===4}function Ti(l){l:for(;;){for(;l.sibling===null;){if(l.return===null||Jo(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&l.tag!==18;){if(l.tag===27&&ra(l.type)||l.flags&2||l.child===null||l.tag===4)continue l;l.child.return=l,l=l.child}if(!(l.flags&2))return l.stateNode}}function Ei(l,t,a){var e=l.tag;if(e===5||e===6)l=l.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(l,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(l),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=Ut));else if(e!==4&&(e===27&&ra(l.type)&&(a=l.stateNode,t=null),l=l.child,l!==null))for(Ei(l,t,a),l=l.sibling;l!==null;)Ei(l,t,a),l=l.sibling}function yn(l,t,a){var e=l.tag;if(e===5||e===6)l=l.stateNode,t?a.insertBefore(l,t):a.appendChild(l);else if(e!==4&&(e===27&&ra(l.type)&&(a=l.stateNode),l=l.child,l!==null))for(yn(l,t,a),l=l.sibling;l!==null;)yn(l,t,a),l=l.sibling}function wo(l){var t=l.stateNode,a=l.memoizedProps;try{for(var e=l.type,u=t.attributes;u.length;)t.removeAttributeNode(u[0]);Vl(t,e,a),t[Xl]=l,t[Jl]=a}catch(n){ol(l,l.return,n)}}var Qt=!1,Cl=!1,Ai=!1,Wo=typeof WeakSet=="function"?WeakSet:Set,Yl=null;function nh(l,t){if(l=l.containerInfo,Ki=qn,l=ns(l),gc(l)){if("selectionStart"in l)var a={start:l.selectionStart,end:l.selectionEnd};else l:{a=(a=l.ownerDocument)&&a.defaultView||window;var e=a.getSelection&&a.getSelection();if(e&&e.rangeCount!==0){a=e.anchorNode;var u=e.anchorOffset,n=e.focusNode;e=e.focusOffset;try{a.nodeType,n.nodeType}catch{a=null;break l}var c=0,i=-1,f=-1,y=0,p=0,A=l,v=null;t:for(;;){for(var S;A!==a||u!==0&&A.nodeType!==3||(i=c+u),A!==n||e!==0&&A.nodeType!==3||(f=c+e),A.nodeType===3&&(c+=A.nodeValue.length),(S=A.firstChild)!==null;)v=A,A=S;for(;;){if(A===l)break t;if(v===a&&++y===u&&(i=c),v===n&&++p===e&&(f=c),(S=A.nextSibling)!==null)break;A=v,v=A.parentNode}A=S}a=i===-1||f===-1?null:{start:i,end:f}}else a=null}a=a||{start:0,end:0}}else a=null;for(Ji={focusedElem:l,selectionRange:a},qn=!1,Yl=t;Yl!==null;)if(t=Yl,l=t.child,(t.subtreeFlags&1028)!==0&&l!==null)l.return=t,Yl=l;else for(;Yl!==null;){switch(t=Yl,n=t.alternate,l=t.flags,t.tag){case 0:if((l&4)!==0&&(l=t.updateQueue,l=l!==null?l.events:null,l!==null))for(a=0;a title"))),Vl(n,e,a),n[Xl]=l,Bl(n),e=n;break l;case"link":var c=lm("link","href",u).get(e+(a.href||""));if(c){for(var i=0;iyl&&(c=yl,yl=Q,Q=c);var m=es(i,Q),s=es(i,yl);if(m&&s&&(S.rangeCount!==1||S.anchorNode!==m.node||S.anchorOffset!==m.offset||S.focusNode!==s.node||S.focusOffset!==s.offset)){var r=A.createRange();r.setStart(m.node,m.offset),S.removeAllRanges(),Q>yl?(S.addRange(r),S.extend(s.node,s.offset)):(r.setEnd(s.node,s.offset),S.addRange(r))}}}}for(A=[],S=i;S=S.parentNode;)S.nodeType===1&&A.push({element:S,left:S.scrollLeft,top:S.scrollTop});for(typeof i.focus=="function"&&i.focus(),i=0;ia?32:a,h.T=null,a=Ui,Ui=null;var n=da,c=Jt;if(Hl=0,ge=da=null,Jt=0,(il&6)!==0)throw Error(d(331));var i=il;if(il|=4,nd(n.current),ad(n,n.current,c,a),il=i,iu(0,!1),lt&&typeof lt.onPostCommitFiberRoot=="function")try{lt.onPostCommitFiberRoot(Me,n)}catch{}return!0}finally{_.p=u,h.T=e,Ed(l,t)}}function Md(l,t,a){t=mt(a,t),t=oi(l.stateNode,t,2),l=ua(l,t,2),l!==null&&(xe(l,2),xt(l))}function ol(l,t,a){if(l.tag===3)Md(l,l,a);else for(;t!==null;){if(t.tag===3){Md(t,l,a);break}else if(t.tag===1){var e=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof e.componentDidCatch=="function"&&(oa===null||!oa.has(e))){l=mt(a,l),a=_o(2),e=ua(t,a,2),e!==null&&(xo(a,e,t,l),xe(e,2),xt(e));break}}t=t.return}}function Hi(l,t,a){var e=l.pingCache;if(e===null){e=l.pingCache=new fh;var u=new Set;e.set(t,u)}else u=e.get(t),u===void 0&&(u=new Set,e.set(t,u));u.has(a)||(xi=!0,u.add(a),l=hh.bind(null,l,t,a),t.then(l,l))}function hh(l,t,a){var e=l.pingCache;e!==null&&e.delete(t),l.pingedLanes|=l.suspendedLanes&a,l.warmLanes&=~a,vl===l&&(P&a)===a&&(_l===4||_l===3&&(P&62914560)===P&&300>Pl()-Sn?(il&2)===0&&Se(l,0):Di|=a,ve===P&&(ve=0)),xt(l)}function _d(l,t){t===0&&(t=bf()),l=xa(l,t),l!==null&&(xe(l,t),xt(l))}function rh(l){var t=l.memoizedState,a=0;t!==null&&(a=t.retryLane),_d(l,a)}function yh(l,t){var a=0;switch(l.tag){case 31:case 13:var e=l.stateNode,u=l.memoizedState;u!==null&&(a=u.retryLane);break;case 19:e=l.stateNode;break;case 22:e=l.stateNode._retryCache;break;default:throw Error(d(314))}e!==null&&e.delete(t),_d(l,a)}function vh(l,t){return Wn(l,t)}var Mn=null,ze=null,qi=!1,_n=!1,Bi=!1,ha=0;function xt(l){l!==ze&&l.next===null&&(ze===null?Mn=ze=l:ze=ze.next=l),_n=!0,qi||(qi=!0,Sh())}function iu(l,t){if(!Bi&&_n){Bi=!0;do for(var a=!1,e=Mn;e!==null;){if(l!==0){var u=e.pendingLanes;if(u===0)var n=0;else{var c=e.suspendedLanes,i=e.pingedLanes;n=(1<<31-tt(42|l)+1)-1,n&=u&~(c&~i),n=n&201326741?n&201326741|1:n?n|2:0}n!==0&&(a=!0,Nd(e,n))}else n=P,n=Ou(e,e===vl?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),(n&3)===0||_e(e,n)||(a=!0,Nd(e,n));e=e.next}while(a);Bi=!1}}function gh(){xd()}function xd(){_n=qi=!1;var l=0;ha!==0&&Dh()&&(l=ha);for(var t=Pl(),a=null,e=Mn;e!==null;){var u=e.next,n=Dd(e,t);n===0?(e.next=null,a===null?Mn=u:a.next=u,u===null&&(ze=a)):(a=e,(l!==0||(n&3)!==0)&&(_n=!0)),e=u}Hl!==0&&Hl!==5||iu(l),ha!==0&&(ha=0)}function Dd(l,t){for(var a=l.suspendedLanes,e=l.pingedLanes,u=l.expirationTimes,n=l.pendingLanes&-62914561;0i)break;var p=f.transferSize,A=f.initiatorType;p&&Yd(A)&&(f=f.responseEnd,c+=p*(f"u"?null:document;function Fd(l,t,a){var e=pe;if(e&&typeof t=="string"&&t){var u=ot(t);u='link[rel="'+l+'"][href="'+u+'"]',typeof a=="string"&&(u+='[crossorigin="'+a+'"]'),kd.has(u)||(kd.add(u),l={rel:l,crossOrigin:a,href:t},e.querySelector(u)===null&&(t=e.createElement("link"),Vl(t,"link",l),Bl(t),e.head.appendChild(t)))}}function Bh(l){wt.D(l),Fd("dns-prefetch",l,null)}function Yh(l,t){wt.C(l,t),Fd("preconnect",l,t)}function Xh(l,t,a){wt.L(l,t,a);var e=pe;if(e&&l&&t){var u='link[rel="preload"][as="'+ot(t)+'"]';t==="image"&&a&&a.imageSrcSet?(u+='[imagesrcset="'+ot(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(u+='[imagesizes="'+ot(a.imageSizes)+'"]')):u+='[href="'+ot(l)+'"]';var n=u;switch(t){case"style":n=Te(l);break;case"script":n=Ee(l)}St.has(n)||(l=z({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:l,as:t},a),St.set(n,l),e.querySelector(u)!==null||t==="style"&&e.querySelector(du(n))||t==="script"&&e.querySelector(mu(n))||(t=e.createElement("link"),Vl(t,"link",l),Bl(t),e.head.appendChild(t)))}}function Gh(l,t){wt.m(l,t);var a=pe;if(a&&l){var e=t&&typeof t.as=="string"?t.as:"script",u='link[rel="modulepreload"][as="'+ot(e)+'"][href="'+ot(l)+'"]',n=u;switch(e){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":n=Ee(l)}if(!St.has(n)&&(l=z({rel:"modulepreload",href:l},t),St.set(n,l),a.querySelector(u)===null)){switch(e){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(mu(n)))return}e=a.createElement("link"),Vl(e,"link",l),Bl(e),a.head.appendChild(e)}}}function Qh(l,t,a){wt.S(l,t,a);var e=pe;if(e&&l){var u=La(e).hoistableStyles,n=Te(l);t=t||"default";var c=u.get(n);if(!c){var i={loading:0,preload:null};if(c=e.querySelector(du(n)))i.loading=5;else{l=z({rel:"stylesheet",href:l,"data-precedence":t},a),(a=St.get(n))&&Pi(l,a);var f=c=e.createElement("link");Bl(f),Vl(f,"link",l),f._p=new Promise(function(y,p){f.onload=y,f.onerror=p}),f.addEventListener("load",function(){i.loading|=1}),f.addEventListener("error",function(){i.loading|=2}),i.loading|=4,Un(c,t,e)}c={type:"stylesheet",instance:c,count:1,state:i},u.set(n,c)}}}function Zh(l,t){wt.X(l,t);var a=pe;if(a&&l){var e=La(a).hoistableScripts,u=Ee(l),n=e.get(u);n||(n=a.querySelector(mu(u)),n||(l=z({src:l,async:!0},t),(t=St.get(u))&&lf(l,t),n=a.createElement("script"),Bl(n),Vl(n,"link",l),a.head.appendChild(n)),n={type:"script",instance:n,count:1,state:null},e.set(u,n))}}function Vh(l,t){wt.M(l,t);var a=pe;if(a&&l){var e=La(a).hoistableScripts,u=Ee(l),n=e.get(u);n||(n=a.querySelector(mu(u)),n||(l=z({src:l,async:!0,type:"module"},t),(t=St.get(u))&&lf(l,t),n=a.createElement("script"),Bl(n),Vl(n,"link",l),a.head.appendChild(n)),n={type:"script",instance:n,count:1,state:null},e.set(u,n))}}function $d(l,t,a,e){var u=(u=Wt.current)?Nn(u):null;if(!u)throw Error(d(446));switch(l){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=Te(a.href),a=La(u).hoistableStyles,e=a.get(t),e||(e={type:"style",instance:null,count:0,state:null},a.set(t,e)),e):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){l=Te(a.href);var n=La(u).hoistableStyles,c=n.get(l);if(c||(u=u.ownerDocument||u,c={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},n.set(l,c),(n=u.querySelector(du(l)))&&!n._p&&(c.instance=n,c.state.loading=5),St.has(l)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},St.set(l,a),n||Lh(u,l,a,c.state))),t&&e===null)throw Error(d(528,""));return c}if(t&&e!==null)throw Error(d(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Ee(a),a=La(u).hoistableScripts,e=a.get(t),e||(e={type:"script",instance:null,count:0,state:null},a.set(t,e)),e):{type:"void",instance:null,count:0,state:null};default:throw Error(d(444,l))}}function Te(l){return'href="'+ot(l)+'"'}function du(l){return'link[rel="stylesheet"]['+l+"]"}function Id(l){return z({},l,{"data-precedence":l.precedence,precedence:null})}function Lh(l,t,a,e){l.querySelector('link[rel="preload"][as="style"]['+t+"]")?e.loading=1:(t=l.createElement("link"),e.preload=t,t.addEventListener("load",function(){return e.loading|=1}),t.addEventListener("error",function(){return e.loading|=2}),Vl(t,"link",a),Bl(t),l.head.appendChild(t))}function Ee(l){return'[src="'+ot(l)+'"]'}function mu(l){return"script[async]"+l}function Pd(l,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var e=l.querySelector('style[data-href~="'+ot(a.href)+'"]');if(e)return t.instance=e,Bl(e),e;var u=z({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return e=(l.ownerDocument||l).createElement("style"),Bl(e),Vl(e,"style",u),Un(e,a.precedence,l),t.instance=e;case"stylesheet":u=Te(a.href);var n=l.querySelector(du(u));if(n)return t.state.loading|=4,t.instance=n,Bl(n),n;e=Id(a),(u=St.get(u))&&Pi(e,u),n=(l.ownerDocument||l).createElement("link"),Bl(n);var c=n;return c._p=new Promise(function(i,f){c.onload=i,c.onerror=f}),Vl(n,"link",e),t.state.loading|=4,Un(n,a.precedence,l),t.instance=n;case"script":return n=Ee(a.src),(u=l.querySelector(mu(n)))?(t.instance=u,Bl(u),u):(e=a,(u=St.get(n))&&(e=z({},a),lf(e,u)),l=l.ownerDocument||l,u=l.createElement("script"),Bl(u),Vl(u,"link",e),l.head.appendChild(u),t.instance=u);case"void":return null;default:throw Error(d(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(e=t.instance,t.state.loading|=4,Un(e,a.precedence,l));return t.instance}function Un(l,t,a){for(var e=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=e.length?e[e.length-1]:null,n=u,c=0;c title"):null)}function Kh(l,t,a){if(a===1||t.itemProp!=null)return!1;switch(l){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return l=t.disabled,typeof t.precedence=="string"&&l==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function am(l){return!(l.type==="stylesheet"&&(l.state.loading&3)===0)}function Jh(l,t,a,e){if(a.type==="stylesheet"&&(typeof e.media!="string"||matchMedia(e.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var u=Te(e.href),n=t.querySelector(du(u));if(n){t=n._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(l.count++,l=Cn.bind(l),t.then(l,l)),a.state.loading|=4,a.instance=n,Bl(n);return}n=t.ownerDocument||t,e=Id(e),(u=St.get(u))&&Pi(e,u),n=n.createElement("link"),Bl(n);var c=n;c._p=new Promise(function(i,f){c.onload=i,c.onerror=f}),Vl(n,"link",e),a.instance=n}l.stylesheets===null&&(l.stylesheets=new Map),l.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(l.count++,a=Cn.bind(l),t.addEventListener("load",a),t.addEventListener("error",a))}}var tf=0;function wh(l,t){return l.stylesheets&&l.count===0&&Hn(l,l.stylesheets),0tf?50:800)+t);return l.unsuspend=a,function(){l.unsuspend=null,clearTimeout(e),clearTimeout(u)}}:null}function Cn(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Hn(this,this.stylesheets);else if(this.unsuspend){var l=this.unsuspend;this.unsuspend=null,l()}}}var Rn=null;function Hn(l,t){l.stylesheets=null,l.unsuspend!==null&&(l.count++,Rn=new Map,t.forEach(Wh,l),Rn=null,Cn.call(l))}function Wh(l,t){if(!(t.state.loading&4)){var a=Rn.get(l);if(a)var e=a.get(null);else{a=new Map,Rn.set(l,a);for(var u=l.querySelectorAll("link[data-precedence],style[data-precedence]"),n=0;n"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(o)}catch(x){console.error(x)}}return o(),of.exports=sr(),of.exports}var dr=or();const xm=T.createContext({windows:[],openWindow:()=>{},closeWindow:()=>{},bringToFront:()=>{}}),mr=({children:o})=>{const[x,D]=T.useState([]),d=T.useRef(1e4),C=T.useCallback((j,b,M)=>{D(q=>q.find(U=>U.id===j)?q.map(U=>U.id===j?{...U,zIndex:++d.current}:U):[...q,{id:j,title:b,charName:M,zIndex:++d.current}])},[]),N=T.useCallback(j=>{D(b=>b.filter(M=>M.id!==j))},[]),O=T.useCallback(j=>{D(b=>b.map(M=>M.id===j?{...M,zIndex:++d.current}:M))},[]);return g.jsx(xm.Provider,{value:{windows:x,openWindow:C,closeWindow:N,bringToFront:O},children:o})},zu=()=>T.useContext(xm),bt={west:-102.1,east:102.1,north:102.1,south:-102.1};function pu(o,x,D,d){const C=(o-bt.west)/(bt.east-bt.west)*D,N=(bt.north-x)/(bt.north-bt.south)*d;return{x:C,y:N}}function hr(o,x,D,d,C,N,O){const j=(o-d)/D,b=(x-C)/D,M=bt.west+j/N*(bt.east-bt.west),q=bt.north-b/O*(bt.north-bt.south);return{ew:M,ns:q}}function hf(o,x){const D=o>=0?"N":"S",d=x>=0?"E":"W";return`${Math.abs(o).toFixed(1)}${D}, ${Math.abs(x).toFixed(1)}${d}`}const Dm=bu.memo(({players:o,imgW:x,imgH:D,getColor:d,onHover:C,onSelect:N,selectedPlayer:O})=>{const{openWindow:j}=zu(),[b,M]=T.useState(null);T.useEffect(()=>{const z=()=>M(null);return b&&window.addEventListener("click",z),()=>window.removeEventListener("click",z)},[b]);const q=T.useMemo(()=>o.filter(z=>z.ew!==void 0&&z.ns!==void 0).map(z=>({...z,pos:pu(z.ew,z.ns,x,D),color:d(z.character_name)})),[o,x,D,d]);return g.jsxs("div",{className:"ml-dots-layer",children:[q.map(z=>g.jsx("div",{className:`ml-dot ${O===z.character_name?"ml-dot-selected":""}`,style:{left:z.pos.x,top:z.pos.y,backgroundColor:z.color},onMouseEnter:U=>{var k;const H=(k=U.currentTarget.closest(".ml-map-container"))==null?void 0:k.getBoundingClientRect();H&&C(z,U.clientX-H.left,U.clientY-H.top)},onMouseLeave:()=>C(null,0,0),onClick:()=>N(z.character_name),onDoubleClick:()=>j(`chat-${z.character_name}`,`Chat: ${z.character_name}`,z.character_name),onContextMenu:U=>{var gl;U.preventDefault();const H=z.character_name,k=(gl=U.currentTarget.closest(".ml-map-container"))==null?void 0:gl.getBoundingClientRect(),tl=k?U.clientX-k.left:U.clientX,dl=k?U.clientY-k.top:U.clientY;M({name:H,x:tl,y:dl})}},z.character_name)),b&&g.jsx("div",{style:{position:"fixed",left:b.x+410,top:b.y,background:"#1a1a1a",border:"1px solid #444",borderRadius:4,zIndex:9999,padding:"2px 0",fontSize:"0.75rem",boxShadow:"0 4px 12px rgba(0,0,0,0.5)",minWidth:120},children:[{label:"Chat",id:"chat"},{label:"Stats",id:"stats"},{label:"Inventory",id:"inv"},{label:"Character",id:"char"},{label:"Combat",id:"combat"},{label:"Radar",id:"radar"}].map(z=>g.jsx("div",{onClick:()=>{j(`${z.id}-${b.name}`,`${z.label}: ${b.name}`,b.name),M(null)},style:{padding:"4px 12px",cursor:"pointer",color:"#ccc"},onMouseEnter:U=>U.currentTarget.style.background="#333",onMouseLeave:U=>U.currentTarget.style.background="",children:z.label},z.id))})]})});Dm.displayName="PlayerDots";const rr="/api";async function za(o){const x=await fetch(`${rr}${o}`,{credentials:"include"});if(!x.ok)throw new Error(`API ${o}: ${x.status}`);return x.json()}function yr(){return`${location.protocol==="https:"?"wss:":"ws:"}//${location.host}/api/ws/live`}const Om=bu.memo(({imgW:o,imgH:x,getColor:D})=>{const[d,C]=T.useState([]);T.useEffect(()=>{const O=async()=>{try{const b=await za("/trails/?seconds=600");C(b.trails??[])}catch{}};O();const j=setInterval(O,2e3);return()=>clearInterval(j)},[]);const N=T.useMemo(()=>{const O={};for(const j of d){const{x:b,y:M}=pu(j.ew,j.ns,o,x);O[j.character_name]||(O[j.character_name]=[]),O[j.character_name].push(`${b},${M}`)}return Object.entries(O).filter(([,j])=>j.length>=2).map(([j,b])=>({name:j,points:b.join(" ")}))},[d,o,x]);return g.jsx("svg",{className:"ml-trails-svg",viewBox:`0 0 ${o} ${x}`,preserveAspectRatio:"none",children:N.map(O=>g.jsx("polyline",{points:O.points,stroke:D(O.name),fill:"none",strokeWidth:2,strokeOpacity:.7,strokeLinecap:"round",strokeLinejoin:"round"},O.name))})});Om.displayName="TrailsSVG";const vr=({imgW:o,imgH:x,enabled:D})=>{const d=T.useRef(null),[C,N]=T.useState([]);return T.useEffect(()=>{if(!D)return;(async()=>{try{const j=await za("/spawns/heatmap?hours=24&limit=50000");N(j.spawn_points??[])}catch{}})()},[D]),T.useEffect(()=>{const O=d.current;if(!O||!D||C.length===0||o===0)return;O.width=o,O.height=x;const j=O.getContext("2d");if(j){j.clearRect(0,0,o,x);for(const b of C){const{x:M,y:q}=pu(b.ew,b.ns,o,x),z=Math.max(5,Math.min(12,5+Math.sqrt(b.intensity*.5))),U=j.createRadialGradient(M,q,0,M,q,z);U.addColorStop(0,`rgba(255, 0, 0, ${Math.min(.9,b.intensity/40)})`),U.addColorStop(.6,`rgba(255, 100, 0, ${Math.min(.4,b.intensity/120)})`),U.addColorStop(1,"rgba(255, 150, 0, 0)"),j.fillStyle=U,j.fillRect(M-z,q-z,z*2,z*2)}}},[C,o,x,D]),D?g.jsx("canvas",{ref:d,className:"ml-heatmap-canvas"}):null},gr=({imgW:o,imgH:x,enabled:D})=>{const[d,C]=T.useState([]);T.useEffect(()=>{if(!D)return;const O=async()=>{try{const b=await za("/portals");C(b.portals??[])}catch{}};O();const j=setInterval(O,6e4);return()=>clearInterval(j)},[D]);const N=T.useMemo(()=>d.map(O=>({...O,pos:pu(O.coordinates.ew,O.coordinates.ns,o,x)})),[d,o,x]);return!D||N.length===0?null:g.jsx("div",{className:"ml-portals-layer",children:N.map((O,j)=>g.jsx("div",{className:"ml-portal-icon",style:{left:O.pos.x,top:O.pos.y},title:`${O.portal_name} (by ${O.discovered_by})`},j))})},Tm=20,Em=.3,Sr=({players:o,getColor:x,onSelectPlayer:D,showHeatmap:d,showPortals:C,selectedPlayer:N})=>{var Ll;const O=T.useRef(null),j=T.useRef(null),[b,M]=T.useState({w:0,h:0}),[q,z]=T.useState(null),U=T.useRef(null),H=T.useRef({scale:1,offX:0,offY:0}),k=T.useRef({dragging:!1,sx:0,sy:0,startOffX:0,startOffY:0}),tl=T.useCallback(()=>{if(j.current){const{scale:w,offX:F,offY:X}=H.current;j.current.style.transform=`translate(${F}px, ${X}px) scale(${w})`}},[]),dl=T.useCallback(w=>{const F=w.currentTarget;if(M({w:F.naturalWidth,h:F.naturalHeight}),O.current){const X=O.current.clientWidth,W=O.current.clientHeight,el=Math.min(X/F.naturalWidth,W/F.naturalHeight);H.current={scale:el,offX:(X-F.naturalWidth*el)/2,offY:(W-F.naturalHeight*el)/2},tl()}},[tl]),gl=T.useCallback(w=>{var V;w.preventDefault();const F=(V=O.current)==null?void 0:V.getBoundingClientRect();if(!F)return;const X=H.current,W=w.deltaY<0?1.1:.9,el=Math.min(Tm,Math.max(Em,X.scale*W)),Rl=el/X.scale,El=w.clientX-F.left,Ot=w.clientY-F.top;H.current={scale:el,offX:El-(El-X.offX)*Rl,offY:Ot-(Ot-X.offY)*Rl},tl()},[tl]),Z=T.useCallback(w=>{if(w.button!==0)return;const F=H.current;k.current={dragging:!0,sx:w.clientX,sy:w.clientY,startOffX:F.offX,startOffY:F.offY}},[]);T.useEffect(()=>{const w=X=>{const W=k.current;if(W.dragging&&(H.current.offX=W.startOffX+(X.clientX-W.sx),H.current.offY=W.startOffY+(X.clientY-W.sy),tl()),O.current&&b.w>0&&U.current){const el=O.current.getBoundingClientRect(),Rl=H.current,El=hr(X.clientX-el.left,X.clientY-el.top,Rl.scale,Rl.offX,Rl.offY,b.w,b.h);U.current.textContent=hf(El.ns,El.ew)}},F=()=>{k.current.dragging=!1};return window.addEventListener("mousemove",w),window.addEventListener("mouseup",F),()=>{window.removeEventListener("mousemove",w),window.removeEventListener("mouseup",F)}},[tl,b.w,b.h]);const L=T.useRef(null);T.useEffect(()=>{if(!N||b.w===0||!O.current||L.current===N)return;const w=o.find(Rl=>Rl.character_name===N);if(!w)return;L.current=N;const{x:F,y:X}=pu(w.ew,w.ns,b.w,b.h),W=O.current.getBoundingClientRect(),el=3;H.current={scale:Math.min(Tm,Math.max(Em,el)),offX:W.width/2-F*el,offY:W.height/2-X*el},tl()},[N,o,b.w,b.h,tl]),T.useEffect(()=>{N||(L.current=null)},[N]);const Ol=T.useCallback((w,F,X)=>{z(w?{x:F,y:X,player:w}:null)},[]);return g.jsxs("div",{className:"ml-map-container",ref:O,onWheel:gl,onMouseDown:Z,children:[g.jsxs("div",{ref:j,className:"ml-map-group",children:[g.jsx("img",{src:"/dereth.png",alt:"Dereth",className:"ml-map-img",onLoad:dl,draggable:!1}),b.w>0&&g.jsxs(g.Fragment,{children:[g.jsx(vr,{imgW:b.w,imgH:b.h,enabled:d}),g.jsx(Om,{imgW:b.w,imgH:b.h,getColor:x}),g.jsx(Dm,{players:o,imgW:b.w,imgH:b.h,getColor:x,onHover:Ol,onSelect:D,selectedPlayer:N}),g.jsx(gr,{imgW:b.w,imgH:b.h,enabled:C})]})]}),q&&g.jsxs("div",{className:"ml-tooltip",style:{left:q.x+12,top:q.y-10},children:[g.jsx("strong",{children:q.player.character_name}),g.jsx("br",{}),hf(q.player.ns,q.player.ew),g.jsx("br",{}),q.player.kills_per_hour," kph · ",(Ll=q.player.kills)==null?void 0:Ll.toLocaleString()," kills"]}),g.jsx("div",{className:"ml-coords",ref:U})]})},Nm=bu.memo(({player:o,vitals:x,color:D,onSelect:d,isSelected:C})=>{var q,z;const{openWindow:N}=zu(),O=(o.vt_state||"idle").toLowerCase(),j=O==="combat"||O==="hunt",b=(o.total_rares??0)>0?Math.round((o.total_kills??0)/(o.total_rares??1)).toLocaleString():null,M=o.character_name;return g.jsxs("li",{className:`ml-player-row ${C?"ml-player-selected":""}`,style:{borderLeftColor:D},children:[g.jsxs("div",{className:"ml-pr-header",onClick:d,children:[g.jsx("span",{className:"ml-pr-name",children:M}),g.jsx("span",{className:"ml-pr-coords",children:hf(o.ns,o.ew)})]}),g.jsxs("div",{className:"ml-pr-vitals",children:[g.jsx("div",{className:"ml-vital-bar hp",children:g.jsx("div",{className:"ml-vital-fill",style:{width:`${(x==null?void 0:x.health_percentage)??0}%`}})}),g.jsx("div",{className:"ml-vital-bar sta",children:g.jsx("div",{className:"ml-vital-fill",style:{width:`${(x==null?void 0:x.stamina_percentage)??0}%`}})}),g.jsx("div",{className:"ml-vital-bar mana",children:g.jsx("div",{className:"ml-vital-fill",style:{width:`${(x==null?void 0:x.mana_percentage)??0}%`}})})]}),g.jsxs("div",{className:"ml-pr-grid",children:[g.jsxs("span",{className:"ml-gs",title:"Session kills",children:["⚔️ ",((q=o.kills)==null?void 0:q.toLocaleString())??0]}),g.jsxs("span",{className:"ml-gs",title:"Total kills",children:["🏆 ",(o.total_kills??0).toLocaleString()]}),g.jsxs("span",{className:"ml-gs",title:"Kills per hour",children:[o.kills_per_hour??"0"," ",g.jsx("span",{className:"ml-suffix",children:"KPH"})]}),g.jsxs("span",{className:"ml-gs",title:"Rares (session / total)",children:["💎 ",o.session_rares??0," / ",o.total_rares??0]}),g.jsx("span",{className:"ml-gs",title:"Kills per rare",children:b?g.jsxs(g.Fragment,{children:["📊 ",b," ",g.jsx("span",{className:"ml-suffix",children:"KPR"})]}):""}),g.jsx("span",{className:`ml-meta-pill ${j?"active":O!=="idle"&&O!=="default"&&O!==""?"other":""}`,children:o.vt_state||"idle"}),g.jsxs("span",{className:"ml-gs",title:"Online time",children:["🕐 ",((z=o.onlinetime)==null?void 0:z.replace(/^00\./,""))??"--"]}),g.jsxs("span",{className:"ml-gs",title:"Deaths",children:["☠️ ",o.deaths??"0"]}),g.jsxs("span",{className:"ml-gs",title:"Prismatic tapers",children:[g.jsx("img",{src:"/prismatic-taper-icon.png",className:"ml-taper-icon",alt:""}),o.prismatic_taper_count??"0"]})]}),g.jsxs("div",{className:"ml-pr-buttons",children:[g.jsx("button",{className:"ml-btn accent",onClick:()=>N(`chat-${M}`,`Chat: ${M}`,M),children:"Chat"}),g.jsx("button",{className:"ml-btn accent",onClick:()=>N(`stats-${M}`,`Stats: ${M}`,M),children:"Stats"}),g.jsx("button",{className:"ml-btn accent",onClick:()=>N(`inv-${M}`,`Inventory: ${M}`,M),children:"Inv"}),g.jsx("button",{className:"ml-btn",onClick:()=>N(`char-${M}`,`Character: ${M}`,M),children:"Char"}),g.jsx("button",{className:"ml-btn",onClick:()=>N(`combat-${M}`,`Combat: ${M}`,M),children:"Combat"}),g.jsx("button",{className:"ml-btn",onClick:()=>N(`radar-${M}`,`Radar: ${M}`,M),children:"Radar"})]})]})});Nm.displayName="PlayerRow";const br=({players:o,vitals:x,getColor:D,onSelect:d,selectedPlayer:C})=>{const N=T.useRef(null),[O,j]=T.useState(!1),b=T.useCallback(()=>{N.current&&j(N.current.scrollTop>200)},[]);return g.jsxs("div",{style:{position:"relative",flex:1,minHeight:0},children:[g.jsx("ul",{className:"ml-player-list",ref:N,onScroll:b,children:o.map(M=>g.jsx(Nm,{player:M,vitals:x.get(M.character_name)??null,color:D(M.character_name),onSelect:()=>d(M.character_name),isSelected:C===M.character_name},M.character_name))}),O&&g.jsx("button",{onClick:()=>{var M;(M=N.current)==null||M.scrollTo({top:0,behavior:"smooth"})},style:{position:"absolute",bottom:8,right:8,width:28,height:28,borderRadius:"50%",background:"rgba(68,136,255,0.2)",border:"1px solid rgba(68,136,255,0.4)",color:"#6af",cursor:"pointer",fontSize:"0.8rem",display:"flex",alignItems:"center",justifyContent:"center"},children:"▲"})]})},zr=[{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"}],pr=({value:o,onChange:x})=>g.jsx("div",{className:"ml-sort-buttons",children:zr.map(D=>g.jsx("button",{className:`ml-sort-btn ${o===D.key?"active":""}`,onClick:()=>x(D.key),children:D.label},D.key))}),Tr=()=>{const{openWindow:o}=zu();return g.jsxs("div",{className:"ml-tool-links",children:[g.jsx("span",{className:"ml-tool-link",style:{cursor:"pointer"},onClick:()=>o("playerdash","Player Dashboard"),children:"👥 Dashboard"}),g.jsx("span",{className:"ml-tool-link",style:{cursor:"pointer"},onClick:()=>o("queststatus","Quest Status"),children:"📜 Quests"}),g.jsx("span",{className:"ml-tool-link",style:{cursor:"pointer"},onClick:()=>o("issues","Issues Board"),children:"📋 Issues"}),g.jsx("span",{className:"ml-tool-link",style:{cursor:"pointer"},onClick:()=>o("vitalsharing","Vital Sharing"),children:"🤝 Vitals"}),g.jsx("span",{className:"ml-tool-link",style:{cursor:"pointer"},onClick:()=>o("combatpicker","Combat Stats"),children:"⚔️ Combat"})]})},Er=({players:o,vitals:x,serverHealth:D,totalRares:d,totalKills:C,getColor:N,onSelectPlayer:O,showHeatmap:j,showPortals:b,onToggleHeatmap:M,onTogglePortals:q,version:z,selectedPlayer:U})=>{var w,F;const[H,k]=T.useState("name"),[tl,dl]=T.useState(""),gl=T.useMemo(()=>o.reduce((X,W)=>X+(parseInt(W.kills_per_hour)||0),0),[o]),Z=((w=D==null?void 0:D.status)==null?void 0:w.toLowerCase())==="online"||((F=D==null?void 0:D.status)==null?void 0:F.toLowerCase())==="up",L=T.useDeferredValue(o),Ol=T.useDeferredValue(x),Ll=T.useMemo(()=>{let X=[...L];switch(tl&&(X=X.filter(W=>W.character_name.toLowerCase().startsWith(tl.toLowerCase()))),H){case"kph":X.sort((W,el)=>(parseInt(el.kills_per_hour)||0)-(parseInt(W.kills_per_hour)||0));break;case"skills":X.sort((W,el)=>(el.kills||0)-(W.kills||0));break;case"srares":X.sort((W,el)=>(el.session_rares??0)-(W.session_rares??0));break;case"tkills":X.sort((W,el)=>(el.total_kills??0)-(W.total_kills??0));break;case"kpr":X.sort((W,el)=>{const Rl=(W.total_kills??0)/Math.max(1,W.total_rares??1),El=(el.total_kills??0)/Math.max(1,el.total_rares??1);return Rl-El});break;default:X.sort((W,el)=>W.character_name.localeCompare(el.character_name))}return X},[L,H,tl]);return g.jsxs("div",{className:"ml-sidebar",children:[z&&g.jsxs("div",{className:"ml-version",children:["v",z]}),g.jsx("div",{className:"ml-sidebar-header",children:g.jsxs("span",{className:"ml-sidebar-title",children:["Active Mosswart Enjoyers (",o.length,")"]})}),g.jsxs("div",{className:"ml-server-status",children:[g.jsx("span",{className:`ml-status-dot ${Z?"online":"offline"}`}),g.jsxs("span",{className:"ml-status-text",children:["Coldeve ",Z?"Online":"Offline"]}),(D==null?void 0:D.player_count)!=null&&g.jsxs("span",{className:"ml-status-detail",children:["👥 ",D.player_count]}),(D==null?void 0:D.latency_ms)!=null&&g.jsxs("span",{className:"ml-status-detail",children:[Math.round(D.latency_ms),"ms"]}),(D==null?void 0:D.uptime_seconds)!=null&&g.jsxs("span",{className:"ml-status-detail",children:["Up: ",Math.floor(D.uptime_seconds/3600),"h"]})]}),g.jsxs("div",{className:"ml-counters",children:[g.jsxs("div",{className:"ml-counter rares",children:[g.jsx("span",{className:"ml-counter-val",children:d}),g.jsx("span",{className:"ml-counter-lbl",children:"Rares"})]}),g.jsxs("div",{className:`ml-counter kph ${gl>5e3?"ultra":""}`,children:[g.jsx("span",{className:"ml-counter-val",children:gl.toLocaleString()}),g.jsx("span",{className:"ml-counter-lbl",children:"Server KPH"})]}),g.jsxs("div",{className:"ml-counter kills",children:[g.jsx("span",{className:"ml-counter-val",children:C.toLocaleString()}),g.jsx("span",{className:"ml-counter-lbl",children:"Kills"})]})]}),g.jsxs("div",{className:"ml-tool-links",children:[g.jsx("a",{href:"/inventory.html",target:"_blank",className:"ml-tool-link",children:"🔍 Inv Search"}),g.jsx("a",{href:"/suitbuilder.html",target:"_blank",className:"ml-tool-link",children:"🛡️ Suitbuilder"}),g.jsx("a",{href:"/debug.html",target:"_blank",className:"ml-tool-link",children:"🐛 Debug"})]}),g.jsx(Tr,{}),g.jsxs("div",{className:"ml-toggles",children:[g.jsxs("label",{className:"ml-toggle-label",children:[g.jsx("input",{type:"checkbox",checked:j,onChange:X=>M(X.target.checked)}),g.jsx("span",{children:"Spawn Heatmap"})]}),g.jsxs("label",{className:"ml-toggle-label",children:[g.jsx("input",{type:"checkbox",checked:b,onChange:X=>q(X.target.checked)}),g.jsx("span",{children:"Portals"})]})]}),g.jsx("div",{style:{borderTop:"1px solid #333",marginTop:4,paddingTop:4}}),g.jsx(pr,{value:H,onChange:k}),g.jsx("input",{className:"ml-filter",type:"text",placeholder:"Filter players...",value:tl,onChange:X=>dl(X.target.value)}),g.jsx(br,{players:Ll,vitals:Ol,getColor:N,onSelect:O,selectedPlayer:U})]})},Ar="modulepreload",Mr=function(o){return"/"+o},Am={},Dt=function(x,D,d){let C=Promise.resolve();if(D&&D.length>0){let O=function(M){return Promise.all(M.map(q=>Promise.resolve(q).then(z=>({status:"fulfilled",value:z}),z=>({status:"rejected",reason:z}))))};document.getElementsByTagName("link");const j=document.querySelector("meta[property=csp-nonce]"),b=(j==null?void 0:j.nonce)||(j==null?void 0:j.getAttribute("nonce"));C=O(D.map(M=>{if(M=Mr(M),M in Am)return;Am[M]=!0;const q=M.endsWith(".css"),z=q?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${M}"]${z}`))return;const U=document.createElement("link");if(U.rel=q?"stylesheet":Ar,q||(U.as="script"),U.crossOrigin="",U.href=M,b&&U.setAttribute("nonce",b),document.head.appendChild(U),q)return new Promise((H,k)=>{U.addEventListener("load",H),U.addEventListener("error",()=>k(new Error(`Unable to preload CSS for ${M}`)))})}))}function N(O){const j=new Event("vite:preloadError",{cancelable:!0});if(j.payload=O,window.dispatchEvent(j),!j.defaultPrevented)throw O}return C.then(O=>{for(const j of O||[])j.status==="rejected"&&N(j.reason);return x().catch(N)})},_r=({id:o,title:x,zIndex:D,width:d=700,height:C=340,children:N})=>{const{closeWindow:O,bringToFront:j}=zu(),b=T.useRef(null),M=T.useRef({dragging:!1,sx:0,sy:0,ox:0,oy:0}),q=T.useRef({resizing:!1,sx:0,sy:0,sw:0,sh:0}),z=T.useRef({x:420,y:10+Math.random()*40}),[U,H]=T.useState({w:d,h:C}),k=T.useCallback(dl=>{var Z;dl.preventDefault(),j(o);const gl=(Z=b.current)==null?void 0:Z.getBoundingClientRect();gl&&(M.current={dragging:!0,sx:dl.clientX,sy:dl.clientY,ox:gl.left,oy:gl.top})},[o,j]),tl=T.useCallback(dl=>{dl.preventDefault(),dl.stopPropagation(),q.current={resizing:!0,sx:dl.clientX,sy:dl.clientY,sw:U.w,sh:U.h}},[U.w,U.h]);return T.useEffect(()=>{const dl=Z=>{const L=M.current;L.dragging&&b.current&&(z.current.x=L.ox+(Z.clientX-L.sx),z.current.y=L.oy+(Z.clientY-L.sy),b.current.style.left=`${z.current.x}px`,b.current.style.top=`${z.current.y}px`);const Ol=q.current;if(Ol.resizing){const Ll=Math.max(300,Ol.sw+(Z.clientX-Ol.sx)),w=Math.max(200,Ol.sh+(Z.clientY-Ol.sy));H({w:Ll,h:w})}},gl=()=>{M.current.dragging=!1,q.current.resizing=!1};return window.addEventListener("mousemove",dl),window.addEventListener("mouseup",gl),()=>{window.removeEventListener("mousemove",dl),window.removeEventListener("mouseup",gl)}},[]),g.jsxs("div",{ref:b,className:"ml-window",style:{zIndex:D,width:U.w,height:U.h,left:z.current.x,top:z.current.y},onMouseDown:()=>j(o),children:[g.jsxs("div",{className:"ml-window-header",onMouseDown:k,children:[g.jsx("span",{className:"ml-window-title",children:x}),g.jsx("button",{className:"ml-window-close",onClick:()=>O(o),children:"×"})]}),g.jsx("div",{className:"ml-window-content",children:N}),g.jsx("div",{className:"ml-window-resize",onMouseDown:tl})]})},xr={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"},Um=50,jm=o=>`mo-chat-history-${o}`;function Dr(o){try{const x=localStorage.getItem(jm(o));return x?JSON.parse(x):[]}catch{return[]}}function Or(o,x){try{localStorage.setItem(jm(o),JSON.stringify(x.slice(-Um)))}catch{}}const Nr=({id:o,charName:x,zIndex:D,messages:d,socket:C})=>{const N=T.useRef(null),[O,j]=T.useState(""),[b,M]=T.useState(!1),q=T.useRef(Dr(x)),z=T.useRef(-1),U=T.useRef(""),H=T.useRef(!1);T.useEffect(()=>{const Z=N.current;Z&&(H.current?M(!0):(Z.scrollTop=Z.scrollHeight,M(!1)))},[d.length]);const k=T.useCallback(()=>{const Z=N.current;if(!Z)return;const L=Z.scrollHeight-Z.scrollTop-Z.clientHeight<30;H.current=!L,L&&M(!1)},[]),tl=T.useCallback(()=>{const Z=N.current;Z&&(Z.scrollTop=Z.scrollHeight,H.current=!1,M(!1))},[]),dl=T.useCallback(Z=>{Z.preventDefault();const L=O.trim();!L||!C||C.readyState!==WebSocket.OPEN||(C.send(JSON.stringify({player_name:x,command:L})),q.current.push(L),q.current.length>Um&&q.current.shift(),Or(x,q.current),z.current=-1,U.current="",j(""),H.current=!1)},[O,C,x]),gl=T.useCallback(Z=>{const L=q.current;if(L.length!==0){if(Z.key==="ArrowUp")Z.preventDefault(),z.current===-1?(U.current=O,z.current=L.length-1):z.current>0&&z.current--,j(L[z.current]);else if(Z.key==="ArrowDown"){if(Z.preventDefault(),z.current===-1)return;z.currentg.jsx("div",{className:"ml-chat-line",style:{color:xr[Z.color??2]??"#ddd"},children:Z.text},L))}),b&&g.jsx("div",{onClick:tl,style:{padding:"3px 0",textAlign:"center",fontSize:"0.65rem",color:"#6af",background:"#1a2a3a",cursor:"pointer",borderTop:"1px solid #334"},children:"▼ New messages below"}),g.jsx("form",{className:"ml-chat-form",onSubmit:dl,children:g.jsx("input",{className:"ml-chat-input",value:O,onChange:Z=>j(Z.target.value),onKeyDown:gl,placeholder:"Enter chat..."})})]})},Ur=T.lazy(()=>Dt(()=>import("./StatsWindow-CX6kEX-g.js"),__vite__mapDeps([0,1])).then(o=>({default:o.StatsWindow}))),jr=T.lazy(()=>Dt(()=>import("./CharacterWindow-CyX_tOIF.js"),__vite__mapDeps([2,1])).then(o=>({default:o.CharacterWindow}))),Cr=T.lazy(()=>Dt(()=>import("./InventoryWindow-YNou026w.js"),__vite__mapDeps([3,1])).then(o=>({default:o.InventoryWindow}))),Rr=T.lazy(()=>Dt(()=>import("./RadarWindow-zG0PV0Ia.js"),__vite__mapDeps([4,1])).then(o=>({default:o.RadarWindow}))),Hr=T.lazy(()=>Dt(()=>import("./CombatStatsWindow-BduiqqZk.js"),__vite__mapDeps([5,1])).then(o=>({default:o.CombatStatsWindow}))),qr=T.lazy(()=>Dt(()=>import("./CombatPickerWindow-NVeKtlGR.js"),__vite__mapDeps([6,1])).then(o=>({default:o.CombatPickerWindow}))),Br=T.lazy(()=>Dt(()=>import("./IssuesWindow-BtrdDjRr.js"),__vite__mapDeps([7,1])).then(o=>({default:o.IssuesWindow}))),Yr=T.lazy(()=>Dt(()=>import("./VitalSharingWindow-CkWl7Mtm.js"),__vite__mapDeps([8,1])).then(o=>({default:o.VitalSharingWindow}))),Xr=T.lazy(()=>Dt(()=>import("./QuestStatusWindow-B4lCEc6-.js"),__vite__mapDeps([9,1])).then(o=>({default:o.QuestStatusWindow}))),Gr=T.lazy(()=>Dt(()=>import("./PlayerDashboardWindow-D5m2YCrZ.js"),__vite__mapDeps([10,1])).then(o=>({default:o.PlayerDashboardWindow}))),Cm=bu.memo(({characters:o,chatMessages:x,nearbyObjects:D,inventoryVersion:d,equipmentCantrips:C,characterStats:N,socket:O})=>{const{windows:j}=zu();return g.jsx(T.Suspense,{fallback:null,children:j.map(b=>{var z;const M=b.charName??"";switch(b.id.split("-")[0]){case"chat":return g.jsx(Nr,{id:b.id,charName:M,zIndex:b.zIndex,messages:x.get(M)??[],socket:O},b.id);case"stats":return g.jsx(Ur,{id:b.id,charName:M,zIndex:b.zIndex},b.id);case"char":return g.jsx(jr,{id:b.id,charName:M,zIndex:b.zIndex,vitals:((z=o.get(M))==null?void 0:z.vitals)??void 0,liveStats:N.get(M)},b.id);case"inv":return g.jsx(Cr,{id:b.id,charName:M,zIndex:b.zIndex,inventoryVersion:d,equipmentCantrips:C.get(M)},b.id);case"radar":return g.jsx(Rr,{id:b.id,charName:M,zIndex:b.zIndex,socket:O,radarData:D.get(M)??null},b.id);case"combat":return g.jsx(Hr,{id:b.id,charName:M,zIndex:b.zIndex},b.id);case"combatpicker":return g.jsx(qr,{id:b.id,zIndex:b.zIndex,characters:o},b.id);case"issues":return g.jsx(Br,{id:b.id,zIndex:b.zIndex},b.id);case"vitalsharing":return g.jsx(Yr,{id:b.id,zIndex:b.zIndex},b.id);case"queststatus":return g.jsx(Xr,{id:b.id,zIndex:b.zIndex},b.id);case"playerdash":return g.jsx(Gr,{id:b.id,zIndex:b.zIndex,characters:o},b.id);default:return null}})})});Cm.displayName="WindowRenderer";let Qr=0;const Zr=({recentRares:o})=>{const[x,D]=T.useState([]),[d,C]=T.useState(0),[N,O]=T.useState([]);T.useEffect(()=>{if(o.length>d&&d>0){const b=o.slice(0,o.length-d);for(const M of b){const q=++Qr;D(z=>[...z,{key:q,charName:M.character_name,rareName:M.name,exiting:!1}]),j();try{const z=new AudioContext,U=z.createOscillator(),H=z.createGain();U.connect(H),H.connect(z.destination),U.frequency.value=880,U.type="sine",H.gain.value=.3,U.start(),H.gain.exponentialRampToValueAtTime(.001,z.currentTime+.5),U.stop(z.currentTime+.5)}catch{}setTimeout(()=>{D(z=>z.map(U=>U.key===q?{...U,exiting:!0}:U)),setTimeout(()=>{D(z=>z.filter(U=>U.key!==q))},500)},6e3)}}C(o.length)},[o.length]);const j=T.useCallback(()=>{const b=Date.now(),M=["#FFD700","#FF4444","#FF8800","#AA44FF","#4488FF"],q=Array.from({length:30},(z,U)=>{const H=Math.PI*2*U/30+(Math.random()-.5)*.5,k=100+Math.random()*200;return{dx:Math.cos(H)*k,dy:Math.sin(H)*k-50,color:M[Math.floor(Math.random()*M.length)]}});O(z=>[...z,{id:b,particles:q}]),setTimeout(()=>O(z=>z.filter(U=>U.id!==b)),2200)},[]);return g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"ml-rare-notifications",children:x.map(b=>g.jsxs("div",{className:`ml-rare-notif ${b.exiting?"exiting":""}`,children:[g.jsx("div",{className:"ml-rare-notif-title",children:"🎆 LEGENDARY RARE! 🎆"}),g.jsx("div",{className:"ml-rare-notif-name",children:b.rareName}),g.jsx("div",{className:"ml-rare-notif-by",children:"found by"}),g.jsx("div",{className:"ml-rare-notif-char",children:b.charName})]},b.key))}),g.jsx("div",{className:"ml-fireworks",children:N.map(b=>g.jsx(bu.Fragment,{children:b.particles.map((M,q)=>g.jsx("div",{className:"ml-firework-particle",style:{left:"50%",top:"30%",backgroundColor:M.color,"--dx":`${M.dx}px`,"--dy":`${M.dy+200}px`}},q))},b.id))})]})},Mm=["#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 Vr(o){let x=0;for(let D=0;D{let C=o.current.get(d);return C||(C=x.current{const x=Lr(),[D,d]=T.useState(!1),[C,N]=T.useState(!1),[O,j]=T.useState(null),b=T.useMemo(()=>Array.from(o.characters.values()).filter(H=>H.telemetry).map(H=>H.telemetry),[o.characters]),M=T.useMemo(()=>new Map(Array.from(o.characters.values()).filter(H=>H.vitals).map(H=>[H.name,H.vitals])),[o.characters]),[q,z]=T.useState("");T.useEffect(()=>{fetch("/api/api-version",{credentials:"include"}).then(H=>H.json()).then(H=>z(H.version??"")).catch(()=>{})},[]);const U=T.useCallback(H=>{j(k=>k===H?null:H)},[]);return g.jsx(mr,{children:g.jsxs("div",{className:"ml-layout",children:[g.jsx(Er,{players:b,vitals:M,serverHealth:o.serverHealth,totalRares:o.totalRares,totalKills:o.totalKills,getColor:x,onSelectPlayer:U,showHeatmap:D,showPortals:C,onToggleHeatmap:d,onTogglePortals:N,version:q,selectedPlayer:O}),g.jsx(Sr,{players:b,getColor:x,onSelectPlayer:U,showHeatmap:D,showPortals:C,selectedPlayer:O}),g.jsx(Cm,{characters:o.characters,chatMessages:o.chatMessages,nearbyObjects:o.nearbyObjects,inventoryVersion:o.inventoryVersion,equipmentCantrips:o.equipmentCantrips,characterStats:o.characterStats,socket:o.socketRef.current}),g.jsx(Zr,{recentRares:o.recentRares})]})})};function Jr(o){const x=T.useRef(null),D=T.useRef(0),d=T.useRef(o);d.current=o;const C=T.useCallback(()=>{var O;if(((O=x.current)==null?void 0:O.readyState)===WebSocket.OPEN)return;const N=new WebSocket(yr());x.current=N,N.addEventListener("message",j=>{try{const b=JSON.parse(j.data);d.current(b)}catch{}}),N.addEventListener("close",()=>{x.current=null,D.current=window.setTimeout(C,2e3)}),N.addEventListener("error",()=>{N.close()})},[]);return T.useEffect(()=>(C(),()=>{var N;clearTimeout(D.current),(N=x.current)==null||N.close(),x.current=null}),[C]),x}const wr=()=>za("/live"),Wr=()=>za("/combat-stats"),kr=()=>za("/server-health"),Fr=()=>za("/total-rares"),$r=()=>za("/total-kills");function Ir(){const[o,x]=T.useState(new Map),[D,d]=T.useState(null),[C,N]=T.useState(0),[O,j]=T.useState(0),[b,M]=T.useState([]),q=T.useRef(new Map),[z,U]=T.useState(0),[H,k]=T.useState(0),tl=T.useRef(new Map),[dl,gl]=T.useState(0),Z=T.useRef(new Map),[L,Ol]=T.useState(0),[Ll,w]=T.useState(new Map),F=T.useRef(o);F.current=o;const X=T.useCallback((V,Al)=>{x(h=>{const _=new Map(h),B=_.get(V)??{name:V,telemetry:null,vitals:null,combat:null,lastUpdate:0};return _.set(V,Al(B)),_})},[]),W=T.useCallback(V=>{var Al;if(V.type){if(V.type==="telemetry"){const h=V;X(h.character_name,_=>({..._,telemetry:h,lastUpdate:Date.now()}))}else if(V.type==="vitals"){const h=V;X(h.character_name,_=>({..._,vitals:h,lastUpdate:Date.now()}))}else if(V.type==="combat_stats"){const h=V;X(h.character_name,_=>({..._,combat:h,lastUpdate:Date.now()}))}else if(V.type==="rare"){const h=V;M(_=>[h,..._].slice(0,50))}else if(V.type==="inventory_delta")k(h=>h+1);else if(V.type==="character_stats"){const h=V;Z.current.set(h.character_name,V),Ol(_=>_+1)}else if(V.type==="equipment_cantrip_state"){const h=V;tl.current.set(h.character_name,h),gl(_=>_+1)}else if(V.type==="dungeon_map"){const h=V;h.landblock&&(window.__dungeonMapCache||(window.__dungeonMapCache={}),window.__dungeonMapCache[h.landblock]=h)}else if(V.type==="nearby_objects"){const h=V;if(w(_=>{const B=new Map(_);return B.set(h.character_name,h),B}),h.is_dungeon&&h.landblock&&!((Al=window.__dungeonMapCache)!=null&&Al[h.landblock])){const _=el.current;(_==null?void 0:_.readyState)===WebSocket.OPEN&&_.send(JSON.stringify({type:"request_dungeon_map",landblock:h.landblock}))}}else if(V.type==="chat"){const h=V,_=q.current.get(h.character_name)??[];_.push({text:h.text,color:h.color,timestamp:h.timestamp}),_.length>1e3&&_.splice(0,_.length-1e3),q.current.set(h.character_name,_),U(B=>B+1)}}},[X]),el=Jr(W);T.useEffect(()=>{const V=async()=>{try{const h=await wr();x(_=>{var ml;const B=new Map(_);for(const ul of h.players??[]){const zl=B.get(ul.character_name);B.set(ul.character_name,{name:ul.character_name,telemetry:ul,vitals:(zl==null?void 0:zl.vitals)??null,combat:(zl==null?void 0:zl.combat)??null,lastUpdate:Date.now()})}for(const ul of B.keys())(ml=h.players)!=null&&ml.some(zl=>zl.character_name===ul)||B.delete(ul);return B})}catch{}};V();const Al=setInterval(V,5e3);return()=>clearInterval(Al)},[]),T.useEffect(()=>{const V=async()=>{try{const h=await Wr();for(const _ of h.stats??[])X(_.character_name,B=>({...B,combat:{..._,type:"combat_stats"}}))}catch{}};V();const Al=setInterval(V,3e4);return()=>clearInterval(Al)},[X]),T.useEffect(()=>{const V=async()=>{try{d(await kr())}catch{}};V();const Al=setInterval(V,3e4);return()=>clearInterval(Al)},[]),T.useEffect(()=>{const V=async()=>{try{const[h,_]=await Promise.all([Fr(),$r()]);N(h.all_time??0),j(_.total??0)}catch{}};V();const Al=setInterval(V,3e5);return()=>clearInterval(Al)},[]);const Rl=T.useMemo(()=>q.current,[z]),El=T.useMemo(()=>tl.current,[dl]),Ot=T.useMemo(()=>Z.current,[L]);return{characters:o,serverHealth:D,totalRares:C,totalKills:O,recentRares:b,chatMessages:Rl,nearbyObjects:Ll,inventoryVersion:H,equipmentCantrips:El,characterStats:Ot,socketRef:el}}function Pr(){const o=Ir();return g.jsx(Kr,{data:o})}dr.createRoot(document.getElementById("root")).render(g.jsx(T.StrictMode,{children:g.jsx(Pr,{})}));"serviceWorker"in navigator&&navigator.serviceWorker.register("/sw.js").catch(()=>{});export{_r as D,za as a,g as j,T as r,zu as u}; diff --git a/static/index.html b/static/index.html index e7e705e0..5c80a960 100644 --- a/static/index.html +++ b/static/index.html @@ -8,7 +8,7 @@ - + diff --git a/static/v2/assets/CharacterWindow-CyX_tOIF.js b/static/v2/assets/CharacterWindow-CyX_tOIF.js new file mode 100644 index 00000000..2cacb43a --- /dev/null +++ b/static/v2/assets/CharacterWindow-CyX_tOIF.js @@ -0,0 +1 @@ +import{r as f,a as J,j as e,D as K}from"./index-fhoLMRWN.js";import"./react-yfL0ty4i.js";const F={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"},B={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"},$={370:"Damage",371:"Damage Resistance",372:"Critical",373:"Critical Resistance",374:"Critical Damage",375:"Critical Damage Resistance",376:"Healing Boost",379:"Vitality"},W={287:"Celestial Hand",288:"Eldrytch Web",289:"Radiant Blood"},D={354:"Melee",355:"Ranged",362:"Summoning"},q={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"},U={181:"Chess Rank",192:"Fishing Skill",199:"Total Augmentations",322:"Aetheria Slots",390:"Enlightenment"};function Q(c){return c>=1001?"Master":c>=301?"Lord":c>=151?"Knight":c>=31?"Adept":"Initiate"}const d="#af7a30",u="#000022",ee=({id:c,charName:g,zIndex:L,vitals:s,liveStats:O})=>{var _,N;const[H,P]=f.useState(null),[j,V]=f.useState(0),[m,G]=f.useState(0);f.useEffect(()=>{J(`/character-stats/${encodeURIComponent(g)}`).then(P).catch(()=>{})},[g]);const n=O||H,a=t=>t!=null?Number(t).toLocaleString():"—",o=(n==null?void 0:n.stats_data)||n||{},C=o.attributes||{},A=o.skills||{},Y=o.vitals||{},E=o.titles||[],h=o.properties||{},T=Object.entries(A).filter(([,t])=>(t==null?void 0:t.training)==="Specialized").sort(([t],[l])=>t.localeCompare(l)),I=Object.entries(A).filter(([,t])=>(t==null?void 0:t.training)==="Trained").sort(([t],[l])=>t.localeCompare(l)),S=Object.entries(h).filter(([t,l])=>F[parseInt(t)]&&Number(l)>0).map(([t,l])=>({name:F[parseInt(t)],uses:Number(l)})),w=Object.entries(h).filter(([t,l])=>B[parseInt(t)]&&Number(l)>0).map(([t,l])=>({name:B[parseInt(t)],uses:Number(l)})),z=Object.entries(h).filter(([t,l])=>$[parseInt(t)]&&Number(l)>0).map(([t,l])=>({name:$[parseInt(t)],value:Number(l)})),x=[];n!=null&&n.birth&&x.push({name:"Birth",value:n.birth}),(n==null?void 0:n.deaths)!=null&&x.push({name:"Deaths",value:a(n.deaths)}),Object.entries(h).forEach(([t,l])=>{const i=parseInt(t);U[i]&&x.push({name:U[i],value:l})});const y=[];Object.entries(h).forEach(([t,l])=>{const i=parseInt(t);D[i]&&y.push({name:D[i],value:q[Number(l)]||`Unknown (${l})`})});const b=[];Object.entries(h).forEach(([t,l])=>{const i=parseInt(t);W[i]&&Number(l)>0&&b.push({name:W[i],rank:Q(Number(l)),value:Number(l)})});const R=t=>({padding:"5px 8px",fontSize:12,fontWeight:"bold",color:"#fff",cursor:"pointer",userSelect:"none",borderTop:`2px solid ${t?d:u}`,borderLeft:`2px solid ${t?d:u}`,borderRight:`2px solid ${t?d:u}`,background:t?"rgba(0,100,0,0.4)":"transparent"}),M={background:"#000",border:`2px solid ${d}`,maxHeight:400,overflowY:"auto",overflowX:"hidden"},r={background:"#222",fontWeight:"bold",fontSize:12,padding:"2px 6px"},k={padding:"2px 6px",background:"rgba(0,100,0,0.4)",whiteSpace:"nowrap"},p={padding:"2px 6px",background:"rgba(0,0,100,0.4)",textAlign:"right",whiteSpace:"nowrap"},X={padding:"2px 6px",color:"#ccc"};return e.jsx(K,{id:c,title:`Character: ${g}`,zIndex:L,width:740,height:600,children:e.jsxs("div",{style:{background:u,color:"#fff",font:'14px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif',overflowY:"auto",padding:"10px 15px 15px",flex:1},children:[e.jsxs("div",{style:{marginBottom:10},children:[e.jsxs("h1",{style:{margin:"0 0 2px",fontSize:28,fontWeight:"bold"},children:[g,e.jsx("span",{style:{fontSize:"200%",color:"#fff27f",float:"right"},children:(n==null?void 0:n.level)||""})]}),e.jsx("div",{style:{fontSize:"85%",color:"gold"},children:[n==null?void 0:n.gender,n==null?void 0:n.race].filter(Boolean).join(" ")||"Awaiting character data..."})]}),e.jsxs("div",{style:{fontSize:"85%",margin:"6px 0 10px",display:"grid",gridTemplateColumns:"1fr 1fr",gap:"0 20px"},children:[e.jsxs("div",{children:["Total XP: ",a(n==null?void 0:n.total_xp)]}),e.jsxs("div",{style:{textAlign:"right"},children:["Unassigned XP: ",a(n==null?void 0:n.unassigned_xp)]}),e.jsxs("div",{children:["Luminance: ",(n==null?void 0:n.luminance_earned)!=null?`${a(n.luminance_earned)} / ${a(n.luminance_total)}`:"—"]}),e.jsxs("div",{style:{textAlign:"right"},children:["Deaths: ",a(n==null?void 0:n.deaths)]})]}),e.jsxs("div",{style:{display:"flex",gap:13,flexWrap:"wrap"},children:[e.jsxs("div",{style:{width:320},children:[e.jsx("div",{style:{height:30,display:"flex"},children:["Attributes","Skills","Titles"].map((t,l)=>e.jsx("div",{style:R(j===l),onClick:()=>V(l),children:t},t))}),e.jsxs("div",{style:M,children:[j===0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{padding:"6px 8px",display:"flex",flexDirection:"column",gap:8,borderBottom:`2px solid ${d}`},children:[{label:"Health",pct:(s==null?void 0:s.health_percentage)??0,cur:s==null?void 0:s.health_current,max:s==null?void 0:s.health_max,bg:"#cc3333"},{label:"Stamina",pct:(s==null?void 0:s.stamina_percentage)??0,cur:s==null?void 0:s.stamina_current,max:s==null?void 0:s.stamina_max,bg:"#ccaa33"},{label:"Mana",pct:(s==null?void 0:s.mana_percentage)??0,cur:s==null?void 0:s.mana_current,max:s==null?void 0:s.mana_max,bg:"#3366cc"}].map(t=>e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[e.jsx("span",{style:{width:55,fontSize:12,color:"#ccc"},children:t.label}),e.jsx("div",{style:{flex:1,height:14,overflow:"hidden",position:"relative",border:`1px solid ${d}`},children:e.jsx("div",{style:{height:"100%",width:`${t.pct}%`,background:t.bg,transition:"width 0.5s ease"}})}),e.jsxs("span",{style:{width:80,textAlign:"right",fontSize:12,color:"#ccc"},children:[t.cur??"—"," / ",t.max??"—"]})]},t.label))}),e.jsxs("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{style:r,children:"Attribute"}),e.jsx("td",{style:r,children:"Creation"}),e.jsx("td",{style:r,children:"Base"})]})}),e.jsx("tbody",{children:["strength","endurance","coordination","quickness","focus","self"].map(t=>{var l,i;return e.jsxs("tr",{children:[e.jsx("td",{style:k,children:t.charAt(0).toUpperCase()+t.slice(1)}),e.jsx("td",{style:X,children:((l=C[t])==null?void 0:l.creation)??"—"}),e.jsx("td",{style:p,children:((i=C[t])==null?void 0:i.base)??"—"})]},t)})})]}),e.jsxs("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{style:r,children:"Vital"}),e.jsx("td",{style:r,children:"Base"})]})}),e.jsx("tbody",{children:["health","stamina","mana"].map(t=>{var l;return e.jsxs("tr",{children:[e.jsx("td",{style:k,children:t.charAt(0).toUpperCase()+t.slice(1)}),e.jsx("td",{style:p,children:((l=Y[t])==null?void 0:l.base)??"—"})]},t)})})]}),e.jsx("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:e.jsx("tbody",{children:e.jsxs("tr",{children:[e.jsx("td",{style:k,children:"Skill Credits"}),e.jsx("td",{style:p,children:a(o.skill_credits)})]})})})]}),j===1&&e.jsxs("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{style:r,children:"Skill"}),e.jsx("td",{style:r,children:"Level"})]})}),e.jsxs("tbody",{children:[T.map(([t,l])=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px",background:"linear-gradient(to right, #392067, #392067, black)"},children:t.replace(/_/g," ").replace(/\b\w/g,i=>i.toUpperCase())}),e.jsx("td",{style:{...p,background:"linear-gradient(to right, #392067, #392067, black)"},children:l.base})]},t)),I.map(([t,l])=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px",background:"linear-gradient(to right, #0f3c3e, #0f3c3e, black)"},children:t.replace(/_/g," ").replace(/\b\w/g,i=>i.toUpperCase())}),e.jsx("td",{style:{...p,background:"linear-gradient(to right, #0f3c3e, #0f3c3e, black)"},children:l.base})]},t)),T.length===0&&I.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:2,style:{padding:10,color:"#666",fontStyle:"italic",textAlign:"center"},children:"No skill data"})})]})]}),j===2&&e.jsx("div",{style:{padding:"6px 10px",fontSize:13},children:E.length>0?E.map((t,l)=>e.jsx("div",{style:{padding:"1px 0"},children:t},l)):e.jsx("div",{style:{color:"#666",fontStyle:"italic",textAlign:"center",padding:10},children:"No titles"})})]})]}),e.jsxs("div",{style:{width:320},children:[e.jsx("div",{style:{height:30,display:"flex"},children:["Augmentations","Ratings","Other"].map((t,l)=>e.jsx("div",{style:R(m===l),onClick:()=>G(l),children:t},t))}),e.jsxs("div",{style:M,children:[m===0&&(S.length||w.length?e.jsxs(e.Fragment,{children:[S.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{background:"#222",padding:"4px 8px",fontWeight:"bold",fontSize:13,borderBottom:`1px solid ${d}`},children:"Augmentations"}),e.jsxs("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{style:r,children:"Name"}),e.jsx("td",{style:r,children:"Uses"})]})}),e.jsx("tbody",{children:S.map(t=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px"},children:t.name}),e.jsx("td",{style:{padding:"2px 6px",textAlign:"right"},children:t.uses})]},t.name))})]})]}),w.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{background:"#222",padding:"4px 8px",fontWeight:"bold",fontSize:13,borderBottom:`1px solid ${d}`},children:"Auras"}),e.jsxs("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{style:r,children:"Name"}),e.jsx("td",{style:r,children:"Uses"})]})}),e.jsx("tbody",{children:w.map(t=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px"},children:t.name}),e.jsx("td",{style:{padding:"2px 6px",textAlign:"right"},children:t.uses})]},t.name))})]})]})]}):e.jsx("div",{style:{color:"#666",fontStyle:"italic",textAlign:"center",padding:10},children:"No augmentation data"})),m===1&&(z.length>0?e.jsxs("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{style:r,children:"Rating"}),e.jsx("td",{style:r,children:"Value"})]})}),e.jsx("tbody",{children:z.map(t=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px"},children:t.name}),e.jsx("td",{style:{padding:"2px 6px",textAlign:"right"},children:t.value})]},t.name))})]}):e.jsx("div",{style:{color:"#666",fontStyle:"italic",textAlign:"center",padding:10},children:"No rating data"})),m===2&&e.jsxs("div",{children:[x.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{background:"#222",padding:"4px 8px",fontWeight:"bold",fontSize:13,borderBottom:`1px solid ${d}`},children:"General"}),e.jsx("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:e.jsx("tbody",{children:x.map(t=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px"},children:t.name}),e.jsx("td",{style:{padding:"2px 6px",textAlign:"right"},children:t.value})]},t.name))})})]}),y.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{background:"#222",padding:"4px 8px",fontWeight:"bold",fontSize:13,borderBottom:`1px solid ${d}`},children:"Masteries"}),e.jsx("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:e.jsx("tbody",{children:y.map(t=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px"},children:t.name}),e.jsx("td",{style:{padding:"2px 6px",textAlign:"right"},children:t.value})]},t.name))})})]}),b.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{background:"#222",padding:"4px 8px",fontWeight:"bold",fontSize:13,borderBottom:`1px solid ${d}`},children:"Society"}),e.jsx("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:e.jsx("tbody",{children:b.map(t=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px"},children:t.name}),e.jsxs("td",{style:{padding:"2px 6px",textAlign:"right"},children:[t.rank," (",t.value,")"]})]},t.name))})})]}),x.length===0&&y.length===0&&b.length===0&&e.jsx("div",{style:{color:"#666",fontStyle:"italic",textAlign:"center",padding:10},children:"No additional data"})]})]})]})]}),(n==null?void 0:n.allegiance)&&e.jsxs("div",{style:{marginTop:5,border:`2px solid ${d}`,background:"#000"},children:[e.jsx("div",{style:{background:"#222",padding:"4px 8px",fontWeight:"bold",fontSize:13,borderBottom:`1px solid ${d}`},children:"Allegiance"}),e.jsx("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:e.jsxs("tbody",{children:[n.allegiance.name&&e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px",color:"#ccc",width:100},children:"Name"}),e.jsx("td",{style:{padding:"2px 6px"},children:n.allegiance.name})]}),((_=n.allegiance.monarch)==null?void 0:_.name)&&e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px",color:"#ccc"},children:"Monarch"}),e.jsx("td",{style:{padding:"2px 6px"},children:n.allegiance.monarch.name})]}),((N=n.allegiance.patron)==null?void 0:N.name)&&e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px",color:"#ccc"},children:"Patron"}),e.jsx("td",{style:{padding:"2px 6px"},children:n.allegiance.patron.name})]}),n.allegiance.rank!=null&&e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px",color:"#ccc"},children:"Rank"}),e.jsx("td",{style:{padding:"2px 6px"},children:n.allegiance.rank})]}),n.allegiance.followers!=null&&e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px",color:"#ccc"},children:"Followers"}),e.jsx("td",{style:{padding:"2px 6px"},children:n.allegiance.followers})]})]})})]})]})})};export{ee as CharacterWindow}; diff --git a/static/v2/assets/CharacterWindow-DX4iez-v.js b/static/v2/assets/CharacterWindow-DX4iez-v.js deleted file mode 100644 index 94cd801d..00000000 --- a/static/v2/assets/CharacterWindow-DX4iez-v.js +++ /dev/null @@ -1 +0,0 @@ -import{r as f,a as Y,j as e,D as X}from"./index-BiGwMY76.js";import"./react-yfL0ty4i.js";const B={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"},F={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"},$={370:"Damage",371:"Damage Resistance",372:"Critical",373:"Critical Resistance",374:"Critical Damage",375:"Critical Damage Resistance",376:"Healing Boost",379:"Vitality"},W={287:"Celestial Hand",288:"Eldrytch Web",289:"Radiant Blood"},U={354:"Melee",355:"Ranged",362:"Summoning"},J={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"},D={181:"Chess Rank",192:"Fishing Skill",199:"Total Augmentations",322:"Aetheria Slots",390:"Enlightenment"};function K(c){return c>=1001?"Master":c>=301?"Lord":c>=151?"Knight":c>=31?"Adept":"Initiate"}const d="#af7a30",u="#000022",Z=({id:c,charName:g,zIndex:L,vitals:s})=>{var _,N;const[n,O]=f.useState(null),[j,H]=f.useState(0),[m,P]=f.useState(0);f.useEffect(()=>{Y(`/character-stats/${encodeURIComponent(g)}`).then(O).catch(()=>{})},[g]);const a=t=>t!=null?Number(t).toLocaleString():"—",o=(n==null?void 0:n.stats_data)||n||{},C=o.attributes||{},A=o.skills||{},V=o.vitals||{},E=o.titles||[],h=o.properties||{},T=Object.entries(A).filter(([,t])=>(t==null?void 0:t.training)==="Specialized").sort(([t],[l])=>t.localeCompare(l)),I=Object.entries(A).filter(([,t])=>(t==null?void 0:t.training)==="Trained").sort(([t],[l])=>t.localeCompare(l)),S=Object.entries(h).filter(([t,l])=>B[parseInt(t)]&&Number(l)>0).map(([t,l])=>({name:B[parseInt(t)],uses:Number(l)})),w=Object.entries(h).filter(([t,l])=>F[parseInt(t)]&&Number(l)>0).map(([t,l])=>({name:F[parseInt(t)],uses:Number(l)})),z=Object.entries(h).filter(([t,l])=>$[parseInt(t)]&&Number(l)>0).map(([t,l])=>({name:$[parseInt(t)],value:Number(l)})),x=[];n!=null&&n.birth&&x.push({name:"Birth",value:n.birth}),(n==null?void 0:n.deaths)!=null&&x.push({name:"Deaths",value:a(n.deaths)}),Object.entries(h).forEach(([t,l])=>{const i=parseInt(t);D[i]&&x.push({name:D[i],value:l})});const y=[];Object.entries(h).forEach(([t,l])=>{const i=parseInt(t);U[i]&&y.push({name:U[i],value:J[Number(l)]||`Unknown (${l})`})});const b=[];Object.entries(h).forEach(([t,l])=>{const i=parseInt(t);W[i]&&Number(l)>0&&b.push({name:W[i],rank:K(Number(l)),value:Number(l)})});const R=t=>({padding:"5px 8px",fontSize:12,fontWeight:"bold",color:"#fff",cursor:"pointer",userSelect:"none",borderTop:`2px solid ${t?d:u}`,borderLeft:`2px solid ${t?d:u}`,borderRight:`2px solid ${t?d:u}`,background:t?"rgba(0,100,0,0.4)":"transparent"}),M={background:"#000",border:`2px solid ${d}`,maxHeight:400,overflowY:"auto",overflowX:"hidden"},r={background:"#222",fontWeight:"bold",fontSize:12,padding:"2px 6px"},k={padding:"2px 6px",background:"rgba(0,100,0,0.4)",whiteSpace:"nowrap"},p={padding:"2px 6px",background:"rgba(0,0,100,0.4)",textAlign:"right",whiteSpace:"nowrap"},G={padding:"2px 6px",color:"#ccc"};return e.jsx(X,{id:c,title:`Character: ${g}`,zIndex:L,width:740,height:600,children:e.jsxs("div",{style:{background:u,color:"#fff",font:'14px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif',overflowY:"auto",padding:"10px 15px 15px",flex:1},children:[e.jsxs("div",{style:{marginBottom:10},children:[e.jsxs("h1",{style:{margin:"0 0 2px",fontSize:28,fontWeight:"bold"},children:[g,e.jsx("span",{style:{fontSize:"200%",color:"#fff27f",float:"right"},children:(n==null?void 0:n.level)||""})]}),e.jsx("div",{style:{fontSize:"85%",color:"gold"},children:[n==null?void 0:n.gender,n==null?void 0:n.race].filter(Boolean).join(" ")||"Awaiting character data..."})]}),e.jsxs("div",{style:{fontSize:"85%",margin:"6px 0 10px",display:"grid",gridTemplateColumns:"1fr 1fr",gap:"0 20px"},children:[e.jsxs("div",{children:["Total XP: ",a(n==null?void 0:n.total_xp)]}),e.jsxs("div",{style:{textAlign:"right"},children:["Unassigned XP: ",a(n==null?void 0:n.unassigned_xp)]}),e.jsxs("div",{children:["Luminance: ",(n==null?void 0:n.luminance_earned)!=null?`${a(n.luminance_earned)} / ${a(n.luminance_total)}`:"—"]}),e.jsxs("div",{style:{textAlign:"right"},children:["Deaths: ",a(n==null?void 0:n.deaths)]})]}),e.jsxs("div",{style:{display:"flex",gap:13,flexWrap:"wrap"},children:[e.jsxs("div",{style:{width:320},children:[e.jsx("div",{style:{height:30,display:"flex"},children:["Attributes","Skills","Titles"].map((t,l)=>e.jsx("div",{style:R(j===l),onClick:()=>H(l),children:t},t))}),e.jsxs("div",{style:M,children:[j===0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{padding:"6px 8px",display:"flex",flexDirection:"column",gap:8,borderBottom:`2px solid ${d}`},children:[{label:"Health",pct:(s==null?void 0:s.health_percentage)??0,cur:s==null?void 0:s.health_current,max:s==null?void 0:s.health_max,bg:"#cc3333"},{label:"Stamina",pct:(s==null?void 0:s.stamina_percentage)??0,cur:s==null?void 0:s.stamina_current,max:s==null?void 0:s.stamina_max,bg:"#ccaa33"},{label:"Mana",pct:(s==null?void 0:s.mana_percentage)??0,cur:s==null?void 0:s.mana_current,max:s==null?void 0:s.mana_max,bg:"#3366cc"}].map(t=>e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[e.jsx("span",{style:{width:55,fontSize:12,color:"#ccc"},children:t.label}),e.jsx("div",{style:{flex:1,height:14,overflow:"hidden",position:"relative",border:`1px solid ${d}`},children:e.jsx("div",{style:{height:"100%",width:`${t.pct}%`,background:t.bg,transition:"width 0.5s ease"}})}),e.jsxs("span",{style:{width:80,textAlign:"right",fontSize:12,color:"#ccc"},children:[t.cur??"—"," / ",t.max??"—"]})]},t.label))}),e.jsxs("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{style:r,children:"Attribute"}),e.jsx("td",{style:r,children:"Creation"}),e.jsx("td",{style:r,children:"Base"})]})}),e.jsx("tbody",{children:["strength","endurance","coordination","quickness","focus","self"].map(t=>{var l,i;return e.jsxs("tr",{children:[e.jsx("td",{style:k,children:t.charAt(0).toUpperCase()+t.slice(1)}),e.jsx("td",{style:G,children:((l=C[t])==null?void 0:l.creation)??"—"}),e.jsx("td",{style:p,children:((i=C[t])==null?void 0:i.base)??"—"})]},t)})})]}),e.jsxs("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{style:r,children:"Vital"}),e.jsx("td",{style:r,children:"Base"})]})}),e.jsx("tbody",{children:["health","stamina","mana"].map(t=>{var l;return e.jsxs("tr",{children:[e.jsx("td",{style:k,children:t.charAt(0).toUpperCase()+t.slice(1)}),e.jsx("td",{style:p,children:((l=V[t])==null?void 0:l.base)??"—"})]},t)})})]}),e.jsx("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:e.jsx("tbody",{children:e.jsxs("tr",{children:[e.jsx("td",{style:k,children:"Skill Credits"}),e.jsx("td",{style:p,children:a(o.skill_credits)})]})})})]}),j===1&&e.jsxs("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{style:r,children:"Skill"}),e.jsx("td",{style:r,children:"Level"})]})}),e.jsxs("tbody",{children:[T.map(([t,l])=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px",background:"linear-gradient(to right, #392067, #392067, black)"},children:t.replace(/_/g," ").replace(/\b\w/g,i=>i.toUpperCase())}),e.jsx("td",{style:{...p,background:"linear-gradient(to right, #392067, #392067, black)"},children:l.base})]},t)),I.map(([t,l])=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px",background:"linear-gradient(to right, #0f3c3e, #0f3c3e, black)"},children:t.replace(/_/g," ").replace(/\b\w/g,i=>i.toUpperCase())}),e.jsx("td",{style:{...p,background:"linear-gradient(to right, #0f3c3e, #0f3c3e, black)"},children:l.base})]},t)),T.length===0&&I.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:2,style:{padding:10,color:"#666",fontStyle:"italic",textAlign:"center"},children:"No skill data"})})]})]}),j===2&&e.jsx("div",{style:{padding:"6px 10px",fontSize:13},children:E.length>0?E.map((t,l)=>e.jsx("div",{style:{padding:"1px 0"},children:t},l)):e.jsx("div",{style:{color:"#666",fontStyle:"italic",textAlign:"center",padding:10},children:"No titles"})})]})]}),e.jsxs("div",{style:{width:320},children:[e.jsx("div",{style:{height:30,display:"flex"},children:["Augmentations","Ratings","Other"].map((t,l)=>e.jsx("div",{style:R(m===l),onClick:()=>P(l),children:t},t))}),e.jsxs("div",{style:M,children:[m===0&&(S.length||w.length?e.jsxs(e.Fragment,{children:[S.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{background:"#222",padding:"4px 8px",fontWeight:"bold",fontSize:13,borderBottom:`1px solid ${d}`},children:"Augmentations"}),e.jsxs("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{style:r,children:"Name"}),e.jsx("td",{style:r,children:"Uses"})]})}),e.jsx("tbody",{children:S.map(t=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px"},children:t.name}),e.jsx("td",{style:{padding:"2px 6px",textAlign:"right"},children:t.uses})]},t.name))})]})]}),w.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{background:"#222",padding:"4px 8px",fontWeight:"bold",fontSize:13,borderBottom:`1px solid ${d}`},children:"Auras"}),e.jsxs("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{style:r,children:"Name"}),e.jsx("td",{style:r,children:"Uses"})]})}),e.jsx("tbody",{children:w.map(t=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px"},children:t.name}),e.jsx("td",{style:{padding:"2px 6px",textAlign:"right"},children:t.uses})]},t.name))})]})]})]}):e.jsx("div",{style:{color:"#666",fontStyle:"italic",textAlign:"center",padding:10},children:"No augmentation data"})),m===1&&(z.length>0?e.jsxs("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{style:r,children:"Rating"}),e.jsx("td",{style:r,children:"Value"})]})}),e.jsx("tbody",{children:z.map(t=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px"},children:t.name}),e.jsx("td",{style:{padding:"2px 6px",textAlign:"right"},children:t.value})]},t.name))})]}):e.jsx("div",{style:{color:"#666",fontStyle:"italic",textAlign:"center",padding:10},children:"No rating data"})),m===2&&e.jsxs("div",{children:[x.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{background:"#222",padding:"4px 8px",fontWeight:"bold",fontSize:13,borderBottom:`1px solid ${d}`},children:"General"}),e.jsx("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:e.jsx("tbody",{children:x.map(t=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px"},children:t.name}),e.jsx("td",{style:{padding:"2px 6px",textAlign:"right"},children:t.value})]},t.name))})})]}),y.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{background:"#222",padding:"4px 8px",fontWeight:"bold",fontSize:13,borderBottom:`1px solid ${d}`},children:"Masteries"}),e.jsx("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:e.jsx("tbody",{children:y.map(t=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px"},children:t.name}),e.jsx("td",{style:{padding:"2px 6px",textAlign:"right"},children:t.value})]},t.name))})})]}),b.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{background:"#222",padding:"4px 8px",fontWeight:"bold",fontSize:13,borderBottom:`1px solid ${d}`},children:"Society"}),e.jsx("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:e.jsx("tbody",{children:b.map(t=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px"},children:t.name}),e.jsxs("td",{style:{padding:"2px 6px",textAlign:"right"},children:[t.rank," (",t.value,")"]})]},t.name))})})]}),x.length===0&&y.length===0&&b.length===0&&e.jsx("div",{style:{color:"#666",fontStyle:"italic",textAlign:"center",padding:10},children:"No additional data"})]})]})]})]}),(n==null?void 0:n.allegiance)&&e.jsxs("div",{style:{marginTop:5,border:`2px solid ${d}`,background:"#000"},children:[e.jsx("div",{style:{background:"#222",padding:"4px 8px",fontWeight:"bold",fontSize:13,borderBottom:`1px solid ${d}`},children:"Allegiance"}),e.jsx("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:e.jsxs("tbody",{children:[n.allegiance.name&&e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px",color:"#ccc",width:100},children:"Name"}),e.jsx("td",{style:{padding:"2px 6px"},children:n.allegiance.name})]}),((_=n.allegiance.monarch)==null?void 0:_.name)&&e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px",color:"#ccc"},children:"Monarch"}),e.jsx("td",{style:{padding:"2px 6px"},children:n.allegiance.monarch.name})]}),((N=n.allegiance.patron)==null?void 0:N.name)&&e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px",color:"#ccc"},children:"Patron"}),e.jsx("td",{style:{padding:"2px 6px"},children:n.allegiance.patron.name})]}),n.allegiance.rank!=null&&e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px",color:"#ccc"},children:"Rank"}),e.jsx("td",{style:{padding:"2px 6px"},children:n.allegiance.rank})]}),n.allegiance.followers!=null&&e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px",color:"#ccc"},children:"Followers"}),e.jsx("td",{style:{padding:"2px 6px"},children:n.allegiance.followers})]})]})})]})]})})};export{Z as CharacterWindow}; diff --git a/static/v2/assets/CombatPickerWindow-NVeKtlGR.js b/static/v2/assets/CombatPickerWindow-NVeKtlGR.js new file mode 100644 index 00000000..bb9e6ab0 --- /dev/null +++ b/static/v2/assets/CombatPickerWindow-NVeKtlGR.js @@ -0,0 +1 @@ +import{u as c,j as r,D as d}from"./index-fhoLMRWN.js";import"./react-yfL0ty4i.js";const p=({id:n,zIndex:i,characters:a})=>{const{openWindow:s}=c(),e=Array.from(a.keys()).sort();return r.jsx(d,{id:n,title:"Combat Stats — Select Character",zIndex:i,width:300,height:400,children:r.jsx("div",{style:{flex:1,overflowY:"auto",padding:6},children:e.length===0?r.jsx("div",{style:{padding:12,color:"#666",textAlign:"center",fontSize:"0.8rem"},children:"No characters online"}):e.map(o=>r.jsx("div",{style:{padding:"5px 8px",cursor:"pointer",borderBottom:"1px solid #222",color:"#ccc",fontSize:"0.82rem"},onMouseEnter:t=>t.currentTarget.style.background="#2a2a2a",onMouseLeave:t=>t.currentTarget.style.background="",onClick:()=>s(`combat-${o}`,`Combat: ${o}`,o),children:o},o))})})};export{p as CombatPickerWindow}; diff --git a/static/v2/assets/CombatStatsWindow-BduiqqZk.js b/static/v2/assets/CombatStatsWindow-BduiqqZk.js new file mode 100644 index 00000000..a7eb456e --- /dev/null +++ b/static/v2/assets/CombatStatsWindow-BduiqqZk.js @@ -0,0 +1 @@ +import{r as A,a as B,j as t,D as L}from"./index-fhoLMRWN.js";import"./react-yfL0ty4i.js";const w=["Typeless","Slash","Pierce","Bludgeon","Fire","Cold","Acid","Electric"];function _(c,a,x){var o,m,f,k;return(((m=(o=c==null?void 0:c[a])==null?void 0:o[x])==null?void 0:m.total_normal_damage)??0)+(((k=(f=c==null?void 0:c[a])==null?void 0:f[x])==null?void 0:k.total_crit_damage)??0)}function G(c){let a={attacks:0,failed:0,crits:0,normalDmg:0,maxNormal:0,critDmg:0,maxCrit:0};if(!c)return a;for(const x of Object.values(c))for(const o of Object.values(x))a.attacks+=o.total_attacks??0,a.failed+=o.failed_attacks??0,a.crits+=o.crits??0,a.normalDmg+=o.total_normal_damage??0,a.maxNormal=Math.max(a.maxNormal,o.max_normal_damage??0),a.critDmg+=o.total_crit_damage??0,a.maxCrit=Math.max(a.maxCrit,o.max_crit_damage??0);return a}function F(c,a){let x={attacks:0,failed:0};const o=c==null?void 0:c[a];if(!o)return x;for(const m of Object.values(o))x.attacks+=m.total_attacks??0,x.failed+=m.failed_attacks??0;return x}const Y=({id:c,charName:a,zIndex:x})=>{const[o,m]=A.useState(null),[f,k]=A.useState("session"),[h,R]=A.useState(null);A.useEffect(()=>{B(`/combat-stats/${encodeURIComponent(a)}`).then(m).catch(()=>{});const e=setInterval(()=>{B(`/combat-stats/${encodeURIComponent(a)}`).then(m).catch(()=>{})},1e4);return()=>clearInterval(e)},[a]);const p=o==null?void 0:o[f],j=(p==null?void 0:p.monsters)??{},S=Object.keys(j).filter(e=>e!=="__cloak_surges__").sort(),n=A.useMemo(()=>{let e={},l={},v=0,$=0;const T=h?[j[h]].filter(Boolean):S.map(u=>j[u]);for(const u of T)if(u){for(const[g,D]of Object.entries(u.offense??{})){e[g]||(e[g]={});for(const[y,E]of Object.entries(D)){e[g][y]||(e[g][y]={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 i=e[g][y],d=E;i.total_attacks+=d.total_attacks??0,i.failed_attacks+=d.failed_attacks??0,i.crits+=d.crits??0,i.total_normal_damage+=d.total_normal_damage??0,i.max_normal_damage=Math.max(i.max_normal_damage,d.max_normal_damage??0),i.total_crit_damage+=d.total_crit_damage??0,i.max_crit_damage=Math.max(i.max_crit_damage,d.max_crit_damage??0)}}for(const[g,D]of Object.entries(u.defense??{})){l[g]||(l[g]={});for(const[y,E]of Object.entries(D)){l[g][y]||(l[g][y]={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 i=l[g][y],d=E;i.total_attacks+=d.total_attacks??0,i.failed_attacks+=d.failed_attacks??0,i.total_normal_damage+=d.total_normal_damage??0,i.max_normal_damage=Math.max(i.max_normal_damage,d.max_normal_damage??0),i.total_crit_damage+=d.total_crit_damage??0,i.max_crit_damage=Math.max(i.max_crit_damage,d.max_crit_damage??0)}}v+=u.aetheria_surges??0,$+=u.cloak_surges??0}return j.__cloak_surges__&&!h&&($+=j.__cloak_surges__.cloak_surges??0),{offense:e,defense:l,aeth:v,cloak:$}},[j,S,h]),r=G(n.offense),b=F(n.defense,"MeleeMissile"),M=F(n.defense,"Magic");r.attacks>0&&((r.attacks-r.failed)/r.attacks*100).toFixed(0);const N=b.attacks>0?(b.failed/b.attacks*100).toFixed(0):"0",W=M.attacks>0?(M.failed/M.attacks*100).toFixed(0):"0",C=r.attacks-r.failed,O=C-r.crits,z=O>0?Math.round(r.normalDmg/O):0;r.crits>0&&Math.round(r.critDmg/r.crits);const I=C>0?(r.crits/C*100).toFixed(1):"0",s=e=>e===0?"":e.toLocaleString();return t.jsxs(L,{id:c,title:`Combat: ${a}`,zIndex:x,width:640,height:520,children:[t.jsxs("div",{style:{display:"flex",gap:4,padding:"4px 8px",borderBottom:"1px solid #333",alignItems:"center"},children:[t.jsx("button",{className:`ml-stats-range-btn ${f==="session"?"active":""}`,onClick:()=>k("session"),children:"Session"}),t.jsx("button",{className:`ml-stats-range-btn ${f==="lifetime"?"active":""}`,onClick:()=>k("lifetime"),children:"Lifetime"}),t.jsx("div",{style:{flex:1}}),f==="session"&&t.jsx("button",{style:{fontSize:"0.6rem",padding:"2px 8px",background:"rgba(204,68,68,0.15)",color:"#c66",border:"1px solid rgba(204,68,68,0.3)",borderRadius:3,cursor:"pointer"},onClick:()=>{confirm("Clear current session stats?")&&m(e=>e&&{...e,session:{total_damage_given:0,total_damage_received:0,total_kills:0,total_aetheria_surges:0,total_cloak_surges:0,monsters:{}}})},children:"Clear Session"})]}),t.jsxs("div",{style:{display:"flex",flex:1,overflow:"hidden"},children:[t.jsxs("div",{style:{width:240,borderRight:"1px solid #333",overflowY:"auto",fontSize:"0.72rem"},children:[t.jsxs("div",{style:{display:"flex",padding:"3px 6px",borderBottom:"1px solid #333",color:"#777",fontSize:"0.65rem",fontWeight:600},children:[t.jsx("span",{style:{width:14}}),t.jsx("span",{style:{flex:1},children:"Monster"}),t.jsx("span",{style:{width:40,textAlign:"right"},children:"Kills"}),t.jsx("span",{style:{width:55,textAlign:"right"},children:"Dmg"})]}),t.jsxs("div",{style:{display:"flex",padding:"3px 6px",cursor:"pointer",background:h===null?"#2a3a4a":"",borderBottom:"1px solid #222",color:"#ddd"},onClick:()=>R(null),children:[t.jsx("span",{style:{width:14,color:"#888"},children:h===null?"*":""}),t.jsx("span",{style:{flex:1},children:"All"}),t.jsx("span",{style:{width:40,textAlign:"right"},children:s((p==null?void 0:p.total_kills)??0)}),t.jsx("span",{style:{width:55,textAlign:"right"},children:s((p==null?void 0:p.total_damage_given)??0)})]}),S.map(e=>{const l=j[e];return t.jsxs("div",{style:{display:"flex",padding:"2px 6px",cursor:"pointer",background:h===e?"#2a3a4a":"",borderBottom:"1px solid #1a1a1a",color:"#ccc"},onClick:()=>R(e),children:[t.jsx("span",{style:{width:14,color:"#888"},children:h===e?"*":""}),t.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e}),t.jsx("span",{style:{width:40,textAlign:"right"},children:s(l.kill_count)}),t.jsx("span",{style:{width:55,textAlign:"right"},children:s(l.damage_given)})]},e)})]}),t.jsx("div",{style:{flex:1,overflowY:"auto",padding:6,fontSize:"0.72rem"},children:t.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[t.jsx("thead",{children:t.jsxs("tr",{style:{color:"#777",fontSize:"0.65rem"},children:[t.jsx("th",{style:{textAlign:"left",padding:"1px 4px"}}),t.jsx("th",{style:{textAlign:"right",padding:"1px 3px"},children:"Given M/M"}),t.jsx("th",{style:{textAlign:"right",padding:"1px 3px"},children:"Given Mag"}),t.jsx("th",{style:{width:4}}),t.jsx("th",{style:{textAlign:"right",padding:"1px 3px"},children:"Recv M/M"}),t.jsx("th",{style:{textAlign:"right",padding:"1px 3px"},children:"Recv Mag"}),t.jsx("th",{style:{width:4}}),t.jsx("th",{style:{textAlign:"left",padding:"1px 3px"},children:"Stats"}),t.jsx("th",{style:{textAlign:"right",padding:"1px 3px"}})]})}),t.jsxs("tbody",{children:[w.map((e,l)=>{const v=[["Evades",b.attacks>0?`${s(b.attacks)} (${N}%)`:""],["Resists",M.attacks>0?`${s(M.attacks)} (${W}%)`:""],["A.Surges",n.aeth>0?`${s(n.aeth)}`:""],["C.Surges",n.cloak>0?`${s(n.cloak)}`:""],["",""],["",""],["Av/Mx",z>0?`${s(z)} / ${s(r.maxNormal)}`:""],["Crits",r.crits>0?`${s(r.crits)} (${I}%)`:""]][l]??["",""];return t.jsxs("tr",{children:[t.jsx("td",{style:{padding:"1px 4px",color:"#888"},children:e}),t.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:s(_(n.offense,"MeleeMissile",e))}),t.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:s(_(n.offense,"Magic",e))}),t.jsx("td",{}),t.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:s(_(n.defense,"MeleeMissile",e))}),t.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:s(_(n.defense,"Magic",e))}),t.jsx("td",{}),t.jsx("td",{style:{padding:"1px 3px",color:"#777",fontWeight:600,fontSize:"0.65rem"},children:v[0]}),t.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:v[1]})]},e)}),t.jsx("tr",{children:t.jsx("td",{colSpan:9,style:{height:4}})}),t.jsxs("tr",{children:[t.jsx("td",{style:{padding:"1px 4px",color:"#888",fontWeight:600},children:"Total"}),t.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:s(w.reduce((e,l)=>e+_(n.offense,"MeleeMissile",l),0))}),t.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:s(w.reduce((e,l)=>e+_(n.offense,"Magic",l),0))}),t.jsx("td",{}),t.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:s(w.reduce((e,l)=>e+_(n.defense,"MeleeMissile",l),0))}),t.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:s(w.reduce((e,l)=>e+_(n.defense,"Magic",l),0))}),t.jsx("td",{}),t.jsx("td",{style:{padding:"1px 3px",color:"#777",fontWeight:600,fontSize:"0.65rem"},children:"Total"}),t.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:s(r.normalDmg+r.critDmg)})]})]})]})})]})]})};export{Y as CombatStatsWindow}; diff --git a/static/v2/assets/InventoryWindow-YNou026w.js b/static/v2/assets/InventoryWindow-YNou026w.js new file mode 100644 index 00000000..cb8aacc4 --- /dev/null +++ b/static/v2/assets/InventoryWindow-YNou026w.js @@ -0,0 +1 @@ +import{r as _,a as T,j as n,D as Q}from"./index-fhoLMRWN.js";import"./react-yfL0ty4i.js";function X(e){var s,d;if(!e)return e;const o=c=>c!=null&&c!==-1&&c!==-1?c:void 0,r=e.IntValues||{};return{item_id:e.item_id??e.Id??0,name:e.name??e.Name??((s=e.StringValues)==null?void 0:s["1"])??"Unknown",icon:e.icon??e.Icon??0,object_class:e.object_class??e.ObjectClass??0,current_wielded_location:e.current_wielded_location??o(e.CurrentWieldedLocation)??o(Number(r[10]))??0,container_id:e.container_id??e.ContainerId??0,items_capacity:e.items_capacity??o(e.ItemsCapacity)??o(Number(r[6]))??((d=e.enhanced_properties)==null?void 0:d.ItemSlots_Decal)??void 0,value:e.value??o(e.Value)??o(Number(r[19]))??0,burden:e.burden??o(e.Burden)??o(Number(r[5]))??0,armor_level:e.armor_level??o(e.ArmorLevel),max_damage:e.max_damage??o(e.MaxDamage),material:e.material??e.material_name??e.Material??void 0,item_set:e.item_set??e.ItemSet??void 0,imbue:e.imbue??e.Imbue??void 0,tinks:e.tinks??o(e.Tinks),workmanship:e.workmanship??o(e.Workmanship),equip_skill:e.equip_skill??e.equip_skill_name??e.EquipSkill??void 0,wield_level:e.wield_level??o(e.WieldLevel),skill_level:e.skill_level??o(e.SkillLevel),lore_requirement:e.lore_requirement??o(e.LoreRequirement),attack_bonus:e.attack_bonus??o(e.AttackBonus),melee_defense_bonus:e.melee_defense_bonus??o(e.MeleeDefenseBonus),magic_defense_bonus:e.magic_defense_bonus??o(e.MagicDBonus),damage_bonus:e.damage_bonus??o(e.DamageBonus),damage_rating:e.damage_rating??o(e.DamRating),crit_rating:e.crit_rating??o(e.CritRating),heal_boost_rating:e.heal_boost_rating??o(e.HealBoostRating),current_mana:e.current_mana??o(Number(r[218103815]))??void 0,max_mana:e.max_mana??o(Number(r[218103814]))??void 0,spellcraft:e.spellcraft??void 0,damage_range:e.damage_range??void 0,damage_type:e.damage_type??void 0,speed_text:e.speed_text??void 0,mana_display:e.mana_display??void 0,spells:e.spells??void 0,icon_overlay_id:e.icon_overlay_id??o(Number(r[218103849]))??void 0,icon_underlay_id:e.icon_underlay_id??o(Number(r[218103850]))??void 0,_raw:e}}function C(e){return!e||e<=0?"06000133":(e+100663296).toString(16).toUpperCase().padStart(8,"0")}const M={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}},I={},ne=[32768,67108864,65536,131072,262144,524288],oe=[1,512,2048,1024,4096,8192,16384,32,256],te=[2,4,134217728,268435456,536870912,1073741824],ie=[2097152,1048576,4194304,16777216,33554432,8388608];(()=>{const e=new Set;Object.entries(M).forEach(([o,r])=>{const s=`${r.row}-${r.col}`,d=parseInt(o);e.has(s)||(e.add(s),ne.includes(d)?I[s]="#3a2555":oe.includes(d)?I[s]="#1e2e55":te.includes(d)?I[s]="#1e3e3e":ie.includes(d)?I[s]="#142040":I[s]="#2a2a2a")})})();const $="#af7a30";function W({item:e,size:o=36}){const r={position:"absolute",top:0,left:0,width:o,height:o,border:"none",background:"transparent",imageRendering:"pixelated"},s=e.icon_underlay_id&&e.icon_underlay_id>100?`/icons/${C(e.icon_underlay_id)}.png`:null,d=e.icon_overlay_id&&e.icon_overlay_id>100?`/icons/${C(e.icon_overlay_id)}.png`:null;return n.jsxs("div",{style:{width:o,height:o,position:"relative"},children:[s&&n.jsx("img",{src:s,alt:"",style:{...r,zIndex:1},onError:c=>{c.target.style.display="none"}}),n.jsx("img",{src:`/icons/${C(e.icon)}.png`,alt:e.name,style:{...r,zIndex:2},onError:c=>{c.target.src="/icons/06000133.png"}}),d&&n.jsx("img",{src:d,alt:"",style:{...r,zIndex:3},onError:c=>{c.target.style.display="none"}})]})}function le({item:e,x:o,y:r}){var j,L;const s=g=>g!=null&&g!==-1&&g!==-1,d=g=>g.toLocaleString(),c=g=>`${((g-1)*100).toFixed(1)}%`;return n.jsxs("div",{style:{position:"fixed",left:o+14,top:r+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:[n.jsx("div",{style:{color:"#ffcc00",fontWeight:"bold",fontSize:14,marginBottom:4},children:e.name}),n.jsxs("div",{style:{color:"#aaa"},children:["Value: ",d(e.value)," · Burden: ",e.burden]}),e.workmanship&&n.jsxs("div",{style:{color:"#aaa"},children:["Workmanship: ",e.workmanship]}),e.material&&n.jsxs("div",{style:{color:"#88ff88"},children:["Material: ",e.material]}),s(e.armor_level)&&n.jsxs("div",{style:{color:"#88ff88"},children:["Armor Level: ",e.armor_level]}),s(e.max_damage)&&n.jsxs("div",{style:{color:"#88ff88"},children:["Max Damage: ",e.max_damage]}),e.damage_range&&n.jsxs("div",{style:{color:"#88ff88"},children:["Damage: ",e.damage_range,e.damage_type?`, ${e.damage_type}`:""]}),s(e.attack_bonus)&&e.attack_bonus!==1&&n.jsxs("div",{style:{color:"#88ff88"},children:["Attack: +",c(e.attack_bonus)]}),s(e.melee_defense_bonus)&&e.melee_defense_bonus!==1&&n.jsxs("div",{style:{color:"#88ff88"},children:["Melee Def: +",c(e.melee_defense_bonus)]}),s(e.magic_defense_bonus)&&e.magic_defense_bonus!==1&&n.jsxs("div",{style:{color:"#88ff88"},children:["Magic Def: +",c(e.magic_defense_bonus)]}),e.equip_skill&&n.jsxs("div",{style:{color:"#ddd"},children:["Skill: ",e.equip_skill]}),s(e.wield_level)&&n.jsxs("div",{style:{color:"#ffaa00"},children:["Wield Level: ",e.wield_level]}),s(e.lore_requirement)&&n.jsxs("div",{style:{color:"#ffaa00"},children:["Lore: ",e.lore_requirement]}),e.imbue&&n.jsxs("div",{style:{color:"#88ff88"},children:["Imbue: ",e.imbue]}),e.item_set&&n.jsxs("div",{style:{color:"#88ff88"},children:["Set: ",e.item_set]}),s(e.tinks)&&n.jsxs("div",{style:{color:"#88ff88"},children:["Tinks: ",e.tinks]}),s(e.damage_rating)&&n.jsxs("div",{children:["Damage Rating: ",e.damage_rating]}),s(e.crit_rating)&&n.jsxs("div",{children:["Crit Rating: ",e.crit_rating]}),s(e.heal_boost_rating)&&n.jsxs("div",{children:["Heal Boost: ",e.heal_boost_rating]}),e.spellcraft&&n.jsxs("div",{style:{color:"#dda0dd"},children:["Spellcraft: ",e.spellcraft]}),s(e.current_mana)&&s(e.max_mana)&&n.jsxs("div",{style:{color:"#98d7ff"},children:["Mana: ",e.current_mana," / ",e.max_mana]}),((L=(j=e.spells)==null?void 0:j.spells)==null?void 0:L.length)>0&&n.jsxs("div",{style:{color:"#4a90e2",marginTop:4,fontSize:12},children:["Spells: ",e.spells.spells.map(g=>g.name).join(", ")]})]})}function G({iconSrc:e,isActive:o,fillPct:r,label:s,onClick:d}){const c=r>90?"#b7432c":r>70?"#d8a431":"#00ff00";return n.jsxs("div",{onClick:d,title:s,style:{display:"flex",alignItems:"flex-start",gap:2,cursor:"pointer",flexShrink:0,marginTop:3,position:"relative"},children:[o&&n.jsx("span",{style:{position:"absolute",left:-11,top:8,color:$,fontSize:10},children:"▶"}),n.jsx("div",{style:{width:30,height:30,border:o?"1px solid #00ff00":"1px solid #333",boxShadow:o?"0 0 4px #00ff00":"none",background:"#000",display:"flex",alignItems:"center",justifyContent:"center"},children:n.jsx("img",{src:e,alt:"",style:{width:26,height:26,objectFit:"contain",imageRendering:"pixelated"},onError:j=>{j.target.src="/icons/06001080.png"}})}),n.jsx("div",{style:{width:7,height:30,background:"#222",border:"1px solid #666",position:"relative",overflow:"hidden",borderRadius:2},title:`${Math.round(r)}% full`,children:n.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,height:`${r}%`,background:c,minHeight:r>0?2:0}})})]})}const ce=({id:e,charName:o,zIndex:r,inventoryVersion:s,equipmentCantrips:d})=>{var V,q,Y;const[c,j]=_.useState([]),[L,g]=_.useState(!0),[k,H]=_.useState(null),[B,U]=_.useState(null),[f,J]=_.useState(null),D=_.useRef(0),O=_.useRef(!1);_.useEffect(()=>{g(!0),Promise.all([T(`/inventory/${encodeURIComponent(o)}?limit=1000`).catch(()=>({items:[]})),T(`/character-stats/${encodeURIComponent(o)}`).catch(()=>null)]).then(([t,i])=>{j((t.items??[]).map(X)),J(i),O.current=!0}).finally(()=>g(!1))},[o]),_.useEffect(()=>{if(!(!O.current||!s))return clearTimeout(D.current),D.current=window.setTimeout(()=>{T(`/inventory/${encodeURIComponent(o)}?limit=1000`).then(t=>j((t.items??[]).map(X))).catch(()=>{})},2e3),()=>clearTimeout(D.current)},[o,s]);const y=_.useCallback((t,i)=>{U(t&&i?{item:t,x:i.clientX,y:i.clientY}:null)},[]),Z=_.useMemo(()=>{const t=new Set,i=[];return Object.entries(M).forEach(([u,m])=>{const a=`${m.row}-${m.col}`;t.has(a)||(t.add(a),i.push({key:a,...m,mask:parseInt(u)}))}),i},[]),{equippedMap:A,containers:z,packItems:w}=_.useMemo(()=>{const t=new Map,i=[],u=new Set,m=new Map;c.forEach(l=>{l.object_class===10&&(i.push(l),u.add(l.item_id))}),i.sort((l,h)=>(l.item_id>>>0)-(h.item_id>>>0));let a=null;return c.forEach(l=>{l.current_wielded_location>0&&l.container_id&&!u.has(l.container_id)&&(a=l.container_id)}),c.forEach(l=>{if(u.has(l.item_id))return;const h=l.current_wielded_location;if(h>0)if(l.object_class===2)Object.entries(M).forEach(([b,x])=>{if((h&parseInt(b))===parseInt(b)){const v=`${x.row}-${x.col}`;t.has(v)||t.set(v,l)}});else{let b=!1;if(M[h]){const x=M[h],v=`${x.row}-${x.col}`;t.has(v)||(t.set(v,l),b=!0)}if(!b){for(const[x,v]of Object.entries(M))if((h&parseInt(x))===parseInt(x)){const K=`${v.row}-${v.col}`;if(!t.has(K)){t.set(K,l),b=!0;break}}}}else{let p=l.container_id||0;a&&p===a&&(p=0),m.has(p)||m.set(p,[]),m.get(p).push(l)}}),{equippedMap:t,containers:i,packItems:m}},[c]);let S=w.get(0)??[],F=0;if(S.length===0){let t=0;for(const[i,u]of w.entries())!z.some(m=>m.item_id===i)&&u.length>t&&(t=u.length,F=i);S=w.get(F)??[]}const P=k!==null?w.get(k)??[]:S,N=(f==null?void 0:f.burden_units)??((V=f==null?void 0:f.stats_data)==null?void 0:V.burden_units)??0,R=(f==null?void 0:f.encumbrance_capacity)??((q=f==null?void 0:f.stats_data)==null?void 0:q.encumbrance_capacity)??0,E=R>0?Math.min(200,N/R*100):0,ee=E>150?"#b7432c":E>100?"#d8a431":"#2e8b57";return L?n.jsx(Q,{id:e,title:`Inventory: ${o}`,zIndex:r,width:572,height:720,children:n.jsx("div",{style:{padding:20,color:"#666",fontStyle:"italic"},children:"Loading inventory..."})}):n.jsxs(Q,{id:e,title:`Inventory: ${o}`,zIndex:r,width:572,height:720,children:[n.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:[n.jsxs("div",{style:{width:316,display:"flex",flexDirection:"column",overflow:"hidden"},children:[n.jsx("div",{style:{position:"relative",height:270,minHeight:270,background:"#0a0a0a",borderBottom:`1px solid ${$}`},children:Z.map(t=>{const i=A.get(t.key),u=I[t.key]??"#2a2a2a";return n.jsx("div",{style:{position:"absolute",left:(t.col-1)*44+4,top:(t.row-1)*44+4,width:36,height:36,background:i?"#5a5a62":u,border:i?"2px solid #00ffff":"2px outset #6a6a72",boxShadow:i?"0 0 5px #00ffff, inset 0 0 5px rgba(0,255,255,0.2)":"none",display:"flex",alignItems:"center",justifyContent:"center",cursor:i?"pointer":"default"},onMouseEnter:m=>i&&y(i,m),onMouseMove:m=>i&&y(i,m),onMouseLeave:()=>y(null),children:i?n.jsx(W,{item:i,size:32}):n.jsx("img",{src:"/icons/06000133.png",alt:"",style:{width:28,height:28,opacity:.15,filter:"grayscale(100%)",imageRendering:"pixelated"}})},t.key)})}),n.jsxs("div",{style:{padding:"3px 6px",fontSize:11,color:"#ccc",background:"#111",borderBottom:`1px solid ${$}`},children:["Contents of ",k!==null?((Y=z.find(t=>t.item_id===k))==null?void 0:Y.name)??"Pack":"Backpack"]}),n.jsxs("div",{style:{flex:1,overflowY:"auto",display:"grid",gridTemplateColumns:"repeat(6, 36px)",gridAutoRows:36,gap:2,padding:4,alignContent:"start"},children:[P.map((t,i)=>n.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:u=>y(t,u),onMouseMove:u=>y(t,u),onMouseLeave:()=>y(null),children:n.jsx(W,{item:t,size:32})},t.item_id??i)),Array.from({length:Math.max(0,24-P.length)}).map((t,i)=>n.jsx("div",{style:{width:36,height:36,background:"#0a0a0a",border:"1px solid #1a1a1a"}},`e${i}`))]})]}),n.jsxs("div",{style:{width:42,display:"flex",flexDirection:"column",alignItems:"center",padding:"4px 2px",borderLeft:`1px solid ${$}`,borderRight:`1px solid ${$}`},children:[n.jsx("div",{style:{textAlign:"center",fontSize:8,color:"#ccc",marginBottom:2},children:R>0?`${Math.floor(E)}%`:"Burden"}),n.jsx("div",{style:{width:14,height:40,background:"#111",border:"1px solid #555",position:"relative",overflow:"hidden",marginBottom:6,flexShrink:0},title:R>0?`${N.toLocaleString()} / ${R.toLocaleString()}`:`Burden: ${c.reduce((t,i)=>t+(i.burden??0),0).toLocaleString()}`,children:n.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,height:`${E/2}%`,background:ee,transition:"height 0.3s"}})}),n.jsx(G,{iconSrc:"/icons/0600127E.png",isActive:k===null,fillPct:S.length>0?Math.min(100,S.length/102*100):0,label:`Backpack (${S.length}/102)`,onClick:()=>H(null)}),z.map(t=>{const i=t.item_id,u=c.filter(l=>l.container_id===i&&l.item_id!==i).length,m=t.items_capacity||24,a=m>0?Math.min(100,u/m*100):0;return n.jsx(G,{iconSrc:`/icons/${C(t.icon)}.png`,isActive:k===i,fillPct:a,label:`${t.name} (${u}/${m})`,onClick:()=>H(i)},i)})]}),n.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden",minWidth:160},children:[n.jsx("div",{style:{padding:"4px 8px",fontSize:"0.72rem",fontWeight:600,color:"#aaa",background:"#111",borderBottom:`1px solid ${$}`},children:"Mana"}),n.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"2px 0"},children:[(()=>{const t=(d==null?void 0:d.items)??[],i=new Map(t.map(a=>[a.item_id,a])),u=d!=null&&d.timestamp?new Date(d.timestamp).getTime():0,m=u>0?Math.max(0,(Date.now()-u)/1e3):0;return Array.from(A.values()).map(a=>{const l=i.get(a.item_id),h=(l==null?void 0:l.current_mana)??a.current_mana??0,p=(l==null?void 0:l.max_mana)??a.max_mana??0,b=(l==null?void 0:l.mana_time_remaining_seconds)??null,x=b!=null?Math.max(0,b-m):null,v=(l==null?void 0:l.state)??(h>0?"active":"not_active");return{...a,current_mana:h,max_mana:p,liveRemaining:x,manaState:v}}).filter(a=>a.current_mana>0||a.max_mana>0).sort((a,l)=>(a.liveRemaining??999999)-(l.liveRemaining??999999)).map((a,l)=>{const h=a.manaState==="active"?"#4c4":a.manaState==="not_active"?"#c44":"#da8";return n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4,padding:"2px 4px",borderBottom:"1px solid #1a1a1a",cursor:"pointer"},onMouseEnter:p=>y(a,p),onMouseMove:p=>y(a,p),onMouseLeave:()=>y(null),children:[n.jsx("div",{style:{width:20,height:20,flexShrink:0},children:n.jsx(W,{item:a,size:20})}),n.jsx("div",{style:{width:8,height:8,borderRadius:"50%",background:h,flexShrink:0}}),n.jsx("div",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"0.68rem",color:"#ccc"},children:a.name}),n.jsxs("div",{style:{fontSize:"0.65rem",color:"#88bbff",whiteSpace:"nowrap",fontVariantNumeric:"tabular-nums"},children:[a.current_mana,"/",a.max_mana]}),n.jsx("div",{style:{fontSize:"0.63rem",color:"#9c9",whiteSpace:"nowrap",fontVariantNumeric:"tabular-nums",minWidth:42,textAlign:"right"},children:a.liveRemaining!=null?se(a.liveRemaining):""})]},l)})})(),Array.from(A.values()).filter(t=>t.current_mana>0||t.max_mana>0).length===0&&n.jsx("div",{style:{padding:12,color:"#555",textAlign:"center",fontSize:"0.7rem"},children:"No mana items equipped"})]})]})]}),B&&n.jsx(le,{item:B.item,x:B.x,y:B.y})]})};function se(e){if(e<=0)return"0h00m";const o=Math.floor(e),r=Math.floor(o/3600),s=Math.floor(o%3600/60);return`${r}h${String(s).padStart(2,"0")}m`}export{ce as InventoryWindow}; diff --git a/static/v2/assets/IssuesWindow-BtrdDjRr.js b/static/v2/assets/IssuesWindow-BtrdDjRr.js new file mode 100644 index 00000000..f077ad95 --- /dev/null +++ b/static/v2/assets/IssuesWindow-BtrdDjRr.js @@ -0,0 +1 @@ +import{r as n,a as W,j as e,D as L}from"./index-fhoLMRWN.js";import"./react-yfL0ty4i.js";const O={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"}},i={padding:"3px 6px",fontSize:"0.8rem",border:"1px solid #555",background:"#2a2a2a",color:"#ddd",borderRadius:0},N={...i,fontSize:"0.75rem"},g={padding:"4px 12px",background:"#4a80c0",color:"#fff",border:"1px solid #336699",cursor:"pointer",fontSize:"0.75rem"},a={padding:"3px 8px",background:"#444",color:"#ccc",border:"1px solid #555",cursor:"pointer",fontSize:"0.7rem"},F=({id:P,zIndex:A})=>{const[h,R]=n.useState([]),[c,m]=n.useState(""),[y,u]=n.useState(""),[f,$]=n.useState("plugin"),[v,d]=n.useState(null),[p,j]=n.useState(""),[b,S]=n.useState(""),[C,z]=n.useState(""),[T,k]=n.useState({}),x=n.useCallback(async()=>{try{const t=await W("/issues");R((t.issues??[]).sort((r,s)=>(r.resolved?1:0)-(s.resolved?1:0)))}catch{}},[]);n.useEffect(()=>{x()},[x]);const l=async(t,r)=>{await fetch(`/api${t}`,{...r,credentials:"include",headers:{"Content-Type":"application/json",...r.headers}}),x()},E=async()=>{c.trim()&&(await l("/issues",{method:"POST",body:JSON.stringify({title:c.trim(),description:y.trim(),category:f})}),m(""),u(""))},B=t=>{if(v===t.id){d(null);return}d(t.id),j(t.title),S(t.description||""),z(t.category||"other")},I=async t=>{p.trim()&&(await l(`/issues/${t}`,{method:"PATCH",body:JSON.stringify({title:p.trim(),description:b.trim(),category:C})}),d(null))},w=async t=>{const r=(T[t]||"").trim();r&&(await l(`/issues/${t}/comments`,{method:"POST",body:JSON.stringify({text:r})}),k(s=>({...s,[t]:""})))};return e.jsxs(L,{id:P,title:"Issues Board",zIndex:A,width:540,height:520,children:[e.jsxs("div",{style:{flex:1,overflowY:"auto",padding:6,fontSize:"0.8rem"},children:[h.length===0&&e.jsx("div",{style:{padding:10,color:"#888",textAlign:"center"},children:"No open issues"}),h.map(t=>{const r=O[t.category]||O.other,s=t.created?new Date(t.created).toLocaleDateString("sv-SE"):"",D=t.comments||[];return e.jsxs("div",{style:{padding:"6px 8px",marginBottom:4,background:"#1f1f1f",borderRadius:3,border:"1px solid #333",opacity:t.resolved?.55:1},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[e.jsx("span",{style:{fontSize:"0.65rem",padding:"1px 6px",borderRadius:3,background:r.color,color:"#fff",fontWeight:600},children:r.label}),e.jsx("strong",{style:{fontSize:"0.8rem",flex:1},children:t.title}),e.jsxs("span",{style:{fontSize:"0.65rem",color:"#888"},children:["by ",t.author||"User"]}),e.jsx("span",{style:{color:"#666",fontSize:"0.65rem"},children:s})]}),t.description&&e.jsx("div",{style:{color:"#999",marginTop:3,fontSize:"0.75rem"},children:t.description}),e.jsxs("div",{style:{display:"flex",gap:4,marginTop:4},children:[t.resolved?e.jsxs(e.Fragment,{children:[e.jsx("button",{style:{...a,fontSize:"0.65rem"},onClick:()=>l(`/issues/${t.id}`,{method:"PATCH",body:JSON.stringify({resolved:!1})}),children:"↻ Reopen"}),e.jsx("button",{style:{...a,fontSize:"0.65rem",color:"#c66"},onClick:()=>{confirm(`Delete issue "${t.title}"?`)&&l(`/issues/${t.id}`,{method:"DELETE"})},children:"🗑 Delete"})]}):e.jsx("button",{style:{...a,fontSize:"0.65rem",background:"rgba(68,204,68,0.15)",color:"#4c4",border:"1px solid rgba(68,204,68,0.3)"},onClick:()=>l(`/issues/${t.id}`,{method:"PATCH",body:JSON.stringify({resolved:!0})}),children:"✓ Resolve"}),e.jsx("button",{style:{...a,fontSize:"0.65rem"},onClick:()=>B(t),children:"✎ Edit"})]}),v===t.id&&e.jsxs("div",{style:{marginTop:4,padding:4,background:"#222",borderRadius:3},children:[e.jsxs("div",{style:{display:"flex",gap:4,marginBottom:4},children:[e.jsx("input",{value:p,onChange:o=>j(o.target.value),style:{...i,flex:1}}),e.jsxs("select",{value:C,onChange:o=>z(o.target.value),style:N,children:[e.jsx("option",{value:"plugin",children:"Plugin"}),e.jsx("option",{value:"overlord",children:"Overlord"}),e.jsx("option",{value:"nav",children:"Nav"}),e.jsx("option",{value:"macro",children:"Macro"}),e.jsx("option",{value:"other",children:"Other"})]})]}),e.jsxs("div",{style:{display:"flex",gap:4},children:[e.jsx("textarea",{value:b,onChange:o=>S(o.target.value),rows:2,style:{...i,flex:1,fontSize:"0.75rem",resize:"vertical"}}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[e.jsx("button",{style:{...g,fontSize:"0.7rem",padding:"3px 8px"},onClick:()=>I(t.id),children:"Save"}),e.jsx("button",{style:{...a},onClick:()=>d(null),children:"Cancel"})]})]})]}),e.jsxs("div",{style:{marginTop:4,paddingTop:4,borderTop:"1px solid #2a2a2a"},children:[D.length===0?e.jsx("div",{style:{color:"#555",fontSize:"0.7rem",padding:"2px 0"},children:"No comments yet"}):D.map(o=>e.jsxs("div",{style:{marginBottom:3,fontSize:"0.72rem"},children:[e.jsx("span",{style:{color:"#8ac",fontWeight:500},children:o.author||"Anonymous"}),e.jsx("span",{style:{color:"#555",marginLeft:6,fontSize:"0.6rem"},children:o.created?new Date(o.created).toLocaleDateString("sv-SE"):""}),e.jsx("div",{style:{color:"#bbb",marginTop:1},children:o.text})]},o.id)),e.jsxs("div",{style:{display:"flex",gap:4,marginTop:3},children:[e.jsx("input",{value:T[t.id]||"",onChange:o=>k(J=>({...J,[t.id]:o.target.value})),placeholder:"Add a comment...",style:{...i,flex:1,fontSize:"0.75rem"},onKeyDown:o=>{o.key==="Enter"&&w(t.id)}}),e.jsx("button",{style:{...g,fontSize:"0.7rem",padding:"3px 8px"},onClick:()=>w(t.id),children:"Post"})]})]})]},t.id)})]}),e.jsxs("div",{style:{padding:6,borderTop:"1px solid #333"},children:[e.jsxs("div",{style:{display:"flex",gap:4,marginBottom:4},children:[e.jsx("input",{value:c,onChange:t=>m(t.target.value),placeholder:"Issue title...",style:{...i,flex:1},onKeyDown:t=>{t.key==="Enter"&&E()}}),e.jsxs("select",{value:f,onChange:t=>$(t.target.value),style:N,children:[e.jsx("option",{value:"plugin",children:"Plugin"}),e.jsx("option",{value:"overlord",children:"Overlord"}),e.jsx("option",{value:"nav",children:"Nav"}),e.jsx("option",{value:"macro",children:"Macro"}),e.jsx("option",{value:"other",children:"Other"})]})]}),e.jsxs("div",{style:{display:"flex",gap:4},children:[e.jsx("textarea",{value:y,onChange:t=>u(t.target.value),placeholder:"Description (optional)...",rows:2,style:{...i,flex:1,fontSize:"0.75rem",resize:"vertical"}}),e.jsx("button",{style:{...g,alignSelf:"flex-end"},onClick:E,children:"Add"})]})]})]})};export{F as IssuesWindow}; diff --git a/static/v2/assets/PlayerDashboardWindow-D5m2YCrZ.js b/static/v2/assets/PlayerDashboardWindow-D5m2YCrZ.js new file mode 100644 index 00000000..e3984066 --- /dev/null +++ b/static/v2/assets/PlayerDashboardWindow-D5m2YCrZ.js @@ -0,0 +1 @@ +import{r as d,j as t,D as y}from"./index-fhoLMRWN.js";import"./react-yfL0ty4i.js";const A=({id:u,zIndex:f,characters:h})=>{const[o,k]=d.useState("kph"),[c,x]=d.useState(!1),p=d.useMemo(()=>{const e=Array.from(h.values()).filter(r=>r.telemetry).map(r=>{var i,g,m;const s=r.telemetry;return{name:r.name,kills:s.kills??0,kph:parseInt(s.kills_per_hour)||0,totalKills:s.total_kills??0,rares:s.total_rares??0,sessionRares:s.session_rares??0,deaths:parseInt(s.deaths)||0,totalDeaths:parseInt(s.total_deaths)||0,uptime:((i=s.onlinetime)==null?void 0:i.replace(/^00\./,""))??"",state:s.vt_state??"idle",tapers:parseInt(s.prismatic_taper_count)||0,hp:((g=r.vitals)==null?void 0:g.health_percentage)??0,vitae:((m=r.vitals)==null?void 0:m.vitae)??0}});return e.sort((r,s)=>{let i=0;switch(o){case"name":i=r.name.localeCompare(s.name);break;case"kills":i=r.kills-s.kills;break;case"kph":i=r.kph-s.kph;break;case"rares":i=r.rares-s.rares;break;case"deaths":i=r.totalDeaths-s.totalDeaths;break;case"uptime":i=r.uptime.localeCompare(s.uptime);break;case"state":i=r.state.localeCompare(s.state);break}return c?i:-i}),e},[h,o,c]),l=e=>{o===e?x(!c):(k(e),x(!1))},a=e=>({padding:"4px 6px",cursor:"pointer",userSelect:"none",color:o===e?"#6af":"#888",fontSize:"0.65rem",fontWeight:600,whiteSpace:"nowrap",borderBottom:"1px solid #444"}),n=e=>o===e?c?" ▲":" ▼":"";return t.jsx(y,{id:u,title:"Player Dashboard",zIndex:f,width:850,height:500,children:t.jsxs("div",{style:{flex:1,overflow:"auto",fontSize:"0.73rem"},children:[t.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[t.jsx("thead",{children:t.jsxs("tr",{style:{position:"sticky",top:0,background:"#1a1a1a",zIndex:1},children:[t.jsxs("th",{style:{...a("name"),textAlign:"left"},onClick:()=>l("name"),children:["Character",n("name")]}),t.jsxs("th",{style:{...a("state"),textAlign:"center"},onClick:()=>l("state"),children:["State",n("state")]}),t.jsxs("th",{style:{...a("kph"),textAlign:"right"},onClick:()=>l("kph"),children:["KPH",n("kph")]}),t.jsxs("th",{style:{...a("kills"),textAlign:"right"},onClick:()=>l("kills"),children:["Session",n("kills")]}),t.jsx("th",{style:{textAlign:"right",padding:"4px 6px",color:"#888",fontSize:"0.65rem",fontWeight:600,borderBottom:"1px solid #444"},children:"Total"}),t.jsxs("th",{style:{...a("rares"),textAlign:"right"},onClick:()=>l("rares"),children:["Rares",n("rares")]}),t.jsxs("th",{style:{...a("deaths"),textAlign:"right"},onClick:()=>l("deaths"),children:["Deaths",n("deaths")]}),t.jsxs("th",{style:{...a("uptime"),textAlign:"right"},onClick:()=>l("uptime"),children:["Uptime",n("uptime")]}),t.jsx("th",{style:{textAlign:"right",padding:"4px 6px",color:"#888",fontSize:"0.65rem",fontWeight:600,borderBottom:"1px solid #444"},children:"HP%"}),t.jsx("th",{style:{textAlign:"right",padding:"4px 6px",color:"#888",fontSize:"0.65rem",fontWeight:600,borderBottom:"1px solid #444"},children:"Vitae"}),t.jsx("th",{style:{textAlign:"right",padding:"4px 6px",color:"#888",fontSize:"0.65rem",fontWeight:600,borderBottom:"1px solid #444"},children:"Tapers"})]})}),t.jsx("tbody",{children:p.map(e=>{const r=e.state.toLowerCase(),s=r==="combat"||r==="hunt";return t.jsxs("tr",{style:{borderBottom:"1px solid #1a1a1a"},children:[t.jsx("td",{style:{padding:"3px 6px",color:"#ccc",fontWeight:500,maxWidth:180,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.name}),t.jsx("td",{style:{textAlign:"center",padding:"3px 6px"},children:t.jsx("span",{style:{fontSize:"0.6rem",padding:"1px 6px",borderRadius:3,background:s?"rgba(68,204,68,0.15)":r==="idle"||r==="default"?"rgba(100,100,100,0.2)":"rgba(204,68,68,0.15)",color:s?"#4c4":r==="idle"||r==="default"?"#888":"#c44"},children:e.state})}),t.jsx("td",{style:{textAlign:"right",padding:"3px 6px",color:"#4c4",fontVariantNumeric:"tabular-nums"},children:e.kph.toLocaleString()}),t.jsx("td",{style:{textAlign:"right",padding:"3px 6px",color:"#ccc",fontVariantNumeric:"tabular-nums"},children:e.kills.toLocaleString()}),t.jsx("td",{style:{textAlign:"right",padding:"3px 6px",color:"#888",fontVariantNumeric:"tabular-nums"},children:e.totalKills.toLocaleString()}),t.jsxs("td",{style:{textAlign:"right",padding:"3px 6px",color:"#fc0",fontVariantNumeric:"tabular-nums"},children:[e.rares,e.sessionRares>0?` (${e.sessionRares})`:""]}),t.jsx("td",{style:{textAlign:"right",padding:"3px 6px",color:e.totalDeaths>0?"#c66":"#555",fontVariantNumeric:"tabular-nums"},children:e.totalDeaths}),t.jsx("td",{style:{textAlign:"right",padding:"3px 6px",color:"#888",fontVariantNumeric:"tabular-nums"},children:e.uptime}),t.jsxs("td",{style:{textAlign:"right",padding:"3px 6px",fontVariantNumeric:"tabular-nums",color:e.hp>80?"#4c4":e.hp>40?"#ca0":"#c44"},children:[e.hp.toFixed(0),"%"]}),t.jsx("td",{style:{textAlign:"right",padding:"3px 6px",fontVariantNumeric:"tabular-nums",color:e.vitae>0?"#f66":"#333"},children:e.vitae>0?`${e.vitae}%`:""}),t.jsx("td",{style:{textAlign:"right",padding:"3px 6px",color:"#888",fontVariantNumeric:"tabular-nums"},children:e.tapers.toLocaleString()})]},e.name)})})]}),p.length===0&&t.jsx("div",{style:{padding:20,color:"#666",textAlign:"center"},children:"No characters online"})]})})};export{A as PlayerDashboardWindow}; diff --git a/static/v2/assets/QuestStatusWindow-B4lCEc6-.js b/static/v2/assets/QuestStatusWindow-B4lCEc6-.js new file mode 100644 index 00000000..bb7498e1 --- /dev/null +++ b/static/v2/assets/QuestStatusWindow-B4lCEc6-.js @@ -0,0 +1 @@ +import{r as c,j as t,D as u,a as f}from"./index-fhoLMRWN.js";import"./react-yfL0ty4i.js";const j=({id:p,zIndex:x})=>{const[s,h]=c.useState(null);c.useEffect(()=>{const e=async()=>{try{h(await f("/quest-status"))}catch{}};e();const o=setInterval(e,3e4);return()=>clearInterval(o)},[]);const i=s?Object.keys(s.quest_data).sort():[],l=new Set;if(s)for(const e of Object.values(s.quest_data))for(const o of Object.keys(e))l.add(o);const n=Array.from(l).sort();return t.jsx(u,{id:p,title:"Quest Status",zIndex:x,width:780,height:500,children:t.jsx("div",{style:{flex:1,overflow:"auto",fontSize:"0.72rem"},children:s?i.length===0?t.jsx("div",{style:{padding:20,color:"#666",textAlign:"center"},children:"No quest data available"}):t.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[t.jsx("thead",{children:t.jsxs("tr",{style:{position:"sticky",top:0,background:"#1a1a1a",zIndex:1},children:[t.jsx("th",{style:{textAlign:"left",padding:"4px 8px",borderBottom:"1px solid #444",color:"#888",fontSize:"0.65rem",fontWeight:600,minWidth:140},children:"Character"}),n.map(e=>t.jsx("th",{style:{textAlign:"center",padding:"4px 6px",borderBottom:"1px solid #444",color:"#888",fontSize:"0.6rem",fontWeight:600,maxWidth:120,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:e,children:e.replace(" Timer","").replace(" Pickup","")},e))]})}),t.jsx("tbody",{children:i.map(e=>{const o=s.quest_data[e]||{};return t.jsxs("tr",{style:{borderBottom:"1px solid #222"},children:[t.jsx("td",{style:{padding:"3px 8px",color:"#ccc",fontWeight:500,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:160},children:e}),n.map(d=>{const r=o[d],a=r==="READY";return t.jsx("td",{style:{textAlign:"center",padding:"3px 6px",color:a?"#4c4":r?"#ca0":"#333",fontWeight:a?600:400,fontSize:a?"0.7rem":"0.68rem"},children:r||"—"},d)})]},e)})})]}):t.jsx("div",{style:{padding:20,color:"#666",textAlign:"center"},children:"Loading quest data..."})})})};export{j as QuestStatusWindow}; diff --git a/static/v2/assets/RadarWindow-zG0PV0Ia.js b/static/v2/assets/RadarWindow-zG0PV0Ia.js new file mode 100644 index 00000000..6e62f5b2 --- /dev/null +++ b/static/v2/assets/RadarWindow-zG0PV0Ia.js @@ -0,0 +1 @@ +import{r as x,j as c,D as ne}from"./index-fhoLMRWN.js";import"./react-yfL0ty4i.js";const q=300,H=.5,se={walls:{r:0,g:0,b:255},innerWalls:{r:127,g:127,b:255},rampedWalls:{r:77,g:255,b:255},floors:{r:0,g:127,b:255},stairs:{r:0,g:63,b:255}},le={walls:{r:140,g:140,b:180},innerWalls:{r:100,g:100,b:140},rampedWalls:{r:120,g:160,b:120},floors:{r:60,g:80,b:60},stairs:{r:180,g:160,b:80}};function oe(d){const g=document.createElement("canvas");g.width=10,g.height=10;const w=g.getContext("2d");w.drawImage(d,0,0,10,10);const a=w.getImageData(0,0,10,10),t=a.data;for(let p=0;p240&&R>240&&k>240){t[p+3]=0;continue}let E=!1;for(const[L,I]of Object.entries(se))if(Math.abs(_-I.r)<15&&Math.abs(R-I.g)<15&&Math.abs(k-I.b)<15){const W=le[L];t[p]=W.r,t[p+1]=W.g,t[p+2]=W.b,E=!0;break}!E&&_<15&&R<15&&k<15&&(t[p+3]=100)}return w.putImageData(a,0,0),g}function ie(d){return d===1?Math.PI:d<-.7&&d>-.8?Math.PI/2:d>.7&&d<.8?-Math.PI/2:0}let A=null;function ce(){A||(A={},fetch("/dungeon_tiles.json").then(d=>d.json()).then(d=>{Object.entries(d).forEach(([g,w])=>{const a=new Image;a.onload=()=>{A[g]=oe(a)},a.src=w})}).catch(()=>{}))}const K={Monster:"#ff4444",Player:"#4488ff",NPC:"#44cc44",Vendor:"#44cc44",Portal:"#aa44ff",Corpse:"#ff8800",Container:"#cccc44",Door:"#888888"};function re(d){const g=(d%360+360)%360;return["N","NE","E","SE","S","SW","W","NW"][Math.round(g/45)%8]}const fe=({id:d,charName:g,zIndex:w,socket:a,radarData:t})=>{const p=x.useRef(null),_=x.useRef(H),[R,k]=x.useState(H),[E,L]=x.useState(null),I=x.useRef(null),W=x.useRef([]);x.useEffect(()=>{const n=new Image;n.src="/dereth.png",n.onload=()=>{I.current=n},ce()},[]),x.useEffect(()=>((a==null?void 0:a.readyState)===WebSocket.OPEN&&a.send(JSON.stringify({player_name:g,command:"start_radar"})),()=>{(a==null?void 0:a.readyState)===WebSocket.OPEN&&a.send(JSON.stringify({player_name:g,command:"stop_radar"}))}),[g,a]);const Q=x.useCallback(n=>{n.preventDefault();const e=n.deltaY>0?1.25:.8;_.current=Math.max(.02,Math.min(5,_.current*e)),k(_.current)},[]),D=x.useCallback(n=>{const e=p.current;if(!e)return;const o=e.getBoundingClientRect(),s=(n.clientX-o.left)*(e.width/o.width),r=(n.clientY-o.top)*(e.height/o.height);let M=null,u=20;W.current.forEach(f=>{if(f._px===void 0)return;const S=Math.sqrt((s-f._px)**2+(r-f._py)**2);S{var G;const n=p.current;if(!n||!t)return;const e=n.getContext("2d");if(!e)return;const o=q,s=o/2,r=o/2,M=t.objects??[],u=t.player_ew??0,f=t.player_ns??0,S=t.player_heading??0,b=t.is_dungeon??!1,V=t.player_x??0,Z=t.player_y??0,Y=_.current,z=b?o/2/(Y*240):o/2/Y,j=S*Math.PI/180;e.clearRect(0,0,o,o),e.fillStyle="#111",e.beginPath(),e.arc(s,r,s,0,Math.PI*2),e.fill(),e.save(),e.beginPath(),e.arc(s,r,s-1,0,Math.PI*2),e.clip();const B=t.landblock??null,te=t.player_raw_z??0;if(b&&B&&((G=window.__dungeonMapCache)!=null&&G[B])){const l=window.__dungeonMapCache[B],h=Math.floor((te+3)/6)*6;e.translate(s,r),e.rotate(-(S-180)*Math.PI/180);const i=10*z,O=A&&Object.keys(A).length>0;(l.z_levels||[]).slice().sort((y,m)=>(y.z===h?1:0)-(m.z===h?1:0)).forEach(y=>{const m=y.z===h;e.globalAlpha=m?.85:.12,(y.cells||[]).forEach(T=>{const P=-(T.x-V)*z,N=(T.y-Z)*z,C=O?A[String(T.env_id)]:null;C?(e.save(),e.translate(P,N),e.rotate(ie(T.rotation)),e.drawImage(C,-i/2,-i/2,i,i),e.restore()):(e.fillStyle=m?"#3a5a3a":"#1a2a1a",e.fillRect(P-i/2,N-i/2,i,i))})}),e.globalAlpha=1,e.setTransform(1,0,0,1,0,0)}else if(!b&&I.current){const l=I.current,h=l.naturalWidth/204.2,i=(u+102.1)*h,O=(102.1-f)*h;e.globalAlpha=.4,e.save(),e.translate(s,r),e.rotate(-j);const v=Y*h*2;e.drawImage(l,i-v/2,O-v/2,v,v,-s,-r,o,o),e.restore(),e.globalAlpha=1}e.restore(),e.strokeStyle="#333",e.lineWidth=1;for(let l=1;l<=4;l++)e.beginPath(),e.arc(s,r,s/4*l,0,Math.PI*2),e.stroke();e.beginPath(),e.moveTo(s,0),e.lineTo(s,o),e.moveTo(0,r),e.lineTo(o,r),e.stroke(),e.font="bold 12px monospace",e.textAlign="center",e.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,a:h})=>{const i=h-j;e.fillStyle=l==="N"?"#cc4444":"#888",e.fillText(l,s+Math.sin(i)*(s-12),r-Math.cos(i)*(s-12))}),e.strokeStyle="#666",e.lineWidth=1,e.beginPath(),e.moveTo(s,r),e.lineTo(s,r-s*.85),e.stroke();const $=b?Math.PI-j:j,X=Math.cos($),F=Math.sin($);M.forEach(l=>{let h,i;b&&l.raw_x!==void 0?(h=-(l.raw_x-V),i=l.raw_y-Z):(h=(l.ew??0)-u,i=(l.ns??0)-f);const O=h*X-i*F,v=b?h*F+i*X:-(h*F+i*X),y=s+O*z,m=r+v*z;if(Math.sqrt((y-s)**2+(m-r)**2)>s-4)return;l._px=y,l._py=m;const P=l.object_class??l.type??"",N=K[P]??"#888",C=l.id===E,J=C?6:P==="Monster"||P==="Player"?4:3;C&&(e.strokeStyle="#fff",e.lineWidth=2,e.beginPath(),e.arc(y,m,J+3,0,Math.PI*2),e.stroke()),e.fillStyle=N,e.beginPath(),e.arc(y,m,J,0,Math.PI*2),e.fill(),(P==="Player"||P==="Portal"||C)&&(e.fillStyle=C?"#fff":N,e.font="9px monospace",e.textAlign="left",e.fillText(l.name,y+6,m+3))}),W.current=M,e.fillStyle="#ffcc00",e.beginPath(),e.arc(s,r,5,0,Math.PI*2),e.fill(),e.strokeStyle="#fff",e.lineWidth=1,e.stroke()},[t,R,E]);const U=((t==null?void 0:t.objects)??[]).map(n=>{const e=(t==null?void 0:t.player_ew)??0,o=(t==null?void 0:t.player_ns)??0,s=(t==null?void 0:t.is_dungeon)??!1,r=(t==null?void 0:t.player_x)??0,M=(t==null?void 0:t.player_y)??0;let u,f,S;s&&n.raw_x!==void 0?(u=-(n.raw_x-r),f=n.raw_y-M,S=Math.sqrt(u*u+f*f)):(u=(n.ew??0)-e,f=(n.ns??0)-o,S=Math.sqrt(u*u+f*f)*240);const b=Math.atan2(u,f)*180/Math.PI;return{...n,dist:S,dir:re(b)}}).sort((n,e)=>n.dist-e.dist),ee=Math.round(R*240);return c.jsxs(ne,{id:d,title:`Radar: ${g}`,zIndex:w,width:360,height:560,children:[c.jsxs("div",{style:{padding:"4px 8px",display:"flex",justifyContent:"space-between",fontSize:"0.75rem",color:"#888",borderBottom:"1px solid #333",background:"#1a1a1a"},children:[c.jsxs("span",{children:["Range: ~",ee,"m"]}),c.jsx("span",{style:{fontSize:"0.65rem",color:"#555"},children:"Scroll to zoom"})]}),c.jsx("canvas",{ref:p,width:q,height:q,style:{display:"block",margin:"0 auto",borderBottom:"1px solid #333",cursor:"crosshair",flexShrink:0},onWheel:Q,onClick:D}),c.jsxs("div",{style:{flex:1,overflowY:"auto",fontSize:"0.72rem",minHeight:0},children:[c.jsxs("div",{style:{display:"flex",padding:"3px 6px",borderBottom:"1px solid #333",color:"#666",fontSize:"0.65rem",fontWeight:600},children:[c.jsx("span",{style:{width:8}}),c.jsx("span",{style:{flex:1,marginLeft:6},children:"Name"}),c.jsx("span",{style:{width:55,textAlign:"left"},children:"Type"}),c.jsx("span",{style:{width:40,textAlign:"right"},children:"Dist"}),c.jsx("span",{style:{width:24,textAlign:"center"},children:"Dir"})]}),U.length===0&&c.jsx("div",{style:{padding:12,color:"#555",textAlign:"center",fontSize:"0.7rem"},children:"Waiting for radar data..."}),U.map(n=>{const e=n.object_class??n.type??"",o=K[e]??"#888",s=n.id===E;return c.jsxs("div",{onClick:()=>L(s?null:n.id),style:{display:"flex",alignItems:"center",padding:"2px 6px",borderBottom:"1px solid #1a1a1a",cursor:"pointer",color:"#ccc",background:s?"#1a2a3a":"",borderLeft:s?"2px solid #4488ff":"2px solid transparent"},children:[c.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:o,flexShrink:0}}),c.jsx("span",{style:{flex:1,marginLeft:6,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.name}),c.jsx("span",{style:{width:55,color:"#888",fontSize:"0.65rem"},children:e}),c.jsx("span",{style:{width:40,textAlign:"right",fontVariantNumeric:"tabular-nums"},children:n.dist<1e3?`${Math.round(n.dist)}m`:`${(n.dist/1e3).toFixed(1)}km`}),c.jsx("span",{style:{width:24,textAlign:"center",color:"#666"},children:n.dir})]},n.id)})]})]})};export{fe as RadarWindow}; diff --git a/static/v2/assets/StatsWindow-CX6kEX-g.js b/static/v2/assets/StatsWindow-CX6kEX-g.js new file mode 100644 index 00000000..f222a874 --- /dev/null +++ b/static/v2/assets/StatsWindow-CX6kEX-g.js @@ -0,0 +1 @@ +import{r as o,j as t,D as d}from"./index-fhoLMRWN.js";import"./react-yfL0ty4i.js";const c=[{title:"Kills per Hour",id:1},{title:"Memory (MB)",id:2},{title:"CPU (%)",id:3},{title:"Mem Handles",id:4}],m=[{label:"1H",value:"now-1h"},{label:"6H",value:"now-6h"},{label:"24H",value:"now-24h"},{label:"7D",value:"now-7d"}],v=({id:s,charName:a,zIndex:i})=>{const[l,r]=o.useState("now-24h"),n=e=>`/grafana/d-solo/dereth-tracker/dereth-tracker-dashboard?panelId=${e}&var-character=${encodeURIComponent(a)}&from=${l}&to=now&theme=light`;return t.jsxs(d,{id:s,title:`Stats: ${a}`,zIndex:i,width:750,height:480,children:[t.jsx("div",{className:"ml-stats-controls",children:m.map(e=>t.jsx("button",{className:`ml-stats-range-btn ${l===e.value?"active":""}`,onClick:()=>r(e.value),children:e.label},e.value))}),t.jsx("div",{className:"ml-stats-grid",children:c.map(e=>t.jsx("div",{className:"ml-stats-panel",children:t.jsx("iframe",{src:n(e.id),width:"100%",height:"100%",frameBorder:"0",title:e.title})},e.id))})]})};export{v as StatsWindow}; diff --git a/static/v2/assets/VitalSharingWindow-CkWl7Mtm.js b/static/v2/assets/VitalSharingWindow-CkWl7Mtm.js new file mode 100644 index 00000000..ff1f5358 --- /dev/null +++ b/static/v2/assets/VitalSharingWindow-CkWl7Mtm.js @@ -0,0 +1 @@ +import{r as n,j as t,D as x,a as m}from"./index-fhoLMRWN.js";import"./react-yfL0ty4i.js";const v=({id:o,zIndex:c})=>{const[a,d]=n.useState([]);n.useEffect(()=>{const e=async()=>{try{const s=await m("/vital-sharing/peers");d(s.peers??[])}catch{}};e();const l=setInterval(e,5e3);return()=>clearInterval(l)},[]);const h=(e,l)=>l>0?Math.min(100,e/l*100):0;return t.jsx(x,{id:o,title:"Vital Sharing Network",zIndex:c,width:520,height:450,children:t.jsx("div",{style:{flex:1,overflowY:"auto",padding:6,fontSize:"0.75rem"},children:a.length===0?t.jsx("div",{style:{padding:16,color:"#666",textAlign:"center"},children:"No vital-sharing peers connected"}):a.map(e=>{var l,s,r;return t.jsxs("div",{style:{padding:"6px 8px",marginBottom:4,background:"#1f1f1f",borderRadius:3,border:"1px solid #333"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:3},children:[t.jsx("span",{style:{color:e.plugin_connected?"#4c4":"#a33",fontSize:"0.8rem"},children:"●"}),t.jsx("strong",{style:{flex:1},children:e.character_name}),e.subscribed&&t.jsx("span",{style:{color:"#6bf",fontSize:"0.65rem"},children:"[subscribed]"})]}),t.jsxs("div",{style:{color:"#666",fontSize:"0.68rem",marginBottom:3},children:["tags: ",((l=e.tags)==null?void 0:l.join(", "))||"none"]}),e.vitals&&e.vitals.max_health>0&&t.jsx("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[{label:"HP",cur:e.vitals.current_health,max:e.vitals.max_health,bg:"#330000",fill:"#c44"},{label:"STA",cur:e.vitals.current_stamina,max:e.vitals.max_stamina,bg:"#331a00",fill:"#ca0"},{label:"MANA",cur:e.vitals.current_mana,max:e.vitals.max_mana,bg:"#001433",fill:"#48f"}].map(i=>t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[t.jsx("span",{style:{width:32,color:"#888",fontSize:"0.65rem"},children:i.label}),t.jsx("div",{style:{flex:1,height:6,background:i.bg,borderRadius:3,overflow:"hidden"},children:t.jsx("div",{style:{width:`${h(i.cur,i.max)}%`,height:"100%",background:i.fill,borderRadius:3}})}),t.jsxs("span",{style:{width:60,textAlign:"right",fontSize:"0.65rem",color:"#888"},children:[i.cur,"/",i.max]})]},i.label))}),e.position&&t.jsxs("div",{style:{color:"#555",fontSize:"0.65rem",marginTop:2},children:[(s=e.position.ns)==null?void 0:s.toFixed(1),"N, ",(r=e.position.ew)==null?void 0:r.toFixed(1),"E"]})]},e.character_name)})})})};export{v as VitalSharingWindow}; diff --git a/static/v2/assets/index-BiGwMY76.js b/static/v2/assets/index-BiGwMY76.js deleted file mode 100644 index 48847e79..00000000 --- a/static/v2/assets/index-BiGwMY76.js +++ /dev/null @@ -1,34 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/StatsWindow-C5XFDqVx.js","assets/react-yfL0ty4i.js","assets/CharacterWindow-DX4iez-v.js","assets/InventoryWindow-C9mxhtJV.js","assets/RadarWindow-BwlMNi8v.js","assets/CombatStatsWindow-BOXaCmme.js","assets/CombatPickerWindow-DMOcilt1.js","assets/IssuesWindow-BspsADhQ.js","assets/VitalSharingWindow-CSqjZNf-.js","assets/QuestStatusWindow-C_sQPwJQ.js","assets/PlayerDashboardWindow-BfZp59uQ.js"])))=>i.map(i=>d[i]); -import{r as _m,g as er,a as ur}from"./react-yfL0ty4i.js";(function(){const _=document.createElement("link").relList;if(_&&_.supports&&_.supports("modulepreload"))return;for(const j of document.querySelectorAll('link[rel="modulepreload"]'))d(j);new MutationObserver(j=>{for(const N of j)if(N.type==="childList")for(const O of N.addedNodes)O.tagName==="LINK"&&O.rel==="modulepreload"&&d(O)}).observe(document,{childList:!0,subtree:!0});function x(j){const N={};return j.integrity&&(N.integrity=j.integrity),j.referrerPolicy&&(N.referrerPolicy=j.referrerPolicy),j.crossOrigin==="use-credentials"?N.credentials="include":j.crossOrigin==="anonymous"?N.credentials="omit":N.credentials="same-origin",N}function d(j){if(j.ep)return;j.ep=!0;const N=x(j);fetch(j.href,N)}})();var sf={exports:{}},gu={};/** - * @license React - * react-jsx-runtime.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var vm;function nr(){if(vm)return gu;vm=1;var o=Symbol.for("react.transitional.element"),_=Symbol.for("react.fragment");function x(d,j,N){var O=null;if(N!==void 0&&(O=""+N),j.key!==void 0&&(O=""+j.key),"key"in j){N={};for(var z in j)z!=="key"&&(N[z]=j[z])}else N=j;return j=N.ref,{$$typeof:o,type:d,key:O,ref:j!==void 0?j:null,props:N}}return gu.Fragment=_,gu.jsx=x,gu.jsxs=x,gu}var gm;function cr(){return gm||(gm=1,sf.exports=nr()),sf.exports}var v=cr(),E=_m();const bu=er(E);var of={exports:{}},Su={},df={exports:{}},mf={};/** - * @license React - * scheduler.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Sm;function ir(){return Sm||(Sm=1,(function(o){function _(p,C){var V=p.length;p.push(C);l:for(;0>>1,bl=p[Sl];if(0>>1;Slj(sl,V))qlj(At,sl)?(p[Sl]=At,p[ql]=V,Sl=ql):(p[Sl]=sl,p[Al]=V,Sl=Al);else if(qlj(At,V))p[Sl]=At,p[ql]=V,Sl=ql;else break l}}return C}function j(p,C){var V=p.sortIndex-C.sortIndex;return V!==0?V:p.id-C.id}if(o.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var N=performance;o.unstable_now=function(){return N.now()}}else{var O=Date,z=O.now();o.unstable_now=function(){return O.now()-z}}var M=[],D=[],q=1,S=null,U=3,B=!1,$=!1,el=!1,ml=!1,gl=typeof setTimeout=="function"?setTimeout:null,L=typeof clearTimeout=="function"?clearTimeout:null,K=typeof setImmediate<"u"?setImmediate:null;function Nl(p){for(var C=x(D);C!==null;){if(C.callback===null)d(D);else if(C.startTime<=p)d(D),C.sortIndex=C.expirationTime,_(M,C);else break;C=x(D)}}function xl(p){if(el=!1,Nl(p),!$)if(x(M)!==null)$=!0,k||(k=!0,Y());else{var C=x(D);C!==null&&st(xl,C.startTime-p)}}var k=!1,I=-1,Z=5,F=-1;function R(){return ml?!0:!(o.unstable_now()-Fp&&R());){var Sl=S.callback;if(typeof Sl=="function"){S.callback=null,U=S.priorityLevel;var bl=Sl(S.expirationTime<=p);if(p=o.unstable_now(),typeof bl=="function"){S.callback=bl,Nl(p),C=!0;break t}S===x(M)&&d(M),Nl(p)}else d(M);S=x(M)}if(S!==null)C=!0;else{var Ll=x(D);Ll!==null&&st(xl,Ll.startTime-p),C=!1}}break l}finally{S=null,U=V,B=!1}C=void 0}}finally{C?Y():k=!1}}}var Y;if(typeof K=="function")Y=function(){K(fl)};else if(typeof MessageChannel<"u"){var w=new MessageChannel,El=w.port2;w.port1.onmessage=fl,Y=function(){El.postMessage(null)}}else Y=function(){gl(fl,0)};function st(p,C){I=gl(function(){p(o.unstable_now())},C)}o.unstable_IdlePriority=5,o.unstable_ImmediatePriority=1,o.unstable_LowPriority=4,o.unstable_NormalPriority=3,o.unstable_Profiling=null,o.unstable_UserBlockingPriority=2,o.unstable_cancelCallback=function(p){p.callback=null},o.unstable_forceFrameRate=function(p){0>p||125Sl?(p.sortIndex=V,_(D,p),x(M)===null&&p===x(D)&&(el?(L(I),I=-1):el=!0,st(xl,V-Sl))):(p.sortIndex=bl,_(M,p),$||B||($=!0,k||(k=!0,Y()))),p},o.unstable_shouldYield=R,o.unstable_wrapCallback=function(p){var C=U;return function(){var V=U;U=C;try{return p.apply(this,arguments)}finally{U=V}}}})(mf)),mf}var bm;function fr(){return bm||(bm=1,df.exports=ir()),df.exports}/** - * @license React - * react-dom-client.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var zm;function sr(){if(zm)return Su;zm=1;var o=fr(),_=_m(),x=ur();function d(l){var t="https://react.dev/errors/"+l;if(1bl||(l.current=Sl[bl],Sl[bl]=null,bl--)}function sl(l,t){bl++,Sl[bl]=l.current,l.current=t}var ql=Ll(null),At=Ll(null),Wt=Ll(null),Tu=Ll(null);function Eu(l,t){switch(sl(Wt,t),sl(At,l),sl(ql,null),t.nodeType){case 9:case 11:l=(l=t.documentElement)&&(l=l.namespaceURI)?Xd(l):0;break;default:if(l=t.tagName,t=t.namespaceURI)t=Xd(t),l=Gd(t,l);else switch(l){case"svg":l=1;break;case"math":l=2;break;default:l=0}}Al(ql),sl(ql,l)}function Ga(){Al(ql),Al(At),Al(Wt)}function Vn(l){l.memoizedState!==null&&sl(Tu,l);var t=ql.current,a=Gd(t,l.type);t!==a&&(sl(At,l),sl(ql,a))}function Au(l){At.current===l&&(Al(ql),Al(At)),Tu.current===l&&(Al(Tu),hu._currentValue=V)}var Ln,rf;function pa(l){if(Ln===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);Ln=t&&t[1]||"",rf=-1)":-1u||f[e]!==r[u]){var b=` -`+f[e].replace(" at new "," at ");return l.displayName&&b.includes("")&&(b=b.replace("",l.displayName)),b}while(1<=e&&0<=u);break}}}finally{Kn=!1,Error.prepareStackTrace=a}return(a=l?l.displayName||l.name:"")?pa(a):""}function Rm(l,t){switch(l.tag){case 26:case 27:case 5:return pa(l.type);case 16:return pa("Lazy");case 13:return l.child!==t&&t!==null?pa("Suspense Fallback"):pa("Suspense");case 19:return pa("SuspenseList");case 0:case 15:return Jn(l.type,!1);case 11:return Jn(l.type.render,!1);case 1:return Jn(l.type,!0);case 31:return pa("Activity");default:return""}}function yf(l){try{var t="",a=null;do t+=Rm(l,a),a=l,l=l.return;while(l);return t}catch(e){return` -Error generating stack: `+e.message+` -`+e.stack}}var wn=Object.prototype.hasOwnProperty,Wn=o.unstable_scheduleCallback,kn=o.unstable_cancelCallback,Hm=o.unstable_shouldYield,qm=o.unstable_requestPaint,Pl=o.unstable_now,Bm=o.unstable_getCurrentPriorityLevel,vf=o.unstable_ImmediatePriority,gf=o.unstable_UserBlockingPriority,Mu=o.unstable_NormalPriority,Ym=o.unstable_LowPriority,Sf=o.unstable_IdlePriority,Xm=o.log,Gm=o.unstable_setDisableYieldValue,Me=null,lt=null;function kt(l){if(typeof Xm=="function"&&Gm(l),lt&&typeof lt.setStrictMode=="function")try{lt.setStrictMode(Me,l)}catch{}}var tt=Math.clz32?Math.clz32:Vm,Qm=Math.log,Zm=Math.LN2;function Vm(l){return l>>>=0,l===0?32:31-(Qm(l)/Zm|0)|0}var _u=256,xu=262144,Du=4194304;function Ta(l){var t=l&42;if(t!==0)return t;switch(l&-l){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 l&261888;case 262144:case 524288:case 1048576:case 2097152:return l&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return l&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return l}}function Ou(l,t,a){var e=l.pendingLanes;if(e===0)return 0;var u=0,n=l.suspendedLanes,c=l.pingedLanes;l=l.warmLanes;var i=e&134217727;return i!==0?(e=i&~n,e!==0?u=Ta(e):(c&=i,c!==0?u=Ta(c):a||(a=i&~l,a!==0&&(u=Ta(a))))):(i=e&~n,i!==0?u=Ta(i):c!==0?u=Ta(c):a||(a=e&~l,a!==0&&(u=Ta(a)))),u===0?0:t!==0&&t!==u&&(t&n)===0&&(n=u&-u,a=t&-t,n>=a||n===32&&(a&4194048)!==0)?t:u}function _e(l,t){return(l.pendingLanes&~(l.suspendedLanes&~l.pingedLanes)&t)===0}function Lm(l,t){switch(l){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 bf(){var l=Du;return Du<<=1,(Du&62914560)===0&&(Du=4194304),l}function Fn(l){for(var t=[],a=0;31>a;a++)t.push(l);return t}function xe(l,t){l.pendingLanes|=t,t!==268435456&&(l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0)}function Km(l,t,a,e,u,n){var c=l.pendingLanes;l.pendingLanes=a,l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0,l.expiredLanes&=a,l.entangledLanes&=a,l.errorRecoveryDisabledLanes&=a,l.shellSuspendCounter=0;var i=l.entanglements,f=l.expirationTimes,r=l.hiddenUpdates;for(a=c&~a;0"u")return null;try{return l.activeElement||l.body}catch{return l.body}}var $m=/[\n"\\]/g;function dt(l){return l.replace($m,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function ac(l,t,a,e,u,n,c,i){l.name="",c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"?l.type=c:l.removeAttribute("type"),t!=null?c==="number"?(t===0&&l.value===""||l.value!=t)&&(l.value=""+ot(t)):l.value!==""+ot(t)&&(l.value=""+ot(t)):c!=="submit"&&c!=="reset"||l.removeAttribute("value"),t!=null?ec(l,c,ot(t)):a!=null?ec(l,c,ot(a)):e!=null&&l.removeAttribute("value"),u==null&&n!=null&&(l.defaultChecked=!!n),u!=null&&(l.checked=u&&typeof u!="function"&&typeof u!="symbol"),i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"?l.name=""+ot(i):l.removeAttribute("name")}function jf(l,t,a,e,u,n,c,i){if(n!=null&&typeof n!="function"&&typeof n!="symbol"&&typeof n!="boolean"&&(l.type=n),t!=null||a!=null){if(!(n!=="submit"&&n!=="reset"||t!=null)){tc(l);return}a=a!=null?""+ot(a):"",t=t!=null?""+ot(t):a,i||t===l.value||(l.value=t),l.defaultValue=t}e=e??u,e=typeof e!="function"&&typeof e!="symbol"&&!!e,l.checked=i?l.checked:!!e,l.defaultChecked=!!e,c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(l.name=c),tc(l)}function ec(l,t,a){t==="number"&&ju(l.ownerDocument)===l||l.defaultValue===""+a||(l.defaultValue=""+a)}function Ja(l,t,a,e){if(l=l.options,t){t={};for(var u=0;u"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),fc=!1;if(jt)try{var Ue={};Object.defineProperty(Ue,"passive",{get:function(){fc=!0}}),window.addEventListener("test",Ue,Ue),window.removeEventListener("test",Ue,Ue)}catch{fc=!1}var $t=null,sc=null,Ru=null;function Xf(){if(Ru)return Ru;var l,t=sc,a=t.length,e,u="value"in $t?$t.value:$t.textContent,n=u.length;for(l=0;l=Re),Kf=" ",Jf=!1;function wf(l,t){switch(l){case"keyup":return M0.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Wf(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var Fa=!1;function x0(l,t){switch(l){case"compositionend":return Wf(t);case"keypress":return t.which!==32?null:(Jf=!0,Kf);case"textInput":return l=t.data,l===Kf&&Jf?null:l;default:return null}}function D0(l,t){if(Fa)return l==="compositionend"||!rc&&wf(l,t)?(l=Xf(),Ru=sc=$t=null,Fa=!1,l):null;switch(l){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:a,offset:t-l};l=e}l:{for(;a;){if(a.nextSibling){a=a.nextSibling;break l}a=a.parentNode}a=void 0}a=as(a)}}function us(l,t){return l&&t?l===t?!0:l&&l.nodeType===3?!1:t&&t.nodeType===3?us(l,t.parentNode):"contains"in l?l.contains(t):l.compareDocumentPosition?!!(l.compareDocumentPosition(t)&16):!1:!1}function ns(l){l=l!=null&&l.ownerDocument!=null&&l.ownerDocument.defaultView!=null?l.ownerDocument.defaultView:window;for(var t=ju(l.document);t instanceof l.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)l=t.contentWindow;else break;t=ju(l.document)}return t}function gc(l){var t=l&&l.nodeName&&l.nodeName.toLowerCase();return t&&(t==="input"&&(l.type==="text"||l.type==="search"||l.type==="tel"||l.type==="url"||l.type==="password")||t==="textarea"||l.contentEditable==="true")}var q0=jt&&"documentMode"in document&&11>=document.documentMode,$a=null,Sc=null,Ye=null,bc=!1;function cs(l,t,a){var e=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;bc||$a==null||$a!==ju(e)||(e=$a,"selectionStart"in e&&gc(e)?e={start:e.selectionStart,end:e.selectionEnd}:(e=(e.ownerDocument&&e.ownerDocument.defaultView||window).getSelection(),e={anchorNode:e.anchorNode,anchorOffset:e.anchorOffset,focusNode:e.focusNode,focusOffset:e.focusOffset}),Ye&&Be(Ye,e)||(Ye=e,e=Dn(Sc,"onSelect"),0>=c,u-=c,Mt=1<<32-tt(t)+u|a<W?(al=X,X=null):al=X.sibling;var cl=y(m,X,h[W],T);if(cl===null){X===null&&(X=al);break}l&&X&&cl.alternate===null&&t(m,X),s=n(cl,s,W),nl===null?G=cl:nl.sibling=cl,nl=cl,X=al}if(W===h.length)return a(m,X),ul&&Rt(m,W),G;if(X===null){for(;WW?(al=X,X=null):al=X.sibling;var ba=y(m,X,cl.value,T);if(ba===null){X===null&&(X=al);break}l&&X&&ba.alternate===null&&t(m,X),s=n(ba,s,W),nl===null?G=ba:nl.sibling=ba,nl=ba,X=al}if(cl.done)return a(m,X),ul&&Rt(m,W),G;if(X===null){for(;!cl.done;W++,cl=h.next())cl=A(m,cl.value,T),cl!==null&&(s=n(cl,s,W),nl===null?G=cl:nl.sibling=cl,nl=cl);return ul&&Rt(m,W),G}for(X=e(X);!cl.done;W++,cl=h.next())cl=g(X,m,W,cl.value,T),cl!==null&&(l&&cl.alternate!==null&&X.delete(cl.key===null?W:cl.key),s=n(cl,s,W),nl===null?G=cl:nl.sibling=cl,nl=cl);return l&&X.forEach(function(ar){return t(m,ar)}),ul&&Rt(m,W),G}function yl(m,s,h,T){if(typeof h=="object"&&h!==null&&h.type===el&&h.key===null&&(h=h.props.children),typeof h=="object"&&h!==null){switch(h.$$typeof){case B:l:{for(var G=h.key;s!==null;){if(s.key===G){if(G=h.type,G===el){if(s.tag===7){a(m,s.sibling),T=u(s,h.props.children),T.return=m,m=T;break l}}else if(s.elementType===G||typeof G=="object"&&G!==null&&G.$$typeof===Z&&Ca(G)===s.type){a(m,s.sibling),T=u(s,h.props),Le(T,h),T.return=m,m=T;break l}a(m,s);break}else t(m,s);s=s.sibling}h.type===el?(T=Da(h.props.children,m.mode,T,h.key),T.return=m,m=T):(T=Lu(h.type,h.key,h.props,null,m.mode,T),Le(T,h),T.return=m,m=T)}return c(m);case $:l:{for(G=h.key;s!==null;){if(s.key===G)if(s.tag===4&&s.stateNode.containerInfo===h.containerInfo&&s.stateNode.implementation===h.implementation){a(m,s.sibling),T=u(s,h.children||[]),T.return=m,m=T;break l}else{a(m,s);break}else t(m,s);s=s.sibling}T=_c(h,m.mode,T),T.return=m,m=T}return c(m);case Z:return h=Ca(h),yl(m,s,h,T)}if(st(h))return H(m,s,h,T);if(Y(h)){if(G=Y(h),typeof G!="function")throw Error(d(150));return h=G.call(h),Q(m,s,h,T)}if(typeof h.then=="function")return yl(m,s,$u(h),T);if(h.$$typeof===K)return yl(m,s,wu(m,h),T);Iu(m,h)}return typeof h=="string"&&h!==""||typeof h=="number"||typeof h=="bigint"?(h=""+h,s!==null&&s.tag===6?(a(m,s.sibling),T=u(s,h),T.return=m,m=T):(a(m,s),T=Mc(h,m.mode,T),T.return=m,m=T),c(m)):a(m,s)}return function(m,s,h,T){try{Ve=0;var G=yl(m,s,h,T);return fe=null,G}catch(X){if(X===ie||X===ku)throw X;var nl=et(29,X,null,m.mode);return nl.lanes=T,nl.return=m,nl}finally{}}}var Ha=Os(!0),Ns=Os(!1),aa=!1;function Yc(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Xc(l,t){l=l.updateQueue,t.updateQueue===l&&(t.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,callbacks:null})}function ea(l){return{lane:l,tag:0,payload:null,callback:null,next:null}}function ua(l,t,a){var e=l.updateQueue;if(e===null)return null;if(e=e.shared,(il&2)!==0){var u=e.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),e.pending=t,t=Vu(l),hs(l,null,a),t}return Zu(l,e,t,a),Vu(l)}function Ke(l,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var e=t.lanes;e&=l.pendingLanes,a|=e,t.lanes=a,pf(l,a)}}function Gc(l,t){var a=l.updateQueue,e=l.alternate;if(e!==null&&(e=e.updateQueue,a===e)){var u=null,n=null;if(a=a.firstBaseUpdate,a!==null){do{var c={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};n===null?u=n=c:n=n.next=c,a=a.next}while(a!==null);n===null?u=n=t:n=n.next=t}else u=n=t;a={baseState:e.baseState,firstBaseUpdate:u,lastBaseUpdate:n,shared:e.shared,callbacks:e.callbacks},l.updateQueue=a;return}l=a.lastBaseUpdate,l===null?a.firstBaseUpdate=t:l.next=t,a.lastBaseUpdate=t}var Qc=!1;function Je(){if(Qc){var l=ce;if(l!==null)throw l}}function we(l,t,a,e){Qc=!1;var u=l.updateQueue;aa=!1;var n=u.firstBaseUpdate,c=u.lastBaseUpdate,i=u.shared.pending;if(i!==null){u.shared.pending=null;var f=i,r=f.next;f.next=null,c===null?n=r:c.next=r,c=f;var b=l.alternate;b!==null&&(b=b.updateQueue,i=b.lastBaseUpdate,i!==c&&(i===null?b.firstBaseUpdate=r:i.next=r,b.lastBaseUpdate=f))}if(n!==null){var A=u.baseState;c=0,b=r=f=null,i=n;do{var y=i.lane&-536870913,g=y!==i.lane;if(g?(tl&y)===y:(e&y)===y){y!==0&&y===ne&&(Qc=!0),b!==null&&(b=b.next={lane:0,tag:i.tag,payload:i.payload,callback:null,next:null});l:{var H=l,Q=i;y=t;var yl=a;switch(Q.tag){case 1:if(H=Q.payload,typeof H=="function"){A=H.call(yl,A,y);break l}A=H;break l;case 3:H.flags=H.flags&-65537|128;case 0:if(H=Q.payload,y=typeof H=="function"?H.call(yl,A,y):H,y==null)break l;A=S({},A,y);break l;case 2:aa=!0}}y=i.callback,y!==null&&(l.flags|=64,g&&(l.flags|=8192),g=u.callbacks,g===null?u.callbacks=[y]:g.push(y))}else g={lane:y,tag:i.tag,payload:i.payload,callback:i.callback,next:null},b===null?(r=b=g,f=A):b=b.next=g,c|=y;if(i=i.next,i===null){if(i=u.shared.pending,i===null)break;g=i,i=g.next,g.next=null,u.lastBaseUpdate=g,u.shared.pending=null}}while(!0);b===null&&(f=A),u.baseState=f,u.firstBaseUpdate=r,u.lastBaseUpdate=b,n===null&&(u.shared.lanes=0),sa|=c,l.lanes=c,l.memoizedState=A}}function Us(l,t){if(typeof l!="function")throw Error(d(191,l));l.call(t)}function js(l,t){var a=l.callbacks;if(a!==null)for(l.callbacks=null,l=0;ln?n:8;var c=p.T,i={};p.T=i,ci(l,!1,t,a);try{var f=u(),r=p.S;if(r!==null&&r(i,f),f!==null&&typeof f=="object"&&typeof f.then=="function"){var b=K0(f,e);Fe(l,t,b,ft(l))}else Fe(l,t,e,ft(l))}catch(A){Fe(l,t,{then:function(){},status:"rejected",reason:A},ft())}finally{C.p=n,c!==null&&i.types!==null&&(c.types=i.types),p.T=c}}function $0(){}function ui(l,t,a,e){if(l.tag!==5)throw Error(d(476));var u=oo(l).queue;so(l,u,t,V,a===null?$0:function(){return mo(l),a(e)})}function oo(l){var t=l.memoizedState;if(t!==null)return t;t={memoizedState:V,baseState:V,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yt,lastRenderedState:V},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yt,lastRenderedState:a},next:null},l.memoizedState=t,l=l.alternate,l!==null&&(l.memoizedState=t),t}function mo(l){var t=oo(l);t.next===null&&(t=l.alternate.memoizedState),Fe(l,t.next.queue,{},ft())}function ni(){return Ql(hu)}function ho(){return Ol().memoizedState}function ro(){return Ol().memoizedState}function I0(l){for(var t=l.return;t!==null;){switch(t.tag){case 24:case 3:var a=ft();l=ea(a);var e=ua(t,l,a);e!==null&&(Il(e,t,a),Ke(e,t,a)),t={cache:Rc()},l.payload=t;return}t=t.return}}function P0(l,t,a){var e=ft();a={lane:e,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},sn(l)?vo(t,a):(a=Ec(l,t,a,e),a!==null&&(Il(a,l,e),go(a,t,e)))}function yo(l,t,a){var e=ft();Fe(l,t,a,e)}function Fe(l,t,a,e){var u={lane:e,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(sn(l))vo(t,u);else{var n=l.alternate;if(l.lanes===0&&(n===null||n.lanes===0)&&(n=t.lastRenderedReducer,n!==null))try{var c=t.lastRenderedState,i=n(c,a);if(u.hasEagerState=!0,u.eagerState=i,at(i,c))return Zu(l,t,u,0),vl===null&&Qu(),!1}catch{}finally{}if(a=Ec(l,t,u,e),a!==null)return Il(a,l,e),go(a,t,e),!0}return!1}function ci(l,t,a,e){if(e={lane:2,revertLane:Yi(),gesture:null,action:e,hasEagerState:!1,eagerState:null,next:null},sn(l)){if(t)throw Error(d(479))}else t=Ec(l,a,e,2),t!==null&&Il(t,l,2)}function sn(l){var t=l.alternate;return l===J||t!==null&&t===J}function vo(l,t){oe=tn=!0;var a=l.pending;a===null?t.next=t:(t.next=a.next,a.next=t),l.pending=t}function go(l,t,a){if((a&4194048)!==0){var e=t.lanes;e&=l.pendingLanes,a|=e,t.lanes=a,pf(l,a)}}var $e={readContext:Ql,use:un,useCallback:Ml,useContext:Ml,useEffect:Ml,useImperativeHandle:Ml,useLayoutEffect:Ml,useInsertionEffect:Ml,useMemo:Ml,useReducer:Ml,useRef:Ml,useState:Ml,useDebugValue:Ml,useDeferredValue:Ml,useTransition:Ml,useSyncExternalStore:Ml,useId:Ml,useHostTransitionStatus:Ml,useFormState:Ml,useActionState:Ml,useOptimistic:Ml,useMemoCache:Ml,useCacheRefresh:Ml};$e.useEffectEvent=Ml;var So={readContext:Ql,use:un,useCallback:function(l,t){return Kl().memoizedState=[l,t===void 0?null:t],l},useContext:Ql,useEffect:lo,useImperativeHandle:function(l,t,a){a=a!=null?a.concat([l]):null,cn(4194308,4,uo.bind(null,t,l),a)},useLayoutEffect:function(l,t){return cn(4194308,4,l,t)},useInsertionEffect:function(l,t){cn(4,2,l,t)},useMemo:function(l,t){var a=Kl();t=t===void 0?null:t;var e=l();if(qa){kt(!0);try{l()}finally{kt(!1)}}return a.memoizedState=[e,t],e},useReducer:function(l,t,a){var e=Kl();if(a!==void 0){var u=a(t);if(qa){kt(!0);try{a(t)}finally{kt(!1)}}}else u=t;return e.memoizedState=e.baseState=u,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:u},e.queue=l,l=l.dispatch=P0.bind(null,J,l),[e.memoizedState,l]},useRef:function(l){var t=Kl();return l={current:l},t.memoizedState=l},useState:function(l){l=Pc(l);var t=l.queue,a=yo.bind(null,J,t);return t.dispatch=a,[l.memoizedState,a]},useDebugValue:ai,useDeferredValue:function(l,t){var a=Kl();return ei(a,l,t)},useTransition:function(){var l=Pc(!1);return l=so.bind(null,J,l.queue,!0,!1),Kl().memoizedState=l,[!1,l]},useSyncExternalStore:function(l,t,a){var e=J,u=Kl();if(ul){if(a===void 0)throw Error(d(407));a=a()}else{if(a=t(),vl===null)throw Error(d(349));(tl&127)!==0||Ys(e,t,a)}u.memoizedState=a;var n={value:a,getSnapshot:t};return u.queue=n,lo(Gs.bind(null,e,n,l),[l]),e.flags|=2048,me(9,{destroy:void 0},Xs.bind(null,e,n,a,t),null),a},useId:function(){var l=Kl(),t=vl.identifierPrefix;if(ul){var a=_t,e=Mt;a=(e&~(1<<32-tt(e)-1)).toString(32)+a,t="_"+t+"R_"+a,a=an++,0<\/script>",n=n.removeChild(n.firstChild);break;case"select":n=typeof e.is=="string"?c.createElement("select",{is:e.is}):c.createElement("select"),e.multiple?n.multiple=!0:e.size&&(n.size=e.size);break;default:n=typeof e.is=="string"?c.createElement(u,{is:e.is}):c.createElement(u)}}n[Xl]=t,n[Jl]=e;l:for(c=t.child;c!==null;){if(c.tag===5||c.tag===6)n.appendChild(c.stateNode);else if(c.tag!==4&&c.tag!==27&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===t)break l;for(;c.sibling===null;){if(c.return===null||c.return===t)break l;c=c.return}c.sibling.return=c.return,c=c.sibling}t.stateNode=n;l:switch(Vl(n,u,e),u){case"button":case"input":case"select":case"textarea":e=!!e.autoFocus;break l;case"img":e=!0;break l;default:e=!1}e&&Gt(t)}}return pl(t),zi(t,t.type,l===null?null:l.memoizedProps,t.pendingProps,a),null;case 6:if(l&&t.stateNode!=null)l.memoizedProps!==e&&Gt(t);else{if(typeof e!="string"&&t.stateNode===null)throw Error(d(166));if(l=Wt.current,ee(t)){if(l=t.stateNode,a=t.memoizedProps,e=null,u=Gl,u!==null)switch(u.tag){case 27:case 5:e=u.memoizedProps}l[Xl]=t,l=!!(l.nodeValue===a||e!==null&&e.suppressHydrationWarning===!0||Bd(l.nodeValue,a)),l||la(t,!0)}else l=On(l).createTextNode(e),l[Xl]=t,t.stateNode=l}return pl(t),null;case 31:if(a=t.memoizedState,l===null||l.memoizedState!==null){if(e=ee(t),a!==null){if(l===null){if(!e)throw Error(d(318));if(l=t.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(d(557));l[Xl]=t}else Oa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;pl(t),l=!1}else a=Nc(),l!==null&&l.memoizedState!==null&&(l.memoizedState.hydrationErrors=a),l=!0;if(!l)return t.flags&256?(nt(t),t):(nt(t),null);if((t.flags&128)!==0)throw Error(d(558))}return pl(t),null;case 13:if(e=t.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(u=ee(t),e!==null&&e.dehydrated!==null){if(l===null){if(!u)throw Error(d(318));if(u=t.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(d(317));u[Xl]=t}else Oa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;pl(t),u=!1}else u=Nc(),l!==null&&l.memoizedState!==null&&(l.memoizedState.hydrationErrors=u),u=!0;if(!u)return t.flags&256?(nt(t),t):(nt(t),null)}return nt(t),(t.flags&128)!==0?(t.lanes=a,t):(a=e!==null,l=l!==null&&l.memoizedState!==null,a&&(e=t.child,u=null,e.alternate!==null&&e.alternate.memoizedState!==null&&e.alternate.memoizedState.cachePool!==null&&(u=e.alternate.memoizedState.cachePool.pool),n=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),n!==u&&(e.flags|=2048)),a!==l&&a&&(t.child.flags|=8192),rn(t,t.updateQueue),pl(t),null);case 4:return Ga(),l===null&&Zi(t.stateNode.containerInfo),pl(t),null;case 10:return qt(t.type),pl(t),null;case 19:if(Al(Dl),e=t.memoizedState,e===null)return pl(t),null;if(u=(t.flags&128)!==0,n=e.rendering,n===null)if(u)Pe(e,!1);else{if(_l!==0||l!==null&&(l.flags&128)!==0)for(l=t.child;l!==null;){if(n=ln(l),n!==null){for(t.flags|=128,Pe(e,!1),l=n.updateQueue,t.updateQueue=l,rn(t,l),t.subtreeFlags=0,l=a,a=t.child;a!==null;)rs(a,l),a=a.sibling;return sl(Dl,Dl.current&1|2),ul&&Rt(t,e.treeForkCount),t.child}l=l.sibling}e.tail!==null&&Pl()>bn&&(t.flags|=128,u=!0,Pe(e,!1),t.lanes=4194304)}else{if(!u)if(l=ln(n),l!==null){if(t.flags|=128,u=!0,l=l.updateQueue,t.updateQueue=l,rn(t,l),Pe(e,!0),e.tail===null&&e.tailMode==="hidden"&&!n.alternate&&!ul)return pl(t),null}else 2*Pl()-e.renderingStartTime>bn&&a!==536870912&&(t.flags|=128,u=!0,Pe(e,!1),t.lanes=4194304);e.isBackwards?(n.sibling=t.child,t.child=n):(l=e.last,l!==null?l.sibling=n:t.child=n,e.last=n)}return e.tail!==null?(l=e.tail,e.rendering=l,e.tail=l.sibling,e.renderingStartTime=Pl(),l.sibling=null,a=Dl.current,sl(Dl,u?a&1|2:a&1),ul&&Rt(t,e.treeForkCount),l):(pl(t),null);case 22:case 23:return nt(t),Vc(),e=t.memoizedState!==null,l!==null?l.memoizedState!==null!==e&&(t.flags|=8192):e&&(t.flags|=8192),e?(a&536870912)!==0&&(t.flags&128)===0&&(pl(t),t.subtreeFlags&6&&(t.flags|=8192)):pl(t),a=t.updateQueue,a!==null&&rn(t,a.retryQueue),a=null,l!==null&&l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(a=l.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(t.flags|=2048),l!==null&&Al(ja),null;case 24:return a=null,l!==null&&(a=l.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),qt(Ul),pl(t),null;case 25:return null;case 30:return null}throw Error(d(156,t.tag))}function uh(l,t){switch(Dc(t),t.tag){case 1:return l=t.flags,l&65536?(t.flags=l&-65537|128,t):null;case 3:return qt(Ul),Ga(),l=t.flags,(l&65536)!==0&&(l&128)===0?(t.flags=l&-65537|128,t):null;case 26:case 27:case 5:return Au(t),null;case 31:if(t.memoizedState!==null){if(nt(t),t.alternate===null)throw Error(d(340));Oa()}return l=t.flags,l&65536?(t.flags=l&-65537|128,t):null;case 13:if(nt(t),l=t.memoizedState,l!==null&&l.dehydrated!==null){if(t.alternate===null)throw Error(d(340));Oa()}return l=t.flags,l&65536?(t.flags=l&-65537|128,t):null;case 19:return Al(Dl),null;case 4:return Ga(),null;case 10:return qt(t.type),null;case 22:case 23:return nt(t),Vc(),l!==null&&Al(ja),l=t.flags,l&65536?(t.flags=l&-65537|128,t):null;case 24:return qt(Ul),null;case 25:return null;default:return null}}function Zo(l,t){switch(Dc(t),t.tag){case 3:qt(Ul),Ga();break;case 26:case 27:case 5:Au(t);break;case 4:Ga();break;case 31:t.memoizedState!==null&&nt(t);break;case 13:nt(t);break;case 19:Al(Dl);break;case 10:qt(t.type);break;case 22:case 23:nt(t),Vc(),l!==null&&Al(ja);break;case 24:qt(Ul)}}function lu(l,t){try{var a=t.updateQueue,e=a!==null?a.lastEffect:null;if(e!==null){var u=e.next;a=u;do{if((a.tag&l)===l){e=void 0;var n=a.create,c=a.inst;e=n(),c.destroy=e}a=a.next}while(a!==u)}}catch(i){dl(t,t.return,i)}}function ia(l,t,a){try{var e=t.updateQueue,u=e!==null?e.lastEffect:null;if(u!==null){var n=u.next;e=n;do{if((e.tag&l)===l){var c=e.inst,i=c.destroy;if(i!==void 0){c.destroy=void 0,u=t;var f=a,r=i;try{r()}catch(b){dl(u,f,b)}}}e=e.next}while(e!==n)}}catch(b){dl(t,t.return,b)}}function Vo(l){var t=l.updateQueue;if(t!==null){var a=l.stateNode;try{js(t,a)}catch(e){dl(l,l.return,e)}}}function Lo(l,t,a){a.props=Ba(l.type,l.memoizedProps),a.state=l.memoizedState;try{a.componentWillUnmount()}catch(e){dl(l,t,e)}}function tu(l,t){try{var a=l.ref;if(a!==null){switch(l.tag){case 26:case 27:case 5:var e=l.stateNode;break;case 30:e=l.stateNode;break;default:e=l.stateNode}typeof a=="function"?l.refCleanup=a(e):a.current=e}}catch(u){dl(l,t,u)}}function xt(l,t){var a=l.ref,e=l.refCleanup;if(a!==null)if(typeof e=="function")try{e()}catch(u){dl(l,t,u)}finally{l.refCleanup=null,l=l.alternate,l!=null&&(l.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(u){dl(l,t,u)}else a.current=null}function Ko(l){var t=l.type,a=l.memoizedProps,e=l.stateNode;try{l:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&e.focus();break l;case"img":a.src?e.src=a.src:a.srcSet&&(e.srcset=a.srcSet)}}catch(u){dl(l,l.return,u)}}function pi(l,t,a){try{var e=l.stateNode;_h(e,l.type,a,t),e[Jl]=t}catch(u){dl(l,l.return,u)}}function Jo(l){return l.tag===5||l.tag===3||l.tag===26||l.tag===27&&ra(l.type)||l.tag===4}function Ti(l){l:for(;;){for(;l.sibling===null;){if(l.return===null||Jo(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&l.tag!==18;){if(l.tag===27&&ra(l.type)||l.flags&2||l.child===null||l.tag===4)continue l;l.child.return=l,l=l.child}if(!(l.flags&2))return l.stateNode}}function Ei(l,t,a){var e=l.tag;if(e===5||e===6)l=l.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(l,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(l),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=Ut));else if(e!==4&&(e===27&&ra(l.type)&&(a=l.stateNode,t=null),l=l.child,l!==null))for(Ei(l,t,a),l=l.sibling;l!==null;)Ei(l,t,a),l=l.sibling}function yn(l,t,a){var e=l.tag;if(e===5||e===6)l=l.stateNode,t?a.insertBefore(l,t):a.appendChild(l);else if(e!==4&&(e===27&&ra(l.type)&&(a=l.stateNode),l=l.child,l!==null))for(yn(l,t,a),l=l.sibling;l!==null;)yn(l,t,a),l=l.sibling}function wo(l){var t=l.stateNode,a=l.memoizedProps;try{for(var e=l.type,u=t.attributes;u.length;)t.removeAttributeNode(u[0]);Vl(t,e,a),t[Xl]=l,t[Jl]=a}catch(n){dl(l,l.return,n)}}var Qt=!1,Rl=!1,Ai=!1,Wo=typeof WeakSet=="function"?WeakSet:Set,Yl=null;function nh(l,t){if(l=l.containerInfo,Ki=qn,l=ns(l),gc(l)){if("selectionStart"in l)var a={start:l.selectionStart,end:l.selectionEnd};else l:{a=(a=l.ownerDocument)&&a.defaultView||window;var e=a.getSelection&&a.getSelection();if(e&&e.rangeCount!==0){a=e.anchorNode;var u=e.anchorOffset,n=e.focusNode;e=e.focusOffset;try{a.nodeType,n.nodeType}catch{a=null;break l}var c=0,i=-1,f=-1,r=0,b=0,A=l,y=null;t:for(;;){for(var g;A!==a||u!==0&&A.nodeType!==3||(i=c+u),A!==n||e!==0&&A.nodeType!==3||(f=c+e),A.nodeType===3&&(c+=A.nodeValue.length),(g=A.firstChild)!==null;)y=A,A=g;for(;;){if(A===l)break t;if(y===a&&++r===u&&(i=c),y===n&&++b===e&&(f=c),(g=A.nextSibling)!==null)break;A=y,y=A.parentNode}A=g}a=i===-1||f===-1?null:{start:i,end:f}}else a=null}a=a||{start:0,end:0}}else a=null;for(Ji={focusedElem:l,selectionRange:a},qn=!1,Yl=t;Yl!==null;)if(t=Yl,l=t.child,(t.subtreeFlags&1028)!==0&&l!==null)l.return=t,Yl=l;else for(;Yl!==null;){switch(t=Yl,n=t.alternate,l=t.flags,t.tag){case 0:if((l&4)!==0&&(l=t.updateQueue,l=l!==null?l.events:null,l!==null))for(a=0;a title"))),Vl(n,e,a),n[Xl]=l,Bl(n),e=n;break l;case"link":var c=lm("link","href",u).get(e+(a.href||""));if(c){for(var i=0;iyl&&(c=yl,yl=Q,Q=c);var m=es(i,Q),s=es(i,yl);if(m&&s&&(g.rangeCount!==1||g.anchorNode!==m.node||g.anchorOffset!==m.offset||g.focusNode!==s.node||g.focusOffset!==s.offset)){var h=A.createRange();h.setStart(m.node,m.offset),g.removeAllRanges(),Q>yl?(g.addRange(h),g.extend(s.node,s.offset)):(h.setEnd(s.node,s.offset),g.addRange(h))}}}}for(A=[],g=i;g=g.parentNode;)g.nodeType===1&&A.push({element:g,left:g.scrollLeft,top:g.scrollTop});for(typeof i.focus=="function"&&i.focus(),i=0;ia?32:a,p.T=null,a=Ui,Ui=null;var n=da,c=Jt;if(Hl=0,ge=da=null,Jt=0,(il&6)!==0)throw Error(d(331));var i=il;if(il|=4,nd(n.current),ad(n,n.current,c,a),il=i,iu(0,!1),lt&&typeof lt.onPostCommitFiberRoot=="function")try{lt.onPostCommitFiberRoot(Me,n)}catch{}return!0}finally{C.p=u,p.T=e,Ed(l,t)}}function Md(l,t,a){t=ht(a,t),t=oi(l.stateNode,t,2),l=ua(l,t,2),l!==null&&(xe(l,2),Dt(l))}function dl(l,t,a){if(l.tag===3)Md(l,l,a);else for(;t!==null;){if(t.tag===3){Md(t,l,a);break}else if(t.tag===1){var e=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof e.componentDidCatch=="function"&&(oa===null||!oa.has(e))){l=ht(a,l),a=_o(2),e=ua(t,a,2),e!==null&&(xo(a,e,t,l),xe(e,2),Dt(e));break}}t=t.return}}function Hi(l,t,a){var e=l.pingCache;if(e===null){e=l.pingCache=new fh;var u=new Set;e.set(t,u)}else u=e.get(t),u===void 0&&(u=new Set,e.set(t,u));u.has(a)||(xi=!0,u.add(a),l=hh.bind(null,l,t,a),t.then(l,l))}function hh(l,t,a){var e=l.pingCache;e!==null&&e.delete(t),l.pingedLanes|=l.suspendedLanes&a,l.warmLanes&=~a,vl===l&&(tl&a)===a&&(_l===4||_l===3&&(tl&62914560)===tl&&300>Pl()-Sn?(il&2)===0&&Se(l,0):Di|=a,ve===tl&&(ve=0)),Dt(l)}function _d(l,t){t===0&&(t=bf()),l=xa(l,t),l!==null&&(xe(l,t),Dt(l))}function rh(l){var t=l.memoizedState,a=0;t!==null&&(a=t.retryLane),_d(l,a)}function yh(l,t){var a=0;switch(l.tag){case 31:case 13:var e=l.stateNode,u=l.memoizedState;u!==null&&(a=u.retryLane);break;case 19:e=l.stateNode;break;case 22:e=l.stateNode._retryCache;break;default:throw Error(d(314))}e!==null&&e.delete(t),_d(l,a)}function vh(l,t){return Wn(l,t)}var Mn=null,ze=null,qi=!1,_n=!1,Bi=!1,ha=0;function Dt(l){l!==ze&&l.next===null&&(ze===null?Mn=ze=l:ze=ze.next=l),_n=!0,qi||(qi=!0,Sh())}function iu(l,t){if(!Bi&&_n){Bi=!0;do for(var a=!1,e=Mn;e!==null;){if(l!==0){var u=e.pendingLanes;if(u===0)var n=0;else{var c=e.suspendedLanes,i=e.pingedLanes;n=(1<<31-tt(42|l)+1)-1,n&=u&~(c&~i),n=n&201326741?n&201326741|1:n?n|2:0}n!==0&&(a=!0,Nd(e,n))}else n=tl,n=Ou(e,e===vl?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),(n&3)===0||_e(e,n)||(a=!0,Nd(e,n));e=e.next}while(a);Bi=!1}}function gh(){xd()}function xd(){_n=qi=!1;var l=0;ha!==0&&Dh()&&(l=ha);for(var t=Pl(),a=null,e=Mn;e!==null;){var u=e.next,n=Dd(e,t);n===0?(e.next=null,a===null?Mn=u:a.next=u,u===null&&(ze=a)):(a=e,(l!==0||(n&3)!==0)&&(_n=!0)),e=u}Hl!==0&&Hl!==5||iu(l),ha!==0&&(ha=0)}function Dd(l,t){for(var a=l.suspendedLanes,e=l.pingedLanes,u=l.expirationTimes,n=l.pendingLanes&-62914561;0i)break;var b=f.transferSize,A=f.initiatorType;b&&Yd(A)&&(f=f.responseEnd,c+=b*(f"u"?null:document;function Fd(l,t,a){var e=pe;if(e&&typeof t=="string"&&t){var u=dt(t);u='link[rel="'+l+'"][href="'+u+'"]',typeof a=="string"&&(u+='[crossorigin="'+a+'"]'),kd.has(u)||(kd.add(u),l={rel:l,crossOrigin:a,href:t},e.querySelector(u)===null&&(t=e.createElement("link"),Vl(t,"link",l),Bl(t),e.head.appendChild(t)))}}function Bh(l){wt.D(l),Fd("dns-prefetch",l,null)}function Yh(l,t){wt.C(l,t),Fd("preconnect",l,t)}function Xh(l,t,a){wt.L(l,t,a);var e=pe;if(e&&l&&t){var u='link[rel="preload"][as="'+dt(t)+'"]';t==="image"&&a&&a.imageSrcSet?(u+='[imagesrcset="'+dt(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(u+='[imagesizes="'+dt(a.imageSizes)+'"]')):u+='[href="'+dt(l)+'"]';var n=u;switch(t){case"style":n=Te(l);break;case"script":n=Ee(l)}bt.has(n)||(l=S({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:l,as:t},a),bt.set(n,l),e.querySelector(u)!==null||t==="style"&&e.querySelector(du(n))||t==="script"&&e.querySelector(mu(n))||(t=e.createElement("link"),Vl(t,"link",l),Bl(t),e.head.appendChild(t)))}}function Gh(l,t){wt.m(l,t);var a=pe;if(a&&l){var e=t&&typeof t.as=="string"?t.as:"script",u='link[rel="modulepreload"][as="'+dt(e)+'"][href="'+dt(l)+'"]',n=u;switch(e){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":n=Ee(l)}if(!bt.has(n)&&(l=S({rel:"modulepreload",href:l},t),bt.set(n,l),a.querySelector(u)===null)){switch(e){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(mu(n)))return}e=a.createElement("link"),Vl(e,"link",l),Bl(e),a.head.appendChild(e)}}}function Qh(l,t,a){wt.S(l,t,a);var e=pe;if(e&&l){var u=La(e).hoistableStyles,n=Te(l);t=t||"default";var c=u.get(n);if(!c){var i={loading:0,preload:null};if(c=e.querySelector(du(n)))i.loading=5;else{l=S({rel:"stylesheet",href:l,"data-precedence":t},a),(a=bt.get(n))&&Pi(l,a);var f=c=e.createElement("link");Bl(f),Vl(f,"link",l),f._p=new Promise(function(r,b){f.onload=r,f.onerror=b}),f.addEventListener("load",function(){i.loading|=1}),f.addEventListener("error",function(){i.loading|=2}),i.loading|=4,Un(c,t,e)}c={type:"stylesheet",instance:c,count:1,state:i},u.set(n,c)}}}function Zh(l,t){wt.X(l,t);var a=pe;if(a&&l){var e=La(a).hoistableScripts,u=Ee(l),n=e.get(u);n||(n=a.querySelector(mu(u)),n||(l=S({src:l,async:!0},t),(t=bt.get(u))&&lf(l,t),n=a.createElement("script"),Bl(n),Vl(n,"link",l),a.head.appendChild(n)),n={type:"script",instance:n,count:1,state:null},e.set(u,n))}}function Vh(l,t){wt.M(l,t);var a=pe;if(a&&l){var e=La(a).hoistableScripts,u=Ee(l),n=e.get(u);n||(n=a.querySelector(mu(u)),n||(l=S({src:l,async:!0,type:"module"},t),(t=bt.get(u))&&lf(l,t),n=a.createElement("script"),Bl(n),Vl(n,"link",l),a.head.appendChild(n)),n={type:"script",instance:n,count:1,state:null},e.set(u,n))}}function $d(l,t,a,e){var u=(u=Wt.current)?Nn(u):null;if(!u)throw Error(d(446));switch(l){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=Te(a.href),a=La(u).hoistableStyles,e=a.get(t),e||(e={type:"style",instance:null,count:0,state:null},a.set(t,e)),e):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){l=Te(a.href);var n=La(u).hoistableStyles,c=n.get(l);if(c||(u=u.ownerDocument||u,c={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},n.set(l,c),(n=u.querySelector(du(l)))&&!n._p&&(c.instance=n,c.state.loading=5),bt.has(l)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},bt.set(l,a),n||Lh(u,l,a,c.state))),t&&e===null)throw Error(d(528,""));return c}if(t&&e!==null)throw Error(d(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Ee(a),a=La(u).hoistableScripts,e=a.get(t),e||(e={type:"script",instance:null,count:0,state:null},a.set(t,e)),e):{type:"void",instance:null,count:0,state:null};default:throw Error(d(444,l))}}function Te(l){return'href="'+dt(l)+'"'}function du(l){return'link[rel="stylesheet"]['+l+"]"}function Id(l){return S({},l,{"data-precedence":l.precedence,precedence:null})}function Lh(l,t,a,e){l.querySelector('link[rel="preload"][as="style"]['+t+"]")?e.loading=1:(t=l.createElement("link"),e.preload=t,t.addEventListener("load",function(){return e.loading|=1}),t.addEventListener("error",function(){return e.loading|=2}),Vl(t,"link",a),Bl(t),l.head.appendChild(t))}function Ee(l){return'[src="'+dt(l)+'"]'}function mu(l){return"script[async]"+l}function Pd(l,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var e=l.querySelector('style[data-href~="'+dt(a.href)+'"]');if(e)return t.instance=e,Bl(e),e;var u=S({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return e=(l.ownerDocument||l).createElement("style"),Bl(e),Vl(e,"style",u),Un(e,a.precedence,l),t.instance=e;case"stylesheet":u=Te(a.href);var n=l.querySelector(du(u));if(n)return t.state.loading|=4,t.instance=n,Bl(n),n;e=Id(a),(u=bt.get(u))&&Pi(e,u),n=(l.ownerDocument||l).createElement("link"),Bl(n);var c=n;return c._p=new Promise(function(i,f){c.onload=i,c.onerror=f}),Vl(n,"link",e),t.state.loading|=4,Un(n,a.precedence,l),t.instance=n;case"script":return n=Ee(a.src),(u=l.querySelector(mu(n)))?(t.instance=u,Bl(u),u):(e=a,(u=bt.get(n))&&(e=S({},a),lf(e,u)),l=l.ownerDocument||l,u=l.createElement("script"),Bl(u),Vl(u,"link",e),l.head.appendChild(u),t.instance=u);case"void":return null;default:throw Error(d(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(e=t.instance,t.state.loading|=4,Un(e,a.precedence,l));return t.instance}function Un(l,t,a){for(var e=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=e.length?e[e.length-1]:null,n=u,c=0;c title"):null)}function Kh(l,t,a){if(a===1||t.itemProp!=null)return!1;switch(l){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return l=t.disabled,typeof t.precedence=="string"&&l==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function am(l){return!(l.type==="stylesheet"&&(l.state.loading&3)===0)}function Jh(l,t,a,e){if(a.type==="stylesheet"&&(typeof e.media!="string"||matchMedia(e.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var u=Te(e.href),n=t.querySelector(du(u));if(n){t=n._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(l.count++,l=Cn.bind(l),t.then(l,l)),a.state.loading|=4,a.instance=n,Bl(n);return}n=t.ownerDocument||t,e=Id(e),(u=bt.get(u))&&Pi(e,u),n=n.createElement("link"),Bl(n);var c=n;c._p=new Promise(function(i,f){c.onload=i,c.onerror=f}),Vl(n,"link",e),a.instance=n}l.stylesheets===null&&(l.stylesheets=new Map),l.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(l.count++,a=Cn.bind(l),t.addEventListener("load",a),t.addEventListener("error",a))}}var tf=0;function wh(l,t){return l.stylesheets&&l.count===0&&Hn(l,l.stylesheets),0tf?50:800)+t);return l.unsuspend=a,function(){l.unsuspend=null,clearTimeout(e),clearTimeout(u)}}:null}function Cn(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Hn(this,this.stylesheets);else if(this.unsuspend){var l=this.unsuspend;this.unsuspend=null,l()}}}var Rn=null;function Hn(l,t){l.stylesheets=null,l.unsuspend!==null&&(l.count++,Rn=new Map,t.forEach(Wh,l),Rn=null,Cn.call(l))}function Wh(l,t){if(!(t.state.loading&4)){var a=Rn.get(l);if(a)var e=a.get(null);else{a=new Map,Rn.set(l,a);for(var u=l.querySelectorAll("link[data-precedence],style[data-precedence]"),n=0;n"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(o)}catch(_){console.error(_)}}return o(),of.exports=sr(),of.exports}var dr=or();const xm=E.createContext({windows:[],openWindow:()=>{},closeWindow:()=>{},bringToFront:()=>{}}),mr=({children:o})=>{const[_,x]=E.useState([]),d=E.useRef(1e4),j=E.useCallback((z,M,D)=>{x(q=>q.find(U=>U.id===z)?q.map(U=>U.id===z?{...U,zIndex:++d.current}:U):[...q,{id:z,title:M,charName:D,zIndex:++d.current}])},[]),N=E.useCallback(z=>{x(M=>M.filter(D=>D.id!==z))},[]),O=E.useCallback(z=>{x(M=>M.map(D=>D.id===z?{...D,zIndex:++d.current}:D))},[]);return v.jsx(xm.Provider,{value:{windows:_,openWindow:j,closeWindow:N,bringToFront:O},children:o})},zu=()=>E.useContext(xm),zt={west:-102.1,east:102.1,north:102.1,south:-102.1};function pu(o,_,x,d){const j=(o-zt.west)/(zt.east-zt.west)*x,N=(zt.north-_)/(zt.north-zt.south)*d;return{x:j,y:N}}function hr(o,_,x,d,j,N,O){const z=(o-d)/x,M=(_-j)/x,D=zt.west+z/N*(zt.east-zt.west),q=zt.north-M/O*(zt.north-zt.south);return{ew:D,ns:q}}function hf(o,_){const x=o>=0?"N":"S",d=_>=0?"E":"W";return`${Math.abs(o).toFixed(1)}${x}, ${Math.abs(_).toFixed(1)}${d}`}const Dm=bu.memo(({players:o,imgW:_,imgH:x,getColor:d,onHover:j,onSelect:N,selectedPlayer:O})=>{const{openWindow:z}=zu(),[M,D]=E.useState(null);E.useEffect(()=>{const S=()=>D(null);return M&&window.addEventListener("click",S),()=>window.removeEventListener("click",S)},[M]);const q=E.useMemo(()=>o.filter(S=>S.ew!==void 0&&S.ns!==void 0).map(S=>({...S,pos:pu(S.ew,S.ns,_,x),color:d(S.character_name)})),[o,_,x,d]);return v.jsxs("div",{className:"ml-dots-layer",children:[q.map(S=>v.jsx("div",{className:`ml-dot ${O===S.character_name?"ml-dot-selected":""}`,style:{left:S.pos.x,top:S.pos.y,backgroundColor:S.color},onMouseEnter:U=>{var $;const B=($=U.currentTarget.closest(".ml-map-container"))==null?void 0:$.getBoundingClientRect();B&&j(S,U.clientX-B.left,U.clientY-B.top)},onMouseLeave:()=>j(null,0,0),onClick:()=>N(S.character_name),onDoubleClick:()=>z(`chat-${S.character_name}`,`Chat: ${S.character_name}`,S.character_name),onContextMenu:U=>{var gl;U.preventDefault();const B=S.character_name,$=(gl=U.currentTarget.closest(".ml-map-container"))==null?void 0:gl.getBoundingClientRect(),el=$?U.clientX-$.left:U.clientX,ml=$?U.clientY-$.top:U.clientY;D({name:B,x:el,y:ml})}},S.character_name)),M&&v.jsx("div",{style:{position:"fixed",left:M.x+410,top:M.y,background:"#1a1a1a",border:"1px solid #444",borderRadius:4,zIndex:9999,padding:"2px 0",fontSize:"0.75rem",boxShadow:"0 4px 12px rgba(0,0,0,0.5)",minWidth:120},children:[{label:"Chat",id:"chat"},{label:"Stats",id:"stats"},{label:"Inventory",id:"inv"},{label:"Character",id:"char"},{label:"Combat",id:"combat"},{label:"Radar",id:"radar"}].map(S=>v.jsx("div",{onClick:()=>{z(`${S.id}-${M.name}`,`${S.label}: ${M.name}`,M.name),D(null)},style:{padding:"4px 12px",cursor:"pointer",color:"#ccc"},onMouseEnter:U=>U.currentTarget.style.background="#333",onMouseLeave:U=>U.currentTarget.style.background="",children:S.label},S.id))})]})});Dm.displayName="PlayerDots";const rr="/api";async function za(o){const _=await fetch(`${rr}${o}`,{credentials:"include"});if(!_.ok)throw new Error(`API ${o}: ${_.status}`);return _.json()}function yr(){return`${location.protocol==="https:"?"wss:":"ws:"}//${location.host}/api/ws/live`}const Om=bu.memo(({imgW:o,imgH:_,getColor:x})=>{const[d,j]=E.useState([]);E.useEffect(()=>{const O=async()=>{try{const M=await za("/trails/?seconds=600");j(M.trails??[])}catch{}};O();const z=setInterval(O,2e3);return()=>clearInterval(z)},[]);const N=E.useMemo(()=>{const O={};for(const z of d){const{x:M,y:D}=pu(z.ew,z.ns,o,_);O[z.character_name]||(O[z.character_name]=[]),O[z.character_name].push(`${M},${D}`)}return Object.entries(O).filter(([,z])=>z.length>=2).map(([z,M])=>({name:z,points:M.join(" ")}))},[d,o,_]);return v.jsx("svg",{className:"ml-trails-svg",viewBox:`0 0 ${o} ${_}`,preserveAspectRatio:"none",children:N.map(O=>v.jsx("polyline",{points:O.points,stroke:x(O.name),fill:"none",strokeWidth:2,strokeOpacity:.7,strokeLinecap:"round",strokeLinejoin:"round"},O.name))})});Om.displayName="TrailsSVG";const vr=({imgW:o,imgH:_,enabled:x})=>{const d=E.useRef(null),[j,N]=E.useState([]);return E.useEffect(()=>{if(!x)return;(async()=>{try{const z=await za("/spawns/heatmap?hours=24&limit=50000");N(z.spawn_points??[])}catch{}})()},[x]),E.useEffect(()=>{const O=d.current;if(!O||!x||j.length===0||o===0)return;O.width=o,O.height=_;const z=O.getContext("2d");if(z){z.clearRect(0,0,o,_);for(const M of j){const{x:D,y:q}=pu(M.ew,M.ns,o,_),S=Math.max(5,Math.min(12,5+Math.sqrt(M.intensity*.5))),U=z.createRadialGradient(D,q,0,D,q,S);U.addColorStop(0,`rgba(255, 0, 0, ${Math.min(.9,M.intensity/40)})`),U.addColorStop(.6,`rgba(255, 100, 0, ${Math.min(.4,M.intensity/120)})`),U.addColorStop(1,"rgba(255, 150, 0, 0)"),z.fillStyle=U,z.fillRect(D-S,q-S,S*2,S*2)}}},[j,o,_,x]),x?v.jsx("canvas",{ref:d,className:"ml-heatmap-canvas"}):null},gr=({imgW:o,imgH:_,enabled:x})=>{const[d,j]=E.useState([]);E.useEffect(()=>{if(!x)return;const O=async()=>{try{const M=await za("/portals");j(M.portals??[])}catch{}};O();const z=setInterval(O,6e4);return()=>clearInterval(z)},[x]);const N=E.useMemo(()=>d.map(O=>({...O,pos:pu(O.coordinates.ew,O.coordinates.ns,o,_)})),[d,o,_]);return!x||N.length===0?null:v.jsx("div",{className:"ml-portals-layer",children:N.map((O,z)=>v.jsx("div",{className:"ml-portal-icon",style:{left:O.pos.x,top:O.pos.y},title:`${O.portal_name} (by ${O.discovered_by})`},z))})},Tm=20,Em=.3,Sr=({players:o,getColor:_,onSelectPlayer:x,showHeatmap:d,showPortals:j,selectedPlayer:N})=>{var xl;const O=E.useRef(null),z=E.useRef(null),[M,D]=E.useState({w:0,h:0}),[q,S]=E.useState(null),U=E.useRef(null),B=E.useRef({scale:1,offX:0,offY:0}),$=E.useRef({dragging:!1,sx:0,sy:0,startOffX:0,startOffY:0}),el=E.useCallback(()=>{if(z.current){const{scale:k,offX:I,offY:Z}=B.current;z.current.style.transform=`translate(${I}px, ${Z}px) scale(${k})`}},[]),ml=E.useCallback(k=>{const I=k.currentTarget;if(D({w:I.naturalWidth,h:I.naturalHeight}),O.current){const Z=O.current.clientWidth,F=O.current.clientHeight,R=Math.min(Z/I.naturalWidth,F/I.naturalHeight);B.current={scale:R,offX:(Z-I.naturalWidth*R)/2,offY:(F-I.naturalHeight*R)/2},el()}},[el]),gl=E.useCallback(k=>{var El;k.preventDefault();const I=(El=O.current)==null?void 0:El.getBoundingClientRect();if(!I)return;const Z=B.current,F=k.deltaY<0?1.1:.9,R=Math.min(Tm,Math.max(Em,Z.scale*F)),fl=R/Z.scale,Y=k.clientX-I.left,w=k.clientY-I.top;B.current={scale:R,offX:Y-(Y-Z.offX)*fl,offY:w-(w-Z.offY)*fl},el()},[el]),L=E.useCallback(k=>{if(k.button!==0)return;const I=B.current;$.current={dragging:!0,sx:k.clientX,sy:k.clientY,startOffX:I.offX,startOffY:I.offY}},[]);E.useEffect(()=>{const k=Z=>{const F=$.current;if(F.dragging&&(B.current.offX=F.startOffX+(Z.clientX-F.sx),B.current.offY=F.startOffY+(Z.clientY-F.sy),el()),O.current&&M.w>0&&U.current){const R=O.current.getBoundingClientRect(),fl=B.current,Y=hr(Z.clientX-R.left,Z.clientY-R.top,fl.scale,fl.offX,fl.offY,M.w,M.h);U.current.textContent=hf(Y.ns,Y.ew)}},I=()=>{$.current.dragging=!1};return window.addEventListener("mousemove",k),window.addEventListener("mouseup",I),()=>{window.removeEventListener("mousemove",k),window.removeEventListener("mouseup",I)}},[el,M.w,M.h]);const K=E.useRef(null);E.useEffect(()=>{if(!N||M.w===0||!O.current||K.current===N)return;const k=o.find(fl=>fl.character_name===N);if(!k)return;K.current=N;const{x:I,y:Z}=pu(k.ew,k.ns,M.w,M.h),F=O.current.getBoundingClientRect(),R=3;B.current={scale:Math.min(Tm,Math.max(Em,R)),offX:F.width/2-I*R,offY:F.height/2-Z*R},el()},[N,o,M.w,M.h,el]),E.useEffect(()=>{N||(K.current=null)},[N]);const Nl=E.useCallback((k,I,Z)=>{S(k?{x:I,y:Z,player:k}:null)},[]);return v.jsxs("div",{className:"ml-map-container",ref:O,onWheel:gl,onMouseDown:L,children:[v.jsxs("div",{ref:z,className:"ml-map-group",children:[v.jsx("img",{src:"/dereth.png",alt:"Dereth",className:"ml-map-img",onLoad:ml,draggable:!1}),M.w>0&&v.jsxs(v.Fragment,{children:[v.jsx(vr,{imgW:M.w,imgH:M.h,enabled:d}),v.jsx(Om,{imgW:M.w,imgH:M.h,getColor:_}),v.jsx(Dm,{players:o,imgW:M.w,imgH:M.h,getColor:_,onHover:Nl,onSelect:x,selectedPlayer:N}),v.jsx(gr,{imgW:M.w,imgH:M.h,enabled:j})]})]}),q&&v.jsxs("div",{className:"ml-tooltip",style:{left:q.x+12,top:q.y-10},children:[v.jsx("strong",{children:q.player.character_name}),v.jsx("br",{}),hf(q.player.ns,q.player.ew),v.jsx("br",{}),q.player.kills_per_hour," kph · ",(xl=q.player.kills)==null?void 0:xl.toLocaleString()," kills"]}),v.jsx("div",{className:"ml-coords",ref:U})]})},Nm=bu.memo(({player:o,vitals:_,color:x,onSelect:d,isSelected:j})=>{var q,S;const{openWindow:N}=zu(),O=(o.vt_state||"idle").toLowerCase(),z=O==="combat"||O==="hunt",M=(o.total_rares??0)>0?Math.round((o.total_kills??0)/(o.total_rares??1)).toLocaleString():null,D=o.character_name;return v.jsxs("li",{className:`ml-player-row ${j?"ml-player-selected":""}`,style:{borderLeftColor:x},children:[v.jsxs("div",{className:"ml-pr-header",onClick:d,children:[v.jsx("span",{className:"ml-pr-name",children:D}),v.jsx("span",{className:"ml-pr-coords",children:hf(o.ns,o.ew)})]}),v.jsxs("div",{className:"ml-pr-vitals",children:[v.jsx("div",{className:"ml-vital-bar hp",children:v.jsx("div",{className:"ml-vital-fill",style:{width:`${(_==null?void 0:_.health_percentage)??0}%`}})}),v.jsx("div",{className:"ml-vital-bar sta",children:v.jsx("div",{className:"ml-vital-fill",style:{width:`${(_==null?void 0:_.stamina_percentage)??0}%`}})}),v.jsx("div",{className:"ml-vital-bar mana",children:v.jsx("div",{className:"ml-vital-fill",style:{width:`${(_==null?void 0:_.mana_percentage)??0}%`}})})]}),v.jsxs("div",{className:"ml-pr-grid",children:[v.jsxs("span",{className:"ml-gs",title:"Session kills",children:["⚔️ ",((q=o.kills)==null?void 0:q.toLocaleString())??0]}),v.jsxs("span",{className:"ml-gs",title:"Total kills",children:["🏆 ",(o.total_kills??0).toLocaleString()]}),v.jsxs("span",{className:"ml-gs",title:"Kills per hour",children:[o.kills_per_hour??"0"," ",v.jsx("span",{className:"ml-suffix",children:"KPH"})]}),v.jsxs("span",{className:"ml-gs",title:"Rares (session / total)",children:["💎 ",o.session_rares??0," / ",o.total_rares??0]}),v.jsx("span",{className:"ml-gs",title:"Kills per rare",children:M?v.jsxs(v.Fragment,{children:["📊 ",M," ",v.jsx("span",{className:"ml-suffix",children:"KPR"})]}):""}),v.jsx("span",{className:`ml-meta-pill ${z?"active":O!=="idle"&&O!=="default"&&O!==""?"other":""}`,children:o.vt_state||"idle"}),v.jsxs("span",{className:"ml-gs",title:"Online time",children:["🕐 ",((S=o.onlinetime)==null?void 0:S.replace(/^00\./,""))??"--"]}),v.jsxs("span",{className:"ml-gs",title:"Deaths",children:["☠️ ",o.deaths??"0"]}),v.jsxs("span",{className:"ml-gs",title:"Prismatic tapers",children:[v.jsx("img",{src:"/prismatic-taper-icon.png",className:"ml-taper-icon",alt:""}),o.prismatic_taper_count??"0"]})]}),v.jsxs("div",{className:"ml-pr-buttons",children:[v.jsx("button",{className:"ml-btn accent",onClick:()=>N(`chat-${D}`,`Chat: ${D}`,D),children:"Chat"}),v.jsx("button",{className:"ml-btn accent",onClick:()=>N(`stats-${D}`,`Stats: ${D}`,D),children:"Stats"}),v.jsx("button",{className:"ml-btn accent",onClick:()=>N(`inv-${D}`,`Inventory: ${D}`,D),children:"Inv"}),v.jsx("button",{className:"ml-btn",onClick:()=>N(`char-${D}`,`Character: ${D}`,D),children:"Char"}),v.jsx("button",{className:"ml-btn",onClick:()=>N(`combat-${D}`,`Combat: ${D}`,D),children:"Combat"}),v.jsx("button",{className:"ml-btn",onClick:()=>N(`radar-${D}`,`Radar: ${D}`,D),children:"Radar"})]})]})});Nm.displayName="PlayerRow";const br=({players:o,vitals:_,getColor:x,onSelect:d,selectedPlayer:j})=>{const N=E.useRef(null),[O,z]=E.useState(!1),M=E.useCallback(()=>{N.current&&z(N.current.scrollTop>200)},[]);return v.jsxs("div",{style:{position:"relative",flex:1,minHeight:0},children:[v.jsx("ul",{className:"ml-player-list",ref:N,onScroll:M,children:o.map(D=>v.jsx(Nm,{player:D,vitals:_.get(D.character_name)??null,color:x(D.character_name),onSelect:()=>d(D.character_name),isSelected:j===D.character_name},D.character_name))}),O&&v.jsx("button",{onClick:()=>{var D;(D=N.current)==null||D.scrollTo({top:0,behavior:"smooth"})},style:{position:"absolute",bottom:8,right:8,width:28,height:28,borderRadius:"50%",background:"rgba(68,136,255,0.2)",border:"1px solid rgba(68,136,255,0.4)",color:"#6af",cursor:"pointer",fontSize:"0.8rem",display:"flex",alignItems:"center",justifyContent:"center"},children:"▲"})]})},zr=[{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"}],pr=({value:o,onChange:_})=>v.jsx("div",{className:"ml-sort-buttons",children:zr.map(x=>v.jsx("button",{className:`ml-sort-btn ${o===x.key?"active":""}`,onClick:()=>_(x.key),children:x.label},x.key))}),Tr=()=>{const{openWindow:o}=zu();return v.jsxs("div",{className:"ml-tool-links",children:[v.jsx("span",{className:"ml-tool-link",style:{cursor:"pointer"},onClick:()=>o("playerdash","Player Dashboard"),children:"👥 Dashboard"}),v.jsx("span",{className:"ml-tool-link",style:{cursor:"pointer"},onClick:()=>o("queststatus","Quest Status"),children:"📜 Quests"}),v.jsx("span",{className:"ml-tool-link",style:{cursor:"pointer"},onClick:()=>o("issues","Issues Board"),children:"📋 Issues"}),v.jsx("span",{className:"ml-tool-link",style:{cursor:"pointer"},onClick:()=>o("vitalsharing","Vital Sharing"),children:"🤝 Vitals"}),v.jsx("span",{className:"ml-tool-link",style:{cursor:"pointer"},onClick:()=>o("combatpicker","Combat Stats"),children:"⚔️ Combat"})]})},Er=({players:o,vitals:_,serverHealth:x,totalRares:d,totalKills:j,getColor:N,onSelectPlayer:O,showHeatmap:z,showPortals:M,onToggleHeatmap:D,onTogglePortals:q,version:S,selectedPlayer:U})=>{var k,I;const[B,$]=E.useState("name"),[el,ml]=E.useState(""),gl=E.useMemo(()=>o.reduce((Z,F)=>Z+(parseInt(F.kills_per_hour)||0),0),[o]),L=((k=x==null?void 0:x.status)==null?void 0:k.toLowerCase())==="online"||((I=x==null?void 0:x.status)==null?void 0:I.toLowerCase())==="up",K=E.useDeferredValue(o),Nl=E.useDeferredValue(_),xl=E.useMemo(()=>{let Z=[...K];switch(el&&(Z=Z.filter(F=>F.character_name.toLowerCase().startsWith(el.toLowerCase()))),B){case"kph":Z.sort((F,R)=>(parseInt(R.kills_per_hour)||0)-(parseInt(F.kills_per_hour)||0));break;case"skills":Z.sort((F,R)=>(R.kills||0)-(F.kills||0));break;case"srares":Z.sort((F,R)=>(R.session_rares??0)-(F.session_rares??0));break;case"tkills":Z.sort((F,R)=>(R.total_kills??0)-(F.total_kills??0));break;case"kpr":Z.sort((F,R)=>{const fl=(F.total_kills??0)/Math.max(1,F.total_rares??1),Y=(R.total_kills??0)/Math.max(1,R.total_rares??1);return fl-Y});break;default:Z.sort((F,R)=>F.character_name.localeCompare(R.character_name))}return Z},[K,B,el]);return v.jsxs("div",{className:"ml-sidebar",children:[S&&v.jsxs("div",{className:"ml-version",children:["v",S]}),v.jsx("div",{className:"ml-sidebar-header",children:v.jsxs("span",{className:"ml-sidebar-title",children:["Active Mosswart Enjoyers (",o.length,")"]})}),v.jsxs("div",{className:"ml-server-status",children:[v.jsx("span",{className:`ml-status-dot ${L?"online":"offline"}`}),v.jsxs("span",{className:"ml-status-text",children:["Coldeve ",L?"Online":"Offline"]}),(x==null?void 0:x.player_count)!=null&&v.jsxs("span",{className:"ml-status-detail",children:["👥 ",x.player_count]}),(x==null?void 0:x.latency_ms)!=null&&v.jsxs("span",{className:"ml-status-detail",children:[Math.round(x.latency_ms),"ms"]}),(x==null?void 0:x.uptime_seconds)!=null&&v.jsxs("span",{className:"ml-status-detail",children:["Up: ",Math.floor(x.uptime_seconds/3600),"h"]})]}),v.jsxs("div",{className:"ml-counters",children:[v.jsxs("div",{className:"ml-counter rares",children:[v.jsx("span",{className:"ml-counter-val",children:d}),v.jsx("span",{className:"ml-counter-lbl",children:"Rares"})]}),v.jsxs("div",{className:`ml-counter kph ${gl>5e3?"ultra":""}`,children:[v.jsx("span",{className:"ml-counter-val",children:gl.toLocaleString()}),v.jsx("span",{className:"ml-counter-lbl",children:"Server KPH"})]}),v.jsxs("div",{className:"ml-counter kills",children:[v.jsx("span",{className:"ml-counter-val",children:j.toLocaleString()}),v.jsx("span",{className:"ml-counter-lbl",children:"Kills"})]})]}),v.jsxs("div",{className:"ml-tool-links",children:[v.jsx("a",{href:"/inventory.html",target:"_blank",className:"ml-tool-link",children:"🔍 Inv Search"}),v.jsx("a",{href:"/suitbuilder.html",target:"_blank",className:"ml-tool-link",children:"🛡️ Suitbuilder"}),v.jsx("a",{href:"/debug.html",target:"_blank",className:"ml-tool-link",children:"🐛 Debug"})]}),v.jsx(Tr,{}),v.jsxs("div",{className:"ml-toggles",children:[v.jsxs("label",{className:"ml-toggle-label",children:[v.jsx("input",{type:"checkbox",checked:z,onChange:Z=>D(Z.target.checked)}),v.jsx("span",{children:"Spawn Heatmap"})]}),v.jsxs("label",{className:"ml-toggle-label",children:[v.jsx("input",{type:"checkbox",checked:M,onChange:Z=>q(Z.target.checked)}),v.jsx("span",{children:"Portals"})]})]}),v.jsx("div",{style:{borderTop:"1px solid #333",marginTop:4,paddingTop:4}}),v.jsx(pr,{value:B,onChange:$}),v.jsx("input",{className:"ml-filter",type:"text",placeholder:"Filter players...",value:el,onChange:Z=>ml(Z.target.value)}),v.jsx(br,{players:xl,vitals:Nl,getColor:N,onSelect:O,selectedPlayer:U})]})},Ar="modulepreload",Mr=function(o){return"/"+o},Am={},Ot=function(_,x,d){let j=Promise.resolve();if(x&&x.length>0){let O=function(D){return Promise.all(D.map(q=>Promise.resolve(q).then(S=>({status:"fulfilled",value:S}),S=>({status:"rejected",reason:S}))))};document.getElementsByTagName("link");const z=document.querySelector("meta[property=csp-nonce]"),M=(z==null?void 0:z.nonce)||(z==null?void 0:z.getAttribute("nonce"));j=O(x.map(D=>{if(D=Mr(D),D in Am)return;Am[D]=!0;const q=D.endsWith(".css"),S=q?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${D}"]${S}`))return;const U=document.createElement("link");if(U.rel=q?"stylesheet":Ar,q||(U.as="script"),U.crossOrigin="",U.href=D,M&&U.setAttribute("nonce",M),document.head.appendChild(U),q)return new Promise((B,$)=>{U.addEventListener("load",B),U.addEventListener("error",()=>$(new Error(`Unable to preload CSS for ${D}`)))})}))}function N(O){const z=new Event("vite:preloadError",{cancelable:!0});if(z.payload=O,window.dispatchEvent(z),!z.defaultPrevented)throw O}return j.then(O=>{for(const z of O||[])z.status==="rejected"&&N(z.reason);return _().catch(N)})},_r=({id:o,title:_,zIndex:x,width:d=700,height:j=340,children:N})=>{const{closeWindow:O,bringToFront:z}=zu(),M=E.useRef(null),D=E.useRef({dragging:!1,sx:0,sy:0,ox:0,oy:0}),q=E.useRef({resizing:!1,sx:0,sy:0,sw:0,sh:0}),S=E.useRef({x:420,y:10+Math.random()*40}),[U,B]=E.useState({w:d,h:j}),$=E.useCallback(ml=>{var L;ml.preventDefault(),z(o);const gl=(L=M.current)==null?void 0:L.getBoundingClientRect();gl&&(D.current={dragging:!0,sx:ml.clientX,sy:ml.clientY,ox:gl.left,oy:gl.top})},[o,z]),el=E.useCallback(ml=>{ml.preventDefault(),ml.stopPropagation(),q.current={resizing:!0,sx:ml.clientX,sy:ml.clientY,sw:U.w,sh:U.h}},[U.w,U.h]);return E.useEffect(()=>{const ml=L=>{const K=D.current;K.dragging&&M.current&&(S.current.x=K.ox+(L.clientX-K.sx),S.current.y=K.oy+(L.clientY-K.sy),M.current.style.left=`${S.current.x}px`,M.current.style.top=`${S.current.y}px`);const Nl=q.current;if(Nl.resizing){const xl=Math.max(300,Nl.sw+(L.clientX-Nl.sx)),k=Math.max(200,Nl.sh+(L.clientY-Nl.sy));B({w:xl,h:k})}},gl=()=>{D.current.dragging=!1,q.current.resizing=!1};return window.addEventListener("mousemove",ml),window.addEventListener("mouseup",gl),()=>{window.removeEventListener("mousemove",ml),window.removeEventListener("mouseup",gl)}},[]),v.jsxs("div",{ref:M,className:"ml-window",style:{zIndex:x,width:U.w,height:U.h,left:S.current.x,top:S.current.y},onMouseDown:()=>z(o),children:[v.jsxs("div",{className:"ml-window-header",onMouseDown:$,children:[v.jsx("span",{className:"ml-window-title",children:_}),v.jsx("button",{className:"ml-window-close",onClick:()=>O(o),children:"×"})]}),v.jsx("div",{className:"ml-window-content",children:N}),v.jsx("div",{className:"ml-window-resize",onMouseDown:el})]})},xr={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"},Um=50,jm=o=>`mo-chat-history-${o}`;function Dr(o){try{const _=localStorage.getItem(jm(o));return _?JSON.parse(_):[]}catch{return[]}}function Or(o,_){try{localStorage.setItem(jm(o),JSON.stringify(_.slice(-Um)))}catch{}}const Nr=({id:o,charName:_,zIndex:x,messages:d,socket:j})=>{const N=E.useRef(null),[O,z]=E.useState(""),[M,D]=E.useState(!1),q=E.useRef(Dr(_)),S=E.useRef(-1),U=E.useRef(""),B=E.useRef(!1);E.useEffect(()=>{const L=N.current;L&&(B.current?D(!0):(L.scrollTop=L.scrollHeight,D(!1)))},[d.length]);const $=E.useCallback(()=>{const L=N.current;if(!L)return;const K=L.scrollHeight-L.scrollTop-L.clientHeight<30;B.current=!K,K&&D(!1)},[]),el=E.useCallback(()=>{const L=N.current;L&&(L.scrollTop=L.scrollHeight,B.current=!1,D(!1))},[]),ml=E.useCallback(L=>{L.preventDefault();const K=O.trim();!K||!j||j.readyState!==WebSocket.OPEN||(j.send(JSON.stringify({player_name:_,command:K})),q.current.push(K),q.current.length>Um&&q.current.shift(),Or(_,q.current),S.current=-1,U.current="",z(""),B.current=!1)},[O,j,_]),gl=E.useCallback(L=>{const K=q.current;if(K.length!==0){if(L.key==="ArrowUp")L.preventDefault(),S.current===-1?(U.current=O,S.current=K.length-1):S.current>0&&S.current--,z(K[S.current]);else if(L.key==="ArrowDown"){if(L.preventDefault(),S.current===-1)return;S.currentv.jsx("div",{className:"ml-chat-line",style:{color:xr[L.color??2]??"#ddd"},children:L.text},K))}),M&&v.jsx("div",{onClick:el,style:{padding:"3px 0",textAlign:"center",fontSize:"0.65rem",color:"#6af",background:"#1a2a3a",cursor:"pointer",borderTop:"1px solid #334"},children:"▼ New messages below"}),v.jsx("form",{className:"ml-chat-form",onSubmit:ml,children:v.jsx("input",{className:"ml-chat-input",value:O,onChange:L=>z(L.target.value),onKeyDown:gl,placeholder:"Enter chat..."})})]})},Ur=E.lazy(()=>Ot(()=>import("./StatsWindow-C5XFDqVx.js"),__vite__mapDeps([0,1])).then(o=>({default:o.StatsWindow}))),jr=E.lazy(()=>Ot(()=>import("./CharacterWindow-DX4iez-v.js"),__vite__mapDeps([2,1])).then(o=>({default:o.CharacterWindow}))),Cr=E.lazy(()=>Ot(()=>import("./InventoryWindow-C9mxhtJV.js"),__vite__mapDeps([3,1])).then(o=>({default:o.InventoryWindow}))),Rr=E.lazy(()=>Ot(()=>import("./RadarWindow-BwlMNi8v.js"),__vite__mapDeps([4,1])).then(o=>({default:o.RadarWindow}))),Hr=E.lazy(()=>Ot(()=>import("./CombatStatsWindow-BOXaCmme.js"),__vite__mapDeps([5,1])).then(o=>({default:o.CombatStatsWindow}))),qr=E.lazy(()=>Ot(()=>import("./CombatPickerWindow-DMOcilt1.js"),__vite__mapDeps([6,1])).then(o=>({default:o.CombatPickerWindow}))),Br=E.lazy(()=>Ot(()=>import("./IssuesWindow-BspsADhQ.js"),__vite__mapDeps([7,1])).then(o=>({default:o.IssuesWindow}))),Yr=E.lazy(()=>Ot(()=>import("./VitalSharingWindow-CSqjZNf-.js"),__vite__mapDeps([8,1])).then(o=>({default:o.VitalSharingWindow}))),Xr=E.lazy(()=>Ot(()=>import("./QuestStatusWindow-C_sQPwJQ.js"),__vite__mapDeps([9,1])).then(o=>({default:o.QuestStatusWindow}))),Gr=E.lazy(()=>Ot(()=>import("./PlayerDashboardWindow-BfZp59uQ.js"),__vite__mapDeps([10,1])).then(o=>({default:o.PlayerDashboardWindow}))),Cm=bu.memo(({characters:o,chatMessages:_,nearbyObjects:x,inventoryVersion:d,equipmentCantrips:j,socket:N})=>{const{windows:O}=zu();return v.jsx(E.Suspense,{fallback:null,children:O.map(z=>{var q;const M=z.charName??"";switch(z.id.split("-")[0]){case"chat":return v.jsx(Nr,{id:z.id,charName:M,zIndex:z.zIndex,messages:_.get(M)??[],socket:N},z.id);case"stats":return v.jsx(Ur,{id:z.id,charName:M,zIndex:z.zIndex},z.id);case"char":return v.jsx(jr,{id:z.id,charName:M,zIndex:z.zIndex,vitals:((q=o.get(M))==null?void 0:q.vitals)??void 0},z.id);case"inv":return v.jsx(Cr,{id:z.id,charName:M,zIndex:z.zIndex,inventoryVersion:d,equipmentCantrips:j.get(M)},z.id);case"radar":return v.jsx(Rr,{id:z.id,charName:M,zIndex:z.zIndex,socket:N,radarData:x.get(M)??null},z.id);case"combat":return v.jsx(Hr,{id:z.id,charName:M,zIndex:z.zIndex},z.id);case"combatpicker":return v.jsx(qr,{id:z.id,zIndex:z.zIndex,characters:o},z.id);case"issues":return v.jsx(Br,{id:z.id,zIndex:z.zIndex},z.id);case"vitalsharing":return v.jsx(Yr,{id:z.id,zIndex:z.zIndex},z.id);case"queststatus":return v.jsx(Xr,{id:z.id,zIndex:z.zIndex},z.id);case"playerdash":return v.jsx(Gr,{id:z.id,zIndex:z.zIndex,characters:o},z.id);default:return null}})})});Cm.displayName="WindowRenderer";let Qr=0;const Zr=({recentRares:o})=>{const[_,x]=E.useState([]),[d,j]=E.useState(0),[N,O]=E.useState([]);E.useEffect(()=>{if(o.length>d&&d>0){const M=o.slice(0,o.length-d);for(const D of M){const q=++Qr;x(S=>[...S,{key:q,charName:D.character_name,rareName:D.name,exiting:!1}]),z();try{const S=new AudioContext,U=S.createOscillator(),B=S.createGain();U.connect(B),B.connect(S.destination),U.frequency.value=880,U.type="sine",B.gain.value=.3,U.start(),B.gain.exponentialRampToValueAtTime(.001,S.currentTime+.5),U.stop(S.currentTime+.5)}catch{}setTimeout(()=>{x(S=>S.map(U=>U.key===q?{...U,exiting:!0}:U)),setTimeout(()=>{x(S=>S.filter(U=>U.key!==q))},500)},6e3)}}j(o.length)},[o.length]);const z=E.useCallback(()=>{const M=Date.now(),D=["#FFD700","#FF4444","#FF8800","#AA44FF","#4488FF"],q=Array.from({length:30},(S,U)=>{const B=Math.PI*2*U/30+(Math.random()-.5)*.5,$=100+Math.random()*200;return{dx:Math.cos(B)*$,dy:Math.sin(B)*$-50,color:D[Math.floor(Math.random()*D.length)]}});O(S=>[...S,{id:M,particles:q}]),setTimeout(()=>O(S=>S.filter(U=>U.id!==M)),2200)},[]);return v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"ml-rare-notifications",children:_.map(M=>v.jsxs("div",{className:`ml-rare-notif ${M.exiting?"exiting":""}`,children:[v.jsx("div",{className:"ml-rare-notif-title",children:"🎆 LEGENDARY RARE! 🎆"}),v.jsx("div",{className:"ml-rare-notif-name",children:M.rareName}),v.jsx("div",{className:"ml-rare-notif-by",children:"found by"}),v.jsx("div",{className:"ml-rare-notif-char",children:M.charName})]},M.key))}),v.jsx("div",{className:"ml-fireworks",children:N.map(M=>v.jsx(bu.Fragment,{children:M.particles.map((D,q)=>v.jsx("div",{className:"ml-firework-particle",style:{left:"50%",top:"30%",backgroundColor:D.color,"--dx":`${D.dx}px`,"--dy":`${D.dy+200}px`}},q))},M.id))})]})},Mm=["#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 Vr(o){let _=0;for(let x=0;x{let j=o.current.get(d);return j||(j=_.current{const _=Lr(),[x,d]=E.useState(!1),[j,N]=E.useState(!1),[O,z]=E.useState(null),M=E.useMemo(()=>Array.from(o.characters.values()).filter(B=>B.telemetry).map(B=>B.telemetry),[o.characters]),D=E.useMemo(()=>new Map(Array.from(o.characters.values()).filter(B=>B.vitals).map(B=>[B.name,B.vitals])),[o.characters]),[q,S]=E.useState("");E.useEffect(()=>{fetch("/api/api-version",{credentials:"include"}).then(B=>B.json()).then(B=>S(B.version??"")).catch(()=>{})},[]);const U=E.useCallback(B=>{z($=>$===B?null:B)},[]);return v.jsx(mr,{children:v.jsxs("div",{className:"ml-layout",children:[v.jsx(Er,{players:M,vitals:D,serverHealth:o.serverHealth,totalRares:o.totalRares,totalKills:o.totalKills,getColor:_,onSelectPlayer:U,showHeatmap:x,showPortals:j,onToggleHeatmap:d,onTogglePortals:N,version:q,selectedPlayer:O}),v.jsx(Sr,{players:M,getColor:_,onSelectPlayer:U,showHeatmap:x,showPortals:j,selectedPlayer:O}),v.jsx(Cm,{characters:o.characters,chatMessages:o.chatMessages,nearbyObjects:o.nearbyObjects,inventoryVersion:o.inventoryVersion,equipmentCantrips:o.equipmentCantrips,socket:o.socketRef.current}),v.jsx(Zr,{recentRares:o.recentRares})]})})};function Jr(o){const _=E.useRef(null),x=E.useRef(0),d=E.useRef(o);d.current=o;const j=E.useCallback(()=>{var O;if(((O=_.current)==null?void 0:O.readyState)===WebSocket.OPEN)return;const N=new WebSocket(yr());_.current=N,N.addEventListener("message",z=>{try{const M=JSON.parse(z.data);d.current(M)}catch{}}),N.addEventListener("close",()=>{_.current=null,x.current=window.setTimeout(j,2e3)}),N.addEventListener("error",()=>{N.close()})},[]);return E.useEffect(()=>(j(),()=>{var N;clearTimeout(x.current),(N=_.current)==null||N.close(),_.current=null}),[j]),_}const wr=()=>za("/live"),Wr=()=>za("/combat-stats"),kr=()=>za("/server-health"),Fr=()=>za("/total-rares"),$r=()=>za("/total-kills");function Ir(){const[o,_]=E.useState(new Map),[x,d]=E.useState(null),[j,N]=E.useState(0),[O,z]=E.useState(0),[M,D]=E.useState([]),q=E.useRef(new Map),[S,U]=E.useState(0),[B,$]=E.useState(0),el=E.useRef(new Map),[ml,gl]=E.useState(0),[L,K]=E.useState(new Map),Nl=E.useRef(o);Nl.current=o;const xl=E.useCallback((R,fl)=>{_(Y=>{const w=new Map(Y),El=w.get(R)??{name:R,telemetry:null,vitals:null,combat:null,lastUpdate:0};return w.set(R,fl(El)),w})},[]),k=E.useCallback(R=>{var fl;if(R.type){if(R.type==="telemetry"){const Y=R;xl(Y.character_name,w=>({...w,telemetry:Y,lastUpdate:Date.now()}))}else if(R.type==="vitals"){const Y=R;xl(Y.character_name,w=>({...w,vitals:Y,lastUpdate:Date.now()}))}else if(R.type==="combat_stats"){const Y=R;xl(Y.character_name,w=>({...w,combat:Y,lastUpdate:Date.now()}))}else if(R.type==="rare"){const Y=R;D(w=>[Y,...w].slice(0,50))}else if(R.type==="inventory_delta")$(Y=>Y+1);else if(R.type==="equipment_cantrip_state"){const Y=R;el.current.set(Y.character_name,Y),gl(w=>w+1)}else if(R.type==="dungeon_map"){const Y=R;Y.landblock&&(window.__dungeonMapCache||(window.__dungeonMapCache={}),window.__dungeonMapCache[Y.landblock]=Y)}else if(R.type==="nearby_objects"){const Y=R;if(K(w=>{const El=new Map(w);return El.set(Y.character_name,Y),El}),Y.is_dungeon&&Y.landblock&&!((fl=window.__dungeonMapCache)!=null&&fl[Y.landblock])){const w=I.current;(w==null?void 0:w.readyState)===WebSocket.OPEN&&w.send(JSON.stringify({type:"request_dungeon_map",landblock:Y.landblock}))}}else if(R.type==="chat"){const Y=R,w=q.current.get(Y.character_name)??[];w.push({text:Y.text,color:Y.color,timestamp:Y.timestamp}),w.length>1e3&&w.splice(0,w.length-1e3),q.current.set(Y.character_name,w),U(El=>El+1)}}},[xl]),I=Jr(k);E.useEffect(()=>{const R=async()=>{try{const Y=await wr();_(w=>{var st;const El=new Map(w);for(const p of Y.players??[]){const C=El.get(p.character_name);El.set(p.character_name,{name:p.character_name,telemetry:p,vitals:(C==null?void 0:C.vitals)??null,combat:(C==null?void 0:C.combat)??null,lastUpdate:Date.now()})}for(const p of El.keys())(st=Y.players)!=null&&st.some(C=>C.character_name===p)||El.delete(p);return El})}catch{}};R();const fl=setInterval(R,5e3);return()=>clearInterval(fl)},[]),E.useEffect(()=>{const R=async()=>{try{const Y=await Wr();for(const w of Y.stats??[])xl(w.character_name,El=>({...El,combat:{...w,type:"combat_stats"}}))}catch{}};R();const fl=setInterval(R,3e4);return()=>clearInterval(fl)},[xl]),E.useEffect(()=>{const R=async()=>{try{d(await kr())}catch{}};R();const fl=setInterval(R,3e4);return()=>clearInterval(fl)},[]),E.useEffect(()=>{const R=async()=>{try{const[Y,w]=await Promise.all([Fr(),$r()]);N(Y.all_time??0),z(w.total??0)}catch{}};R();const fl=setInterval(R,3e5);return()=>clearInterval(fl)},[]);const Z=E.useMemo(()=>q.current,[S]),F=E.useMemo(()=>el.current,[ml]);return{characters:o,serverHealth:x,totalRares:j,totalKills:O,recentRares:M,chatMessages:Z,nearbyObjects:L,inventoryVersion:B,equipmentCantrips:F,socketRef:I}}function Pr(){const o=Ir();return v.jsx(Kr,{data:o})}dr.createRoot(document.getElementById("root")).render(v.jsx(E.StrictMode,{children:v.jsx(Pr,{})}));"serviceWorker"in navigator&&navigator.serviceWorker.register("/sw.js").catch(()=>{});export{_r as D,za as a,v as j,E as r,zu as u}; diff --git a/static/v2/assets/index-fhoLMRWN.js b/static/v2/assets/index-fhoLMRWN.js new file mode 100644 index 00000000..5845e0c5 --- /dev/null +++ b/static/v2/assets/index-fhoLMRWN.js @@ -0,0 +1,34 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/StatsWindow-CX6kEX-g.js","assets/react-yfL0ty4i.js","assets/CharacterWindow-CyX_tOIF.js","assets/InventoryWindow-YNou026w.js","assets/RadarWindow-zG0PV0Ia.js","assets/CombatStatsWindow-BduiqqZk.js","assets/CombatPickerWindow-NVeKtlGR.js","assets/IssuesWindow-BtrdDjRr.js","assets/VitalSharingWindow-CkWl7Mtm.js","assets/QuestStatusWindow-B4lCEc6-.js","assets/PlayerDashboardWindow-D5m2YCrZ.js"])))=>i.map(i=>d[i]); +import{r as _m,g as er,a as ur}from"./react-yfL0ty4i.js";(function(){const x=document.createElement("link").relList;if(x&&x.supports&&x.supports("modulepreload"))return;for(const C of document.querySelectorAll('link[rel="modulepreload"]'))d(C);new MutationObserver(C=>{for(const N of C)if(N.type==="childList")for(const O of N.addedNodes)O.tagName==="LINK"&&O.rel==="modulepreload"&&d(O)}).observe(document,{childList:!0,subtree:!0});function D(C){const N={};return C.integrity&&(N.integrity=C.integrity),C.referrerPolicy&&(N.referrerPolicy=C.referrerPolicy),C.crossOrigin==="use-credentials"?N.credentials="include":C.crossOrigin==="anonymous"?N.credentials="omit":N.credentials="same-origin",N}function d(C){if(C.ep)return;C.ep=!0;const N=D(C);fetch(C.href,N)}})();var sf={exports:{}},gu={};/** + * @license React + * react-jsx-runtime.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var vm;function nr(){if(vm)return gu;vm=1;var o=Symbol.for("react.transitional.element"),x=Symbol.for("react.fragment");function D(d,C,N){var O=null;if(N!==void 0&&(O=""+N),C.key!==void 0&&(O=""+C.key),"key"in C){N={};for(var j in C)j!=="key"&&(N[j]=C[j])}else N=C;return C=N.ref,{$$typeof:o,type:d,key:O,ref:C!==void 0?C:null,props:N}}return gu.Fragment=x,gu.jsx=D,gu.jsxs=D,gu}var gm;function cr(){return gm||(gm=1,sf.exports=nr()),sf.exports}var g=cr(),T=_m();const bu=er(T);var of={exports:{}},Su={},df={exports:{}},mf={};/** + * @license React + * scheduler.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Sm;function ir(){return Sm||(Sm=1,(function(o){function x(h,_){var B=h.length;h.push(_);l:for(;0>>1,ul=h[ml];if(0>>1;mlC(fl,B))qlC(Et,fl)?(h[ml]=Et,h[ql]=B,ml=ql):(h[ml]=fl,h[Tl]=B,ml=Tl);else if(qlC(Et,B))h[ml]=Et,h[ql]=B,ml=ql;else break l}}return _}function C(h,_){var B=h.sortIndex-_.sortIndex;return B!==0?B:h.id-_.id}if(o.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var N=performance;o.unstable_now=function(){return N.now()}}else{var O=Date,j=O.now();o.unstable_now=function(){return O.now()-j}}var b=[],M=[],q=1,z=null,U=3,H=!1,k=!1,tl=!1,dl=!1,gl=typeof setTimeout=="function"?setTimeout:null,Z=typeof clearTimeout=="function"?clearTimeout:null,L=typeof setImmediate<"u"?setImmediate:null;function Ol(h){for(var _=D(M);_!==null;){if(_.callback===null)d(M);else if(_.startTime<=h)d(M),_.sortIndex=_.expirationTime,x(b,_);else break;_=D(M)}}function Ll(h){if(tl=!1,Ol(h),!k)if(D(b)!==null)k=!0,w||(w=!0,El());else{var _=D(M);_!==null&&Al(Ll,_.startTime-h)}}var w=!1,F=-1,X=5,W=-1;function el(){return dl?!0:!(o.unstable_now()-Wh&&el());){var ml=z.callback;if(typeof ml=="function"){z.callback=null,U=z.priorityLevel;var ul=ml(z.expirationTime<=h);if(h=o.unstable_now(),typeof ul=="function"){z.callback=ul,Ol(h),_=!0;break t}z===D(b)&&d(b),Ol(h)}else d(b);z=D(b)}if(z!==null)_=!0;else{var zl=D(M);zl!==null&&Al(Ll,zl.startTime-h),_=!1}}break l}finally{z=null,U=B,H=!1}_=void 0}}finally{_?El():w=!1}}}var El;if(typeof L=="function")El=function(){L(Rl)};else if(typeof MessageChannel<"u"){var Ot=new MessageChannel,V=Ot.port2;Ot.port1.onmessage=Rl,El=function(){V.postMessage(null)}}else El=function(){gl(Rl,0)};function Al(h,_){F=gl(function(){h(o.unstable_now())},_)}o.unstable_IdlePriority=5,o.unstable_ImmediatePriority=1,o.unstable_LowPriority=4,o.unstable_NormalPriority=3,o.unstable_Profiling=null,o.unstable_UserBlockingPriority=2,o.unstable_cancelCallback=function(h){h.callback=null},o.unstable_forceFrameRate=function(h){0>h||125ml?(h.sortIndex=B,x(M,h),D(b)===null&&h===D(M)&&(tl?(Z(F),F=-1):tl=!0,Al(Ll,B-ml))):(h.sortIndex=ul,x(b,h),k||H||(k=!0,w||(w=!0,El()))),h},o.unstable_shouldYield=el,o.unstable_wrapCallback=function(h){var _=U;return function(){var B=U;U=_;try{return h.apply(this,arguments)}finally{U=B}}}})(mf)),mf}var bm;function fr(){return bm||(bm=1,df.exports=ir()),df.exports}/** + * @license React + * react-dom-client.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var zm;function sr(){if(zm)return Su;zm=1;var o=fr(),x=_m(),D=ur();function d(l){var t="https://react.dev/errors/"+l;if(1ul||(l.current=ml[ul],ml[ul]=null,ul--)}function fl(l,t){ul++,ml[ul]=l.current,l.current=t}var ql=zl(null),Et=zl(null),Wt=zl(null),Tu=zl(null);function Eu(l,t){switch(fl(Wt,t),fl(Et,l),fl(ql,null),t.nodeType){case 9:case 11:l=(l=t.documentElement)&&(l=l.namespaceURI)?Xd(l):0;break;default:if(l=t.tagName,t=t.namespaceURI)t=Xd(t),l=Gd(t,l);else switch(l){case"svg":l=1;break;case"math":l=2;break;default:l=0}}Tl(ql),fl(ql,l)}function Ga(){Tl(ql),Tl(Et),Tl(Wt)}function Vn(l){l.memoizedState!==null&&fl(Tu,l);var t=ql.current,a=Gd(t,l.type);t!==a&&(fl(Et,l),fl(ql,a))}function Au(l){Et.current===l&&(Tl(ql),Tl(Et)),Tu.current===l&&(Tl(Tu),hu._currentValue=B)}var Ln,rf;function pa(l){if(Ln===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);Ln=t&&t[1]||"",rf=-1)":-1u||f[e]!==y[u]){var p=` +`+f[e].replace(" at new "," at ");return l.displayName&&p.includes("")&&(p=p.replace("",l.displayName)),p}while(1<=e&&0<=u);break}}}finally{Kn=!1,Error.prepareStackTrace=a}return(a=l?l.displayName||l.name:"")?pa(a):""}function Rm(l,t){switch(l.tag){case 26:case 27:case 5:return pa(l.type);case 16:return pa("Lazy");case 13:return l.child!==t&&t!==null?pa("Suspense Fallback"):pa("Suspense");case 19:return pa("SuspenseList");case 0:case 15:return Jn(l.type,!1);case 11:return Jn(l.type.render,!1);case 1:return Jn(l.type,!0);case 31:return pa("Activity");default:return""}}function yf(l){try{var t="",a=null;do t+=Rm(l,a),a=l,l=l.return;while(l);return t}catch(e){return` +Error generating stack: `+e.message+` +`+e.stack}}var wn=Object.prototype.hasOwnProperty,Wn=o.unstable_scheduleCallback,kn=o.unstable_cancelCallback,Hm=o.unstable_shouldYield,qm=o.unstable_requestPaint,Pl=o.unstable_now,Bm=o.unstable_getCurrentPriorityLevel,vf=o.unstable_ImmediatePriority,gf=o.unstable_UserBlockingPriority,Mu=o.unstable_NormalPriority,Ym=o.unstable_LowPriority,Sf=o.unstable_IdlePriority,Xm=o.log,Gm=o.unstable_setDisableYieldValue,Me=null,lt=null;function kt(l){if(typeof Xm=="function"&&Gm(l),lt&&typeof lt.setStrictMode=="function")try{lt.setStrictMode(Me,l)}catch{}}var tt=Math.clz32?Math.clz32:Vm,Qm=Math.log,Zm=Math.LN2;function Vm(l){return l>>>=0,l===0?32:31-(Qm(l)/Zm|0)|0}var _u=256,xu=262144,Du=4194304;function Ta(l){var t=l&42;if(t!==0)return t;switch(l&-l){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 l&261888;case 262144:case 524288:case 1048576:case 2097152:return l&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return l&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return l}}function Ou(l,t,a){var e=l.pendingLanes;if(e===0)return 0;var u=0,n=l.suspendedLanes,c=l.pingedLanes;l=l.warmLanes;var i=e&134217727;return i!==0?(e=i&~n,e!==0?u=Ta(e):(c&=i,c!==0?u=Ta(c):a||(a=i&~l,a!==0&&(u=Ta(a))))):(i=e&~n,i!==0?u=Ta(i):c!==0?u=Ta(c):a||(a=e&~l,a!==0&&(u=Ta(a)))),u===0?0:t!==0&&t!==u&&(t&n)===0&&(n=u&-u,a=t&-t,n>=a||n===32&&(a&4194048)!==0)?t:u}function _e(l,t){return(l.pendingLanes&~(l.suspendedLanes&~l.pingedLanes)&t)===0}function Lm(l,t){switch(l){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 bf(){var l=Du;return Du<<=1,(Du&62914560)===0&&(Du=4194304),l}function Fn(l){for(var t=[],a=0;31>a;a++)t.push(l);return t}function xe(l,t){l.pendingLanes|=t,t!==268435456&&(l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0)}function Km(l,t,a,e,u,n){var c=l.pendingLanes;l.pendingLanes=a,l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0,l.expiredLanes&=a,l.entangledLanes&=a,l.errorRecoveryDisabledLanes&=a,l.shellSuspendCounter=0;var i=l.entanglements,f=l.expirationTimes,y=l.hiddenUpdates;for(a=c&~a;0"u")return null;try{return l.activeElement||l.body}catch{return l.body}}var $m=/[\n"\\]/g;function ot(l){return l.replace($m,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function ac(l,t,a,e,u,n,c,i){l.name="",c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"?l.type=c:l.removeAttribute("type"),t!=null?c==="number"?(t===0&&l.value===""||l.value!=t)&&(l.value=""+st(t)):l.value!==""+st(t)&&(l.value=""+st(t)):c!=="submit"&&c!=="reset"||l.removeAttribute("value"),t!=null?ec(l,c,st(t)):a!=null?ec(l,c,st(a)):e!=null&&l.removeAttribute("value"),u==null&&n!=null&&(l.defaultChecked=!!n),u!=null&&(l.checked=u&&typeof u!="function"&&typeof u!="symbol"),i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"?l.name=""+st(i):l.removeAttribute("name")}function jf(l,t,a,e,u,n,c,i){if(n!=null&&typeof n!="function"&&typeof n!="symbol"&&typeof n!="boolean"&&(l.type=n),t!=null||a!=null){if(!(n!=="submit"&&n!=="reset"||t!=null)){tc(l);return}a=a!=null?""+st(a):"",t=t!=null?""+st(t):a,i||t===l.value||(l.value=t),l.defaultValue=t}e=e??u,e=typeof e!="function"&&typeof e!="symbol"&&!!e,l.checked=i?l.checked:!!e,l.defaultChecked=!!e,c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(l.name=c),tc(l)}function ec(l,t,a){t==="number"&&ju(l.ownerDocument)===l||l.defaultValue===""+a||(l.defaultValue=""+a)}function Ja(l,t,a,e){if(l=l.options,t){t={};for(var u=0;u"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),fc=!1;if(jt)try{var Ue={};Object.defineProperty(Ue,"passive",{get:function(){fc=!0}}),window.addEventListener("test",Ue,Ue),window.removeEventListener("test",Ue,Ue)}catch{fc=!1}var $t=null,sc=null,Ru=null;function Xf(){if(Ru)return Ru;var l,t=sc,a=t.length,e,u="value"in $t?$t.value:$t.textContent,n=u.length;for(l=0;l=Re),Kf=" ",Jf=!1;function wf(l,t){switch(l){case"keyup":return M0.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Wf(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var Fa=!1;function x0(l,t){switch(l){case"compositionend":return Wf(t);case"keypress":return t.which!==32?null:(Jf=!0,Kf);case"textInput":return l=t.data,l===Kf&&Jf?null:l;default:return null}}function D0(l,t){if(Fa)return l==="compositionend"||!rc&&wf(l,t)?(l=Xf(),Ru=sc=$t=null,Fa=!1,l):null;switch(l){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:a,offset:t-l};l=e}l:{for(;a;){if(a.nextSibling){a=a.nextSibling;break l}a=a.parentNode}a=void 0}a=as(a)}}function us(l,t){return l&&t?l===t?!0:l&&l.nodeType===3?!1:t&&t.nodeType===3?us(l,t.parentNode):"contains"in l?l.contains(t):l.compareDocumentPosition?!!(l.compareDocumentPosition(t)&16):!1:!1}function ns(l){l=l!=null&&l.ownerDocument!=null&&l.ownerDocument.defaultView!=null?l.ownerDocument.defaultView:window;for(var t=ju(l.document);t instanceof l.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)l=t.contentWindow;else break;t=ju(l.document)}return t}function gc(l){var t=l&&l.nodeName&&l.nodeName.toLowerCase();return t&&(t==="input"&&(l.type==="text"||l.type==="search"||l.type==="tel"||l.type==="url"||l.type==="password")||t==="textarea"||l.contentEditable==="true")}var q0=jt&&"documentMode"in document&&11>=document.documentMode,$a=null,Sc=null,Ye=null,bc=!1;function cs(l,t,a){var e=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;bc||$a==null||$a!==ju(e)||(e=$a,"selectionStart"in e&&gc(e)?e={start:e.selectionStart,end:e.selectionEnd}:(e=(e.ownerDocument&&e.ownerDocument.defaultView||window).getSelection(),e={anchorNode:e.anchorNode,anchorOffset:e.anchorOffset,focusNode:e.focusNode,focusOffset:e.focusOffset}),Ye&&Be(Ye,e)||(Ye=e,e=Dn(Sc,"onSelect"),0>=c,u-=c,At=1<<32-tt(t)+u|a<J?(ll=Y,Y=null):ll=Y.sibling;var cl=v(m,Y,r[J],E);if(cl===null){Y===null&&(Y=ll);break}l&&Y&&cl.alternate===null&&t(m,Y),s=n(cl,s,J),nl===null?G=cl:nl.sibling=cl,nl=cl,Y=ll}if(J===r.length)return a(m,Y),al&&Rt(m,J),G;if(Y===null){for(;JJ?(ll=Y,Y=null):ll=Y.sibling;var ba=v(m,Y,cl.value,E);if(ba===null){Y===null&&(Y=ll);break}l&&Y&&ba.alternate===null&&t(m,Y),s=n(ba,s,J),nl===null?G=ba:nl.sibling=ba,nl=ba,Y=ll}if(cl.done)return a(m,Y),al&&Rt(m,J),G;if(Y===null){for(;!cl.done;J++,cl=r.next())cl=A(m,cl.value,E),cl!==null&&(s=n(cl,s,J),nl===null?G=cl:nl.sibling=cl,nl=cl);return al&&Rt(m,J),G}for(Y=e(Y);!cl.done;J++,cl=r.next())cl=S(Y,m,J,cl.value,E),cl!==null&&(l&&cl.alternate!==null&&Y.delete(cl.key===null?J:cl.key),s=n(cl,s,J),nl===null?G=cl:nl.sibling=cl,nl=cl);return l&&Y.forEach(function(ar){return t(m,ar)}),al&&Rt(m,J),G}function yl(m,s,r,E){if(typeof r=="object"&&r!==null&&r.type===tl&&r.key===null&&(r=r.props.children),typeof r=="object"&&r!==null){switch(r.$$typeof){case H:l:{for(var G=r.key;s!==null;){if(s.key===G){if(G=r.type,G===tl){if(s.tag===7){a(m,s.sibling),E=u(s,r.props.children),E.return=m,m=E;break l}}else if(s.elementType===G||typeof G=="object"&&G!==null&&G.$$typeof===X&&Ca(G)===s.type){a(m,s.sibling),E=u(s,r.props),Le(E,r),E.return=m,m=E;break l}a(m,s);break}else t(m,s);s=s.sibling}r.type===tl?(E=Da(r.props.children,m.mode,E,r.key),E.return=m,m=E):(E=Lu(r.type,r.key,r.props,null,m.mode,E),Le(E,r),E.return=m,m=E)}return c(m);case k:l:{for(G=r.key;s!==null;){if(s.key===G)if(s.tag===4&&s.stateNode.containerInfo===r.containerInfo&&s.stateNode.implementation===r.implementation){a(m,s.sibling),E=u(s,r.children||[]),E.return=m,m=E;break l}else{a(m,s);break}else t(m,s);s=s.sibling}E=_c(r,m.mode,E),E.return=m,m=E}return c(m);case X:return r=Ca(r),yl(m,s,r,E)}if(Al(r))return R(m,s,r,E);if(El(r)){if(G=El(r),typeof G!="function")throw Error(d(150));return r=G.call(r),Q(m,s,r,E)}if(typeof r.then=="function")return yl(m,s,$u(r),E);if(r.$$typeof===L)return yl(m,s,wu(m,r),E);Iu(m,r)}return typeof r=="string"&&r!==""||typeof r=="number"||typeof r=="bigint"?(r=""+r,s!==null&&s.tag===6?(a(m,s.sibling),E=u(s,r),E.return=m,m=E):(a(m,s),E=Mc(r,m.mode,E),E.return=m,m=E),c(m)):a(m,s)}return function(m,s,r,E){try{Ve=0;var G=yl(m,s,r,E);return fe=null,G}catch(Y){if(Y===ie||Y===ku)throw Y;var nl=et(29,Y,null,m.mode);return nl.lanes=E,nl.return=m,nl}finally{}}}var Ha=Os(!0),Ns=Os(!1),aa=!1;function Yc(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Xc(l,t){l=l.updateQueue,t.updateQueue===l&&(t.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,callbacks:null})}function ea(l){return{lane:l,tag:0,payload:null,callback:null,next:null}}function ua(l,t,a){var e=l.updateQueue;if(e===null)return null;if(e=e.shared,(il&2)!==0){var u=e.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),e.pending=t,t=Vu(l),hs(l,null,a),t}return Zu(l,e,t,a),Vu(l)}function Ke(l,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var e=t.lanes;e&=l.pendingLanes,a|=e,t.lanes=a,pf(l,a)}}function Gc(l,t){var a=l.updateQueue,e=l.alternate;if(e!==null&&(e=e.updateQueue,a===e)){var u=null,n=null;if(a=a.firstBaseUpdate,a!==null){do{var c={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};n===null?u=n=c:n=n.next=c,a=a.next}while(a!==null);n===null?u=n=t:n=n.next=t}else u=n=t;a={baseState:e.baseState,firstBaseUpdate:u,lastBaseUpdate:n,shared:e.shared,callbacks:e.callbacks},l.updateQueue=a;return}l=a.lastBaseUpdate,l===null?a.firstBaseUpdate=t:l.next=t,a.lastBaseUpdate=t}var Qc=!1;function Je(){if(Qc){var l=ce;if(l!==null)throw l}}function we(l,t,a,e){Qc=!1;var u=l.updateQueue;aa=!1;var n=u.firstBaseUpdate,c=u.lastBaseUpdate,i=u.shared.pending;if(i!==null){u.shared.pending=null;var f=i,y=f.next;f.next=null,c===null?n=y:c.next=y,c=f;var p=l.alternate;p!==null&&(p=p.updateQueue,i=p.lastBaseUpdate,i!==c&&(i===null?p.firstBaseUpdate=y:i.next=y,p.lastBaseUpdate=f))}if(n!==null){var A=u.baseState;c=0,p=y=f=null,i=n;do{var v=i.lane&-536870913,S=v!==i.lane;if(S?(P&v)===v:(e&v)===v){v!==0&&v===ne&&(Qc=!0),p!==null&&(p=p.next={lane:0,tag:i.tag,payload:i.payload,callback:null,next:null});l:{var R=l,Q=i;v=t;var yl=a;switch(Q.tag){case 1:if(R=Q.payload,typeof R=="function"){A=R.call(yl,A,v);break l}A=R;break l;case 3:R.flags=R.flags&-65537|128;case 0:if(R=Q.payload,v=typeof R=="function"?R.call(yl,A,v):R,v==null)break l;A=z({},A,v);break l;case 2:aa=!0}}v=i.callback,v!==null&&(l.flags|=64,S&&(l.flags|=8192),S=u.callbacks,S===null?u.callbacks=[v]:S.push(v))}else S={lane:v,tag:i.tag,payload:i.payload,callback:i.callback,next:null},p===null?(y=p=S,f=A):p=p.next=S,c|=v;if(i=i.next,i===null){if(i=u.shared.pending,i===null)break;S=i,i=S.next,S.next=null,u.lastBaseUpdate=S,u.shared.pending=null}}while(!0);p===null&&(f=A),u.baseState=f,u.firstBaseUpdate=y,u.lastBaseUpdate=p,n===null&&(u.shared.lanes=0),sa|=c,l.lanes=c,l.memoizedState=A}}function Us(l,t){if(typeof l!="function")throw Error(d(191,l));l.call(t)}function js(l,t){var a=l.callbacks;if(a!==null)for(l.callbacks=null,l=0;ln?n:8;var c=h.T,i={};h.T=i,ci(l,!1,t,a);try{var f=u(),y=h.S;if(y!==null&&y(i,f),f!==null&&typeof f=="object"&&typeof f.then=="function"){var p=K0(f,e);Fe(l,t,p,ft(l))}else Fe(l,t,e,ft(l))}catch(A){Fe(l,t,{then:function(){},status:"rejected",reason:A},ft())}finally{_.p=n,c!==null&&i.types!==null&&(c.types=i.types),h.T=c}}function $0(){}function ui(l,t,a,e){if(l.tag!==5)throw Error(d(476));var u=oo(l).queue;so(l,u,t,B,a===null?$0:function(){return mo(l),a(e)})}function oo(l){var t=l.memoizedState;if(t!==null)return t;t={memoizedState:B,baseState:B,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yt,lastRenderedState:B},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yt,lastRenderedState:a},next:null},l.memoizedState=t,l=l.alternate,l!==null&&(l.memoizedState=t),t}function mo(l){var t=oo(l);t.next===null&&(t=l.alternate.memoizedState),Fe(l,t.next.queue,{},ft())}function ni(){return Ql(hu)}function ho(){return Dl().memoizedState}function ro(){return Dl().memoizedState}function I0(l){for(var t=l.return;t!==null;){switch(t.tag){case 24:case 3:var a=ft();l=ea(a);var e=ua(t,l,a);e!==null&&(Il(e,t,a),Ke(e,t,a)),t={cache:Rc()},l.payload=t;return}t=t.return}}function P0(l,t,a){var e=ft();a={lane:e,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},sn(l)?vo(t,a):(a=Ec(l,t,a,e),a!==null&&(Il(a,l,e),go(a,t,e)))}function yo(l,t,a){var e=ft();Fe(l,t,a,e)}function Fe(l,t,a,e){var u={lane:e,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(sn(l))vo(t,u);else{var n=l.alternate;if(l.lanes===0&&(n===null||n.lanes===0)&&(n=t.lastRenderedReducer,n!==null))try{var c=t.lastRenderedState,i=n(c,a);if(u.hasEagerState=!0,u.eagerState=i,at(i,c))return Zu(l,t,u,0),vl===null&&Qu(),!1}catch{}finally{}if(a=Ec(l,t,u,e),a!==null)return Il(a,l,e),go(a,t,e),!0}return!1}function ci(l,t,a,e){if(e={lane:2,revertLane:Yi(),gesture:null,action:e,hasEagerState:!1,eagerState:null,next:null},sn(l)){if(t)throw Error(d(479))}else t=Ec(l,a,e,2),t!==null&&Il(t,l,2)}function sn(l){var t=l.alternate;return l===K||t!==null&&t===K}function vo(l,t){oe=tn=!0;var a=l.pending;a===null?t.next=t:(t.next=a.next,a.next=t),l.pending=t}function go(l,t,a){if((a&4194048)!==0){var e=t.lanes;e&=l.pendingLanes,a|=e,t.lanes=a,pf(l,a)}}var $e={readContext:Ql,use:un,useCallback:Ml,useContext:Ml,useEffect:Ml,useImperativeHandle:Ml,useLayoutEffect:Ml,useInsertionEffect:Ml,useMemo:Ml,useReducer:Ml,useRef:Ml,useState:Ml,useDebugValue:Ml,useDeferredValue:Ml,useTransition:Ml,useSyncExternalStore:Ml,useId:Ml,useHostTransitionStatus:Ml,useFormState:Ml,useActionState:Ml,useOptimistic:Ml,useMemoCache:Ml,useCacheRefresh:Ml};$e.useEffectEvent=Ml;var So={readContext:Ql,use:un,useCallback:function(l,t){return Kl().memoizedState=[l,t===void 0?null:t],l},useContext:Ql,useEffect:lo,useImperativeHandle:function(l,t,a){a=a!=null?a.concat([l]):null,cn(4194308,4,uo.bind(null,t,l),a)},useLayoutEffect:function(l,t){return cn(4194308,4,l,t)},useInsertionEffect:function(l,t){cn(4,2,l,t)},useMemo:function(l,t){var a=Kl();t=t===void 0?null:t;var e=l();if(qa){kt(!0);try{l()}finally{kt(!1)}}return a.memoizedState=[e,t],e},useReducer:function(l,t,a){var e=Kl();if(a!==void 0){var u=a(t);if(qa){kt(!0);try{a(t)}finally{kt(!1)}}}else u=t;return e.memoizedState=e.baseState=u,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:u},e.queue=l,l=l.dispatch=P0.bind(null,K,l),[e.memoizedState,l]},useRef:function(l){var t=Kl();return l={current:l},t.memoizedState=l},useState:function(l){l=Pc(l);var t=l.queue,a=yo.bind(null,K,t);return t.dispatch=a,[l.memoizedState,a]},useDebugValue:ai,useDeferredValue:function(l,t){var a=Kl();return ei(a,l,t)},useTransition:function(){var l=Pc(!1);return l=so.bind(null,K,l.queue,!0,!1),Kl().memoizedState=l,[!1,l]},useSyncExternalStore:function(l,t,a){var e=K,u=Kl();if(al){if(a===void 0)throw Error(d(407));a=a()}else{if(a=t(),vl===null)throw Error(d(349));(P&127)!==0||Ys(e,t,a)}u.memoizedState=a;var n={value:a,getSnapshot:t};return u.queue=n,lo(Gs.bind(null,e,n,l),[l]),e.flags|=2048,me(9,{destroy:void 0},Xs.bind(null,e,n,a,t),null),a},useId:function(){var l=Kl(),t=vl.identifierPrefix;if(al){var a=Mt,e=At;a=(e&~(1<<32-tt(e)-1)).toString(32)+a,t="_"+t+"R_"+a,a=an++,0<\/script>",n=n.removeChild(n.firstChild);break;case"select":n=typeof e.is=="string"?c.createElement("select",{is:e.is}):c.createElement("select"),e.multiple?n.multiple=!0:e.size&&(n.size=e.size);break;default:n=typeof e.is=="string"?c.createElement(u,{is:e.is}):c.createElement(u)}}n[Xl]=t,n[Jl]=e;l:for(c=t.child;c!==null;){if(c.tag===5||c.tag===6)n.appendChild(c.stateNode);else if(c.tag!==4&&c.tag!==27&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===t)break l;for(;c.sibling===null;){if(c.return===null||c.return===t)break l;c=c.return}c.sibling.return=c.return,c=c.sibling}t.stateNode=n;l:switch(Vl(n,u,e),u){case"button":case"input":case"select":case"textarea":e=!!e.autoFocus;break l;case"img":e=!0;break l;default:e=!1}e&&Gt(t)}}return bl(t),zi(t,t.type,l===null?null:l.memoizedProps,t.pendingProps,a),null;case 6:if(l&&t.stateNode!=null)l.memoizedProps!==e&&Gt(t);else{if(typeof e!="string"&&t.stateNode===null)throw Error(d(166));if(l=Wt.current,ee(t)){if(l=t.stateNode,a=t.memoizedProps,e=null,u=Gl,u!==null)switch(u.tag){case 27:case 5:e=u.memoizedProps}l[Xl]=t,l=!!(l.nodeValue===a||e!==null&&e.suppressHydrationWarning===!0||Bd(l.nodeValue,a)),l||la(t,!0)}else l=On(l).createTextNode(e),l[Xl]=t,t.stateNode=l}return bl(t),null;case 31:if(a=t.memoizedState,l===null||l.memoizedState!==null){if(e=ee(t),a!==null){if(l===null){if(!e)throw Error(d(318));if(l=t.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(d(557));l[Xl]=t}else Oa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;bl(t),l=!1}else a=Nc(),l!==null&&l.memoizedState!==null&&(l.memoizedState.hydrationErrors=a),l=!0;if(!l)return t.flags&256?(nt(t),t):(nt(t),null);if((t.flags&128)!==0)throw Error(d(558))}return bl(t),null;case 13:if(e=t.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(u=ee(t),e!==null&&e.dehydrated!==null){if(l===null){if(!u)throw Error(d(318));if(u=t.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(d(317));u[Xl]=t}else Oa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;bl(t),u=!1}else u=Nc(),l!==null&&l.memoizedState!==null&&(l.memoizedState.hydrationErrors=u),u=!0;if(!u)return t.flags&256?(nt(t),t):(nt(t),null)}return nt(t),(t.flags&128)!==0?(t.lanes=a,t):(a=e!==null,l=l!==null&&l.memoizedState!==null,a&&(e=t.child,u=null,e.alternate!==null&&e.alternate.memoizedState!==null&&e.alternate.memoizedState.cachePool!==null&&(u=e.alternate.memoizedState.cachePool.pool),n=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),n!==u&&(e.flags|=2048)),a!==l&&a&&(t.child.flags|=8192),rn(t,t.updateQueue),bl(t),null);case 4:return Ga(),l===null&&Zi(t.stateNode.containerInfo),bl(t),null;case 10:return qt(t.type),bl(t),null;case 19:if(Tl(xl),e=t.memoizedState,e===null)return bl(t),null;if(u=(t.flags&128)!==0,n=e.rendering,n===null)if(u)Pe(e,!1);else{if(_l!==0||l!==null&&(l.flags&128)!==0)for(l=t.child;l!==null;){if(n=ln(l),n!==null){for(t.flags|=128,Pe(e,!1),l=n.updateQueue,t.updateQueue=l,rn(t,l),t.subtreeFlags=0,l=a,a=t.child;a!==null;)rs(a,l),a=a.sibling;return fl(xl,xl.current&1|2),al&&Rt(t,e.treeForkCount),t.child}l=l.sibling}e.tail!==null&&Pl()>bn&&(t.flags|=128,u=!0,Pe(e,!1),t.lanes=4194304)}else{if(!u)if(l=ln(n),l!==null){if(t.flags|=128,u=!0,l=l.updateQueue,t.updateQueue=l,rn(t,l),Pe(e,!0),e.tail===null&&e.tailMode==="hidden"&&!n.alternate&&!al)return bl(t),null}else 2*Pl()-e.renderingStartTime>bn&&a!==536870912&&(t.flags|=128,u=!0,Pe(e,!1),t.lanes=4194304);e.isBackwards?(n.sibling=t.child,t.child=n):(l=e.last,l!==null?l.sibling=n:t.child=n,e.last=n)}return e.tail!==null?(l=e.tail,e.rendering=l,e.tail=l.sibling,e.renderingStartTime=Pl(),l.sibling=null,a=xl.current,fl(xl,u?a&1|2:a&1),al&&Rt(t,e.treeForkCount),l):(bl(t),null);case 22:case 23:return nt(t),Vc(),e=t.memoizedState!==null,l!==null?l.memoizedState!==null!==e&&(t.flags|=8192):e&&(t.flags|=8192),e?(a&536870912)!==0&&(t.flags&128)===0&&(bl(t),t.subtreeFlags&6&&(t.flags|=8192)):bl(t),a=t.updateQueue,a!==null&&rn(t,a.retryQueue),a=null,l!==null&&l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(a=l.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(t.flags|=2048),l!==null&&Tl(ja),null;case 24:return a=null,l!==null&&(a=l.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),qt(Nl),bl(t),null;case 25:return null;case 30:return null}throw Error(d(156,t.tag))}function uh(l,t){switch(Dc(t),t.tag){case 1:return l=t.flags,l&65536?(t.flags=l&-65537|128,t):null;case 3:return qt(Nl),Ga(),l=t.flags,(l&65536)!==0&&(l&128)===0?(t.flags=l&-65537|128,t):null;case 26:case 27:case 5:return Au(t),null;case 31:if(t.memoizedState!==null){if(nt(t),t.alternate===null)throw Error(d(340));Oa()}return l=t.flags,l&65536?(t.flags=l&-65537|128,t):null;case 13:if(nt(t),l=t.memoizedState,l!==null&&l.dehydrated!==null){if(t.alternate===null)throw Error(d(340));Oa()}return l=t.flags,l&65536?(t.flags=l&-65537|128,t):null;case 19:return Tl(xl),null;case 4:return Ga(),null;case 10:return qt(t.type),null;case 22:case 23:return nt(t),Vc(),l!==null&&Tl(ja),l=t.flags,l&65536?(t.flags=l&-65537|128,t):null;case 24:return qt(Nl),null;case 25:return null;default:return null}}function Zo(l,t){switch(Dc(t),t.tag){case 3:qt(Nl),Ga();break;case 26:case 27:case 5:Au(t);break;case 4:Ga();break;case 31:t.memoizedState!==null&&nt(t);break;case 13:nt(t);break;case 19:Tl(xl);break;case 10:qt(t.type);break;case 22:case 23:nt(t),Vc(),l!==null&&Tl(ja);break;case 24:qt(Nl)}}function lu(l,t){try{var a=t.updateQueue,e=a!==null?a.lastEffect:null;if(e!==null){var u=e.next;a=u;do{if((a.tag&l)===l){e=void 0;var n=a.create,c=a.inst;e=n(),c.destroy=e}a=a.next}while(a!==u)}}catch(i){ol(t,t.return,i)}}function ia(l,t,a){try{var e=t.updateQueue,u=e!==null?e.lastEffect:null;if(u!==null){var n=u.next;e=n;do{if((e.tag&l)===l){var c=e.inst,i=c.destroy;if(i!==void 0){c.destroy=void 0,u=t;var f=a,y=i;try{y()}catch(p){ol(u,f,p)}}}e=e.next}while(e!==n)}}catch(p){ol(t,t.return,p)}}function Vo(l){var t=l.updateQueue;if(t!==null){var a=l.stateNode;try{js(t,a)}catch(e){ol(l,l.return,e)}}}function Lo(l,t,a){a.props=Ba(l.type,l.memoizedProps),a.state=l.memoizedState;try{a.componentWillUnmount()}catch(e){ol(l,t,e)}}function tu(l,t){try{var a=l.ref;if(a!==null){switch(l.tag){case 26:case 27:case 5:var e=l.stateNode;break;case 30:e=l.stateNode;break;default:e=l.stateNode}typeof a=="function"?l.refCleanup=a(e):a.current=e}}catch(u){ol(l,t,u)}}function _t(l,t){var a=l.ref,e=l.refCleanup;if(a!==null)if(typeof e=="function")try{e()}catch(u){ol(l,t,u)}finally{l.refCleanup=null,l=l.alternate,l!=null&&(l.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(u){ol(l,t,u)}else a.current=null}function Ko(l){var t=l.type,a=l.memoizedProps,e=l.stateNode;try{l:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&e.focus();break l;case"img":a.src?e.src=a.src:a.srcSet&&(e.srcset=a.srcSet)}}catch(u){ol(l,l.return,u)}}function pi(l,t,a){try{var e=l.stateNode;_h(e,l.type,a,t),e[Jl]=t}catch(u){ol(l,l.return,u)}}function Jo(l){return l.tag===5||l.tag===3||l.tag===26||l.tag===27&&ra(l.type)||l.tag===4}function Ti(l){l:for(;;){for(;l.sibling===null;){if(l.return===null||Jo(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&l.tag!==18;){if(l.tag===27&&ra(l.type)||l.flags&2||l.child===null||l.tag===4)continue l;l.child.return=l,l=l.child}if(!(l.flags&2))return l.stateNode}}function Ei(l,t,a){var e=l.tag;if(e===5||e===6)l=l.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(l,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(l),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=Ut));else if(e!==4&&(e===27&&ra(l.type)&&(a=l.stateNode,t=null),l=l.child,l!==null))for(Ei(l,t,a),l=l.sibling;l!==null;)Ei(l,t,a),l=l.sibling}function yn(l,t,a){var e=l.tag;if(e===5||e===6)l=l.stateNode,t?a.insertBefore(l,t):a.appendChild(l);else if(e!==4&&(e===27&&ra(l.type)&&(a=l.stateNode),l=l.child,l!==null))for(yn(l,t,a),l=l.sibling;l!==null;)yn(l,t,a),l=l.sibling}function wo(l){var t=l.stateNode,a=l.memoizedProps;try{for(var e=l.type,u=t.attributes;u.length;)t.removeAttributeNode(u[0]);Vl(t,e,a),t[Xl]=l,t[Jl]=a}catch(n){ol(l,l.return,n)}}var Qt=!1,Cl=!1,Ai=!1,Wo=typeof WeakSet=="function"?WeakSet:Set,Yl=null;function nh(l,t){if(l=l.containerInfo,Ki=qn,l=ns(l),gc(l)){if("selectionStart"in l)var a={start:l.selectionStart,end:l.selectionEnd};else l:{a=(a=l.ownerDocument)&&a.defaultView||window;var e=a.getSelection&&a.getSelection();if(e&&e.rangeCount!==0){a=e.anchorNode;var u=e.anchorOffset,n=e.focusNode;e=e.focusOffset;try{a.nodeType,n.nodeType}catch{a=null;break l}var c=0,i=-1,f=-1,y=0,p=0,A=l,v=null;t:for(;;){for(var S;A!==a||u!==0&&A.nodeType!==3||(i=c+u),A!==n||e!==0&&A.nodeType!==3||(f=c+e),A.nodeType===3&&(c+=A.nodeValue.length),(S=A.firstChild)!==null;)v=A,A=S;for(;;){if(A===l)break t;if(v===a&&++y===u&&(i=c),v===n&&++p===e&&(f=c),(S=A.nextSibling)!==null)break;A=v,v=A.parentNode}A=S}a=i===-1||f===-1?null:{start:i,end:f}}else a=null}a=a||{start:0,end:0}}else a=null;for(Ji={focusedElem:l,selectionRange:a},qn=!1,Yl=t;Yl!==null;)if(t=Yl,l=t.child,(t.subtreeFlags&1028)!==0&&l!==null)l.return=t,Yl=l;else for(;Yl!==null;){switch(t=Yl,n=t.alternate,l=t.flags,t.tag){case 0:if((l&4)!==0&&(l=t.updateQueue,l=l!==null?l.events:null,l!==null))for(a=0;a title"))),Vl(n,e,a),n[Xl]=l,Bl(n),e=n;break l;case"link":var c=lm("link","href",u).get(e+(a.href||""));if(c){for(var i=0;iyl&&(c=yl,yl=Q,Q=c);var m=es(i,Q),s=es(i,yl);if(m&&s&&(S.rangeCount!==1||S.anchorNode!==m.node||S.anchorOffset!==m.offset||S.focusNode!==s.node||S.focusOffset!==s.offset)){var r=A.createRange();r.setStart(m.node,m.offset),S.removeAllRanges(),Q>yl?(S.addRange(r),S.extend(s.node,s.offset)):(r.setEnd(s.node,s.offset),S.addRange(r))}}}}for(A=[],S=i;S=S.parentNode;)S.nodeType===1&&A.push({element:S,left:S.scrollLeft,top:S.scrollTop});for(typeof i.focus=="function"&&i.focus(),i=0;ia?32:a,h.T=null,a=Ui,Ui=null;var n=da,c=Jt;if(Hl=0,ge=da=null,Jt=0,(il&6)!==0)throw Error(d(331));var i=il;if(il|=4,nd(n.current),ad(n,n.current,c,a),il=i,iu(0,!1),lt&&typeof lt.onPostCommitFiberRoot=="function")try{lt.onPostCommitFiberRoot(Me,n)}catch{}return!0}finally{_.p=u,h.T=e,Ed(l,t)}}function Md(l,t,a){t=mt(a,t),t=oi(l.stateNode,t,2),l=ua(l,t,2),l!==null&&(xe(l,2),xt(l))}function ol(l,t,a){if(l.tag===3)Md(l,l,a);else for(;t!==null;){if(t.tag===3){Md(t,l,a);break}else if(t.tag===1){var e=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof e.componentDidCatch=="function"&&(oa===null||!oa.has(e))){l=mt(a,l),a=_o(2),e=ua(t,a,2),e!==null&&(xo(a,e,t,l),xe(e,2),xt(e));break}}t=t.return}}function Hi(l,t,a){var e=l.pingCache;if(e===null){e=l.pingCache=new fh;var u=new Set;e.set(t,u)}else u=e.get(t),u===void 0&&(u=new Set,e.set(t,u));u.has(a)||(xi=!0,u.add(a),l=hh.bind(null,l,t,a),t.then(l,l))}function hh(l,t,a){var e=l.pingCache;e!==null&&e.delete(t),l.pingedLanes|=l.suspendedLanes&a,l.warmLanes&=~a,vl===l&&(P&a)===a&&(_l===4||_l===3&&(P&62914560)===P&&300>Pl()-Sn?(il&2)===0&&Se(l,0):Di|=a,ve===P&&(ve=0)),xt(l)}function _d(l,t){t===0&&(t=bf()),l=xa(l,t),l!==null&&(xe(l,t),xt(l))}function rh(l){var t=l.memoizedState,a=0;t!==null&&(a=t.retryLane),_d(l,a)}function yh(l,t){var a=0;switch(l.tag){case 31:case 13:var e=l.stateNode,u=l.memoizedState;u!==null&&(a=u.retryLane);break;case 19:e=l.stateNode;break;case 22:e=l.stateNode._retryCache;break;default:throw Error(d(314))}e!==null&&e.delete(t),_d(l,a)}function vh(l,t){return Wn(l,t)}var Mn=null,ze=null,qi=!1,_n=!1,Bi=!1,ha=0;function xt(l){l!==ze&&l.next===null&&(ze===null?Mn=ze=l:ze=ze.next=l),_n=!0,qi||(qi=!0,Sh())}function iu(l,t){if(!Bi&&_n){Bi=!0;do for(var a=!1,e=Mn;e!==null;){if(l!==0){var u=e.pendingLanes;if(u===0)var n=0;else{var c=e.suspendedLanes,i=e.pingedLanes;n=(1<<31-tt(42|l)+1)-1,n&=u&~(c&~i),n=n&201326741?n&201326741|1:n?n|2:0}n!==0&&(a=!0,Nd(e,n))}else n=P,n=Ou(e,e===vl?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),(n&3)===0||_e(e,n)||(a=!0,Nd(e,n));e=e.next}while(a);Bi=!1}}function gh(){xd()}function xd(){_n=qi=!1;var l=0;ha!==0&&Dh()&&(l=ha);for(var t=Pl(),a=null,e=Mn;e!==null;){var u=e.next,n=Dd(e,t);n===0?(e.next=null,a===null?Mn=u:a.next=u,u===null&&(ze=a)):(a=e,(l!==0||(n&3)!==0)&&(_n=!0)),e=u}Hl!==0&&Hl!==5||iu(l),ha!==0&&(ha=0)}function Dd(l,t){for(var a=l.suspendedLanes,e=l.pingedLanes,u=l.expirationTimes,n=l.pendingLanes&-62914561;0i)break;var p=f.transferSize,A=f.initiatorType;p&&Yd(A)&&(f=f.responseEnd,c+=p*(f"u"?null:document;function Fd(l,t,a){var e=pe;if(e&&typeof t=="string"&&t){var u=ot(t);u='link[rel="'+l+'"][href="'+u+'"]',typeof a=="string"&&(u+='[crossorigin="'+a+'"]'),kd.has(u)||(kd.add(u),l={rel:l,crossOrigin:a,href:t},e.querySelector(u)===null&&(t=e.createElement("link"),Vl(t,"link",l),Bl(t),e.head.appendChild(t)))}}function Bh(l){wt.D(l),Fd("dns-prefetch",l,null)}function Yh(l,t){wt.C(l,t),Fd("preconnect",l,t)}function Xh(l,t,a){wt.L(l,t,a);var e=pe;if(e&&l&&t){var u='link[rel="preload"][as="'+ot(t)+'"]';t==="image"&&a&&a.imageSrcSet?(u+='[imagesrcset="'+ot(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(u+='[imagesizes="'+ot(a.imageSizes)+'"]')):u+='[href="'+ot(l)+'"]';var n=u;switch(t){case"style":n=Te(l);break;case"script":n=Ee(l)}St.has(n)||(l=z({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:l,as:t},a),St.set(n,l),e.querySelector(u)!==null||t==="style"&&e.querySelector(du(n))||t==="script"&&e.querySelector(mu(n))||(t=e.createElement("link"),Vl(t,"link",l),Bl(t),e.head.appendChild(t)))}}function Gh(l,t){wt.m(l,t);var a=pe;if(a&&l){var e=t&&typeof t.as=="string"?t.as:"script",u='link[rel="modulepreload"][as="'+ot(e)+'"][href="'+ot(l)+'"]',n=u;switch(e){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":n=Ee(l)}if(!St.has(n)&&(l=z({rel:"modulepreload",href:l},t),St.set(n,l),a.querySelector(u)===null)){switch(e){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(mu(n)))return}e=a.createElement("link"),Vl(e,"link",l),Bl(e),a.head.appendChild(e)}}}function Qh(l,t,a){wt.S(l,t,a);var e=pe;if(e&&l){var u=La(e).hoistableStyles,n=Te(l);t=t||"default";var c=u.get(n);if(!c){var i={loading:0,preload:null};if(c=e.querySelector(du(n)))i.loading=5;else{l=z({rel:"stylesheet",href:l,"data-precedence":t},a),(a=St.get(n))&&Pi(l,a);var f=c=e.createElement("link");Bl(f),Vl(f,"link",l),f._p=new Promise(function(y,p){f.onload=y,f.onerror=p}),f.addEventListener("load",function(){i.loading|=1}),f.addEventListener("error",function(){i.loading|=2}),i.loading|=4,Un(c,t,e)}c={type:"stylesheet",instance:c,count:1,state:i},u.set(n,c)}}}function Zh(l,t){wt.X(l,t);var a=pe;if(a&&l){var e=La(a).hoistableScripts,u=Ee(l),n=e.get(u);n||(n=a.querySelector(mu(u)),n||(l=z({src:l,async:!0},t),(t=St.get(u))&&lf(l,t),n=a.createElement("script"),Bl(n),Vl(n,"link",l),a.head.appendChild(n)),n={type:"script",instance:n,count:1,state:null},e.set(u,n))}}function Vh(l,t){wt.M(l,t);var a=pe;if(a&&l){var e=La(a).hoistableScripts,u=Ee(l),n=e.get(u);n||(n=a.querySelector(mu(u)),n||(l=z({src:l,async:!0,type:"module"},t),(t=St.get(u))&&lf(l,t),n=a.createElement("script"),Bl(n),Vl(n,"link",l),a.head.appendChild(n)),n={type:"script",instance:n,count:1,state:null},e.set(u,n))}}function $d(l,t,a,e){var u=(u=Wt.current)?Nn(u):null;if(!u)throw Error(d(446));switch(l){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=Te(a.href),a=La(u).hoistableStyles,e=a.get(t),e||(e={type:"style",instance:null,count:0,state:null},a.set(t,e)),e):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){l=Te(a.href);var n=La(u).hoistableStyles,c=n.get(l);if(c||(u=u.ownerDocument||u,c={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},n.set(l,c),(n=u.querySelector(du(l)))&&!n._p&&(c.instance=n,c.state.loading=5),St.has(l)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},St.set(l,a),n||Lh(u,l,a,c.state))),t&&e===null)throw Error(d(528,""));return c}if(t&&e!==null)throw Error(d(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Ee(a),a=La(u).hoistableScripts,e=a.get(t),e||(e={type:"script",instance:null,count:0,state:null},a.set(t,e)),e):{type:"void",instance:null,count:0,state:null};default:throw Error(d(444,l))}}function Te(l){return'href="'+ot(l)+'"'}function du(l){return'link[rel="stylesheet"]['+l+"]"}function Id(l){return z({},l,{"data-precedence":l.precedence,precedence:null})}function Lh(l,t,a,e){l.querySelector('link[rel="preload"][as="style"]['+t+"]")?e.loading=1:(t=l.createElement("link"),e.preload=t,t.addEventListener("load",function(){return e.loading|=1}),t.addEventListener("error",function(){return e.loading|=2}),Vl(t,"link",a),Bl(t),l.head.appendChild(t))}function Ee(l){return'[src="'+ot(l)+'"]'}function mu(l){return"script[async]"+l}function Pd(l,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var e=l.querySelector('style[data-href~="'+ot(a.href)+'"]');if(e)return t.instance=e,Bl(e),e;var u=z({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return e=(l.ownerDocument||l).createElement("style"),Bl(e),Vl(e,"style",u),Un(e,a.precedence,l),t.instance=e;case"stylesheet":u=Te(a.href);var n=l.querySelector(du(u));if(n)return t.state.loading|=4,t.instance=n,Bl(n),n;e=Id(a),(u=St.get(u))&&Pi(e,u),n=(l.ownerDocument||l).createElement("link"),Bl(n);var c=n;return c._p=new Promise(function(i,f){c.onload=i,c.onerror=f}),Vl(n,"link",e),t.state.loading|=4,Un(n,a.precedence,l),t.instance=n;case"script":return n=Ee(a.src),(u=l.querySelector(mu(n)))?(t.instance=u,Bl(u),u):(e=a,(u=St.get(n))&&(e=z({},a),lf(e,u)),l=l.ownerDocument||l,u=l.createElement("script"),Bl(u),Vl(u,"link",e),l.head.appendChild(u),t.instance=u);case"void":return null;default:throw Error(d(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(e=t.instance,t.state.loading|=4,Un(e,a.precedence,l));return t.instance}function Un(l,t,a){for(var e=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=e.length?e[e.length-1]:null,n=u,c=0;c title"):null)}function Kh(l,t,a){if(a===1||t.itemProp!=null)return!1;switch(l){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return l=t.disabled,typeof t.precedence=="string"&&l==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function am(l){return!(l.type==="stylesheet"&&(l.state.loading&3)===0)}function Jh(l,t,a,e){if(a.type==="stylesheet"&&(typeof e.media!="string"||matchMedia(e.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var u=Te(e.href),n=t.querySelector(du(u));if(n){t=n._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(l.count++,l=Cn.bind(l),t.then(l,l)),a.state.loading|=4,a.instance=n,Bl(n);return}n=t.ownerDocument||t,e=Id(e),(u=St.get(u))&&Pi(e,u),n=n.createElement("link"),Bl(n);var c=n;c._p=new Promise(function(i,f){c.onload=i,c.onerror=f}),Vl(n,"link",e),a.instance=n}l.stylesheets===null&&(l.stylesheets=new Map),l.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(l.count++,a=Cn.bind(l),t.addEventListener("load",a),t.addEventListener("error",a))}}var tf=0;function wh(l,t){return l.stylesheets&&l.count===0&&Hn(l,l.stylesheets),0tf?50:800)+t);return l.unsuspend=a,function(){l.unsuspend=null,clearTimeout(e),clearTimeout(u)}}:null}function Cn(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Hn(this,this.stylesheets);else if(this.unsuspend){var l=this.unsuspend;this.unsuspend=null,l()}}}var Rn=null;function Hn(l,t){l.stylesheets=null,l.unsuspend!==null&&(l.count++,Rn=new Map,t.forEach(Wh,l),Rn=null,Cn.call(l))}function Wh(l,t){if(!(t.state.loading&4)){var a=Rn.get(l);if(a)var e=a.get(null);else{a=new Map,Rn.set(l,a);for(var u=l.querySelectorAll("link[data-precedence],style[data-precedence]"),n=0;n"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(o)}catch(x){console.error(x)}}return o(),of.exports=sr(),of.exports}var dr=or();const xm=T.createContext({windows:[],openWindow:()=>{},closeWindow:()=>{},bringToFront:()=>{}}),mr=({children:o})=>{const[x,D]=T.useState([]),d=T.useRef(1e4),C=T.useCallback((j,b,M)=>{D(q=>q.find(U=>U.id===j)?q.map(U=>U.id===j?{...U,zIndex:++d.current}:U):[...q,{id:j,title:b,charName:M,zIndex:++d.current}])},[]),N=T.useCallback(j=>{D(b=>b.filter(M=>M.id!==j))},[]),O=T.useCallback(j=>{D(b=>b.map(M=>M.id===j?{...M,zIndex:++d.current}:M))},[]);return g.jsx(xm.Provider,{value:{windows:x,openWindow:C,closeWindow:N,bringToFront:O},children:o})},zu=()=>T.useContext(xm),bt={west:-102.1,east:102.1,north:102.1,south:-102.1};function pu(o,x,D,d){const C=(o-bt.west)/(bt.east-bt.west)*D,N=(bt.north-x)/(bt.north-bt.south)*d;return{x:C,y:N}}function hr(o,x,D,d,C,N,O){const j=(o-d)/D,b=(x-C)/D,M=bt.west+j/N*(bt.east-bt.west),q=bt.north-b/O*(bt.north-bt.south);return{ew:M,ns:q}}function hf(o,x){const D=o>=0?"N":"S",d=x>=0?"E":"W";return`${Math.abs(o).toFixed(1)}${D}, ${Math.abs(x).toFixed(1)}${d}`}const Dm=bu.memo(({players:o,imgW:x,imgH:D,getColor:d,onHover:C,onSelect:N,selectedPlayer:O})=>{const{openWindow:j}=zu(),[b,M]=T.useState(null);T.useEffect(()=>{const z=()=>M(null);return b&&window.addEventListener("click",z),()=>window.removeEventListener("click",z)},[b]);const q=T.useMemo(()=>o.filter(z=>z.ew!==void 0&&z.ns!==void 0).map(z=>({...z,pos:pu(z.ew,z.ns,x,D),color:d(z.character_name)})),[o,x,D,d]);return g.jsxs("div",{className:"ml-dots-layer",children:[q.map(z=>g.jsx("div",{className:`ml-dot ${O===z.character_name?"ml-dot-selected":""}`,style:{left:z.pos.x,top:z.pos.y,backgroundColor:z.color},onMouseEnter:U=>{var k;const H=(k=U.currentTarget.closest(".ml-map-container"))==null?void 0:k.getBoundingClientRect();H&&C(z,U.clientX-H.left,U.clientY-H.top)},onMouseLeave:()=>C(null,0,0),onClick:()=>N(z.character_name),onDoubleClick:()=>j(`chat-${z.character_name}`,`Chat: ${z.character_name}`,z.character_name),onContextMenu:U=>{var gl;U.preventDefault();const H=z.character_name,k=(gl=U.currentTarget.closest(".ml-map-container"))==null?void 0:gl.getBoundingClientRect(),tl=k?U.clientX-k.left:U.clientX,dl=k?U.clientY-k.top:U.clientY;M({name:H,x:tl,y:dl})}},z.character_name)),b&&g.jsx("div",{style:{position:"fixed",left:b.x+410,top:b.y,background:"#1a1a1a",border:"1px solid #444",borderRadius:4,zIndex:9999,padding:"2px 0",fontSize:"0.75rem",boxShadow:"0 4px 12px rgba(0,0,0,0.5)",minWidth:120},children:[{label:"Chat",id:"chat"},{label:"Stats",id:"stats"},{label:"Inventory",id:"inv"},{label:"Character",id:"char"},{label:"Combat",id:"combat"},{label:"Radar",id:"radar"}].map(z=>g.jsx("div",{onClick:()=>{j(`${z.id}-${b.name}`,`${z.label}: ${b.name}`,b.name),M(null)},style:{padding:"4px 12px",cursor:"pointer",color:"#ccc"},onMouseEnter:U=>U.currentTarget.style.background="#333",onMouseLeave:U=>U.currentTarget.style.background="",children:z.label},z.id))})]})});Dm.displayName="PlayerDots";const rr="/api";async function za(o){const x=await fetch(`${rr}${o}`,{credentials:"include"});if(!x.ok)throw new Error(`API ${o}: ${x.status}`);return x.json()}function yr(){return`${location.protocol==="https:"?"wss:":"ws:"}//${location.host}/api/ws/live`}const Om=bu.memo(({imgW:o,imgH:x,getColor:D})=>{const[d,C]=T.useState([]);T.useEffect(()=>{const O=async()=>{try{const b=await za("/trails/?seconds=600");C(b.trails??[])}catch{}};O();const j=setInterval(O,2e3);return()=>clearInterval(j)},[]);const N=T.useMemo(()=>{const O={};for(const j of d){const{x:b,y:M}=pu(j.ew,j.ns,o,x);O[j.character_name]||(O[j.character_name]=[]),O[j.character_name].push(`${b},${M}`)}return Object.entries(O).filter(([,j])=>j.length>=2).map(([j,b])=>({name:j,points:b.join(" ")}))},[d,o,x]);return g.jsx("svg",{className:"ml-trails-svg",viewBox:`0 0 ${o} ${x}`,preserveAspectRatio:"none",children:N.map(O=>g.jsx("polyline",{points:O.points,stroke:D(O.name),fill:"none",strokeWidth:2,strokeOpacity:.7,strokeLinecap:"round",strokeLinejoin:"round"},O.name))})});Om.displayName="TrailsSVG";const vr=({imgW:o,imgH:x,enabled:D})=>{const d=T.useRef(null),[C,N]=T.useState([]);return T.useEffect(()=>{if(!D)return;(async()=>{try{const j=await za("/spawns/heatmap?hours=24&limit=50000");N(j.spawn_points??[])}catch{}})()},[D]),T.useEffect(()=>{const O=d.current;if(!O||!D||C.length===0||o===0)return;O.width=o,O.height=x;const j=O.getContext("2d");if(j){j.clearRect(0,0,o,x);for(const b of C){const{x:M,y:q}=pu(b.ew,b.ns,o,x),z=Math.max(5,Math.min(12,5+Math.sqrt(b.intensity*.5))),U=j.createRadialGradient(M,q,0,M,q,z);U.addColorStop(0,`rgba(255, 0, 0, ${Math.min(.9,b.intensity/40)})`),U.addColorStop(.6,`rgba(255, 100, 0, ${Math.min(.4,b.intensity/120)})`),U.addColorStop(1,"rgba(255, 150, 0, 0)"),j.fillStyle=U,j.fillRect(M-z,q-z,z*2,z*2)}}},[C,o,x,D]),D?g.jsx("canvas",{ref:d,className:"ml-heatmap-canvas"}):null},gr=({imgW:o,imgH:x,enabled:D})=>{const[d,C]=T.useState([]);T.useEffect(()=>{if(!D)return;const O=async()=>{try{const b=await za("/portals");C(b.portals??[])}catch{}};O();const j=setInterval(O,6e4);return()=>clearInterval(j)},[D]);const N=T.useMemo(()=>d.map(O=>({...O,pos:pu(O.coordinates.ew,O.coordinates.ns,o,x)})),[d,o,x]);return!D||N.length===0?null:g.jsx("div",{className:"ml-portals-layer",children:N.map((O,j)=>g.jsx("div",{className:"ml-portal-icon",style:{left:O.pos.x,top:O.pos.y},title:`${O.portal_name} (by ${O.discovered_by})`},j))})},Tm=20,Em=.3,Sr=({players:o,getColor:x,onSelectPlayer:D,showHeatmap:d,showPortals:C,selectedPlayer:N})=>{var Ll;const O=T.useRef(null),j=T.useRef(null),[b,M]=T.useState({w:0,h:0}),[q,z]=T.useState(null),U=T.useRef(null),H=T.useRef({scale:1,offX:0,offY:0}),k=T.useRef({dragging:!1,sx:0,sy:0,startOffX:0,startOffY:0}),tl=T.useCallback(()=>{if(j.current){const{scale:w,offX:F,offY:X}=H.current;j.current.style.transform=`translate(${F}px, ${X}px) scale(${w})`}},[]),dl=T.useCallback(w=>{const F=w.currentTarget;if(M({w:F.naturalWidth,h:F.naturalHeight}),O.current){const X=O.current.clientWidth,W=O.current.clientHeight,el=Math.min(X/F.naturalWidth,W/F.naturalHeight);H.current={scale:el,offX:(X-F.naturalWidth*el)/2,offY:(W-F.naturalHeight*el)/2},tl()}},[tl]),gl=T.useCallback(w=>{var V;w.preventDefault();const F=(V=O.current)==null?void 0:V.getBoundingClientRect();if(!F)return;const X=H.current,W=w.deltaY<0?1.1:.9,el=Math.min(Tm,Math.max(Em,X.scale*W)),Rl=el/X.scale,El=w.clientX-F.left,Ot=w.clientY-F.top;H.current={scale:el,offX:El-(El-X.offX)*Rl,offY:Ot-(Ot-X.offY)*Rl},tl()},[tl]),Z=T.useCallback(w=>{if(w.button!==0)return;const F=H.current;k.current={dragging:!0,sx:w.clientX,sy:w.clientY,startOffX:F.offX,startOffY:F.offY}},[]);T.useEffect(()=>{const w=X=>{const W=k.current;if(W.dragging&&(H.current.offX=W.startOffX+(X.clientX-W.sx),H.current.offY=W.startOffY+(X.clientY-W.sy),tl()),O.current&&b.w>0&&U.current){const el=O.current.getBoundingClientRect(),Rl=H.current,El=hr(X.clientX-el.left,X.clientY-el.top,Rl.scale,Rl.offX,Rl.offY,b.w,b.h);U.current.textContent=hf(El.ns,El.ew)}},F=()=>{k.current.dragging=!1};return window.addEventListener("mousemove",w),window.addEventListener("mouseup",F),()=>{window.removeEventListener("mousemove",w),window.removeEventListener("mouseup",F)}},[tl,b.w,b.h]);const L=T.useRef(null);T.useEffect(()=>{if(!N||b.w===0||!O.current||L.current===N)return;const w=o.find(Rl=>Rl.character_name===N);if(!w)return;L.current=N;const{x:F,y:X}=pu(w.ew,w.ns,b.w,b.h),W=O.current.getBoundingClientRect(),el=3;H.current={scale:Math.min(Tm,Math.max(Em,el)),offX:W.width/2-F*el,offY:W.height/2-X*el},tl()},[N,o,b.w,b.h,tl]),T.useEffect(()=>{N||(L.current=null)},[N]);const Ol=T.useCallback((w,F,X)=>{z(w?{x:F,y:X,player:w}:null)},[]);return g.jsxs("div",{className:"ml-map-container",ref:O,onWheel:gl,onMouseDown:Z,children:[g.jsxs("div",{ref:j,className:"ml-map-group",children:[g.jsx("img",{src:"/dereth.png",alt:"Dereth",className:"ml-map-img",onLoad:dl,draggable:!1}),b.w>0&&g.jsxs(g.Fragment,{children:[g.jsx(vr,{imgW:b.w,imgH:b.h,enabled:d}),g.jsx(Om,{imgW:b.w,imgH:b.h,getColor:x}),g.jsx(Dm,{players:o,imgW:b.w,imgH:b.h,getColor:x,onHover:Ol,onSelect:D,selectedPlayer:N}),g.jsx(gr,{imgW:b.w,imgH:b.h,enabled:C})]})]}),q&&g.jsxs("div",{className:"ml-tooltip",style:{left:q.x+12,top:q.y-10},children:[g.jsx("strong",{children:q.player.character_name}),g.jsx("br",{}),hf(q.player.ns,q.player.ew),g.jsx("br",{}),q.player.kills_per_hour," kph · ",(Ll=q.player.kills)==null?void 0:Ll.toLocaleString()," kills"]}),g.jsx("div",{className:"ml-coords",ref:U})]})},Nm=bu.memo(({player:o,vitals:x,color:D,onSelect:d,isSelected:C})=>{var q,z;const{openWindow:N}=zu(),O=(o.vt_state||"idle").toLowerCase(),j=O==="combat"||O==="hunt",b=(o.total_rares??0)>0?Math.round((o.total_kills??0)/(o.total_rares??1)).toLocaleString():null,M=o.character_name;return g.jsxs("li",{className:`ml-player-row ${C?"ml-player-selected":""}`,style:{borderLeftColor:D},children:[g.jsxs("div",{className:"ml-pr-header",onClick:d,children:[g.jsx("span",{className:"ml-pr-name",children:M}),g.jsx("span",{className:"ml-pr-coords",children:hf(o.ns,o.ew)})]}),g.jsxs("div",{className:"ml-pr-vitals",children:[g.jsx("div",{className:"ml-vital-bar hp",children:g.jsx("div",{className:"ml-vital-fill",style:{width:`${(x==null?void 0:x.health_percentage)??0}%`}})}),g.jsx("div",{className:"ml-vital-bar sta",children:g.jsx("div",{className:"ml-vital-fill",style:{width:`${(x==null?void 0:x.stamina_percentage)??0}%`}})}),g.jsx("div",{className:"ml-vital-bar mana",children:g.jsx("div",{className:"ml-vital-fill",style:{width:`${(x==null?void 0:x.mana_percentage)??0}%`}})})]}),g.jsxs("div",{className:"ml-pr-grid",children:[g.jsxs("span",{className:"ml-gs",title:"Session kills",children:["⚔️ ",((q=o.kills)==null?void 0:q.toLocaleString())??0]}),g.jsxs("span",{className:"ml-gs",title:"Total kills",children:["🏆 ",(o.total_kills??0).toLocaleString()]}),g.jsxs("span",{className:"ml-gs",title:"Kills per hour",children:[o.kills_per_hour??"0"," ",g.jsx("span",{className:"ml-suffix",children:"KPH"})]}),g.jsxs("span",{className:"ml-gs",title:"Rares (session / total)",children:["💎 ",o.session_rares??0," / ",o.total_rares??0]}),g.jsx("span",{className:"ml-gs",title:"Kills per rare",children:b?g.jsxs(g.Fragment,{children:["📊 ",b," ",g.jsx("span",{className:"ml-suffix",children:"KPR"})]}):""}),g.jsx("span",{className:`ml-meta-pill ${j?"active":O!=="idle"&&O!=="default"&&O!==""?"other":""}`,children:o.vt_state||"idle"}),g.jsxs("span",{className:"ml-gs",title:"Online time",children:["🕐 ",((z=o.onlinetime)==null?void 0:z.replace(/^00\./,""))??"--"]}),g.jsxs("span",{className:"ml-gs",title:"Deaths",children:["☠️ ",o.deaths??"0"]}),g.jsxs("span",{className:"ml-gs",title:"Prismatic tapers",children:[g.jsx("img",{src:"/prismatic-taper-icon.png",className:"ml-taper-icon",alt:""}),o.prismatic_taper_count??"0"]})]}),g.jsxs("div",{className:"ml-pr-buttons",children:[g.jsx("button",{className:"ml-btn accent",onClick:()=>N(`chat-${M}`,`Chat: ${M}`,M),children:"Chat"}),g.jsx("button",{className:"ml-btn accent",onClick:()=>N(`stats-${M}`,`Stats: ${M}`,M),children:"Stats"}),g.jsx("button",{className:"ml-btn accent",onClick:()=>N(`inv-${M}`,`Inventory: ${M}`,M),children:"Inv"}),g.jsx("button",{className:"ml-btn",onClick:()=>N(`char-${M}`,`Character: ${M}`,M),children:"Char"}),g.jsx("button",{className:"ml-btn",onClick:()=>N(`combat-${M}`,`Combat: ${M}`,M),children:"Combat"}),g.jsx("button",{className:"ml-btn",onClick:()=>N(`radar-${M}`,`Radar: ${M}`,M),children:"Radar"})]})]})});Nm.displayName="PlayerRow";const br=({players:o,vitals:x,getColor:D,onSelect:d,selectedPlayer:C})=>{const N=T.useRef(null),[O,j]=T.useState(!1),b=T.useCallback(()=>{N.current&&j(N.current.scrollTop>200)},[]);return g.jsxs("div",{style:{position:"relative",flex:1,minHeight:0},children:[g.jsx("ul",{className:"ml-player-list",ref:N,onScroll:b,children:o.map(M=>g.jsx(Nm,{player:M,vitals:x.get(M.character_name)??null,color:D(M.character_name),onSelect:()=>d(M.character_name),isSelected:C===M.character_name},M.character_name))}),O&&g.jsx("button",{onClick:()=>{var M;(M=N.current)==null||M.scrollTo({top:0,behavior:"smooth"})},style:{position:"absolute",bottom:8,right:8,width:28,height:28,borderRadius:"50%",background:"rgba(68,136,255,0.2)",border:"1px solid rgba(68,136,255,0.4)",color:"#6af",cursor:"pointer",fontSize:"0.8rem",display:"flex",alignItems:"center",justifyContent:"center"},children:"▲"})]})},zr=[{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"}],pr=({value:o,onChange:x})=>g.jsx("div",{className:"ml-sort-buttons",children:zr.map(D=>g.jsx("button",{className:`ml-sort-btn ${o===D.key?"active":""}`,onClick:()=>x(D.key),children:D.label},D.key))}),Tr=()=>{const{openWindow:o}=zu();return g.jsxs("div",{className:"ml-tool-links",children:[g.jsx("span",{className:"ml-tool-link",style:{cursor:"pointer"},onClick:()=>o("playerdash","Player Dashboard"),children:"👥 Dashboard"}),g.jsx("span",{className:"ml-tool-link",style:{cursor:"pointer"},onClick:()=>o("queststatus","Quest Status"),children:"📜 Quests"}),g.jsx("span",{className:"ml-tool-link",style:{cursor:"pointer"},onClick:()=>o("issues","Issues Board"),children:"📋 Issues"}),g.jsx("span",{className:"ml-tool-link",style:{cursor:"pointer"},onClick:()=>o("vitalsharing","Vital Sharing"),children:"🤝 Vitals"}),g.jsx("span",{className:"ml-tool-link",style:{cursor:"pointer"},onClick:()=>o("combatpicker","Combat Stats"),children:"⚔️ Combat"})]})},Er=({players:o,vitals:x,serverHealth:D,totalRares:d,totalKills:C,getColor:N,onSelectPlayer:O,showHeatmap:j,showPortals:b,onToggleHeatmap:M,onTogglePortals:q,version:z,selectedPlayer:U})=>{var w,F;const[H,k]=T.useState("name"),[tl,dl]=T.useState(""),gl=T.useMemo(()=>o.reduce((X,W)=>X+(parseInt(W.kills_per_hour)||0),0),[o]),Z=((w=D==null?void 0:D.status)==null?void 0:w.toLowerCase())==="online"||((F=D==null?void 0:D.status)==null?void 0:F.toLowerCase())==="up",L=T.useDeferredValue(o),Ol=T.useDeferredValue(x),Ll=T.useMemo(()=>{let X=[...L];switch(tl&&(X=X.filter(W=>W.character_name.toLowerCase().startsWith(tl.toLowerCase()))),H){case"kph":X.sort((W,el)=>(parseInt(el.kills_per_hour)||0)-(parseInt(W.kills_per_hour)||0));break;case"skills":X.sort((W,el)=>(el.kills||0)-(W.kills||0));break;case"srares":X.sort((W,el)=>(el.session_rares??0)-(W.session_rares??0));break;case"tkills":X.sort((W,el)=>(el.total_kills??0)-(W.total_kills??0));break;case"kpr":X.sort((W,el)=>{const Rl=(W.total_kills??0)/Math.max(1,W.total_rares??1),El=(el.total_kills??0)/Math.max(1,el.total_rares??1);return Rl-El});break;default:X.sort((W,el)=>W.character_name.localeCompare(el.character_name))}return X},[L,H,tl]);return g.jsxs("div",{className:"ml-sidebar",children:[z&&g.jsxs("div",{className:"ml-version",children:["v",z]}),g.jsx("div",{className:"ml-sidebar-header",children:g.jsxs("span",{className:"ml-sidebar-title",children:["Active Mosswart Enjoyers (",o.length,")"]})}),g.jsxs("div",{className:"ml-server-status",children:[g.jsx("span",{className:`ml-status-dot ${Z?"online":"offline"}`}),g.jsxs("span",{className:"ml-status-text",children:["Coldeve ",Z?"Online":"Offline"]}),(D==null?void 0:D.player_count)!=null&&g.jsxs("span",{className:"ml-status-detail",children:["👥 ",D.player_count]}),(D==null?void 0:D.latency_ms)!=null&&g.jsxs("span",{className:"ml-status-detail",children:[Math.round(D.latency_ms),"ms"]}),(D==null?void 0:D.uptime_seconds)!=null&&g.jsxs("span",{className:"ml-status-detail",children:["Up: ",Math.floor(D.uptime_seconds/3600),"h"]})]}),g.jsxs("div",{className:"ml-counters",children:[g.jsxs("div",{className:"ml-counter rares",children:[g.jsx("span",{className:"ml-counter-val",children:d}),g.jsx("span",{className:"ml-counter-lbl",children:"Rares"})]}),g.jsxs("div",{className:`ml-counter kph ${gl>5e3?"ultra":""}`,children:[g.jsx("span",{className:"ml-counter-val",children:gl.toLocaleString()}),g.jsx("span",{className:"ml-counter-lbl",children:"Server KPH"})]}),g.jsxs("div",{className:"ml-counter kills",children:[g.jsx("span",{className:"ml-counter-val",children:C.toLocaleString()}),g.jsx("span",{className:"ml-counter-lbl",children:"Kills"})]})]}),g.jsxs("div",{className:"ml-tool-links",children:[g.jsx("a",{href:"/inventory.html",target:"_blank",className:"ml-tool-link",children:"🔍 Inv Search"}),g.jsx("a",{href:"/suitbuilder.html",target:"_blank",className:"ml-tool-link",children:"🛡️ Suitbuilder"}),g.jsx("a",{href:"/debug.html",target:"_blank",className:"ml-tool-link",children:"🐛 Debug"})]}),g.jsx(Tr,{}),g.jsxs("div",{className:"ml-toggles",children:[g.jsxs("label",{className:"ml-toggle-label",children:[g.jsx("input",{type:"checkbox",checked:j,onChange:X=>M(X.target.checked)}),g.jsx("span",{children:"Spawn Heatmap"})]}),g.jsxs("label",{className:"ml-toggle-label",children:[g.jsx("input",{type:"checkbox",checked:b,onChange:X=>q(X.target.checked)}),g.jsx("span",{children:"Portals"})]})]}),g.jsx("div",{style:{borderTop:"1px solid #333",marginTop:4,paddingTop:4}}),g.jsx(pr,{value:H,onChange:k}),g.jsx("input",{className:"ml-filter",type:"text",placeholder:"Filter players...",value:tl,onChange:X=>dl(X.target.value)}),g.jsx(br,{players:Ll,vitals:Ol,getColor:N,onSelect:O,selectedPlayer:U})]})},Ar="modulepreload",Mr=function(o){return"/"+o},Am={},Dt=function(x,D,d){let C=Promise.resolve();if(D&&D.length>0){let O=function(M){return Promise.all(M.map(q=>Promise.resolve(q).then(z=>({status:"fulfilled",value:z}),z=>({status:"rejected",reason:z}))))};document.getElementsByTagName("link");const j=document.querySelector("meta[property=csp-nonce]"),b=(j==null?void 0:j.nonce)||(j==null?void 0:j.getAttribute("nonce"));C=O(D.map(M=>{if(M=Mr(M),M in Am)return;Am[M]=!0;const q=M.endsWith(".css"),z=q?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${M}"]${z}`))return;const U=document.createElement("link");if(U.rel=q?"stylesheet":Ar,q||(U.as="script"),U.crossOrigin="",U.href=M,b&&U.setAttribute("nonce",b),document.head.appendChild(U),q)return new Promise((H,k)=>{U.addEventListener("load",H),U.addEventListener("error",()=>k(new Error(`Unable to preload CSS for ${M}`)))})}))}function N(O){const j=new Event("vite:preloadError",{cancelable:!0});if(j.payload=O,window.dispatchEvent(j),!j.defaultPrevented)throw O}return C.then(O=>{for(const j of O||[])j.status==="rejected"&&N(j.reason);return x().catch(N)})},_r=({id:o,title:x,zIndex:D,width:d=700,height:C=340,children:N})=>{const{closeWindow:O,bringToFront:j}=zu(),b=T.useRef(null),M=T.useRef({dragging:!1,sx:0,sy:0,ox:0,oy:0}),q=T.useRef({resizing:!1,sx:0,sy:0,sw:0,sh:0}),z=T.useRef({x:420,y:10+Math.random()*40}),[U,H]=T.useState({w:d,h:C}),k=T.useCallback(dl=>{var Z;dl.preventDefault(),j(o);const gl=(Z=b.current)==null?void 0:Z.getBoundingClientRect();gl&&(M.current={dragging:!0,sx:dl.clientX,sy:dl.clientY,ox:gl.left,oy:gl.top})},[o,j]),tl=T.useCallback(dl=>{dl.preventDefault(),dl.stopPropagation(),q.current={resizing:!0,sx:dl.clientX,sy:dl.clientY,sw:U.w,sh:U.h}},[U.w,U.h]);return T.useEffect(()=>{const dl=Z=>{const L=M.current;L.dragging&&b.current&&(z.current.x=L.ox+(Z.clientX-L.sx),z.current.y=L.oy+(Z.clientY-L.sy),b.current.style.left=`${z.current.x}px`,b.current.style.top=`${z.current.y}px`);const Ol=q.current;if(Ol.resizing){const Ll=Math.max(300,Ol.sw+(Z.clientX-Ol.sx)),w=Math.max(200,Ol.sh+(Z.clientY-Ol.sy));H({w:Ll,h:w})}},gl=()=>{M.current.dragging=!1,q.current.resizing=!1};return window.addEventListener("mousemove",dl),window.addEventListener("mouseup",gl),()=>{window.removeEventListener("mousemove",dl),window.removeEventListener("mouseup",gl)}},[]),g.jsxs("div",{ref:b,className:"ml-window",style:{zIndex:D,width:U.w,height:U.h,left:z.current.x,top:z.current.y},onMouseDown:()=>j(o),children:[g.jsxs("div",{className:"ml-window-header",onMouseDown:k,children:[g.jsx("span",{className:"ml-window-title",children:x}),g.jsx("button",{className:"ml-window-close",onClick:()=>O(o),children:"×"})]}),g.jsx("div",{className:"ml-window-content",children:N}),g.jsx("div",{className:"ml-window-resize",onMouseDown:tl})]})},xr={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"},Um=50,jm=o=>`mo-chat-history-${o}`;function Dr(o){try{const x=localStorage.getItem(jm(o));return x?JSON.parse(x):[]}catch{return[]}}function Or(o,x){try{localStorage.setItem(jm(o),JSON.stringify(x.slice(-Um)))}catch{}}const Nr=({id:o,charName:x,zIndex:D,messages:d,socket:C})=>{const N=T.useRef(null),[O,j]=T.useState(""),[b,M]=T.useState(!1),q=T.useRef(Dr(x)),z=T.useRef(-1),U=T.useRef(""),H=T.useRef(!1);T.useEffect(()=>{const Z=N.current;Z&&(H.current?M(!0):(Z.scrollTop=Z.scrollHeight,M(!1)))},[d.length]);const k=T.useCallback(()=>{const Z=N.current;if(!Z)return;const L=Z.scrollHeight-Z.scrollTop-Z.clientHeight<30;H.current=!L,L&&M(!1)},[]),tl=T.useCallback(()=>{const Z=N.current;Z&&(Z.scrollTop=Z.scrollHeight,H.current=!1,M(!1))},[]),dl=T.useCallback(Z=>{Z.preventDefault();const L=O.trim();!L||!C||C.readyState!==WebSocket.OPEN||(C.send(JSON.stringify({player_name:x,command:L})),q.current.push(L),q.current.length>Um&&q.current.shift(),Or(x,q.current),z.current=-1,U.current="",j(""),H.current=!1)},[O,C,x]),gl=T.useCallback(Z=>{const L=q.current;if(L.length!==0){if(Z.key==="ArrowUp")Z.preventDefault(),z.current===-1?(U.current=O,z.current=L.length-1):z.current>0&&z.current--,j(L[z.current]);else if(Z.key==="ArrowDown"){if(Z.preventDefault(),z.current===-1)return;z.currentg.jsx("div",{className:"ml-chat-line",style:{color:xr[Z.color??2]??"#ddd"},children:Z.text},L))}),b&&g.jsx("div",{onClick:tl,style:{padding:"3px 0",textAlign:"center",fontSize:"0.65rem",color:"#6af",background:"#1a2a3a",cursor:"pointer",borderTop:"1px solid #334"},children:"▼ New messages below"}),g.jsx("form",{className:"ml-chat-form",onSubmit:dl,children:g.jsx("input",{className:"ml-chat-input",value:O,onChange:Z=>j(Z.target.value),onKeyDown:gl,placeholder:"Enter chat..."})})]})},Ur=T.lazy(()=>Dt(()=>import("./StatsWindow-CX6kEX-g.js"),__vite__mapDeps([0,1])).then(o=>({default:o.StatsWindow}))),jr=T.lazy(()=>Dt(()=>import("./CharacterWindow-CyX_tOIF.js"),__vite__mapDeps([2,1])).then(o=>({default:o.CharacterWindow}))),Cr=T.lazy(()=>Dt(()=>import("./InventoryWindow-YNou026w.js"),__vite__mapDeps([3,1])).then(o=>({default:o.InventoryWindow}))),Rr=T.lazy(()=>Dt(()=>import("./RadarWindow-zG0PV0Ia.js"),__vite__mapDeps([4,1])).then(o=>({default:o.RadarWindow}))),Hr=T.lazy(()=>Dt(()=>import("./CombatStatsWindow-BduiqqZk.js"),__vite__mapDeps([5,1])).then(o=>({default:o.CombatStatsWindow}))),qr=T.lazy(()=>Dt(()=>import("./CombatPickerWindow-NVeKtlGR.js"),__vite__mapDeps([6,1])).then(o=>({default:o.CombatPickerWindow}))),Br=T.lazy(()=>Dt(()=>import("./IssuesWindow-BtrdDjRr.js"),__vite__mapDeps([7,1])).then(o=>({default:o.IssuesWindow}))),Yr=T.lazy(()=>Dt(()=>import("./VitalSharingWindow-CkWl7Mtm.js"),__vite__mapDeps([8,1])).then(o=>({default:o.VitalSharingWindow}))),Xr=T.lazy(()=>Dt(()=>import("./QuestStatusWindow-B4lCEc6-.js"),__vite__mapDeps([9,1])).then(o=>({default:o.QuestStatusWindow}))),Gr=T.lazy(()=>Dt(()=>import("./PlayerDashboardWindow-D5m2YCrZ.js"),__vite__mapDeps([10,1])).then(o=>({default:o.PlayerDashboardWindow}))),Cm=bu.memo(({characters:o,chatMessages:x,nearbyObjects:D,inventoryVersion:d,equipmentCantrips:C,characterStats:N,socket:O})=>{const{windows:j}=zu();return g.jsx(T.Suspense,{fallback:null,children:j.map(b=>{var z;const M=b.charName??"";switch(b.id.split("-")[0]){case"chat":return g.jsx(Nr,{id:b.id,charName:M,zIndex:b.zIndex,messages:x.get(M)??[],socket:O},b.id);case"stats":return g.jsx(Ur,{id:b.id,charName:M,zIndex:b.zIndex},b.id);case"char":return g.jsx(jr,{id:b.id,charName:M,zIndex:b.zIndex,vitals:((z=o.get(M))==null?void 0:z.vitals)??void 0,liveStats:N.get(M)},b.id);case"inv":return g.jsx(Cr,{id:b.id,charName:M,zIndex:b.zIndex,inventoryVersion:d,equipmentCantrips:C.get(M)},b.id);case"radar":return g.jsx(Rr,{id:b.id,charName:M,zIndex:b.zIndex,socket:O,radarData:D.get(M)??null},b.id);case"combat":return g.jsx(Hr,{id:b.id,charName:M,zIndex:b.zIndex},b.id);case"combatpicker":return g.jsx(qr,{id:b.id,zIndex:b.zIndex,characters:o},b.id);case"issues":return g.jsx(Br,{id:b.id,zIndex:b.zIndex},b.id);case"vitalsharing":return g.jsx(Yr,{id:b.id,zIndex:b.zIndex},b.id);case"queststatus":return g.jsx(Xr,{id:b.id,zIndex:b.zIndex},b.id);case"playerdash":return g.jsx(Gr,{id:b.id,zIndex:b.zIndex,characters:o},b.id);default:return null}})})});Cm.displayName="WindowRenderer";let Qr=0;const Zr=({recentRares:o})=>{const[x,D]=T.useState([]),[d,C]=T.useState(0),[N,O]=T.useState([]);T.useEffect(()=>{if(o.length>d&&d>0){const b=o.slice(0,o.length-d);for(const M of b){const q=++Qr;D(z=>[...z,{key:q,charName:M.character_name,rareName:M.name,exiting:!1}]),j();try{const z=new AudioContext,U=z.createOscillator(),H=z.createGain();U.connect(H),H.connect(z.destination),U.frequency.value=880,U.type="sine",H.gain.value=.3,U.start(),H.gain.exponentialRampToValueAtTime(.001,z.currentTime+.5),U.stop(z.currentTime+.5)}catch{}setTimeout(()=>{D(z=>z.map(U=>U.key===q?{...U,exiting:!0}:U)),setTimeout(()=>{D(z=>z.filter(U=>U.key!==q))},500)},6e3)}}C(o.length)},[o.length]);const j=T.useCallback(()=>{const b=Date.now(),M=["#FFD700","#FF4444","#FF8800","#AA44FF","#4488FF"],q=Array.from({length:30},(z,U)=>{const H=Math.PI*2*U/30+(Math.random()-.5)*.5,k=100+Math.random()*200;return{dx:Math.cos(H)*k,dy:Math.sin(H)*k-50,color:M[Math.floor(Math.random()*M.length)]}});O(z=>[...z,{id:b,particles:q}]),setTimeout(()=>O(z=>z.filter(U=>U.id!==b)),2200)},[]);return g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"ml-rare-notifications",children:x.map(b=>g.jsxs("div",{className:`ml-rare-notif ${b.exiting?"exiting":""}`,children:[g.jsx("div",{className:"ml-rare-notif-title",children:"🎆 LEGENDARY RARE! 🎆"}),g.jsx("div",{className:"ml-rare-notif-name",children:b.rareName}),g.jsx("div",{className:"ml-rare-notif-by",children:"found by"}),g.jsx("div",{className:"ml-rare-notif-char",children:b.charName})]},b.key))}),g.jsx("div",{className:"ml-fireworks",children:N.map(b=>g.jsx(bu.Fragment,{children:b.particles.map((M,q)=>g.jsx("div",{className:"ml-firework-particle",style:{left:"50%",top:"30%",backgroundColor:M.color,"--dx":`${M.dx}px`,"--dy":`${M.dy+200}px`}},q))},b.id))})]})},Mm=["#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 Vr(o){let x=0;for(let D=0;D{let C=o.current.get(d);return C||(C=x.current{const x=Lr(),[D,d]=T.useState(!1),[C,N]=T.useState(!1),[O,j]=T.useState(null),b=T.useMemo(()=>Array.from(o.characters.values()).filter(H=>H.telemetry).map(H=>H.telemetry),[o.characters]),M=T.useMemo(()=>new Map(Array.from(o.characters.values()).filter(H=>H.vitals).map(H=>[H.name,H.vitals])),[o.characters]),[q,z]=T.useState("");T.useEffect(()=>{fetch("/api/api-version",{credentials:"include"}).then(H=>H.json()).then(H=>z(H.version??"")).catch(()=>{})},[]);const U=T.useCallback(H=>{j(k=>k===H?null:H)},[]);return g.jsx(mr,{children:g.jsxs("div",{className:"ml-layout",children:[g.jsx(Er,{players:b,vitals:M,serverHealth:o.serverHealth,totalRares:o.totalRares,totalKills:o.totalKills,getColor:x,onSelectPlayer:U,showHeatmap:D,showPortals:C,onToggleHeatmap:d,onTogglePortals:N,version:q,selectedPlayer:O}),g.jsx(Sr,{players:b,getColor:x,onSelectPlayer:U,showHeatmap:D,showPortals:C,selectedPlayer:O}),g.jsx(Cm,{characters:o.characters,chatMessages:o.chatMessages,nearbyObjects:o.nearbyObjects,inventoryVersion:o.inventoryVersion,equipmentCantrips:o.equipmentCantrips,characterStats:o.characterStats,socket:o.socketRef.current}),g.jsx(Zr,{recentRares:o.recentRares})]})})};function Jr(o){const x=T.useRef(null),D=T.useRef(0),d=T.useRef(o);d.current=o;const C=T.useCallback(()=>{var O;if(((O=x.current)==null?void 0:O.readyState)===WebSocket.OPEN)return;const N=new WebSocket(yr());x.current=N,N.addEventListener("message",j=>{try{const b=JSON.parse(j.data);d.current(b)}catch{}}),N.addEventListener("close",()=>{x.current=null,D.current=window.setTimeout(C,2e3)}),N.addEventListener("error",()=>{N.close()})},[]);return T.useEffect(()=>(C(),()=>{var N;clearTimeout(D.current),(N=x.current)==null||N.close(),x.current=null}),[C]),x}const wr=()=>za("/live"),Wr=()=>za("/combat-stats"),kr=()=>za("/server-health"),Fr=()=>za("/total-rares"),$r=()=>za("/total-kills");function Ir(){const[o,x]=T.useState(new Map),[D,d]=T.useState(null),[C,N]=T.useState(0),[O,j]=T.useState(0),[b,M]=T.useState([]),q=T.useRef(new Map),[z,U]=T.useState(0),[H,k]=T.useState(0),tl=T.useRef(new Map),[dl,gl]=T.useState(0),Z=T.useRef(new Map),[L,Ol]=T.useState(0),[Ll,w]=T.useState(new Map),F=T.useRef(o);F.current=o;const X=T.useCallback((V,Al)=>{x(h=>{const _=new Map(h),B=_.get(V)??{name:V,telemetry:null,vitals:null,combat:null,lastUpdate:0};return _.set(V,Al(B)),_})},[]),W=T.useCallback(V=>{var Al;if(V.type){if(V.type==="telemetry"){const h=V;X(h.character_name,_=>({..._,telemetry:h,lastUpdate:Date.now()}))}else if(V.type==="vitals"){const h=V;X(h.character_name,_=>({..._,vitals:h,lastUpdate:Date.now()}))}else if(V.type==="combat_stats"){const h=V;X(h.character_name,_=>({..._,combat:h,lastUpdate:Date.now()}))}else if(V.type==="rare"){const h=V;M(_=>[h,..._].slice(0,50))}else if(V.type==="inventory_delta")k(h=>h+1);else if(V.type==="character_stats"){const h=V;Z.current.set(h.character_name,V),Ol(_=>_+1)}else if(V.type==="equipment_cantrip_state"){const h=V;tl.current.set(h.character_name,h),gl(_=>_+1)}else if(V.type==="dungeon_map"){const h=V;h.landblock&&(window.__dungeonMapCache||(window.__dungeonMapCache={}),window.__dungeonMapCache[h.landblock]=h)}else if(V.type==="nearby_objects"){const h=V;if(w(_=>{const B=new Map(_);return B.set(h.character_name,h),B}),h.is_dungeon&&h.landblock&&!((Al=window.__dungeonMapCache)!=null&&Al[h.landblock])){const _=el.current;(_==null?void 0:_.readyState)===WebSocket.OPEN&&_.send(JSON.stringify({type:"request_dungeon_map",landblock:h.landblock}))}}else if(V.type==="chat"){const h=V,_=q.current.get(h.character_name)??[];_.push({text:h.text,color:h.color,timestamp:h.timestamp}),_.length>1e3&&_.splice(0,_.length-1e3),q.current.set(h.character_name,_),U(B=>B+1)}}},[X]),el=Jr(W);T.useEffect(()=>{const V=async()=>{try{const h=await wr();x(_=>{var ml;const B=new Map(_);for(const ul of h.players??[]){const zl=B.get(ul.character_name);B.set(ul.character_name,{name:ul.character_name,telemetry:ul,vitals:(zl==null?void 0:zl.vitals)??null,combat:(zl==null?void 0:zl.combat)??null,lastUpdate:Date.now()})}for(const ul of B.keys())(ml=h.players)!=null&&ml.some(zl=>zl.character_name===ul)||B.delete(ul);return B})}catch{}};V();const Al=setInterval(V,5e3);return()=>clearInterval(Al)},[]),T.useEffect(()=>{const V=async()=>{try{const h=await Wr();for(const _ of h.stats??[])X(_.character_name,B=>({...B,combat:{..._,type:"combat_stats"}}))}catch{}};V();const Al=setInterval(V,3e4);return()=>clearInterval(Al)},[X]),T.useEffect(()=>{const V=async()=>{try{d(await kr())}catch{}};V();const Al=setInterval(V,3e4);return()=>clearInterval(Al)},[]),T.useEffect(()=>{const V=async()=>{try{const[h,_]=await Promise.all([Fr(),$r()]);N(h.all_time??0),j(_.total??0)}catch{}};V();const Al=setInterval(V,3e5);return()=>clearInterval(Al)},[]);const Rl=T.useMemo(()=>q.current,[z]),El=T.useMemo(()=>tl.current,[dl]),Ot=T.useMemo(()=>Z.current,[L]);return{characters:o,serverHealth:D,totalRares:C,totalKills:O,recentRares:b,chatMessages:Rl,nearbyObjects:Ll,inventoryVersion:H,equipmentCantrips:El,characterStats:Ot,socketRef:el}}function Pr(){const o=Ir();return g.jsx(Kr,{data:o})}dr.createRoot(document.getElementById("root")).render(g.jsx(T.StrictMode,{children:g.jsx(Pr,{})}));"serviceWorker"in navigator&&navigator.serviceWorker.register("/sw.js").catch(()=>{});export{_r as D,za as a,g as j,T as r,zu as u}; diff --git a/static/v2/index.html b/static/v2/index.html index e7e705e0..5c80a960 100644 --- a/static/v2/index.html +++ b/static/v2/index.html @@ -8,7 +8,7 @@ - +