chatlab-cli 0.36.2 → 0.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (201) hide show
  1. package/dist/{chat-command-SEV6N3AR.mjs → chat-command-WBAJBKIE.mjs} +15 -16
  2. package/dist/{chat-command-SEV6N3AR.mjs.map → chat-command-WBAJBKIE.mjs.map} +1 -1
  3. package/dist/chunk-2TV7M4CC.mjs +101 -0
  4. package/dist/chunk-2TV7M4CC.mjs.map +1 -0
  5. package/dist/{chunk-TRGR3KKJ.mjs → chunk-4J4MA3RC.mjs} +2605 -672
  6. package/dist/chunk-4J4MA3RC.mjs.map +1 -0
  7. package/dist/{chunk-TJ3NOBVI.mjs → chunk-5YOHLJFB.mjs} +98 -284
  8. package/dist/chunk-5YOHLJFB.mjs.map +1 -0
  9. package/dist/{chunk-WRBFV2GX.mjs → chunk-CR2MU7LN.mjs} +49 -55
  10. package/dist/chunk-CR2MU7LN.mjs.map +1 -0
  11. package/dist/{chunk-WJQOXOMR.mjs → chunk-DKIYHA3O.mjs} +281 -30
  12. package/dist/chunk-DKIYHA3O.mjs.map +1 -0
  13. package/dist/{chunk-VREVDZ4Q.mjs → chunk-DQR2YS3I.mjs} +1930 -33
  14. package/dist/chunk-DQR2YS3I.mjs.map +1 -0
  15. package/dist/{chunk-VUYWUHWW.mjs → chunk-EJBBVLUN.mjs} +3 -3
  16. package/dist/chunk-EJBBVLUN.mjs.map +1 -0
  17. package/dist/{chunk-HWIXK7SU.mjs → chunk-FM3GXNEO.mjs} +1643 -3
  18. package/dist/chunk-FM3GXNEO.mjs.map +1 -0
  19. package/dist/{chunk-YUH3H3QW.mjs → chunk-MSMDLDPB.mjs} +96 -5
  20. package/dist/chunk-MSMDLDPB.mjs.map +1 -0
  21. package/dist/{chunk-6EZPD3XJ.mjs → chunk-N2WGG3MS.mjs} +2 -2
  22. package/dist/{chunk-TWH422HC.mjs → chunk-RXMSZIYD.mjs} +3 -3
  23. package/dist/{chunk-CH5YAZ4Q.mjs → chunk-SQWN4GTQ.mjs} +2 -2
  24. package/dist/cli.mjs +9 -9
  25. package/dist/contacts-worker.mjs +2 -2
  26. package/dist/global-insight-worker.mjs +1 -1
  27. package/dist/{http-237XYNRT.mjs → http-X6OEOOSH.mjs} +12 -12
  28. package/dist/{import-R2E2TFAK.mjs → import-WBJ6YIQ7.mjs} +7 -7
  29. package/dist/index.mjs +12 -12
  30. package/dist/{mcp-BED4AARV.mjs → mcp-FR6OKWKL.mjs} +8 -8
  31. package/dist/people-relationships-worker.mjs +2 -2
  32. package/dist/semantic-index-worker.mjs +1 -1
  33. package/dist/{src-AYMALWU5.mjs → src-WE5HNN2O.mjs} +44 -14
  34. package/dist/{stream-import-RXNSOOYH.mjs → stream-import-YYQVZDGQ.mjs} +7 -7
  35. package/dist/{worker-runtime-JGAZU7MC.mjs → worker-runtime-YGB5ZDE4.mjs} +5 -5
  36. package/dist-cli-web/assets/AISettingsTab-Co2sM1iY.js +1 -0
  37. package/dist-cli-web/assets/{AboutTab-DCM1-glA.js → AboutTab-DQ8r6mYE.js} +1 -1
  38. package/dist-cli-web/assets/ActionToolsPanel-CmYpw8Mt.css +1 -0
  39. package/dist-cli-web/assets/ActionToolsPanel.vue_vue_type_script_setup_true_lang--RPlmfIu.js +75 -0
  40. package/dist-cli-web/assets/{Alert-D-egBWcb.js → Alert-DU1tLAAg.js} +1 -1
  41. package/dist-cli-web/assets/ApiSettingsTab-D5g5b79L.js +2 -0
  42. package/dist-cli-web/assets/BatchManageTab-BFUyVaGU.js +1 -0
  43. package/dist-cli-web/assets/{BufferResource-BE2_2bZK.js → BufferResource-C-RfYwQW.js} +1 -1
  44. package/dist-cli-web/assets/{CanvasRenderer-DDKdvEYQ.js → CanvasRenderer-Dz7JAMrR.js} +1 -1
  45. package/dist-cli-web/assets/CardDecoration-D28DI1G9.js +1 -0
  46. package/dist-cli-web/assets/ChatRecordDrawer-Cph819yY.js +1 -0
  47. package/dist-cli-web/assets/{ChatRecordWorkspace-DqUI4QiU.js → ChatRecordWorkspace-BAfERdPc.js} +1 -1
  48. package/dist-cli-web/assets/Checkbox-B8uqt13j.js +1 -0
  49. package/dist-cli-web/assets/DataDirCleanupNotice-3sGBE5vU.js +1 -0
  50. package/dist-cli-web/assets/{DatePicker.vue_vue_type_script_setup_true_lang-sPDoPzZ9.js → DatePicker.vue_vue_type_script_setup_true_lang-CQuub8-f.js} +1 -1
  51. package/dist-cli-web/assets/{DebugToolsPanel-BIHA6jw4.js → DebugToolsPanel-Cwkr0BOY.js} +1 -1
  52. package/dist-cli-web/assets/EChart.vue_vue_type_script_setup_true_lang-BuLujQCF.js +1 -0
  53. package/dist-cli-web/assets/EChartBar.vue_vue_type_script_setup_true_lang-DuA5xbcC.js +1 -0
  54. package/dist-cli-web/assets/EChartLine.vue_vue_type_script_setup_true_lang-CvmMEfYq.js +1 -0
  55. package/dist-cli-web/assets/EChartWordcloud-CHVtyPR7.js +1 -0
  56. package/dist-cli-web/assets/FileDropZone.vue_vue_type_script_setup_true_lang-BKPy9Qv-.js +1 -0
  57. package/dist-cli-web/assets/{Filter-kO4dIDJ2.js → Filter-CMfRHIoK.js} +1 -1
  58. package/dist-cli-web/assets/GlobalTaskBar-Jz6MASCu.js +1 -0
  59. package/dist-cli-web/assets/GlobalTaskBar-haLzezqY.css +1 -0
  60. package/dist-cli-web/assets/GroupRelationshipGalaxyView-Ch4obfEq.js +1 -0
  61. package/dist-cli-web/assets/Label-CuryuymO.js +1 -0
  62. package/dist-cli-web/assets/LoadingState.vue_vue_type_script_setup_true_lang-CoeQsaiL.js +1 -0
  63. package/dist-cli-web/assets/MessageExportModal-JqGZ-iLr.js +1 -0
  64. package/dist-cli-web/assets/PageHeader-CPLgiKT8.css +1 -0
  65. package/dist-cli-web/assets/PageHeader-D4up77TB.js +1 -0
  66. package/dist-cli-web/assets/{PageTabs.vue_vue_type_script_setup_true_lang-Cgungbjl.js → PageTabs.vue_vue_type_script_setup_true_lang-DYQRFk9s.js} +1 -1
  67. package/dist-cli-web/assets/{RelationshipGalaxyCanvas-Cod1JX9m.js → RelationshipGalaxyCanvas-Cn7Eta5U.js} +3 -3
  68. package/dist-cli-web/assets/{RelationshipGalaxyThreeCanvas-CkefzeFJ.js → RelationshipGalaxyThreeCanvas-LlaX57z6.js} +1 -1
  69. package/dist-cli-web/assets/{RenderTargetSystem-SuQ7cbze.js → RenderTargetSystem-JhA2PUFi.js} +1 -1
  70. package/dist-cli-web/assets/{RovingFocusItem-psoFYxrC.js → RovingFocusItem-DHaiTb4j.js} +1 -1
  71. package/dist-cli-web/assets/{ScreenCaptureModal-D4r9ixKh.js → ScreenCaptureModal-Bxhyt5g1.js} +1 -1
  72. package/dist-cli-web/assets/SectionTabs.vue_vue_type_script_setup_true_lang-BlAje3Tf.js +1 -0
  73. package/dist-cli-web/assets/Select-Beeqv0wU.js +1 -0
  74. package/dist-cli-web/assets/SettingsModal-DV8yDBJs.js +2 -0
  75. package/dist-cli-web/assets/{StorageTab-DhSJ-0Ir.js → StorageTab-B7GHadia.js} +1 -1
  76. package/dist-cli-web/assets/Switch-u4zlvUMa.js +1 -0
  77. package/dist-cli-web/assets/{Tabs-Bnm_Q7yW.js → Tabs-B7-Koq3x.js} +1 -1
  78. package/dist-cli-web/assets/Tabs-RWKHwtfM.js +1 -0
  79. package/dist-cli-web/assets/ThemeCard.vue_vue_type_script_setup_true_lang-ndsa3-aT.js +1 -0
  80. package/dist-cli-web/assets/{TimeSelect.vue_vue_type_script_setup_true_lang-Cjz8Wpg-.js → TimeSelect.vue_vue_type_script_setup_true_lang-DKa1flT-.js} +1 -1
  81. package/dist-cli-web/assets/{VisuallyHiddenInput-Bo_XwaLu.js → VisuallyHiddenInput-DGDqcvUy.js} +1 -1
  82. package/dist-cli-web/assets/{WebGLRenderer-D1x9WZRj.js → WebGLRenderer-ifvgA1fe.js} +1 -1
  83. package/dist-cli-web/assets/{WebGPURenderer-37Nw-tLm.js → WebGPURenderer-DwzmuWF0.js} +1 -1
  84. package/dist-cli-web/assets/aiChat-BY4C3UQe.js +8 -0
  85. package/dist-cli-web/assets/base-BWDX-164.js +1 -0
  86. package/dist-cli-web/assets/{browserAll-CWrz_-4U.js → browserAll-CSIIETeE.js} +1 -1
  87. package/dist-cli-web/assets/chatMessages--r0obAVw.css +1 -0
  88. package/dist-cli-web/assets/chatMessages-Zywjea1n.js +147 -0
  89. package/dist-cli-web/assets/cli-web-BRY49NWe.js +1 -0
  90. package/dist-cli-web/assets/{fetch-Du-wU0OO.js → fetch-Bf4cqeM3.js} +1 -1
  91. package/dist-cli-web/assets/{fetch-DPSWt6yX.js → fetch-BiXab0IF.js} +1 -1
  92. package/dist-cli-web/assets/{fetch-B69OkB6B.js → fetch-C8CcoTWY.js} +1 -1
  93. package/dist-cli-web/assets/{fetch-qd2FgBWQ.js → fetch-Co2vLmiE.js} +1 -1
  94. package/dist-cli-web/assets/{fetch-BGmCCyzz.js → fetch-D3nLtFBi.js} +1 -1
  95. package/dist-cli-web/assets/{fetch-CFpLXWTe.js → fetch-DNSDHSqQ.js} +1 -1
  96. package/dist-cli-web/assets/{fetch-DZ6OF-xW.js → fetch-DeHqF6yL.js} +1 -1
  97. package/dist-cli-web/assets/{fetch-CkXgOxcu.js → fetch-jx1VdM9j.js} +3 -3
  98. package/dist-cli-web/assets/{fetch-Gu4qQjUB.js → fetch-mYSeL4Ki.js} +1 -1
  99. package/dist-cli-web/assets/fetch-qBaUXqFt.js +1 -0
  100. package/dist-cli-web/assets/{fetch-6pcVxB9h.js → fetch-r6mhEGrP.js} +1 -1
  101. package/dist-cli-web/assets/{fetch-CgA1peJD.js → fetch-wzv71PYy.js} +1 -1
  102. package/dist-cli-web/assets/{host-CWsAWKgy.js → host-1emQf9_4.js} +1 -1
  103. package/dist-cli-web/assets/{host-D8zlA62K.js → host-jXJHyyOX.js} +1 -1
  104. package/dist-cli-web/assets/index-2dJCozDq.js +64 -0
  105. package/dist-cli-web/assets/index-6ejRbH3h.js +2 -0
  106. package/dist-cli-web/assets/index-B4mJkX_d.js +1 -0
  107. package/dist-cli-web/assets/index-B7biznha.js +1 -0
  108. package/dist-cli-web/assets/index-BOcFyPCa.js +1 -0
  109. package/dist-cli-web/assets/index-BQ463TS7.js +1 -0
  110. package/dist-cli-web/assets/index-BZpR015e.css +1 -0
  111. package/dist-cli-web/assets/index-BgelKQTW.css +1 -0
  112. package/dist-cli-web/assets/index-C1A1FwpO.css +1 -0
  113. package/dist-cli-web/assets/index-CIIyg_o9.css +1 -0
  114. package/dist-cli-web/assets/{index-a7CT8DQm.js → index-CYc_VLgK.js} +1 -1
  115. package/dist-cli-web/assets/index-ClHMs0-a.js +2 -0
  116. package/dist-cli-web/assets/{index-Dy0fRMDf.js → index-Cw0IhKZ6.js} +10 -10
  117. package/dist-cli-web/assets/{index-v6DlL4ue.js → index-DOqbUvhA.js} +1 -1
  118. package/dist-cli-web/assets/index-DnpnIyle.js +135 -0
  119. package/dist-cli-web/assets/index-LV9LfFNu.js +1 -0
  120. package/dist-cli-web/assets/index-kePiJ3ca.js +137 -0
  121. package/dist-cli-web/assets/index-slDUxib2.js +1 -0
  122. package/dist-cli-web/assets/{people-page-header-Czt9e1jv.js → people-page-header-Cx5r9Bk2.js} +1 -1
  123. package/dist-cli-web/assets/{prompt-DGazz143.js → prompt-BggEDxxi.js} +1 -1
  124. package/dist-cli-web/assets/{semantic-index-config-builder-BkFHzIUy.js → semantic-index-config-builder-1sO0aEc1.js} +1 -1
  125. package/dist-cli-web/assets/{service-CAp0YJoS.js → service-Bvq1fRkC.js} +1 -1
  126. package/dist-cli-web/assets/service-DkPheDt8.js +1 -0
  127. package/dist-cli-web/assets/service-DvI8O_7K.js +1 -0
  128. package/dist-cli-web/assets/useFormControl-B0aShtLp.js +1 -0
  129. package/dist-cli-web/assets/useTable-DC7oxmBl.js +1 -0
  130. package/dist-cli-web/assets/{useToast-YAHDkKDN.js → useToast-CCPBE-Sy.js} +1 -1
  131. package/dist-cli-web/assets/{vendor-echarts-hTLhTs52.js → vendor-echarts-C9ugTmum.js} +1 -1
  132. package/dist-cli-web/assets/{vendor-echarts-wordcloud-B8CF_NgP.js → vendor-echarts-wordcloud-DNiU8Psq.js} +1 -1
  133. package/dist-cli-web/assets/{webworkerAll-CvSp2Y8j.js → webworkerAll-FCJk6reG.js} +1 -1
  134. package/dist-cli-web/index.html +2 -2
  135. package/package.json +1 -1
  136. package/dist/chunk-6E46U4H2.mjs +0 -41
  137. package/dist/chunk-6E46U4H2.mjs.map +0 -1
  138. package/dist/chunk-HWIXK7SU.mjs.map +0 -1
  139. package/dist/chunk-TJ3NOBVI.mjs.map +0 -1
  140. package/dist/chunk-TRGR3KKJ.mjs.map +0 -1
  141. package/dist/chunk-VREVDZ4Q.mjs.map +0 -1
  142. package/dist/chunk-VUYWUHWW.mjs.map +0 -1
  143. package/dist/chunk-WJQOXOMR.mjs.map +0 -1
  144. package/dist/chunk-WRBFV2GX.mjs.map +0 -1
  145. package/dist/chunk-YUH3H3QW.mjs.map +0 -1
  146. package/dist-cli-web/assets/AISettingsTab-VgI7PiJd.js +0 -1
  147. package/dist-cli-web/assets/ActionToolsPanel-BTGgwXVD.css +0 -1
  148. package/dist-cli-web/assets/ActionToolsPanel.vue_vue_type_script_setup_true_lang-a7RMjjve.js +0 -112
  149. package/dist-cli-web/assets/ApiSettingsTab-Co3LWf1f.js +0 -2
  150. package/dist-cli-web/assets/BatchManageTab-2LrckmQm.js +0 -1
  151. package/dist-cli-web/assets/ChatRecordDrawer-DRhztqLG.js +0 -1
  152. package/dist-cli-web/assets/Checkbox-EfpQmv4A.js +0 -1
  153. package/dist-cli-web/assets/DataDirCleanupNotice-BYIiR58J.js +0 -1
  154. package/dist-cli-web/assets/EChart.vue_vue_type_script_setup_true_lang-DryMSoCz.js +0 -1
  155. package/dist-cli-web/assets/EChartBar.vue_vue_type_script_setup_true_lang-BdFW-hvt.js +0 -1
  156. package/dist-cli-web/assets/EChartLine.vue_vue_type_script_setup_true_lang-C69Kdw9X.js +0 -1
  157. package/dist-cli-web/assets/EChartWordcloud-DM7UEHdK.js +0 -1
  158. package/dist-cli-web/assets/GlobalTaskBar-BZS_h0zC.js +0 -1
  159. package/dist-cli-web/assets/GlobalTaskBar-COW_uBX6.css +0 -1
  160. package/dist-cli-web/assets/GroupRelationshipGalaxyView--WIaHx_F.js +0 -1
  161. package/dist-cli-web/assets/Label-CIuDXyeM.js +0 -1
  162. package/dist-cli-web/assets/LoadingState.vue_vue_type_script_setup_true_lang-B_7VHxTx.js +0 -1
  163. package/dist-cli-web/assets/MessageExportModal-BQsIpyxv.js +0 -1
  164. package/dist-cli-web/assets/PageHeader-DxhQHF_0.js +0 -1
  165. package/dist-cli-web/assets/PageHeader-XIXMTomn.css +0 -1
  166. package/dist-cli-web/assets/SectionTabs.vue_vue_type_script_setup_true_lang-v_7aRBgM.js +0 -1
  167. package/dist-cli-web/assets/Select-CxurgslB.js +0 -1
  168. package/dist-cli-web/assets/SettingsModal-DBZucuf6.js +0 -2
  169. package/dist-cli-web/assets/Switch-3D81G6uV.js +0 -1
  170. package/dist-cli-web/assets/Tabs-DB603EEu.js +0 -1
  171. package/dist-cli-web/assets/ThemeCard.vue_vue_type_script_setup_true_lang-BDTdkH5i.js +0 -1
  172. package/dist-cli-web/assets/aiChat-BCzYQeZq.js +0 -8
  173. package/dist-cli-web/assets/cli-web-C-8N0CJh.js +0 -1
  174. package/dist-cli-web/assets/fetch-z9M9FcIC.js +0 -1
  175. package/dist-cli-web/assets/index-BGd4ZfhO.js +0 -2
  176. package/dist-cli-web/assets/index-BYZF1ngN.js +0 -1
  177. package/dist-cli-web/assets/index-BcuwlCin.css +0 -1
  178. package/dist-cli-web/assets/index-BnaLj2dx.css +0 -1
  179. package/dist-cli-web/assets/index-Bq5q3kSU.js +0 -36
  180. package/dist-cli-web/assets/index-CPR3jdC2.js +0 -137
  181. package/dist-cli-web/assets/index-D3AjvaOX.js +0 -1
  182. package/dist-cli-web/assets/index-DAitScUA.js +0 -1
  183. package/dist-cli-web/assets/index-DBSMWAJ0.js +0 -1
  184. package/dist-cli-web/assets/index-DTn9htw-.js +0 -64
  185. package/dist-cli-web/assets/index-DV_rWxcH.js +0 -1
  186. package/dist-cli-web/assets/index-DxhAGqYM.css +0 -1
  187. package/dist-cli-web/assets/index-I0mIcDpE.css +0 -1
  188. package/dist-cli-web/assets/index-onwNShRw.js +0 -2
  189. package/dist-cli-web/assets/service-BMqwB74f.js +0 -1
  190. package/dist-cli-web/assets/service-CUQ8iHdS.js +0 -1
  191. package/dist-cli-web/assets/useFormControl-DcSMUc2d.js +0 -1
  192. package/dist-cli-web/assets/useTable-Clmq3sge.js +0 -1
  193. /package/dist/{chunk-6EZPD3XJ.mjs.map → chunk-N2WGG3MS.mjs.map} +0 -0
  194. /package/dist/{chunk-TWH422HC.mjs.map → chunk-RXMSZIYD.mjs.map} +0 -0
  195. /package/dist/{chunk-CH5YAZ4Q.mjs.map → chunk-SQWN4GTQ.mjs.map} +0 -0
  196. /package/dist/{http-237XYNRT.mjs.map → http-X6OEOOSH.mjs.map} +0 -0
  197. /package/dist/{import-R2E2TFAK.mjs.map → import-WBJ6YIQ7.mjs.map} +0 -0
  198. /package/dist/{mcp-BED4AARV.mjs.map → mcp-FR6OKWKL.mjs.map} +0 -0
  199. /package/dist/{src-AYMALWU5.mjs.map → src-WE5HNN2O.mjs.map} +0 -0
  200. /package/dist/{stream-import-RXNSOOYH.mjs.map → stream-import-YYQVZDGQ.mjs.map} +0 -0
  201. /package/dist/{worker-runtime-JGAZU7MC.mjs.map → worker-runtime-YGB5ZDE4.mjs.map} +0 -0
@@ -1 +0,0 @@
1
- import{a as ve,ah as ke,ai as _e,aj as fe,r as $,J as be,ak as we,Y as Se,h as u,i as e,e as r,z as g,p as s,l as v,a6 as P,w as S,c as H,F as k,f as p,a5 as Te,al as ze,o as d,j as T,a4 as De,n as z,am as q,an as h}from"./index-Bq5q3kSU.js";import{_ as Ce}from"./LoadingState.vue_vue_type_script_setup_true_lang-B_7VHxTx.js";import{_ as j}from"./ThemeCard.vue_vue_type_script_setup_true_lang-BDTdkH5i.js";import{C as Ie}from"./EChart.vue_vue_type_script_setup_true_lang-DryMSoCz.js";import{_ as Ee}from"./EChartLine.vue_vue_type_script_setup_true_lang-C69Kdw9X.js";import"./vendor-echarts-wordcloud-B8CF_NgP.js";import{T as Me}from"./service-CUQ8iHdS.js";import"./vendor-snapdom--nZvo8Sg.js";import"./vendor-echarts-hTLhTs52.js";import"./vendor-zrender-D8psf1AA.js";const Ae={class:"min-h-0 flex-1 overflow-y-auto"},Pe={class:"mx-auto w-full max-w-[920px] space-y-6 px-4 py-5 sm:px-6 sm:py-6"},Le={class:"min-w-0"},Oe={key:1,class:"flex items-center gap-2 rounded-xl border border-amber-100 bg-amber-50/50 px-4 py-2.5 text-xs text-amber-800 dark:border-amber-950/40 dark:bg-amber-950/20 dark:text-amber-300"},Ye={key:2,class:"flex flex-wrap items-center justify-between gap-3 rounded-xl border border-red-200 bg-red-50/50 px-4 py-2.5 text-xs text-red-800 dark:border-red-950/40 dark:bg-red-950/20 dark:text-red-300"},Ne={key:0,class:"flex flex-wrap items-center justify-between gap-3 rounded-xl border border-gray-200 bg-white p-4 text-xs text-gray-600 dark:border-zinc-800 dark:bg-zinc-900/50 dark:text-zinc-300"},Re={key:0},Ve={key:1},$e={key:2},je={class:"space-y-4"},Ue={class:"relative z-10 min-w-0 px-5 pt-6 pb-5 sm:px-8 sm:pt-8 sm:pb-6"},Be={class:"text-2xl font-bold tracking-tight text-gray-900 dark:text-white sm:text-3xl"},Fe={class:"mt-6 max-w-3xl space-y-3 text-gray-600 dark:text-zinc-300"},We={class:"flex flex-wrap items-baseline gap-x-2 gap-y-1 text-lg leading-relaxed sm:text-xl"},Ge={class:"font-black text-2xl tracking-tight tabular-nums text-pink-600 sm:text-3xl dark:text-pink-400"},He={class:"flex flex-wrap items-baseline gap-x-2 gap-y-1 text-base leading-relaxed sm:text-lg"},qe={class:"font-black text-2xl tabular-nums text-indigo-600 dark:text-indigo-400"},Je={class:"font-black text-2xl tabular-nums text-blue-600 dark:text-blue-400"},Ke={class:"mt-7"},Ze={class:"mb-2 text-[10px] font-bold uppercase tracking-widest text-gray-400 dark:text-zinc-500"},Qe={class:"grid grid-cols-2 gap-2 lg:grid-cols-4"},Xe={class:"min-w-0"},et={class:"mt-0.5 truncate text-[10px] font-medium text-gray-500 dark:text-zinc-400"},tt={class:"mt-0.5 truncate text-[9px] text-gray-400 dark:text-zinc-500"},st={class:"mt-6"},at={class:"text-xs font-bold tracking-wide text-gray-700 dark:text-zinc-300"},nt={class:"mt-1 text-[10px] text-gray-400 dark:text-zinc-500"},ot={class:"mt-2"},rt={class:"mt-2 text-[10px] leading-5 text-gray-400 dark:text-zinc-500"},it={class:"mt-4 flex flex-wrap items-center justify-between gap-x-6 gap-y-1 border-t border-gray-200/60 pt-4 font-mono text-[10px] text-gray-400 dark:border-white/5 dark:text-zinc-500"},lt={class:"min-w-0 p-5 sm:p-6"},ct={class:"flex items-center gap-2 text-xs font-bold uppercase tracking-wider text-gray-700 dark:text-zinc-300"},dt={class:"mt-1 text-[11px] text-gray-400 dark:text-zinc-500"},ut={class:"mt-5 grid gap-6 lg:grid-cols-7 lg:gap-0"},pt={class:"min-w-0 lg:col-span-4 lg:pr-8"},mt={key:0,class:"space-y-3.5"},xt={class:"text-xs font-medium text-gray-500 dark:text-zinc-400"},gt={class:"h-1.5 overflow-hidden rounded-full bg-gray-100 dark:bg-zinc-800"},ht={class:"min-w-[4.75rem] whitespace-nowrap text-right font-mono text-[10px] font-semibold tabular-nums text-gray-600 dark:text-zinc-300"},yt={key:1,class:"text-xs text-gray-400"},vt={class:"min-w-0 border-t border-gray-200/60 pt-5 lg:col-span-3 lg:border-t-0 lg:border-l lg:pt-0 lg:pl-8 dark:border-white/5"},kt={class:"text-xs font-semibold text-gray-700 dark:text-zinc-300"},_t={key:0,class:"mt-3 divide-y divide-gray-200/60 dark:divide-white/5"},ft={class:"flex h-5 w-5 items-center justify-center rounded-full bg-pink-50 font-mono text-[9px] font-bold text-pink-600 dark:bg-pink-950/30 dark:text-pink-400"},bt={class:"flex min-w-0 items-baseline gap-2"},wt={class:"font-mono text-xs font-semibold tabular-nums text-gray-700 dark:text-zinc-200"},St={class:"truncate text-[10px] text-gray-400 dark:text-zinc-500"},Tt={class:"whitespace-nowrap font-mono text-[10px] font-semibold tabular-nums text-gray-600 dark:text-zinc-300"},zt={key:1,class:"mt-3 text-xs text-gray-400"},Dt={class:"min-w-0 p-5 sm:p-6"},Ct={class:"flex flex-wrap items-end justify-between gap-x-6 gap-y-2"},It={class:"text-base font-semibold text-gray-800 dark:text-zinc-200"},Et={class:"mt-1 text-[11px] text-gray-400 dark:text-zinc-500"},Mt={key:0,class:"mt-5 grid gap-8 lg:grid-cols-2 lg:gap-0 lg:divide-x lg:divide-gray-200/60 dark:lg:divide-white/5"},At={class:"flex items-center justify-between gap-4 border-b border-gray-200/60 pb-3 dark:border-white/5"},Pt={class:"flex min-w-0 items-center gap-2"},Lt={class:"truncate text-sm font-semibold text-gray-700 dark:text-zinc-200"},Ot={class:"shrink-0 text-[10px] text-gray-400 dark:text-zinc-500"},Yt={key:0,class:"divide-y divide-gray-200/60 dark:divide-white/5"},Nt={class:"grid grid-cols-[28px_minmax(0,1fr)_auto] items-center gap-3"},Rt={class:"min-w-0"},Vt={class:"block truncate text-sm font-semibold text-gray-700 dark:text-zinc-200"},$t={class:"mt-1 block truncate text-[10px] text-gray-400 dark:text-zinc-500"},jt={class:"shrink-0 text-right"},Ut={class:"whitespace-nowrap font-mono text-xs font-black tabular-nums text-gray-900 dark:text-white"},Bt={class:"mt-1 font-mono text-[10px] tabular-nums text-gray-400 dark:text-zinc-500"},Ft={class:"mt-2 ml-10 h-1 overflow-hidden rounded-full bg-gray-100 dark:bg-zinc-800"},Wt={key:1,class:"pt-4 text-xs text-gray-400"},Gt={key:1,class:"mt-5 text-xs text-gray-400"},ns=ve({__name:"index",setup(Ht){const U=ke(),n=_e(ze),{formatDate:_,formatNumber:J}=fe(),f=U.insightScope,b=U.services.get(Me),K=new Date().getFullYear(),D=$(f.getSnapshot()),l=$(null),C=$("");let I=null,E=0;const L=p(()=>{const t=D.value.time;return t?t.mode==="recent"?{mode:"recent",days:365,acceptStale:!0}:{mode:"year",year:t.year??K,acceptStale:!0}:null}),Z=p(()=>JSON.stringify(L.value)),O=p(()=>(l.value?.coverage.missingOwnerSessions??0)+(l.value?.coverage.unresolvedOwnerSessions??0)),Y=p(()=>l.value?.metrics!==null&&l.value?.metrics!==void 0),Q=p(()=>l.value?.task.status==="running"),X=p(()=>Y.value&&l.value?.metrics?.estimatedSeconds===0),ee=p(()=>(l.value?.coverage.totalSessions??0)>0&&l.value?.coverage.analyzedSessions===0&&O.value>0),te=p(()=>D.value.time?.mode==="year"?D.value.time.year:void 0),M=p(()=>{const t=te.value,a=l.value?.latestDataYear;return t===void 0||a===null||a===void 0||t===a?null:{year:t,latestYear:a}}),se=p(()=>l.value?.range.mode==="year"?n("yearTitle",{year:l.value.range.year}):n("recentTitle")),ae=p(()=>{const t=l.value?.range;if(!t)return"";const a={day:"2-digit",month:"2-digit",year:"numeric"},i=_(t.startTs*1e3,a),c=_(t.endTs*1e3,a);return i===c?i:`${i} – ${c}`}),ne=p(()=>{const t=l.value?.range,a=l.value?.monthlyActivity??[];return{labels:a.map(i=>t?.mode==="year"?n("monthLabel",{month:Number(i.key.slice(5))}):i.key.replace("-","/")),values:a.map(i=>me(i.estimatedSeconds))}}),N=p(()=>{const t=l.value?.range;if(!t)return[];const a=Array(7).fill(0),i=Array(7).fill(0),c=new Map((l.value?.dailyActivity??[]).map(x=>[x.key,x.estimatedSeconds])),o=W(new Date(t.startTs*1e3)),m=W(new Date(t.endTs*1e3));for(;o<=m;){const x=(o.getDay()+6)%7;a[x]+=c.get(xe(o))??0,i[x]++,o.setDate(o.getDate()+1)}const G=a.map((x,w)=>i[w]?Math.round(x/i[w]):0),ye=Math.max(...G,1);return G.map((x,w)=>({key:w,label:_(new Date(2024,0,1+w),{weekday:"short"}),seconds:x,width:x>0?Math.max(x/ye*100,3):0}))}),oe=p(()=>N.value.some(t=>t.seconds>0)),R=p(()=>[...l.value?.dailyActivity??[]].filter(t=>t.estimatedSeconds>0).sort((t,a)=>a.estimatedSeconds-t.estimatedSeconds||t.key.localeCompare(a.key)).slice(0,3).map(t=>{const a=ge(t.key);return{...t,dateLabel:_(a,{month:"2-digit",day:"2-digit"}),weekdayLabel:_(a,{weekday:"short"})}})),B=p(()=>[h.GROUP,h.PRIVATE].map(t=>l.value?.chatTypes.find(a=>a.type===t)).filter(t=>t!==void 0)),re=p(()=>{const t=B.value.find(o=>o.type===h.PRIVATE),a=B.value.find(o=>o.type===h.GROUP),i=R.value[0],c=[...N.value].sort((o,m)=>m.seconds-o.seconds)[0];return[{key:"private",icon:"i-heroicons-user",colorClass:"text-pink-600 dark:text-pink-400",label:n("privateChat"),value:t?y(t.seconds):"—",subtext:n("shareOfTotal",{share:t?.share??0})},{key:"group",icon:"i-heroicons-user-group",colorClass:"text-blue-600 dark:text-blue-400",label:n("groupChat"),value:a?y(a.seconds):"—",subtext:n("shareOfTotal",{share:a?.share??0})},{key:"peakDay",icon:"i-heroicons-fire",colorClass:"text-red-600 dark:text-red-400",label:n("peakDay"),value:i?.dateLabel??"—",subtext:i?y(i.estimatedSeconds):"—"},{key:"peakWeekday",icon:"i-heroicons-calendar-days",colorClass:"text-amber-600 dark:text-amber-400",label:n("peakWeekday"),value:c?.seconds?c.label:"—",subtext:c?.seconds?y(c.seconds):"—"}]}),F=p(()=>[h.PRIVATE,h.GROUP].map(t=>{const a=(l.value?.sessionRanking??[]).filter(i=>i.type===t).slice(0,10).map((i,c)=>({...i,rank:c+1}));return{type:t,items:a,maxSeconds:Math.max(...a.map(i=>i.seconds),1)}})),ie=p(()=>F.value.some(t=>t.items.length>0)),le=f.subscribe(()=>{D.value=f.getSnapshot()}),ce=b.subscribeOwnerSettingsClosed(()=>{A(!1)});be(Z,()=>{V(),L.value&&(l.value=null,A(!1))},{immediate:!0}),we(()=>{E++,V(),le(),ce()});async function A(t){const a=L.value;if(!a)return;const i=++E;C.value="";try{const c=t?await b.recompute(a):await b.get(a);if(i!==E)return;l.value=c,c.metrics&&f.setAvailableTimeYears(c.availableDataYears),c.task.status==="running"&&de()}catch(c){if(i!==E)return;const o=c instanceof Error?c.message:String(c);C.value=o,Se(`Global insight time investment failed: ${o}`,c instanceof Error?c.stack:void 0)}}function de(){V(),I=setTimeout(()=>{A(!1)},900)}function V(){I&&(clearTimeout(I),I=null)}function ue(){const t=l.value?.latestDataYear;t&&f.switchTimeToYear(t)}function pe(){b.openOwnerSettings()}function y(t){const a=Math.round(t/60);if(t>0&&a<1)return n("duration.lessThanMinute");if(a<60)return n("duration.minutes",{count:a});const i=Math.floor(a/60),c=a%60;return c?n("duration.hoursMinutes",{hours:i,minutes:c}):n("duration.hours",{count:i})}function me(t){return Math.round(t/3600*10)/10}function W(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate())}function xe(t){return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`}function ge(t){const[a,i,c]=t.split("-").map(Number);return new Date(a,i-1,c)}function he(t){return n(t===h.PRIVATE?"privateChat":"groupChat")}return(t,a)=>{const i=De,c=Te;return d(),u("main",Ae,[e("div",Pe,[O.value>0&&r(b).canConfigureOwner?(d(),u("button",{key:0,type:"button",class:"inline-flex w-fit max-w-full items-center gap-2 rounded-lg bg-amber-50 px-3 py-2 text-left text-xs text-amber-800 transition-colors hover:bg-amber-100 dark:bg-amber-950/20 dark:text-amber-300 dark:hover:bg-amber-950/30",onClick:pe},[g(i,{name:"i-heroicons-user-circle",class:"h-4 w-4 shrink-0"}),e("span",Le,s(r(n)("status.ownerIssues",{count:O.value})),1),g(i,{name:"i-heroicons-arrow-right",class:"h-3.5 w-3.5 shrink-0 opacity-70"})])):v("",!0),l.value?.cache.status==="stale"||Q.value&&Y.value?(d(),u("div",Oe,[g(i,{name:"i-heroicons-arrow-path",class:"h-4 w-4 shrink-0 animate-spin"}),P(" "+s(r(n)("status.updating")),1)])):v("",!0),C.value||l.value?.task.status==="failed"?(d(),u("div",Ye,[e("span",null,s(r(n)("failed")),1),g(c,{size:"xs",color:"error",variant:"soft",icon:"i-heroicons-arrow-path",onClick:a[0]||(a[0]=o=>A(!0))},{default:S(()=>[P(s(r(n)("actions.retry")),1)]),_:1})])):v("",!0),!Y.value&&!C.value&&l.value?.task.status!=="failed"?(d(),H(Ce,{key:3,height:"min(52vh, 420px)",text:l.value?.task.status==="running"?r(n)("status.computingProgress",{processed:l.value.task.processedSessions,total:l.value.task.totalSessions}):r(n)("loading")},null,8,["text"])):l.value?.metrics?(d(),u(k,{key:4},[X.value?(d(),u("div",Ne,[ee.value?(d(),u("span",Re,s(r(n)("status.noAnalyzableOwner")),1)):M.value?(d(),u("span",Ve,s(r(n)("status.noDataWithLatest",M.value)),1)):(d(),u("span",$e,s(r(n)("noData")),1)),M.value?(d(),H(c,{key:3,size:"xs",variant:"soft",color:"neutral",icon:"i-heroicons-arrow-right",onClick:ue},{default:S(()=>[P(s(r(n)("actions.switchYear",{year:M.value.latestYear})),1)]),_:1})):v("",!0)])):v("",!0),e("div",je,[g(r(j),{class:"relative isolate overflow-hidden"},{default:S(()=>[g(r(Ie)),e("section",Ue,[e("h2",Be,s(se.value),1),e("div",Fe,[e("p",We,[e("span",null,s(r(n)("narrative.totalPrefix")),1),e("span",Ge,s(y(l.value.metrics.estimatedSeconds)),1),e("span",null,s(r(n)("narrative.totalSuffix")),1)]),e("p",He,[e("span",null,s(r(n)("narrative.daysPrefix")),1),e("span",qe,s(r(J)(l.value.metrics.activeDayCount)),1),e("span",null,s(r(n)("narrative.daysMiddle")),1),e("span",Je,s(y(l.value.metrics.averagePerActiveDaySeconds)),1),e("span",null,s(r(n)("narrative.daysSuffix")),1)])]),e("div",Ke,[e("div",Ze,s(r(n)("keyMetrics")),1),e("div",Qe,[(d(!0),u(k,null,T(re.value,o=>(d(),u("div",{key:o.key,class:"flex min-w-0 items-start gap-2 px-2.5 py-2"},[g(i,{name:o.icon,class:z(["mt-0.5 h-3.5 w-3.5 shrink-0",o.colorClass])},null,8,["name","class"]),e("div",Xe,[e("div",{class:z(["truncate font-mono text-sm leading-tight font-black tabular-nums",o.colorClass])},s(o.value),3),e("div",et,s(o.label),1),e("div",tt,s(o.subtext),1)])]))),128))])]),e("div",st,[e("div",null,[e("h3",at,s(r(n)("monthlyTitle")),1),e("p",nt,s(r(n)("monthlyDescription")),1)]),e("div",ot,[g(r(Ee),{data:ne.value,height:240,mode:"compact",smooth:!1,"show-area":!1},null,8,["data"])]),e("p",rt,s(r(n)("estimateNote")),1)]),e("div",it,[e("span",null,s(ae.value),1),e("span",null,s(r(n)("status.coverage",{analyzed:l.value.coverage.analyzedSessions,total:l.value.coverage.totalSessions})),1)])])]),_:1}),g(r(j),null,{default:S(()=>[e("section",lt,[e("h3",ct,[a[1]||(a[1]=e("span",{class:"inline-block h-2 w-2 rounded-full bg-pink-500 dark:bg-pink-400"},null,-1)),P(" "+s(r(n)("rhythmTitle")),1)]),e("p",dt,s(r(n)("rhythmDescription")),1),e("div",ut,[e("div",pt,[oe.value?(d(),u("div",mt,[(d(!0),u(k,null,T(N.value,o=>(d(),u("div",{key:o.key,class:"grid grid-cols-[2.25rem_minmax(0,1fr)_auto] items-center gap-3"},[e("span",xt,s(o.label),1),e("div",gt,[e("div",{class:"h-full rounded-full bg-pink-500 transition-[width] duration-500 dark:bg-pink-400",style:q({width:`${o.width}%`})},null,4)]),e("span",ht,s(y(o.seconds)),1)]))),128))])):(d(),u("p",yt,s(r(n)("noData")),1))]),e("div",vt,[e("h4",kt,s(r(n)("topDaysTitle")),1),R.value.length?(d(),u("div",_t,[(d(!0),u(k,null,T(R.value,(o,m)=>(d(),u("div",{key:o.key,class:"grid grid-cols-[1.5rem_minmax(0,1fr)_auto] items-center gap-3 py-2.5 first:pt-0 last:pb-0"},[e("span",ft,s(m+1),1),e("div",bt,[e("span",wt,s(o.dateLabel),1),e("span",St,s(o.weekdayLabel),1)]),e("span",Tt,s(y(o.estimatedSeconds)),1)]))),128))])):(d(),u("p",zt,s(r(n)("noData")),1))])])])]),_:1}),g(r(j),null,{default:S(()=>[e("section",Dt,[e("div",Ct,[e("div",null,[e("h3",It,s(r(n)("rankingTitle")),1),e("p",Et,s(r(n)("rankingDescription")),1)])]),ie.value?(d(),u("div",Mt,[(d(!0),u(k,null,T(F.value,o=>(d(),u("div",{key:o.type,class:"min-w-0 lg:px-10 lg:first:pl-0 lg:last:pr-0"},[e("div",At,[e("div",Pt,[e("span",{class:z(["h-2.5 w-2.5 shrink-0 rounded-full",o.type===r(h).PRIVATE?"bg-pink-500 dark:bg-pink-400":"bg-blue-500 dark:bg-blue-400"])},null,2),e("h4",Lt,s(he(o.type)),1)]),e("span",Ot,s(r(n)("rankingCount",{count:o.items.length})),1)]),o.items.length?(d(),u("div",Yt,[(d(!0),u(k,null,T(o.items,m=>(d(),u("div",{key:m.sessionId,class:"min-w-0 py-3 last:pb-0"},[e("div",Nt,[e("span",{class:z(["flex h-6 w-6 items-center justify-center rounded-full font-mono text-[10px] font-bold",m.rank<=3?o.type===r(h).PRIVATE?"bg-pink-50 text-pink-600 dark:bg-pink-950/30 dark:text-pink-400":"bg-blue-50 text-blue-600 dark:bg-blue-950/30 dark:text-blue-400":"bg-gray-100 text-gray-500 dark:bg-zinc-800 dark:text-zinc-400"])},s(m.rank),3),e("div",Rt,[e("span",Vt,s(m.name),1),e("span",$t,s(m.platform),1)]),e("div",jt,[e("div",Ut,s(y(m.seconds)),1),e("div",Bt,s(m.share)+"% ",1)])]),e("div",Ft,[e("div",{class:z(["h-full rounded-full",o.type===r(h).PRIVATE?"bg-pink-500 dark:bg-pink-400":"bg-blue-500 dark:bg-blue-400"]),style:q({width:`${m.seconds/o.maxSeconds*100}%`})},null,6)])]))),128))])):(d(),u("p",Wt,s(r(n)("noData")),1))]))),128))])):(d(),u("p",Gt,s(r(n)("noData")),1))])]),_:1})])],64)):v("",!0)])])}}});export{ns as default};
@@ -1 +0,0 @@
1
- import{a as ke,a3 as be,o as c,c as re,w as T,h as f,i as a,p as o,e as r,z as y,a5 as _e,a4 as Se,F as q,j as he,l as E,a6 as Z,aD as Tt,f as u,ae as De,K as Lt,I as $t,ax as It,bf as Ft,J as O,x as Pt,y as Mt,ap as zt,$ as At,am as X,n as U,bg as Nt,r as b,C as Be,bu as Et}from"./index-Bq5q3kSU.js";import{_ as Bt}from"./Tabs-DB603EEu.js";import{u as jt}from"./useToast-YAHDkKDN.js";import{_ as Vt}from"./ThemeCard.vue_vue_type_script_setup_true_lang-BDTdkH5i.js";import{_ as Dt}from"./LoadingState.vue_vue_type_script_setup_true_lang-B_7VHxTx.js";import{_ as Gt}from"./SectionTabs.vue_vue_type_script_setup_true_lang-v_7aRBgM.js";import{u as Ot}from"./people-page-header-Czt9e1jv.js";import"./vendor-snapdom--nZvo8Sg.js";import"./RovingFocusItem-psoFYxrC.js";const Ut={key:0,class:"flex h-full w-[420px] max-w-[80vw] shrink-0 flex-col border-l border-gray-200 bg-white dark:border-gray-800 dark:bg-page-dark",style:{"-webkit-app-region":"no-drag"}},qt={class:"flex items-center justify-between border-b border-gray-200 px-4 py-3 dark:border-gray-800"},Rt={class:"text-base font-semibold text-gray-900 dark:text-white"},Ht={key:0,class:"flex min-h-0 flex-1 items-center justify-center gap-2 text-sm text-gray-400 dark:text-gray-500"},Kt={key:1,class:"min-h-0 flex-1 overflow-y-auto"},Yt={class:"px-5 py-5"},Qt={class:"flex items-start gap-4"},Wt={class:"relative shrink-0"},Jt=["src","alt"],Xt={key:1,class:"flex h-16 w-16 items-center justify-center rounded-2xl bg-gradient-to-br from-gray-155 to-gray-200 text-lg font-bold text-gray-700 dark:from-gray-800 dark:to-page-dark dark:text-gray-200"},Zt={class:"min-w-0 flex-1 pt-1"},ea={class:"truncate text-lg font-bold tracking-tight text-gray-900 dark:text-white"},ta={class:"mt-1 truncate font-mono text-xs text-gray-400 dark:text-gray-500"},aa={key:0,class:"mt-2 flex flex-wrap gap-1.5"},na={key:1,class:"mt-3 flex flex-wrap items-center gap-2"},sa={class:"border-t border-gray-100 px-5 py-4 dark:border-white/5"},oa={class:"mb-3 text-[10px] font-bold uppercase tracking-wider text-gray-400 dark:text-gray-500"},ra={class:"space-y-2.5"},ia={class:"flex items-center justify-between gap-2"},la={class:"truncate text-xs font-semibold text-gray-700 dark:text-gray-300"},ca={class:"flex items-center gap-1 text-[10px] font-bold text-gray-400 transition group-hover/item:text-pink-500 dark:text-gray-500"},da={class:"mt-1.5 truncate text-[11px] font-medium text-gray-400 dark:text-gray-500"},ua={class:"mt-2 flex flex-wrap gap-1.5"},fa=ke({__name:"ContactDetailPanel",props:{selectedKey:{},contact:{},isLoading:{type:Boolean},isFriendActionLoading:{type:Boolean}},emits:["clear","openSource","viewSourceRecords","markFriend","unmarkFriend"],setup(n,{emit:s}){const h=n,S=s,{t:C}=be(),A=u(()=>{const p=h.contact;if(!p)return[];const v=new Set([p.displayName.trim().toLowerCase(),p.platformId.trim().toLowerCase()]);return p.aliases.filter(w=>!v.has(w.trim().toLowerCase()))}),I=u(()=>h.contact?.pool==="non_friend"),F=u(()=>h.contact?.friendSource==="manual"),B=u(()=>I.value||F.value);function P(p){return p.displayName.trim().slice(0,1).toUpperCase()||"?"}return(p,v)=>{const w=_e,R=Se;return c(),re(Tt,{name:"contact-detail-panel"},{default:T(()=>[n.selectedKey?(c(),f("aside",Ut,[a("div",qt,[a("h3",Rt,o(r(C)("contacts.detail.title")),1),y(w,{"aria-label":r(C)("contacts.actions.clearSelection"),icon:"i-heroicons-x-mark",color:"neutral",variant:"ghost",size:"sm",onClick:v[0]||(v[0]=x=>S("clear"))},null,8,["aria-label"])]),n.isLoading?(c(),f("div",Ht,[y(R,{name:"i-lucide-loader-2",class:"h-4 w-4 animate-spin"}),a("span",null,o(r(C)("common.loading")),1)])):n.contact?(c(),f("div",Kt,[a("section",Yt,[a("div",Qt,[a("div",Wt,[n.contact.avatar?(c(),f("img",{key:0,src:n.contact.avatar,alt:n.contact.displayName,loading:"lazy",decoding:"async",class:"h-16 w-16 rounded-2xl object-cover shadow-sm ring-2 ring-white dark:ring-page-dark"},null,8,Jt)):(c(),f("div",Xt,o(P(n.contact)),1))]),a("div",Zt,[a("h2",ea,o(n.contact.displayName),1),a("p",ta,o(n.contact.platform)+" · "+o(n.contact.platformId),1),A.value.length>0?(c(),f("div",aa,[(c(!0),f(q,null,he(A.value.slice(0,4),x=>(c(),f("span",{key:x,class:"max-w-full truncate rounded-md bg-gray-100 px-2 py-0.5 text-[11px] font-medium text-gray-500 dark:bg-white/5 dark:text-gray-400"},o(x),1))),128))])):E("",!0),B.value?(c(),f("div",na,[I.value?(c(),re(w,{key:0,icon:"i-lucide-user-plus",color:"primary",variant:"soft",size:"xs",loading:n.isFriendActionLoading,onClick:v[1]||(v[1]=x=>S("markFriend"))},{default:T(()=>[Z(o(r(C)("contacts.actions.markFriend")),1)]),_:1},8,["loading"])):F.value?(c(),re(w,{key:1,icon:"i-lucide-user-minus",color:"neutral",variant:"soft",size:"xs",loading:n.isFriendActionLoading,onClick:v[2]||(v[2]=x=>S("unmarkFriend"))},{default:T(()=>[Z(o(r(C)("contacts.actions.unmarkFriend")),1)]),_:1},8,["loading"])):E("",!0)])):E("",!0)])])]),a("section",sa,[a("h3",oa,o(r(C)("contacts.detail.sources")),1),a("div",ra,[(c(!0),f(q,null,he(n.contact.sourceSessions,x=>(c(),f("div",{key:x.id,class:"w-full rounded-2xl border border-gray-100 bg-white/40 px-3.5 py-3 text-left transition duration-300 hover:border-gray-200 dark:border-white/5 dark:bg-page-dark/10 dark:hover:border-white/10"},[a("div",ia,[a("span",la,o(x.name),1),a("span",ca,o(x.type==="private"?r(C)("contacts.detail.sourceType.private"):r(C)("contacts.detail.sourceType.group")),1)]),a("div",da,o(x.privateMessageCount!=null?r(C)("contacts.metrics.privateMessages",{count:x.privateMessageCount}):r(C)("contacts.metrics.groupSignals",{count:x.coOccurrenceCount??0})),1),a("div",ua,[y(w,{icon:"i-lucide-arrow-up-right",color:"primary",variant:"soft",size:"xs",onClick:j=>S("openSource",x)},{default:T(()=>[Z(o(r(C)("contacts.actions.openSourceSession")),1)]),_:1},8,["onClick"]),y(w,{icon:"i-lucide-messages-square",color:"primary",variant:"soft",size:"xs",onClick:j=>S("viewSourceRecords",x)},{default:T(()=>[Z(o(r(C)("contacts.actions.viewSourceRecords")),1)]),_:1},8,["onClick"])])]))),128))])])])):E("",!0)])):E("",!0)]),_:1})}}}),ma=De(fa,[["__scopeId","data-v-4df1b50a"]]),pa={key:0,class:"flex items-center gap-3.5 rounded-2xl border border-amber-200/60 bg-amber-50/40 p-4 text-sm text-amber-800 backdrop-blur-sm dark:border-amber-900/40 dark:bg-amber-950/10 dark:text-amber-200"},ga={class:"flex h-9 w-9 shrink-0 items-center justify-center rounded-xl bg-amber-100/80 dark:bg-amber-950/50"},va={class:"font-medium"},xa={key:1,class:"flex flex-col gap-4 rounded-2xl border border-zinc-200/80 bg-zinc-50/60 p-4 text-sm text-zinc-700 backdrop-blur-sm dark:border-zinc-800/80 dark:bg-page-dark/40 dark:text-zinc-300 sm:flex-row sm:items-center sm:justify-between"},ya={class:"flex items-center gap-3.5"},ha={class:"flex h-9 w-9 shrink-0 items-center justify-center rounded-xl bg-zinc-100 dark:bg-zinc-800/80"},ka={class:"font-medium"},ba={class:"flex items-center shrink-0 self-end sm:self-center"},_a={key:2,class:"flex flex-col gap-4 rounded-2xl border border-red-200/60 bg-red-50/40 p-4 text-sm text-red-700 backdrop-blur-sm dark:border-red-900/40 dark:bg-red-950/10 dark:text-red-300 sm:flex-row sm:items-center sm:justify-between"},Sa={class:"flex min-w-0 items-center gap-3.5"},wa={class:"flex h-9 w-9 shrink-0 items-center justify-center rounded-xl bg-red-100/80 dark:bg-red-950/50"},Ca={class:"truncate font-medium"},Ta={class:"flex items-center shrink-0 self-end sm:self-center"},La=ke({__name:"ContactsStatusBlocks",props:{showDisabledNotice:{type:Boolean},activePrivateSessionCount:{},cacheStatus:{},taskFailed:{type:Boolean},taskLastError:{},isTaskRunning:{type:Boolean},isRecomputing:{type:Boolean}},emits:["recompute"],setup(n,{emit:s}){const h=s,{t:S}=be();return(C,A)=>{const I=Se,F=_e;return c(),f(q,null,[n.showDisabledNotice?(c(),f("div",pa,[a("div",ga,[y(I,{name:"i-lucide-alert-triangle",class:"h-5 w-5 text-amber-500"})]),a("span",va,o(r(S)("contacts.disabled",{count:n.activePrivateSessionCount})),1)])):E("",!0),n.cacheStatus==="stale"&&!n.isTaskRunning?(c(),f("div",xa,[a("div",ya,[a("div",ha,[y(I,{name:"i-lucide-history",class:"h-5 w-5 text-zinc-500 dark:text-zinc-400"})]),a("span",ka,o(r(S)("contacts.stale.inline")),1)]),a("div",ba,[y(F,{size:"sm",color:"primary",variant:"soft",class:"rounded-xl px-4 font-medium",loading:n.isRecomputing||n.isTaskRunning,disabled:n.isTaskRunning,onClick:A[0]||(A[0]=B=>h("recompute"))},{default:T(()=>[Z(o(r(S)("contacts.actions.recompute")),1)]),_:1},8,["loading","disabled"])])])):E("",!0),n.taskFailed?(c(),f("div",_a,[a("div",Sa,[a("div",wa,[y(I,{name:"i-lucide-alert-circle",class:"h-5 w-5 text-red-500"})]),a("span",Ca,o(n.taskLastError||r(S)("contacts.task.failed")),1)]),a("div",Ta,[y(F,{size:"sm",color:"error",variant:"soft",class:"rounded-xl px-4 font-medium",onClick:A[1]||(A[1]=B=>h("recompute"))},{default:T(()=>[Z(o(r(S)("contacts.task.retry")),1)]),_:1})])])):E("",!0)],64)}}});function $a(n){return!!n.diagnostics&&!n.showLoadingState&&!n.diagnostics.contactsEnabled}function Ia(n){return n.previousScrollTop}function je(n){return n!=="friend"}function Fa(n){return n.friendInitialLoading||n.groupmateInitialLoading}function Pa(n){return n.activeSection==="non_friend"||n.friendSectionReady}function Ma(n){return n.friendInitialLoading||n.groupmateInitialLoading||n.completionProgressVisible===!0||n.activeTaskStatus==="running"||n.friendTaskStatus==="running"||n.groupmateTaskStatus==="running"}function za(n){return n.previousStatus==="running"&&n.nextStatus==="succeeded"&&n.nextTotalSessions>0&&n.nextProcessedSessions>=n.nextTotalSessions&&n.previousProcessedSessions<n.nextTotalSessions}function Aa(n){return n.friendTaskStatus==="running"||n.groupmateTaskStatus==="running"?["friend","non_friend"]:[n.activePool]}function Na(n){const s=[{type:"section",key:"section:friend",pool:"friend"}];return s.push(...n.friends.map(h=>({type:"contact",key:h.key,pool:"friend",contact:h}))),n.friendLoadingMore&&s.push({type:"loading",key:"loading:friend",pool:"friend"}),n.showGroupSection&&(s.push({type:"section",key:"section:non_friend",pool:"non_friend"}),s.push(...n.groupmates.map(h=>({type:"contact",key:h.key,pool:"non_friend",contact:h}))),n.groupmateLoadingMore&&s.push({type:"loading",key:"loading:non_friend",pool:"non_friend"})),s}const Ea={class:"flex min-h-0 flex-1 flex-col text-gray-900 dark:bg-page-dark dark:text-gray-100"},Ba={class:"flex min-w-0 flex-1 flex-wrap items-center justify-end gap-2 py-1.5 xl:py-0"},ja={class:"flex min-h-0 flex-1 overflow-hidden"},Va={class:"min-h-0 min-w-0 flex-1 overflow-hidden"},Da={class:"flex h-full min-h-0 w-full flex-col gap-6 px-6 pb-3 pt-4"},Ga={class:"flex min-h-0 flex-1 flex-col gap-4"},Oa={key:1,class:"rounded-2xl border border-red-200 bg-red-50/50 p-4 text-sm text-red-700 dark:border-red-900/30 dark:bg-red-950/20 dark:text-red-300"},Ua={key:2,class:"min-h-0 flex-1"},qa={key:0,class:"flex flex-col items-center justify-center rounded-3xl border border-dashed border-gray-250 p-16 text-center dark:border-white/5"},Ra={class:"flex h-12 w-12 items-center justify-center rounded-2xl bg-gray-50 text-gray-400 dark:bg-white/5 dark:text-gray-500"},Ha={class:"mt-4 text-sm font-medium text-gray-400 dark:text-gray-500"},Ka={class:"shrink-0 overflow-hidden border-b border-gray-100 bg-white dark:border-white/5 dark:bg-[#202024]"},Ya={class:"flex min-w-0 items-center justify-end gap-1 text-right"},Qa={class:"truncate"},Wa={class:"max-w-[280px] whitespace-normal break-words text-left text-xs leading-5"},Ja={class:"flex min-w-0 items-center justify-end gap-1 text-right"},Xa={class:"truncate"},Za={class:"max-w-[280px] whitespace-normal break-words text-left text-xs leading-5"},en=["aria-label","onClick"],tn={class:"group flex min-w-0 w-full items-center gap-3"},an={class:"relative shrink-0 overflow-hidden rounded-lg"},nn=["src","alt"],sn={key:1,class:"flex h-10 w-10 items-center justify-center bg-gradient-to-br from-gray-50 to-gray-100 text-sm font-bold text-gray-500 transition-transform duration-300 group-hover:scale-105 dark:from-gray-800 dark:to-gray-800/60 dark:text-gray-400"},on={class:"min-w-0 flex-1"},rn={class:"flex min-w-0 items-center gap-1"},ln={class:"mt-1 inline-flex items-center rounded bg-gray-50 px-1.5 py-0.5 font-mono text-[9px] font-semibold uppercase tracking-wider text-gray-400 dark:bg-white/5 dark:text-gray-500"},cn={class:"contact-table-value"},dn={class:"contact-table-value"},un={class:"contact-table-value"},fn={class:"contact-table-value"},mn=100,Ve=69,pn=20,gn=ke({__name:"index",setup(n){const{t:s}=be(),h=jt(),S=Lt(),C=$t(),A=It(),I=b(!1),F=b(""),B=b(""),P=b("1y"),p=b("friend"),v=b(null),w=b(null),R=b(!1),x=b(!1),j=b(null),fe=b(!1),H=b(null),ee=b(null),te=b(null),M=b(null),ae={friend:null,non_friend:null},K=b(!1),Y=b(null),we=b(0),ne=b({});function me(){return{items:[],response:null,page:0,total:0,hasMore:!1,isLoadingInitial:!1,isLoadingMore:!1,error:"",requestId:0,scrollOffset:0}}const V=b({friend:me(),non_friend:me()}),ie=u(()=>V.value[p.value]),k=u(()=>V.value.friend),m=u(()=>V.value.non_friend),Ce=u(()=>!!k.value.response&&!k.value.hasMore&&!k.value.isLoadingInitial),pe=u(()=>Pa({activeSection:p.value,friendSectionReady:Ce.value,groupmateHasItems:m.value.items.length>0,groupmateLoading:m.value.isLoadingInitial||m.value.isLoadingMore})),N=u(()=>Na({friends:k.value.items,groupmates:m.value.items,showGroupSection:pe.value,friendLoadingMore:k.value.isLoadingMore,groupmateLoadingMore:m.value.isLoadingInitial||m.value.isLoadingMore})),le=u(()=>ie.value.response??k.value.response??m.value.response),ge=u(()=>[ie.value.response,k.value.response,m.value.response].find(e=>e?.task?.status==="running")??le.value),Ge=u(()=>k.value.items.length+m.value.items.length>0),Oe=u(()=>!Ge.value&&!!k.value.response&&!!m.value.response&&!k.value.hasMore&&!m.value.hasMore&&!k.value.isLoadingInitial&&!m.value.isLoadingInitial),Te=u(()=>k.value.error||m.value.error),ve=u(()=>le.value?.diagnostics),z=u(()=>ge.value?.task),ce=u(()=>H.value??z.value),Q=u(()=>z.value?.status==="running"),Ue=u(()=>z.value?.status==="failed"),Le=u(()=>Ma({activeTaskStatus:ie.value.response?.task?.status,friendTaskStatus:k.value.response?.task?.status,groupmateTaskStatus:m.value.response?.task?.status,friendInitialLoading:k.value.isLoadingInitial,groupmateInitialLoading:m.value.isLoadingInitial,completionProgressVisible:H.value!==null})),qe=u(()=>H.value?s("contacts.task.running",{current:ce.value?.processedSessions??0,total:ce.value?.totalSessions??0}):ge.value?.cache.status==="stale"&&Q.value?s("contacts.task.updating"):ge.value?.cache.status==="missing"&&Q.value?s("contacts.task.running",{current:ce.value?.processedSessions??0,total:ce.value?.totalSessions??0}):s("common.loading")),Re=u(()=>$a({diagnostics:ve.value,showLoadingState:Le.value})),se=u(()=>{const e=le.value?.stats,t=e?.friendsTotal??0,i=e?.nonFriendsTotal??0;return{total:t+i,friends:t,nonFriends:i}}),He=u(()=>[{id:"friend",label:`${s("contacts.tabs.friends")} ${se.value.friends.toLocaleString()}`,icon:"i-heroicons-user"},{id:"non_friend",label:`${s("contacts.tabs.groupContacts")} ${se.value.nonFriends.toLocaleString()}`,icon:"i-heroicons-user-group"}]),Ke=u(()=>Et.map(e=>({label:s(`contacts.timeRange.${e}`),value:e}))),de=Ft(u(()=>({count:N.value.length,getScrollElement:()=>Y.value,estimateSize:e=>Ze(N.value[e]),overscan:10,getItemKey:e=>N.value[e]?.key??e}))),xe=u(()=>de.value.getVirtualItems()),Ye=u(()=>de.value.getTotalSize());O(F,e=>{te.value&&clearTimeout(te.value),te.value=setTimeout(()=>{B.value=e.trim()},300)}),O(()=>z.value?.status,()=>Pe()),O(()=>({status:z.value?.status,processedSessions:z.value?.processedSessions??0,totalSessions:z.value?.totalSessions??0}),(e,t)=>{e.status==="running"&&ue(),z.value&&za({previousStatus:t?.status,nextStatus:e.status,previousProcessedSessions:t?.processedSessions??0,nextProcessedSessions:e.processedSessions,nextTotalSessions:e.totalSessions})&&rt(z.value)}),O([B,P],()=>{nt(),$e()}),O(()=>N.value.length,()=>{de.value.measure()}),O(xe,()=>{Xe()},{flush:"post"}),O(N,()=>{v.value&&(k.value.items.some(e=>e.key===v.value)||m.value.items.some(e=>e.key===v.value)||oe())}),Pt(()=>{$e()}),Mt(()=>{Me(),ue(),te.value&&clearTimeout(te.value),M.value&&clearTimeout(M.value)});async function D(e,t){const i=W(e,1,{...t,replace:!0});ae[e]=i;try{await i}finally{ae[e]===i&&(ae[e]=null)}}async function $e(){await Promise.all([D("friend"),D("non_friend")])}async function Ie(e){const t=V.value[e];!t.hasMore||t.isLoadingInitial||t.isLoadingMore||await W(e,t.page+1,{acceptStale:!0,replace:!1})}async function W(e,t,i){const d=V.value[e],_=i?.replace!==!1,L=d.requestId+1;d.requestId=L,d.error="",i?.silent||(_?d.isLoadingInitial=d.items.length===0:d.isLoadingMore=!0);try{const $={acceptStale:i?.acceptStale,timeRangePreset:P.value,pool:e,page:t,pageSize:mn,query:B.value||void 0},l=i?.force?await S.recomputeContacts($):await S.getContacts($);if(d.requestId!==L)return;We(d,l,_,{preserveExisting:i?.preserveExisting}),Pe()}catch($){if(d.requestId===L&&(d.error=String($)),i?.throwOnError)throw $}finally{d.requestId===L&&(d.isLoadingInitial=!1,d.isLoadingMore=!1)}}async function Fe(){I.value=!0;try{await W(p.value,1,{acceptStale:!0,force:!0,replace:!0,throwOnError:!0}),h.success(s("contacts.toast.recomputeStarted"))}catch(e){h.fail(s("contacts.toast.recomputeFailed"),{description:String(e)})}finally{I.value=!1}}const Qe=u(()=>({title:s("layout.relationships"),description:s("contacts.subtitle",{count:ve.value?.privateSessionCount??0}),icon:"i-lucide-users",iconClass:"bg-primary-600 text-white dark:bg-primary-500 dark:text-white shadow-sm",action:{label:s("contacts.actions.recompute"),icon:"i-lucide-refresh-cw",loading:I.value,disabled:Q.value,class:"border border-pink-100 hover:border-pink-200 dark:border-pink-950/30 dark:hover:border-pink-900/50",onClick:Fe},stats:[{id:"total",label:s("contacts.stats.total"),value:se.value.total.toLocaleString()},{id:"friends",label:s("contacts.stats.friends"),value:se.value.friends.toLocaleString()},{id:"nonFriends",label:s("contacts.stats.nonFriends"),value:se.value.nonFriends.toLocaleString(),dividerBefore:!0}]}));Ot(Qe);function We(e,t,i,d){const _=e.response?.cache.signature,L=t.cache.signature,$=!!_&&!!L&&_!==L;if(e.response=t,e.total=t.pagination.total,d?.preserveExisting&&!$&&e.items.length>0){e.hasMore=e.items.length<t.pagination.total;return}e.page=t.pagination.page,e.hasMore=t.pagination.hasMore,e.items=i||$?t.contacts:Je(e.items,t.contacts),$&&oe()}function Je(e,t){const i=new Set(e.map(_=>_.key)),d=[...e];for(const _ of t)i.has(_.key)||(i.add(_.key),d.push(_));return d}function Xe(){const t=xe.value.at(-1);if(!t||t.index<N.value.length-pn)return;if(G(t.index).pool==="friend"){if(k.value.hasMore){Ie("friend");return}Ce.value&&!m.value.response&&!m.value.isLoadingInitial&&D("non_friend");return}if(!m.value.response&&!m.value.isLoadingInitial){D("non_friend");return}m.value.hasMore&&Ie("non_friend")}function G(e){return N.value[e]}function g(e){return G(e)}function Ze(e){return e?.type==="section"?e.pool==="non_friend"?42:1:e?.type==="loading"?44:Ve}async function et(e){const t=e==="non_friend"?"non_friend":"friend";p.value=t,K.value=!0,M.value&&clearTimeout(M.value),t==="non_friend"&&await tt(),await Be();const i=N.value.findIndex(d=>d.type==="section"&&d.pool===t);if(i>=0){const d=t==="non_friend"?Math.min(i+1,N.value.length-1):i;de.value.scrollToIndex(d,{align:"start"})}M.value=setTimeout(()=>{K.value=!1,p.value=t},350)}async function tt(){!m.value.response&&!m.value.isLoadingInitial&&await D("non_friend",{acceptStale:!0}),await at()}async function at(e){if(!Fa({friendInitialLoading:k.value.isLoadingInitial,groupmateInitialLoading:m.value.isLoadingInitial}))return;const t=[ae.friend,ae.non_friend].filter(i=>!!i);t.length!==0&&await Promise.allSettled(t)}function nt(){K.value=!1,M.value&&clearTimeout(M.value),ue();for(const e of["friend","non_friend"])V.value[e].requestId++,V.value[e]=me();oe(),ne.value={},Y.value&&(Y.value.scrollTop=0)}function Pe(){Q.value?st():Me()}function st(){j.value||(j.value=setInterval(()=>{ot()},1500))}async function ot(){if(!fe.value){fe.value=!0;try{const e=Aa({activePool:p.value,friendTaskStatus:k.value.response?.task?.status,groupmateTaskStatus:m.value.response?.task?.status});await Promise.all(e.map(t=>W(t,1,{acceptStale:!0,replace:!0,preserveExisting:!0,silent:!0})))}finally{fe.value=!1}}}function Me(){j.value&&(clearInterval(j.value),j.value=null)}function rt(e){ue(),H.value={...e,processedSessions:e.totalSessions},ee.value=setTimeout(()=>{H.value=null,ee.value=null},450)}function ue(){ee.value&&(clearTimeout(ee.value),ee.value=null),H.value=null}async function it(e){v.value=e.key,await ze(e.key)}async function ze(e,t){const i=`${P.value}:${e}`,d=ne.value[i];if(d&&!t?.skipCache){w.value=d;return}w.value=null,R.value=!0;try{const _=await S.getContactDetail(e,{acceptStale:!0,timeRangePreset:P.value});if(v.value!==e)return;w.value=_.contact,_.contact&&(ne.value={...ne.value,[i]:_.contact})}catch(_){h.fail(s("contacts.toast.recomputeFailed"),{description:String(_)})}finally{v.value===e&&(R.value=!1)}}async function lt(){const e=w.value?.key;if(!(!e||x.value)){x.value=!0;try{await S.markContactAsFriend(e,{timeRangePreset:P.value}),h.success(s("contacts.toast.markFriendSucceeded")),await Ae(e)}catch(t){h.fail(s("contacts.toast.markFriendFailed"),{description:String(t)})}finally{x.value=!1}}}async function ct(){const e=w.value?.key;if(!(!e||x.value)){x.value=!0;try{await S.unmarkContactAsFriend(e,{timeRangePreset:P.value}),h.success(s("contacts.toast.unmarkFriendSucceeded")),await Ae(e)}catch(t){h.fail(s("contacts.toast.unmarkFriendFailed"),{description:String(t)})}finally{x.value=!1}}}async function Ae(e){const t=p.value,i=Y.value?.scrollTop??0,d=w.value?.pool??t;if(ne.value={},d==="non_friend"){dt(e),oe(),await Ee(t,i),await ut();return}await Promise.all([D("friend",{acceptStale:!0}),D("non_friend",{acceptStale:!0})]),v.value=e,await ze(e,{skipCache:!0}),await Ee(t,i)}function dt(e){const t=m.value,i=t.items.filter(d=>d.key!==e);i.length!==t.items.length&&(t.items=i,t.total=Math.max(0,t.total-1),t.hasMore=t.items.length<t.total)}async function ut(){await Promise.all([W("friend",1,{acceptStale:!0,replace:!0,preserveExisting:je("friend"),silent:!0}),W("non_friend",1,{acceptStale:!0,replace:!0,preserveExisting:je("non_friend"),silent:!0})])}function oe(){v.value=null,w.value=null,R.value=!1}function ft(e){return e.friendSource==="manual"?s("contacts.pool.manualFriend"):e.pool==="friend"?s("contacts.pool.friend"):s("contacts.pool.nonFriend")}function mt(e){return e.friendSource==="manual"?"bg-indigo-50 text-indigo-600 dark:bg-indigo-500/10 dark:text-indigo-400 border border-indigo-100/50 dark:border-indigo-500/20":e.pool==="friend"?"bg-sky-50 text-sky-600 dark:bg-sky-500/10 dark:text-sky-400 border border-sky-100/50 dark:border-sky-500/20":"bg-emerald-50 text-emerald-600 dark:bg-emerald-500/10 dark:text-emerald-400 border border-emerald-100/50 dark:border-emerald-500/20"}function ye(e){return e==="friend"?"contact-table-grid--friends":"contact-table-grid--group-contacts"}function pt(e,t){return J(e==="friend"?t.scoreBreakdown.privateMessageCount:t.scoreBreakdown.commonGroupCount)}function gt(e,t){return J(e==="friend"?t.scoreBreakdown.activePrivateMonths:t.scoreBreakdown.coOccurrenceCount)}function vt(e,t){return J(e==="friend"?t.scoreBreakdown.commonGroupCount:t.scoreBreakdown.replyInteractionCount)}function xt(e){return(e.displayName||e.platformId||"?").slice(0,1)}function yt(e){return Math.round(e*100).toString()}function ht(e){return e.friendSource==="manual"?"-":yt(e.score)}function J(e){return String(e??0)}function kt(e){return e?new Date(e*1e3).toLocaleDateString():s("contacts.emptyValue")}function bt(e){A.push({name:e.type==="private"?"private-chat":"group-chat",params:{id:e.id}})}function _t(e){C.openChatRecordDrawer({sessionId:e.id})}function St(e){const t=e.target;if(ie.value.scrollOffset=t.scrollTop,we.value=t.scrollLeft,K.value)return;const i=wt(t);p.value!==i&&(p.value=i)}function wt(e){return pe.value&&e.scrollTop>=Ne()?"non_friend":"friend"}function Ne(){return 1+k.value.items.length*Ve+(k.value.isLoadingMore?44:0)}async function Ee(e,t){p.value=e,await Be();const i=Y.value;i&&(K.value=!0,M.value&&clearTimeout(M.value),i.scrollTop=Ia({previousScrollTop:t,groupSectionScrollTop:Ct()}),M.value=setTimeout(()=>{K.value=!1,p.value=e},150))}function Ct(){return pe.value?Ne():null}return(e,t)=>{const i=Bt,d=_e,_=zt,L=Se,$=Nt;return c(),f("div",Ea,[y(r(Gt),{modelValue:p.value,"onUpdate:modelValue":t[3]||(t[3]=l=>p.value=l),items:He.value,"persist-key":"contactsTab",onChange:et},{right:T(()=>[a("div",Ba,[y(i,{modelValue:P.value,"onUpdate:modelValue":t[0]||(t[0]=l=>P.value=l),items:Ke.value,content:!1,size:"xs",class:"min-w-max gap-0 bg-transparent dark:bg-transparent shadow-none",disabled:Q.value},null,8,["modelValue","items","disabled"]),y(_,{modelValue:F.value,"onUpdate:modelValue":t[2]||(t[2]=l=>F.value=l),icon:"i-lucide-search",placeholder:r(s)("contacts.search"),size:"sm",class:"w-full sm:w-36"},At({_:2},[F.value?{name:"trailing",fn:T(()=>[y(d,{icon:"i-heroicons-x-mark",variant:"link",color:"neutral",size:"xs","aria-label":r(s)("contacts.actions.clearSearch"),onClick:t[1]||(t[1]=l=>F.value="")},null,8,["aria-label"])]),key:"0"}:void 0]),1032,["modelValue","placeholder"])])]),_:1},8,["modelValue","items"]),a("div",ja,[a("main",Va,[a("div",Da,[y(La,{"show-disabled-notice":Re.value,"active-private-session-count":ve.value?.activePrivateSessionCount??0,"cache-status":le.value?.cache.status,"task-failed":Ue.value,"task-last-error":z.value?.lastError,"is-task-running":Q.value,"is-recomputing":I.value,onRecompute:Fe},null,8,["show-disabled-notice","active-private-session-count","cache-status","task-failed","task-last-error","is-task-running","is-recomputing"]),a("section",Ga,[Le.value?(c(),re(r(Dt),{key:0,text:qe.value,height:"py-16"},null,8,["text"])):Te.value?(c(),f("div",Oa,o(Te.value),1)):(c(),f("div",Ua,[Oe.value?(c(),f("div",qa,[a("div",Ra,[y(L,{name:"i-lucide-users-2",class:"h-6 w-6"})]),a("p",Ha,o(r(s)("contacts.empty")),1)])):(c(),re(r(Vt),{key:1,shadow:!1,class:"flex h-full min-w-0 flex-col"},{default:T(()=>[a("div",Ka,[a("div",{class:U(["contact-table-grid min-w-[720px] px-4 py-3 text-[11px] font-bold uppercase tracking-wider text-gray-400 dark:text-gray-500",ye(p.value)]),style:X({transform:`translateX(-${we.value}px)`})},[a("span",null,o(r(s)("contacts.table.contact")),1),a("span",null,o(r(s)("contacts.table.status")),1),p.value==="friend"?(c(),f(q,{key:0},[a("span",null,o(r(s)("contacts.metrics.privateMessagesLabel")),1),a("span",null,o(r(s)("contacts.metrics.activeMonths")),1),a("span",null,o(r(s)("contacts.metrics.commonGroups")),1)],64)):(c(),f(q,{key:1},[a("span",null,o(r(s)("contacts.metrics.commonGroups")),1),a("span",null,o(r(s)("contacts.metrics.coOccurrence")),1),a("span",null,o(r(s)("contacts.metrics.replies")),1)],64)),a("span",null,o(r(s)("contacts.metrics.lastInteractionShort")),1),a("span",Ya,[a("span",Qa,o(r(s)("contacts.detail.score")),1),y($,{content:{side:"top"},ui:{content:"h-auto"}},{content:T(()=>[a("div",Wa,o(r(s)("contacts.detail.scoreHelp")),1)]),default:T(()=>[y(L,{name:"i-lucide-circle-help",class:"h-3.5 w-3.5 shrink-0 text-gray-350 transition-colors hover:text-primary-500 dark:text-gray-600 dark:hover:text-primary-400"})]),_:1})])],6)]),a("div",{ref_key:"scrollContainerRef",ref:Y,class:"min-h-0 flex-1 overflow-auto scrollbar-hide",onScroll:St},[a("div",{class:"relative min-w-[720px]",style:X({height:`${Ye.value}px`})},[(c(!0),f(q,null,he(xe.value,l=>(c(),f(q,{key:String(l.key)},[G(l.index).type==="section"&&G(l.index).pool==="friend"?(c(),f("div",{key:0,class:"absolute left-0 top-0 h-px w-full",style:X({transform:`translateY(${l.start}px)`}),"aria-hidden":"true"},null,4)):G(l.index).type==="section"?(c(),f("div",{key:1,class:U(["contact-table-grid absolute left-0 top-0 w-full border-b border-gray-100 bg-white px-4 py-3 text-[11px] font-bold uppercase tracking-wider text-gray-400 dark:border-white/5 dark:bg-[#202024] dark:text-gray-500",ye(G(l.index).pool)]),style:X({transform:`translateY(${l.start}px)`})},[a("span",null,o(r(s)("contacts.table.contact")),1),a("span",null,o(r(s)("contacts.table.status")),1),a("span",null,o(r(s)("contacts.metrics.commonGroups")),1),a("span",null,o(r(s)("contacts.metrics.coOccurrence")),1),a("span",null,o(r(s)("contacts.metrics.replies")),1),a("span",null,o(r(s)("contacts.metrics.lastInteractionShort")),1),a("span",Ja,[a("span",Xa,o(r(s)("contacts.detail.score")),1),y($,{content:{side:"top"},ui:{content:"h-auto"}},{content:T(()=>[a("div",Za,o(r(s)("contacts.detail.scoreHelp")),1)]),default:T(()=>[y(L,{name:"i-lucide-circle-help",class:"h-3.5 w-3.5 shrink-0 text-gray-350 transition-colors hover:text-primary-500 dark:text-gray-600 dark:hover:text-primary-400"})]),_:1})])],6)):G(l.index).type==="contact"?(c(),f("button",{key:2,type:"button",class:U(["contact-table-grid absolute left-0 top-0 w-full px-4 py-3.5 text-left outline-none transition-colors duration-200 focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-offset-2 focus-visible:ring-offset-white dark:focus-visible:ring-offset-gray-900",[ye(g(l.index).pool),v.value===g(l.index).contact.key?"border-b border-primary-500/20 bg-primary-500/[0.03] dark:bg-primary-500/[0.04]":"border-b border-gray-100/50 bg-transparent hover:bg-gray-50/50 dark:border-white/5 dark:hover:bg-gray-800/20"]]),style:X({transform:`translateY(${l.start}px)`}),"aria-label":r(s)("contacts.actions.viewDetail",{name:g(l.index).contact.displayName}),onClick:vn=>it(g(l.index).contact)},[a("div",{class:U(["absolute left-0 top-1/4 h-1/2 w-1 rounded-r-full bg-primary-500 transition-all duration-300",v.value===g(l.index).contact.key?"scale-100 opacity-100":"scale-75 opacity-0"])},null,2),a("div",tn,[a("div",an,[g(l.index).contact.avatar?(c(),f("img",{key:0,src:g(l.index).contact.avatar??"",alt:g(l.index).contact.displayName,loading:"lazy",decoding:"async",class:"h-10 w-10 object-cover transition-transform duration-300 group-hover:scale-105"},null,8,nn)):(c(),f("div",sn,o(xt(g(l.index).contact)),1))]),a("div",on,[a("div",rn,[a("span",{class:U(["truncate text-sm font-semibold leading-tight tracking-tight text-gray-800 transition-colors group-hover:text-primary-600 group-focus-visible:text-primary-600 dark:text-gray-200 dark:group-hover:text-primary-400 dark:group-focus-visible:text-primary-400",v.value===g(l.index).contact.key?"text-primary-600 dark:text-primary-400":""])},o(g(l.index).contact.displayName),3)]),a("span",ln,o(g(l.index).contact.platform),1)])]),a("span",{class:U(["inline-flex w-fit justify-self-start rounded-lg px-2.5 py-1 text-xs font-semibold",mt(g(l.index).contact)])},o(ft(g(l.index).contact)),3),a("span",cn,o(pt(g(l.index).pool,g(l.index).contact)),1),a("span",dn,o(gt(g(l.index).pool,g(l.index).contact)),1),a("span",un,o(vt(g(l.index).pool,g(l.index).contact)),1),a("span",fn,o(kt(g(l.index).contact.lastInteractionTs)),1),a("span",{class:U(["inline-flex h-7 w-12 items-center justify-center justify-self-end rounded-lg font-mono text-xs font-bold tabular-nums transition-colors duration-200",v.value===g(l.index).contact.key?"bg-primary-500 text-white":"bg-primary-50 text-primary-600 dark:bg-primary-500/10 dark:text-primary-400"])},o(ht(g(l.index).contact)),3)],14,en)):(c(),f("div",{key:3,class:"absolute left-0 top-0 flex h-11 w-full items-center justify-center gap-2 border-b border-gray-100/50 text-xs font-semibold text-gray-500 dark:border-white/5 dark:text-gray-400",style:X({transform:`translateY(${l.start}px)`})},[y(L,{name:"i-lucide-loader-2",class:"h-4 w-4 animate-spin"}),a("span",null,o(r(s)("common.loading")),1)],4))],64))),128))],4)],544)]),_:1}))]))])])]),y(ma,{"selected-key":v.value,contact:w.value,"is-loading":R.value,"is-friend-action-loading":x.value,onClear:oe,onOpenSource:bt,onViewSourceRecords:_t,onMarkFriend:lt,onUnmarkFriend:ct},null,8,["selected-key","contact","is-loading","is-friend-action-loading"])])])}}}),Tn=De(gn,[["__scopeId","data-v-30c675a1"]]);export{Tn as default};
@@ -1 +0,0 @@
1
- import{f as o,r as S,a as L,a3 as q,aj as B,aC as A,b9 as U,ba as z,bb as H,bc as K,J as G,ak as J,o as p,h as j,z as x,w as _,c as k,e as t,$ as O,bd as F,l as Q,aD as W,k as X,aF as Z,ae as ee}from"./index-Bq5q3kSU.js";import{P as ae}from"./PageHeader-DxhQHF_0.js";import{_ as $}from"./TimeSelect.vue_vue_type_script_setup_true_lang-Cjz8Wpg-.js";import{_ as te}from"./PageTabs.vue_vue_type_script_setup_true_lang-Cgungbjl.js";import"./vendor-snapdom--nZvo8Sg.js";import"./Select-CxurgslB.js";import"./useFormControl-DcSMUc2d.js";import"./clamp-jFYhBC76.js";import"./Tabs-Bnm_Q7yW.js";import"./Tabs-DB603EEu.js";import"./RovingFocusItem-psoFYxrC.js";import"./DatePicker.vue_vue_type_script_setup_true_lang-sPDoPzZ9.js";function oe(u,m,l,f){const s=u?.state;return s&&(!l||l.includes(s.mode))?{...s}:{mode:m,year:f}}function ne(u){return[u.defaultMode,u.allowedModes.join(","),u.allowedRecentDays?.join(",")].join(":")}function se(u,m){const l=new Date().getFullYear(),f=Math.floor(Date.now()/1e3),s=S(null),h=S(l),y=S(0),d=S([l]),v=o(()=>oe(s.value,u?.value??"year",m?.value,h.value)),T=o(()=>{const i=d.value.at(-1)??l;return{availableYears:d.value,fullRange:{start:Math.floor(new Date(i,0,1).getTime()/1e3),end:f}}});function n(i){const g=[...new Set([l,...i])].sort((r,w)=>w-r);g.join(",")!==d.value.join(",")&&(d.value=g)}function R(i){h.value=i,s.value=null,y.value++}return{modelValue:s,componentKey:y,initialState:v,rangeSource:T,setAvailableYears:n,switchToYear:R}}const le={class:"flex h-full flex-col text-gray-900 dark:bg-page-dark dark:text-gray-100",style:{"padding-top":"var(--titlebar-area-height)"}},ie={key:1,class:"mt-3 flex justify-end pb-1.5"},re=L({__name:"index",setup(u){const{t:m}=q(),{translate:l}=B(),f=A(),s=U(),{controller:h,snapshot:y}=z(),d=H(s),v=o(()=>String(f.meta.insightPageId??d[0]?.id??"")),T=o(()=>d.find(e=>e.id===v.value)),n=o(()=>T.value?.filters?.time),R=o(()=>n.value?.defaultMode??"year"),i=o(()=>n.value?[...n.value.allowedModes]:void 0),g=se(R,i),{modelValue:r,componentKey:w,initialState:Y,rangeSource:I}=g,b=s.ui.insightScope;if(!(b instanceof K))throw new Error("Insight scope host controller is unavailable");const N=b.attachTimeCommands({setAvailableYears:g.setAvailableYears,switchToYear:g.switchToYear}),P=G([r,n],([e,c])=>{const a=e?.state;b.updateSnapshot({time:e&&a&&c?.allowedModes.includes(a.mode)?{mode:a.mode,startTs:e.startTs,endTs:e.endTs,isFullRange:e.isFullRange,recentDays:a.recentDays,year:a.year,quarterYear:a.quarterYear,quarter:a.quarter,customStart:a.customStart,customEnd:a.customEnd}:void 0})},{immediate:!0}),E=o(()=>(y.value.revision,h.getResolvedLayout())),D=o(()=>E.value.primary.find(e=>e.kind==="group"&&e.entries.some(({page:c})=>c.id===v.value))),V=o(()=>(D.value?.kind==="group"?D.value.entries:[]).map(({page:e})=>({id:e.id,label:l(e.title),icon:e.icon,to:{name:e.routeName}}))),C=o(()=>n.value?.allowedRecentDays?[...n.value.allowedRecentDays]:void 0),M=o(()=>{const e=n.value;return e?ne(e):"none"});return J(()=>{P(),N(),b.updateSnapshot({})}),(e,c)=>(p(),j("div",le,[x(ae,{title:t(m)("insight.title"),icon:"i-heroicons-presentation-chart-bar","icon-class":"bg-pink-600 text-white dark:bg-pink-500 dark:text-white",size:"compact"},{default:_(()=>[V.value.length>0?(p(),k(t(te),{key:0,class:"mt-3 pb-1.5","model-value":v.value,items:V.value,"aria-label":t(m)("insight.tabs.nav")},O({_:2},[n.value?{name:"right",fn:_(()=>[(p(),k($,{key:`${t(w)}:${M.value}`,modelValue:t(r),"onUpdate:modelValue":c[0]||(c[0]=a=>F(r)?r.value=a:null),"range-source":t(I),"allowed-modes":i.value,"allowed-recent-days":C.value,"initial-state":t(Y)},null,8,["modelValue","range-source","allowed-modes","allowed-recent-days","initial-state"]))]),key:"0"}:void 0]),1032,["model-value","items","aria-label"])):n.value?(p(),j("div",ie,[(p(),k($,{key:`${t(w)}:${M.value}`,modelValue:t(r),"onUpdate:modelValue":c[1]||(c[1]=a=>F(r)?r.value=a:null),"range-source":t(I),"allowed-modes":i.value,"allowed-recent-days":C.value,"initial-state":t(Y)},null,8,["modelValue","range-source","allowed-modes","allowed-recent-days","initial-state"]))])):Q("",!0)]),_:1},8,["title"]),x(t(Z),null,{default:_(({Component:a})=>[x(W,{name:"insight-tab-slide",mode:"out-in"},{default:_(()=>[(p(),k(X(a),{key:v.value}))]),_:2},1024)]),_:1})]))}}),Se=ee(re,[["__scopeId","data-v-74269df3"]]);export{Se as default};
@@ -1,64 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/GroupRelationshipGalaxyView--WIaHx_F.js","assets/index-Bq5q3kSU.js","assets/vendor-snapdom--nZvo8Sg.js","assets/index-DxhAGqYM.css","assets/LoadingState.vue_vue_type_script_setup_true_lang-B_7VHxTx.js","assets/RelationshipGalaxyThreeCanvas-CkefzeFJ.js","assets/relationship-galaxy-connections-Cg4G5yYE.js","assets/relationship-galaxy-viewport-Cwfa51ER.js","assets/RelationshipGalaxyThreeCanvas-CCasBcBQ.css","assets/MessageExportModal-BQsIpyxv.js","assets/useToast-YAHDkKDN.js","assets/Tabs-Bnm_Q7yW.js","assets/Tabs-DB603EEu.js","assets/RovingFocusItem-psoFYxrC.js"])))=>i.map(i=>d[i]);
2
- import{r as T,x as Oe,y as at,a as H,o as l,h as $,n as K,i as o,F as E,j as X,p as b,b as oe,Z as kt,c as k,am as _e,f as y,c0 as wt,E as st,e as t,w as C,z as x,a3 as ee,aL as Ae,l as q,a7 as De,a5 as Ie,a6 as J,a4 as Se,I as je,J as z,K as Q,br as ot,bs as nt,cE as _t,ap as lt,aO as Ye,aP as Xe,cF as $t,$ as Ct,H as Ke,ag as Tt,C as Be,bN as It,aD as it,G as St,cG as Rt,ae as rt,aC as Mt,ax as Lt,ao as Vt,a8 as At,az as Nt,bd as Ze}from"./index-Bq5q3kSU.js";import{b as j,a as ne,c as Dt,d as Je,e as Ft,u as qt,f as ut,I as Bt,g as Ut,h as Ht,i as Pt,j as Et,k as zt,C as Ot,l as jt,L as Kt,D as Wt,m as Gt,n as Yt,o as Xt,M as Zt}from"./ActionToolsPanel.vue_vue_type_script_setup_true_lang-a7RMjjve.js";import{_ as ct}from"./SectionTabs.vue_vue_type_script_setup_true_lang-v_7aRBgM.js";import"./vendor-echarts-wordcloud-B8CF_NgP.js";import{g as Jt,_ as Qt}from"./EChartBar.vue_vue_type_script_setup_true_lang-BdFW-hvt.js";import{_ as ge,L as dt,u as ea}from"./LoadingState.vue_vue_type_script_setup_true_lang-B_7VHxTx.js";import{a as ta}from"./index-Dy0fRMDf.js";import{f as ze,a as aa,b as sa}from"./TimeSelect.vue_vue_type_script_setup_true_lang-Cjz8Wpg-.js";import{_ as oa}from"./Switch-3D81G6uV.js";import{a as mt}from"./Tabs-DB603EEu.js";import{u as na}from"./prompt-DGazz143.js";import{_ as la}from"./Select-CxurgslB.js";import{_ as ae}from"./EChart.vue_vue_type_script_setup_true_lang-DryMSoCz.js";import{T as ie}from"./Tabs-Bnm_Q7yW.js";import{_ as ia}from"./ThemeCard.vue_vue_type_script_setup_true_lang-BDTdkH5i.js";import{u as ra,p as ua,j as ca,t as da,v as ma,i as va,k as pa}from"./vendor-echarts-hTLhTs52.js";import{_ as ga}from"./useTable-Clmq3sge.js";import"./vendor-snapdom--nZvo8Sg.js";import"./Checkbox-EfpQmv4A.js";import"./useFormControl-DcSMUc2d.js";import"./VisuallyHiddenInput-Bo_XwaLu.js";import"./RovingFocusItem-psoFYxrC.js";import"./Label-CIuDXyeM.js";import"./useToast-YAHDkKDN.js";import"./service-CAp0YJoS.js";import"./aiChat-BCzYQeZq.js";import"./chatlabSiteLocale-CrCNb8QP.js";import"./ChatRecordWorkspace-DqUI4QiU.js";import"./DatePicker.vue_vue_type_script_setup_true_lang-sPDoPzZ9.js";import"./clamp-jFYhBC76.js";import"./EChartLine.vue_vue_type_script_setup_true_lang-C69Kdw9X.js";import"./semantic-index-config-builder-BkFHzIUy.js";import"./PageHeader-DxhQHF_0.js";import"./PageTabs.vue_vue_type_script_setup_true_lang-Cgungbjl.js";import"./Alert-D-egBWcb.js";import"./vendor-zrender-D8psf1AA.js";function ha(n,e={}){const{threshold:a=300,containerSelector:s=".overflow-y-auto",scrollLockDuration:u=800}=e,i=T(n[0]?.id||"");let c=!1;const p=T(null);let m=null;function f(){if(c)return;const v=[];n.forEach(d=>{const w=document.getElementById(d.id);if(w){const I=w.getBoundingClientRect();v.push({id:d.id,top:Math.round(I.top)})}});let r=0;for(let d=0;d<v.length;d++){if(v[d].top>a){r=Math.max(0,d-1);break}r=d}i.value=n[r]?.id||""}function h(v){const r=document.getElementById(v);r&&(i.value=v,c=!0,r.scrollIntoView({behavior:"smooth",block:"start"}),setTimeout(()=>{c=!1,f()},u))}return Oe(()=>{m=p.value?.closest(s)||null,m&&(m.addEventListener("scroll",f,{passive:!0}),f())}),at(()=>{m&&m.removeEventListener("scroll",f)}),{contentRef:p,activeAnchor:i,scrollToAnchor:h,updateActiveAnchor:f}}function $e(n){return n===0?"text-amber-500 dark:text-amber-400":n===1?"text-gray-500 dark:text-gray-300":n===2?"text-orange-600 dark:text-orange-400":"text-gray-400 dark:text-gray-500"}function Ce(n){return String(n+1).padStart(2,"0")}function fa(n){return n===0?"from-amber-400 to-orange-500":n===1?"from-gray-300 to-gray-400":n===2?"from-orange-400 to-amber-600":"from-primary-300 to-primary-500"}const ya={class:"sticky top-24 space-y-6"},ba={class:"border-l border-gray-200 dark:border-gray-800"},xa=["onClick"],ka=H({__name:"PageAnchorsNav",props:{anchors:{},activeAnchor:{},width:{default:"w-44"},hideOnMobile:{type:Boolean,default:!0}},emits:["click"],setup(n,{emit:e}){const a=e;function s(u){a("click",u)}return(u,i)=>(l(),$("div",{class:K([n.width,"shrink-0",n.hideOnMobile?"hidden lg:block":""])},[o("div",ya,[o("nav",null,[o("div",ba,[(l(!0),$(E,null,X(n.anchors,c=>(l(),$("button",{key:c.id,class:K(["-ml-px block border-l-2 py-1.5 pl-4 text-left text-sm transition-colors",[n.activeAnchor===c.id?"border-pink-500 font-medium text-pink-600 dark:text-pink-400":"border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300"]]),onClick:p=>s(c.id)},b(c.label),11,xa))),128))])]),oe(u.$slots,"default")])],2))}}),re=H({__name:"TopNSelect",props:{modelValue:{default:10},modelModifiers:{}},emits:["update:modelValue"],setup(n){const e=kt(n,"modelValue"),a=[{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(s,u)=>{const i=la;return l(),k(i,{modelValue:e.value,"onUpdate:modelValue":u[0]||(u[0]=c=>e.value=c),items:a,"value-key":"value",class:"w-25"},null,8,["modelValue"])}}}),he=H({__name:"ScrollableChart",props:{contentHeight:{},maxHeightVh:{default:60},paddingClass:{default:"px-3 py-2"}},setup(n){const e=n,a=y(()=>typeof window>"u"?500:Math.round(window.innerHeight*e.maxHeightVh/100)),s=y(()=>e.contentHeight>a.value),u=y(()=>({maxHeight:`${e.maxHeightVh}vh`,overflowY:s.value?"auto":"hidden"}));return(i,c)=>(l(),$("div",{class:K(n.paddingClass),style:_e(u.value)},[oe(i.$slots,"default")],6))}}),vt=Symbol("ranking-avatar-map"),wa=new Map,_a={byId:wa,byName:new Map},$a=36,Ue=new Map,He=new Set,Qe=new Set,et=T(0);function Ca(n){const e=new Map;for(const a of n){const s=a.avatar?.trim();e.set(a.id,s||null)}return e}function Ta(n){const e=n?.trim();return e||null}function we(n,e,a){const s=e?.trim();!s||n.get(s)||(a?n.set(s,a):n.has(s)||n.set(s,null))}function Ia(n){const e=new Map;for(const a of n){const s=Ta(a.avatar);we(e,a.groupNickname,s),we(e,a.accountName,s),we(e,a.platformId,s),we(e,a.groupNickname||a.accountName||a.platformId,s);for(const u of a.aliases??[])we(e,u,s)}return e}function Sa(n){return{byId:Ca(n),byName:Ia(n)}}function ve(n,e,a,s){const u=e?.trim();if(u)return u;if(n!=null&&n!==""){const p=typeof n=="number"?n:Number(n);if(Number.isFinite(p)){const m=a.get(p);if(m)return m}}const i=s?.name?.trim();if(i&&s?.byName)return s.byName.get(i)??null;if(n==null||n==="")return null;const c=typeof n=="number"?n:Number(n);return Number.isFinite(c)?a.get(c)??null:null}function Te(n){const e=n.trim();return e?e.slice(0,1):"?"}function pt(){const n=st(vt,null);return y(()=>n?.value??_a)}function We(){const n=pt();return y(()=>n.value.byId)}function Ra(n,e){return n?e.get(n)??null:null}function Ma(n,e=$a){return typeof Image>"u"||typeof document>"u"?Promise.resolve(null):new Promise(a=>{const s=new Image;/^https?:/i.test(n)&&(s.crossOrigin="anonymous"),s.onload=()=>{try{const u=document.createElement("canvas");u.width=e,u.height=e;const i=u.getContext("2d");if(!i){a(null);return}i.beginPath(),i.arc(e/2,e/2,e/2,0,Math.PI*2),i.closePath(),i.clip();const c=s.naturalWidth||s.width,p=s.naturalHeight||s.height;if(c<=0||p<=0){a(null);return}const m=Math.max(e/c,e/p),f=c*m,h=p*m;i.drawImage(s,(e-f)/2,(e-h)/2,f,h),a(u.toDataURL("image/png"))}catch{a(null)}},s.onerror=()=>a(null),s.src=n})}function fe(n){const e=We();return wt(()=>{const a=e.value;for(const s of n()){const u=ve(s.memberId??s.id,s.avatar,a);!u||Ue.has(u)||Qe.has(u)||He.has(u)||(He.add(u),Ma(u).then(i=>{He.delete(u),i?Ue.set(u,i):Qe.add(u),et.value+=1}))}}),y(()=>{et.value;const a=e.value,s=new Map;for(const u of n()){const i=u.memberId??u.id,c=typeof i=="number"?i:Number(i);if(!Number.isFinite(c))continue;const p=ve(i,u.avatar,a);s.set(c,Ra(p,Ue))}return s})}const Pe=28,me=18,Ee="#4b5563",gt=Symbol("ranking-width-mode"),ht={standard:{contentClass:"max-w-3xl",gridLeft:110+Pe,labelMaxLength:8},wide:{contentClass:"max-w-5xl",gridLeft:180+Pe,labelMaxLength:16},full:{contentClass:"max-w-none",gridLeft:260+Pe,labelMaxLength:28}};function La(n){return n===1?"🥇":n===2?"🥈":n===3?"🥉":`${n}.`}function ye(){const n=st(gt,null);return y(()=>ht[n?.value??"standard"])}function Va(n,e){return n.length<=e?n:`${n.slice(0,e)}…`}function Aa(n){return n?{width:me,height:me,borderRadius:me/2,backgroundColor:{image:n},align:"center",verticalAlign:"middle"}:{width:me,height:me,borderRadius:me/2,backgroundColor:"#fce7f3",color:"#db2777",fontSize:10,fontWeight:600,align:"center",verticalAlign:"middle",lineHeight:me}}function be(n,e){const a=n.map(u=>Va(u.name,e.labelMaxLength)),s={rank:{fontSize:12,color:Ee,padding:[0,4,0,4]},name:{fontSize:12,color:Ee}};return n.forEach((u,i)=>{const c=ve(u.memberId??u.id,void 0,e.avatars);s[`av${i}`]=Aa(c)}),{data:a,axisLabel:{fontSize:12,color:Ee,margin:8,formatter:(u,i)=>{const c=n[i];if(!c)return"";const p=e.totalCount-i,f=ve(c.memberId??c.id,void 0,e.avatars)?"":Te(c.name);return`{av${i}|${f}}{rank|${La(p)}}{name|${a[i]??""}}`},rich:s}}}const Na={class:"px-3 py-2"},Fe=H({__name:"EChartRank",props:{members:{},title:{},description:{},topN:{default:10},unit:{default:"条"},height:{default:"auto"},maxHeightVh:{default:60},bare:{type:Boolean,default:!1}},setup(n){const e=n,a=ye(),s=y(()=>e.members.slice(0,e.topN)),u=fe(()=>s.value),i=y(()=>{if(e.height!=="auto")return e.height;const m=s.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"}]},p=y(()=>{const m=[...s.value].reverse(),f=be(m,{totalCount:s.value.length,labelMaxLength:a.value.labelMaxLength,avatars:u.value}),h=m.map(d=>d.value),v=Math.max(...h,1),r=m.map(d=>({value:d.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:d=>{const w=d[0];if(!w)return"";const I=s.value.length-1-w.dataIndex,g=s.value[I];return`
3
- <div style="padding: 4px 8px;">
4
- <div style="font-weight: bold; margin-bottom: 4px;">${g.name}</div>
5
- <div>${g.value} ${e.unit} (${g.percentage}%)</div>
6
- </div>
7
- `}},grid:{left:a.value.gridLeft,right:70,top:15,bottom:15,containLabel:!1},xAxis:{type:"value",max:v*1.1,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1}},yAxis:{type:"category",data:f.data,axisLine:{show:!1},axisTick:{show:!1},axisLabel:f.axisLabel},series:[{type:"bar",data:r,barWidth:18,barCategoryGap:"30%",label:{show:!0,position:"right",distance:8,formatter:d=>{const w=s.value.length-1-d.dataIndex;return`${s.value[w].value} ${e.unit}`},fontSize:11,fontWeight:500,color:"#6b7280"},emphasis:{itemStyle:{shadowBlur:6,shadowColor:"rgba(238, 69, 103, 0.3)"}}}]}});return(m,f)=>n.bare?(l(),k(t(he),{key:0,"content-height":i.value,"max-height-vh":n.maxHeightVh},{default:C(()=>[x(ae,{option:p.value,height:i.value},null,8,["option","height"])]),_:1},8,["content-height","max-height-vh"])):(l(),k(t(j),{key:1,title:n.title,description:n.description,scrollable:"","max-height-vh":n.maxHeightVh},{default:C(()=>[o("div",Na,[x(ae,{option:p.value,height:i.value},null,8,["option","height"])])]),_:1},8,["title","description","max-height-vh"]))}}),Da={class:"min-w-0 flex-1"},Fa={class:"flex items-baseline justify-between gap-3"},qa=["title"],Ba={class:"flex shrink-0 items-baseline gap-1.5 whitespace-nowrap"},Ua={class:"font-mono text-base font-black tabular-nums text-gray-900 dark:text-white"},Ha={class:"text-xs text-gray-500 dark:text-gray-400"},Pa={class:"mt-2 flex items-center gap-2.5"},Ea={class:"h-1.5 flex-1 overflow-hidden rounded-full bg-gray-100 dark:bg-white/5"},za={class:"w-10 shrink-0 text-right font-mono text-[11px] tabular-nums text-gray-400 dark:text-gray-500"},tt=H({__name:"RankList",props:{members:{},showAvatar:{type:Boolean,default:!1},rankLimit:{default:0},unit:{}},setup(n){const{t:e}=ee(),a=n,s=y(()=>a.unit||e("views.charts.rankList.unit")),u=We(),i=y(()=>a.rankLimit>0?a.members.slice(0,a.rankLimit):a.members);function c(m){return ve(m.id,m.avatar,u.value)}function p(m){if(i.value.length===0)return 0;const f=i.value[0].value;return f===0?0:Math.round(i.value[m].value/f*100)}return(m,f)=>(l(),$("div",null,[(l(!0),$(E,null,X(i.value,(h,v)=>(l(),$("div",{key:h.id,class:"flex items-start gap-3 px-5 py-3.5 transition-colors hover:bg-gray-50/70 dark:hover:bg-white/5"},[o("span",{class:K(["w-8 shrink-0 pt-0.5 text-center font-mono text-sm font-black tabular-nums",t($e)(v)])},b(t(Ce)(v)),3),n.showAvatar?(l(),k(Ae,{key:0,src:c(h),alt:h.name,text:t(Te)(h.name),"root-class":"h-10 w-10 shrink-0","image-class":"h-10 w-10 rounded-full object-cover","fallback-class":"flex h-10 w-10 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"},null,8,["src","alt","text"])):q("",!0),o("div",Da,[o("div",Fa,[o("p",{class:"truncate text-sm font-medium text-gray-900 dark:text-white",title:h.name},b(h.name),9,qa),o("div",Ba,[o("span",Ua,b(h.value),1),o("span",Ha,b(s.value),1)])]),o("div",Pa,[o("div",Ea,[o("div",{class:K(["h-full rounded-full bg-linear-to-r transition-all",t(fa)(v)]),style:_e({width:`${p(v)}%`})},null,6)]),o("span",za,b(h.percentage)+"% ",1)])])]))),128))]))}}),Oa={class:"flex items-center gap-2"},ja={class:"shrink-0 whitespace-nowrap rounded-full bg-gray-100 px-2.5 py-1 text-[11px] font-medium text-gray-500 dark:bg-white/5 dark:text-gray-400"},Ka={class:"no-capture"},Wa={key:0,class:"no-capture px-3 pb-3 pt-1"},Ga={class:"flex items-center gap-1.5"},Ya={class:"flex w-full items-center justify-between border-b border-gray-100 px-6 py-5 dark:border-white/5"},Xa={class:"min-w-0"},Za={class:"truncate text-base font-semibold text-gray-900 dark:text-white"},Ja={class:"mt-1 text-xs text-gray-500 dark:text-gray-400"},Qa={class:"max-h-[70vh] overflow-y-auto"},ft=H({__name:"ExpandableListCard",props:{title:{},description:{},showViewAll:{type:Boolean},viewAllLabel:{},countLabel:{}},setup(n){const e=T(!1),a=T(null);return(s,u)=>{const i=Se,c=Ie,p=De;return l(),k(t(j),{title:n.title,description:n.description,"show-divider":!1},{headerRight:C(()=>[o("div",Oa,[o("span",ja,b(n.countLabel),1),o("div",Ka,[oe(s.$slots,"headerRight")])])]),default:C(()=>[o("div",null,[oe(s.$slots,"default")]),n.showViewAll?(l(),$("div",Wa,[x(p,{open:e.value,"onUpdate:open":u[0]||(u[0]=m=>e.value=m),ui:{content:"md:w-full max-w-4xl"}},{content:C(()=>[o("div",{ref_key:"modalBodyRef",ref:a,class:"section-content flex flex-col overflow-hidden"},[o("div",Ya,[o("div",Xa,[o("h3",Za,b(n.title),1),o("p",Ja,b(n.countLabel),1)]),x(ta,{size:"xs",type:"element","target-element":a.value},null,8,["target-element"])]),o("div",Qa,[oe(s.$slots,"full")])],512)]),default:C(()=>[x(c,{color:"neutral",variant:"ghost",class:"w-full justify-center rounded-lg py-2.5 text-xs font-medium text-gray-500 dark:text-gray-400"},{default:C(()=>[o("span",Ga,[J(b(n.viewAllLabel)+" ",1),x(i,{name:"i-heroicons-arrow-right",class:"h-3.5 w-3.5"})])]),_:1})]),_:3},8,["open"])])):q("",!0)]),_:3},8,["title","description"])}}}),es=H({__name:"RankListPro",props:{members:{},title:{},description:{},topN:{default:10},unit:{}},setup(n){const{t:e}=ee(),a=n,s=y(()=>a.members.slice(0,a.topN)),u=y(()=>a.members.length>a.topN);return(i,c)=>(l(),k(ft,{title:n.title,description:n.description,"show-view-all":u.value,"view-all-label":t(e)("views.charts.rankListPro.fullRanking"),"count-label":t(e)("views.charts.rankListPro.memberCount",{count:n.members.length})},{headerRight:C(()=>[oe(i.$slots,"headerRight")]),full:C(()=>[x(tt,{members:n.members,unit:n.unit,"show-avatar":""},null,8,["members","unit"])]),default:C(()=>[x(tt,{members:s.value,unit:n.unit,"show-avatar":""},null,8,["members","unit"])]),_:3},8,["title","description","show-view-all","view-all-label","count-label"]))}}),ts={key:0},as={class:"px-5 py-8 text-center text-sm text-gray-400"},Ne=H({__name:"ListPro",props:{items:{},title:{},description:{},topN:{default:10},countLabel:{}},setup(n){const{t:e}=ee(),a=n,s=y(()=>a.items.slice(0,a.topN)),u=y(()=>a.items.length>a.topN),i=y(()=>a.countLabel?a.countLabel:e("views.charts.listPro.countTemplate",{count:a.items.length}));return(c,p)=>(l(),k(ft,{title:n.title,description:n.description,"show-view-all":u.value,"view-all-label":t(e)("views.charts.listPro.fullRanking"),"count-label":i.value},{headerRight:C(()=>[oe(c.$slots,"headerRight")]),full:C(()=>[o("div",null,[(l(!0),$(E,null,X(n.items,(m,f)=>(l(),$("div",{key:f,class:"group/list-row px-5 py-3.5 transition-colors hover:bg-gray-50/70 dark:hover:bg-white/5"},[oe(c.$slots,"item",{item:m,index:f})]))),128))])]),default:C(()=>[oe(c.$slots,"config"),o("div",null,[(l(!0),$(E,null,X(s.value,(m,f)=>(l(),$("div",{key:f,class:"group/list-row px-5 py-3.5 transition-colors hover:bg-gray-50/70 dark:hover:bg-white/5"},[oe(c.$slots,"item",{item:m,index:f})]))),128))]),n.items.length===0?(l(),$("div",ts,[oe(c.$slots,"empty",{},()=>[o("div",as,b(t(e)("views.charts.listPro.empty")),1)])])):q("",!0)]),_:3},8,["title","description","show-view-all","view-all-label","count-label"]))}});function ss(n,e){return{keywords:[n],...e?.memberId!=null?{memberId:e.memberId}:{}}}const os={class:"main-content mx-auto max-w-3xl p-6"},ns=["aria-label","onClick"],ls=["title"],is={class:"flex shrink-0 items-center gap-3 pl-2"},rs={class:"font-mono text-sm font-black tabular-nums text-primary-600 dark:text-primary-400"},us={class:"grid w-full grid-cols-[2rem_2rem_minmax(0,1fr)] items-start gap-x-3 sm:grid-cols-[2rem_2rem_minmax(7.5rem,0.65fr)_minmax(0,1.35fr)]"},cs=["title"],ds={class:"col-start-3 row-start-2 mt-1.5 flex min-w-0 flex-wrap items-center gap-x-4 gap-y-1.5 sm:col-start-4 sm:row-start-1 sm:mt-0"},ms=["title","aria-label","onClick"],vs={class:"max-w-40 truncate text-sm text-gray-700 transition-colors group-hover/phrase:text-primary-600 dark:text-gray-200 dark:group-hover/phrase:text-primary-400"},ps={class:"shrink-0 font-mono text-[11px] tabular-nums text-gray-400 dark:text-gray-500"},gs=H({__name:"CatchphraseTab",props:{sessionId:{},timeFilter:{}},setup(n){const{t:e}=ee(),a=je(),s=We();function u(g){return ve(g.memberId,void 0,s.value)}const i=n,c=T(null),p=T(!1),m=y(()=>c.value?.members??[]),f=y(()=>i.timeFilter?.memberId!=null),h=y(()=>f.value?m.value[0]??null:null),v=y(()=>h.value?e("quotes.catchphrase.memberTitle",{name:h.value.name}):e("quotes.catchphrase.title")),r=y(()=>f.value?e("quotes.catchphrase.memberDescription"):e("quotes.catchphrase.description"));async function d(){if(i.sessionId){p.value=!0;try{c.value=await Q().getCatchphraseAnalysis(i.sessionId,i.timeFilter)}catch(g){console.error("Failed to load catchphrase analysis:",g)}finally{p.value=!1}}}function w(g){a.openChatRecordDrawer(ss(g,i.timeFilter))}function I(g){return g.catchphrases.slice(0,5)}return z(()=>[i.sessionId,i.timeFilter],()=>{d()},{immediate:!0,deep:!0}),(g,S)=>{const _=Se;return l(),$("div",os,[p.value?(l(),k(t(ge),{key:0,text:t(e)("quotes.catchphrase.loading")},null,8,["text"])):h.value?(l(),k(t(Ne),{key:1,items:h.value.catchphrases,title:v.value,description:r.value,"top-n":10,"count-label":t(e)("quotes.catchphrase.phraseCount",{count:h.value.catchphrases.length})},{headerRight:C(()=>[h.value?(l(),k(Ae,{key:0,src:u(h.value),alt:h.value.name,text:t(Te)(h.value.name),"root-class":"h-8 w-8 shrink-0","image-class":"h-8 w-8 rounded-full object-cover","fallback-class":"flex h-8 w-8 items-center justify-center rounded-full bg-linear-to-br from-pink-100 to-rose-100 text-[10px] font-medium text-pink-600 dark:from-pink-900/30 dark:to-rose-900/30 dark:text-pink-400"},null,8,["src","alt","text"])):q("",!0)]),item:C(({item:M,index:L})=>[o("button",{type:"button",class:"group/item grid w-full grid-cols-[2rem_minmax(0,1fr)_auto] items-center gap-3 rounded-lg text-left outline-none focus-visible:ring-2 focus-visible:ring-primary-500/40","aria-label":`${t(e)("quotes.catchphrase.viewChat")}: ${M.content}`,onClick:W=>w(M.content)},[o("span",{class:K(["w-8 shrink-0 text-center font-mono text-sm font-black tabular-nums",t($e)(L)])},b(t(Ce)(L)),3),o("p",{class:"line-clamp-2 min-w-0 text-sm font-medium leading-5 text-gray-900 dark:text-white",title:M.content},b(M.content),9,ls),o("div",is,[o("span",rs,b(t(e)("quotes.catchphrase.times",{count:M.count})),1),x(_,{name:"i-heroicons-chevron-right",class:"h-4 w-4 text-gray-300 transition-colors group-hover/item:text-gray-500 dark:text-gray-600 dark:group-hover/item:text-gray-400"})])],8,ns)]),_:1},8,["items","title","description","count-label"])):m.value.length>0?(l(),k(t(Ne),{key:2,items:m.value,title:v.value,description:r.value,"top-n":10,"count-label":t(e)("quotes.catchphrase.memberCount",{count:m.value.length})},{item:C(({item:M,index:L})=>[o("div",us,[o("span",{class:K(["row-span-2 w-8 shrink-0 pt-0.5 text-center font-mono text-sm font-black tabular-nums sm:row-span-1",t($e)(L)])},b(t(Ce)(L)),3),x(Ae,{src:u(M),alt:M.name,text:t(Te)(M.name),"root-class":"col-start-2 row-span-2 h-8 w-8 shrink-0 sm:row-span-1","image-class":"h-8 w-8 rounded-full object-cover","fallback-class":"flex h-8 w-8 items-center justify-center rounded-full bg-linear-to-br from-pink-100 to-rose-100 text-[10px] font-medium text-pink-600 dark:from-pink-900/30 dark:to-rose-900/30 dark:text-pink-400"},null,8,["src","alt","text"]),o("p",{class:"col-start-3 row-start-1 min-w-0 truncate pt-0.5 text-sm font-semibold text-gray-900 dark:text-white",title:M.name},b(M.name),9,cs),o("div",ds,[(l(!0),$(E,null,X(I(M),W=>(l(),$("button",{key:W.content,type:"button",class:"group/phrase inline-flex max-w-full items-baseline gap-1 rounded text-left outline-none focus-visible:ring-2 focus-visible:ring-primary-500/40",title:W.content,"aria-label":`${t(e)("quotes.catchphrase.viewChat")}: ${W.content}`,onClick:V=>w(W.content)},[o("span",vs," “"+b(W.content)+"” ",1),o("span",ps,b(t(e)("quotes.catchphrase.times",{count:W.count})),1)],8,ms))),128))])])]),_:1},8,["items","title","description","count-label"])):(l(),k(t(j),{key:3,title:v.value,description:r.value,"show-divider":!1},{default:C(()=>[x(t(ne),{text:t(e)("quotes.catchphrase.empty.title")},null,8,["text"])]),_:1},8,["title","description"]))])}}}),hs={class:"main-content mx-auto max-w-3xl p-6"},fs=["aria-label","onClick"],ys={class:"min-w-0"},bs=["title"],xs={class:"mt-1 flex min-w-0 items-center gap-1.5 text-xs text-gray-400 dark:text-gray-500"},ks={class:"truncate"},ws={class:"shrink-0"},_s={class:"flex shrink-0 items-center gap-3 pl-2"},$s={class:"text-right"},Cs={class:"font-mono text-sm font-black tabular-nums text-primary-600 dark:text-primary-400"},Ts={class:"mt-0.5 text-[11px] text-gray-400 dark:text-gray-500"},Is=H({__name:"HotRepeatTab",props:{sessionId:{},timeFilter:{}},setup(n){const{t:e}=ee(),a=n,s=je(),u=pt();function i(h){return ve(h.originatorId,void 0,u.value.byId,{name:h.originatorName,byName:u.value.byName})}const c=T(null),p=T(!1);async function m(){if(a.sessionId){p.value=!0;try{c.value=await Q().getRepeatAnalysis(a.sessionId,a.timeFilter)}catch(h){console.error("Failed to load repeat analysis:",h)}finally{p.value=!1}}}function f(h){s.openChatRecordDrawer({scrollToMessageId:h.firstMessageId,highlightKeywords:[h.content]})}return z(()=>[a.sessionId,a.timeFilter],()=>{m()},{immediate:!0,deep:!0}),(h,v)=>{const r=Se;return l(),$("div",hs,[p.value?(l(),k(t(ge),{key:0,text:t(e)("quotes.hotRepeat.loading")},null,8,["text"])):c.value&&c.value.hotContents.length>0?(l(),k(t(Ne),{key:1,items:c.value.hotContents,title:t(e)("quotes.hotRepeat.title"),description:t(e)("quotes.hotRepeat.description"),"top-n":10,"count-label":t(e)("quotes.hotRepeat.countTemplate",{count:c.value.hotContents.length})},{item:C(({item:d,index:w})=>[o("button",{type:"button",class:"group/item grid w-full grid-cols-[2rem_2rem_minmax(0,1fr)_auto] items-start gap-3 rounded-lg text-left outline-none focus-visible:ring-2 focus-visible:ring-primary-500/40","aria-label":`${t(e)("quotes.hotRepeat.viewChat")}: ${d.content}`,onClick:I=>f(d)},[o("span",{class:K(["w-8 shrink-0 pt-0.5 text-center font-mono text-sm font-black tabular-nums",t($e)(w)])},b(t(Ce)(w)),3),x(Ae,{src:i(d),alt:d.originatorName,text:t(Te)(d.originatorName),"root-class":"h-8 w-8 shrink-0","image-class":"h-8 w-8 rounded-full object-cover","fallback-class":"flex h-8 w-8 items-center justify-center rounded-full bg-linear-to-br from-pink-100 to-rose-100 text-[10px] font-medium text-pink-600 dark:from-pink-900/30 dark:to-rose-900/30 dark:text-pink-400"},null,8,["src","alt","text"]),o("div",ys,[o("p",{class:"line-clamp-2 text-sm font-medium leading-5 text-gray-900 dark:text-white",title:d.content},b(d.content),9,bs),o("div",xs,[o("span",ks,b(d.originatorName),1),v[0]||(v[0]=o("span",{"aria-hidden":"true"},"·",-1)),o("span",ws,b(t(ze)(d.lastTs)),1)])]),o("div",_s,[o("div",$s,[o("p",Cs,b(t(e)("quotes.hotRepeat.people",{count:d.maxChainLength})),1),o("p",Ts,b(t(e)("quotes.hotRepeat.times",{count:d.count})),1)]),x(r,{name:"i-heroicons-chevron-right",class:"h-4 w-4 text-gray-300 transition-colors group-hover/item:text-gray-500 dark:text-gray-600 dark:group-hover/item:text-gray-400"})])],8,fs)]),_:1},8,["items","title","description","count-label"])):(l(),k(t(j),{key:2,title:t(e)("quotes.hotRepeat.title")},{default:C(()=>[x(t(ne),{text:t(e)("quotes.hotRepeat.empty")},null,8,["text"])]),_:1},8,["title"]))])}}}),Ss={class:"main-content mx-auto max-w-[920px] space-y-4 p-4 sm:space-y-6 sm:p-6"},Rs={class:"grid grid-cols-1 gap-6 lg:grid-cols-2"},Ms={class:"p-3 sm:p-5"},Ls={class:"p-3 sm:p-5"},Vs=H({__name:"GroupChatOverview",props:{session:{},memberActivity:{},messageTypes:{},hourlyActivity:{},dailyActivity:{},timeRange:{},filteredMessageCount:{},filteredMemberCount:{},timeFilter:{}},setup(n){const{t:e}=ee(),a=n,{dailyChartData:s}=qt(()=>a.dailyActivity),u=y(()=>({labels:a.messageTypes.map(c=>Jt(c.type,e)),values:a.messageTypes.map(c=>c.count)})),i=y(()=>{const c=[...a.memberActivity].sort((v,r)=>r.messageCount-v.messageCount),p=c.slice(0,10),m=c.slice(10).reduce((v,r)=>v+r.messageCount,0),f=p.map(v=>v.name),h=p.map(v=>v.messageCount);return m>0&&(f.push(e("analysis.overview.others")),h.push(m)),{labels:f,values:h}});return(c,p)=>(l(),$("div",Ss,[x(Dt,{session:n.session,"daily-activity":n.dailyActivity,"message-types":n.messageTypes,"hourly-activity":n.hourlyActivity,"time-range":n.timeRange,"filtered-message-count":n.filteredMessageCount,"filtered-member-count":n.filteredMemberCount,"time-filter":n.timeFilter},null,8,["session","daily-activity","message-types","hourly-activity","time-range","filtered-message-count","filtered-member-count","time-filter"]),o("div",Rs,[x(t(j),{title:t(e)("analysis.overview.messageTypeDistribution"),"show-divider":!1},{default:C(()=>[o("div",Ms,[x(t(Je),{data:u.value,height:280},null,8,["data"])])]),_:1},8,["title"]),x(t(j),{title:t(e)("analysis.overview.memberDistribution"),"show-divider":!1},{default:C(()=>[o("div",Ls,[x(t(Je),{data:i.value,height:280},null,8,["data"])])]),_:1},8,["title"])]),x(Ft,{"daily-activity":n.dailyActivity,"daily-chart-data":t(s)},null,8,["daily-activity","daily-chart-data"])]))}}),As={class:"flex h-full flex-col"},Ns={class:"min-h-0 flex-1 overflow-y-auto"},Ds=H({__name:"GroupChatInsights",props:{sessionId:{},session:{},memberActivity:{},messageTypes:{},hourlyActivity:{},dailyActivity:{},timeRange:{},filteredMessageCount:{},filteredMemberCount:{},timeFilter:{}},setup(n){const e=ot(()=>nt(()=>import("./GroupRelationshipGalaxyView--WIaHx_F.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8]))),{t:a}=ee(),s=n,u=y(()=>[{id:"overview",label:a("analysis.tabs.overview"),icon:"i-heroicons-squares-2x2"},{id:"type-analysis",label:a("analysis.subTabs.insights.typeAnalysis"),icon:"i-heroicons-chart-pie"},{id:"time-analysis",label:a("analysis.subTabs.insights.timeAnalysis"),icon:"i-heroicons-clock"},{id:"topic",label:a("analysis.subTabs.insights.topic"),icon:"i-heroicons-cloud"},{id:"relationship",label:a("analysis.subTabs.insights.relationship"),icon:"i-heroicons-heart"}]),i=T("overview"),c=T(null),p=y(()=>({...s.timeFilter,memberId:c.value}));return(m,f)=>(l(),$("div",As,[x(t(ct),{modelValue:i.value,"onUpdate:modelValue":f[1]||(f[1]=h=>i.value=h),items:u.value,"persist-key":"groupInsightsTab"},{right:C(()=>[i.value==="type-analysis"||i.value==="time-analysis"?(l(),k(ut,{key:0,modelValue:c.value,"onUpdate:modelValue":f[0]||(f[0]=h=>c.value=h),"session-id":s.sessionId},null,8,["modelValue","session-id"])):q("",!0)]),_:1},8,["modelValue","items"]),o("div",Ns,[x(t(Bt),{"active-key":i.value},{default:C(({viewKey:h})=>[h==="overview"?(l(),k(Vs,{key:0,session:s.session,"member-activity":s.memberActivity,"message-types":s.messageTypes,"hourly-activity":s.hourlyActivity,"daily-activity":s.dailyActivity,"time-range":s.timeRange,"filtered-message-count":s.filteredMessageCount,"filtered-member-count":s.filteredMemberCount,"time-filter":s.timeFilter},null,8,["session","member-activity","message-types","hourly-activity","daily-activity","time-range","filtered-message-count","filtered-member-count","time-filter"])):h==="type-analysis"?(l(),k(Ut,{key:1,"session-id":s.sessionId,"session-name":s.session.name,"time-filter":p.value},null,8,["session-id","session-name","time-filter"])):h==="time-analysis"?(l(),k(Ht,{key:2,"session-id":s.sessionId,"session-name":s.session.name,"time-filter":p.value},null,8,["session-id","session-name","time-filter"])):h==="topic"?(l(),k(t(Pt),{key:3,"session-id":s.sessionId,"time-filter":s.timeFilter},null,8,["session-id","time-filter"])):h==="relationship"?(l(),k(t(e),{key:4,"session-id":s.sessionId,"time-filter":s.timeFilter},null,8,["session-id","time-filter"])):q("",!0)]),_:1},8,["active-key"])])]))}}),Fs={class:"border-b border-gray-100 p-4 dark:border-gray-800"},qs={class:"mb-3 flex flex-wrap items-center gap-2"},Bs={class:"text-xs text-gray-500 dark:text-gray-400"},Us=["onClick"],Hs={class:"p-4"},Ps={class:"mb-3 font-semibold text-gray-900 dark:text-white"},Es={class:"space-y-3"},zs={class:"mb-1 block text-xs text-gray-500"},Os={class:"mb-1 block text-xs text-gray-500"},js={class:"flex flex-wrap items-center gap-2"},Ks={class:"mt-4 flex justify-end gap-2"},Ws={class:"flex flex-wrap items-center gap-2"},Gs={class:"mt-1.5 text-xs text-gray-400"},Ys={key:0,class:"border-b border-gray-100 px-5 py-4 dark:border-gray-800"},Xs={class:"mb-3 flex items-center justify-between"},Zs={class:"text-base font-medium text-gray-700 dark:text-gray-300"},Js={class:"flex cursor-pointer items-center gap-1.5 text-xs text-gray-500"},Qs={class:"flex flex-wrap gap-2"},eo={class:"text-xs text-gray-500"},to={class:"flex items-center gap-3"},ao={class:"w-32 shrink-0"},so={class:"truncate font-medium text-gray-900 dark:text-white"},oo={class:"flex flex-1 items-center"},no={class:"flex h-2 w-full overflow-hidden rounded-full bg-gray-100 dark:bg-white/5"},lo=["title"],io={class:"flex shrink-0 items-baseline gap-2"},ro={class:"font-mono text-base font-black tabular-nums text-gray-900 dark:text-white"},uo={class:"text-xs text-gray-500"},co={key:0,class:"flex h-64 flex-col items-center justify-center text-gray-400"},mo={class:"text-sm"},vo={key:1,class:"h-64"},po=H({__name:"KeywordRankingTab",props:{sessionId:{},timeFilter:{}},setup(n){const{t:e}=ee(),a=n,s=na(),u=T(!1),i={bg:"bg-pink-400",text:"text-pink-700",badge:"pink",wrapBg:"bg-pink-50 dark:bg-pink-900/20"},c=[{bg:"bg-amber-400",text:"text-amber-700",badge:"amber",wrapBg:"bg-amber-50 dark:bg-amber-900/20"},{bg:"bg-pink-400",text:"text-pink-700",badge:"pink",wrapBg:"bg-pink-50 dark:bg-pink-900/20"},{bg:"bg-blue-400",text:"text-blue-700",badge:"blue",wrapBg:"bg-blue-50 dark:bg-blue-900/20"},{bg:"bg-green-400",text:"text-green-700",badge:"green",wrapBg:"bg-green-50 dark:bg-green-900/20"},{bg:"bg-purple-400",text:"text-purple-700",badge:"purple",wrapBg:"bg-purple-50 dark:bg-purple-900/20"},{bg:"bg-red-400",text:"text-red-700",badge:"red",wrapBg:"bg-red-50 dark:bg-red-900/20"},{bg:"bg-cyan-400",text:"text-cyan-700",badge:"cyan",wrapBg:"bg-cyan-50 dark:bg-cyan-900/20"},{bg:"bg-orange-400",text:"text-orange-700",badge:"orange",wrapBg:"bg-orange-50 dark:bg-orange-900/20"}];function p(R){if(!u.value)return i;const B=r.value.indexOf(R);if(B>=0)return c[B%c.length];let D=0;for(let se=0;se<R.length;se++)D=D*31+R.charCodeAt(se)>>>0;return c[D%c.length]}const m=["laugh","sad","praise","slacker","gossip","polite","curious"],f=y(()=>[{id:"laugh",name:e("quotes.keywords.templates.laugh.name"),keywords:e("quotes.keywords.templates.laugh.keywords").split(","),description:e("quotes.keywords.templates.laugh.description")},{id:"sad",name:e("quotes.keywords.templates.sad.name"),keywords:e("quotes.keywords.templates.sad.keywords").split(","),description:e("quotes.keywords.templates.sad.description")},{id:"praise",name:e("quotes.keywords.templates.praise.name"),keywords:e("quotes.keywords.templates.praise.keywords").split(","),description:e("quotes.keywords.templates.praise.description")},{id:"slacker",name:e("quotes.keywords.templates.slacker.name"),keywords:e("quotes.keywords.templates.slacker.keywords").split(","),description:e("quotes.keywords.templates.slacker.description")},{id:"gossip",name:e("quotes.keywords.templates.gossip.name"),keywords:e("quotes.keywords.templates.gossip.keywords").split(","),description:e("quotes.keywords.templates.gossip.description")},{id:"polite",name:e("quotes.keywords.templates.polite.name"),keywords:e("quotes.keywords.templates.polite.keywords").split(","),description:e("quotes.keywords.templates.polite.description")},{id:"curious",name:e("quotes.keywords.templates.curious.name"),keywords:e("quotes.keywords.templates.curious.keywords").split(","),description:e("quotes.keywords.templates.curious.description")}]),h=y(()=>{const R=s.customKeywordTemplates.map(D=>({...D,isCustom:!0}));return[...f.value.filter(D=>!s.deletedPresetTemplateIds.includes(D.id)),...R]}),v=T("laugh"),r=T([]);z(f,R=>{R.length>0&&r.value.length===0&&(r.value=[...R[0].keywords])},{immediate:!0});const d=y(()=>{const R=h.value.find(B=>B.id===v.value);return R?R.name:""}),w=T(null),I=T(!1);let g=0;const S=T(!1),_=T(null),M=T(""),L=T([]),W=T(""),V=y(()=>_.value!==null),U=y(()=>V.value?e("quotes.keywords.modal.editTitle"):e("quotes.keywords.modal.createTitle"));function O(){_.value=null,M.value="",L.value=[],W.value="",S.value=!0}function te(R){_.value=R.id,M.value=R.name,L.value=[...R.keywords],S.value=!0}function Z(){const R=W.value.trim();R&&!L.value.includes(R)&&(L.value=[...L.value,R]),W.value=""}function G(R){L.value=L.value.filter(B=>B!==R)}function F(R){v.value=R.id,r.value=[...R.keywords],w.value=null,le()}function P(){g++,r.value=[],w.value=null,I.value=!1,v.value=""}const Y=T("");function xe(){const R=Y.value.trim();R&&!r.value.includes(R)&&(r.value=[...r.value,R],le()),Y.value=""}function Re(R){r.value=r.value.filter(B=>B!==R),le()}function Me(R){return m.includes(R)}function Le(){if(M.value.trim()){if(V.value&&_.value)if(Me(_.value)){const R={id:`custom_${Date.now()}`,name:M.value.trim(),keywords:[...L.value]};s.addCustomKeywordTemplate(R),v.value=R.id,r.value=[...R.keywords],le()}else s.updateCustomKeywordTemplate(_.value,{name:M.value.trim(),keywords:[...L.value]}),v.value===_.value&&(r.value=[...L.value],le());else{const R={id:`custom_${Date.now()}`,name:M.value.trim(),keywords:[...L.value]};s.addCustomKeywordTemplate(R),v.value=R.id,r.value=[...R.keywords],le()}S.value=!1}}function Ve(R){Me(R)?s.addDeletedPresetTemplateId(R):s.removeCustomKeywordTemplate(R),v.value===R&&(h.value.length>0?F(h.value[0]):P())}async function le(){const R=++g;if(!a.sessionId||r.value.length===0){w.value=null,I.value=!1;return}I.value=!0;try{const B=await Q().getLaughAnalysis(a.sessionId,a.timeFilter,[...r.value]);if(R!==g)return;w.value=B}catch(B){if(R!==g)return;console.error("Failed to load keyword ranking:",B),w.value=null}finally{R===g&&(I.value=!1)}}const ue=y(()=>w.value?w.value.rankByCount.map(R=>({id:R.memberId.toString(),name:R.name,value:R.laughCount,percentage:R.percentage,keywordDistribution:R.keywordDistribution||[]})):[]);function ce(R){if(ue.value.length===0)return 0;const B=ue.value[0].value;return B===0?0:Math.round(ue.value[R].value/B*100)}function N(R,B){const D=ce(B);return!R.keywordDistribution||R.keywordDistribution.length===0?[{keyword:"default",width:D,bg:"bg-amber-400"}]:R.keywordDistribution.map(se=>({keyword:se.keyword,width:se.percentage/100*D,bg:p(se.keyword).bg}))}return z(()=>[a.sessionId,a.timeFilter],()=>{le()},{immediate:!0,deep:!0}),(R,B)=>{const D=_t,se=lt,qe=mt,Ge=Ie,yt=De,bt=oa,xt=Se;return l(),k(t(Ne),{items:ue.value,title:t(e)("quotes.keywords.title"),description:t(e)("quotes.keywords.description"),"top-n":10,"count-label":t(e)("quotes.keywords.countTemplate",{count:ue.value.length})},{config:C(()=>[o("div",Fs,[o("div",qs,[o("span",Bs,b(t(e)("quotes.keywords.templateLabel")),1),(l(!0),$(E,null,X(h.value,A=>(l(),k(D,{key:A.id,items:[[{label:t(e)("quotes.keywords.contextMenu.edit"),icon:"i-lucide-pencil",disabled:!A.isCustom,onSelect:()=>te(A)},{label:t(e)("quotes.keywords.contextMenu.delete"),icon:"i-lucide-trash",color:"error",onSelect:()=>Ve(A.id)}]]},{default:C(()=>[o("button",{class:K(["rounded-md border px-2.5 py-1 text-sm transition-all",v.value===A.id?"border-pink-500 bg-pink-50 text-pink-600 dark:border-pink-400 dark:bg-pink-900/20 dark:text-pink-400":"border-gray-200 text-gray-600 hover:border-gray-300 dark:border-gray-700 dark:text-gray-400 dark:hover:border-gray-600"]),onClick:pe=>F(A)},b(A.name),11,Us)]),_:2},1032,["items"]))),128)),x(yt,{open:S.value,"onUpdate:open":B[3]||(B[3]=A=>S.value=A)},{content:C(()=>[o("div",Hs,[o("h3",Ps,b(U.value),1),o("div",Es,[o("div",null,[o("label",zs,b(t(e)("quotes.keywords.modal.templateName")),1),x(se,{modelValue:M.value,"onUpdate:modelValue":B[0]||(B[0]=A=>M.value=A),placeholder:t(e)("quotes.keywords.modal.templateNamePlaceholder")},null,8,["modelValue","placeholder"])]),o("div",null,[o("label",Os,b(t(e)("quotes.keywords.modal.keywords")),1),o("div",js,[(l(!0),$(E,null,X(L.value,A=>(l(),k(qe,{key:A,variant:"soft",class:"cursor-pointer",onClick:pe=>G(A)},{default:C(()=>[J(b(A)+" ",1),B[6]||(B[6]=o("span",{class:"ml-0.5 hover:text-red-500"},"×",-1))]),_:2},1032,["onClick"]))),128)),x(se,{modelValue:W.value,"onUpdate:modelValue":B[1]||(B[1]=A=>W.value=A),placeholder:t(e)("quotes.keywords.modal.keywordPlaceholder"),class:"w-full",onKeydown:Ye(Xe(Z,["prevent"]),["enter"])},null,8,["modelValue","placeholder","onKeydown"])])])]),o("div",Ks,[x(Ge,{variant:"soft",onClick:B[2]||(B[2]=A=>S.value=!1)},{default:C(()=>[J(b(t(e)("common.cancel")),1)]),_:1}),x(Ge,{color:"primary",disabled:!M.value.trim()||L.value.length===0,onClick:Le},{default:C(()=>[J(b(V.value?t(e)("quotes.keywords.modal.update"):t(e)("common.save")),1)]),_:1},8,["disabled"])])])]),default:C(()=>[o("button",{class:"rounded-md border border-dashed border-gray-300 px-2.5 py-1 text-sm text-gray-500 transition-all hover:border-pink-400 hover:text-pink-500 dark:border-gray-600",onClick:O},b(t(e)("quotes.keywords.newTemplate")),1)]),_:1},8,["open"])]),o("div",Ws,[(l(!0),$(E,null,X(r.value,A=>(l(),k(qe,{key:A,class:"cursor-pointer",onClick:pe=>Re(A)},{default:C(()=>[J(b(A)+" ",1),B[7]||(B[7]=o("span",{class:"ml-0.5 hover:text-red-500"},"×",-1))]),_:2},1032,["onClick"]))),128)),x(se,{modelValue:Y.value,"onUpdate:modelValue":B[4]||(B[4]=A=>Y.value=A),placeholder:t(e)("quotes.keywords.searchPlaceholder"),class:"w-32",onKeydown:Ye(Xe(xe,["prevent"]),["enter"])},null,8,["modelValue","placeholder","onKeydown"]),r.value.length>0?(l(),$("button",{key:0,class:"text-sm text-pink-500 hover:text-red-500",onClick:P},b(t(e)("quotes.keywords.clear")),1)):q("",!0)]),o("div",Gs,b(t(e)("quotes.keywords.templateHint")),1)]),w.value&&w.value.typeDistribution.length>0?(l(),$("div",Ys,[o("div",Xs,[o("span",Zs,b(d.value?d.value:r.value.length===1?r.value[0]:t(e)("quotes.keywords.keyword"))+b(t(e)("quotes.keywords.ranking")),1),o("label",Js,[o("span",null,b(t(e)("quotes.keywords.multiColorMode")),1),x(bt,{modelValue:u.value,"onUpdate:modelValue":B[5]||(B[5]=A=>u.value=A),size:"md"},null,8,["modelValue"])])]),o("div",Qs,[(l(!0),$(E,null,X(w.value.typeDistribution,A=>(l(),$("div",{key:A.type,class:K(["flex items-center gap-2 rounded-lg px-2 py-2 text-xs",p(A.type).wrapBg])},[o("span",{class:K(["h-2.5 w-2.5 shrink-0 rounded-full",p(A.type).bg])},null,2),o("span",{class:K(["font-medium",p(A.type).text])},b(A.type),3),o("span",eo,b(t(e)("quotes.keywords.times",{count:A.count})),1),x(qe,{color:p(A.type).badge,variant:"soft",size:"xs"},{default:C(()=>[J(b(A.percentage)+"%",1)]),_:2},1032,["color"])],2))),128))])])):q("",!0),I.value&&ue.value.length===0?(l(),k(t(ge),{key:1,text:t(e)("quotes.keywords.loading")},null,8,["text"])):q("",!0)]),item:C(({item:A,index:pe})=>[o("div",to,[o("span",{class:K(["w-8 shrink-0 text-center font-mono text-sm font-black tabular-nums",t($e)(pe)])},b(t(Ce)(pe)),3),o("div",ao,[o("p",so,b(A.name),1)]),o("div",oo,[o("div",no,[(l(!0),$(E,null,X(N(A,pe),ke=>(l(),$("div",{key:ke.keyword,class:K(["h-full transition-all first:rounded-l-full last:rounded-r-full",ke.bg]),style:_e({width:`${ke.width}%`}),title:`${ke.keyword}: ${ke.width.toFixed(1)}%`},null,14,lo))),128))])]),o("div",io,[o("span",ro,b(A.value),1),o("span",uo,b(t(e)("quotes.keywords.timesWithPercent",{count:A.value,percent:A.percentage})),1)])])]),empty:C(()=>[I.value?(l(),$("div",vo)):(l(),$("div",co,[x(xt,{name:"i-heroicons-magnifying-glass",class:"mb-2 h-8 w-8 opacity-50"}),o("p",mo,b(t(e)("quotes.keywords.empty")),1)]))]),_:1},8,["items","title","description","count-label"])}}}),go={class:"flex h-56 items-center justify-center",role:"status","aria-live":"polite"},ho={class:"sr-only"},de=H({__name:"RankingLoadingBody",setup(n){const{t:e}=ee();return(a,s)=>(l(),$("div",go,[o("span",ho,b(t(e)("common.loading")),1),x(t(dt))]))}}),fo={class:"flex items-center gap-3"},yo={key:1,class:"py-8 text-center text-sm text-gray-400"},bo=H({__name:"ActivityRank",props:{sessionId:{},memberActivity:{},baseLoading:{type:Boolean},timeFilter:{},showTopNSelect:{type:Boolean,default:!0},globalTopN:{}},setup(n){const e=n,a=T(null),s=T(null),u=T(!1),i=T("activity"),c=T(e.globalTopN??10);z(()=>e.globalTopN,g=>{g!==void 0&&(c.value=g)});async function p(){if(e.sessionId){u.value=!0;try{const g=Q(),[S,_]=await Promise.all([g.getDragonKingAnalysis(e.sessionId,e.timeFilter),g.getCheckInAnalysis(e.sessionId,e.timeFilter)]);a.value=S,s.value=_}catch(g){console.error("加载活跃数据失败:",g)}finally{u.value=!1}}}const m=y(()=>e.memberActivity.map(g=>({id:g.memberId.toString(),name:g.name,value:g.messageCount,percentage:g.percentage}))),f=y(()=>a.value?a.value.rank.map(g=>({id:g.memberId.toString(),name:g.name,value:g.count,percentage:g.percentage})):[]),h=y(()=>s.value?s.value.loyaltyRank.map(g=>({id:g.memberId.toString(),name:g.name,value:g.totalDays,percentage:g.percentage})):[]),v=y(()=>i.value==="activity"?!!e.baseLoading&&e.memberActivity.length===0:u.value),r=y(()=>{switch(i.value){case"activity":return m.value;case"dragon":return f.value;case"loyalty":return h.value;default:return m.value}}),d=y(()=>{switch(i.value){case"activity":return"条";case"dragon":case"loyalty":return"天";default:return"条"}}),w=y(()=>{switch(i.value){case"activity":return"🏆 活跃榜 - 发言数量";case"dragon":return"🏆 活跃榜 - 龙王";case"loyalty":return"🏆 活跃榜 - 累计发言";default:return"🏆 活跃榜"}}),I=y(()=>{switch(i.value){case"activity":return"按消息发送数量排名";case"dragon":{const g=a.value?.totalDays;return g==null?"每天发言最多的人+1":`每天发言最多的人+1(共 ${g} 天)`}case"loyalty":{const g=s.value?.totalDays;return g==null?"累计发言天数排名":`累计发言天数排名(共 ${g} 天)`}default:return""}});return z(()=>[e.sessionId,e.timeFilter],()=>p(),{immediate:!0,deep:!0}),(g,S)=>(l(),k(t(j),{title:w.value,description:I.value},{headerRight:C(()=>[o("div",fo,[n.showTopNSelect?(l(),k(t(re),{key:0,modelValue:c.value,"onUpdate:modelValue":S[0]||(S[0]=_=>c.value=_)},null,8,["modelValue"])):q("",!0),x(t(ie),{modelValue:i.value,"onUpdate:modelValue":S[1]||(S[1]=_=>i.value=_),items:[{label:"发言数量",value:"activity"},{label:"龙王",value:"dragon"},{label:"累计发言",value:"loyalty"}],size:"sm"},null,8,["modelValue"])])]),default:C(()=>[v.value?(l(),k(de,{key:0})):(l(),$(E,{key:1},[r.value.length>0?(l(),k(t(Fe),{key:0,members:r.value,title:w.value,unit:d.value,"top-n":c.value,bare:""},null,8,["members","title","unit","top-n"])):(l(),$("div",yo,"暂无数据"))],64))]),_:1},8,["title","description"]))}}),xo={key:0},ko={key:0,class:"flex items-center justify-center gap-6 border-t border-gray-100 px-5 py-3 dark:border-gray-800"},wo={class:"px-3 py-2"},_o=H({__name:"EChartStreakRank",props:{items:{},title:{},description:{},topN:{default:10},mode:{default:"max"},maxHeightVh:{default:60},bare:{type:Boolean,default:!1}},setup(n){const e=n,a=ye(),s=y(()=>e.mode==="current"?e.items.filter(v=>v.currentStreak>0).sort((v,r)=>r.currentStreak-v.currentStreak).slice(0,e.topN):e.items.slice(0,e.topN)),u=fe(()=>s.value),i=y(()=>{const v=s.value.length*36;return Math.max(v+30,180)}),c={type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:"#ee4567"},{offset:1,color:"#f7758c"}]},p={type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:"#f97316"},{offset:1,color:"#fb923c"}]};function m(v,r){return`${v} ~ ${r}`}function f(v){return e.mode==="current"?v.currentStreak:v.maxStreak}const h=y(()=>{const v=[...s.value].reverse(),r=be(v,{totalCount:s.value.length,labelMaxLength:a.value.labelMaxLength,avatars:u.value}),d=v.map(g=>f(g)),w=Math.max(...d,1),I=v.map(g=>({value:f(g),itemStyle:{color:e.mode==="current"||g.currentStreak>0?p: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:g=>{const S=g[0];if(!S)return"";const _=s.value.length-1-S.dataIndex,M=s.value[_];if(e.mode==="current")return`
8
- <div style="padding: 4px 8px;">
9
- <div style="font-weight: bold; margin-bottom: 6px;">${M.name}</div>
10
- <div style="color: #fb923c;">🔥 当前连续 <b>${M.currentStreak}</b> 天</div>
11
- <div style="margin-top: 4px; font-size: 12px; color: #9ca3af;">最长记录: ${M.maxStreak} 天</div>
12
- </div>
13
- `;let L=`
14
- <div style="padding: 4px 8px;">
15
- <div style="font-weight: bold; margin-bottom: 6px;">${M.name}</div>
16
- <div style="margin-bottom: 4px;">🔥 最长连续: <b>${M.maxStreak}</b> 天</div>
17
- <div style="font-size: 12px; color: #9ca3af;">${m(M.maxStreakStart,M.maxStreakEnd)}</div>
18
- `;return M.currentStreak>0&&(L+=`<div style="margin-top: 6px; color: #fb923c;">🔥 当前连续 ${M.currentStreak} 天</div>`),L+="</div>",L}},grid:{left:a.value.gridLeft,right:70,top:15,bottom:15,containLabel:!1},xAxis:{type:"value",max:w*1.15,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1}},yAxis:{type:"category",data:r.data,axisLine:{show:!1},axisTick:{show:!1},axisLabel:r.axisLabel},series:[{type:"bar",data:I,barWidth:18,barCategoryGap:"30%",label:{show:!0,position:"right",distance:8,formatter:g=>{const S=s.value.length-1-g.dataIndex,_=s.value[S],M=f(_),L=e.mode==="current"||_.currentStreak>0?" 🔥":"";return`${M} 天${L}`},fontSize:11,fontWeight:500,color:"#6b7280"},emphasis:{itemStyle:{shadowBlur:6,shadowColor:"rgba(249, 115, 22, 0.3)"}}}]}});return(v,r)=>n.bare?(l(),$("div",xo,[x(t(he),{"content-height":i.value,"max-height-vh":n.maxHeightVh},{default:C(()=>[x(t(ae),{option:h.value,height:i.value},null,8,["option","height"])]),_:1},8,["content-height","max-height-vh"]),n.mode==="max"?(l(),$("div",ko,[...r[0]||(r[0]=[$t('<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)])])):q("",!0)])):(l(),k(t(j),{key:1,title:n.title,description:n.description,scrollable:"","max-height-vh":n.maxHeightVh},Ct({default:C(()=>[o("div",wo,[x(t(ae),{option:h.value,height:i.value},null,8,["option","height"])])]),_:2},[n.mode==="max"?{name:"footer",fn:C(()=>[r[1]||(r[1]=o("div",{class:"flex items-center justify-center gap-6 border-t border-gray-100 px-5 py-3 dark:border-gray-800"},[o("div",{class:"flex items-center gap-1.5"},[o("div",{class:"h-3 w-6 rounded bg-linear-to-r from-orange-500 to-orange-400"}),o("span",{class:"text-xs text-gray-500"},"当前连续中 🔥")]),o("div",{class:"flex items-center gap-1.5"},[o("div",{class:"h-3 w-6 rounded bg-linear-to-r from-pink-500 to-pink-400"}),o("span",{class:"text-xs text-gray-500"},"已中断")])],-1))]),key:"0"}:void 0]),1032,["title","description","max-height-vh"]))}}),$o={class:"px-3 py-2"},Co=H({__name:"EChartBattleRank",props:{battles:{},title:{},description:{},topN:{default:10},maxHeightVh:{default:60},bare:{type:Boolean,default:!1}},setup(n){const e=n,a=y(()=>e.battles.slice(0,e.topN)),s=y(()=>{const p=a.value.length*36;return Math.max(p+30,180)}),u={type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:"#ee4567"},{offset:1,color:"#f7758c"}]};function i(p){return`${p.participantCount} 人参战`}const c=y(()=>{const p=[...a.value].reverse(),m=p.map(r=>i(r)),f=p.map(r=>r.totalImages),h=Math.max(...f,1),v=p.map(r=>({value:r.totalImages,itemStyle:{color:u,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:r=>{const d=r[0];if(!d)return"";const w=a.value.length-1-d.dataIndex,I=a.value[w],g=I.participants.slice(0,5).map(_=>`<span style="color: #d1d5db;">${_.name}</span> <b>${_.imageCount}</b>张`).join("、"),S=I.participants.length>5?`、+${I.participants.length-5}`:"";return`
19
- <div style="padding: 6px 8px;">
20
- <div style="font-weight: bold; margin-bottom: 8px; font-size: 13px;">
21
- ⚔️ ${ze(I.startTime)}
22
- </div>
23
- <div style="margin-bottom: 6px;">
24
- <span style="color: #9ca3af;">参战人数:</span> <b>${I.participantCount}</b> 人
25
- </div>
26
- <div style="margin-bottom: 8px;">
27
- <span style="color: #9ca3af;">总图片数:</span> <b style="color: #f472b6;">${I.totalImages}</b> 张
28
- </div>
29
- <div style="border-top: 1px solid #374151; padding-top: 6px; font-size: 11px;">
30
- ${g}${S}
31
- </div>
32
- </div>
33
- `}},grid:{left:95,right:125,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:m,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{fontSize:11,color:"#4b5563",margin:12,formatter:(r,d)=>{const I=a.value.length-1-d+1;return`${I===1?"🥇":I===2?"🥈":I===3?"🥉":`${I}.`} ${r}`}}},series:[{type:"bar",data:v,barWidth:18,barCategoryGap:"30%",label:{show:!0,position:"right",distance:8,formatter:r=>{const d=a.value.length-1-r.dataIndex,w=a.value[d],I=ze(w.startTime);return`${w.totalImages} 张 (${I})`},fontSize:11,fontWeight:500,color:"#6b7280"},emphasis:{itemStyle:{shadowBlur:6,shadowColor:"rgba(238, 69, 103, 0.3)"}}}]}});return(p,m)=>n.bare?(l(),k(t(he),{key:0,"content-height":s.value,"max-height-vh":n.maxHeightVh},{default:C(()=>[x(t(ae),{option:c.value,height:s.value},null,8,["option","height"])]),_:1},8,["content-height","max-height-vh"])):(l(),k(t(j),{key:1,title:n.title,description:n.description,scrollable:"","max-height-vh":n.maxHeightVh},{default:C(()=>[o("div",$o,[x(t(ae),{option:c.value,height:s.value},null,8,["option","height"])])]),_:1},8,["title","description","max-height-vh"]))}}),To={class:"px-3 py-2"},Io=H({__name:"EChartTimeRank",props:{items:{},title:{},description:{},topN:{default:10},maxHeightVh:{default:60},bare:{type:Boolean,default:!1}},setup(n){const e=n,a=ye(),s=y(()=>e.items.slice(0,e.topN)),u=fe(()=>s.value),i=y(()=>{const f=s.value.length*36;return Math.max(f+30,180)}),c={type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:"#f59e0b"},{offset:1,color:"#fbbf24"}]};function p(f){return(f/1e3).toFixed(2)+"s"}const m=y(()=>{if(s.value.length===0)return{};const f=[...s.value].reverse(),h=be(f,{totalCount:s.value.length,labelMaxLength:a.value.labelMaxLength,avatars:u.value}),v=s.value[0].avgTimeDiff,r=f.map(d=>({value:Math.round(v/d.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:d=>{const w=d[0];if(!w)return"";const I=s.value.length-1-w.dataIndex,g=s.value[I];return`
34
- <div style="padding: 4px 8px;">
35
- <div style="font-weight: bold; margin-bottom: 6px;">${g.name}</div>
36
- <div style="margin-bottom: 4px;">⚡️ 平均反应时间: <b>${p(g.avgTimeDiff)}</b></div>
37
- <div style="font-size: 12px; color: #9ca3af;">参与复读 ${g.count} 次</div>
38
- </div>
39
- `}},grid:{left:a.value.gridLeft,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:h.data,axisLine:{show:!1},axisTick:{show:!1},axisLabel:h.axisLabel},series:[{type:"bar",data:r,barWidth:18,barCategoryGap:"30%",label:{show:!0,position:"right",distance:8,formatter:d=>{const w=s.value.length-1-d.dataIndex,I=s.value[w];return`${p(I.avgTimeDiff)} · ${I.count}次`},fontSize:11,fontWeight:500,color:"#6b7280"},emphasis:{itemStyle:{shadowBlur:6,shadowColor:"rgba(245, 158, 11, 0.3)"}}}]}});return(f,h)=>n.bare?(l(),k(t(he),{key:0,"content-height":i.value,"max-height-vh":n.maxHeightVh},{default:C(()=>[x(t(ae),{option:m.value,height:i.value},null,8,["option","height"])]),_:1},8,["content-height","max-height-vh"])):(l(),k(t(j),{key:1,title:n.title,description:n.description,scrollable:"","max-height-vh":n.maxHeightVh},{default:C(()=>[o("div",To,[x(t(ae),{option:m.value,height:i.value},null,8,["option","height"])])]),_:1},8,["title","description","max-height-vh"]))}}),So={class:"flex items-center gap-3"},Ro={class:"px-3 py-2"},Mo=H({__name:"EChartDivingRank",props:{items:{},showTopNSelect:{type:Boolean,default:!0},maxHeightVh:{default:60},globalTopN:{}},setup(n){const e=n,a=ye(),s=T("desc"),u=T(e.globalTopN??10);z(()=>e.globalTopN,d=>{d!==void 0&&(u.value=d)});const i=y(()=>[...e.items].sort((w,I)=>s.value==="desc"?I.daysSinceLastMessage-w.daysSinceLastMessage:w.daysSinceLastMessage-I.daysSinceLastMessage).slice(0,u.value)),c=fe(()=>i.value),p=y(()=>s.value==="desc"?"🤿 潜水榜 - 潜水最久":"🤿 潜水榜 - 最近冒泡"),m=y(()=>s.value==="desc"?"距离上次发言时间最久的成员":"最近发言过的成员"),f=y(()=>{const d=i.value.length*36;return Math.max(d+30,180)}),h={type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:"#06b6d4"},{offset:1,color:"#22d3ee"}]};function v(d){return d===0?"今天":d===1?"昨天":`${d} 天前`}const r=y(()=>{if(i.value.length===0)return{};const d=[...i.value].reverse(),w=be(d,{totalCount:i.value.length,labelMaxLength:a.value.labelMaxLength,avatars:c.value}),I=Math.max(...i.value.map(S=>S.daysSinceLastMessage),1),g=d.map(S=>({value:S.daysSinceLastMessage,itemStyle:{color:h,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:S=>{const _=S[0];if(!_)return"";const M=i.value.length-1-_.dataIndex,L=i.value[M];return`
40
- <div style="padding: 4px 8px;">
41
- <div style="font-weight: bold; margin-bottom: 6px;">${L.name}</div>
42
- <div style="margin-bottom: 4px;">🤿 ${v(L.daysSinceLastMessage)}</div>
43
- <div style="font-size: 12px; color: #9ca3af;">最后发言: ${aa(L.lastMessageTs)}</div>
44
- </div>
45
- `}},grid:{left:a.value.gridLeft,right:100,top:15,bottom:15,containLabel:!1},xAxis:{type:"value",max:I*1.15,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1}},yAxis:{type:"category",data:w.data,axisLine:{show:!1},axisTick:{show:!1},axisLabel:w.axisLabel},series:[{type:"bar",data:g,barWidth:18,barCategoryGap:"30%",label:{show:!0,position:"right",distance:8,formatter:S=>{const _=i.value.length-1-S.dataIndex,M=i.value[_];return v(M.daysSinceLastMessage)},fontSize:11,fontWeight:500,color:"#6b7280"},emphasis:{itemStyle:{shadowBlur:6,shadowColor:"rgba(0, 0, 0, 0.2)"}}}]}});return(d,w)=>(l(),k(t(j),{title:p.value,description:m.value,scrollable:"","max-height-vh":n.maxHeightVh},{headerRight:C(()=>[o("div",So,[n.showTopNSelect?(l(),k(t(re),{key:0,modelValue:u.value,"onUpdate:modelValue":w[0]||(w[0]=I=>u.value=I)},null,8,["modelValue"])):q("",!0),x(t(ie),{modelValue:s.value,"onUpdate:modelValue":w[1]||(w[1]=I=>s.value=I),items:[{label:"潜水最久",value:"desc"},{label:"最近冒泡",value:"asc"}],size:"sm"},null,8,["modelValue"])])]),default:C(()=>[o("div",Ro,[x(t(ae),{option:r.value,height:f.value},null,8,["option","height"])])]),_:1},8,["title","description","max-height-vh"]))}}),Lo={class:"px-3 py-2"},Vo=H({__name:"EChartConsecutiveRank",props:{items:{},title:{},description:{},topN:{default:10},maxHeightVh:{default:60},bare:{type:Boolean,default:!1}},setup(n){const e=n,a=ye(),s=y(()=>[...e.items].sort((f,h)=>h.maxConsecutiveDays-f.maxConsecutiveDays).slice(0,e.topN)),u=fe(()=>s.value),i=y(()=>{const f=s.value.length*36;return Math.max(f+30,180)}),c={type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:"#f97316"},{offset:1,color:"#fb923c"}]},p={type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:"#ec4899"},{offset:1,color:"#f472b6"}]},m=y(()=>{if(s.value.length===0)return{};const f=[...s.value].reverse(),h=be(f,{totalCount:s.value.length,labelMaxLength:a.value.labelMaxLength,avatars:u.value}),v=Math.max(...s.value.map(r=>r.maxConsecutiveDays),1);return{tooltip:{trigger:"axis",axisPointer:{type:"shadow"},backgroundColor:"rgba(0, 0, 0, 0.85)",borderColor:"transparent",textStyle:{color:"#fff",fontSize:12},formatter:r=>{if(!r||r.length===0)return"";const d=r[0].dataIndex,w=s.value.length-1-d,I=s.value[w];let g=`
46
- <div style="padding: 6px 8px;">
47
- <div style="font-weight: bold; margin-bottom: 6px;">${I.name}</div>
48
- <div>最长连续: <b style="color: #f472b6;">${I.maxConsecutiveDays}</b> 天</div>
49
- `;return I.currentStreak>0&&(g+=`<div style="color: #f97316;">🔥 当前连续 ${I.currentStreak} 天</div>`),g+="</div>",g}},legend:{show:!1},grid:{left:a.value.gridLeft,right:75,top:15,bottom:15,containLabel:!1},xAxis:{type:"value",max:v*1.15,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1}},yAxis:{type:"category",data:h.data,axisLine:{show:!1},axisTick:{show:!1},axisLabel:h.axisLabel},series:[{name:"当前连续",type:"bar",data:f.map(r=>({value:r.currentStreak>0?r.maxConsecutiveDays:0,itemStyle:{color:c,borderRadius:[0,4,4,0]}})),barWidth:18,barGap:"-100%",label:{show:!0,position:"right",distance:8,formatter:r=>{const d=s.value.length-1-r.dataIndex,w=s.value[d];return w.currentStreak>0?`${w.maxConsecutiveDays} 天`:""},fontSize:11,fontWeight:500,color:"#6b7280"}},{name:"已中断",type:"bar",data:f.map(r=>({value:r.currentStreak===0?r.maxConsecutiveDays:0,itemStyle:{color:p,borderRadius:[0,4,4,0]}})),barWidth:18,label:{show:!0,position:"right",distance:8,formatter:r=>{const d=s.value.length-1-r.dataIndex,w=s.value[d];return w.currentStreak===0?`${w.maxConsecutiveDays} 天`:""},fontSize:11,fontWeight:500,color:"#6b7280"}}]}});return(f,h)=>n.bare?(l(),k(t(he),{key:0,"content-height":i.value,"max-height-vh":n.maxHeightVh},{default:C(()=>[x(t(ae),{option:m.value,height:i.value},null,8,["option","height"])]),_:1},8,["content-height","max-height-vh"])):(l(),k(t(j),{key:1,title:n.title,description:n.description,scrollable:"","max-height-vh":n.maxHeightVh},{default:C(()=>[o("div",Lo,[x(t(ae),{option:m.value,height:i.value},null,8,["option","height"])])]),_:1},8,["title","description","max-height-vh"]))}}),Ao={class:"px-3 py-2"},No=H({__name:"EChartNightOwlRank",props:{items:{},title:{},description:{},topN:{default:10},maxHeightVh:{default:60},bare:{type:Boolean,default:!1}},setup(n){const e=n,a=ye(),s=y(()=>e.items.slice(0,e.topN)),u=fe(()=>s.value),i=y(()=>{const m=s.value.length*36;return Math.max(m+50,200)}),c={h23:"#8b5cf6",h0:"#3b82f6",h1:"#06b6d4",h2:"#f59e0b",h3to4:"#ef4444"},p=y(()=>{if(s.value.length===0)return{};const m=[...s.value].reverse(),f=be(m,{totalCount:s.value.length,labelMaxLength:a.value.labelMaxLength,avatars:u.value}),h=Math.max(...s.value.map(v=>v.totalNightMessages),1);return{tooltip:{trigger:"axis",axisPointer:{type:"shadow"},backgroundColor:"rgba(0, 0, 0, 0.85)",borderColor:"transparent",textStyle:{color:"#fff",fontSize:12},formatter:v=>{if(!v||v.length===0)return"";const r=v[0].dataIndex,d=s.value.length-1-r,w=s.value[d],I=w.hourlyBreakdown;return`
50
- <div style="padding: 6px 8px;">
51
- <div style="font-weight: bold; margin-bottom: 6px;">${w.name}</div>
52
- <div style="margin-bottom: 4px;">
53
- 称号: <b style="color: #f472b6;">${w.title}</b>
54
- </div>
55
- <div style="margin-bottom: 6px;">总发言: <b>${w.totalNightMessages}</b> 条</div>
56
- <div style="border-top: 1px solid #374151; padding-top: 6px;">
57
- <div><span style="color: ${c.h23};">●</span> 23点: ${I.h23} 条</div>
58
- <div><span style="color: ${c.h0};">●</span> 0点: ${I.h0} 条</div>
59
- <div><span style="color: ${c.h1};">●</span> 1点: ${I.h1} 条</div>
60
- <div><span style="color: ${c.h2};">●</span> 2点: ${I.h2} 条</div>
61
- <div><span style="color: ${c.h3to4};">●</span> 3-4点: ${I.h3to4} 条</div>
62
- </div>
63
- </div>
64
- `}},legend:{show:!0,bottom:0,itemWidth:12,itemHeight:12,textStyle:{color:"#6b7280",fontSize:10}},grid:{left:a.value.gridLeft,right:70,top:15,bottom:35,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:f.data,axisLine:{show:!1},axisTick:{show:!1},axisLabel:f.axisLabel},series:[{name:"23点",type:"bar",stack:"total",data:m.map(v=>v.hourlyBreakdown.h23),itemStyle:{color:c.h23},barWidth:18},{name:"0点",type:"bar",stack:"total",data:m.map(v=>v.hourlyBreakdown.h0),itemStyle:{color:c.h0},barWidth:18},{name:"1点",type:"bar",stack:"total",data:m.map(v=>v.hourlyBreakdown.h1),itemStyle:{color:c.h1},barWidth:18},{name:"2点",type:"bar",stack:"total",data:m.map(v=>v.hourlyBreakdown.h2),itemStyle:{color:c.h2},barWidth:18},{name:"3-4点",type:"bar",stack:"total",data:m.map(v=>v.hourlyBreakdown.h3to4),itemStyle:{color:c.h3to4,borderRadius:[0,4,4,0]},barWidth:18,label:{show:!0,position:"right",distance:8,formatter:v=>{const r=s.value.length-1-v.dataIndex;return`${s.value[r].totalNightMessages} 条`},fontSize:11,fontWeight:500,color:"#6b7280"}}]}});return(m,f)=>n.bare?(l(),k(t(he),{key:0,"content-height":i.value,"max-height-vh":n.maxHeightVh},{default:C(()=>[x(t(ae),{option:p.value,height:i.value},null,8,["option","height"])]),_:1},8,["content-height","max-height-vh"])):(l(),k(t(j),{key:1,title:n.title,description:n.description,scrollable:"","max-height-vh":n.maxHeightVh},{default:C(()=>[o("div",Ao,[x(t(ae),{option:p.value,height:i.value},null,8,["option","height"])])]),_:1},8,["title","description","max-height-vh"]))}}),Do={id:"streak-rank",class:"scroll-mt-24"},Fo={class:"flex items-center gap-3"},qo=H({__name:"CheckInRank",props:{sessionId:{},timeFilter:{},showTopNSelect:{type:Boolean,default:!0},globalTopN:{}},setup(n){const e=n,a=T(null),s=T(!1),u=T("max"),i=T(e.globalTopN??10);z(()=>e.globalTopN,h=>{h!==void 0&&(i.value=h)});const c=y(()=>u.value==="max"?"🔥 火花榜 - 最长连续":"🔥 火花榜 - 当前连续"),p=y(()=>u.value==="max"?"历史最长连续发言天数":"正在持续连续发言的成员"),m=y(()=>a.value?a.value.streakRank.some(h=>h.currentStreak>0):!1);async function f(){if(e.sessionId){s.value=!0;try{a.value=await Q().getCheckInAnalysis(e.sessionId,e.timeFilter)}catch(h){console.error("加载打卡分析失败:",h)}finally{s.value=!1}}}return z(()=>[e.sessionId,e.timeFilter],()=>{f()},{immediate:!0,deep:!0}),(h,v)=>(l(),$("div",Do,[x(t(j),{title:c.value,description:p.value},{headerRight:C(()=>[o("div",Fo,[n.showTopNSelect?(l(),k(t(re),{key:0,modelValue:i.value,"onUpdate:modelValue":v[0]||(v[0]=r=>i.value=r)},null,8,["modelValue"])):q("",!0),m.value?(l(),k(t(ie),{key:1,modelValue:u.value,"onUpdate:modelValue":v[1]||(v[1]=r=>u.value=r),items:[{label:"最长连续",value:"max"},{label:"当前连续",value:"current"}],size:"sm"},null,8,["modelValue"])):q("",!0)])]),default:C(()=>[s.value?(l(),k(de,{key:0})):a.value&&a.value.streakRank.length>0?(l(),k(t(_o),{key:1,items:a.value.streakRank,title:c.value,mode:u.value,"top-n":i.value,bare:""},null,8,["items","title","mode","top-n"])):(l(),k(t(ne),{key:2,text:"暂无连续发言数据"}))]),_:1},8,["title","description"])]))}}),Bo={class:"flex items-center gap-3"},Uo={key:1,class:"py-8 text-center text-sm text-gray-400"},Ho={key:1,class:"py-8 text-center text-sm text-gray-400"},Po=H({__name:"MemeBattleRank",props:{sessionId:{},timeFilter:{},showTopNSelect:{type:Boolean,default:!0},globalTopN:{}},setup(n){const e=n,a=T(null),s=T(!1),u=T("count"),i=T(e.globalTopN??10);z(()=>e.globalTopN,d=>{d!==void 0&&(i.value=d)});async function c(){if(e.sessionId){s.value=!0;try{a.value=await Q().getMemeBattleAnalysis(e.sessionId,e.timeFilter)}catch(d){console.error("加载斗图分析失败:",d)}finally{s.value=!1}}}const p=y(()=>a.value?a.value.rankByCount.map(d=>({id:d.memberId.toString(),name:d.name,value:d.count,percentage:d.percentage})):[]),m=y(()=>a.value?a.value.rankByImageCount.map(d=>({id:d.memberId.toString(),name:d.name,value:d.count,percentage:d.percentage})):[]),f=y(()=>u.value==="count"?p.value:m.value),h=y(()=>u.value==="count"?"场":"张"),v=y(()=>{switch(u.value){case"battle":return"⚔️ 斗图榜 - 史诗级战役";case"count":return"⚔️ 斗图榜 - 按场次";case"image":return"⚔️ 斗图榜 - 按图量";default:return"⚔️ 斗图榜"}}),r=y(()=>{switch(u.value){case"battle":return"记录最激烈的斗图大战";case"count":return"参与斗图次数最多的人";case"image":return"在斗图中发送图片最多的人";default:return""}});return z(()=>[e.sessionId,e.timeFilter],()=>c(),{immediate:!0,deep:!0}),(d,w)=>s.value||a.value?(l(),k(t(j),{key:0,title:v.value,description:r.value},{headerRight:C(()=>[o("div",Bo,[n.showTopNSelect?(l(),k(t(re),{key:0,modelValue:i.value,"onUpdate:modelValue":w[0]||(w[0]=I=>i.value=I)},null,8,["modelValue"])):q("",!0),x(t(ie),{modelValue:u.value,"onUpdate:modelValue":w[1]||(w[1]=I=>u.value=I),items:[{label:"按场次",value:"count"},{label:"按图量",value:"image"},{label:"史诗级战役",value:"battle"}],size:"sm"},null,8,["modelValue"])])]),default:C(()=>[s.value?(l(),k(de,{key:0})):a.value&&u.value==="battle"?(l(),$(E,{key:1},[a.value.topBattles.length>0?(l(),k(t(Co),{key:0,battles:a.value.topBattles,title:"","top-n":i.value,bare:""},null,8,["battles","top-n"])):(l(),$("div",Uo,"暂无史诗级战役数据"))],64)):a.value?(l(),$(E,{key:2},[f.value.length>0?(l(),k(t(Fe),{key:0,members:f.value,title:v.value,unit:h.value,"top-n":i.value,bare:""},null,8,["members","title","unit","top-n"])):(l(),$("div",Ho,"暂无斗图数据"))],64)):q("",!0)]),_:1},8,["title","description"])):q("",!0)}}),Eo={class:"space-y-6"},zo={class:"flex items-center gap-3"},Oo={class:"flex items-center gap-3"},jo={key:2,class:"px-3 py-2"},Ko=H({__name:"RepeatSection",props:{sessionId:{},timeFilter:{},showTopNSelect:{type:Boolean,default:!0},globalTopN:{}},setup(n){const e=n,a=T(null),s=T(!1),u=T("originator"),i=T("fastest"),c=T(e.globalTopN??10),p=T(e.globalTopN??10);z(()=>e.globalTopN,_=>{_!==void 0&&(c.value=_,p.value=_)});async function m(){if(e.sessionId){s.value=!0;try{a.value=await Q().getRepeatAnalysis(e.sessionId,e.timeFilter)}catch(_){console.error("加载复读分析失败:",_)}finally{s.value=!1}}}const f=y(()=>a.value?a.value.originators.map(_=>({id:_.memberId.toString(),name:_.name,value:_.count,percentage:_.percentage})):[]),h=y(()=>a.value?a.value.initiators.map(_=>({id:_.memberId.toString(),name:_.name,value:_.count,percentage:_.percentage})):[]),v=y(()=>a.value?a.value.breakers.map(_=>({id:_.memberId.toString(),name:_.name,value:_.count,percentage:_.percentage})):[]),r=y(()=>{switch(u.value){case"originator":return f.value;case"initiator":return h.value;case"breaker":return v.value;default:return f.value}}),d=y(()=>{switch(u.value){case"originator":return"🔁 复读榜 - 被复读";case"initiator":return"🔁 复读榜 - 挑起";case"breaker":return"🔁 复读榜 - 打断";default:return"🔁 复读榜"}}),w=y(()=>{switch(u.value){case"originator":return"发出的消息被别人复读的次数";case"initiator":return"第二个发送相同消息、带起节奏的人";case"breaker":return"终结复读链的人";default:return""}}),I=y(()=>{if(!a.value)return{labels:[],values:[]};const _=a.value.chainLengthDistribution;return{labels:_.map(M=>`${M.length}人`),values:_.map(M=>M.count)}}),g=y(()=>i.value==="fastest"?"📊 复读统计 - 最快反应":"📊 复读统计 - 链长分布"),S=y(()=>{if(i.value==="fastest")return"平均复读反应时间(至少参与5次复读)";const _=a.value?.totalRepeatChains??0,M=a.value?.avgChainLength??0;return`共 ${_} 次复读,平均 ${M} 人参与`});return z(()=>[e.sessionId,e.timeFilter],()=>m(),{immediate:!0,deep:!0}),(_,M)=>(l(),$("div",Eo,[s.value||a.value&&a.value.totalRepeatChains>0?(l(),$(E,{key:0},[x(t(j),{title:d.value,description:w.value},{headerRight:C(()=>[o("div",zo,[n.showTopNSelect?(l(),k(t(re),{key:0,modelValue:c.value,"onUpdate:modelValue":M[0]||(M[0]=L=>c.value=L)},null,8,["modelValue"])):q("",!0),x(t(ie),{modelValue:u.value,"onUpdate:modelValue":M[1]||(M[1]=L=>u.value=L),items:[{label:"被复读",value:"originator"},{label:"挑起",value:"initiator"},{label:"打断",value:"breaker"}],size:"sm"},null,8,["modelValue"])])]),default:C(()=>[s.value?(l(),k(de,{key:0})):r.value.length>0?(l(),k(t(Fe),{key:1,members:r.value,title:d.value,unit:"次","top-n":c.value,bare:""},null,8,["members","title","top-n"])):(l(),k(t(ne),{key:2,text:"暂无数据"}))]),_:1},8,["title","description"]),x(t(j),{title:g.value,description:S.value},{headerRight:C(()=>[o("div",Oo,[n.showTopNSelect&&i.value==="fastest"?(l(),k(t(re),{key:0,modelValue:p.value,"onUpdate:modelValue":M[2]||(M[2]=L=>p.value=L)},null,8,["modelValue"])):q("",!0),x(t(ie),{modelValue:i.value,"onUpdate:modelValue":M[3]||(M[3]=L=>i.value=L),items:[{label:"最快反应",value:"fastest"},{label:"链长分布",value:"distribution"}],size:"sm"},null,8,["modelValue"])])]),default:C(()=>[s.value?(l(),k(de,{key:0})):i.value==="fastest"?(l(),$(E,{key:1},[a.value?.fastestRepeaters&&a.value.fastestRepeaters.length>0?(l(),k(t(Io),{key:0,items:a.value.fastestRepeaters,"top-n":p.value,title:"",bare:""},null,8,["items","top-n"])):(l(),k(t(ne),{key:1,text:"暂无最快复读数据"}))],64)):(l(),$("div",jo,[I.value.labels.length>0?(l(),k(t(Qt),{key:0,data:I.value,height:200},null,8,["data"])):(l(),k(t(ne),{key:1,text:"暂无分布数据"}))]))]),_:1},8,["title","description"])],64)):(l(),k(t(j),{key:1,title:"🔁 复读榜"},{default:C(()=>[x(t(ne),{text:"该群组暂无复读记录"})]),_:1}))]))}}),Wo=H({__name:"DivingRank",props:{sessionId:{},timeFilter:{},globalTopN:{}},setup(n){const e=n,a=T(null),s=T(!1);async function u(){if(e.sessionId){s.value=!0;try{a.value=await Q().getDivingAnalysis(e.sessionId,e.timeFilter)}catch(i){console.error("加载潜水分析失败:",i)}finally{s.value=!1}}}return z(()=>[e.sessionId,e.timeFilter],()=>u(),{immediate:!0,deep:!0}),(i,c)=>s.value?(l(),k(t(j),{key:0,title:"🤿 潜水榜 - 潜水最久",description:"距离上次发言时间最久的成员"},{default:C(()=>[x(de)]),_:1})):a.value&&a.value.rank.length>0?(l(),k(t(Mo),{key:1,items:a.value.rank,"global-top-n":n.globalTopN},null,8,["items","global-top-n"])):(l(),k(t(j),{key:2,title:"🤿 潜水榜"},{default:C(()=>[x(t(ne),{text:"暂无潜水数据"})]),_:1}))}}),Go={class:"space-y-6"},Yo={class:"flex items-center gap-3"},Xo={key:1,class:"py-8 text-center text-sm text-gray-400"},Zo={key:1,class:"py-8 text-center text-sm text-gray-400"},Jo={class:"flex items-center gap-3"},Qo={key:2,class:"py-8 text-center text-sm text-gray-400"},en=H({__name:"NightOwlRank",props:{sessionId:{},timeFilter:{},showTopNSelect:{type:Boolean,default:!0},globalTopN:{}},setup(n){const e=n,a=T(null),s=T(!1),u=T("first"),i=T("distribution"),c=T(e.globalTopN??10),p=T(e.globalTopN??10);z(()=>e.globalTopN,g=>{g!==void 0&&(c.value=g,p.value=g)});async function m(){if(e.sessionId){s.value=!0;try{a.value=await Q().getNightOwlAnalysis(e.sessionId,e.timeFilter)}catch(g){console.error("加载出勤分析失败:",g)}finally{s.value=!1}}}const f=y(()=>a.value?a.value.lastSpeakerRank.map(g=>({id:String(g.memberId),name:g.name,value:g.count,percentage:g.percentage})):[]),h=y(()=>a.value?a.value.firstSpeakerRank.map(g=>({id:String(g.memberId),name:g.name,value:g.count,percentage:g.percentage})):[]),v=y(()=>u.value==="last"?f.value:h.value),r=y(()=>u.value==="last"?"⏰ 出勤排行 - 最晚下班":"⏰ 出勤排行 - 最早上班"),d=y(()=>{const g=u.value==="last"?"每天最后一个发言的人":"每天第一个发言的人",S=a.value?.totalDays;return S==null?g:`${g}(共 ${S} 天)`}),w=y(()=>i.value==="distribution"?"🦉 修仙统计 - 发言分布":"🦉 修仙统计 - 连续记录"),I=y(()=>i.value==="distribution"?"深夜时段(23:00-05:00)各时段发言分布":"连续在深夜时段发言的天数");return z(()=>[e.sessionId,e.timeFilter],()=>m(),{immediate:!0,deep:!0}),(g,S)=>(l(),$("div",Go,[s.value||a.value?(l(),$(E,{key:0},[x(t(j),{title:w.value,description:I.value},{headerRight:C(()=>[o("div",Yo,[n.showTopNSelect?(l(),k(t(re),{key:0,modelValue:c.value,"onUpdate:modelValue":S[0]||(S[0]=_=>c.value=_)},null,8,["modelValue"])):q("",!0),x(t(ie),{modelValue:i.value,"onUpdate:modelValue":S[1]||(S[1]=_=>i.value=_),items:[{label:"发言分布",value:"distribution"},{label:"连续记录",value:"consecutive"}],size:"sm"},null,8,["modelValue"])])]),default:C(()=>[s.value?(l(),k(de,{key:0})):i.value==="distribution"?(l(),$(E,{key:1},[a.value&&a.value.nightOwlRank.length>0?(l(),k(t(No),{key:0,items:a.value.nightOwlRank,"top-n":c.value,title:"",bare:""},null,8,["items","top-n"])):(l(),$("div",Xo,"暂无深夜发言数据"))],64)):(l(),$(E,{key:2},[a.value&&a.value.consecutiveRecords.length>0?(l(),k(t(Vo),{key:0,items:a.value.consecutiveRecords,"top-n":c.value,title:"",bare:""},null,8,["items","top-n"])):(l(),$("div",Zo,"暂无连续记录"))],64))]),_:1},8,["title","description"]),x(t(j),{title:r.value,description:d.value},{headerRight:C(()=>[o("div",Jo,[n.showTopNSelect?(l(),k(t(re),{key:0,modelValue:p.value,"onUpdate:modelValue":S[2]||(S[2]=_=>p.value=_)},null,8,["modelValue"])):q("",!0),x(t(ie),{modelValue:u.value,"onUpdate:modelValue":S[3]||(S[3]=_=>u.value=_),items:[{label:"最早上班",value:"first"},{label:"最晚下班",value:"last"}],size:"sm"},null,8,["modelValue"])])]),default:C(()=>[s.value?(l(),k(de,{key:0})):v.value.length>0?(l(),k(t(Fe),{key:1,members:v.value,title:r.value,"top-n":p.value,unit:"次",bare:""},null,8,["members","title","top-n"])):(l(),$("div",Qo,"暂无数据"))]),_:1},8,["title","description"])],64)):q("",!0)]))}}),tn={class:"mb-8 mt-4"},an={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"}},sn={id:"activity-rank",class:"scroll-mt-24"},on={id:"meme-battle",class:"scroll-mt-24"},nn={id:"repeat",class:"scroll-mt-24"},ln={id:"night-owl",class:"scroll-mt-24"},rn={id:"diving",class:"scroll-mt-24"},un={class:"border-l border-gray-200 pl-4 dark:border-gray-800"},cn={class:"mt-4 border-l border-gray-200 pl-4 dark:border-gray-800"},dn={class:"flex rounded-lg border border-gray-200 bg-white p-0.5 text-xs dark:border-gray-700 dark:bg-page-dark"},mn=["onClick"],vn=H({__name:"OverallRankingTab",props:{sessionId:{},timeFilter:{}},setup(n){const e=n,a=T([]),s=T([]),u=T(!1);async function i(){if(e.sessionId){u.value=!0;try{const g=Q(),[S,_]=await Promise.all([g.getMemberActivity(e.sessionId,e.timeFilter),g.getAvailableYears(e.sessionId)]);a.value=S,s.value=_}finally{u.value=!1}}}z(()=>[e.sessionId,e.timeFilter],()=>i(),{immediate:!0,deep:!0});const c=y(()=>{if(e.timeFilter?.startTs&&e.timeFilter?.endTs){const g=new Date(e.timeFilter.startTs*1e3).getFullYear(),S=new Date(e.timeFilter.endTs*1e3).getFullYear();return g===S?`${g} 赛季`:`${g}-${S} 赛季`}if(s.value.length>0){const g=[...s.value].sort((M,L)=>M-L),S=g[0],_=g[g.length-1];return S===_?`${S} 赛季`:`${S}-${_} 赛季`}return u.value?"赛季":"全部赛季"}),p=y(()=>({startTs:e.timeFilter?.startTs,endTs:e.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:f,activeAnchor:h,scrollToAnchor:v}=ha(m,{threshold:350}),r=T(10),d=T("standard");Ke(gt,d);const w=[{value:"standard",label:"标准"},{value:"wide",label:"宽屏"},{value:"full",label:"全宽"}],I=y(()=>ht[d.value].contentClass);return(g,S)=>(l(),$("div",{ref_key:"contentRef",ref:f,class:"flex gap-6 p-6"},[o("div",{class:K(["main-content mx-auto min-w-0 flex-1 space-y-6 px-8",I.value])},[o("div",tn,[o("h1",an," 🏆 "+b(c.value),1),S[1]||(S[1]=o("p",{class:"mt-4 text-sm text-gray-500 dark:text-gray-400"},"各榜单前三名请找群主领取奖励 🎁",-1))]),o("div",sn,[x(t(bo),{"session-id":e.sessionId,"member-activity":a.value,"base-loading":u.value,"time-filter":p.value,"global-top-n":r.value},null,8,["session-id","member-activity","base-loading","time-filter","global-top-n"])]),x(t(qo),{"session-id":e.sessionId,"time-filter":p.value,"global-top-n":r.value},null,8,["session-id","time-filter","global-top-n"]),o("div",on,[x(t(Po),{"session-id":e.sessionId,"time-filter":p.value,"global-top-n":r.value},null,8,["session-id","time-filter","global-top-n"])]),o("div",nn,[x(t(Ko),{"session-id":e.sessionId,"time-filter":p.value,"global-top-n":r.value},null,8,["session-id","time-filter","global-top-n"])]),o("div",ln,[x(t(en),{"session-id":e.sessionId,"time-filter":p.value,"global-top-n":r.value},null,8,["session-id","time-filter","global-top-n"])]),o("div",rn,[x(t(Wo),{"session-id":e.sessionId,"time-filter":p.value,"global-top-n":r.value},null,8,["session-id","time-filter","global-top-n"])]),S[2]||(S[2]=o("div",{class:"h-48 no-capture"},null,-1))],2),x(t(ka),{anchors:m,"active-anchor":t(h),onClick:t(v)},{default:C(()=>[o("div",un,[S[3]||(S[3]=o("div",{class:"mb-2 text-xs text-gray-400"},"显示数量",-1)),x(t(re),{modelValue:r.value,"onUpdate:modelValue":S[0]||(S[0]=_=>r.value=_)},null,8,["modelValue"])]),o("div",cn,[S[4]||(S[4]=o("div",{class:"mb-2 text-xs text-gray-400"},"榜单宽度",-1)),o("div",dn,[(l(),$(E,null,X(w,_=>o("button",{key:_.value,type:"button",class:K(["rounded-md px-2 py-1 transition",d.value===_.value?"bg-pink-500 text-white shadow-sm":"text-gray-500 hover:bg-gray-100 dark:text-gray-400 dark:hover:bg-gray-800"]),onClick:M=>d.value=_.value},b(_.label),11,mn)),64))])])]),_:1},8,["active-anchor","onClick"])],512))}}),pn={class:"main-content mx-auto max-w-3xl p-4 sm:p-6"},gn=H({__name:"InteractionRankingTab",props:{sessionId:{},timeFilter:{}},setup(n){const{t:e}=ee(),a=n,s=T(null),u=T(!1);async function i(){if(a.sessionId){u.value=!0;try{s.value=await Q().getMentionAnalysis(a.sessionId,a.timeFilter)}catch(r){console.error("加载 @ 互动分析失败:",r)}finally{u.value=!1}}}const c=y(()=>s.value?s.value.topMentioners.map(r=>({id:r.memberId.toString(),name:r.name,value:r.count,percentage:r.percentage})):[]),p=y(()=>s.value?s.value.topMentioned.map(r=>({id:r.memberId.toString(),name:r.name,value:r.count,percentage:r.percentage})):[]),m=T("mentioners"),f=y(()=>[{label:e("members.relationships.rankModes.mentioners"),value:"mentioners"},{label:e("members.relationships.rankModes.mentioned"),value:"mentioned"}]),h=y(()=>m.value==="mentioners"?c.value:p.value),v=y(()=>m.value==="mentioners"?e("members.relationships.topMentionersDescription"):e("members.relationships.topMentionedDescription"));return z(()=>[a.sessionId,a.timeFilter],()=>{i()},{immediate:!0,deep:!0}),(r,d)=>(l(),$("div",pn,[u.value?(l(),k(t(ge),{key:0,text:t(e)("members.relationships.loading")},null,8,["text"])):s.value&&s.value.totalMentions>0&&h.value.length>0?(l(),k(t(es),{key:1,members:h.value,title:t(e)("members.relationships.rankingTitle"),description:v.value,unit:t(e)("members.relationships.times")},{headerRight:C(()=>[x(t(ie),{modelValue:m.value,"onUpdate:modelValue":d[0]||(d[0]=w=>m.value=w),items:f.value,size:"sm"},null,8,["modelValue","items"])]),_:1},8,["members","title","description","unit"])):(l(),k(t(j),{key:2,title:t(e)("members.relationships.emptyTitle")},{default:C(()=>[x(t(ne),{text:t(e)("members.relationships.empty")},null,8,["text"])]),_:1},8,["title"]))]))}}),hn={class:"mx-auto h-full max-w-[920px] p-2 sm:p-4"},fn={class:"flex flex-wrap items-center justify-between gap-2 border-b border-gray-200 bg-gray-50 px-3 py-3 dark:border-gray-700 dark:bg-page-dark/50 sm:px-4"},yn={class:"flex items-center gap-3"},bn={class:"inline-flex items-center",role:"group"},xn={class:"flex items-center gap-3"},kn={class:"p-3 w-64"},wn={class:"text-sm font-medium mb-3"},_n={class:"space-y-3"},$n={class:"text-xs text-gray-500 mb-1 block"},Cn={class:"text-xs text-gray-400 mt-1"},Tn={class:"text-xs text-gray-500 mb-1 block"},In={class:"text-xs text-gray-400 mt-1"},Sn={class:"flex-1 min-h-0 overflow-hidden"},Rn={key:0,class:"h-full flex items-center justify-center"},Mn={key:1,class:"h-full flex items-center justify-center"},Ln={class:"text-center text-gray-400"},Vn={key:2,class:"h-full"},An={key:3,class:"h-full flex overflow-hidden"},Nn={class:"w-64 border-r border-gray-200 dark:border-gray-700 flex flex-col overflow-hidden"},Dn={class:"px-4 py-3 border-b border-gray-200 dark:border-gray-700"},Fn={class:"text-sm font-medium flex items-center gap-2"},qn={class:"flex-1 overflow-y-auto"},Bn=["onClick"],Un={class:"flex items-center justify-between"},Hn={class:"text-sm truncate"},Pn={class:"text-xs text-gray-400"},En={class:"flex-1 overflow-hidden flex flex-col"},zn={key:0,class:"flex-1 flex items-center justify-center"},On={class:"text-center text-gray-400"},jn={class:"px-4 py-3 border-b border-gray-200 dark:border-gray-700 flex items-center gap-3"},Kn={class:"w-10 h-10 rounded-full flex items-center justify-center text-white font-bold bg-primary-500"},Wn={class:"font-medium"},Gn={class:"text-xs text-gray-400"},Yn={class:"px-4 py-3 border-b border-gray-200 dark:border-gray-700"},Xn={class:"text-sm font-medium flex items-center gap-2"},Zn={class:"flex-1 overflow-y-auto"},Jn={key:0,class:"p-4 text-center text-gray-400"},Qn={class:"flex items-center gap-3"},el={class:"flex-1 min-w-0"},tl={class:"text-sm font-medium truncate"},al={class:"flex items-center gap-3 mt-0.5 text-xs text-gray-400"},sl={class:"w-20 h-2 bg-gray-200 dark:bg-gray-700 rounded-full overflow-hidden"},ol={key:4,class:"h-full flex flex-col overflow-hidden"},nl={class:"px-4 py-3 border-b border-gray-200 dark:border-gray-700"},ll={class:"text-sm font-medium flex items-center gap-2"},il={class:"flex-1 overflow-y-auto"},rl={class:"flex items-center gap-3"},ul={class:"flex-1 min-w-0"},cl={class:"flex items-center gap-2 text-sm"},dl={class:"font-medium truncate"},ml={class:"font-medium truncate"},vl={class:"flex items-center gap-3 mt-1 text-xs text-gray-400"},pl={class:"w-24 h-2 bg-gray-200 dark:bg-gray-700 rounded-full overflow-hidden"},gl={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-page-dark/50"},hl=H({__name:"ProximityRankingTab",props:{sessionId:{},timeFilter:{}},setup(n){ra([ua,ca,da,ma,va]);const e=n,{t:a}=ee(),s=Tt(),u=y(()=>s.value==="dark"),i=T(!0);ea(i);const c=T(null),p=T("matrix"),m=T(null),f=T({lookAhead:3,decaySeconds:120,topEdges:150}),h=T(null);let v=null;async function r(){if(e.sessionId){i.value=!0;try{c.value=await Q().getClusterGraph(e.sessionId,e.timeFilter,{lookAhead:f.value.lookAhead,decaySeconds:f.value.decaySeconds,topEdges:f.value.topEdges})}catch(V){console.error("[chart-cluster] 加载小团体关系数据失败:",V),c.value=null}finally{i.value=!1}}}const d=y(()=>{if(!c.value||c.value.nodes.length===0)return null;const{nodes:V,links:U,maxLinkValue:O}=c.value,Z=[...V].sort((P,Y)=>Y.messageCount-P.messageCount).slice(0,20).map(P=>P.name),G=new Map;for(const P of U)G.set(`${P.source}-${P.target}`,P.value),G.set(`${P.target}-${P.source}`,P.value);const F=[];for(let P=0;P<Z.length;P++)for(let Y=0;Y<Z.length;Y++)if(P===Y)F.push([P,Y,-1]);else{const xe=G.get(`${Z[P]}-${Z[Y]}`)||0;F.push([P,Y,xe])}return{names:Z,data:F,maxValue:O}});function w(){if(!d.value)return{graphic:{type:"text",style:{text:a("views.cluster.noData"),fill:"#999"}}};const{names:V,data:U,maxValue:O}=d.value;return{tooltip:{position:"top",formatter:te=>{const[Z,G,F]=te.data;return F<0?`${V[Z]}`:F===0?`${V[Z]} ↔ ${V[G]}<br/>暂无关系数据`:`${V[Z]} ↔ ${V[G]}<br/>临近度: ${F.toFixed(2)}`}},grid:{left:120,right:40,top:40,bottom:120},xAxis:{type:"category",data:V,splitArea:{show:!0},axisLabel:{rotate:45,fontSize:10,color:u.value?"#ccc":"#333"}},yAxis:{type:"category",data:V,splitArea:{show:!0},axisLabel:{fontSize:10,color:u.value?"#ccc":"#333"}},visualMap:{min:0,max:O||1,calculable:!0,orient:"horizontal",left:"center",bottom:10,inRange:{color:u.value?["#1a1a2e","#16213e","#0f3460","#e94560"]:["#f7f7f7","#fce4ec","#f8bbd9","#ee4567"]},textStyle:{color:u.value?"#ccc":"#333"}},series:[{type:"heatmap",data:U.filter(te=>te[2]>=0),label:{show:!1},emphasis:{itemStyle:{shadowBlur:10,shadowColor:"rgba(0, 0, 0, 0.5)"}}}],backgroundColor:"transparent"}}const I=y(()=>c.value?[...c.value.nodes].sort((V,U)=>U.messageCount-V.messageCount):[]),g=y(()=>!c.value||m.value===null?null:c.value.nodes.find(V=>V.id===m.value)||null),S=y(()=>{if(!c.value||!g.value)return[];const V=g.value.name,U=[];for(const O of c.value.links)O.source===V?U.push({otherName:O.target,value:O.value,coOccurrenceCount:O.coOccurrenceCount}):O.target===V&&U.push({otherName:O.source,value:O.value,coOccurrenceCount:O.coOccurrenceCount});return U.sort((O,te)=>te.value-O.value),U}),_=y(()=>c.value?c.value.links.slice(0,50):[]);function M(){v&&p.value==="matrix"&&v.setOption(w(),{notMerge:!0})}function L(){h.value&&(v=pa(h.value,u.value?"dark":void 0),M())}function W(){v?.resize()}return z(p,async(V,U)=>{U==="matrix"&&v&&(v.dispose(),v=null),V==="matrix"&&(await Be(),L())}),z([c,()=>u.value],()=>{p.value==="matrix"&&M()},{deep:!0}),z(i,async(V,U)=>{U&&!V&&p.value==="matrix"&&(v&&(v.dispose(),v=null),await Be(),L())}),z(()=>[e.sessionId,e.timeFilter],()=>r(),{immediate:!0,deep:!0}),Oe(()=>{window.addEventListener("resize",W),p.value==="matrix"&&Be(()=>L())}),at(()=>{window.removeEventListener("resize",W),v?.dispose(),v=null}),(V,U)=>{const O=Ie,te=lt,Z=It,G=Se;return l(),$("div",hn,[x(t(ia),{class:"flex h-full flex-col"},{default:C(()=>[o("div",fn,[o("div",yn,[o("div",bn,[x(O,{size:"xs",color:p.value==="matrix"?"primary":"neutral",variant:p.value==="matrix"?"solid":"ghost",onClick:U[0]||(U[0]=F=>p.value="matrix")},{default:C(()=>[J(b(t(a)("views.cluster.matrixView")),1)]),_:1},8,["color","variant"]),x(O,{size:"xs",color:p.value==="member"?"primary":"neutral",variant:p.value==="member"?"solid":"ghost",onClick:U[1]||(U[1]=F=>p.value="member")},{default:C(()=>[J(b(t(a)("views.cluster.memberView")),1)]),_:1},8,["color","variant"]),x(O,{size:"xs",color:p.value==="circle"?"primary":"neutral",variant:p.value==="circle"?"solid":"ghost",onClick:U[2]||(U[2]=F=>p.value="circle")},{default:C(()=>[J(b(t(a)("views.cluster.rankingView")),1)]),_:1},8,["color","variant"])])]),o("div",xn,[x(Z,null,{content:C(()=>[o("div",kn,[o("h4",wn,b(t(a)("views.cluster.modelSettings")),1),o("div",_n,[o("div",null,[o("label",$n,b(t(a)("views.cluster.lookAhead")),1),x(te,{modelValue:f.value.lookAhead,"onUpdate:modelValue":U[3]||(U[3]=F=>f.value.lookAhead=F),modelModifiers:{number:!0},type:"number",min:1,max:10,size:"xs",placeholder:"1-10"},null,8,["modelValue"]),o("p",Cn,b(t(a)("views.cluster.lookAheadDesc")),1)]),o("div",null,[o("label",Tn,b(t(a)("views.cluster.decaySeconds")),1),x(te,{modelValue:f.value.decaySeconds,"onUpdate:modelValue":U[4]||(U[4]=F=>f.value.decaySeconds=F),modelModifiers:{number:!0},type:"number",min:30,max:3600,size:"xs",placeholder:"30-3600"},null,8,["modelValue"]),o("p",In,b(t(a)("views.cluster.decaySecondsDesc")),1)]),x(O,{size:"xs",color:"primary",class:"w-full mt-2",onClick:r},{default:C(()=>[J(b(t(a)("views.cluster.applySettings")),1)]),_:1})])])]),default:C(()=>[x(O,{variant:"ghost",size:"xs",icon:"i-heroicons-adjustments-horizontal"})]),_:1}),x(O,{variant:"ghost",size:"xs",icon:"i-heroicons-arrow-path",onClick:r})])]),o("div",Sn,[i.value?(l(),$("div",Rn,[x(G,{name:"i-heroicons-arrow-path",class:"w-6 h-6 animate-spin text-gray-400"})])):!c.value||c.value.nodes.length===0?(l(),$("div",Mn,[o("div",Ln,[x(G,{name:"i-heroicons-user-group",class:"w-12 h-12 mx-auto mb-2 opacity-50"}),o("p",null,b(t(a)("views.cluster.noData")),1)])])):p.value==="matrix"?(l(),$("div",Vn,[o("div",{ref_key:"chartRef",ref:h,class:"w-full h-full"},null,512)])):p.value==="member"?(l(),$("div",An,[o("div",Nn,[o("div",Dn,[o("h3",Fn,[x(G,{name:"i-heroicons-users",class:"w-4 h-4"}),J(" "+b(t(a)("views.cluster.selectMember")),1)])]),o("div",qn,[(l(!0),$(E,null,X(I.value,F=>(l(),$("div",{key:F.id,class:K(["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":m.value===F.id}]),onClick:P=>m.value=F.id},[o("div",Un,[o("span",Hn,b(F.name),1),o("span",Pn,b(F.messageCount),1)])],10,Bn))),128))])]),o("div",En,[g.value?(l(),$(E,{key:1},[o("div",jn,[o("div",Kn,b(g.value.name.charAt(0)),1),o("div",null,[o("div",Wn,b(g.value.name),1),o("div",Gn,b(t(a)("views.cluster.msgCount"))+": "+b(g.value.messageCount)+" | "+b(t(a)("views.cluster.relationCount"))+": "+b(S.value.length),1)])]),o("div",Yn,[o("h3",Xn,[x(G,{name:"i-heroicons-heart",class:"w-4 h-4 text-pink-500"}),J(" "+b(t(a)("views.cluster.relationsByIntimacy")),1)])]),o("div",Zn,[S.value.length===0?(l(),$("div",Jn,b(t(a)("views.cluster.noRelations")),1)):q("",!0),(l(!0),$(E,null,X(S.value,(F,P)=>(l(),$("div",{key:F.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"},[o("div",Qn,[o("span",{class:K(["w-6 h-6 rounded-full flex items-center justify-center text-xs font-bold",P<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"])},b(P+1),3),o("div",el,[o("div",tl,b(F.otherName),1),o("div",al,[o("span",null,b(t(a)("views.cluster.intimacy"))+": "+b((F.value*100).toFixed(0))+"%",1),o("span",null,b(t(a)("views.cluster.coOccurrence"))+": "+b(F.coOccurrenceCount)+b(t(a)("views.cluster.times")),1)])]),o("div",sl,[o("div",{class:"h-full bg-linear-to-r from-pink-400 to-pink-600",style:_e({width:`${S.value[0]?.value?F.value/S.value[0].value*100:0}%`})},null,4)])])]))),128))])],64)):(l(),$("div",zn,[o("div",On,[x(G,{name:"i-heroicons-cursor-arrow-rays",class:"w-12 h-12 mx-auto mb-2 opacity-50"}),o("p",null,b(t(a)("views.cluster.selectMemberHint")),1)])]))])])):(l(),$("div",ol,[o("div",nl,[o("h3",ll,[x(G,{name:"i-heroicons-trophy",class:"w-4 h-4 text-yellow-500"}),J(" "+b(t(a)("views.cluster.interactionRanking")),1)])]),o("div",il,[(l(!0),$(E,null,X(_.value,(F,P)=>(l(),$("div",{key:P,class:"px-4 py-3 border-b border-gray-100 dark:border-gray-800 hover:bg-gray-50 dark:hover:bg-gray-800/50"},[o("div",rl,[o("span",{class:K(["w-8 h-8 rounded-full flex items-center justify-center text-sm font-bold",P<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"])},b(P+1),3),o("div",ul,[o("div",cl,[o("span",dl,b(F.source),1),U[5]||(U[5]=o("span",{class:"text-gray-400"},"↔",-1)),o("span",ml,b(F.target),1)]),o("div",vl,[o("span",null,b(t(a)("views.cluster.score"))+": "+b(F.value.toFixed(2)),1),o("span",null,b(t(a)("views.cluster.coOccurrence"))+": "+b(F.coOccurrenceCount)+b(t(a)("views.cluster.times")),1)])]),o("div",pl,[o("div",{class:"h-full bg-linear-to-r from-yellow-400 to-orange-500",style:_e({width:`${_.value[0]?.value?F.value/_.value[0].value*100:0}%`})},null,4)])])]))),128))])]))]),c.value?(l(),$("div",gl,[o("span",null,b(t(a)("views.cluster.totalMembers"))+": "+b(c.value.stats.totalMembers),1),o("span",null,b(t(a)("views.cluster.totalMessages"))+": "+b(c.value.stats.totalMessages.toLocaleString()),1),o("span",null,b(t(a)("views.cluster.involvedMembers"))+": "+b(c.value.stats.involvedMembers),1),o("span",null,b(t(a)("views.cluster.edgeCount"))+": "+b(c.value.stats.edgeCount),1)])):q("",!0)]),_:1})])}}}),fl={class:"flex h-full flex-col"},yl={class:"min-h-0 flex-1 overflow-y-auto"},bl={key:3,class:"main-content mx-auto w-full max-w-3xl p-6"},xl=H({__name:"RankingView",props:{sessionId:{},timeFilter:{},visibleTabIds:{}},setup(n){const e=n,{t:a,locale:s}=ee(),u=T("overall"),i=T(null),c=St({byId:new Map,byName:new Map});Ke(vt,c),z(()=>e.sessionId,async r=>{if(c.value={byId:new Map,byName:new Map},!!r)try{const d=await Q().getMembers(r);if(e.sessionId!==r)return;c.value=Sa(d)}catch(d){console.error("Failed to load ranking avatars:",d)}},{immediate:!0});const p=y(()=>Rt("groupRanking",s.value)),m=r=>!e.visibleTabIds||e.visibleTabIds.includes(r),f=y(()=>[...p.value&&m("overall")?[{id:"overall",label:a("analysis.subTabs.ranking.overall"),icon:"i-heroicons-trophy"}]:[],{id:"interaction",label:a("analysis.subTabs.ranking.interaction"),icon:"i-heroicons-heart"},{id:"proximity",label:a("analysis.subTabs.ranking.proximity"),icon:"i-heroicons-user-group"},{id:"hot-repeat",label:a("analysis.subTabs.quotes.hotRepeat"),icon:"i-heroicons-sparkles"},{id:"catchphrase",label:a("analysis.subTabs.quotes.catchphrase"),icon:"i-heroicons-chat-bubble-bottom-center-text"},{id:"keyword",label:a("analysis.subTabs.ranking.keyword"),icon:"i-heroicons-magnifying-glass"}].filter(d=>m(d.id))),h=y(()=>({startTs:e.timeFilter?.startTs,endTs:e.timeFilter?.endTs})),v=y(()=>({...h.value,memberId:i.value}));return z(f,r=>{r.some(d=>d.id===u.value)||(u.value=r[0]?.id??"hot-repeat")},{immediate:!0}),(r,d)=>(l(),$("div",fl,[x(t(ct),{modelValue:u.value,"onUpdate:modelValue":d[1]||(d[1]=w=>u.value=w),items:f.value,"persist-key":"groupRankingTab"},{right:C(()=>[u.value==="catchphrase"?(l(),k(ut,{key:0,modelValue:i.value,"onUpdate:modelValue":d[0]||(d[0]=w=>i.value=w),"session-id":e.sessionId},null,8,["modelValue","session-id"])):q("",!0)]),_:1},8,["modelValue","items"]),o("div",yl,[x(it,{name:"fade",mode:"out-in"},{default:C(()=>[u.value==="overall"?(l(),k(vn,{key:0,"session-id":e.sessionId,"time-filter":h.value},null,8,["session-id","time-filter"])):u.value==="interaction"?(l(),k(gn,{key:1,"session-id":e.sessionId,"time-filter":h.value},null,8,["session-id","time-filter"])):u.value==="proximity"?(l(),k(hl,{key:2,"session-id":e.sessionId,"time-filter":h.value},null,8,["session-id","time-filter"])):u.value==="keyword"?(l(),$("div",bl,[x(po,{"session-id":e.sessionId,"time-filter":h.value},null,8,["session-id","time-filter"])])):u.value==="hot-repeat"?(l(),k(t(Is),{key:4,"session-id":e.sessionId,"time-filter":h.value},null,8,["session-id","time-filter"])):u.value==="catchphrase"?(l(),k(t(gs),{key:5,"session-id":e.sessionId,"time-filter":v.value},null,8,["session-id","time-filter"])):q("",!0)]),_:1})])]))}}),kl=rt(xl,[["__scopeId","data-v-8da082e6"]]),wl={class:"main-content max-w-5xl p-6"},_l={class:"mb-4 text-sm text-gray-500 dark:text-gray-400 no-capture"},$l={key:0,class:"divide-y divide-gray-100 dark:divide-gray-800"},Cl={class:"w-32 shrink-0 pt-0.5 font-medium text-gray-900 dark:text-white"},Tl={class:"flex flex-1 flex-wrap items-center gap-2"},Il={class:"flex items-center gap-1.5 rounded-lg bg-gray-50 px-3 py-1.5 dark:bg-gray-800"},Sl={class:"text-xs text-gray-400"},Rl={key:0,class:"text-gray-300 dark:text-gray-600"},Ml=H({__name:"NicknameHistory",props:{sessionId:{}},setup(n){const{t:e}=ee(),a=n,s=T([]),u=T([]),i=T(!1);function c(f){return f.groupNickname||f.accountName||f.platformId}async function p(){if(a.sessionId)try{s.value=await Q().getMembers(a.sessionId)}catch(f){console.error("加载成员列表失败:",f)}}async function m(){if(!a.sessionId||s.value.length===0)return;i.value=!0;const f=[];try{const h=s.value.map(r=>Q().getMemberNameHistory(a.sessionId,r.id)),v=await Promise.all(h);s.value.forEach((r,d)=>{const w=v[d];w.length>2&&f.push({memberId:r.id,name:c(r),history:w})}),u.value=f}catch(h){console.error("加载昵称变更记录失败:",h)}finally{i.value=!1}}return z(()=>a.sessionId,async()=>{await p()},{immediate:!0}),z(()=>s.value.length,()=>{s.value.length>0&&m()}),Oe(async()=>{s.value.length===0&&await p()}),(f,h)=>{const v=mt;return l(),$("div",wl,[o("p",_l,b(t(e)("members.nicknameHistory.note")),1),x(t(j),{title:t(e)("members.nicknameHistory.title"),description:i.value?t(e)("members.nicknameHistory.loading"):u.value.length>0?t(e)("members.nicknameHistory.hasChanges",{count:u.value.length}):t(e)("members.nicknameHistory.noChanges")},{default:C(()=>[!i.value&&u.value.length>0?(l(),$("div",$l,[(l(!0),$(E,null,X(u.value,r=>(l(),$("div",{key:r.memberId,class:"flex items-start gap-3 px-5 py-3"},[o("div",Cl,b(r.name),1),o("div",Tl,[(l(!0),$(E,null,X(r.history,(d,w)=>(l(),$(E,{key:w},[o("div",Il,[o("span",{class:K(["text-sm",d.endTs===null?"font-semibold text-pink-600":"text-gray-700 dark:text-gray-300"])},b(d.name),3),d.endTs===null?(l(),k(v,{key:0,color:"primary",variant:"soft",size:"xs"},{default:C(()=>[J(b(t(e)("members.nicknameHistory.current")),1)]),_:1})):q("",!0),o("span",Sl,"("+b(t(sa)(d.startTs,d.endTs))+")",1)]),w<r.history.length-1?(l(),$("span",Rl,"→")):q("",!0)],64))),128))])]))),128))])):i.value?(l(),k(t(ge),{key:2,text:t(e)("members.nicknameHistory.loadingText")},null,8,["text"])):(l(),k(t(ne),{key:1,text:t(e)("members.nicknameHistory.empty")},null,8,["text"]))]),_:1},8,["title","description"])])}}}),Ll={class:"flex h-full flex-col overflow-hidden bg-white dark:bg-page-dark"},Vl={class:"flex flex-none items-center justify-between border-b border-gray-200 px-5 py-3 dark:border-gray-700"},Al={class:"text-lg font-semibold text-gray-900 dark:text-white"},Nl={class:"flex-1 overflow-auto"},Dl=H({__name:"NicknameHistoryEntry",props:{sessionId:{}},setup(n){const{t:e}=ee(),a=n,s=T(!1);return(u,i)=>{const c=Ie,p=De;return l(),$(E,null,[x(c,{variant:"ghost",icon:"i-heroicons-clock",size:"sm",onClick:i[0]||(i[0]=m=>s.value=!0)},{default:C(()=>[J(b(t(e)("analysis.subTabs.member.nicknameHistory")),1)]),_:1}),a.sessionId?(l(),k(p,{key:0,open:s.value,"onUpdate:open":i[2]||(i[2]=m=>s.value=m),ui:{content:"max-w-6xl h-[85vh]"}},{content:C(()=>[o("div",Ll,[o("div",Vl,[o("h2",Al,b(t(e)("analysis.subTabs.member.nicknameHistory")),1),x(c,{variant:"ghost",icon:"i-heroicons-x-mark",size:"sm",onClick:i[1]||(i[1]=m=>s.value=!1)})]),o("div",Nl,[x(Ml,{"session-id":a.sessionId},null,8,["session-id"])])])]),_:1},8,["open"])):q("",!0)],64)}}}),Fl={class:"relative flex h-full flex-col dark:bg-page-dark",style:{"padding-top":"var(--titlebar-area-height)"}},ql=["aria-label"],Bl={class:"relative flex-1 overflow-y-auto"},Ul={class:"h-full"},Hl={key:2,class:"flex h-full items-center justify-center"},Pl={class:"text-gray-500"},El={class:"flex h-full flex-col overflow-hidden bg-white dark:bg-page-dark"},zl={class:"flex flex-none items-center justify-between border-b border-gray-200 px-5 py-3 dark:border-gray-700"},Ol={class:"text-lg font-semibold text-gray-900 dark:text-white"},jl={class:"text-sm text-gray-500 dark:text-gray-400"},Kl={class:"flex items-center gap-2"},Wl={class:"flex-1 overflow-hidden"},Gl=H({__name:"index",setup(n){const e=ot(()=>nt(()=>import("./MessageExportModal-BQsIpyxv.js"),__vite__mapDeps([9,1,2,3,10,11,12,13]))),{t:a}=ee(),s=Mt(),u=Lt(),i=Vt(),c=je(),p=At(),{currentSessionId:m}=Nt(i),f=T(!1),h=T(!1),v=T(!1),r=T(!1),d=T(!1);function w(){c.openChatRecordDrawer({})}const I=[{id:"insights",labelKey:"analysis.tabs.insights",icon:"i-heroicons-presentation-chart-bar"},{id:"ranking",labelKey:"analysis.tabs.ranking",icon:"i-heroicons-trophy"},{id:"ai-chat",labelKey:"analysis.tabs.aiChat",icon:"i-heroicons-chat-bubble-left-ellipsis"},{id:"memory",labelKey:"analysis.tabs.memory",icon:"i-heroicons-light-bulb"},{id:"lab",labelKey:"analysis.tabs.lab",icon:"i-heroicons-beaker"}],g=y(()=>p.debugMode?[...I,{id:"debug",labelKey:"analysis.tabs.debug",icon:"i-heroicons-bug-ant"}]:I),S=y(()=>g.value.map(ce=>ce.id)),{activeTab:_,isLoading:M,isInitialLoad:L,isSessionSwitching:W,session:V,memberActivity:U,hourlyActivity:O,dailyActivity:te,messageTypes:Z,timeRangeValue:G,fullTimeRange:F,availableYears:P,timeFilter:Y,initialTimeState:xe,loadData:Re,handleTimeRangeInitialized:Me}=Et({route:s,router:u,currentSessionId:m,selectSession:i.selectSession,defaultTab:p.defaultSessionTab,validTabIds:S.value});Ke("session-switch-loading",W);const Le=T(_.value==="ai-chat"&&typeof s.query.aiChatId=="string"),Ve=y(()=>W.value||Le.value),le=y(()=>U.value.reduce((ce,N)=>ce+N.messageCount,0)),ue=y(()=>U.value.filter(ce=>ce.messageCount>0).length);return(ce,N)=>{const R=Ie,B=De;return l(),$("div",Fl,[Ve.value?(l(),$("div",{key:0,"data-testid":"group-chat-switch-loading",class:"absolute inset-0 z-20 flex cursor-wait items-center justify-center bg-page-bg dark:bg-page-dark",style:{paddingTop:"var(--titlebar-area-height)"},role:"status","aria-live":"polite","aria-label":t(a)("common.loading")},[x(t(dt))],8,ql)):q("",!0),t(V)?(l(),$(E,{key:1},[x(zt,{"active-tab":t(_),"onUpdate:activeTab":N[0]||(N[0]=D=>Ze(_)?_.value=D:null),"time-range-value":t(G),"onUpdate:timeRangeValue":N[1]||(N[1]=D=>Ze(G)?G.value=D:null),title:t(V).name,avatar:t(V).groupAvatar,icon:"i-heroicons-chat-bubble-left-right","icon-class":"bg-primary-600 text-white dark:bg-primary-500 dark:text-white",tabs:g.value,"current-session-id":t(m),"initial-time-state":t(xe),onOpenIncrementalImport:N[2]||(N[2]=D=>v.value=!0),onOpenMemberManagement:N[3]||(N[3]=D=>d.value=!0),onOpenChatRecord:w,"onUpdate:fullRange":N[4]||(N[4]=D=>F.value=D),"onUpdate:availableYears":N[5]||(N[5]=D=>P.value=D),onTimeRangeInitialized:t(Me)},null,8,["active-tab","time-range-value","title","avatar","tabs","current-session-id","initial-time-state","onTimeRangeInitialized"]),o("div",Bl,[t(M)&&!Ve.value?(l(),k(t(ge),{key:0,variant:"overlay",text:t(a)("common.loading")},null,8,["text"])):q("",!0),o("div",Ul,[x(it,{name:"tab-slide",mode:"out-in"},{default:C(()=>[t(_)==="insights"?(l(),k(Ds,{key:"insights-"+t(m),"session-id":t(m),session:t(V),"member-activity":t(U),"message-types":t(Z),"hourly-activity":t(O),"daily-activity":t(te),"time-range":t(F),"filtered-message-count":le.value,"filtered-member-count":ue.value,"time-filter":t(Y)},null,8,["session-id","session","member-activity","message-types","hourly-activity","daily-activity","time-range","filtered-message-count","filtered-member-count","time-filter"])):t(_)==="ranking"?(l(),k(kl,{key:"ranking-"+t(m),"session-id":t(m),"time-filter":t(Y)},null,8,["session-id","time-filter"])):t(_)==="ai-chat"?(l(),k(t(Ot),{key:"ai-chat-"+t(m),"session-id":t(m),"session-name":t(V).name,"chat-type":"group",onRestoreLoadingChange:N[6]||(N[6]=D=>Le.value=D)},null,8,["session-id","session-name"])):t(_)==="memory"?(l(),k(jt,{key:"memory-"+t(m),"session-id":t(m),"session-name":t(V).name},null,8,["session-id","session-name"])):t(_)==="lab"?(l(),k(Kt,{key:"lab-"+t(m),"session-id":t(m),"chat-type":"group"},null,8,["session-id"])):t(_)==="debug"?(l(),k(t(Wt),{key:"debug-"+t(m),"session-id":t(m)},null,8,["session-id"])):q("",!0)]),_:1})])]),x(Gt,{onOpenIncrementalImport:N[7]||(N[7]=D=>v.value=!0),onOpenSemanticIndex:N[8]||(N[8]=D=>f.value=!0),onOpenMemberManagement:N[9]||(N[9]=D=>d.value=!0),onOpenChatRecord:w,onOpenMessageExport:N[10]||(N[10]=D=>r.value=!0)})],64)):t(L)?q("",!0):(l(),$("div",Hl,[o("p",Pl,b(t(a)("analysis.groupChat.loadError")),1)])),t(m)&&t(V)?(l(),k(Yt,{key:3,modelValue:f.value,"onUpdate:modelValue":N[11]||(N[11]=D=>f.value=D),"session-id":t(m),"message-count":t(V).messageCount},null,8,["modelValue","session-id","message-count"])):q("",!0),t(m)&&t(V)?(l(),k(ga,{key:4,modelValue:h.value,"onUpdate:modelValue":N[12]||(N[12]=D=>h.value=D),"session-id":t(m),"chat-type":"group","auto-check":""},null,8,["modelValue","session-id"])):q("",!0),t(m)&&t(V)?(l(),k(Xt,{key:5,modelValue:v.value,"onUpdate:modelValue":N[13]||(N[13]=D=>v.value=D),"session-id":t(m),"session-name":t(V).name,onImported:N[14]||(N[14]=()=>{t(Re)(),t(i).loadSessions()})},null,8,["modelValue","session-id","session-name"])):q("",!0),t(m)?(l(),k(t(e),{key:6,modelValue:r.value,"onUpdate:modelValue":N[15]||(N[15]=D=>r.value=D)},null,8,["modelValue"])):q("",!0),t(m)?(l(),k(B,{key:7,open:d.value,"onUpdate:open":N[17]||(N[17]=D=>d.value=D),ui:{content:"max-w-6xl h-[85vh]"}},{content:C(()=>[o("div",El,[o("div",zl,[o("div",null,[o("h2",Ol,b(t(a)("analysis.tooltip.memberManagement")),1),o("p",jl,b(t(a)("members.list.description",{count:t(V)?.memberCount??0})),1)]),o("div",Kl,[x(Dl,{"session-id":t(m)},null,8,["session-id"]),x(R,{variant:"ghost",icon:"i-heroicons-x-mark",size:"sm",onClick:N[16]||(N[16]=D=>d.value=!1)})])]),o("div",Wl,[x(Zt,{"session-id":t(m),"show-header":!1,"chat-type":"group",onDataChanged:t(Re)},null,8,["session-id","onDataChanged"])])])]),_:1},8,["open"])):q("",!0)])}}}),Li=rt(Gl,[["__scopeId","data-v-56b25fde"]]);export{Li as default};
@@ -1 +0,0 @@
1
- import{a as k,a3 as b,aC as y,o as s,h as n,z as l,w as o,e,F as u,j as v,l as r,i as d,p,c as _,a5 as w,n as C,a6 as B,aD as V,k as z,aF as N,f as m,ae as P}from"./index-Bq5q3kSU.js";import{P as D}from"./PageHeader-DxhQHF_0.js";import{_ as F}from"./PageTabs.vue_vue_type_script_setup_true_lang-Cgungbjl.js";import{p as H}from"./people-page-header-Czt9e1jv.js";import"./vendor-snapdom--nZvo8Sg.js";const I={class:"flex h-full flex-col text-gray-900 dark:bg-page-dark dark:text-gray-100",style:{"padding-top":"var(--titlebar-area-height)"}},R={key:0,class:"hidden items-center gap-5 text-[11px] sm:flex"},S={key:0,class:"h-3 w-px bg-gray-250 dark:bg-white/10"},T={class:"flex items-center gap-1.5"},$={class:"text-gray-400 dark:text-gray-500"},j={class:"font-mono font-bold text-gray-900 dark:text-white"},E=k({__name:"index",setup(L){const{t:a}=b(),h=y(),c=m(()=>h.name==="people-relationships"?"relationships":"contacts"),g=m(()=>[{id:"contacts",label:a("contacts.title"),icon:"i-lucide-users",to:{name:"people-contacts"}},{id:"relationships",label:a("relationships.title"),icon:"i-lucide-git-fork",to:{name:"people-relationships"}}]),f=m(()=>c.value==="relationships"?{title:a("layout.relationships"),description:a("relationships.subtitle"),icon:"i-lucide-git-fork",iconClass:"bg-primary-600 text-white dark:bg-primary-500 dark:text-white shadow-sm"}:{title:a("layout.relationships"),description:a("contacts.subtitle",{count:0}),icon:"i-lucide-users",iconClass:"bg-primary-600 text-white dark:bg-primary-500 dark:text-white shadow-sm"}),{header:t}=H(f);return(U,q)=>{const x=w;return s(),n("div",I,[l(D,{title:e(t).title,description:e(t).description,size:"compact",icon:e(t).icon,"icon-class":e(t).iconClass},{actions:o(()=>[e(t).action?(s(),_(x,{key:0,icon:e(t).action.icon,color:"primary",variant:"soft",size:"sm",class:C(["rounded-xl",e(t).action.class]),loading:e(t).action.loading,disabled:e(t).action.disabled,onClick:e(t).action.onClick},{default:o(()=>[B(p(e(t).action.label),1)]),_:1},8,["icon","class","loading","disabled","onClick"])):r("",!0)]),default:o(()=>[l(e(F),{class:"mt-3 pb-1.5","model-value":c.value,items:g.value,"aria-label":e(a)("relationships.nav")},{right:o(()=>[e(t).stats?.length?(s(),n("div",R,[(s(!0),n(u,null,v(e(t).stats,i=>(s(),n(u,{key:i.id},[i.dividerBefore?(s(),n("div",S)):r("",!0),d("div",T,[d("span",$,p(i.label),1),d("span",j,p(i.value),1)])],64))),128))])):r("",!0)]),_:1},8,["model-value","items","aria-label"])]),_:1},8,["title","description","icon","icon-class"]),l(e(N),null,{default:o(({Component:i})=>[l(V,{name:"people-tab-slide",mode:"out-in"},{default:o(()=>[(s(),_(z(i),{key:c.value}))]),_:2},1024)]),_:1})])}}}),O=P(E,[["__scopeId","data-v-06450f37"]]);export{O as default};