1import{j as e}from"./react-vendor-BR2bEzcq.js";import{l as s,m as a,M as t,Q as r,Z as l,a4 as i,a1 as n,f as c,L as o,a3 as m,$ as x,C as d,ab as p,T as h}from"./index-We6CJOzg.js";import{a as g}from"./axios-DY9rj2-D.js";import{g as y,R as u}from"./ResponseBadge-Bagloy9O.js";import{g as j}from"./useClassColors-0ReFtma0.js";import{n as b}from"./slotNormalizer-LfLlU44e.js";import{C as f}from"./CharacterName-RZSABTuA.js";import{A as N}from"./arrow-up-down-Bc3UoPYo.js";import{A as v}from"./arrow-up-htAiRC3B.js";import{A as w}from"./arrow-down-BYqjcFvA.js";import{M as k}from"./minus-4UkgDHwR.js";import{H as I}from"./hammer-BdRsdib4.js";import{A as C}from"./arrow-left-Dk9ydCFh.js";import{G as S}from"./gem-CN2cse71.js";import{S as D}from"./shield-check-C3H4N-LO.js";import{C as $}from"./calendar-DQKFALGA.js";import{C as T}from"./crown-BvuWOFSM.js";import{U as A}from"./user-CZciFs5h.js";import{V as L}from"./vote-CdbxuLnj.js";import"./sparkles-GpUrlamX.js";const R=s("dice-5",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["path",{d:"M16 8h.01",key:"cr5u4v"}],["path",{d:"M8 8h.01",key:"1e4136"}],["path",{d:"M8 16h.01",key:"18s6g9"}],["path",{d:"M16 16h.01",key:"1f9h7w"}],["path",{d:"M12 12h.01",key:"1mp3jc"}]]);function U(e){return e?e.replace(/\|A:[^|]*\|a/g,"").replace(/\|c[0-9a-fA-F]{8}/gi,"").replace(/\|r/g,"").replace(/\|h/g,"").trim():e}function z(e){if(!e)return null;const s=e.match(/\|A:Professions-ChatIcon-Quality-Tier(\d)/i);return s?parseInt(s[1],10):null}function V(e){if(!e)return null;const s=e.match(/\(?\b(\d{3,4})\b\)?/);return s?parseInt(s[1],10):null}const M={1:"T1",2:"T2",3:"T3",4:"T4",5:"Max"},q={1:"text-gray-400 border-gray-600",2:"text-green-400 border-green-700",3:"text-blue-400 border-blue-700",4:"text-purple-400 border-purple-700",5:"text-amber-400 border-amber-600"},G={poor:"border-gray-500",common:"border-gray-400",uncommon:"border-green-500",rare:"border-blue-500",epic:"border-purple-500",legendary:"border-amber-500",artifact:"border-amber-300",heirloom:"border-cyan-400"};function _({label:s,gearStr:l,gearName:i,gearIlvl:n,gearItem:c,index:o}){const m=z(i)??z(l),x=c?.name||(i?U(i):null)||function(e){if(!e)return null;const s=e.match(/\|h\[(.+?)\]\|h/);return s?U(s[1]):null}(l)||null,d=n||c?.itemLevel||V(l),p=x||(l?"Equipped Item":"Empty"),h=c?.iconUrl||(c?.icon?`https://wow.zamimg.com/images/wow/icons/large/${c.icon}.jpg`:null),g=G[c?.quality||"common"]||G.common;return e.jsxs(a.div,{initial:{opacity:0,x:-8},animate:{opacity:1,x:0},transition:{delay:.06*o,duration:.3},className:"flex items-center gap-2 sm:gap-3 p-2 sm:p-2.5 rounded-lg bg-gray-800/40 border border-gray-700/50",children:[e.jsxs("div",{className:`w-8 h-8 rounded-sm bg-gray-700/60 flex items-center justify-center shrink-0 border-2 ${h?g:"border-transparent"}`,children:[h?e.jsx("img",{src:h,alt:p,className:"w-full h-full rounded-sm object-cover",onError:e=>{e.currentTarget.style.display="none",e.currentTarget.nextSibling.style.display="flex"}}):null,e.jsx("div",{className:"w-full h-full rounded-sm flex items-center justify-center",style:{display:h?"none":"flex"},children:0===o?e.jsx(t,{className:"h-4 w-4 text-gray-400"}):e.jsx(r,{className:"h-4 w-4 text-gray-400"})})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs text-gray-500 uppercase tracking-wider",children:s}),m&&e.jsxs("span",{className:`inline-flex items-center gap-0.5 text-[10px] font-medium px-1.5 py-px rounded-sm border ${q[m]??q[5]}`,title:`Crafted item â Quality Tier ${m}`,children:[e.jsx(I,{className:"h-2.5 w-2.5"}),M[m]??`T${m}`]})]}),e.jsx("p",{className:"text-sm text-gray-300 truncate",title:p,children:p})]}),d&&e.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full bg-gray-700/80 text-gray-300 font-medium shrink-0",children:d})]})}function F({entry:s}){if(!s.gear1&&!s.gear2)return null;const t=s.metadata?.itemLevel||s.Item?.itemLevel||null,r=s.metadata?.winnerGear1ilvl||V(s.gear1);s.metadata?.winnerGear2ilvl||V(s.gear2);const l=s.metadata?.winnerIlvlDiff??(t&&r?t-r:null),i=l>0?v:l<0?w:k,n=l>0?"text-green-400":l<0?"text-red-400":"text-gray-400";return e.jsxs("div",{className:"glass-card p-3 sm:p-4 space-y-3",children:[e.jsxs("h2",{className:"text-base sm:text-lg font-semibold text-white flex items-center gap-2",children:[e.jsx(N,{className:"h-5 w-5 text-blue-400"}),"Gear Comparison"]}),e.jsxs("div",{className:"space-y-2",children:[s.gear1&&e.jsx(_,{label:"Slot 1",gearStr:s.gear1,gearName:s.metadata?.gear1Name,gearIlvl:s.metadata?.winnerGear1ilvl,gearItem:s.gear1Item,index:0}),s.gear2&&e.jsx(_,{label:"Slot 2",gearStr:s.gear2,gearName:s.metadata?.gear2Name,gearIlvl:s.metadata?.winnerGear2ilvl,gearItem:s.gear2Item,index:1})]}),null!==l&&e.jsxs(a.div,{initial:{opacity:0,scale:.95}
1,animate:{opacity:1,scale:1},transition:{delay:.15,type:"spring",stiffness:400,damping:25},className:"flex items-center justify-between p-3 rounded-lg bg-gray-800/60 border border-gray-700/40",children:[e.jsx("span",{className:"text-sm text-gray-400",children:"Upgrade Delta"}),e.jsxs("div",{className:`flex items-center gap-1.5 font-semibold ${n}`,children:[e.jsx(i,{className:"h-4 w-4"}),e.jsxs("span",{className:"text-lg",children:[l>0?"+":"",l]}),e.jsx("span",{className:"text-xs text-gray-500 font-normal",children:"ilvls"})]})]}),(s.subType||s.equipLoc)&&e.jsxs("div",{className:"flex items-center gap-4 text-xs text-gray-500 pt-1",children:[s.subType&&e.jsx("span",{children:s.subType}),s.equipLoc&&e.jsx("span",{children:b(s.equipLoc)})]})]})}const E={strength:{label:"Strength",color:"text-red-400"},agility:{label:"Agility",color:"text-yellow-400"},intellect:{label:"Intellect",color:"text-blue-400"},stamina:{label:"Stamina",color:"text-green-400"},critical_strike:{label:"Critical Strike",color:"text-orange-400"},crit:{label:"Critical Strike",color:"text-orange-400"},haste:{label:"Haste",color:"text-cyan-400"},mastery:{label:"Mastery",color:"text-purple-400"},versatility:{label:"Versatility",color:"text-emerald-400"},vers:{label:"Versatility",color:"text-emerald-400"},armor:{label:"Armor",color:"text-gray-400"},speed:{label:"Speed",color:"text-teal-400"},leech:{label:"Leech",color:"text-lime-400"},avoidance:{label:"Avoidance",color:"text-indigo-400"}},O=["strength","agility","intellect","stamina","critical_strike","crit","haste","mastery","versatility","vers","armor","speed","leech","avoidance"];function P({stats:s}){if(!s||"object"!=typeof s)return null;let a;return a=Array.isArray(s)?s.filter(e=>e.value&&e.value>0).map(e=>({key:e.type||e.name,value:e.value})):Object.entries(s).filter(([,e])=>e&&"number"==typeof e&&e>0).map(([e,s])=>({key:e.toLowerCase().replace(/\s+/g,"_"),value:s})),0===a.length?null:(a.sort((e,s)=>{const a=O.indexOf(e.key),t=O.indexOf(s.key);return(-1===a?999:a)-(-1===t?999:t)}),e.jsxs("div",{className:"glass-card p-4",children:[e.jsxs("h2",{className:"text-lg font-semibold text-white mb-3 flex items-center gap-2",children:[e.jsx(l,{className:"h-5 w-5 text-yellow-400"}),"Item Stats"]}),e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-x-4 sm:gap-x-6 gap-y-2 text-sm",children:a.map(({key:s,value:a})=>{const t=E[s]||{label:s.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase()),color:"text-gray-300"};return e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-gray-400 truncate",children:t.label}),e.jsxs("span",{className:`font-medium ${t.color}`,children:["+",a]})]},s)})})]}))}const B={bis:"BiS",major_upgrade:"Major Upgrade",minor_upgrade:"Minor Upgrade",pass:"Pass",veto:"Veto"},H={bis:"bg-amber-900/50 text-amber-300 border-amber-500/30",major_upgrade:"bg-green-900/50 text-green-300 border-green-500/30",minor_upgrade:"bg-blue-900/50 text-blue-300 border-blue-500/30",pass:"bg-gray-800/50 text-gray-400 border-gray-600/30",veto:"bg-red-900/50 text-red-300 border-red-500/30"};function K({vote:s,reasoning:a,count:t,size:r="sm"}){const l=B[s]||s||"Unknown",i=H[s]||"bg-gray-800/50 text-gray-400 border-gray-600/30",n={xs:"text-[10px] px-1.5 py-0.5",sm:"text-xs px-2 py-0.5",md:"text-sm px-2.5 py-1"};return e.jsxs("span",{className:`inline-flex items-center gap-1 rounded-full border font-medium ${i} ${n[r]||n.sm}`,title:a||void 0,children:[l,null!=t&&t>0&&e.jsxs("span",{className:"opacity-70 font-normal",children:["x",t]})]})}const Q={hidden:{opacity:0},visible:{opacity:1,transition:{staggerChildren:.04,delayChildren:.05}}},J={hidden:{opacity:0,x:-8},visible:{opacity:1,x:0,transition:{type:"spring",stiffness:400,damping:25}}},W={hidden:{opacity:0,scale:.8},visible:{opacity:1,scale:1,transition:{type:"spring",stiffness:500,damping:20}}},Y={initial:{opacity:0,y:16},animate:{opacity:1,y:0}},Z=(e=0)=>({delay:e,type:"spring",stiffness:400,damping:30}),X=e=>{if(!e)return"Unknown";try{return new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return e}},ee={14:"Normal",15:"Heroic",16:"Mythic",17:"LFR"};function se(){const{id:s}=i(),{loot:r}=n(),l=r.canEdit(),{data:N,isLoading:v,isError:w,error:k}=c({queryKey:["loot","detail",s],queryFn:async()=>(await g.get(`/api/loot/${s}`,{withCredentials:!0})).data,staleTime:3e5,enabled:!!s}),I=N?.itemID,{data:U}=c({queryKey:["droptimizer","interest",I],queryFn:async()=>(await g.get(`/api/loot/items/${I}/droptimizer-interest`,{withCredentials:!0})).data.data??[],enabled:!!I&&l,staleTime:3e5});if(v)return e.jsx(a.div,{initial:{opacity:0}
1,animate:{opacity:1},className:"flex items-center justify-center min-h-[400px]",children:e.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-2 spinner-primary"})});if(w)return e.jsxs(a.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.4},className:"max-w-4xl mx-auto p-4 space-y-4",children:[e.jsxs(o,{to:"/loot",className:"inline-flex items-center text-sm text-gray-400 hover:text-white transition-colors",children:[e.jsx(C,{className:"h-4 w-4 mr-1"}),"Back to Loot History"]}),e.jsxs(a.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},transition:{delay:.1,type:"spring",stiffness:400,damping:25},className:"glass-card p-8 text-center",children:[e.jsx("p",{className:"text-red-400 text-lg",children:"Failed to load loot entry"}),e.jsx("p",{className:"text-gray-500 text-sm mt-2",children:k?.response?.data?.error||k?.message||"Unknown error"})]})]});if(!N)return null;const z=N.Item?.name||N.itemName||"Unknown Item",V=N.Item?.quality||N.quality||"epic",M=m(V),q=N.Item?.icon||null,G=N.Item?.iconUrl||(q?`https://wow.zamimg.com/images/wow/icons/large/${q}.jpg`:null),_=N.metadata?.itemLevel||N.Item?.itemLevel||null,E=N.Item?.wowheadLink||(N.itemID?`https://www.wowhead.com/item=${N.itemID}`:null),O=N.difficulty||N.Instance?.difficulty||ee[N.metadata?.difficultyID]||null,B=O?x(O):null,H=N.metadata?.candidates||[],se=[...H].sort((e,s)=>y(e.response)-y(s.response)),te=N.metadata?.councilVotes||N.metadata?.votes||[],re=new Map;for(const e of H)e.response&&"Unknown"!==e.response&&e.responseID&&re.set(Number(e.responseID),e.response);const le=te.reduce((e,s)=>{let a;return a=s.vote||s.label?s.vote||s.label:Array.isArray(s.responses)&&s.responses.length>0?re.get(s.responses[0])||`Response ${s.responses[0]}`:"Unknown",e[a]=(e[a]||0)+1,e},{}),ie=(N.character?.characterName||"").toLowerCase();return e.jsxs(a.div,{initial:{opacity:0}
1,animate:{opacity:1},transition:{duration:.3},className:"max-w-4xl mx-auto px-3 sm:px-4 py-4 space-y-4 sm:space-y-6",children:[e.jsxs(a.nav,{initial:{opacity:0,x:-12},animate:{opacity:1,x:0},transition:{delay:.05,duration:.3},className:"flex items-center text-sm text-gray-400",children:[e.jsxs(o,{to:"/loot",className:"hover:text-white transition-colors flex items-center",children:[e.jsx(C,{className:"h-3.5 w-3.5 mr-1"}),"Loot History"]}),e.jsx(d,{className:"h-3.5 w-3.5 mx-2"}),e.jsx("span",{className:"text-white truncate",children:z})]}),e.jsxs(a.div,{...Y,transition:Z(.08),className:"glass-card p-4 sm:p-5 relative overflow-hidden",children:[e.jsx("div",{className:"absolute inset-0 opacity-[0.03] pointer-events-none",style:{background:`radial-gradient(ellipse at 20% 50%, ${M}, transparent 70%)`}}),e.jsxs("div",{className:"flex items-start gap-3 sm:gap-4 relative",children:[e.jsx(a.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{delay:.12,type:"spring",stiffness:500,damping:20},className:"w-12 h-12 sm:w-16 sm:h-16 rounded-lg border-2 flex items-center justify-center shrink-0",style:{borderColor:`${M}60`,backgroundColor:`${M}10`},children:G?e.jsx("img",{src:G,alt:z,className:"w-10 h-10 sm:w-14 sm:h-14 rounded-sm",loading:"lazy"}):e.jsx(S,{className:"h-6 w-6 sm:h-8 sm:w-8",style:{color:M}})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs(a.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{delay:.14,duration:.3},className:"flex items-center gap-2 flex-wrap",children:[E?e.jsx("a",{href:E,target:"_blank",rel:"noopener noreferrer",className:"text-lg sm:text-xl font-semibold hover:underline transition-colors",style:{color:M},children:z}):e.jsx("h1",{className:"text-lg sm:text-xl font-semibold",style:{color:M},children:z}),e.jsxs(a.div,{variants:Q,initial:"hidden",animate:"visible",className:"flex items-center gap-1.5 flex-wrap",children:[_&&e.jsxs(a.span,{variants:W,className:"px-2 py-0.5 bg-gray-700/80 text-gray-200 text-xs rounded-full font-medium",children:["ilvl ",_]}),N.metadata?.isBoe&&e.jsx(a.span,{variants:W,className:"px-2 py-0.5 bg-emerald-900/40 text-emerald-400 text-xs rounded-full font-medium border border-emerald-700/40",children:"BoE"}),O&&e.jsx(a.span,{variants:W,className:"px-2 py-0.5 text-xs rounded-full font-medium",style:{backgroundColor:`${B}20`,color:B,border:`1px solid ${B}40`},children:O}),N.itemStats?.slot&&e.jsx(a.span,{variants:W,className:"px-2 py-0.5 bg-indigo-900/30 text-indigo-300 text-xs rounded-full font-medium border border-indigo-700/30",children:b(N.itemStats.slot)}),N.itemStats?.itemSubClass&&e.jsx(a.span,{variants:W,className:"px-2 py-0.5 bg-gray-800/60 text-gray-300 text-xs rounded-full font-medium border border-gray-700/30",children:N.itemStats.itemSubClass}),N.dropSources?.[0]?.dropChance&&e.jsxs(a.span,{variants:W,className:"px-2 py-0.5 bg-cyan-900/30 text-cyan-300 text-xs rounded-full font-medium border border-cyan-700/30",children:["~",N.dropSources[0].dropChance,"% drop"]})]}),N.itemStats?.classRestrictions?.length>0&&e.jsxs(a.div,{initial:{opacity:0}
1,animate:{opacity:1},transition:{delay:.18,duration:.3},className:"flex items-center gap-1 mt-1.5 flex-wrap",children:[e.jsx("span",{className:"text-[10px] text-gray-500 uppercase tracking-wider mr-1",children:"Classes:"}),N.itemStats.classRestrictions.map(s=>e.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded-sm",style:{color:j(s),backgroundColor:`${j(s)}12`},children:s},s))]})]}),e.jsxs(a.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.2,duration:.4},className:"flex items-center gap-2 sm:gap-4 mt-2 text-xs sm:text-sm text-gray-400 flex-wrap",children:[N.instance&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(D,{className:"h-4 w-4"}),N.instance]}),N.boss&&N.boss!==N.instance&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(t,{className:"h-3.5 w-3.5"}),N.boss]}),N.date&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx($,{className:"h-4 w-4"}),X(N.date),N.time&&e.jsx("span",{className:"text-gray-500 ml-1",children:N.time})]})]})]})]})]}),e.jsxs(a.section,{...Y,transition:Z(.12),className:"glass-card p-4",children:[e.jsxs("h2",{className:"text-lg font-semibold text-white mb-3 flex items-center gap-2",children:[e.jsx(T,{className:"h-5 w-5 text-yellow-400"}),"Award Context"]}),e.jsxs(a.div,{variants:Q,initial:"hidden",animate:"visible",className:"grid grid-cols-2 md:grid-cols-3 gap-4 text-sm",children:[e.jsxs(a.div,{variants:J,children:[e.jsx("span",{className:"text-gray-500 block mb-1 text-xs uppercase tracking-wider",children:"Response"}),e.jsx(u,{response:N.response,awardReason:N.metadata?.awardReason||"Auto-Assigned",votes:N.votes,size:"md"})]}),e.jsxs(a.div,{variants:J,children:[e.jsx("span",{className:"text-gray-500 block mb-1 text-xs uppercase tracking-wider",children:"Awarded To"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(A,{className:"h-4 w-4 text-gray-500"}),e.jsx(f,{name:N.character?.characterName||N.owner||"Unknown",className:N.character?.class,realm:N.character?.server,linkTo:N.character?.id?`/characters/${N.character.id}`:void 0})]})]}),N.isAwardReason&&N.metadata?.awardReason&&e.jsxs(a.div,{variants:J,children:[e.jsx("span",{className:"text-gray-500 block mb-1 text-xs uppercase tracking-wider",children:"Award Reason"}),e.jsx("span",{className:"text-yellow-400 text-sm truncate block max-w-[150px] sm:max-w-[250px]",title:N.metadata.awardReason,children:N.metadata.awardReason})]}),N.rollType&&"normal"!==N.rollType&&e.jsxs(a.div,{variants:J,children:[e.jsx("span",{className:"text-gray-500 block mb-1 text-xs uppercase tracking-wider",children:"Roll Type"}),e.jsx("span",{className:"text-white capitalize",children:N.rollType})]}),null!=N.metadata?.winnerRoll&&e.jsxs(a.div,{variants:J,children:[e.jsx("span",{className:"text-gray-500 block mb-1 text-xs uppercase tracking-wider",children:"Roll"}),e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(R,{className:"h-3.5 w-3.5 text-amber-400"}),e.jsx("span",{className:"text-white font-medium",children:N.metadata.winnerRoll})]})]}),N.owner&&N.owner!==(N.character?.characterName||"")&&e.jsxs(a.div,{variants:J,children:[e.jsx("span",{className:"text-gray-500 block mb-1 text-xs uppercase tracking-wider",children:"Master Looter"}),e.jsx("span",{className:"text-white",children:N.owner})]}),N.metadata?.groupSize&&e.jsxs(a.div,{variants:J,children:[e.jsx("span",{className:"text-gray-500 block mb-1 text-xs uppercase tracking-wider",children:"Group Size"}),e.jsx("span",{className:"text-white",children:N.metadata.groupSize})]}),N.note&&e.jsxs(a.div,{variants:J,className:"col-span-2 md:col-span-3",children:[e.jsx("span",{className:"text-gray-500 block mb-1 text-xs uppercase tracking-wider",children:"Note"}),e.jsxs("p",{className:"text-gray-300 italic text-sm",children:['"',N.note,'"']})]})]})]}),(N.gear1||N.gear2)&&e.jsx(a.div,{...Y,transition:Z(.15),children:e.jsx(F,{entry:N})}),N.itemStats?.stats&&e.jsx(a.div,{...Y,transition:Z(.17),children:e.jsx(P,{stats:N.itemStats.stats})}),e.jsxs(a.section,{...Y,transition:Z(.18),className:"glass-card p-4",children:[e.jsxs("h2",{className:"text-lg font-semibold text-white mb-3 flex items-center gap-2",children:[e.jsx(p,{className:"h-5 w-5 text-purple-400"}),"Candidates",se.length>0&&e.jsx("span",{className:"text-sm font-normal text-gray-400 bg-gray-800/60 px-2 py-0.5 rounded-full",children:se.length})]}),l?se.length>0?e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-gray-700/60 text-gray-500 text-xs uppercase tracking-wider",children:[e.jsx("th",{className:"text-left py-2 px-2 sm:py-2.5 sm:px-3",children:"Player"}),e.jsx("th",{className:"text-left py-2 px-2 sm:py-2.5 sm:px-3",children:"Response"}),e.jsx("th",{className:"text-left py-2 px-2 sm:py-2.5 sm:px-3 hidden sm:table-cell",children:"ilvl Diff"}),e.jsx("th",{className:"text-left py-2.5 px-3 hidden md:table-cell",children:"Gear"}),e.jsx("th",{className:"text-left py-2 px-2 sm:py-2.5 sm:px-3",children:"Roll"}),e.jsx("th",{className:"text-left py-2.5 px-3 hidden sm:table-cell",children:"Votes"}),e.jsx("th",{className:"text-left py-2.5 px-3 hidden sm:table-cell",children:"Note"})]})}),e.jsx(a.tbody,{variants:Q,initial:"hidden",animate:"visible",children:se.map((s,t)=>{const r=s.name||s.player||s.playerName||"Unknown",l=r.toLowerCase()===ie,i=s.ilvlDiff??(_&&s.gear1ilvl?_-s.gear1ilvl:null),n=r.toLowerCase(),c=N.structuredVotes?.length>0?N.structuredVotes.filter(e=>(e.candidateName?.split("-")[0]||"").toLowerCase()===n).length:te.filter(e=>Array.isArray(e.responses)&&e.responses.some(e=>("string"==typeof e?e.split("-")[0]:"").toLowerCase()===n)).length,o=j(s.class||s.playerClass);return e.jsxs(a.tr,{variants:J,className:"border-b border-gray-800/50 transition-colors "+(l?"bg-green-500/6 hover:bg-green-500/10":"hover:bg-white/2"),children:[e.jsx("td",{className:"py-2 px-2 sm:py-2.5 sm:px-3",children:e.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2",children:[l&&e.jsx(T,{className:"h-3.5 w-3.5 text-yellow-400 shrink-0"}),e.jsx("span",{className:"truncate max-w-[100px] sm:max-w-none "+(l?"text-green-300 font-medium":"text-white"),children:r}),(s.class||s.playerClass)&&e.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded-sm hidden sm:inline",style:{color:o,backgroundColor:`${o}12`},children:s.class||s.playerClass})]})}),e.jsx("td",{className:"py-2 px-2 sm:py-2.5 sm:px-3",children:e.jsx(u,{response:s.response,size:"xs",showVotes:!1})}),e.jsx("td",{className:"py-2.5 px-3 hidden sm:table-cell",children:null!=i?e.jsxs("span",{className:"font-medium "+(i>0?"text-green-400":i<0?"text-red-400":"text-gray-500"),children:[i>0?"+":"",i]}):e.jsx("span",{className:"text-gray-700",children:"-"})}),e.jsx("td",{className:"py-2.5 px-3 text-gray-500 hidden md:table-cell",children:s.gear1ilvl?e.jsx("span",{className:"bg-gray-800/60 px-1.5 py-0.5 rounded-sm text-xs",children:s.gear1ilvl}):"-"}),e.jsx("td",{className:"py-2 px-2 sm:py-2.5 sm:px-3 text-gray-300",children:s.roll??"-"}),e.jsx("td",{className:"py-2.5 px-3 hidden sm:table-cell",children:c>0?e.jsx("span",{className:"inline-flex items-center justify-center w-6 h-6 bg-blue-500/20 text-blue-300 text-xs rounded-full font-medium",children:c}):e.jsx("span",{className:"text-gray-700",children:"-"})}),e.jsx("td",{className:"py-2.5 px-3 text-gray-500 italic text-xs max-w-[120px] sm:max-w-[200px] truncate hidden sm:table-cell",children:s.note||"-"})]},t)})})]})}):e.jsx("p",{className:"text-gray-500 text-sm py-4 text-center",children:"No candidate data available for this entry"}):e.jsxs("div",{className:"text-center py-6",children:[e.jsx(D,{className:"h-8 w-8 text-gray-600 mx-auto mb-2"}),e.jsx("p",{className:"text-gray-500 text-sm",children:"Officer access required to view candidates"})]})]}),e.jsxs(a.section,{...Y,transition:Z(.22),className:"glass-card p-4",children:[e.jsxs("h2",{className:"text-lg font-semibold text-white mb-3 flex items-center gap-2",children:[e.jsx(L,{className:"h-5 w-5 text-blue-400"}),"Council Votes"]}),l?N.structuredVotes?.length>0?e.jsxs("div",{className:"space-y-3",children:[(()=>{const s={};
1return N.structuredVotes.forEach(e=>{s[e.vote]=(s[e.vote]||0)+1}),e.jsx(a.div,{variants:Q,initial:"hidden",animate:"visible",className:"flex flex-wrap gap-2",children:Object.entries(s).map(([s,t])=>e.jsx(a.div,{variants:W,children:e.jsx(K,{vote:s,count:t,size:"md"})},s))})})(),e.jsx("div",{className:"overflow-x-auto -mx-4 px-4 sm:mx-0 sm:px-0",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-gray-700/60 text-gray-500 text-xs uppercase tracking-wider",children:[e.jsx("th",{className:"text-left py-2 px-2 sm:py-2.5 sm:px-3",children:"Voter"}),e.jsx("th",{className:"text-left py-2 px-2 sm:py-2.5 sm:px-3",children:"Vote"}),e.jsx("th",{className:"text-left py-2 px-2 sm:py-2.5 sm:px-3",children:"Candidate"}),e.jsx("th",{className:"text-left py-2.5 px-3 hidden sm:table-cell",children:"Reasoning"})]})}),e.jsx(a.tbody,{variants:Q,initial:"hidden",animate:"visible",children:N.structuredVotes.map((s,t)=>e.jsxs(a.tr,{variants:J,className:"border-b border-gray-800/50 hover:bg-white/2 transition-colors",children:[e.jsx("td",{className:"py-2 px-2 sm:py-2.5 sm:px-3",children:e.jsx("span",{className:"text-white font-medium text-xs sm:text-sm truncate block max-w-[80px] sm:max-w-none",children:s.voterName?.split("-")[0]||"Unknown"})}),e.jsx("td",{className:"py-2 px-2 sm:py-2.5 sm:px-3",children:e.jsx(K,{vote:s.vote,reasoning:s.reasoning,size:"xs"})}),e.jsx("td",{className:"py-2 px-2 sm:py-2.5 sm:px-3 text-gray-300 text-xs sm:text-sm",children:e.jsx("span",{className:"truncate block max-w-[80px] sm:max-w-none",children:s.candidateName?.split("-")[0]||"-"})}),e.jsx("td",{className:"py-2.5 px-3 text-gray-500 italic text-xs max-w-[150px] sm:max-w-[250px] truncate hidden sm:table-cell",title:s.reasoning,children:s.reasoning||"-"})]},t))})]})})]}):te.length>0?e.jsxs("div",{className:"space-y-3",children:[e.jsx(a.div,{variants:Q,initial:"hidden",animate:"visible",className:"flex flex-wrap gap-2",children:Object.entries(le).map(([s,t])=>e.jsxs(a.span,{variants:W,className:"px-2.5 py-1 bg-gray-700/40 rounded-lg text-xs text-gray-200 border border-gray-700/30",children:[e.jsx("span",{className:"font-semibold text-white",children:t})," ",s]},s))}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-gray-700/60 text-gray-500 text-xs uppercase tracking-wider",children:[e.jsx("th",{className:"text-left py-2.5 px-3",children:"Voter"}),e.jsx("th",{className:"text-left py-2.5 px-3",children:"Voted For"})]})}),e.jsx(a.tbody,{variants:Q,initial:"hidden",animate:"visible",children:te.map((s,t)=>e.jsxs(a.tr,{variants:J,className:"border-b border-gray-800/50 hover:bg-white/2 transition-colors",children:[e.jsx("td",{className:"py-2.5 px-3",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-white",children:(s.voter||"Unknown").split("-")[0]}),s.voterClass&&e.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded-sm",style:{color:j(s.voterClass),backgroundColor:`${j(s.voterClass)}12`},children:s.voterClass})]})}),e.jsx("td",{className:"py-2.5 px-3 text-gray-300",children:Array.isArray(s.responses)&&s.responses.length>0?s.responses.map(e=>"string"==typeof e?e.split("-")[0]:String(e)).join(", "):s.vote||"-"})]},t))})]})})]}):e.jsx("p",{className:"text-gray-500 text-sm py-4 text-center",children:"No council vote data available"}):e.jsxs("div",{className:"text-center py-6",children:[e.jsx(D,{className:"h-8 w-8 text-gray-600 mx-auto mb-2"}),e.jsx("p",{className:"text-gray-500 text-sm",children:"Officer access required to view votes"})]})]}),l&&U&&U.length>0&&e.jsxs(a.section,{...Y,transition:Z(.22),className:"glass-card p-4",children:[e.jsxs("h2",{className:"text-lg font-semibold text-white mb-3 flex items-center gap-2",children:[e.jsx(h,{className:"h-5 w-5 text-indigo-400"}),"Droptimizer DPS Upgrades",e.jsx("span",{className:"text-sm font-normal text-gray-400 bg-gray-800/60 px-2 py-0.5 rounded-full",children:U.length})]}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-gray-700/60 text-gray-500 text-xs uppercase tracking-wider",children:[e.jsx("th",{className:"text-left py-2 px-2 sm:px-3",children:"#"}),e.jsx("th",{className:"text-left py-2 px-2 sm:px-3",children:"Character"}),e.jsx("th",{className:"text-left py-2 px-2 sm:px-3",children:"Spec"}),e.jsx("th",{className:"text-right py-2 px-2 sm:px-3",children:"DPS Gain"}),e.jsx("th",{className:"text-right py-2 px-2 sm:px-3 hidden sm:table-cell",children:"%"}),e.jsx("th",{className:"text-center py-2 px-2 sm:px-3 hidden sm:table-cell",children:"Report"})]})}),e.jsx("tbody",{children:U.map((s,a)=>e.jsxs("tr",{className:"border-b border-gray-800/50 hover:bg-white/2 transition-colors",children:[e.jsx("td",{className:"py-2 px-2 sm:px-3 text-gray-500 text-xs",children:a+1}),e.jsx("td",{className:"py-2 px-2 sm:px-3 text-white font-medium",children:s.character?.characterName??"Unknown"}),e.jsx("td",{className:"py-2 px-2 sm:px-3 text-gray-400 text-xs capitalize",children:s.spec??"â"}),e.jsx("td",{className:"py-2 px-2 sm:px-3 text-right text-green-400 font-mono text-xs",children:Number.isFinite(Number(s.dpsGain))?`+${Number(s.dpsGain).toFixed(0)}`:"â"}),e.jsx("td",{className:"py-2 px-2 sm:px-3 text-right text-gray-400 font-mono text-xs hidden sm:table-cell",children:Number.isFinite(Number(s.dpsGainPct))?`${Number(s.dpsGainPct).toFixed(1)}%`:"â"}),e.jsxs("td",{className:"py-2 px-2 sm:px-3 text-center hidden sm:table-cell",children:[1===s.isStale&&e.jsx("span",{className:"text-amber-400 text-xs",children:"â ï¸ stale"}),s.reportId&&e.jsx("a",{href:`https://www.raidbots.com/simbot/report/${s.reportId}`,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-indigo-400 hover:underline ml-1",children:"report"})]})]},`${s.characterId}-${a}
1`))})]})})]}),e.jsxs(a.details,{...Y,transition:Z(.25),className:"glass-card p-4 group",children:[e.jsxs("summary",{className:"cursor-pointer font-medium text-gray-400 select-none hover:text-gray-200 transition-colors text-sm flex items-center gap-2",children:[e.jsx(d,{className:"h-4 w-4 transition-transform group-open:rotate-90"}),"Technical Details"]}),e.jsxs("div",{className:"mt-3 space-y-1 text-sm text-gray-400 font-mono",children:[e.jsx(ae,{label:"ID",value:N.id}),e.jsx(ae,{label:"Item ID",value:N.itemID}),e.jsx(ae,{label:"Item String",value:N.itemString}),N.responseID&&"0"!==N.responseID&&"UNKNOWN"!==N.responseID&&e.jsx(ae,{label:"Response ID",value:N.responseID}),e.jsx(ae,{label:"Roll Type",value:N.rollType}),e.jsx(ae,{label:"Sub Type",value:"Junk"===N.subType?"Token":N.subType}),e.jsx(ae,{label:"Equip Location",value:b(N.equipLoc)}),e.jsx(ae,{label:"Difficulty",value:O}),N.metadata?.difficultyID&&e.jsx(ae,{label:"Difficulty ID",value:N.metadata.difficultyID}),N.metadata?.encounterID&&e.jsx(ae,{label:"Encounter ID",value:N.metadata.encounterID}),N.metadata?.mapID&&e.jsx(ae,{label:"Map ID",value:N.metadata.mapID}),e.jsx(ae,{label:"Server Time",value:N.servertime}),e.jsx(ae,{label:"Created",value:N.createdAt?new Date(N.createdAt).toLocaleString():null})]})]})]})}function ae({label:s,value:a}){return null==a||""===a?null:e.jsxs("div",{className:"flex justify-between gap-4 py-1 px-2 rounded-sm hover:bg-white/2 transition-colors",children:[e.jsx("span",{className:"text-gray-500 shrink-0",children:s}),e.jsx("span",{className:"text-gray-300 truncate text-right",children:String(a)})]})}export{se as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.