chatlab-cli 0.26.3 → 0.27.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/README.md +10 -4
  2. package/dist/{chat-command-D37MMEJ7.mjs → chat-command-B7POB3C3.mjs} +6 -5
  3. package/dist/{chat-command-D37MMEJ7.mjs.map → chat-command-B7POB3C3.mjs.map} +1 -1
  4. package/dist/{chunk-K5SGXTVJ.mjs → chunk-3FUF3PEY.mjs} +21 -19
  5. package/dist/{chunk-K5SGXTVJ.mjs.map → chunk-3FUF3PEY.mjs.map} +1 -1
  6. package/dist/{chunk-742TAKEP.mjs → chunk-3JNVGW62.mjs} +2 -2
  7. package/dist/{chunk-VSOWNKPA.mjs → chunk-GFHSSCCR.mjs} +11 -1
  8. package/dist/{chunk-YPTJVTVJ.mjs → chunk-I7BHOZPX.mjs} +13159 -19038
  9. package/dist/chunk-I7BHOZPX.mjs.map +1 -0
  10. package/dist/chunk-N3G43SCQ.mjs +7337 -0
  11. package/dist/chunk-N3G43SCQ.mjs.map +1 -0
  12. package/dist/{chunk-GNGZHBKM.mjs → chunk-RJ4D4QWK.mjs} +42 -7
  13. package/dist/chunk-RJ4D4QWK.mjs.map +1 -0
  14. package/dist/{chunk-VCN64OD6.mjs → chunk-SAE2H2LN.mjs} +7 -5
  15. package/dist/{chunk-VCN64OD6.mjs.map → chunk-SAE2H2LN.mjs.map} +1 -1
  16. package/dist/{chunk-QMXNJRTT.mjs → chunk-SIVERPF5.mjs} +280 -104
  17. package/dist/chunk-SIVERPF5.mjs.map +1 -0
  18. package/dist/{chunk-RMITK4IC.mjs → chunk-WQMKKUSD.mjs} +468 -118
  19. package/dist/chunk-WQMKKUSD.mjs.map +1 -0
  20. package/dist/{chunk-D5MWER7N.mjs → chunk-YUFYTDRH.mjs} +6 -4
  21. package/dist/{chunk-D5MWER7N.mjs.map → chunk-YUFYTDRH.mjs.map} +1 -1
  22. package/dist/cli.mjs +5 -4
  23. package/dist/{http-6F6TYWCI.mjs → http-A54ZBBAY.mjs} +10 -9
  24. package/dist/{import-VYPOMSSA.mjs → import-EA3TB3S2.mjs} +6 -5
  25. package/dist/index.mjs +10 -9
  26. package/dist/{mcp-AR7L5FA3.mjs → mcp-DJDOWHH3.mjs} +11 -9
  27. package/dist/{mcp-AR7L5FA3.mjs.map → mcp-DJDOWHH3.mjs.map} +1 -1
  28. package/dist/onnxruntime_binding-6Q6HXASN.node +0 -0
  29. package/dist/onnxruntime_binding-EKZT2NRK.node +0 -0
  30. package/dist/onnxruntime_binding-P6S7V3CI.node +0 -0
  31. package/dist/onnxruntime_binding-PJNNIIUO.node +0 -0
  32. package/dist/onnxruntime_binding-UN6SPTQK.node +0 -0
  33. package/dist/semantic-index-worker.mjs +34 -0
  34. package/dist/semantic-index-worker.mjs.map +1 -0
  35. package/dist/{service-KZTHBDQ5.mjs → service-KGL3RAIA.mjs} +2 -2
  36. package/dist/{src-6S7JPKHX.mjs → src-EKPMJRG6.mjs} +65 -109
  37. package/dist/{stream-import-KZFC3XT2.mjs → stream-import-FQFNRQ2B.mjs} +5 -4
  38. package/dist/transformers.node-PUMHAODN.mjs +42889 -0
  39. package/dist/transformers.node-PUMHAODN.mjs.map +1 -0
  40. package/dist/{update-checker-3N7HQEP2.mjs → update-checker-LGMTEKMT.mjs} +2 -2
  41. package/dist/worker-runtime-UH2OBO3T.mjs +71 -0
  42. package/dist/worker-runtime-UH2OBO3T.mjs.map +1 -0
  43. package/dist-web/assets/{DebugToolsPanel-DzZmSzIU.css → DebugToolsPanel-DFw6_G5V.css} +1 -1
  44. package/dist-web/assets/DebugToolsPanel.vue_vue_type_script_setup_true_lang-NL1sTF6i.js +110 -0
  45. package/dist-web/assets/{MessageExportModal-CF6yaor7.js → MessageExportModal-B60rvfCh.js} +1 -1
  46. package/dist-web/assets/{electron-DKVw61Ww.js → electron-BRUg9LnY.js} +1 -1
  47. package/dist-web/assets/{fetch-CUw-PUYP.js → fetch-BIpjJHxj.js} +1 -1
  48. package/dist-web/assets/{fetch-BMdgfBVS.js → fetch-BRsMdFcn.js} +1 -1
  49. package/dist-web/assets/{fetch-CPeSfqsU.js → fetch-C-m3IysH.js} +1 -1
  50. package/dist-web/assets/{fetch-CpYSD089.js → fetch-Cma-mZjd.js} +1 -1
  51. package/dist-web/assets/{fetch-D2jNBqs8.js → fetch-DE8gj5Ke.js} +1 -1
  52. package/dist-web/assets/{fetch-DqEMAea3.js → fetch-DLAp7h55.js} +1 -1
  53. package/dist-web/assets/{fetch-BvVfWR-P.js → fetch-DNSaxRnL.js} +1 -1
  54. package/dist-web/assets/{fetch-BC8jyJ_U.js → fetch-DOEbyLSD.js} +1 -1
  55. package/dist-web/assets/{fetch-BQlEQsqi.js → fetch-DSN-QYZE.js} +1 -1
  56. package/dist-web/assets/{fetch-Bh6HC-IR.js → fetch-woAa3H2L.js} +1 -1
  57. package/dist-web/assets/index-B3mDjury.js +11 -0
  58. package/dist-web/assets/{index-Qh0XLt3R.js → index-B9I-Y3fR.js} +1 -1
  59. package/dist-web/assets/{index-DqybGdJH.css → index-BX3tqfLz.css} +1 -1
  60. package/dist-web/assets/index-GAU7LI1r.js +173 -0
  61. package/dist-web/assets/index-I3SWZjnW.css +1 -0
  62. package/dist-web/assets/index-YmzTgkb2.css +1 -0
  63. package/dist-web/assets/index-iwqJDVMJ.js +2 -0
  64. package/dist-web/assets/index-o6veAyTB.js +64 -0
  65. package/dist-web/assets/{index-BHQnAj6l.js → index-r_zHR2t9.js} +1 -1
  66. package/dist-web/assets/{web-Bx2TiHDk.js → web-C2UtGskd.js} +1 -1
  67. package/dist-web/index.html +2 -2
  68. package/package.json +1 -1
  69. package/dist/chunk-GNGZHBKM.mjs.map +0 -1
  70. package/dist/chunk-QMXNJRTT.mjs.map +0 -1
  71. package/dist/chunk-RMITK4IC.mjs.map +0 -1
  72. package/dist/chunk-YPTJVTVJ.mjs.map +0 -1
  73. package/dist-web/assets/DebugToolsPanel.vue_vue_type_script_setup_true_lang-BTdqmm0y.js +0 -107
  74. package/dist-web/assets/index-BwzuCu5R.js +0 -2
  75. package/dist-web/assets/index-CG746E15.js +0 -64
  76. package/dist-web/assets/index-CXoQ_U22.js +0 -173
  77. package/dist-web/assets/index-HgIuP1Td.css +0 -1
  78. package/dist-web/assets/index-R82N2_0b.css +0 -1
  79. package/dist-web/assets/index-wPAmuQZY.js +0 -11
  80. /package/dist/{chunk-742TAKEP.mjs.map → chunk-3JNVGW62.mjs.map} +0 -0
  81. /package/dist/{chunk-VSOWNKPA.mjs.map → chunk-GFHSSCCR.mjs.map} +0 -0
  82. /package/dist/{http-6F6TYWCI.mjs.map → http-A54ZBBAY.mjs.map} +0 -0
  83. /package/dist/{import-VYPOMSSA.mjs.map → import-EA3TB3S2.mjs.map} +0 -0
  84. /package/dist/{service-KZTHBDQ5.mjs.map → service-KGL3RAIA.mjs.map} +0 -0
  85. /package/dist/{src-6S7JPKHX.mjs.map → src-EKPMJRG6.mjs.map} +0 -0
  86. /package/dist/{stream-import-KZFC3XT2.mjs.map → stream-import-FQFNRQ2B.mjs.map} +0 -0
  87. /package/dist/{update-checker-3N7HQEP2.mjs.map → update-checker-LGMTEKMT.mjs.map} +0 -0
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MessageExportModal-CF6yaor7.js","assets/vendor-nuxt-ui-Zy8txNdC.js","assets/vendor-reka-ui-mMvma1EP.js","assets/index-wPAmuQZY.js","assets/vendor-snapdom-XnBoh1gd.js","assets/index-HgIuP1Td.css"])))=>i.map(i=>d[i]);
2
- import{_ as Ae}from"./vendor-snapdom-XnBoh1gd.js";import{a as se,k as je,b as $e,n as Re,D as Le,g as Ce,u as Ve,d as De}from"./vendor-nuxt-ui-Zy8txNdC.js";import{p as Q,w as X,d as re,F as ge,G as n,H as D,u as t,K as W,P as d,a5 as e,T as s,Z as H,a3 as J,Q as O,U as A,L as y,a0 as ne,h as q,b as N,_ as ze,O as Be,bD as Se,R as ye,a9 as Oe,i as ke,bI as Ne}from"./vendor-reka-ui-mMvma1EP.js";import{u as ee,p as pe,T as Ue,k as Pe,j as oe,r as Fe,_ as Ie,e as Ee,b as We,s as Ke}from"./index-wPAmuQZY.js";import{F as le,c as me,d as Me,h as He,a as _e,i as we,j as Ge,u as Je,k as Ye,_ as Qe,n as Ze,o as Xe,p as et,q as tt,r as st,t as at,v as nt,w as it,x as lt,y as ot,z as rt,C as ct,A as dt,B as ut,D as mt,E as gt}from"./DebugToolsPanel.vue_vue_type_script_setup_true_lang-BTdqmm0y.js";import"./vendor-echarts-wordcloud-B1kQMklB.js";import{u as xe,s as pt,j as fe,m as ve,n as ie,t as Te,p as qe,k as xt,v as ft}from"./vendor-echarts-CITQeskI.js";import"./index-Qh0XLt3R.js";import"./vendor-zrender-DFl4U2Oe.js";const vt={key:0,class:"relative z-10 flex flex-col h-full"},bt={class:"flex flex-col sm:flex-row items-center sm:items-start gap-6 px-6 pt-8 pb-4 sm:px-8"},ht={class:"w-full flex-1 min-w-0"},yt={class:"flex items-center gap-x-2 sm:gap-x-3 mb-6 sm:mb-8"},_t={class:"text-2xl sm:text-4xl font-black tracking-tight text-blue-600 dark:text-blue-400 truncate"},kt={class:"text-2xl sm:text-4xl font-black tracking-tight text-pink-600 dark:text-pink-400 truncate"},wt={class:"grid grid-cols-2 gap-4 sm:gap-10"},$t={class:"text-[10px] font-bold uppercase tracking-widest text-gray-400 dark:text-gray-500"},Ct={class:"flex flex-col gap-2.5"},St=["title","onClick"],Pt={class:"shrink-0 text-[10px] sm:text-xs font-semibold tabular-nums text-gray-400/80"},It={key:0,class:"text-xs sm:text-sm font-medium text-gray-400"},Mt={class:"hidden shrink-0 sm:block"},Tt={class:"px-6 pb-6 pt-2 sm:px-8 mt-auto"},qt={class:"mb-3 flex items-center justify-between"},At={class:"text-[10px] font-bold uppercase tracking-widest text-gray-400 dark:text-gray-500"},jt={class:"grid grid-cols-1 sm:grid-cols-3 gap-4"},Rt={class:"mb-4 flex items-center gap-2.5"},Lt={class:"text-sm font-bold tracking-wide text-gray-900 dark:text-white"},Vt={class:"flex items-center justify-between mb-4 w-full"},Dt={class:"flex flex-col flex-1 min-w-0"},zt={class:"truncate text-[10px] font-bold uppercase tracking-wider text-gray-400 mb-1"},Bt={class:"flex flex-col flex-1 min-w-0 items-end text-right"},Ot={class:"truncate text-[10px] font-bold uppercase tracking-wider text-gray-400 mb-1"},Nt={class:"mt-auto pt-3 border-t border-gray-100 dark:border-white/5 flex flex-col"},Ut={key:0,class:"flex items-start justify-between gap-2 mb-2 min-h-[24px]"},Ft={class:"flex flex-1 flex-nowrap overflow-hidden gap-1"},Et={key:0,class:"text-[11px] text-gray-400"},Wt={class:"flex flex-1 flex-nowrap overflow-hidden gap-1 justify-end"},Kt={key:0,class:"text-[11px] text-gray-400"},Ht={key:1,class:"flex flex-nowrap overflow-hidden items-center gap-x-1.5 mb-2 min-h-[24px]"},Gt=["onClick"],Jt={key:0,class:"shrink-0 text-gray-300 dark:text-gray-600 font-normal"},Yt={key:0,class:"text-[11px] text-gray-400"},Qt={class:"text-[10px] leading-relaxed text-gray-500 dark:text-gray-400"},Zt={class:"flex items-center justify-between px-6 pb-4 opacity-40 mix-blend-luminosity dark:opacity-30 sm:px-8 sm:pb-5"},Xt={class:"flex items-center gap-1.5"},es={class:"text-[9px] font-medium uppercase tracking-widest"},ts=Q({__name:"LanguagePreferenceCard",props:{data:{}},emits:["wordClick"],setup($,{emit:a}){xe([pt,fe,ve]);const{t:r}=ee(),_=pe(),o=$,p=a,C=q(()=>o.data.members[0]),k=q(()=>o.data.members[1]);function u(m,l){return m.length<=l?m:m.slice(0,l)+"…"}function I(m){const l=m.posDistribution,w=l.noun+l.verb+l.adjective+l.adverb+l.modalParticle+l.interjection+l.other;return w===0?r("quotes.languagePreference.pos.styleBalanced"):l.noun/w>.5?r("quotes.languagePreference.pos.styleEncyclopedia"):l.verb/w>.45?r("quotes.languagePreference.pos.styleAction"):l.adjective/w>.3?r("quotes.languagePreference.pos.styleExpressive"):r("quotes.languagePreference.pos.styleBalanced")}function z(m){const w=[["ellipsis",m.ellipsis],["exclamation",m.exclamation],["question",m.question],["tilde",m.tilde],["noPunct",m.noPunct],["period",m.period]].reduce((b,V)=>b[1]>=V[1]?b:V);return{ellipsis:r("quotes.languagePreference.punctuation.personalityDeep"),exclamation:r("quotes.languagePreference.punctuation.personalityPassionate"),question:r("quotes.languagePreference.punctuation.personalityCurious"),tilde:r("quotes.languagePreference.punctuation.personalityCheerful"),noPunct:r("quotes.languagePreference.punctuation.personalityFreeflow"),period:r("quotes.languagePreference.punctuation.personalityPrecise")}[w[0]]||"-"}function M(m,l=5){return[["...",m.ellipsis],["!",m.exclamation],["?",m.question],["~",m.tilde],["。",m.period]].filter(([,i])=>i>0).sort((i,b)=>b[1]-i[1]).slice(0,l).map(([i])=>i)}const j=["#6366f1","#ec4899","#f97316","#22c55e","#3b82f6","#8b5cf6","#14b8a6","#f43f5e","#eab308","#06b6d4"],f=q(()=>{const m=C.value,l=k.value;if(!m||!l)return[];const w=o.data.sharedWords.slice(0,6).map((i,b)=>({word:i.word,color:j[b%j.length]}));return[{icon:"i-heroicons-book-open",iconBgClass:"bg-blue-100 dark:bg-blue-500/20",iconColorClass:"text-blue-600 dark:text-blue-400",title:r("quotes.languagePreference.card.diversityTitle"),leftName:m.name,leftValue:`${m.lexicalDiversity}%`,rightName:l.name,rightValue:`${l.lexicalDiversity}%`,valueClass:"text-lg text-blue-600 dark:text-blue-400",detail:{kind:"tags-single",tags:w},desc:r("quotes.languagePreference.card.diversityDesc")},{icon:"i-heroicons-sparkles",iconBgClass:"bg-violet-100 dark:bg-violet-500/20",iconColorClass:"text-violet-600 dark:text-violet-400",title:r("quotes.languagePreference.card.styleTitle"),leftName:m.name,leftValue:I(m),rightName:l.name,rightValue:I(l),valueClass:"text-xs text-violet-600 dark:text-violet-400",detail:{kind:"tags-vs",leftTags:m.modalParticles.slice(0,4).map(i=>i.word),rightTags:l.modalParticles.slice(0,4).map(i=>i.word)},desc:r("quotes.languagePreference.card.styleDesc")},{icon:"i-heroicons-finger-print",iconBgClass:"bg-orange-100 dark:bg-orange-500/20",iconColorClass:"text-orange-600 dark:text-orange-400",title:r("quotes.languagePreference.card.punctTitle"),leftName:m.name,leftValue:z(m.punctuation),rightName:l.name,rightValue:z(l.punctuation),valueClass:"text-xs text-orange-600 dark:text-orange-400",detail:{kind:"tags-vs",leftTags:M(m.punctuation,4),rightTags:M(l.punctuation,4)},desc:r("quotes.languagePreference.card.punctDesc")}]}),R=N(null);let c=null;function x(){R.value&&(c=ie(R.value,void 0,{renderer:"canvas"}),P())}function P(){if(!c||!C.value||!k.value)return;const m=C.value.posDistribution,l=k.value.posDistribution,w=[{name:r("quotes.languagePreference.card.radarFactual"),max:0},{name:r("quotes.languagePreference.card.radarActive"),max:0},{name:r("quotes.languagePreference.card.radarDescriptive"),max:0},{name:r("quotes.languagePreference.card.radarAffable"),max:0},{name:r("quotes.languagePreference.card.radarIntense"),max:0}],i=[m.noun,m.verb,m.adjective,m.modalParticle+m.interjection,m.adverb],b=[l.noun,l.verb,l.adjective,l.modalParticle+l.interjection,l.adverb];for(let B=0;B<w.length;B++)w[B].max=Math.max(i[B],b[B],1)*1.3;const V=_.value?"#9ca3af":"#6b7280";c.setOption({backgroundColor:"transparent",tooltip:{trigger:"item"},legend:{bottom:0,itemWidth:10,itemHeight:10,textStyle:{fontSize:10,color:V},data:[C.value.name,k.value.name]},radar:{indicator:w,radius:"60%",center:["50%","50%"],splitArea:{areaStyle:{color:_.value?["rgba(255,255,255,0.02)","rgba(255,255,255,0.04)"]:["rgba(0,0,0,0.01)","rgba(0,0,0,0.03)"]}},axisName:{color:V,fontSize:10},splitLine:{lineStyle:{color:_.value?"rgba(255,255,255,0.08)":"rgba(0,0,0,0.06)"}},axisLine:{lineStyle:{color:_.value?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.08)"}}},series:[{type:"radar",data:[{value:i,name:C.value.name,lineStyle:{color:"#3b82f6",width:2},areaStyle:{color:"rgba(59,130,246,0.15)"},itemStyle:{color:"#3b82f6"},symbol:"circle",symbolSize:4},{value:b,name:k.value.name,lineStyle:{color:"#ec4899",width:2},areaStyle:{color:"rgba(236,72,153,0.15)"},itemStyle:{color:"#ec4899"},symbol:"circle",symbolSize:4}]}]},{notMerge:!0})}function T(){c?.resize()}return X(()=>o.data,()=>P(),{deep:!0}),X(_,()=>{c?.dispose(),x()}),re(()=>{x(),window.addEventListener("resize",T)}),ge(()=>{window.removeEventListener("resize",T),c?.dispose()}),(m,l)=>{const w=se;return n(),D(t(le),{variant:"elevated",decorative:"",class:"flex flex-col"},{default:W(()=>[C.value&&k.value?(n(),d("div",vt,[e("div",bt,[e("div",ht,[e("div",yt,[e("span",_t,s(C.value.name),1),l[0]||(l[0]=e("span",{class:"text-sm sm:text-lg font-black text-gray-300 dark:text-gray-600 italic px-1 sm:px-2 shrink-0"}," VS ",-1)),e("span",kt,s(k.value.name),1)]),e("div",wt,[(n(!0),d(H,null,J([C.value,k.value],(i,b)=>(n(),d("div",{key:i.memberId,class:"flex flex-col gap-3"},[e("div",$t,s(t(r)("quotes.languagePreference.card.topCatchphrases")),1),e("div",Ct,[(n(!0),d(H,null,J(i.catchphrases.slice(0,3),(V,B)=>(n(),d("div",{key:B,class:"flex items-center gap-2 group"},[e("span",{class:O(["text-xs sm:text-sm font-black font-mono opacity-40 transition-opacity group-hover:opacity-100",b===0?"text-blue-600 dark:text-blue-400":"text-pink-600 dark:text-pink-400"])}," #"+s(B+1),3),e("span",{class:"truncate text-sm sm:text-base font-bold text-gray-700 dark:text-gray-200 cursor-pointer hover:opacity-70 transition-opacity",title:V.content,onClick:E=>p("wordClick",V.content)}," 「"+s(u(V.content,12))+"」 ",9,St),e("span",Pt," ×"+s(V.count),1)]))),128)),i.catchphrases.length===0?(n(),d("div",It,"-")):A("",!0)])]))),128))])]),e("div",Mt,[e("div",{ref_key:"radarRef",ref:R,style:{width:"250px",height:"230px"},class:"-mt-4 sm:-mr-4"},null,512)])]),e("div",Tt,[e("div",qt,[e("span",At,s(t(r)("quotes.languagePreference.card.languageProfiles")),1)]),e("div",jt,[(n(!0),d(H,null,J(f.value,i=>(n(),d("div",{key:i.title,class:"flex flex-col rounded-xl bg-white/60 p-4 ring-1 ring-gray-900/5 backdrop-blur-sm dark:bg-white/5 dark:ring-white/10"},[e("div",Rt,[e("div",{class:O(["flex h-8 w-8 shrink-0 items-center justify-center rounded-lg",i.iconBgClass])},[y(w,{name:i.icon,class:O(["h-4 w-4",i.iconColorClass])},null,8,["name","class"])],2),e("span",Lt,s(i.title),1)]),e("div",Vt,[e("div",Dt,[e("span",zt,s(i.leftName),1),e("span",{class:O(["truncate text-xl font-black font-mono leading-none",i.valueClass])},s(i.leftValue),3)]),l[1]||(l[1]=e("div",{class:"px-2 shrink-0"},[e("span",{class:"text-[10px] font-black text-gray-300 dark:text-gray-600 italic"},"VS")],-1)),e("div",Bt,[e("span",Ot,s(i.rightName),1),e("span",{class:O(["truncate text-xl font-black font-mono leading-none",i.valueClass])},s(i.rightValue),3)])]),e("div",Nt,[i.detail.kind==="tags-vs"?(n(),d("div",Ut,[e("div",Ft,[(n(!0),d(H,null,J(i.detail.leftTags,b=>(n(),d("span",{key:b,class:"shrink-0 px-1.5 py-0.5 rounded-md text-[10px] font-semibold font-mono bg-blue-50 text-blue-600 dark:bg-blue-500/10 dark:text-blue-400"},s(b),1))),128)),i.detail.leftTags.length===0?(n(),d("span",Et,"-")):A("",!0)]),e("div",Wt,[(n(!0),d(H,null,J(i.detail.rightTags,b=>(n(),d("span",{key:b,class:"shrink-0 px-1.5 py-0.5 rounded-md text-[10px] font-semibold font-mono bg-pink-50 text-pink-600 dark:bg-pink-500/10 dark:text-pink-400"},s(b),1))),128)),i.detail.rightTags.length===0?(n(),d("span",Kt,"-")):A("",!0)])])):i.detail.kind==="tags-single"?(n(),d("div",Ht,[(n(!0),d(H,null,J(i.detail.tags.slice(0,6),(b,V)=>(n(),d(H,{key:b.word},[e("span",{class:"shrink-0 cursor-pointer text-[11px] font-bold transition-opacity hover:opacity-80",style:ne({color:b.color}),onClick:B=>p("wordClick",b.word)},s(b.word),13,Gt),V<i.detail.tags.slice(0,6).length-1?(n(),d("span",Jt," · ")):A("",!0)],64))),128)),i.detail.tags.length===0?(n(),d("span",Yt,"-")):A("",!0)])):A("",!0),e("p",Qt,s(i.desc),1)])]))),128))])]),e("div",Zt,[e("div",Xt,[y(w,{name:"i-heroicons-chat-bubble-left-right-solid",class:"h-3.5 w-3.5"}),l[2]||(l[2]=e("span",{class:"text-[10px] font-bold uppercase tracking-wider"},"ChatLab",-1))]),e("span",es,s(t(r)("quotes.languagePreference.card.watermark")),1)])])):A("",!0)]),_:1})}}}),ss={class:"px-5 py-4 sm:px-6"},as={class:"mb-4 flex items-center justify-between"},ns={class:"flex items-center gap-2"},is={class:"text-[15px] font-black tracking-tight text-gray-900 dark:text-white"},ls={key:0,class:"rounded-full bg-pink-100 px-2 py-0.5 text-[10px] font-bold text-pink-600 dark:bg-pink-900/30 dark:text-pink-400"},os={key:0,class:"grid grid-cols-2 gap-6"},rs={class:"mb-3 text-center"},cs={class:"text-sm font-semibold text-blue-600 dark:text-blue-400"},ds={class:"flex flex-wrap gap-2"},us=["title","onClick"],ms={class:"text-[10px] font-semibold opacity-60"},gs={class:"mb-3 text-center"},ps={class:"text-sm font-semibold text-pink-600 dark:text-pink-400"},xs={class:"flex flex-wrap gap-2"},fs=["title","onClick"],vs={class:"text-[10px] font-semibold opacity-60"},bs={class:"mt-4 text-center text-xs text-gray-500 dark:text-gray-400"},hs=Q({__name:"CatchphrasePKSection",props:{members:{}},emits:["wordClick"],setup($,{emit:a}){const{t:r}=ee(),_=$,o=a,p=N(20),C=[{label:"10",value:10},{label:"20",value:20},{label:"30",value:30}],k=q(()=>_.members[0]),u=q(()=>_.members[1]),I=q(()=>k.value?.catchphrases.slice(0,p.value)??[]),z=q(()=>u.value?.catchphrases.slice(0,p.value)??[]),M=q(()=>{if(!k.value||!u.value)return new Set;const c=new Set(k.value.catchphrases.map(P=>P.content)),x=new Set(u.value.catchphrases.map(P=>P.content));return new Set([...c].filter(P=>x.has(P)))}),j=[{bg:"bg-amber-50 text-amber-600 ring-1 ring-amber-500/20 dark:bg-amber-500/10 dark:text-amber-400 dark:ring-amber-500/30",text:"text-amber-700 dark:text-amber-400 font-bold",badge:"bg-amber-500 text-white dark:bg-amber-600"},{bg:"bg-slate-50 text-slate-600 ring-1 ring-slate-500/20 dark:bg-slate-500/10 dark:text-slate-400 dark:ring-slate-500/30",text:"text-slate-700 dark:text-slate-300 font-bold",badge:"bg-slate-400 text-white dark:bg-slate-500"},{bg:"bg-orange-50 text-orange-600 ring-1 ring-orange-500/20 dark:bg-orange-500/10 dark:text-orange-400 dark:ring-orange-500/30",text:"text-orange-700 dark:text-orange-400 font-bold",badge:"bg-orange-400 text-white dark:bg-orange-500"}];function f(c){return c<j.length?j[c]:{bg:"bg-gray-50/50 text-gray-600 ring-1 ring-gray-900/5 dark:bg-gray-800/30 dark:text-gray-400 dark:ring-white/10",text:"text-gray-600 dark:text-gray-400",badge:"bg-transparent text-gray-400"}}function R(c,x=20){return c.length<=x?c:c.slice(0,x)+"..."}return(c,x)=>{const P=se;return n(),D(t(le),{variant:"section"},{default:W(()=>[e("div",ss,[e("div",as,[e("div",ns,[y(P,{name:"i-heroicons-chat-bubble-bottom-center-text",class:"h-4 w-4 text-indigo-500"}),e("span",is,s(t(r)("quotes.languagePreference.catchphrasePK.title")),1),M.value.size>0?(n(),d("span",ls,s(t(r)("quotes.languagePreference.catchphrasePK.sharedCount",{count:M.value.size})),1)):A("",!0)]),y(t(Ue),{modelValue:p.value,"onUpdate:modelValue":x[0]||(x[0]=T=>p.value=T),size:"xs",items:C},null,8,["modelValue"])]),k.value&&u.value?(n(),d("div",os,[e("div",null,[e("div",rs,[e("span",cs,s(k.value.name),1)]),e("div",ds,[(n(!0),d(H,null,J(I.value,(T,m)=>(n(),d("div",{key:T.content,class:O(["inline-flex cursor-pointer items-center gap-1.5 rounded-full px-3 py-1 transition-opacity hover:opacity-75",[M.value.has(T.content)?"bg-pink-50 text-pink-600 ring-1 ring-pink-500/20 dark:bg-pink-500/10 dark:text-pink-400 dark:ring-pink-500/30 shadow-sm":f(m).bg]]),title:T.content,onClick:l=>o("wordClick",T.content)},[m<3?(n(),d("span",{key:0,class:O(["flex h-4 w-4 shrink-0 items-center justify-center rounded-full text-[10px] font-bold",f(m).badge])},s(m+1),3)):A("",!0),e("span",{class:O(["text-[13px] font-medium",M.value.has(T.content)?"font-bold":f(m).text])},s(R(T.content)),3),e("span",ms,"×"+s(T.count),1)],10,us))),128))])]),e("div",null,[e("div",gs,[e("span",ps,s(u.value.name),1)]),e("div",xs,[(n(!0),d(H,null,J(z.value,(T,m)=>(n(),d("div",{key:T.content,class:O(["inline-flex cursor-pointer items-center gap-1.5 rounded-full px-3 py-1 transition-opacity hover:opacity-75",[M.value.has(T.content)?"bg-pink-50 text-pink-600 ring-1 ring-pink-500/20 dark:bg-pink-500/10 dark:text-pink-400 dark:ring-pink-500/30 shadow-sm":f(m).bg]]),title:T.content,onClick:l=>o("wordClick",T.content)},[m<3?(n(),d("span",{key:0,class:O(["flex h-4 w-4 shrink-0 items-center justify-center rounded-full text-[10px] font-bold",f(m).badge])},s(m+1),3)):A("",!0),e("span",{class:O(["text-[13px] font-medium",M.value.has(T.content)?"font-bold":f(m).text])},s(R(T.content)),3),e("span",vs,"×"+s(T.count),1)],10,fs))),128))])])])):A("",!0),e("p",bs,s(t(r)("quotes.languagePreference.catchphrasePK.hint")),1)])]),_:1})}}}),ys={class:"px-5 py-4 sm:px-6"},_s={class:"mb-4 flex items-center gap-2"},ks={class:"text-[15px] font-black tracking-tight text-gray-900 dark:text-white"},ws={class:"flex flex-col gap-4 lg:flex-row lg:gap-6"},$s={class:"flex-1"},Cs={key:0,class:"flex shrink-0 flex-col gap-3 lg:w-48"},Ss={class:"min-w-0"},Ps={class:"truncate text-xs font-semibold text-gray-500 dark:text-gray-400"},Is=Q({__name:"PosPortraitSection",props:{members:{}},setup($){xe([Te,qe,fe,xt,ve]);const{t:a}=ee(),r=pe(),_=$,o=q(()=>_.members[0]),p=q(()=>_.members[1]);function C(j){const f=j.posDistribution,R=f.noun+f.verb+f.adjective+f.adverb+f.modalParticle+f.interjection+f.other;if(R===0)return{label:a("quotes.languagePreference.pos.styleBalanced"),icon:"i-heroicons-scale-solid",colorClass:"text-cyan-600 dark:text-cyan-400"};const c=f.noun/R,x=f.verb/R,P=f.adjective/R;return c>.5?{label:a("quotes.languagePreference.pos.styleEncyclopedia"),icon:"i-heroicons-book-open-solid",colorClass:"text-indigo-600 dark:text-indigo-400"}:x>.45?{label:a("quotes.languagePreference.pos.styleAction"),icon:"i-heroicons-rocket-launch-solid",colorClass:"text-orange-600 dark:text-orange-400"}:P>.3?{label:a("quotes.languagePreference.pos.styleExpressive"),icon:"i-heroicons-paint-brush-solid",colorClass:"text-pink-600 dark:text-pink-400"}:{label:a("quotes.languagePreference.pos.styleBalanced"),icon:"i-heroicons-scale-solid",colorClass:"text-cyan-600 dark:text-cyan-400"}}const k=N(null);let u=null;function I(){k.value&&(u=ie(k.value,void 0,{renderer:"canvas"}),z())}function z(){if(!u||!o.value||!p.value)return;const j=o.value.posDistribution,f=p.value.posDistribution,R=[a("quotes.languagePreference.card.radarNoun"),a("quotes.languagePreference.card.radarVerb"),a("quotes.languagePreference.card.radarAdj"),a("quotes.languagePreference.card.radarModal"),a("quotes.languagePreference.card.radarAdv")],c=[j.noun,j.verb,j.adjective,j.modalParticle+j.interjection,j.adverb],x=[f.noun,f.verb,f.adjective,f.modalParticle+f.interjection,f.adverb],P=r.value?"#9ca3af":"#6b7280";u.setOption({backgroundColor:"transparent",tooltip:{trigger:"axis",axisPointer:{type:"shadow"}},legend:{data:[o.value.name,p.value.name],top:0,textStyle:{fontSize:11,color:P}},grid:{left:80,right:20,top:36,bottom:10},xAxis:{type:"value",show:!1},yAxis:{type:"category",data:R,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{fontSize:11,color:P}},series:[{name:o.value.name,type:"bar",data:c,itemStyle:{color:"#3b82f6",borderRadius:[0,4,4,0]},barGap:"20%",barCategoryGap:"40%"},{name:p.value.name,type:"bar",data:x,itemStyle:{color:"#ec4899",borderRadius:[0,4,4,0]}}]},{notMerge:!0})}function M(){u?.resize()}return X(()=>_.members,()=>z(),{deep:!0}),X(r,()=>{u?.dispose(),I()}),re(()=>{I(),window.addEventListener("resize",M)}),ge(()=>{window.removeEventListener("resize",M),u?.dispose()}),(j,f)=>{const R=se;return n(),D(t(le),{variant:"section"},{default:W(()=>[e("div",ys,[e("div",_s,[y(R,{name:"i-heroicons-chart-bar",class:"h-4 w-4 text-violet-500"}),e("span",ks,s(t(a)("quotes.languagePreference.pos.title")),1)]),e("div",ws,[e("div",$s,[e("div",{ref_key:"chartRef",ref:k,style:{width:"100%",height:"220px"}},null,512)]),o.value&&p.value?(n(),d("div",Cs,[(n(!0),d(H,null,J([o.value,p.value],c=>(n(),d("div",{key:c.memberId,class:"flex items-center gap-3 rounded-xl bg-white/60 p-3 ring-1 ring-gray-900/5 backdrop-blur-sm dark:bg-white/5 dark:ring-white/10"},[y(R,{name:C(c).icon,class:O(["h-5 w-5 shrink-0",C(c).colorClass])},null,8,["name","class"]),e("div",Ss,[e("div",Ps,s(c.name),1),e("div",{class:O(["truncate text-sm font-bold",C(c).colorClass])},s(C(c).label),3)])]))),128))])):A("",!0)])])]),_:1})}}}),Ms={class:"px-5 py-4 sm:px-6"},Ts={class:"mb-4 flex items-center gap-2"},qs={class:"text-[15px] font-black tracking-tight text-gray-900 dark:text-white"},As={key:0,class:"grid grid-cols-1 gap-6 md:grid-cols-2"},js={class:"mb-2 flex items-center justify-between"},Rs={key:1,class:"flex h-[200px] items-center justify-center text-sm text-gray-400"},Ls=Q({__name:"ModalParticleSection",props:{members:{}},setup($){xe([Te,qe,fe,ve]);const{t:a}=ee(),r=pe(),_=$,o=q(()=>_.members[0]),p=q(()=>_.members[1]),C=new Set(["呀","哒","滴","啦","哇","耶"]),k=new Set(["呢","吗","嘛"]),u=new Set(["吧","喔","噢","嘛"]),I=new Set(["嗯","哦","额","呃"]);function z(T){const m={label:a("quotes.languagePreference.modal.toneMixed"),colorClass:"bg-gray-50 text-gray-600 ring-1 ring-gray-900/5 dark:bg-gray-800/50 dark:text-gray-400 dark:ring-white/10"};if(T.modalParticles.length===0)return m;let l=0,w=0,i=0,b=0,V=0;for(const E of T.modalParticles)V+=E.count,C.has(E.word)&&(l+=E.count),k.has(E.word)&&(w+=E.count),u.has(E.word)&&(i+=E.count),I.has(E.word)&&(b+=E.count);if(V===0)return m;const B=Math.max(l,w,i,b);return B===l&&l/V>.3?{label:a("quotes.languagePreference.modal.toneSoft"),colorClass:"bg-pink-50 text-pink-600 ring-1 ring-pink-500/20 dark:bg-pink-500/10 dark:text-pink-400 dark:ring-pink-500/30"}:B===w&&w/V>.3?{label:a("quotes.languagePreference.modal.toneCurious"),colorClass:"bg-violet-50 text-violet-600 ring-1 ring-violet-500/20 dark:bg-violet-500/10 dark:text-violet-400 dark:ring-violet-500/30"}:B===i&&i/V>.3?{label:a("quotes.languagePreference.modal.toneCasual"),colorClass:"bg-emerald-50 text-emerald-600 ring-1 ring-emerald-500/20 dark:bg-emerald-500/10 dark:text-emerald-400 dark:ring-emerald-500/30"}:B===b&&b/V>.3?{label:a("quotes.languagePreference.modal.toneCalm"),colorClass:"bg-blue-50 text-blue-600 ring-1 ring-blue-500/20 dark:bg-blue-500/10 dark:text-blue-400 dark:ring-blue-500/30"}:m}const M=N(null),j=N(null);let f=null,R=null;function c(T,m){const l=T.modalParticles.slice(0,8),w=r.value?"#9ca3af":"#6b7280";return{backgroundColor:"transparent",tooltip:{trigger:"axis",axisPointer:{type:"shadow"}},grid:{left:40,right:20,top:4,bottom:4},xAxis:{type:"value",show:!1},yAxis:{type:"category",data:l.map(i=>i.word).reverse(),axisLine:{show:!1},axisTick:{show:!1},axisLabel:{fontSize:12,color:w},inverse:!1},series:[{type:"bar",data:l.map(i=>i.count).reverse(),itemStyle:{color:m,borderRadius:[0,4,4,0]},barWidth:"50%",label:{show:!0,position:"right",fontSize:10,color:w,formatter:"{c}"}}]}}function x(){M.value&&o.value&&(f=ie(M.value,void 0,{renderer:"canvas"}),f.setOption(c(o.value,"#3b82f6"),{notMerge:!0})),j.value&&p.value&&(R=ie(j.value,void 0,{renderer:"canvas"}),R.setOption(c(p.value,"#ec4899"),{notMerge:!0}))}function P(){f?.resize(),R?.resize()}return X(()=>_.members,()=>{f&&o.value&&f.setOption(c(o.value,"#3b82f6"),{notMerge:!0}),R&&p.value&&R.setOption(c(p.value,"#ec4899"),{notMerge:!0})},{deep:!0}),X(r,()=>{f?.dispose(),R?.dispose(),x()}),re(()=>{x(),window.addEventListener("resize",P)}),ge(()=>{window.removeEventListener("resize",P),f?.dispose(),R?.dispose()}),(T,m)=>{const l=se;return n(),D(t(le),{variant:"section"},{default:W(()=>[e("div",Ms,[e("div",Ts,[y(l,{name:"i-heroicons-chat-bubble-oval-left-ellipsis",class:"h-4 w-4 text-pink-500"}),e("span",qs,s(t(a)("quotes.languagePreference.modal.title")),1)]),o.value&&p.value?(n(),d("div",As,[(n(!0),d(H,null,J([o.value,p.value],(w,i)=>(n(),d("div",{key:w.memberId},[e("div",js,[e("span",{class:O(["text-sm font-semibold",i===0?"text-blue-600 dark:text-blue-400":"text-pink-600 dark:text-pink-400"])},s(w.name),3),e("span",{class:O(["rounded-full px-2 py-0.5 text-[10px] font-bold",z(w).colorClass])},s(z(w).label),3)]),w.modalParticles.length>0?(n(),d("div",{key:0,ref_for:!0,ref:b=>{i===0?M.value=b:j.value=b},style:{width:"100%",height:"200px"}},null,512)):(n(),d("div",Rs,s(t(a)("quotes.languagePreference.modal.empty")),1))]))),128))])):A("",!0)])]),_:1})}}}),Vs={class:"px-5 py-4 sm:px-6"},Ds={class:"mb-4 flex items-center gap-2"},zs={class:"text-[15px] font-black tracking-tight text-gray-900 dark:text-white"},Bs={key:0,class:"grid grid-cols-1 gap-6 md:grid-cols-2"},Os={class:"mb-2 flex items-center gap-2"},Ns={key:1,class:"flex h-[200px] items-center justify-center text-sm text-gray-400"},Us=Q({__name:"PunctuationSection",props:{members:{}},setup($){xe([ft,fe,ve]);const{t:a}=ee(),r=pe(),_=$,o=q(()=>_.members[0]),p=q(()=>_.members[1]),C=["#6366f1","#ec4899","#f97316","#22c55e","#06b6d4","#8b5cf6"];function k(x){const T=[["ellipsis",x.ellipsis],["exclamation",x.exclamation],["question",x.question],["tilde",x.tilde],["noPunct",x.noPunct],["period",x.period]].reduce((l,w)=>l[1]>=w[1]?l:w);return{ellipsis:{label:a("quotes.languagePreference.punctuation.personalityDeep"),colorClass:"bg-indigo-50 text-indigo-600 ring-1 ring-indigo-500/20 dark:bg-indigo-500/10 dark:text-indigo-400 dark:ring-indigo-500/30"},exclamation:{label:a("quotes.languagePreference.punctuation.personalityPassionate"),colorClass:"bg-rose-50 text-rose-600 ring-1 ring-rose-500/20 dark:bg-rose-500/10 dark:text-rose-400 dark:ring-rose-500/30"},question:{label:a("quotes.languagePreference.punctuation.personalityCurious"),colorClass:"bg-amber-50 text-amber-600 ring-1 ring-amber-500/20 dark:bg-amber-500/10 dark:text-amber-400 dark:ring-amber-500/30"},tilde:{label:a("quotes.languagePreference.punctuation.personalityCheerful"),colorClass:"bg-pink-50 text-pink-600 ring-1 ring-pink-500/20 dark:bg-pink-500/10 dark:text-pink-400 dark:ring-pink-500/30"},noPunct:{label:a("quotes.languagePreference.punctuation.personalityFreeflow"),colorClass:"bg-emerald-50 text-emerald-600 ring-1 ring-emerald-500/20 dark:bg-emerald-500/10 dark:text-emerald-400 dark:ring-emerald-500/30"},period:{label:a("quotes.languagePreference.punctuation.personalityPrecise"),colorClass:"bg-blue-50 text-blue-600 ring-1 ring-blue-500/20 dark:bg-blue-500/10 dark:text-blue-400 dark:ring-blue-500/30"}}[T[0]]||{label:"-",colorClass:"bg-gray-50 text-gray-600 ring-1 ring-gray-900/5 dark:bg-gray-800/50 dark:text-gray-400 dark:ring-white/10"}}function u(x){return[{name:"...",value:x.ellipsis},{name:"!",value:x.exclamation},{name:"?",value:x.question},{name:"~",value:x.tilde},{name:"。",value:x.period},{name:a("quotes.languagePreference.punctuation.none"),value:x.noPunct}].filter(P=>P.value>0)}const I=N(null),z=N(null);let M=null,j=null;function f(x){return{backgroundColor:"transparent",tooltip:{trigger:"item",formatter:"{b}: {c} ({d}%)"},series:[{type:"pie",radius:["45%","75%"],center:["50%","50%"],avoidLabelOverlap:!1,padAngle:2,itemStyle:{borderRadius:4},label:{show:!0,fontSize:10,color:r.value?"#9ca3af":"#6b7280",formatter:"{b}"},emphasis:{label:{show:!0,fontWeight:"bold"},scaleSize:4},data:x.map((P,T)=>({...P,itemStyle:{color:C[T%C.length]}}))}]}}function R(){I.value&&o.value&&(M=ie(I.value,void 0,{renderer:"canvas"}),M.setOption(f(u(o.value.punctuation)),{notMerge:!0})),z.value&&p.value&&(j=ie(z.value,void 0,{renderer:"canvas"}),j.setOption(f(u(p.value.punctuation)),{notMerge:!0}))}function c(){M?.resize(),j?.resize()}return X(()=>_.members,()=>{M&&o.value&&M.setOption(f(u(o.value.punctuation)),{notMerge:!0}),j&&p.value&&j.setOption(f(u(p.value.punctuation)),{notMerge:!0})},{deep:!0}),X(r,()=>{M?.dispose(),j?.dispose(),R()}),re(()=>{R(),window.addEventListener("resize",c)}),ge(()=>{window.removeEventListener("resize",c),M?.dispose(),j?.dispose()}),(x,P)=>{const T=se;return n(),D(t(le),{variant:"section"},{default:W(()=>[e("div",Vs,[e("div",Ds,[y(T,{name:"i-heroicons-ellipsis-horizontal",class:"h-4 w-4 text-orange-500"}),e("span",zs,s(t(a)("quotes.languagePreference.punctuation.title")),1)]),o.value&&p.value?(n(),d("div",Bs,[(n(!0),d(H,null,J([o.value,p.value],(m,l)=>(n(),d("div",{key:m.memberId,class:"flex flex-col items-center"},[e("div",Os,[e("span",{class:O(["text-sm font-semibold",l===0?"text-blue-600 dark:text-blue-400":"text-pink-600 dark:text-pink-400"])},s(m.name),3),e("span",{class:O(["rounded-full px-2 py-0.5 text-[10px] font-bold",k(m.punctuation).colorClass])},s(k(m.punctuation).label),3)]),m.punctuation.total>0?(n(),d("div",{key:0,ref_for:!0,ref:w=>{l===0?I.value=w:z.value=w},style:{width:"100%",height:"200px"}},null,512)):(n(),d("div",Ns,s(t(a)("quotes.languagePreference.punctuation.empty")),1))]))),128))])):A("",!0)])]),_:1})}}}),Fs={class:"main-content mx-auto max-w-[920px] space-y-6 p-6"},Es=Q({__name:"LanguagePreferenceTab",props:{sessionId:{},timeFilter:{}},setup($){const{t:a,locale:r}=ee(),_=Pe(),o=$,p=N(null),C=N(!1),k=q(()=>p.value&&p.value.members.length>=2);async function u(){if(o.sessionId){C.value=!0;try{p.value=await oe().getLanguagePreferenceAnalysis(o.sessionId,r.value,o.timeFilter)}catch(z){console.error("[LanguagePreferenceTab] Failed to load:",z)}finally{C.value=!1}}}function I(z){_.openChatRecordDrawer({keywords:[z]})}return X(()=>[o.sessionId,o.timeFilter],()=>u(),{immediate:!0,deep:!0}),(z,M)=>(n(),d("div",Fs,[C.value?(n(),D(t(me),{key:0,text:t(a)("quotes.languagePreference.loading")},null,8,["text"])):k.value?p.value?(n(),d(H,{key:2},[y(ts,{data:p.value,onWordClick:I},null,8,["data"]),y(hs,{members:p.value.members,onWordClick:I},null,8,["members"]),y(Is,{members:p.value.members},null,8,["members"]),y(Ls,{members:p.value.members},null,8,["members"]),y(Us,{members:p.value.members},null,8,["members"])],64)):A("",!0):(n(),D(t(Me),{key:1,text:t(a)("quotes.languagePreference.empty")},null,8,["text"]))]))}}),Ws={class:"main-content mx-auto max-w-[920px] space-y-6 p-6"},Ks={class:"grid grid-cols-1 gap-6 lg:grid-cols-2"},Hs={class:"p-5"},Gs={class:"p-5"},Js=Q({__name:"OverviewTab",props:{session:{},memberActivity:{},messageTypes:{},hourlyActivity:{},dailyActivity:{},timeRange:{},selectedYear:{},filteredMessageCount:{},filteredMemberCount:{},timeFilter:{}},setup($){const{t:a}=ee(),r=$,{dailyChartData:_}=Je(()=>r.dailyActivity),o=q(()=>({labels:r.messageTypes.map(k=>Ye(k.type,a)),values:r.messageTypes.map(k=>k.count)})),p=q(()=>{if(r.memberActivity.length<2)return null;const u=[...r.memberActivity].sort((z,M)=>M.messageCount-z.messageCount).slice(0,2),I=u[0].messageCount+u[1].messageCount;return{member1:{name:u[0].name,avatar:u[0].avatar,count:u[0].messageCount,percentage:I>0?Math.round(u[0].messageCount/I*100):0},member2:{name:u[1].name,avatar:u[1].avatar,count:u[1].messageCount,percentage:I>0?Math.round(u[1].messageCount/I*100):0},total:I}}),C=q(()=>p.value?{labels:[p.value.member1.name,p.value.member2.name],values:[p.value.member1.count,p.value.member2.count]}:{labels:[],values:[]});return(k,u)=>(n(),d("div",Ws,[y(He,{session:$.session,"daily-activity":$.dailyActivity,"message-types":$.messageTypes,"hourly-activity":$.hourlyActivity,"time-range":$.timeRange,"selected-year":$.selectedYear,"filtered-message-count":$.filteredMessageCount,"time-filter":$.timeFilter},null,8,["session","daily-activity","message-types","hourly-activity","time-range","selected-year","filtered-message-count","time-filter"]),e("div",Ks,[y(t(_e),{title:t(a)("analysis.overview.messageTypeDistribution"),"show-divider":!1},{default:W(()=>[e("div",Hs,[y(t(we),{data:o.value,height:280},null,8,["data"])])]),_:1},8,["title"]),p.value?(n(),D(t(_e),{key:0,title:t(a)("analysis.overview.memberComparison"),"show-divider":!1},{default:W(()=>[e("div",Gs,[y(t(we),{data:C.value,height:280},null,8,["data"])])]),_:1},8,["title"])):A("",!0)]),y(Ge,{"daily-activity":$.dailyActivity,"daily-chart-data":t(_)},null,8,["daily-activity","daily-chart-data"])]))}}),Ys={class:"flex flex-col rounded-2xl bg-white p-4 ring-1 ring-gray-900/5 transition-colors dark:bg-transparent dark:ring-white/10"},Qs={class:"mb-2 min-h-8"},Zs={class:"flex items-center justify-between gap-2"},Xs={class:"flex min-w-0 items-center gap-2"},ea={class:"truncate text-xs font-bold tracking-wide text-gray-900 dark:text-white"},ta={key:0,class:"shrink-0"},sa={class:"flex h-full flex-col"},aa={class:"grid grid-cols-2 gap-2"},na={class:"flex min-w-0 flex-col items-center rounded-xl bg-white px-1 py-1.5 text-center dark:bg-transparent"},ia=["title"],la={class:"flex min-w-0 flex-col items-center rounded-xl bg-white px-1 py-1.5 text-center dark:bg-transparent"},oa=["title"],ra={class:"mt-auto pt-3 min-h-8 text-[10px] leading-relaxed text-gray-500 dark:text-gray-400 sm:min-h-6"},ue=Q({__name:"RelationshipMetricCard",props:{title:{},iconName:{},iconBgClass:{},iconColorClass:{},leftName:{default:"—"},leftValue:{default:"--"},rightName:{default:"—"},rightValue:{default:"--"},valueClass:{default:"text-gray-700 dark:text-gray-200"},description:{default:""}},setup($){const a=ze(),r=q(()=>!!a["header-extra"]);return(_,o)=>{const p=se;return n(),d("div",Ys,[e("div",Qs,[e("div",Zs,[e("div",Xs,[e("div",{class:O(["flex h-6 w-6 shrink-0 items-center justify-center rounded-full",$.iconBgClass])},[y(p,{name:$.iconName,class:O(["h-3.5 w-3.5",$.iconColorClass])},null,8,["name","class"])],2),e("span",ea,s($.title),1)]),r.value?(n(),d("div",ta,[Be(_.$slots,"header-extra")])):A("",!0)])]),e("div",sa,[e("div",aa,[e("div",na,[e("div",{class:"w-full truncate text-[10px] font-semibold tracking-wide text-gray-500 dark:text-gray-400",title:$.leftName},s($.leftName),9,ia),e("div",{class:O(["mt-2 font-black font-mono leading-none tabular-nums",$.valueClass])},s($.leftValue),3)]),e("div",la,[e("div",{class:"w-full truncate text-[10px] font-semibold tracking-wide text-gray-500 dark:text-gray-400",title:$.rightName},s($.rightName),9,oa),e("div",{class:O(["mt-2 font-black font-mono leading-none tabular-nums",$.valueClass])},s($.rightValue),3)])]),e("p",ra,s($.description),1)])])}}}),ca={key:1,class:"main-content mx-auto max-w-[920px] space-y-6 p-6"},da={class:"space-y-6"},ua={class:"relative z-10 flex flex-col items-center justify-center gap-10 px-6 pt-10 pb-6 sm:px-8 lg:flex-row lg:items-start lg:justify-between lg:gap-8 xl:gap-12"},ma={class:"flex min-w-0 max-w-full flex-1 flex-col items-center justify-center lg:items-start"},ga={class:"flex flex-col text-[15px] leading-relaxed text-gray-600 dark:text-gray-300"},pa={class:"mb-2 text-sm font-medium tracking-wide text-gray-500 dark:text-gray-400"},xa={class:"mb-4 flex min-w-0 flex-wrap items-baseline gap-2"},fa={class:"text-xl font-medium text-gray-700 dark:text-gray-300"},va={class:"font-black text-5xl tracking-tight text-gray-900 dark:text-white"},ba={class:"text-xl font-medium text-gray-700 dark:text-gray-300"},ha={class:"flex min-w-0 max-w-full flex-wrap items-baseline gap-x-1.5 gap-y-1"},ya={class:"text-base font-medium text-gray-600 dark:text-gray-300"},_a={class:"font-black text-3xl text-pink-500 dark:text-pink-400"},ka={class:"text-base font-medium text-gray-600 dark:text-gray-300"},wa={class:"max-w-full break-all text-xl font-bold leading-snug text-gray-900 dark:text-white"},$a={class:"text-base font-medium text-gray-600 dark:text-gray-300"},Ca={class:"mt-8 flex w-full max-w-[320px] items-center justify-between gap-4"},Sa={class:"flex flex-1 flex-col items-center overflow-hidden"},Pa=["title"],Ia={class:"mt-1 text-2xl font-black text-blue-500 dark:text-blue-400"},Ma={class:"mt-0.5 text-[10px] font-medium text-gray-400"},Ta={class:"flex flex-1 flex-col items-center overflow-hidden"},qa=["title"],Aa={class:"mt-1 text-2xl font-black text-pink-500 dark:text-pink-400"},ja={class:"mt-0.5 text-[10px] font-medium text-gray-400"},Ra={key:0,class:"flex min-w-0 w-full max-w-[400px] flex-1 flex-col justify-center lg:max-w-[460px]"},La={class:"mb-2 flex items-center justify-between px-1"},Va={class:"text-sm font-bold text-gray-900 dark:text-white"},Da={class:"text-[10px] font-medium text-gray-500 dark:text-gray-400"},za={class:"w-full"},Ba={class:"h-[200px] w-full"},Oa={class:"relative z-10 grid grid-cols-2 gap-3 p-4 pt-2 sm:p-6 sm:pt-2 lg:grid-cols-4"},Na={class:"relative z-10 flex items-center justify-between px-6 pb-4 opacity-40 mix-blend-luminosity dark:opacity-30 sm:px-8 sm:pb-5"},Ua={class:"flex items-center gap-1.5"},Fa={class:"text-[9px] font-medium uppercase tracking-widest"},Ea={class:"p-6 sm:p-8"},Wa={class:"relative ml-4 border-l-2 border-gray-100/80 py-4 dark:border-gray-800/80"},Ka={class:"absolute -left-[11px] top-1 flex h-5 w-5 items-center justify-center rounded-full bg-white ring-4 ring-white dark:bg-gray-900 dark:ring-gray-900"},Ha={class:"group relative overflow-hidden rounded-[20px] bg-card-bg shadow-sm ring-1 ring-gray-900/5 transition-all hover:-translate-y-0.5 hover:shadow-md dark:bg-card-dark dark:ring-white/10"},Ga={key:0,class:"pointer-events-none absolute inset-0 overflow-hidden opacity-30 transition-opacity group-hover:opacity-50"},Ja={class:"relative z-10 p-4 sm:p-5"},Ya={class:"flex items-center gap-3"},Qa={class:"text-xl font-bold tracking-tight text-gray-900 dark:text-white"},Za={key:0,class:"flex items-baseline gap-1.5"},Xa={class:"text-xs font-medium text-gray-500 dark:text-gray-400"},en={class:"text-2xl font-black leading-none text-gray-900 dark:text-white"},tn={class:"text-xs font-medium text-gray-500 dark:text-gray-400"},sn={key:0,class:"grid grid-cols-2 gap-3 lg:grid-cols-4"},an={class:"flex flex-col rounded-xl bg-blue-50/50 p-3 ring-1 ring-blue-100/50 dark:bg-blue-500/5 dark:ring-blue-500/10"},nn={class:"mb-2.5 flex items-center gap-1.5"},ln={class:"text-xs font-bold text-gray-700 dark:text-gray-300"},on={class:"flex flex-col gap-1.5"},rn={class:"flex items-center justify-between text-xs"},cn={class:"w-12 truncate font-medium text-gray-500 dark:text-gray-400"},dn={class:"font-black tabular-nums text-blue-600 dark:text-blue-400"},un={class:"flex items-center justify-between text-xs"},mn={class:"w-12 truncate font-medium text-gray-500 dark:text-gray-400"},gn={class:"font-black tabular-nums text-pink-500 dark:text-pink-400"},pn={class:"mt-3 flex h-1 w-full overflow-hidden rounded-full bg-gray-200 dark:bg-gray-700"},xn={class:"flex flex-col rounded-xl bg-indigo-50/50 p-3 ring-1 ring-indigo-100/50 dark:bg-indigo-500/5 dark:ring-indigo-500/10"},fn={class:"mb-2.5 flex items-center gap-1.5"},vn={class:"text-xs font-bold text-gray-700 dark:text-gray-300"},bn={class:"flex flex-col gap-1.5"},hn={class:"flex items-center justify-between text-xs"},yn={class:"w-12 truncate font-medium text-gray-500 dark:text-gray-400"},_n={class:"font-black tabular-nums text-indigo-600 dark:text-indigo-400"},kn={class:"flex items-center justify-between text-xs"},wn={class:"w-12 truncate font-medium text-gray-500 dark:text-gray-400"},$n={class:"font-black tabular-nums text-pink-500 dark:text-pink-400"},Cn={class:"mt-3 flex h-1 w-full overflow-hidden rounded-full bg-gray-200 dark:bg-gray-700"},Sn={class:"flex flex-col rounded-xl bg-amber-50/50 p-3 ring-1 ring-amber-100/50 dark:bg-amber-500/5 dark:ring-amber-500/10"},Pn={class:"mb-2.5 flex items-center gap-1.5"},In={class:"text-xs font-bold text-gray-700 dark:text-gray-300"},Mn={class:"flex flex-col gap-1.5"},Tn={class:"flex items-center justify-between text-xs"},qn={class:"w-12 truncate font-medium text-gray-500 dark:text-gray-400"},An={class:"font-black tabular-nums text-amber-600 dark:text-amber-500"},jn={class:"flex items-center justify-between text-xs"},Rn={class:"w-12 truncate font-medium text-gray-500 dark:text-gray-400"},Ln={class:"font-black tabular-nums text-amber-600 dark:text-amber-500"},Vn={class:"flex flex-col rounded-xl bg-purple-50/50 p-3 ring-1 ring-purple-100/50 dark:bg-purple-500/5 dark:ring-purple-500/10"},Dn={class:"mb-2.5 flex items-center gap-1.5"},zn={class:"text-xs font-bold text-gray-700 dark:text-gray-300"},Bn={class:"flex flex-col gap-1.5"},On={class:"flex items-center justify-between text-xs"},Nn={class:"w-12 truncate font-medium text-gray-500 dark:text-gray-400"},Un={class:"font-black tabular-nums text-purple-600 dark:text-purple-400"},Fn={class:"flex items-center justify-between text-xs"},En={class:"w-12 truncate font-medium text-gray-500 dark:text-gray-400"},Wn={class:"font-black tabular-nums text-purple-600 dark:text-purple-400"},Kn={key:1,class:"flex h-24 items-center justify-center text-sm font-medium text-gray-400 dark:text-gray-500"},Hn=Q({__name:"RelationshipView",props:{sessionId:{},timeFilter:{}},setup($){const{t:a,locale:r}=ee(),_=$,o=N(null),p=N(!1),C=N(!1),k=N(300);async function u(g){if(!_.sessionId)return;const h=g?.localOnly==="perseverance";h?C.value=!0:p.value=!0;try{o.value=await oe().getRelationshipStats(_.sessionId,_.timeFilter,{perseveranceThreshold:k.value})}catch(v){console.error("Failed to load relationship stats:",v)}finally{h?C.value=!1:p.value=!1}}X(()=>[_.sessionId,_.timeFilter],()=>u(),{immediate:!0,deep:!0});const I=[{label:"1m",value:60},{label:"3m",value:180},{label:"5m",value:300},{label:"10m",value:600},{label:"30m",value:1800}];function z(g){k.value!==g&&(k.value=g,u({localOnly:"perseverance"}))}const M=q({get:()=>k.value,set:g=>z(g)});function j(g){return a("views.relationship.perseverance.thresholdMinutes",{n:Math.round(g/60)})}const f=q(()=>a("views.relationship.perseverance.hintWithThreshold",{threshold:j(k.value)})),R=q(()=>o.value?.hasSessionIndex&&o.value.totalSessions>0),c=q(()=>o.value?.members[0]),x=q(()=>o.value?.members[1]),P=q(()=>{if(!c.value||!o.value)return 50;const g=(c.value.totalInitiateCount??0)+(x.value?.totalInitiateCount??0);return g===0?50:Math.round(c.value.totalInitiateCount/g*100)}),T=q(()=>{if(!o.value||o.value.months.length===0)return"";const g=[...o.value.months].sort((F,L)=>F.month.localeCompare(L.month)),h=g[0].month.replace("-","/"),v=g[g.length-1].month.replace("-","/");return h===v?h:`${h} – ${v}`}),m=q(()=>r.value.startsWith("en")?"max-w-[420px]":"max-w-[320px]");function l(g){return g<=0?0:g>=100?100:Math.max(5,Math.min(95,g))}const w=q(()=>{if(!o.value||o.value.months.length===0||!c.value)return{};const g=[...o.value.months].sort((K,G)=>K.month.localeCompare(G.month)),h=g.map(K=>E(K.month)),v=c.value.name,F=x.value?.name??"—",L=g.map(K=>{const G=K.members.find(de=>de.memberId===c.value.memberId);return!G||K.totalSessions===0?50:Math.round(G.initiateCount/K.totalSessions*100)});return{tooltip:{trigger:"axis",formatter(K){const G=K[0],de=G.value;return`${G.axisValue}<br/>${v}: ${de}%<br/>${F}: ${100-de}%`}},grid:{left:40,right:20,top:20,bottom:30},xAxis:{type:"category",data:h,axisLabel:{fontSize:11}},yAxis:{type:"value",min:0,max:100,axisLabel:{formatter:"{value}%",fontSize:11},splitLine:{lineStyle:{type:"dashed"}}},series:[{type:"line",data:L,smooth:!0,symbol:"circle",symbolSize:6,lineStyle:{width:2,color:"#3b82f6"},itemStyle:{color:"#3b82f6"},areaStyle:{color:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:"rgba(59, 130, 246, 0.15)"},{offset:1,color:"rgba(59, 130, 246, 0)"}]}},markLine:{silent:!0,data:[{yAxis:50,lineStyle:{type:"dashed",color:"#9ca3af"}}],label:{show:!1},symbol:"none"}}]}});function i(g){if(g.totalSessions===0)return a("views.relationship.labels.peacefulSilence");if(g.totalSessions<=2)return a("views.relationship.labels.fleetingThoughts");const v=[...g.members].sort((L,K)=>K.initiateCount-L.initiateCount)[0];if(!v||g.totalSessions===0)return"";const F=Math.round(v.initiateCount/g.totalSessions*100);return F>=40&&F<=60?a("views.relationship.labels.wellMatched"):F>=80?a("views.relationship.labels.monologue",{name:v.name}):a("views.relationship.labels.missingYou",{name:v.name})}function b(g){if(!c.value||g.totalSessions===0)return 50;const h=g.members.find(v=>v.memberId===c.value.memberId);return Math.round((h?.initiateCount??0)/g.totalSessions*100)}function V(g){if(!c.value)return 50;const v=g.members.find(L=>L.memberId===c.value.memberId)?.closeCount??0,F=g.members.reduce((L,K)=>L+(K.closeCount??0),0);return F===0?50:Math.round(v/F*100)}function B(g){const[h,v]=g.split("-");return a("views.relationship.monthFormat",{year:h,month:Number.parseInt(v,10)})}function E(g){const h=g.split("-");return a("views.relationship.monthShortFormat",{month:Number.parseInt(h[1],10)})}function Z(g){return!g||!o.value?.iceBreakers?.length?0:o.value.iceBreakers.filter(h=>h.memberId===g).reduce((h,v)=>h+v.count,0)}function te(g){if(!g||!o.value?.responseLatency?.length)return null;const h=o.value.responseLatency.find(v=>v.memberId===g);return h?h.avgResponseTime:null}function U(g){return!g||!o.value?.perseverance?.length?0:o.value.perseverance.find(v=>v.memberId===g)?.totalDoubleTexts??0}function ae(g){const h=te(g);return h!=null?S(h):"--"}function be(g){return o.value?.monthlyResponseLatency?.find(h=>h.month===g)?.members??[]}function he(g){return o.value?.monthlyPerseverance?.find(h=>h.month===g)?.members??[]}function ce(g,h){if(!h)return"--";const v=be(g).find(F=>F.memberId===h);return v?S(v.avgResponseTime):"--"}function Y(g,h){if(!h)return"--";const v=he(g).find(F=>F.memberId===h);return v?v.doubleTextCount.toString():"--"}function S(g){const h=Math.max(0,Math.round(g));if(h<60)return a("views.relationship.responseLatency.seconds",{n:h});if(h<3600){const L=Math.floor(h/60),K=h%60;return a("views.relationship.responseLatency.minutesSeconds",{m:L,s:K})}const v=Math.floor(h/3600),F=Math.floor(h%3600/60);return F===0?a("views.relationship.responseLatency.hours",{n:v}):a("views.relationship.responseLatency.hoursMinutes",{h:v,m:F})}return(g,h)=>{const v=je,F=se;return n(),d("div",{class:O(p.value?"h-full":"")},[p.value?(n(),D(t(me),{key:0,variant:"page",text:t(a)("common.loading")},null,8,["text"])):(n(),d("div",ca,[o.value&&!R.value?(n(),D(t(Me),{key:0,icon:"i-heroicons-heart",title:t(a)("views.relationship.empty.title"),description:t(a)("views.relationship.empty.description")},null,8,["title","description"])):o.value&&R.value?(n(),d(H,{key:1},[e("div",da,[y(t(le),{id:"shareable-poster",variant:"elevated",decorative:"",class:"flex flex-col"},{default:W(()=>[e("div",ua,[e("div",ma,[e("div",{class:O(["flex w-fit min-w-0 flex-col items-start text-left",m.value])},[e("div",ga,[e("p",pa,s(T.value),1),e("div",xa,[e("span",fa,s(t(a)("views.relationship.hero.totalSessionsPrefix")),1),e("span",va,s(o.value.totalSessions),1),e("span",ba,s(t(a)("views.relationship.hero.totalSessionsSuffix")),1)]),e("div",ha,[e("span",ya,s(t(a)("views.relationship.hero.initiativePrefix")),1),e("span",_a,s(P.value>=50?P.value:100-P.value)+"% ",1),e("span",ka,s(t(a)("views.relationship.hero.initiativeByPrefix")),1),e("span",wa,s(P.value>=50?c.value?.name:x.value?.name),1),e("span",$a,s(t(a)("views.relationship.hero.initiativeBySuffix")),1)])]),e("div",Ca,[e("div",Sa,[e("div",{class:"w-full truncate text-center text-xs font-bold text-gray-500 dark:text-gray-400",title:c.value?.name},s(c.value?.name),9,Pa),e("div",Ia,s(c.value?.totalInitiateCount),1),e("div",Ma,s(t(a)("views.relationship.hero.initiateTimes")),1)]),h[1]||(h[1]=e("div",{class:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-gray-100 font-black text-[10px] italic text-gray-400 shadow-inner dark:bg-gray-900/80 dark:text-gray-500"}," VS ",-1)),e("div",Ta,[e("div",{class:"w-full truncate text-center text-xs font-bold text-gray-500 dark:text-gray-400",title:x.value?.name},s(x.value?.name),9,qa),e("div",Aa,s(x.value?.totalInitiateCount),1),e("div",ja,s(t(a)("views.relationship.hero.initiateTimes")),1)])])],2)]),o.value.months.length>=2?(n(),d("div",Ra,[e("div",La,[e("span",Va,s(t(a)("views.relationship.trend.title")),1),e("span",Da,s(t(a)("views.relationship.trend.hint",{name:c.value?.name??""})),1)]),e("div",za,[e("div",Ba,[y(t(Qe),{option:w.value,height:200},null,8,["option"])])])])):A("",!0)]),e("div",Oa,[y(ue,{title:t(a)("views.relationship.closerTitle"),"icon-name":"i-heroicons-hand-raised-solid","icon-bg-class":"bg-blue-100 dark:bg-blue-500/20","icon-color-class":"text-blue-600 dark:text-blue-400","left-name":c.value?.name,"left-value":c.value?.totalCloseCount??0,"right-name":x.value?.name,"right-value":x.value?.totalCloseCount??0,"value-class":"text-lg text-blue-600 dark:text-blue-400",description:t(a)("views.relationship.closerHint")},null,8,["title","left-name","left-value","right-name","right-value","description"]),y(ue,{title:t(a)("views.relationship.iceBreaker.title"),"icon-name":"i-heroicons-fire-solid","icon-bg-class":"bg-pink-100 dark:bg-pink-500/20","icon-color-class":"text-pink-600 dark:text-pink-400","left-name":c.value?.name,"left-value":Z(c.value?.memberId),"right-name":x.value?.name,"right-value":Z(x.value?.memberId),"value-class":"text-lg text-pink-600 dark:text-pink-400",description:t(a)("views.relationship.iceBreaker.hint")},null,8,["title","left-name","left-value","right-name","right-value","description"]),y(ue,{title:t(a)("views.relationship.responseLatency.title"),"icon-name":"i-heroicons-clock-solid","icon-bg-class":"bg-amber-100 dark:bg-amber-500/20","icon-color-class":"text-amber-600 dark:text-amber-400","left-name":c.value?.name,"left-value":ae(c.value?.memberId),"right-name":x.value?.name,"right-value":ae(x.value?.memberId),"value-class":"text-base text-amber-600 dark:text-amber-400",description:t(a)("views.relationship.responseLatency.hint")},null,8,["title","left-name","left-value","right-name","right-value","description"]),y(ue,{title:t(a)("views.relationship.perseverance.title"),"icon-name":"i-heroicons-arrow-path-solid","icon-bg-class":"bg-purple-100 dark:bg-purple-500/20","icon-color-class":"text-purple-600 dark:text-purple-400","left-name":c.value?.name,"left-value":U(c.value?.memberId),"right-name":x.value?.name,"right-value":U(x.value?.memberId),"value-class":"text-lg text-purple-600 dark:text-purple-400",description:f.value},{"header-extra":W(()=>[y(v,{modelValue:M.value,"onUpdate:modelValue":h[0]||(h[0]=L=>M.value=L),items:I,"value-key":"value",size:"xs",class:"relative z-[120] w-16",ui:{content:"z-[121]"},disabled:C.value},null,8,["modelValue","disabled"])]),_:1},8,["title","left-name","left-value","right-name","right-value","description"])]),e("div",Na,[e("div",Ua,[y(F,{name:"i-heroicons-chat-bubble-left-right-solid",class:"h-3.5 w-3.5"}),h[2]||(h[2]=e("span",{class:"text-[10px] font-bold uppercase tracking-wider"},"ChatLab",-1))]),e("span",Fa,s(t(a)("views.relationship.watermarkReport")),1)])]),_:1})]),y(t(_e),{title:t(a)("views.relationship.monthly.title"),"show-divider":!1},{default:W(()=>[e("div",Ea,[e("div",Wa,[(n(!0),d(H,null,J(o.value.months,(L,K)=>(n(),d("div",{key:L.month,class:"relative pb-12 pl-10 last:pb-0"},[e("div",Ka,[e("div",{class:O(["h-2.5 w-2.5 rounded-full shadow-sm",L.totalSessions>0?K===0?"bg-pink-500 animate-pulse":"bg-pink-400":"bg-gray-300 dark:bg-gray-600"])},null,2)]),e("div",Ha,[L.totalSessions>0?(n(),d("div",Ga,[...h[3]||(h[3]=[e("div",{class:"absolute -left-[10%] top-[20%] h-[60%] w-[40%] rounded-full bg-blue-400/10 blur-[40px] dark:bg-blue-500/20"},null,-1),e("div",{class:"absolute -right-[10%] bottom-[20%] h-[60%] w-[40%] rounded-full bg-pink-400/10 blur-[40px] dark:bg-pink-500/20"},null,-1)])])):A("",!0),e("div",Ja,[e("div",{class:O(["flex items-center justify-between",L.totalSessions>0?"mb-4":""])},[e("div",Ya,[e("span",Qa,s(B(L.month)),1),e("span",{class:O(["rounded-lg px-2.5 py-1 text-xs font-semibold",L.totalSessions===0?"bg-gray-50 text-gray-500 dark:bg-gray-800/50 dark:text-gray-400":"bg-pink-50 text-pink-600 dark:bg-pink-500/10 dark:text-pink-400"])},s(i(L)),3)]),L.totalSessions>0?(n(),d("div",Za,[e("span",Xa,s(t(a)("views.relationship.monthly.totalSessionsPrefix")),1),e("span",en,s(L.totalSessions),1),e("span",tn,s(t(a)("views.relationship.monthly.totalSessionsSuffix")),1)])):A("",!0)],2),L.totalSessions>0?(n(),d("div",sn,[e("div",an,[e("div",nn,[y(F,{name:"i-heroicons-chat-bubble-bottom-center-text-solid",class:"h-3.5 w-3.5 text-blue-500 dark:text-blue-400"}),e("span",ln,s(t(a)("views.relationship.initiator")),1)]),e("div",on,[e("div",rn,[e("span",cn,s(c.value?.name),1),e("span",dn,s(L.members.find(G=>G.memberId===c.value?.memberId)?.initiateCount??0),1)]),e("div",un,[e("span",mn,s(x.value?.name),1),e("span",gn,s(L.members.find(G=>G.memberId===x.value?.memberId)?.initiateCount??0),1)])]),e("div",pn,[e("div",{class:"bg-blue-500 dark:bg-blue-400",style:ne({width:l(b(L))+"%"})},null,4),e("div",{class:"bg-pink-500 dark:bg-pink-400",style:ne({width:l(100-b(L))+"%"})},null,4)])]),e("div",xn,[e("div",fn,[y(F,{name:"i-heroicons-hand-raised-solid",class:"h-3.5 w-3.5 text-indigo-500 dark:text-indigo-400"}),e("span",vn,s(t(a)("views.relationship.closer")),1)]),e("div",bn,[e("div",hn,[e("span",yn,s(c.value?.name),1),e("span",_n,s(L.members.find(G=>G.memberId===c.value?.memberId)?.closeCount??0),1)]),e("div",kn,[e("span",wn,s(x.value?.name),1),e("span",$n,s(L.members.find(G=>G.memberId===x.value?.memberId)?.closeCount??0),1)])]),e("div",Cn,[e("div",{class:"bg-indigo-500 dark:bg-indigo-400",style:ne({width:l(V(L))+"%"})},null,4),e("div",{class:"bg-pink-500 dark:bg-pink-400",style:ne({width:l(100-V(L))+"%"})},null,4)])]),e("div",Sn,[e("div",Pn,[y(F,{name:"i-heroicons-clock-solid",class:"h-3.5 w-3.5 text-amber-500 dark:text-amber-400"}),e("span",In,s(t(a)("views.relationship.responseLatency.title")),1)]),e("div",Mn,[e("div",Tn,[e("span",qn,s(c.value?.name),1),e("span",An,s(ce(L.month,c.value?.memberId)),1)]),e("div",jn,[e("span",Rn,s(x.value?.name),1),e("span",Ln,s(ce(L.month,x.value?.memberId)),1)])])]),e("div",Vn,[e("div",Dn,[y(F,{name:"i-heroicons-arrow-path-solid",class:"h-3.5 w-3.5 text-purple-500 dark:text-purple-400"}),e("span",zn,s(t(a)("views.relationship.perseverance.title")),1)]),e("div",Bn,[e("div",On,[e("span",Nn,s(c.value?.name),1),e("span",Un,s(Y(L.month,c.value?.memberId)),1)]),e("div",Fn,[e("span",En,s(x.value?.name),1),e("span",Wn,s(Y(L.month,x.value?.memberId)),1)])])])])):(n(),d("div",Kn,s(t(a)("views.relationship.noActivity")),1))])])]))),128))])])]),_:1},8,["title"])],64)):A("",!0)]))],2)}}}),Gn={class:"flex h-full flex-col"},Jn={class:"flex-1 min-h-0 overflow-auto"},Yn=Q({__name:"ViewTab",props:{sessionId:{},sessionName:{},timeFilter:{}},setup($){const{t:a}=ee(),r=$,_=q(()=>[{id:"relationship",label:a("analysis.subTabs.view.relationship"),icon:"i-heroicons-heart"},{id:"type-analysis",label:a("analysis.subTabs.view.typeAnalysis"),icon:"i-heroicons-chart-pie"},{id:"time-analysis",label:a("analysis.subTabs.view.timeAnalysis"),icon:"i-heroicons-clock"},{id:"topic",label:a("analysis.subTabs.view.topic"),icon:"i-heroicons-cloud"},{id:"language-preference",label:a("analysis.subTabs.view.languagePreference"),icon:"i-heroicons-language"}]),o=N("relationship"),p=N(null),C=q(()=>({...r.timeFilter,memberId:p.value}));return(k,u)=>(n(),d("div",Gn,[y(t(Fe),{modelValue:o.value,"onUpdate:modelValue":u[1]||(u[1]=I=>o.value=I),items:_.value,"persist-key":"privateViewTab"},{right:W(()=>[o.value==="type-analysis"||o.value==="time-analysis"?(n(),D(Ze,{key:0,modelValue:p.value,"onUpdate:modelValue":u[0]||(u[0]=I=>p.value=I),"session-id":r.sessionId},null,8,["modelValue","session-id"])):A("",!0)]),_:1},8,["modelValue","items"]),e("div",Jn,[y(Se,{name:"fade",mode:"out-in"},{default:W(()=>[o.value==="type-analysis"?(n(),D(Xe,{key:0,"session-id":r.sessionId,"session-name":r.sessionName,"time-filter":C.value},null,8,["session-id","session-name","time-filter"])):o.value==="time-analysis"?(n(),D(et,{key:1,"session-id":r.sessionId,"session-name":r.sessionName,"time-filter":C.value},null,8,["session-id","session-name","time-filter"])):o.value==="relationship"?(n(),D(Hn,{key:2,"session-id":r.sessionId,"time-filter":r.timeFilter},null,8,["session-id","time-filter"])):o.value==="topic"?(n(),D(t(tt),{key:3,"session-id":r.sessionId,"time-filter":r.timeFilter,"show-shared-topics":!0},null,8,["session-id","time-filter"])):o.value==="language-preference"?(n(),D(t(Es),{key:4,"session-id":r.sessionId,"time-filter":r.timeFilter},null,8,["session-id","time-filter"])):A("",!0)]),_:1})])]))}}),Qn=Ie(Yn,[["__scopeId","data-v-9043b751"]]),Zn={class:"main-content max-w-4xl p-6"},Xn={key:0,class:"mb-6"},ei={class:"flex items-center gap-3"},ti={class:"text-xl font-bold text-gray-900 dark:text-white"},si={class:"text-sm text-gray-500 dark:text-gray-400"},ai={key:1,class:"flex h-60 items-center justify-center"},ni={key:2,class:"mb-4 flex items-center justify-end gap-2"},ii={class:"text-xs text-gray-500 dark:text-gray-400"},li={key:3,class:"grid gap-4 md:grid-cols-2"},oi={class:"absolute right-4 top-4"},ri={class:"flex items-start gap-4"},ci=["src","alt"],di={key:1,class:"flex h-14 w-14 shrink-0 items-center justify-center rounded-full bg-linear-to-br from-pink-400 to-pink-600 text-lg font-medium text-white"},ui={class:"flex-1 min-w-0"},mi={class:"text-lg font-semibold text-gray-900 dark:text-white truncate"},gi={class:"text-sm text-gray-500 dark:text-gray-400"},pi={class:"mt-4 flex items-center gap-4"},xi={class:"flex-1"},fi={class:"flex items-baseline justify-between"},vi={class:"text-sm text-gray-500 dark:text-gray-400"},bi={class:"text-lg font-bold text-gray-900 dark:text-white"},hi={class:"mt-2 h-2 w-full overflow-hidden rounded-full bg-gray-100 dark:bg-gray-800"},yi={class:"mt-1 text-xs text-gray-400 dark:text-gray-500"},_i={class:"mt-4 border-t border-gray-100 pt-4 dark:border-gray-800"},ki={class:"mb-2 block text-sm font-medium text-gray-700 dark:text-gray-300"},wi={class:"relative"},$i={key:0,class:"absolute right-3 top-1/2 -translate-y-1/2"},Ci={key:4,class:"flex h-60 flex-col items-center justify-center"},Si={class:"text-gray-500 dark:text-gray-400"},Pi={key:5,class:"mt-6 flex items-start gap-3 rounded-xl bg-blue-50 p-4 dark:bg-blue-900/20"},Ii={class:"text-sm font-medium text-blue-800 dark:text-blue-200"},Mi={class:"mt-1 text-sm text-blue-700 dark:text-blue-300"},Ti={class:"p-6"},qi={class:"mb-4 flex items-center gap-3"},Ai={class:"flex h-10 w-10 items-center justify-center rounded-full bg-amber-100 dark:bg-amber-900/30"},ji={class:"text-lg font-semibold text-gray-900 dark:text-white"},Ri={class:"mb-2 text-sm text-gray-600 dark:text-gray-400"},Li={class:"mb-6 text-xs text-amber-700 dark:text-amber-300"},Vi={class:"flex justify-end gap-2"},Di=Q({__name:"MemberTab",props:{sessionId:{},showHeader:{type:Boolean,default:!0}},setup($){const{t:a}=ee(),r=$,_=N([]),o=N(!1),p=N(null),C=N(new Set),k=N(!1),u=N(!1);function I(i){return i.groupNickname||i.accountName||i.platformId}function z(i){return I(i).slice(0,1)}const M=q(()=>_.value.filter(i=>C.value.has(i.id))),j=q(()=>M.value.length===2),f=q(()=>{if(M.value.length!==2)return null;const[i,b]=M.value;return b.messageCount>i.messageCount||b.messageCount===i.messageCount&&b.id<i.id?{primary:b,secondary:i}:{primary:i,secondary:b}}),R=q(()=>_.value.reduce((i,b)=>i+b.messageCount,0));function c(i){return R.value===0?0:Math.round(i/R.value*100)}async function x(){if(r.sessionId){o.value=!0;try{_.value=await oe().getMembers(r.sessionId)}catch(i){console.error("加载成员列表失败:",i)}finally{o.value=!1}}}async function P(i,b){const V=JSON.parse(JSON.stringify(b)),B=JSON.stringify(i.aliases),E=JSON.stringify(V);if(B!==E){p.value=i.id;try{if(await oe().updateMemberAliases(r.sessionId,i.id,V)){const te=_.value.findIndex(U=>U.id===i.id);te!==-1&&(_.value[te]={..._.value[te],aliases:V})}}catch(Z){console.error("保存别名失败:",Z)}finally{p.value=null}}}function T(i){const b=new Set(C.value);b.has(i)?b.delete(i):b.add(i),C.value=b}function m(){j.value&&(k.value=!0)}function l(){C.value=new Set}async function w(){if(f.value){u.value=!0;try{await oe().mergeMembers(r.sessionId,f.value.primary.id,f.value.secondary.id)&&(k.value=!1,l(),await x())}catch(i){console.error("合并成员失败:",i)}finally{u.value=!1}}}return X(()=>r.sessionId,()=>{l(),x()},{immediate:!0}),re(()=>{x()}),(i,b)=>{const V=se,B=$e,E=Re,Z=Le,te=Ce;return n(),d("div",Zn,[r.showHeader?(n(),d("div",Xn,[e("div",ei,[e("div",null,[e("h2",ti,s(t(a)("members.private.title")),1),e("p",si,s(t(a)("members.private.description",{count:_.value.length})),1)])])])):A("",!0),y(st,{class:"mb-6","session-id":$.sessionId,members:_.value,"chat-type":"private"},null,8,["session-id","members"]),o.value?(n(),d("div",ai,[y(V,{name:"i-heroicons-arrow-path",class:"h-8 w-8 animate-spin text-pink-500"})])):A("",!0),!o.value&&_.value.length>1?(n(),d("div",ni,[e("span",ii,s(t(a)("members.list.mergeSelectedCount",{count:C.value.size})),1),y(B,{icon:"i-heroicons-link",size:"sm",color:"primary",disabled:!j.value,onClick:m},{default:W(()=>[ye(s(t(a)("members.list.mergeSelected")),1)]),_:1},8,["disabled"])])):A("",!0),o.value?A("",!0):(n(),d("div",li,[(n(!0),d(H,null,J(_.value,U=>(n(),d("div",{key:U.id,class:"relative rounded-xl border border-gray-200 bg-white p-5 shadow-sm dark:border-gray-700 dark:bg-gray-900"},[e("div",oi,[y(E,{"model-value":C.value.has(U.id),onClick:Oe(ae=>T(U.id),["stop"])},null,8,["model-value","onClick"])]),e("div",ri,[U.avatar?(n(),d("img",{key:0,src:U.avatar,alt:I(U),class:"h-14 w-14 shrink-0 rounded-full object-cover"},null,8,ci)):(n(),d("div",di,s(z(U)),1)),e("div",ui,[e("h3",mi,s(I(U)),1),e("p",gi,"ID: "+s(U.platformId),1)])]),e("div",pi,[e("div",xi,[e("div",fi,[e("span",vi,s(t(a)("members.private.messageCount")),1),e("span",bi,s(U.messageCount.toLocaleString()),1)]),e("div",hi,[e("div",{class:"h-full rounded-full bg-linear-to-r from-pink-400 to-pink-600 transition-all duration-500",style:ne({width:`${c(U.messageCount)}%`})},null,4)]),e("p",yi,s(t(a)("members.private.percentage",{value:c(U.messageCount)})),1)])]),e("div",_i,[e("label",ki,s(t(a)("members.private.customAlias")),1),e("div",wi,[y(Z,{"model-value":U.aliases,placeholder:t(a)("members.private.aliasPlaceholder"),class:"w-full","onUpdate:modelValue":ae=>P(U,ae)},null,8,["model-value","placeholder","onUpdate:modelValue"]),p.value===U.id?(n(),d("div",$i,[y(V,{name:"i-heroicons-arrow-path",class:"h-4 w-4 animate-spin text-pink-500"})])):A("",!0)])])]))),128))])),!o.value&&_.value.length===0?(n(),d("div",Ci,[y(V,{name:"i-heroicons-user-group",class:"mb-3 h-12 w-12 text-gray-300 dark:text-gray-600"}),e("p",Si,s(t(a)("members.private.empty")),1)])):A("",!0),_.value.length>0?(n(),d("div",Pi,[y(V,{name:"i-heroicons-information-circle",class:"mt-0.5 h-5 w-5 shrink-0 text-blue-500"}),e("div",null,[e("p",Ii,s(t(a)("members.private.tipTitle")),1),e("p",Mi,s(t(a)("members.private.tipContent")),1)])])):A("",!0),y(te,{open:k.value,ui:{content:"max-w-md"},"onUpdate:open":b[1]||(b[1]=U=>k.value=U)},{content:W(()=>[e("div",Ti,[e("div",qi,[e("div",Ai,[y(V,{name:"i-heroicons-link",class:"h-5 w-5 text-amber-600 dark:text-amber-400"})]),e("h3",ji,s(t(a)("members.list.mergeModal.title")),1)]),e("p",Ri,s(t(a)("members.list.mergeModal.content",{source:f.value?I(f.value.secondary):"",sourceCount:f.value?f.value.secondary.messageCount.toLocaleString():"0",target:f.value?I(f.value.primary):"",targetCount:f.value?f.value.primary.messageCount.toLocaleString():"0"})),1),e("p",Li,s(t(a)("members.list.mergeModal.hint")),1),e("div",Vi,[y(B,{variant:"outline",disabled:u.value,onClick:b[0]||(b[0]=U=>k.value=!1)},{default:W(()=>[ye(s(t(a)("members.list.mergeModal.cancel")),1)]),_:1},8,["disabled"]),y(B,{color:"primary",loading:u.value,onClick:w},{default:W(()=>[ye(s(t(a)("members.list.mergeModal.confirm")),1)]),_:1},8,["loading"])])])]),_:1},8,["open"])])}}}),zi={class:"flex h-full flex-col bg-white dark:bg-gray-900",style:{"padding-top":"var(--titlebar-area-height)"}},Bi={class:"relative flex-1 overflow-y-auto"},Oi={class:"h-full"},Ni={key:2,class:"flex h-full items-center justify-center"},Ui={class:"text-gray-500"},Fi={class:"flex h-full flex-col overflow-hidden bg-white dark:bg-gray-900"},Ei={class:"flex flex-none items-center justify-between border-b border-gray-200 px-5 py-3 dark:border-gray-700"},Wi={class:"text-lg font-semibold text-gray-900 dark:text-white"},Ki={class:"text-sm text-gray-500 dark:text-gray-400"},Hi={class:"flex-1 overflow-auto"},Gi=Q({__name:"index",setup($){const a=Ne(()=>Ae(()=>import("./MessageExportModal-CF6yaor7.js"),__vite__mapDeps([0,1,2,3,4,5]))),{t:r}=ee(),_=Ve(),o=De(),p=Ee(),C=Pe(),k=We(),{currentSessionId:u}=Ke(p),I=N(!1),z=N(!1),M=N(!1),j=N(!1),f=N(!1);function R(){C.openChatRecordDrawer({})}const c=[{id:"overview",labelKey:"analysis.tabs.overview",icon:"i-heroicons-chart-pie"},{id:"view",labelKey:"analysis.tabs.view",icon:"i-heroicons-presentation-chart-bar"},{id:"ai-chat",labelKey:"analysis.tabs.aiChat",icon:"i-heroicons-chat-bubble-left-ellipsis"},{id:"lab",labelKey:"analysis.tabs.lab",icon:"i-heroicons-beaker"}],x=q(()=>k.debugMode?[...c,{id:"debug",labelKey:"analysis.tabs.debug",icon:"i-heroicons-bug-ant"}]:c),{activeTab:P,isLoading:T,isInitialLoad:m,session:l,memberActivity:w,hourlyActivity:i,dailyActivity:b,messageTypes:V,timeRangeValue:B,fullTimeRange:E,timeFilter:Z,selectedYearForOverview:te,initialTimeState:U,loadAnalysisData:ae}=at({route:_,router:o,currentSessionId:u,selectSession:p.selectSession,defaultTab:k.defaultSessionTab,validTabIds:x.value.map(Y=>Y.id)}),be=q(()=>w.value.reduce((Y,S)=>Y+S.messageCount,0)),he=q(()=>w.value.filter(Y=>Y.messageCount>0).length),ce=q(()=>{if(!l.value||w.value.length===0)return null;if(l.value.ownerId){const S=w.value.find(g=>g.platformId!==l.value?.ownerId);if(S?.avatar)return S.avatar}const Y=w.value.find(S=>S.name===l.value?.name);return Y?.avatar?Y.avatar:(w.value.length,null)});return(Y,S)=>{const g=$e,h=Ce;return n(),d("div",zi,[t(m)?(n(),D(me,{key:0,variant:"page",text:t(r)("analysis.privateChat.loading")},null,8,["text"])):t(l)?(n(),d(H,{key:1},[y(nt,{"active-tab":t(P),"onUpdate:activeTab":S[0]||(S[0]=v=>ke(P)?P.value=v:null),"time-range-value":t(B),"onUpdate:timeRangeValue":S[1]||(S[1]=v=>ke(B)?B.value=v:null),title:t(l).name,avatar:ce.value,icon:"i-heroicons-user","icon-class":"bg-pink-600 text-white dark:bg-pink-500 dark:text-white",tabs:x.value,"current-session-id":t(u),"initial-time-state":t(U),onOpenIncrementalImport:S[2]||(S[2]=v=>M.value=!0),onOpenMemberManagement:S[3]||(S[3]=v=>f.value=!0),onOpenChatRecord:R,"onUpdate:fullRange":S[4]||(S[4]=v=>E.value=v)},null,8,["active-tab","time-range-value","title","avatar","tabs","current-session-id","initial-time-state"]),e("div",Bi,[t(T)?(n(),D(me,{key:0,variant:"overlay",text:t(r)("common.loading")},null,8,["text"])):A("",!0),e("div",Oi,[y(Se,{name:"tab-slide",mode:"out-in"},{default:W(()=>[t(P)==="overview"?(n(),D(Js,{key:"overview-"+t(u),session:t(l),"member-activity":t(w),"message-types":t(V),"hourly-activity":t(i),"daily-activity":t(b),"time-range":t(E),"selected-year":t(te),"filtered-message-count":be.value,"filtered-member-count":he.value,"time-filter":t(Z)},null,8,["session","member-activity","message-types","hourly-activity","daily-activity","time-range","selected-year","filtered-message-count","filtered-member-count","time-filter"])):t(P)==="view"?(n(),D(Qn,{key:"view-"+t(u),"session-id":t(u),"session-name":t(l).name,"time-filter":t(Z)},null,8,["session-id","session-name","time-filter"])):t(P)==="ai-chat"?(n(),D(t(ct),{key:"ai-chat-"+t(u),"session-id":t(u),"session-name":t(l).name,"chat-type":"private"},null,8,["session-id","session-name"])):t(P)==="memory"?(n(),D(dt,{key:"memory-"+t(u),"session-id":t(u),"session-name":t(l).name},null,8,["session-id","session-name"])):t(P)==="lab"?(n(),D(ut,{key:"lab-"+t(u),"session-id":t(u),"session-name":t(l).name,"time-filter":t(Z),"chat-type":"private",mode:"sql-only"},null,8,["session-id","session-name","time-filter"])):t(P)==="debug"?(n(),D(t(mt),{key:"debug-"+t(u),"session-id":t(u)},null,8,["session-id"])):A("",!0)]),_:1})])]),y(it,{onOpenIncrementalImport:S[5]||(S[5]=v=>M.value=!0),onOpenSessionIndex:S[6]||(S[6]=v=>I.value=!0),onOpenMemberManagement:S[7]||(S[7]=v=>f.value=!0),onOpenChatRecord:R,onOpenMessageExport:S[8]||(S[8]=v=>j.value=!0)}),t(k).debugMode?(n(),D(gt,{key:0})):A("",!0)],64)):(n(),d("div",Ni,[e("p",Ui,s(t(r)("analysis.privateChat.loadError")),1)])),t(u)&&t(l)&&t(l).messageCount>0?(n(),D(lt,{key:3,modelValue:I.value,"onUpdate:modelValue":S[9]||(S[9]=v=>I.value=v),"session-id":t(u),"message-count":t(l).messageCount},null,8,["modelValue","session-id","message-count"])):A("",!0),t(u)&&t(l)&&!I.value?(n(),D(ot,{key:4,modelValue:z.value,"onUpdate:modelValue":S[10]||(S[10]=v=>z.value=v),"session-id":t(u),"chat-type":"private","auto-check":""},null,8,["modelValue","session-id"])):A("",!0),t(u)&&t(l)?(n(),D(rt,{key:5,modelValue:M.value,"onUpdate:modelValue":S[11]||(S[11]=v=>M.value=v),"session-id":t(u),"session-name":t(l).name,onImported:S[12]||(S[12]=()=>{t(ae)(),t(p).loadSessions()})},null,8,["modelValue","session-id","session-name"])):A("",!0),t(u)?(n(),D(t(a),{key:6,modelValue:j.value,"onUpdate:modelValue":S[13]||(S[13]=v=>j.value=v)},null,8,["modelValue"])):A("",!0),t(u)?(n(),D(h,{key:7,open:f.value,"onUpdate:open":S[15]||(S[15]=v=>f.value=v),ui:{content:"max-w-6xl h-[85vh]"}},{content:W(()=>[e("div",Fi,[e("div",Ei,[e("div",null,[e("h2",Wi,s(t(r)("analysis.tooltip.memberManagement")),1),e("p",Ki,s(t(r)("members.private.description",{count:t(l)?.memberCount??0})),1)]),y(g,{variant:"ghost",icon:"i-heroicons-x-mark",size:"sm",onClick:S[14]||(S[14]=v=>f.value=!1)})]),e("div",Hi,[y(Di,{"session-id":t(u),"show-header":!1},null,8,["session-id"])])])]),_:1},8,["open"])):A("",!0)])}}}),nl=Ie(Gi,[["__scopeId","data-v-daf8ed15"]]);export{nl as default};
@@ -1,64 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/EChartWordcloud-B_YisOW5.js","assets/vendor-echarts-wordcloud-B1kQMklB.js","assets/vendor-echarts-CITQeskI.js","assets/vendor-zrender-DFl4U2Oe.js","assets/vendor-reka-ui-mMvma1EP.js","assets/MessageExportModal-CF6yaor7.js","assets/vendor-nuxt-ui-Zy8txNdC.js","assets/index-wPAmuQZY.js","assets/vendor-snapdom-XnBoh1gd.js","assets/index-HgIuP1Td.css"])))=>i.map(i=>d[i]);
2
- import{_ as Ue}from"./vendor-snapdom-XnBoh1gd.js";import{k as Qe,g as he,b as re,l as Ze,a as Ie,j as Fe,c as Xe,e as Be,_ as et,n as tt,D as at,u as st,d as ot}from"./vendor-nuxt-ui-Zy8txNdC.js";import{b as S,d as pe,F as Se,p as H,G as o,P as k,Q,a5 as a,Z as W,a3 as X,T as u,O as He,J as nt,H as I,a0 as ve,h as $,w as O,u as e,K as T,L as f,U as D,R as G,bI as We,a9 as je,bJ as lt,au as Oe,bF as Ee,n as we,bD as Te,i as De}from"./vendor-reka-ui-mMvma1EP.js";import{p as it,u as ee,k as Me,T as le,j as K,q as rt,r as Pe,_ as Ve,t as ct,e as ut,b as dt,s as mt}from"./index-wPAmuQZY.js";import{_ as te,a as q,g as qe,b as vt,c as se,d as ne,e as ht,f as Ce,h as pt,i as Ne,j as gt,u as ft,k as yt,l as xt,m as bt,n as kt,o as _t,p as wt,q as $t,r as Ct,s as It,t as St,v as Tt,w as Mt,x as Vt,y as Rt,z as Dt,C as Nt,A as Lt,B as At,D as zt,E as Ut}from"./DebugToolsPanel.vue_vue_type_script_setup_true_lang-BTdqmm0y.js";import"./vendor-echarts-wordcloud-B1kQMklB.js";import{u as Ge,i as Ft,j as Ye,k as Bt,m as Ke,n as Je,o as Ht,p as Wt,q as jt}from"./vendor-echarts-CITQeskI.js";import{a as Le}from"./index-Qh0XLt3R.js";import"./vendor-zrender-DFl4U2Oe.js";function Ot(h,s={}){const{threshold:t=300,containerSelector:l=".overflow-y-auto",scrollLockDuration:m=800}=s,c=S(h[0]?.id||"");let v=!1;const p=S(null);let d=null;function y(){if(v)return;const i=[];h.forEach(r=>{const _=document.getElementById(r.id);if(_){const b=_.getBoundingClientRect();i.push({id:r.id,top:Math.round(b.top)})}});let n=0;for(let r=0;r<i.length;r++){if(i[r].top>t){n=Math.max(0,r-1);break}n=r}c.value=h[n]?.id||""}function g(i){const n=document.getElementById(i);n&&(c.value=i,v=!0,n.scrollIntoView({behavior:"smooth",block:"start"}),setTimeout(()=>{v=!1,y()},m))}return pe(()=>{d=p.value?.closest(l)||null,d&&(d.addEventListener("scroll",y,{passive:!0}),y())}),Se(()=>{d&&d.removeEventListener("scroll",y)}),{contentRef:p,activeAnchor:c,scrollToAnchor:g,updateActiveAnchor:y}}const Et={class:"sticky top-24 space-y-6"},Pt={class:"border-l border-gray-200 dark:border-gray-800"},qt=["onClick"],Gt=H({__name:"PageAnchorsNav",props:{anchors:{},activeAnchor:{},width:{default:"w-44"},hideOnMobile:{type:Boolean,default:!0}},emits:["click"],setup(h,{emit:s}){const t=s;function l(m){t("click",m)}return(m,c)=>(o(),k("div",{class:Q([h.width,"shrink-0",h.hideOnMobile?"hidden lg:block":""])},[a("div",Et,[a("nav",null,[a("div",Pt,[(o(!0),k(W,null,X(h.anchors,v=>(o(),k("button",{key:v.id,class:Q(["-ml-px block border-l-2 py-1.5 pl-4 text-left text-sm transition-colors",[h.activeAnchor===v.id?"border-pink-500 font-medium text-pink-600 dark:text-pink-400":"border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300"]]),onClick:p=>l(v.id)},u(v.label),11,qt))),128))])]),He(m.$slots,"default")])],2))}}),ie=H({__name:"TopNSelect",props:{modelValue:{default:10},modelModifiers:{}},emits:["update:modelValue"],setup(h){const s=nt(h,"modelValue"),t=[{label:"Top 5",value:5},{label:"Top 10",value:10},{label:"Top 20",value:20},{label:"Top 30",value:30},{label:"Top 50",value:50},{label:"Top 100",value:100}];return(l,m)=>{const c=Qe;return o(),I(c,{modelValue:s.value,"onUpdate:modelValue":m[0]||(m[0]=v=>s.value=v),items:t,"value-key":"value",class:"w-25"},null,8,["modelValue"])}}}),ce=H({__name:"ScrollableChart",props:{contentHeight:{},maxHeightVh:{default:60},paddingClass:{default:"px-3 py-2"}},setup(h){const s=h,t=$(()=>typeof window>"u"?500:Math.round(window.innerHeight*s.maxHeightVh/100)),l=$(()=>s.contentHeight>t.value),m=$(()=>({maxHeight:`${s.maxHeightVh}vh`,overflowY:l.value?"auto":"hidden"}));return(c,v)=>(o(),k("div",{class:Q(h.paddingClass),style:ve(m.value)},[He(c.$slots,"default")],6))}}),Yt=H({__name:"EChartGraph",props:{data:{},height:{default:400},layout:{default:"circular"},directed:{type:Boolean,default:!1}},setup(h,{expose:s}){Ge([Ft,Ye,Bt,Ke]);const t=h,l=$(()=>typeof t.height=="number"?`${t.height}px`:t.height),m=it(),c=S(null);let v=null;const p=["#ee4567","#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#9a60b4","#fc8452","#3ba272","#ea7ccc","#6e7074","#546570"],d=$(()=>{const x=new Set;return t.data.nodes.filter(w=>x.has(w.name)?!1:(x.add(w.name),!0))}),y=$(()=>{const x=new Map;return d.value.forEach((w,C)=>{x.set(w.name,p[C%p.length])}),x});function g(x,w){return w<=0?1:1+x/w*5}const i=$(()=>{const x=t.data.maxLinkValue||Math.max(...t.data.links.map(w=>w.value||1),1);return{tooltip:{trigger:"item",backgroundColor:m.value?"rgba(30, 30, 30, 0.9)":"rgba(255, 255, 255, 0.95)",borderColor:m.value?"rgba(255, 255, 255, 0.1)":"rgba(0, 0, 0, 0.1)",textStyle:{color:m.value?"#e5e7eb":"#374151"},formatter:w=>w.dataType==="node"?`<b>${w.data.name}</b><br/>消息数: ${w.data.value||0}`:w.dataType==="edge"?`${w.data.source} → ${w.data.target}<br/>艾特次数: ${w.data.value||0}`:""},animationDuration:1e3,animationDurationUpdate:500,animationEasingUpdate:"quinticInOut",series:[{type:"graph",layout:t.layout,circular:t.layout==="circular"?{rotateLabel:!0}:void 0,force:t.layout==="force"?{repulsion:300,gravity:.1,edgeLength:[80,200],friction:.6}:void 0,roam:!0,scaleLimit:{min:.3,max:3},draggable:!0,label:{show:!0,position:"right",formatter:"{b}",color:m.value?"#e5e7eb":"#374151",fontSize:11,fontWeight:500},edgeSymbol:t.directed?["none","arrow"]:["none","none"],edgeSymbolSize:t.directed?[0,10]:[0,0],lineStyle:{curveness:.3,opacity:.5},emphasis:{focus:"adjacency",label:{show:!0,fontSize:13,fontWeight:600},lineStyle:{width:4,opacity:.9},itemStyle:{shadowBlur:15,shadowColor:"rgba(0, 0, 0, 0.3)"}},data:d.value.map(w=>{const C=y.value.get(w.name)||p[0];return{name:w.name,value:w.value,symbolSize:w.symbolSize||30,label:{show:t.layout==="circular"?!0:(w.symbolSize||30)>30},itemStyle:{color:C,borderColor:"#fff",borderWidth:2,shadowBlur:5,shadowColor:`${C}66`}}}),links:t.data.links.filter(w=>y.value.has(w.source)&&y.value.has(w.target)).map(w=>{const C=y.value.get(w.source)||p[0];return{source:w.source,target:w.target,value:w.value,lineStyle:{color:C,width:g(w.value||1,x)}}})}]}});function n(){c.value&&(v=Je(c.value,m.value?"dark":void 0,{renderer:"canvas"}),v.setOption({backgroundColor:"transparent",...i.value}))}function r(){v&&v.setOption({backgroundColor:"transparent",...i.value},{notMerge:!0})}function _(){v?.resize()}function b(){v&&v.dispatchAction({type:"restore"})}return s({resetView:b}),O([()=>t.data,()=>t.layout,()=>t.directed,m],()=>{v?r():n()},{deep:!0}),pe(()=>{n(),window.addEventListener("resize",_)}),Se(()=>{window.removeEventListener("resize",_),v?.dispose()}),(x,w)=>(o(),k("div",{ref_key:"chartRef",ref:c,style:ve({height:l.value,width:"100%"})},null,4))}}),Kt={class:"px-3 py-2"},ye=H({__name:"EChartRank",props:{members:{},title:{},description:{},topN:{default:10},unit:{default:"条"},height:{default:"auto"},maxHeightVh:{default:60},bare:{type:Boolean,default:!1}},setup(h){const s=h,t=$(()=>s.members.slice(0,s.topN)),l=$(()=>{if(s.height!=="auto")return s.height;const p=t.value.length*36;return Math.max(p+30,180)}),m={type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:"#ee4567"},{offset:1,color:"#f7758c"}]};function c(p,d=8){return p.length<=d?p:p.slice(0,d)+"…"}const v=$(()=>{const p=[...t.value].reverse(),d=p.map(n=>c(n.name)),y=p.map(n=>n.value),g=Math.max(...y,1),i=p.map(n=>({value:n.value,itemStyle:{color:m,borderRadius:[0,4,4,0]}}));return{tooltip:{trigger:"axis",axisPointer:{type:"shadow"},backgroundColor:"rgba(0, 0, 0, 0.8)",borderColor:"transparent",textStyle:{color:"#fff"},formatter:n=>{const r=n[0];if(!r)return"";const _=t.value.length-1-r.dataIndex,b=t.value[_];return`
3
- <div style="padding: 4px 8px;">
4
- <div style="font-weight: bold; margin-bottom: 4px;">${b.name}</div>
5
- <div>${b.value} ${s.unit} (${b.percentage}%)</div>
6
- </div>
7
- `}},grid:{left:110,right:70,top:15,bottom:15,containLabel:!1},xAxis:{type:"value",max:g*1.1,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1}},yAxis:{type:"category",data:d,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{fontSize:12,color:"#4b5563",margin:12,formatter:(n,r)=>{const b=t.value.length-1-r+1;return`${b===1?"🥇":b===2?"🥈":b===3?"🥉":`${b}.`} ${n}`}}},series:[{type:"bar",data:i,barWidth:18,barCategoryGap:"30%",label:{show:!0,position:"right",distance:8,formatter:n=>{const r=t.value.length-1-n.dataIndex;return`${t.value[r].value} ${s.unit}`},fontSize:11,fontWeight:500,color:"#6b7280"},emphasis:{itemStyle:{shadowBlur:6,shadowColor:"rgba(238, 69, 103, 0.3)"}}}]}});return(p,d)=>h.bare?(o(),I(e(ce),{key:0,"content-height":l.value,"max-height-vh":h.maxHeightVh},{default:T(()=>[f(te,{option:v.value,height:l.value},null,8,["option","height"])]),_:1},8,["content-height","max-height-vh"])):(o(),I(e(q),{key:1,title:h.title,description:h.description,scrollable:"","max-height-vh":h.maxHeightVh},{default:T(()=>[a("div",Kt,[f(te,{option:v.value,height:l.value},null,8,["option","height"])])]),_:1},8,["title","description","max-height-vh"]))}}),Jt={class:"divide-y divide-gray-100 dark:divide-gray-800"},Qt={key:0,class:"flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-linear-to-br from-pink-100 to-rose-100 text-sm font-medium text-pink-600 dark:from-pink-900/30 dark:to-rose-900/30 dark:text-pink-400"},Zt={class:"w-32 shrink-0"},Xt={class:"wrap-break-word font-medium text-gray-900 dark:text-white"},ea={class:"flex flex-1 items-center"},ta={class:"h-2 w-full overflow-hidden rounded-full bg-gray-100 dark:bg-gray-800"},aa={class:"flex shrink-0 items-baseline gap-2 whitespace-nowrap"},sa={class:"text-lg font-bold text-gray-900 dark:text-white"},oa={class:"text-sm text-gray-500"},Ae=H({__name:"RankList",props:{members:{},showAvatar:{type:Boolean,default:!1},rankLimit:{default:0},unit:{}},setup(h){const{t:s}=ee(),t=h,l=$(()=>t.unit||s("views.charts.rankList.unit")),m=$(()=>t.rankLimit>0?t.members.slice(0,t.rankLimit):t.members);function c(v){if(m.value.length===0)return 0;const p=m.value[0].value;return p===0?0:Math.round(m.value[v].value/p*100)}return(v,p)=>(o(),k("div",Jt,[(o(!0),k(W,null,X(m.value,(d,y)=>(o(),k("div",{key:d.id,class:"flex items-center gap-3 px-5 py-3 transition-colors hover:bg-gray-50 dark:hover:bg-gray-800/50"},[a("div",{class:Q(["flex h-8 w-8 shrink-0 items-center justify-center rounded-full text-sm font-bold",e(qe)(y)])},u(y+1),3),h.showAvatar?(o(),k("div",Qt,u(d.name.slice(0,1)),1)):D("",!0),a("div",Zt,[a("p",Xt,u(d.name),1)]),a("div",ea,[a("div",ta,[a("div",{class:Q(["h-full rounded-full bg-linear-to-r transition-all",e(vt)(y)]),style:ve({width:`${c(y)}%`})},null,6)])]),a("div",aa,[a("span",sa,u(d.value),1),a("span",oa,u(l.value)+" ("+u(d.percentage)+"%)",1)])]))),128))]))}}),na={class:"flex items-center justify-between border-b border-gray-200 px-5 py-3 dark:border-gray-800"},la={class:"font-semibold text-gray-900 whitespace-nowrap dark:text-white"},ia={key:0,class:"mt-1 text-sm text-gray-500 dark:text-gray-400"},ra={class:"no-capture flex items-center gap-1"},ca={class:"flex w-full items-center justify-between border-b border-gray-200 px-6 py-4 dark:border-gray-700"},ua={class:"flex items-center gap-2"},da={class:"text-lg font-semibold text-gray-900 whitespace-nowrap dark:text-white"},ma={class:"text-sm text-gray-500"},va={class:"max-h-[60vh] p-4 overflow-y-auto"},ze=H({__name:"RankListPro",props:{members:{},title:{},description:{},topN:{default:10},unit:{}},setup(h){const{t:s}=ee(),t=h,l=S(!1),m=S(null),c=S(null),v=$(()=>t.members.slice(0,t.topN)),p=$(()=>t.members.length>t.topN);return(d,y)=>{const g=re,i=he;return o(),k("div",{ref_key:"cardRef",ref:m,class:"rounded-xl border border-gray-200 bg-white shadow-sm dark:border-gray-800 dark:bg-gray-900"},[a("div",na,[a("div",null,[a("h3",la,u(h.title),1),h.description?(o(),k("p",ia,u(h.description),1)):D("",!0)]),a("div",ra,[f(Le,{size:"xs",type:"element","target-element":m.value},null,8,["target-element"]),f(i,{open:l.value,"onUpdate:open":y[0]||(y[0]=n=>l.value=n),ui:{content:"md:w-full max-w-3xl"}},{content:T(()=>[a("div",{ref_key:"modalBodyRef",ref:c,class:"section-content flex flex-col"},[a("div",ca,[a("div",ua,[a("h3",da,u(h.title),1),a("span",ma," ("+u(e(s)("views.charts.rankListPro.memberCount",{count:h.members.length}))+") ",1)]),f(Le,{size:"xs",type:"element","target-element":c.value},null,8,["target-element"])]),a("div",va,[f(Ae,{members:h.members,unit:h.unit},null,8,["members","unit"])])],512)]),default:T(()=>[p.value?(o(),I(g,{key:0,icon:"i-heroicons-list-bullet",variant:"ghost"},{default:T(()=>[G(u(e(s)("views.charts.rankListPro.fullRanking")),1)]),_:1})):D("",!0)]),_:1},8,["open"])])]),f(Ae,{members:v.value,unit:h.unit},null,8,["members","unit"])],512)}}}),ha={class:"main-content mx-auto max-w-6xl py-6"},pa={class:"mb-4 flex items-center justify-end gap-4"},ga={class:"text-xs text-gray-500 dark:text-gray-400"},fa={key:0,class:"grid grid-cols-2 gap-6"},ya={class:"mb-3 text-center"},xa={class:"text-base font-semibold text-gray-900 dark:text-white"},ba={class:"flex flex-wrap gap-2"},ka=["title","onClick"],_a={class:"text-xs opacity-50"},wa={key:1,class:"grid grid-cols-2 gap-6"},$a={class:"mb-3 text-center"},Ca={class:"text-base font-semibold text-gray-900 dark:text-white"},Ia={class:"relative w-full",style:{"aspect-ratio":"4 / 3"}},Sa={class:"mt-4 text-center text-xs text-gray-500 dark:text-gray-400"},Ta=H({__name:"CatchphraseTab",props:{sessionId:{},timeFilter:{}},setup(h){const s=We(()=>Ue(()=>import("./EChartWordcloud-B_YisOW5.js"),__vite__mapDeps([0,1,2,3,4]))),{t}=ee(),l=Me(),m=h,c=S(null),v=S(!1),p=S("list"),d=S(30),y=$(()=>[{label:t("quotes.catchphrase.viewMode.list"),value:"list"},{label:t("quotes.catchphrase.viewMode.wordcloud"),value:"wordcloud"}]),g=[{label:"10",value:10},{label:"30",value:30},{label:"50",value:50},{label:"100",value:100}],i=$(()=>c.value&&c.value.members.length>0),n=$(()=>{if(!c.value)return[];const M=d.value;return console.log("[CatchphraseTab] displayMembers recompute, topN:",M,"type:",typeof M),c.value.members.map(L=>{const F=L.catchphrases.slice(0,M);return console.log("[CatchphraseTab]",L.name,"total:",L.catchphrases.length,"display:",F.length),{...L,catchphrases:F}})}),r=$(()=>n.value.map(M=>({name:M.name,data:{words:M.catchphrases.map(L=>({word:L.content,count:L.count}))}}))),_=[{bg:"bg-amber-50 dark:bg-amber-900/20",text:"text-amber-700 dark:text-amber-400",badge:"bg-amber-100 dark:bg-amber-800/40 text-amber-600 dark:text-amber-300"},{bg:"bg-slate-50 dark:bg-slate-800/40",text:"text-slate-600 dark:text-slate-300",badge:"bg-slate-100 dark:bg-slate-700/60 text-slate-500 dark:text-slate-400"},{bg:"bg-orange-50 dark:bg-orange-900/15",text:"text-orange-600 dark:text-orange-400",badge:"bg-orange-100 dark:bg-orange-800/30 text-orange-500 dark:text-orange-300"}];function b(M){return M<_.length?_[M]:{bg:"bg-gray-50 dark:bg-gray-800/30",text:"text-gray-600 dark:text-gray-400",badge:"bg-gray-100 dark:bg-gray-700/40 text-gray-500 dark:text-gray-400"}}function x(M,L=20){return M.length<=L?M:M.slice(0,L)+"..."}async function w(){if(m.sessionId){v.value=!0;try{c.value=await K().getCatchphraseAnalysis(m.sessionId,m.timeFilter),console.log("[CatchphraseTab] API result: members:",c.value?.members.length,"per-member catchphrases:",c.value?.members.map(M=>({name:M.name,count:M.catchphrases.length})))}catch(M){console.error("Failed to load catchphrase analysis:",M)}finally{v.value=!1}}}function C(M){l.openChatRecordDrawer({keywords:[M]})}return O(d,(M,L)=>{console.log("[CatchphraseTab] topN changed:",L,"->",M,"type:",typeof M)}),O(()=>[m.sessionId,m.timeFilter],()=>{w()},{immediate:!0,deep:!0}),(M,L)=>(o(),k("div",ha,[v.value?(o(),I(e(se),{key:0,text:e(t)("quotes.catchphrase.loading")},null,8,["text"])):i.value?(o(),k(W,{key:2},[a("div",pa,[a("span",ga,u(e(t)("quotes.catchphrase.topN")),1),f(e(le),{modelValue:d.value,"onUpdate:modelValue":L[0]||(L[0]=F=>d.value=F),size:"xs",items:g},null,8,["modelValue"]),L[2]||(L[2]=a("div",{class:"h-4 w-px bg-gray-200 dark:bg-gray-700"},null,-1)),f(e(le),{modelValue:p.value,"onUpdate:modelValue":L[1]||(L[1]=F=>p.value=F),size:"xs",items:y.value},null,8,["modelValue","items"])]),p.value==="list"?(o(),k("div",fa,[(o(!0),k(W,null,X(n.value,F=>(o(),k("div",{key:F.memberId},[a("div",ya,[a("span",xa,u(F.name),1)]),a("div",ba,[(o(!0),k(W,null,X(F.catchphrases,(A,z)=>(o(),k("div",{key:z,class:Q(["inline-flex cursor-pointer items-center gap-1.5 rounded-full px-3 py-1.5 transition-opacity hover:opacity-75",b(z).bg]),title:A.content,onClick:B=>C(A.content)},[z<3?(o(),k("span",{key:0,class:Q(["flex h-4 w-4 shrink-0 items-center justify-center rounded-full text-[10px] font-bold",b(z).badge])},u(z+1),3)):D("",!0),a("span",{class:Q(["text-sm font-medium",b(z).text])},u(x(A.content)),3),a("span",_a,u(e(t)("quotes.catchphrase.times",{count:A.count})),1)],10,ka))),128))])]))),128))])):(o(),k("div",wa,[(o(!0),k(W,null,X(r.value,F=>(o(),k("div",{key:F.name},[a("div",$a,[a("span",Ca,u(F.name),1)]),a("div",Ia,[F.data.words.length===0?(o(),I(e(ne),{key:0,text:e(t)("quotes.catchphrase.empty.title"),class:"h-full"},null,8,["text"])):(o(),I(e(s),{key:1,data:F.data,height:"100%","max-words":d.value,"color-scheme":"default","size-scale":1,loading:v.value,onWordClick:C},null,8,["data","max-words","loading"]))])]))),128))])),a("p",Sa,u(e(t)("quotes.catchphrase.stats.clickHint")),1)],64)):(o(),I(e(ne),{key:1,text:e(t)("quotes.catchphrase.empty.title")},null,8,["text"]))]))}}),Ma={class:"main-content mx-auto max-w-3xl p-6"},Va={class:"flex items-center gap-3"},Ra={class:"shrink-0 text-lg font-bold text-pink-600"},Da={class:"flex flex-1 items-center gap-1 overflow-hidden text-sm"},Na={class:"shrink-0 font-medium text-gray-900 dark:text-white whitespace-nowrap"},La=["title"],Aa={class:"flex shrink-0 items-center gap-2 text-xs text-gray-500"},za=H({__name:"HotRepeatTab",props:{sessionId:{},timeFilter:{}},setup(h){const{t:s}=ee(),t=h,l=Me(),m=S(null),c=S(!1);async function v(){if(t.sessionId){c.value=!0;try{m.value=await K().getRepeatAnalysis(t.sessionId,t.timeFilter)}catch(y){console.error("Failed to load repeat analysis:",y)}finally{c.value=!1}}}function p(y,g=30){return y.length<=g?y:y.slice(0,g)+"..."}function d(y){l.openChatRecordDrawer({scrollToMessageId:y.firstMessageId,highlightKeywords:[y.content]})}return O(()=>[t.sessionId,t.timeFilter],()=>{v()},{immediate:!0,deep:!0}),(y,g)=>{const i=re;return o(),k("div",Ma,[c.value?(o(),I(e(se),{key:0,text:e(s)("quotes.hotRepeat.loading")},null,8,["text"])):m.value&&m.value.hotContents.length>0?(o(),I(e(ht),{key:1,items:m.value.hotContents,title:e(s)("quotes.hotRepeat.title"),description:e(s)("quotes.hotRepeat.description"),"top-n":50,"count-template":e(s)("quotes.hotRepeat.countTemplate")},{item:T(({item:n,index:r})=>[a("div",Va,[a("span",{class:Q(["flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-xs font-bold",e(qe)(r)])},u(r+1),3),a("span",Ra,u(e(s)("quotes.hotRepeat.people",{count:n.maxChainLength})),1),a("div",Da,[a("span",Na,u(n.originatorName)+u(e(s)("quotes.hotRepeat.colon")),1),a("span",{class:"truncate text-gray-600 dark:text-gray-400",title:n.content},u(p(n.content)),9,La)]),a("div",Aa,[a("span",null,u(e(s)("quotes.hotRepeat.times",{count:n.count})),1),g[0]||(g[0]=a("span",{class:"text-gray-300 dark:text-gray-600"},"|",-1)),a("span",null,u(e(Ce)(n.lastTs)),1),f(i,{icon:"i-heroicons-chat-bubble-left-right",color:"neutral",variant:"ghost",size:"xs",title:e(s)("quotes.hotRepeat.viewChat"),onClick:je(_=>d(n),["stop"])},null,8,["title","onClick"])])])]),_:1},8,["items","title","description","count-template"])):(o(),I(e(q),{key:2,title:e(s)("quotes.hotRepeat.title")},{default:T(()=>[f(e(ne),{text:e(s)("quotes.hotRepeat.empty")},null,8,["text"])]),_:1},8,["title"]))])}}}),Ua={class:"main-content mx-auto max-w-[920px] space-y-6 p-6"},Fa={class:"grid grid-cols-1 gap-6 lg:grid-cols-2"},Ba={class:"p-5"},Ha={class:"p-5"},Wa=H({__name:"OverviewTab",props:{session:{},memberActivity:{},topMembers:{},bottomMembers:{},messageTypes:{},hourlyActivity:{},dailyActivity:{},timeRange:{},selectedYear:{},filteredMessageCount:{},filteredMemberCount:{},timeFilter:{}},setup(h){const{t:s}=ee(),t=h,{dailyChartData:l}=ft(()=>t.dailyActivity),m=$(()=>({labels:t.messageTypes.map(v=>yt(v.type,s)),values:t.messageTypes.map(v=>v.count)})),c=$(()=>{const v=[...t.memberActivity].sort((i,n)=>n.messageCount-i.messageCount),p=v.slice(0,10),d=v.slice(10).reduce((i,n)=>i+n.messageCount,0),y=p.map(i=>i.name),g=p.map(i=>i.messageCount);return d>0&&(y.push(s("analysis.overview.others")),g.push(d)),{labels:y,values:g}});return(v,p)=>(o(),k("div",Ua,[f(pt,{session:h.session,"daily-activity":h.dailyActivity,"message-types":h.messageTypes,"hourly-activity":h.hourlyActivity,"time-range":h.timeRange,"selected-year":h.selectedYear,"filtered-message-count":h.filteredMessageCount,"time-filter":h.timeFilter},null,8,["session","daily-activity","message-types","hourly-activity","time-range","selected-year","filtered-message-count","time-filter"]),a("div",Fa,[f(e(q),{title:e(s)("analysis.overview.messageTypeDistribution"),"show-divider":!1},{default:T(()=>[a("div",Ba,[f(e(Ne),{data:m.value,height:280},null,8,["data"])])]),_:1},8,["title"]),f(e(q),{title:e(s)("analysis.overview.memberDistribution"),"show-divider":!1},{default:T(()=>[a("div",Ha,[f(e(Ne),{data:c.value,height:280},null,8,["data"])])]),_:1},8,["title"])]),f(gt,{"daily-activity":h.dailyActivity,"daily-chart-data":e(l)},null,8,["daily-activity","daily-chart-data"])]))}}),ja={class:"flex items-center gap-3"},Oa={key:1,class:"py-8 text-center text-sm text-gray-400"},Ea=H({__name:"ActivityRank",props:{sessionId:{},memberActivity:{},timeFilter:{},showTopNSelect:{type:Boolean,default:!0},globalTopN:{}},setup(h){const s=h,t=S(null),l=S(null),m=S(!1),c=S("activity"),v=S(s.globalTopN??10);O(()=>s.globalTopN,b=>{b!==void 0&&(v.value=b)});async function p(){if(s.sessionId){m.value=!0;try{const b=K(),[x,w]=await Promise.all([b.getDragonKingAnalysis(s.sessionId,s.timeFilter),b.getCheckInAnalysis(s.sessionId,s.timeFilter)]);t.value=x,l.value=w}catch(b){console.error("加载活跃数据失败:",b)}finally{m.value=!1}}}const d=$(()=>s.memberActivity.map(b=>({id:b.memberId.toString(),name:b.name,value:b.messageCount,percentage:b.percentage}))),y=$(()=>t.value?t.value.rank.map(b=>({id:b.memberId.toString(),name:b.name,value:b.count,percentage:b.percentage})):[]),g=$(()=>l.value?l.value.loyaltyRank.map(b=>({id:b.memberId.toString(),name:b.name,value:b.totalDays,percentage:b.percentage})):[]),i=$(()=>{switch(c.value){case"activity":return d.value;case"dragon":return y.value;case"loyalty":return g.value;default:return d.value}}),n=$(()=>{switch(c.value){case"activity":return"条";case"dragon":case"loyalty":return"天";default:return"条"}}),r=$(()=>{switch(c.value){case"activity":return"🏆 活跃榜 - 发言数量";case"dragon":return"🏆 活跃榜 - 龙王";case"loyalty":return"🏆 活跃榜 - 累计发言";default:return"🏆 活跃榜"}}),_=$(()=>{switch(c.value){case"activity":return"按消息发送数量排名";case"dragon":return`每天发言最多的人+1(共 ${t.value?.totalDays??0} 天)`;case"loyalty":return`累计发言天数排名(共 ${l.value?.totalDays??0} 天)`;default:return""}});return O(()=>[s.sessionId,s.timeFilter],()=>p(),{immediate:!0,deep:!0}),(b,x)=>(o(),I(e(q),{title:r.value,description:_.value},{headerRight:T(()=>[a("div",ja,[h.showTopNSelect?(o(),I(e(ie),{key:0,modelValue:v.value,"onUpdate:modelValue":x[0]||(x[0]=w=>v.value=w)},null,8,["modelValue"])):D("",!0),f(e(le),{modelValue:c.value,"onUpdate:modelValue":x[1]||(x[1]=w=>c.value=w),items:[{label:"发言数量",value:"activity"},{label:"龙王",value:"dragon"},{label:"累计发言",value:"loyalty"}],size:"sm"},null,8,["modelValue"])])]),default:T(()=>[m.value&&(c.value==="dragon"||c.value==="loyalty")?(o(),I(e(se),{key:0,text:"正在加载数据..."})):(o(),k(W,{key:1},[i.value.length>0?(o(),I(e(ye),{key:0,members:i.value,title:r.value,unit:n.value,"top-n":v.value,bare:""},null,8,["members","title","unit","top-n"])):(o(),k("div",Oa,"暂无数据"))],64))]),_:1},8,["title","description"]))}}),Pa={key:0},qa={key:0,class:"flex items-center justify-center gap-6 border-t border-gray-100 px-5 py-3 dark:border-gray-800"},Ga={class:"px-3 py-2"},Ya=H({__name:"EChartStreakRank",props:{items:{},title:{},description:{},topN:{default:10},mode:{default:"max"},maxHeightVh:{default:60},bare:{type:Boolean,default:!1}},setup(h){const s=h,t=$(()=>s.mode==="current"?s.items.filter(g=>g.currentStreak>0).sort((g,i)=>i.currentStreak-g.currentStreak).slice(0,s.topN):s.items.slice(0,s.topN)),l=$(()=>{const g=t.value.length*36;return Math.max(g+30,180)}),m={type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:"#ee4567"},{offset:1,color:"#f7758c"}]},c={type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:"#f97316"},{offset:1,color:"#fb923c"}]};function v(g,i=8){return g.length<=i?g:g.slice(0,i)+"…"}function p(g,i){return`${g} ~ ${i}`}function d(g){return s.mode==="current"?g.currentStreak:g.maxStreak}const y=$(()=>{const g=[...t.value].reverse(),i=g.map(b=>v(b.name)),n=g.map(b=>d(b)),r=Math.max(...n,1),_=g.map(b=>({value:d(b),itemStyle:{color:s.mode==="current"||b.currentStreak>0?c:m,borderRadius:[0,4,4,0]}}));return{tooltip:{trigger:"axis",axisPointer:{type:"shadow"},backgroundColor:"rgba(0, 0, 0, 0.8)",borderColor:"transparent",textStyle:{color:"#fff"},formatter:b=>{const x=b[0];if(!x)return"";const w=t.value.length-1-x.dataIndex,C=t.value[w];if(s.mode==="current")return`
8
- <div style="padding: 4px 8px;">
9
- <div style="font-weight: bold; margin-bottom: 6px;">${C.name}</div>
10
- <div style="color: #fb923c;">🔥 当前连续 <b>${C.currentStreak}</b> 天</div>
11
- <div style="margin-top: 4px; font-size: 12px; color: #9ca3af;">最长记录: ${C.maxStreak} 天</div>
12
- </div>
13
- `;let M=`
14
- <div style="padding: 4px 8px;">
15
- <div style="font-weight: bold; margin-bottom: 6px;">${C.name}</div>
16
- <div style="margin-bottom: 4px;">🔥 最长连续: <b>${C.maxStreak}</b> 天</div>
17
- <div style="font-size: 12px; color: #9ca3af;">${p(C.maxStreakStart,C.maxStreakEnd)}</div>
18
- `;return C.currentStreak>0&&(M+=`<div style="margin-top: 6px; color: #fb923c;">🔥 当前连续 ${C.currentStreak} 天</div>`),M+="</div>",M}},grid:{left:110,right:70,top:15,bottom:15,containLabel:!1},xAxis:{type:"value",max:r*1.15,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1}},yAxis:{type:"category",data:i,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{fontSize:12,color:"#4b5563",margin:12,formatter:(b,x)=>{const C=t.value.length-1-x+1;return`${C===1?"🥇":C===2?"🥈":C===3?"🥉":`${C}.`} ${b}`}}},series:[{type:"bar",data:_,barWidth:18,barCategoryGap:"30%",label:{show:!0,position:"right",distance:8,formatter:b=>{const x=t.value.length-1-b.dataIndex,w=t.value[x],C=d(w),M=s.mode==="current"||w.currentStreak>0?" 🔥":"";return`${C} 天${M}`},fontSize:11,fontWeight:500,color:"#6b7280"},emphasis:{itemStyle:{shadowBlur:6,shadowColor:"rgba(249, 115, 22, 0.3)"}}}]}});return(g,i)=>h.bare?(o(),k("div",Pa,[f(e(ce),{"content-height":l.value,"max-height-vh":h.maxHeightVh},{default:T(()=>[f(e(te),{option:y.value,height:l.value},null,8,["option","height"])]),_:1},8,["content-height","max-height-vh"]),h.mode==="max"?(o(),k("div",qa,[...i[0]||(i[0]=[lt('<div class="flex items-center gap-1.5"><div class="h-3 w-6 rounded bg-linear-to-r from-orange-500 to-orange-400"></div><span class="text-xs text-gray-500">当前连续中 🔥</span></div><div class="flex items-center gap-1.5"><div class="h-3 w-6 rounded bg-linear-to-r from-pink-500 to-pink-400"></div><span class="text-xs text-gray-500">已中断</span></div>',2)])])):D("",!0)])):(o(),I(e(q),{key:1,title:h.title,description:h.description,scrollable:"","max-height-vh":h.maxHeightVh},Oe({default:T(()=>[a("div",Ga,[f(e(te),{option:y.value,height:l.value},null,8,["option","height"])])]),_:2},[h.mode==="max"?{name:"footer",fn:T(()=>[i[1]||(i[1]=a("div",{class:"flex items-center justify-center gap-6 border-t border-gray-100 px-5 py-3 dark:border-gray-800"},[a("div",{class:"flex items-center gap-1.5"},[a("div",{class:"h-3 w-6 rounded bg-linear-to-r from-orange-500 to-orange-400"}),a("span",{class:"text-xs text-gray-500"},"当前连续中 🔥")]),a("div",{class:"flex items-center gap-1.5"},[a("div",{class:"h-3 w-6 rounded bg-linear-to-r from-pink-500 to-pink-400"}),a("span",{class:"text-xs text-gray-500"},"已中断")])],-1))]),key:"0"}:void 0]),1032,["title","description","max-height-vh"]))}}),Ka={class:"px-3 py-2"},Ja=H({__name:"EChartBattleRank",props:{battles:{},title:{},description:{},topN:{default:10},maxHeightVh:{default:60},bare:{type:Boolean,default:!1}},setup(h){const s=h,t=$(()=>s.battles.slice(0,s.topN)),l=$(()=>{const p=t.value.length*36;return Math.max(p+30,180)}),m={type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:"#ee4567"},{offset:1,color:"#f7758c"}]};function c(p){return`${p.participantCount} 人参战`}const v=$(()=>{const p=[...t.value].reverse(),d=p.map(n=>c(n)),y=p.map(n=>n.totalImages),g=Math.max(...y,1),i=p.map(n=>({value:n.totalImages,itemStyle:{color:m,borderRadius:[0,4,4,0]}}));return{tooltip:{trigger:"axis",axisPointer:{type:"shadow"},backgroundColor:"rgba(0, 0, 0, 0.85)",borderColor:"transparent",textStyle:{color:"#fff",fontSize:12},extraCssText:"max-width: 300px;",formatter:n=>{const r=n[0];if(!r)return"";const _=t.value.length-1-r.dataIndex,b=t.value[_],x=b.participants.slice(0,5).map(C=>`<span style="color: #d1d5db;">${C.name}</span> <b>${C.imageCount}</b>张`).join("、"),w=b.participants.length>5?`、+${b.participants.length-5}`:"";return`
19
- <div style="padding: 6px 8px;">
20
- <div style="font-weight: bold; margin-bottom: 8px; font-size: 13px;">
21
- ⚔️ ${Ce(b.startTime)}
22
- </div>
23
- <div style="margin-bottom: 6px;">
24
- <span style="color: #9ca3af;">参战人数:</span> <b>${b.participantCount}</b> 人
25
- </div>
26
- <div style="margin-bottom: 8px;">
27
- <span style="color: #9ca3af;">总图片数:</span> <b style="color: #f472b6;">${b.totalImages}</b> 张
28
- </div>
29
- <div style="border-top: 1px solid #374151; padding-top: 6px; font-size: 11px;">
30
- ${x}${w}
31
- </div>
32
- </div>
33
- `}},grid:{left:95,right:125,top:15,bottom:15,containLabel:!1},xAxis:{type:"value",max:g*1.15,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1}},yAxis:{type:"category",data:d,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{fontSize:11,color:"#4b5563",margin:12,formatter:(n,r)=>{const b=t.value.length-1-r+1;return`${b===1?"🥇":b===2?"🥈":b===3?"🥉":`${b}.`} ${n}`}}},series:[{type:"bar",data:i,barWidth:18,barCategoryGap:"30%",label:{show:!0,position:"right",distance:8,formatter:n=>{const r=t.value.length-1-n.dataIndex,_=t.value[r],b=Ce(_.startTime);return`${_.totalImages} 张 (${b})`},fontSize:11,fontWeight:500,color:"#6b7280"},emphasis:{itemStyle:{shadowBlur:6,shadowColor:"rgba(238, 69, 103, 0.3)"}}}]}});return(p,d)=>h.bare?(o(),I(e(ce),{key:0,"content-height":l.value,"max-height-vh":h.maxHeightVh},{default:T(()=>[f(e(te),{option:v.value,height:l.value},null,8,["option","height"])]),_:1},8,["content-height","max-height-vh"])):(o(),I(e(q),{key:1,title:h.title,description:h.description,scrollable:"","max-height-vh":h.maxHeightVh},{default:T(()=>[a("div",Ka,[f(e(te),{option:v.value,height:l.value},null,8,["option","height"])])]),_:1},8,["title","description","max-height-vh"]))}}),Qa={class:"px-3 py-2"},Za=H({__name:"EChartTimeRank",props:{items:{},title:{},description:{},topN:{default:10},maxHeightVh:{default:60},bare:{type:Boolean,default:!1}},setup(h){const s=h,t=$(()=>s.items.slice(0,s.topN)),l=$(()=>{const d=t.value.length*36;return Math.max(d+30,180)}),m={type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:"#f59e0b"},{offset:1,color:"#fbbf24"}]};function c(d,y=8){return d.length<=y?d:d.slice(0,y)+"…"}function v(d){return(d/1e3).toFixed(2)+"s"}const p=$(()=>{if(t.value.length===0)return{};const d=[...t.value].reverse(),y=d.map(n=>c(n.name)),g=t.value[0].avgTimeDiff,i=d.map(n=>({value:Math.round(g/n.avgTimeDiff*100),itemStyle:{color:m,borderRadius:[0,4,4,0]}}));return{tooltip:{trigger:"axis",axisPointer:{type:"shadow"},backgroundColor:"rgba(0, 0, 0, 0.8)",borderColor:"transparent",textStyle:{color:"#fff"},formatter:n=>{const r=n[0];if(!r)return"";const _=t.value.length-1-r.dataIndex,b=t.value[_];return`
34
- <div style="padding: 4px 8px;">
35
- <div style="font-weight: bold; margin-bottom: 6px;">${b.name}</div>
36
- <div style="margin-bottom: 4px;">⚡️ 平均反应时间: <b>${v(b.avgTimeDiff)}</b></div>
37
- <div style="font-size: 12px; color: #9ca3af;">参与复读 ${b.count} 次</div>
38
- </div>
39
- `}},grid:{left:110,right:100,top:15,bottom:15,containLabel:!1},xAxis:{type:"value",max:105,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1}},yAxis:{type:"category",data:y,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{fontSize:12,color:"#4b5563",margin:12,formatter:(n,r)=>{const b=t.value.length-1-r+1;return`${b===1?"🥇":b===2?"🥈":b===3?"🥉":`${b}.`} ${n}`}}},series:[{type:"bar",data:i,barWidth:18,barCategoryGap:"30%",label:{show:!0,position:"right",distance:8,formatter:n=>{const r=t.value.length-1-n.dataIndex,_=t.value[r];return`${v(_.avgTimeDiff)} · ${_.count}次`},fontSize:11,fontWeight:500,color:"#6b7280"},emphasis:{itemStyle:{shadowBlur:6,shadowColor:"rgba(245, 158, 11, 0.3)"}}}]}});return(d,y)=>h.bare?(o(),I(e(ce),{key:0,"content-height":l.value,"max-height-vh":h.maxHeightVh},{default:T(()=>[f(e(te),{option:p.value,height:l.value},null,8,["option","height"])]),_:1},8,["content-height","max-height-vh"])):(o(),I(e(q),{key:1,title:h.title,description:h.description,scrollable:"","max-height-vh":h.maxHeightVh},{default:T(()=>[a("div",Qa,[f(e(te),{option:p.value,height:l.value},null,8,["option","height"])])]),_:1},8,["title","description","max-height-vh"]))}}),Xa={class:"flex items-center gap-3"},es={class:"px-3 py-2"},ts=H({__name:"EChartDivingRank",props:{items:{},showTopNSelect:{type:Boolean,default:!0},maxHeightVh:{default:60},globalTopN:{}},setup(h){const s=h,t=S("desc"),l=S(s.globalTopN??10);O(()=>s.globalTopN,n=>{n!==void 0&&(l.value=n)});const m=$(()=>[...s.items].sort((r,_)=>t.value==="desc"?_.daysSinceLastMessage-r.daysSinceLastMessage:r.daysSinceLastMessage-_.daysSinceLastMessage).slice(0,l.value)),c=$(()=>t.value==="desc"?"🤿 潜水榜 - 潜水最久":"🤿 潜水榜 - 最近冒泡"),v=$(()=>t.value==="desc"?"距离上次发言时间最久的成员":"最近发言过的成员"),p=$(()=>{const n=m.value.length*36;return Math.max(n+30,180)}),d={type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:"#06b6d4"},{offset:1,color:"#22d3ee"}]};function y(n,r=8){return n.length<=r?n:n.slice(0,r)+"…"}function g(n){return n===0?"今天":n===1?"昨天":`${n} 天前`}const i=$(()=>{if(m.value.length===0)return{};const n=[...m.value].reverse(),r=n.map(x=>y(x.name)),_=Math.max(...m.value.map(x=>x.daysSinceLastMessage),1),b=n.map(x=>({value:x.daysSinceLastMessage,itemStyle:{color:d,borderRadius:[0,4,4,0]}}));return{tooltip:{trigger:"axis",axisPointer:{type:"shadow"},backgroundColor:"rgba(0, 0, 0, 0.8)",borderColor:"transparent",textStyle:{color:"#fff"},formatter:x=>{const w=x[0];if(!w)return"";const C=m.value.length-1-w.dataIndex,M=m.value[C];return`
40
- <div style="padding: 4px 8px;">
41
- <div style="font-weight: bold; margin-bottom: 6px;">${M.name}</div>
42
- <div style="margin-bottom: 4px;">🤿 ${g(M.daysSinceLastMessage)}</div>
43
- <div style="font-size: 12px; color: #9ca3af;">最后发言: ${xt(M.lastMessageTs)}</div>
44
- </div>
45
- `}},grid:{left:110,right:100,top:15,bottom:15,containLabel:!1},xAxis:{type:"value",max:_*1.15,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1}},yAxis:{type:"category",data:r,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{fontSize:12,color:"#4b5563",margin:12,formatter:(x,w)=>{const M=m.value.length-1-w+1;return`${M===1?"🥇":M===2?"🥈":M===3?"🥉":`${M}.`} ${x}`}}},series:[{type:"bar",data:b,barWidth:18,barCategoryGap:"30%",label:{show:!0,position:"right",distance:8,formatter:x=>{const w=m.value.length-1-x.dataIndex,C=m.value[w];return g(C.daysSinceLastMessage)},fontSize:11,fontWeight:500,color:"#6b7280"},emphasis:{itemStyle:{shadowBlur:6,shadowColor:"rgba(0, 0, 0, 0.2)"}}}]}});return(n,r)=>(o(),I(e(q),{title:c.value,description:v.value,scrollable:"","max-height-vh":h.maxHeightVh},{headerRight:T(()=>[a("div",Xa,[h.showTopNSelect?(o(),I(e(ie),{key:0,modelValue:l.value,"onUpdate:modelValue":r[0]||(r[0]=_=>l.value=_)},null,8,["modelValue"])):D("",!0),f(e(le),{modelValue:t.value,"onUpdate:modelValue":r[1]||(r[1]=_=>t.value=_),items:[{label:"潜水最久",value:"desc"},{label:"最近冒泡",value:"asc"}],size:"sm"},null,8,["modelValue"])])]),default:T(()=>[a("div",es,[f(e(te),{option:i.value,height:p.value},null,8,["option","height"])])]),_:1},8,["title","description","max-height-vh"]))}}),as={class:"px-3 py-2"},ss=H({__name:"EChartConsecutiveRank",props:{items:{},title:{},description:{},topN:{default:10},maxHeightVh:{default:60},bare:{type:Boolean,default:!1}},setup(h){const s=h,t=$(()=>[...s.items].sort((d,y)=>y.maxConsecutiveDays-d.maxConsecutiveDays).slice(0,s.topN)),l=$(()=>{const d=t.value.length*36;return Math.max(d+30,180)}),m={type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:"#f97316"},{offset:1,color:"#fb923c"}]},c={type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:"#ec4899"},{offset:1,color:"#f472b6"}]};function v(d,y=8){return d.length<=y?d:d.slice(0,y)+"…"}const p=$(()=>{if(t.value.length===0)return{};const d=[...t.value].reverse(),y=d.map(i=>v(i.name)),g=Math.max(...t.value.map(i=>i.maxConsecutiveDays),1);return{tooltip:{trigger:"axis",axisPointer:{type:"shadow"},backgroundColor:"rgba(0, 0, 0, 0.85)",borderColor:"transparent",textStyle:{color:"#fff",fontSize:12},formatter:i=>{if(!i||i.length===0)return"";const n=i[0].dataIndex,r=t.value.length-1-n,_=t.value[r];let b=`
46
- <div style="padding: 6px 8px;">
47
- <div style="font-weight: bold; margin-bottom: 6px;">${_.name}</div>
48
- <div>最长连续: <b style="color: #f472b6;">${_.maxConsecutiveDays}</b> 天</div>
49
- `;return _.currentStreak>0&&(b+=`<div style="color: #f97316;">🔥 当前连续 ${_.currentStreak} 天</div>`),b+="</div>",b}},legend:{show:!1},grid:{left:110,right:75,top:15,bottom:15,containLabel:!1},xAxis:{type:"value",max:g*1.15,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1}},yAxis:{type:"category",data:y,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{fontSize:12,color:"#4b5563",margin:12,formatter:(i,n)=>{const _=t.value.length-1-n+1;return`${_===1?"🥇":_===2?"🥈":_===3?"🥉":`${_}.`} ${i}`}}},series:[{name:"当前连续",type:"bar",data:d.map(i=>({value:i.currentStreak>0?i.maxConsecutiveDays:0,itemStyle:{color:m,borderRadius:[0,4,4,0]}})),barWidth:18,barGap:"-100%",label:{show:!0,position:"right",distance:8,formatter:i=>{const n=t.value.length-1-i.dataIndex,r=t.value[n];return r.currentStreak>0?`${r.maxConsecutiveDays} 天`:""},fontSize:11,fontWeight:500,color:"#6b7280"}},{name:"已中断",type:"bar",data:d.map(i=>({value:i.currentStreak===0?i.maxConsecutiveDays:0,itemStyle:{color:c,borderRadius:[0,4,4,0]}})),barWidth:18,label:{show:!0,position:"right",distance:8,formatter:i=>{const n=t.value.length-1-i.dataIndex,r=t.value[n];return r.currentStreak===0?`${r.maxConsecutiveDays} 天`:""},fontSize:11,fontWeight:500,color:"#6b7280"}}]}});return(d,y)=>h.bare?(o(),I(e(ce),{key:0,"content-height":l.value,"max-height-vh":h.maxHeightVh},{default:T(()=>[f(e(te),{option:p.value,height:l.value},null,8,["option","height"])]),_:1},8,["content-height","max-height-vh"])):(o(),I(e(q),{key:1,title:h.title,description:h.description,scrollable:"","max-height-vh":h.maxHeightVh},{default:T(()=>[a("div",as,[f(e(te),{option:p.value,height:l.value},null,8,["option","height"])])]),_:1},8,["title","description","max-height-vh"]))}}),os={class:"px-3 py-2"},ns=H({__name:"EChartNightOwlRank",props:{items:{},title:{},description:{},topN:{default:10},maxHeightVh:{default:60},bare:{type:Boolean,default:!1}},setup(h){const s=h,t=$(()=>s.items.slice(0,s.topN)),l=$(()=>{const p=t.value.length*36;return Math.max(p+50,200)}),m={h23:"#8b5cf6",h0:"#3b82f6",h1:"#06b6d4",h2:"#f59e0b",h3to4:"#ef4444"};function c(p,d=8){return p.length<=d?p:p.slice(0,d)+"…"}const v=$(()=>{if(t.value.length===0)return{};const p=[...t.value].reverse(),d=p.map(g=>c(g.name)),y=Math.max(...t.value.map(g=>g.totalNightMessages),1);return{tooltip:{trigger:"axis",axisPointer:{type:"shadow"},backgroundColor:"rgba(0, 0, 0, 0.85)",borderColor:"transparent",textStyle:{color:"#fff",fontSize:12},formatter:g=>{if(!g||g.length===0)return"";const i=g[0].dataIndex,n=t.value.length-1-i,r=t.value[n],_=r.hourlyBreakdown;return`
50
- <div style="padding: 6px 8px;">
51
- <div style="font-weight: bold; margin-bottom: 6px;">${r.name}</div>
52
- <div style="margin-bottom: 4px;">
53
- 称号: <b style="color: #f472b6;">${r.title}</b>
54
- </div>
55
- <div style="margin-bottom: 6px;">总发言: <b>${r.totalNightMessages}</b> 条</div>
56
- <div style="border-top: 1px solid #374151; padding-top: 6px;">
57
- <div><span style="color: ${m.h23};">●</span> 23点: ${_.h23} 条</div>
58
- <div><span style="color: ${m.h0};">●</span> 0点: ${_.h0} 条</div>
59
- <div><span style="color: ${m.h1};">●</span> 1点: ${_.h1} 条</div>
60
- <div><span style="color: ${m.h2};">●</span> 2点: ${_.h2} 条</div>
61
- <div><span style="color: ${m.h3to4};">●</span> 3-4点: ${_.h3to4} 条</div>
62
- </div>
63
- </div>
64
- `}},legend:{show:!0,bottom:0,itemWidth:12,itemHeight:12,textStyle:{color:"#6b7280",fontSize:10}},grid:{left:110,right:70,top:15,bottom:35,containLabel:!1},xAxis:{type:"value",max:y*1.15,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1}},yAxis:{type:"category",data:d,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{fontSize:12,color:"#4b5563",margin:12,formatter:(g,i)=>{const r=t.value.length-1-i+1;return`${r===1?"🥇":r===2?"🥈":r===3?"🥉":`${r}.`} ${g}`}}},series:[{name:"23点",type:"bar",stack:"total",data:p.map(g=>g.hourlyBreakdown.h23),itemStyle:{color:m.h23},barWidth:18},{name:"0点",type:"bar",stack:"total",data:p.map(g=>g.hourlyBreakdown.h0),itemStyle:{color:m.h0},barWidth:18},{name:"1点",type:"bar",stack:"total",data:p.map(g=>g.hourlyBreakdown.h1),itemStyle:{color:m.h1},barWidth:18},{name:"2点",type:"bar",stack:"total",data:p.map(g=>g.hourlyBreakdown.h2),itemStyle:{color:m.h2},barWidth:18},{name:"3-4点",type:"bar",stack:"total",data:p.map(g=>g.hourlyBreakdown.h3to4),itemStyle:{color:m.h3to4,borderRadius:[0,4,4,0]},barWidth:18,label:{show:!0,position:"right",distance:8,formatter:g=>{const i=t.value.length-1-g.dataIndex;return`${t.value[i].totalNightMessages} 条`},fontSize:11,fontWeight:500,color:"#6b7280"}}]}});return(p,d)=>h.bare?(o(),I(e(ce),{key:0,"content-height":l.value,"max-height-vh":h.maxHeightVh},{default:T(()=>[f(e(te),{option:v.value,height:l.value},null,8,["option","height"])]),_:1},8,["content-height","max-height-vh"])):(o(),I(e(q),{key:1,title:h.title,description:h.description,scrollable:"","max-height-vh":h.maxHeightVh},{default:T(()=>[a("div",os,[f(e(te),{option:v.value,height:l.value},null,8,["option","height"])])]),_:1},8,["title","description","max-height-vh"]))}}),ls={id:"streak-rank",class:"scroll-mt-24"},is={class:"flex items-center gap-3"},rs=H({__name:"CheckInRank",props:{sessionId:{},timeFilter:{},showTopNSelect:{type:Boolean,default:!0},globalTopN:{}},setup(h){const s=h,t=S(null),l=S(!1),m=S("max"),c=S(s.globalTopN??10);O(()=>s.globalTopN,g=>{g!==void 0&&(c.value=g)});const v=$(()=>m.value==="max"?"🔥 火花榜 - 最长连续":"🔥 火花榜 - 当前连续"),p=$(()=>m.value==="max"?"历史最长连续发言天数":"正在持续连续发言的成员"),d=$(()=>t.value?t.value.streakRank.some(g=>g.currentStreak>0):!1);async function y(){if(s.sessionId){l.value=!0;try{t.value=await K().getCheckInAnalysis(s.sessionId,s.timeFilter)}catch(g){console.error("加载打卡分析失败:",g)}finally{l.value=!1}}}return O(()=>[s.sessionId,s.timeFilter],()=>{y()},{immediate:!0,deep:!0}),(g,i)=>(o(),k("div",ls,[l.value?(o(),I(e(se),{key:0,text:"正在分析数据..."})):t.value&&t.value.streakRank.length>0?(o(),I(e(q),{key:1,title:v.value,description:p.value},{headerRight:T(()=>[a("div",is,[h.showTopNSelect?(o(),I(e(ie),{key:0,modelValue:c.value,"onUpdate:modelValue":i[0]||(i[0]=n=>c.value=n)},null,8,["modelValue"])):D("",!0),d.value?(o(),I(e(le),{key:1,modelValue:m.value,"onUpdate:modelValue":i[1]||(i[1]=n=>m.value=n),items:[{label:"最长连续",value:"max"},{label:"当前连续",value:"current"}],size:"sm"},null,8,["modelValue"])):D("",!0)])]),default:T(()=>[f(e(Ya),{items:t.value.streakRank,title:v.value,mode:m.value,"top-n":c.value,bare:""},null,8,["items","title","mode","top-n"])]),_:1},8,["title","description"])):(o(),I(e(q),{key:2,title:"🔥 火花榜"},{default:T(()=>[f(e(ne),{text:"暂无连续发言数据"})]),_:1}))]))}}),cs={class:"flex items-center gap-3"},us={key:1,class:"py-8 text-center text-sm text-gray-400"},ds={key:1,class:"py-8 text-center text-sm text-gray-400"},ms=H({__name:"MemeBattleRank",props:{sessionId:{},timeFilter:{},showTopNSelect:{type:Boolean,default:!0},globalTopN:{}},setup(h){const s=h,t=S(null),l=S(!1),m=S("count"),c=S(s.globalTopN??10);O(()=>s.globalTopN,r=>{r!==void 0&&(c.value=r)});async function v(){if(s.sessionId){l.value=!0;try{t.value=await K().getMemeBattleAnalysis(s.sessionId,s.timeFilter)}catch(r){console.error("加载斗图分析失败:",r)}finally{l.value=!1}}}const p=$(()=>t.value?t.value.rankByCount.map(r=>({id:r.memberId.toString(),name:r.name,value:r.count,percentage:r.percentage})):[]),d=$(()=>t.value?t.value.rankByImageCount.map(r=>({id:r.memberId.toString(),name:r.name,value:r.count,percentage:r.percentage})):[]),y=$(()=>m.value==="count"?p.value:d.value),g=$(()=>m.value==="count"?"场":"张"),i=$(()=>{switch(m.value){case"battle":return"⚔️ 斗图榜 - 史诗级战役";case"count":return"⚔️ 斗图榜 - 按场次";case"image":return"⚔️ 斗图榜 - 按图量";default:return"⚔️ 斗图榜"}}),n=$(()=>{switch(m.value){case"battle":return"记录最激烈的斗图大战";case"count":return"参与斗图次数最多的人";case"image":return"在斗图中发送图片最多的人";default:return""}});return O(()=>[s.sessionId,s.timeFilter],()=>v(),{immediate:!0,deep:!0}),(r,_)=>l.value?(o(),I(e(se),{key:0,text:"正在统计斗图数据..."})):t.value?(o(),I(e(q),{key:1,title:i.value,description:n.value},{headerRight:T(()=>[a("div",cs,[h.showTopNSelect?(o(),I(e(ie),{key:0,modelValue:c.value,"onUpdate:modelValue":_[0]||(_[0]=b=>c.value=b)},null,8,["modelValue"])):D("",!0),f(e(le),{modelValue:m.value,"onUpdate:modelValue":_[1]||(_[1]=b=>m.value=b),items:[{label:"按场次",value:"count"},{label:"按图量",value:"image"},{label:"史诗级战役",value:"battle"}],size:"sm"},null,8,["modelValue"])])]),default:T(()=>[m.value==="battle"?(o(),k(W,{key:0},[t.value.topBattles.length>0?(o(),I(e(Ja),{key:0,battles:t.value.topBattles,title:"","top-n":c.value,bare:""},null,8,["battles","top-n"])):(o(),k("div",us,"暂无史诗级战役数据"))],64)):(o(),k(W,{key:1},[y.value.length>0?(o(),I(e(ye),{key:0,members:y.value,title:i.value,unit:g.value,"top-n":c.value,bare:""},null,8,["members","title","unit","top-n"])):(o(),k("div",ds,"暂无斗图数据"))],64))]),_:1},8,["title","description"])):D("",!0)}}),vs={class:"space-y-6"},hs={class:"flex items-center gap-3"},ps={class:"flex items-center gap-3"},gs={key:1,class:"px-3 py-2"},fs=H({__name:"RepeatSection",props:{sessionId:{},timeFilter:{},showTopNSelect:{type:Boolean,default:!0},globalTopN:{}},setup(h){const s=h,t=S(null),l=S(!1),m=S("originator"),c=S("fastest"),v=S(s.globalTopN??10),p=S(s.globalTopN??10);O(()=>s.globalTopN,C=>{C!==void 0&&(v.value=C,p.value=C)});async function d(){if(s.sessionId){l.value=!0;try{t.value=await K().getRepeatAnalysis(s.sessionId,s.timeFilter)}catch(C){console.error("加载复读分析失败:",C)}finally{l.value=!1}}}const y=$(()=>t.value?t.value.originators.map(C=>({id:C.memberId.toString(),name:C.name,value:C.count,percentage:C.percentage})):[]),g=$(()=>t.value?t.value.initiators.map(C=>({id:C.memberId.toString(),name:C.name,value:C.count,percentage:C.percentage})):[]),i=$(()=>t.value?t.value.breakers.map(C=>({id:C.memberId.toString(),name:C.name,value:C.count,percentage:C.percentage})):[]),n=$(()=>{switch(m.value){case"originator":return y.value;case"initiator":return g.value;case"breaker":return i.value;default:return y.value}}),r=$(()=>{switch(m.value){case"originator":return"🔁 复读榜 - 被复读";case"initiator":return"🔁 复读榜 - 挑起";case"breaker":return"🔁 复读榜 - 打断";default:return"🔁 复读榜"}}),_=$(()=>{switch(m.value){case"originator":return"发出的消息被别人复读的次数";case"initiator":return"第二个发送相同消息、带起节奏的人";case"breaker":return"终结复读链的人";default:return""}}),b=$(()=>{if(!t.value)return{labels:[],values:[]};const C=t.value.chainLengthDistribution;return{labels:C.map(M=>`${M.length}人`),values:C.map(M=>M.count)}}),x=$(()=>c.value==="fastest"?"📊 复读统计 - 最快反应":"📊 复读统计 - 链长分布"),w=$(()=>{if(c.value==="fastest")return"平均复读反应时间(至少参与5次复读)";const C=t.value?.totalRepeatChains??0,M=t.value?.avgChainLength??0;return`共 ${C} 次复读,平均 ${M} 人参与`});return O(()=>[s.sessionId,s.timeFilter],()=>d(),{immediate:!0,deep:!0}),(C,M)=>(o(),k("div",vs,[l.value?(o(),I(e(se),{key:0,text:"正在分析复读数据..."})):t.value&&t.value.totalRepeatChains>0?(o(),k(W,{key:1},[f(e(q),{title:r.value,description:_.value},{headerRight:T(()=>[a("div",hs,[h.showTopNSelect?(o(),I(e(ie),{key:0,modelValue:v.value,"onUpdate:modelValue":M[0]||(M[0]=L=>v.value=L)},null,8,["modelValue"])):D("",!0),f(e(le),{modelValue:m.value,"onUpdate:modelValue":M[1]||(M[1]=L=>m.value=L),items:[{label:"被复读",value:"originator"},{label:"挑起",value:"initiator"},{label:"打断",value:"breaker"}],size:"sm"},null,8,["modelValue"])])]),default:T(()=>[n.value.length>0?(o(),I(e(ye),{key:0,members:n.value,title:r.value,unit:"次","top-n":v.value,bare:""},null,8,["members","title","top-n"])):(o(),I(e(ne),{key:1,text:"暂无数据"}))]),_:1},8,["title","description"]),f(e(q),{title:x.value,description:w.value},{headerRight:T(()=>[a("div",ps,[h.showTopNSelect&&c.value==="fastest"?(o(),I(e(ie),{key:0,modelValue:p.value,"onUpdate:modelValue":M[2]||(M[2]=L=>p.value=L)},null,8,["modelValue"])):D("",!0),f(e(le),{modelValue:c.value,"onUpdate:modelValue":M[3]||(M[3]=L=>c.value=L),items:[{label:"最快反应",value:"fastest"},{label:"链长分布",value:"distribution"}],size:"sm"},null,8,["modelValue"])])]),default:T(()=>[c.value==="fastest"?(o(),k(W,{key:0},[t.value.fastestRepeaters&&t.value.fastestRepeaters.length>0?(o(),I(e(Za),{key:0,items:t.value.fastestRepeaters,"top-n":p.value,title:"",bare:""},null,8,["items","top-n"])):(o(),I(e(ne),{key:1,text:"暂无最快复读数据"}))],64)):(o(),k("div",gs,[b.value.labels.length>0?(o(),I(e(bt),{key:0,data:b.value,height:200},null,8,["data"])):(o(),I(e(ne),{key:1,text:"暂无分布数据"}))]))]),_:1},8,["title","description"])],64)):(o(),I(e(q),{key:2,title:"🔁 复读榜"},{default:T(()=>[f(e(ne),{text:"该群组暂无复读记录"})]),_:1}))]))}}),ys=H({__name:"DivingRank",props:{sessionId:{},timeFilter:{},globalTopN:{}},setup(h){const s=h,t=S(null),l=S(!1);async function m(){if(s.sessionId){l.value=!0;try{t.value=await K().getDivingAnalysis(s.sessionId,s.timeFilter)}catch(c){console.error("加载潜水分析失败:",c)}finally{l.value=!1}}}return O(()=>[s.sessionId,s.timeFilter],()=>m(),{immediate:!0,deep:!0}),(c,v)=>l.value?(o(),I(e(se),{key:0,text:"正在统计潜水数据..."})):t.value&&t.value.rank.length>0?(o(),I(e(ts),{key:1,items:t.value.rank,"global-top-n":h.globalTopN},null,8,["items","global-top-n"])):D("",!0)}}),xs={class:"space-y-6"},bs={class:"flex items-center gap-3"},ks={key:1,class:"py-8 text-center text-sm text-gray-400"},_s={key:1,class:"py-8 text-center text-sm text-gray-400"},ws={class:"flex items-center gap-3"},$s={key:1,class:"py-8 text-center text-sm text-gray-400"},Cs=H({__name:"NightOwlRank",props:{sessionId:{},timeFilter:{},showTopNSelect:{type:Boolean,default:!0},globalTopN:{}},setup(h){const s=h,t=S(null),l=S(!1),m=S("first"),c=S("distribution"),v=S(s.globalTopN??10),p=S(s.globalTopN??10);O(()=>s.globalTopN,x=>{x!==void 0&&(v.value=x,p.value=x)});async function d(){if(s.sessionId){l.value=!0;try{t.value=await K().getNightOwlAnalysis(s.sessionId,s.timeFilter)}catch(x){console.error("加载出勤分析失败:",x)}finally{l.value=!1}}}const y=$(()=>t.value?t.value.lastSpeakerRank.map(x=>({id:String(x.memberId),name:x.name,value:x.count,percentage:x.percentage})):[]),g=$(()=>t.value?t.value.firstSpeakerRank.map(x=>({id:String(x.memberId),name:x.name,value:x.count,percentage:x.percentage})):[]),i=$(()=>m.value==="last"?y.value:g.value),n=$(()=>m.value==="last"?"⏰ 出勤排行 - 最晚下班":"⏰ 出勤排行 - 最早上班"),r=$(()=>{const x=t.value?.totalDays??0;return m.value==="last"?`每天最后一个发言的人(共 ${x} 天)`:`每天第一个发言的人(共 ${x} 天)`}),_=$(()=>c.value==="distribution"?"🦉 修仙统计 - 发言分布":"🦉 修仙统计 - 连续记录"),b=$(()=>c.value==="distribution"?"深夜时段(23:00-05:00)各时段发言分布":"连续在深夜时段发言的天数");return O(()=>[s.sessionId,s.timeFilter],()=>d(),{immediate:!0,deep:!0}),(x,w)=>(o(),k("div",xs,[l.value?(o(),I(e(se),{key:0,text:"正在加载出勤分析..."})):t.value?(o(),k(W,{key:1},[f(e(q),{title:_.value,description:b.value},{headerRight:T(()=>[a("div",bs,[h.showTopNSelect?(o(),I(e(ie),{key:0,modelValue:v.value,"onUpdate:modelValue":w[0]||(w[0]=C=>v.value=C)},null,8,["modelValue"])):D("",!0),f(e(le),{modelValue:c.value,"onUpdate:modelValue":w[1]||(w[1]=C=>c.value=C),items:[{label:"发言分布",value:"distribution"},{label:"连续记录",value:"consecutive"}],size:"sm"},null,8,["modelValue"])])]),default:T(()=>[c.value==="distribution"?(o(),k(W,{key:0},[t.value.nightOwlRank.length>0?(o(),I(e(ns),{key:0,items:t.value.nightOwlRank,"top-n":v.value,title:"",bare:""},null,8,["items","top-n"])):(o(),k("div",ks,"暂无深夜发言数据"))],64)):(o(),k(W,{key:1},[t.value.consecutiveRecords.length>0?(o(),I(e(ss),{key:0,items:t.value.consecutiveRecords,"top-n":v.value,title:"",bare:""},null,8,["items","top-n"])):(o(),k("div",_s,"暂无连续记录"))],64))]),_:1},8,["title","description"]),f(e(q),{title:n.value,description:r.value},{headerRight:T(()=>[a("div",ws,[h.showTopNSelect?(o(),I(e(ie),{key:0,modelValue:p.value,"onUpdate:modelValue":w[2]||(w[2]=C=>p.value=C)},null,8,["modelValue"])):D("",!0),f(e(le),{modelValue:m.value,"onUpdate:modelValue":w[3]||(w[3]=C=>m.value=C),items:[{label:"最早上班",value:"first"},{label:"最晚下班",value:"last"}],size:"sm"},null,8,["modelValue"])])]),default:T(()=>[i.value.length>0?(o(),I(e(ye),{key:0,members:i.value,title:n.value,"top-n":p.value,unit:"次",bare:""},null,8,["members","title","top-n"])):(o(),k("div",$s,"暂无数据"))]),_:1},8,["title","description"])],64)):D("",!0)]))}}),Is={class:"main-content min-w-0 flex-1 px-8 mx-auto max-w-3xl space-y-6"},Ss={class:"mb-8 mt-4"},Ts={class:"text-5xl tracking-wider",style:{"font-weight":"800",background:"linear-gradient(to right, #f59e0b, #ec4899, #9333ea)","-webkit-background-clip":"text","-webkit-text-fill-color":"transparent"}},Ms={id:"activity-rank",class:"scroll-mt-24"},Vs={id:"meme-battle",class:"scroll-mt-24"},Rs={id:"repeat",class:"scroll-mt-24"},Ds={id:"night-owl",class:"scroll-mt-24"},Ns={id:"diving",class:"scroll-mt-24"},Ls={class:"border-l border-gray-200 pl-4 dark:border-gray-800"},As=H({__name:"RankingView",props:{sessionId:{},timeFilter:{}},setup(h){const s=h,t=S([]),l=S([]);async function m(){if(!s.sessionId)return;const n=K(),[r,_]=await Promise.all([n.getMemberActivity(s.sessionId,s.timeFilter),n.getAvailableYears(s.sessionId)]);t.value=r,l.value=_}O(()=>[s.sessionId,s.timeFilter],()=>m(),{immediate:!0,deep:!0});const c=$(()=>{if(s.timeFilter?.startTs&&s.timeFilter?.endTs){const n=new Date(s.timeFilter.startTs*1e3).getFullYear(),r=new Date(s.timeFilter.endTs*1e3).getFullYear();return n===r?`${n} 赛季`:`${n}-${r} 赛季`}if(l.value.length>0){const n=[...l.value].sort((b,x)=>b-x),r=n[0],_=n[n.length-1];return r===_?`${r} 赛季`:`${r}-${_} 赛季`}return"全部赛季"}),v=$(()=>({startTs:s.timeFilter?.startTs,endTs:s.timeFilter?.endTs})),p=[{id:"activity-rank",label:"🏆 活跃榜"},{id:"streak-rank",label:"🔥 火花榜"},{id:"meme-battle",label:"⚔️ 斗图榜"},{id:"repeat",label:"🔁 复读榜"},{id:"night-owl",label:"⏰ 出勤榜"},{id:"diving",label:"🤿 潜水榜"}],{contentRef:d,activeAnchor:y,scrollToAnchor:g}=Ot(p,{threshold:350}),i=S(10);return(n,r)=>(o(),k("div",{ref_key:"contentRef",ref:d,class:"flex gap-6 p-6"},[a("div",Is,[a("div",Ss,[a("h1",Ts," 🏆 "+u(c.value),1),r[1]||(r[1]=a("p",{class:"mt-4 text-sm text-gray-500 dark:text-gray-400"},"各榜单前三名请找群主领取奖励 🎁",-1))]),a("div",Ms,[f(e(Ea),{"session-id":s.sessionId,"member-activity":t.value,"time-filter":v.value,"global-top-n":i.value},null,8,["session-id","member-activity","time-filter","global-top-n"])]),f(e(rs),{"session-id":s.sessionId,"time-filter":v.value,"global-top-n":i.value},null,8,["session-id","time-filter","global-top-n"]),a("div",Vs,[f(e(ms),{"session-id":s.sessionId,"time-filter":v.value,"global-top-n":i.value},null,8,["session-id","time-filter","global-top-n"])]),a("div",Rs,[f(e(fs),{"session-id":s.sessionId,"time-filter":v.value,"global-top-n":i.value},null,8,["session-id","time-filter","global-top-n"])]),a("div",Ds,[f(e(Cs),{"session-id":s.sessionId,"time-filter":v.value,"global-top-n":i.value},null,8,["session-id","time-filter","global-top-n"])]),a("div",Ns,[f(e(ys),{"session-id":s.sessionId,"time-filter":v.value,"global-top-n":i.value},null,8,["session-id","time-filter","global-top-n"])]),r[2]||(r[2]=a("div",{class:"h-48 no-capture"},null,-1))]),f(e(Gt),{anchors:p,"active-anchor":e(y),onClick:e(g)},{default:T(()=>[a("div",Ls,[r[3]||(r[3]=a("div",{class:"text-xs text-gray-400 mb-2"},"显示数量",-1)),f(e(ie),{modelValue:i.value,"onUpdate:modelValue":r[0]||(r[0]=_=>i.value=_)},null,8,["modelValue"])])]),_:1},8,["active-anchor","onClick"])],512))}}),zs={class:"flex h-full flex-col"},Us={class:"flex items-center justify-end px-4 py-2"},Fs={class:"flex items-center gap-4"},Bs={class:"flex items-center gap-2"},Hs={class:"text-xs text-gray-400"},Ws={class:"flex items-center gap-2"},js={class:"text-xs text-gray-400"},Os={class:"flex-1 min-h-0 relative"},Es={key:0,class:"absolute inset-0 flex items-center justify-center"},Ps={key:0,class:"h-full"},qs={class:"absolute bottom-2 left-1/2 -translate-x-1/2 rounded-full bg-gray-100/80 px-3 py-1 text-xs text-gray-500 backdrop-blur-sm dark:bg-gray-800/80 dark:text-gray-400"},Gs={key:1,class:"flex h-full items-center justify-center text-gray-400"},Ys={class:"text-center"},Ks={class:"mt-2 text-sm"},Js=H({__name:"InteractionView",props:{sessionId:{},timeFilter:{}},setup(h){const s=h,{t}=ee(),l=S(!0),m=S({nodes:[],links:[],maxLinkValue:0}),c=S("circular"),v=S(!1),p=S(null);function d(){p.value?.resetView()}async function y(){if(s.sessionId){l.value=!0;try{const g=await K().getMentionGraph(s.sessionId,s.timeFilter);m.value={nodes:g.nodes,links:g.links,maxLinkValue:g.maxLinkValue}}catch(g){console.error("[chart-interaction] 加载互动关系图数据失败:",g)}finally{l.value=!1}}}return O(()=>[s.sessionId,s.timeFilter],()=>{y()},{immediate:!0,deep:!0}),(g,i)=>{const n=re,r=Ee("UButtonGroup"),_=Ze,b=Ie;return o(),k("div",zs,[a("div",Us,[a("div",Fs,[a("div",Bs,[a("span",Hs,u(e(t)("views.interaction.layout"))+":",1),f(r,{size:"xs"},{default:T(()=>[f(n,{color:c.value==="circular"?"primary":"neutral",variant:c.value==="circular"?"solid":"ghost",onClick:i[0]||(i[0]=x=>c.value="circular")},{default:T(()=>[G(u(e(t)("views.interaction.circular")),1)]),_:1},8,["color","variant"]),f(n,{color:c.value==="force"?"primary":"neutral",variant:c.value==="force"?"solid":"ghost",onClick:i[1]||(i[1]=x=>c.value="force")},{default:T(()=>[G(u(e(t)("views.interaction.force")),1)]),_:1},8,["color","variant"])]),_:1})]),a("div",Ws,[a("span",js,u(e(t)("views.interaction.directed"))+":",1),f(_,{modelValue:v.value,"onUpdate:modelValue":i[2]||(i[2]=x=>v.value=x),size:"xs"},null,8,["modelValue"])]),f(n,{size:"xs",color:"neutral",variant:"ghost",icon:"i-heroicons-arrow-path",onClick:d},{default:T(()=>[G(u(e(t)("views.interaction.reset")),1)]),_:1})])]),a("div",Os,[l.value?(o(),k("div",Es,[f(b,{name:"i-heroicons-arrow-path",class:"h-8 w-8 animate-spin text-pink-500"})])):(o(),k(W,{key:1},[m.value.nodes.length>0?(o(),k("div",Ps,[f(e(Yt),{ref_key:"graphRef",ref:p,data:m.value,layout:c.value,directed:v.value,height:"100%"},null,8,["data","layout","directed"]),a("div",qs,u(e(t)("views.interaction.graphHint",{nodes:m.value.nodes.length,links:m.value.links.length})),1)])):(o(),k("div",Gs,[a("div",Ys,[f(b,{name:"i-heroicons-user-group",class:"mx-auto h-10 w-10 text-gray-300 dark:text-gray-600"}),a("p",Ks,u(e(t)("views.interaction.noInteraction")),1)])]))],64))])])}}}),Qs={class:"main-content mx-auto max-w-[920px] space-y-6 p-6"},Zs={class:"grid grid-cols-1 gap-6 lg:grid-cols-2"},Xs={class:"grid grid-cols-1 gap-6 lg:grid-cols-2"},eo={class:"divide-y divide-gray-100 dark:divide-gray-800"},to={class:"flex flex-1 items-center gap-2"},ao=["onClick"],so={class:"flex items-center gap-1 text-pink-500"},oo={class:"text-xs"},no=["onClick"],lo={class:"shrink-0 text-right text-sm text-gray-500"},io={key:0,class:"text-red-500"},ro={key:1},co={class:"divide-y divide-gray-100 dark:divide-gray-800"},uo={class:"flex flex-1 items-center gap-2"},mo=["onClick"],vo={class:"flex items-center gap-1"},ho={class:"text-xs text-gray-400"},po={class:"text-xs text-gray-400"},go=["onClick"],fo={class:"shrink-0 text-right"},yo={class:"text-lg font-bold text-pink-600"},xo={class:"ml-1 text-sm text-gray-500"},bo={key:0,class:"p-5"},ko={class:"mb-4 text-lg font-semibold text-gray-900 dark:text-white"},_o={key:0,class:"mb-4"},wo={class:"mb-2 text-sm font-medium text-gray-700 dark:text-gray-300"},$o={class:"space-y-2"},Co={class:"text-sm font-medium text-gray-900 dark:text-white"},Io={class:"text-xs text-gray-500"},So={key:1},To={class:"mb-2 text-sm font-medium text-gray-700 dark:text-gray-300"},Mo={class:"space-y-2"},Vo={class:"text-sm font-medium text-gray-900 dark:text-white"},Ro={class:"text-xs text-gray-500"},Do={class:"mt-4 flex justify-end"},No=H({__name:"Relationships",props:{sessionId:{},timeFilter:{}},setup(h){const{t:s}=ee(),t=h,l=S(null),m=S(!1),c=S(null),v=S(!1);async function p(){if(t.sessionId){m.value=!0;try{l.value=await K().getMentionAnalysis(t.sessionId,t.timeFilter)}catch(i){console.error("加载 @ 互动分析失败:",i)}finally{m.value=!1}}}const d=$(()=>l.value?l.value.topMentioners.map(i=>({id:i.memberId.toString(),name:i.name,value:i.count,percentage:i.percentage})):[]),y=$(()=>l.value?l.value.topMentioned.map(i=>({id:i.memberId.toString(),name:i.name,value:i.count,percentage:i.percentage})):[]);function g(i){if(!l.value)return;const n=l.value.memberDetails.find(r=>r.memberId===i);n&&(c.value=n,v.value=!0)}return O(()=>[t.sessionId,t.timeFilter],()=>{p()},{immediate:!0,deep:!0}),(i,n)=>{const r=Fe,_=re,b=he;return o(),k("div",Qs,[m.value?(o(),I(e(se),{key:0,text:e(s)("members.relationships.loading")},null,8,["text"])):l.value&&l.value.totalMentions>0?(o(),k(W,{key:1},[a("div",Zs,[d.value.length>0?(o(),I(e(ze),{key:0,members:d.value,title:e(s)("members.relationships.topMentioners"),description:e(s)("members.relationships.totalMentions",{count:l.value.totalMentions}),unit:e(s)("members.relationships.times")},null,8,["members","title","description","unit"])):D("",!0),y.value.length>0?(o(),I(e(ze),{key:1,members:y.value,title:e(s)("members.relationships.topMentioned"),description:e(s)("members.relationships.popularMember"),unit:e(s)("members.relationships.times")},null,8,["members","title","description","unit"])):D("",!0)]),a("div",Xs,[l.value.oneWay.length>0?(o(),I(e(q),{key:0,class:"hidden",title:e(s)("members.relationships.oneWay.title"),description:e(s)("members.relationships.oneWay.description",{count:l.value.oneWay.length})},{default:T(()=>[a("div",eo,[(o(!0),k(W,null,X(l.value.oneWay.slice(0,10),(x,w)=>(o(),k("div",{key:w,class:"flex items-center gap-4 px-5 py-3 transition-colors hover:bg-gray-50 dark:hover:bg-gray-800/50"},[a("span",{class:Q(["flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-xs font-bold",w===0?"bg-pink-100 text-pink-600 dark:bg-pink-900/30 dark:text-pink-400":"bg-gray-100 text-gray-500 dark:bg-gray-800 dark:text-gray-500"])},u(w+1),3),a("div",to,[a("button",{class:"font-medium text-gray-900 hover:text-pink-600 dark:text-white dark:hover:text-pink-600",onClick:C=>g(x.fromMemberId)},u(x.fromName),9,ao),a("div",so,[n[2]||(n[2]=a("span",{class:"text-lg"},"→",-1)),a("span",oo,u(x.fromToCount)+"次",1)]),a("button",{class:"font-medium text-gray-900 hover:text-pink-600 dark:text-white dark:hover:text-pink-600",onClick:C=>g(x.toMemberId)},u(x.toName),9,no)]),a("div",lo,[x.toFromCount===0?(o(),k("span",io,u(e(s)("members.relationships.oneWay.neverRespond")),1)):(o(),k("span",ro,u(e(s)("members.relationships.oneWay.reverse",{count:x.toFromCount})),1))]),f(r,{color:"pink",variant:"soft",size:"xs"},{default:T(()=>[G(u(e(s)("members.relationships.oneWay.ratio",{value:Math.round(x.ratio*100)})),1)]),_:2},1024)]))),128))])]),_:1},8,["title","description"])):D("",!0),l.value.twoWay.length>0?(o(),I(e(q),{key:1,title:e(s)("members.relationships.twoWay.title"),description:e(s)("members.relationships.twoWay.description",{count:l.value.twoWay.length})},{default:T(()=>[a("div",co,[(o(!0),k(W,null,X(l.value.twoWay.slice(0,10),(x,w)=>(o(),k("div",{key:w,class:"flex items-center gap-4 px-5 py-3 transition-colors hover:bg-gray-50 dark:hover:bg-gray-800/50"},[a("span",{class:Q(["flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-xs font-bold",w===0?"bg-linear-to-r from-pink-400 to-red-400 text-white":w===1?"bg-linear-to-r from-pink-300 to-red-300 text-white":w===2?"bg-linear-to-r from-pink-200 to-red-200 text-pink-700":"bg-gray-100 text-gray-500 dark:bg-gray-800 dark:text-gray-500"])},u(w+1),3),a("div",uo,[a("button",{class:"font-medium text-gray-900 hover:text-pink-600 dark:text-white dark:hover:text-pink-600",onClick:C=>g(x.member1Id)},u(x.member1Name),9,mo),a("div",vo,[a("span",ho,u(x.member1To2),1),n[3]||(n[3]=a("span",{class:"text-lg text-pink-500"},"⇄",-1)),a("span",po,u(x.member2To1),1)]),a("button",{class:"font-medium text-gray-900 hover:text-pink-600 dark:text-white dark:hover:text-pink-600",onClick:C=>g(x.member2Id)},u(x.member2Name),9,go)]),a("div",fo,[a("span",yo,u(x.total),1),a("span",xo,u(e(s)("members.relationships.twoWay.interactions")),1)]),f(r,{color:x.balance>=.7?"green":x.balance>=.5?"blue":"gray",variant:"soft",size:"xs"},{default:T(()=>[G(u(e(s)("members.relationships.twoWay.balance",{value:Math.round(x.balance*100)})),1)]),_:2},1032,["color"])]))),128))])]),_:1},8,["title","description"])):D("",!0)])],64)):m.value?D("",!0):(o(),I(e(q),{key:2,title:e(s)("members.relationships.emptyTitle")},{default:T(()=>[f(e(ne),{text:e(s)("members.relationships.empty")},null,8,["text"])]),_:1},8,["title"])),f(b,{open:v.value,"onUpdate:open":n[1]||(n[1]=x=>v.value=x)},{content:T(()=>[c.value?(o(),k("div",bo,[a("h3",ko,u(e(s)("members.relationships.modal.title",{name:c.value.name})),1),c.value.topMentioned.length>0?(o(),k("div",_o,[a("h4",wo,u(e(s)("members.relationships.modal.topMentioned")),1),a("div",$o,[(o(!0),k(W,null,X(c.value.topMentioned,(x,w)=>(o(),k("div",{key:w,class:"flex items-center gap-3 rounded-lg bg-gray-50 px-3 py-2 dark:bg-gray-800"},[a("span",Co,u(x.toName),1),a("span",Io,u(e(s)("members.relationships.modal.timesCount",{count:x.count})),1)]))),128))])])):D("",!0),c.value.topMentioners.length>0?(o(),k("div",So,[a("h4",To,u(e(s)("members.relationships.modal.topMentioners")),1),a("div",Mo,[(o(!0),k(W,null,X(c.value.topMentioners,(x,w)=>(o(),k("div",{key:w,class:"flex items-center gap-3 rounded-lg bg-gray-50 px-3 py-2 dark:bg-gray-800"},[a("span",Vo,u(x.fromName),1),a("span",Ro,u(e(s)("members.relationships.modal.timesCount",{count:x.count})),1)]))),128))])])):D("",!0),a("div",Do,[f(_,{variant:"soft",onClick:n[0]||(n[0]=x=>v.value=!1)},{default:T(()=>[G(u(e(s)("members.relationships.modal.close")),1)]),_:1})])])):D("",!0)]),_:1},8,["open"])])}}}),Lo={class:"mx-auto max-w-[920px] p-4 h-full"},Ao={class:"flex h-full flex-col rounded-lg border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-900 shadow-sm overflow-hidden"},zo={class:"flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-800/50"},Uo={class:"flex items-center gap-3"},Fo={class:"flex items-center gap-3"},Bo={class:"p-3 w-64"},Ho={class:"text-sm font-medium mb-3"},Wo={class:"space-y-3"},jo={class:"text-xs text-gray-500 mb-1 block"},Oo={class:"text-xs text-gray-400 mt-1"},Eo={class:"text-xs text-gray-500 mb-1 block"},Po={class:"text-xs text-gray-400 mt-1"},qo={class:"flex-1 min-h-0 overflow-hidden"},Go={key:0,class:"h-full flex items-center justify-center"},Yo={key:1,class:"h-full flex items-center justify-center"},Ko={class:"text-center text-gray-400"},Jo={key:2,class:"h-full"},Qo={key:3,class:"h-full flex overflow-hidden"},Zo={class:"w-64 border-r border-gray-200 dark:border-gray-700 flex flex-col overflow-hidden"},Xo={class:"px-4 py-3 border-b border-gray-200 dark:border-gray-700"},en={class:"text-sm font-medium flex items-center gap-2"},tn={class:"flex-1 overflow-y-auto"},an=["onClick"],sn={class:"flex items-center justify-between"},on={class:"text-sm truncate"},nn={class:"text-xs text-gray-400"},ln={class:"flex-1 overflow-hidden flex flex-col"},rn={key:0,class:"flex-1 flex items-center justify-center"},cn={class:"text-center text-gray-400"},un={class:"px-4 py-3 border-b border-gray-200 dark:border-gray-700 flex items-center gap-3"},dn={class:"w-10 h-10 rounded-full flex items-center justify-center text-white font-bold bg-primary-500"},mn={class:"font-medium"},vn={class:"text-xs text-gray-400"},hn={class:"px-4 py-3 border-b border-gray-200 dark:border-gray-700"},pn={class:"text-sm font-medium flex items-center gap-2"},gn={class:"flex-1 overflow-y-auto"},fn={key:0,class:"p-4 text-center text-gray-400"},yn={class:"flex items-center gap-3"},xn={class:"flex-1 min-w-0"},bn={class:"text-sm font-medium truncate"},kn={class:"flex items-center gap-3 mt-0.5 text-xs text-gray-400"},_n={class:"w-20 h-2 bg-gray-200 dark:bg-gray-700 rounded-full overflow-hidden"},wn={key:4,class:"h-full flex flex-col overflow-hidden"},$n={class:"px-4 py-3 border-b border-gray-200 dark:border-gray-700"},Cn={class:"text-sm font-medium flex items-center gap-2"},In={class:"flex-1 overflow-y-auto"},Sn={class:"flex items-center gap-3"},Tn={class:"flex-1 min-w-0"},Mn={class:"flex items-center gap-2 text-sm"},Vn={class:"font-medium truncate"},Rn={class:"font-medium truncate"},Dn={class:"flex items-center gap-3 mt-1 text-xs text-gray-400"},Nn={class:"w-24 h-2 bg-gray-200 dark:bg-gray-700 rounded-full overflow-hidden"},Ln={key:0,class:"px-4 py-2 border-t border-gray-200 dark:border-gray-700 text-xs text-gray-400 flex items-center gap-4 bg-gray-50 dark:bg-gray-800/50"},An=H({__name:"ClusterView",props:{sessionId:{},timeFilter:{}},setup(h){Ge([Ht,Ye,Wt,jt,Ke]);const s=h,{t}=ee(),l=rt(),m=$(()=>l.value==="dark"),c=S(!0),v=S(null),p=S("matrix"),d=S(null),y=S({lookAhead:3,decaySeconds:120,topEdges:150}),g=S(null);let i=null;async function n(){if(s.sessionId){c.value=!0;try{v.value=await K().getClusterGraph(s.sessionId,s.timeFilter,{lookAhead:y.value.lookAhead,decaySeconds:y.value.decaySeconds,topEdges:y.value.topEdges})}catch(A){console.error("[chart-cluster] 加载小团体关系数据失败:",A),v.value=null}finally{c.value=!1}}}const r=$(()=>{if(!v.value||v.value.nodes.length===0)return null;const{nodes:A,links:z,maxLinkValue:B}=v.value,P=[...A].sort((R,Y)=>Y.messageCount-R.messageCount).slice(0,20).map(R=>R.name),Z=new Map;for(const R of z)Z.set(`${R.source}-${R.target}`,R.value),Z.set(`${R.target}-${R.source}`,R.value);const J=[];for(let R=0;R<P.length;R++)for(let Y=0;Y<P.length;Y++)if(R===Y)J.push([R,Y,-1]);else{const ue=Z.get(`${P[R]}-${P[Y]}`)||0;J.push([R,Y,ue])}return{names:P,data:J,maxValue:B}});function _(){if(!r.value)return{graphic:{type:"text",style:{text:t("views.cluster.noData"),fill:"#999"}}};const{names:A,data:z,maxValue:B}=r.value;return{tooltip:{position:"top",formatter:ae=>{const[P,Z,J]=ae.data;return J<0?`${A[P]}`:J===0?`${A[P]} ↔ ${A[Z]}<br/>暂无关系数据`:`${A[P]} ↔ ${A[Z]}<br/>临近度: ${J.toFixed(2)}`}},grid:{left:120,right:40,top:40,bottom:120},xAxis:{type:"category",data:A,splitArea:{show:!0},axisLabel:{rotate:45,fontSize:10,color:m.value?"#ccc":"#333"}},yAxis:{type:"category",data:A,splitArea:{show:!0},axisLabel:{fontSize:10,color:m.value?"#ccc":"#333"}},visualMap:{min:0,max:B||1,calculable:!0,orient:"horizontal",left:"center",bottom:10,inRange:{color:m.value?["#1a1a2e","#16213e","#0f3460","#e94560"]:["#f7f7f7","#fce4ec","#f8bbd9","#ee4567"]},textStyle:{color:m.value?"#ccc":"#333"}},series:[{type:"heatmap",data:z.filter(ae=>ae[2]>=0),label:{show:!1},emphasis:{itemStyle:{shadowBlur:10,shadowColor:"rgba(0, 0, 0, 0.5)"}}}],backgroundColor:"transparent"}}const b=$(()=>v.value?[...v.value.nodes].sort((A,z)=>z.messageCount-A.messageCount):[]),x=$(()=>!v.value||d.value===null?null:v.value.nodes.find(A=>A.id===d.value)||null),w=$(()=>{if(!v.value||!x.value)return[];const A=x.value.name,z=[];for(const B of v.value.links)B.source===A?z.push({otherName:B.target,value:B.value,coOccurrenceCount:B.coOccurrenceCount}):B.target===A&&z.push({otherName:B.source,value:B.value,coOccurrenceCount:B.coOccurrenceCount});return z.sort((B,ae)=>ae.value-B.value),z}),C=$(()=>v.value?v.value.links.slice(0,50):[]);function M(){i&&p.value==="matrix"&&i.setOption(_(),{notMerge:!0})}function L(){g.value&&(i=Je(g.value,m.value?"dark":void 0),M())}function F(){i?.resize()}return O(p,async(A,z)=>{z==="matrix"&&i&&(i.dispose(),i=null),A==="matrix"&&(await we(),L())}),O([v,()=>m.value],()=>{p.value==="matrix"&&M()},{deep:!0}),O(c,async(A,z)=>{z&&!A&&p.value==="matrix"&&(i&&(i.dispose(),i=null),await we(),L())}),O(()=>[s.sessionId,s.timeFilter],()=>n(),{immediate:!0,deep:!0}),pe(()=>{window.addEventListener("resize",F),p.value==="matrix"&&we(()=>L())}),Se(()=>{window.removeEventListener("resize",F),i?.dispose(),i=null}),(A,z)=>{const B=re,ae=Ee("UButtonGroup"),P=Be,Z=Xe,J=Ie;return o(),k("div",Lo,[a("div",Ao,[a("div",zo,[a("div",Uo,[f(ae,{size:"xs"},{default:T(()=>[f(B,{color:p.value==="matrix"?"primary":"neutral",variant:p.value==="matrix"?"solid":"ghost",onClick:z[0]||(z[0]=R=>p.value="matrix")},{default:T(()=>[G(u(e(t)("views.cluster.matrixView")),1)]),_:1},8,["color","variant"]),f(B,{color:p.value==="member"?"primary":"neutral",variant:p.value==="member"?"solid":"ghost",onClick:z[1]||(z[1]=R=>p.value="member")},{default:T(()=>[G(u(e(t)("views.cluster.memberView")),1)]),_:1},8,["color","variant"]),f(B,{color:p.value==="circle"?"primary":"neutral",variant:p.value==="circle"?"solid":"ghost",onClick:z[2]||(z[2]=R=>p.value="circle")},{default:T(()=>[G(u(e(t)("views.cluster.rankingView")),1)]),_:1},8,["color","variant"])]),_:1})]),a("div",Fo,[f(Z,null,{content:T(()=>[a("div",Bo,[a("h4",Ho,u(e(t)("views.cluster.modelSettings")),1),a("div",Wo,[a("div",null,[a("label",jo,u(e(t)("views.cluster.lookAhead")),1),f(P,{modelValue:y.value.lookAhead,"onUpdate:modelValue":z[3]||(z[3]=R=>y.value.lookAhead=R),modelModifiers:{number:!0},type:"number",min:1,max:10,size:"xs",placeholder:"1-10"},null,8,["modelValue"]),a("p",Oo,u(e(t)("views.cluster.lookAheadDesc")),1)]),a("div",null,[a("label",Eo,u(e(t)("views.cluster.decaySeconds")),1),f(P,{modelValue:y.value.decaySeconds,"onUpdate:modelValue":z[4]||(z[4]=R=>y.value.decaySeconds=R),modelModifiers:{number:!0},type:"number",min:30,max:3600,size:"xs",placeholder:"30-3600"},null,8,["modelValue"]),a("p",Po,u(e(t)("views.cluster.decaySecondsDesc")),1)]),f(B,{size:"xs",color:"primary",class:"w-full mt-2",onClick:n},{default:T(()=>[G(u(e(t)("views.cluster.applySettings")),1)]),_:1})])])]),default:T(()=>[f(B,{variant:"ghost",size:"xs",icon:"i-heroicons-adjustments-horizontal"})]),_:1}),f(B,{variant:"ghost",size:"xs",icon:"i-heroicons-arrow-path",onClick:n})])]),a("div",qo,[c.value?(o(),k("div",Go,[f(J,{name:"i-heroicons-arrow-path",class:"w-6 h-6 animate-spin text-gray-400"})])):!v.value||v.value.nodes.length===0?(o(),k("div",Yo,[a("div",Ko,[f(J,{name:"i-heroicons-user-group",class:"w-12 h-12 mx-auto mb-2 opacity-50"}),a("p",null,u(e(t)("views.cluster.noData")),1)])])):p.value==="matrix"?(o(),k("div",Jo,[a("div",{ref_key:"chartRef",ref:g,class:"w-full h-full"},null,512)])):p.value==="member"?(o(),k("div",Qo,[a("div",Zo,[a("div",Xo,[a("h3",en,[f(J,{name:"i-heroicons-users",class:"w-4 h-4"}),G(" "+u(e(t)("views.cluster.selectMember")),1)])]),a("div",tn,[(o(!0),k(W,null,X(b.value,R=>(o(),k("div",{key:R.id,class:Q(["px-4 py-2 cursor-pointer border-b border-gray-100 dark:border-gray-800 hover:bg-gray-50 dark:hover:bg-gray-800/50",{"bg-primary-50 dark:bg-primary-900/30":d.value===R.id}]),onClick:Y=>d.value=R.id},[a("div",sn,[a("span",on,u(R.name),1),a("span",nn,u(R.messageCount),1)])],10,an))),128))])]),a("div",ln,[x.value?(o(),k(W,{key:1},[a("div",un,[a("div",dn,u(x.value.name.charAt(0)),1),a("div",null,[a("div",mn,u(x.value.name),1),a("div",vn,u(e(t)("views.cluster.msgCount"))+": "+u(x.value.messageCount)+" | "+u(e(t)("views.cluster.relationCount"))+": "+u(w.value.length),1)])]),a("div",hn,[a("h3",pn,[f(J,{name:"i-heroicons-heart",class:"w-4 h-4 text-pink-500"}),G(" "+u(e(t)("views.cluster.relationsByIntimacy")),1)])]),a("div",gn,[w.value.length===0?(o(),k("div",fn,u(e(t)("views.cluster.noRelations")),1)):D("",!0),(o(!0),k(W,null,X(w.value,(R,Y)=>(o(),k("div",{key:R.otherName,class:"px-4 py-3 border-b border-gray-100 dark:border-gray-800 hover:bg-gray-50 dark:hover:bg-gray-800/50"},[a("div",yn,[a("span",{class:Q(["w-6 h-6 rounded-full flex items-center justify-center text-xs font-bold",Y<3?"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/30 dark:text-yellow-400":"bg-gray-100 text-gray-500 dark:bg-gray-800 dark:text-gray-400"])},u(Y+1),3),a("div",xn,[a("div",bn,u(R.otherName),1),a("div",kn,[a("span",null,u(e(t)("views.cluster.intimacy"))+": "+u((R.value*100).toFixed(0))+"%",1),a("span",null,u(e(t)("views.cluster.coOccurrence"))+": "+u(R.coOccurrenceCount)+u(e(t)("views.cluster.times")),1)])]),a("div",_n,[a("div",{class:"h-full bg-linear-to-r from-pink-400 to-pink-600",style:ve({width:`${w.value[0]?.value?R.value/w.value[0].value*100:0}%`})},null,4)])])]))),128))])],64)):(o(),k("div",rn,[a("div",cn,[f(J,{name:"i-heroicons-cursor-arrow-rays",class:"w-12 h-12 mx-auto mb-2 opacity-50"}),a("p",null,u(e(t)("views.cluster.selectMemberHint")),1)])]))])])):(o(),k("div",wn,[a("div",$n,[a("h3",Cn,[f(J,{name:"i-heroicons-trophy",class:"w-4 h-4 text-yellow-500"}),G(" "+u(e(t)("views.cluster.interactionRanking")),1)])]),a("div",In,[(o(!0),k(W,null,X(C.value,(R,Y)=>(o(),k("div",{key:Y,class:"px-4 py-3 border-b border-gray-100 dark:border-gray-800 hover:bg-gray-50 dark:hover:bg-gray-800/50"},[a("div",Sn,[a("span",{class:Q(["w-8 h-8 rounded-full flex items-center justify-center text-sm font-bold",Y<3?"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/30 dark:text-yellow-400":"bg-gray-100 text-gray-500 dark:bg-gray-800 dark:text-gray-400"])},u(Y+1),3),a("div",Tn,[a("div",Mn,[a("span",Vn,u(R.source),1),z[5]||(z[5]=a("span",{class:"text-gray-400"},"↔",-1)),a("span",Rn,u(R.target),1)]),a("div",Dn,[a("span",null,u(e(t)("views.cluster.score"))+": "+u(R.value.toFixed(2)),1),a("span",null,u(e(t)("views.cluster.coOccurrence"))+": "+u(R.coOccurrenceCount)+u(e(t)("views.cluster.times")),1)])]),a("div",Nn,[a("div",{class:"h-full bg-linear-to-r from-yellow-400 to-orange-500",style:ve({width:`${C.value[0]?.value?R.value/C.value[0].value*100:0}%`})},null,4)])])]))),128))])]))]),v.value?(o(),k("div",Ln,[a("span",null,u(e(t)("views.cluster.totalMembers"))+": "+u(v.value.stats.totalMembers),1),a("span",null,u(e(t)("views.cluster.totalMessages"))+": "+u(v.value.stats.totalMessages.toLocaleString()),1),a("span",null,u(e(t)("views.cluster.involvedMembers"))+": "+u(v.value.stats.involvedMembers),1),a("span",null,u(e(t)("views.cluster.edgeCount"))+": "+u(v.value.stats.edgeCount),1)])):D("",!0)])])}}}),zn={class:"flex h-full flex-col"},Un={class:"min-h-0 flex-1 overflow-y-auto"},Fn=H({__name:"GroupRelationships",props:{sessionId:{},timeFilter:{}},setup(h){const{t:s}=ee(),t=h,l=S("mention-graph"),m=$(()=>[{id:"mention-graph",label:s("analysis.subTabs.groupRelationships.mentionGraph"),icon:"i-heroicons-arrows-right-left"},{id:"mention-ranking",label:s("analysis.subTabs.groupRelationships.mentionRanking"),icon:"i-heroicons-heart"},{id:"proximity",label:s("analysis.subTabs.groupRelationships.proximity"),icon:"i-heroicons-user-group"}]);return(c,v)=>(o(),k("div",zn,[f(e(Pe),{modelValue:l.value,"onUpdate:modelValue":v[0]||(v[0]=p=>l.value=p),items:m.value,"persist-key":"groupRelationshipsTab",size:"sm"},null,8,["modelValue","items"]),a("div",Un,[f(Te,{name:"fade",mode:"out-in"},{default:T(()=>[l.value==="mention-graph"?(o(),I(Js,{key:0,"session-id":t.sessionId,"time-filter":t.timeFilter},null,8,["session-id","time-filter"])):l.value==="mention-ranking"?(o(),I(No,{key:1,"session-id":t.sessionId,"time-filter":t.timeFilter},null,8,["session-id","time-filter"])):l.value==="proximity"?(o(),I(An,{key:2,"session-id":t.sessionId,"time-filter":t.timeFilter},null,8,["session-id","time-filter"])):D("",!0)]),_:1})])]))}}),Bn=Ve(Fn,[["__scopeId","data-v-531340f2"]]),Hn={class:"flex h-full flex-col"},Wn={class:"flex-1 min-h-0 overflow-y-auto"},jn=H({__name:"ViewTab",props:{sessionId:{},sessionName:{},timeFilter:{}},setup(h){const{t:s,locale:t}=ee(),l=h,m=$(()=>{const d=[{id:"type-analysis",label:s("analysis.subTabs.view.typeAnalysis"),icon:"i-heroicons-chart-pie"},{id:"time-analysis",label:s("analysis.subTabs.view.timeAnalysis"),icon:"i-heroicons-clock"},{id:"topic",label:s("analysis.subTabs.view.topic"),icon:"i-heroicons-cloud"},{id:"group-relationships",label:s("analysis.subTabs.view.groupRelationships"),icon:"i-heroicons-heart"},{id:"hot-repeat",label:s("analysis.subTabs.quotes.hotRepeat"),icon:"i-heroicons-fire"},{id:"catchphrase",label:s("analysis.subTabs.quotes.catchphrase"),icon:"i-heroicons-chat-bubble-bottom-center-text"}];return ct("groupRanking",t.value)&&d.splice(2,0,{id:"ranking",label:s("analysis.subTabs.view.ranking"),icon:"i-heroicons-trophy"}),d}),c=S("type-analysis"),v=S(null),p=$(()=>({...l.timeFilter,memberId:v.value}));return(d,y)=>(o(),k("div",Hn,[f(e(Pe),{modelValue:c.value,"onUpdate:modelValue":y[1]||(y[1]=g=>c.value=g),items:m.value,"persist-key":"groupViewTab"},{right:T(()=>[c.value!=="topic"?(o(),I(kt,{key:0,modelValue:v.value,"onUpdate:modelValue":y[0]||(y[0]=g=>v.value=g),"session-id":l.sessionId},null,8,["modelValue","session-id"])):D("",!0)]),_:1},8,["modelValue","items"]),a("div",Wn,[f(Te,{name:"fade",mode:"out-in"},{default:T(()=>[c.value==="type-analysis"?(o(),I(_t,{key:0,"session-id":l.sessionId,"session-name":l.sessionName,"time-filter":p.value},null,8,["session-id","session-name","time-filter"])):c.value==="time-analysis"?(o(),I(wt,{key:1,"session-id":l.sessionId,"session-name":l.sessionName,"time-filter":p.value},null,8,["session-id","session-name","time-filter"])):c.value==="topic"?(o(),I(e($t),{key:2,"session-id":l.sessionId,"time-filter":l.timeFilter},null,8,["session-id","time-filter"])):c.value==="group-relationships"?(o(),I(Bn,{key:3,"session-id":l.sessionId,"time-filter":p.value},null,8,["session-id","time-filter"])):c.value==="ranking"?(o(),I(As,{key:4,"session-id":l.sessionId,"time-filter":p.value},null,8,["session-id","time-filter"])):c.value==="hot-repeat"?(o(),I(e(za),{key:5,"session-id":l.sessionId,"time-filter":l.timeFilter},null,8,["session-id","time-filter"])):c.value==="catchphrase"?(o(),I(e(Ta),{key:6,"session-id":l.sessionId,"time-filter":l.timeFilter},null,8,["session-id","time-filter"])):D("",!0)]),_:1})])]))}}),On=Ve(jn,[["__scopeId","data-v-ab94305e"]]),En={key:0,class:"mb-6"},Pn={class:"flex items-center gap-3"},qn={class:"text-xl font-bold text-gray-900 dark:text-white"},Gn={class:"text-sm text-gray-500 dark:text-gray-400"},Yn={class:"mb-4 flex flex-wrap items-center justify-between gap-3"},Kn={class:"flex items-center gap-2"},Jn={class:"text-xs text-gray-500 dark:text-gray-400"},Qn={key:0,class:"flex h-60 items-center justify-center"},Zn={key:1,class:"flex h-60 flex-col items-center justify-center"},Xn={class:"text-gray-500 dark:text-gray-400"},el={key:2,class:"flex min-h-0 flex-1 flex-col"},tl={class:"w-full"},al={class:"sticky top-0 bg-gray-50 dark:bg-gray-800"},sl={class:"text-left text-xs font-medium uppercase text-gray-500 dark:text-gray-400"},ol={class:"px-4 py-4"},nl={class:"px-4 py-4"},ll={class:"px-4 py-4"},il={class:"w-64 px-4 py-4"},rl={class:"inline-flex items-center gap-1.5"},cl={class:"px-4 py-4 text-right"},ul={class:"divide-y divide-gray-200 dark:divide-gray-700"},dl={class:"px-4 py-4"},ml={class:"px-4 py-4"},vl={class:"flex items-center gap-2"},hl=["src","alt"],pl={key:1,class:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-gradient-to-br from-pink-400 to-pink-600 text-xs font-medium text-white"},gl={class:"text-sm font-medium text-gray-900 dark:text-white"},fl={class:"ml-1 text-sm text-gray-500 dark:text-gray-400"},yl={class:"px-4 py-4"},xl={key:0,class:"text-sm font-medium text-gray-900 dark:text-white"},bl={key:1,class:"text-sm text-gray-400 dark:text-gray-500"},kl={class:"px-4 py-4"},_l={class:"text-sm font-semibold text-gray-900 dark:text-white"},wl={class:"px-4 py-4"},$l={class:"max-w-xs"},Cl={key:0,class:"absolute right-2 top-1/2 -translate-y-1/2"},Il={class:"px-4 py-4 text-right"},Sl={key:0,class:"flex items-center justify-between border-t border-gray-200 px-6 py-4 dark:border-gray-700"},Tl={class:"text-sm text-gray-500 dark:text-gray-400"},Ml={class:"flex items-center gap-2"},Vl={class:"text-sm font-medium text-gray-600 dark:text-gray-300"},Rl={class:"p-6 text-center"},Dl={class:"mx-auto mb-4 flex h-14 w-14 items-center justify-center rounded-full bg-red-100 dark:bg-red-900/30"},Nl={class:"mb-2 text-lg font-semibold text-gray-900 dark:text-white"},Ll={class:"mb-6 text-sm text-gray-500 dark:text-gray-400"},Al={class:"flex justify-center gap-3"},zl={class:"p-6"},Ul={class:"mb-4 flex items-center gap-3"},Fl={class:"flex h-10 w-10 items-center justify-center rounded-full bg-amber-100 dark:bg-amber-900/30"},Bl={class:"text-lg font-semibold text-gray-900 dark:text-white"},Hl={class:"mb-2 text-sm text-gray-600 dark:text-gray-400"},Wl={class:"mb-6 text-xs text-amber-700 dark:text-amber-300"},jl={class:"flex justify-end gap-2"},$e=20,Ol=H({__name:"MemberList",props:{sessionId:{},showHeader:{type:Boolean,default:!0}},emits:["data-changed"],setup(h,{emit:s}){const{t}=ee(),l=h,m=s,c=S([]),v=S([]),p=S(!1),d=S(""),y=S(null),g=S(!1),i=S(new Set),n=S(!1),r=S(!1),_=S(1),b=S(0),x=S(0),w=S("desc"),C=S(null);let M=null;function L(N){return N.groupNickname||N.accountName||N.platformId}function F(N){return L(N).slice(0,1)}const A=$(()=>v.value.filter(N=>i.value.has(N.id))),z=$(()=>A.value.length===2),B=$(()=>{if(A.value.length!==2)return null;const[N,U]=A.value;return U.messageCount>N.messageCount||U.messageCount===N.messageCount&&U.id<N.id?{primary:U,secondary:N}:{primary:N,secondary:U}});function ae(){w.value=w.value==="desc"?"asc":"desc",_.value=1,P()}async function P(){if(l.sessionId){p.value=!0;try{const N=await K().getMembersPaginated(l.sessionId,{page:_.value,pageSize:$e,search:d.value.trim(),sortOrder:w.value});c.value=N.items,b.value=N.total,x.value=N.totalPages}catch(N){console.error("加载成员列表失败:",N)}finally{p.value=!1}}}async function Z(){if(l.sessionId)try{v.value=await K().getMembers(l.sessionId)}catch(N){console.error("加载所有成员失败:",N)}}async function J(N,U){const V=JSON.parse(JSON.stringify(U)),de=JSON.stringify(N.aliases),oe=JSON.stringify(V);if(de!==oe){C.value=N.id;try{if(await K().updateMemberAliases(l.sessionId,N.id,V)){const me=c.value.findIndex(ke=>ke.id===N.id);me!==-1&&(c.value[me]={...c.value[me],aliases:V})}}catch(j){console.error("保存别名失败:",j)}finally{C.value=null}}}function R(N){y.value=N}function Y(){y.value=null}async function ue(){if(y.value){g.value=!0;try{await K().deleteMember(l.sessionId,y.value.id)&&(await P(),await Z(),m("data-changed"))}catch(N){console.error("删除成员失败:",N)}finally{g.value=!1,y.value=null}}}function ge(N){const U=new Set(i.value);U.has(N)?U.delete(N):U.add(N),i.value=U}function xe(){z.value&&(n.value=!0)}function fe(){i.value=new Set}async function be(){if(B.value){r.value=!0;try{await K().mergeMembers(l.sessionId,B.value.primary.id,B.value.secondary.id)&&(n.value=!1,fe(),await P(),await Z(),m("data-changed"))}catch(N){console.error("合并成员失败:",N)}finally{r.value=!1}}}return O(d,()=>{_.value=1,M&&clearTimeout(M),M=setTimeout(()=>{P()},300)}),O(_,()=>{P()}),O(()=>l.sessionId,()=>{d.value="",_.value=1,fe(),P(),Z()},{immediate:!0}),pe(()=>{P(),Z()}),(N,U)=>{const V=re,de=Be,oe=Ie,j=et,me=tt,ke=at,Re=he;return o(),k("div",{class:Q(["main-content",l.showHeader?"max-w-5xl p-6":"flex h-full max-w-none flex-col overflow-hidden p-4"])},[l.showHeader?(o(),k("div",En,[a("div",Pn,[a("div",null,[a("h2",qn,u(e(t)("members.list.title")),1),a("p",Gn,u(e(t)("members.list.description",{count:b.value})),1)])])])):D("",!0),f(Ct,{class:"mb-6","session-id":h.sessionId,members:v.value,"chat-type":"group"},null,8,["session-id","members"]),a("div",Yn,[f(de,{modelValue:d.value,"onUpdate:modelValue":U[1]||(U[1]=E=>d.value=E),placeholder:e(t)("members.list.searchPlaceholder"),icon:"i-heroicons-magnifying-glass",class:"w-full md:w-100"},Oe({_:2},[d.value?{name:"trailing",fn:T(()=>[f(V,{icon:"i-heroicons-x-mark",variant:"link",color:"neutral",size:"xs",onClick:U[0]||(U[0]=E=>d.value="")})]),key:"0"}:void 0]),1032,["modelValue","placeholder"]),a("div",Kn,[a("span",Jn,u(e(t)("members.list.mergeSelectedCount",{count:i.value.size})),1),f(V,{icon:"i-heroicons-link",size:"sm",color:"primary",disabled:!z.value,onClick:xe},{default:T(()=>[G(u(e(t)("members.list.mergeSelected")),1)]),_:1},8,["disabled"])])]),a("div",{class:Q(["rounded-xl border border-gray-200 bg-white shadow-sm dark:border-gray-700 dark:bg-gray-900",l.showHeader?"":"flex min-h-0 flex-1 flex-col"])},[p.value?(o(),k("div",Qn,[f(oe,{name:"i-heroicons-arrow-path",class:"h-8 w-8 animate-spin text-pink-500"})])):c.value.length===0?(o(),k("div",Zn,[f(oe,{name:"i-heroicons-user-group",class:"mb-3 h-12 w-12 text-gray-300 dark:text-gray-600"}),a("p",Xn,u(d.value?e(t)("members.list.noMatch"):e(t)("members.list.empty")),1)])):(o(),k("div",el,[a("div",{class:Q(["max-h-[500px] overflow-y-auto",l.showHeader?"":"max-h-none min-h-0 flex-1"])},[a("table",tl,[a("thead",al,[a("tr",sl,[U[7]||(U[7]=a("th",{class:"w-12 px-4 py-4"},null,-1)),a("th",ol,u(e(t)("members.list.table.accountName")),1),a("th",nl,u(e(t)("members.list.table.groupNickname")),1),a("th",ll,[a("button",{class:"flex items-center gap-1.5 hover:text-gray-700 dark:hover:text-gray-200",onClick:ae},[G(u(e(t)("members.list.table.messageCount"))+" ",1),f(oe,{name:w.value==="desc"?"i-heroicons-arrow-down":"i-heroicons-arrow-up",class:"h-3.5 w-3.5"},null,8,["name"])])]),a("th",il,[a("div",rl,[a("span",null,u(e(t)("members.list.table.customAlias")),1),f(j,{text:e(t)("members.list.tip"),popper:{placement:"top"}},{default:T(()=>[f(oe,{name:"i-heroicons-question-mark-circle",class:"h-4 w-4 text-gray-400 dark:text-gray-500"})]),_:1},8,["text"])])]),a("th",cl,u(e(t)("members.list.table.actions")),1)])]),a("tbody",ul,[(o(!0),k(W,null,X(c.value,E=>(o(),k("tr",{key:E.id,class:"hover:bg-gray-50 dark:hover:bg-gray-800/50"},[a("td",dl,[f(me,{"model-value":i.value.has(E.id),onClick:je(_e=>ge(E.id),["stop"])},null,8,["model-value","onClick"])]),a("td",ml,[a("div",vl,[E.avatar?(o(),k("img",{key:0,src:E.avatar,alt:L(E),class:"h-8 w-8 shrink-0 rounded-full object-cover"},null,8,hl)):(o(),k("div",pl,u(F(E)),1)),a("div",null,[a("span",gl,u(E.accountName||"-"),1),a("span",fl,"("+u(E.platformId)+")",1)])])]),a("td",yl,[E.groupNickname?(o(),k("span",xl,u(E.groupNickname),1)):(o(),k("span",bl,"-"))]),a("td",kl,[a("span",_l,u(E.messageCount.toLocaleString()),1)]),a("td",wl,[a("div",$l,[f(ke,{"model-value":E.aliases,placeholder:e(t)("members.list.aliasPlaceholder"),class:"w-80","onUpdate:modelValue":_e=>J(E,_e)},null,8,["model-value","placeholder","onUpdate:modelValue"]),C.value===E.id?(o(),k("div",Cl,[f(oe,{name:"i-heroicons-arrow-path",class:"h-4 w-4 animate-spin text-pink-500"})])):D("",!0)])]),a("td",Il,[f(V,{label:e(t)("members.list.delete"),size:"xs",onClick:_e=>R(E)},null,8,["label","onClick"])])]))),128))])])],2),x.value>1?(o(),k("div",Sl,[a("p",Tl,u(e(t)("members.list.pagination",{start:(_.value-1)*$e+1,end:Math.min(_.value*$e,b.value),total:b.value})),1),a("div",Ml,[f(V,{icon:"i-heroicons-chevron-left",variant:"outline",size:"sm",disabled:_.value===1||p.value,onClick:U[2]||(U[2]=E=>_.value--)},null,8,["disabled"]),a("span",Vl,u(_.value)+" / "+u(x.value),1),f(V,{icon:"i-heroicons-chevron-right",variant:"outline",size:"sm",disabled:_.value>=x.value||p.value,onClick:U[3]||(U[3]=E=>_.value++)},null,8,["disabled"])])])):D("",!0)]))],2),f(Re,{open:!!y.value,ui:{content:"max-w-sm"},"onUpdate:open":U[4]||(U[4]=E=>y.value=null)},{content:T(()=>[a("div",Rl,[a("div",Dl,[f(oe,{name:"i-heroicons-exclamation-triangle",class:"h-7 w-7 text-red-500"})]),a("h3",Nl,u(e(t)("members.list.modal.title")),1),a("p",Ll,u(e(t)("members.list.modal.content",{name:y.value?L(y.value):"",count:y.value?.messageCount.toLocaleString()})),1),a("div",Al,[f(V,{variant:"outline",onClick:Y},{default:T(()=>[G(u(e(t)("members.list.modal.cancel")),1)]),_:1}),f(V,{color:"error",loading:g.value,onClick:ue},{default:T(()=>[G(u(e(t)("members.list.modal.confirm")),1)]),_:1},8,["loading"])])])]),_:1},8,["open"]),f(Re,{open:n.value,ui:{content:"max-w-md"},"onUpdate:open":U[6]||(U[6]=E=>n.value=E)},{content:T(()=>[a("div",zl,[a("div",Ul,[a("div",Fl,[f(oe,{name:"i-heroicons-link",class:"h-5 w-5 text-amber-600 dark:text-amber-400"})]),a("h3",Bl,u(e(t)("members.list.mergeModal.title")),1)]),a("p",Hl,u(e(t)("members.list.mergeModal.content",{source:B.value?L(B.value.secondary):"",sourceCount:B.value?B.value.secondary.messageCount.toLocaleString():"0",target:B.value?L(B.value.primary):"",targetCount:B.value?B.value.primary.messageCount.toLocaleString():"0"})),1),a("p",Wl,u(e(t)("members.list.mergeModal.hint")),1),a("div",jl,[f(V,{variant:"outline",disabled:r.value,onClick:U[5]||(U[5]=E=>n.value=!1)},{default:T(()=>[G(u(e(t)("members.list.mergeModal.cancel")),1)]),_:1},8,["disabled"]),f(V,{color:"primary",loading:r.value,onClick:be},{default:T(()=>[G(u(e(t)("members.list.mergeModal.confirm")),1)]),_:1},8,["loading"])])])]),_:1},8,["open"])],2)}}}),El={class:"main-content max-w-5xl p-6"},Pl={class:"mb-4 text-sm text-gray-500 dark:text-gray-400 no-capture"},ql={key:0,class:"divide-y divide-gray-100 dark:divide-gray-800"},Gl={class:"w-32 shrink-0 pt-0.5 font-medium text-gray-900 dark:text-white"},Yl={class:"flex flex-1 flex-wrap items-center gap-2"},Kl={class:"flex items-center gap-1.5 rounded-lg bg-gray-50 px-3 py-1.5 dark:bg-gray-800"},Jl={class:"text-xs text-gray-400"},Ql={key:0,class:"text-gray-300 dark:text-gray-600"},Zl=H({__name:"NicknameHistory",props:{sessionId:{}},setup(h){const{t:s}=ee(),t=h,l=S([]),m=S([]),c=S(!1);function v(y){return y.groupNickname||y.accountName||y.platformId}async function p(){if(t.sessionId)try{l.value=await K().getMembers(t.sessionId)}catch(y){console.error("加载成员列表失败:",y)}}async function d(){if(!t.sessionId||l.value.length===0)return;c.value=!0;const y=[];try{const g=l.value.map(n=>K().getMemberNameHistory(t.sessionId,n.id)),i=await Promise.all(g);l.value.forEach((n,r)=>{const _=i[r];_.length>2&&y.push({memberId:n.id,name:v(n),history:_})}),m.value=y}catch(g){console.error("加载昵称变更记录失败:",g)}finally{c.value=!1}}return O(()=>t.sessionId,async()=>{await p()},{immediate:!0}),O(()=>l.value.length,()=>{l.value.length>0&&d()}),pe(async()=>{l.value.length===0&&await p()}),(y,g)=>{const i=Fe;return o(),k("div",El,[a("p",Pl,u(e(s)("members.nicknameHistory.note")),1),f(e(q),{title:e(s)("members.nicknameHistory.title"),description:c.value?e(s)("members.nicknameHistory.loading"):m.value.length>0?e(s)("members.nicknameHistory.hasChanges",{count:m.value.length}):e(s)("members.nicknameHistory.noChanges")},{default:T(()=>[!c.value&&m.value.length>0?(o(),k("div",ql,[(o(!0),k(W,null,X(m.value,n=>(o(),k("div",{key:n.memberId,class:"flex items-start gap-3 px-5 py-3"},[a("div",Gl,u(n.name),1),a("div",Yl,[(o(!0),k(W,null,X(n.history,(r,_)=>(o(),k(W,{key:_},[a("div",Kl,[a("span",{class:Q(["text-sm",r.endTs===null?"font-semibold text-pink-600":"text-gray-700 dark:text-gray-300"])},u(r.name),3),r.endTs===null?(o(),I(i,{key:0,color:"primary",variant:"soft",size:"xs"},{default:T(()=>[G(u(e(s)("members.nicknameHistory.current")),1)]),_:1})):D("",!0),a("span",Jl,"("+u(e(It)(r.startTs,r.endTs))+")",1)]),_<n.history.length-1?(o(),k("span",Ql,"→")):D("",!0)],64))),128))])]))),128))])):c.value?(o(),I(e(se),{key:2,text:e(s)("members.nicknameHistory.loadingText")},null,8,["text"])):(o(),I(e(ne),{key:1,text:e(s)("members.nicknameHistory.empty")},null,8,["text"]))]),_:1},8,["title","description"])])}}}),Xl={class:"flex h-full flex-col overflow-hidden bg-white dark:bg-gray-900"},ei={class:"flex flex-none items-center justify-between border-b border-gray-200 px-5 py-3 dark:border-gray-700"},ti={class:"text-lg font-semibold text-gray-900 dark:text-white"},ai={class:"flex-1 overflow-auto"},si=H({__name:"NicknameHistoryEntry",props:{sessionId:{}},setup(h){const{t:s}=ee(),t=h,l=S(!1);return(m,c)=>{const v=re,p=he;return o(),k(W,null,[f(v,{variant:"ghost",icon:"i-heroicons-clock",size:"sm",onClick:c[0]||(c[0]=d=>l.value=!0)},{default:T(()=>[G(u(e(s)("analysis.subTabs.member.nicknameHistory")),1)]),_:1}),t.sessionId?(o(),I(p,{key:0,open:l.value,"onUpdate:open":c[2]||(c[2]=d=>l.value=d),ui:{content:"max-w-6xl h-[85vh]"}},{content:T(()=>[a("div",Xl,[a("div",ei,[a("h2",ti,u(e(s)("analysis.subTabs.member.nicknameHistory")),1),f(v,{variant:"ghost",icon:"i-heroicons-x-mark",size:"sm",onClick:c[1]||(c[1]=d=>l.value=!1)})]),a("div",ai,[f(Zl,{"session-id":t.sessionId},null,8,["session-id"])])])]),_:1},8,["open"])):D("",!0)],64)}}}),oi={class:"flex h-full flex-col bg-white dark:bg-gray-900",style:{"padding-top":"var(--titlebar-area-height)"}},ni={class:"relative flex-1 overflow-y-auto"},li={class:"h-full"},ii={key:2,class:"flex h-full items-center justify-center"},ri={class:"text-gray-500"},ci={class:"flex h-full flex-col overflow-hidden bg-white dark:bg-gray-900"},ui={class:"flex flex-none items-center justify-between border-b border-gray-200 px-5 py-3 dark:border-gray-700"},di={class:"text-lg font-semibold text-gray-900 dark:text-white"},mi={class:"text-sm text-gray-500 dark:text-gray-400"},vi={class:"flex items-center gap-2"},hi={class:"flex-1 overflow-hidden"},pi=H({__name:"index",setup(h){const s=We(()=>Ue(()=>import("./MessageExportModal-CF6yaor7.js"),__vite__mapDeps([5,6,4,7,8,9]))),{t}=ee(),l=st(),m=ot(),c=ut(),v=Me(),p=dt(),{currentSessionId:d}=mt(c),y=S(!1),g=S(!1),i=S(!1),n=S(!1),r=S(!1);function _(){v.openChatRecordDrawer({})}const b=[{id:"overview",labelKey:"analysis.tabs.overview",icon:"i-heroicons-chart-pie"},{id:"view",labelKey:"analysis.tabs.view",icon:"i-heroicons-presentation-chart-bar"},{id:"ai-chat",labelKey:"analysis.tabs.aiChat",icon:"i-heroicons-chat-bubble-left-ellipsis"},{id:"lab",labelKey:"analysis.tabs.lab",icon:"i-heroicons-beaker"}],x=$(()=>p.debugMode?[...b,{id:"debug",labelKey:"analysis.tabs.debug",icon:"i-heroicons-bug-ant"}]:b),w=$(()=>x.value.map(U=>U.id)),{activeTab:C,isLoading:M,isInitialLoad:L,session:F,memberActivity:A,hourlyActivity:z,dailyActivity:B,messageTypes:ae,timeRangeValue:P,fullTimeRange:Z,availableYears:J,timeFilter:R,selectedYearForOverview:Y,initialTimeState:ue,loadData:ge}=St({route:l,router:m,currentSessionId:d,selectSession:c.selectSession,defaultTab:p.defaultSessionTab,validTabIds:w.value}),xe=$(()=>A.value.slice(0,3)),fe=$(()=>A.value.length<=1?[]:[...A.value].sort((U,V)=>U.messageCount-V.messageCount).slice(0,1)),be=$(()=>A.value.reduce((U,V)=>U+V.messageCount,0)),N=$(()=>A.value.filter(U=>U.messageCount>0).length);return(U,V)=>{const de=re,oe=he;return o(),k("div",oi,[e(L)?(o(),I(se,{key:0,variant:"page",text:e(t)("analysis.groupChat.loading")},null,8,["text"])):e(F)?(o(),k(W,{key:1},[f(Tt,{"active-tab":e(C),"onUpdate:activeTab":V[0]||(V[0]=j=>De(C)?C.value=j:null),"time-range-value":e(P),"onUpdate:timeRangeValue":V[1]||(V[1]=j=>De(P)?P.value=j:null),title:e(F).name,avatar:e(F).groupAvatar,icon:"i-heroicons-chat-bubble-left-right","icon-class":"bg-primary-600 text-white dark:bg-primary-500 dark:text-white",tabs:x.value,"current-session-id":e(d),"initial-time-state":e(ue),onOpenIncrementalImport:V[2]||(V[2]=j=>i.value=!0),onOpenMemberManagement:V[3]||(V[3]=j=>r.value=!0),onOpenChatRecord:_,"onUpdate:fullRange":V[4]||(V[4]=j=>Z.value=j),"onUpdate:availableYears":V[5]||(V[5]=j=>J.value=j)},null,8,["active-tab","time-range-value","title","avatar","tabs","current-session-id","initial-time-state"]),a("div",ni,[e(M)?(o(),I(se,{key:0,variant:"overlay"})):D("",!0),a("div",li,[f(Te,{name:"tab-slide",mode:"out-in"},{default:T(()=>[e(C)==="overview"?(o(),I(Wa,{key:"overview-"+e(d),session:e(F),"member-activity":e(A),"top-members":xe.value,"bottom-members":fe.value,"message-types":e(ae),"hourly-activity":e(z),"daily-activity":e(B),"time-range":e(Z),"selected-year":e(Y),"filtered-message-count":be.value,"filtered-member-count":N.value,"time-filter":e(R)},null,8,["session","member-activity","top-members","bottom-members","message-types","hourly-activity","daily-activity","time-range","selected-year","filtered-message-count","filtered-member-count","time-filter"])):e(C)==="view"?(o(),I(On,{key:"view-"+e(d),"session-id":e(d),"session-name":e(F).name,"time-filter":e(R)},null,8,["session-id","session-name","time-filter"])):e(C)==="ai-chat"?(o(),I(e(Nt),{key:"ai-chat-"+e(d),"session-id":e(d),"session-name":e(F).name,"chat-type":"group"},null,8,["session-id","session-name"])):e(C)==="memory"?(o(),I(Lt,{key:"memory-"+e(d),"session-id":e(d),"session-name":e(F).name},null,8,["session-id","session-name"])):e(C)==="lab"?(o(),I(At,{key:"lab-"+e(d),"session-id":e(d),"session-name":e(F).name,"time-filter":e(R),"chat-type":"group",mode:"sql-only"},null,8,["session-id","session-name","time-filter"])):e(C)==="debug"?(o(),I(e(zt),{key:"debug-"+e(d),"session-id":e(d)},null,8,["session-id"])):D("",!0)]),_:1})])]),f(Mt,{onOpenIncrementalImport:V[6]||(V[6]=j=>i.value=!0),onOpenSessionIndex:V[7]||(V[7]=j=>y.value=!0),onOpenMemberManagement:V[8]||(V[8]=j=>r.value=!0),onOpenChatRecord:_,onOpenMessageExport:V[9]||(V[9]=j=>n.value=!0)}),e(p).debugMode?(o(),I(Ut,{key:0})):D("",!0)],64)):(o(),k("div",ii,[a("p",ri,u(e(t)("analysis.groupChat.loadError")),1)])),e(d)&&e(F)&&e(F).messageCount>0?(o(),I(Vt,{key:3,modelValue:y.value,"onUpdate:modelValue":V[10]||(V[10]=j=>y.value=j),"session-id":e(d),"message-count":e(F).messageCount},null,8,["modelValue","session-id","message-count"])):D("",!0),e(d)&&e(F)&&!y.value?(o(),I(Rt,{key:4,modelValue:g.value,"onUpdate:modelValue":V[11]||(V[11]=j=>g.value=j),"session-id":e(d),"chat-type":"group","auto-check":""},null,8,["modelValue","session-id"])):D("",!0),e(d)&&e(F)?(o(),I(Dt,{key:5,modelValue:i.value,"onUpdate:modelValue":V[12]||(V[12]=j=>i.value=j),"session-id":e(d),"session-name":e(F).name,onImported:V[13]||(V[13]=()=>{e(ge)(),e(c).loadSessions()})},null,8,["modelValue","session-id","session-name"])):D("",!0),e(d)?(o(),I(e(s),{key:6,modelValue:n.value,"onUpdate:modelValue":V[14]||(V[14]=j=>n.value=j)},null,8,["modelValue"])):D("",!0),e(d)?(o(),I(oe,{key:7,open:r.value,"onUpdate:open":V[16]||(V[16]=j=>r.value=j),ui:{content:"max-w-6xl h-[85vh]"}},{content:T(()=>[a("div",ci,[a("div",ui,[a("div",null,[a("h2",di,u(e(t)("analysis.tooltip.memberManagement")),1),a("p",mi,u(e(t)("members.list.description",{count:e(F)?.memberCount??0})),1)]),a("div",vi,[f(si,{"session-id":e(d)},null,8,["session-id"]),f(de,{variant:"ghost",icon:"i-heroicons-x-mark",size:"sm",onClick:V[15]||(V[15]=j=>r.value=!1)})])]),a("div",hi,[f(Ol,{"session-id":e(d),"show-header":!1,onDataChanged:e(ge)},null,8,["session-id","onDataChanged"])])])]),_:1},8,["open"])):D("",!0)])}}}),Ci=Ve(pi,[["__scopeId","data-v-1452caf7"]]);export{Ci as default};