chatlab-cli 0.37.3 → 0.37.4

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 (141) hide show
  1. package/LICENSE +661 -0
  2. package/dist/{chat-command-RQC44FPF.mjs → chat-command-DJKSQP6Y.mjs} +8 -8
  3. package/dist/{chunk-E6IRRNBQ.mjs → chunk-3K7F2SRZ.mjs} +3 -3
  4. package/dist/{chunk-GDKQKHJT.mjs → chunk-ARRFRJOH.mjs} +2 -2
  5. package/dist/{chunk-HJWBFHNR.mjs → chunk-D6BRSG3V.mjs} +4 -4
  6. package/dist/{chunk-4FAEB4C2.mjs → chunk-DJ7QEJNO.mjs} +12 -12
  7. package/dist/{chunk-O57SQSCO.mjs → chunk-JWWWLW5G.mjs} +2 -2
  8. package/dist/{chunk-ZOHSWBD2.mjs → chunk-NKSPJN6X.mjs} +108 -7
  9. package/dist/chunk-NKSPJN6X.mjs.map +1 -0
  10. package/dist/{chunk-5OA4QI3Q.mjs → chunk-NVW3ZCYD.mjs} +3 -3
  11. package/dist/{chunk-LUENE6L7.mjs → chunk-OXRS2UPE.mjs} +4 -4
  12. package/dist/{chunk-ZGXXAPLX.mjs → chunk-QP77JL6O.mjs} +2 -2
  13. package/dist/{chunk-E2ZFGNZQ.mjs → chunk-VCKF7RYB.mjs} +11 -11
  14. package/dist/{chunk-IDDTW5JN.mjs → chunk-WBPOMYBE.mjs} +8 -6
  15. package/dist/{chunk-IDDTW5JN.mjs.map → chunk-WBPOMYBE.mjs.map} +1 -1
  16. package/dist/{chunk-IMJVOODY.mjs → chunk-YPP3N2AX.mjs} +2 -2
  17. package/dist/cli.mjs +9 -9
  18. package/dist/contacts-worker.mjs +2 -2
  19. package/dist/global-insight-worker.mjs +1 -1
  20. package/dist/{http-QJDZKDNJ.mjs → http-O4AZUIOD.mjs} +12 -12
  21. package/dist/{import-XK6YM26A.mjs → import-IALJQB7V.mjs} +7 -7
  22. package/dist/index.mjs +12 -12
  23. package/dist/{mcp-DMGZFSYN.mjs → mcp-VNBL4WMM.mjs} +8 -8
  24. package/dist/people-relationships-worker.mjs +2 -2
  25. package/dist/semantic-index-worker.mjs +1 -1
  26. package/dist/{src-4AHJUFCW.mjs → src-6ICLBMOR.mjs} +6 -6
  27. package/dist/{stream-import-7VQVT5ST.mjs → stream-import-NKQYYSGZ.mjs} +7 -7
  28. package/dist/{worker-runtime-PQBAV75N.mjs → worker-runtime-AE2I6U2G.mjs} +5 -5
  29. package/dist-cli-web/assets/{AISettingsTab-qS3XKnvh.js → AISettingsTab-mecu-HsX.js} +1 -1
  30. package/dist-cli-web/assets/{AboutTab-K-i40dPv.js → AboutTab-CgXYD50w.js} +1 -1
  31. package/dist-cli-web/assets/{Alert-GSvA5B7J.js → Alert-DR892gaV.js} +1 -1
  32. package/dist-cli-web/assets/{ApiSettingsTab-DIVGTR3g.js → ApiSettingsTab-Cvw8gStg.js} +1 -1
  33. package/dist-cli-web/assets/{BatchManageTab-CJhwvYWV.js → BatchManageTab-DqSEzAtr.js} +1 -1
  34. package/dist-cli-web/assets/{BufferResource-Cjm0m7sF.js → BufferResource-rydt5j-b.js} +1 -1
  35. package/dist-cli-web/assets/{CanvasRenderer-C-fmrahh.js → CanvasRenderer-Ci5IaFxW.js} +1 -1
  36. package/dist-cli-web/assets/{CardDecoration-Cz54ZPyh.js → CardDecoration-8F4sZO4v.js} +1 -1
  37. package/dist-cli-web/assets/{ChatRecordDrawer-Cst8zTUv.js → ChatRecordDrawer-D3LzSRkL.js} +1 -1
  38. package/dist-cli-web/assets/{ChatRecordWorkspace-DKVKaimw.js → ChatRecordWorkspace-BDCIAjm3.js} +1 -1
  39. package/dist-cli-web/assets/{Checkbox-CrlY3jiJ.js → Checkbox-I1cjN4s_.js} +1 -1
  40. package/dist-cli-web/assets/{DataDirCleanupNotice-Cjqiub4e.js → DataDirCleanupNotice-8zcIOyGl.js} +1 -1
  41. package/dist-cli-web/assets/{DatePicker.vue_vue_type_script_setup_true_lang-BYY2UmPA.js → DatePicker.vue_vue_type_script_setup_true_lang-DWWzQOTU.js} +1 -1
  42. package/dist-cli-web/assets/{DebugToolsPanel-I00RV_Lr.js → DebugToolsPanel-CiGd5ttA.js} +1 -1
  43. package/dist-cli-web/assets/{EChart.vue_vue_type_script_setup_true_lang-CRTZh9kh.js → EChart.vue_vue_type_script_setup_true_lang-Rk-Bu-rv.js} +1 -1
  44. package/dist-cli-web/assets/{EChartBar.vue_vue_type_script_setup_true_lang-DjDFhnN9.js → EChartBar.vue_vue_type_script_setup_true_lang-CB_KuKt4.js} +1 -1
  45. package/dist-cli-web/assets/{EChartLine.vue_vue_type_script_setup_true_lang-BLqlW9E4.js → EChartLine.vue_vue_type_script_setup_true_lang-5iW9KPRe.js} +1 -1
  46. package/dist-cli-web/assets/{EChartWordcloud-ChKJM8bU.js → EChartWordcloud-BiN68kpp.js} +1 -1
  47. package/dist-cli-web/assets/{FileDropZone.vue_vue_type_script_setup_true_lang-CsRmQhVQ.js → FileDropZone.vue_vue_type_script_setup_true_lang-DpK_xXUN.js} +1 -1
  48. package/dist-cli-web/assets/{Filter-Duzxgudo.js → Filter-Tmam9FK9.js} +1 -1
  49. package/dist-cli-web/assets/{GlobalTaskBar-DL0IJxlt.js → GlobalTaskBar-B77auVn7.js} +1 -1
  50. package/dist-cli-web/assets/{GroupRelationshipGalaxyView-BZrB2o2g.js → GroupRelationshipGalaxyView-DAmdqVxU.js} +1 -1
  51. package/dist-cli-web/assets/{Label-CaVKlQnJ.js → Label-DTrL45eR.js} +1 -1
  52. package/dist-cli-web/assets/{LoadingState.vue_vue_type_script_setup_true_lang-uF54r-dT.js → LoadingState.vue_vue_type_script_setup_true_lang-DH0zYa8f.js} +1 -1
  53. package/dist-cli-web/assets/{MessageExportModal-JpurBsUW.js → MessageExportModal-DgvQvcc5.js} +1 -1
  54. package/dist-cli-web/assets/{PageHeader-BciykZ_-.js → PageHeader-C-UYITO9.js} +1 -1
  55. package/dist-cli-web/assets/{PageTabs.vue_vue_type_script_setup_true_lang-2Xe2iUFO.js → PageTabs.vue_vue_type_script_setup_true_lang-BV344PR7.js} +1 -1
  56. package/dist-cli-web/assets/{RelationshipGalaxyCanvas-BO5-MowG.js → RelationshipGalaxyCanvas-Bzh-vQI8.js} +3 -3
  57. package/dist-cli-web/assets/{RelationshipGalaxyThreeCanvas-Dp4CcWU5.js → RelationshipGalaxyThreeCanvas--DDkxCCc.js} +1 -1
  58. package/dist-cli-web/assets/{RenderTargetSystem-CfuoUG_y.js → RenderTargetSystem-BP0KBa7R.js} +1 -1
  59. package/dist-cli-web/assets/{RovingFocusItem-FpYwYEP_.js → RovingFocusItem-BAQO8BlG.js} +1 -1
  60. package/dist-cli-web/assets/{ScreenCaptureModal-cElYPaSj.js → ScreenCaptureModal-DtAB4lyN.js} +1 -1
  61. package/dist-cli-web/assets/{SectionTabs.vue_vue_type_script_setup_true_lang-pVQMbTsj.js → SectionTabs.vue_vue_type_script_setup_true_lang-DjUq1i7-.js} +1 -1
  62. package/dist-cli-web/assets/{Select-H8Fz6RkU.js → Select-CaRAtYOu.js} +1 -1
  63. package/dist-cli-web/assets/{SettingsModal-52Fw4fVW.js → SettingsModal-BKu9l7vR.js} +2 -2
  64. package/dist-cli-web/assets/{StorageTab-BnugE5BO.js → StorageTab-DWUzStD4.js} +1 -1
  65. package/dist-cli-web/assets/{Switch-K4aqYC4Y.js → Switch-mMuTJ87v.js} +1 -1
  66. package/dist-cli-web/assets/{Tabs-DJ5p8gb6.js → Tabs-B0DXvZn9.js} +1 -1
  67. package/dist-cli-web/assets/{Tabs-BXjD45rO.js → Tabs-Bw65ChMB.js} +1 -1
  68. package/dist-cli-web/assets/{ThemeCard.vue_vue_type_script_setup_true_lang-BLmTpx4f.js → ThemeCard.vue_vue_type_script_setup_true_lang-CFSCaL65.js} +1 -1
  69. package/dist-cli-web/assets/{TimeSelect.vue_vue_type_script_setup_true_lang-geQAlopO.js → TimeSelect.vue_vue_type_script_setup_true_lang-sP4Z2nbi.js} +1 -1
  70. package/dist-cli-web/assets/{VisuallyHiddenInput-J2KEIQBX.js → VisuallyHiddenInput-Cy3d6wW5.js} +1 -1
  71. package/dist-cli-web/assets/{WebGLRenderer-BDFzRniS.js → WebGLRenderer-C86bSgXH.js} +1 -1
  72. package/dist-cli-web/assets/{WebGPURenderer-BKYZyUCZ.js → WebGPURenderer-EcnRVF_C.js} +1 -1
  73. package/dist-cli-web/assets/{aiChat-CdJzpNYW.js → aiChat-ZrHuq9Eb.js} +3 -3
  74. package/dist-cli-web/assets/{base-129JztT1.js → base-DwqzgeyP.js} +1 -1
  75. package/dist-cli-web/assets/{browserAll-CZNZDK1i.js → browserAll-DUX8qJC8.js} +1 -1
  76. package/dist-cli-web/assets/{chatMessages-zmzHCUCy.js → chatMessages-By6kR5_1.js} +3 -3
  77. package/dist-cli-web/assets/{cli-web-_WGCg-ZY.js → cli-web-JlckDfz0.js} +1 -1
  78. package/dist-cli-web/assets/{fetch-Dw33HaVP.js → fetch-Bhl8mtJ2.js} +1 -1
  79. package/dist-cli-web/assets/{fetch-B7Tdp7Uo.js → fetch-BjtwVVBg.js} +1 -1
  80. package/dist-cli-web/assets/{fetch-DaeoNUip.js → fetch-BpoJa14b.js} +1 -1
  81. package/dist-cli-web/assets/{fetch-DTPDtL38.js → fetch-CY5yJNTL.js} +1 -1
  82. package/dist-cli-web/assets/{fetch-DOsmgros.js → fetch-ChSI9rRd.js} +1 -1
  83. package/dist-cli-web/assets/{fetch-BBdyPNj3.js → fetch-CuySZ9TW.js} +1 -1
  84. package/dist-cli-web/assets/{fetch-C4W6tD-D.js → fetch-DS-lTLBb.js} +1 -1
  85. package/dist-cli-web/assets/{fetch-Di4QpfqL.js → fetch-Dkyidev6.js} +1 -1
  86. package/dist-cli-web/assets/{fetch-sbr95ipd.js → fetch-DtqHZHIT.js} +1 -1
  87. package/dist-cli-web/assets/{fetch-DgHdAlO7.js → fetch-GYzy1nua.js} +1 -1
  88. package/dist-cli-web/assets/{fetch-Bafz8jLM.js → fetch-LZAcmdq3.js} +1 -1
  89. package/dist-cli-web/assets/{fetch-IP6i-mtr.js → fetch-w66ywFn5.js} +1 -1
  90. package/dist-cli-web/assets/{host-CMnAiJSx.js → host-CBXwW7_e.js} +1 -1
  91. package/dist-cli-web/assets/{host-CuuNLUWx.js → host-CDCKLdfF.js} +1 -1
  92. package/dist-cli-web/assets/{index-DhRaZS6z.js → index-3KDkw8sV.js} +1 -1
  93. package/dist-cli-web/assets/{index-fsLAooCi.js → index-BAjafcRU.js} +1 -1
  94. package/dist-cli-web/assets/{index-BOXh7X5Y.js → index-BLO0CYvx.js} +1 -1
  95. package/dist-cli-web/assets/{index-BepItDCQ.js → index-BVoFqt2r.js} +4 -4
  96. package/dist-cli-web/assets/{index-Dz4yfeg6.js → index-CYmoNVAj.js} +1 -1
  97. package/dist-cli-web/assets/{index-bQ9oj54q.js → index-D07viL9P.js} +4 -4
  98. package/dist-cli-web/assets/{index-CN9WMxb3.js → index-DD7RFB6N.js} +2 -2
  99. package/dist-cli-web/assets/index-DEafpen2.js +137 -0
  100. package/dist-cli-web/assets/{index-BmGA3geF.js → index-D_CX3gzo.js} +1 -1
  101. package/dist-cli-web/assets/{index-EtteazuD.js → index-D_SJKdur.js} +1 -1
  102. package/dist-cli-web/assets/{index-DgCXdbsG.js → index-RqQZ2vvr.js} +2 -2
  103. package/dist-cli-web/assets/{index-BBYtZa7g.js → index-T_aveLoS.js} +1 -1
  104. package/dist-cli-web/assets/{index-BZpR015e.css → index-XC-s67UA.css} +1 -1
  105. package/dist-cli-web/assets/{index-Chh0gCp7.js → index-fhyFEtxF.js} +1 -1
  106. package/dist-cli-web/assets/{index-C-u3l4Uh.js → index-sMeHjrc9.js} +1 -1
  107. package/dist-cli-web/assets/{people-page-header-CKXRSnpl.js → people-page-header-DPOKmbHG.js} +1 -1
  108. package/dist-cli-web/assets/{prompt-DNxAd1Bj.js → prompt-ipERjPzE.js} +1 -1
  109. package/dist-cli-web/assets/{semantic-index-config-builder-CQ27G4TK.js → semantic-index-config-builder-CjJ4q8PF.js} +1 -1
  110. package/dist-cli-web/assets/service-2UJZvVpa.js +1 -0
  111. package/dist-cli-web/assets/{service-BwbGKwDn.js → service-CAdsM9Hy.js} +1 -1
  112. package/dist-cli-web/assets/service-i_PJfTaR.js +1 -0
  113. package/dist-cli-web/assets/useFormControl-BPt9mIxj.js +1 -0
  114. package/dist-cli-web/assets/{useInsightTabAnalytics-DaU_ADbQ.js → useInsightTabAnalytics-s3wcN9Eo.js} +4 -4
  115. package/dist-cli-web/assets/{useTable-BYXxnZMd.js → useTable-DOM-gqX0.js} +1 -1
  116. package/dist-cli-web/assets/{useToast-DPkgv34s.js → useToast-BzK6i1Tk.js} +1 -1
  117. package/dist-cli-web/assets/{webworkerAll-Um4PrCaA.js → webworkerAll-ClkzpxNT.js} +1 -1
  118. package/dist-cli-web/index.html +2 -2
  119. package/package.json +1 -1
  120. package/dist/chunk-ZOHSWBD2.mjs.map +0 -1
  121. package/dist-cli-web/assets/index-GNMlsoVH.js +0 -137
  122. package/dist-cli-web/assets/service-DQjyjQZx.js +0 -1
  123. package/dist-cli-web/assets/service-Dtve_40X.js +0 -1
  124. package/dist-cli-web/assets/useFormControl-CNmp_2bd.js +0 -1
  125. /package/dist/{chat-command-RQC44FPF.mjs.map → chat-command-DJKSQP6Y.mjs.map} +0 -0
  126. /package/dist/{chunk-E6IRRNBQ.mjs.map → chunk-3K7F2SRZ.mjs.map} +0 -0
  127. /package/dist/{chunk-GDKQKHJT.mjs.map → chunk-ARRFRJOH.mjs.map} +0 -0
  128. /package/dist/{chunk-HJWBFHNR.mjs.map → chunk-D6BRSG3V.mjs.map} +0 -0
  129. /package/dist/{chunk-4FAEB4C2.mjs.map → chunk-DJ7QEJNO.mjs.map} +0 -0
  130. /package/dist/{chunk-O57SQSCO.mjs.map → chunk-JWWWLW5G.mjs.map} +0 -0
  131. /package/dist/{chunk-5OA4QI3Q.mjs.map → chunk-NVW3ZCYD.mjs.map} +0 -0
  132. /package/dist/{chunk-LUENE6L7.mjs.map → chunk-OXRS2UPE.mjs.map} +0 -0
  133. /package/dist/{chunk-ZGXXAPLX.mjs.map → chunk-QP77JL6O.mjs.map} +0 -0
  134. /package/dist/{chunk-E2ZFGNZQ.mjs.map → chunk-VCKF7RYB.mjs.map} +0 -0
  135. /package/dist/{chunk-IMJVOODY.mjs.map → chunk-YPP3N2AX.mjs.map} +0 -0
  136. /package/dist/{http-QJDZKDNJ.mjs.map → http-O4AZUIOD.mjs.map} +0 -0
  137. /package/dist/{import-XK6YM26A.mjs.map → import-IALJQB7V.mjs.map} +0 -0
  138. /package/dist/{mcp-DMGZFSYN.mjs.map → mcp-VNBL4WMM.mjs.map} +0 -0
  139. /package/dist/{src-4AHJUFCW.mjs.map → src-6ICLBMOR.mjs.map} +0 -0
  140. /package/dist/{stream-import-7VQVT5ST.mjs.map → stream-import-NKQYYSGZ.mjs.map} +0 -0
  141. /package/dist/{worker-runtime-PQBAV75N.mjs.map → worker-runtime-AE2I6U2G.mjs.map} +0 -0
@@ -1,7 +1,7 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/service-BwbGKwDn.js","assets/index-bQ9oj54q.js","assets/vendor-snapdom--nZvo8Sg.js","assets/index-BZpR015e.css"])))=>i.map(i=>d[i]);
2
- import{e as S,g as k,bD as Qs,x as wt,al as _t,d as be,cI as ze,c0 as ti,C as Oe,b as J,cB as ni,cJ as ri,cK as Js,G as si,cL as ai,cM as ii,cN as ls,cO as oi,cP as li,cQ as ci,cR as ui,cS as di,cT as pi,cU as hi,cV as Be,ce as Lt,K as Te,cW as fi,cX as gi,cg as cs,aI as Je,bt as mi,o as m,f as ae,a6 as qe,J as Xn,aA as er,c as x,n as Y,a as h,z as F,a7 as Ne,p as w,a8 as tr,w as de,a9 as He,F as me,j as _e,aK as Zs,aL as Xs,aR as mt,aQ as yn,bO as ea,cY as yi,l as q,aF as It,a0 as vi,aa as ta,a3 as ki,O as xi,r as Rt,ah as nr,bh as na,cZ as Nt,c_ as xt,c$ as Pt,d0 as fe,d1 as Ee,d2 as ra,d3 as bi,d4 as sa,d5 as vt,d6 as Or,d7 as wi,d8 as _i,d9 as Ti,da as Ci,db as Ue,dc as Si,dd as us,de as aa,df as Mi,dg as en,dh as rr,di as tn,dj as Ai,dk as Ke,dl as Li,dm as $t,dn as $i,dp as tt,dq as Ei,dr as Ii,ds as Ht,dt as wr,du as Ri,dv as Pi,dw as Hi,dx as Ni,dy as zi,dz as ia,dA as Oi,dB as ds,dC as _r,dD as Bi,dE as Di,dF as oa,dG as ji,as as la,aX as Fi,aT as qi,bG as Ui,P as ca,aw as xn,av as ua,H as Ki,aN as Wi,aH as Vi,aE as Gi,ap as Yi,L as lr,bS as Qi,ar as Ji,aP as Zi,aV as Xi,cb as eo,m as ps,au as to,bC as no,cf as ro}from"./index-bQ9oj54q.js";import{M as da,_ as so}from"./index-BmGA3geF.js";import{u as Br}from"./useToast-DPkgv34s.js";import{_ as hs}from"./EChartBar.vue_vue_type_script_setup_true_lang-DjDFhnN9.js";import{_ as pa}from"./EChart.vue_vue_type_script_setup_true_lang-CRTZh9kh.js";import{_ as fs}from"./EChartLine.vue_vue_type_script_setup_true_lang-BLqlW9E4.js";import{s as ao,a as ha}from"./aiChat-CdJzpNYW.js";import{u as fa}from"./prompt-DNxAd1Bj.js";import{useCacheService as io}from"./service-BwbGKwDn.js";function oo(e){const t=S(()=>k(e)),n=S(()=>new Intl.Collator("en",{usage:"search",...t.value}));return{startsWith:(a,o)=>o.length===0?!0:(a=a.normalize("NFC"),o=o.normalize("NFC"),n.value.compare(a.slice(0,o.length),o)===0),endsWith:(a,o)=>o.length===0?!0:(a=a.normalize("NFC"),o=o.normalize("NFC"),n.value.compare(a.slice(-o.length),o)===0),contains:(a,o)=>{if(o.length===0)return!0;a=a.normalize("NFC"),o=o.normalize("NFC");let l=0;const c=o.length;for(;l+c<=a.length;l++){const u=a.slice(l,l+c);if(n.value.compare(o,u)===0)return!0}return!1}}}const lo={none:[],qwen:["default","off","high"],deepseek_v4:["default","off","high","xhigh"],deepseek_hybrid:["default","off","auto"],o_series:["default","low","medium","high"],gpt5:["default","minimal","low","medium","high"],gpt5_1:["default","off","low","medium","high"],gpt5_2plus:["default","off","minimal","low","medium","high","xhigh"],grok:["default","low","high"],kimi:["default","off","auto","low","medium","high"],doubao:["default","off","auto","high"],hunyuan:["default","off","high"],gemini:["default","off","low","medium","high"],default:["default","off","low","medium","high"]},gs=/^(?!.*-non-reasoning\b)(o\d+(?:-[\w-]+)?|.*\b(?:reasoning|reasoner|thinking|think)\b.*|.*-[rR]\d+.*|.*\bqwq(?:-[\w-]+)?\b.*|.*\bhunyuan-t1(?:-[\w-]+)?\b.*|.*\bgrok-(?:3-mini|4|4-fast|build)(?:-[\w-]+)?\b.*)$/i;function co(e,t){const n=t.toLowerCase(),s=e.toLowerCase();if(n.includes("-non-reasoning")||s==="anthropic")return"none";if(s==="gemini")return/gemini-(?:2\.5|3(?:\.\d+)?-(?:flash|pro)|flash-latest|pro-latest)/i.test(n)?"gemini":"none";if(s==="qwen"||/\bqwen|qwq/i.test(n))return"qwen";if(/deepseek[_-]v([4-9]|\d{2,})/i.test(n)||/deepseek-ai\/deepseek-r1/i.test(n))return"deepseek_v4";if(/deepseek[_-]chat|deepseek[_-]v3/i.test(n))return"deepseek_hybrid";if(s==="openai"||s==="openai-compatible"){if(/gpt-5\.[2-9]|gpt-5\.[1-9]\d/.test(n))return"gpt5_2plus";if(/gpt-5\.1/.test(n))return"gpt5_1";if(/gpt-5/.test(n))return"gpt5";if(/^o\d/.test(n))return"o_series"}return/^o\d/.test(n)?"o_series":/\bgrok-(?:3-mini|4|4-fast|build)\b/i.test(n)?"grok":/\bkimi-k(?:2-thinking|2\.[5-9]|[3-9])/i.test(n)||s==="kimi"&&/thinking/i.test(n)?"kimi":/\bdoubao-.*seed/i.test(n)||s==="doubao"&&/seed/i.test(n)?"doubao":/\bhunyuan-(?:t1|a13b)/i.test(n)?"hunyuan":s==="glm"||/\bglm-?(?:5|4\.[5-7]|z1|zero)/i.test(n)?"qwen":s==="siliconflow"&&/r[1-9]/i.test(n)?"deepseek_v4":s==="openrouter"?/deepseek.*(v[4-9]|r\d)/i.test(n)?"deepseek_v4":/deepseek[_-]?(chat|v3)/i.test(n)?"deepseek_hybrid":/\bgrok-(?:3-mini|4|4-fast|build)\b/i.test(n)?"grok":/\bkimi-k(?:2-thinking|2\.[5-9]|[3-9])/i.test(n)?"kimi":gs.test(n)?"default":"none":/\bmimo-v2/i.test(n)||/\bminimax-m[123]/i.test(n)||/\bseed-oss/i.test(n)?"deepseek_hybrid":/\bbaichuan-m[23]/i.test(n)||/\bmagistral/i.test(n)||/\bmistral-small-2603/i.test(n)||/\bstep-(?:3|r1-v-mini)/i.test(n)||/\bgemma-?4/i.test(n)||/\bpangu-pro-moe/i.test(n)||/\bsonar-deep-research/i.test(n)||/\bring-(?:1t|mini|flash)/i.test(n)?"default":/\bqwen|qwq/i.test(n)?"qwen":/deepseek[_-]?r\d|deepseek[_-]?v[4-9]/i.test(n)?"deepseek_v4":/^o\d/i.test(n)?"o_series":gs.test(n)?"default":"none"}function uo(e,t){const n=co(e,t);return lo[n]}function po(){const{contains:e,startsWith:t}=oo({sensitivity:"base"});function n(a,o){return e(a,o)?e(o,a)?0:t(a,o)?1:2:null}function s(a,o,l){if(typeof a!="object"||a===null)return n(String(a),o);let c=null;for(const u of l){const d=Qs(a,u);if(d==null)continue;const p=Array.isArray(d)?d.map(String):[String(d)];for(const f of p){const y=n(f,o);if(y!==null&&(c===null||y<c)&&(c=y),c===0)return 0}}return c}function r(a,o,l){if(!o)return a;const c=[];for(const u of a){const d=s(u,o,l);d!==null&&c.push({item:u,score:d})}return c.sort((u,d)=>u.score-d.score),c.map(({item:u})=>u)}function i(a,o,l){return o?a.map(c=>{const u=[];for(const d of c){if(d==null)continue;if(l.isStructural?.(d)){u.push({item:d,score:-1});continue}const p=s(d,o,l.fields);p!==null&&u.push({item:d,score:p})}return u.sort((d,p)=>d.score-p.score),u.map(({item:d})=>d)}).filter(c=>c.some(u=>!l.isStructural?.(u))):a}return{score:n,scoreItem:s,filter:r,filterGroups:i}}function ms(e){return ai((t,n)=>({get(){return t(),e},set(s){e=s,requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})}}))}var ho=class extends ri{constructor(e={}){return super(e),this.contentComponent=null,this.appContext=null,this.reactiveState=ms(this.view.state),this.reactiveExtensionStorage=ms(this.extensionStorage),this.on("beforeTransaction",({nextState:t})=>{this.reactiveState.value=t,this.reactiveExtensionStorage.value=this.extensionStorage}),Js(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(e,t){const n=super.registerPlugin(e,t);return this.reactiveState&&(this.reactiveState.value=n),n}unregisterPlugin(e){const t=super.unregisterPlugin(e);return this.reactiveState&&t&&(this.reactiveState.value=t),t}},fo=be({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(e){const t=J(),n=ni();return ti(()=>{const s=e.editor;s&&s.options.element&&t.value&&Oe(()=>{var r;if(!t.value||!((r=s.view.dom)!=null&&r.parentNode))return;const i=k(t.value);t.value.append(...s.view.dom.parentNode.childNodes),s.contentComponent=n.ctx._,n&&(s.appContext={...n.appContext,provides:n.provides}),s.setOptions({element:i}),s.createNodeViews()})}),_t(()=>{const s=e.editor;s&&(s.contentComponent=null,s.appContext=null)}),{rootEl:t}},render(){return ze("div",{ref:e=>{this.rootEl=e}})}}),go=(e={})=>{const t=si();return wt(()=>{t.value=new ho(e)}),_t(()=>{var n,s,r,i;const a=(s=(n=t.value)==null?void 0:n.view.dom)==null?void 0:s.parentNode,o=a?.cloneNode(!0);(r=a?.parentNode)==null||r.replaceChild(o,a),(i=t.value)==null||i.destroy()}),t},mo=class{constructor(e,{props:t={},editor:n}){this.destroyed=!1,this.editor=n,this.component=Js(e),this.el=document.createElement("div"),this.props=ii(t),this.renderedComponent=this.renderComponent()}get element(){return this.renderedComponent.el}get ref(){var e,t,n,s;return(t=(e=this.renderedComponent.vNode)==null?void 0:e.component)!=null&&t.exposed?this.renderedComponent.vNode.component.exposed:(s=(n=this.renderedComponent.vNode)==null?void 0:n.component)==null?void 0:s.proxy}renderComponent(){if(this.destroyed)return this.renderedComponent;let e=ze(this.component,this.props);return this.editor.appContext&&(e.appContext=this.editor.appContext),typeof document<"u"&&this.el&&ls(e,this.el),{vNode:e,destroy:()=>{this.el&&ls(null,this.el),this.el=null,e=null},el:this.el?this.el.firstElementChild:null}}updateProps(e={}){this.destroyed||(Object.entries(e).forEach(([t,n])=>{this.props[t]=n}),this.renderComponent())}destroy(){this.destroyed||(this.destroyed=!0,this.renderedComponent.destroy())}};function yo(e,t){if(!t?.schema)return!1;const n=typeof e=="string"?e:e.name;return t.schema.spec.marks.get(n)!==void 0}function Tt(e,t){if(!e)return!1;const{selection:n}=e.state,{$from:s,to:r}=n;return t.some(i=>e.state.doc.nodesBetween(s.pos,r,a=>a.type.name===i))}function ut(e,t){return e?e.extensionManager.extensions.some(n=>n.name===t):!1}function ys(e){const t=`toggle${e.charAt(0).toUpperCase()}${e.slice(1)}`;return{canExecute:n=>n.can()[t](),execute:n=>n.chain().focus()[t](),isActive:n=>n.isActive(e),isDisabled:n=>Tt(n,["image"])||n.isActive("code")}}function vs(e){const t=`set${e.charAt(0).toUpperCase()}${e.slice(1)}`;return{canExecute:n=>n.can()[t](),execute:n=>n.chain().focus()[t](),isActive:n=>n.isActive(e),isDisabled:n=>Tt(n,["image"])||n.isActive("code")}}function ks(e){return{canExecute:t=>t.can()[e](),execute:t=>t.chain()[e](),isActive:()=>!1,isDisabled:void 0}}function vo(){return{canExecute:(e,t)=>e.can().toggleMark(t.mark),execute:(e,t)=>e.chain().focus().toggleMark(t.mark),isActive:(e,t)=>e.isActive(t.mark),isDisabled:(e,t)=>!yo(t.mark,e)||Tt(e,["image"])}}function ko(){return{canExecute:(e,t)=>e.can().setTextAlign(t.align),execute:(e,t)=>e.chain().focus().setTextAlign(t.align),isActive:(e,t)=>e.isActive({textAlign:t.align}),isDisabled:e=>!ut(e,"textAlign")||Tt(e,["image","horizontalRule"])}}function xo(){return{canExecute:(e,t)=>e.can().toggleHeading({level:t.level}),execute:(e,t)=>e.chain().focus().toggleHeading({level:t.level}),isActive:(e,t)=>e.isActive("heading",{level:t.level}),isDisabled:e=>Tt(e,["image"])||e.isActive("code")}}function bo(){return{canExecute:e=>e.can().setLink({href:""})||e.can().unsetLink(),execute:(e,t)=>{const n=e.chain(),s=e.getAttributes("link").href,r=e.isActive("code");if(s)return n.focus().unsetLink();const i=t?.href||prompt("Enter the URL:");return i?r?n.focus().extendMarkRange("code").setLink({href:i}):n.focus().setLink({href:i}):n},isActive:e=>e.isActive("link"),isDisabled:e=>{if(!ut(e,"link")||Tt(e,["image"]))return!0;const{selection:t}=e.state;return t.empty&&!e.isActive("link")}}}function wo(){return{canExecute:e=>e.can().setImage({src:""}),execute:(e,t)=>{const n=e.chain().focus();if(t?.src)return n.setImage({src:t.src});const s=prompt("Enter the image URL:");return s?n.setImage({src:s}):n},isActive:e=>e.isActive("image"),isDisabled:e=>!ut(e,"image")}}function cr(e){const n={bulletList:"toggleBulletList",orderedList:"toggleOrderedList",taskList:"toggleTaskList"}[e],s=e==="taskList"?"taskItem":"listItem",r=["bulletList","orderedList","taskList"];return{canExecute:i=>i.can()[n]()||i.isActive("listItem")||r.some(a=>ut(i,a)&&i.isActive(a)),execute:i=>{const{state:a}=i,{selection:o}=a;let l=i.chain().focus();if(o.node){const c=o.node,u=c.firstChild?.firstChild,d=c.lastChild?.lastChild,p=u?o.from+u.nodeSize:o.from+1,f=d?o.to-d.nodeSize:o.to-1;l=l.setTextSelection({from:p,to:f}).clearNodes()}if(i.isActive(e)){let c=l.liftListItem(s);for(const u of r)ut(i,u)&&(c=c.lift(u));return c.selectTextblockEnd()}if(r.some(c=>ut(i,c)&&i.isActive(c))){const c=i.isActive("taskList")?"taskItem":"listItem";let u=l.liftListItem(c);for(const d of r)ut(i,d)&&(u=u.lift(d));return u[n]().selectTextblockEnd()}return l[n]().selectTextblockEnd()},isActive:i=>i.isActive(e),isDisabled:i=>ut(i,e)?Tt(i,["image"])||i.isActive("code"):!0}}function xs(e){return{canExecute:(t,n)=>{if(n?.pos==null||!t.state.doc.nodeAt(n.pos))return!1;const r=t.state.doc.resolve(n.pos),i=r.parent,a=r.index();return e==="up"?a>0:a<i.childCount-1},execute:(t,n)=>{if(n?.pos==null)return t.chain();const s=t.state.doc.nodeAt(n.pos);if(!s)return t.chain();const r=t.state.doc.resolve(n.pos),i=r.parent,a=r.index();if(e==="up"&&a>0){const o=i.child(a-1),l=n.pos-o.nodeSize;return t.chain().focus().deleteRange({from:n.pos,to:n.pos+s.nodeSize}).insertContentAt(l,s.toJSON())}if(e==="down"&&a<i.childCount-1){const o=i.child(a+1),l=n.pos+o.nodeSize;return t.chain().focus().deleteRange({from:n.pos,to:n.pos+s.nodeSize}).insertContentAt(l,s.toJSON())}return t.chain()},isActive:()=>!1,isDisabled:void 0}}function _o(){return{mark:vo(),textAlign:ko(),heading:xo(),link:bo(),image:wo(),blockquote:ys("blockquote"),bulletList:cr("bulletList"),orderedList:cr("orderedList"),taskList:cr("taskList"),codeBlock:ys("codeBlock"),horizontalRule:vs("horizontalRule"),paragraph:vs("paragraph"),undo:ks("undo"),redo:ks("redo"),clearFormatting:{canExecute:(e,t)=>t?.pos!=null?!!e.state.doc.nodeAt(t.pos):e.can().clearNodes()||e.can().unsetAllMarks(),execute:(e,t)=>{if(t?.pos!=null){const n=e.state.doc.nodeAt(t.pos);if(!n)return e.chain();const s=t.pos+1,r=t.pos+n.nodeSize-1;return e.chain().focus().setTextSelection({from:s,to:r}).clearNodes().unsetAllMarks()}return e.chain().focus().clearNodes().unsetAllMarks()},isActive:()=>!1,isDisabled:void 0},duplicate:{canExecute:(e,t)=>t?.pos==null?!1:!!e.state.doc.nodeAt(t.pos),execute:(e,t)=>{if(t?.pos==null)return e.chain();const n=e.state.doc.nodeAt(t.pos);return n?e.chain().focus().insertContentAt(t.pos+n.nodeSize,n.toJSON()):e.chain()},isActive:()=>!1,isDisabled:void 0},delete:{canExecute:(e,t)=>t?.pos==null?!1:!!e.state.doc.nodeAt(t.pos),execute:(e,t)=>{if(t?.pos==null)return e.chain();const n=e.state.doc.nodeAt(t.pos);return n?e.chain().focus().deleteRange({from:t.pos,to:t.pos+n.nodeSize}):e.chain()},isActive:()=>!1,isDisabled:void 0},moveUp:xs("up"),moveDown:xs("down"),suggestion:{canExecute:()=>!0,execute:(e,t)=>{const{state:n}=e,{selection:s}=n,{$from:r}=s;if(t?.pos!==void 0){const l=n.doc.nodeAt(t.pos);if(l){const c=t.pos+l.nodeSize;return e.chain().focus().insertContentAt(c,{type:"paragraph",content:[{type:"text",text:"/"}]})}}const i=r.node(r.depth),o=r.before(r.depth)+i.nodeSize;return e.chain().focus().insertContentAt(o,{type:"paragraph",content:[{type:"text",text:"/"}]})},isActive:()=>!1,isDisabled:void 0},mention:{canExecute:()=>!0,execute:e=>{const{state:t}=e,{selection:n}=t,{$from:s}=n,r=s.parent.textBetween(Math.max(0,s.parentOffset-1),s.parentOffset,void 0," "),i=r&&r!==" ";return e.chain().focus().insertContent(i?" @":"@")},isActive:()=>!1,isDisabled:void 0},emoji:{canExecute:()=>!0,execute:e=>{const{state:t}=e,{selection:n}=t,{$from:s}=n,r=s.parent.textBetween(Math.max(0,s.parentOffset-1),s.parentOffset,void 0," "),i=r&&r!==" ";return e.chain().focus().insertContent(i?" :":":")},isActive:()=>!1,isDisabled:void 0}}}function To(e){const t=[];return e.offset&&t.push(oi(typeof e.offset!="boolean"?e.offset:void 0)),e.flip&&t.push(li(typeof e.flip!="boolean"?e.flip:void 0)),e.shift&&t.push(ci(typeof e.shift!="boolean"?e.shift:void 0)),e.size&&t.push(ui(typeof e.size!="boolean"?e.size:void 0)),e.autoPlacement&&t.push(di(typeof e.autoPlacement!="boolean"?e.autoPlacement:void 0)),e.hide&&t.push(pi(typeof e.hide!="boolean"?e.hide:void 0)),e.inline&&t.push(hi(typeof e.inline!="boolean"?e.inline:void 0)),t}function Co(e){const t=J([]),n=J(0),s=J("closed"),r=e.searchTerm??J("");let i=null,a=null,o=null,l=null,c=null,u=null,d=null,p=null,f=null,y=null,_=null;const{score:M}=po(),v=()=>{s.value!=="closed"&&(s.value="closed",u&&(document.removeEventListener("keydown",u,!0),u=null),d&&(e.editor.view.dom.removeEventListener("blur",d),d=null),y&&(window.removeEventListener("scroll",y,!0),y=null),a&&o&&(a.removeEventListener("mousedown",o),o=null),i&&(i.destroy(),i=null),a&&(a.remove(),a=null))},C=e.filterFields??["label"],z=(H,W)=>{if(!W)return H;const j=[];for(const se of H){let oe=null;for(const Se of C){const Ae=Qs(se,Se);if(Ae==null)continue;const we=Array.isArray(Ae)?Ae.map(String):[String(Ae)];for(const he of we){const De=he.replace(/[\s_-]/g,""),Me=Math.min(M(he,W)??3,M(De,W)??3);if((oe===null||Me<oe)&&(oe=Me),oe===0)break}if(oe===0)break}oe!==null&&oe<3&&j.push({item:se,score:oe})}return j.sort((se,oe)=>se.score-oe.score),j.map(({item:se})=>se)},L=e.filter||z,E=e.limit??42,G=typeof e.pluginKey=="string"?new Be(e.pluginKey):e.pluginKey,ue=S(()=>{const H=k(e.items);return H?.length?cs(H)?H:[H]:[]}),te=S(()=>ue.value.flatMap(H=>H)),V=S(()=>t.value.length?e.ignoreFilter?[t.value]:ue.value.map(H=>{const W=H.filter(j=>t.value.includes(j));return W.sort((j,se)=>t.value.indexOf(j)-t.value.indexOf(se)),W}).filter(H=>H.length>0):[]),I=S(()=>t.value.filter(H=>H.type!=="label"&&H.type!=="separator")),U=Lt(e.options,{strategy:"absolute",placement:"bottom-start",offset:8,flip:{},shift:{padding:8},size:!1,autoPlacement:!1,hide:!1,inline:!1}),O=To(U),Z=H=>{if(!p)return;const W=p();if(!W)return;gi({getBoundingClientRect:()=>W},H,{placement:U.placement,strategy:U.strategy,middleware:O}).then(({x:se,y:oe,strategy:Se})=>{H.style.width="max-content",H.style.position=Se,H.style.top="0",H.style.left="0",H.style.transform=`translate(${Math.round(se)}px, ${Math.round(oe)}px)`})},ie=()=>{s.value="open",u||(u=j=>{c&&c({event:j})&&(j.preventDefault(),j.stopPropagation())},document.addEventListener("keydown",u,!0)),d||(d=()=>{setTimeout(()=>{if(s.value==="open"){const j=e.editor.view.state.tr.setMeta(G,{exit:!0});e.editor.view.dispatch(j)}},0)},e.editor.view.dom.addEventListener("blur",d)),y||(y=()=>{a&&Z(a)},window.addEventListener("scroll",y,!0)),f=j=>{n.value=j,i&&i.updateProps({groups:V.value,selectedIndex:j,onSelect:l,onHover:f,state:s.value})},i=new mo(K,{props:{groups:V.value,selectedIndex:n.value,onSelect:l,onHover:f,state:s.value},editor:e.editor}),a=document.createElement("div"),a.style.position=U.strategy,a.style.zIndex="50",o=j=>{j.preventDefault()},a.addEventListener("mousedown",o),((typeof e.appendTo=="function"?e.appendTo():e.appendTo)??e.editor.view.dom.parentElement)?.appendChild(a),i.element&&a.appendChild(i.element),Z(a)};e.ignoreFilter&&(_=Te(()=>k(e.items),H=>{if(!p)return;const W=H?.length?cs(H)?H.flat():H:[];if(t.value=W.slice(0,E),!t.value.length){v();return}if(n.value>=I.value.length&&(n.value=Math.max(0,I.value.length-1)),s.value==="closed"&&t.value.length){ie();return}i&&i.updateProps({groups:V.value,selectedIndex:n.value,onSelect:l,onHover:f,state:s.value}),a&&Z(a)},{deep:!0,flush:"sync"}));const K={props:{groups:{type:Array,required:!0},selectedIndex:{type:Number,required:!0},onSelect:{type:Function,required:!0},onHover:{type:Function,required:!0},state:{type:String,required:!0}},setup(H){function W(se,oe,Se){se.preventDefault(),H.onSelect(oe,Se)}function j(se){H.onHover(se)}return()=>{const se=H.groups,oe=new Map;let Se=0;for(const Ae of se)for(const we of Ae){const he=we;he.type!=="label"&&he.type!=="separator"&&oe.set(we,Se++)}return ze("div",{class:e.ui.value.content(),role:"listbox","data-state":H.state},[ze("div",{class:e.ui.value.viewport(),role:"presentation"},se.map((Ae,we)=>ze("div",{key:`group-${we}`,class:e.ui.value.group(),role:"group"},Ae.map((he,De)=>{const Me=he;if(Me.type==="label")return ze("div",{key:`label-${we}-${De}`,class:e.ui.value.label({class:Me.class})},e.renderItem(he,e.ui));if(Me.type==="separator")return ze("div",{key:`separator-${we}-${De}`,class:e.ui.value.separator({class:Me.class}),role:"separator"});const Ie=oe.get(he),pt=Ie===H.selectedIndex;return ze("div",{key:`item-${Ie}`,class:e.ui.value.item({class:Me.class,active:!1}),role:"option","aria-selected":pt,"data-highlighted":pt?"":void 0,"data-disabled":Me.disabled?"":void 0,onMousedown:it=>W(it,he,Ie),onMouseenter:()=>j(Ie),ref:it=>{it&&pt&&it.scrollIntoView({block:"nearest",inline:"nearest"})}},e.renderItem(he,e.ui))}))))])}}};return{plugin:fi({...e.suggestion||{},pluginKey:G,editor:e.editor,char:e.char,items:({query:H})=>(r.value=H,e.ignoreFilter?te.value.slice(0,E):L(te.value,H).slice(0,E)),command:({editor:H,range:W,props:j})=>{e.onSelect(H,W,j)},render:()=>(c=W=>{const{event:j}=W;if(!i||!I.value.length)return!1;if(j.key==="Escape")return v(),!0;if(j.key==="ArrowUp")return n.value=(n.value+I.value.length-1)%I.value.length,i?.updateProps({groups:V.value,selectedIndex:n.value,onSelect:l,onHover:f,state:s.value}),!0;if(j.key==="ArrowDown")return n.value=(n.value+1)%I.value.length,i?.updateProps({groups:V.value,selectedIndex:n.value,onSelect:l,onHover:f,state:s.value}),!0;if(j.key==="Enter"||j.key==="Tab"){const se=I.value[n.value];return se&&l&&l(se),!0}return!1},{onStart:W=>{t.value=e.ignoreFilter?te.value.slice(0,E):W.items,n.value=0,l=j=>W.command(j),p=W.clientRect,t.value.length&&ie()},onUpdate:W=>{if(t.value=e.ignoreFilter?te.value.slice(0,E):W.items,l=j=>W.command(j),n.value>=I.value.length&&(n.value=Math.max(0,I.value.length-1)),!t.value.length){v();return}i?i.updateProps({groups:V.value,selectedIndex:n.value,onSelect:l,onHover:f,state:s.value}):ie(),a&&Z(a)},onKeyDown:c,onExit:()=>{v(),p=null,r.value=""}})}),destroy:()=>{s.value="closed",u&&(document.removeEventListener("keydown",u,!0),u=null),d&&(e.editor.view.dom.removeEventListener("blur",d),d=null),y&&(window.removeEventListener("scroll",y,!0),y=null),a&&o&&(a.removeEventListener("mousedown",o),o=null),i&&(i.destroy(),i=null),a&&(a.remove(),a=null),_&&(_(),_=null)},filteredItems:t,searchTerm:r}}function So(e){return e.content.trim()?e.content:e.contentBlocks?.filter(n=>n.type==="text"&&!!n.text).map(n=>n.text).join("")??""}function Tr(e){return e.flatMap(t=>{if(t.role!=="user"&&t.role!=="assistant")return[];const n=So(t);return n.trim()?[{role:t.role,content:n,timestamp:t.timestamp}]:[]})}function Mo(e){return Tr(e).length>0}function Ao(e,t,n,s){const r=[];r.push(`# ${e}`),r.push(""),r.push(`> ${s.createdAt}: ${Je(n).format("YYYY-MM-DD HH:mm:ss")}`),r.push(""),r.push("---"),r.push("");for(const i of t){const a=Je(i.timestamp).format("YYYY-MM-DD HH:mm:ss"),o=i.role==="user"?s.user:s.assistant;r.push(`### ${o}`),r.push(`*${a}*`),r.push(""),r.push(i.content),r.push(""),r.push("---"),r.push("")}return r.join(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/service-CAdsM9Hy.js","assets/index-D07viL9P.js","assets/vendor-snapdom--nZvo8Sg.js","assets/index-XC-s67UA.css"])))=>i.map(i=>d[i]);
2
+ import{e as S,g as k,bD as Qs,x as wt,al as _t,d as be,cI as ze,c0 as ti,C as Oe,b as J,cB as ni,cJ as ri,cK as Js,G as si,cL as ai,cM as ii,cN as ls,cO as oi,cP as li,cQ as ci,cR as ui,cS as di,cT as pi,cU as hi,cV as Be,ce as Lt,K as Te,cW as fi,cX as gi,cg as cs,aI as Je,bt as mi,o as m,f as ae,a6 as qe,J as Xn,aA as er,c as x,n as Y,a as h,z as F,a7 as Ne,p as w,a8 as tr,w as de,a9 as He,F as me,j as _e,aK as Zs,aL as Xs,aR as mt,aQ as yn,bO as ea,cY as yi,l as q,aF as It,a0 as vi,aa as ta,a3 as ki,O as xi,r as Rt,ah as nr,bh as na,cZ as Nt,c_ as xt,c$ as Pt,d0 as fe,d1 as Ee,d2 as ra,d3 as bi,d4 as sa,d5 as vt,d6 as Or,d7 as wi,d8 as _i,d9 as Ti,da as Ci,db as Ue,dc as Si,dd as us,de as aa,df as Mi,dg as en,dh as rr,di as tn,dj as Ai,dk as Ke,dl as Li,dm as $t,dn as $i,dp as tt,dq as Ei,dr as Ii,ds as Ht,dt as wr,du as Ri,dv as Pi,dw as Hi,dx as Ni,dy as zi,dz as ia,dA as Oi,dB as ds,dC as _r,dD as Bi,dE as Di,dF as oa,dG as ji,as as la,aX as Fi,aT as qi,bG as Ui,P as ca,aw as xn,av as ua,H as Ki,aN as Wi,aH as Vi,aE as Gi,ap as Yi,L as lr,bS as Qi,ar as Ji,aP as Zi,aV as Xi,cb as eo,m as ps,au as to,bC as no,cf as ro}from"./index-D07viL9P.js";import{M as da,_ as so}from"./index-D_CX3gzo.js";import{u as Br}from"./useToast-BzK6i1Tk.js";import{_ as hs}from"./EChartBar.vue_vue_type_script_setup_true_lang-CB_KuKt4.js";import{_ as pa}from"./EChart.vue_vue_type_script_setup_true_lang-Rk-Bu-rv.js";import{_ as fs}from"./EChartLine.vue_vue_type_script_setup_true_lang-5iW9KPRe.js";import{s as ao,a as ha}from"./aiChat-ZrHuq9Eb.js";import{u as fa}from"./prompt-ipERjPzE.js";import{useCacheService as io}from"./service-CAdsM9Hy.js";function oo(e){const t=S(()=>k(e)),n=S(()=>new Intl.Collator("en",{usage:"search",...t.value}));return{startsWith:(a,o)=>o.length===0?!0:(a=a.normalize("NFC"),o=o.normalize("NFC"),n.value.compare(a.slice(0,o.length),o)===0),endsWith:(a,o)=>o.length===0?!0:(a=a.normalize("NFC"),o=o.normalize("NFC"),n.value.compare(a.slice(-o.length),o)===0),contains:(a,o)=>{if(o.length===0)return!0;a=a.normalize("NFC"),o=o.normalize("NFC");let l=0;const c=o.length;for(;l+c<=a.length;l++){const u=a.slice(l,l+c);if(n.value.compare(o,u)===0)return!0}return!1}}}const lo={none:[],qwen:["default","off","high"],deepseek_v4:["default","off","high","xhigh"],deepseek_hybrid:["default","off","auto"],o_series:["default","low","medium","high"],gpt5:["default","minimal","low","medium","high"],gpt5_1:["default","off","low","medium","high"],gpt5_2plus:["default","off","minimal","low","medium","high","xhigh"],grok:["default","low","high"],kimi:["default","off","auto","low","medium","high"],doubao:["default","off","auto","high"],hunyuan:["default","off","high"],gemini:["default","off","low","medium","high"],default:["default","off","low","medium","high"]},gs=/^(?!.*-non-reasoning\b)(o\d+(?:-[\w-]+)?|.*\b(?:reasoning|reasoner|thinking|think)\b.*|.*-[rR]\d+.*|.*\bqwq(?:-[\w-]+)?\b.*|.*\bhunyuan-t1(?:-[\w-]+)?\b.*|.*\bgrok-(?:3-mini|4|4-fast|build)(?:-[\w-]+)?\b.*)$/i;function co(e,t){const n=t.toLowerCase(),s=e.toLowerCase();if(n.includes("-non-reasoning")||s==="anthropic")return"none";if(s==="gemini")return/gemini-(?:2\.5|3(?:\.\d+)?-(?:flash|pro)|flash-latest|pro-latest)/i.test(n)?"gemini":"none";if(s==="qwen"||/\bqwen|qwq/i.test(n))return"qwen";if(/deepseek[_-]v([4-9]|\d{2,})/i.test(n)||/deepseek-ai\/deepseek-r1/i.test(n))return"deepseek_v4";if(/deepseek[_-]chat|deepseek[_-]v3/i.test(n))return"deepseek_hybrid";if(s==="openai"||s==="openai-compatible"){if(/gpt-5\.[2-9]|gpt-5\.[1-9]\d/.test(n))return"gpt5_2plus";if(/gpt-5\.1/.test(n))return"gpt5_1";if(/gpt-5/.test(n))return"gpt5";if(/^o\d/.test(n))return"o_series"}return/^o\d/.test(n)?"o_series":/\bgrok-(?:3-mini|4|4-fast|build)\b/i.test(n)?"grok":/\bkimi-k(?:2-thinking|2\.[5-9]|[3-9])/i.test(n)||s==="kimi"&&/thinking/i.test(n)?"kimi":/\bdoubao-.*seed/i.test(n)||s==="doubao"&&/seed/i.test(n)?"doubao":/\bhunyuan-(?:t1|a13b)/i.test(n)?"hunyuan":s==="glm"||/\bglm-?(?:5|4\.[5-7]|z1|zero)/i.test(n)?"qwen":s==="siliconflow"&&/r[1-9]/i.test(n)?"deepseek_v4":s==="openrouter"?/deepseek.*(v[4-9]|r\d)/i.test(n)?"deepseek_v4":/deepseek[_-]?(chat|v3)/i.test(n)?"deepseek_hybrid":/\bgrok-(?:3-mini|4|4-fast|build)\b/i.test(n)?"grok":/\bkimi-k(?:2-thinking|2\.[5-9]|[3-9])/i.test(n)?"kimi":gs.test(n)?"default":"none":/\bmimo-v2/i.test(n)||/\bminimax-m[123]/i.test(n)||/\bseed-oss/i.test(n)?"deepseek_hybrid":/\bbaichuan-m[23]/i.test(n)||/\bmagistral/i.test(n)||/\bmistral-small-2603/i.test(n)||/\bstep-(?:3|r1-v-mini)/i.test(n)||/\bgemma-?4/i.test(n)||/\bpangu-pro-moe/i.test(n)||/\bsonar-deep-research/i.test(n)||/\bring-(?:1t|mini|flash)/i.test(n)?"default":/\bqwen|qwq/i.test(n)?"qwen":/deepseek[_-]?r\d|deepseek[_-]?v[4-9]/i.test(n)?"deepseek_v4":/^o\d/i.test(n)?"o_series":gs.test(n)?"default":"none"}function uo(e,t){const n=co(e,t);return lo[n]}function po(){const{contains:e,startsWith:t}=oo({sensitivity:"base"});function n(a,o){return e(a,o)?e(o,a)?0:t(a,o)?1:2:null}function s(a,o,l){if(typeof a!="object"||a===null)return n(String(a),o);let c=null;for(const u of l){const d=Qs(a,u);if(d==null)continue;const p=Array.isArray(d)?d.map(String):[String(d)];for(const f of p){const y=n(f,o);if(y!==null&&(c===null||y<c)&&(c=y),c===0)return 0}}return c}function r(a,o,l){if(!o)return a;const c=[];for(const u of a){const d=s(u,o,l);d!==null&&c.push({item:u,score:d})}return c.sort((u,d)=>u.score-d.score),c.map(({item:u})=>u)}function i(a,o,l){return o?a.map(c=>{const u=[];for(const d of c){if(d==null)continue;if(l.isStructural?.(d)){u.push({item:d,score:-1});continue}const p=s(d,o,l.fields);p!==null&&u.push({item:d,score:p})}return u.sort((d,p)=>d.score-p.score),u.map(({item:d})=>d)}).filter(c=>c.some(u=>!l.isStructural?.(u))):a}return{score:n,scoreItem:s,filter:r,filterGroups:i}}function ms(e){return ai((t,n)=>({get(){return t(),e},set(s){e=s,requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})}}))}var ho=class extends ri{constructor(e={}){return super(e),this.contentComponent=null,this.appContext=null,this.reactiveState=ms(this.view.state),this.reactiveExtensionStorage=ms(this.extensionStorage),this.on("beforeTransaction",({nextState:t})=>{this.reactiveState.value=t,this.reactiveExtensionStorage.value=this.extensionStorage}),Js(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(e,t){const n=super.registerPlugin(e,t);return this.reactiveState&&(this.reactiveState.value=n),n}unregisterPlugin(e){const t=super.unregisterPlugin(e);return this.reactiveState&&t&&(this.reactiveState.value=t),t}},fo=be({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(e){const t=J(),n=ni();return ti(()=>{const s=e.editor;s&&s.options.element&&t.value&&Oe(()=>{var r;if(!t.value||!((r=s.view.dom)!=null&&r.parentNode))return;const i=k(t.value);t.value.append(...s.view.dom.parentNode.childNodes),s.contentComponent=n.ctx._,n&&(s.appContext={...n.appContext,provides:n.provides}),s.setOptions({element:i}),s.createNodeViews()})}),_t(()=>{const s=e.editor;s&&(s.contentComponent=null,s.appContext=null)}),{rootEl:t}},render(){return ze("div",{ref:e=>{this.rootEl=e}})}}),go=(e={})=>{const t=si();return wt(()=>{t.value=new ho(e)}),_t(()=>{var n,s,r,i;const a=(s=(n=t.value)==null?void 0:n.view.dom)==null?void 0:s.parentNode,o=a?.cloneNode(!0);(r=a?.parentNode)==null||r.replaceChild(o,a),(i=t.value)==null||i.destroy()}),t},mo=class{constructor(e,{props:t={},editor:n}){this.destroyed=!1,this.editor=n,this.component=Js(e),this.el=document.createElement("div"),this.props=ii(t),this.renderedComponent=this.renderComponent()}get element(){return this.renderedComponent.el}get ref(){var e,t,n,s;return(t=(e=this.renderedComponent.vNode)==null?void 0:e.component)!=null&&t.exposed?this.renderedComponent.vNode.component.exposed:(s=(n=this.renderedComponent.vNode)==null?void 0:n.component)==null?void 0:s.proxy}renderComponent(){if(this.destroyed)return this.renderedComponent;let e=ze(this.component,this.props);return this.editor.appContext&&(e.appContext=this.editor.appContext),typeof document<"u"&&this.el&&ls(e,this.el),{vNode:e,destroy:()=>{this.el&&ls(null,this.el),this.el=null,e=null},el:this.el?this.el.firstElementChild:null}}updateProps(e={}){this.destroyed||(Object.entries(e).forEach(([t,n])=>{this.props[t]=n}),this.renderComponent())}destroy(){this.destroyed||(this.destroyed=!0,this.renderedComponent.destroy())}};function yo(e,t){if(!t?.schema)return!1;const n=typeof e=="string"?e:e.name;return t.schema.spec.marks.get(n)!==void 0}function Tt(e,t){if(!e)return!1;const{selection:n}=e.state,{$from:s,to:r}=n;return t.some(i=>e.state.doc.nodesBetween(s.pos,r,a=>a.type.name===i))}function ut(e,t){return e?e.extensionManager.extensions.some(n=>n.name===t):!1}function ys(e){const t=`toggle${e.charAt(0).toUpperCase()}${e.slice(1)}`;return{canExecute:n=>n.can()[t](),execute:n=>n.chain().focus()[t](),isActive:n=>n.isActive(e),isDisabled:n=>Tt(n,["image"])||n.isActive("code")}}function vs(e){const t=`set${e.charAt(0).toUpperCase()}${e.slice(1)}`;return{canExecute:n=>n.can()[t](),execute:n=>n.chain().focus()[t](),isActive:n=>n.isActive(e),isDisabled:n=>Tt(n,["image"])||n.isActive("code")}}function ks(e){return{canExecute:t=>t.can()[e](),execute:t=>t.chain()[e](),isActive:()=>!1,isDisabled:void 0}}function vo(){return{canExecute:(e,t)=>e.can().toggleMark(t.mark),execute:(e,t)=>e.chain().focus().toggleMark(t.mark),isActive:(e,t)=>e.isActive(t.mark),isDisabled:(e,t)=>!yo(t.mark,e)||Tt(e,["image"])}}function ko(){return{canExecute:(e,t)=>e.can().setTextAlign(t.align),execute:(e,t)=>e.chain().focus().setTextAlign(t.align),isActive:(e,t)=>e.isActive({textAlign:t.align}),isDisabled:e=>!ut(e,"textAlign")||Tt(e,["image","horizontalRule"])}}function xo(){return{canExecute:(e,t)=>e.can().toggleHeading({level:t.level}),execute:(e,t)=>e.chain().focus().toggleHeading({level:t.level}),isActive:(e,t)=>e.isActive("heading",{level:t.level}),isDisabled:e=>Tt(e,["image"])||e.isActive("code")}}function bo(){return{canExecute:e=>e.can().setLink({href:""})||e.can().unsetLink(),execute:(e,t)=>{const n=e.chain(),s=e.getAttributes("link").href,r=e.isActive("code");if(s)return n.focus().unsetLink();const i=t?.href||prompt("Enter the URL:");return i?r?n.focus().extendMarkRange("code").setLink({href:i}):n.focus().setLink({href:i}):n},isActive:e=>e.isActive("link"),isDisabled:e=>{if(!ut(e,"link")||Tt(e,["image"]))return!0;const{selection:t}=e.state;return t.empty&&!e.isActive("link")}}}function wo(){return{canExecute:e=>e.can().setImage({src:""}),execute:(e,t)=>{const n=e.chain().focus();if(t?.src)return n.setImage({src:t.src});const s=prompt("Enter the image URL:");return s?n.setImage({src:s}):n},isActive:e=>e.isActive("image"),isDisabled:e=>!ut(e,"image")}}function cr(e){const n={bulletList:"toggleBulletList",orderedList:"toggleOrderedList",taskList:"toggleTaskList"}[e],s=e==="taskList"?"taskItem":"listItem",r=["bulletList","orderedList","taskList"];return{canExecute:i=>i.can()[n]()||i.isActive("listItem")||r.some(a=>ut(i,a)&&i.isActive(a)),execute:i=>{const{state:a}=i,{selection:o}=a;let l=i.chain().focus();if(o.node){const c=o.node,u=c.firstChild?.firstChild,d=c.lastChild?.lastChild,p=u?o.from+u.nodeSize:o.from+1,f=d?o.to-d.nodeSize:o.to-1;l=l.setTextSelection({from:p,to:f}).clearNodes()}if(i.isActive(e)){let c=l.liftListItem(s);for(const u of r)ut(i,u)&&(c=c.lift(u));return c.selectTextblockEnd()}if(r.some(c=>ut(i,c)&&i.isActive(c))){const c=i.isActive("taskList")?"taskItem":"listItem";let u=l.liftListItem(c);for(const d of r)ut(i,d)&&(u=u.lift(d));return u[n]().selectTextblockEnd()}return l[n]().selectTextblockEnd()},isActive:i=>i.isActive(e),isDisabled:i=>ut(i,e)?Tt(i,["image"])||i.isActive("code"):!0}}function xs(e){return{canExecute:(t,n)=>{if(n?.pos==null||!t.state.doc.nodeAt(n.pos))return!1;const r=t.state.doc.resolve(n.pos),i=r.parent,a=r.index();return e==="up"?a>0:a<i.childCount-1},execute:(t,n)=>{if(n?.pos==null)return t.chain();const s=t.state.doc.nodeAt(n.pos);if(!s)return t.chain();const r=t.state.doc.resolve(n.pos),i=r.parent,a=r.index();if(e==="up"&&a>0){const o=i.child(a-1),l=n.pos-o.nodeSize;return t.chain().focus().deleteRange({from:n.pos,to:n.pos+s.nodeSize}).insertContentAt(l,s.toJSON())}if(e==="down"&&a<i.childCount-1){const o=i.child(a+1),l=n.pos+o.nodeSize;return t.chain().focus().deleteRange({from:n.pos,to:n.pos+s.nodeSize}).insertContentAt(l,s.toJSON())}return t.chain()},isActive:()=>!1,isDisabled:void 0}}function _o(){return{mark:vo(),textAlign:ko(),heading:xo(),link:bo(),image:wo(),blockquote:ys("blockquote"),bulletList:cr("bulletList"),orderedList:cr("orderedList"),taskList:cr("taskList"),codeBlock:ys("codeBlock"),horizontalRule:vs("horizontalRule"),paragraph:vs("paragraph"),undo:ks("undo"),redo:ks("redo"),clearFormatting:{canExecute:(e,t)=>t?.pos!=null?!!e.state.doc.nodeAt(t.pos):e.can().clearNodes()||e.can().unsetAllMarks(),execute:(e,t)=>{if(t?.pos!=null){const n=e.state.doc.nodeAt(t.pos);if(!n)return e.chain();const s=t.pos+1,r=t.pos+n.nodeSize-1;return e.chain().focus().setTextSelection({from:s,to:r}).clearNodes().unsetAllMarks()}return e.chain().focus().clearNodes().unsetAllMarks()},isActive:()=>!1,isDisabled:void 0},duplicate:{canExecute:(e,t)=>t?.pos==null?!1:!!e.state.doc.nodeAt(t.pos),execute:(e,t)=>{if(t?.pos==null)return e.chain();const n=e.state.doc.nodeAt(t.pos);return n?e.chain().focus().insertContentAt(t.pos+n.nodeSize,n.toJSON()):e.chain()},isActive:()=>!1,isDisabled:void 0},delete:{canExecute:(e,t)=>t?.pos==null?!1:!!e.state.doc.nodeAt(t.pos),execute:(e,t)=>{if(t?.pos==null)return e.chain();const n=e.state.doc.nodeAt(t.pos);return n?e.chain().focus().deleteRange({from:t.pos,to:t.pos+n.nodeSize}):e.chain()},isActive:()=>!1,isDisabled:void 0},moveUp:xs("up"),moveDown:xs("down"),suggestion:{canExecute:()=>!0,execute:(e,t)=>{const{state:n}=e,{selection:s}=n,{$from:r}=s;if(t?.pos!==void 0){const l=n.doc.nodeAt(t.pos);if(l){const c=t.pos+l.nodeSize;return e.chain().focus().insertContentAt(c,{type:"paragraph",content:[{type:"text",text:"/"}]})}}const i=r.node(r.depth),o=r.before(r.depth)+i.nodeSize;return e.chain().focus().insertContentAt(o,{type:"paragraph",content:[{type:"text",text:"/"}]})},isActive:()=>!1,isDisabled:void 0},mention:{canExecute:()=>!0,execute:e=>{const{state:t}=e,{selection:n}=t,{$from:s}=n,r=s.parent.textBetween(Math.max(0,s.parentOffset-1),s.parentOffset,void 0," "),i=r&&r!==" ";return e.chain().focus().insertContent(i?" @":"@")},isActive:()=>!1,isDisabled:void 0},emoji:{canExecute:()=>!0,execute:e=>{const{state:t}=e,{selection:n}=t,{$from:s}=n,r=s.parent.textBetween(Math.max(0,s.parentOffset-1),s.parentOffset,void 0," "),i=r&&r!==" ";return e.chain().focus().insertContent(i?" :":":")},isActive:()=>!1,isDisabled:void 0}}}function To(e){const t=[];return e.offset&&t.push(oi(typeof e.offset!="boolean"?e.offset:void 0)),e.flip&&t.push(li(typeof e.flip!="boolean"?e.flip:void 0)),e.shift&&t.push(ci(typeof e.shift!="boolean"?e.shift:void 0)),e.size&&t.push(ui(typeof e.size!="boolean"?e.size:void 0)),e.autoPlacement&&t.push(di(typeof e.autoPlacement!="boolean"?e.autoPlacement:void 0)),e.hide&&t.push(pi(typeof e.hide!="boolean"?e.hide:void 0)),e.inline&&t.push(hi(typeof e.inline!="boolean"?e.inline:void 0)),t}function Co(e){const t=J([]),n=J(0),s=J("closed"),r=e.searchTerm??J("");let i=null,a=null,o=null,l=null,c=null,u=null,d=null,p=null,f=null,y=null,_=null;const{score:M}=po(),v=()=>{s.value!=="closed"&&(s.value="closed",u&&(document.removeEventListener("keydown",u,!0),u=null),d&&(e.editor.view.dom.removeEventListener("blur",d),d=null),y&&(window.removeEventListener("scroll",y,!0),y=null),a&&o&&(a.removeEventListener("mousedown",o),o=null),i&&(i.destroy(),i=null),a&&(a.remove(),a=null))},C=e.filterFields??["label"],z=(H,W)=>{if(!W)return H;const j=[];for(const se of H){let oe=null;for(const Se of C){const Ae=Qs(se,Se);if(Ae==null)continue;const we=Array.isArray(Ae)?Ae.map(String):[String(Ae)];for(const he of we){const De=he.replace(/[\s_-]/g,""),Me=Math.min(M(he,W)??3,M(De,W)??3);if((oe===null||Me<oe)&&(oe=Me),oe===0)break}if(oe===0)break}oe!==null&&oe<3&&j.push({item:se,score:oe})}return j.sort((se,oe)=>se.score-oe.score),j.map(({item:se})=>se)},L=e.filter||z,E=e.limit??42,G=typeof e.pluginKey=="string"?new Be(e.pluginKey):e.pluginKey,ue=S(()=>{const H=k(e.items);return H?.length?cs(H)?H:[H]:[]}),te=S(()=>ue.value.flatMap(H=>H)),V=S(()=>t.value.length?e.ignoreFilter?[t.value]:ue.value.map(H=>{const W=H.filter(j=>t.value.includes(j));return W.sort((j,se)=>t.value.indexOf(j)-t.value.indexOf(se)),W}).filter(H=>H.length>0):[]),I=S(()=>t.value.filter(H=>H.type!=="label"&&H.type!=="separator")),U=Lt(e.options,{strategy:"absolute",placement:"bottom-start",offset:8,flip:{},shift:{padding:8},size:!1,autoPlacement:!1,hide:!1,inline:!1}),O=To(U),Z=H=>{if(!p)return;const W=p();if(!W)return;gi({getBoundingClientRect:()=>W},H,{placement:U.placement,strategy:U.strategy,middleware:O}).then(({x:se,y:oe,strategy:Se})=>{H.style.width="max-content",H.style.position=Se,H.style.top="0",H.style.left="0",H.style.transform=`translate(${Math.round(se)}px, ${Math.round(oe)}px)`})},ie=()=>{s.value="open",u||(u=j=>{c&&c({event:j})&&(j.preventDefault(),j.stopPropagation())},document.addEventListener("keydown",u,!0)),d||(d=()=>{setTimeout(()=>{if(s.value==="open"){const j=e.editor.view.state.tr.setMeta(G,{exit:!0});e.editor.view.dispatch(j)}},0)},e.editor.view.dom.addEventListener("blur",d)),y||(y=()=>{a&&Z(a)},window.addEventListener("scroll",y,!0)),f=j=>{n.value=j,i&&i.updateProps({groups:V.value,selectedIndex:j,onSelect:l,onHover:f,state:s.value})},i=new mo(K,{props:{groups:V.value,selectedIndex:n.value,onSelect:l,onHover:f,state:s.value},editor:e.editor}),a=document.createElement("div"),a.style.position=U.strategy,a.style.zIndex="50",o=j=>{j.preventDefault()},a.addEventListener("mousedown",o),((typeof e.appendTo=="function"?e.appendTo():e.appendTo)??e.editor.view.dom.parentElement)?.appendChild(a),i.element&&a.appendChild(i.element),Z(a)};e.ignoreFilter&&(_=Te(()=>k(e.items),H=>{if(!p)return;const W=H?.length?cs(H)?H.flat():H:[];if(t.value=W.slice(0,E),!t.value.length){v();return}if(n.value>=I.value.length&&(n.value=Math.max(0,I.value.length-1)),s.value==="closed"&&t.value.length){ie();return}i&&i.updateProps({groups:V.value,selectedIndex:n.value,onSelect:l,onHover:f,state:s.value}),a&&Z(a)},{deep:!0,flush:"sync"}));const K={props:{groups:{type:Array,required:!0},selectedIndex:{type:Number,required:!0},onSelect:{type:Function,required:!0},onHover:{type:Function,required:!0},state:{type:String,required:!0}},setup(H){function W(se,oe,Se){se.preventDefault(),H.onSelect(oe,Se)}function j(se){H.onHover(se)}return()=>{const se=H.groups,oe=new Map;let Se=0;for(const Ae of se)for(const we of Ae){const he=we;he.type!=="label"&&he.type!=="separator"&&oe.set(we,Se++)}return ze("div",{class:e.ui.value.content(),role:"listbox","data-state":H.state},[ze("div",{class:e.ui.value.viewport(),role:"presentation"},se.map((Ae,we)=>ze("div",{key:`group-${we}`,class:e.ui.value.group(),role:"group"},Ae.map((he,De)=>{const Me=he;if(Me.type==="label")return ze("div",{key:`label-${we}-${De}`,class:e.ui.value.label({class:Me.class})},e.renderItem(he,e.ui));if(Me.type==="separator")return ze("div",{key:`separator-${we}-${De}`,class:e.ui.value.separator({class:Me.class}),role:"separator"});const Ie=oe.get(he),pt=Ie===H.selectedIndex;return ze("div",{key:`item-${Ie}`,class:e.ui.value.item({class:Me.class,active:!1}),role:"option","aria-selected":pt,"data-highlighted":pt?"":void 0,"data-disabled":Me.disabled?"":void 0,onMousedown:it=>W(it,he,Ie),onMouseenter:()=>j(Ie),ref:it=>{it&&pt&&it.scrollIntoView({block:"nearest",inline:"nearest"})}},e.renderItem(he,e.ui))}))))])}}};return{plugin:fi({...e.suggestion||{},pluginKey:G,editor:e.editor,char:e.char,items:({query:H})=>(r.value=H,e.ignoreFilter?te.value.slice(0,E):L(te.value,H).slice(0,E)),command:({editor:H,range:W,props:j})=>{e.onSelect(H,W,j)},render:()=>(c=W=>{const{event:j}=W;if(!i||!I.value.length)return!1;if(j.key==="Escape")return v(),!0;if(j.key==="ArrowUp")return n.value=(n.value+I.value.length-1)%I.value.length,i?.updateProps({groups:V.value,selectedIndex:n.value,onSelect:l,onHover:f,state:s.value}),!0;if(j.key==="ArrowDown")return n.value=(n.value+1)%I.value.length,i?.updateProps({groups:V.value,selectedIndex:n.value,onSelect:l,onHover:f,state:s.value}),!0;if(j.key==="Enter"||j.key==="Tab"){const se=I.value[n.value];return se&&l&&l(se),!0}return!1},{onStart:W=>{t.value=e.ignoreFilter?te.value.slice(0,E):W.items,n.value=0,l=j=>W.command(j),p=W.clientRect,t.value.length&&ie()},onUpdate:W=>{if(t.value=e.ignoreFilter?te.value.slice(0,E):W.items,l=j=>W.command(j),n.value>=I.value.length&&(n.value=Math.max(0,I.value.length-1)),!t.value.length){v();return}i?i.updateProps({groups:V.value,selectedIndex:n.value,onSelect:l,onHover:f,state:s.value}):ie(),a&&Z(a)},onKeyDown:c,onExit:()=>{v(),p=null,r.value=""}})}),destroy:()=>{s.value="closed",u&&(document.removeEventListener("keydown",u,!0),u=null),d&&(e.editor.view.dom.removeEventListener("blur",d),d=null),y&&(window.removeEventListener("scroll",y,!0),y=null),a&&o&&(a.removeEventListener("mousedown",o),o=null),i&&(i.destroy(),i=null),a&&(a.remove(),a=null),_&&(_(),_=null)},filteredItems:t,searchTerm:r}}function So(e){return e.content.trim()?e.content:e.contentBlocks?.filter(n=>n.type==="text"&&!!n.text).map(n=>n.text).join("")??""}function Tr(e){return e.flatMap(t=>{if(t.role!=="user"&&t.role!=="assistant")return[];const n=So(t);return n.trim()?[{role:t.role,content:n,timestamp:t.timestamp}]:[]})}function Mo(e){return Tr(e).length>0}function Ao(e,t,n,s){const r=[];r.push(`# ${e}`),r.push(""),r.push(`> ${s.createdAt}: ${Je(n).format("YYYY-MM-DD HH:mm:ss")}`),r.push(""),r.push("---"),r.push("");for(const i of t){const a=Je(i.timestamp).format("YYYY-MM-DD HH:mm:ss"),o=i.role==="user"?s.user:s.assistant;r.push(`### ${o}`),r.push(`*${a}*`),r.push(""),r.push(i.content),r.push(""),r.push("---"),r.push("")}return r.join(`
3
3
  `)}function Lo(e,t,n,s){const r=[];r.push(`${e}`),r.push(`${s.createdAt}: ${Je(n).format("YYYY-MM-DD HH:mm:ss")}`),r.push(""),r.push("=".repeat(50)),r.push("");for(const i of t){const a=Je(i.timestamp).format("YYYY-MM-DD HH:mm:ss"),o=i.role==="user"?s.user:s.assistant;r.push(`[${o}] ${a}`),r.push(""),r.push(i.content),r.push(""),r.push("-".repeat(50)),r.push("")}return r.join(`
4
- `)}function $o(e){return e.replace(/[/\\?%*:|"<>]/g,"_")}async function Eo(e,t,n,s,r){if(t.length===0)return{success:!1,error:"No messages to export"};let i,a;const o=Je(n).format("YYYYMMDD_HHmmss"),l=$o(e);s==="markdown"?(i=Ao(e,t,n,r),a=`${l}_${o}.md`):(i=Lo(e,t,n,r),a=`${l}_${o}.txt`);const c=`data:text/plain;charset=utf-8,${encodeURIComponent(i)}`,{useCacheService:u}=await mi(async()=>{const{useCacheService:p}=await import("./service-BwbGKwDn.js");return{useCacheService:p}},__vite__mapDeps([0,1,2,3]));return await u().saveToDownloads(a,c)}const bs=be({__name:"EChartPie",props:{data:{},height:{default:280},mode:{default:"expanded"},doughnut:{type:Boolean,default:!0},innerRadius:{default:"50%"},showLegend:{type:Boolean,default:!0}},setup(e){const t=e,n=["#6366f1","#8b5cf6","#ec4899","#f43f5e","#f97316","#eab308","#22c55e","#14b8a6","#06b6d4","#3b82f6"],s=S(()=>{const r=t.data.labels.map((p,f)=>({name:p,value:t.data.values[f]})),i=t.data.labels.length,a=t.mode==="compact",o=i>(a?8:14),l=i>(a?6:12),c=a?{type:l?"scroll":"plain",orient:"horizontal",left:8,right:8,bottom:0,height:28,textStyle:{fontSize:11,overflow:"truncate",width:72}}:{type:l?"scroll":"plain",orient:"vertical",right:10,top:24,bottom:24,textStyle:{fontSize:12,overflow:"truncate",width:120}},u=!a&&!o,d=t.showLegend&&!u;return{color:n,tooltip:{trigger:"item",formatter:"{b}: {c} ({d}%)",confine:!0,extraCssText:"max-width: min(360px, 70vw); white-space: normal; word-break: break-word;",backgroundColor:"rgba(0, 0, 0, 0.8)",borderColor:"transparent",textStyle:{color:"#fff"}},legend:d?c:void 0,series:[{type:"pie",radius:t.doughnut?[t.innerRadius,a?"58%":"68%"]:a?"58%":"68%",center:d?a?["50%","42%"]:["38%","50%"]:["50%",a?"46%":"50%"],avoidLabelOverlap:!0,itemStyle:{borderRadius:4,borderColor:"#fff",borderWidth:2},label:{show:u,formatter:"{b}",overflow:"truncate",width:110,alignTo:"edge",edgeDistance:12},emphasis:{label:{show:u,fontSize:14,fontWeight:"bold",overflow:"truncate",width:140},itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}},data:r}]}});return(r,i)=>(m(),ae(pa,{option:s.value,height:e.height},null,8,["option","height"]))}}),ws=be({__name:"EChartHeatmap",props:{data:{},height:{default:280},mode:{default:"expanded"},minColor:{default:"#fee5e8"},maxColor:{default:"#ee4567"}},setup(e){const t=e,n=S(()=>{let r=0;for(const[,,i]of t.data.data)i>r&&(r=i);return r||1}),s=S(()=>{const r=t.mode==="compact",i=t.data.xLabels.length,a=t.data.yLabels.length;return{tooltip:{position:"top",confine:!0,extraCssText:"max-width: min(360px, 70vw); white-space: normal; word-break: break-word;",formatter:o=>{const l=t.data.xLabels[o.data[0]],c=t.data.yLabels[o.data[1]],u=o.data[2];return`${c} ${l}<br/>消息数: <strong>${u}</strong>`},backgroundColor:"rgba(0, 0, 0, 0.8)",borderColor:"transparent",textStyle:{color:"#fff"}},grid:{left:r?52:72,right:20,top:r?12:24,bottom:r?52:70,outerBoundsMode:"same"},xAxis:{type:"category",data:t.data.xLabels,splitArea:{show:!0},axisLine:{show:!1},axisTick:{show:!1},axisLabel:{fontSize:r?10:11,color:"#6b7280",interval:r&&i>16?"auto":0,hideOverlap:!0}},yAxis:{type:"category",data:t.data.yLabels,splitArea:{show:!0},axisLine:{show:!1},axisTick:{show:!1},axisLabel:{fontSize:r?10:11,color:"#6b7280",interval:r&&a>14?"auto":0,hideOverlap:!0}},visualMap:{min:0,max:n.value,calculable:!0,orient:"horizontal",left:"center",bottom:0,itemWidth:r?8:10,itemHeight:r?84:120,inRange:{color:[t.minColor,t.maxColor]},textStyle:{color:"#6b7280",fontSize:11}},series:[{type:"heatmap",data:t.data.data,label:{show:!1},emphasis:{itemStyle:{shadowBlur:10,shadowColor:"rgba(0, 0, 0, 0.5)"}}}]}});return(r,i)=>(m(),ae(pa,{option:s.value,height:e.height},null,8,["option","height"]))}}),Io=["inert","aria-hidden"],Ro={class:"flex h-full w-64 flex-col"},Po={class:"flex-1 overflow-y-auto p-2"},Ho={key:0,class:"flex items-center justify-center py-8"},No={key:1,class:"flex flex-col items-center justify-center py-12 text-center"},zo={class:"flex h-12 w-12 items-center justify-center rounded-full bg-gray-50 dark:bg-gray-800"},Oo={class:"mt-3 text-xs text-gray-400"},Bo={key:2,class:"space-y-3"},Do={class:"px-2 pb-1 pt-1.5 text-[10px] font-medium tracking-wide text-gray-400 dark:text-gray-500"},jo={class:"space-y-0.5"},Fo=["onClick"],qo=["placeholder","onBlur","onKeyup"],Uo={key:1,class:"flex items-center"},Ko={class:"line-clamp-1 min-w-0 flex-1 text-sm leading-snug"},Wo={class:"rounded p-0.5 text-gray-400 transition-colors hover:bg-gray-200 hover:text-gray-600 dark:hover:bg-gray-700 dark:hover:text-gray-300"},Vo={class:"w-28 p-1"},Go=["disabled","onClick"],Yo=["onClick"],Qo=["disabled","onClick"],Jo={class:"pointer-events-none absolute left-0 top-0 z-10 h-[52px] w-[92px]"},Zo={key:0,class:"pointer-events-auto absolute left-2 top-2"},Xo=["title","disabled"],fg=be({__name:"ConversationList",props:{sessionId:{},activeId:{},disabled:{type:Boolean},conversations:{},loading:{type:Boolean},embedded:{type:Boolean},collapsible:{type:Boolean,default:!0}},emits:["select","create","delete","rename"],setup(e,{expose:t,emit:n}){const{t:s}=qe(),r=Xn(),{isAIChatSidebarCollapsed:i}=er(r),{toggleAIChatSidebar:a}=r,o=e,l=n,c=J([]),u=J(!1),d=J(null),p=J(""),f=J(null),y=S(()=>o.conversations!==void 0),_=S(()=>o.conversations??c.value),M=S(()=>y.value?o.loading??!1:u.value),v=S(()=>o.collapsible!==!1),C=S(()=>v.value&&i.value);async function z(){if(!y.value){u.value=!0;try{c.value=await It().getAIChats(o.sessionId)}catch(O){console.error("加载对话列表失败:",O)}finally{u.value=!1}}}const L=S(()=>{if(_.value.length===0)return[];const O=Je(),Z=O.subtract(7,"day").startOf("day"),ie=O.subtract(30,"day").startOf("day"),K=[],B=[],re=new Map;for(const j of _.value){const se=Je(j.updatedAt*1e3);if(se.isAfter(Z))K.push(j);else if(se.isAfter(ie))B.push(j);else{const oe=se.format("YYYY-MM");re.has(oe)||re.set(oe,[]),re.get(oe).push(j)}}const H=[];K.length>0&&H.push({label:s("ai.chat.conversation.group.last7Days"),conversations:K}),B.length>0&&H.push({label:s("ai.chat.conversation.group.last30Days"),conversations:B});const W=[...re.keys()].sort((j,se)=>se.localeCompare(j));for(const j of W){const se=Je(j+"-01");H.push({label:se.format(se.year()===O.year()?"M月":"YYYY年M月"),conversations:re.get(j)})}return H});function E(O){return O.title||s("ai.chat.conversation.newChat")}function G(O){o.disabled||(d.value=O.id,p.value=O.title||"")}async function ue(O){if(!o.disabled){if(p.value.trim()){if(y.value){l("rename",{id:O,title:p.value.trim()}),d.value=null;return}try{await It().updateAIChatTitle(O,p.value.trim());const Z=c.value.find(ie=>ie.id===O);Z&&(Z.title=p.value.trim())}catch(Z){console.error("更新标题失败:",Z)}}d.value=null}}function te(O){f.value=null,G(O)}function V(O){f.value=null,navigator.clipboard.writeText(O)}function I(O){f.value=null,U(O)}async function U(O){if(!o.disabled){if(y.value){l("delete",O);return}try{await It().deleteAIChat(O),c.value=c.value.filter(Z=>Z.id!==O),l("delete",O)}catch(Z){console.error("删除对话失败:",Z)}}}return wt(()=>{z()}),Te(()=>o.sessionId,()=>{z()}),t({refresh:z}),(O,Z)=>{const ie=Ne,K=tr,B=ea;return m(),x("div",{class:Y(["relative shrink-0 overflow-hidden transition-[width] duration-300 ease-in-out motion-reduce:transition-none",[o.embedded?"h-full":"m-3 h-[calc(100%-1.5rem)]",C.value?"w-[92px]":"w-64"]])},[h("div",{class:Y(["absolute inset-y-0 left-0 overflow-hidden rounded-lg bg-white transition-[width] duration-300 ease-in-out motion-reduce:transition-none dark:bg-sidebar-dark",C.value?"pointer-events-none w-0":"w-64"]),inert:C.value,"aria-hidden":C.value?"true":void 0},[h("div",Ro,[Z[5]||(Z[5]=h("div",{class:"h-[52px] shrink-0 border-b border-gray-200 dark:border-gray-800"},null,-1)),h("div",Po,[M.value?(m(),x("div",Ho,[F(ie,{name:"i-heroicons-arrow-path",class:"h-5 w-5 animate-spin text-gray-400"})])):_.value.length===0?(m(),x("div",No,[h("div",zo,[F(ie,{name:"i-heroicons-chat-bubble-left",class:"h-6 w-6 text-gray-300 dark:text-gray-600"})]),h("p",Oo,w(k(s)("ai.chat.conversation.empty")),1),F(K,{class:"mt-2",size:"xs",variant:"link",color:"primary",disabled:e.disabled,onClick:Z[0]||(Z[0]=re=>!e.disabled&&l("create"))},{default:de(()=>[He(w(k(s)("ai.chat.conversation.startNew")),1)]),_:1},8,["disabled"])])):(m(),x("div",Bo,[(m(!0),x(me,null,_e(L.value,re=>(m(),x("div",{key:re.label},[h("div",Do,w(re.label),1),h("div",jo,[(m(!0),x(me,null,_e(re.conversations,H=>(m(),x("div",{key:H.id,class:Y(["group relative rounded-lg px-3 py-2 transition-all",["cursor-pointer",e.activeId===H.id?"bg-gray-100 text-gray-900 dark:bg-gray-800 dark:text-white":"text-gray-600 hover:bg-gray-50 dark:text-gray-400 dark:hover:bg-gray-800/50"]]),onClick:W=>l("select",H.id)},[d.value===H.id?Zs((m(),x("input",{key:0,"onUpdate:modelValue":Z[1]||(Z[1]=W=>p.value=W),class:"w-full rounded border-none bg-white px-2 py-1 text-sm shadow-sm outline-none ring-1 ring-gray-200 focus:ring-2 focus:ring-primary-500 dark:bg-page-dark dark:ring-gray-700",placeholder:k(s)("ai.chat.conversation.titlePlaceholder"),autoFocus:"",onBlur:W=>ue(H.id),onKeyup:yn(W=>ue(H.id),["enter"]),onClick:Z[2]||(Z[2]=mt(()=>{},["stop"]))},null,40,qo)),[[Xs,p.value]]):(m(),x("div",Uo,[h("p",Ko,w(E(H)),1),h("div",{class:Y(["ml-1 shrink-0 opacity-0 transition-opacity group-hover:opacity-100",{"opacity-100":e.activeId===H.id||f.value===H.id}]),onClick:Z[3]||(Z[3]=mt(()=>{},["stop"]))},[F(B,{open:f.value===H.id,ui:{content:"z-50 p-0"},"onUpdate:open":W=>f.value=W?H.id:null},{content:de(()=>[h("div",Vo,[h("button",{class:"flex w-full items-center gap-2 rounded-md px-2 py-2 text-xs text-gray-600 transition-colors hover:bg-gray-100 dark:text-gray-400 dark:hover:bg-gray-800",disabled:e.disabled,onClick:W=>te(H)},[F(ie,{name:"i-heroicons-pencil",class:"h-3.5 w-3.5"}),He(" "+w(k(s)("ai.chat.conversation.rename")),1)],8,Go),h("button",{class:"flex w-full items-center gap-2 rounded-md px-2 py-2 text-xs text-gray-600 transition-colors hover:bg-gray-100 dark:text-gray-400 dark:hover:bg-gray-800",onClick:W=>V(H.id)},[F(ie,{name:"i-heroicons-clipboard-document",class:"h-3.5 w-3.5"}),He(" "+w(k(s)("ai.chat.conversation.copyId")),1)],8,Yo),h("button",{class:"flex w-full items-center gap-2 rounded-md px-2 py-2 text-xs text-red-500 transition-colors hover:bg-red-50 dark:text-red-400 dark:hover:bg-red-950/30",disabled:e.disabled,onClick:W=>I(H.id)},[F(ie,{name:"i-heroicons-trash",class:"h-3.5 w-3.5"}),He(" "+w(k(s)("ai.chat.conversation.delete")),1)],8,Qo)])]),default:de(()=>[h("button",Wo,[F(ie,{name:"i-heroicons-ellipsis-horizontal",class:"h-4 w-4"})])]),_:2},1032,["open","onUpdate:open"])],2)]))],10,Fo))),128))])]))),128))]))])])],10,Io),h("div",Jo,[v.value?(m(),x("div",Zo,[F(yi,{collapsed:C.value,"accessible-label":k(s)(C.value?"common.expandSidebar":"common.collapseSidebar"),onClick:k(a)},null,8,["collapsed","accessible-label","onClick"])])):q("",!0),h("button",{type:"button",class:Y(["pointer-events-auto absolute left-12 top-2 flex h-9 w-9 items-center justify-center rounded-full text-gray-600 transition-colors hover:bg-gray-100 hover:text-gray-900 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-gray-200",{"cursor-not-allowed opacity-50":e.disabled}]),title:k(s)("ai.chat.conversation.newConversation"),disabled:e.disabled,onClick:Z[4]||(Z[4]=re=>!e.disabled&&l("create"))},[F(ie,{name:"i-lucide-square-pen",class:"h-4 w-4"})],10,Xo)])],2)}}}),el={class:"flex max-h-[80vh] flex-col overflow-hidden"},tl={class:"shrink-0 border-b border-gray-200 px-6 py-4 dark:border-gray-800"},nl={class:"flex items-center justify-between"},rl={class:"flex items-center gap-3"},sl={class:"flex h-8 w-8 items-center justify-center rounded-lg bg-red-100 dark:bg-red-900/40"},al={class:"text-lg font-semibold text-gray-900 dark:text-white"},il={class:"flex-1 overflow-y-auto px-6 py-4"},ol={class:"flex flex-col gap-4"},ll={class:"text-sm font-semibold text-gray-700 dark:text-gray-300"},cl={key:0,class:"rounded-md border border-red-200 bg-red-50/50 p-3 dark:border-red-900/40 dark:bg-red-950/20"},ul={class:"m-0 whitespace-pre-wrap break-words font-mono text-xs leading-relaxed text-red-600 dark:text-red-400"},dl={key:1,class:"rounded-md border border-gray-200 bg-gray-50 p-3 dark:border-gray-700 dark:bg-page-dark"},pl={class:"m-0 max-h-[300px] overflow-auto whitespace-pre-wrap break-words font-mono text-xs leading-relaxed text-gray-700 dark:text-gray-300"},hl={key:2,class:"select-text break-words rounded-md border border-gray-200 bg-gray-50 px-3 py-2 font-mono text-xs text-gray-700 dark:border-gray-700 dark:bg-page-dark dark:text-gray-300"},fl={key:0,class:"py-8 text-center text-sm text-gray-400 dark:text-gray-500"},gl={class:"shrink-0 border-t border-gray-200 px-6 py-3 dark:border-gray-800"},ml={class:"flex justify-end"},yl=be({__name:"ErrorDetailModal",props:ki({error:{}},{open:{type:Boolean,required:!0},openModifiers:{}}),emits:["update:open"],setup(e){const{t}=qe(),n=Br(),s=vi(e,"open"),r=e,i=S(()=>{const l=r.error,c=[];return l.url&&c.push({label:t("ai.chat.error.requestUrl"),value:l.url}),l.statusCode!=null&&c.push({label:t("ai.chat.error.statusCode"),value:String(l.statusCode)}),l.responseBody&&c.push({label:t("ai.chat.error.responseBody"),value:a(l.responseBody),isCode:!0}),l.responseHeaders&&c.push({label:t("ai.chat.error.responseHeaders"),value:JSON.stringify(l.responseHeaders,null,2),isCode:!0}),l.name&&c.push({label:t("ai.chat.error.name"),value:l.name}),l.message&&c.push({label:t("ai.chat.error.message"),value:l.message}),l.stack&&c.push({label:t("ai.chat.error.stack"),value:l.stack,isStack:!0}),l.cause&&c.push({label:t("ai.chat.error.cause"),value:a(l.cause),isCode:!0}),l.provider&&c.push({label:t("ai.chat.error.provider"),value:l.provider}),l.requestBody&&c.push({label:t("ai.chat.error.requestBody"),value:a(l.requestBody),isCode:!0}),c});function a(l){try{return JSON.stringify(JSON.parse(l),null,2)}catch{return l}}function o(){const l=i.value.map(c=>`${c.label}: ${c.value}`).join(`
4
+ `)}function $o(e){return e.replace(/[/\\?%*:|"<>]/g,"_")}async function Eo(e,t,n,s,r){if(t.length===0)return{success:!1,error:"No messages to export"};let i,a;const o=Je(n).format("YYYYMMDD_HHmmss"),l=$o(e);s==="markdown"?(i=Ao(e,t,n,r),a=`${l}_${o}.md`):(i=Lo(e,t,n,r),a=`${l}_${o}.txt`);const c=`data:text/plain;charset=utf-8,${encodeURIComponent(i)}`,{useCacheService:u}=await mi(async()=>{const{useCacheService:p}=await import("./service-CAdsM9Hy.js");return{useCacheService:p}},__vite__mapDeps([0,1,2,3]));return await u().saveToDownloads(a,c)}const bs=be({__name:"EChartPie",props:{data:{},height:{default:280},mode:{default:"expanded"},doughnut:{type:Boolean,default:!0},innerRadius:{default:"50%"},showLegend:{type:Boolean,default:!0}},setup(e){const t=e,n=["#6366f1","#8b5cf6","#ec4899","#f43f5e","#f97316","#eab308","#22c55e","#14b8a6","#06b6d4","#3b82f6"],s=S(()=>{const r=t.data.labels.map((p,f)=>({name:p,value:t.data.values[f]})),i=t.data.labels.length,a=t.mode==="compact",o=i>(a?8:14),l=i>(a?6:12),c=a?{type:l?"scroll":"plain",orient:"horizontal",left:8,right:8,bottom:0,height:28,textStyle:{fontSize:11,overflow:"truncate",width:72}}:{type:l?"scroll":"plain",orient:"vertical",right:10,top:24,bottom:24,textStyle:{fontSize:12,overflow:"truncate",width:120}},u=!a&&!o,d=t.showLegend&&!u;return{color:n,tooltip:{trigger:"item",formatter:"{b}: {c} ({d}%)",confine:!0,extraCssText:"max-width: min(360px, 70vw); white-space: normal; word-break: break-word;",backgroundColor:"rgba(0, 0, 0, 0.8)",borderColor:"transparent",textStyle:{color:"#fff"}},legend:d?c:void 0,series:[{type:"pie",radius:t.doughnut?[t.innerRadius,a?"58%":"68%"]:a?"58%":"68%",center:d?a?["50%","42%"]:["38%","50%"]:["50%",a?"46%":"50%"],avoidLabelOverlap:!0,itemStyle:{borderRadius:4,borderColor:"#fff",borderWidth:2},label:{show:u,formatter:"{b}",overflow:"truncate",width:110,alignTo:"edge",edgeDistance:12},emphasis:{label:{show:u,fontSize:14,fontWeight:"bold",overflow:"truncate",width:140},itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}},data:r}]}});return(r,i)=>(m(),ae(pa,{option:s.value,height:e.height},null,8,["option","height"]))}}),ws=be({__name:"EChartHeatmap",props:{data:{},height:{default:280},mode:{default:"expanded"},minColor:{default:"#fee5e8"},maxColor:{default:"#ee4567"}},setup(e){const t=e,n=S(()=>{let r=0;for(const[,,i]of t.data.data)i>r&&(r=i);return r||1}),s=S(()=>{const r=t.mode==="compact",i=t.data.xLabels.length,a=t.data.yLabels.length;return{tooltip:{position:"top",confine:!0,extraCssText:"max-width: min(360px, 70vw); white-space: normal; word-break: break-word;",formatter:o=>{const l=t.data.xLabels[o.data[0]],c=t.data.yLabels[o.data[1]],u=o.data[2];return`${c} ${l}<br/>消息数: <strong>${u}</strong>`},backgroundColor:"rgba(0, 0, 0, 0.8)",borderColor:"transparent",textStyle:{color:"#fff"}},grid:{left:r?52:72,right:20,top:r?12:24,bottom:r?52:70,outerBoundsMode:"same"},xAxis:{type:"category",data:t.data.xLabels,splitArea:{show:!0},axisLine:{show:!1},axisTick:{show:!1},axisLabel:{fontSize:r?10:11,color:"#6b7280",interval:r&&i>16?"auto":0,hideOverlap:!0}},yAxis:{type:"category",data:t.data.yLabels,splitArea:{show:!0},axisLine:{show:!1},axisTick:{show:!1},axisLabel:{fontSize:r?10:11,color:"#6b7280",interval:r&&a>14?"auto":0,hideOverlap:!0}},visualMap:{min:0,max:n.value,calculable:!0,orient:"horizontal",left:"center",bottom:0,itemWidth:r?8:10,itemHeight:r?84:120,inRange:{color:[t.minColor,t.maxColor]},textStyle:{color:"#6b7280",fontSize:11}},series:[{type:"heatmap",data:t.data.data,label:{show:!1},emphasis:{itemStyle:{shadowBlur:10,shadowColor:"rgba(0, 0, 0, 0.5)"}}}]}});return(r,i)=>(m(),ae(pa,{option:s.value,height:e.height},null,8,["option","height"]))}}),Io=["inert","aria-hidden"],Ro={class:"flex h-full w-64 flex-col"},Po={class:"flex-1 overflow-y-auto p-2"},Ho={key:0,class:"flex items-center justify-center py-8"},No={key:1,class:"flex flex-col items-center justify-center py-12 text-center"},zo={class:"flex h-12 w-12 items-center justify-center rounded-full bg-gray-50 dark:bg-gray-800"},Oo={class:"mt-3 text-xs text-gray-400"},Bo={key:2,class:"space-y-3"},Do={class:"px-2 pb-1 pt-1.5 text-[10px] font-medium tracking-wide text-gray-400 dark:text-gray-500"},jo={class:"space-y-0.5"},Fo=["onClick"],qo=["placeholder","onBlur","onKeyup"],Uo={key:1,class:"flex items-center"},Ko={class:"line-clamp-1 min-w-0 flex-1 text-sm leading-snug"},Wo={class:"rounded p-0.5 text-gray-400 transition-colors hover:bg-gray-200 hover:text-gray-600 dark:hover:bg-gray-700 dark:hover:text-gray-300"},Vo={class:"w-28 p-1"},Go=["disabled","onClick"],Yo=["onClick"],Qo=["disabled","onClick"],Jo={class:"pointer-events-none absolute left-0 top-0 z-10 h-[52px] w-[92px]"},Zo={key:0,class:"pointer-events-auto absolute left-2 top-2"},Xo=["title","disabled"],fg=be({__name:"ConversationList",props:{sessionId:{},activeId:{},disabled:{type:Boolean},conversations:{},loading:{type:Boolean},embedded:{type:Boolean},collapsible:{type:Boolean,default:!0}},emits:["select","create","delete","rename"],setup(e,{expose:t,emit:n}){const{t:s}=qe(),r=Xn(),{isAIChatSidebarCollapsed:i}=er(r),{toggleAIChatSidebar:a}=r,o=e,l=n,c=J([]),u=J(!1),d=J(null),p=J(""),f=J(null),y=S(()=>o.conversations!==void 0),_=S(()=>o.conversations??c.value),M=S(()=>y.value?o.loading??!1:u.value),v=S(()=>o.collapsible!==!1),C=S(()=>v.value&&i.value);async function z(){if(!y.value){u.value=!0;try{c.value=await It().getAIChats(o.sessionId)}catch(O){console.error("加载对话列表失败:",O)}finally{u.value=!1}}}const L=S(()=>{if(_.value.length===0)return[];const O=Je(),Z=O.subtract(7,"day").startOf("day"),ie=O.subtract(30,"day").startOf("day"),K=[],B=[],re=new Map;for(const j of _.value){const se=Je(j.updatedAt*1e3);if(se.isAfter(Z))K.push(j);else if(se.isAfter(ie))B.push(j);else{const oe=se.format("YYYY-MM");re.has(oe)||re.set(oe,[]),re.get(oe).push(j)}}const H=[];K.length>0&&H.push({label:s("ai.chat.conversation.group.last7Days"),conversations:K}),B.length>0&&H.push({label:s("ai.chat.conversation.group.last30Days"),conversations:B});const W=[...re.keys()].sort((j,se)=>se.localeCompare(j));for(const j of W){const se=Je(j+"-01");H.push({label:se.format(se.year()===O.year()?"M月":"YYYY年M月"),conversations:re.get(j)})}return H});function E(O){return O.title||s("ai.chat.conversation.newChat")}function G(O){o.disabled||(d.value=O.id,p.value=O.title||"")}async function ue(O){if(!o.disabled){if(p.value.trim()){if(y.value){l("rename",{id:O,title:p.value.trim()}),d.value=null;return}try{await It().updateAIChatTitle(O,p.value.trim());const Z=c.value.find(ie=>ie.id===O);Z&&(Z.title=p.value.trim())}catch(Z){console.error("更新标题失败:",Z)}}d.value=null}}function te(O){f.value=null,G(O)}function V(O){f.value=null,navigator.clipboard.writeText(O)}function I(O){f.value=null,U(O)}async function U(O){if(!o.disabled){if(y.value){l("delete",O);return}try{await It().deleteAIChat(O),c.value=c.value.filter(Z=>Z.id!==O),l("delete",O)}catch(Z){console.error("删除对话失败:",Z)}}}return wt(()=>{z()}),Te(()=>o.sessionId,()=>{z()}),t({refresh:z}),(O,Z)=>{const ie=Ne,K=tr,B=ea;return m(),x("div",{class:Y(["relative shrink-0 overflow-hidden transition-[width] duration-300 ease-in-out motion-reduce:transition-none",[o.embedded?"h-full":"m-3 h-[calc(100%-1.5rem)]",C.value?"w-[92px]":"w-64"]])},[h("div",{class:Y(["absolute inset-y-0 left-0 overflow-hidden rounded-lg bg-white transition-[width] duration-300 ease-in-out motion-reduce:transition-none dark:bg-sidebar-dark",C.value?"pointer-events-none w-0":"w-64"]),inert:C.value,"aria-hidden":C.value?"true":void 0},[h("div",Ro,[Z[5]||(Z[5]=h("div",{class:"h-[52px] shrink-0 border-b border-gray-200 dark:border-gray-800"},null,-1)),h("div",Po,[M.value?(m(),x("div",Ho,[F(ie,{name:"i-heroicons-arrow-path",class:"h-5 w-5 animate-spin text-gray-400"})])):_.value.length===0?(m(),x("div",No,[h("div",zo,[F(ie,{name:"i-heroicons-chat-bubble-left",class:"h-6 w-6 text-gray-300 dark:text-gray-600"})]),h("p",Oo,w(k(s)("ai.chat.conversation.empty")),1),F(K,{class:"mt-2",size:"xs",variant:"link",color:"primary",disabled:e.disabled,onClick:Z[0]||(Z[0]=re=>!e.disabled&&l("create"))},{default:de(()=>[He(w(k(s)("ai.chat.conversation.startNew")),1)]),_:1},8,["disabled"])])):(m(),x("div",Bo,[(m(!0),x(me,null,_e(L.value,re=>(m(),x("div",{key:re.label},[h("div",Do,w(re.label),1),h("div",jo,[(m(!0),x(me,null,_e(re.conversations,H=>(m(),x("div",{key:H.id,class:Y(["group relative rounded-lg px-3 py-2 transition-all",["cursor-pointer",e.activeId===H.id?"bg-gray-100 text-gray-900 dark:bg-gray-800 dark:text-white":"text-gray-600 hover:bg-gray-50 dark:text-gray-400 dark:hover:bg-gray-800/50"]]),onClick:W=>l("select",H.id)},[d.value===H.id?Zs((m(),x("input",{key:0,"onUpdate:modelValue":Z[1]||(Z[1]=W=>p.value=W),class:"w-full rounded border-none bg-white px-2 py-1 text-sm shadow-sm outline-none ring-1 ring-gray-200 focus:ring-2 focus:ring-primary-500 dark:bg-page-dark dark:ring-gray-700",placeholder:k(s)("ai.chat.conversation.titlePlaceholder"),autoFocus:"",onBlur:W=>ue(H.id),onKeyup:yn(W=>ue(H.id),["enter"]),onClick:Z[2]||(Z[2]=mt(()=>{},["stop"]))},null,40,qo)),[[Xs,p.value]]):(m(),x("div",Uo,[h("p",Ko,w(E(H)),1),h("div",{class:Y(["ml-1 shrink-0 opacity-0 transition-opacity group-hover:opacity-100",{"opacity-100":e.activeId===H.id||f.value===H.id}]),onClick:Z[3]||(Z[3]=mt(()=>{},["stop"]))},[F(B,{open:f.value===H.id,ui:{content:"z-50 p-0"},"onUpdate:open":W=>f.value=W?H.id:null},{content:de(()=>[h("div",Vo,[h("button",{class:"flex w-full items-center gap-2 rounded-md px-2 py-2 text-xs text-gray-600 transition-colors hover:bg-gray-100 dark:text-gray-400 dark:hover:bg-gray-800",disabled:e.disabled,onClick:W=>te(H)},[F(ie,{name:"i-heroicons-pencil",class:"h-3.5 w-3.5"}),He(" "+w(k(s)("ai.chat.conversation.rename")),1)],8,Go),h("button",{class:"flex w-full items-center gap-2 rounded-md px-2 py-2 text-xs text-gray-600 transition-colors hover:bg-gray-100 dark:text-gray-400 dark:hover:bg-gray-800",onClick:W=>V(H.id)},[F(ie,{name:"i-heroicons-clipboard-document",class:"h-3.5 w-3.5"}),He(" "+w(k(s)("ai.chat.conversation.copyId")),1)],8,Yo),h("button",{class:"flex w-full items-center gap-2 rounded-md px-2 py-2 text-xs text-red-500 transition-colors hover:bg-red-50 dark:text-red-400 dark:hover:bg-red-950/30",disabled:e.disabled,onClick:W=>I(H.id)},[F(ie,{name:"i-heroicons-trash",class:"h-3.5 w-3.5"}),He(" "+w(k(s)("ai.chat.conversation.delete")),1)],8,Qo)])]),default:de(()=>[h("button",Wo,[F(ie,{name:"i-heroicons-ellipsis-horizontal",class:"h-4 w-4"})])]),_:2},1032,["open","onUpdate:open"])],2)]))],10,Fo))),128))])]))),128))]))])])],10,Io),h("div",Jo,[v.value?(m(),x("div",Zo,[F(yi,{collapsed:C.value,"accessible-label":k(s)(C.value?"common.expandSidebar":"common.collapseSidebar"),onClick:k(a)},null,8,["collapsed","accessible-label","onClick"])])):q("",!0),h("button",{type:"button",class:Y(["pointer-events-auto absolute left-12 top-2 flex h-9 w-9 items-center justify-center rounded-full text-gray-600 transition-colors hover:bg-gray-100 hover:text-gray-900 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-gray-200",{"cursor-not-allowed opacity-50":e.disabled}]),title:k(s)("ai.chat.conversation.newConversation"),disabled:e.disabled,onClick:Z[4]||(Z[4]=re=>!e.disabled&&l("create"))},[F(ie,{name:"i-lucide-square-pen",class:"h-4 w-4"})],10,Xo)])],2)}}}),el={class:"flex max-h-[80vh] flex-col overflow-hidden"},tl={class:"shrink-0 border-b border-gray-200 px-6 py-4 dark:border-gray-800"},nl={class:"flex items-center justify-between"},rl={class:"flex items-center gap-3"},sl={class:"flex h-8 w-8 items-center justify-center rounded-lg bg-red-100 dark:bg-red-900/40"},al={class:"text-lg font-semibold text-gray-900 dark:text-white"},il={class:"flex-1 overflow-y-auto px-6 py-4"},ol={class:"flex flex-col gap-4"},ll={class:"text-sm font-semibold text-gray-700 dark:text-gray-300"},cl={key:0,class:"rounded-md border border-red-200 bg-red-50/50 p-3 dark:border-red-900/40 dark:bg-red-950/20"},ul={class:"m-0 whitespace-pre-wrap break-words font-mono text-xs leading-relaxed text-red-600 dark:text-red-400"},dl={key:1,class:"rounded-md border border-gray-200 bg-gray-50 p-3 dark:border-gray-700 dark:bg-page-dark"},pl={class:"m-0 max-h-[300px] overflow-auto whitespace-pre-wrap break-words font-mono text-xs leading-relaxed text-gray-700 dark:text-gray-300"},hl={key:2,class:"select-text break-words rounded-md border border-gray-200 bg-gray-50 px-3 py-2 font-mono text-xs text-gray-700 dark:border-gray-700 dark:bg-page-dark dark:text-gray-300"},fl={key:0,class:"py-8 text-center text-sm text-gray-400 dark:text-gray-500"},gl={class:"shrink-0 border-t border-gray-200 px-6 py-3 dark:border-gray-800"},ml={class:"flex justify-end"},yl=be({__name:"ErrorDetailModal",props:ki({error:{}},{open:{type:Boolean,required:!0},openModifiers:{}}),emits:["update:open"],setup(e){const{t}=qe(),n=Br(),s=vi(e,"open"),r=e,i=S(()=>{const l=r.error,c=[];return l.url&&c.push({label:t("ai.chat.error.requestUrl"),value:l.url}),l.statusCode!=null&&c.push({label:t("ai.chat.error.statusCode"),value:String(l.statusCode)}),l.responseBody&&c.push({label:t("ai.chat.error.responseBody"),value:a(l.responseBody),isCode:!0}),l.responseHeaders&&c.push({label:t("ai.chat.error.responseHeaders"),value:JSON.stringify(l.responseHeaders,null,2),isCode:!0}),l.name&&c.push({label:t("ai.chat.error.name"),value:l.name}),l.message&&c.push({label:t("ai.chat.error.message"),value:l.message}),l.stack&&c.push({label:t("ai.chat.error.stack"),value:l.stack,isStack:!0}),l.cause&&c.push({label:t("ai.chat.error.cause"),value:a(l.cause),isCode:!0}),l.provider&&c.push({label:t("ai.chat.error.provider"),value:l.provider}),l.requestBody&&c.push({label:t("ai.chat.error.requestBody"),value:a(l.requestBody),isCode:!0}),c});function a(l){try{return JSON.stringify(JSON.parse(l),null,2)}catch{return l}}function o(){const l=i.value.map(c=>`${c.label}: ${c.value}`).join(`
5
5
 
6
6
  `);navigator.clipboard.writeText(l).then(()=>{n.success(t("ai.chat.error.copied"))})}return(l,c)=>{const u=Ne,d=tr,p=ta;return m(),ae(p,{open:s.value,"onUpdate:open":c[1]||(c[1]=f=>s.value=f),ui:{content:"sm:max-w-[700px] z-[100]",overlay:"backdrop-blur-sm z-[99]"}},{content:de(()=>[h("div",el,[h("div",tl,[h("div",nl,[h("div",rl,[h("div",sl,[F(u,{name:"i-heroicons-exclamation-triangle",class:"h-4 w-4 text-red-600 dark:text-red-400"})]),h("h2",al,w(k(t)("ai.chat.error.detail")),1)]),F(d,{icon:"i-heroicons-x-mark",variant:"ghost",color:"neutral",size:"sm",onClick:c[0]||(c[0]=f=>s.value=!1)})])]),h("div",il,[h("div",ol,[(m(!0),x(me,null,_e(i.value,(f,y)=>(m(),x("div",{key:y,class:"flex flex-col gap-1.5"},[h("div",ll,w(f.label),1),f.isStack?(m(),x("div",cl,[h("pre",ul,w(f.value),1)])):f.isCode?(m(),x("div",dl,[h("pre",pl,w(f.value),1)])):(m(),x("div",hl,w(f.value),1))]))),128)),i.value.length===0?(m(),x("div",fl,w(k(t)("ai.chat.error.unknown")),1)):q("",!0)])]),h("div",gl,[h("div",ml,[F(d,{icon:"i-heroicons-document-duplicate",variant:"soft",color:"neutral",size:"sm",onClick:o},{default:de(()=>[He(w(k(t)("ai.chat.error.copyAll")),1)]),_:1})])])])]),_:1},8,["open"])}}}),vl={class:"min-w-0 flex-1 truncate"},kl={class:"shrink-0 text-[11px] text-amber-600/80 dark:text-amber-400/80"},xl={class:"mb-1.5 flex items-center gap-2"},bl={class:"flex shrink-0 items-center justify-center text-red-500 dark:text-red-400"},wl={class:"pr-5 text-[13px] font-semibold leading-[1.4] text-red-600 dark:text-red-400"},_l={class:"ml-6 line-clamp-3 break-words text-xs leading-normal text-gray-600 dark:text-gray-400"},Tl={class:"mt-2.5 ml-6 flex items-center"},Cl={class:"ml-auto inline-flex items-center gap-0.5 text-xs text-gray-400 transition-colors duration-150 group-hover:text-red-500 dark:text-gray-500 dark:group-hover:text-red-400"},Sl=be({__name:"ErrorBlock",props:{error:{},compact:{type:Boolean}},setup(e){const{t}=qe(),n=e,s=J(!1);function r(i){return i.friendlyMessage||i.message||t("ai.chat.error.unknown")}return(i,a)=>{const o=Ne;return m(),x(me,null,[n.compact?(m(),x("button",{key:0,type:"button",class:"flex w-full min-w-0 items-start gap-2 rounded-md py-1 text-left text-xs text-amber-700 transition-colors hover:bg-amber-50/70 dark:text-amber-300 dark:hover:bg-amber-950/20",onClick:a[0]||(a[0]=l=>s.value=!0)},[F(o,{name:"i-heroicons-exclamation-circle",class:"mt-0.5 h-3.5 w-3.5 shrink-0 text-amber-500"}),h("span",vl,w(r(e.error)),1),h("span",kl,w(k(t)("ai.chat.error.viewDetail")),1)])):(m(),x("div",{key:1,class:"group relative my-2 w-full min-w-[320px] cursor-pointer rounded-lg border border-red-200 bg-red-50/60 px-3.5 py-3 text-[13px] transition-all duration-200 hover:border-red-300 hover:bg-red-50 dark:border-red-900/30 dark:bg-red-950/20 dark:hover:border-red-800/50 dark:hover:bg-red-950/30",onClick:a[1]||(a[1]=l=>s.value=!0)},[h("div",xl,[h("div",bl,[F(o,{name:"i-heroicons-exclamation-triangle",class:"h-4 w-4"})]),h("div",wl,w(k(t)("ai.chat.error.title")),1)]),h("div",_l,w(r(e.error)),1),h("div",Tl,[h("div",Cl,[He(w(k(t)("ai.chat.error.viewDetail"))+" ",1),F(o,{name:"i-heroicons-chevron-right",class:"h-3.5 w-3.5"})])])])),F(yl,{open:s.value,"onUpdate:open":a[2]||(a[2]=l=>s.value=l),error:e.error},null,8,["open","error"])],64)}}}),Ml={class:"my-2 w-full overflow-hidden rounded-lg border border-gray-200 bg-white/80 dark:border-gray-700/70 dark:bg-page-dark/70"},Al={class:"border-b border-gray-100 px-3 py-2 dark:border-gray-800"},Ll={class:"flex min-w-0 items-start justify-between gap-3"},$l={class:"min-w-0"},El={class:"truncate text-sm font-semibold text-gray-900 dark:text-gray-100"},Il={key:0,class:"mt-0.5 line-clamp-2 text-xs text-gray-500 dark:text-gray-400"},Rl={class:"flex shrink-0 items-center gap-1.5"},Pl={class:"rounded-md bg-gray-100 px-1.5 py-0.5 text-[10px] uppercase text-gray-500 dark:bg-gray-800"},Hl={class:"flex max-h-[92vh] flex-col overflow-hidden bg-white dark:bg-page-dark"},Nl={class:"flex items-start justify-between gap-4 border-b border-gray-200 px-5 py-4 dark:border-gray-800"},zl={class:"min-w-0"},Ol={class:"truncate text-base font-semibold text-gray-900 dark:text-gray-100"},Bl={key:0,class:"mt-1 line-clamp-2 text-xs text-gray-500 dark:text-gray-400"},Dl={class:"mt-1 text-[11px] text-gray-400 dark:text-gray-500"},jl={class:"min-h-0 flex-1 overflow-auto p-4"},Fl={key:0,class:"flex h-64 items-center justify-center text-xs text-gray-400 dark:text-gray-500"},ql={class:"mt-1 text-[11px] text-gray-400 dark:text-gray-500"},Ul={class:"px-2 py-3"},Kl={key:0,class:"flex h-32 items-center justify-center text-xs text-gray-400 dark:text-gray-500"},Wl=be({__name:"ChartBlockRenderer",props:{chart:{}},setup(e){const{t}=qe(),n=e,s=J(!1),r=S(()=>n.chart.spec.title),i=S(()=>n.chart.spec.subtitle||n.chart.spec.description||""),a=S(()=>n.chart.spec.display?.height??(n.chart.spec.type==="heatmap"?300:260)),o=S(()=>n.chart.rowCount===0),l=S(()=>{const v=[];return n.chart.spec.unit&&v.push(n.chart.spec.unit),n.chart.truncated&&v.push(t("ai.chat.message.chart.truncated")),v.push(t("ai.chat.message.chart.rows",{count:n.chart.rowCount})),v.join(" · ")}),c=S(()=>n.chart.data),u=S(()=>n.chart.data),d=S(()=>n.chart.data),p=S(()=>n.chart.data),f=S(()=>n.chart.spec.type==="pie"?d.value.labels.length>8:n.chart.spec.type==="line"?u.value.labels.length>28||(u.value.series?.length??0)>4:n.chart.spec.type==="bar"?c.value.labels.length>12:n.chart.spec.type==="heatmap"?p.value.xLabels.length*p.value.yLabels.length>180:!1),y=S(()=>{const v=f.value?320:380;return Math.min(a.value,v)}),_=S(()=>{const v=a.value;if(n.chart.spec.type==="pie")return Math.max(v,560);if(n.chart.spec.type==="line")return Math.max(v,u.value.labels.length>40?620:540);if(n.chart.spec.type==="bar"){const C=n.chart.spec.display?.horizontal?c.value.labels.length*28+120:520;return Math.min(Math.max(v,C),820)}return n.chart.spec.type==="heatmap"?Math.min(Math.max(v,p.value.yLabels.length*22+150,560),860):Math.max(v,520)}),M=S(()=>n.chart.spec.type==="pie"?"640px":n.chart.spec.type==="bar"?"720px":"780px");return(v,C)=>{const z=tr,L=ta;return m(),x("div",Ml,[h("div",Al,[h("div",Ll,[h("div",$l,[h("h3",El,w(r.value),1),i.value?(m(),x("p",Il,w(i.value),1)):q("",!0)]),h("div",Rl,[h("span",Pl,w(e.chart.spec.type),1),F(L,{open:s.value,"onUpdate:open":C[2]||(C[2]=E=>s.value=E),ui:{overlay:"z-[10040] backdrop-blur-sm",content:"z-[10050] w-[96vw] max-w-6xl max-h-[92vh] overflow-hidden"}},{content:de(()=>[h("div",Hl,[h("div",Nl,[h("div",zl,[h("h3",Ol,w(r.value),1),i.value?(m(),x("p",Bl,w(i.value),1)):q("",!0),h("p",Dl,w(l.value),1)]),F(z,{icon:"i-heroicons-x-mark",size:"sm",color:"neutral",variant:"ghost",class:"shrink-0",title:k(t)("common.close"),"aria-label":k(t)("common.close"),onClick:C[1]||(C[1]=E=>s.value=!1)},null,8,["title","aria-label"])]),h("div",jl,[h("div",{class:"mx-auto w-full",style:xi({minWidth:M.value})},[o.value?(m(),x("div",Fl,w(k(t)("ai.chat.message.chart.empty")),1)):e.chart.spec.type==="bar"?(m(),ae(hs,{key:1,data:c.value,height:_.value,mode:"expanded",horizontal:e.chart.spec.display?.horizontal},null,8,["data","height","horizontal"])):e.chart.spec.type==="line"?(m(),ae(fs,{key:2,data:u.value,height:_.value,mode:"expanded"},null,8,["data","height"])):e.chart.spec.type==="pie"?(m(),ae(bs,{key:3,data:d.value,height:_.value,mode:"expanded","show-legend":e.chart.spec.display?.showLegend??!0},null,8,["data","height","show-legend"])):e.chart.spec.type==="heatmap"?(m(),ae(ws,{key:4,data:p.value,height:_.value,mode:"expanded"},null,8,["data","height"])):q("",!0)],4)])])]),default:de(()=>[F(z,{icon:"i-heroicons-arrows-pointing-out",size:"xs",color:"neutral",variant:"ghost",class:"no-capture",title:k(t)("ai.chat.message.chart.expand"),"aria-label":k(t)("ai.chat.message.chart.expand"),onClick:C[0]||(C[0]=mt(()=>{},["stop"]))},null,8,["title","aria-label"])]),_:1},8,["open"])])]),h("p",ql,w(l.value),1)]),h("div",Ul,[o.value?(m(),x("div",Kl,w(k(t)("ai.chat.message.chart.empty")),1)):e.chart.spec.type==="bar"?(m(),ae(hs,{key:1,data:c.value,height:y.value,mode:"compact",horizontal:e.chart.spec.display?.horizontal},null,8,["data","height","horizontal"])):e.chart.spec.type==="line"?(m(),ae(fs,{key:2,data:u.value,height:y.value,mode:"compact"},null,8,["data","height"])):e.chart.spec.type==="pie"?(m(),ae(bs,{key:3,data:d.value,height:y.value,mode:"compact","show-legend":e.chart.spec.display?.showLegend??!0},null,8,["data","height","show-legend"])):e.chart.spec.type==="heatmap"?(m(),ae(ws,{key:4,data:p.value,height:y.value,mode:"compact"},null,8,["data","height"])):q("",!0)])])}}}),Vl=["data-open","aria-hidden","inert"],Gl={class:"ai-process-fold-inner"},Kt=be({__name:"ProcessDisclosure",props:{lazy:{type:Boolean,default:!1}},setup(e){const t=e,n=J(!1),s=J(!1);function r(){n.value||(s.value=!0),n.value=!n.value}return(i,a)=>(m(),x("div",null,[Rt(i.$slots,"summary",{open:n.value,toggle:r}),h("div",{class:"ai-process-fold","data-open":n.value||void 0,"aria-hidden":!n.value,inert:n.value?void 0:!0},[h("div",Gl,[!t.lazy||s.value?Rt(i.$slots,"default",{key:0}):q("",!0)])],8,Vl)]))}}),Yl={class:"relative flex h-4 w-4 shrink-0 items-center justify-center","aria-hidden":"true"},Wt=be({__name:"ProcessDisclosureIcon",props:{icon:{},open:{type:Boolean},iconClass:{default:"text-gray-400 dark:text-gray-500"}},setup(e){return(t,n)=>{const s=Ne;return m(),x("span",Yl,[e.open?q("",!0):(m(),ae(s,{key:0,name:e.icon,class:Y(["absolute h-3.5 w-3.5 transition-opacity duration-100 group-hover/process-toggle:opacity-0",e.iconClass])},null,8,["name","class"])),F(s,{name:"i-heroicons-chevron-down",class:Y(["absolute h-3.5 w-3.5 text-gray-500 transition-opacity duration-100 dark:text-gray-400",e.open?"opacity-100":"opacity-0 group-hover/process-toggle:opacity-100"])},null,8,["class"])])}}}),Ql=["aria-expanded","onClick"],Jl={class:"shrink-0 text-gray-600 dark:text-gray-300"},Zl={class:"ml-auto flex min-w-0 items-center gap-2"},Xl={key:0,class:"truncate text-[11px] text-gray-400 dark:text-gray-500"},ec={class:"evidence-details mx-px mt-1 rounded-lg border border-gray-200/60 bg-gray-50/80 px-3 py-2 dark:border-white/5 dark:bg-white/[0.03]"},tc={class:"mb-2 space-y-0.5 text-xs text-gray-600 dark:text-gray-400"},nc={class:"font-medium"},rc={key:0},sc={class:"font-medium"},ac={key:0,class:"mb-2 space-y-1"},ic={key:1,class:"py-1.5 text-center text-xs text-gray-400 dark:text-gray-500"},oc={key:2,class:"space-y-2"},lc={class:"flex items-center gap-2"},cc={class:"ml-auto shrink-0 text-[11px] text-gray-400 dark:text-gray-500"},uc={key:0,class:"mt-1 text-[11px] text-gray-500 dark:text-gray-400"},dc={class:"mt-1 space-y-0.5"},pc=["onClick"],hc={class:"min-w-0 flex-1 text-xs leading-snug text-gray-600 dark:text-gray-300"},fc={key:0,class:"mr-1 text-gray-400 dark:text-gray-500"},gc={class:"line-clamp-2 break-words align-middle"},mc={key:3,class:"mt-1.5 text-right text-[11px] text-gray-400 dark:text-gray-500"},yc=be({__name:"EvidenceBlock",props:{evidence:{}},setup(e){const t=e,{t:n}=qe(),s=Xn(),r=["included","uncertain","excluded"],i=S(()=>[...t.evidence.groups].sort((p,f)=>r.indexOf(p.status)-r.indexOf(f.status))),a=S(()=>t.evidence.groups.reduce((p,f)=>p+f.sources.length,0)),o=S(()=>r.map(p=>({status:p,count:t.evidence.groups.filter(f=>f.status===p).length})).filter(p=>p.count>0)),l=S(()=>t.evidence.warnings??[]),c={included:"bg-emerald-50 text-emerald-600 dark:bg-emerald-900/20 dark:text-emerald-400",uncertain:"bg-amber-50 text-amber-600 dark:bg-amber-900/20 dark:text-amber-400",excluded:"bg-gray-100 text-gray-500 dark:bg-gray-800/40 dark:text-gray-400"},u={included:"bg-emerald-500",uncertain:"bg-amber-500",excluded:"bg-gray-400"};function d(p){s.openChatRecordDrawer({scrollToMessageId:p})}return(p,f)=>{const y=Ne;return m(),ae(Kt,{lazy:"",class:"w-full text-[13px]"},{summary:de(({open:_,toggle:M})=>[h("button",{type:"button",class:"group/process-toggle flex h-7 w-full items-center gap-2 rounded-md text-left text-sm leading-7 text-gray-500 transition-colors hover:bg-gray-50/80 hover:text-gray-700 dark:text-gray-400 dark:hover:bg-gray-800/30 dark:hover:text-gray-300","aria-expanded":_,onClick:M},[F(Wt,{icon:"i-heroicons-document-magnifying-glass",open:_},null,8,["open"]),h("span",Jl,w(k(n)("ai.chat.evidence.title")),1),h("div",Zl,[(m(!0),x(me,null,_e(o.value,v=>(m(),x("span",{key:v.status,class:"flex shrink-0 items-center gap-1 text-[11px] text-gray-500 dark:text-gray-400"},[h("span",{class:Y(["h-1.5 w-1.5 rounded-full",u[v.status]])},null,2),He(" "+w(k(n)(`ai.chat.evidence.group.${v.status}`))+" "+w(v.count),1)]))),128)),o.value.length===0?(m(),x("span",Xl,w(k(n)("ai.chat.evidence.empty")),1)):q("",!0)])],8,Ql)]),default:de(()=>[h("div",ec,[h("div",tc,[h("div",null,[h("span",nc,w(k(n)("ai.chat.evidence.query"))+":",1),He(" "+w(e.evidence.query),1)]),e.evidence.criteria?(m(),x("div",rc,[h("span",sc,w(k(n)("ai.chat.evidence.criteria"))+":",1),He(" "+w(e.evidence.criteria),1)])):q("",!0)]),l.value.length>0?(m(),x("div",ac,[(m(!0),x(me,null,_e(l.value,_=>(m(),x("div",{key:_,class:"flex items-start gap-1.5 rounded bg-amber-50/70 px-2 py-1 text-[11px] text-amber-600 dark:bg-amber-900/15 dark:text-amber-400"},[F(y,{name:"i-heroicons-exclamation-triangle",class:"mt-0.5 h-3 w-3 shrink-0"}),h("span",null,w(k(n)(`ai.chat.evidence.warning.${_}`)),1)]))),128))])):q("",!0),i.value.length===0?(m(),x("div",ic,w(k(n)("ai.chat.evidence.empty")),1)):(m(),x("div",oc,[(m(!0),x(me,null,_e(i.value,_=>(m(),x("div",{key:_.id,class:"rounded-md border border-gray-200/80 bg-white px-2.5 py-1.5 dark:border-gray-700/50 dark:bg-page-dark/30"},[h("div",lc,[h("span",{class:Y(["rounded px-1.5 py-0.5 text-[11px] font-medium",c[_.status]])},w(k(n)(`ai.chat.evidence.group.${_.status}`)),3),h("span",cc,w(_.title),1)]),_.reason?(m(),x("div",uc,w(_.reason),1)):q("",!0),h("ul",dc,[(m(!0),x(me,null,_e(_.sources,(M,v)=>(m(),x("li",{key:`${_.id}-${v}`,class:"group/source flex cursor-pointer items-start gap-1.5 rounded px-1.5 py-1 transition-colors hover:bg-gray-50 dark:hover:bg-gray-800/40",onClick:C=>d(M.messageId)},[h("div",hc,[M.senderName?(m(),x("span",fc,w(M.senderName)+": ",1)):q("",!0),h("span",gc,w(M.snippet),1)]),F(y,{name:"i-heroicons-arrow-top-right-on-square",class:"mt-0.5 h-3 w-3 shrink-0 text-gray-400 opacity-0 transition-opacity group-hover/source:opacity-100 dark:text-gray-500"})],8,pc))),128))])]))),128))])),i.value.length>0?(m(),x("div",mc,w(k(n)("ai.chat.evidence.totalSources",{count:a.value})),1)):q("",!0)])]),_:1})}}}),vc=nr(yc,[["__scopeId","data-v-812e30c9"]]),kc=["aria-expanded","onClick"],xc={class:"shrink-0 text-gray-600 dark:text-gray-300"},bc={class:"ml-auto shrink-0 text-[11px] text-gray-400 dark:text-gray-500"},wc={class:"cross-chat-evidence-details mx-px mt-1 rounded-lg border border-gray-200/60 bg-gray-50/80 px-3 py-2 dark:border-white/5 dark:bg-white/[0.03]"},_c={class:"mb-2 flex items-start gap-2 text-xs text-gray-500 dark:text-gray-400"},Tc={class:"min-w-0 flex-1"},Cc={class:"text-gray-600 dark:text-gray-300"},Sc={key:0,class:"shrink-0 rounded bg-amber-50 px-1.5 py-0.5 text-[11px] text-amber-600 dark:bg-amber-900/20 dark:text-amber-400"},Mc={key:0,class:"py-2 text-center text-xs text-gray-400 dark:text-gray-500"},Ac={key:1,class:"space-y-2"},Lc={class:"mb-1 flex items-center gap-1.5 text-xs text-gray-600 dark:text-gray-300"},$c={class:"min-w-0 flex-1 truncate"},Ec={class:"shrink-0 text-[11px] text-gray-400"},Ic=["onClick"],Rc={class:"min-w-0 flex-1 text-xs leading-snug text-gray-600 dark:text-gray-300"},Pc={class:"mr-1 text-gray-400 dark:text-gray-500"},Hc={class:"line-clamp-2 break-words"},Nc={class:"mt-2 text-right text-[11px] text-gray-400 dark:text-gray-500"},zc=be({__name:"CrossChatEvidenceBlock",props:{evidence:{}},setup(e){const t=e,{t:n}=qe(),s=Xn(),r=S(()=>{const a=new Map;for(const o of t.evidence.sources){const l=a.get(o.sessionId);l?l.sources.push(o):a.set(o.sessionId,{sessionName:o.sessionName,sessionType:o.sessionType,sources:[o]})}return[...a.entries()].map(([o,l])=>({sessionId:o,...l}))});function i(a){s.openChatRecordDrawer({sessionId:a.sessionId,scrollToMessageId:a.messageId})}return(a,o)=>{const l=Ne;return m(),ae(Kt,{lazy:"",class:"w-full text-[13px]"},{summary:de(({open:c,toggle:u})=>[h("button",{type:"button",class:"group/process-toggle flex h-7 w-full items-center gap-2 rounded-md text-left text-sm leading-7 text-gray-500 transition-colors hover:bg-gray-50/80 hover:text-gray-700 dark:text-gray-400 dark:hover:bg-gray-800/30 dark:hover:text-gray-300","aria-expanded":c,onClick:u},[F(Wt,{icon:"i-heroicons-document-magnifying-glass",open:c},null,8,["open"]),h("span",xc,w(k(n)("ai.chat.crossChatEvidence.title")),1),h("span",bc,w(k(n)("ai.chat.crossChatEvidence.summary",{sources:e.evidence.sources.length,sessions:r.value.length})),1)],8,kc)]),default:de(()=>[h("div",wc,[h("div",_c,[h("span",Tc,[h("span",Cc,w(k(n)("ai.chat.crossChatEvidence.query"))+":",1),He(" "+w(e.evidence.query),1)]),e.evidence.coverage.truncated?(m(),x("span",Sc,w(k(n)("ai.chat.crossChatEvidence.partial")),1)):q("",!0)]),r.value.length===0?(m(),x("div",Mc,w(k(n)("ai.chat.crossChatEvidence.empty")),1)):(m(),x("div",Ac,[(m(!0),x(me,null,_e(r.value,c=>(m(),x("section",{key:c.sessionId,class:"rounded-md border border-gray-200/80 bg-white px-2.5 py-2 dark:border-gray-700/50 dark:bg-page-dark/30"},[h("div",Lc,[F(l,{name:c.sessionType==="group"?"i-heroicons-user-group":"i-heroicons-user",class:"h-3.5 w-3.5 shrink-0 text-gray-400"},null,8,["name"]),h("span",$c,w(c.sessionName),1),h("span",Ec,w(k(n)("ai.chat.crossChatEvidence.sourceCount",{count:c.sources.length})),1)]),(m(!0),x(me,null,_e(c.sources,u=>(m(),x("button",{key:`${u.sessionId}:${u.messageId}`,type:"button",class:"group/source flex w-full items-start gap-2 rounded px-1.5 py-1 text-left transition-colors hover:bg-gray-50 dark:hover:bg-gray-800/40",onClick:d=>i(u)},[h("div",Rc,[h("span",Pc,w(u.senderName)+":",1),h("span",Hc,w(u.snippet),1)]),F(l,{name:"i-heroicons-arrow-top-right-on-square",class:"mt-0.5 h-3 w-3 shrink-0 text-gray-400 opacity-0 transition-opacity group-hover/source:opacity-100"})],8,Ic))),128))]))),128))])),h("p",Nc,w(k(n)("ai.chat.crossChatEvidence.coverage",{scanned:e.evidence.coverage.scannedSessions,candidates:e.evidence.coverage.candidateSessions})),1)])]),_:1})}}}),Oc=nr(zc,[["__scopeId","data-v-8bc36d76"]]),Bc=/^\s*!\[[^\]\n]*\]\(\s*(?:(?:https?:\/\/(?:localhost|127\.0\.0\.1)(?::\d+)?)?\/?|\.\/)?chart[\w-]*(?:\.(?:png|jpg|jpeg|webp|svg))?(?:\?[^)\s]*)?\s*(?:"[^"]*")?\s*\)\s*$/gim;function Dc(e){return e&&e.replace(Bc,"").replace(/\n{3,}/g,`
7
7
 
@@ -1 +1 @@
1
- import{Z as a,a5 as n}from"./index-bQ9oj54q.js";import"./vendor-snapdom--nZvo8Sg.js";class p{async getVersion(){return"0.37.3"}async fetchRemoteConfig(e){try{const t=await fetch(e);return t.ok?{success:!0,data:(t.headers.get("content-type")||"").includes("application/json")||e.split("?")[0].endsWith(".json")?await t.json():await t.text()}:{success:!1,error:`HTTP ${t.status}`}}catch(t){return{success:!1,error:String(t)}}}setThemeSource(e){}async getOpenAtLogin(){return!1}async setOpenAtLogin(e){return{success:!1,error:"Not available in CLI Web"}}async getDesktopCloseBehavior(){return"background"}async setDesktopCloseBehavior(e){return{success:!1,error:"Not available in CLI Web"}}async getAnalyticsEnabled(){try{return(await(await a("/_web/telemetry/enabled")).json()).enabled===!0}catch{return!1}}async setAnalyticsEnabled(e){try{return await(await a("/_web/telemetry/enabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:e})})).json()}catch{return{success:!1}}}async trackDailyActive(e){await a("/_web/telemetry/track",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({eventName:"app_active",properties:{app_locale:e}})}).catch(()=>{})}async trackAnalyticsEvent(e,t){await a("/_web/telemetry/track",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({eventName:e,properties:t})}).catch(()=>{})}async showOpenDialog(e){return{canceled:!0,filePaths:[]}}async copyImageToClipboard(e){if(globalThis.isSecureContext===!1)return{success:!1,error:"Image clipboard requires HTTPS or localhost"};if(typeof navigator>"u"||typeof navigator.clipboard?.write!="function"||typeof ClipboardItem>"u")return{success:!1,error:"Image clipboard is not supported by this browser"};try{const t=fetch(e).then(async r=>{if(!r.ok)throw new Error(`Failed to read screenshot data: HTTP ${r.status}`);const s=await r.blob();if(s.type!=="image/png")throw new Error(`Unsupported screenshot MIME type: ${s.type||"unknown"}`);return s});return await navigator.clipboard.write([new ClipboardItem({"image/png":t})]),{success:!0}}catch(t){const r=t instanceof Error?`${t.name}: ${t.message}`:String(t);return n(`Image clipboard write failed: ${r}`,t instanceof Error?t.stack:void 0),{success:!1,error:r}}}async checkUpdate(){try{return await(await a("/_web/system/check-update")).json()}catch(e){return{hasUpdate:!1,currentVersion:"unknown",error:e instanceof Error?e.message:String(e)}}}async performUpdate(){return{success:!1,error:"Web update is unavailable. Run clb update in your terminal."}}async relaunch(){window.location.reload()}}export{p as CliWebPlatformAdapter};
1
+ import{Z as a,a5 as n}from"./index-D07viL9P.js";import"./vendor-snapdom--nZvo8Sg.js";class p{async getVersion(){return"0.37.4"}async fetchRemoteConfig(e){try{const t=await fetch(e);return t.ok?{success:!0,data:(t.headers.get("content-type")||"").includes("application/json")||e.split("?")[0].endsWith(".json")?await t.json():await t.text()}:{success:!1,error:`HTTP ${t.status}`}}catch(t){return{success:!1,error:String(t)}}}setThemeSource(e){}async getOpenAtLogin(){return!1}async setOpenAtLogin(e){return{success:!1,error:"Not available in CLI Web"}}async getDesktopCloseBehavior(){return"background"}async setDesktopCloseBehavior(e){return{success:!1,error:"Not available in CLI Web"}}async getAnalyticsEnabled(){try{return(await(await a("/_web/telemetry/enabled")).json()).enabled===!0}catch{return!1}}async setAnalyticsEnabled(e){try{return await(await a("/_web/telemetry/enabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:e})})).json()}catch{return{success:!1}}}async trackDailyActive(e){await a("/_web/telemetry/track",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({eventName:"app_active",properties:{app_locale:e}})}).catch(()=>{})}async trackAnalyticsEvent(e,t){await a("/_web/telemetry/track",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({eventName:e,properties:t})}).catch(()=>{})}async showOpenDialog(e){return{canceled:!0,filePaths:[]}}async copyImageToClipboard(e){if(globalThis.isSecureContext===!1)return{success:!1,error:"Image clipboard requires HTTPS or localhost"};if(typeof navigator>"u"||typeof navigator.clipboard?.write!="function"||typeof ClipboardItem>"u")return{success:!1,error:"Image clipboard is not supported by this browser"};try{const t=fetch(e).then(async r=>{if(!r.ok)throw new Error(`Failed to read screenshot data: HTTP ${r.status}`);const s=await r.blob();if(s.type!=="image/png")throw new Error(`Unsupported screenshot MIME type: ${s.type||"unknown"}`);return s});return await navigator.clipboard.write([new ClipboardItem({"image/png":t})]),{success:!0}}catch(t){const r=t instanceof Error?`${t.name}: ${t.message}`:String(t);return n(`Image clipboard write failed: ${r}`,t instanceof Error?t.stack:void 0),{success:!1,error:r}}}async checkUpdate(){try{return await(await a("/_web/system/check-update")).json()}catch(e){return{hasUpdate:!1,currentVersion:"unknown",error:e instanceof Error?e.message:String(e)}}}async performUpdate(){return{success:!1,error:"Web update is unavailable. Run clb update in your terminal."}}async relaunch(){window.location.reload()}}export{p as CliWebPlatformAdapter};
@@ -1,4 +1,4 @@
1
- import{$ as R}from"./index-bQ9oj54q.js";import"./vendor-snapdom--nZvo8Sg.js";const S=`
1
+ import{$ as R}from"./index-D07viL9P.js";import"./vendor-snapdom--nZvo8Sg.js";const S=`
2
2
  msg.id,
3
3
  m.id as senderId,
4
4
  COALESCE(m.group_nickname, m.account_name, m.platform_id) as senderName,
@@ -1 +1 @@
1
- import{S as i,V as r,W as s,T as l}from"./index-bQ9oj54q.js";import"./vendor-snapdom--nZvo8Sg.js";class c{async getAll(){return i("/ai/skills")}async getConfig(t){try{return await i(`/ai/skills/${t}`)}catch{return null}}async create(t){return r("/ai/skills",{rawMd:t})}async update(t,a){return s(`/ai/skills/${t}`,{rawMd:a})}async delete(t){return l(`/ai/skills/${t}`)}async importFromMd(t){return r("/ai/skills/import",{rawMd:t})}async importBuiltin(t){return r("/ai/skills/import-builtin",{builtinId:t})}async reimport(t){return r(`/ai/skills/${t}/reimport`,{})}async getBuiltinCatalog(){try{return await i("/ai/skills/builtin-catalog")}catch{return[]}}}export{c as FetchSkillAdapter};
1
+ import{S as i,V as r,W as s,T as l}from"./index-D07viL9P.js";import"./vendor-snapdom--nZvo8Sg.js";class c{async getAll(){return i("/ai/skills")}async getConfig(t){try{return await i(`/ai/skills/${t}`)}catch{return null}}async create(t){return r("/ai/skills",{rawMd:t})}async update(t,a){return s(`/ai/skills/${t}`,{rawMd:a})}async delete(t){return l(`/ai/skills/${t}`)}async importFromMd(t){return r("/ai/skills/import",{rawMd:t})}async importBuiltin(t){return r("/ai/skills/import-builtin",{builtinId:t})}async reimport(t){return r(`/ai/skills/${t}/reimport`,{})}async getBuiltinCatalog(){try{return await i("/ai/skills/builtin-catalog")}catch{return[]}}}export{c as FetchSkillAdapter};
@@ -1 +1 @@
1
- import{Z as c}from"./index-bQ9oj54q.js";import"./vendor-snapdom--nZvo8Sg.js";class p{preflight(e,n){return s(`/_web/sessions/${encodeURIComponent(e)}/topics/preflight`,{method:"POST",body:JSON.stringify(n)})}start(e,n){return s(`/_web/sessions/${encodeURIComponent(e)}/topics/runs`,{method:"POST",body:JSON.stringify(n)})}generateDay(e,n,o,t){return s(`/_web/sessions/${encodeURIComponent(e)}/topics/days/${encodeURIComponent(n)}/generate`,{method:"POST",body:JSON.stringify({timezone:o,locale:t})})}getLatestRun(e){return s(`/_web/sessions/${encodeURIComponent(e)}/topics/runs/latest`)}getRun(e,n){return s(`/_web/sessions/${encodeURIComponent(e)}/topics/runs/${encodeURIComponent(n)}`)}pause(e,n){return this.runAction(e,n,"pause")}resume(e,n){return this.runAction(e,n,"resume")}cancel(e,n){return this.runAction(e,n,"cancel")}getDay(e,n,o){return s(`/_web/sessions/${encodeURIComponent(e)}/topics/days/${encodeURIComponent(n)}?timezone=${encodeURIComponent(o)}`)}async deleteDay(e,n){return(await s(`/_web/sessions/${encodeURIComponent(e)}/topics/days/${encodeURIComponent(n)}`,{method:"DELETE"})).success}runAction(e,n,o){return s(`/_web/sessions/${encodeURIComponent(e)}/topics/runs/${encodeURIComponent(n)}/${o}`,{method:"POST"})}}async function s(r,e={}){const n=new Headers(e.headers);e.body!==void 0&&n.set("Content-Type","application/json");const o=await c(r,{...e,headers:n});if(!o.ok){const t=await o.json().catch(()=>null);throw new Error(t?.error||t?.message||`HTTP ${o.status}`)}return o.json()}export{p as FetchChatTopicsAdapter};
1
+ import{Z as c}from"./index-D07viL9P.js";import"./vendor-snapdom--nZvo8Sg.js";class p{preflight(e,n){return s(`/_web/sessions/${encodeURIComponent(e)}/topics/preflight`,{method:"POST",body:JSON.stringify(n)})}start(e,n){return s(`/_web/sessions/${encodeURIComponent(e)}/topics/runs`,{method:"POST",body:JSON.stringify(n)})}generateDay(e,n,o,t){return s(`/_web/sessions/${encodeURIComponent(e)}/topics/days/${encodeURIComponent(n)}/generate`,{method:"POST",body:JSON.stringify({timezone:o,locale:t})})}getLatestRun(e){return s(`/_web/sessions/${encodeURIComponent(e)}/topics/runs/latest`)}getRun(e,n){return s(`/_web/sessions/${encodeURIComponent(e)}/topics/runs/${encodeURIComponent(n)}`)}pause(e,n){return this.runAction(e,n,"pause")}resume(e,n){return this.runAction(e,n,"resume")}cancel(e,n){return this.runAction(e,n,"cancel")}getDay(e,n,o){return s(`/_web/sessions/${encodeURIComponent(e)}/topics/days/${encodeURIComponent(n)}?timezone=${encodeURIComponent(o)}`)}async deleteDay(e,n){return(await s(`/_web/sessions/${encodeURIComponent(e)}/topics/days/${encodeURIComponent(n)}`,{method:"DELETE"})).success}runAction(e,n,o){return s(`/_web/sessions/${encodeURIComponent(e)}/topics/runs/${encodeURIComponent(n)}/${o}`,{method:"POST"})}}async function s(r,e={}){const n=new Headers(e.headers);e.body!==void 0&&n.set("Content-Type","application/json");const o=await c(r,{...e,headers:n});if(!o.ok){const t=await o.json().catch(()=>null);throw new Error(t?.error||t?.message||`HTTP ${o.status}`)}return o.json()}export{p as FetchChatTopicsAdapter};
@@ -1,4 +1,4 @@
1
- import{Z as d,ax as l,S as I}from"./index-bQ9oj54q.js";import"./vendor-snapdom--nZvo8Sg.js";function g(i){return{success:i.success,sessionId:i.sessionId,platform:i.platform,error:i.error,importMode:i.importMode,matchedBy:i.matchedBy,createReason:i.createReason,newMessageCount:i.newMessageCount,duplicateCount:i.duplicateCount,messageCount:i.messageCount,memberCount:i.memberCount,diagnostics:i.diagnostics}}async function S(i,e,t){const o=i.body?.getReader();if(!o)return e;const s=new TextDecoder;let r="",a=e;for(;;){const{done:n,value:y}=await o.read();if(n)break;r+=s.decode(y,{stream:!0});const w=r.split(`
1
+ import{Z as d,ax as l,S as I}from"./index-D07viL9P.js";import"./vendor-snapdom--nZvo8Sg.js";function g(i){return{success:i.success,sessionId:i.sessionId,platform:i.platform,error:i.error,importMode:i.importMode,matchedBy:i.matchedBy,createReason:i.createReason,newMessageCount:i.newMessageCount,duplicateCount:i.duplicateCount,messageCount:i.messageCount,memberCount:i.memberCount,diagnostics:i.diagnostics}}async function S(i,e,t){const o=i.body?.getReader();if(!o)return e;const s=new TextDecoder;let r="",a=e;for(;;){const{done:n,value:y}=await o.read();if(n)break;r+=s.decode(y,{stream:!0});const w=r.split(`
2
2
  `);r=w.pop()||"";let p="";for(const u of w)if(u.startsWith("event: "))p=u.slice(7).trim();else if(u.startsWith("data: ")){const f=JSON.parse(u.slice(6));p==="progress"?t?.(f):(p==="done"||p==="error")&&(a=f),p=""}}return a}class B{constructor(){this.activeBatch=null}async requestBatchCancellation(e){try{await d(`${l()}/import/batch/${encodeURIComponent(e)}/cancel`,{method:"POST"})}catch{}}async importFile(e,t,o){if(typeof e=="string")return{success:!1,error:"File path import is not supported in Web mode"};const s=new FormData;s.append("file",e),t?.formatId&&s.append("formatId",t.formatId),t?.chatIndex!==void 0&&s.append("chatIndex",String(t.chatIndex)),t?.sessionGapThreshold!==void 0&&s.append("sessionGapThreshold",String(t.sessionGapThreshold));const r=await d(`${l()}/import`,{method:"POST",body:s});if(!r.ok){const a=await r.text();return{success:!1,error:`HTTP ${r.status}: ${a}`}}return g(await S(r,{success:!1,error:"Unknown error"},o))}async importBatch(e,t,o){if(e.some(n=>typeof n.file=="string"))return e.map(n=>({id:n.id,status:"failed",error:"File path import is not supported in Web mode"}));const s=new FormData;for(const n of e)s.append("files",n.file);t?.sessionGapThreshold!==void 0&&s.append("sessionGapThreshold",String(t.sessionGapThreshold));const r={id:crypto.randomUUID(),cancelRequested:!1};this.activeBatch=r;const a=Array(e.length);try{const n=await d(`${l()}/import/batch`,{method:"POST",body:s,headers:{"X-ChatLab-Import-Batch-Id":r.id}});if(r.cancelRequested&&await this.requestBatchCancellation(r.id),!n.ok||!n.body){const m=await n.text();return e.map(T=>({id:T.id,status:"failed",error:`HTTP ${n.status}: ${m}`}))}const y=n.body.getReader(),w=new TextDecoder;let p="",u=null,f=null,c="";for(;;){const{done:m,value:T}=await y.read();if(m)break;p+=w.decode(T,{stream:!0});const v=p.split(`
3
3
  `);p=v.pop()||"";for(const b of v){if(b.startsWith("event: ")){c=b.slice(7).trim();continue}if(!b.startsWith("data: "))continue;const h=JSON.parse(b.slice(6));if(c==="batch-start")o?.({index:h.index,event:"start"});else if(c==="batch-progress")o?.({index:h.index,event:"progress",progress:h.progress});else if(c==="batch-complete"){const $=x(e,h.index,h.result);a[h.index]=$,o?.({index:h.index,event:"complete",result:$})}else c==="done"?u=h.map(($,C)=>x(e,C,$)):c==="error"&&(f=typeof h?.error=="string"?h.error:"Batch import failed");c=""}}return u??e.map((m,T)=>a[T]??{id:m.id,status:"failed",error:f??"Batch response ended without results"})}catch(n){return e.map((y,w)=>a[w]??{id:y.id,status:"failed",error:n instanceof Error?n.message:String(n)})}finally{this.activeBatch===r&&(this.activeBatch=null)}}cancelActiveImport(){this.activeBatch&&(this.activeBatch.cancelRequested=!0,this.requestBatchCancellation(this.activeBatch.id))}async detectFormat(e){if(typeof e=="string")return null;const t=new FormData;t.append("file",e);const o=await d(`${l()}/detect-format`,{method:"POST",body:t});return o.ok?(await o.json()).format:null}async scanMultiChatFile(e){if(typeof e=="string")return[];const t=new FormData;t.append("file",e);const o=await d(`${l()}/scan-multi-chat`,{method:"POST",body:t});return o.ok?(await o.json()).chats:[]}async prepareImportSource(e){if(typeof e=="string")return{success:!1,error:"File path import is not supported in Web mode"};const t=new FormData;t.append("file",e);const o=await d(`${l()}/import-sources`,{method:"POST",body:t}),s=await o.json().catch(()=>null);return o.ok?s??{success:!1,error:"Invalid import source response"}:{success:!1,error:s?.error||`HTTP ${o.status}`}}async importPreparedChat(e,t,o,s){const r=await d(`${l()}/import-sources/${encodeURIComponent(e)}/import`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({chatId:t,sessionGapThreshold:s?.sessionGapThreshold})});if(!r.ok){const a=await r.text();return{success:!1,error:`HTTP ${r.status}: ${a}`}}return g(await S(r,{success:!1,error:"Unknown error"},o))}async releaseImportSource(e){await d(`${l()}/import-sources/${encodeURIComponent(e)}`,{method:"DELETE"})}getSupportedFormats(){return I("/supported-formats")}async importDemo(e,t,o){return new Promise(s=>{d(`${l()}/demo/import`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({locale:e,timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone,sessionGapThreshold:o?.sessionGapThreshold})}).then(async r=>{if(!r.ok||!r.body){s({success:!1,error:`HTTP ${r.status}`});return}const a=r.body.getReader(),n=new TextDecoder;let y="";for(;;){const{done:w,value:p}=await a.read();if(w)break;y+=n.decode(p,{stream:!0});const u=y.split(`
4
4
  `);y=u.pop()||"";let f="";for(const c of u)if(c.startsWith("event: "))f=c.slice(7).trim();else if(c.startsWith("data: ")){const m=JSON.parse(c.slice(6));if(f==="progress")(m.stage==="downloading"||m.stage==="importing")&&t?.({stage:m.stage});else if(f==="result"){s(m);return}f=""}}s({success:!1,error:"Stream ended without result"})}).catch(r=>s({success:!1,error:String(r)}))})}async analyzeIncrementalImport(e,t){if(typeof t=="string")return{newMessageCount:0,duplicateCount:0,totalInFile:0,error:"File path not supported in Web mode"};const o=new FormData;o.append("file",t);const s=await d(`${l()}/sessions/${e}/import/incremental/analyze`,{method:"POST",body:o});if(!s.ok){const r=await s.text();return{newMessageCount:0,duplicateCount:0,totalInFile:0,error:`HTTP ${s.status}: ${r}`}}return await s.json()}async incrementalImport(e,t,o){if(typeof t=="string")return{success:!1,newMessageCount:0,error:"File path not supported in Web mode"};const s=new FormData;s.append("file",t);const r=await d(`${l()}/sessions/${e}/import/incremental`,{method:"POST",body:s});if(!r.ok){const a=await r.text();return{success:!1,newMessageCount:0,error:`HTTP ${r.status}: ${a}`}}return S(r,{success:!1,newMessageCount:0,error:"Unknown error"},o)}async importDirectory(e,t,o){if(typeof e=="string")return{success:!1,error:"Directory path import is not supported in Web mode"};if(e.length===0)return{success:!1,error:"No files in directory"};const s=new FormData;for(const a of e)s.append("files",a),s.append("relativePaths",a.webkitRelativePath||a.name);t?.sessionGapThreshold!==void 0&&s.append("sessionGapThreshold",String(t.sessionGapThreshold));const r=await d(`${l()}/import-directory`,{method:"POST",body:s});if(!r.ok){const a=await r.text();return{success:!1,error:`HTTP ${r.status}: ${a}`}}return g(await S(r,{success:!1,error:"Unknown error"},o))}}function x(i,e,t){const o=i[e]?.id??String(e);return t?.status==="cancelled"?{id:o,status:"cancelled"}:t?.status==="success"?{id:o,status:"success",result:g(t.result)}:{id:o,status:"failed",error:t?.error??t?.result?.error??"error.import_failed",result:t?.result?g(t.result):void 0}}export{B as FetchImportAdapter};
@@ -1 +1 @@
1
- import{S as t,V as e}from"./index-bQ9oj54q.js";import"./vendor-snapdom--nZvo8Sg.js";class o{async getInfo(){return t("/cache/info")}async clear(a){return e("/cache/clear",{cacheId:a})}async getDataDir(){return t("/cache/data-dir")}async setDataDir(a,r=!0){return e("/cache/data-dir",{path:a,migrate:r})}async openDataDirCleanup(a){return e("/cache/data-dir/cleanup/open",{cleanupId:a})}async dismissDataDirCleanupNotice(a){return e("/cache/data-dir/cleanup/dismiss",{cleanupId:a})}async deleteDataDirCleanup(a){return e("/cache/data-dir/cleanup/delete",{cleanupId:a})}async getLatestImportLog(){return t("/cache/latest-import-log")}async saveToDownloads(a,r){return e("/cache/save-to-downloads",{filename:a,dataUrl:r})}async openDir(a){return e("/cache/open-dir",{cacheId:a})}async showInFolder(a){return e("/cache/show-in-folder",{filePath:a})}}export{o as FetchCacheAdapter};
1
+ import{S as t,V as e}from"./index-D07viL9P.js";import"./vendor-snapdom--nZvo8Sg.js";class o{async getInfo(){return t("/cache/info")}async clear(a){return e("/cache/clear",{cacheId:a})}async getDataDir(){return t("/cache/data-dir")}async setDataDir(a,r=!0){return e("/cache/data-dir",{path:a,migrate:r})}async openDataDirCleanup(a){return e("/cache/data-dir/cleanup/open",{cleanupId:a})}async dismissDataDirCleanupNotice(a){return e("/cache/data-dir/cleanup/dismiss",{cleanupId:a})}async deleteDataDirCleanup(a){return e("/cache/data-dir/cleanup/delete",{cleanupId:a})}async getLatestImportLog(){return t("/cache/latest-import-log")}async saveToDownloads(a,r){return e("/cache/save-to-downloads",{filename:a,dataUrl:r})}async openDir(a){return e("/cache/open-dir",{cacheId:a})}async showInFolder(a){return e("/cache/show-in-folder",{filePath:a})}}export{o as FetchCacheAdapter};
@@ -1 +1 @@
1
- import{S as a,V as t,W as n,T as e}from"./index-bQ9oj54q.js";import"./vendor-snapdom--nZvo8Sg.js";class o{async getAll(){return a("/ai/assistants")}async getConfig(s){try{return await a(`/ai/assistants/${s}`)}catch{return null}}async create(s){return t("/ai/assistants",s)}async update(s,r){return n(`/ai/assistants/${s}`,r)}async delete(s){return e(`/ai/assistants/${s}`)}async reset(s){return t(`/ai/assistants/${s}/reset`,{})}async getUpgradeInfo(s){return a(`/ai/assistants/${s}/upgrade-status`)}async upgradeWithBackup(s,r){return t(`/ai/assistants/${s}/upgrade`,{backupName:r})}async importFromMd(s){return t("/ai/assistants/import",{rawMd:s})}async getBuiltinToolCatalog(){return a("/ai/tools/catalog")}}export{o as FetchAssistantAdapter};
1
+ import{S as a,V as t,W as n,T as e}from"./index-D07viL9P.js";import"./vendor-snapdom--nZvo8Sg.js";class o{async getAll(){return a("/ai/assistants")}async getConfig(s){try{return await a(`/ai/assistants/${s}`)}catch{return null}}async create(s){return t("/ai/assistants",s)}async update(s,r){return n(`/ai/assistants/${s}`,r)}async delete(s){return e(`/ai/assistants/${s}`)}async reset(s){return t(`/ai/assistants/${s}/reset`,{})}async getUpgradeInfo(s){return a(`/ai/assistants/${s}/upgrade-status`)}async upgradeWithBackup(s,r){return t(`/ai/assistants/${s}/upgrade`,{backupName:r})}async importFromMd(s){return t("/ai/assistants/import",{rawMd:s})}async getBuiltinToolCatalog(){return a("/ai/tools/catalog")}}export{o as FetchAssistantAdapter};
@@ -1,4 +1,4 @@
1
- import{Z as r,$ as m}from"./index-bQ9oj54q.js";import"./vendor-snapdom--nZvo8Sg.js";function u(){return m("data")}const c=`(SELECT mc.message_id FROM message_context mc
1
+ import{Z as r,$ as m}from"./index-D07viL9P.js";import"./vendor-snapdom--nZvo8Sg.js";function u(){return m("data")}const c=`(SELECT mc.message_id FROM message_context mc
2
2
  JOIN message first_msg ON first_msg.id = mc.message_id
3
3
  WHERE mc.segment_id = segment.id ORDER BY first_msg.ts ASC, first_msg.id ASC LIMIT 1) as firstMessageId`;class l{async generate(s,t=1800){const e=await r(`/_web/sessions/${s}/generate-index`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({gapThreshold:t})});if(!e.ok)throw new Error(`Failed to generate session index: ${e.status}`);return(await e.json()).sessionCount}async generateIncremental(s,t=1800){const e=await r(`/_web/sessions/${s}/generate-incremental-index`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({gapThreshold:t})});if(!e.ok)throw new Error(`Failed to generate incremental session index: ${e.status}`);return(await e.json()).sessionCount}async hasIndex(s){return(await this.getStats(s)).hasIndex}async getStats(s){try{const e=(await u().pluginQuery(s,"SELECT COUNT(*) as cnt FROM segment",[]))[0]?.cnt??0;return{hasIndex:e>0,sessionCount:e,gapThreshold:1800}}catch{return{hasIndex:!1,sessionCount:0,gapThreshold:1800}}}async getAllIndexStats(){const s=await r("/_web/sessions/index-stats");return s.ok?await s.json():[]}async clear(s){return await r(`/_web/sessions/${s}/clear-index`,{method:"POST"}),!0}async updateGapThreshold(s,t){return!0}async getSessions(s){return u().pluginQuery(s,`SELECT id, start_ts as startTs, end_ts as endTs, message_count as messageCount, summary,
4
4
  summary_message_count as summaryMessageCount, ${c}
@@ -1 +1 @@
1
- import{S as t,W as o,T as r}from"./index-bQ9oj54q.js";import"./vendor-snapdom--nZvo8Sg.js";class u{load(){return t("/navigation-layout")}save(a){return o("/navigation-layout",a)}reset(){return r("/navigation-layout")}}export{u as FetchNavigationLayoutAdapter};
1
+ import{S as t,W as o,T as r}from"./index-D07viL9P.js";import"./vendor-snapdom--nZvo8Sg.js";class u{load(){return t("/navigation-layout")}save(a){return o("/navigation-layout",a)}reset(){return r("/navigation-layout")}}export{u as FetchNavigationLayoutAdapter};
@@ -1 +1 @@
1
- import{S as r,U as n}from"./index-bQ9oj54q.js";import"./vendor-snapdom--nZvo8Sg.js";class a{getPresentationPreferences(){return r("/preferences/bootstrap")}getPreferences(){return r("/preferences")}savePreferences(e){return n("/preferences",e)}getUiConfig(){return r("/preferences/ui-config")}saveUiConfig(e){return n("/preferences/ui-config",e)}async getLocale(){return(await r("/preferences/locale")).lang}saveLocale(e){return n("/preferences/locale",{lang:e})}}export{a as FetchPreferencesAdapter};
1
+ import{S as r,U as n}from"./index-D07viL9P.js";import"./vendor-snapdom--nZvo8Sg.js";class a{getPresentationPreferences(){return r("/preferences/bootstrap")}getPreferences(){return r("/preferences")}savePreferences(e){return n("/preferences",e)}getUiConfig(){return r("/preferences/ui-config")}saveUiConfig(e){return n("/preferences/ui-config",e)}async getLocale(){return(await r("/preferences/locale")).lang}saveLocale(e){return n("/preferences/locale",{lang:e})}}export{a as FetchPreferencesAdapter};
@@ -1 +1 @@
1
- import{S as r,V as a,W as u,T as m,Z as y}from"./index-bQ9oj54q.js";import"./vendor-snapdom--nZvo8Sg.js";const g="This feature is not available in web mode";class A{async getAIChat(e){try{return await r(`/ai/chats/${e}`)}catch{return null}}async getAIChats(e){return r(`/ai/chats?sessionId=${encodeURIComponent(e)}`)}async getGlobalAIChats(){return r("/ai/global-chats")}async createAIChat(e,t,s){return a("/ai/chats",{sessionId:e,title:t,assistantId:s})}async createGlobalAIChat(e,t){return a("/ai/global-chats",{title:e,assistantId:t})}async updateAIChatTitle(e,t){return u(`/ai/chats/${e}/title`,{title:t})}async deleteAIChat(e){return m(`/ai/chats/${e}`)}async getAIMemories(e){if(!e)return r("/ai/memories");const t=new URLSearchParams({scopeType:e.scopeType});return e.scopeId&&t.set("scopeId",e.scopeId),r(`/ai/memories?${t.toString()}`)}async createAIMemory(e){return a("/ai/memories",e)}async updateAIMemory(e,t){return u(`/ai/memories/${e}`,{content:t})}async deleteAIMemory(e){return m(`/ai/memories/${e}`)}async clearAIMemories(e){return a("/ai/memories/clear",e)}async linkAIMemorySources(e){return a("/ai/memories/link-sources",e)}async getMessages(e){return r(`/ai/chats/${e}/messages`)}async addMessagePair(e,t,s){return a(`/ai/chats/${e}/message-pair`,{userMessage:t,assistantMessage:s})}async replaceLatestMessageRound(e,t){return a(`/ai/chats/${e}/replace-latest-message-round`,t)}async addMessage(e,t,s,c,n,o,i,l){return a(`/ai/chats/${e}/messages`,{role:t,content:s,dataKeywords:c,dataMessageCount:n,contentBlocks:o,tokenUsage:i,entityRefs:l})}async deleteMessagesFrom(e,t){return a(`/ai/chats/${e}/messages/${t}/delete-from`,{})}async forkAIChat(e,t,s){return a(`/ai/chats/${e}/fork`,{upToMessageId:t,title:s})}async updateMessageContent(e,t,s){await u(`/ai/messages/${e}/content`,{content:t,entityRefs:s})}async deleteAndRelinkMessage(e,t){await a(`/ai/chats/${e}/messages/${t}/delete-relink`,{})}async insertMessageAfter(e,t,s,c,n,o,i){return a(`/ai/chats/${e}/messages/insert-after`,{afterMessageId:t,role:s,content:c,contentBlocks:n,tokenUsage:o,entityRefs:i})}async getAIChatTokenUsage(e){return r(`/ai/chats/${e}/token-usage`)}async estimateContextTokens(e){try{return await r(`/ai/chats/${e}/estimate-tokens`)}catch(t){return{success:!1,tokens:0,error:t instanceof Error?t.message:String(t)}}}async exportFilterResultToFile(e){try{const t=await y(`/_web/sessions/${e.sessionId}/export`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionName:e.sessionName,format:e.format||"txt",timeFilter:e.timeFilter})});if(!t.ok)return{success:!1,error:(await t.json().catch(()=>null))?.error||`HTTP ${t.status}`};const s=await t.blob(),c=t.headers.get("Content-Disposition")?.match(/filename="?(.+?)"?$/)?.[1]||`${e.sessionName}_export.txt`,n=URL.createObjectURL(s),o=document.createElement("a");return o.href=n,o.download=decodeURIComponent(c),o.click(),URL.revokeObjectURL(n),{success:!0}}catch(t){return{success:!1,error:t instanceof Error?t.message:String(t)}}}onExportProgress(e){return()=>{}}async executeAiSQL(e){return a("/ai/debug/execute-sql",{sql:e})}async getAiSchema(){return r("/ai/debug/schema")}async clearDebugContext(){return a("/ai/debug/clear-debug-context",{})}async getToolCatalog(){try{return await r("/ai/tools/full-catalog")}catch{return r("/ai/tools/catalog")}}async executeTool(e,t,s,c){try{return await a("/ai/tools/execute",{testId:e,toolName:t,params:s,sessionId:c})}catch(n){return{success:!1,error:String(n)}}}async cancelToolTest(e){try{return await a("/ai/tools/cancel",{testId:e})}catch{return{success:!1}}}async getDefaultDesensitizeRules(e){try{return await r(`/ai/desensitize-rules/defaults?locale=${encodeURIComponent(e)}`)}catch{return[]}}async mergeDesensitizeRules(e,t,s={}){try{return await a("/ai/desensitize-rules/merge",{existingRules:e,locale:t,overrides:s})}catch{return e}}async showAiLogFile(){try{return await a("/ai/logs/show")}catch(e){return{success:!1,error:e instanceof Error?e.message:g}}}}export{A as FetchAIAdapter};
1
+ import{S as r,V as a,W as u,T as m,Z as y}from"./index-D07viL9P.js";import"./vendor-snapdom--nZvo8Sg.js";const g="This feature is not available in web mode";class A{async getAIChat(e){try{return await r(`/ai/chats/${e}`)}catch{return null}}async getAIChats(e){return r(`/ai/chats?sessionId=${encodeURIComponent(e)}`)}async getGlobalAIChats(){return r("/ai/global-chats")}async createAIChat(e,t,s){return a("/ai/chats",{sessionId:e,title:t,assistantId:s})}async createGlobalAIChat(e,t){return a("/ai/global-chats",{title:e,assistantId:t})}async updateAIChatTitle(e,t){return u(`/ai/chats/${e}/title`,{title:t})}async deleteAIChat(e){return m(`/ai/chats/${e}`)}async getAIMemories(e){if(!e)return r("/ai/memories");const t=new URLSearchParams({scopeType:e.scopeType});return e.scopeId&&t.set("scopeId",e.scopeId),r(`/ai/memories?${t.toString()}`)}async createAIMemory(e){return a("/ai/memories",e)}async updateAIMemory(e,t){return u(`/ai/memories/${e}`,{content:t})}async deleteAIMemory(e){return m(`/ai/memories/${e}`)}async clearAIMemories(e){return a("/ai/memories/clear",e)}async linkAIMemorySources(e){return a("/ai/memories/link-sources",e)}async getMessages(e){return r(`/ai/chats/${e}/messages`)}async addMessagePair(e,t,s){return a(`/ai/chats/${e}/message-pair`,{userMessage:t,assistantMessage:s})}async replaceLatestMessageRound(e,t){return a(`/ai/chats/${e}/replace-latest-message-round`,t)}async addMessage(e,t,s,c,n,o,i,l){return a(`/ai/chats/${e}/messages`,{role:t,content:s,dataKeywords:c,dataMessageCount:n,contentBlocks:o,tokenUsage:i,entityRefs:l})}async deleteMessagesFrom(e,t){return a(`/ai/chats/${e}/messages/${t}/delete-from`,{})}async forkAIChat(e,t,s){return a(`/ai/chats/${e}/fork`,{upToMessageId:t,title:s})}async updateMessageContent(e,t,s){await u(`/ai/messages/${e}/content`,{content:t,entityRefs:s})}async deleteAndRelinkMessage(e,t){await a(`/ai/chats/${e}/messages/${t}/delete-relink`,{})}async insertMessageAfter(e,t,s,c,n,o,i){return a(`/ai/chats/${e}/messages/insert-after`,{afterMessageId:t,role:s,content:c,contentBlocks:n,tokenUsage:o,entityRefs:i})}async getAIChatTokenUsage(e){return r(`/ai/chats/${e}/token-usage`)}async estimateContextTokens(e){try{return await r(`/ai/chats/${e}/estimate-tokens`)}catch(t){return{success:!1,tokens:0,error:t instanceof Error?t.message:String(t)}}}async exportFilterResultToFile(e){try{const t=await y(`/_web/sessions/${e.sessionId}/export`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionName:e.sessionName,format:e.format||"txt",timeFilter:e.timeFilter})});if(!t.ok)return{success:!1,error:(await t.json().catch(()=>null))?.error||`HTTP ${t.status}`};const s=await t.blob(),c=t.headers.get("Content-Disposition")?.match(/filename="?(.+?)"?$/)?.[1]||`${e.sessionName}_export.txt`,n=URL.createObjectURL(s),o=document.createElement("a");return o.href=n,o.download=decodeURIComponent(c),o.click(),URL.revokeObjectURL(n),{success:!0}}catch(t){return{success:!1,error:t instanceof Error?t.message:String(t)}}}onExportProgress(e){return()=>{}}async executeAiSQL(e){return a("/ai/debug/execute-sql",{sql:e})}async getAiSchema(){return r("/ai/debug/schema")}async clearDebugContext(){return a("/ai/debug/clear-debug-context",{})}async getToolCatalog(){try{return await r("/ai/tools/full-catalog")}catch{return r("/ai/tools/catalog")}}async executeTool(e,t,s,c){try{return await a("/ai/tools/execute",{testId:e,toolName:t,params:s,sessionId:c})}catch(n){return{success:!1,error:String(n)}}}async cancelToolTest(e){try{return await a("/ai/tools/cancel",{testId:e})}catch{return{success:!1}}}async getDefaultDesensitizeRules(e){try{return await r(`/ai/desensitize-rules/defaults?locale=${encodeURIComponent(e)}`)}catch{return[]}}async mergeDesensitizeRules(e,t,s={}){try{return await a("/ai/desensitize-rules/merge",{existingRules:e,locale:t,overrides:s})}catch{return e}}async showAiLogFile(){try{return await a("/ai/logs/show")}catch(e){return{success:!1,error:e instanceof Error?e.message:g}}}}export{A as FetchAIAdapter};
@@ -1 +1 @@
1
- import{S as s,W as l,V as o,T as i}from"./index-bQ9oj54q.js";import"./vendor-snapdom--nZvo8Sg.js";class g{async hasConfig(){return s("/ai/llm/has-config")}async getConfigStore(){return s("/ai/llm/configs")}async getAllConfigs(){return(await this.getConfigStore()).configs}async getDefaultAssistantSlot(){return s("/ai/llm/default-assistant-slot")}async getFastModelSlot(){return s("/ai/llm/fast-model-slot")}async setDefaultAssistantModel(e,t){return l("/ai/llm/default-assistant-slot",{configId:e,modelId:t})}async setFastModel(e){return l("/ai/llm/fast-model-slot",e)}async getProviders(){return s("/ai/llm/providers")}async getProviderRegistry(){return s("/ai/llm/provider-registry")}async getModelCatalog(){return s("/ai/llm/model-catalog")}async addConfig(e){return o("/ai/llm/configs",e)}async updateConfig(e,t){return l(`/ai/llm/configs/${e}`,t)}async deleteConfig(e){return i(`/ai/llm/configs/${e}`)}async validateApiKey(e,t,a,r,n,m){return o("/ai/llm/validate-key",{provider:e,apiKey:t,baseUrl:a,model:r,apiFormat:n,configId:m})}async fetchRemoteModels(e,t,a,r,n){return o("/ai/llm/remote-models",{provider:e,apiKey:t,baseUrl:a,apiFormat:r,configId:n})}async addCustomProvider(e){return o("/ai/llm/custom-providers",e)}async updateCustomProvider(e,t){return l(`/ai/llm/custom-providers/${e}`,t)}async deleteCustomProvider(e){return i(`/ai/llm/custom-providers/${e}`)}async addCustomModel(e){return o("/ai/llm/custom-models",e)}async updateCustomModel(e,t,a){return l(`/ai/llm/custom-models/${e}/${encodeURIComponent(t)}`,a)}async deleteCustomModel(e,t){return i(`/ai/llm/custom-models/${e}/${encodeURIComponent(t)}`)}}export{g as FetchLLMAdapter};
1
+ import{S as s,W as l,V as o,T as i}from"./index-D07viL9P.js";import"./vendor-snapdom--nZvo8Sg.js";class g{async hasConfig(){return s("/ai/llm/has-config")}async getConfigStore(){return s("/ai/llm/configs")}async getAllConfigs(){return(await this.getConfigStore()).configs}async getDefaultAssistantSlot(){return s("/ai/llm/default-assistant-slot")}async getFastModelSlot(){return s("/ai/llm/fast-model-slot")}async setDefaultAssistantModel(e,t){return l("/ai/llm/default-assistant-slot",{configId:e,modelId:t})}async setFastModel(e){return l("/ai/llm/fast-model-slot",e)}async getProviders(){return s("/ai/llm/providers")}async getProviderRegistry(){return s("/ai/llm/provider-registry")}async getModelCatalog(){return s("/ai/llm/model-catalog")}async addConfig(e){return o("/ai/llm/configs",e)}async updateConfig(e,t){return l(`/ai/llm/configs/${e}`,t)}async deleteConfig(e){return i(`/ai/llm/configs/${e}`)}async validateApiKey(e,t,a,r,n,m){return o("/ai/llm/validate-key",{provider:e,apiKey:t,baseUrl:a,model:r,apiFormat:n,configId:m})}async fetchRemoteModels(e,t,a,r,n){return o("/ai/llm/remote-models",{provider:e,apiKey:t,baseUrl:a,apiFormat:r,configId:n})}async addCustomProvider(e){return o("/ai/llm/custom-providers",e)}async updateCustomProvider(e,t){return l(`/ai/llm/custom-providers/${e}`,t)}async deleteCustomProvider(e){return i(`/ai/llm/custom-providers/${e}`)}async addCustomModel(e){return o("/ai/llm/custom-models",e)}async updateCustomModel(e,t,a){return l(`/ai/llm/custom-models/${e}/${encodeURIComponent(t)}`,a)}async deleteCustomModel(e,t){return i(`/ai/llm/custom-models/${e}/${encodeURIComponent(t)}`)}}export{g as FetchLLMAdapter};
@@ -1 +1 @@
1
- import{S as c,T as o,U as l,V as m,W as $,X as a,Y as y}from"./index-bQ9oj54q.js";import"./vendor-snapdom--nZvo8Sg.js";function S(i,e){e&&(e.startTs&&i.set("startTs",String(e.startTs)),e.endTs&&i.set("endTs",String(e.endTs)),e.memberId&&i.set("memberId",String(e.memberId)))}function n(i){const e=new URLSearchParams;S(e,i);const s=e.toString();return s?`?${s}`:""}function u(i){const e=new URLSearchParams;i?.mode&&e.set("mode",i.mode),i?.year&&e.set("year",String(i.year)),i?.days&&e.set("days",String(i.days)),i?.acceptStale&&e.set("acceptStale","1");const s=e.toString();return s?`?${s}`:""}class h{getSessions(){return c("/sessions")}getSession(e){return c(`/sessions/${e}`)}async deleteSession(e){return(await o(`/sessions/${e}`)).success}async renameSession(e,s){return(await l(`/sessions/${e}/name`,{name:s})).success}async updateSessionOwnerId(e,s){return(await l(`/sessions/${e}/owner`,{ownerId:s})).success}tryApplyOwnerProfile(e){return m(`/sessions/${e}/owner/apply-profile`,{})}setOwnerAndApplyProfile(e,s){return m(`/sessions/${e}/owner/select`,{ownerPlatformId:s})}async excludeOwnerSession(e){return(await m(`/sessions/${e}/owner/exclude`,{})).success}getContacts(e){const s=new URLSearchParams;e?.acceptStale&&s.set("acceptStale","1"),e?.timeRangePreset&&s.set("timeRange",e.timeRangePreset),e?.pool&&s.set("pool",e.pool),e?.page&&s.set("page",String(e.page)),e?.pageSize&&s.set("pageSize",String(e.pageSize)),e?.query&&s.set("q",e.query);const t=s.toString();return c(`/contacts${t?`?${t}`:""}`)}getContactDetail(e,s){const t=new URLSearchParams;s?.acceptStale&&t.set("acceptStale","1"),s?.timeRangePreset&&t.set("timeRange",s.timeRangePreset);const r=t.toString();return c(`/contacts/${encodeURIComponent(e)}/detail${r?`?${r}`:""}`)}recomputeContacts(e){const s=new URLSearchParams;e?.timeRangePreset&&s.set("timeRange",e.timeRangePreset),e?.pool&&s.set("pool",e.pool),e?.page&&s.set("page",String(e.page)),e?.pageSize&&s.set("pageSize",String(e.pageSize)),e?.query&&s.set("q",e.query);const t=s.toString();return m(`/contacts/recompute${t?`?${t}`:""}`,{})}async markContactAsFriend(e,s){const t=new URLSearchParams;s?.timeRangePreset&&t.set("timeRange",s.timeRangePreset);const r=t.toString();return(await $(`/contacts/${encodeURIComponent(e)}/mark-friend${r?`?${r}`:""}`)).success}async unmarkContactAsFriend(e,s){const t=new URLSearchParams;s?.timeRangePreset&&t.set("timeRange",s.timeRangePreset);const r=t.toString();return(await o(`/contacts/${encodeURIComponent(e)}/mark-friend${r?`?${r}`:""}`)).success}getPeopleRelationships(e){const s=new URLSearchParams;e?.acceptStale&&s.set("acceptStale","1"),e?.timeRangePreset&&s.set("timeRange",e.timeRangePreset),e?.graphScope&&s.set("scope",e.graphScope),e?.query&&s.set("q",e.query);const t=s.toString();return c(`/people/relationships${t?`?${t}`:""}`)}recomputePeopleRelationships(e){const s=new URLSearchParams;e?.timeRangePreset&&s.set("timeRange",e.timeRangePreset),e?.graphScope&&s.set("scope",e.graphScope),e?.query&&s.set("q",e.query);const t=s.toString();return m(`/people/relationships/recompute${t?`?${t}`:""}`,{})}getPeopleRelationshipNeighborhood(e,s){const t=new URLSearchParams;s?.acceptStale&&t.set("acceptStale","1"),s?.timeRangePreset&&t.set("timeRange",s.timeRangePreset),s?.graphScope&&t.set("scope",s.graphScope);const r=t.toString();return c(`/people/relationships/${encodeURIComponent(e)}/neighborhood${r?`?${r}`:""}`)}getAnnualSummary(e){return c(`/global-insight/annual-summary${u(e)}`)}recomputeAnnualSummary(e){return m(`/global-insight/annual-summary/recompute${u(e)}`,{})}getTimeInvestment(e){return c(`/global-insight/time-investment${u(e)}`)}recomputeTimeInvestment(e){return m(`/global-insight/time-investment/recompute${u(e)}`,{})}getAvailableYears(e){return c(`/sessions/${e}/years`)}getTimeRange(e){return c(`/sessions/${e}/time-range`)}getMemberActivity(e,s){return a(`/sessions/${e}/stats/member-activity${n(s)}`)}getHourlyActivity(e,s){return a(`/sessions/${e}/stats/hourly${n(s)}`)}getDailyActivity(e,s){return a(`/sessions/${e}/stats/daily${n(s)}`)}getWeekdayActivity(e,s){return a(`/sessions/${e}/stats/weekday${n(s)}`)}getMonthlyActivity(e,s){return a(`/sessions/${e}/analytics/monthly-activity${n(s)}`)}getYearlyActivity(e,s){return a(`/sessions/${e}/analytics/yearly-activity${n(s)}`)}getMessageLengthDistribution(e,s){return a(`/sessions/${e}/analytics/message-length-distribution${n(s)}`)}getMessageTypeDistribution(e,s){return a(`/sessions/${e}/stats/message-types${n(s)}`)}getTextStats(e,s){return a(`/sessions/${e}/analytics/text-stats${n(s)}`)}getLongMessageCount(e,s,t){const r=new URLSearchParams;s?.startTs&&r.set("startTs",String(s.startTs)),s?.endTs&&r.set("endTs",String(s.endTs)),s?.memberId&&r.set("memberId",String(s.memberId)),t!=null&&r.set("minLength",String(t));const g=r.toString();return a(`/sessions/${e}/analytics/long-message-count${g?`?${g}`:""}`)}getMemberMonthlyTrend(e,s){return a(`/sessions/${e}/analytics/member-monthly-trend${n(s)}`)}getTextLengthPercentiles(e,s){return a(`/sessions/${e}/analytics/text-length-percentiles${n(s)}`)}getWordFrequency(e,s){return y("/nlp/word-frequency",{sessionId:e,...s})}getDragonKingAnalysis(e,s){return a(`/sessions/${e}/analytics/dragon-king${n(s)}`)}getDivingAnalysis(e,s){return a(`/sessions/${e}/analytics/diving${n(s)}`)}getCheckInAnalysis(e,s){return a(`/sessions/${e}/analytics/check-in${n(s)}`)}getMemeBattleAnalysis(e,s){return a(`/sessions/${e}/analytics/meme-battle${n(s)}`)}getNightOwlAnalysis(e,s){return a(`/sessions/${e}/analytics/night-owl${n(s)}`)}getRepeatAnalysis(e,s){return a(`/sessions/${e}/analytics/repeat${n(s)}`)}getMembers(e){return c(`/sessions/${e}/members`)}getMembersPaginated(e,s){const t=new URLSearchParams({page:String(s.page),pageSize:String(s.pageSize)});return s.search&&t.set("search",s.search),s.sortOrder&&t.set("sortOrder",s.sortOrder),c(`/sessions/${e}/members/paginated?${t}`)}getMemberNameHistory(e,s){return c(`/sessions/${e}/members/${s}/history`)}async updateMemberAliases(e,s,t){return(await l(`/sessions/${e}/members/${s}/aliases`,{aliases:t})).success}async mergeMembers(e,s,t){return(await m(`/sessions/${e}/members/merge`,{memberId1:s,memberId2:t})).success}async deleteMember(e,s){return(await o(`/sessions/${e}/members/${s}`)).success}async deleteMembers(e,s){return(await m(`/sessions/${e}/members/batch-delete`,{memberIds:s})).success}getCatchphraseAnalysis(e,s){return a(`/sessions/${e}/analytics/catchphrase${n(s)}`)}getLanguagePreferenceAnalysis(e,s,t,r){const g=new URLSearchParams;return g.set("locale",s),t?.startTs&&g.set("startTs",String(t.startTs)),t?.endTs&&g.set("endTs",String(t.endTs)),t?.memberId&&g.set("memberId",String(t.memberId)),a(`/sessions/${e}/analytics/language-preference?${g}`)}getMentionAnalysis(e,s){return a(`/sessions/${e}/analytics/mention${n(s)}`)}getGroupRelationshipGalaxy(e,s){return a(`/sessions/${e}/analytics/relationship-galaxy${n(s)}`)}getClusterGraph(e,s,t){const r=new URLSearchParams;s?.startTs&&r.set("startTs",String(s.startTs)),s?.endTs&&r.set("endTs",String(s.endTs)),s?.memberId&&r.set("memberId",String(s.memberId)),t?.topEdges&&r.set("topEdges",String(t.topEdges)),t?.lookAhead&&r.set("lookAhead",String(t.lookAhead)),t?.decaySeconds&&r.set("decaySeconds",String(t.decaySeconds));const g=r.toString();return a(`/sessions/${e}/analytics/cluster${g?`?${g}`:""}`)}getLaughAnalysis(e,s,t){return y(`/sessions/${e}/analytics/laugh${n(s)}`,{keywords:t??[]})}getRelationshipStats(e,s,t){return a(`/sessions/${e}/analytics/relationship${n(s)}`)}getJourneyStats(e,s){return a(`/sessions/${e}/analytics/journey${n(s)}`)}executeSQL(e,s){return m(`/sessions/${e}/sql`,{sql:s})}getSchema(e){return c(`/sessions/${e}/schema`)}pluginQuery(e,s,t){return m(`/sessions/${e}/query`,{sql:s,params:t??[]})}}export{h as FetchDataAdapter};
1
+ import{S as c,T as o,U as l,V as m,W as $,X as a,Y as y}from"./index-D07viL9P.js";import"./vendor-snapdom--nZvo8Sg.js";function S(i,e){e&&(e.startTs&&i.set("startTs",String(e.startTs)),e.endTs&&i.set("endTs",String(e.endTs)),e.memberId&&i.set("memberId",String(e.memberId)))}function n(i){const e=new URLSearchParams;S(e,i);const s=e.toString();return s?`?${s}`:""}function u(i){const e=new URLSearchParams;i?.mode&&e.set("mode",i.mode),i?.year&&e.set("year",String(i.year)),i?.days&&e.set("days",String(i.days)),i?.acceptStale&&e.set("acceptStale","1");const s=e.toString();return s?`?${s}`:""}class h{getSessions(){return c("/sessions")}getSession(e){return c(`/sessions/${e}`)}async deleteSession(e){return(await o(`/sessions/${e}`)).success}async renameSession(e,s){return(await l(`/sessions/${e}/name`,{name:s})).success}async updateSessionOwnerId(e,s){return(await l(`/sessions/${e}/owner`,{ownerId:s})).success}tryApplyOwnerProfile(e){return m(`/sessions/${e}/owner/apply-profile`,{})}setOwnerAndApplyProfile(e,s){return m(`/sessions/${e}/owner/select`,{ownerPlatformId:s})}async excludeOwnerSession(e){return(await m(`/sessions/${e}/owner/exclude`,{})).success}getContacts(e){const s=new URLSearchParams;e?.acceptStale&&s.set("acceptStale","1"),e?.timeRangePreset&&s.set("timeRange",e.timeRangePreset),e?.pool&&s.set("pool",e.pool),e?.page&&s.set("page",String(e.page)),e?.pageSize&&s.set("pageSize",String(e.pageSize)),e?.query&&s.set("q",e.query);const t=s.toString();return c(`/contacts${t?`?${t}`:""}`)}getContactDetail(e,s){const t=new URLSearchParams;s?.acceptStale&&t.set("acceptStale","1"),s?.timeRangePreset&&t.set("timeRange",s.timeRangePreset);const r=t.toString();return c(`/contacts/${encodeURIComponent(e)}/detail${r?`?${r}`:""}`)}recomputeContacts(e){const s=new URLSearchParams;e?.timeRangePreset&&s.set("timeRange",e.timeRangePreset),e?.pool&&s.set("pool",e.pool),e?.page&&s.set("page",String(e.page)),e?.pageSize&&s.set("pageSize",String(e.pageSize)),e?.query&&s.set("q",e.query);const t=s.toString();return m(`/contacts/recompute${t?`?${t}`:""}`,{})}async markContactAsFriend(e,s){const t=new URLSearchParams;s?.timeRangePreset&&t.set("timeRange",s.timeRangePreset);const r=t.toString();return(await $(`/contacts/${encodeURIComponent(e)}/mark-friend${r?`?${r}`:""}`)).success}async unmarkContactAsFriend(e,s){const t=new URLSearchParams;s?.timeRangePreset&&t.set("timeRange",s.timeRangePreset);const r=t.toString();return(await o(`/contacts/${encodeURIComponent(e)}/mark-friend${r?`?${r}`:""}`)).success}getPeopleRelationships(e){const s=new URLSearchParams;e?.acceptStale&&s.set("acceptStale","1"),e?.timeRangePreset&&s.set("timeRange",e.timeRangePreset),e?.graphScope&&s.set("scope",e.graphScope),e?.query&&s.set("q",e.query);const t=s.toString();return c(`/people/relationships${t?`?${t}`:""}`)}recomputePeopleRelationships(e){const s=new URLSearchParams;e?.timeRangePreset&&s.set("timeRange",e.timeRangePreset),e?.graphScope&&s.set("scope",e.graphScope),e?.query&&s.set("q",e.query);const t=s.toString();return m(`/people/relationships/recompute${t?`?${t}`:""}`,{})}getPeopleRelationshipNeighborhood(e,s){const t=new URLSearchParams;s?.acceptStale&&t.set("acceptStale","1"),s?.timeRangePreset&&t.set("timeRange",s.timeRangePreset),s?.graphScope&&t.set("scope",s.graphScope);const r=t.toString();return c(`/people/relationships/${encodeURIComponent(e)}/neighborhood${r?`?${r}`:""}`)}getAnnualSummary(e){return c(`/global-insight/annual-summary${u(e)}`)}recomputeAnnualSummary(e){return m(`/global-insight/annual-summary/recompute${u(e)}`,{})}getTimeInvestment(e){return c(`/global-insight/time-investment${u(e)}`)}recomputeTimeInvestment(e){return m(`/global-insight/time-investment/recompute${u(e)}`,{})}getAvailableYears(e){return c(`/sessions/${e}/years`)}getTimeRange(e){return c(`/sessions/${e}/time-range`)}getMemberActivity(e,s){return a(`/sessions/${e}/stats/member-activity${n(s)}`)}getHourlyActivity(e,s){return a(`/sessions/${e}/stats/hourly${n(s)}`)}getDailyActivity(e,s){return a(`/sessions/${e}/stats/daily${n(s)}`)}getWeekdayActivity(e,s){return a(`/sessions/${e}/stats/weekday${n(s)}`)}getMonthlyActivity(e,s){return a(`/sessions/${e}/analytics/monthly-activity${n(s)}`)}getYearlyActivity(e,s){return a(`/sessions/${e}/analytics/yearly-activity${n(s)}`)}getMessageLengthDistribution(e,s){return a(`/sessions/${e}/analytics/message-length-distribution${n(s)}`)}getMessageTypeDistribution(e,s){return a(`/sessions/${e}/stats/message-types${n(s)}`)}getTextStats(e,s){return a(`/sessions/${e}/analytics/text-stats${n(s)}`)}getLongMessageCount(e,s,t){const r=new URLSearchParams;s?.startTs&&r.set("startTs",String(s.startTs)),s?.endTs&&r.set("endTs",String(s.endTs)),s?.memberId&&r.set("memberId",String(s.memberId)),t!=null&&r.set("minLength",String(t));const g=r.toString();return a(`/sessions/${e}/analytics/long-message-count${g?`?${g}`:""}`)}getMemberMonthlyTrend(e,s){return a(`/sessions/${e}/analytics/member-monthly-trend${n(s)}`)}getTextLengthPercentiles(e,s){return a(`/sessions/${e}/analytics/text-length-percentiles${n(s)}`)}getWordFrequency(e,s){return y("/nlp/word-frequency",{sessionId:e,...s})}getDragonKingAnalysis(e,s){return a(`/sessions/${e}/analytics/dragon-king${n(s)}`)}getDivingAnalysis(e,s){return a(`/sessions/${e}/analytics/diving${n(s)}`)}getCheckInAnalysis(e,s){return a(`/sessions/${e}/analytics/check-in${n(s)}`)}getMemeBattleAnalysis(e,s){return a(`/sessions/${e}/analytics/meme-battle${n(s)}`)}getNightOwlAnalysis(e,s){return a(`/sessions/${e}/analytics/night-owl${n(s)}`)}getRepeatAnalysis(e,s){return a(`/sessions/${e}/analytics/repeat${n(s)}`)}getMembers(e){return c(`/sessions/${e}/members`)}getMembersPaginated(e,s){const t=new URLSearchParams({page:String(s.page),pageSize:String(s.pageSize)});return s.search&&t.set("search",s.search),s.sortOrder&&t.set("sortOrder",s.sortOrder),c(`/sessions/${e}/members/paginated?${t}`)}getMemberNameHistory(e,s){return c(`/sessions/${e}/members/${s}/history`)}async updateMemberAliases(e,s,t){return(await l(`/sessions/${e}/members/${s}/aliases`,{aliases:t})).success}async mergeMembers(e,s,t){return(await m(`/sessions/${e}/members/merge`,{memberId1:s,memberId2:t})).success}async deleteMember(e,s){return(await o(`/sessions/${e}/members/${s}`)).success}async deleteMembers(e,s){return(await m(`/sessions/${e}/members/batch-delete`,{memberIds:s})).success}getCatchphraseAnalysis(e,s){return a(`/sessions/${e}/analytics/catchphrase${n(s)}`)}getLanguagePreferenceAnalysis(e,s,t,r){const g=new URLSearchParams;return g.set("locale",s),t?.startTs&&g.set("startTs",String(t.startTs)),t?.endTs&&g.set("endTs",String(t.endTs)),t?.memberId&&g.set("memberId",String(t.memberId)),a(`/sessions/${e}/analytics/language-preference?${g}`)}getMentionAnalysis(e,s){return a(`/sessions/${e}/analytics/mention${n(s)}`)}getGroupRelationshipGalaxy(e,s){return a(`/sessions/${e}/analytics/relationship-galaxy${n(s)}`)}getClusterGraph(e,s,t){const r=new URLSearchParams;s?.startTs&&r.set("startTs",String(s.startTs)),s?.endTs&&r.set("endTs",String(s.endTs)),s?.memberId&&r.set("memberId",String(s.memberId)),t?.topEdges&&r.set("topEdges",String(t.topEdges)),t?.lookAhead&&r.set("lookAhead",String(t.lookAhead)),t?.decaySeconds&&r.set("decaySeconds",String(t.decaySeconds));const g=r.toString();return a(`/sessions/${e}/analytics/cluster${g?`?${g}`:""}`)}getLaughAnalysis(e,s,t){return y(`/sessions/${e}/analytics/laugh${n(s)}`,{keywords:t??[]})}getRelationshipStats(e,s,t){return a(`/sessions/${e}/analytics/relationship${n(s)}`)}getJourneyStats(e,s){return a(`/sessions/${e}/analytics/journey${n(s)}`)}executeSQL(e,s){return m(`/sessions/${e}/sql`,{sql:s})}getSchema(e){return c(`/sessions/${e}/schema`)}pluginQuery(e,s,t){return m(`/sessions/${e}/query`,{sql:s,params:t??[]})}}export{h as FetchDataAdapter};
@@ -1 +1 @@
1
- import{J as t,K as o,L as r}from"./index-bQ9oj54q.js";import{A as s}from"./service-DQjyjQZx.js";import"./vendor-snapdom--nZvo8Sg.js";function u(){return{get:e=>r().getAnnualSummary(e),recompute:e=>r().recomputeAnnualSummary(e),openOwnerSettings:()=>t().openSettings("data","missing-owner"),subscribeOwnerSettingsClosed:e=>{const n=t();return o(()=>n.showSettings,(a,i)=>{i&&!a&&e()})}}}function g(e){e.register(s,u())}export{u as createAnnualSummaryUiService,g as registerAnnualSummaryUiService};
1
+ import{J as t,K as o,L as r}from"./index-D07viL9P.js";import{A as s}from"./service-i_PJfTaR.js";import"./vendor-snapdom--nZvo8Sg.js";function u(){return{get:e=>r().getAnnualSummary(e),recompute:e=>r().recomputeAnnualSummary(e),openOwnerSettings:()=>t().openSettings("data","missing-owner"),subscribeOwnerSettingsClosed:e=>{const n=t();return o(()=>n.showSettings,(a,i)=>{i&&!a&&e()})}}}function g(e){e.register(s,u())}export{u as createAnnualSummaryUiService,g as registerAnnualSummaryUiService};
@@ -1 +1 @@
1
- import{J as t,K as o,L as r,Q as m}from"./index-bQ9oj54q.js";import{T as a}from"./service-Dtve_40X.js";import"./vendor-snapdom--nZvo8Sg.js";function u(){return{canConfigureOwner:!m.usesBrowserRuntime,get:e=>r().getTimeInvestment(e),recompute:e=>r().recomputeTimeInvestment(e),openOwnerSettings:()=>t().openSettings("data","missing-owner"),subscribeOwnerSettingsClosed:e=>{const n=t();return o(()=>n.showSettings,(s,i)=>{i&&!s&&e()})}}}function g(e){e.register(a,u())}export{u as createTimeInvestmentUiService,g as registerTimeInvestmentUiService};
1
+ import{J as t,K as o,L as r,Q as m}from"./index-D07viL9P.js";import{T as a}from"./service-2UJZvVpa.js";import"./vendor-snapdom--nZvo8Sg.js";function u(){return{canConfigureOwner:!m.usesBrowserRuntime,get:e=>r().getTimeInvestment(e),recompute:e=>r().recomputeTimeInvestment(e),openOwnerSettings:()=>t().openSettings("data","missing-owner"),subscribeOwnerSettingsClosed:e=>{const n=t();return o(()=>n.showSettings,(s,i)=>{i&&!s&&e()})}}}function g(e){e.register(a,u())}export{u as createTimeInvestmentUiService,g as registerTimeInvestmentUiService};
@@ -1 +1 @@
1
- import{d as k,a6 as b,aD as y,o as s,c as n,z as l,w as o,g as e,F as u,j as v,l as r,a as d,p,f as _,a8 as w,n as C,a9 as B,aE as V,k as z,aJ as N,e as m,ah as P}from"./index-bQ9oj54q.js";import{P as D}from"./PageHeader-BciykZ_-.js";import{_ as H}from"./PageTabs.vue_vue_type_script_setup_true_lang-2Xe2iUFO.js";import{p as I}from"./people-page-header-CKXRSnpl.js";import"./vendor-snapdom--nZvo8Sg.js";const E={class:"flex h-full flex-col text-gray-900 dark:bg-page-dark dark:text-gray-100",style:{"padding-top":"var(--titlebar-area-height)"}},F={key:0,class:"hidden items-center gap-5 text-[11px] sm:flex"},R={key:0,class:"h-3 w-px bg-gray-250 dark:bg-white/10"},S={class:"flex items-center gap-1.5"},T={class:"text-gray-400 dark:text-gray-500"},$={class:"font-mono font-bold text-gray-900 dark:text-white"},j=k({__name:"index",setup(J){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}=I(f);return(L,U)=>{const x=w;return s(),n("div",E,[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(H),{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",F,[(s(!0),n(u,null,v(e(t).stats,i=>(s(),n(u,{key:i.id},[i.dividerBefore?(s(),n("div",R)):r("",!0),d("div",S,[d("span",T,p(i.label),1),d("span",$,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(j,[["__scopeId","data-v-06450f37"]]);export{O as default};
1
+ import{d as k,a6 as b,aD as y,o as s,c as n,z as l,w as o,g as e,F as u,j as v,l as r,a as d,p,f as _,a8 as w,n as C,a9 as B,aE as V,k as z,aJ as N,e as m,ah as P}from"./index-D07viL9P.js";import{P as D}from"./PageHeader-C-UYITO9.js";import{_ as H}from"./PageTabs.vue_vue_type_script_setup_true_lang-BV344PR7.js";import{p as I}from"./people-page-header-DPOKmbHG.js";import"./vendor-snapdom--nZvo8Sg.js";const E={class:"flex h-full flex-col text-gray-900 dark:bg-page-dark dark:text-gray-100",style:{"padding-top":"var(--titlebar-area-height)"}},F={key:0,class:"hidden items-center gap-5 text-[11px] sm:flex"},R={key:0,class:"h-3 w-px bg-gray-250 dark:bg-white/10"},S={class:"flex items-center gap-1.5"},T={class:"text-gray-400 dark:text-gray-500"},$={class:"font-mono font-bold text-gray-900 dark:text-white"},j=k({__name:"index",setup(J){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}=I(f);return(L,U)=>{const x=w;return s(),n("div",E,[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(H),{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",F,[(s(!0),n(u,null,v(e(t).stats,i=>(s(),n(u,{key:i.id},[i.dividerBefore?(s(),n("div",R)):r("",!0),d("div",S,[d("span",T,p(i.label),1),d("span",$,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(j,[["__scopeId","data-v-06450f37"]]);export{O as default};
@@ -1 +1 @@
1
- import{e as o,b as S,d as L,a6 as q,ak as B,aD as A,ba as K,bb as U,bc as z,bd as H,K as G,al as J,o as p,c as j,z as R,w as _,f as k,g as t,a1 as O,be as E,l as Q,aE as W,k as X,aJ as Z,ah as ee}from"./index-bQ9oj54q.js";import{P as ae}from"./PageHeader-BciykZ_-.js";import{_ as F}from"./TimeSelect.vue_vue_type_script_setup_true_lang-geQAlopO.js";import{_ as te}from"./PageTabs.vue_vue_type_script_setup_true_lang-2Xe2iUFO.js";import"./vendor-snapdom--nZvo8Sg.js";import"./Select-H8Fz6RkU.js";import"./useFormControl-CNmp_2bd.js";import"./clamp-jFYhBC76.js";import"./Tabs-BXjD45rO.js";import"./Tabs-DJ5p8gb6.js";import"./RovingFocusItem-FpYwYEP_.js";import"./DatePicker.vue_vue_type_script_setup_true_lang-BYY2UmPA.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 x(i){h.value=i,s.value=null,y.value++}return{modelValue:s,componentKey:y,initialState:v,rangeSource:T,setAvailableYears:n,switchToYear:x}}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=K(),{controller:h,snapshot:y}=U(),d=z(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),x=o(()=>n.value?.defaultMode??"year"),i=o(()=>n.value?[...n.value.allowedModes]:void 0),g=se(x,i),{modelValue:r,componentKey:w,initialState:Y,rangeSource:I}=g,b=s.ui.insightScope;if(!(b instanceof H))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}),$=o(()=>(y.value.revision,h.getResolvedLayout())),D=o(()=>$.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,[R(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 min-h-[38px] 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(F,{key:`${t(w)}:${M.value}`,modelValue:t(r),"onUpdate:modelValue":c[0]||(c[0]=a=>E(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(F,{key:`${t(w)}:${M.value}`,modelValue:t(r),"onUpdate:modelValue":c[1]||(c[1]=a=>E(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"]),R(t(Z),null,{default:_(({Component:a})=>[R(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-7e7305c7"]]);export{Se as default};
1
+ import{e as o,b as S,d as L,a6 as q,ak as B,aD as A,ba as K,bb as U,bc as z,bd as H,K as G,al as J,o as p,c as j,z as R,w as _,f as k,g as t,a1 as O,be as E,l as Q,aE as W,k as X,aJ as Z,ah as ee}from"./index-D07viL9P.js";import{P as ae}from"./PageHeader-C-UYITO9.js";import{_ as F}from"./TimeSelect.vue_vue_type_script_setup_true_lang-sP4Z2nbi.js";import{_ as te}from"./PageTabs.vue_vue_type_script_setup_true_lang-BV344PR7.js";import"./vendor-snapdom--nZvo8Sg.js";import"./Select-CaRAtYOu.js";import"./useFormControl-BPt9mIxj.js";import"./clamp-jFYhBC76.js";import"./Tabs-Bw65ChMB.js";import"./Tabs-B0DXvZn9.js";import"./RovingFocusItem-BAQO8BlG.js";import"./DatePicker.vue_vue_type_script_setup_true_lang-DWWzQOTU.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 x(i){h.value=i,s.value=null,y.value++}return{modelValue:s,componentKey:y,initialState:v,rangeSource:T,setAvailableYears:n,switchToYear:x}}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=K(),{controller:h,snapshot:y}=U(),d=z(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),x=o(()=>n.value?.defaultMode??"year"),i=o(()=>n.value?[...n.value.allowedModes]:void 0),g=se(x,i),{modelValue:r,componentKey:w,initialState:Y,rangeSource:I}=g,b=s.ui.insightScope;if(!(b instanceof H))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}),$=o(()=>(y.value.revision,h.getResolvedLayout())),D=o(()=>$.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,[R(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 min-h-[38px] 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(F,{key:`${t(w)}:${M.value}`,modelValue:t(r),"onUpdate:modelValue":c[0]||(c[0]=a=>E(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(F,{key:`${t(w)}:${M.value}`,modelValue:t(r),"onUpdate:modelValue":c[1]||(c[1]=a=>E(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"]),R(t(Z),null,{default:_(({Component:a})=>[R(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-7e7305c7"]]);export{Se as default};