chatlab-cli 0.25.1 → 0.26.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.
- package/dist/{chat-command-5XMRLXZM.mjs → chat-command-T3Z4O4M5.mjs} +144 -6
- package/dist/chat-command-T3Z4O4M5.mjs.map +1 -0
- package/dist/{chunk-CUCDRAY6.mjs → chunk-3APSMVOM.mjs} +2 -2
- package/dist/{chunk-WYHGWTA4.mjs → chunk-6O2SW5GL.mjs} +94 -29
- package/dist/chunk-6O2SW5GL.mjs.map +1 -0
- package/dist/{chunk-GTCTDD2Z.mjs → chunk-AZZYKUBR.mjs} +17 -39
- package/dist/chunk-AZZYKUBR.mjs.map +1 -0
- package/dist/{chunk-JE3FOFF7.mjs → chunk-FACKH2BR.mjs} +49 -12
- package/dist/chunk-FACKH2BR.mjs.map +1 -0
- package/dist/{chunk-PDQFSQO6.mjs → chunk-FAOZNMPK.mjs} +2 -2
- package/dist/{chunk-7VG6QGQ2.mjs → chunk-GUGKY2GV.mjs} +1169 -328
- package/dist/chunk-GUGKY2GV.mjs.map +1 -0
- package/dist/{chunk-FDK6SPCG.mjs → chunk-MZG2GLJR.mjs} +2 -2
- package/dist/{chunk-YZYP5ST6.mjs → chunk-SC77N66X.mjs} +12 -11
- package/dist/chunk-SC77N66X.mjs.map +1 -0
- package/dist/cli.mjs +3 -3
- package/dist/{http-C3CGXUBU.mjs → http-6LQUOYQ6.mjs} +8 -8
- package/dist/{import-VS7L5JDX.mjs → import-B2MAIBAK.mjs} +4 -4
- package/dist/index.mjs +8 -8
- package/dist/{mcp-6VXDPUQK.mjs → mcp-ZMMYW46I.mjs} +4 -4
- package/dist/{stream-import-TFDBNVIW.mjs → stream-import-FHFBCEDV.mjs} +3 -3
- package/dist-web/assets/{DebugToolsPanel-vn-bnUxn.css → DebugToolsPanel-CrqULdXp.css} +1 -1
- package/dist-web/assets/DebugToolsPanel.vue_vue_type_script_setup_true_lang-CgtTQTfN.js +182 -0
- package/dist-web/assets/{EChartWordcloud-CzhfrEF_.js → EChartWordcloud-B_YisOW5.js} +1 -1
- package/dist-web/assets/MessageExportModal-B8DKeSAH.js +1 -0
- package/dist-web/assets/{electron-DRkrjeIl.js → electron-C-aMus7e.js} +1 -1
- package/dist-web/assets/electron-dBbXcMDB.js +1 -0
- package/dist-web/assets/{fetch-CDamdvtb.js → fetch-B-LdQP9s.js} +1 -1
- package/dist-web/assets/{fetch-Drk9dLaF.js → fetch-B26JuD67.js} +1 -1
- package/dist-web/assets/{fetch-BmZIm6mS.js → fetch-BLKibnXa.js} +1 -1
- package/dist-web/assets/{fetch-BqLy63aj.js → fetch-BNNqdS2B.js} +1 -1
- package/dist-web/assets/fetch-BSJY7tRo.js +1 -0
- package/dist-web/assets/{fetch-DWg-2kOp.js → fetch-CV8jezsM.js} +1 -1
- package/dist-web/assets/{fetch-ph2_d79v.js → fetch-CvnJ4Jgf.js} +1 -1
- package/dist-web/assets/{fetch-DfgdagMN.js → fetch-DP3yNfJM.js} +1 -1
- package/dist-web/assets/{fetch-Bvcxe5PI.js → fetch-phbrO2bY.js} +1 -1
- package/dist-web/assets/{fetch-Y-_WsCuk.js → fetch-xB6cl_1L.js} +3 -3
- package/dist-web/assets/index-8Zcs8peI.css +1 -0
- package/dist-web/assets/index-B_lOzUD8.js +2 -0
- package/dist-web/assets/index-BvWcJc3c.js +173 -0
- package/dist-web/assets/{index-DMWf5On7.js → index-CSDI5pAA.js} +2 -2
- package/dist-web/assets/{index-CGNgUIT-.css → index-CX2FucK5.css} +1 -1
- package/dist-web/assets/{index-9urfJP1r.js → index-DJQFNVUJ.js} +1 -1
- package/dist-web/assets/index-DZ6Szt_y.js +163 -0
- package/dist-web/assets/index-DhpclWeF.js +11 -0
- package/dist-web/assets/index-Dhql4DJr.css +1 -0
- package/dist-web/assets/{vendor-nuxt-ui-C_8CsH6e.js → vendor-nuxt-ui-Zy8txNdC.js} +1 -1
- package/dist-web/assets/{vendor-reka-ui-CIMXwvEp.js → vendor-reka-ui-mMvma1EP.js} +1 -1
- package/dist-web/assets/{web-XJV6Vj5t.js → web-DUQU-v8U.js} +1 -1
- package/dist-web/index.html +4 -4
- package/package.json +1 -1
- package/dist/chat-command-5XMRLXZM.mjs.map +0 -1
- package/dist/chunk-7VG6QGQ2.mjs.map +0 -1
- package/dist/chunk-GTCTDD2Z.mjs.map +0 -1
- package/dist/chunk-JE3FOFF7.mjs.map +0 -1
- package/dist/chunk-WYHGWTA4.mjs.map +0 -1
- package/dist/chunk-YZYP5ST6.mjs.map +0 -1
- package/dist-web/assets/DebugToolsPanel.vue_vue_type_script_setup_true_lang-B1xZmp9r.js +0 -161
- package/dist-web/assets/MessageExportModal-B79pPBL9.js +0 -1
- package/dist-web/assets/electron-Dv8jdn_2.js +0 -1
- package/dist-web/assets/fetch-BstX-wd4.js +0 -1
- package/dist-web/assets/index-C3A_Rjh-.css +0 -1
- package/dist-web/assets/index-CfKjh0Jr.js +0 -9
- package/dist-web/assets/index-CprJOAB1.css +0 -1
- package/dist-web/assets/index-D_hHm7bQ.js +0 -2
- package/dist-web/assets/index-MCdpiX_O.js +0 -173
- package/dist-web/assets/index-deYDOVUa.js +0 -163
- /package/dist/{chunk-CUCDRAY6.mjs.map → chunk-3APSMVOM.mjs.map} +0 -0
- /package/dist/{chunk-PDQFSQO6.mjs.map → chunk-FAOZNMPK.mjs.map} +0 -0
- /package/dist/{chunk-FDK6SPCG.mjs.map → chunk-MZG2GLJR.mjs.map} +0 -0
- /package/dist/{http-C3CGXUBU.mjs.map → http-6LQUOYQ6.mjs.map} +0 -0
- /package/dist/{import-VS7L5JDX.mjs.map → import-B2MAIBAK.mjs.map} +0 -0
- /package/dist/{mcp-6VXDPUQK.mjs.map → mcp-ZMMYW46I.mjs.map} +0 -0
- /package/dist/{stream-import-TFDBNVIW.mjs.map → stream-import-FHFBCEDV.mjs.map} +0 -0
|
@@ -0,0 +1,163 @@
|
|
|
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-B8DKeSAH.js","assets/vendor-nuxt-ui-Zy8txNdC.js","assets/index-DhpclWeF.js","assets/vendor-snapdom-XnBoh1gd.js","assets/index-Dhql4DJr.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as Fe}from"./vendor-snapdom-XnBoh1gd.js";import{k as st,g as xe,b as me,l as at,a as Me,j as Be,c as nt,e as Ue,_ as ot,n as rt,D as it,u as lt,d as ct}from"./vendor-nuxt-ui-Zy8txNdC.js";import{b as L,d as be,F as Te,p as P,G as i,P as S,Q as Z,a5 as a,Z as q,a3 as se,T as x,O as He,J as dt,H as N,a0 as ye,h as D,w as G,u as t,K as A,L as $,U as B,R as K,bI as We,a9 as je,bJ as ut,au as Pe,bF as qe,n as Ie,bD as De,i as Ve}from"./vendor-reka-ui-mMvma1EP.js";import{p as mt,u as ae,k as Re,T as ce,j as Y,q as gt,r as Ye,_ as Ne,t as pt,e as ht,b as vt,s as ft}from"./index-DhpclWeF.js";import{_ as ne,a as Q,g as Ge,b as yt,c as oe,d as le,e as xt,f as Se,h as bt,i as Ae,j as _t,u as kt,k as wt,l as $t,m as It,n as Ct,o as St,p as Mt,q as Tt,r as Dt,s as Rt,t as Nt,v as Lt,w as Vt,x as At,y as Et,C as Ot,z as zt,A as Ft,D as Bt,B as Ut}from"./DebugToolsPanel.vue_vue_type_script_setup_true_lang-CgtTQTfN.js";import"./vendor-echarts-wordcloud-B1kQMklB.js";import{u as Je,i as Ht,j as Qe,k as Wt,m as Ke,n as Xe,o as jt,p as Pt,q as qt}from"./vendor-echarts-CITQeskI.js";import{a as Ee}from"./index-CSDI5pAA.js";import"./vendor-zrender-DFl4U2Oe.js";function Yt(l,s={}){const{threshold:e=300,containerSelector:o=".overflow-y-auto",scrollLockDuration:c=800}=s,u=L(l[0]?.id||"");let d=!1;const m=L(null);let p=null;function _(){if(d)return;const g=[];l.forEach(r=>{const h=document.getElementById(r.id);if(h){const f=h.getBoundingClientRect();g.push({id:r.id,top:Math.round(f.top)})}});let n=0;for(let r=0;r<g.length;r++){if(g[r].top>e){n=Math.max(0,r-1);break}n=r}u.value=l[n]?.id||""}function y(g){const n=document.getElementById(g);n&&(u.value=g,d=!0,n.scrollIntoView({behavior:"smooth",block:"start"}),setTimeout(()=>{d=!1,_()},c))}return be(()=>{p=m.value?.closest(o)||null,p&&(p.addEventListener("scroll",_,{passive:!0}),_())}),Te(()=>{p&&p.removeEventListener("scroll",_)}),{contentRef:m,activeAnchor:u,scrollToAnchor:y,updateActiveAnchor:_}}const Gt={class:"sticky top-24 space-y-6"},Jt={class:"border-l border-gray-200 dark:border-gray-800"},Qt=["onClick"],Kt=P({__name:"PageAnchorsNav",props:{anchors:{},activeAnchor:{},width:{default:"w-44"},hideOnMobile:{type:Boolean,default:!0}},emits:["click"],setup(l,{emit:s}){const e=s;function o(c){e("click",c)}return(c,u)=>(i(),S("div",{class:Z([l.width,"shrink-0",l.hideOnMobile?"hidden lg:block":""])},[a("div",Gt,[a("nav",null,[a("div",Jt,[(i(!0),S(q,null,se(l.anchors,d=>(i(),S("button",{key:d.id,class:Z(["-ml-px block border-l-2 py-1.5 pl-4 text-left text-sm transition-colors",[l.activeAnchor===d.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:m=>o(d.id)},x(d.label),11,Qt))),128))])]),He(c.$slots,"default")])],2))}}),ue=P({__name:"TopNSelect",props:{modelValue:{default:10},modelModifiers:{}},emits:["update:modelValue"],setup(l){const s=dt(l,"modelValue"),e=[{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(o,c)=>{const u=st;return i(),N(u,{modelValue:s.value,"onUpdate:modelValue":c[0]||(c[0]=d=>s.value=d),items:e,"value-key":"value",class:"w-25"},null,8,["modelValue"])}}}),pe=P({__name:"ScrollableChart",props:{contentHeight:{},maxHeightVh:{default:60},paddingClass:{default:"px-3 py-2"}},setup(l){const s=l,e=D(()=>typeof window>"u"?500:Math.round(window.innerHeight*s.maxHeightVh/100)),o=D(()=>s.contentHeight>e.value),c=D(()=>({maxHeight:`${s.maxHeightVh}vh`,overflowY:o.value?"auto":"hidden"}));return(u,d)=>(i(),S("div",{class:Z(l.paddingClass),style:ye(c.value)},[He(u.$slots,"default")],6))}}),Xt=P({__name:"EChartGraph",props:{data:{},height:{default:400},layout:{default:"circular"},directed:{type:Boolean,default:!1}},setup(l,{expose:s}){Je([Ht,Qe,Wt,Ke]);const e=l,o=D(()=>typeof e.height=="number"?`${e.height}px`:e.height),c=mt(),u=L(null);let d=null;const m=["#ee4567","#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#9a60b4","#fc8452","#3ba272","#ea7ccc","#6e7074","#546570"],p=D(()=>{const b=new Set;return e.data.nodes.filter(k=>b.has(k.name)?!1:(b.add(k.name),!0))}),_=D(()=>{const b=new Map;return p.value.forEach((k,I)=>{b.set(k.name,m[I%m.length])}),b});function y(b,k){return k<=0?1:1+b/k*5}const g=D(()=>{const b=e.data.maxLinkValue||Math.max(...e.data.links.map(k=>k.value||1),1);return{tooltip:{trigger:"item",backgroundColor:c.value?"rgba(30, 30, 30, 0.9)":"rgba(255, 255, 255, 0.95)",borderColor:c.value?"rgba(255, 255, 255, 0.1)":"rgba(0, 0, 0, 0.1)",textStyle:{color:c.value?"#e5e7eb":"#374151"},formatter:k=>k.dataType==="node"?`<b>${k.data.name}</b><br/>消息数: ${k.data.value||0}`:k.dataType==="edge"?`${k.data.source} → ${k.data.target}<br/>艾特次数: ${k.data.value||0}`:""},animationDuration:1e3,animationDurationUpdate:500,animationEasingUpdate:"quinticInOut",series:[{type:"graph",layout:e.layout,circular:e.layout==="circular"?{rotateLabel:!0}:void 0,force:e.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:c.value?"#e5e7eb":"#374151",fontSize:11,fontWeight:500},edgeSymbol:e.directed?["none","arrow"]:["none","none"],edgeSymbolSize:e.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:p.value.map(k=>{const I=_.value.get(k.name)||m[0];return{name:k.name,value:k.value,symbolSize:k.symbolSize||30,label:{show:e.layout==="circular"?!0:(k.symbolSize||30)>30},itemStyle:{color:I,borderColor:"#fff",borderWidth:2,shadowBlur:5,shadowColor:`${I}66`}}}),links:e.data.links.filter(k=>_.value.has(k.source)&&_.value.has(k.target)).map(k=>{const I=_.value.get(k.source)||m[0];return{source:k.source,target:k.target,value:k.value,lineStyle:{color:I,width:y(k.value||1,b)}}})}]}});function n(){u.value&&(d=Xe(u.value,c.value?"dark":void 0,{renderer:"canvas"}),d.setOption({backgroundColor:"transparent",...g.value}))}function r(){d&&d.setOption({backgroundColor:"transparent",...g.value},{notMerge:!0})}function h(){d?.resize()}function f(){d&&d.dispatchAction({type:"restore"})}return s({resetView:f}),G([()=>e.data,()=>e.layout,()=>e.directed,c],()=>{d?r():n()},{deep:!0}),be(()=>{n(),window.addEventListener("resize",h)}),Te(()=>{window.removeEventListener("resize",h),d?.dispose()}),(b,k)=>(i(),S("div",{ref_key:"chartRef",ref:u,style:ye({height:o.value,width:"100%"})},null,4))}}),Zt={class:"px-3 py-2"},ke=P({__name:"EChartRank",props:{members:{},title:{},description:{},topN:{default:10},unit:{default:"条"},height:{default:"auto"},maxHeightVh:{default:60},bare:{type:Boolean,default:!1}},setup(l){const s=l,e=D(()=>s.members.slice(0,s.topN)),o=D(()=>{if(s.height!=="auto")return s.height;const m=e.value.length*36;return Math.max(m+30,180)}),c={type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:"#ee4567"},{offset:1,color:"#f7758c"}]};function u(m,p=8){return m.length<=p?m:m.slice(0,p)+"…"}const d=D(()=>{const m=[...e.value].reverse(),p=m.map(n=>u(n.name)),_=m.map(n=>n.value),y=Math.max(..._,1),g=m.map(n=>({value:n.value,itemStyle:{color:c,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 h=e.value.length-1-r.dataIndex,f=e.value[h];return`
|
|
3
|
+
<div style="padding: 4px 8px;">
|
|
4
|
+
<div style="font-weight: bold; margin-bottom: 4px;">${f.name}</div>
|
|
5
|
+
<div>${f.value} ${s.unit} (${f.percentage}%)</div>
|
|
6
|
+
</div>
|
|
7
|
+
`}},grid:{left:110,right:70,top:15,bottom:15,containLabel:!1},xAxis:{type:"value",max:y*1.1,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1}},yAxis:{type:"category",data:p,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{fontSize:12,color:"#4b5563",margin:12,formatter:(n,r)=>{const f=e.value.length-1-r+1;return`${f===1?"🥇":f===2?"🥈":f===3?"🥉":`${f}.`} ${n}`}}},series:[{type:"bar",data:g,barWidth:18,barCategoryGap:"30%",label:{show:!0,position:"right",distance:8,formatter:n=>{const r=e.value.length-1-n.dataIndex;return`${e.value[r].value} ${s.unit}`},fontSize:11,fontWeight:500,color:"#6b7280"},emphasis:{itemStyle:{shadowBlur:6,shadowColor:"rgba(238, 69, 103, 0.3)"}}}]}});return(m,p)=>l.bare?(i(),N(t(pe),{key:0,"content-height":o.value,"max-height-vh":l.maxHeightVh},{default:A(()=>[$(ne,{option:d.value,height:o.value},null,8,["option","height"])]),_:1},8,["content-height","max-height-vh"])):(i(),N(t(Q),{key:1,title:l.title,description:l.description,scrollable:"","max-height-vh":l.maxHeightVh},{default:A(()=>[a("div",Zt,[$(ne,{option:d.value,height:o.value},null,8,["option","height"])])]),_:1},8,["title","description","max-height-vh"]))}}),es={class:"divide-y divide-gray-100 dark:divide-gray-800"},ts={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"},ss={class:"w-32 shrink-0"},as={class:"wrap-break-word font-medium text-gray-900 dark:text-white"},ns={class:"flex flex-1 items-center"},os={class:"h-2 w-full overflow-hidden rounded-full bg-gray-100 dark:bg-gray-800"},rs={class:"flex shrink-0 items-baseline gap-2 whitespace-nowrap"},is={class:"text-lg font-bold text-gray-900 dark:text-white"},ls={class:"text-sm text-gray-500"},Oe=P({__name:"RankList",props:{members:{},showAvatar:{type:Boolean,default:!1},rankLimit:{default:0},unit:{}},setup(l){const{t:s}=ae(),e=l,o=D(()=>e.unit||s("views.charts.rankList.unit")),c=D(()=>e.rankLimit>0?e.members.slice(0,e.rankLimit):e.members);function u(d){if(c.value.length===0)return 0;const m=c.value[0].value;return m===0?0:Math.round(c.value[d].value/m*100)}return(d,m)=>(i(),S("div",es,[(i(!0),S(q,null,se(c.value,(p,_)=>(i(),S("div",{key:p.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:Z(["flex h-8 w-8 shrink-0 items-center justify-center rounded-full text-sm font-bold",t(Ge)(_)])},x(_+1),3),l.showAvatar?(i(),S("div",ts,x(p.name.slice(0,1)),1)):B("",!0),a("div",ss,[a("p",as,x(p.name),1)]),a("div",ns,[a("div",os,[a("div",{class:Z(["h-full rounded-full bg-linear-to-r transition-all",t(yt)(_)]),style:ye({width:`${u(_)}%`})},null,6)])]),a("div",rs,[a("span",is,x(p.value),1),a("span",ls,x(o.value)+" ("+x(p.percentage)+"%)",1)])]))),128))]))}}),cs={class:"flex items-center justify-between border-b border-gray-200 px-5 py-3 dark:border-gray-800"},ds={class:"font-semibold text-gray-900 whitespace-nowrap dark:text-white"},us={key:0,class:"mt-1 text-sm text-gray-500 dark:text-gray-400"},ms={class:"no-capture flex items-center gap-1"},gs={class:"flex w-full items-center justify-between border-b border-gray-200 px-6 py-4 dark:border-gray-700"},ps={class:"flex items-center gap-2"},hs={class:"text-lg font-semibold text-gray-900 whitespace-nowrap dark:text-white"},vs={class:"text-sm text-gray-500"},fs={class:"max-h-[60vh] p-4 overflow-y-auto"},ze=P({__name:"RankListPro",props:{members:{},title:{},description:{},topN:{default:10},unit:{}},setup(l){const{t:s}=ae(),e=l,o=L(!1),c=L(null),u=L(null),d=D(()=>e.members.slice(0,e.topN)),m=D(()=>e.members.length>e.topN);return(p,_)=>{const y=me,g=xe;return i(),S("div",{ref_key:"cardRef",ref:c,class:"rounded-xl border border-gray-200 bg-white shadow-sm dark:border-gray-800 dark:bg-gray-900"},[a("div",cs,[a("div",null,[a("h3",ds,x(l.title),1),l.description?(i(),S("p",us,x(l.description),1)):B("",!0)]),a("div",ms,[$(Ee,{size:"xs",type:"element","target-element":c.value},null,8,["target-element"]),$(g,{open:o.value,"onUpdate:open":_[0]||(_[0]=n=>o.value=n),ui:{content:"md:w-full max-w-3xl"}},{content:A(()=>[a("div",{ref_key:"modalBodyRef",ref:u,class:"section-content flex flex-col"},[a("div",gs,[a("div",ps,[a("h3",hs,x(l.title),1),a("span",vs," ("+x(t(s)("views.charts.rankListPro.memberCount",{count:l.members.length}))+") ",1)]),$(Ee,{size:"xs",type:"element","target-element":u.value},null,8,["target-element"])]),a("div",fs,[$(Oe,{members:l.members,unit:l.unit},null,8,["members","unit"])])],512)]),default:A(()=>[m.value?(i(),N(y,{key:0,icon:"i-heroicons-list-bullet",variant:"ghost"},{default:A(()=>[K(x(t(s)("views.charts.rankListPro.fullRanking")),1)]),_:1})):B("",!0)]),_:1},8,["open"])])]),$(Oe,{members:d.value,unit:l.unit},null,8,["members","unit"])],512)}}}),ys={class:"main-content mx-auto max-w-6xl py-6"},xs={class:"mb-4 flex items-center justify-end gap-4"},bs={class:"text-xs text-gray-500 dark:text-gray-400"},_s={key:0,class:"grid grid-cols-2 gap-6"},ks={class:"mb-3 text-center"},ws={class:"text-base font-semibold text-gray-900 dark:text-white"},$s={class:"flex flex-wrap gap-2"},Is=["title","onClick"],Cs={class:"text-xs opacity-50"},Ss={key:1,class:"grid grid-cols-2 gap-6"},Ms={class:"mb-3 text-center"},Ts={class:"text-base font-semibold text-gray-900 dark:text-white"},Ds={class:"relative w-full",style:{"aspect-ratio":"4 / 3"}},Rs={class:"mt-4 text-center text-xs text-gray-500 dark:text-gray-400"},Ns=P({__name:"CatchphraseTab",props:{sessionId:{},timeFilter:{}},setup(l){const s=We(()=>Fe(()=>import("./EChartWordcloud-B_YisOW5.js"),__vite__mapDeps([0,1,2,3,4]))),{t:e}=ae(),o=Re(),c=l,u=L(null),d=L(!1),m=L("list"),p=L(30),_=D(()=>[{label:e("quotes.catchphrase.viewMode.list"),value:"list"},{label:e("quotes.catchphrase.viewMode.wordcloud"),value:"wordcloud"}]),y=[{label:"10",value:10},{label:"30",value:30},{label:"50",value:50},{label:"100",value:100}],g=D(()=>u.value&&u.value.members.length>0),n=D(()=>{if(!u.value)return[];const v=p.value;return console.log("[CatchphraseTab] displayMembers recompute, topN:",v,"type:",typeof v),u.value.members.map(w=>{const C=w.catchphrases.slice(0,v);return console.log("[CatchphraseTab]",w.name,"total:",w.catchphrases.length,"display:",C.length),{...w,catchphrases:C}})}),r=D(()=>n.value.map(v=>({name:v.name,data:{words:v.catchphrases.map(w=>({word:w.content,count:w.count}))}}))),h=[{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 f(v){return v<h.length?h[v]:{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 b(v,w=20){return v.length<=w?v:v.slice(0,w)+"..."}async function k(){if(c.sessionId){d.value=!0;try{u.value=await Y().getCatchphraseAnalysis(c.sessionId,c.timeFilter),console.log("[CatchphraseTab] API result: members:",u.value?.members.length,"per-member catchphrases:",u.value?.members.map(v=>({name:v.name,count:v.catchphrases.length})))}catch(v){console.error("Failed to load catchphrase analysis:",v)}finally{d.value=!1}}}function I(v){o.openChatRecordDrawer({keywords:[v]})}return G(p,(v,w)=>{console.log("[CatchphraseTab] topN changed:",w,"->",v,"type:",typeof v)}),G(()=>[c.sessionId,c.timeFilter],()=>{k()},{immediate:!0,deep:!0}),(v,w)=>(i(),S("div",ys,[d.value?(i(),N(t(oe),{key:0,text:t(e)("quotes.catchphrase.loading")},null,8,["text"])):g.value?(i(),S(q,{key:2},[a("div",xs,[a("span",bs,x(t(e)("quotes.catchphrase.topN")),1),$(t(ce),{modelValue:p.value,"onUpdate:modelValue":w[0]||(w[0]=C=>p.value=C),size:"xs",items:y},null,8,["modelValue"]),w[2]||(w[2]=a("div",{class:"h-4 w-px bg-gray-200 dark:bg-gray-700"},null,-1)),$(t(ce),{modelValue:m.value,"onUpdate:modelValue":w[1]||(w[1]=C=>m.value=C),size:"xs",items:_.value},null,8,["modelValue","items"])]),m.value==="list"?(i(),S("div",_s,[(i(!0),S(q,null,se(n.value,C=>(i(),S("div",{key:C.memberId},[a("div",ks,[a("span",ws,x(C.name),1)]),a("div",$s,[(i(!0),S(q,null,se(C.catchphrases,(M,T)=>(i(),S("div",{key:T,class:Z(["inline-flex cursor-pointer items-center gap-1.5 rounded-full px-3 py-1.5 transition-opacity hover:opacity-75",f(T).bg]),title:M.content,onClick:V=>I(M.content)},[T<3?(i(),S("span",{key:0,class:Z(["flex h-4 w-4 shrink-0 items-center justify-center rounded-full text-[10px] font-bold",f(T).badge])},x(T+1),3)):B("",!0),a("span",{class:Z(["text-sm font-medium",f(T).text])},x(b(M.content)),3),a("span",Cs,x(t(e)("quotes.catchphrase.times",{count:M.count})),1)],10,Is))),128))])]))),128))])):(i(),S("div",Ss,[(i(!0),S(q,null,se(r.value,C=>(i(),S("div",{key:C.name},[a("div",Ms,[a("span",Ts,x(C.name),1)]),a("div",Ds,[C.data.words.length===0?(i(),N(t(le),{key:0,text:t(e)("quotes.catchphrase.empty.title"),class:"h-full"},null,8,["text"])):(i(),N(t(s),{key:1,data:C.data,height:"100%","max-words":p.value,"color-scheme":"default","size-scale":1,loading:d.value,onWordClick:I},null,8,["data","max-words","loading"]))])]))),128))])),a("p",Rs,x(t(e)("quotes.catchphrase.stats.clickHint")),1)],64)):(i(),N(t(le),{key:1,text:t(e)("quotes.catchphrase.empty.title")},null,8,["text"]))]))}});function he(l){const s=[],e=[];return l?.startTs!=null&&(s.push("AND msg.ts >= ?"),e.push(l.startTs)),l?.endTs!=null&&(s.push("AND msg.ts <= ?"),e.push(l.endTs)),l?.memberId!=null&&(s.push("AND msg.sender_id = ?"),e.push(l.memberId)),{conditions:s.join(" "),params:e}}const ge="AND COALESCE(m.account_name, '') != '系统消息'";async function Ls(l,s){const{conditions:e,params:o}=he(s),[c,u]=await Promise.all([Y().pluginQuery(l,`WITH daily_counts AS (
|
|
8
|
+
SELECT
|
|
9
|
+
strftime('%Y-%m-%d', msg.ts, 'unixepoch', 'localtime') as date,
|
|
10
|
+
msg.sender_id,
|
|
11
|
+
m.platform_id,
|
|
12
|
+
COALESCE(m.group_nickname, m.account_name, m.platform_id) as name,
|
|
13
|
+
COUNT(*) as msg_count
|
|
14
|
+
FROM message msg
|
|
15
|
+
JOIN member m ON msg.sender_id = m.id
|
|
16
|
+
WHERE 1=1 ${ge} ${e}
|
|
17
|
+
GROUP BY date, msg.sender_id
|
|
18
|
+
),
|
|
19
|
+
daily_max AS (
|
|
20
|
+
SELECT date, MAX(msg_count) as max_count
|
|
21
|
+
FROM daily_counts
|
|
22
|
+
GROUP BY date
|
|
23
|
+
)
|
|
24
|
+
SELECT dc.sender_id, dc.platform_id, dc.name, COUNT(*) as dragon_days
|
|
25
|
+
FROM daily_counts dc
|
|
26
|
+
JOIN daily_max dm ON dc.date = dm.date AND dc.msg_count = dm.max_count
|
|
27
|
+
GROUP BY dc.sender_id
|
|
28
|
+
ORDER BY dragon_days DESC`,o),Y().pluginQuery(l,`SELECT COUNT(DISTINCT strftime('%Y-%m-%d', msg.ts, 'unixepoch', 'localtime')) as total
|
|
29
|
+
FROM message msg
|
|
30
|
+
JOIN member m ON msg.sender_id = m.id
|
|
31
|
+
WHERE 1=1 ${ge} ${e}`,o)]),d=u[0]?.total??0;return{rank:c.map(p=>({memberId:p.sender_id,platformId:p.platform_id,name:p.name,count:p.dragon_days,percentage:d>0?Math.round(p.dragon_days/d*1e4)/100:0})),totalDays:d}}async function Vs(l,s){const{conditions:e,params:o}=he(s),c=await Y().pluginQuery(l,`SELECT
|
|
32
|
+
m.id as member_id,
|
|
33
|
+
m.platform_id,
|
|
34
|
+
COALESCE(m.group_nickname, m.account_name, m.platform_id) as name,
|
|
35
|
+
MAX(msg.ts) as last_ts
|
|
36
|
+
FROM member m
|
|
37
|
+
JOIN message msg ON m.id = msg.sender_id
|
|
38
|
+
WHERE 1=1 ${ge} ${e}
|
|
39
|
+
GROUP BY m.id
|
|
40
|
+
ORDER BY last_ts ASC`,o),u=Math.floor(Date.now()/1e3);return{rank:c.map(m=>({memberId:m.member_id,platformId:m.platform_id,name:m.name,lastMessageTs:m.last_ts,daysSinceLastMessage:Math.floor((u-m.last_ts)/86400)}))}}function As(l){const{dailyActivity:s}=l;if(s.length===0)return{streakRank:[],loyaltyRank:[],totalDays:0};const e=new Set(s.map(r=>r.day)),o=e.size,c=Array.from(e).sort(),u=c[c.length-1],d=new Map;for(const r of s)d.has(r.senderId)||d.set(r.senderId,{name:r.name,days:new Set}),d.get(r.senderId).days.add(r.day);const m=[],p=[];for(const[r,h]of d){const f=Array.from(h.days).sort(),b=f.length;let k=1,I=f[0],v=f[0],w=1,C=f[0];for(let T=1;T<f.length;T++){const V=new Date(f[T-1]),H=new Date(f[T]);Math.round((H.getTime()-V.getTime())/(1e3*60*60*24))===1?w++:(w>k&&(k=w,I=C,v=f[T-1]),w=1,C=f[T])}w>k&&(k=w,I=C,v=f[f.length-1]);let M=0;if(f[f.length-1]===u){M=1;for(let T=f.length-2;T>=0;T--){const V=new Date(f[T+1]),H=new Date(f[T]);if(Math.round((V.getTime()-H.getTime())/(1e3*60*60*24))===1)M++;else break}}m.push({memberId:r,name:h.name,maxStreak:k,maxStreakStart:I,maxStreakEnd:v,currentStreak:M}),p.push({memberId:r,name:h.name,totalDays:b})}const _=m.sort((r,h)=>h.maxStreak-r.maxStreak),y=p.sort((r,h)=>h.totalDays-r.totalDays),g=y.length>0?y[0].totalDays:1,n=y.map(r=>({...r,percentage:Math.round(r.totalDays/g*100)}));return{streakRank:_,loyaltyRank:n,totalDays:o}}async function Ze(l,s){const{conditions:e,params:o}=he(s),c=await Y().pluginQuery(l,`SELECT
|
|
41
|
+
msg.sender_id as senderId,
|
|
42
|
+
COALESCE(m.group_nickname, m.account_name, m.platform_id) as name,
|
|
43
|
+
DATE(msg.ts, 'unixepoch', 'localtime') as day
|
|
44
|
+
FROM message msg
|
|
45
|
+
JOIN member m ON msg.sender_id = m.id
|
|
46
|
+
WHERE 1=1 ${ge} ${e}
|
|
47
|
+
GROUP BY msg.sender_id, day
|
|
48
|
+
ORDER BY msg.sender_id, day`,o);return c.length===0?{streakRank:[],loyaltyRank:[],totalDays:0}:Y().pluginCompute(As.toString(),{dailyActivity:c})}function Es(l){const{messages:s}=l,e={topBattles:[],rankByCount:[],rankByImageCount:[],totalBattles:0},o=[];let c=[];const u=()=>{c.length>=3&&new Set(c.map(r=>r.senderId)).size>=2&&o.push({startTime:c[0].ts,endTime:c[c.length-1].ts,msgs:c.map(({senderId:r,name:h,platformId:f})=>({senderId:r,name:h,platformId:f}))}),c=[]};for(const n of s)n.type===1||n.type===5?c.push({senderId:n.senderId,name:n.name,platformId:n.platformId,ts:n.ts}):u();if(u(),o.length===0)return e;const d=o.map(n=>({startTime:n.startTime,endTime:n.endTime,totalImages:n.msgs.length,participantCount:new Set(n.msgs.map(r=>r.senderId)).size,participants:Object.values(n.msgs.reduce((r,h)=>(r[h.senderId]||(r[h.senderId]={memberId:h.senderId,name:h.name,imageCount:0}),r[h.senderId].imageCount++,r),{})).sort((r,h)=>h.imageCount-r.imageCount)})).sort((n,r)=>r.totalImages-n.totalImages).slice(0,30),m=new Map;for(const n of o){const r=new Set;for(const h of n.msgs)m.has(h.senderId)||m.set(h.senderId,{memberId:h.senderId,platformId:h.platformId,name:h.name,battleCount:0,imageCount:0}),m.get(h.senderId).imageCount++,r.add(h.senderId);for(const h of r)m.get(h).battleCount++}const p=Array.from(m.values()),_=[...p].sort((n,r)=>r.battleCount-n.battleCount).map(n=>({memberId:n.memberId,platformId:n.platformId,name:n.name,count:n.battleCount,percentage:o.length>0?Math.round(n.battleCount/o.length*1e4)/100:0})),y=o.reduce((n,r)=>n+r.msgs.length,0),g=[...p].sort((n,r)=>r.imageCount-n.imageCount).map(n=>({memberId:n.memberId,platformId:n.platformId,name:n.name,count:n.imageCount,percentage:y>0?Math.round(n.imageCount/y*1e4)/100:0}));return{topBattles:d,rankByCount:_,rankByImageCount:g,totalBattles:o.length}}async function Os(l,s){const{conditions:e,params:o}=he(s),c=await Y().pluginQuery(l,`SELECT
|
|
49
|
+
msg.sender_id as senderId,
|
|
50
|
+
msg.type,
|
|
51
|
+
msg.ts,
|
|
52
|
+
m.platform_id as platformId,
|
|
53
|
+
COALESCE(m.group_nickname, m.account_name, m.platform_id) as name
|
|
54
|
+
FROM message msg
|
|
55
|
+
JOIN member m ON msg.sender_id = m.id
|
|
56
|
+
WHERE msg.type != 6 ${e}
|
|
57
|
+
ORDER BY msg.ts ASC`,o);return c.length===0?{topBattles:[],rankByCount:[],rankByImageCount:[],totalBattles:0}:Y().pluginCompute(Es.toString(),{messages:c})}function zs(l){const{messages:s}=l,e={nightOwlRank:[],lastSpeakerRank:[],firstSpeakerRank:[],consecutiveRecords:[],champions:[],totalDays:0};if(s.length===0)return e;function o(v){return v===0?"养生达人":v<=20?"偶尔失眠":v<=50?"经常失眠":v<=100?"夜猫子":v<=200?"秃头预备役":v<=500?"修仙练习生":"守夜冠军"}function c(v){const w=new Date(v*1e3);return w.getHours()<5&&w.setDate(w.getDate()-1),w.toISOString().split("T")[0]}function u(v){const w=Math.floor(v/60),C=Math.round(v%60);return`${w.toString().padStart(2,"0")}:${C.toString().padStart(2,"0")}`}const d=new Map,m=new Map,p=new Map,_=new Map;for(const v of s){d.has(v.senderId)||d.set(v.senderId,{platformId:v.platformId,name:v.name});const w=new Date(v.ts*1e3),C=w.getHours(),M=w.getMinutes(),T=c(v.ts);m.has(v.senderId)||m.set(v.senderId,{total:0,h23:0,h0:0,h1:0,h2:0,h3to4:0,totalMessages:0});const V=m.get(v.senderId);V.totalMessages++,C===23?(V.h23++,V.total++):C===0?(V.h0++,V.total++):C===1?(V.h1++,V.total++):C===2?(V.h2++,V.total++):C>=3&&C<5&&(V.h3to4++,V.total++),(C>=23||C<5)&&(_.has(v.senderId)||_.set(v.senderId,new Set),_.get(v.senderId).add(T)),p.has(T)||p.set(T,[]),p.get(T).push({senderId:v.senderId,ts:v.ts,hour:C,minute:M})}const y=p.size,g=[];for(const[v,w]of m.entries()){if(w.total===0)continue;const C=d.get(v);g.push({memberId:v,platformId:C.platformId,name:C.name,totalNightMessages:w.total,title:o(w.total),hourlyBreakdown:{h23:w.h23,h0:w.h0,h1:w.h1,h2:w.h2,h3to4:w.h3to4},percentage:w.totalMessages>0?Math.round(w.total/w.totalMessages*1e4)/100:0})}g.sort((v,w)=>w.totalNightMessages-v.totalNightMessages);const n=new Map,r=new Map;for(const[,v]of p.entries()){if(v.length===0)continue;const w=v[v.length-1];n.has(w.senderId)||n.set(w.senderId,{count:0,times:[]});const C=n.get(w.senderId);C.count++,C.times.push(w.hour*60+w.minute);const M=v[0];r.has(M.senderId)||r.set(M.senderId,{count:0,times:[]});const T=r.get(M.senderId);T.count++,T.times.push(M.hour*60+M.minute)}const h=[];for(const[v,w]of n.entries()){const C=d.get(v),M=w.times.reduce((V,H)=>V+H,0)/w.times.length,T=Math.max(...w.times);h.push({memberId:v,platformId:C.platformId,name:C.name,count:w.count,avgTime:u(M),extremeTime:u(T),percentage:y>0?Math.round(w.count/y*1e4)/100:0})}h.sort((v,w)=>w.count-v.count);const f=[];for(const[v,w]of r.entries()){const C=d.get(v),M=w.times.reduce((V,H)=>V+H,0)/w.times.length,T=Math.min(...w.times);f.push({memberId:v,platformId:C.platformId,name:C.name,count:w.count,avgTime:u(M),extremeTime:u(T),percentage:y>0?Math.round(w.count/y*1e4)/100:0})}f.sort((v,w)=>w.count-v.count);const b=[];for(const[v,w]of _.entries()){if(w.size===0)continue;const C=d.get(v),M=Array.from(w).sort();let T=1,V=1;for(let E=1;E<M.length;E++){const W=new Date(M[E-1]);(new Date(M[E]).getTime()-W.getTime())/(1e3*60*60*24)===1?(V++,T=Math.max(T,V)):V=1}const H=M[M.length-1],U=new Date().toISOString().split("T")[0],R=new Date(Date.now()-864e5).toISOString().split("T")[0],F=H===U||H===R;b.push({memberId:v,platformId:C.platformId,name:C.name,maxConsecutiveDays:T,currentStreak:F?V:0})}b.sort((v,w)=>w.maxConsecutiveDays-v.maxConsecutiveDays);const k=new Map;for(const v of g)k.has(v.memberId)||k.set(v.memberId,{nightMessages:0,lastSpeakerCount:0,consecutiveDays:0}),k.get(v.memberId).nightMessages=v.totalNightMessages;for(const v of h)k.has(v.memberId)||k.set(v.memberId,{nightMessages:0,lastSpeakerCount:0,consecutiveDays:0}),k.get(v.memberId).lastSpeakerCount=v.count;for(const v of b)k.has(v.memberId)||k.set(v.memberId,{nightMessages:0,lastSpeakerCount:0,consecutiveDays:0}),k.get(v.memberId).consecutiveDays=v.maxConsecutiveDays;const I=[];for(const[v,w]of k.entries()){const C=d.get(v),M=w.nightMessages*1+w.lastSpeakerCount*10+w.consecutiveDays*20;M>0&&I.push({memberId:v,platformId:C.platformId,name:C.name,score:M,nightMessages:w.nightMessages,lastSpeakerCount:w.lastSpeakerCount,consecutiveDays:w.consecutiveDays})}return I.sort((v,w)=>w.score-v.score),{nightOwlRank:g,lastSpeakerRank:h,firstSpeakerRank:f,consecutiveRecords:b,champions:I,totalDays:y}}async function Fs(l,s){const{conditions:e,params:o}=he(s),c=await Y().pluginQuery(l,`SELECT
|
|
58
|
+
msg.id,
|
|
59
|
+
msg.sender_id as senderId,
|
|
60
|
+
msg.ts,
|
|
61
|
+
m.platform_id as platformId,
|
|
62
|
+
COALESCE(m.group_nickname, m.account_name, m.platform_id) as name
|
|
63
|
+
FROM message msg
|
|
64
|
+
JOIN member m ON msg.sender_id = m.id
|
|
65
|
+
WHERE 1=1 ${ge} ${e}
|
|
66
|
+
ORDER BY msg.ts ASC`,o);return c.length===0?{nightOwlRank:[],lastSpeakerRank:[],firstSpeakerRank:[],consecutiveRecords:[],champions:[],totalDays:0}:Y().pluginCompute(zs.toString(),{messages:c})}function Bs(l){const{messages:s}=l,e=new Map,o=new Map,c=new Map,u=new Map,d=new Map,m=new Map,p=new Map;let _=null,y=[],g=0,n=0;const r=new Map,h=(C,M)=>{if(C.length<3)return;g++;const T=C.length;n+=T;const V=C[0].senderId;e.set(V,(e.get(V)||0)+1);const H=C[1].senderId;o.set(H,(o.get(H)||0)+1),M!==void 0&&c.set(M,(c.get(M)||0)+1),m.set(T,(m.get(T)||0)+1);const U=C[0].content,R=C[0].ts,F=C[0].id,E=p.get(U);E?(E.count++,E.lastTs=Math.max(E.lastTs,R),T>E.maxChainLength&&(E.maxChainLength=T,E.originatorId=V,E.firstMessageId=F)):p.set(U,{count:1,maxChainLength:T,originatorId:V,lastTs:R,firstMessageId:F});for(let W=1;W<C.length;W++){const X=C[W],ee=C[W-1],ie=(X.ts-ee.ts)*1e3;if(ie<=20*1e3){r.has(X.senderId)||r.set(X.senderId,{totalDiff:0,count:0});const re=r.get(X.senderId);re.totalDiff+=ie,re.count++}}};for(const C of s){d.has(C.senderId)||d.set(C.senderId,{platformId:C.platformId,name:C.name}),u.set(C.senderId,(u.get(C.senderId)||0)+1);const M=C.content.trim();M===_?y[y.length-1]?.senderId!==C.senderId&&y.push({id:C.id,senderId:C.senderId,content:M,ts:C.ts}):(h(y,C.senderId),_=M,y=[{id:C.id,senderId:C.senderId,content:M,ts:C.ts}])}h(y);const f=(C,M)=>{const T=[];for(const[V,H]of C.entries()){const U=d.get(V);U&&T.push({memberId:V,platformId:U.platformId,name:U.name,count:H,percentage:M>0?Math.round(H/M*1e4)/100:0})}return T.sort((V,H)=>H.count-V.count)},b=C=>{const M=[];for(const[T,V]of C.entries()){const H=d.get(T),U=u.get(T)||0;H&&U>0&&M.push({memberId:T,platformId:H.platformId,name:H.name,count:V,totalMessages:U,rate:Math.round(V/U*1e4)/100})}return M.sort((T,V)=>V.rate-T.rate)},k=()=>{const C=[];for(const[M,T]of r.entries()){if(T.count<5)continue;const V=d.get(M);V&&C.push({memberId:M,platformId:V.platformId,name:V.name,count:T.count,avgTimeDiff:Math.round(T.totalDiff/T.count)})}return C.sort((M,T)=>M.avgTimeDiff-T.avgTimeDiff)},I=[];for(const[C,M]of m.entries())I.push({length:C,count:M});I.sort((C,M)=>C.length-M.length);const v=[];for(const[C,M]of p.entries()){const T=d.get(M.originatorId);v.push({content:C,count:M.count,maxChainLength:M.maxChainLength,originatorName:T?.name||"未知",lastTs:M.lastTs,firstMessageId:M.firstMessageId})}v.sort((C,M)=>M.maxChainLength-C.maxChainLength);const w=v.slice(0,100);return{originators:f(e,g),initiators:f(o,g),breakers:f(c,g),fastestRepeaters:k(),originatorRates:b(e),initiatorRates:b(o),breakerRates:b(c),chainLengthDistribution:I,hotContents:w,avgChainLength:g>0?Math.round(n/g*100)/100:0,totalRepeatChains:g}}async function et(l,s){const{conditions:e,params:o}=he(s),c=await Y().pluginQuery(l,`SELECT
|
|
67
|
+
msg.id,
|
|
68
|
+
msg.sender_id as senderId,
|
|
69
|
+
msg.content,
|
|
70
|
+
msg.ts,
|
|
71
|
+
m.platform_id as platformId,
|
|
72
|
+
COALESCE(m.group_nickname, m.account_name, m.platform_id) as name
|
|
73
|
+
FROM message msg
|
|
74
|
+
JOIN member m ON msg.sender_id = m.id
|
|
75
|
+
WHERE 1=1 ${ge}
|
|
76
|
+
AND msg.type = 0
|
|
77
|
+
AND msg.content IS NOT NULL
|
|
78
|
+
AND TRIM(msg.content) != ''
|
|
79
|
+
${e}
|
|
80
|
+
ORDER BY msg.ts ASC, msg.id ASC`,o);return c.length===0?{originators:[],initiators:[],breakers:[],fastestRepeaters:[],originatorRates:[],initiatorRates:[],breakerRates:[],chainLengthDistribution:[],hotContents:[],avgChainLength:0,totalRepeatChains:0}:Y().pluginCompute(Bs.toString(),{messages:c})}const Us={class:"main-content mx-auto max-w-3xl p-6"},Hs={class:"flex items-center gap-3"},Ws={class:"shrink-0 text-lg font-bold text-pink-600"},js={class:"flex flex-1 items-center gap-1 overflow-hidden text-sm"},Ps={class:"shrink-0 font-medium text-gray-900 dark:text-white whitespace-nowrap"},qs=["title"],Ys={class:"flex shrink-0 items-center gap-2 text-xs text-gray-500"},Gs=P({__name:"HotRepeatTab",props:{sessionId:{},timeFilter:{}},setup(l){const{t:s}=ae(),e=l,o=Re(),c=L(null),u=L(!1);async function d(){if(e.sessionId){u.value=!0;try{c.value=await et(e.sessionId,e.timeFilter)}catch(_){console.error("Failed to load repeat analysis:",_)}finally{u.value=!1}}}function m(_,y=30){return _.length<=y?_:_.slice(0,y)+"..."}function p(_){o.openChatRecordDrawer({scrollToMessageId:_.firstMessageId,highlightKeywords:[_.content]})}return G(()=>[e.sessionId,e.timeFilter],()=>{d()},{immediate:!0,deep:!0}),(_,y)=>{const g=me;return i(),S("div",Us,[u.value?(i(),N(t(oe),{key:0,text:t(s)("quotes.hotRepeat.loading")},null,8,["text"])):c.value&&c.value.hotContents.length>0?(i(),N(t(xt),{key:1,items:c.value.hotContents,title:t(s)("quotes.hotRepeat.title"),description:t(s)("quotes.hotRepeat.description"),"top-n":50,"count-template":t(s)("quotes.hotRepeat.countTemplate")},{item:A(({item:n,index:r})=>[a("div",Hs,[a("span",{class:Z(["flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-xs font-bold",t(Ge)(r)])},x(r+1),3),a("span",Ws,x(t(s)("quotes.hotRepeat.people",{count:n.maxChainLength})),1),a("div",js,[a("span",Ps,x(n.originatorName)+x(t(s)("quotes.hotRepeat.colon")),1),a("span",{class:"truncate text-gray-600 dark:text-gray-400",title:n.content},x(m(n.content)),9,qs)]),a("div",Ys,[a("span",null,x(t(s)("quotes.hotRepeat.times",{count:n.count})),1),y[0]||(y[0]=a("span",{class:"text-gray-300 dark:text-gray-600"},"|",-1)),a("span",null,x(t(Se)(n.lastTs)),1),$(g,{icon:"i-heroicons-chat-bubble-left-right",color:"neutral",variant:"ghost",size:"xs",title:t(s)("quotes.hotRepeat.viewChat"),onClick:je(h=>p(n),["stop"])},null,8,["title","onClick"])])])]),_:1},8,["items","title","description","count-template"])):(i(),N(t(Q),{key:2,title:t(s)("quotes.hotRepeat.title")},{default:A(()=>[$(t(le),{text:t(s)("quotes.hotRepeat.empty")},null,8,["text"])]),_:1},8,["title"]))])}}}),Js={class:"main-content mx-auto max-w-[920px] space-y-6 p-6"},Qs={class:"grid grid-cols-1 gap-6 lg:grid-cols-2"},Ks={class:"p-5"},Xs={class:"p-5"},Zs=P({__name:"OverviewTab",props:{session:{},memberActivity:{},topMembers:{},bottomMembers:{},messageTypes:{},hourlyActivity:{},dailyActivity:{},timeRange:{},selectedYear:{},filteredMessageCount:{},filteredMemberCount:{},timeFilter:{}},setup(l){const{t:s}=ae(),e=l,{dailyChartData:o}=kt(()=>e.dailyActivity),c=D(()=>({labels:e.messageTypes.map(d=>wt(d.type,s)),values:e.messageTypes.map(d=>d.count)})),u=D(()=>{const d=[...e.memberActivity].sort((g,n)=>n.messageCount-g.messageCount),m=d.slice(0,10),p=d.slice(10).reduce((g,n)=>g+n.messageCount,0),_=m.map(g=>g.name),y=m.map(g=>g.messageCount);return p>0&&(_.push(s("analysis.overview.others")),y.push(p)),{labels:_,values:y}});return(d,m)=>(i(),S("div",Js,[$(bt,{session:l.session,"daily-activity":l.dailyActivity,"message-types":l.messageTypes,"hourly-activity":l.hourlyActivity,"time-range":l.timeRange,"selected-year":l.selectedYear,"filtered-message-count":l.filteredMessageCount,"time-filter":l.timeFilter},null,8,["session","daily-activity","message-types","hourly-activity","time-range","selected-year","filtered-message-count","time-filter"]),a("div",Qs,[$(t(Q),{title:t(s)("analysis.overview.messageTypeDistribution"),"show-divider":!1},{default:A(()=>[a("div",Ks,[$(t(Ae),{data:c.value,height:280},null,8,["data"])])]),_:1},8,["title"]),$(t(Q),{title:t(s)("analysis.overview.memberDistribution"),"show-divider":!1},{default:A(()=>[a("div",Xs,[$(t(Ae),{data:u.value,height:280},null,8,["data"])])]),_:1},8,["title"])]),$(_t,{"daily-activity":l.dailyActivity,"daily-chart-data":t(o)},null,8,["daily-activity","daily-chart-data"])]))}}),ea={class:"flex items-center gap-3"},ta={key:1,class:"py-8 text-center text-sm text-gray-400"},sa=P({__name:"ActivityRank",props:{sessionId:{},memberActivity:{},timeFilter:{},showTopNSelect:{type:Boolean,default:!0},globalTopN:{}},setup(l){const s=l,e=L(null),o=L(null),c=L(!1),u=L("activity"),d=L(s.globalTopN??10);G(()=>s.globalTopN,f=>{f!==void 0&&(d.value=f)});async function m(){if(s.sessionId){c.value=!0;try{const[f,b]=await Promise.all([Ls(s.sessionId,s.timeFilter),Ze(s.sessionId,s.timeFilter)]);e.value=f,o.value=b}catch(f){console.error("加载活跃数据失败:",f)}finally{c.value=!1}}}const p=D(()=>s.memberActivity.map(f=>({id:f.memberId.toString(),name:f.name,value:f.messageCount,percentage:f.percentage}))),_=D(()=>e.value?e.value.rank.map(f=>({id:f.memberId.toString(),name:f.name,value:f.count,percentage:f.percentage})):[]),y=D(()=>o.value?o.value.loyaltyRank.map(f=>({id:f.memberId.toString(),name:f.name,value:f.totalDays,percentage:f.percentage})):[]),g=D(()=>{switch(u.value){case"activity":return p.value;case"dragon":return _.value;case"loyalty":return y.value;default:return p.value}}),n=D(()=>{switch(u.value){case"activity":return"条";case"dragon":case"loyalty":return"天";default:return"条"}}),r=D(()=>{switch(u.value){case"activity":return"🏆 活跃榜 - 发言数量";case"dragon":return"🏆 活跃榜 - 龙王";case"loyalty":return"🏆 活跃榜 - 累计发言";default:return"🏆 活跃榜"}}),h=D(()=>{switch(u.value){case"activity":return"按消息发送数量排名";case"dragon":return`每天发言最多的人+1(共 ${e.value?.totalDays??0} 天)`;case"loyalty":return`累计发言天数排名(共 ${o.value?.totalDays??0} 天)`;default:return""}});return G(()=>[s.sessionId,s.timeFilter],()=>m(),{immediate:!0,deep:!0}),(f,b)=>(i(),N(t(Q),{title:r.value,description:h.value},{headerRight:A(()=>[a("div",ea,[l.showTopNSelect?(i(),N(t(ue),{key:0,modelValue:d.value,"onUpdate:modelValue":b[0]||(b[0]=k=>d.value=k)},null,8,["modelValue"])):B("",!0),$(t(ce),{modelValue:u.value,"onUpdate:modelValue":b[1]||(b[1]=k=>u.value=k),items:[{label:"发言数量",value:"activity"},{label:"龙王",value:"dragon"},{label:"累计发言",value:"loyalty"}],size:"sm"},null,8,["modelValue"])])]),default:A(()=>[c.value&&(u.value==="dragon"||u.value==="loyalty")?(i(),N(t(oe),{key:0,text:"正在加载数据..."})):(i(),S(q,{key:1},[g.value.length>0?(i(),N(t(ke),{key:0,members:g.value,title:r.value,unit:n.value,"top-n":d.value,bare:""},null,8,["members","title","unit","top-n"])):(i(),S("div",ta,"暂无数据"))],64))]),_:1},8,["title","description"]))}}),aa={key:0},na={key:0,class:"flex items-center justify-center gap-6 border-t border-gray-100 px-5 py-3 dark:border-gray-800"},oa={class:"px-3 py-2"},ra=P({__name:"EChartStreakRank",props:{items:{},title:{},description:{},topN:{default:10},mode:{default:"max"},maxHeightVh:{default:60},bare:{type:Boolean,default:!1}},setup(l){const s=l,e=D(()=>s.mode==="current"?s.items.filter(y=>y.currentStreak>0).sort((y,g)=>g.currentStreak-y.currentStreak).slice(0,s.topN):s.items.slice(0,s.topN)),o=D(()=>{const y=e.value.length*36;return Math.max(y+30,180)}),c={type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:"#ee4567"},{offset:1,color:"#f7758c"}]},u={type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:"#f97316"},{offset:1,color:"#fb923c"}]};function d(y,g=8){return y.length<=g?y:y.slice(0,g)+"…"}function m(y,g){return`${y} ~ ${g}`}function p(y){return s.mode==="current"?y.currentStreak:y.maxStreak}const _=D(()=>{const y=[...e.value].reverse(),g=y.map(f=>d(f.name)),n=y.map(f=>p(f)),r=Math.max(...n,1),h=y.map(f=>({value:p(f),itemStyle:{color:s.mode==="current"||f.currentStreak>0?u:c,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:f=>{const b=f[0];if(!b)return"";const k=e.value.length-1-b.dataIndex,I=e.value[k];if(s.mode==="current")return`
|
|
81
|
+
<div style="padding: 4px 8px;">
|
|
82
|
+
<div style="font-weight: bold; margin-bottom: 6px;">${I.name}</div>
|
|
83
|
+
<div style="color: #fb923c;">🔥 当前连续 <b>${I.currentStreak}</b> 天</div>
|
|
84
|
+
<div style="margin-top: 4px; font-size: 12px; color: #9ca3af;">最长记录: ${I.maxStreak} 天</div>
|
|
85
|
+
</div>
|
|
86
|
+
`;let v=`
|
|
87
|
+
<div style="padding: 4px 8px;">
|
|
88
|
+
<div style="font-weight: bold; margin-bottom: 6px;">${I.name}</div>
|
|
89
|
+
<div style="margin-bottom: 4px;">🔥 最长连续: <b>${I.maxStreak}</b> 天</div>
|
|
90
|
+
<div style="font-size: 12px; color: #9ca3af;">${m(I.maxStreakStart,I.maxStreakEnd)}</div>
|
|
91
|
+
`;return I.currentStreak>0&&(v+=`<div style="margin-top: 6px; color: #fb923c;">🔥 当前连续 ${I.currentStreak} 天</div>`),v+="</div>",v}},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:g,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{fontSize:12,color:"#4b5563",margin:12,formatter:(f,b)=>{const I=e.value.length-1-b+1;return`${I===1?"🥇":I===2?"🥈":I===3?"🥉":`${I}.`} ${f}`}}},series:[{type:"bar",data:h,barWidth:18,barCategoryGap:"30%",label:{show:!0,position:"right",distance:8,formatter:f=>{const b=e.value.length-1-f.dataIndex,k=e.value[b],I=p(k),v=s.mode==="current"||k.currentStreak>0?" 🔥":"";return`${I} 天${v}`},fontSize:11,fontWeight:500,color:"#6b7280"},emphasis:{itemStyle:{shadowBlur:6,shadowColor:"rgba(249, 115, 22, 0.3)"}}}]}});return(y,g)=>l.bare?(i(),S("div",aa,[$(t(pe),{"content-height":o.value,"max-height-vh":l.maxHeightVh},{default:A(()=>[$(t(ne),{option:_.value,height:o.value},null,8,["option","height"])]),_:1},8,["content-height","max-height-vh"]),l.mode==="max"?(i(),S("div",na,[...g[0]||(g[0]=[ut('<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)])])):B("",!0)])):(i(),N(t(Q),{key:1,title:l.title,description:l.description,scrollable:"","max-height-vh":l.maxHeightVh},Pe({default:A(()=>[a("div",oa,[$(t(ne),{option:_.value,height:o.value},null,8,["option","height"])])]),_:2},[l.mode==="max"?{name:"footer",fn:A(()=>[g[1]||(g[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"]))}}),ia={class:"px-3 py-2"},la=P({__name:"EChartBattleRank",props:{battles:{},title:{},description:{},topN:{default:10},maxHeightVh:{default:60},bare:{type:Boolean,default:!1}},setup(l){const s=l,e=D(()=>s.battles.slice(0,s.topN)),o=D(()=>{const m=e.value.length*36;return Math.max(m+30,180)}),c={type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:"#ee4567"},{offset:1,color:"#f7758c"}]};function u(m){return`${m.participantCount} 人参战`}const d=D(()=>{const m=[...e.value].reverse(),p=m.map(n=>u(n)),_=m.map(n=>n.totalImages),y=Math.max(..._,1),g=m.map(n=>({value:n.totalImages,itemStyle:{color:c,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 h=e.value.length-1-r.dataIndex,f=e.value[h],b=f.participants.slice(0,5).map(I=>`<span style="color: #d1d5db;">${I.name}</span> <b>${I.imageCount}</b>张`).join("、"),k=f.participants.length>5?`、+${f.participants.length-5}`:"";return`
|
|
92
|
+
<div style="padding: 6px 8px;">
|
|
93
|
+
<div style="font-weight: bold; margin-bottom: 8px; font-size: 13px;">
|
|
94
|
+
⚔️ ${Se(f.startTime)}
|
|
95
|
+
</div>
|
|
96
|
+
<div style="margin-bottom: 6px;">
|
|
97
|
+
<span style="color: #9ca3af;">参战人数:</span> <b>${f.participantCount}</b> 人
|
|
98
|
+
</div>
|
|
99
|
+
<div style="margin-bottom: 8px;">
|
|
100
|
+
<span style="color: #9ca3af;">总图片数:</span> <b style="color: #f472b6;">${f.totalImages}</b> 张
|
|
101
|
+
</div>
|
|
102
|
+
<div style="border-top: 1px solid #374151; padding-top: 6px; font-size: 11px;">
|
|
103
|
+
${b}${k}
|
|
104
|
+
</div>
|
|
105
|
+
</div>
|
|
106
|
+
`}},grid:{left:95,right:125,top:15,bottom:15,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:p,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{fontSize:11,color:"#4b5563",margin:12,formatter:(n,r)=>{const f=e.value.length-1-r+1;return`${f===1?"🥇":f===2?"🥈":f===3?"🥉":`${f}.`} ${n}`}}},series:[{type:"bar",data:g,barWidth:18,barCategoryGap:"30%",label:{show:!0,position:"right",distance:8,formatter:n=>{const r=e.value.length-1-n.dataIndex,h=e.value[r],f=Se(h.startTime);return`${h.totalImages} 张 (${f})`},fontSize:11,fontWeight:500,color:"#6b7280"},emphasis:{itemStyle:{shadowBlur:6,shadowColor:"rgba(238, 69, 103, 0.3)"}}}]}});return(m,p)=>l.bare?(i(),N(t(pe),{key:0,"content-height":o.value,"max-height-vh":l.maxHeightVh},{default:A(()=>[$(t(ne),{option:d.value,height:o.value},null,8,["option","height"])]),_:1},8,["content-height","max-height-vh"])):(i(),N(t(Q),{key:1,title:l.title,description:l.description,scrollable:"","max-height-vh":l.maxHeightVh},{default:A(()=>[a("div",ia,[$(t(ne),{option:d.value,height:o.value},null,8,["option","height"])])]),_:1},8,["title","description","max-height-vh"]))}}),ca={class:"px-3 py-2"},da=P({__name:"EChartTimeRank",props:{items:{},title:{},description:{},topN:{default:10},maxHeightVh:{default:60},bare:{type:Boolean,default:!1}},setup(l){const s=l,e=D(()=>s.items.slice(0,s.topN)),o=D(()=>{const p=e.value.length*36;return Math.max(p+30,180)}),c={type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:"#f59e0b"},{offset:1,color:"#fbbf24"}]};function u(p,_=8){return p.length<=_?p:p.slice(0,_)+"…"}function d(p){return(p/1e3).toFixed(2)+"s"}const m=D(()=>{if(e.value.length===0)return{};const p=[...e.value].reverse(),_=p.map(n=>u(n.name)),y=e.value[0].avgTimeDiff,g=p.map(n=>({value:Math.round(y/n.avgTimeDiff*100),itemStyle:{color:c,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 h=e.value.length-1-r.dataIndex,f=e.value[h];return`
|
|
107
|
+
<div style="padding: 4px 8px;">
|
|
108
|
+
<div style="font-weight: bold; margin-bottom: 6px;">${f.name}</div>
|
|
109
|
+
<div style="margin-bottom: 4px;">⚡️ 平均反应时间: <b>${d(f.avgTimeDiff)}</b></div>
|
|
110
|
+
<div style="font-size: 12px; color: #9ca3af;">参与复读 ${f.count} 次</div>
|
|
111
|
+
</div>
|
|
112
|
+
`}},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:_,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{fontSize:12,color:"#4b5563",margin:12,formatter:(n,r)=>{const f=e.value.length-1-r+1;return`${f===1?"🥇":f===2?"🥈":f===3?"🥉":`${f}.`} ${n}`}}},series:[{type:"bar",data:g,barWidth:18,barCategoryGap:"30%",label:{show:!0,position:"right",distance:8,formatter:n=>{const r=e.value.length-1-n.dataIndex,h=e.value[r];return`${d(h.avgTimeDiff)} · ${h.count}次`},fontSize:11,fontWeight:500,color:"#6b7280"},emphasis:{itemStyle:{shadowBlur:6,shadowColor:"rgba(245, 158, 11, 0.3)"}}}]}});return(p,_)=>l.bare?(i(),N(t(pe),{key:0,"content-height":o.value,"max-height-vh":l.maxHeightVh},{default:A(()=>[$(t(ne),{option:m.value,height:o.value},null,8,["option","height"])]),_:1},8,["content-height","max-height-vh"])):(i(),N(t(Q),{key:1,title:l.title,description:l.description,scrollable:"","max-height-vh":l.maxHeightVh},{default:A(()=>[a("div",ca,[$(t(ne),{option:m.value,height:o.value},null,8,["option","height"])])]),_:1},8,["title","description","max-height-vh"]))}}),ua={class:"flex items-center gap-3"},ma={class:"px-3 py-2"},ga=P({__name:"EChartDivingRank",props:{items:{},showTopNSelect:{type:Boolean,default:!0},maxHeightVh:{default:60},globalTopN:{}},setup(l){const s=l,e=L("desc"),o=L(s.globalTopN??10);G(()=>s.globalTopN,n=>{n!==void 0&&(o.value=n)});const c=D(()=>[...s.items].sort((r,h)=>e.value==="desc"?h.daysSinceLastMessage-r.daysSinceLastMessage:r.daysSinceLastMessage-h.daysSinceLastMessage).slice(0,o.value)),u=D(()=>e.value==="desc"?"🤿 潜水榜 - 潜水最久":"🤿 潜水榜 - 最近冒泡"),d=D(()=>e.value==="desc"?"距离上次发言时间最久的成员":"最近发言过的成员"),m=D(()=>{const n=c.value.length*36;return Math.max(n+30,180)}),p={type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:"#06b6d4"},{offset:1,color:"#22d3ee"}]};function _(n,r=8){return n.length<=r?n:n.slice(0,r)+"…"}function y(n){return n===0?"今天":n===1?"昨天":`${n} 天前`}const g=D(()=>{if(c.value.length===0)return{};const n=[...c.value].reverse(),r=n.map(b=>_(b.name)),h=Math.max(...c.value.map(b=>b.daysSinceLastMessage),1),f=n.map(b=>({value:b.daysSinceLastMessage,itemStyle:{color:p,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 k=b[0];if(!k)return"";const I=c.value.length-1-k.dataIndex,v=c.value[I];return`
|
|
113
|
+
<div style="padding: 4px 8px;">
|
|
114
|
+
<div style="font-weight: bold; margin-bottom: 6px;">${v.name}</div>
|
|
115
|
+
<div style="margin-bottom: 4px;">🤿 ${y(v.daysSinceLastMessage)}</div>
|
|
116
|
+
<div style="font-size: 12px; color: #9ca3af;">最后发言: ${$t(v.lastMessageTs)}</div>
|
|
117
|
+
</div>
|
|
118
|
+
`}},grid:{left:110,right:100,top:15,bottom:15,containLabel:!1},xAxis:{type:"value",max:h*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:(b,k)=>{const v=c.value.length-1-k+1;return`${v===1?"🥇":v===2?"🥈":v===3?"🥉":`${v}.`} ${b}`}}},series:[{type:"bar",data:f,barWidth:18,barCategoryGap:"30%",label:{show:!0,position:"right",distance:8,formatter:b=>{const k=c.value.length-1-b.dataIndex,I=c.value[k];return y(I.daysSinceLastMessage)},fontSize:11,fontWeight:500,color:"#6b7280"},emphasis:{itemStyle:{shadowBlur:6,shadowColor:"rgba(0, 0, 0, 0.2)"}}}]}});return(n,r)=>(i(),N(t(Q),{title:u.value,description:d.value,scrollable:"","max-height-vh":l.maxHeightVh},{headerRight:A(()=>[a("div",ua,[l.showTopNSelect?(i(),N(t(ue),{key:0,modelValue:o.value,"onUpdate:modelValue":r[0]||(r[0]=h=>o.value=h)},null,8,["modelValue"])):B("",!0),$(t(ce),{modelValue:e.value,"onUpdate:modelValue":r[1]||(r[1]=h=>e.value=h),items:[{label:"潜水最久",value:"desc"},{label:"最近冒泡",value:"asc"}],size:"sm"},null,8,["modelValue"])])]),default:A(()=>[a("div",ma,[$(t(ne),{option:g.value,height:m.value},null,8,["option","height"])])]),_:1},8,["title","description","max-height-vh"]))}}),pa={class:"px-3 py-2"},ha=P({__name:"EChartConsecutiveRank",props:{items:{},title:{},description:{},topN:{default:10},maxHeightVh:{default:60},bare:{type:Boolean,default:!1}},setup(l){const s=l,e=D(()=>[...s.items].sort((p,_)=>_.maxConsecutiveDays-p.maxConsecutiveDays).slice(0,s.topN)),o=D(()=>{const p=e.value.length*36;return Math.max(p+30,180)}),c={type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:"#f97316"},{offset:1,color:"#fb923c"}]},u={type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:"#ec4899"},{offset:1,color:"#f472b6"}]};function d(p,_=8){return p.length<=_?p:p.slice(0,_)+"…"}const m=D(()=>{if(e.value.length===0)return{};const p=[...e.value].reverse(),_=p.map(g=>d(g.name)),y=Math.max(...e.value.map(g=>g.maxConsecutiveDays),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 n=g[0].dataIndex,r=e.value.length-1-n,h=e.value[r];let f=`
|
|
119
|
+
<div style="padding: 6px 8px;">
|
|
120
|
+
<div style="font-weight: bold; margin-bottom: 6px;">${h.name}</div>
|
|
121
|
+
<div>最长连续: <b style="color: #f472b6;">${h.maxConsecutiveDays}</b> 天</div>
|
|
122
|
+
`;return h.currentStreak>0&&(f+=`<div style="color: #f97316;">🔥 当前连续 ${h.currentStreak} 天</div>`),f+="</div>",f}},legend:{show:!1},grid:{left:110,right:75,top:15,bottom:15,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:_,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{fontSize:12,color:"#4b5563",margin:12,formatter:(g,n)=>{const h=e.value.length-1-n+1;return`${h===1?"🥇":h===2?"🥈":h===3?"🥉":`${h}.`} ${g}`}}},series:[{name:"当前连续",type:"bar",data:p.map(g=>({value:g.currentStreak>0?g.maxConsecutiveDays:0,itemStyle:{color:c,borderRadius:[0,4,4,0]}})),barWidth:18,barGap:"-100%",label:{show:!0,position:"right",distance:8,formatter:g=>{const n=e.value.length-1-g.dataIndex,r=e.value[n];return r.currentStreak>0?`${r.maxConsecutiveDays} 天`:""},fontSize:11,fontWeight:500,color:"#6b7280"}},{name:"已中断",type:"bar",data:p.map(g=>({value:g.currentStreak===0?g.maxConsecutiveDays:0,itemStyle:{color:u,borderRadius:[0,4,4,0]}})),barWidth:18,label:{show:!0,position:"right",distance:8,formatter:g=>{const n=e.value.length-1-g.dataIndex,r=e.value[n];return r.currentStreak===0?`${r.maxConsecutiveDays} 天`:""},fontSize:11,fontWeight:500,color:"#6b7280"}}]}});return(p,_)=>l.bare?(i(),N(t(pe),{key:0,"content-height":o.value,"max-height-vh":l.maxHeightVh},{default:A(()=>[$(t(ne),{option:m.value,height:o.value},null,8,["option","height"])]),_:1},8,["content-height","max-height-vh"])):(i(),N(t(Q),{key:1,title:l.title,description:l.description,scrollable:"","max-height-vh":l.maxHeightVh},{default:A(()=>[a("div",pa,[$(t(ne),{option:m.value,height:o.value},null,8,["option","height"])])]),_:1},8,["title","description","max-height-vh"]))}}),va={class:"px-3 py-2"},fa=P({__name:"EChartNightOwlRank",props:{items:{},title:{},description:{},topN:{default:10},maxHeightVh:{default:60},bare:{type:Boolean,default:!1}},setup(l){const s=l,e=D(()=>s.items.slice(0,s.topN)),o=D(()=>{const m=e.value.length*36;return Math.max(m+50,200)}),c={h23:"#8b5cf6",h0:"#3b82f6",h1:"#06b6d4",h2:"#f59e0b",h3to4:"#ef4444"};function u(m,p=8){return m.length<=p?m:m.slice(0,p)+"…"}const d=D(()=>{if(e.value.length===0)return{};const m=[...e.value].reverse(),p=m.map(y=>u(y.name)),_=Math.max(...e.value.map(y=>y.totalNightMessages),1);return{tooltip:{trigger:"axis",axisPointer:{type:"shadow"},backgroundColor:"rgba(0, 0, 0, 0.85)",borderColor:"transparent",textStyle:{color:"#fff",fontSize:12},formatter:y=>{if(!y||y.length===0)return"";const g=y[0].dataIndex,n=e.value.length-1-g,r=e.value[n],h=r.hourlyBreakdown;return`
|
|
123
|
+
<div style="padding: 6px 8px;">
|
|
124
|
+
<div style="font-weight: bold; margin-bottom: 6px;">${r.name}</div>
|
|
125
|
+
<div style="margin-bottom: 4px;">
|
|
126
|
+
称号: <b style="color: #f472b6;">${r.title}</b>
|
|
127
|
+
</div>
|
|
128
|
+
<div style="margin-bottom: 6px;">总发言: <b>${r.totalNightMessages}</b> 条</div>
|
|
129
|
+
<div style="border-top: 1px solid #374151; padding-top: 6px;">
|
|
130
|
+
<div><span style="color: ${c.h23};">●</span> 23点: ${h.h23} 条</div>
|
|
131
|
+
<div><span style="color: ${c.h0};">●</span> 0点: ${h.h0} 条</div>
|
|
132
|
+
<div><span style="color: ${c.h1};">●</span> 1点: ${h.h1} 条</div>
|
|
133
|
+
<div><span style="color: ${c.h2};">●</span> 2点: ${h.h2} 条</div>
|
|
134
|
+
<div><span style="color: ${c.h3to4};">●</span> 3-4点: ${h.h3to4} 条</div>
|
|
135
|
+
</div>
|
|
136
|
+
</div>
|
|
137
|
+
`}},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:_*1.15,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1}},yAxis:{type:"category",data:p,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{fontSize:12,color:"#4b5563",margin:12,formatter:(y,g)=>{const r=e.value.length-1-g+1;return`${r===1?"🥇":r===2?"🥈":r===3?"🥉":`${r}.`} ${y}`}}},series:[{name:"23点",type:"bar",stack:"total",data:m.map(y=>y.hourlyBreakdown.h23),itemStyle:{color:c.h23},barWidth:18},{name:"0点",type:"bar",stack:"total",data:m.map(y=>y.hourlyBreakdown.h0),itemStyle:{color:c.h0},barWidth:18},{name:"1点",type:"bar",stack:"total",data:m.map(y=>y.hourlyBreakdown.h1),itemStyle:{color:c.h1},barWidth:18},{name:"2点",type:"bar",stack:"total",data:m.map(y=>y.hourlyBreakdown.h2),itemStyle:{color:c.h2},barWidth:18},{name:"3-4点",type:"bar",stack:"total",data:m.map(y=>y.hourlyBreakdown.h3to4),itemStyle:{color:c.h3to4,borderRadius:[0,4,4,0]},barWidth:18,label:{show:!0,position:"right",distance:8,formatter:y=>{const g=e.value.length-1-y.dataIndex;return`${e.value[g].totalNightMessages} 条`},fontSize:11,fontWeight:500,color:"#6b7280"}}]}});return(m,p)=>l.bare?(i(),N(t(pe),{key:0,"content-height":o.value,"max-height-vh":l.maxHeightVh},{default:A(()=>[$(t(ne),{option:d.value,height:o.value},null,8,["option","height"])]),_:1},8,["content-height","max-height-vh"])):(i(),N(t(Q),{key:1,title:l.title,description:l.description,scrollable:"","max-height-vh":l.maxHeightVh},{default:A(()=>[a("div",va,[$(t(ne),{option:d.value,height:o.value},null,8,["option","height"])])]),_:1},8,["title","description","max-height-vh"]))}}),ya={id:"streak-rank",class:"scroll-mt-24"},xa={class:"flex items-center gap-3"},ba=P({__name:"CheckInRank",props:{sessionId:{},timeFilter:{},showTopNSelect:{type:Boolean,default:!0},globalTopN:{}},setup(l){const s=l,e=L(null),o=L(!1),c=L("max"),u=L(s.globalTopN??10);G(()=>s.globalTopN,y=>{y!==void 0&&(u.value=y)});const d=D(()=>c.value==="max"?"🔥 火花榜 - 最长连续":"🔥 火花榜 - 当前连续"),m=D(()=>c.value==="max"?"历史最长连续发言天数":"正在持续连续发言的成员"),p=D(()=>e.value?e.value.streakRank.some(y=>y.currentStreak>0):!1);async function _(){if(s.sessionId){o.value=!0;try{e.value=await Ze(s.sessionId,s.timeFilter)}catch(y){console.error("加载打卡分析失败:",y)}finally{o.value=!1}}}return G(()=>[s.sessionId,s.timeFilter],()=>{_()},{immediate:!0,deep:!0}),(y,g)=>(i(),S("div",ya,[o.value?(i(),N(t(oe),{key:0,text:"正在分析数据..."})):e.value&&e.value.streakRank.length>0?(i(),N(t(Q),{key:1,title:d.value,description:m.value},{headerRight:A(()=>[a("div",xa,[l.showTopNSelect?(i(),N(t(ue),{key:0,modelValue:u.value,"onUpdate:modelValue":g[0]||(g[0]=n=>u.value=n)},null,8,["modelValue"])):B("",!0),p.value?(i(),N(t(ce),{key:1,modelValue:c.value,"onUpdate:modelValue":g[1]||(g[1]=n=>c.value=n),items:[{label:"最长连续",value:"max"},{label:"当前连续",value:"current"}],size:"sm"},null,8,["modelValue"])):B("",!0)])]),default:A(()=>[$(t(ra),{items:e.value.streakRank,title:d.value,mode:c.value,"top-n":u.value,bare:""},null,8,["items","title","mode","top-n"])]),_:1},8,["title","description"])):(i(),N(t(Q),{key:2,title:"🔥 火花榜"},{default:A(()=>[$(t(le),{text:"暂无连续发言数据"})]),_:1}))]))}}),_a={class:"flex items-center gap-3"},ka={key:1,class:"py-8 text-center text-sm text-gray-400"},wa={key:1,class:"py-8 text-center text-sm text-gray-400"},$a=P({__name:"MemeBattleRank",props:{sessionId:{},timeFilter:{},showTopNSelect:{type:Boolean,default:!0},globalTopN:{}},setup(l){const s=l,e=L(null),o=L(!1),c=L("count"),u=L(s.globalTopN??10);G(()=>s.globalTopN,r=>{r!==void 0&&(u.value=r)});async function d(){if(s.sessionId){o.value=!0;try{e.value=await Os(s.sessionId,s.timeFilter)}catch(r){console.error("加载斗图分析失败:",r)}finally{o.value=!1}}}const m=D(()=>e.value?e.value.rankByCount.map(r=>({id:r.memberId.toString(),name:r.name,value:r.count,percentage:r.percentage})):[]),p=D(()=>e.value?e.value.rankByImageCount.map(r=>({id:r.memberId.toString(),name:r.name,value:r.count,percentage:r.percentage})):[]),_=D(()=>c.value==="count"?m.value:p.value),y=D(()=>c.value==="count"?"场":"张"),g=D(()=>{switch(c.value){case"battle":return"⚔️ 斗图榜 - 史诗级战役";case"count":return"⚔️ 斗图榜 - 按场次";case"image":return"⚔️ 斗图榜 - 按图量";default:return"⚔️ 斗图榜"}}),n=D(()=>{switch(c.value){case"battle":return"记录最激烈的斗图大战";case"count":return"参与斗图次数最多的人";case"image":return"在斗图中发送图片最多的人";default:return""}});return G(()=>[s.sessionId,s.timeFilter],()=>d(),{immediate:!0,deep:!0}),(r,h)=>o.value?(i(),N(t(oe),{key:0,text:"正在统计斗图数据..."})):e.value?(i(),N(t(Q),{key:1,title:g.value,description:n.value},{headerRight:A(()=>[a("div",_a,[l.showTopNSelect?(i(),N(t(ue),{key:0,modelValue:u.value,"onUpdate:modelValue":h[0]||(h[0]=f=>u.value=f)},null,8,["modelValue"])):B("",!0),$(t(ce),{modelValue:c.value,"onUpdate:modelValue":h[1]||(h[1]=f=>c.value=f),items:[{label:"按场次",value:"count"},{label:"按图量",value:"image"},{label:"史诗级战役",value:"battle"}],size:"sm"},null,8,["modelValue"])])]),default:A(()=>[c.value==="battle"?(i(),S(q,{key:0},[e.value.topBattles.length>0?(i(),N(t(la),{key:0,battles:e.value.topBattles,title:"","top-n":u.value,bare:""},null,8,["battles","top-n"])):(i(),S("div",ka,"暂无史诗级战役数据"))],64)):(i(),S(q,{key:1},[_.value.length>0?(i(),N(t(ke),{key:0,members:_.value,title:g.value,unit:y.value,"top-n":u.value,bare:""},null,8,["members","title","unit","top-n"])):(i(),S("div",wa,"暂无斗图数据"))],64))]),_:1},8,["title","description"])):B("",!0)}}),Ia={class:"space-y-6"},Ca={class:"flex items-center gap-3"},Sa={class:"flex items-center gap-3"},Ma={key:1,class:"px-3 py-2"},Ta=P({__name:"RepeatSection",props:{sessionId:{},timeFilter:{},showTopNSelect:{type:Boolean,default:!0},globalTopN:{}},setup(l){const s=l,e=L(null),o=L(!1),c=L("originator"),u=L("fastest"),d=L(s.globalTopN??10),m=L(s.globalTopN??10);G(()=>s.globalTopN,I=>{I!==void 0&&(d.value=I,m.value=I)});async function p(){if(s.sessionId){o.value=!0;try{e.value=await et(s.sessionId,s.timeFilter)}catch(I){console.error("加载复读分析失败:",I)}finally{o.value=!1}}}const _=D(()=>e.value?e.value.originators.map(I=>({id:I.memberId.toString(),name:I.name,value:I.count,percentage:I.percentage})):[]),y=D(()=>e.value?e.value.initiators.map(I=>({id:I.memberId.toString(),name:I.name,value:I.count,percentage:I.percentage})):[]),g=D(()=>e.value?e.value.breakers.map(I=>({id:I.memberId.toString(),name:I.name,value:I.count,percentage:I.percentage})):[]),n=D(()=>{switch(c.value){case"originator":return _.value;case"initiator":return y.value;case"breaker":return g.value;default:return _.value}}),r=D(()=>{switch(c.value){case"originator":return"🔁 复读榜 - 被复读";case"initiator":return"🔁 复读榜 - 挑起";case"breaker":return"🔁 复读榜 - 打断";default:return"🔁 复读榜"}}),h=D(()=>{switch(c.value){case"originator":return"发出的消息被别人复读的次数";case"initiator":return"第二个发送相同消息、带起节奏的人";case"breaker":return"终结复读链的人";default:return""}}),f=D(()=>{if(!e.value)return{labels:[],values:[]};const I=e.value.chainLengthDistribution;return{labels:I.map(v=>`${v.length}人`),values:I.map(v=>v.count)}}),b=D(()=>u.value==="fastest"?"📊 复读统计 - 最快反应":"📊 复读统计 - 链长分布"),k=D(()=>{if(u.value==="fastest")return"平均复读反应时间(至少参与5次复读)";const I=e.value?.totalRepeatChains??0,v=e.value?.avgChainLength??0;return`共 ${I} 次复读,平均 ${v} 人参与`});return G(()=>[s.sessionId,s.timeFilter],()=>p(),{immediate:!0,deep:!0}),(I,v)=>(i(),S("div",Ia,[o.value?(i(),N(t(oe),{key:0,text:"正在分析复读数据..."})):e.value&&e.value.totalRepeatChains>0?(i(),S(q,{key:1},[$(t(Q),{title:r.value,description:h.value},{headerRight:A(()=>[a("div",Ca,[l.showTopNSelect?(i(),N(t(ue),{key:0,modelValue:d.value,"onUpdate:modelValue":v[0]||(v[0]=w=>d.value=w)},null,8,["modelValue"])):B("",!0),$(t(ce),{modelValue:c.value,"onUpdate:modelValue":v[1]||(v[1]=w=>c.value=w),items:[{label:"被复读",value:"originator"},{label:"挑起",value:"initiator"},{label:"打断",value:"breaker"}],size:"sm"},null,8,["modelValue"])])]),default:A(()=>[n.value.length>0?(i(),N(t(ke),{key:0,members:n.value,title:r.value,unit:"次","top-n":d.value,bare:""},null,8,["members","title","top-n"])):(i(),N(t(le),{key:1,text:"暂无数据"}))]),_:1},8,["title","description"]),$(t(Q),{title:b.value,description:k.value},{headerRight:A(()=>[a("div",Sa,[l.showTopNSelect&&u.value==="fastest"?(i(),N(t(ue),{key:0,modelValue:m.value,"onUpdate:modelValue":v[2]||(v[2]=w=>m.value=w)},null,8,["modelValue"])):B("",!0),$(t(ce),{modelValue:u.value,"onUpdate:modelValue":v[3]||(v[3]=w=>u.value=w),items:[{label:"最快反应",value:"fastest"},{label:"链长分布",value:"distribution"}],size:"sm"},null,8,["modelValue"])])]),default:A(()=>[u.value==="fastest"?(i(),S(q,{key:0},[e.value.fastestRepeaters&&e.value.fastestRepeaters.length>0?(i(),N(t(da),{key:0,items:e.value.fastestRepeaters,"top-n":m.value,title:"",bare:""},null,8,["items","top-n"])):(i(),N(t(le),{key:1,text:"暂无最快复读数据"}))],64)):(i(),S("div",Ma,[f.value.labels.length>0?(i(),N(t(It),{key:0,data:f.value,height:200},null,8,["data"])):(i(),N(t(le),{key:1,text:"暂无分布数据"}))]))]),_:1},8,["title","description"])],64)):(i(),N(t(Q),{key:2,title:"🔁 复读榜"},{default:A(()=>[$(t(le),{text:"该群组暂无复读记录"})]),_:1}))]))}}),Da=P({__name:"DivingRank",props:{sessionId:{},timeFilter:{},globalTopN:{}},setup(l){const s=l,e=L(null),o=L(!1);async function c(){if(s.sessionId){o.value=!0;try{e.value=await Vs(s.sessionId,s.timeFilter)}catch(u){console.error("加载潜水分析失败:",u)}finally{o.value=!1}}}return G(()=>[s.sessionId,s.timeFilter],()=>c(),{immediate:!0,deep:!0}),(u,d)=>o.value?(i(),N(t(oe),{key:0,text:"正在统计潜水数据..."})):e.value&&e.value.rank.length>0?(i(),N(t(ga),{key:1,items:e.value.rank,"global-top-n":l.globalTopN},null,8,["items","global-top-n"])):B("",!0)}}),Ra={class:"space-y-6"},Na={class:"flex items-center gap-3"},La={key:1,class:"py-8 text-center text-sm text-gray-400"},Va={key:1,class:"py-8 text-center text-sm text-gray-400"},Aa={class:"flex items-center gap-3"},Ea={key:1,class:"py-8 text-center text-sm text-gray-400"},Oa=P({__name:"NightOwlRank",props:{sessionId:{},timeFilter:{},showTopNSelect:{type:Boolean,default:!0},globalTopN:{}},setup(l){const s=l,e=L(null),o=L(!1),c=L("first"),u=L("distribution"),d=L(s.globalTopN??10),m=L(s.globalTopN??10);G(()=>s.globalTopN,b=>{b!==void 0&&(d.value=b,m.value=b)});async function p(){if(s.sessionId){o.value=!0;try{e.value=await Fs(s.sessionId,s.timeFilter)}catch(b){console.error("加载出勤分析失败:",b)}finally{o.value=!1}}}const _=D(()=>e.value?e.value.lastSpeakerRank.map(b=>({id:String(b.memberId),name:b.name,value:b.count,percentage:b.percentage})):[]),y=D(()=>e.value?e.value.firstSpeakerRank.map(b=>({id:String(b.memberId),name:b.name,value:b.count,percentage:b.percentage})):[]),g=D(()=>c.value==="last"?_.value:y.value),n=D(()=>c.value==="last"?"⏰ 出勤排行 - 最晚下班":"⏰ 出勤排行 - 最早上班"),r=D(()=>{const b=e.value?.totalDays??0;return c.value==="last"?`每天最后一个发言的人(共 ${b} 天)`:`每天第一个发言的人(共 ${b} 天)`}),h=D(()=>u.value==="distribution"?"🦉 修仙统计 - 发言分布":"🦉 修仙统计 - 连续记录"),f=D(()=>u.value==="distribution"?"深夜时段(23:00-05:00)各时段发言分布":"连续在深夜时段发言的天数");return G(()=>[s.sessionId,s.timeFilter],()=>p(),{immediate:!0,deep:!0}),(b,k)=>(i(),S("div",Ra,[o.value?(i(),N(t(oe),{key:0,text:"正在加载出勤分析..."})):e.value?(i(),S(q,{key:1},[$(t(Q),{title:h.value,description:f.value},{headerRight:A(()=>[a("div",Na,[l.showTopNSelect?(i(),N(t(ue),{key:0,modelValue:d.value,"onUpdate:modelValue":k[0]||(k[0]=I=>d.value=I)},null,8,["modelValue"])):B("",!0),$(t(ce),{modelValue:u.value,"onUpdate:modelValue":k[1]||(k[1]=I=>u.value=I),items:[{label:"发言分布",value:"distribution"},{label:"连续记录",value:"consecutive"}],size:"sm"},null,8,["modelValue"])])]),default:A(()=>[u.value==="distribution"?(i(),S(q,{key:0},[e.value.nightOwlRank.length>0?(i(),N(t(fa),{key:0,items:e.value.nightOwlRank,"top-n":d.value,title:"",bare:""},null,8,["items","top-n"])):(i(),S("div",La,"暂无深夜发言数据"))],64)):(i(),S(q,{key:1},[e.value.consecutiveRecords.length>0?(i(),N(t(ha),{key:0,items:e.value.consecutiveRecords,"top-n":d.value,title:"",bare:""},null,8,["items","top-n"])):(i(),S("div",Va,"暂无连续记录"))],64))]),_:1},8,["title","description"]),$(t(Q),{title:n.value,description:r.value},{headerRight:A(()=>[a("div",Aa,[l.showTopNSelect?(i(),N(t(ue),{key:0,modelValue:m.value,"onUpdate:modelValue":k[2]||(k[2]=I=>m.value=I)},null,8,["modelValue"])):B("",!0),$(t(ce),{modelValue:c.value,"onUpdate:modelValue":k[3]||(k[3]=I=>c.value=I),items:[{label:"最早上班",value:"first"},{label:"最晚下班",value:"last"}],size:"sm"},null,8,["modelValue"])])]),default:A(()=>[g.value.length>0?(i(),N(t(ke),{key:0,members:g.value,title:n.value,"top-n":m.value,unit:"次",bare:""},null,8,["members","title","top-n"])):(i(),S("div",Ea,"暂无数据"))]),_:1},8,["title","description"])],64)):B("",!0)]))}}),za={class:"main-content min-w-0 flex-1 px-8 mx-auto max-w-3xl space-y-6"},Fa={class:"mb-8 mt-4"},Ba={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"}},Ua={id:"activity-rank",class:"scroll-mt-24"},Ha={id:"meme-battle",class:"scroll-mt-24"},Wa={id:"repeat",class:"scroll-mt-24"},ja={id:"night-owl",class:"scroll-mt-24"},Pa={id:"diving",class:"scroll-mt-24"},qa={class:"border-l border-gray-200 pl-4 dark:border-gray-800"},Ya=P({__name:"RankingView",props:{sessionId:{},timeFilter:{}},setup(l){const s=l,e=L([]),o=L([]);async function c(){if(!s.sessionId)return;const n=Y(),[r,h]=await Promise.all([n.getMemberActivity(s.sessionId,s.timeFilter),n.getAvailableYears(s.sessionId)]);e.value=r,o.value=h}G(()=>[s.sessionId,s.timeFilter],()=>c(),{immediate:!0,deep:!0});const u=D(()=>{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(o.value.length>0){const n=[...o.value].sort((f,b)=>f-b),r=n[0],h=n[n.length-1];return r===h?`${r} 赛季`:`${r}-${h} 赛季`}return"全部赛季"}),d=D(()=>({startTs:s.timeFilter?.startTs,endTs:s.timeFilter?.endTs})),m=[{id:"activity-rank",label:"🏆 活跃榜"},{id:"streak-rank",label:"🔥 火花榜"},{id:"meme-battle",label:"⚔️ 斗图榜"},{id:"repeat",label:"🔁 复读榜"},{id:"night-owl",label:"⏰ 出勤榜"},{id:"diving",label:"🤿 潜水榜"}],{contentRef:p,activeAnchor:_,scrollToAnchor:y}=Yt(m,{threshold:350}),g=L(10);return(n,r)=>(i(),S("div",{ref_key:"contentRef",ref:p,class:"flex gap-6 p-6"},[a("div",za,[a("div",Fa,[a("h1",Ba," 🏆 "+x(u.value),1),r[1]||(r[1]=a("p",{class:"mt-4 text-sm text-gray-500 dark:text-gray-400"},"各榜单前三名请找群主领取奖励 🎁",-1))]),a("div",Ua,[$(t(sa),{"session-id":s.sessionId,"member-activity":e.value,"time-filter":d.value,"global-top-n":g.value},null,8,["session-id","member-activity","time-filter","global-top-n"])]),$(t(ba),{"session-id":s.sessionId,"time-filter":d.value,"global-top-n":g.value},null,8,["session-id","time-filter","global-top-n"]),a("div",Ha,[$(t($a),{"session-id":s.sessionId,"time-filter":d.value,"global-top-n":g.value},null,8,["session-id","time-filter","global-top-n"])]),a("div",Wa,[$(t(Ta),{"session-id":s.sessionId,"time-filter":d.value,"global-top-n":g.value},null,8,["session-id","time-filter","global-top-n"])]),a("div",ja,[$(t(Oa),{"session-id":s.sessionId,"time-filter":d.value,"global-top-n":g.value},null,8,["session-id","time-filter","global-top-n"])]),a("div",Pa,[$(t(Da),{"session-id":s.sessionId,"time-filter":d.value,"global-top-n":g.value},null,8,["session-id","time-filter","global-top-n"])]),r[2]||(r[2]=a("div",{class:"h-48 no-capture"},null,-1))]),$(t(Kt),{anchors:m,"active-anchor":t(_),onClick:t(y)},{default:A(()=>[a("div",qa,[r[3]||(r[3]=a("div",{class:"text-xs text-gray-400 mb-2"},"显示数量",-1)),$(t(ue),{modelValue:g.value,"onUpdate:modelValue":r[0]||(r[0]=h=>g.value=h)},null,8,["modelValue"])])]),_:1},8,["active-anchor","onClick"])],512))}});function tt(l){const s=[],e=[];return l?.startTs!=null&&(s.push("AND msg.ts >= ?"),e.push(l.startTs)),l?.endTs!=null&&(s.push("AND msg.ts <= ?"),e.push(l.endTs)),l?.memberId!=null&&(s.push("AND msg.sender_id = ?"),e.push(l.memberId)),{conditions:s.join(" "),params:e}}const Ga="AND COALESCE(m.account_name, '') != '系统消息'";async function Ja(l,s){const{conditions:e,params:o}=tt(s);return Y().pluginQuery(l,`SELECT
|
|
138
|
+
m.id,
|
|
139
|
+
m.platform_id as platformId,
|
|
140
|
+
COALESCE(m.group_nickname, m.account_name, m.platform_id) as name,
|
|
141
|
+
COUNT(msg.id) as messageCount
|
|
142
|
+
FROM member m
|
|
143
|
+
LEFT JOIN message msg ON m.id = msg.sender_id ${e} ${Ga}
|
|
144
|
+
WHERE COALESCE(m.account_name, '') != '系统消息'
|
|
145
|
+
GROUP BY m.id`,o)}async function Qa(l){return Y().pluginQuery(l,`SELECT member_id as memberId, name
|
|
146
|
+
FROM member_name_history`)}async function Ka(l,s){const{conditions:e,params:o}=tt(s);return Y().pluginQuery(l,`SELECT msg.sender_id as senderId, msg.content
|
|
147
|
+
FROM message msg
|
|
148
|
+
JOIN member m ON msg.sender_id = m.id
|
|
149
|
+
WHERE COALESCE(m.account_name, '') != '系统消息'
|
|
150
|
+
AND msg.type = 0
|
|
151
|
+
AND msg.content IS NOT NULL
|
|
152
|
+
AND msg.content LIKE '%@%'
|
|
153
|
+
${e}`,o)}function Xa(l){const{members:s,nameHistory:e,messages:o}=l,c={nodes:[],links:[],maxLinkValue:0};if(s.length===0)return c;const u=new Map,d=new Map;for(const h of s)d.set(h.id,{name:h.name,messageCount:h.messageCount}),u.set(h.name,h.id);for(const h of e)u.has(h.name)||u.set(h.name,h.memberId);const m=new Map,p=/@([^\s@]+)/g;for(const h of o){const f=h.content.matchAll(p),b=new Set;for(const k of f){const I=k[1],v=u.get(I);if(v&&v!==h.senderId&&!b.has(v)){b.add(v),m.has(h.senderId)||m.set(h.senderId,new Map);const w=m.get(h.senderId);w.set(v,(w.get(v)||0)+1)}}}const _=new Set;for(const[h,f]of m.entries()){_.add(h);for(const b of f.keys())_.add(b)}const y=Math.max(...s.filter(h=>_.has(h.id)).map(h=>h.messageCount),1),g=[];for(const h of _){const f=d.get(h);if(f){const b=20+f.messageCount/y*40;g.push({id:h,name:f.name,value:f.messageCount,symbolSize:Math.round(b)})}}const n=[];let r=0;for(const[h,f]of m.entries()){const b=d.get(h);if(b)for(const[k,I]of f.entries()){const v=d.get(k);v&&(n.push({source:b.name,target:v.name,value:I}),r=Math.max(r,I))}}return{nodes:g,links:n,maxLinkValue:r}}async function Za(l,s){const e={nodes:[],links:[],maxLinkValue:0};try{const[o,c,u]=await Promise.all([Ja(l,s),Qa(l),Ka(l,s)]);return o.length===0?e:await Y().pluginCompute(Xa.toString(),{members:o,nameHistory:c,messages:u})}catch(o){return console.error("[chart-interaction] Failed to load mention graph:",o),e}}const en={class:"flex h-full flex-col"},tn={class:"flex items-center justify-end px-4 py-2"},sn={class:"flex items-center gap-4"},an={class:"flex items-center gap-2"},nn={class:"text-xs text-gray-400"},on={class:"flex items-center gap-2"},rn={class:"text-xs text-gray-400"},ln={class:"flex-1 min-h-0 relative"},cn={key:0,class:"absolute inset-0 flex items-center justify-center"},dn={key:0,class:"h-full"},un={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"},mn={key:1,class:"flex h-full items-center justify-center text-gray-400"},gn={class:"text-center"},pn={class:"mt-2 text-sm"},hn=P({__name:"InteractionView",props:{sessionId:{},timeFilter:{}},setup(l){const s=l,{t:e}=ae(),o=L(!0),c=L({nodes:[],links:[],maxLinkValue:0}),u=L("circular"),d=L(!1),m=L(null);function p(){m.value?.resetView()}async function _(){if(s.sessionId){o.value=!0;try{const y=await Za(s.sessionId,s.timeFilter);c.value={nodes:y.nodes,links:y.links,maxLinkValue:y.maxLinkValue}}catch(y){console.error("[chart-interaction] 加载互动关系图数据失败:",y)}finally{o.value=!1}}}return G(()=>[s.sessionId,s.timeFilter],()=>{_()},{immediate:!0,deep:!0}),(y,g)=>{const n=me,r=qe("UButtonGroup"),h=at,f=Me;return i(),S("div",en,[a("div",tn,[a("div",sn,[a("div",an,[a("span",nn,x(t(e)("views.interaction.layout"))+":",1),$(r,{size:"xs"},{default:A(()=>[$(n,{color:u.value==="circular"?"primary":"neutral",variant:u.value==="circular"?"solid":"ghost",onClick:g[0]||(g[0]=b=>u.value="circular")},{default:A(()=>[K(x(t(e)("views.interaction.circular")),1)]),_:1},8,["color","variant"]),$(n,{color:u.value==="force"?"primary":"neutral",variant:u.value==="force"?"solid":"ghost",onClick:g[1]||(g[1]=b=>u.value="force")},{default:A(()=>[K(x(t(e)("views.interaction.force")),1)]),_:1},8,["color","variant"])]),_:1})]),a("div",on,[a("span",rn,x(t(e)("views.interaction.directed"))+":",1),$(h,{modelValue:d.value,"onUpdate:modelValue":g[2]||(g[2]=b=>d.value=b),size:"xs"},null,8,["modelValue"])]),$(n,{size:"xs",color:"neutral",variant:"ghost",icon:"i-heroicons-arrow-path",onClick:p},{default:A(()=>[K(x(t(e)("views.interaction.reset")),1)]),_:1})])]),a("div",ln,[o.value?(i(),S("div",cn,[$(f,{name:"i-heroicons-arrow-path",class:"h-8 w-8 animate-spin text-pink-500"})])):(i(),S(q,{key:1},[c.value.nodes.length>0?(i(),S("div",dn,[$(t(Xt),{ref_key:"graphRef",ref:m,data:c.value,layout:u.value,directed:d.value,height:"100%"},null,8,["data","layout","directed"]),a("div",un,x(t(e)("views.interaction.graphHint",{nodes:c.value.nodes.length,links:c.value.links.length})),1)])):(i(),S("div",mn,[a("div",gn,[$(f,{name:"i-heroicons-user-group",class:"mx-auto h-10 w-10 text-gray-300 dark:text-gray-600"}),a("p",pn,x(t(e)("views.interaction.noInteraction")),1)])]))],64))])])}}}),vn={class:"main-content mx-auto max-w-[920px] space-y-6 p-6"},fn={class:"grid grid-cols-1 gap-6 lg:grid-cols-2"},yn={class:"grid grid-cols-1 gap-6 lg:grid-cols-2"},xn={class:"divide-y divide-gray-100 dark:divide-gray-800"},bn={class:"flex flex-1 items-center gap-2"},_n=["onClick"],kn={class:"flex items-center gap-1 text-pink-500"},wn={class:"text-xs"},$n=["onClick"],In={class:"shrink-0 text-right text-sm text-gray-500"},Cn={key:0,class:"text-red-500"},Sn={key:1},Mn={class:"divide-y divide-gray-100 dark:divide-gray-800"},Tn={class:"flex flex-1 items-center gap-2"},Dn=["onClick"],Rn={class:"flex items-center gap-1"},Nn={class:"text-xs text-gray-400"},Ln={class:"text-xs text-gray-400"},Vn=["onClick"],An={class:"shrink-0 text-right"},En={class:"text-lg font-bold text-pink-600"},On={class:"ml-1 text-sm text-gray-500"},zn={key:0,class:"p-5"},Fn={class:"mb-4 text-lg font-semibold text-gray-900 dark:text-white"},Bn={key:0,class:"mb-4"},Un={class:"mb-2 text-sm font-medium text-gray-700 dark:text-gray-300"},Hn={class:"space-y-2"},Wn={class:"text-sm font-medium text-gray-900 dark:text-white"},jn={class:"text-xs text-gray-500"},Pn={key:1},qn={class:"mb-2 text-sm font-medium text-gray-700 dark:text-gray-300"},Yn={class:"space-y-2"},Gn={class:"text-sm font-medium text-gray-900 dark:text-white"},Jn={class:"text-xs text-gray-500"},Qn={class:"mt-4 flex justify-end"},Kn=P({__name:"Relationships",props:{sessionId:{},timeFilter:{}},setup(l){const{t:s}=ae(),e=l,o=L(null),c=L(!1),u=L(null),d=L(!1);async function m(){if(e.sessionId){c.value=!0;try{o.value=await Y().getMentionAnalysis(e.sessionId,e.timeFilter)}catch(g){console.error("加载 @ 互动分析失败:",g)}finally{c.value=!1}}}const p=D(()=>o.value?o.value.topMentioners.map(g=>({id:g.memberId.toString(),name:g.name,value:g.count,percentage:g.percentage})):[]),_=D(()=>o.value?o.value.topMentioned.map(g=>({id:g.memberId.toString(),name:g.name,value:g.count,percentage:g.percentage})):[]);function y(g){if(!o.value)return;const n=o.value.memberDetails.find(r=>r.memberId===g);n&&(u.value=n,d.value=!0)}return G(()=>[e.sessionId,e.timeFilter],()=>{m()},{immediate:!0,deep:!0}),(g,n)=>{const r=Be,h=me,f=xe;return i(),S("div",vn,[c.value?(i(),N(t(oe),{key:0,text:t(s)("members.relationships.loading")},null,8,["text"])):o.value&&o.value.totalMentions>0?(i(),S(q,{key:1},[a("div",fn,[p.value.length>0?(i(),N(t(ze),{key:0,members:p.value,title:t(s)("members.relationships.topMentioners"),description:t(s)("members.relationships.totalMentions",{count:o.value.totalMentions}),unit:t(s)("members.relationships.times")},null,8,["members","title","description","unit"])):B("",!0),_.value.length>0?(i(),N(t(ze),{key:1,members:_.value,title:t(s)("members.relationships.topMentioned"),description:t(s)("members.relationships.popularMember"),unit:t(s)("members.relationships.times")},null,8,["members","title","description","unit"])):B("",!0)]),a("div",yn,[o.value.oneWay.length>0?(i(),N(t(Q),{key:0,class:"hidden",title:t(s)("members.relationships.oneWay.title"),description:t(s)("members.relationships.oneWay.description",{count:o.value.oneWay.length})},{default:A(()=>[a("div",xn,[(i(!0),S(q,null,se(o.value.oneWay.slice(0,10),(b,k)=>(i(),S("div",{key:k,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:Z(["flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-xs font-bold",k===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"])},x(k+1),3),a("div",bn,[a("button",{class:"font-medium text-gray-900 hover:text-pink-600 dark:text-white dark:hover:text-pink-600",onClick:I=>y(b.fromMemberId)},x(b.fromName),9,_n),a("div",kn,[n[2]||(n[2]=a("span",{class:"text-lg"},"→",-1)),a("span",wn,x(b.fromToCount)+"次",1)]),a("button",{class:"font-medium text-gray-900 hover:text-pink-600 dark:text-white dark:hover:text-pink-600",onClick:I=>y(b.toMemberId)},x(b.toName),9,$n)]),a("div",In,[b.toFromCount===0?(i(),S("span",Cn,x(t(s)("members.relationships.oneWay.neverRespond")),1)):(i(),S("span",Sn,x(t(s)("members.relationships.oneWay.reverse",{count:b.toFromCount})),1))]),$(r,{color:"pink",variant:"soft",size:"xs"},{default:A(()=>[K(x(t(s)("members.relationships.oneWay.ratio",{value:Math.round(b.ratio*100)})),1)]),_:2},1024)]))),128))])]),_:1},8,["title","description"])):B("",!0),o.value.twoWay.length>0?(i(),N(t(Q),{key:1,title:t(s)("members.relationships.twoWay.title"),description:t(s)("members.relationships.twoWay.description",{count:o.value.twoWay.length})},{default:A(()=>[a("div",Mn,[(i(!0),S(q,null,se(o.value.twoWay.slice(0,10),(b,k)=>(i(),S("div",{key:k,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:Z(["flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-xs font-bold",k===0?"bg-linear-to-r from-pink-400 to-red-400 text-white":k===1?"bg-linear-to-r from-pink-300 to-red-300 text-white":k===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"])},x(k+1),3),a("div",Tn,[a("button",{class:"font-medium text-gray-900 hover:text-pink-600 dark:text-white dark:hover:text-pink-600",onClick:I=>y(b.member1Id)},x(b.member1Name),9,Dn),a("div",Rn,[a("span",Nn,x(b.member1To2),1),n[3]||(n[3]=a("span",{class:"text-lg text-pink-500"},"⇄",-1)),a("span",Ln,x(b.member2To1),1)]),a("button",{class:"font-medium text-gray-900 hover:text-pink-600 dark:text-white dark:hover:text-pink-600",onClick:I=>y(b.member2Id)},x(b.member2Name),9,Vn)]),a("div",An,[a("span",En,x(b.total),1),a("span",On,x(t(s)("members.relationships.twoWay.interactions")),1)]),$(r,{color:b.balance>=.7?"green":b.balance>=.5?"blue":"gray",variant:"soft",size:"xs"},{default:A(()=>[K(x(t(s)("members.relationships.twoWay.balance",{value:Math.round(b.balance*100)})),1)]),_:2},1032,["color"])]))),128))])]),_:1},8,["title","description"])):B("",!0)])],64)):c.value?B("",!0):(i(),N(t(Q),{key:2,title:t(s)("members.relationships.emptyTitle")},{default:A(()=>[$(t(le),{text:t(s)("members.relationships.empty")},null,8,["text"])]),_:1},8,["title"])),$(f,{open:d.value,"onUpdate:open":n[1]||(n[1]=b=>d.value=b)},{content:A(()=>[u.value?(i(),S("div",zn,[a("h3",Fn,x(t(s)("members.relationships.modal.title",{name:u.value.name})),1),u.value.topMentioned.length>0?(i(),S("div",Bn,[a("h4",Un,x(t(s)("members.relationships.modal.topMentioned")),1),a("div",Hn,[(i(!0),S(q,null,se(u.value.topMentioned,(b,k)=>(i(),S("div",{key:k,class:"flex items-center gap-3 rounded-lg bg-gray-50 px-3 py-2 dark:bg-gray-800"},[a("span",Wn,x(b.toName),1),a("span",jn,x(t(s)("members.relationships.modal.timesCount",{count:b.count})),1)]))),128))])])):B("",!0),u.value.topMentioners.length>0?(i(),S("div",Pn,[a("h4",qn,x(t(s)("members.relationships.modal.topMentioners")),1),a("div",Yn,[(i(!0),S(q,null,se(u.value.topMentioners,(b,k)=>(i(),S("div",{key:k,class:"flex items-center gap-3 rounded-lg bg-gray-50 px-3 py-2 dark:bg-gray-800"},[a("span",Gn,x(b.fromName),1),a("span",Jn,x(t(s)("members.relationships.modal.timesCount",{count:b.count})),1)]))),128))])])):B("",!0),a("div",Qn,[$(h,{variant:"soft",onClick:n[0]||(n[0]=b=>d.value=!1)},{default:A(()=>[K(x(t(s)("members.relationships.modal.close")),1)]),_:1})])])):B("",!0)]),_:1},8,["open"])])}}}),Xn={lookAhead:3,decaySeconds:120,topEdges:150},Zn="AND COALESCE(m.account_name, '') != '系统消息'";function eo(l){const s=[],e=[];return l?.startTs!=null&&(s.push("AND msg.ts >= ?"),e.push(l.startTs)),l?.endTs!=null&&(s.push("AND msg.ts <= ?"),e.push(l.endTs)),{conditions:s.join(" "),params:e}}async function to(l){return Y().pluginQuery(l,`SELECT
|
|
154
|
+
id,
|
|
155
|
+
platform_id as platformId,
|
|
156
|
+
COALESCE(group_nickname, account_name, platform_id) as name,
|
|
157
|
+
(SELECT COUNT(*) FROM message WHERE sender_id = member.id) as messageCount
|
|
158
|
+
FROM member
|
|
159
|
+
WHERE COALESCE(account_name, '') != '系统消息'`)}async function so(l,s){const{conditions:e,params:o}=eo(s);return Y().pluginQuery(l,`SELECT msg.sender_id as senderId, msg.ts as ts
|
|
160
|
+
FROM message msg
|
|
161
|
+
JOIN member m ON msg.sender_id = m.id
|
|
162
|
+
WHERE 1=1 ${Zn} ${e}
|
|
163
|
+
ORDER BY msg.ts ASC, msg.id ASC`,o)}function ao(l){const{members:s,messages:e,options:o}=l;function c(R,F){return R<F?`${R}-${F}`:`${F}-${R}`}function u(R){return Math.round(R*100)/100}const d={nodes:[],links:[],maxLinkValue:0,communities:[],stats:{totalMembers:0,totalMessages:0,involvedMembers:0,edgeCount:0,communityCount:0}};if(s.length<2)return{...d,stats:{...d.stats,totalMembers:s.length}};const m=new Map;for(const R of s)m.set(R.id,{name:R.name,platformId:R.platformId,messageCount:R.messageCount});if(e.length<2)return{...d,stats:{...d.stats,totalMembers:s.length,totalMessages:e.length}};const p=new Map;for(const R of e)p.set(R.senderId,(p.get(R.senderId)||0)+1);const _=e.length,y=new Map,g=new Map;for(let R=0;R<e.length-1;R++){const F=e[R],E=new Set;let W=0;for(let X=R+1;X<e.length&&W<o.lookAhead;X++){const ee=e[X];if(ee.senderId===F.senderId||E.has(ee.senderId))continue;E.add(ee.senderId),W++;const ie=(ee.ts-F.ts)/1e3,re=Math.exp(-ie/o.decaySeconds),de=1-(W-1)*.2,z=re*de,O=c(F.senderId,ee.senderId);y.set(O,(y.get(O)||0)+z),g.set(O,(g.get(O)||0)+1)}}const n=o.lookAhead*.8,r=[];for(const[R,F]of y){const[E,W]=R.split("-"),X=parseInt(E),ee=parseInt(W),ie=p.get(X)||0,re=p.get(ee)||0,de=ie*re/_*n,z=de>0?F/de:0;r.push({sourceId:X,targetId:ee,rawScore:F,expectedScore:de,normalizedScore:z,coOccurrenceCount:g.get(R)||0})}const h=Math.max(...r.map(R=>R.rawScore),1),f=Math.max(...r.map(R=>R.normalizedScore),1),b=r.map(R=>{const F=.5*(R.rawScore/h)+.5*(R.normalizedScore/f);return{...R,rawScore:u(R.rawScore),expectedScore:u(R.expectedScore),normalizedScore:u(R.normalizedScore),hybridScore:u(F)}});b.sort((R,F)=>F.hybridScore-R.hybridScore);const k=b.slice(0,o.topEdges);if(k.length===0)return{...d,stats:{...d.stats,totalMembers:s.length,totalMessages:e.length}};const I=new Set;for(const R of k)I.add(R.sourceId),I.add(R.targetId);const v=new Map;for(const R of k)v.set(R.sourceId,(v.get(R.sourceId)||0)+R.hybridScore),v.set(R.targetId,(v.get(R.targetId)||0)+R.hybridScore);const w=Math.max(...v.values(),1),C=new Map;for(const R of I){const F=m.get(R)?.name||String(R);C.set(F,(C.get(F)||0)+1)}const M=new Map;for(const R of I){const F=m.get(R),E=F?.name||String(R);(C.get(E)||0)>1?M.set(R,`${E}#${(F?.platformId||String(R)).slice(-4)}`):M.set(R,E)}const T=Math.max(...[...I].map(R=>m.get(R)?.messageCount||0),1),V=[...I].map(R=>{const F=m.get(R),E=v.get(R)||0,W=E/w,X=F.messageCount/T,ee=20+(.7*W+.3*X)*35;return{id:R,name:M.get(R),messageCount:F.messageCount,symbolSize:Math.round(ee),degree:u(E),normalizedDegree:u(W)}});V.sort((R,F)=>F.degree-R.degree);const H=k.length>0?Math.max(...k.map(R=>R.hybridScore)):0,U=k.map(R=>({source:M.get(R.sourceId),target:M.get(R.targetId),value:R.hybridScore,rawScore:R.rawScore,expectedScore:R.expectedScore,coOccurrenceCount:R.coOccurrenceCount}));return{nodes:V,links:U,maxLinkValue:u(H),communities:[],stats:{totalMembers:s.length,totalMessages:e.length,involvedMembers:I.size,edgeCount:k.length,communityCount:0}}}async function no(l,s,e){const o={nodes:[],links:[],maxLinkValue:0,communities:[],stats:{totalMembers:0,totalMessages:0,involvedMembers:0,edgeCount:0,communityCount:0}};try{const[c,u]=await Promise.all([to(l),so(l,s)]);if(c.length<2||u.length<2)return{...o,stats:{...o.stats,totalMembers:c.length,totalMessages:u.length}};const d={...Xn,...e};return await Y().pluginCompute(ao.toString(),{members:c,messages:u,options:d})}catch(c){return console.error("[chart-cluster] Failed to load cluster graph:",c),o}}const oo={class:"mx-auto max-w-[920px] p-4 h-full"},ro={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"},io={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"},lo={class:"flex items-center gap-3"},co={class:"flex items-center gap-3"},uo={class:"p-3 w-64"},mo={class:"text-sm font-medium mb-3"},go={class:"space-y-3"},po={class:"text-xs text-gray-500 mb-1 block"},ho={class:"text-xs text-gray-400 mt-1"},vo={class:"text-xs text-gray-500 mb-1 block"},fo={class:"text-xs text-gray-400 mt-1"},yo={class:"flex-1 min-h-0 overflow-hidden"},xo={key:0,class:"h-full flex items-center justify-center"},bo={key:1,class:"h-full flex items-center justify-center"},_o={class:"text-center text-gray-400"},ko={key:2,class:"h-full"},wo={key:3,class:"h-full flex overflow-hidden"},$o={class:"w-64 border-r border-gray-200 dark:border-gray-700 flex flex-col overflow-hidden"},Io={class:"px-4 py-3 border-b border-gray-200 dark:border-gray-700"},Co={class:"text-sm font-medium flex items-center gap-2"},So={class:"flex-1 overflow-y-auto"},Mo=["onClick"],To={class:"flex items-center justify-between"},Do={class:"text-sm truncate"},Ro={class:"text-xs text-gray-400"},No={class:"flex-1 overflow-hidden flex flex-col"},Lo={key:0,class:"flex-1 flex items-center justify-center"},Vo={class:"text-center text-gray-400"},Ao={class:"px-4 py-3 border-b border-gray-200 dark:border-gray-700 flex items-center gap-3"},Eo={class:"w-10 h-10 rounded-full flex items-center justify-center text-white font-bold bg-primary-500"},Oo={class:"font-medium"},zo={class:"text-xs text-gray-400"},Fo={class:"px-4 py-3 border-b border-gray-200 dark:border-gray-700"},Bo={class:"text-sm font-medium flex items-center gap-2"},Uo={class:"flex-1 overflow-y-auto"},Ho={key:0,class:"p-4 text-center text-gray-400"},Wo={class:"flex items-center gap-3"},jo={class:"flex-1 min-w-0"},Po={class:"text-sm font-medium truncate"},qo={class:"flex items-center gap-3 mt-0.5 text-xs text-gray-400"},Yo={class:"w-20 h-2 bg-gray-200 dark:bg-gray-700 rounded-full overflow-hidden"},Go={key:4,class:"h-full flex flex-col overflow-hidden"},Jo={class:"px-4 py-3 border-b border-gray-200 dark:border-gray-700"},Qo={class:"text-sm font-medium flex items-center gap-2"},Ko={class:"flex-1 overflow-y-auto"},Xo={class:"flex items-center gap-3"},Zo={class:"flex-1 min-w-0"},er={class:"flex items-center gap-2 text-sm"},tr={class:"font-medium truncate"},sr={class:"font-medium truncate"},ar={class:"flex items-center gap-3 mt-1 text-xs text-gray-400"},nr={class:"w-24 h-2 bg-gray-200 dark:bg-gray-700 rounded-full overflow-hidden"},or={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"},rr=P({__name:"ClusterView",props:{sessionId:{},timeFilter:{}},setup(l){Je([jt,Qe,Pt,qt,Ke]);const s=l,{t:e}=ae(),o=gt(),c=D(()=>o.value==="dark"),u=L(!0),d=L(null),m=L("matrix"),p=L(null),_=L({lookAhead:3,decaySeconds:120,topEdges:150}),y=L(null);let g=null;async function n(){if(s.sessionId){u.value=!0;try{d.value=await no(s.sessionId,s.timeFilter,{lookAhead:_.value.lookAhead,decaySeconds:_.value.decaySeconds,topEdges:_.value.topEdges})}catch(M){console.error("[chart-cluster] 加载小团体关系数据失败:",M),d.value=null}finally{u.value=!1}}}const r=D(()=>{if(!d.value||d.value.nodes.length===0)return null;const{nodes:M,links:T,maxLinkValue:V}=d.value,U=[...M].sort((E,W)=>W.messageCount-E.messageCount).slice(0,20).map(E=>E.name),R=new Map;for(const E of T)R.set(`${E.source}-${E.target}`,E.value),R.set(`${E.target}-${E.source}`,E.value);const F=[];for(let E=0;E<U.length;E++)for(let W=0;W<U.length;W++)if(E===W)F.push([E,W,-1]);else{const X=R.get(`${U[E]}-${U[W]}`)||0;F.push([E,W,X])}return{names:U,data:F,maxValue:V}});function h(){if(!r.value)return{graphic:{type:"text",style:{text:e("views.cluster.noData"),fill:"#999"}}};const{names:M,data:T,maxValue:V}=r.value;return{tooltip:{position:"top",formatter:H=>{const[U,R,F]=H.data;return F<0?`${M[U]}`:F===0?`${M[U]} ↔ ${M[R]}<br/>暂无关系数据`:`${M[U]} ↔ ${M[R]}<br/>临近度: ${F.toFixed(2)}`}},grid:{left:120,right:40,top:40,bottom:120},xAxis:{type:"category",data:M,splitArea:{show:!0},axisLabel:{rotate:45,fontSize:10,color:c.value?"#ccc":"#333"}},yAxis:{type:"category",data:M,splitArea:{show:!0},axisLabel:{fontSize:10,color:c.value?"#ccc":"#333"}},visualMap:{min:0,max:V||1,calculable:!0,orient:"horizontal",left:"center",bottom:10,inRange:{color:c.value?["#1a1a2e","#16213e","#0f3460","#e94560"]:["#f7f7f7","#fce4ec","#f8bbd9","#ee4567"]},textStyle:{color:c.value?"#ccc":"#333"}},series:[{type:"heatmap",data:T.filter(H=>H[2]>=0),label:{show:!1},emphasis:{itemStyle:{shadowBlur:10,shadowColor:"rgba(0, 0, 0, 0.5)"}}}],backgroundColor:"transparent"}}const f=D(()=>d.value?[...d.value.nodes].sort((M,T)=>T.messageCount-M.messageCount):[]),b=D(()=>!d.value||p.value===null?null:d.value.nodes.find(M=>M.id===p.value)||null),k=D(()=>{if(!d.value||!b.value)return[];const M=b.value.name,T=[];for(const V of d.value.links)V.source===M?T.push({otherName:V.target,value:V.value,coOccurrenceCount:V.coOccurrenceCount}):V.target===M&&T.push({otherName:V.source,value:V.value,coOccurrenceCount:V.coOccurrenceCount});return T.sort((V,H)=>H.value-V.value),T}),I=D(()=>d.value?d.value.links.slice(0,50):[]);function v(){g&&m.value==="matrix"&&g.setOption(h(),{notMerge:!0})}function w(){y.value&&(g=Xe(y.value,c.value?"dark":void 0),v())}function C(){g?.resize()}return G(m,async(M,T)=>{T==="matrix"&&g&&(g.dispose(),g=null),M==="matrix"&&(await Ie(),w())}),G([d,()=>c.value],()=>{m.value==="matrix"&&v()},{deep:!0}),G(u,async(M,T)=>{T&&!M&&m.value==="matrix"&&(g&&(g.dispose(),g=null),await Ie(),w())}),G(()=>[s.sessionId,s.timeFilter],()=>n(),{immediate:!0,deep:!0}),be(()=>{window.addEventListener("resize",C),m.value==="matrix"&&Ie(()=>w())}),Te(()=>{window.removeEventListener("resize",C),g?.dispose(),g=null}),(M,T)=>{const V=me,H=qe("UButtonGroup"),U=Ue,R=nt,F=Me;return i(),S("div",oo,[a("div",ro,[a("div",io,[a("div",lo,[$(H,{size:"xs"},{default:A(()=>[$(V,{color:m.value==="matrix"?"primary":"neutral",variant:m.value==="matrix"?"solid":"ghost",onClick:T[0]||(T[0]=E=>m.value="matrix")},{default:A(()=>[K(x(t(e)("views.cluster.matrixView")),1)]),_:1},8,["color","variant"]),$(V,{color:m.value==="member"?"primary":"neutral",variant:m.value==="member"?"solid":"ghost",onClick:T[1]||(T[1]=E=>m.value="member")},{default:A(()=>[K(x(t(e)("views.cluster.memberView")),1)]),_:1},8,["color","variant"]),$(V,{color:m.value==="circle"?"primary":"neutral",variant:m.value==="circle"?"solid":"ghost",onClick:T[2]||(T[2]=E=>m.value="circle")},{default:A(()=>[K(x(t(e)("views.cluster.rankingView")),1)]),_:1},8,["color","variant"])]),_:1})]),a("div",co,[$(R,null,{content:A(()=>[a("div",uo,[a("h4",mo,x(t(e)("views.cluster.modelSettings")),1),a("div",go,[a("div",null,[a("label",po,x(t(e)("views.cluster.lookAhead")),1),$(U,{modelValue:_.value.lookAhead,"onUpdate:modelValue":T[3]||(T[3]=E=>_.value.lookAhead=E),modelModifiers:{number:!0},type:"number",min:1,max:10,size:"xs",placeholder:"1-10"},null,8,["modelValue"]),a("p",ho,x(t(e)("views.cluster.lookAheadDesc")),1)]),a("div",null,[a("label",vo,x(t(e)("views.cluster.decaySeconds")),1),$(U,{modelValue:_.value.decaySeconds,"onUpdate:modelValue":T[4]||(T[4]=E=>_.value.decaySeconds=E),modelModifiers:{number:!0},type:"number",min:30,max:3600,size:"xs",placeholder:"30-3600"},null,8,["modelValue"]),a("p",fo,x(t(e)("views.cluster.decaySecondsDesc")),1)]),$(V,{size:"xs",color:"primary",class:"w-full mt-2",onClick:n},{default:A(()=>[K(x(t(e)("views.cluster.applySettings")),1)]),_:1})])])]),default:A(()=>[$(V,{variant:"ghost",size:"xs",icon:"i-heroicons-adjustments-horizontal"})]),_:1}),$(V,{variant:"ghost",size:"xs",icon:"i-heroicons-arrow-path",onClick:n})])]),a("div",yo,[u.value?(i(),S("div",xo,[$(F,{name:"i-heroicons-arrow-path",class:"w-6 h-6 animate-spin text-gray-400"})])):!d.value||d.value.nodes.length===0?(i(),S("div",bo,[a("div",_o,[$(F,{name:"i-heroicons-user-group",class:"w-12 h-12 mx-auto mb-2 opacity-50"}),a("p",null,x(t(e)("views.cluster.noData")),1)])])):m.value==="matrix"?(i(),S("div",ko,[a("div",{ref_key:"chartRef",ref:y,class:"w-full h-full"},null,512)])):m.value==="member"?(i(),S("div",wo,[a("div",$o,[a("div",Io,[a("h3",Co,[$(F,{name:"i-heroicons-users",class:"w-4 h-4"}),K(" "+x(t(e)("views.cluster.selectMember")),1)])]),a("div",So,[(i(!0),S(q,null,se(f.value,E=>(i(),S("div",{key:E.id,class:Z(["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":p.value===E.id}]),onClick:W=>p.value=E.id},[a("div",To,[a("span",Do,x(E.name),1),a("span",Ro,x(E.messageCount),1)])],10,Mo))),128))])]),a("div",No,[b.value?(i(),S(q,{key:1},[a("div",Ao,[a("div",Eo,x(b.value.name.charAt(0)),1),a("div",null,[a("div",Oo,x(b.value.name),1),a("div",zo,x(t(e)("views.cluster.msgCount"))+": "+x(b.value.messageCount)+" | "+x(t(e)("views.cluster.relationCount"))+": "+x(k.value.length),1)])]),a("div",Fo,[a("h3",Bo,[$(F,{name:"i-heroicons-heart",class:"w-4 h-4 text-pink-500"}),K(" "+x(t(e)("views.cluster.relationsByIntimacy")),1)])]),a("div",Uo,[k.value.length===0?(i(),S("div",Ho,x(t(e)("views.cluster.noRelations")),1)):B("",!0),(i(!0),S(q,null,se(k.value,(E,W)=>(i(),S("div",{key:E.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",Wo,[a("span",{class:Z(["w-6 h-6 rounded-full flex items-center justify-center text-xs font-bold",W<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"])},x(W+1),3),a("div",jo,[a("div",Po,x(E.otherName),1),a("div",qo,[a("span",null,x(t(e)("views.cluster.intimacy"))+": "+x((E.value*100).toFixed(0))+"%",1),a("span",null,x(t(e)("views.cluster.coOccurrence"))+": "+x(E.coOccurrenceCount)+x(t(e)("views.cluster.times")),1)])]),a("div",Yo,[a("div",{class:"h-full bg-linear-to-r from-pink-400 to-pink-600",style:ye({width:`${k.value[0]?.value?E.value/k.value[0].value*100:0}%`})},null,4)])])]))),128))])],64)):(i(),S("div",Lo,[a("div",Vo,[$(F,{name:"i-heroicons-cursor-arrow-rays",class:"w-12 h-12 mx-auto mb-2 opacity-50"}),a("p",null,x(t(e)("views.cluster.selectMemberHint")),1)])]))])])):(i(),S("div",Go,[a("div",Jo,[a("h3",Qo,[$(F,{name:"i-heroicons-trophy",class:"w-4 h-4 text-yellow-500"}),K(" "+x(t(e)("views.cluster.interactionRanking")),1)])]),a("div",Ko,[(i(!0),S(q,null,se(I.value,(E,W)=>(i(),S("div",{key:W,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",Xo,[a("span",{class:Z(["w-8 h-8 rounded-full flex items-center justify-center text-sm font-bold",W<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"])},x(W+1),3),a("div",Zo,[a("div",er,[a("span",tr,x(E.source),1),T[5]||(T[5]=a("span",{class:"text-gray-400"},"↔",-1)),a("span",sr,x(E.target),1)]),a("div",ar,[a("span",null,x(t(e)("views.cluster.score"))+": "+x(E.value.toFixed(2)),1),a("span",null,x(t(e)("views.cluster.coOccurrence"))+": "+x(E.coOccurrenceCount)+x(t(e)("views.cluster.times")),1)])]),a("div",nr,[a("div",{class:"h-full bg-linear-to-r from-yellow-400 to-orange-500",style:ye({width:`${I.value[0]?.value?E.value/I.value[0].value*100:0}%`})},null,4)])])]))),128))])]))]),d.value?(i(),S("div",or,[a("span",null,x(t(e)("views.cluster.totalMembers"))+": "+x(d.value.stats.totalMembers),1),a("span",null,x(t(e)("views.cluster.totalMessages"))+": "+x(d.value.stats.totalMessages.toLocaleString()),1),a("span",null,x(t(e)("views.cluster.involvedMembers"))+": "+x(d.value.stats.involvedMembers),1),a("span",null,x(t(e)("views.cluster.edgeCount"))+": "+x(d.value.stats.edgeCount),1)])):B("",!0)])])}}}),ir={class:"flex h-full flex-col"},lr={class:"min-h-0 flex-1 overflow-y-auto"},cr=P({__name:"GroupRelationships",props:{sessionId:{},timeFilter:{}},setup(l){const{t:s}=ae(),e=l,o=L("mention-graph"),c=D(()=>[{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(u,d)=>(i(),S("div",ir,[$(t(Ye),{modelValue:o.value,"onUpdate:modelValue":d[0]||(d[0]=m=>o.value=m),items:c.value,"persist-key":"groupRelationshipsTab",size:"sm"},null,8,["modelValue","items"]),a("div",lr,[$(De,{name:"fade",mode:"out-in"},{default:A(()=>[o.value==="mention-graph"?(i(),N(hn,{key:0,"session-id":e.sessionId,"time-filter":e.timeFilter},null,8,["session-id","time-filter"])):o.value==="mention-ranking"?(i(),N(Kn,{key:1,"session-id":e.sessionId,"time-filter":e.timeFilter},null,8,["session-id","time-filter"])):o.value==="proximity"?(i(),N(rr,{key:2,"session-id":e.sessionId,"time-filter":e.timeFilter},null,8,["session-id","time-filter"])):B("",!0)]),_:1})])]))}}),dr=Ne(cr,[["__scopeId","data-v-90e47115"]]),ur={class:"flex h-full flex-col"},mr={class:"flex-1 min-h-0 overflow-y-auto"},gr=P({__name:"ViewTab",props:{sessionId:{},sessionName:{},timeFilter:{}},setup(l){const{t:s,locale:e}=ae(),o=l,c=D(()=>{const p=[{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 pt("groupRanking",e.value)&&p.splice(2,0,{id:"ranking",label:s("analysis.subTabs.view.ranking"),icon:"i-heroicons-trophy"}),p}),u=L("type-analysis"),d=L(null),m=D(()=>({...o.timeFilter,memberId:d.value}));return(p,_)=>(i(),S("div",ur,[$(t(Ye),{modelValue:u.value,"onUpdate:modelValue":_[1]||(_[1]=y=>u.value=y),items:c.value,"persist-key":"groupViewTab"},{right:A(()=>[u.value!=="topic"?(i(),N(Ct,{key:0,modelValue:d.value,"onUpdate:modelValue":_[0]||(_[0]=y=>d.value=y),"session-id":o.sessionId},null,8,["modelValue","session-id"])):B("",!0)]),_:1},8,["modelValue","items"]),a("div",mr,[$(De,{name:"fade",mode:"out-in"},{default:A(()=>[u.value==="type-analysis"?(i(),N(St,{key:0,"session-id":o.sessionId,"session-name":o.sessionName,"time-filter":m.value},null,8,["session-id","session-name","time-filter"])):u.value==="time-analysis"?(i(),N(Mt,{key:1,"session-id":o.sessionId,"session-name":o.sessionName,"time-filter":m.value},null,8,["session-id","session-name","time-filter"])):u.value==="topic"?(i(),N(t(Tt),{key:2,"session-id":o.sessionId,"time-filter":o.timeFilter},null,8,["session-id","time-filter"])):u.value==="group-relationships"?(i(),N(dr,{key:3,"session-id":o.sessionId,"time-filter":m.value},null,8,["session-id","time-filter"])):u.value==="ranking"?(i(),N(Ya,{key:4,"session-id":o.sessionId,"time-filter":m.value},null,8,["session-id","time-filter"])):u.value==="hot-repeat"?(i(),N(t(Gs),{key:5,"session-id":o.sessionId,"time-filter":o.timeFilter},null,8,["session-id","time-filter"])):u.value==="catchphrase"?(i(),N(t(Ns),{key:6,"session-id":o.sessionId,"time-filter":o.timeFilter},null,8,["session-id","time-filter"])):B("",!0)]),_:1})])]))}}),pr=Ne(gr,[["__scopeId","data-v-abeebf4d"]]),hr={key:0,class:"mb-6"},vr={class:"flex items-center gap-3"},fr={class:"text-xl font-bold text-gray-900 dark:text-white"},yr={class:"text-sm text-gray-500 dark:text-gray-400"},xr={class:"mb-4 flex flex-wrap items-center justify-between gap-3"},br={class:"flex items-center gap-2"},_r={class:"text-xs text-gray-500 dark:text-gray-400"},kr={key:0,class:"flex h-60 items-center justify-center"},wr={key:1,class:"flex h-60 flex-col items-center justify-center"},$r={class:"text-gray-500 dark:text-gray-400"},Ir={key:2,class:"flex min-h-0 flex-1 flex-col"},Cr={class:"w-full"},Sr={class:"sticky top-0 bg-gray-50 dark:bg-gray-800"},Mr={class:"text-left text-xs font-medium uppercase text-gray-500 dark:text-gray-400"},Tr={class:"px-4 py-4"},Dr={class:"px-4 py-4"},Rr={class:"px-4 py-4"},Nr={class:"w-64 px-4 py-4"},Lr={class:"inline-flex items-center gap-1.5"},Vr={class:"px-4 py-4 text-right"},Ar={class:"divide-y divide-gray-200 dark:divide-gray-700"},Er={class:"px-4 py-4"},Or={class:"px-4 py-4"},zr={class:"flex items-center gap-2"},Fr=["src","alt"],Br={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"},Ur={class:"text-sm font-medium text-gray-900 dark:text-white"},Hr={class:"ml-1 text-sm text-gray-500 dark:text-gray-400"},Wr={class:"px-4 py-4"},jr={key:0,class:"text-sm font-medium text-gray-900 dark:text-white"},Pr={key:1,class:"text-sm text-gray-400 dark:text-gray-500"},qr={class:"px-4 py-4"},Yr={class:"text-sm font-semibold text-gray-900 dark:text-white"},Gr={class:"px-4 py-4"},Jr={class:"max-w-xs"},Qr={key:0,class:"absolute right-2 top-1/2 -translate-y-1/2"},Kr={class:"px-4 py-4 text-right"},Xr={key:0,class:"flex items-center justify-between border-t border-gray-200 px-6 py-4 dark:border-gray-700"},Zr={class:"text-sm text-gray-500 dark:text-gray-400"},ei={class:"flex items-center gap-2"},ti={class:"text-sm font-medium text-gray-600 dark:text-gray-300"},si={class:"p-6 text-center"},ai={class:"mx-auto mb-4 flex h-14 w-14 items-center justify-center rounded-full bg-red-100 dark:bg-red-900/30"},ni={class:"mb-2 text-lg font-semibold text-gray-900 dark:text-white"},oi={class:"mb-6 text-sm text-gray-500 dark:text-gray-400"},ri={class:"flex justify-center gap-3"},ii={class:"p-6"},li={class:"mb-4 flex items-center gap-3"},ci={class:"flex h-10 w-10 items-center justify-center rounded-full bg-amber-100 dark:bg-amber-900/30"},di={class:"text-lg font-semibold text-gray-900 dark:text-white"},ui={class:"mb-2 text-sm text-gray-600 dark:text-gray-400"},mi={class:"mb-6 text-xs text-amber-700 dark:text-amber-300"},gi={class:"flex justify-end gap-2"},Ce=20,pi=P({__name:"MemberList",props:{sessionId:{},showHeader:{type:Boolean,default:!0}},emits:["data-changed"],setup(l,{emit:s}){const{t:e}=ae(),o=l,c=s,u=L([]),d=L([]),m=L(!1),p=L(""),_=L(null),y=L(!1),g=L(new Set),n=L(!1),r=L(!1),h=L(1),f=L(0),b=L(0),k=L("desc"),I=L(null);let v=null;function w(z){return z.groupNickname||z.accountName||z.platformId}function C(z){return w(z).slice(0,1)}const M=D(()=>d.value.filter(z=>g.value.has(z.id))),T=D(()=>M.value.length===2),V=D(()=>{if(M.value.length!==2)return null;const[z,O]=M.value;return O.messageCount>z.messageCount||O.messageCount===z.messageCount&&O.id<z.id?{primary:O,secondary:z}:{primary:z,secondary:O}});function H(){k.value=k.value==="desc"?"asc":"desc",h.value=1,U()}async function U(){if(o.sessionId){m.value=!0;try{const z=await Y().getMembersPaginated(o.sessionId,{page:h.value,pageSize:Ce,search:p.value.trim(),sortOrder:k.value});u.value=z.items,f.value=z.total,b.value=z.totalPages}catch(z){console.error("加载成员列表失败:",z)}finally{m.value=!1}}}async function R(){if(o.sessionId)try{d.value=await Y().getMembers(o.sessionId)}catch(z){console.error("加载所有成员失败:",z)}}async function F(z,O){const te=JSON.parse(JSON.stringify(O)),ve=JSON.stringify(z.aliases),j=JSON.stringify(te);if(ve!==j){I.value=z.id;try{if(await Y().updateMemberAliases(o.sessionId,z.id,te)){const fe=u.value.findIndex(we=>we.id===z.id);fe!==-1&&(u.value[fe]={...u.value[fe],aliases:te})}}catch(_e){console.error("保存别名失败:",_e)}finally{I.value=null}}}function E(z){_.value=z}function W(){_.value=null}async function X(){if(_.value){y.value=!0;try{await Y().deleteMember(o.sessionId,_.value.id)&&(await U(),await R(),c("data-changed"))}catch(z){console.error("删除成员失败:",z)}finally{y.value=!1,_.value=null}}}function ee(z){const O=new Set(g.value);O.has(z)?O.delete(z):O.add(z),g.value=O}function ie(){T.value&&(n.value=!0)}function re(){g.value=new Set}async function de(){if(V.value){r.value=!0;try{await Y().mergeMembers(o.sessionId,V.value.primary.id,V.value.secondary.id)&&(n.value=!1,re(),await U(),await R(),c("data-changed"))}catch(z){console.error("合并成员失败:",z)}finally{r.value=!1}}}return G(p,()=>{h.value=1,v&&clearTimeout(v),v=setTimeout(()=>{U()},300)}),G(h,()=>{U()}),G(()=>o.sessionId,()=>{p.value="",h.value=1,re(),U(),R()},{immediate:!0}),be(()=>{U(),R()}),(z,O)=>{const te=me,ve=Ue,j=Me,_e=ot,fe=rt,we=it,Le=xe;return i(),S("div",{class:Z(["main-content",o.showHeader?"max-w-5xl p-6":"flex h-full max-w-none flex-col overflow-hidden p-4"])},[o.showHeader?(i(),S("div",hr,[a("div",vr,[a("div",null,[a("h2",fr,x(t(e)("members.list.title")),1),a("p",yr,x(t(e)("members.list.description",{count:f.value})),1)])])])):B("",!0),$(Dt,{class:"mb-6","session-id":l.sessionId,members:d.value,"is-loading":m.value,"chat-type":"group"},null,8,["session-id","members","is-loading"]),a("div",xr,[$(ve,{modelValue:p.value,"onUpdate:modelValue":O[1]||(O[1]=J=>p.value=J),placeholder:t(e)("members.list.searchPlaceholder"),icon:"i-heroicons-magnifying-glass",class:"w-full md:w-100"},Pe({_:2},[p.value?{name:"trailing",fn:A(()=>[$(te,{icon:"i-heroicons-x-mark",variant:"link",color:"neutral",size:"xs",onClick:O[0]||(O[0]=J=>p.value="")})]),key:"0"}:void 0]),1032,["modelValue","placeholder"]),a("div",br,[a("span",_r,x(t(e)("members.list.mergeSelectedCount",{count:g.value.size})),1),$(te,{icon:"i-heroicons-link",size:"sm",color:"primary",disabled:!T.value,onClick:ie},{default:A(()=>[K(x(t(e)("members.list.mergeSelected")),1)]),_:1},8,["disabled"])])]),a("div",{class:Z(["rounded-xl border border-gray-200 bg-white shadow-sm dark:border-gray-700 dark:bg-gray-900",o.showHeader?"":"flex min-h-0 flex-1 flex-col"])},[m.value?(i(),S("div",kr,[$(j,{name:"i-heroicons-arrow-path",class:"h-8 w-8 animate-spin text-pink-500"})])):u.value.length===0?(i(),S("div",wr,[$(j,{name:"i-heroicons-user-group",class:"mb-3 h-12 w-12 text-gray-300 dark:text-gray-600"}),a("p",$r,x(p.value?t(e)("members.list.noMatch"):t(e)("members.list.empty")),1)])):(i(),S("div",Ir,[a("div",{class:Z(["max-h-[500px] overflow-y-auto",o.showHeader?"":"max-h-none min-h-0 flex-1"])},[a("table",Cr,[a("thead",Sr,[a("tr",Mr,[O[7]||(O[7]=a("th",{class:"w-12 px-4 py-4"},null,-1)),a("th",Tr,x(t(e)("members.list.table.accountName")),1),a("th",Dr,x(t(e)("members.list.table.groupNickname")),1),a("th",Rr,[a("button",{class:"flex items-center gap-1.5 hover:text-gray-700 dark:hover:text-gray-200",onClick:H},[K(x(t(e)("members.list.table.messageCount"))+" ",1),$(j,{name:k.value==="desc"?"i-heroicons-arrow-down":"i-heroicons-arrow-up",class:"h-3.5 w-3.5"},null,8,["name"])])]),a("th",Nr,[a("div",Lr,[a("span",null,x(t(e)("members.list.table.customAlias")),1),$(_e,{text:t(e)("members.list.tip"),popper:{placement:"top"}},{default:A(()=>[$(j,{name:"i-heroicons-question-mark-circle",class:"h-4 w-4 text-gray-400 dark:text-gray-500"})]),_:1},8,["text"])])]),a("th",Vr,x(t(e)("members.list.table.actions")),1)])]),a("tbody",Ar,[(i(!0),S(q,null,se(u.value,J=>(i(),S("tr",{key:J.id,class:"hover:bg-gray-50 dark:hover:bg-gray-800/50"},[a("td",Er,[$(fe,{"model-value":g.value.has(J.id),onClick:je($e=>ee(J.id),["stop"])},null,8,["model-value","onClick"])]),a("td",Or,[a("div",zr,[J.avatar?(i(),S("img",{key:0,src:J.avatar,alt:w(J),class:"h-8 w-8 shrink-0 rounded-full object-cover"},null,8,Fr)):(i(),S("div",Br,x(C(J)),1)),a("div",null,[a("span",Ur,x(J.accountName||"-"),1),a("span",Hr,"("+x(J.platformId)+")",1)])])]),a("td",Wr,[J.groupNickname?(i(),S("span",jr,x(J.groupNickname),1)):(i(),S("span",Pr,"-"))]),a("td",qr,[a("span",Yr,x(J.messageCount.toLocaleString()),1)]),a("td",Gr,[a("div",Jr,[$(we,{"model-value":J.aliases,placeholder:t(e)("members.list.aliasPlaceholder"),class:"w-80","onUpdate:modelValue":$e=>F(J,$e)},null,8,["model-value","placeholder","onUpdate:modelValue"]),I.value===J.id?(i(),S("div",Qr,[$(j,{name:"i-heroicons-arrow-path",class:"h-4 w-4 animate-spin text-pink-500"})])):B("",!0)])]),a("td",Kr,[$(te,{label:t(e)("members.list.delete"),size:"xs",onClick:$e=>E(J)},null,8,["label","onClick"])])]))),128))])])],2),b.value>1?(i(),S("div",Xr,[a("p",Zr,x(t(e)("members.list.pagination",{start:(h.value-1)*Ce+1,end:Math.min(h.value*Ce,f.value),total:f.value})),1),a("div",ei,[$(te,{icon:"i-heroicons-chevron-left",variant:"outline",size:"sm",disabled:h.value===1||m.value,onClick:O[2]||(O[2]=J=>h.value--)},null,8,["disabled"]),a("span",ti,x(h.value)+" / "+x(b.value),1),$(te,{icon:"i-heroicons-chevron-right",variant:"outline",size:"sm",disabled:h.value>=b.value||m.value,onClick:O[3]||(O[3]=J=>h.value++)},null,8,["disabled"])])])):B("",!0)]))],2),$(Le,{open:!!_.value,ui:{content:"max-w-sm"},"onUpdate:open":O[4]||(O[4]=J=>_.value=null)},{content:A(()=>[a("div",si,[a("div",ai,[$(j,{name:"i-heroicons-exclamation-triangle",class:"h-7 w-7 text-red-500"})]),a("h3",ni,x(t(e)("members.list.modal.title")),1),a("p",oi,x(t(e)("members.list.modal.content",{name:_.value?w(_.value):"",count:_.value?.messageCount.toLocaleString()})),1),a("div",ri,[$(te,{variant:"outline",onClick:W},{default:A(()=>[K(x(t(e)("members.list.modal.cancel")),1)]),_:1}),$(te,{color:"error",loading:y.value,onClick:X},{default:A(()=>[K(x(t(e)("members.list.modal.confirm")),1)]),_:1},8,["loading"])])])]),_:1},8,["open"]),$(Le,{open:n.value,ui:{content:"max-w-md"},"onUpdate:open":O[6]||(O[6]=J=>n.value=J)},{content:A(()=>[a("div",ii,[a("div",li,[a("div",ci,[$(j,{name:"i-heroicons-link",class:"h-5 w-5 text-amber-600 dark:text-amber-400"})]),a("h3",di,x(t(e)("members.list.mergeModal.title")),1)]),a("p",ui,x(t(e)("members.list.mergeModal.content",{source:V.value?w(V.value.secondary):"",sourceCount:V.value?V.value.secondary.messageCount.toLocaleString():"0",target:V.value?w(V.value.primary):"",targetCount:V.value?V.value.primary.messageCount.toLocaleString():"0"})),1),a("p",mi,x(t(e)("members.list.mergeModal.hint")),1),a("div",gi,[$(te,{variant:"outline",disabled:r.value,onClick:O[5]||(O[5]=J=>n.value=!1)},{default:A(()=>[K(x(t(e)("members.list.mergeModal.cancel")),1)]),_:1},8,["disabled"]),$(te,{color:"primary",loading:r.value,onClick:de},{default:A(()=>[K(x(t(e)("members.list.mergeModal.confirm")),1)]),_:1},8,["loading"])])])]),_:1},8,["open"])],2)}}}),hi={class:"main-content max-w-5xl p-6"},vi={class:"mb-4 text-sm text-gray-500 dark:text-gray-400 no-capture"},fi={key:0,class:"divide-y divide-gray-100 dark:divide-gray-800"},yi={class:"w-32 shrink-0 pt-0.5 font-medium text-gray-900 dark:text-white"},xi={class:"flex flex-1 flex-wrap items-center gap-2"},bi={class:"flex items-center gap-1.5 rounded-lg bg-gray-50 px-3 py-1.5 dark:bg-gray-800"},_i={class:"text-xs text-gray-400"},ki={key:0,class:"text-gray-300 dark:text-gray-600"},wi=P({__name:"NicknameHistory",props:{sessionId:{}},setup(l){const{t:s}=ae(),e=l,o=L([]),c=L([]),u=L(!1);function d(_){return _.groupNickname||_.accountName||_.platformId}async function m(){if(e.sessionId)try{o.value=await Y().getMembers(e.sessionId)}catch(_){console.error("加载成员列表失败:",_)}}async function p(){if(!e.sessionId||o.value.length===0)return;u.value=!0;const _=[];try{const y=o.value.map(n=>Y().getMemberNameHistory(e.sessionId,n.id)),g=await Promise.all(y);o.value.forEach((n,r)=>{const h=g[r];h.length>2&&_.push({memberId:n.id,name:d(n),history:h})}),c.value=_}catch(y){console.error("加载昵称变更记录失败:",y)}finally{u.value=!1}}return G(()=>e.sessionId,async()=>{await m()},{immediate:!0}),G(()=>o.value.length,()=>{o.value.length>0&&p()}),be(async()=>{o.value.length===0&&await m()}),(_,y)=>{const g=Be;return i(),S("div",hi,[a("p",vi,x(t(s)("members.nicknameHistory.note")),1),$(t(Q),{title:t(s)("members.nicknameHistory.title"),description:u.value?t(s)("members.nicknameHistory.loading"):c.value.length>0?t(s)("members.nicknameHistory.hasChanges",{count:c.value.length}):t(s)("members.nicknameHistory.noChanges")},{default:A(()=>[!u.value&&c.value.length>0?(i(),S("div",fi,[(i(!0),S(q,null,se(c.value,n=>(i(),S("div",{key:n.memberId,class:"flex items-start gap-3 px-5 py-3"},[a("div",yi,x(n.name),1),a("div",xi,[(i(!0),S(q,null,se(n.history,(r,h)=>(i(),S(q,{key:h},[a("div",bi,[a("span",{class:Z(["text-sm",r.endTs===null?"font-semibold text-pink-600":"text-gray-700 dark:text-gray-300"])},x(r.name),3),r.endTs===null?(i(),N(g,{key:0,color:"primary",variant:"soft",size:"xs"},{default:A(()=>[K(x(t(s)("members.nicknameHistory.current")),1)]),_:1})):B("",!0),a("span",_i,"("+x(t(Rt)(r.startTs,r.endTs))+")",1)]),h<n.history.length-1?(i(),S("span",ki,"→")):B("",!0)],64))),128))])]))),128))])):u.value?(i(),N(t(oe),{key:2,text:t(s)("members.nicknameHistory.loadingText")},null,8,["text"])):(i(),N(t(le),{key:1,text:t(s)("members.nicknameHistory.empty")},null,8,["text"]))]),_:1},8,["title","description"])])}}}),$i={class:"flex h-full flex-col overflow-hidden bg-white dark:bg-gray-900"},Ii={class:"flex flex-none items-center justify-between border-b border-gray-200 px-5 py-3 dark:border-gray-700"},Ci={class:"text-lg font-semibold text-gray-900 dark:text-white"},Si={class:"flex-1 overflow-auto"},Mi=P({__name:"NicknameHistoryEntry",props:{sessionId:{}},setup(l){const{t:s}=ae(),e=l,o=L(!1);return(c,u)=>{const d=me,m=xe;return i(),S(q,null,[$(d,{variant:"ghost",icon:"i-heroicons-clock",size:"sm",onClick:u[0]||(u[0]=p=>o.value=!0)},{default:A(()=>[K(x(t(s)("analysis.subTabs.member.nicknameHistory")),1)]),_:1}),e.sessionId?(i(),N(m,{key:0,open:o.value,"onUpdate:open":u[2]||(u[2]=p=>o.value=p),ui:{content:"max-w-6xl h-[85vh]"}},{content:A(()=>[a("div",$i,[a("div",Ii,[a("h2",Ci,x(t(s)("analysis.subTabs.member.nicknameHistory")),1),$(d,{variant:"ghost",icon:"i-heroicons-x-mark",size:"sm",onClick:u[1]||(u[1]=p=>o.value=!1)})]),a("div",Si,[$(wi,{"session-id":e.sessionId},null,8,["session-id"])])])]),_:1},8,["open"])):B("",!0)],64)}}}),Ti={class:"flex h-full flex-col bg-white dark:bg-gray-900",style:{"padding-top":"var(--titlebar-area-height)"}},Di={class:"relative flex-1 overflow-y-auto"},Ri={class:"h-full"},Ni={key:2,class:"flex h-full items-center justify-center"},Li={class:"text-gray-500"},Vi={class:"flex h-full flex-col overflow-hidden bg-white dark:bg-gray-900"},Ai={class:"flex flex-none items-center justify-between border-b border-gray-200 px-5 py-3 dark:border-gray-700"},Ei={class:"text-lg font-semibold text-gray-900 dark:text-white"},Oi={class:"text-sm text-gray-500 dark:text-gray-400"},zi={class:"flex items-center gap-2"},Fi={class:"flex-1 overflow-hidden"},Bi=P({__name:"index",setup(l){const s=We(()=>Fe(()=>import("./MessageExportModal-B8DKeSAH.js"),__vite__mapDeps([5,6,4,7,8,9]))),{t:e}=ae(),o=lt(),c=ct(),u=ht(),d=Re(),m=vt(),{currentSessionId:p}=ft(u),_=L(!1),y=L(!1),g=L(!1),n=L(!1);function r(){d.openChatRecordDrawer({})}const h=[{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"}],f=D(()=>m.debugMode?[...h,{id:"debug",labelKey:"analysis.tabs.debug",icon:"i-heroicons-bug-ant"}]:h),b=D(()=>f.value.map(z=>z.id)),{activeTab:k,isLoading:I,isInitialLoad:v,session:w,memberActivity:C,hourlyActivity:M,dailyActivity:T,messageTypes:V,timeRangeValue:H,fullTimeRange:U,availableYears:R,timeFilter:F,selectedYearForOverview:E,initialTimeState:W,loadData:X}=Nt({route:o,router:c,currentSessionId:p,selectSession:u.selectSession,defaultTab:m.defaultSessionTab,validTabIds:b.value}),ee=D(()=>C.value.slice(0,3)),ie=D(()=>C.value.length<=1?[]:[...C.value].sort((z,O)=>z.messageCount-O.messageCount).slice(0,1)),re=D(()=>C.value.reduce((z,O)=>z+O.messageCount,0)),de=D(()=>C.value.filter(z=>z.messageCount>0).length);return(z,O)=>{const te=me,ve=xe;return i(),S("div",Ti,[t(v)?(i(),N(oe,{key:0,variant:"page",text:t(e)("analysis.groupChat.loading")},null,8,["text"])):t(w)?(i(),S(q,{key:1},[$(Lt,{"active-tab":t(k),"onUpdate:activeTab":O[0]||(O[0]=j=>Ve(k)?k.value=j:null),"time-range-value":t(H),"onUpdate:timeRangeValue":O[1]||(O[1]=j=>Ve(H)?H.value=j:null),title:t(w).name,avatar:t(w).groupAvatar,icon:"i-heroicons-chat-bubble-left-right","icon-class":"bg-primary-600 text-white dark:bg-primary-500 dark:text-white",tabs:f.value,"current-session-id":t(p),"initial-time-state":t(W),onOpenIncrementalImport:O[2]||(O[2]=j=>y.value=!0),onOpenMemberManagement:O[3]||(O[3]=j=>n.value=!0),onOpenChatRecord:r,"onUpdate:fullRange":O[4]||(O[4]=j=>U.value=j),"onUpdate:availableYears":O[5]||(O[5]=j=>R.value=j)},null,8,["active-tab","time-range-value","title","avatar","tabs","current-session-id","initial-time-state"]),a("div",Di,[t(I)?(i(),N(oe,{key:0,variant:"overlay"})):B("",!0),a("div",Ri,[$(De,{name:"tab-slide",mode:"out-in"},{default:A(()=>[t(k)==="overview"?(i(),N(Zs,{key:"overview-"+t(p),session:t(w),"member-activity":t(C),"top-members":ee.value,"bottom-members":ie.value,"message-types":t(V),"hourly-activity":t(M),"daily-activity":t(T),"time-range":t(U),"selected-year":t(E),"filtered-message-count":re.value,"filtered-member-count":de.value,"time-filter":t(F)},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"])):t(k)==="view"?(i(),N(pr,{key:"view-"+t(p),"session-id":t(p),"session-name":t(w).name,"time-filter":t(F)},null,8,["session-id","session-name","time-filter"])):t(k)==="ai-chat"?(i(),N(t(Ot),{key:"ai-chat-"+t(p),"session-id":t(p),"session-name":t(w).name,"chat-type":"group"},null,8,["session-id","session-name"])):t(k)==="memory"?(i(),N(zt,{key:"memory-"+t(p),"session-id":t(p),"session-name":t(w).name},null,8,["session-id","session-name"])):t(k)==="lab"?(i(),N(Ft,{key:"lab-"+t(p),"session-id":t(p),"session-name":t(w).name,"time-filter":t(F),"chat-type":"group",mode:"sql-only"},null,8,["session-id","session-name","time-filter"])):t(k)==="debug"?(i(),N(t(Bt),{key:"debug-"+t(p),"session-id":t(p)},null,8,["session-id"])):B("",!0)]),_:1})])]),$(Vt,{onOpenIncrementalImport:O[6]||(O[6]=j=>y.value=!0),onOpenSessionIndex:O[7]||(O[7]=j=>_.value=!0),onOpenMemberManagement:O[8]||(O[8]=j=>n.value=!0),onOpenChatRecord:r,onOpenMessageExport:O[9]||(O[9]=j=>g.value=!0)}),t(m).debugMode?(i(),N(Ut,{key:0})):B("",!0)],64)):(i(),S("div",Ni,[a("p",Li,x(t(e)("analysis.groupChat.loadError")),1)])),t(p)&&t(w)&&t(w).messageCount>0?(i(),N(At,{key:3,modelValue:_.value,"onUpdate:modelValue":O[10]||(O[10]=j=>_.value=j),"session-id":t(p),"message-count":t(w).messageCount},null,8,["modelValue","session-id","message-count"])):B("",!0),t(p)&&t(w)?(i(),N(Et,{key:4,modelValue:y.value,"onUpdate:modelValue":O[11]||(O[11]=j=>y.value=j),"session-id":t(p),"session-name":t(w).name,onImported:O[12]||(O[12]=()=>{t(X)(),t(u).loadSessions()})},null,8,["modelValue","session-id","session-name"])):B("",!0),t(p)?(i(),N(t(s),{key:5,modelValue:g.value,"onUpdate:modelValue":O[13]||(O[13]=j=>g.value=j)},null,8,["modelValue"])):B("",!0),t(p)?(i(),N(ve,{key:6,open:n.value,"onUpdate:open":O[15]||(O[15]=j=>n.value=j),ui:{content:"max-w-6xl h-[85vh]"}},{content:A(()=>[a("div",Vi,[a("div",Ai,[a("div",null,[a("h2",Ei,x(t(e)("analysis.tooltip.memberManagement")),1),a("p",Oi,x(t(e)("members.list.description",{count:t(w)?.memberCount??0})),1)]),a("div",zi,[$(Mi,{"session-id":t(p)},null,8,["session-id"]),$(te,{variant:"ghost",icon:"i-heroicons-x-mark",size:"sm",onClick:O[14]||(O[14]=j=>n.value=!1)})])]),a("div",Fi,[$(pi,{"session-id":t(p),"show-header":!1,onDataChanged:t(X)},null,8,["session-id","onDataChanged"])])])]),_:1},8,["open"])):B("",!0)])}}}),Qi=Ne(Bi,[["__scopeId","data-v-83343020"]]);export{Qi as default};
|