MosswartOverlord/static/assets/CharacterWindow-CKLgR9TL.js
Erik 9f7686681b feat: v2 React frontend is now primary at /
- v1 vanilla JS frontend moved to /classic (static/classic/)
- v2 React app now serves at / (root)
- Vite base changed from /v2/ to /
- Assets at /assets/, service worker at /sw.js
- /classic still works — all v1 files preserved with relative paths
- /v2 still works as before (build output unchanged)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 12:17:23 +02:00

1 line
14 KiB
JavaScript

import{r as f,a as Y,j as e,D as X}from"./index-DnlpBAAU.js";import"./react-DlyoauG8.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};