hermes-web-ui 0.5.11-beta.5 → 0.5.12

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 (37) hide show
  1. package/dist/client/assets/js/{ChannelsView-BD6WhVVt.js → ChannelsView-BNl0PXuE.js} +1 -1
  2. package/dist/client/assets/js/{ChatView-Dd0kC8Vo.js → ChatView-B48jxi8d.js} +1 -1
  3. package/dist/client/assets/js/{FileRenameModal-ekm_sUbS.js → FileRenameModal-DZLJX7uH.js} +1 -1
  4. package/dist/client/assets/js/{FilesView-B4lJn--H.js → FilesView-DVzc81q4.js} +1 -1
  5. package/dist/client/assets/js/{GatewaysView-AlpgnuQe.js → GatewaysView-nVI491J6.js} +1 -1
  6. package/dist/client/assets/js/{GroupChatView-BvlhFvZq.js → GroupChatView-BQ9NQruK.js} +1 -1
  7. package/dist/client/assets/js/{HistoryView-CP5HybMt.js → HistoryView-B4dVZ_w6.js} +1 -1
  8. package/dist/client/assets/js/{JobsView-dZs_Tfgz.js → JobsView-CO4gS_xZ.js} +1 -1
  9. package/dist/client/assets/js/{LoginView-BTyndZfl.js → LoginView-BjLXmhAE.js} +1 -1
  10. package/dist/client/assets/js/{LogsView-BXfMEwdi.js → LogsView-DByB3JRO.js} +1 -1
  11. package/dist/client/assets/js/{MarkdownRenderer-BmetuLvT.js → MarkdownRenderer-CJqzLmjP.js} +1 -1
  12. package/dist/client/assets/js/{MemoryView-CZLYeSfA.js → MemoryView-C-A9eqd_.js} +1 -1
  13. package/dist/client/assets/js/{ModelsView-DVv9Wd-p.js → ModelsView-CEwjlOkp.js} +1 -1
  14. package/dist/client/assets/js/{ProfilesView-DvlCRUzA.js → ProfilesView-BvQ6Cz_c.js} +1 -1
  15. package/dist/client/assets/js/{SessionListItem-B-sKqWVK.js → SessionListItem-Do-ItiIR.js} +1 -1
  16. package/dist/client/assets/js/{SettingsView-BHbjOojW.js → SettingsView-x-dvxRpJ.js} +1 -1
  17. package/dist/client/assets/js/{SkillsView-COnH00Kh.js → SkillsView-D2FpFwdq.js} +1 -1
  18. package/dist/client/assets/js/{TerminalView-Dm3pyG2z.js → TerminalView-BYqwreYx.js} +1 -1
  19. package/dist/client/assets/js/{UsageView-Cq408biC.js → UsageView-DYAJ0kQH.js} +1 -1
  20. package/dist/client/assets/js/app-DSt5wvbw.js +1 -0
  21. package/dist/client/assets/js/app-DlZUhYPc.js +1 -0
  22. package/dist/client/assets/js/{auth-BNHABIZy.js → auth-B4Z3jLnR.js} +1 -1
  23. package/dist/client/assets/js/{chat-CW3_uh-9.js → chat-BkwaPwH2.js} +2 -2
  24. package/dist/client/assets/js/index-CFh6DxPJ.js +1 -0
  25. package/dist/client/assets/js/{models-_V0v2UkS.js → models-ZUoTLeI2.js} +1 -1
  26. package/dist/client/assets/js/{router-BfmZqYKj.js → router-Be5a7E15.js} +2 -2
  27. package/dist/client/assets/js/{session-browser-prefs-Dl3WfwAw.js → session-browser-prefs-CXMgnvdU.js} +1 -1
  28. package/dist/client/assets/js/{sessions-Cxahzjxf.js → sessions-DTX4oAQD.js} +1 -1
  29. package/dist/client/assets/js/{settings-Dm8GxViy.js → settings-DWQeYe8U.js} +1 -1
  30. package/dist/client/assets/js/{skills-DDOK6DZr.js → skills-B5AulaXk.js} +1 -1
  31. package/dist/client/index.html +6 -6
  32. package/dist/server/index.js +2 -2
  33. package/dist/server/index.js.map +1 -1
  34. package/package.json +1 -1
  35. package/dist/client/assets/js/app-BntgG861.js +0 -1
  36. package/dist/client/assets/js/app-CRJO72mI.js +0 -1
  37. package/dist/client/assets/js/index-qjZs0vOQ.js +0 -1
@@ -1 +1 @@
1
- import{n as C}from"./rolldown-runtime-iJLb3ux7.js";import{$ as g,F as ve,Ft as G,I as ge,Lt as H,Ot as be,P as p,Pt as e,Q as V,X as ke,Z as w,_t as xe,bt as o,c as b,dt as we,et as h,ft as Ce,g as ye,gt as ze,ht as qe,it as L,j as He,kt as P,l as Se,nt as I,pt as c,q as x,rt as t,t as U,z as $}from"./ui-vendor-DIP97-f3.js";import{n as W,r as F}from"./vue-vendor-DHimL2gr.js";import{n as Q,t as D}from"./_plugin-vue_export-helper-JVWBimuG.js";import{a as Me,i as Te,n as se,o as Re,r as Be,s as Pe,t as de}from"./settings-Dm8GxViy.js";import{n as Ae,t as r}from"./SettingRow-B0puNXgX.js";var j,K,O,X,ue,Z=C((()=>{$(),U(),W(),j={class:"platform-info"},K=["innerHTML"],O={class:"platform-name"},X={key:0,class:"platform-card-body"},ue=L({__name:"PlatformCard",props:{name:{},icon:{},config:{},credentials:{},exclusive:{type:Boolean}},setup(S){const s=S,k=P(!0),{t:a}=F(),y=ke(()=>{const z=s.credentials;if(!z)return!1;const i=["token","api_key","app_id","client_id","secret","app_secret","client_secret","access_token","bot_id","account_id","enabled"];return[z,z.extra].filter(Boolean).some(M=>i.some(u=>{const f=M[u];return f!=null&&f!==""&&f!==!1}))});return(z,i)=>(c(),h("div",{class:G(["platform-card",{configured:y.value}])},[w("div",{class:"platform-card-header",onClick:i[0]||(i[0]=M=>k.value=!k.value)},[w("div",j,[w("span",{class:"platform-icon",innerHTML:S.icon},null,8,K),w("span",O,H(S.name),1),t(e(ge),{type:y.value?"success":"default",size:"small",round:""},{default:o(()=>[I(H(y.value?e(a)("common.configured"):e(a)("common.notConfigured")),1)]),_:1},8,["type"])]),w("span",{class:G(["expand-icon",{expanded:k.value}])},"▾",2)]),k.value?(c(),h("div",X,[S.exclusive?(c(),V(e(ve),{key:0,type:"warning","show-icon":!0,class:"exclusive-alert"},{default:o(()=>[I(H(e(a)("platform.exclusiveTokenWarning")),1)]),_:1})):g("",!0),ze(z.$slots,"default",{},void 0,!0)])):g("",!0)],2))}})})),Ie=C((()=>{})),pe,Ve=C((()=>{Z(),Z(),Ie(),Q(),pe=D(ue,[["__scopeId","data-v-e27ecbbe"]])})),J,Y,ee,ae,me,le=C((()=>{$(),U(),W(),de(),Te(),Ve(),Ae(),J={class:"settings-section"},Y={class:"weixin-qr-section"},ee={key:1,class:"weixin-qr-loading"},ae={key:2,class:"weixin-qr-hint"},me=L({__name:"PlatformSettings",setup(S){const s=se(),k=ye(),{t:a}=F(),y=be({});function z(d,l){return`${d}.${l}`}function i(d,l){return!!y[z(d,l)]}async function M(d,l,q){const _=z(d,l);y[_]=!0;try{await q(),k.success(a("settings.saved"))}catch{k.error(a("settings.saveFailed"))}finally{y[_]=!1}}async function u(d,l,q){M(d,l,()=>s.saveSection(d,q))}async function f(d,l,q){M(d,l,async()=>{await Re(d,q),await s.fetchSettings()})}function m(d){return s.platforms[d]||{}}const N=P(""),T=P(""),v=P("idle");let R=null;async function _e(){v.value="loading",N.value="",T.value="",E();try{const d=await Be();T.value=d.qrcode,N.value=d.qrcode_url,window.open(d.qrcode_url,"_blank"),v.value="waiting",B()}catch(d){v.value="error",k.error(d.message||a("platform.qrFetching"))}}function B(){T.value&&(R=setTimeout(async()=>{try{const d=await Me(T.value);d.status==="wait"?B():d.status==="scaned"?(v.value="scaned",B()):d.status==="expired"?v.value="expired":d.status==="confirmed"&&(v.value="confirmed",await Pe({account_id:d.account_id,token:d.token,base_url:d.base_url}),await s.fetchSettings(),k.success(a("settings.saved")))}catch{B()}},3e3))}function E(){R&&(clearTimeout(R),R=null)}Ce(()=>{E()});const he=[{key:"telegram",name:"Telegram",exclusive:!0,icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.479.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"/></svg>'},{key:"discord",name:"Discord",exclusive:!0,icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189z"/></svg>'},{key:"slack",name:"Slack",exclusive:!0,icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52zm1.271 0a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313zM8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834zm0 1.271a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312zm10.122 0a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V5.042zm-1.27 0a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.165 0a2.528 2.528 0 0 1 2.523 2.522v6.312zM15.165 18.956a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.165 24a2.527 2.527 0 0 1-2.52-2.522v-2.522h2.52zm0-1.27a2.527 2.527 0 0 1 2.523-2.52h6.313A2.528 2.528 0 0 1 24 18.956a2.528 2.528 0 0 1-2.522 2.523h-6.313z"/></svg>'},{key:"whatsapp",name:"WhatsApp",exclusive:!0,icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z"/></svg>'},{key:"matrix",name:"Matrix",icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M.632.55v22.9H2.28V24H0V0h2.28v.55zm7.043 7.26v1.157h.033c.309-.443.683-.784 1.117-1.024.433-.245.936-.365 1.5-.365.54 0 1.033.107 1.48.324.448.217.786.619 1.017 1.205.24-.376.558-.702.956-.98.398-.277.872-.414 1.424-.414.41 0 .784.065 1.122.194.34.13.629.325.87.588.241.263.428.59.56.984.132.393.198.85.198 1.368v5.89h-2.49v-4.893c0-.268-.016-.525-.048-.77a1.627 1.627 0 00-.2-.63 1.028 1.028 0 00-.392-.426 1.294 1.294 0 00-.616-.134c-.277 0-.508.05-.693.15a1.043 1.043 0 00-.43.41 1.768 1.768 0 00-.214.616 4.15 4.15 0 00-.06.74v4.937H9.29v-4.937c0-.25-.01-.498-.032-.742a1.84 1.84 0 00-.166-.638.998.998 0 00-.363-.448 1.206 1.206 0 00-.624-.154c-.26 0-.483.048-.67.144a1.055 1.055 0 00-.436.402 1.744 1.744 0 00-.227.616 4.108 4.108 0 00-.063.74v4.937H5.21V7.81zm15.693 15.64V.55H21.72V0H24v24h-2.28v-.55z"/></svg>'},{key:"feishu",name:"Feishu",exclusive:!0,icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M6.59 3.41a2.25 2.25 0 0 1 3.182 0L13.5 7.14l-3.182 3.182L6.59 7.59a2.25 2.25 0 0 1 0-3.182zm5.303 5.303L15.075 5.53a2.25 2.25 0 0 1 3.182 3.182L15.075 11.894 11.893 8.713zM3.41 6.59a2.25 2.25 0 0 1 3.182 0l3.182 3.182-3.182 3.182a2.25 2.25 0 0 1-3.182-3.182L3.41 6.59zm5.303 5.303L11.894 15.075a2.25 2.25 0 0 1-3.182 3.182L5.53 15.075 8.713 11.893zm5.303-5.303L17.478 9.778a2.25 2.25 0 0 1-3.182 3.182L10.53 10.075l3.182-3.182 0 .023z"/></svg>'},{key:"weixin",name:"Weixin",exclusive:!0,icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M8.691 2.188C3.891 2.188 0 5.476 0 9.53c0 2.212 1.17 4.203 3.002 5.55a.59.59 0 01.213.665l-.39 1.48c-.019.07-.048.141-.048.213 0 .163.13.295.29.295a.326.326 0 00.167-.054l1.903-1.114a.864.864 0 01.717-.098 10.16 10.16 0 002.837.403c.276 0 .543-.027.811-.05-.857-2.578.157-4.972 1.932-6.446 1.703-1.415 3.882-1.98 5.853-1.838-.576-3.583-4.196-6.348-8.596-6.348zM5.785 5.991c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 01-1.162 1.178A1.17 1.17 0 014.623 7.17c0-.651.52-1.18 1.162-1.18zm5.813 0c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 01-1.162 1.178 1.17 1.17 0 01-1.162-1.178c0-.651.52-1.18 1.162-1.18zm3.68 4.025c-3.694 0-6.69 2.462-6.69 5.496 0 3.034 2.996 5.496 6.69 5.496.753 0 1.477-.1 2.158-.28a.66.66 0 01.548.074l1.46.854a.25.25 0 00.127.041.224.224 0 00.221-.225c0-.055-.022-.109-.037-.162l-.298-1.131a.453.453 0 01.163-.509C21.81 18.613 22.77 16.973 22.77 15.512c0-3.034-2.996-5.496-6.69-5.496h.198zm-2.454 3.347c.491 0 .889.404.889.902a.896.896 0 01-.889.903.896.896 0 01-.889-.903c0-.498.398-.902.889-.902zm4.912 0c.491 0 .889.404.889.902a.896.896 0 01-.889.903.896.896 0 01-.889-.903c0-.498.398-.902.889-.902z"/></svg>'},{key:"wecom",name:"WeCom",icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M8.691 2.188C3.891 2.188 0 5.476 0 9.53c0 2.212 1.17 4.203 3.002 5.55a.59.59 0 01.213.665l-.39 1.48c-.019.07-.048.141-.048.213 0 .163.13.295.29.295a.326.326 0 00.167-.054l1.903-1.114a.864.864 0 01.717-.098 10.16 10.16 0 002.837.403c.276 0 .543-.027.811-.05-.857-2.578.157-4.972 1.932-6.446 1.703-1.415 3.882-1.98 5.853-1.838-.576-3.583-4.196-6.348-8.596-6.348zM5.785 5.991c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 01-1.162 1.178A1.17 1.17 0 014.623 7.17c0-.651.52-1.18 1.162-1.18zm5.813 0c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 01-1.162 1.178 1.17 1.17 0 01-1.162-1.178c0-.651.52-1.18 1.162-1.18zm3.68 4.025c-3.694 0-6.69 2.462-6.69 5.496 0 3.034 2.996 5.496 6.69 5.496.753 0 1.477-.1 2.158-.28a.66.66 0 01.548.074l1.46.854a.25.25 0 00.127.041.224.224 0 00.221-.225c0-.055-.022-.109-.037-.162l-.298-1.131a.453.453 0 01.163-.509C21.81 18.613 22.77 16.973 22.77 15.512c0-3.034-2.996-5.496-6.69-5.496h.198zm-2.454 3.347c.491 0 .889.404.889.902a.896.896 0 01-.889.903.896.896 0 01-.889-.903c0-.498.398-.902.889-.902zm4.912 0c.491 0 .889.404.889.902a.896.896 0 01-.889.903.896.896 0 01-.889-.903c0-.498.398-.902.889-.902z"/></svg>'}];return(d,l)=>{const q=xe("NSpin");return c(),h("section",J,[(c(),h(x,null,qe(he,_=>t(pe,{key:_.key,name:_.name,icon:_.icon,exclusive:_.exclusive,config:e(s)[_.key],credentials:m(_.key)},{default:o(()=>[_.key==="telegram"?(c(),h(x,{key:0},[t(r,{label:e(a)("platform.botToken"),hint:e(a)("platform.botTokenHint")},{default:o(()=>[t(e(p),{"default-value":m("telegram").token||"",loading:i("telegram","token"),clearable:"",size:"small",class:"input-lg",placeholder:"123456:ABC-DEF...",onChange:l[0]||(l[0]=n=>f("telegram","token",{token:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(a)("platform.requireMention"),hint:e(a)("platform.requireMentionGroup")},{default:o(()=>[t(e(b),{value:e(s).telegram.require_mention,loading:i("telegram","require_mention"),"onUpdate:value":l[1]||(l[1]=n=>u("telegram","require_mention",{require_mention:n}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(a)("platform.reactions"),hint:e(a)("platform.reactionsHint")},{default:o(()=>[t(e(b),{value:e(s).telegram.reactions,loading:i("telegram","reactions"),"onUpdate:value":l[2]||(l[2]=n=>u("telegram","reactions",{reactions:n}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(a)("platform.freeResponseChats"),hint:e(a)("platform.freeResponseChatsHint")},{default:o(()=>[t(e(p),{"default-value":e(s).telegram.free_response_chats||"",loading:i("telegram","free_response_chats"),size:"small",placeholder:"chat_id1,chat_id2",onChange:l[3]||(l[3]=n=>u("telegram","free_response_chats",{free_response_chats:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(a)("platform.mentionPatterns"),hint:e(a)("platform.mentionPatternsHint")},{default:o(()=>[t(e(p),{"default-value":(e(s).telegram.mention_patterns||[]).join(", "),loading:i("telegram","mention_patterns"),size:"small",placeholder:"pattern1, pattern2",onChange:l[4]||(l[4]=n=>u("telegram","mention_patterns",{mention_patterns:n?n.split(",").map(A=>A.trim()):[]}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"])],64)):g("",!0),_.key==="discord"?(c(),h(x,{key:1},[t(r,{label:e(a)("platform.botToken"),hint:e(a)("platform.botTokenHint")},{default:o(()=>[t(e(p),{"default-value":m("discord").token||"",loading:i("discord","token"),clearable:"",size:"small",class:"input-lg",placeholder:"Bot token...",onChange:l[5]||(l[5]=n=>f("discord","token",{token:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(a)("platform.requireMention"),hint:e(a)("platform.requireMentionChannel")},{default:o(()=>[t(e(b),{value:e(s).discord.require_mention,loading:i("discord","require_mention"),"onUpdate:value":l[6]||(l[6]=n=>u("discord","require_mention",{require_mention:n}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(a)("platform.autoThread"),hint:e(a)("platform.autoThreadHint")},{default:o(()=>[t(e(b),{value:e(s).discord.auto_thread,loading:i("discord","auto_thread"),"onUpdate:value":l[7]||(l[7]=n=>u("discord","auto_thread",{auto_thread:n}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(a)("platform.reactions"),hint:e(a)("platform.reactionsHint")},{default:o(()=>[t(e(b),{value:e(s).discord.reactions,loading:i("discord","reactions"),"onUpdate:value":l[8]||(l[8]=n=>u("discord","reactions",{reactions:n}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(a)("platform.freeResponseChannels"),hint:e(a)("platform.freeResponseChannelsHint")},{default:o(()=>[t(e(p),{"default-value":e(s).discord.free_response_channels||"",loading:i("discord","free_response_channels"),size:"small",placeholder:"channel_id1,channel_id2",onChange:l[9]||(l[9]=n=>u("discord","free_response_channels",{free_response_channels:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(a)("platform.allowedChannels"),hint:e(a)("platform.allowedChannelsHint")},{default:o(()=>[t(e(p),{"default-value":e(s).discord.allowed_channels||"",loading:i("discord","allowed_channels"),size:"small",placeholder:"channel_id1,channel_id2",onChange:l[10]||(l[10]=n=>u("discord","allowed_channels",{allowed_channels:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(a)("platform.ignoredChannels"),hint:e(a)("platform.ignoredChannelsHint")},{default:o(()=>[t(e(p),{"default-value":e(s).discord.ignored_channels||"",loading:i("discord","ignored_channels"),size:"small",placeholder:"channel_id1,channel_id2",onChange:l[11]||(l[11]=n=>u("discord","ignored_channels",{ignored_channels:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(a)("platform.noThreadChannels"),hint:e(a)("platform.noThreadChannelsHint")},{default:o(()=>[t(e(p),{"default-value":e(s).discord.no_thread_channels||"",loading:i("discord","no_thread_channels"),size:"small",placeholder:"channel_id1,channel_id2",onChange:l[12]||(l[12]=n=>u("discord","no_thread_channels",{no_thread_channels:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"])],64)):g("",!0),_.key==="slack"?(c(),h(x,{key:2},[t(r,{label:e(a)("platform.botToken"),hint:e(a)("platform.botTokenHint")},{default:o(()=>[t(e(p),{"default-value":m("slack").token||"",loading:i("slack","token"),clearable:"",size:"small",class:"input-lg",placeholder:"xoxb-...",onChange:l[13]||(l[13]=n=>f("slack","token",{token:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(a)("platform.requireMention"),hint:e(a)("platform.requireMentionChannel")},{default:o(()=>[t(e(b),{value:e(s).slack.require_mention,loading:i("slack","require_mention"),"onUpdate:value":l[14]||(l[14]=n=>u("slack","require_mention",{require_mention:n}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(a)("platform.allowBots"),hint:e(a)("platform.allowBotsHint")},{default:o(()=>[t(e(b),{value:e(s).slack.allow_bots,loading:i("slack","allow_bots"),"onUpdate:value":l[15]||(l[15]=n=>u("slack","allow_bots",{allow_bots:n}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(a)("platform.freeResponseChannels"),hint:e(a)("platform.freeResponseChannelsHint")},{default:o(()=>[t(e(p),{"default-value":e(s).slack.free_response_channels||"",loading:i("slack","free_response_channels"),size:"small",placeholder:"channel_id1,channel_id2",onChange:l[16]||(l[16]=n=>u("slack","free_response_channels",{free_response_channels:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"])],64)):g("",!0),_.key==="whatsapp"?(c(),h(x,{key:3},[t(r,{label:e(a)("platform.waEnabled"),hint:e(a)("platform.waEnabledHint")},{default:o(()=>[t(e(b),{value:m("whatsapp").enabled,loading:i("whatsapp","enabled"),"onUpdate:value":l[17]||(l[17]=n=>f("whatsapp","enabled",{enabled:n}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(a)("platform.requireMention"),hint:e(a)("platform.requireMentionGroup")},{default:o(()=>[t(e(b),{value:e(s).whatsapp.require_mention,loading:i("whatsapp","require_mention"),"onUpdate:value":l[18]||(l[18]=n=>u("whatsapp","require_mention",{require_mention:n}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(a)("platform.freeResponseChats"),hint:e(a)("platform.freeResponseChatsHint")},{default:o(()=>[t(e(p),{"default-value":e(s).whatsapp.free_response_chats||"",loading:i("whatsapp","free_response_chats"),size:"small",placeholder:"chat_id1,chat_id2",onChange:l[19]||(l[19]=n=>u("whatsapp","free_response_chats",{free_response_chats:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(a)("platform.mentionPatterns"),hint:e(a)("platform.mentionPatternsHint")},{default:o(()=>[t(e(p),{"default-value":(e(s).whatsapp.mention_patterns||[]).join(", "),loading:i("whatsapp","mention_patterns"),size:"small",placeholder:"pattern1, pattern2",onChange:l[20]||(l[20]=n=>u("whatsapp","mention_patterns",{mention_patterns:n?n.split(",").map(A=>A.trim()):[]}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"])],64)):g("",!0),_.key==="matrix"?(c(),h(x,{key:4},[t(r,{label:e(a)("platform.accessToken"),hint:e(a)("platform.accessTokenHint")},{default:o(()=>[t(e(p),{"default-value":m("matrix").token||"",loading:i("matrix","token"),clearable:"",size:"small",class:"input-lg",placeholder:"syt_...",onChange:l[21]||(l[21]=n=>f("matrix","token",{token:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(a)("platform.homeserver"),hint:e(a)("platform.homeserverHint")},{default:o(()=>[t(e(p),{"default-value":m("matrix").extra?.homeserver||"",loading:i("matrix","homeserver"),clearable:"",size:"small",class:"input-lg",placeholder:"https://matrix.org",onChange:l[22]||(l[22]=n=>f("matrix","homeserver",{extra:{...m("matrix").extra,homeserver:n}}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(a)("platform.requireMention"),hint:e(a)("platform.requireMentionRoom")},{default:o(()=>[t(e(b),{value:e(s).matrix.require_mention,loading:i("matrix","require_mention"),"onUpdate:value":l[23]||(l[23]=n=>u("matrix","require_mention",{require_mention:n}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(a)("platform.autoThread"),hint:e(a)("platform.autoThreadHintRoom")},{default:o(()=>[t(e(b),{value:e(s).matrix.auto_thread,loading:i("matrix","auto_thread"),"onUpdate:value":l[24]||(l[24]=n=>u("matrix","auto_thread",{auto_thread:n}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(a)("platform.dmMentionThreads"),hint:e(a)("platform.dmMentionThreadsHint")},{default:o(()=>[t(e(b),{value:e(s).matrix.dm_mention_threads,loading:i("matrix","dm_mention_threads"),"onUpdate:value":l[25]||(l[25]=n=>u("matrix","dm_mention_threads",{dm_mention_threads:n}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(a)("platform.freeResponseRooms"),hint:e(a)("platform.freeResponseRoomsHint")},{default:o(()=>[t(e(p),{"default-value":e(s).matrix.free_response_rooms||"",loading:i("matrix","free_response_rooms"),size:"small",placeholder:"room_id1,room_id2",onChange:l[26]||(l[26]=n=>u("matrix","free_response_rooms",{free_response_rooms:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"])],64)):g("",!0),_.key==="feishu"?(c(),h(x,{key:5},[t(r,{label:e(a)("platform.appId"),hint:e(a)("platform.appIdHint")},{default:o(()=>[t(e(p),{"default-value":m("feishu").extra?.app_id||"",loading:i("feishu","app_id"),clearable:"",size:"small",class:"input-lg",placeholder:"cli_...",onChange:l[27]||(l[27]=n=>f("feishu","app_id",{extra:{...m("feishu").extra,app_id:n}}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(a)("platform.appSecret"),hint:e(a)("platform.appSecretHint")},{default:o(()=>[t(e(p),{"default-value":m("feishu").extra?.app_secret||"",loading:i("feishu","app_secret"),clearable:"",size:"small",class:"input-lg",placeholder:"App Secret",onChange:l[28]||(l[28]=n=>f("feishu","app_secret",{extra:{...m("feishu").extra,app_secret:n}}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(a)("platform.requireMention"),hint:e(a)("platform.requireMentionGroup")},{default:o(()=>[t(e(b),{value:e(s).feishu.require_mention,loading:i("feishu","require_mention"),"onUpdate:value":l[29]||(l[29]=n=>u("feishu","require_mention",{require_mention:n}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(a)("platform.freeResponseChats"),hint:e(a)("platform.freeResponseChatsHint")},{default:o(()=>[t(e(p),{"default-value":e(s).feishu.free_response_chats||"",loading:i("feishu","free_response_chats"),size:"small",placeholder:"chat_id1,chat_id2",onChange:l[30]||(l[30]=n=>u("feishu","free_response_chats",{free_response_chats:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"])],64)):g("",!0),_.key==="dingtalk"?(c(),h(x,{key:6},[t(r,{label:e(a)("platform.clientId"),hint:e(a)("platform.clientIdHint")},{default:o(()=>[t(e(p),{"default-value":m("dingtalk").extra?.client_id||"",loading:i("dingtalk","client_id"),clearable:"",size:"small",class:"input-lg",placeholder:"Client ID",onChange:l[31]||(l[31]=n=>f("dingtalk","client_id",{extra:{...m("dingtalk").extra,client_id:n}}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(a)("platform.clientSecret"),hint:e(a)("platform.clientSecretHint")},{default:o(()=>[t(e(p),{"default-value":m("dingtalk").extra?.client_secret||"",loading:i("dingtalk","client_secret"),clearable:"",size:"small",class:"input-lg",placeholder:"Client Secret",onChange:l[32]||(l[32]=n=>f("dingtalk","client_secret",{extra:{...m("dingtalk").extra,client_secret:n}}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(a)("platform.requireMention"),hint:e(a)("platform.requireMentionGroup")},{default:o(()=>[t(e(b),{value:e(s).dingtalk.require_mention,loading:i("dingtalk","require_mention"),"onUpdate:value":l[33]||(l[33]=n=>u("dingtalk","require_mention",{require_mention:n}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(a)("platform.freeResponseChats"),hint:e(a)("platform.freeResponseChatsHint")},{default:o(()=>[t(e(p),{"default-value":e(s).dingtalk.free_response_chats||"",loading:i("dingtalk","free_response_chats"),size:"small",placeholder:"chat_id1,chat_id2",onChange:l[34]||(l[34]=n=>u("dingtalk","free_response_chats",{free_response_chats:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"])],64)):g("",!0),_.key==="weixin"?(c(),h(x,{key:7},[w("div",Y,[v.value==="idle"||v.value==="error"||v.value==="expired"||v.value==="confirmed"?(c(),V(e(He),{key:0,type:"primary",size:"small",onClick:_e},{default:o(()=>[I(H(v.value==="confirmed"?e(a)("platform.qrRelogin"):e(a)("platform.qrLogin")),1)]),_:1})):g("",!0),v.value==="loading"?(c(),h("div",ee,[t(q,{size:"small"}),w("span",null,H(e(a)("platform.qrFetching")),1)])):g("",!0),v.value==="waiting"||v.value==="scaned"?(c(),h("div",ae,H(v.value==="scaned"?e(a)("platform.qrScanedHint"):e(a)("platform.qrScanHint")),1)):g("",!0)]),t(r,{label:e(a)("platform.weixinToken"),hint:e(a)("platform.weixinTokenHint")},{default:o(()=>[t(e(p),{"default-value":m("weixin").token||"",loading:i("weixin","token"),clearable:"",size:"small",class:"input-lg",placeholder:"Token",onChange:l[35]||(l[35]=n=>f("weixin","token",{token:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(a)("platform.accountId"),hint:e(a)("platform.accountIdHint")},{default:o(()=>[t(e(p),{"default-value":m("weixin").extra?.account_id||"",loading:i("weixin","account_id"),clearable:"",size:"small",class:"input-lg",placeholder:"Account ID",onChange:l[36]||(l[36]=n=>f("weixin","account_id",{extra:{...m("weixin").extra,account_id:n}}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"])],64)):g("",!0),_.key==="wecom"?(c(),h(x,{key:8},[t(r,{label:e(a)("platform.botId"),hint:e(a)("platform.botIdHint")},{default:o(()=>[t(e(p),{"default-value":m("wecom").extra?.bot_id||"",loading:i("wecom","bot_id"),clearable:"",size:"small",class:"input-lg",placeholder:"Bot ID",onChange:l[37]||(l[37]=n=>f("wecom","bot_id",{extra:{...m("wecom").extra,bot_id:n}}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(a)("platform.appSecret"),hint:e(a)("platform.wecomSecretHint")},{default:o(()=>[t(e(p),{"default-value":m("wecom").extra?.secret||"",loading:i("wecom","secret"),clearable:"",size:"small",class:"input-lg",placeholder:"Secret",onChange:l[38]||(l[38]=n=>f("wecom","secret",{extra:{...m("wecom").extra,secret:n}}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"])],64)):g("",!0)]),_:2},1032,["name","icon","exclusive","config","credentials"])),64))])}}})})),Le=C((()=>{})),fe,Ue=C((()=>{le(),le(),Le(),Q(),fe=D(me,[["__scopeId","data-v-ee52227d"]])})),te,ne,ie,oe,ce,re=C((()=>{$(),U(),W(),de(),Ue(),te={class:"channels-view"},ne={class:"page-header"},ie={class:"header-title"},oe={class:"channels-content"},ce=L({__name:"ChannelsView",setup(S){const s=se(),{t:k}=F();return we(()=>{s.fetchSettings()}),(a,y)=>(c(),h("div",te,[w("header",ne,[w("h2",ie,H(e(k)("sidebar.channels")),1)]),w("div",oe,[t(e(Se),{show:e(s).loading||e(s).saving,size:"large",description:e(k)("common.loading")},{default:o(()=>[e(s).loading?g("",!0):(c(),V(fe,{key:0}))]),_:1},8,["show","description"])])]))}})})),$e=C((()=>{})),We,Fe=C((()=>{re(),re(),$e(),Q(),We=D(ce,[["__scopeId","data-v-e25dbf6c"]])}));Fe();export{We as default};
1
+ import{n as C}from"./rolldown-runtime-iJLb3ux7.js";import{$ as g,F as ve,Ft as G,I as ge,Lt as H,Ot as be,P as p,Pt as e,Q as V,X as ke,Z as w,_t as xe,bt as o,c as b,dt as we,et as h,ft as Ce,g as ye,gt as ze,ht as qe,it as L,j as He,kt as P,l as Se,nt as I,pt as c,q as x,rt as t,t as U,z as $}from"./ui-vendor-DIP97-f3.js";import{n as W,r as F}from"./vue-vendor-DHimL2gr.js";import{n as Q,t as D}from"./_plugin-vue_export-helper-JVWBimuG.js";import{a as Me,i as Te,n as se,o as Re,r as Be,s as Pe,t as de}from"./settings-DWQeYe8U.js";import{n as Ae,t as r}from"./SettingRow-B0puNXgX.js";var j,K,O,X,ue,Z=C((()=>{$(),U(),W(),j={class:"platform-info"},K=["innerHTML"],O={class:"platform-name"},X={key:0,class:"platform-card-body"},ue=L({__name:"PlatformCard",props:{name:{},icon:{},config:{},credentials:{},exclusive:{type:Boolean}},setup(S){const s=S,k=P(!0),{t:a}=F(),y=ke(()=>{const z=s.credentials;if(!z)return!1;const i=["token","api_key","app_id","client_id","secret","app_secret","client_secret","access_token","bot_id","account_id","enabled"];return[z,z.extra].filter(Boolean).some(M=>i.some(u=>{const f=M[u];return f!=null&&f!==""&&f!==!1}))});return(z,i)=>(c(),h("div",{class:G(["platform-card",{configured:y.value}])},[w("div",{class:"platform-card-header",onClick:i[0]||(i[0]=M=>k.value=!k.value)},[w("div",j,[w("span",{class:"platform-icon",innerHTML:S.icon},null,8,K),w("span",O,H(S.name),1),t(e(ge),{type:y.value?"success":"default",size:"small",round:""},{default:o(()=>[I(H(y.value?e(a)("common.configured"):e(a)("common.notConfigured")),1)]),_:1},8,["type"])]),w("span",{class:G(["expand-icon",{expanded:k.value}])},"▾",2)]),k.value?(c(),h("div",X,[S.exclusive?(c(),V(e(ve),{key:0,type:"warning","show-icon":!0,class:"exclusive-alert"},{default:o(()=>[I(H(e(a)("platform.exclusiveTokenWarning")),1)]),_:1})):g("",!0),ze(z.$slots,"default",{},void 0,!0)])):g("",!0)],2))}})})),Ie=C((()=>{})),pe,Ve=C((()=>{Z(),Z(),Ie(),Q(),pe=D(ue,[["__scopeId","data-v-e27ecbbe"]])})),J,Y,ee,ae,me,le=C((()=>{$(),U(),W(),de(),Te(),Ve(),Ae(),J={class:"settings-section"},Y={class:"weixin-qr-section"},ee={key:1,class:"weixin-qr-loading"},ae={key:2,class:"weixin-qr-hint"},me=L({__name:"PlatformSettings",setup(S){const s=se(),k=ye(),{t:a}=F(),y=be({});function z(d,l){return`${d}.${l}`}function i(d,l){return!!y[z(d,l)]}async function M(d,l,q){const _=z(d,l);y[_]=!0;try{await q(),k.success(a("settings.saved"))}catch{k.error(a("settings.saveFailed"))}finally{y[_]=!1}}async function u(d,l,q){M(d,l,()=>s.saveSection(d,q))}async function f(d,l,q){M(d,l,async()=>{await Re(d,q),await s.fetchSettings()})}function m(d){return s.platforms[d]||{}}const N=P(""),T=P(""),v=P("idle");let R=null;async function _e(){v.value="loading",N.value="",T.value="",E();try{const d=await Be();T.value=d.qrcode,N.value=d.qrcode_url,window.open(d.qrcode_url,"_blank"),v.value="waiting",B()}catch(d){v.value="error",k.error(d.message||a("platform.qrFetching"))}}function B(){T.value&&(R=setTimeout(async()=>{try{const d=await Me(T.value);d.status==="wait"?B():d.status==="scaned"?(v.value="scaned",B()):d.status==="expired"?v.value="expired":d.status==="confirmed"&&(v.value="confirmed",await Pe({account_id:d.account_id,token:d.token,base_url:d.base_url}),await s.fetchSettings(),k.success(a("settings.saved")))}catch{B()}},3e3))}function E(){R&&(clearTimeout(R),R=null)}Ce(()=>{E()});const he=[{key:"telegram",name:"Telegram",exclusive:!0,icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.479.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"/></svg>'},{key:"discord",name:"Discord",exclusive:!0,icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189z"/></svg>'},{key:"slack",name:"Slack",exclusive:!0,icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52zm1.271 0a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313zM8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834zm0 1.271a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312zm10.122 0a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V5.042zm-1.27 0a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.165 0a2.528 2.528 0 0 1 2.523 2.522v6.312zM15.165 18.956a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.165 24a2.527 2.527 0 0 1-2.52-2.522v-2.522h2.52zm0-1.27a2.527 2.527 0 0 1 2.523-2.52h6.313A2.528 2.528 0 0 1 24 18.956a2.528 2.528 0 0 1-2.522 2.523h-6.313z"/></svg>'},{key:"whatsapp",name:"WhatsApp",exclusive:!0,icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z"/></svg>'},{key:"matrix",name:"Matrix",icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M.632.55v22.9H2.28V24H0V0h2.28v.55zm7.043 7.26v1.157h.033c.309-.443.683-.784 1.117-1.024.433-.245.936-.365 1.5-.365.54 0 1.033.107 1.48.324.448.217.786.619 1.017 1.205.24-.376.558-.702.956-.98.398-.277.872-.414 1.424-.414.41 0 .784.065 1.122.194.34.13.629.325.87.588.241.263.428.59.56.984.132.393.198.85.198 1.368v5.89h-2.49v-4.893c0-.268-.016-.525-.048-.77a1.627 1.627 0 00-.2-.63 1.028 1.028 0 00-.392-.426 1.294 1.294 0 00-.616-.134c-.277 0-.508.05-.693.15a1.043 1.043 0 00-.43.41 1.768 1.768 0 00-.214.616 4.15 4.15 0 00-.06.74v4.937H9.29v-4.937c0-.25-.01-.498-.032-.742a1.84 1.84 0 00-.166-.638.998.998 0 00-.363-.448 1.206 1.206 0 00-.624-.154c-.26 0-.483.048-.67.144a1.055 1.055 0 00-.436.402 1.744 1.744 0 00-.227.616 4.108 4.108 0 00-.063.74v4.937H5.21V7.81zm15.693 15.64V.55H21.72V0H24v24h-2.28v-.55z"/></svg>'},{key:"feishu",name:"Feishu",exclusive:!0,icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M6.59 3.41a2.25 2.25 0 0 1 3.182 0L13.5 7.14l-3.182 3.182L6.59 7.59a2.25 2.25 0 0 1 0-3.182zm5.303 5.303L15.075 5.53a2.25 2.25 0 0 1 3.182 3.182L15.075 11.894 11.893 8.713zM3.41 6.59a2.25 2.25 0 0 1 3.182 0l3.182 3.182-3.182 3.182a2.25 2.25 0 0 1-3.182-3.182L3.41 6.59zm5.303 5.303L11.894 15.075a2.25 2.25 0 0 1-3.182 3.182L5.53 15.075 8.713 11.893zm5.303-5.303L17.478 9.778a2.25 2.25 0 0 1-3.182 3.182L10.53 10.075l3.182-3.182 0 .023z"/></svg>'},{key:"weixin",name:"Weixin",exclusive:!0,icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M8.691 2.188C3.891 2.188 0 5.476 0 9.53c0 2.212 1.17 4.203 3.002 5.55a.59.59 0 01.213.665l-.39 1.48c-.019.07-.048.141-.048.213 0 .163.13.295.29.295a.326.326 0 00.167-.054l1.903-1.114a.864.864 0 01.717-.098 10.16 10.16 0 002.837.403c.276 0 .543-.027.811-.05-.857-2.578.157-4.972 1.932-6.446 1.703-1.415 3.882-1.98 5.853-1.838-.576-3.583-4.196-6.348-8.596-6.348zM5.785 5.991c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 01-1.162 1.178A1.17 1.17 0 014.623 7.17c0-.651.52-1.18 1.162-1.18zm5.813 0c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 01-1.162 1.178 1.17 1.17 0 01-1.162-1.178c0-.651.52-1.18 1.162-1.18zm3.68 4.025c-3.694 0-6.69 2.462-6.69 5.496 0 3.034 2.996 5.496 6.69 5.496.753 0 1.477-.1 2.158-.28a.66.66 0 01.548.074l1.46.854a.25.25 0 00.127.041.224.224 0 00.221-.225c0-.055-.022-.109-.037-.162l-.298-1.131a.453.453 0 01.163-.509C21.81 18.613 22.77 16.973 22.77 15.512c0-3.034-2.996-5.496-6.69-5.496h.198zm-2.454 3.347c.491 0 .889.404.889.902a.896.896 0 01-.889.903.896.896 0 01-.889-.903c0-.498.398-.902.889-.902zm4.912 0c.491 0 .889.404.889.902a.896.896 0 01-.889.903.896.896 0 01-.889-.903c0-.498.398-.902.889-.902z"/></svg>'},{key:"wecom",name:"WeCom",icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M8.691 2.188C3.891 2.188 0 5.476 0 9.53c0 2.212 1.17 4.203 3.002 5.55a.59.59 0 01.213.665l-.39 1.48c-.019.07-.048.141-.048.213 0 .163.13.295.29.295a.326.326 0 00.167-.054l1.903-1.114a.864.864 0 01.717-.098 10.16 10.16 0 002.837.403c.276 0 .543-.027.811-.05-.857-2.578.157-4.972 1.932-6.446 1.703-1.415 3.882-1.98 5.853-1.838-.576-3.583-4.196-6.348-8.596-6.348zM5.785 5.991c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 01-1.162 1.178A1.17 1.17 0 014.623 7.17c0-.651.52-1.18 1.162-1.18zm5.813 0c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 01-1.162 1.178 1.17 1.17 0 01-1.162-1.178c0-.651.52-1.18 1.162-1.18zm3.68 4.025c-3.694 0-6.69 2.462-6.69 5.496 0 3.034 2.996 5.496 6.69 5.496.753 0 1.477-.1 2.158-.28a.66.66 0 01.548.074l1.46.854a.25.25 0 00.127.041.224.224 0 00.221-.225c0-.055-.022-.109-.037-.162l-.298-1.131a.453.453 0 01.163-.509C21.81 18.613 22.77 16.973 22.77 15.512c0-3.034-2.996-5.496-6.69-5.496h.198zm-2.454 3.347c.491 0 .889.404.889.902a.896.896 0 01-.889.903.896.896 0 01-.889-.903c0-.498.398-.902.889-.902zm4.912 0c.491 0 .889.404.889.902a.896.896 0 01-.889.903.896.896 0 01-.889-.903c0-.498.398-.902.889-.902z"/></svg>'}];return(d,l)=>{const q=xe("NSpin");return c(),h("section",J,[(c(),h(x,null,qe(he,_=>t(pe,{key:_.key,name:_.name,icon:_.icon,exclusive:_.exclusive,config:e(s)[_.key],credentials:m(_.key)},{default:o(()=>[_.key==="telegram"?(c(),h(x,{key:0},[t(r,{label:e(a)("platform.botToken"),hint:e(a)("platform.botTokenHint")},{default:o(()=>[t(e(p),{"default-value":m("telegram").token||"",loading:i("telegram","token"),clearable:"",size:"small",class:"input-lg",placeholder:"123456:ABC-DEF...",onChange:l[0]||(l[0]=n=>f("telegram","token",{token:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(a)("platform.requireMention"),hint:e(a)("platform.requireMentionGroup")},{default:o(()=>[t(e(b),{value:e(s).telegram.require_mention,loading:i("telegram","require_mention"),"onUpdate:value":l[1]||(l[1]=n=>u("telegram","require_mention",{require_mention:n}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(a)("platform.reactions"),hint:e(a)("platform.reactionsHint")},{default:o(()=>[t(e(b),{value:e(s).telegram.reactions,loading:i("telegram","reactions"),"onUpdate:value":l[2]||(l[2]=n=>u("telegram","reactions",{reactions:n}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(a)("platform.freeResponseChats"),hint:e(a)("platform.freeResponseChatsHint")},{default:o(()=>[t(e(p),{"default-value":e(s).telegram.free_response_chats||"",loading:i("telegram","free_response_chats"),size:"small",placeholder:"chat_id1,chat_id2",onChange:l[3]||(l[3]=n=>u("telegram","free_response_chats",{free_response_chats:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(a)("platform.mentionPatterns"),hint:e(a)("platform.mentionPatternsHint")},{default:o(()=>[t(e(p),{"default-value":(e(s).telegram.mention_patterns||[]).join(", "),loading:i("telegram","mention_patterns"),size:"small",placeholder:"pattern1, pattern2",onChange:l[4]||(l[4]=n=>u("telegram","mention_patterns",{mention_patterns:n?n.split(",").map(A=>A.trim()):[]}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"])],64)):g("",!0),_.key==="discord"?(c(),h(x,{key:1},[t(r,{label:e(a)("platform.botToken"),hint:e(a)("platform.botTokenHint")},{default:o(()=>[t(e(p),{"default-value":m("discord").token||"",loading:i("discord","token"),clearable:"",size:"small",class:"input-lg",placeholder:"Bot token...",onChange:l[5]||(l[5]=n=>f("discord","token",{token:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(a)("platform.requireMention"),hint:e(a)("platform.requireMentionChannel")},{default:o(()=>[t(e(b),{value:e(s).discord.require_mention,loading:i("discord","require_mention"),"onUpdate:value":l[6]||(l[6]=n=>u("discord","require_mention",{require_mention:n}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(a)("platform.autoThread"),hint:e(a)("platform.autoThreadHint")},{default:o(()=>[t(e(b),{value:e(s).discord.auto_thread,loading:i("discord","auto_thread"),"onUpdate:value":l[7]||(l[7]=n=>u("discord","auto_thread",{auto_thread:n}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(a)("platform.reactions"),hint:e(a)("platform.reactionsHint")},{default:o(()=>[t(e(b),{value:e(s).discord.reactions,loading:i("discord","reactions"),"onUpdate:value":l[8]||(l[8]=n=>u("discord","reactions",{reactions:n}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(a)("platform.freeResponseChannels"),hint:e(a)("platform.freeResponseChannelsHint")},{default:o(()=>[t(e(p),{"default-value":e(s).discord.free_response_channels||"",loading:i("discord","free_response_channels"),size:"small",placeholder:"channel_id1,channel_id2",onChange:l[9]||(l[9]=n=>u("discord","free_response_channels",{free_response_channels:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(a)("platform.allowedChannels"),hint:e(a)("platform.allowedChannelsHint")},{default:o(()=>[t(e(p),{"default-value":e(s).discord.allowed_channels||"",loading:i("discord","allowed_channels"),size:"small",placeholder:"channel_id1,channel_id2",onChange:l[10]||(l[10]=n=>u("discord","allowed_channels",{allowed_channels:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(a)("platform.ignoredChannels"),hint:e(a)("platform.ignoredChannelsHint")},{default:o(()=>[t(e(p),{"default-value":e(s).discord.ignored_channels||"",loading:i("discord","ignored_channels"),size:"small",placeholder:"channel_id1,channel_id2",onChange:l[11]||(l[11]=n=>u("discord","ignored_channels",{ignored_channels:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(a)("platform.noThreadChannels"),hint:e(a)("platform.noThreadChannelsHint")},{default:o(()=>[t(e(p),{"default-value":e(s).discord.no_thread_channels||"",loading:i("discord","no_thread_channels"),size:"small",placeholder:"channel_id1,channel_id2",onChange:l[12]||(l[12]=n=>u("discord","no_thread_channels",{no_thread_channels:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"])],64)):g("",!0),_.key==="slack"?(c(),h(x,{key:2},[t(r,{label:e(a)("platform.botToken"),hint:e(a)("platform.botTokenHint")},{default:o(()=>[t(e(p),{"default-value":m("slack").token||"",loading:i("slack","token"),clearable:"",size:"small",class:"input-lg",placeholder:"xoxb-...",onChange:l[13]||(l[13]=n=>f("slack","token",{token:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(a)("platform.requireMention"),hint:e(a)("platform.requireMentionChannel")},{default:o(()=>[t(e(b),{value:e(s).slack.require_mention,loading:i("slack","require_mention"),"onUpdate:value":l[14]||(l[14]=n=>u("slack","require_mention",{require_mention:n}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(a)("platform.allowBots"),hint:e(a)("platform.allowBotsHint")},{default:o(()=>[t(e(b),{value:e(s).slack.allow_bots,loading:i("slack","allow_bots"),"onUpdate:value":l[15]||(l[15]=n=>u("slack","allow_bots",{allow_bots:n}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(a)("platform.freeResponseChannels"),hint:e(a)("platform.freeResponseChannelsHint")},{default:o(()=>[t(e(p),{"default-value":e(s).slack.free_response_channels||"",loading:i("slack","free_response_channels"),size:"small",placeholder:"channel_id1,channel_id2",onChange:l[16]||(l[16]=n=>u("slack","free_response_channels",{free_response_channels:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"])],64)):g("",!0),_.key==="whatsapp"?(c(),h(x,{key:3},[t(r,{label:e(a)("platform.waEnabled"),hint:e(a)("platform.waEnabledHint")},{default:o(()=>[t(e(b),{value:m("whatsapp").enabled,loading:i("whatsapp","enabled"),"onUpdate:value":l[17]||(l[17]=n=>f("whatsapp","enabled",{enabled:n}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(a)("platform.requireMention"),hint:e(a)("platform.requireMentionGroup")},{default:o(()=>[t(e(b),{value:e(s).whatsapp.require_mention,loading:i("whatsapp","require_mention"),"onUpdate:value":l[18]||(l[18]=n=>u("whatsapp","require_mention",{require_mention:n}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(a)("platform.freeResponseChats"),hint:e(a)("platform.freeResponseChatsHint")},{default:o(()=>[t(e(p),{"default-value":e(s).whatsapp.free_response_chats||"",loading:i("whatsapp","free_response_chats"),size:"small",placeholder:"chat_id1,chat_id2",onChange:l[19]||(l[19]=n=>u("whatsapp","free_response_chats",{free_response_chats:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(a)("platform.mentionPatterns"),hint:e(a)("platform.mentionPatternsHint")},{default:o(()=>[t(e(p),{"default-value":(e(s).whatsapp.mention_patterns||[]).join(", "),loading:i("whatsapp","mention_patterns"),size:"small",placeholder:"pattern1, pattern2",onChange:l[20]||(l[20]=n=>u("whatsapp","mention_patterns",{mention_patterns:n?n.split(",").map(A=>A.trim()):[]}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"])],64)):g("",!0),_.key==="matrix"?(c(),h(x,{key:4},[t(r,{label:e(a)("platform.accessToken"),hint:e(a)("platform.accessTokenHint")},{default:o(()=>[t(e(p),{"default-value":m("matrix").token||"",loading:i("matrix","token"),clearable:"",size:"small",class:"input-lg",placeholder:"syt_...",onChange:l[21]||(l[21]=n=>f("matrix","token",{token:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(a)("platform.homeserver"),hint:e(a)("platform.homeserverHint")},{default:o(()=>[t(e(p),{"default-value":m("matrix").extra?.homeserver||"",loading:i("matrix","homeserver"),clearable:"",size:"small",class:"input-lg",placeholder:"https://matrix.org",onChange:l[22]||(l[22]=n=>f("matrix","homeserver",{extra:{...m("matrix").extra,homeserver:n}}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(a)("platform.requireMention"),hint:e(a)("platform.requireMentionRoom")},{default:o(()=>[t(e(b),{value:e(s).matrix.require_mention,loading:i("matrix","require_mention"),"onUpdate:value":l[23]||(l[23]=n=>u("matrix","require_mention",{require_mention:n}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(a)("platform.autoThread"),hint:e(a)("platform.autoThreadHintRoom")},{default:o(()=>[t(e(b),{value:e(s).matrix.auto_thread,loading:i("matrix","auto_thread"),"onUpdate:value":l[24]||(l[24]=n=>u("matrix","auto_thread",{auto_thread:n}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(a)("platform.dmMentionThreads"),hint:e(a)("platform.dmMentionThreadsHint")},{default:o(()=>[t(e(b),{value:e(s).matrix.dm_mention_threads,loading:i("matrix","dm_mention_threads"),"onUpdate:value":l[25]||(l[25]=n=>u("matrix","dm_mention_threads",{dm_mention_threads:n}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(a)("platform.freeResponseRooms"),hint:e(a)("platform.freeResponseRoomsHint")},{default:o(()=>[t(e(p),{"default-value":e(s).matrix.free_response_rooms||"",loading:i("matrix","free_response_rooms"),size:"small",placeholder:"room_id1,room_id2",onChange:l[26]||(l[26]=n=>u("matrix","free_response_rooms",{free_response_rooms:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"])],64)):g("",!0),_.key==="feishu"?(c(),h(x,{key:5},[t(r,{label:e(a)("platform.appId"),hint:e(a)("platform.appIdHint")},{default:o(()=>[t(e(p),{"default-value":m("feishu").extra?.app_id||"",loading:i("feishu","app_id"),clearable:"",size:"small",class:"input-lg",placeholder:"cli_...",onChange:l[27]||(l[27]=n=>f("feishu","app_id",{extra:{...m("feishu").extra,app_id:n}}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(a)("platform.appSecret"),hint:e(a)("platform.appSecretHint")},{default:o(()=>[t(e(p),{"default-value":m("feishu").extra?.app_secret||"",loading:i("feishu","app_secret"),clearable:"",size:"small",class:"input-lg",placeholder:"App Secret",onChange:l[28]||(l[28]=n=>f("feishu","app_secret",{extra:{...m("feishu").extra,app_secret:n}}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(a)("platform.requireMention"),hint:e(a)("platform.requireMentionGroup")},{default:o(()=>[t(e(b),{value:e(s).feishu.require_mention,loading:i("feishu","require_mention"),"onUpdate:value":l[29]||(l[29]=n=>u("feishu","require_mention",{require_mention:n}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(a)("platform.freeResponseChats"),hint:e(a)("platform.freeResponseChatsHint")},{default:o(()=>[t(e(p),{"default-value":e(s).feishu.free_response_chats||"",loading:i("feishu","free_response_chats"),size:"small",placeholder:"chat_id1,chat_id2",onChange:l[30]||(l[30]=n=>u("feishu","free_response_chats",{free_response_chats:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"])],64)):g("",!0),_.key==="dingtalk"?(c(),h(x,{key:6},[t(r,{label:e(a)("platform.clientId"),hint:e(a)("platform.clientIdHint")},{default:o(()=>[t(e(p),{"default-value":m("dingtalk").extra?.client_id||"",loading:i("dingtalk","client_id"),clearable:"",size:"small",class:"input-lg",placeholder:"Client ID",onChange:l[31]||(l[31]=n=>f("dingtalk","client_id",{extra:{...m("dingtalk").extra,client_id:n}}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(a)("platform.clientSecret"),hint:e(a)("platform.clientSecretHint")},{default:o(()=>[t(e(p),{"default-value":m("dingtalk").extra?.client_secret||"",loading:i("dingtalk","client_secret"),clearable:"",size:"small",class:"input-lg",placeholder:"Client Secret",onChange:l[32]||(l[32]=n=>f("dingtalk","client_secret",{extra:{...m("dingtalk").extra,client_secret:n}}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(a)("platform.requireMention"),hint:e(a)("platform.requireMentionGroup")},{default:o(()=>[t(e(b),{value:e(s).dingtalk.require_mention,loading:i("dingtalk","require_mention"),"onUpdate:value":l[33]||(l[33]=n=>u("dingtalk","require_mention",{require_mention:n}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(a)("platform.freeResponseChats"),hint:e(a)("platform.freeResponseChatsHint")},{default:o(()=>[t(e(p),{"default-value":e(s).dingtalk.free_response_chats||"",loading:i("dingtalk","free_response_chats"),size:"small",placeholder:"chat_id1,chat_id2",onChange:l[34]||(l[34]=n=>u("dingtalk","free_response_chats",{free_response_chats:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"])],64)):g("",!0),_.key==="weixin"?(c(),h(x,{key:7},[w("div",Y,[v.value==="idle"||v.value==="error"||v.value==="expired"||v.value==="confirmed"?(c(),V(e(He),{key:0,type:"primary",size:"small",onClick:_e},{default:o(()=>[I(H(v.value==="confirmed"?e(a)("platform.qrRelogin"):e(a)("platform.qrLogin")),1)]),_:1})):g("",!0),v.value==="loading"?(c(),h("div",ee,[t(q,{size:"small"}),w("span",null,H(e(a)("platform.qrFetching")),1)])):g("",!0),v.value==="waiting"||v.value==="scaned"?(c(),h("div",ae,H(v.value==="scaned"?e(a)("platform.qrScanedHint"):e(a)("platform.qrScanHint")),1)):g("",!0)]),t(r,{label:e(a)("platform.weixinToken"),hint:e(a)("platform.weixinTokenHint")},{default:o(()=>[t(e(p),{"default-value":m("weixin").token||"",loading:i("weixin","token"),clearable:"",size:"small",class:"input-lg",placeholder:"Token",onChange:l[35]||(l[35]=n=>f("weixin","token",{token:n}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(a)("platform.accountId"),hint:e(a)("platform.accountIdHint")},{default:o(()=>[t(e(p),{"default-value":m("weixin").extra?.account_id||"",loading:i("weixin","account_id"),clearable:"",size:"small",class:"input-lg",placeholder:"Account ID",onChange:l[36]||(l[36]=n=>f("weixin","account_id",{extra:{...m("weixin").extra,account_id:n}}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"])],64)):g("",!0),_.key==="wecom"?(c(),h(x,{key:8},[t(r,{label:e(a)("platform.botId"),hint:e(a)("platform.botIdHint")},{default:o(()=>[t(e(p),{"default-value":m("wecom").extra?.bot_id||"",loading:i("wecom","bot_id"),clearable:"",size:"small",class:"input-lg",placeholder:"Bot ID",onChange:l[37]||(l[37]=n=>f("wecom","bot_id",{extra:{...m("wecom").extra,bot_id:n}}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"]),t(r,{label:e(a)("platform.appSecret"),hint:e(a)("platform.wecomSecretHint")},{default:o(()=>[t(e(p),{"default-value":m("wecom").extra?.secret||"",loading:i("wecom","secret"),clearable:"",size:"small",class:"input-lg",placeholder:"Secret",onChange:l[38]||(l[38]=n=>f("wecom","secret",{extra:{...m("wecom").extra,secret:n}}))},null,8,["default-value","loading"])]),_:1},8,["label","hint"])],64)):g("",!0)]),_:2},1032,["name","icon","exclusive","config","credentials"])),64))])}}})})),Le=C((()=>{})),fe,Ue=C((()=>{le(),le(),Le(),Q(),fe=D(me,[["__scopeId","data-v-ee52227d"]])})),te,ne,ie,oe,ce,re=C((()=>{$(),U(),W(),de(),Ue(),te={class:"channels-view"},ne={class:"page-header"},ie={class:"header-title"},oe={class:"channels-content"},ce=L({__name:"ChannelsView",setup(S){const s=se(),{t:k}=F();return we(()=>{s.fetchSettings()}),(a,y)=>(c(),h("div",te,[w("header",ne,[w("h2",ie,H(e(k)("sidebar.channels")),1)]),w("div",oe,[t(e(Se),{show:e(s).loading||e(s).saving,size:"large",description:e(k)("common.loading")},{default:o(()=>[e(s).loading?g("",!0):(c(),V(fe,{key:0}))]),_:1},8,["show","description"])])]))}})})),$e=C((()=>{})),We,Fe=C((()=>{re(),re(),$e(),Q(),We=D(ce,[["__scopeId","data-v-e25dbf6c"]])}));Fe();export{We as default};
@@ -1,3 +1,3 @@
1
- import{n as R}from"./rolldown-runtime-iJLb3ux7.js";import{$ as w,C as xe,E as $n,Ft as G,G as Mn,It as en,J as In,K as Pn,Lt as l,P as Tn,Pt as t,Q as K,U as Bn,V as Fn,W as Ve,X as q,Z as e,_t as Ln,bt as k,c as Dn,d as Rn,dt as de,et as o,ft as Ae,g as ze,ht as ee,it as ie,j as H,kt as m,lt as ke,nt as U,pt as n,q as W,rt as b,t as Me,u as tn,vt as X,x as En,xt as Le,y as De,z as ae}from"./ui-vendor-DIP97-f3.js";import{n as ve,r as he}from"./vue-vendor-DHimL2gr.js";import{d as Re,i as An,l as sn,o as Oe,r as zn,s as Ue}from"./router-BfmZqYKj.js";import{t as On}from"./logo-BnHwDXCu.js";import{n as Un,t as Nn}from"./useTheme-B0TxXkB2.js";import{n as Ee,t as nn}from"./app-CRJO72mI.js";import{n as oe,t as le}from"./_plugin-vue_export-helper-JVWBimuG.js";import{n as Ie,t as Pe}from"./chat-CW3_uh-9.js";import{f as Vn,l as an,r as qn,t as Hn,u as Wn}from"./sessions-Cxahzjxf.js";import{n as Kn,t as Gn}from"./settings-Dm8GxViy.js";import{n as jn,t as Jn}from"./session-browser-prefs-Dl3WfwAw.js";import{a as Yn,c as $e,i as Xn,l as on,n as Qn,o as Zn,r as ei,s as qe,t as He}from"./SessionListItem-B-sKqWVK.js";import{n as ti,t as si}from"./clipboard-D3SeHW1n.js";import{a as ni,i as ii,n as ai,o as oi,r as li,s as ri,t as ui}from"./xterm-Bov7T25g.js";import{_ as ci,a as di,b as vi,c as hi,d as fi,f as _i,g as pi,h as mi,i as gi,l as yi,m as wi,n as ki,o as xi,p as bi,r as Si,s as Ci,t as $i,u as Mi,v as Ii,y as Pi}from"./FileRenameModal-ekm_sUbS.js";async function Ti(z,s,_){return(await Ue(`/api/hermes/model-context/${encodeURIComponent(z)}/${encodeURIComponent(s)}`,{method:"PUT",body:JSON.stringify({provider:z,model:s,context_limit:_})})).data}var Bi=R((()=>{Oe()})),We,Ke,Ge,je,Je,Ye,Xe,Qe,Ze,et,tt,st,nt,it,at,ot,lt,ln,rt=R((()=>{ae(),Pe(),nn(),sn(),an(),Bi(),Me(),ve(),We={class:"chat-input-area"},Ke={class:"input-top-bar"},Ge={class:"auto-play-speech-switch"},je={key:1,class:"context-bar"},Je={key:0,class:"attachment-previews"},Ye=["src","alt"],Xe={key:1,class:"attachment-file"},Qe={class:"file-name"},Ze={class:"file-size"},et=["onClick"],tt=["placeholder"],st={class:"input-actions"},nt={class:"context-edit-content"},it={style:{"margin-bottom":"16px",color:"#666"}},at={style:{"margin-top":"12px","font-size":"12px",color:"#999"}},ot={style:{display:"flex","justify-content":"flex-end",gap:"8px"}},lt=2e5,ln=ie({__name:"ChatInput",setup(z){const s=Ie(),{t:_}=he(),C=ze(),a=m(""),g=m(),L=m(),S=m([]),y=m(!1),M=m(0),B=m(!1),$=m(!1);de(()=>{const u=localStorage.getItem("autoPlaySpeech");u!==null&&($.value=u==="true",s.setAutoPlaySpeech($.value))}),X($,u=>{localStorage.setItem("autoPlaySpeech",String(u)),s.setAutoPlaySpeech(u)});const v=q(()=>a.value.trim()||S.value.length>0),h=m(2e5),f=m(!1),D=m(2e5),O=m(!1);async function Y(){D.value=h.value,f.value=!0}async function A(){if(!D.value||D.value<=0){C.error(_("chat.contextEditInvalid"));return}O.value=!0;try{const u=Ee(),p=u.selectedProvider||"",I=u.selectedModel||"";if(!p||!I){C.error(_("chat.contextEditFailed"));return}await Ti(p,I,D.value),h.value=D.value,f.value=!1,C.success(_("chat.contextEditSuccess"))}catch(u){C.error(`${_("chat.contextEditFailed")}: ${u.message||""}`)}finally{O.value=!1}}async function F(){try{h.value=await qn(Re().activeProfileName||void 0)}catch{h.value=lt}}de(F),X(()=>Re().activeProfileName,F),X(()=>Ee().selectedModel,F);const x=q(()=>(s.activeSession?.inputTokens??0)+(s.activeSession?.outputTokens??0)),j=q(()=>Math.max(0,h.value-x.value)),N=q(()=>Math.min(x.value/h.value*100,100));function Q(u){return u>=1e6?(u/1e6).toFixed(1)+"M":u>=1e3?(u/1e3).toFixed(1)+"k":String(u)}function Z(u){if(S.value.find(ne=>ne.name===u.name))return;const p=Date.now().toString(36)+Math.random().toString(36).slice(2,8),I=URL.createObjectURL(u);S.value.push({id:p,name:u.name,type:u.type,size:u.size,url:I,file:u})}function ye(){L.value?.click()}function re(u){const p=u.target;if(p.files){for(const I of p.files)Z(I);p.value=""}}function fe(u){const p=Array.from(u.clipboardData?.items||[]).filter(I=>I.type.startsWith("image/"));if(p.length){u.preventDefault();for(const I of p){const ne=I.getAsFile();if(!ne)continue;const Be=I.type.split("/")[1]||"png";Z(new File([ne],`pasted-${Date.now()}.${Be}`,{type:I.type}))}}}function _e(u){u.preventDefault()}function ue(u){u.preventDefault(),u.dataTransfer?.types.includes("Files")&&(M.value++,y.value=!0)}function te(){M.value--,M.value<=0&&(M.value=0,y.value=!1)}function pe(u){u.preventDefault(),M.value=0,y.value=!1;const p=Array.from(u.dataTransfer?.files||[]);if(p.length){for(const I of p)Z(I);g.value?.focus()}}function ce(){const u=a.value.trim();!u&&S.value.length===0||(s.sendMessage(u,S.value.length>0?S.value:void 0),a.value="",S.value=[],g.value&&(g.value.style.height="auto"))}function me(){B.value=!0}function c(){requestAnimationFrame(()=>{B.value=!1})}function d(u){return B.value||u.isComposing||u.keyCode===229}function P(u){u.key!=="Enter"||u.shiftKey||d(u)||(u.preventDefault(),ce())}function se(u){const p=u.target;p.style.height="auto",p.style.height=Math.min(p.scrollHeight,100)+"px"}function J(u){const p=S.value.findIndex(I=>I.id===u);p!==-1&&(URL.revokeObjectURL(S.value[p].url),S.value.splice(p,1))}function Te(u){return u<1024?u+" B":u<1024*1024?(u/1024).toFixed(1)+" KB":(u/(1024*1024)).toFixed(1)+" MB"}function be(u){return u.startsWith("image/")}return(u,p)=>(n(),o("div",We,[e("div",Ke,[b(t(xe),{trigger:"hover"},{trigger:k(()=>[b(t(H),{quaternary:"",size:"tiny",onClick:ye,circle:""},{icon:k(()=>[...p[6]||(p[6]=[e("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[e("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"})],-1)])]),_:1})]),default:k(()=>[U(" "+l(t(_)("chat.attachFiles")),1)]),_:1}),e("div",Ge,[b(t(xe),{trigger:"hover"},{trigger:k(()=>[...p[7]||(p[7]=[e("div",{class:"switch-label"},[e("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("polygon",{points:"5 3 19 12 5 21 5 3"})])],-1)])]),default:k(()=>[U(" "+l(t(_)("chat.autoPlaySpeech")),1)]),_:1}),b(t(Dn),{size:"small",value:$.value,"onUpdate:value":p[0]||(p[0]=I=>$.value=I),round:!1},null,8,["value"])]),x.value>0?(n(),o("span",{key:0,class:G(["context-info",{"context-warning":N.value>80}])},[U(l(Q(x.value))+" / ",1),b(t(xe),{trigger:"hover"},{trigger:k(()=>[e("span",{class:"context-limit-editable",onClick:Y},l(Q(h.value)),1)]),default:k(()=>[e("span",null,l(t(_)("chat.contextClickToEdit")),1)]),_:1}),U(" · "+l(t(_)("chat.contextRemaining"))+" "+l(Q(j.value)),1)],2)):w("",!0),x.value>0?(n(),o("div",je,[e("div",{class:G(["context-bar-fill",{"context-bar-warn":N.value>60&&N.value<=80,"context-bar-danger":N.value>80}]),style:en({width:`${N.value}%`})},null,6)])):w("",!0)]),S.value.length>0?(n(),o("div",Je,[(n(!0),o(W,null,ee(S.value,I=>(n(),o("div",{key:I.id,class:G(["attachment-preview",{image:be(I.type)}])},[be(I.type)?(n(),o("img",{key:0,src:I.url,alt:I.name,class:"attachment-thumb"},null,8,Ye)):(n(),o("div",Xe,[p[8]||(p[8]=e("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[e("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),e("polyline",{points:"14 2 14 8 20 8"})],-1)),e("span",Qe,l(I.name),1),e("span",Ze,l(Te(I.size)),1)])),e("button",{class:"attachment-remove",onClick:ne=>J(I.id)},[...p[9]||(p[9]=[e("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])],8,et)],2))),128))])):w("",!0),e("div",{class:G(["input-wrapper",{"drag-over":y.value}]),onDragover:_e,onDragenter:ue,onDragleave:te,onDrop:pe},[e("input",{ref_key:"fileInputRef",ref:L,type:"file",multiple:"",class:"file-input-hidden",onChange:re},null,544),Le(e("textarea",{ref_key:"textareaRef",ref:g,"onUpdate:modelValue":p[1]||(p[1]=I=>a.value=I),class:"input-textarea",placeholder:t(_)("chat.inputPlaceholder"),rows:"1",onKeydown:P,onCompositionstart:me,onCompositionend:c,onInput:se,onPaste:fe},null,40,tt),[[Bn,a.value]]),e("div",st,[t(s).isStreaming?(n(),K(t(H),{key:0,size:"small",type:"error",disabled:t(s).isAborting,onClick:p[2]||(p[2]=I=>t(s).stopStreaming())},{default:k(()=>[U(l(t(_)("chat.stop")),1)]),_:1},8,["disabled"])):w("",!0),b(t(H),{size:"small",type:"primary",disabled:!v.value||t(s).isStreaming,onClick:ce},{icon:k(()=>[...p[10]||(p[10]=[e("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),e("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})],-1)])]),default:k(()=>[U(" "+l(t(_)("chat.send")),1)]),_:1},8,["disabled"])])],34),b(t(De),{show:f.value,"onUpdate:show":p[5]||(p[5]=I=>f.value=I),title:t(_)("chat.contextEditTitle"),"mask-closable":!0,preset:"card",style:{width:"400px"}},{footer:k(()=>[e("div",ot,[b(t(H),{onClick:p[4]||(p[4]=I=>f.value=!1),disabled:O.value},{default:k(()=>[U(l(t(_)("chat.contextEditCancel")),1)]),_:1},8,["disabled"]),b(t(H),{type:"primary",onClick:A,loading:O.value},{default:k(()=>[U(l(t(_)("chat.contextEditSave")),1)]),_:1},8,["loading"])])]),default:k(()=>[e("div",nt,[e("p",it,l(t(_)("chat.contextEditDesc")),1),b(t(Rn),{value:D.value,"onUpdate:value":p[3]||(p[3]=I=>D.value=I),min:1e3,max:1e7,step:1e3,"show-button":!1,placeholder:t(_)("chat.contextEditPlaceholder"),style:{width:"100%"}},{suffix:k(()=>[...p[11]||(p[11]=[e("span",{style:{color:"#999"}},"tokens",-1)])]),_:1},8,["value","placeholder"]),e("div",at,l(t(_)("chat.contextEditHint")),1)])]),_:1},8,["show","title"])]))}})})),Fi=R((()=>{})),rn,Li=R((()=>{rt(),rt(),Fi(),oe(),rn=le(ln,[["__scopeId","data-v-1a738dbc"]])}));async function Di(z={}){const s=new URLSearchParams;return z.humanOnly===!1&&s.set("humanOnly","false"),z.source&&s.set("source",z.source),z.limit!=null&&s.set("limit",String(z.limit)),(await Ue(`/api/hermes/sessions/conversations${s.toString()?`?${s.toString()}`:""}`)).sessions}async function Ri(z,s={}){const _=new URLSearchParams;s.humanOnly===!1&&_.set("humanOnly","false"),s.source&&_.set("source",s.source);const C=_.toString()?`?${_.toString()}`:"";return Ue(`/api/hermes/sessions/conversations/${encodeURIComponent(z)}/messages${C}`)}var Ei=R((()=>{Oe()})),ut,ct,dt,vt,ht,ft,_t,pt,mt,gt,yt,wt,kt,xt,bt,St,Ct,$t,Mt,It,Pt,un,Tt=R((()=>{ae(),Ei(),on(),ve(),ut={class:"conversation-monitor"},ct={class:"conversation-monitor__sidebar"},dt={key:0,class:"conversation-monitor__empty"},vt={key:1,class:"conversation-monitor__empty"},ht=["aria-pressed","onClick"],ft={class:"conversation-monitor__session-title-row"},_t={class:"conversation-monitor__session-title"},pt={key:0,class:"conversation-monitor__session-live"},mt={class:"conversation-monitor__session-meta"},gt={key:0,class:"conversation-monitor__session-preview"},yt={class:"conversation-monitor__detail"},wt={key:0,class:"conversation-monitor__detail-header"},kt={class:"conversation-monitor__detail-title"},xt={class:"conversation-monitor__detail-meta"},bt={key:1,class:"conversation-monitor__empty conversation-monitor__empty--error"},St={key:2,class:"conversation-monitor__empty"},Ct={key:3,class:"conversation-monitor__empty"},$t={key:4,class:"conversation-monitor__messages"},Mt={class:"conversation-monitor__message-meta"},It={class:"conversation-monitor__message-content"},Pt=15e3,un=ie({__name:"ConversationMonitorPane",props:{humanOnly:{type:Boolean}},setup(z){const s=z,{t:_}=he(),C=m([]),a=m(null),g=m(null),L=m(!1),S=m(!1),y=m("");let M=null,B=0,$=0;const v=q(()=>C.value.find(A=>A.id===a.value)||null);function h(A){return _(A==="user"?"chat.monitorRoleUser":"chat.monitorRoleAssistant")}function f(A){return _("chat.linkedSessions",{count:A})}function D(){B+=1,$+=1}async function O(A=!1){const F=++B;A||(L.value=!0,y.value="");try{const x=await Di({humanOnly:s.humanOnly});if(F!==B)return;if(C.value=x,!x.length){a.value=null,g.value=null;return}(!a.value||!x.some(j=>j.id===a.value))&&(a.value=x[0].id)}catch(x){if(F!==B||A)return;y.value=x?.message||String(x),C.value=[],a.value=null,g.value=null}finally{!A&&F===B&&(L.value=!1)}}async function Y(A,F=!1){const x=++$;if(!A){g.value=null;return}const j=s.humanOnly;F||(S.value=!0,y.value="");try{const N=await Ri(A,{humanOnly:j});if(x!==$||A!==a.value||j!==s.humanOnly)return;g.value=N}catch(N){if(x!==$||F)return;y.value=N?.message||String(N),g.value=null}finally{!F&&x===$&&(S.value=!1)}}return X(a,async A=>{await Y(A,!1)}),X(()=>s.humanOnly,async()=>{D(),a.value=null,g.value=null,await O(!1)}),de(async()=>{await O(!1),M=setInterval(async()=>{await O(!0),a.value&&await Y(a.value,!0)},Pt)}),Ae(()=>{D(),M&&clearInterval(M)}),(A,F)=>(n(),o("div",ut,[e("aside",ct,[L.value&&C.value.length===0?(n(),o("div",dt,l(t(_)("common.loading")),1)):C.value.length===0?(n(),o("div",vt,l(t(_)("chat.noSessions")),1)):w("",!0),(n(!0),o(W,null,ee(C.value,x=>(n(),o("button",{key:x.id,class:G(["conversation-monitor__session",{active:x.id===a.value}]),"aria-pressed":x.id===a.value,onClick:j=>a.value=x.id},[e("div",ft,[e("span",_t,l(x.title||x.preview||x.id),1),x.is_active?(n(),o("span",pt,l(t(_)("chat.recentBadge")),1)):w("",!0)]),e("div",mt,l(t($e)(x.source))+" · "+l(t(qe)(x.last_active)),1),x.preview?(n(),o("div",gt,l(x.preview),1)):w("",!0)],10,ht))),128))]),e("section",yt,[v.value?(n(),o("header",wt,[e("div",kt,l(v.value.title||v.value.preview||v.value.id),1),e("div",xt,[e("span",null,l(t($e)(v.value.source)),1),F[0]||(F[0]=e("span",null,"·",-1)),e("span",null,l(v.value.model),1),F[1]||(F[1]=e("span",null,"·",-1)),e("span",null,l(f(v.value.thread_session_count)),1)])])):w("",!0),y.value?(n(),o("div",bt,l(y.value),1)):S.value&&!g.value?(n(),o("div",St,l(t(_)("common.loading")),1)):!g.value||g.value.messages.length===0?(n(),o("div",Ct,l(t(_)("chat.noVisibleMessages")),1)):(n(),o("div",$t,[(n(!0),o(W,null,ee(g.value.messages,x=>(n(),o("article",{key:`${x.session_id}-${x.id}`,class:G(["conversation-monitor__message",`role-${x.role}`])},[e("div",Mt,l(h(x.role))+" · "+l(t(qe)(x.timestamp)),1),e("div",It,l(x.content),1)],2))),128))]))])]))}})})),Ai=R((()=>{})),cn,zi=R((()=>{Tt(),Tt(),Ai(),oe(),cn=le(un,[["__scopeId","data-v-be298d0d"]])})),dn,Oi=R((()=>{dn="/assets/mp4/thinking-light-BjeGd2gJ.mp4"})),vn,Ui=R((()=>{vn="/assets/mp4/thinking-dark-yYkYRZLs.mp4"})),Bt,Ft,Lt,Dt,Rt,Et,At,zt,Ot,Ut,Nt,Vt,qt,Ht,Wt,Kt,Gt,jt,Jt,Yt,hn,Xt=R((()=>{ae(),On(),ve(),Xn(),Pe(),Oi(),Ui(),Nn(),Bt={key:0,class:"empty-state"},Ft={key:0,class:"streaming-indicator"},Lt=["src"],Dt={key:0,class:"tool-calls-panel"},Rt={key:0,class:"tool-call-item compression-item"},Et={key:0,width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",class:"tool-call-icon"},At={key:1,width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",class:"tool-call-icon"},zt={class:"tool-call-name"},Ot={key:2,class:"tool-call-spinner"},Ut={key:1,class:"tool-call-item compression-item"},Nt={key:0,width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",class:"tool-call-icon"},Vt={key:1,width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",class:"tool-call-icon"},qt={class:"tool-call-name"},Ht={key:2,class:"tool-call-spinner"},Wt={class:"tool-call-name"},Kt={key:0,class:"tool-call-preview"},Gt=["title"],jt={key:2,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",class:"tool-call-success-icon"},Jt={key:3,class:"tool-call-spinner"},Yt={key:4,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",class:"tool-call-error-icon"},hn=ie({__name:"MessageList",setup(z){const s=Ie(),{t:_}=he(),{isDark:C}=Un(),a=m();function g(v){return v>=1e6?(v/1e6).toFixed(1)+"M":v>=1e3?(v/1e3).toFixed(1)+"K":String(v)}function L(v){return v<1?`${Math.round(v*1e3)}ms`:v<60?`${Math.round(v*10)/10}s`:`${Math.floor(v/60)}m ${Math.round(v%60)}s`}const S=q(()=>s.messages.filter(v=>v.role!=="tool")),y=q(()=>{const v=s.messages;let h=-1;for(let f=v.length-1;f>=0;f--)if(v[f].role==="user"){h=f;break}return[...v.filter((f,D)=>f.role==="tool"&&D>h)].reverse()});function M(v=200){const h=a.value;return h?h.scrollHeight-h.scrollTop-h.clientHeight<v:!0}function B(){ke(()=>{a.value&&(a.value.scrollTop=a.value.scrollHeight)})}function $(v){ke(()=>{const h=document.getElementById(`message-${v}`);h&&h.scrollIntoView({block:"center"})})}return X(()=>s.activeSessionId,v=>{if(v){if(s.focusMessageId){ke(()=>$(s.focusMessageId));return}ke(()=>B())}},{immediate:!0}),X(()=>s.focusMessageId,v=>{v&&$(v)}),X(()=>s.isRunActive,v=>{v&&B()}),X(()=>s.messages[s.messages.length-1]?.content,()=>{if(s.focusMessageId){$(s.focusMessageId);return}M()&&B()}),X(y,()=>{if(s.focusMessageId){$(s.focusMessageId);return}M()&&B()}),(v,h)=>(n(),o("div",{ref_key:"listRef",ref:a,class:"message-list"},[t(s).messages.length===0?(n(),o("div",Bt,[h[0]||(h[0]=e("img",{src:"/logo.png",alt:"Hermes",class:"empty-logo"},null,-1)),e("p",null,l(t(_)("chat.emptyState")),1)])):w("",!0),(n(!0),o(W,null,ee(S.value,f=>(n(),K(ei,{key:f.id,message:f,highlight:t(s).focusMessageId===f.id},null,8,["message","highlight"]))),128)),b(Fn,{name:"fade"},{default:k(()=>[t(s).isRunActive||t(s).abortState?(n(),o("div",Ft,[e("video",{src:t(C)?t(vn):t(dn),autoplay:"",loop:"",muted:"",playsinline:"",class:"thinking-video"},null,8,Lt),y.value.length>0||t(s).compressionState||t(s).abortState?(n(),o("div",Dt,[t(s).abortState?(n(),o("div",Rt,[t(s).abortState.aborting?(n(),o("svg",Et,[...h[1]||(h[1]=[e("path",{d:"M10 9v6m4-6v6M5 5h14v14H5z"},null,-1)])])):(n(),o("svg",At,[...h[2]||(h[2]=[e("path",{d:"M5 13l4 4L19 7"},null,-1)])])),e("span",zt,l(t(s).abortState.aborting?"Pausing... waiting for the run to stop and sync":t(s).abortState.synced?"Paused and synced":"Paused"),1),t(s).abortState.aborting?(n(),o("span",Ot)):w("",!0)])):w("",!0),t(s).compressionState?(n(),o("div",Ut,[t(s).compressionState.compressing?(n(),o("svg",Nt,[...h[3]||(h[3]=[e("path",{d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"},null,-1)])])):t(s).compressionState.compressed?(n(),o("svg",Vt,[...h[4]||(h[4]=[e("path",{d:"M5 13l4 4L19 7"},null,-1)])])):w("",!0),e("span",qt,l(t(s).compressionState.compressing?`Compressing... (${t(s).compressionState.messageCount} msgs, ~${g(t(s).compressionState.beforeTokens)} tokens)`:t(s).compressionState.compressed?`Compressed ${t(s).compressionState.messageCount} msgs: ~${g(t(s).compressionState.beforeTokens)} → ~${g(t(s).compressionState.afterTokens)} tokens`:"Compression skipped"),1),t(s).compressionState.compressing?(n(),o("span",Ht)):w("",!0)])):w("",!0),(n(!0),o(W,null,ee(y.value,f=>(n(),o("div",{key:f.id,class:"tool-call-item"},[h[7]||(h[7]=e("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",class:"tool-call-icon"},[e("path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"})],-1)),e("span",Wt,l(f.toolName),1),f.toolPreview?(n(),o("span",Kt,l(f.toolPreview),1)):w("",!0),f.toolDuration&&f.toolStatus!=="running"?(n(),o("span",{key:1,class:"tool-call-duration",title:v.$t("chat.executionDuration")},l(L(f.toolDuration)),9,Gt)):w("",!0),f.toolStatus==="done"?(n(),o("svg",jt,[...h[5]||(h[5]=[e("circle",{cx:"12",cy:"12",r:"10",fill:"currentColor","fill-opacity":"0.15"},null,-1),e("path",{d:"M8 12L11 15L16 9",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",fill:"none"},null,-1)])])):w("",!0),f.toolStatus==="running"?(n(),o("span",Jt)):w("",!0),f.toolStatus==="error"?(n(),o("svg",Yt,[...h[6]||(h[6]=[e("circle",{cx:"12",cy:"12",r:"10",fill:"currentColor","fill-opacity":"0.15"},null,-1),e("path",{d:"M15 9L9 15M9 9L15 15",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",fill:"none"},null,-1)])])):w("",!0)]))),128))])):w("",!0)])):w("",!0)]),_:1})],512))}})})),Ni=R((()=>{})),fn,Vi=R((()=>{Xt(),Xt(),Ni(),oe(),fn=le(hn,[["__scopeId","data-v-cf22d274"]])})),Qt,Zt,es,ts,ss,ns,is,as,os,ls,rs,us,cs,ds,vs,hs,fs,_s,Fe,ps,_n,ms=R((()=>{ae(),ri(),ii(),li(),ui(),Oe(),Me(),ve(),Qt={class:"terminal-panel-drawer"},Zt={class:"sidebar-header"},es={class:"sidebar-title"},ts={class:"session-list"},ss={key:0,class:"session-error"},ns={key:1,class:"session-empty"},is=["onClick"],as={class:"session-item-content"},os={class:"session-item-title"},ls={class:"session-item-meta"},rs={class:"session-item-shell"},us={key:0,class:"session-item-status"},cs={key:1,class:"session-item-time"},ds={class:"terminal-main"},vs={class:"terminal-header"},hs={key:0,class:"header-session-title"},fs={class:"header-actions"},_s={class:"terminal-container"},Fe="hermes_terminal_theme",ps=3,_n=ie({__name:"TerminalPanel",setup(z){const{t:s}=he(),_=ze(),C={default:{label:"Default",theme:{background:"#1a1a2e",foreground:"#e0e0e0",cursor:"#4cc9f0",cursorAccent:"#1a1a2e",selectionBackground:"rgba(76, 201, 240, 0.3)",black:"#000000",red:"#e06c75",green:"#98c379",yellow:"#e5c07b",blue:"#61afef",magenta:"#c678dd",cyan:"#56b6c2",white:"#abb2bf",brightBlack:"#5c6370",brightRed:"#e06c75",brightGreen:"#98c379",brightYellow:"#e5c07b",brightBlue:"#61afef",brightMagenta:"#c678dd",brightCyan:"#56b6c2",brightWhite:"#ffffff"}},"solarized-dark":{label:"Solarized Dark",theme:{background:"#002b36",foreground:"#839496",cursor:"#93a1a1",cursorAccent:"#002b36",selectionBackground:"rgba(147, 161, 161, 0.3)",black:"#073642",red:"#dc322f",green:"#859900",yellow:"#b58900",blue:"#268bd2",magenta:"#d33682",cyan:"#2aa198",white:"#eee8d5",brightBlack:"#002b36",brightRed:"#cb4b16",brightGreen:"#586e75",brightYellow:"#657b83",brightBlue:"#839496",brightMagenta:"#6c71c4",brightCyan:"#93a1a1",brightWhite:"#fdf6e3"}},"tokyo-night":{label:"Tokyo Night",theme:{background:"#1a1b26",foreground:"#a9b1d6",cursor:"#c0caf5",cursorAccent:"#1a1b26",selectionBackground:"rgba(192, 202, 245, 0.2)",black:"#15161e",red:"#f7768e",green:"#9ece6a",yellow:"#e0af68",blue:"#7aa2f7",magenta:"#bb9af7",cyan:"#7dcfff",white:"#a9b1d6",brightBlack:"#414868",brightRed:"#f7768e",brightGreen:"#9ece6a",brightYellow:"#e0af68",brightBlue:"#7aa2f7",brightMagenta:"#bb9af7",brightCyan:"#7dcfff",brightWhite:"#c0caf5"}},"github-dark":{label:"GitHub Dark",theme:{background:"#0d1117",foreground:"#c9d1d9",cursor:"#58a6ff",cursorAccent:"#0d1117",selectionBackground:"rgba(88, 166, 255, 0.25)",black:"#484f58",red:"#ff7b72",green:"#7ee787",yellow:"#ffa657",blue:"#79c0ff",magenta:"#d2a8ff",cyan:"#a5d6ff",white:"#c9d1d9",brightBlack:"#6e7681",brightRed:"#ffa198",brightGreen:"#56d364",brightYellow:"#e3b341",brightBlue:"#58a6ff",brightMagenta:"#bc8cff",brightCyan:"#79c0ff",brightWhite:"#f0f6fc"}}},a=m(null),g=m([]),L=m(null),S=m(localStorage.getItem(Fe)||"default"),y=m(null),M=m(!1),B=m(!1);let $=null;const v=new Map;let h=null,f=null,D=null,O=0;const Y=q(()=>g.value.find(c=>c.id===L.value)||null),A=q(()=>Object.entries(C).map(([c,d])=>({label:d.label,value:c}))),F=q(()=>C[S.value]?.theme.background??"#1a1a2e");function x(){const c=zn(),d=An(),P=d?d.startsWith("https")?"wss:":"ws:":location.protocol==="https:"?"wss:":"ws:";return d?`${P}//${new URL(d).host}/api/hermes/terminal${c?`?token=${encodeURIComponent(c)}`:""}`:`${P}//${location.host}/api/hermes/terminal${c?`?token=${encodeURIComponent(c)}`:""}`}function j(){if(O>=ps){y.value=s("terminal.connectionFailed"),M.value=!1;return}const c=x();y.value=null,M.value=!0,O++,$=new WebSocket(c),$.onopen=()=>{O=0,M.value=!1,y.value=null},$.onmessage=d=>{const P=typeof d.data=="string"?d.data:"";if(P.charCodeAt(0)===123)try{Q(JSON.parse(P))}catch{}else h?.write(P)},$.onclose=d=>{if(M.value=!1,d.code===1e3||d.code===1003||d.code===1008){y.value=s("terminal.connectionClosed");return}setTimeout(j,3e3)},$.onerror=d=>{console.error("[Terminal] WebSocket error:",d),y.value=s("terminal.connectionError")}}function N(c){!$||$.readyState!==WebSocket.OPEN||$.send(typeof c=="string"?c:JSON.stringify(c))}function Q(c){switch(c.type){case"created":g.value.push({id:c.id,shell:c.shell,pid:c.pid,title:`${c.shell} #${g.value.length+1}`,createdAt:Date.now(),exited:!1}),re(c.id);break;case"exited":{const d=g.value.find(P=>P.id===c.id);d&&(d.exited=!0,L.value===c.id&&h?.write(`\r
1
+ import{n as R}from"./rolldown-runtime-iJLb3ux7.js";import{$ as w,C as xe,E as $n,Ft as G,G as Mn,It as en,J as In,K as Pn,Lt as l,P as Tn,Pt as t,Q as K,U as Bn,V as Fn,W as Ve,X as q,Z as e,_t as Ln,bt as k,c as Dn,d as Rn,dt as de,et as o,ft as Ae,g as ze,ht as ee,it as ie,j as H,kt as m,lt as ke,nt as U,pt as n,q as W,rt as b,t as Me,u as tn,vt as X,x as En,xt as Le,y as De,z as ae}from"./ui-vendor-DIP97-f3.js";import{n as ve,r as he}from"./vue-vendor-DHimL2gr.js";import{d as Re,i as An,l as sn,o as Oe,r as zn,s as Ue}from"./router-Be5a7E15.js";import{t as On}from"./logo-BnHwDXCu.js";import{n as Un,t as Nn}from"./useTheme-B0TxXkB2.js";import{n as Ee,t as nn}from"./app-DlZUhYPc.js";import{n as oe,t as le}from"./_plugin-vue_export-helper-JVWBimuG.js";import{n as Ie,t as Pe}from"./chat-BkwaPwH2.js";import{f as Vn,l as an,r as qn,t as Hn,u as Wn}from"./sessions-DTX4oAQD.js";import{n as Kn,t as Gn}from"./settings-DWQeYe8U.js";import{n as jn,t as Jn}from"./session-browser-prefs-CXMgnvdU.js";import{a as Yn,c as $e,i as Xn,l as on,n as Qn,o as Zn,r as ei,s as qe,t as He}from"./SessionListItem-Do-ItiIR.js";import{n as ti,t as si}from"./clipboard-D3SeHW1n.js";import{a as ni,i as ii,n as ai,o as oi,r as li,s as ri,t as ui}from"./xterm-Bov7T25g.js";import{_ as ci,a as di,b as vi,c as hi,d as fi,f as _i,g as pi,h as mi,i as gi,l as yi,m as wi,n as ki,o as xi,p as bi,r as Si,s as Ci,t as $i,u as Mi,v as Ii,y as Pi}from"./FileRenameModal-DZLJX7uH.js";async function Ti(z,s,_){return(await Ue(`/api/hermes/model-context/${encodeURIComponent(z)}/${encodeURIComponent(s)}`,{method:"PUT",body:JSON.stringify({provider:z,model:s,context_limit:_})})).data}var Bi=R((()=>{Oe()})),We,Ke,Ge,je,Je,Ye,Xe,Qe,Ze,et,tt,st,nt,it,at,ot,lt,ln,rt=R((()=>{ae(),Pe(),nn(),sn(),an(),Bi(),Me(),ve(),We={class:"chat-input-area"},Ke={class:"input-top-bar"},Ge={class:"auto-play-speech-switch"},je={key:1,class:"context-bar"},Je={key:0,class:"attachment-previews"},Ye=["src","alt"],Xe={key:1,class:"attachment-file"},Qe={class:"file-name"},Ze={class:"file-size"},et=["onClick"],tt=["placeholder"],st={class:"input-actions"},nt={class:"context-edit-content"},it={style:{"margin-bottom":"16px",color:"#666"}},at={style:{"margin-top":"12px","font-size":"12px",color:"#999"}},ot={style:{display:"flex","justify-content":"flex-end",gap:"8px"}},lt=2e5,ln=ie({__name:"ChatInput",setup(z){const s=Ie(),{t:_}=he(),C=ze(),a=m(""),g=m(),L=m(),S=m([]),y=m(!1),M=m(0),B=m(!1),$=m(!1);de(()=>{const u=localStorage.getItem("autoPlaySpeech");u!==null&&($.value=u==="true",s.setAutoPlaySpeech($.value))}),X($,u=>{localStorage.setItem("autoPlaySpeech",String(u)),s.setAutoPlaySpeech(u)});const v=q(()=>a.value.trim()||S.value.length>0),h=m(2e5),f=m(!1),D=m(2e5),O=m(!1);async function Y(){D.value=h.value,f.value=!0}async function A(){if(!D.value||D.value<=0){C.error(_("chat.contextEditInvalid"));return}O.value=!0;try{const u=Ee(),p=u.selectedProvider||"",I=u.selectedModel||"";if(!p||!I){C.error(_("chat.contextEditFailed"));return}await Ti(p,I,D.value),h.value=D.value,f.value=!1,C.success(_("chat.contextEditSuccess"))}catch(u){C.error(`${_("chat.contextEditFailed")}: ${u.message||""}`)}finally{O.value=!1}}async function F(){try{h.value=await qn(Re().activeProfileName||void 0)}catch{h.value=lt}}de(F),X(()=>Re().activeProfileName,F),X(()=>Ee().selectedModel,F);const x=q(()=>(s.activeSession?.inputTokens??0)+(s.activeSession?.outputTokens??0)),j=q(()=>Math.max(0,h.value-x.value)),N=q(()=>Math.min(x.value/h.value*100,100));function Q(u){return u>=1e6?(u/1e6).toFixed(1)+"M":u>=1e3?(u/1e3).toFixed(1)+"k":String(u)}function Z(u){if(S.value.find(ne=>ne.name===u.name))return;const p=Date.now().toString(36)+Math.random().toString(36).slice(2,8),I=URL.createObjectURL(u);S.value.push({id:p,name:u.name,type:u.type,size:u.size,url:I,file:u})}function ye(){L.value?.click()}function re(u){const p=u.target;if(p.files){for(const I of p.files)Z(I);p.value=""}}function fe(u){const p=Array.from(u.clipboardData?.items||[]).filter(I=>I.type.startsWith("image/"));if(p.length){u.preventDefault();for(const I of p){const ne=I.getAsFile();if(!ne)continue;const Be=I.type.split("/")[1]||"png";Z(new File([ne],`pasted-${Date.now()}.${Be}`,{type:I.type}))}}}function _e(u){u.preventDefault()}function ue(u){u.preventDefault(),u.dataTransfer?.types.includes("Files")&&(M.value++,y.value=!0)}function te(){M.value--,M.value<=0&&(M.value=0,y.value=!1)}function pe(u){u.preventDefault(),M.value=0,y.value=!1;const p=Array.from(u.dataTransfer?.files||[]);if(p.length){for(const I of p)Z(I);g.value?.focus()}}function ce(){const u=a.value.trim();!u&&S.value.length===0||(s.sendMessage(u,S.value.length>0?S.value:void 0),a.value="",S.value=[],g.value&&(g.value.style.height="auto"))}function me(){B.value=!0}function c(){requestAnimationFrame(()=>{B.value=!1})}function d(u){return B.value||u.isComposing||u.keyCode===229}function P(u){u.key!=="Enter"||u.shiftKey||d(u)||(u.preventDefault(),ce())}function se(u){const p=u.target;p.style.height="auto",p.style.height=Math.min(p.scrollHeight,100)+"px"}function J(u){const p=S.value.findIndex(I=>I.id===u);p!==-1&&(URL.revokeObjectURL(S.value[p].url),S.value.splice(p,1))}function Te(u){return u<1024?u+" B":u<1024*1024?(u/1024).toFixed(1)+" KB":(u/(1024*1024)).toFixed(1)+" MB"}function be(u){return u.startsWith("image/")}return(u,p)=>(n(),o("div",We,[e("div",Ke,[b(t(xe),{trigger:"hover"},{trigger:k(()=>[b(t(H),{quaternary:"",size:"tiny",onClick:ye,circle:""},{icon:k(()=>[...p[6]||(p[6]=[e("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[e("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"})],-1)])]),_:1})]),default:k(()=>[U(" "+l(t(_)("chat.attachFiles")),1)]),_:1}),e("div",Ge,[b(t(xe),{trigger:"hover"},{trigger:k(()=>[...p[7]||(p[7]=[e("div",{class:"switch-label"},[e("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("polygon",{points:"5 3 19 12 5 21 5 3"})])],-1)])]),default:k(()=>[U(" "+l(t(_)("chat.autoPlaySpeech")),1)]),_:1}),b(t(Dn),{size:"small",value:$.value,"onUpdate:value":p[0]||(p[0]=I=>$.value=I),round:!1},null,8,["value"])]),x.value>0?(n(),o("span",{key:0,class:G(["context-info",{"context-warning":N.value>80}])},[U(l(Q(x.value))+" / ",1),b(t(xe),{trigger:"hover"},{trigger:k(()=>[e("span",{class:"context-limit-editable",onClick:Y},l(Q(h.value)),1)]),default:k(()=>[e("span",null,l(t(_)("chat.contextClickToEdit")),1)]),_:1}),U(" · "+l(t(_)("chat.contextRemaining"))+" "+l(Q(j.value)),1)],2)):w("",!0),x.value>0?(n(),o("div",je,[e("div",{class:G(["context-bar-fill",{"context-bar-warn":N.value>60&&N.value<=80,"context-bar-danger":N.value>80}]),style:en({width:`${N.value}%`})},null,6)])):w("",!0)]),S.value.length>0?(n(),o("div",Je,[(n(!0),o(W,null,ee(S.value,I=>(n(),o("div",{key:I.id,class:G(["attachment-preview",{image:be(I.type)}])},[be(I.type)?(n(),o("img",{key:0,src:I.url,alt:I.name,class:"attachment-thumb"},null,8,Ye)):(n(),o("div",Xe,[p[8]||(p[8]=e("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[e("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),e("polyline",{points:"14 2 14 8 20 8"})],-1)),e("span",Qe,l(I.name),1),e("span",Ze,l(Te(I.size)),1)])),e("button",{class:"attachment-remove",onClick:ne=>J(I.id)},[...p[9]||(p[9]=[e("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])],8,et)],2))),128))])):w("",!0),e("div",{class:G(["input-wrapper",{"drag-over":y.value}]),onDragover:_e,onDragenter:ue,onDragleave:te,onDrop:pe},[e("input",{ref_key:"fileInputRef",ref:L,type:"file",multiple:"",class:"file-input-hidden",onChange:re},null,544),Le(e("textarea",{ref_key:"textareaRef",ref:g,"onUpdate:modelValue":p[1]||(p[1]=I=>a.value=I),class:"input-textarea",placeholder:t(_)("chat.inputPlaceholder"),rows:"1",onKeydown:P,onCompositionstart:me,onCompositionend:c,onInput:se,onPaste:fe},null,40,tt),[[Bn,a.value]]),e("div",st,[t(s).isStreaming?(n(),K(t(H),{key:0,size:"small",type:"error",disabled:t(s).isAborting,onClick:p[2]||(p[2]=I=>t(s).stopStreaming())},{default:k(()=>[U(l(t(_)("chat.stop")),1)]),_:1},8,["disabled"])):w("",!0),b(t(H),{size:"small",type:"primary",disabled:!v.value||t(s).isStreaming,onClick:ce},{icon:k(()=>[...p[10]||(p[10]=[e("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),e("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})],-1)])]),default:k(()=>[U(" "+l(t(_)("chat.send")),1)]),_:1},8,["disabled"])])],34),b(t(De),{show:f.value,"onUpdate:show":p[5]||(p[5]=I=>f.value=I),title:t(_)("chat.contextEditTitle"),"mask-closable":!0,preset:"card",style:{width:"400px"}},{footer:k(()=>[e("div",ot,[b(t(H),{onClick:p[4]||(p[4]=I=>f.value=!1),disabled:O.value},{default:k(()=>[U(l(t(_)("chat.contextEditCancel")),1)]),_:1},8,["disabled"]),b(t(H),{type:"primary",onClick:A,loading:O.value},{default:k(()=>[U(l(t(_)("chat.contextEditSave")),1)]),_:1},8,["loading"])])]),default:k(()=>[e("div",nt,[e("p",it,l(t(_)("chat.contextEditDesc")),1),b(t(Rn),{value:D.value,"onUpdate:value":p[3]||(p[3]=I=>D.value=I),min:1e3,max:1e7,step:1e3,"show-button":!1,placeholder:t(_)("chat.contextEditPlaceholder"),style:{width:"100%"}},{suffix:k(()=>[...p[11]||(p[11]=[e("span",{style:{color:"#999"}},"tokens",-1)])]),_:1},8,["value","placeholder"]),e("div",at,l(t(_)("chat.contextEditHint")),1)])]),_:1},8,["show","title"])]))}})})),Fi=R((()=>{})),rn,Li=R((()=>{rt(),rt(),Fi(),oe(),rn=le(ln,[["__scopeId","data-v-1a738dbc"]])}));async function Di(z={}){const s=new URLSearchParams;return z.humanOnly===!1&&s.set("humanOnly","false"),z.source&&s.set("source",z.source),z.limit!=null&&s.set("limit",String(z.limit)),(await Ue(`/api/hermes/sessions/conversations${s.toString()?`?${s.toString()}`:""}`)).sessions}async function Ri(z,s={}){const _=new URLSearchParams;s.humanOnly===!1&&_.set("humanOnly","false"),s.source&&_.set("source",s.source);const C=_.toString()?`?${_.toString()}`:"";return Ue(`/api/hermes/sessions/conversations/${encodeURIComponent(z)}/messages${C}`)}var Ei=R((()=>{Oe()})),ut,ct,dt,vt,ht,ft,_t,pt,mt,gt,yt,wt,kt,xt,bt,St,Ct,$t,Mt,It,Pt,un,Tt=R((()=>{ae(),Ei(),on(),ve(),ut={class:"conversation-monitor"},ct={class:"conversation-monitor__sidebar"},dt={key:0,class:"conversation-monitor__empty"},vt={key:1,class:"conversation-monitor__empty"},ht=["aria-pressed","onClick"],ft={class:"conversation-monitor__session-title-row"},_t={class:"conversation-monitor__session-title"},pt={key:0,class:"conversation-monitor__session-live"},mt={class:"conversation-monitor__session-meta"},gt={key:0,class:"conversation-monitor__session-preview"},yt={class:"conversation-monitor__detail"},wt={key:0,class:"conversation-monitor__detail-header"},kt={class:"conversation-monitor__detail-title"},xt={class:"conversation-monitor__detail-meta"},bt={key:1,class:"conversation-monitor__empty conversation-monitor__empty--error"},St={key:2,class:"conversation-monitor__empty"},Ct={key:3,class:"conversation-monitor__empty"},$t={key:4,class:"conversation-monitor__messages"},Mt={class:"conversation-monitor__message-meta"},It={class:"conversation-monitor__message-content"},Pt=15e3,un=ie({__name:"ConversationMonitorPane",props:{humanOnly:{type:Boolean}},setup(z){const s=z,{t:_}=he(),C=m([]),a=m(null),g=m(null),L=m(!1),S=m(!1),y=m("");let M=null,B=0,$=0;const v=q(()=>C.value.find(A=>A.id===a.value)||null);function h(A){return _(A==="user"?"chat.monitorRoleUser":"chat.monitorRoleAssistant")}function f(A){return _("chat.linkedSessions",{count:A})}function D(){B+=1,$+=1}async function O(A=!1){const F=++B;A||(L.value=!0,y.value="");try{const x=await Di({humanOnly:s.humanOnly});if(F!==B)return;if(C.value=x,!x.length){a.value=null,g.value=null;return}(!a.value||!x.some(j=>j.id===a.value))&&(a.value=x[0].id)}catch(x){if(F!==B||A)return;y.value=x?.message||String(x),C.value=[],a.value=null,g.value=null}finally{!A&&F===B&&(L.value=!1)}}async function Y(A,F=!1){const x=++$;if(!A){g.value=null;return}const j=s.humanOnly;F||(S.value=!0,y.value="");try{const N=await Ri(A,{humanOnly:j});if(x!==$||A!==a.value||j!==s.humanOnly)return;g.value=N}catch(N){if(x!==$||F)return;y.value=N?.message||String(N),g.value=null}finally{!F&&x===$&&(S.value=!1)}}return X(a,async A=>{await Y(A,!1)}),X(()=>s.humanOnly,async()=>{D(),a.value=null,g.value=null,await O(!1)}),de(async()=>{await O(!1),M=setInterval(async()=>{await O(!0),a.value&&await Y(a.value,!0)},Pt)}),Ae(()=>{D(),M&&clearInterval(M)}),(A,F)=>(n(),o("div",ut,[e("aside",ct,[L.value&&C.value.length===0?(n(),o("div",dt,l(t(_)("common.loading")),1)):C.value.length===0?(n(),o("div",vt,l(t(_)("chat.noSessions")),1)):w("",!0),(n(!0),o(W,null,ee(C.value,x=>(n(),o("button",{key:x.id,class:G(["conversation-monitor__session",{active:x.id===a.value}]),"aria-pressed":x.id===a.value,onClick:j=>a.value=x.id},[e("div",ft,[e("span",_t,l(x.title||x.preview||x.id),1),x.is_active?(n(),o("span",pt,l(t(_)("chat.recentBadge")),1)):w("",!0)]),e("div",mt,l(t($e)(x.source))+" · "+l(t(qe)(x.last_active)),1),x.preview?(n(),o("div",gt,l(x.preview),1)):w("",!0)],10,ht))),128))]),e("section",yt,[v.value?(n(),o("header",wt,[e("div",kt,l(v.value.title||v.value.preview||v.value.id),1),e("div",xt,[e("span",null,l(t($e)(v.value.source)),1),F[0]||(F[0]=e("span",null,"·",-1)),e("span",null,l(v.value.model),1),F[1]||(F[1]=e("span",null,"·",-1)),e("span",null,l(f(v.value.thread_session_count)),1)])])):w("",!0),y.value?(n(),o("div",bt,l(y.value),1)):S.value&&!g.value?(n(),o("div",St,l(t(_)("common.loading")),1)):!g.value||g.value.messages.length===0?(n(),o("div",Ct,l(t(_)("chat.noVisibleMessages")),1)):(n(),o("div",$t,[(n(!0),o(W,null,ee(g.value.messages,x=>(n(),o("article",{key:`${x.session_id}-${x.id}`,class:G(["conversation-monitor__message",`role-${x.role}`])},[e("div",Mt,l(h(x.role))+" · "+l(t(qe)(x.timestamp)),1),e("div",It,l(x.content),1)],2))),128))]))])]))}})})),Ai=R((()=>{})),cn,zi=R((()=>{Tt(),Tt(),Ai(),oe(),cn=le(un,[["__scopeId","data-v-be298d0d"]])})),dn,Oi=R((()=>{dn="/assets/mp4/thinking-light-BjeGd2gJ.mp4"})),vn,Ui=R((()=>{vn="/assets/mp4/thinking-dark-yYkYRZLs.mp4"})),Bt,Ft,Lt,Dt,Rt,Et,At,zt,Ot,Ut,Nt,Vt,qt,Ht,Wt,Kt,Gt,jt,Jt,Yt,hn,Xt=R((()=>{ae(),On(),ve(),Xn(),Pe(),Oi(),Ui(),Nn(),Bt={key:0,class:"empty-state"},Ft={key:0,class:"streaming-indicator"},Lt=["src"],Dt={key:0,class:"tool-calls-panel"},Rt={key:0,class:"tool-call-item compression-item"},Et={key:0,width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",class:"tool-call-icon"},At={key:1,width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",class:"tool-call-icon"},zt={class:"tool-call-name"},Ot={key:2,class:"tool-call-spinner"},Ut={key:1,class:"tool-call-item compression-item"},Nt={key:0,width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",class:"tool-call-icon"},Vt={key:1,width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",class:"tool-call-icon"},qt={class:"tool-call-name"},Ht={key:2,class:"tool-call-spinner"},Wt={class:"tool-call-name"},Kt={key:0,class:"tool-call-preview"},Gt=["title"],jt={key:2,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",class:"tool-call-success-icon"},Jt={key:3,class:"tool-call-spinner"},Yt={key:4,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",class:"tool-call-error-icon"},hn=ie({__name:"MessageList",setup(z){const s=Ie(),{t:_}=he(),{isDark:C}=Un(),a=m();function g(v){return v>=1e6?(v/1e6).toFixed(1)+"M":v>=1e3?(v/1e3).toFixed(1)+"K":String(v)}function L(v){return v<1?`${Math.round(v*1e3)}ms`:v<60?`${Math.round(v*10)/10}s`:`${Math.floor(v/60)}m ${Math.round(v%60)}s`}const S=q(()=>s.messages.filter(v=>v.role!=="tool")),y=q(()=>{const v=s.messages;let h=-1;for(let f=v.length-1;f>=0;f--)if(v[f].role==="user"){h=f;break}return[...v.filter((f,D)=>f.role==="tool"&&D>h)].reverse()});function M(v=200){const h=a.value;return h?h.scrollHeight-h.scrollTop-h.clientHeight<v:!0}function B(){ke(()=>{a.value&&(a.value.scrollTop=a.value.scrollHeight)})}function $(v){ke(()=>{const h=document.getElementById(`message-${v}`);h&&h.scrollIntoView({block:"center"})})}return X(()=>s.activeSessionId,v=>{if(v){if(s.focusMessageId){ke(()=>$(s.focusMessageId));return}ke(()=>B())}},{immediate:!0}),X(()=>s.focusMessageId,v=>{v&&$(v)}),X(()=>s.isRunActive,v=>{v&&B()}),X(()=>s.messages[s.messages.length-1]?.content,()=>{if(s.focusMessageId){$(s.focusMessageId);return}M()&&B()}),X(y,()=>{if(s.focusMessageId){$(s.focusMessageId);return}M()&&B()}),(v,h)=>(n(),o("div",{ref_key:"listRef",ref:a,class:"message-list"},[t(s).messages.length===0?(n(),o("div",Bt,[h[0]||(h[0]=e("img",{src:"/logo.png",alt:"Hermes",class:"empty-logo"},null,-1)),e("p",null,l(t(_)("chat.emptyState")),1)])):w("",!0),(n(!0),o(W,null,ee(S.value,f=>(n(),K(ei,{key:f.id,message:f,highlight:t(s).focusMessageId===f.id},null,8,["message","highlight"]))),128)),b(Fn,{name:"fade"},{default:k(()=>[t(s).isRunActive||t(s).abortState?(n(),o("div",Ft,[e("video",{src:t(C)?t(vn):t(dn),autoplay:"",loop:"",muted:"",playsinline:"",class:"thinking-video"},null,8,Lt),y.value.length>0||t(s).compressionState||t(s).abortState?(n(),o("div",Dt,[t(s).abortState?(n(),o("div",Rt,[t(s).abortState.aborting?(n(),o("svg",Et,[...h[1]||(h[1]=[e("path",{d:"M10 9v6m4-6v6M5 5h14v14H5z"},null,-1)])])):(n(),o("svg",At,[...h[2]||(h[2]=[e("path",{d:"M5 13l4 4L19 7"},null,-1)])])),e("span",zt,l(t(s).abortState.aborting?"Pausing... waiting for the run to stop and sync":t(s).abortState.synced?"Paused and synced":"Paused"),1),t(s).abortState.aborting?(n(),o("span",Ot)):w("",!0)])):w("",!0),t(s).compressionState?(n(),o("div",Ut,[t(s).compressionState.compressing?(n(),o("svg",Nt,[...h[3]||(h[3]=[e("path",{d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"},null,-1)])])):t(s).compressionState.compressed?(n(),o("svg",Vt,[...h[4]||(h[4]=[e("path",{d:"M5 13l4 4L19 7"},null,-1)])])):w("",!0),e("span",qt,l(t(s).compressionState.compressing?`Compressing... (${t(s).compressionState.messageCount} msgs, ~${g(t(s).compressionState.beforeTokens)} tokens)`:t(s).compressionState.compressed?`Compressed ${t(s).compressionState.messageCount} msgs: ~${g(t(s).compressionState.beforeTokens)} → ~${g(t(s).compressionState.afterTokens)} tokens`:"Compression skipped"),1),t(s).compressionState.compressing?(n(),o("span",Ht)):w("",!0)])):w("",!0),(n(!0),o(W,null,ee(y.value,f=>(n(),o("div",{key:f.id,class:"tool-call-item"},[h[7]||(h[7]=e("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",class:"tool-call-icon"},[e("path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"})],-1)),e("span",Wt,l(f.toolName),1),f.toolPreview?(n(),o("span",Kt,l(f.toolPreview),1)):w("",!0),f.toolDuration&&f.toolStatus!=="running"?(n(),o("span",{key:1,class:"tool-call-duration",title:v.$t("chat.executionDuration")},l(L(f.toolDuration)),9,Gt)):w("",!0),f.toolStatus==="done"?(n(),o("svg",jt,[...h[5]||(h[5]=[e("circle",{cx:"12",cy:"12",r:"10",fill:"currentColor","fill-opacity":"0.15"},null,-1),e("path",{d:"M8 12L11 15L16 9",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",fill:"none"},null,-1)])])):w("",!0),f.toolStatus==="running"?(n(),o("span",Jt)):w("",!0),f.toolStatus==="error"?(n(),o("svg",Yt,[...h[6]||(h[6]=[e("circle",{cx:"12",cy:"12",r:"10",fill:"currentColor","fill-opacity":"0.15"},null,-1),e("path",{d:"M15 9L9 15M9 9L15 15",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",fill:"none"},null,-1)])])):w("",!0)]))),128))])):w("",!0)])):w("",!0)]),_:1})],512))}})})),Ni=R((()=>{})),fn,Vi=R((()=>{Xt(),Xt(),Ni(),oe(),fn=le(hn,[["__scopeId","data-v-cf22d274"]])})),Qt,Zt,es,ts,ss,ns,is,as,os,ls,rs,us,cs,ds,vs,hs,fs,_s,Fe,ps,_n,ms=R((()=>{ae(),ri(),ii(),li(),ui(),Oe(),Me(),ve(),Qt={class:"terminal-panel-drawer"},Zt={class:"sidebar-header"},es={class:"sidebar-title"},ts={class:"session-list"},ss={key:0,class:"session-error"},ns={key:1,class:"session-empty"},is=["onClick"],as={class:"session-item-content"},os={class:"session-item-title"},ls={class:"session-item-meta"},rs={class:"session-item-shell"},us={key:0,class:"session-item-status"},cs={key:1,class:"session-item-time"},ds={class:"terminal-main"},vs={class:"terminal-header"},hs={key:0,class:"header-session-title"},fs={class:"header-actions"},_s={class:"terminal-container"},Fe="hermes_terminal_theme",ps=3,_n=ie({__name:"TerminalPanel",setup(z){const{t:s}=he(),_=ze(),C={default:{label:"Default",theme:{background:"#1a1a2e",foreground:"#e0e0e0",cursor:"#4cc9f0",cursorAccent:"#1a1a2e",selectionBackground:"rgba(76, 201, 240, 0.3)",black:"#000000",red:"#e06c75",green:"#98c379",yellow:"#e5c07b",blue:"#61afef",magenta:"#c678dd",cyan:"#56b6c2",white:"#abb2bf",brightBlack:"#5c6370",brightRed:"#e06c75",brightGreen:"#98c379",brightYellow:"#e5c07b",brightBlue:"#61afef",brightMagenta:"#c678dd",brightCyan:"#56b6c2",brightWhite:"#ffffff"}},"solarized-dark":{label:"Solarized Dark",theme:{background:"#002b36",foreground:"#839496",cursor:"#93a1a1",cursorAccent:"#002b36",selectionBackground:"rgba(147, 161, 161, 0.3)",black:"#073642",red:"#dc322f",green:"#859900",yellow:"#b58900",blue:"#268bd2",magenta:"#d33682",cyan:"#2aa198",white:"#eee8d5",brightBlack:"#002b36",brightRed:"#cb4b16",brightGreen:"#586e75",brightYellow:"#657b83",brightBlue:"#839496",brightMagenta:"#6c71c4",brightCyan:"#93a1a1",brightWhite:"#fdf6e3"}},"tokyo-night":{label:"Tokyo Night",theme:{background:"#1a1b26",foreground:"#a9b1d6",cursor:"#c0caf5",cursorAccent:"#1a1b26",selectionBackground:"rgba(192, 202, 245, 0.2)",black:"#15161e",red:"#f7768e",green:"#9ece6a",yellow:"#e0af68",blue:"#7aa2f7",magenta:"#bb9af7",cyan:"#7dcfff",white:"#a9b1d6",brightBlack:"#414868",brightRed:"#f7768e",brightGreen:"#9ece6a",brightYellow:"#e0af68",brightBlue:"#7aa2f7",brightMagenta:"#bb9af7",brightCyan:"#7dcfff",brightWhite:"#c0caf5"}},"github-dark":{label:"GitHub Dark",theme:{background:"#0d1117",foreground:"#c9d1d9",cursor:"#58a6ff",cursorAccent:"#0d1117",selectionBackground:"rgba(88, 166, 255, 0.25)",black:"#484f58",red:"#ff7b72",green:"#7ee787",yellow:"#ffa657",blue:"#79c0ff",magenta:"#d2a8ff",cyan:"#a5d6ff",white:"#c9d1d9",brightBlack:"#6e7681",brightRed:"#ffa198",brightGreen:"#56d364",brightYellow:"#e3b341",brightBlue:"#58a6ff",brightMagenta:"#bc8cff",brightCyan:"#79c0ff",brightWhite:"#f0f6fc"}}},a=m(null),g=m([]),L=m(null),S=m(localStorage.getItem(Fe)||"default"),y=m(null),M=m(!1),B=m(!1);let $=null;const v=new Map;let h=null,f=null,D=null,O=0;const Y=q(()=>g.value.find(c=>c.id===L.value)||null),A=q(()=>Object.entries(C).map(([c,d])=>({label:d.label,value:c}))),F=q(()=>C[S.value]?.theme.background??"#1a1a2e");function x(){const c=zn(),d=An(),P=d?d.startsWith("https")?"wss:":"ws:":location.protocol==="https:"?"wss:":"ws:";return d?`${P}//${new URL(d).host}/api/hermes/terminal${c?`?token=${encodeURIComponent(c)}`:""}`:`${P}//${location.host}/api/hermes/terminal${c?`?token=${encodeURIComponent(c)}`:""}`}function j(){if(O>=ps){y.value=s("terminal.connectionFailed"),M.value=!1;return}const c=x();y.value=null,M.value=!0,O++,$=new WebSocket(c),$.onopen=()=>{O=0,M.value=!1,y.value=null},$.onmessage=d=>{const P=typeof d.data=="string"?d.data:"";if(P.charCodeAt(0)===123)try{Q(JSON.parse(P))}catch{}else h?.write(P)},$.onclose=d=>{if(M.value=!1,d.code===1e3||d.code===1003||d.code===1008){y.value=s("terminal.connectionClosed");return}setTimeout(j,3e3)},$.onerror=d=>{console.error("[Terminal] WebSocket error:",d),y.value=s("terminal.connectionError")}}function N(c){!$||$.readyState!==WebSocket.OPEN||$.send(typeof c=="string"?c:JSON.stringify(c))}function Q(c){switch(c.type){case"created":g.value.push({id:c.id,shell:c.shell,pid:c.pid,title:`${c.shell} #${g.value.length+1}`,createdAt:Date.now(),exited:!1}),re(c.id);break;case"exited":{const d=g.value.find(P=>P.id===c.id);d&&(d.exited=!0,L.value===c.id&&h?.write(`\r
2
2
  \x1B[90m[${s("terminal.processExited",{code:c.exitCode})}]\x1B[0m\r
3
3
  `));break}case"error":_.error(c.message);break}}function Z(){N({type:"create"})}function ye(c){let d=v.get(c);if(!d){const P=new oi({cursorBlink:!0,fontSize:14,fontFamily:'Menlo, Monaco, "Courier New", monospace',theme:{...C[S.value].theme}}),se=new ni;P.loadAddon(se),P.loadAddon(new ai),P.onData(J=>{$?.readyState===WebSocket.OPEN&&$.send(J)}),d={term:P,fitAddon:se,opened:!1},v.set(c,d)}return d}function re(c){if(L.value===c)return;L.value=c;const d=ye(c);h=d.term,f=d.fitAddon,_e(),N({type:"switch",sessionId:c})}function fe(c){N({type:"close",sessionId:c}),g.value=g.value.filter(P=>P.id!==c);const d=v.get(c);d&&(d.term.dispose(),v.delete(c)),L.value===c&&(L.value=g.value.length>0?g.value[0].id:null,h=null,f=null,L.value?re(L.value):(ue(),Z()))}function _e(){if(!a.value)return;const c=a.value;for(;c.firstChild;)c.removeChild(c.firstChild);const d=v.get(L.value);if(d){if(!d.opened)d.term.open(c),d.opened=!0;else{const P=d.term.element;P&&c.appendChild(P)}D?.disconnect(),D=new ResizeObserver(()=>{te(),pe()}),D.observe(a.value),setTimeout(()=>te(),50),setTimeout(()=>te(),200)}}function ue(){if(!a.value)return;const c=a.value;for(;c.firstChild;)c.removeChild(c.firstChild)}function te(){if(f)try{f.fit()}catch{}}function pe(){if(!(!h||!$||$.readyState!==WebSocket.OPEN))try{N({type:"resize",cols:h.cols,rows:h.rows})}catch{}}function ce(c){S.value=c,localStorage.setItem(Fe,c);const d=C[c]?.theme;if(d)for(const P of v.values())P.term.options.theme={...d}}function me(c){return new Date(c).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}return de(()=>{j()}),Ae(()=>{ue();for(const c of v.values())c.term.dispose();v.clear(),h=null,f=null,$?.close(),$=null}),(c,d)=>(n(),o("div",Qt,[B.value?(n(),o("div",{key:0,class:"sidebar-overlay",onClick:d[0]||(d[0]=P=>B.value=!1)})):w("",!0),e("div",{class:G(["terminal-sidebar",{"mobile-visible":B.value}])},[e("div",Zt,[e("span",es,l(t(s)("terminal.sessions")),1),b(t(xe),{trigger:"hover"},{trigger:k(()=>[b(t(H),{quaternary:"",size:"tiny",onClick:Z,circle:""},{icon:k(()=>[...d[3]||(d[3]=[e("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),e("line",{x1:"5",y1:"12",x2:"19",y2:"12"})],-1)])]),_:1})]),default:k(()=>[U(" "+l(t(s)("terminal.newTab")),1)]),_:1})]),e("div",ts,[y.value?(n(),o("div",ss,[d[4]||(d[4]=e("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("circle",{cx:"12",cy:"12",r:"10"}),e("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),e("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})],-1)),e("span",null,l(y.value),1),b(t(H),{size:"tiny",onClick:j},{default:k(()=>[U(l(t(s)("common.retry")),1)]),_:1})])):g.value.length===0?(n(),o("div",ns,[M.value?(n(),o(W,{key:0},[U(l(t(s)("common.loading")),1)],64)):(n(),o(W,{key:1},[U(l(t(s)("terminal.noSessions")),1)],64))])):w("",!0),(n(!0),o(W,null,ee(g.value,P=>(n(),o("button",{key:P.id,class:G(["session-item",{active:P.id===L.value,exited:P.exited}]),onClick:se=>re(P.id)},[e("div",as,[e("span",os,l(P.title),1),e("span",ls,[e("span",rs,l(P.shell),1),P.exited?(n(),o("span",us,l(t(s)("terminal.sessionExited")),1)):(n(),o("span",cs,l(me(P.createdAt)),1))])]),g.value.length>1?(n(),K(t(tn),{key:0,onPositiveClick:se=>fe(P.id)},{trigger:k(()=>[e("button",{class:"session-item-delete",onClick:d[1]||(d[1]=Pn(()=>{},["stop"]))},[...d[5]||(d[5]=[e("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])])]),default:k(()=>[U(" "+l(t(s)("terminal.closeSession")),1)]),_:1},8,["onPositiveClick"])):w("",!0)],10,is))),128))])],2),e("div",ds,[e("header",vs,[Y.value?(n(),o("span",hs,l(Y.value.title),1)):w("",!0),e("div",fs,[b(t(H),{size:"small",onClick:d[2]||(d[2]=P=>B.value=!B.value),class:"sidebar-toggle"},{icon:k(()=>[...d[6]||(d[6]=[e("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),e("line",{x1:"9",y1:"3",x2:"9",y2:"21"})],-1)])]),default:k(()=>[U(" "+l(t(s)("terminal.sessions")),1)]),_:1}),b(t($n),{value:S.value,options:A.value,size:"small","consistent-menu-width":!1,class:"theme-select","onUpdate:value":ce},null,8,["value","options"]),b(t(H),{size:"small",onClick:Z},{icon:k(()=>[...d[7]||(d[7]=[e("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),e("line",{x1:"5",y1:"12",x2:"19",y2:"12"})],-1)])]),default:k(()=>[U(" "+l(t(s)("terminal.newTab")),1)]),_:1})])]),e("div",_s,[e("div",{ref_key:"terminalRef",ref:a,class:"terminal-xterm",style:en({backgroundColor:F.value})},null,4)])])]))}})})),qi=R((()=>{})),pn,Hi=R((()=>{ms(),ms(),qi(),oe(),pn=le(_n,[["__scopeId","data-v-53ffdd40"]])})),gs,ys,ws,ks,mn,xs=R((()=>{ae(),Pi(),ve(),Me(),Ii(),pi(),wi(),_i(),Mi(),hi(),xi(),gi(),ki(),gs={class:"files-panel-drawer"},ys={class:"files-main-panel"},ws={class:"main-toolbar"},ks={class:"files-content"},mn=ie({__name:"FilesPanel",setup(z){const s=vi(),{t:_}=he(),C=m(null),a=m(!1),g=m(!1),L=m("newFile"),S=m(null),y=m(!1);function M(h,f){C.value?.show(h,f)}function B(){L.value="newFile",S.value=null,g.value=!0}function $(){L.value="newFolder",S.value=null,g.value=!0}function v(h){L.value="rename",S.value=h,g.value=!0}return de(()=>{s.fetchEntries("")}),(h,f)=>(n(),o("div",gs,[y.value?(n(),o("div",{key:0,class:"sidebar-overlay",onClick:f[0]||(f[0]=D=>y.value=!1)})):w("",!0),e("div",{class:G(["files-tree-panel",{"mobile-visible":y.value}])},[b(ci)],2),e("div",ys,[e("div",ws,[b(t(H),{size:"small",onClick:f[1]||(f[1]=D=>y.value=!y.value),class:"sidebar-toggle"},{icon:k(()=>[...f[5]||(f[5]=[e("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),e("line",{x1:"9",y1:"3",x2:"9",y2:"21"})],-1)])]),default:k(()=>[U(" "+l(t(_)("files.fileTree")),1)]),_:1}),b(bi,{onShowNewFile:B,onShowNewFolder:$,onShowUpload:f[2]||(f[2]=D=>a.value=!0)})]),b(mi),e("div",ks,[t(s).editingFile?(n(),K(Ci,{key:0})):t(s).previewFile?(n(),K(di,{key:1})):(n(),K(fi,{key:2,onContextmenuEntry:M}))])]),b(yi,{ref_key:"contextMenuRef",ref:C,onRename:v},null,512),b(Si,{show:a.value,"onUpdate:show":f[3]||(f[3]=D=>a.value=D)},null,8,["show"]),b($i,{show:g.value,"onUpdate:show":f[4]||(f[4]=D=>g.value=D),mode:L.value,entry:S.value},null,8,["show","mode","entry"])]))}})})),Wi=R((()=>{})),gn,Ki=R((()=>{xs(),xs(),Wi(),oe(),gn=le(mn,[["__scopeId","data-v-efc529cd"]])})),bs,Ss,Cs,$s,Ms,yn,Is=R((()=>{ae(),ve(),Hi(),Ki(),bs={class:"drawer-header"},Ss={class:"drawer-tabs"},Cs={class:"drawer-content"},$s={class:"drawer-pane"},Ms={class:"drawer-pane"},yn=ie({__name:"DrawerPanel",props:{show:{type:Boolean},activeTab:{default:"files"}},emits:["update:show"],setup(z,{emit:s}){const _=z,C=s,{t:a}=he(),g=m(_.activeTab);X(()=>_.activeTab,S=>{S&&(g.value=S)});function L(){C("update:show",!1)}return(S,y)=>(n(),K(In,{to:"body"},[z.show?(n(),o("div",{key:0,class:"drawer-overlay",onClick:L})):w("",!0),e("div",{class:G(["drawer-panel",{show:z.show}])},[e("div",bs,[e("div",Ss,[e("button",{class:G(["tab-button",{active:g.value==="files"}]),onClick:y[0]||(y[0]=M=>g.value="files")},l(t(a)("drawer.files")),3),e("button",{class:G(["tab-button",{active:g.value==="terminal"}]),onClick:y[1]||(y[1]=M=>g.value="terminal")},l(t(a)("drawer.terminal")),3)]),e("button",{class:"close-button",onClick:L},[...y[2]||(y[2]=[e("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])])]),e("div",Cs,[Le(e("div",$s,[b(gn)],512),[[Ve,g.value==="files"]]),Le(e("div",Ms,[b(pn)],512),[[Ve,g.value==="terminal"]])])],2)]))}})})),Gi=R((()=>{})),wn,ji=R((()=>{Is(),Is(),Gi(),oe(),wn=le(yn,[["__scopeId","data-v-730aaf6b"]])})),Ps,Ts,Bs,Fs,Ls,Ds,Rs,Es,As,zs,Os,Us,Ns,Vs,qs,Hs,Ws,Ks,Gs,js,Js,Ys,kn,Xs=R((()=>{ae(),an(),Pe(),Jn(),Me(),ve(),on(),ti(),Zn(),Li(),zi(),Vi(),Qn(),ji(),Ps={class:"chat-panel"},Ts={class:"session-list-header"},Bs={key:0,class:"session-list-title"},Fs={class:"session-list-actions"},Ls={key:0,class:"session-scope-note"},Ds={key:1,class:"session-items"},Rs={key:0,class:"session-loading"},Es={key:1,class:"session-empty"},As={class:"session-group-header session-group-header--static"},zs={class:"session-group-label"},Os={class:"session-group-count"},Us=["onClick"],Ns={class:"session-group-label"},Vs={class:"session-group-count"},qs={class:"chat-main"},Hs={class:"chat-header"},Ws={class:"header-left"},Ks={class:"header-session-title"},Gs={key:1,class:"source-badge"},js=["title"],Js={class:"header-actions"},Ys={class:"drawer-button-wrapper"},kn=ie({__name:"ChatPanel",setup(z){const s=Ie(),_=jn(),C=ze(),{t:a}=he(),g=m(!1),L=m("files"),S=m("chat"),y=m(!1),M=m(new Set),B=m(typeof window>"u"||!window.matchMedia("(max-width: 768px)").matches);let $=null;const v=m(!1);function h(r){s.switchSession(r),$?.matches&&(B.value=!1)}function f(r){v.value=r.matches,r.matches&&B.value&&(B.value=!1)}de(()=>{$=window.matchMedia("(max-width: 768px)"),f($),$.addEventListener("change",f)}),Ae(()=>{$?.removeEventListener("change",f)});const D=m(!1),O=m(""),Y=m(null),A=m(null),F=m(new Set(JSON.parse(localStorage.getItem("hermes_collapsed_groups")||"[]")));function x(r){return r==="api_server"?-1:r==="cron"?999:0}function j(r){return[...r].sort((i,E)=>(E.updatedAt||0)-(i.updatedAt||0))}const N=q(()=>j(s.sessions.filter(r=>_.isPinned(r.id)))),Q=q(()=>{const r=new Map;for(const i of s.sessions){if(_.isPinned(i.id))continue;const E=i.source||"";r.has(E)||r.set(E,[]),r.get(E).push(i)}return[...r.keys()].sort((i,E)=>{const T=x(i),V=x(E);return T!==V?T-V:i.localeCompare(E)}).map(i=>({source:i,label:i?$e(i):a("chat.other"),sessions:j(r.get(i))}))});function Z(r){if(!F.value.has(r))F.value=new Set([...F.value,r]);else{F.value=new Set(Q.value.map(E=>E.source).filter(E=>E!==r));const i=Q.value.find(E=>E.source===r);i?.sessions.length&&s.switchSession(i.sessions[0].id)}localStorage.setItem("hermes_collapsed_groups",JSON.stringify([...F.value]))}X(Q,r=>{if(localStorage.getItem("hermes_collapsed_groups")!==null){const i=s.activeSession?.source;i&&F.value.has(i)&&(F.value=new Set([...F.value].filter(E=>E!==i)),localStorage.setItem("hermes_collapsed_groups",JSON.stringify([...F.value])));return}F.value=new Set(r.slice(1).map(i=>i.source)),localStorage.setItem("hermes_collapsed_groups",JSON.stringify([...F.value]))},{once:!0}),X(()=>[s.sessionsLoaded,...s.sessions.map(r=>r.id)],r=>{const i=r.slice(1);!r[0]||i.length===0||_.pruneMissingSessions(i)},{immediate:!0});const ye=q(()=>s.activeSession?.title||a("chat.newChat")),re=q(()=>S.value==="live"?a("chat.liveSessions"):ye.value),fe=q(()=>S.value==="chat"&&s.activeSession?.source||"");function _e(){s.newChat()}async function ue(r){const i=r||s.activeSessionId;i&&(await si(i)?C.success(a("common.copied")):C.error(a("common.copied")+" ✗"))}function te(r){_.removePinned(r),s.deleteSession(r),C.success(a("chat.sessionDeleted"))}function pe(){y.value=!y.value,y.value||M.value.clear()}function ce(r){M.value.has(r)?M.value.delete(r):M.value.add(r),M.value=new Set(M.value)}function me(r){return M.value.has(r)}async function c(){if(M.value.size===0)return;const r=Array.from(M.value);try{const i=await Hn(r);if(i.deleted>0){for(const E of r)_.removePinned(E);await s.loadSessions(),C.success(a("chat.batchDeleteSuccess",{count:i.deleted})),i.failed>0&&C.warning(a("chat.batchDeletePartial",{failed:i.failed}))}else C.error(a("chat.batchDeleteFailed"))}catch{C.error(a("chat.batchDeleteFailed"))}finally{y.value=!1,M.value.clear()}}function d(){M.value.clear();for(const r of s.sessions)r.id!==s.activeSessionId&&M.value.add(r.id);M.value=new Set(M.value)}const P=q(()=>M.value.size),se=q(()=>s.sessions.some(r=>r.id!==s.activeSessionId)),J=m(null),Te=q(()=>J.value?_.isPinned(J.value):!1),be=q(()=>[{label:a(Te.value?"chat.unpin":"chat.pin"),key:"pin"},{label:a("chat.rename"),key:"rename"},{label:a("chat.setWorkspace"),key:"workspace"},{label:a("chat.copySessionId"),key:"copy-id"}]);function u(r,i){r.preventDefault(),J.value=i,p.value=!0,I.value=r.clientX,ne.value=r.clientY}const p=m(!1),I=m(0),ne=m(0);function Be(r){if(p.value=!1,!!J.value){if(r==="pin"){_.togglePinned(J.value);return}if(r==="copy-id")ue(J.value);else if(r==="workspace"){const i=s.sessions.find(E=>E.id===J.value);we.value=J.value,ge.value=i?.workspace||"",Se.value=!0}else if(r==="rename"){const i=s.sessions.find(E=>E.id===J.value);Y.value=J.value,O.value=i?.title||"",D.value=!0,ke(()=>{A.value?.focus()})}}}function Sn(){p.value=!1}async function Ne(){if(!(!Y.value||!O.value.trim())){if(await Wn(Y.value,O.value.trim())){const r=s.sessions.find(i=>i.id===Y.value);r&&(r.title=O.value.trim()),s.activeSession?.id===Y.value&&(s.activeSession.title=O.value.trim()),C.success(a("chat.renamed"))}else C.error(a("chat.renameFailed"));D.value=!1}}const Se=m(!1),ge=m(""),we=m(null);async function Cn(){if(we.value){if(await Vn(we.value,ge.value||null)){const r=s.sessions.find(i=>i.id===we.value);r&&(r.workspace=ge.value||null),s.activeSession?.id===we.value&&(s.activeSession.workspace=ge.value||null),C.success(a("chat.workspaceSet"))}else C.error(a("chat.workspaceSetFailed"));Se.value=!1}}return(r,i)=>{const E=Ln("RouterLink");return n(),o("div",Ps,[S.value==="chat"?(n(),o("div",{key:0,class:G(["session-backdrop",{active:B.value}]),onClick:i[0]||(i[0]=T=>B.value=!1)},null,2)):w("",!0),S.value==="chat"?(n(),o("aside",{key:1,class:G(["session-list",{collapsed:!B.value}])},[e("div",Ts,[B.value?(n(),o("span",Bs,l(t(a)("chat.webUiSessions")),1)):w("",!0),e("div",Fs,[e("button",{class:"session-close-btn",onClick:i[1]||(i[1]=T=>B.value=!1)},[...i[10]||(i[10]=[e("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])]),y.value?w("",!0):(n(),K(t(H),{key:0,quaternary:"",size:"tiny",onClick:pe,title:t(a)("chat.toggleBatchMode")},{icon:k(()=>[...i[11]||(i[11]=[e("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("path",{d:"M9 11l3 3L22 4"}),e("path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"})],-1)])]),_:1},8,["title"])),y.value?(n(),K(t(H),{key:1,quaternary:"",size:"tiny",onClick:d,disabled:!se.value,title:t(a)("chat.selectAll")},{icon:k(()=>[...i[12]||(i[12]=[e("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("path",{d:"M9 11l3 3L22 4"}),e("path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"})],-1)])]),_:1},8,["disabled","title"])):w("",!0),y.value&&P.value>0?(n(),K(t(tn),{key:2,onPositiveClick:c},{trigger:k(()=>[b(t(H),{quaternary:"",size:"tiny",type:"error"},{icon:k(()=>[...i[13]||(i[13]=[e("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("polyline",{points:"3 6 5 6 21 6"}),e("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})],-1)])]),_:1})]),default:k(()=>[U(" "+l(t(a)("chat.confirmBatchDelete",{count:P.value})),1)]),_:1})):w("",!0),y.value?(n(),K(t(H),{key:3,quaternary:"",size:"tiny",onClick:pe},{icon:k(()=>[...i[14]||(i[14]=[e("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])]),_:1})):w("",!0),b(t(H),{quaternary:"",size:"tiny",onClick:_e,circle:""},{icon:k(()=>[...i[15]||(i[15]=[e("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),e("line",{x1:"5",y1:"12",x2:"19",y2:"12"})],-1)])]),_:1})])]),B.value?(n(),o("div",Ls,[e("span",null,l(t(a)("chat.sessionScopeHint")),1),b(E,{class:"session-scope-link",to:{name:"hermes.history"}},{default:k(()=>[U(l(t(a)("chat.openHistory")),1)]),_:1})])):w("",!0),B.value?(n(),o("div",Ds,[t(s).isLoadingSessions&&t(s).sessions.length===0?(n(),o("div",Rs,l(t(a)("common.loading")),1)):t(s).sessions.length===0?(n(),o("div",Es,l(t(a)("chat.noSessions")),1)):w("",!0),N.value.length>0?(n(),o(W,{key:2},[e("div",As,[e("span",zs,l(t(a)("chat.pinned")),1),e("span",Os,l(N.value.length),1)]),(n(!0),o(W,null,ee(N.value,T=>(n(),K(He,{key:`pinned-${T.id}`,session:T,active:T.id===t(s).activeSessionId,pinned:!0,"can-delete":T.id!==t(s).activeSessionId||t(s).sessions.length>1,streaming:t(s).isSessionLive(T.id),selectable:y.value,selected:me(T.id),onSelect:V=>h(T.id),onContextmenu:V=>u(V,T.id),onDelete:V=>te(T.id),onToggleSelect:V=>ce(T.id)},null,8,["session","active","can-delete","streaming","selectable","selected","onSelect","onContextmenu","onDelete","onToggleSelect"]))),128))],64)):w("",!0),(n(!0),o(W,null,ee(Q.value,T=>(n(),o(W,{key:T.source},[e("div",{class:"session-group-header",onClick:V=>Z(T.source)},[(n(),o("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2",class:G(["group-chevron",{collapsed:F.value.has(T.source)}])},[...i[16]||(i[16]=[e("polyline",{points:"9 18 15 12 9 6"},null,-1)])],2)),e("span",Ns,l(T.label),1),e("span",Vs,l(T.sessions.length),1)],8,Us),F.value.has(T.source)?w("",!0):(n(!0),o(W,{key:0},ee(T.sessions,V=>(n(),K(He,{key:V.id,session:V,active:V.id===t(s).activeSessionId,pinned:!1,"can-delete":V.id!==t(s).activeSessionId||t(s).sessions.length>1,streaming:t(s).isSessionLive(V.id),selectable:y.value,selected:me(V.id),onSelect:Ce=>h(V.id),onContextmenu:Ce=>u(Ce,V.id),onDelete:Ce=>te(V.id),onToggleSelect:Ce=>ce(V.id)},null,8,["session","active","can-delete","streaming","selectable","selected","onSelect","onContextmenu","onDelete","onToggleSelect"]))),128))],64))),128))])):w("",!0)],2)):w("",!0),b(t(En),{placement:"bottom-start",trigger:"manual",x:I.value,y:ne.value,options:be.value,show:p.value,onSelect:Be,onClickoutside:Sn},null,8,["x","y","options","show"]),b(t(De),{show:D.value,"onUpdate:show":i[3]||(i[3]=T=>D.value=T),preset:"dialog",title:t(a)("chat.renameSession"),"positive-text":t(a)("common.ok"),"negative-text":t(a)("common.cancel"),onPositiveClick:Ne},{default:k(()=>[b(t(Tn),{ref_key:"renameInputRef",ref:A,value:O.value,"onUpdate:value":i[2]||(i[2]=T=>O.value=T),placeholder:t(a)("chat.enterNewTitle"),onKeydown:Mn(Ne,["enter"])},null,8,["value","placeholder"])]),_:1},8,["show","title","positive-text","negative-text"]),b(t(De),{show:Se.value,"onUpdate:show":i[5]||(i[5]=T=>Se.value=T),preset:"dialog",title:t(a)("chat.setWorkspaceTitle"),"positive-text":t(a)("common.ok"),"negative-text":t(a)("common.cancel"),style:{width:"520px"},onPositiveClick:Cn},{default:k(()=>[b(Yn,{modelValue:ge.value,"onUpdate:modelValue":i[4]||(i[4]=T=>ge.value=T)},null,8,["modelValue"])]),_:1},8,["show","title","positive-text","negative-text"]),e("div",qs,[e("header",Hs,[e("div",Ws,[S.value==="chat"?(n(),K(t(H),{key:0,quaternary:"",size:"small",onClick:i[6]||(i[6]=T=>B.value=!B.value),circle:""},{icon:k(()=>[...i[17]||(i[17]=[e("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[e("rect",{x:"3",y:"3",width:"7",height:"7"}),e("rect",{x:"14",y:"3",width:"7",height:"7"}),e("rect",{x:"3",y:"14",width:"7",height:"7"}),e("rect",{x:"14",y:"14",width:"7",height:"7"})],-1)])]),_:1})):w("",!0),e("span",Ks,l(re.value),1),fe.value?(n(),o("span",Gs,l(t($e)(fe.value)),1)):w("",!0),t(s).activeSession?.workspace?(n(),o("span",{key:2,class:"workspace-badge",title:t(s).activeSession.workspace},"📁 "+l(t(s).activeSession.workspace.split("/").pop()||t(s).activeSession.workspace),9,js)):w("",!0)]),e("div",Js,[S.value==="chat"?(n(),o(W,{key:0},[b(t(xe),{trigger:"hover"},{trigger:k(()=>[b(t(H),{quaternary:"",size:"small",onClick:i[7]||(i[7]=T=>ue()),circle:""},{icon:k(()=>[...i[18]||(i[18]=[e("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[e("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),e("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})],-1)])]),_:1})]),default:k(()=>[U(" "+l(t(a)("chat.copySessionId")),1)]),_:1}),b(t(H),{size:"small",circle:v.value,onClick:_e},{icon:k(()=>[...i[19]||(i[19]=[e("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),e("line",{x1:"5",y1:"12",x2:"19",y2:"12"})],-1)])]),default:k(()=>[v.value?w("",!0):(n(),o(W,{key:0},[U(l(t(a)("chat.newChat")),1)],64))]),_:1},8,["circle"])],64)):w("",!0)])]),S.value==="chat"?(n(),o(W,{key:0},[b(fn),b(rn)],64)):(n(),K(cn,{key:1,"human-only":t(_).humanOnly},null,8,["human-only"]))]),e("div",Ys,[e("div",{class:"drawer-button",onClick:i[8]||(i[8]=T=>g.value=!0)},[...i[20]||(i[20]=[e("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[e("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),e("line",{x1:"9",y1:"3",x2:"9",y2:"21"}),e("line",{x1:"15",y1:"3",x2:"15",y2:"21"})],-1)])])]),b(wn,{show:g.value,"onUpdate:show":i[9]||(i[9]=T=>g.value=T),"active-tab":L.value},null,8,["show","active-tab"])])}}})})),Ji=R((()=>{})),xn,Yi=R((()=>{Xs(),Xs(),Ji(),oe(),xn=le(kn,[["__scopeId","data-v-d0f532f3"]])})),Qs,bn,Zs=R((()=>{ae(),Yi(),nn(),Pe(),sn(),Gn(),Qs={class:"chat-view"},bn=ie({__name:"ChatView",setup(z){const s=Ee(),_=Ie(),C=Re(),a=Kn();return de(async()=>{s.loadModels(),await Promise.all([C.fetchProfiles(),a.fetchSettings()]),_.loadSessions()}),(g,L)=>(n(),o("div",Qs,[b(xn)]))}})})),Xi=R((()=>{})),Qi,Zi=R((()=>{Zs(),Zs(),Xi(),oe(),Qi=le(bn,[["__scopeId","data-v-c6869148"]])}));Zi();export{Qi as default};
@@ -1 +1 @@
1
- import{n as g}from"./rolldown-runtime-iJLb3ux7.js";import{$ as O,G as pt,K as te,Lt as m,M as ae,N as _t,P as ft,Pt as e,Q as R,R as vt,S as mt,X as J,Z as y,a as ht,b as Oe,bt as h,dt as Re,et as $,g as V,ht as qe,it as B,j as E,kt as C,l as wt,lt as gt,m as G,nt as x,ot as ie,pt as b,q as Ke,r as yt,rt as F,t as P,ut as Ft,vt as kt,x as bt,y as Ae,z as M}from"./ui-vendor-DIP97-f3.js";import{d as Ct,n as U,r as L,u as xt}from"./vue-vendor-DHimL2gr.js";import{i as Ve,o as St,r as Je,s as q}from"./router-BfmZqYKj.js";import{n as K,t as A}from"./_plugin-vue_export-helper-JVWBimuG.js";import{Mi as $t,Ni as Tt,Pi as Et,t as Dt}from"./monaco-editor-DJ0jbRX9.js";import{n as Mt,t as zt}from"./clipboard-D3SeHW1n.js";import{c as Xe,n as Bt,s as Ge,t as Pt}from"./MarkdownRenderer-BmetuLvT.js";async function We(i=""){const s=new URLSearchParams;i&&s.set("path",i);const t=s.toString();return q(`/api/hermes/files/list${t?`?${t}`:""}`)}async function se(i){return q(`/api/hermes/files/read?path=${encodeURIComponent(i)}`)}async function le(i,s){await q("/api/hermes/files/write",{method:"PUT",body:JSON.stringify({path:i,content:s})})}async function Ut(i,s=!1){await q("/api/hermes/files/delete",{method:"DELETE",body:JSON.stringify({path:i,recursive:s})})}async function Lt(i,s){await q("/api/hermes/files/rename",{method:"POST",body:JSON.stringify({oldPath:i,newPath:s})})}async function jt(i){await q("/api/hermes/files/mkdir",{method:"POST",body:JSON.stringify({path:i})})}async function It(i,s){await q("/api/hermes/files/copy",{method:"POST",body:JSON.stringify({srcPath:i,destPath:s})})}async function Nt(i,s){const t=Ve(),n=new FormData;for(const w of s)n.append("file",w);const a=new URLSearchParams;i&&a.set("path",i);const l=a.toString(),r=`${t}/api/hermes/files/upload${l?`?${l}`:""}`,c={},_=Je();_&&(c.Authorization=`Bearer ${_}`);const u=await fetch(r,{method:"POST",headers:c,body:n});if(!u.ok){const w=await u.json().catch(()=>({error:`HTTP ${u.status}`}));throw new Error(w.error||`Upload failed: ${u.status}`)}return(await u.json()).files}function Ot(i,s){const t=Ve(),n=new URLSearchParams({path:i});s&&n.set("name",s);const a=Je();return a&&n.set("token",a),`${t}/api/hermes/download?${n.toString()}`}var Y=g((()=>{St()}));function Rt(i){const s=i.split("/").pop()||"";return s==="Dockerfile"?"dockerfile":s==="Makefile"?"makefile":He["."+s.split(".").pop()?.toLowerCase()]||"plaintext"}function Q(i){const s=i.lastIndexOf(".");return s>=0?i.slice(s).toLowerCase():""}function Z(i){return Ye.has(Q(i))}function ee(i){const s=Q(i);return s===".md"||s===".markdown"}function H(i){return!new Set([".png",".jpg",".jpeg",".gif",".webp",".bmp",".ico",".zip",".gz",".tar",".7z",".rar",".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".mp3",".mp4",".wav",".webm",".avi",".mov",".exe",".dll",".so",".dylib",".bin",".dat",".db",".sqlite"]).has(Q(i))}function X(i,s,t){return!!(i===s||t&&i.startsWith(s+"/"))}var He,Ye,z,j=g((()=>{Ct(),M(),Y(),He={".js":"javascript",".jsx":"javascript",".ts":"typescript",".tsx":"typescript",".json":"json",".jsonc":"json",".html":"html",".htm":"html",".css":"css",".scss":"scss",".less":"less",".md":"markdown",".markdown":"markdown",".py":"python",".yaml":"yaml",".yml":"yaml",".xml":"xml",".sh":"shell",".bash":"shell",".zsh":"shell",".sql":"sql",".go":"go",".rs":"rust",".java":"java",".c":"c",".h":"c",".cpp":"cpp",".hpp":"cpp",".toml":"ini",".ini":"ini",".env":"ini",".vue":"html",".dockerfile":"dockerfile",".graphql":"graphql",".lua":"lua",".r":"r",".rb":"ruby",".php":"php",".swift":"swift",".kt":"kotlin"},Ye=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".bmp",".ico"]),z=xt("files",()=>{const i=C(""),s=C([]),t=C(!1),n=C("name"),a=C("asc"),l=C(null),r=C(null),c=J(()=>i.value?i.value.split("/").filter(Boolean):[]),_=J(()=>{const o=[...s.value];return o.sort((k,I)=>{if(k.isDir!==I.isDir)return k.isDir?-1:1;let N=0;switch(n.value){case"name":N=k.name.localeCompare(I.name);break;case"size":N=k.size-I.size;break;case"modTime":N=k.modTime.localeCompare(I.modTime);break}return a.value==="asc"?N:-N}),o});async function u(o){o!==void 0&&o!==i.value&&(r.value=null),o!==void 0&&(i.value=o),t.value=!0;try{s.value=(await We(i.value)).entries}catch(k){throw console.error("Failed to fetch files:",k),k}finally{t.value=!1}}function w(o){return u(o)}function S(){const o=i.value.split("/").filter(Boolean);return o.pop(),u(o.join("/"))}async function d(o){const k=await se(o);l.value={path:o,content:k.content,originalContent:k.content,language:Rt(o)}}async function p(){l.value&&(await le(l.value.path,l.value.content),l.value.originalContent=l.value.content)}function f(){l.value=null}async function D(o){if(Z(o.name))r.value={path:o.path,type:"image"};else if(ee(o.name)){const k=await se(o.path);r.value={path:o.path,type:"markdown",content:k.content}}}function T(){r.value=null}async function v(o){const k=i.value?`${i.value}/${o}`:o;await jt(k),await u()}async function W(o){const k=i.value?`${i.value}/${o}`:o;await le(k,""),await u()}async function ot(o){await Ut(o.path,o.isDir),r.value&&X(r.value.path,o.path,o.isDir)&&(r.value=null),l.value&&X(l.value.path,o.path,o.isDir)&&(l.value=null),await u()}async function rt(o,k){const I=o.path.includes("/")?o.path.slice(0,o.path.lastIndexOf("/")):"",N=I?`${I}/${k}`:k;await Lt(o.path,N),r.value&&X(r.value.path,o.path,o.isDir)&&(r.value=null),l.value&&X(l.value.path,o.path,o.isDir)&&(l.value=null),await u()}async function ut(o,k){await It(o.path,k),await u()}async function ct(o){await Nt(i.value,o),await u()}function dt(o){n.value===o?a.value=a.value==="asc"?"desc":"asc":(n.value=o,a.value="asc")}return{currentPath:i,entries:s,loading:t,sortBy:n,sortOrder:a,editingFile:l,previewFile:r,pathSegments:c,sortedEntries:_,hasUnsavedChanges:J(()=>l.value?l.value.content!==l.value.originalContent:!1),fetchEntries:u,navigateTo:w,navigateUp:S,openEditor:d,saveEditor:p,closeEditor:f,openPreview:D,closePreview:T,createDir:v,createFile:W,deleteEntry:ot,renameEntry:rt,copyEntry:ut,uploadFiles:ct,setSort:dt}})})),ne,Qe,oe=g((()=>{M(),P(),U(),j(),Y(),ne={class:"file-tree"},Qe=B({__name:"FileTree",setup(i){const{t:s}=L(),t=z(),n=C([]),a=C([]);async function l(u){try{return(await We(u)).entries.filter(w=>w.isDir).sort((w,S)=>w.name.localeCompare(S.name)).map(w=>({key:w.path,label:w.name,isLeaf:!1}))}catch{return[]}}async function r(u){u.children=await l(u.key)}function c(u){u.length>0&&(a.value=u,t.navigateTo(u[0]))}function _(){a.value=[],t.navigateTo("")}return Re(async()=>{n.value=await l("")}),(u,w)=>(b(),$("div",ne,[y("div",{class:"tree-header",onClick:_},[w[0]||(w[0]=y("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},[y("path",{d:"M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"}),y("polyline",{points:"9 22 9 12 15 12 15 22"})],-1)),y("span",null,m(e(s)("files.breadcrumbRoot")),1)]),F(e(ht),{data:n.value,"selected-keys":a.value,"on-load":r,"expand-on-click":"","block-line":"","onUpdate:selectedKeys":c},null,8,["data","selected-keys"])]))}})})),qt=g((()=>{})),Kt,pa=g((()=>{oe(),oe(),qt(),K(),Kt=A(Qe,[["__scopeId","data-v-7f00b3bc"]])})),re,Ze,ue=g((()=>{M(),U(),P(),j(),re={class:"file-breadcrumb"},Ze=B({__name:"FileBreadcrumb",setup(i){const{t:s}=L(),t=z();function n(a){if(a<0)t.navigateTo("");else{const l=t.pathSegments.slice(0,a+1).join("/");t.navigateTo(l)}}return(a,l)=>(b(),$("div",re,[F(e(_t),null,{default:h(()=>[F(e(ae),{onClick:l[0]||(l[0]=r=>n(-1))},{default:h(()=>[x(m(e(s)("files.breadcrumbRoot")),1)]),_:1}),(b(!0),$(Ke,null,qe(e(t).pathSegments,(r,c)=>(b(),R(e(ae),{key:c,onClick:_=>n(c)},{default:h(()=>[x(m(r),1)]),_:2},1032,["onClick"]))),128))]),_:1})]))}})})),At=g((()=>{})),Vt,_a=g((()=>{ue(),ue(),At(),K(),Vt=A(Ze,[["__scopeId","data-v-061302de"]])})),ce,et,de=g((()=>{M(),P(),U(),j(),ce={class:"file-toolbar"},et=B({__name:"FileToolbar",emits:["showNewFile","showNewFolder","showUpload"],setup(i,{emit:s}){const{t}=L(),n=V(),a=z(),l=s;async function r(){try{await a.fetchEntries()}catch{n.error(t("files.backendError"))}}return(c,_)=>(b(),$("div",ce,[F(e(G),{size:8,wrap:!0,class:"toolbar-space"},{default:h(()=>[F(e(E),{size:"small",onClick:_[0]||(_[0]=u=>l("showNewFile")),class:"toolbar-btn"},{default:h(()=>[x(m(e(t)("files.newFile")),1)]),_:1}),F(e(E),{size:"small",onClick:_[1]||(_[1]=u=>l("showNewFolder")),class:"toolbar-btn"},{default:h(()=>[x(m(e(t)("files.newFolder")),1)]),_:1}),F(e(E),{size:"small",onClick:_[2]||(_[2]=u=>l("showUpload")),class:"toolbar-btn"},{default:h(()=>[x(m(e(t)("files.upload")),1)]),_:1}),F(e(E),{size:"small",onClick:r,class:"toolbar-btn"},{default:h(()=>[x(m(e(t)("files.refresh")),1)]),_:1})]),_:1})]))}})})),Jt=g((()=>{})),Xt,fa=g((()=>{de(),de(),Jt(),K(),Xt=A(et,[["__scopeId","data-v-ec79e90c"]])})),pe,_e,fe,ve,me,he,we,ge,ye,Fe,ke,be,tt,Ce=g((()=>{M(),P(),U(),j(),Xe(),pe={class:"file-list"},_e={key:1,class:"file-list-items"},fe={class:"file-list-header"},ve={key:0,class:"sort-indicator"},me={key:0,class:"sort-indicator"},he={key:0,class:"sort-indicator"},we=["onDblclick","onContextmenu"],ge={class:"file-name"},ye={class:"file-icon"},Fe={class:"file-size"},ke={class:"file-date"},be={class:"file-actions"},tt=B({__name:"FileList",emits:["contextmenu-entry"],setup(i,{emit:s}){const{t}=L(),n=V(),a=z(),l=s;function r(d){if(d===0)return"—";const p=["B","KB","MB","GB"];let f=0,D=d;for(;D>=1024&&f<p.length-1;)D/=1024,f++;return`${D.toFixed(f===0?0:1)} ${p[f]}`}function c(d){return d?new Date(d).toLocaleString():"—"}function _(d){return d.isDir?"📁":{yaml:"⚙️",yml:"⚙️",json:"📋",toml:"⚙️",md:"📝",txt:"📄",log:"📄",py:"🐍",js:"📜",ts:"📜",vue:"💚",png:"🖼️",jpg:"🖼️",jpeg:"🖼️",gif:"🖼️",svg:"🖼️",webp:"🖼️",zip:"📦",gz:"📦",tar:"📦",sh:"⚡",bash:"⚡"}[d.name.split(".").pop()?.toLowerCase()||""]||"📄"}function u(d){d.isDir?a.navigateTo(d.path):H(d.name)?a.openEditor(d.path):(Z(d.name)||ee(d.name))&&a.openPreview(d)}function w(d,p){d.preventDefault(),l("contextmenu-entry",d,p)}async function S(d){try{await Ge(d.path,d.name)}catch(p){n.error(p.message||t("files.backendError"))}}return(d,p)=>(b(),$("div",pe,[F(e(wt),{show:e(a).loading},{default:h(()=>[!e(a).loading&&e(a).sortedEntries.length===0?(b(),R(e(vt),{key:0,description:e(t)("files.emptyDir")},null,8,["description"])):(b(),$("div",_e,[y("div",fe,[y("div",{class:"file-name sort-header",onClick:p[0]||(p[0]=f=>e(a).setSort("name"))},[x(m(e(t)("files.name"))+" ",1),e(a).sortBy==="name"?(b(),$("span",ve,m(e(a).sortOrder==="asc"?"↑":"↓"),1)):O("",!0)]),y("div",{class:"file-size sort-header",onClick:p[1]||(p[1]=f=>e(a).setSort("size"))},[x(m(e(t)("files.size"))+" ",1),e(a).sortBy==="size"?(b(),$("span",me,m(e(a).sortOrder==="asc"?"↑":"↓"),1)):O("",!0)]),y("div",{class:"file-date sort-header",onClick:p[2]||(p[2]=f=>e(a).setSort("modTime"))},[x(m(e(t)("files.modified"))+" ",1),e(a).sortBy==="modTime"?(b(),$("span",he,m(e(a).sortOrder==="asc"?"↑":"↓"),1)):O("",!0)]),p[3]||(p[3]=y("div",{class:"file-actions-placeholder"},null,-1))]),(b(!0),$(Ke,null,qe(e(a).sortedEntries,f=>(b(),$("div",{key:f.path,class:"file-list-row",onDblclick:D=>u(f),onContextmenu:D=>w(D,f)},[y("div",ge,[y("span",ye,m(_(f)),1),y("span",null,m(f.name),1)]),y("div",Fe,m(f.isDir?"—":r(f.size)),1),y("div",ke,m(c(f.modTime)),1),y("div",be,[e(H)(f.name)&&!f.isDir?(b(),R(e(E),{key:0,size:"tiny",quaternary:"",onClick:te(D=>e(a).openEditor(f.path),["stop"]),title:e(t)("files.edit")},{default:h(()=>[...p[4]||(p[4]=[x("✏️",-1)])]),_:1},8,["onClick","title"])):O("",!0),f.isDir?O("",!0):(b(),R(e(E),{key:1,size:"tiny",quaternary:"",onClick:te(D=>S(f),["stop"]),title:e(t)("files.download")},{default:h(()=>[...p[5]||(p[5]=[x("⬇️",-1)])]),_:1},8,["onClick","title"]))])],40,we))),128))]))]),_:1},8,["show"])]))}})})),Gt=g((()=>{})),Wt,va=g((()=>{Ce(),Ce(),Gt(),K(),Wt=A(tt,[["__scopeId","data-v-ab2593c7"]])})),at,xe=g((()=>{M(),P(),U(),j(),Xe(),Mt(),at=B({__name:"FileContextMenu",emits:["rename"],setup(i,{expose:s,emit:t}){const{t:n}=L(),a=V(),l=Oe(),r=z(),c=C(!1),_=C(0),u=C(0),w=C(null),S=t;function d(T,v){w.value=v,_.value=T.clientX,u.value=T.clientY,c.value=!1,gt(()=>{c.value=!0})}function p(){const T=w.value;if(!T)return[];const v=[];return T.isDir?v.push({label:n("files.open"),key:"open"}):(H(T.name)&&v.push({label:n("files.edit"),key:"edit"}),(Z(T.name)||ee(T.name))&&v.push({label:n("files.preview"),key:"preview"}),v.push({label:n("files.download"),key:"download"})),v.push({type:"divider",key:"d1"}),v.push({label:n("files.copyPath"),key:"copyPath"}),v.push({label:n("files.rename"),key:"rename"}),v.push({type:"divider",key:"d2"}),v.push({label:n("files.delete"),key:"delete"}),v}async function f(T){c.value=!1;const v=w.value;if(v)switch(T){case"open":r.navigateTo(v.path);break;case"edit":try{await r.openEditor(v.path)}catch{a.error(n("files.backendError"))}break;case"preview":try{await r.openPreview(v)}catch{a.error(n("files.backendError"))}break;case"download":try{await Ge(v.path,v.name)}catch(W){a.error(W.message)}break;case"copyPath":await zt(v.path)?a.success(n("files.pathCopied")):a.error(n("files.pathCopied")+" ✗");break;case"rename":S("rename",v);break;case"delete":l.warning({title:n("files.delete"),content:v.isDir?n("files.confirmDeleteDir",{name:v.name}):n("files.confirmDelete",{name:v.name}),positiveText:n("common.delete"),negativeText:n("common.cancel"),onPositiveClick:async()=>{try{await r.deleteEntry(v),a.success(n("files.deleted"))}catch{a.error(n("files.deleteFailed"))}}});break}}function D(){c.value=!1}return s({show:d}),(T,v)=>(b(),R(e(bt),{show:c.value,x:_.value,y:u.value,options:p(),placement:"bottom-start",trigger:"manual",onSelect:f,onClickoutside:D},null,8,["show","x","y","options"]))}})})),Ht,ma=g((()=>{xe(),xe(),Ht=at})),Se,$e,Te,it,Ee=g((()=>{M(),P(),U(),j(),Dt(),Se={class:"file-editor"},$e={class:"editor-header"},Te={class:"editor-filename"},it=B({__name:"FileEditor",setup(i){self.MonacoEnvironment={getWorker(w,S){return new Worker(new URL("/assets/editor.worker-JF2IK1uK.js",""+import.meta.url),{type:"module"})}};const{t:s}=L(),t=V(),n=Oe(),a=z(),l=C(null);let r=null;const c=C(!1);Re(()=>{!l.value||!a.editingFile||(r=Et.create(l.value,{value:a.editingFile.content,language:a.editingFile.language,theme:document.documentElement.classList.contains("dark")?"vs-dark":"vs",minimap:{enabled:!1},fontSize:13,lineNumbers:"on",scrollBeyondLastLine:!1,automaticLayout:!0,tabSize:2,wordWrap:"on"}),r.onDidChangeModelContent(()=>{a.editingFile&&(a.editingFile.content=r.getValue())}),r.addCommand(Tt.CtrlCmd|$t.KeyS,()=>{_()}))}),Ft(()=>{r?.dispose(),r=null});async function _(){c.value=!0;try{await a.saveEditor(),t.success(s("files.saved"))}catch{t.error(s("files.saveFailed"))}finally{c.value=!1}}function u(){a.hasUnsavedChanges?n.warning({title:s("files.unsavedChanges"),positiveText:s("common.ok"),negativeText:s("common.cancel"),onPositiveClick:()=>{a.closeEditor()}}):a.closeEditor()}return(w,S)=>(b(),$("div",Se,[y("div",$e,[y("span",Te,m(e(a).editingFile?.path),1),F(e(G),null,{default:h(()=>[F(e(E),{size:"small",type:"primary",loading:c.value,onClick:_},{default:h(()=>[x(m(e(s)("files.saveFile")),1)]),_:1},8,["loading"]),F(e(E),{size:"small",onClick:u},{default:h(()=>[x(m(e(s)("files.closeEditor")),1)]),_:1})]),_:1})]),y("div",{ref_key:"editorContainer",ref:l,class:"editor-container"},null,512)]))}})})),Yt=g((()=>{})),Qt,ha=g((()=>{Ee(),Ee(),Yt(),K(),Qt=A(it,[["__scopeId","data-v-1ae26b53"]])})),De,Me,ze,Be,Pe,Ue,st,Le=g((()=>{M(),P(),U(),j(),Y(),Bt(),De={key:0,class:"file-preview"},Me={class:"preview-header"},ze={class:"preview-filename"},Be={class:"preview-content"},Pe=["src","alt"],Ue={key:1,class:"preview-markdown"},st=B({__name:"FilePreview",setup(i){const{t:s}=L(),t=z();function n(){return t.previewFile?Ot(t.previewFile.path):""}const a=()=>ie("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"currentColor"},[ie("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})]);return(l,r)=>e(t).previewFile?(b(),$("div",De,[y("div",Me,[y("span",ze,m(e(t).previewFile.path),1),F(e(E),{size:"small",quaternary:"",onClick:r[0]||(r[0]=c=>e(t).closePreview())},{icon:h(()=>[F(e(mt),null,{default:h(()=>[F(a)]),_:1})]),default:h(()=>[x(" "+m(e(s)("files.closePreview")),1)]),_:1})]),y("div",Be,[e(t).previewFile.type==="image"?(b(),$("img",{key:0,src:n(),class:"preview-image",alt:e(t).previewFile.path},null,8,Pe)):e(t).previewFile.type==="markdown"?(b(),$("div",Ue,[F(Pt,{content:e(t).previewFile.content||""},null,8,["content"])])):O("",!0)])])):O("",!0)}})})),Zt=g((()=>{})),ea,wa=g((()=>{Le(),Le(),Zt(),K(),ea=A(st,[["__scopeId","data-v-a9f9eb37"]])})),je,lt,Ie=g((()=>{M(),P(),U(),j(),je={class:"upload-dragger"},lt=B({__name:"FileUploadModal",props:{show:{type:Boolean}},emits:["update:show"],setup(i,{emit:s}){const{t}=L(),n=V(),a=z(),l=i,r=s,c=C(!1),_=C([]);function u(d){_.value=d.fileList.map(p=>p.file).filter(p=>p!=null)}async function w(){if(_.value.length!==0){c.value=!0;try{await a.uploadFiles(_.value),n.success(t("files.uploadSuccess",{count:_.value.length})),_.value=[],r("update:show",!1)}catch(d){n.error(d.message||t("files.uploadFailed"))}finally{c.value=!1}}}function S(){_.value=[],r("update:show",!1)}return(d,p)=>(b(),R(e(Ae),{show:l.show,preset:"dialog",title:e(t)("files.upload"),"onUpdate:show":S,style:{width:"500px"}},{action:h(()=>[F(e(G),null,{default:h(()=>[F(e(E),{onClick:S},{default:h(()=>[x(m(e(t)("common.cancel")),1)]),_:1}),F(e(E),{type:"primary",loading:c.value,disabled:_.value.length===0,onClick:w},{default:h(()=>[x(m(e(t)("files.upload"))+" ("+m(_.value.length)+") ",1)]),_:1},8,["loading","disabled"])]),_:1})]),default:h(()=>[F(e(yt),{multiple:"","directory-dnd":"","default-upload":!1,onChange:u},{default:h(()=>[y("div",je,[y("p",null,m(e(t)("files.dragDropHint")),1)])]),_:1})]),_:1},8,["show","title"]))}})})),ta=g((()=>{})),aa,ga=g((()=>{Ie(),Ie(),ta(),K(),aa=A(lt,[["__scopeId","data-v-e54e68b1"]])})),nt,Ne=g((()=>{M(),P(),U(),j(),nt=B({__name:"FileRenameModal",props:{show:{type:Boolean},mode:{},entry:{}},emits:["update:show"],setup(i,{emit:s}){const{t}=L(),n=V(),a=z(),l=i,r=s,c=C(""),_=C(!1);kt(()=>l.show,d=>{d&&(l.mode==="rename"&&l.entry?c.value=l.entry.name:c.value="")});const u=J(()=>{switch(l.mode){case"newFile":return t("files.newFile");case"newFolder":return t("files.newFolder");case"rename":return t("files.rename")}}),w=J(()=>{switch(l.mode){case"newFile":return t("files.newFileName");case"newFolder":return t("files.newFolderName");case"rename":return t("files.renameTo")}});async function S(){if(c.value.trim()){_.value=!0;try{switch(l.mode){case"newFile":await a.createFile(c.value.trim()),n.success(t("files.created"));break;case"newFolder":await a.createDir(c.value.trim()),n.success(t("files.created"));break;case"rename":l.entry&&(await a.renameEntry(l.entry,c.value.trim()),n.success(t("files.renamed")));break}r("update:show",!1)}catch(d){const p=l.mode==="rename"?t("files.renameFailed"):t("files.createFailed");n.error(d.message||p)}finally{_.value=!1}}}return(d,p)=>(b(),R(e(Ae),{show:l.show,preset:"dialog",title:u.value,"onUpdate:show":p[2]||(p[2]=f=>r("update:show",!1)),style:{width:"400px"}},{action:h(()=>[F(e(G),null,{default:h(()=>[F(e(E),{onClick:p[1]||(p[1]=f=>r("update:show",!1))},{default:h(()=>[x(m(e(t)("common.cancel")),1)]),_:1}),F(e(E),{type:"primary",loading:_.value,disabled:!c.value.trim(),onClick:S},{default:h(()=>[x(m(e(t)("common.ok")),1)]),_:1},8,["loading","disabled"])]),_:1})]),default:h(()=>[F(e(ft),{value:c.value,"onUpdate:value":p[0]||(p[0]=f=>c.value=f),placeholder:w.value,onKeydown:pt(S,["enter"]),autofocus:""},null,8,["value","placeholder"])]),_:1},8,["show","title"]))}})})),ia,ya=g((()=>{Ne(),Ne(),ia=nt}));export{Kt as _,ea as a,z as b,ha as c,Wt as d,va as f,_a as g,Vt as h,ga as i,Ht as l,fa as m,ya as n,wa as o,Xt as p,aa as r,Qt as s,ia as t,ma as u,pa as v,j as y};
1
+ import{n as g}from"./rolldown-runtime-iJLb3ux7.js";import{$ as O,G as pt,K as te,Lt as m,M as ae,N as _t,P as ft,Pt as e,Q as R,R as vt,S as mt,X as J,Z as y,a as ht,b as Oe,bt as h,dt as Re,et as $,g as V,ht as qe,it as B,j as E,kt as C,l as wt,lt as gt,m as G,nt as x,ot as ie,pt as b,q as Ke,r as yt,rt as F,t as P,ut as Ft,vt as kt,x as bt,y as Ae,z as M}from"./ui-vendor-DIP97-f3.js";import{d as Ct,n as U,r as L,u as xt}from"./vue-vendor-DHimL2gr.js";import{i as Ve,o as St,r as Je,s as q}from"./router-Be5a7E15.js";import{n as K,t as A}from"./_plugin-vue_export-helper-JVWBimuG.js";import{Mi as $t,Ni as Tt,Pi as Et,t as Dt}from"./monaco-editor-DJ0jbRX9.js";import{n as Mt,t as zt}from"./clipboard-D3SeHW1n.js";import{c as Xe,n as Bt,s as Ge,t as Pt}from"./MarkdownRenderer-CJqzLmjP.js";async function We(i=""){const s=new URLSearchParams;i&&s.set("path",i);const t=s.toString();return q(`/api/hermes/files/list${t?`?${t}`:""}`)}async function se(i){return q(`/api/hermes/files/read?path=${encodeURIComponent(i)}`)}async function le(i,s){await q("/api/hermes/files/write",{method:"PUT",body:JSON.stringify({path:i,content:s})})}async function Ut(i,s=!1){await q("/api/hermes/files/delete",{method:"DELETE",body:JSON.stringify({path:i,recursive:s})})}async function Lt(i,s){await q("/api/hermes/files/rename",{method:"POST",body:JSON.stringify({oldPath:i,newPath:s})})}async function jt(i){await q("/api/hermes/files/mkdir",{method:"POST",body:JSON.stringify({path:i})})}async function It(i,s){await q("/api/hermes/files/copy",{method:"POST",body:JSON.stringify({srcPath:i,destPath:s})})}async function Nt(i,s){const t=Ve(),n=new FormData;for(const w of s)n.append("file",w);const a=new URLSearchParams;i&&a.set("path",i);const l=a.toString(),r=`${t}/api/hermes/files/upload${l?`?${l}`:""}`,c={},_=Je();_&&(c.Authorization=`Bearer ${_}`);const u=await fetch(r,{method:"POST",headers:c,body:n});if(!u.ok){const w=await u.json().catch(()=>({error:`HTTP ${u.status}`}));throw new Error(w.error||`Upload failed: ${u.status}`)}return(await u.json()).files}function Ot(i,s){const t=Ve(),n=new URLSearchParams({path:i});s&&n.set("name",s);const a=Je();return a&&n.set("token",a),`${t}/api/hermes/download?${n.toString()}`}var Y=g((()=>{St()}));function Rt(i){const s=i.split("/").pop()||"";return s==="Dockerfile"?"dockerfile":s==="Makefile"?"makefile":He["."+s.split(".").pop()?.toLowerCase()]||"plaintext"}function Q(i){const s=i.lastIndexOf(".");return s>=0?i.slice(s).toLowerCase():""}function Z(i){return Ye.has(Q(i))}function ee(i){const s=Q(i);return s===".md"||s===".markdown"}function H(i){return!new Set([".png",".jpg",".jpeg",".gif",".webp",".bmp",".ico",".zip",".gz",".tar",".7z",".rar",".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".mp3",".mp4",".wav",".webm",".avi",".mov",".exe",".dll",".so",".dylib",".bin",".dat",".db",".sqlite"]).has(Q(i))}function X(i,s,t){return!!(i===s||t&&i.startsWith(s+"/"))}var He,Ye,z,j=g((()=>{Ct(),M(),Y(),He={".js":"javascript",".jsx":"javascript",".ts":"typescript",".tsx":"typescript",".json":"json",".jsonc":"json",".html":"html",".htm":"html",".css":"css",".scss":"scss",".less":"less",".md":"markdown",".markdown":"markdown",".py":"python",".yaml":"yaml",".yml":"yaml",".xml":"xml",".sh":"shell",".bash":"shell",".zsh":"shell",".sql":"sql",".go":"go",".rs":"rust",".java":"java",".c":"c",".h":"c",".cpp":"cpp",".hpp":"cpp",".toml":"ini",".ini":"ini",".env":"ini",".vue":"html",".dockerfile":"dockerfile",".graphql":"graphql",".lua":"lua",".r":"r",".rb":"ruby",".php":"php",".swift":"swift",".kt":"kotlin"},Ye=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".bmp",".ico"]),z=xt("files",()=>{const i=C(""),s=C([]),t=C(!1),n=C("name"),a=C("asc"),l=C(null),r=C(null),c=J(()=>i.value?i.value.split("/").filter(Boolean):[]),_=J(()=>{const o=[...s.value];return o.sort((k,I)=>{if(k.isDir!==I.isDir)return k.isDir?-1:1;let N=0;switch(n.value){case"name":N=k.name.localeCompare(I.name);break;case"size":N=k.size-I.size;break;case"modTime":N=k.modTime.localeCompare(I.modTime);break}return a.value==="asc"?N:-N}),o});async function u(o){o!==void 0&&o!==i.value&&(r.value=null),o!==void 0&&(i.value=o),t.value=!0;try{s.value=(await We(i.value)).entries}catch(k){throw console.error("Failed to fetch files:",k),k}finally{t.value=!1}}function w(o){return u(o)}function S(){const o=i.value.split("/").filter(Boolean);return o.pop(),u(o.join("/"))}async function d(o){const k=await se(o);l.value={path:o,content:k.content,originalContent:k.content,language:Rt(o)}}async function p(){l.value&&(await le(l.value.path,l.value.content),l.value.originalContent=l.value.content)}function f(){l.value=null}async function D(o){if(Z(o.name))r.value={path:o.path,type:"image"};else if(ee(o.name)){const k=await se(o.path);r.value={path:o.path,type:"markdown",content:k.content}}}function T(){r.value=null}async function v(o){const k=i.value?`${i.value}/${o}`:o;await jt(k),await u()}async function W(o){const k=i.value?`${i.value}/${o}`:o;await le(k,""),await u()}async function ot(o){await Ut(o.path,o.isDir),r.value&&X(r.value.path,o.path,o.isDir)&&(r.value=null),l.value&&X(l.value.path,o.path,o.isDir)&&(l.value=null),await u()}async function rt(o,k){const I=o.path.includes("/")?o.path.slice(0,o.path.lastIndexOf("/")):"",N=I?`${I}/${k}`:k;await Lt(o.path,N),r.value&&X(r.value.path,o.path,o.isDir)&&(r.value=null),l.value&&X(l.value.path,o.path,o.isDir)&&(l.value=null),await u()}async function ut(o,k){await It(o.path,k),await u()}async function ct(o){await Nt(i.value,o),await u()}function dt(o){n.value===o?a.value=a.value==="asc"?"desc":"asc":(n.value=o,a.value="asc")}return{currentPath:i,entries:s,loading:t,sortBy:n,sortOrder:a,editingFile:l,previewFile:r,pathSegments:c,sortedEntries:_,hasUnsavedChanges:J(()=>l.value?l.value.content!==l.value.originalContent:!1),fetchEntries:u,navigateTo:w,navigateUp:S,openEditor:d,saveEditor:p,closeEditor:f,openPreview:D,closePreview:T,createDir:v,createFile:W,deleteEntry:ot,renameEntry:rt,copyEntry:ut,uploadFiles:ct,setSort:dt}})})),ne,Qe,oe=g((()=>{M(),P(),U(),j(),Y(),ne={class:"file-tree"},Qe=B({__name:"FileTree",setup(i){const{t:s}=L(),t=z(),n=C([]),a=C([]);async function l(u){try{return(await We(u)).entries.filter(w=>w.isDir).sort((w,S)=>w.name.localeCompare(S.name)).map(w=>({key:w.path,label:w.name,isLeaf:!1}))}catch{return[]}}async function r(u){u.children=await l(u.key)}function c(u){u.length>0&&(a.value=u,t.navigateTo(u[0]))}function _(){a.value=[],t.navigateTo("")}return Re(async()=>{n.value=await l("")}),(u,w)=>(b(),$("div",ne,[y("div",{class:"tree-header",onClick:_},[w[0]||(w[0]=y("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},[y("path",{d:"M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"}),y("polyline",{points:"9 22 9 12 15 12 15 22"})],-1)),y("span",null,m(e(s)("files.breadcrumbRoot")),1)]),F(e(ht),{data:n.value,"selected-keys":a.value,"on-load":r,"expand-on-click":"","block-line":"","onUpdate:selectedKeys":c},null,8,["data","selected-keys"])]))}})})),qt=g((()=>{})),Kt,pa=g((()=>{oe(),oe(),qt(),K(),Kt=A(Qe,[["__scopeId","data-v-7f00b3bc"]])})),re,Ze,ue=g((()=>{M(),U(),P(),j(),re={class:"file-breadcrumb"},Ze=B({__name:"FileBreadcrumb",setup(i){const{t:s}=L(),t=z();function n(a){if(a<0)t.navigateTo("");else{const l=t.pathSegments.slice(0,a+1).join("/");t.navigateTo(l)}}return(a,l)=>(b(),$("div",re,[F(e(_t),null,{default:h(()=>[F(e(ae),{onClick:l[0]||(l[0]=r=>n(-1))},{default:h(()=>[x(m(e(s)("files.breadcrumbRoot")),1)]),_:1}),(b(!0),$(Ke,null,qe(e(t).pathSegments,(r,c)=>(b(),R(e(ae),{key:c,onClick:_=>n(c)},{default:h(()=>[x(m(r),1)]),_:2},1032,["onClick"]))),128))]),_:1})]))}})})),At=g((()=>{})),Vt,_a=g((()=>{ue(),ue(),At(),K(),Vt=A(Ze,[["__scopeId","data-v-061302de"]])})),ce,et,de=g((()=>{M(),P(),U(),j(),ce={class:"file-toolbar"},et=B({__name:"FileToolbar",emits:["showNewFile","showNewFolder","showUpload"],setup(i,{emit:s}){const{t}=L(),n=V(),a=z(),l=s;async function r(){try{await a.fetchEntries()}catch{n.error(t("files.backendError"))}}return(c,_)=>(b(),$("div",ce,[F(e(G),{size:8,wrap:!0,class:"toolbar-space"},{default:h(()=>[F(e(E),{size:"small",onClick:_[0]||(_[0]=u=>l("showNewFile")),class:"toolbar-btn"},{default:h(()=>[x(m(e(t)("files.newFile")),1)]),_:1}),F(e(E),{size:"small",onClick:_[1]||(_[1]=u=>l("showNewFolder")),class:"toolbar-btn"},{default:h(()=>[x(m(e(t)("files.newFolder")),1)]),_:1}),F(e(E),{size:"small",onClick:_[2]||(_[2]=u=>l("showUpload")),class:"toolbar-btn"},{default:h(()=>[x(m(e(t)("files.upload")),1)]),_:1}),F(e(E),{size:"small",onClick:r,class:"toolbar-btn"},{default:h(()=>[x(m(e(t)("files.refresh")),1)]),_:1})]),_:1})]))}})})),Jt=g((()=>{})),Xt,fa=g((()=>{de(),de(),Jt(),K(),Xt=A(et,[["__scopeId","data-v-ec79e90c"]])})),pe,_e,fe,ve,me,he,we,ge,ye,Fe,ke,be,tt,Ce=g((()=>{M(),P(),U(),j(),Xe(),pe={class:"file-list"},_e={key:1,class:"file-list-items"},fe={class:"file-list-header"},ve={key:0,class:"sort-indicator"},me={key:0,class:"sort-indicator"},he={key:0,class:"sort-indicator"},we=["onDblclick","onContextmenu"],ge={class:"file-name"},ye={class:"file-icon"},Fe={class:"file-size"},ke={class:"file-date"},be={class:"file-actions"},tt=B({__name:"FileList",emits:["contextmenu-entry"],setup(i,{emit:s}){const{t}=L(),n=V(),a=z(),l=s;function r(d){if(d===0)return"—";const p=["B","KB","MB","GB"];let f=0,D=d;for(;D>=1024&&f<p.length-1;)D/=1024,f++;return`${D.toFixed(f===0?0:1)} ${p[f]}`}function c(d){return d?new Date(d).toLocaleString():"—"}function _(d){return d.isDir?"📁":{yaml:"⚙️",yml:"⚙️",json:"📋",toml:"⚙️",md:"📝",txt:"📄",log:"📄",py:"🐍",js:"📜",ts:"📜",vue:"💚",png:"🖼️",jpg:"🖼️",jpeg:"🖼️",gif:"🖼️",svg:"🖼️",webp:"🖼️",zip:"📦",gz:"📦",tar:"📦",sh:"⚡",bash:"⚡"}[d.name.split(".").pop()?.toLowerCase()||""]||"📄"}function u(d){d.isDir?a.navigateTo(d.path):H(d.name)?a.openEditor(d.path):(Z(d.name)||ee(d.name))&&a.openPreview(d)}function w(d,p){d.preventDefault(),l("contextmenu-entry",d,p)}async function S(d){try{await Ge(d.path,d.name)}catch(p){n.error(p.message||t("files.backendError"))}}return(d,p)=>(b(),$("div",pe,[F(e(wt),{show:e(a).loading},{default:h(()=>[!e(a).loading&&e(a).sortedEntries.length===0?(b(),R(e(vt),{key:0,description:e(t)("files.emptyDir")},null,8,["description"])):(b(),$("div",_e,[y("div",fe,[y("div",{class:"file-name sort-header",onClick:p[0]||(p[0]=f=>e(a).setSort("name"))},[x(m(e(t)("files.name"))+" ",1),e(a).sortBy==="name"?(b(),$("span",ve,m(e(a).sortOrder==="asc"?"↑":"↓"),1)):O("",!0)]),y("div",{class:"file-size sort-header",onClick:p[1]||(p[1]=f=>e(a).setSort("size"))},[x(m(e(t)("files.size"))+" ",1),e(a).sortBy==="size"?(b(),$("span",me,m(e(a).sortOrder==="asc"?"↑":"↓"),1)):O("",!0)]),y("div",{class:"file-date sort-header",onClick:p[2]||(p[2]=f=>e(a).setSort("modTime"))},[x(m(e(t)("files.modified"))+" ",1),e(a).sortBy==="modTime"?(b(),$("span",he,m(e(a).sortOrder==="asc"?"↑":"↓"),1)):O("",!0)]),p[3]||(p[3]=y("div",{class:"file-actions-placeholder"},null,-1))]),(b(!0),$(Ke,null,qe(e(a).sortedEntries,f=>(b(),$("div",{key:f.path,class:"file-list-row",onDblclick:D=>u(f),onContextmenu:D=>w(D,f)},[y("div",ge,[y("span",ye,m(_(f)),1),y("span",null,m(f.name),1)]),y("div",Fe,m(f.isDir?"—":r(f.size)),1),y("div",ke,m(c(f.modTime)),1),y("div",be,[e(H)(f.name)&&!f.isDir?(b(),R(e(E),{key:0,size:"tiny",quaternary:"",onClick:te(D=>e(a).openEditor(f.path),["stop"]),title:e(t)("files.edit")},{default:h(()=>[...p[4]||(p[4]=[x("✏️",-1)])]),_:1},8,["onClick","title"])):O("",!0),f.isDir?O("",!0):(b(),R(e(E),{key:1,size:"tiny",quaternary:"",onClick:te(D=>S(f),["stop"]),title:e(t)("files.download")},{default:h(()=>[...p[5]||(p[5]=[x("⬇️",-1)])]),_:1},8,["onClick","title"]))])],40,we))),128))]))]),_:1},8,["show"])]))}})})),Gt=g((()=>{})),Wt,va=g((()=>{Ce(),Ce(),Gt(),K(),Wt=A(tt,[["__scopeId","data-v-ab2593c7"]])})),at,xe=g((()=>{M(),P(),U(),j(),Xe(),Mt(),at=B({__name:"FileContextMenu",emits:["rename"],setup(i,{expose:s,emit:t}){const{t:n}=L(),a=V(),l=Oe(),r=z(),c=C(!1),_=C(0),u=C(0),w=C(null),S=t;function d(T,v){w.value=v,_.value=T.clientX,u.value=T.clientY,c.value=!1,gt(()=>{c.value=!0})}function p(){const T=w.value;if(!T)return[];const v=[];return T.isDir?v.push({label:n("files.open"),key:"open"}):(H(T.name)&&v.push({label:n("files.edit"),key:"edit"}),(Z(T.name)||ee(T.name))&&v.push({label:n("files.preview"),key:"preview"}),v.push({label:n("files.download"),key:"download"})),v.push({type:"divider",key:"d1"}),v.push({label:n("files.copyPath"),key:"copyPath"}),v.push({label:n("files.rename"),key:"rename"}),v.push({type:"divider",key:"d2"}),v.push({label:n("files.delete"),key:"delete"}),v}async function f(T){c.value=!1;const v=w.value;if(v)switch(T){case"open":r.navigateTo(v.path);break;case"edit":try{await r.openEditor(v.path)}catch{a.error(n("files.backendError"))}break;case"preview":try{await r.openPreview(v)}catch{a.error(n("files.backendError"))}break;case"download":try{await Ge(v.path,v.name)}catch(W){a.error(W.message)}break;case"copyPath":await zt(v.path)?a.success(n("files.pathCopied")):a.error(n("files.pathCopied")+" ✗");break;case"rename":S("rename",v);break;case"delete":l.warning({title:n("files.delete"),content:v.isDir?n("files.confirmDeleteDir",{name:v.name}):n("files.confirmDelete",{name:v.name}),positiveText:n("common.delete"),negativeText:n("common.cancel"),onPositiveClick:async()=>{try{await r.deleteEntry(v),a.success(n("files.deleted"))}catch{a.error(n("files.deleteFailed"))}}});break}}function D(){c.value=!1}return s({show:d}),(T,v)=>(b(),R(e(bt),{show:c.value,x:_.value,y:u.value,options:p(),placement:"bottom-start",trigger:"manual",onSelect:f,onClickoutside:D},null,8,["show","x","y","options"]))}})})),Ht,ma=g((()=>{xe(),xe(),Ht=at})),Se,$e,Te,it,Ee=g((()=>{M(),P(),U(),j(),Dt(),Se={class:"file-editor"},$e={class:"editor-header"},Te={class:"editor-filename"},it=B({__name:"FileEditor",setup(i){self.MonacoEnvironment={getWorker(w,S){return new Worker(new URL("/assets/editor.worker-JF2IK1uK.js",""+import.meta.url),{type:"module"})}};const{t:s}=L(),t=V(),n=Oe(),a=z(),l=C(null);let r=null;const c=C(!1);Re(()=>{!l.value||!a.editingFile||(r=Et.create(l.value,{value:a.editingFile.content,language:a.editingFile.language,theme:document.documentElement.classList.contains("dark")?"vs-dark":"vs",minimap:{enabled:!1},fontSize:13,lineNumbers:"on",scrollBeyondLastLine:!1,automaticLayout:!0,tabSize:2,wordWrap:"on"}),r.onDidChangeModelContent(()=>{a.editingFile&&(a.editingFile.content=r.getValue())}),r.addCommand(Tt.CtrlCmd|$t.KeyS,()=>{_()}))}),Ft(()=>{r?.dispose(),r=null});async function _(){c.value=!0;try{await a.saveEditor(),t.success(s("files.saved"))}catch{t.error(s("files.saveFailed"))}finally{c.value=!1}}function u(){a.hasUnsavedChanges?n.warning({title:s("files.unsavedChanges"),positiveText:s("common.ok"),negativeText:s("common.cancel"),onPositiveClick:()=>{a.closeEditor()}}):a.closeEditor()}return(w,S)=>(b(),$("div",Se,[y("div",$e,[y("span",Te,m(e(a).editingFile?.path),1),F(e(G),null,{default:h(()=>[F(e(E),{size:"small",type:"primary",loading:c.value,onClick:_},{default:h(()=>[x(m(e(s)("files.saveFile")),1)]),_:1},8,["loading"]),F(e(E),{size:"small",onClick:u},{default:h(()=>[x(m(e(s)("files.closeEditor")),1)]),_:1})]),_:1})]),y("div",{ref_key:"editorContainer",ref:l,class:"editor-container"},null,512)]))}})})),Yt=g((()=>{})),Qt,ha=g((()=>{Ee(),Ee(),Yt(),K(),Qt=A(it,[["__scopeId","data-v-1ae26b53"]])})),De,Me,ze,Be,Pe,Ue,st,Le=g((()=>{M(),P(),U(),j(),Y(),Bt(),De={key:0,class:"file-preview"},Me={class:"preview-header"},ze={class:"preview-filename"},Be={class:"preview-content"},Pe=["src","alt"],Ue={key:1,class:"preview-markdown"},st=B({__name:"FilePreview",setup(i){const{t:s}=L(),t=z();function n(){return t.previewFile?Ot(t.previewFile.path):""}const a=()=>ie("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"currentColor"},[ie("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})]);return(l,r)=>e(t).previewFile?(b(),$("div",De,[y("div",Me,[y("span",ze,m(e(t).previewFile.path),1),F(e(E),{size:"small",quaternary:"",onClick:r[0]||(r[0]=c=>e(t).closePreview())},{icon:h(()=>[F(e(mt),null,{default:h(()=>[F(a)]),_:1})]),default:h(()=>[x(" "+m(e(s)("files.closePreview")),1)]),_:1})]),y("div",Be,[e(t).previewFile.type==="image"?(b(),$("img",{key:0,src:n(),class:"preview-image",alt:e(t).previewFile.path},null,8,Pe)):e(t).previewFile.type==="markdown"?(b(),$("div",Ue,[F(Pt,{content:e(t).previewFile.content||""},null,8,["content"])])):O("",!0)])])):O("",!0)}})})),Zt=g((()=>{})),ea,wa=g((()=>{Le(),Le(),Zt(),K(),ea=A(st,[["__scopeId","data-v-a9f9eb37"]])})),je,lt,Ie=g((()=>{M(),P(),U(),j(),je={class:"upload-dragger"},lt=B({__name:"FileUploadModal",props:{show:{type:Boolean}},emits:["update:show"],setup(i,{emit:s}){const{t}=L(),n=V(),a=z(),l=i,r=s,c=C(!1),_=C([]);function u(d){_.value=d.fileList.map(p=>p.file).filter(p=>p!=null)}async function w(){if(_.value.length!==0){c.value=!0;try{await a.uploadFiles(_.value),n.success(t("files.uploadSuccess",{count:_.value.length})),_.value=[],r("update:show",!1)}catch(d){n.error(d.message||t("files.uploadFailed"))}finally{c.value=!1}}}function S(){_.value=[],r("update:show",!1)}return(d,p)=>(b(),R(e(Ae),{show:l.show,preset:"dialog",title:e(t)("files.upload"),"onUpdate:show":S,style:{width:"500px"}},{action:h(()=>[F(e(G),null,{default:h(()=>[F(e(E),{onClick:S},{default:h(()=>[x(m(e(t)("common.cancel")),1)]),_:1}),F(e(E),{type:"primary",loading:c.value,disabled:_.value.length===0,onClick:w},{default:h(()=>[x(m(e(t)("files.upload"))+" ("+m(_.value.length)+") ",1)]),_:1},8,["loading","disabled"])]),_:1})]),default:h(()=>[F(e(yt),{multiple:"","directory-dnd":"","default-upload":!1,onChange:u},{default:h(()=>[y("div",je,[y("p",null,m(e(t)("files.dragDropHint")),1)])]),_:1})]),_:1},8,["show","title"]))}})})),ta=g((()=>{})),aa,ga=g((()=>{Ie(),Ie(),ta(),K(),aa=A(lt,[["__scopeId","data-v-e54e68b1"]])})),nt,Ne=g((()=>{M(),P(),U(),j(),nt=B({__name:"FileRenameModal",props:{show:{type:Boolean},mode:{},entry:{}},emits:["update:show"],setup(i,{emit:s}){const{t}=L(),n=V(),a=z(),l=i,r=s,c=C(""),_=C(!1);kt(()=>l.show,d=>{d&&(l.mode==="rename"&&l.entry?c.value=l.entry.name:c.value="")});const u=J(()=>{switch(l.mode){case"newFile":return t("files.newFile");case"newFolder":return t("files.newFolder");case"rename":return t("files.rename")}}),w=J(()=>{switch(l.mode){case"newFile":return t("files.newFileName");case"newFolder":return t("files.newFolderName");case"rename":return t("files.renameTo")}});async function S(){if(c.value.trim()){_.value=!0;try{switch(l.mode){case"newFile":await a.createFile(c.value.trim()),n.success(t("files.created"));break;case"newFolder":await a.createDir(c.value.trim()),n.success(t("files.created"));break;case"rename":l.entry&&(await a.renameEntry(l.entry,c.value.trim()),n.success(t("files.renamed")));break}r("update:show",!1)}catch(d){const p=l.mode==="rename"?t("files.renameFailed"):t("files.createFailed");n.error(d.message||p)}finally{_.value=!1}}}return(d,p)=>(b(),R(e(Ae),{show:l.show,preset:"dialog",title:u.value,"onUpdate:show":p[2]||(p[2]=f=>r("update:show",!1)),style:{width:"400px"}},{action:h(()=>[F(e(G),null,{default:h(()=>[F(e(E),{onClick:p[1]||(p[1]=f=>r("update:show",!1))},{default:h(()=>[x(m(e(t)("common.cancel")),1)]),_:1}),F(e(E),{type:"primary",loading:_.value,disabled:!c.value.trim(),onClick:S},{default:h(()=>[x(m(e(t)("common.ok")),1)]),_:1},8,["loading","disabled"])]),_:1})]),default:h(()=>[F(e(ft),{value:c.value,"onUpdate:value":p[0]||(p[0]=f=>c.value=f),placeholder:w.value,onKeydown:pt(S,["enter"]),autofocus:""},null,8,["value","placeholder"])]),_:1},8,["show","title"]))}})})),ia,ya=g((()=>{Ne(),Ne(),ia=nt}));export{Kt as _,ea as a,z as b,ha as c,Wt as d,va as f,_a as g,Vt as h,ga as i,Ht as l,fa as m,ya as n,wa as o,Xt as p,aa as r,Qt as s,ia as t,ma as u,pa as v,j as y};
@@ -1 +1 @@
1
- import{n as f}from"./rolldown-runtime-iJLb3ux7.js";import{Pt as F,Q as d,Z as v,dt as R,et as S,it as b,kt as a,pt as u,rt as l,z as B}from"./ui-vendor-DIP97-f3.js";import{n as E,t as N}from"./_plugin-vue_export-helper-JVWBimuG.js";import{_ as U,a as C,b as T,c as P,d as L,f as z,g as I,h as Q,i as Z,l as $,m as j,n as q,o as A,p as D,r as G,s as H,t as J,u as K,v as O,y as W}from"./FileRenameModal-ekm_sUbS.js";var w,m,c,h,M,y=f((()=>{B(),W(),O(),I(),j(),z(),K(),P(),A(),Z(),q(),w={class:"files-view"},m={class:"files-tree-panel"},c={class:"files-main-panel"},h={class:"files-content"},M=b({__name:"FilesView",setup(le){const _=T(),p=a(null),r=a(!1),t=a(!1),i=a("newFile"),n=a(null);function x(s,e){p.value?.show(s,e)}function k(){i.value="newFile",n.value=null,t.value=!0}function V(){i.value="newFolder",n.value=null,t.value=!0}function g(s){i.value="rename",n.value=s,t.value=!0}return R(()=>{_.fetchEntries("")}),(s,e)=>(u(),S("div",w,[v("div",m,[l(U)]),v("div",c,[l(D,{onShowNewFile:k,onShowNewFolder:V,onShowUpload:e[0]||(e[0]=o=>r.value=!0)}),l(Q),v("div",h,[F(_).editingFile?(u(),d(H,{key:0})):F(_).previewFile?(u(),d(C,{key:1})):(u(),d(L,{key:2,onContextmenuEntry:x}))])]),l($,{ref_key:"contextMenuRef",ref:p,onRename:g},null,512),l(G,{show:r.value,"onUpdate:show":e[1]||(e[1]=o=>r.value=o)},null,8,["show"]),l(J,{show:t.value,"onUpdate:show":e[2]||(e[2]=o=>t.value=o),mode:i.value,entry:n.value},null,8,["show","mode","entry"])]))}})})),X=f((()=>{})),Y,ee=f((()=>{y(),y(),X(),E(),Y=N(M,[["__scopeId","data-v-4513759a"]])}));ee();export{Y as default};
1
+ import{n as f}from"./rolldown-runtime-iJLb3ux7.js";import{Pt as F,Q as d,Z as v,dt as R,et as S,it as b,kt as a,pt as u,rt as l,z as B}from"./ui-vendor-DIP97-f3.js";import{n as E,t as N}from"./_plugin-vue_export-helper-JVWBimuG.js";import{_ as U,a as C,b as T,c as P,d as L,f as z,g as I,h as Q,i as Z,l as $,m as j,n as q,o as A,p as D,r as G,s as H,t as J,u as K,v as O,y as W}from"./FileRenameModal-DZLJX7uH.js";var w,m,c,h,M,y=f((()=>{B(),W(),O(),I(),j(),z(),K(),P(),A(),Z(),q(),w={class:"files-view"},m={class:"files-tree-panel"},c={class:"files-main-panel"},h={class:"files-content"},M=b({__name:"FilesView",setup(le){const _=T(),p=a(null),r=a(!1),t=a(!1),i=a("newFile"),n=a(null);function x(s,e){p.value?.show(s,e)}function k(){i.value="newFile",n.value=null,t.value=!0}function V(){i.value="newFolder",n.value=null,t.value=!0}function g(s){i.value="rename",n.value=s,t.value=!0}return R(()=>{_.fetchEntries("")}),(s,e)=>(u(),S("div",w,[v("div",m,[l(U)]),v("div",c,[l(D,{onShowNewFile:k,onShowNewFolder:V,onShowUpload:e[0]||(e[0]=o=>r.value=!0)}),l(Q),v("div",h,[F(_).editingFile?(u(),d(H,{key:0})):F(_).previewFile?(u(),d(C,{key:1})):(u(),d(L,{key:2,onContextmenuEntry:x}))])]),l($,{ref_key:"contextMenuRef",ref:p,onRename:g},null,512),l(G,{show:r.value,"onUpdate:show":e[1]||(e[1]=o=>r.value=o)},null,8,["show"]),l(J,{show:t.value,"onUpdate:show":e[2]||(e[2]=o=>t.value=o),mode:i.value,entry:n.value},null,8,["show","mode","entry"])]))}})})),X=f((()=>{})),Y,ee=f((()=>{y(),y(),X(),E(),Y=N(M,[["__scopeId","data-v-4513759a"]])}));ee();export{Y as default};
@@ -1 +1 @@
1
- import{n as d}from"./rolldown-runtime-iJLb3ux7.js";import{$ as M,I as O,Lt as o,Pt as s,Z as _,bt as p,dt as j,et as l,g as q,ht as A,it as L,j as E,kt as g,l as F,nt as m,pt as u,q as Z,rt as f,t as H,z as P}from"./ui-vendor-DIP97-f3.js";import{d as J,n as K,r as Q,u as R}from"./vue-vendor-DHimL2gr.js";import{o as U,s as w}from"./router-BfmZqYKj.js";import{n as W,t as X}from"./_plugin-vue_export-helper-JVWBimuG.js";async function Y(){return(await w("/api/hermes/gateways")).gateways}async function aa(i){return(await w(`/api/hermes/gateways/${i}/start`,{method:"POST"})).gateway}async function ea(i){await w(`/api/hermes/gateways/${i}/stop`,{method:"POST"})}var ta=d((()=>{U()})),b,sa=d((()=>{J(),P(),ta(),b=R("gateways",()=>{const i=g([]),e=g(!1);async function c(){e.value=!0;try{const t=await Y();i.value=Array.isArray(t)?t:Object.values(t||{})}finally{e.value=!1}}async function r(t){e.value=!0;try{const n=await aa(t),a=i.value.findIndex(v=>v.profile===t);a>=0?i.value[a]=n:i.value.push(n)}finally{e.value=!1}}async function y(t){e.value=!0;try{await ea(t);const n=i.value.find(a=>a.profile===t);n&&(n.running=!1,n.pid=void 0)}finally{e.value=!1}}return{gateways:i,loading:e,fetchStatus:c,start:r,stop:y}})})),h,G,V,k,x,S,$,C,I,T,z,B,D,N=d((()=>{P(),H(),K(),sa(),h={class:"gateways-view"},G={class:"page-header"},V={class:"header-title"},k={class:"gateways-content"},x={key:0,class:"empty-state"},S={key:1,class:"gateway-list"},$={class:"gateway-info"},C={class:"gateway-name"},I={class:"gateway-meta"},T={class:"meta-item"},z={key:0,class:"meta-item"},B={class:"gateway-actions"},D=L({__name:"GatewaysView",setup(i){const{t:e}=Q(),c=q(),r=b();j(()=>{r.fetchStatus()});async function y(t,n){try{n?(await r.stop(t),c.success(`${e("gateways.stopped")}: ${t}`)):(await r.start(t),c.success(`${e("gateways.started")}: ${t}`))}catch(a){c.error(a.message)}}return(t,n)=>(u(),l("div",h,[_("header",G,[_("h2",V,o(s(e)("gateways.title")),1)]),_("div",k,[f(s(F),{show:s(r).loading,size:"large"},{default:p(()=>[s(r).gateways.length===0?(u(),l("div",x,o(s(e)("common.noData")),1)):(u(),l("div",S,[(u(!0),l(Z,null,A(s(r).gateways,a=>(u(),l("div",{key:a.profile,class:"gateway-card"},[_("div",$,[_("div",C,o(a.profile),1),_("div",I,[_("span",T,o(a.host)+":"+o(a.port),1),a.pid?(u(),l("span",z,"PID: "+o(a.pid),1)):M("",!0)])]),_("div",B,[f(s(O),{type:a.running?"success":"default",size:"small",round:""},{default:p(()=>[m(o(a.running?s(e)("gateways.running"):s(e)("gateways.stopped")),1)]),_:2},1032,["type"]),f(s(E),{size:"small",type:a.running?"warning":"primary",round:"",onClick:v=>y(a.profile,a.running)},{default:p(()=>[m(o(a.running?s(e)("common.stop"):s(e)("common.start")),1)]),_:2},1032,["type","onClick"])])]))),128))]))]),_:1},8,["show"])])]))}})})),ia=d((()=>{})),na,ra=d((()=>{N(),N(),ia(),W(),na=X(D,[["__scopeId","data-v-d70aa8a3"]])}));ra();export{na as default};
1
+ import{n as d}from"./rolldown-runtime-iJLb3ux7.js";import{$ as M,I as O,Lt as o,Pt as s,Z as _,bt as p,dt as j,et as l,g as q,ht as A,it as L,j as E,kt as g,l as F,nt as m,pt as u,q as Z,rt as f,t as H,z as P}from"./ui-vendor-DIP97-f3.js";import{d as J,n as K,r as Q,u as R}from"./vue-vendor-DHimL2gr.js";import{o as U,s as w}from"./router-Be5a7E15.js";import{n as W,t as X}from"./_plugin-vue_export-helper-JVWBimuG.js";async function Y(){return(await w("/api/hermes/gateways")).gateways}async function aa(i){return(await w(`/api/hermes/gateways/${i}/start`,{method:"POST"})).gateway}async function ea(i){await w(`/api/hermes/gateways/${i}/stop`,{method:"POST"})}var ta=d((()=>{U()})),b,sa=d((()=>{J(),P(),ta(),b=R("gateways",()=>{const i=g([]),e=g(!1);async function c(){e.value=!0;try{const t=await Y();i.value=Array.isArray(t)?t:Object.values(t||{})}finally{e.value=!1}}async function r(t){e.value=!0;try{const n=await aa(t),a=i.value.findIndex(v=>v.profile===t);a>=0?i.value[a]=n:i.value.push(n)}finally{e.value=!1}}async function y(t){e.value=!0;try{await ea(t);const n=i.value.find(a=>a.profile===t);n&&(n.running=!1,n.pid=void 0)}finally{e.value=!1}}return{gateways:i,loading:e,fetchStatus:c,start:r,stop:y}})})),h,G,V,k,x,S,$,C,I,T,z,B,D,N=d((()=>{P(),H(),K(),sa(),h={class:"gateways-view"},G={class:"page-header"},V={class:"header-title"},k={class:"gateways-content"},x={key:0,class:"empty-state"},S={key:1,class:"gateway-list"},$={class:"gateway-info"},C={class:"gateway-name"},I={class:"gateway-meta"},T={class:"meta-item"},z={key:0,class:"meta-item"},B={class:"gateway-actions"},D=L({__name:"GatewaysView",setup(i){const{t:e}=Q(),c=q(),r=b();j(()=>{r.fetchStatus()});async function y(t,n){try{n?(await r.stop(t),c.success(`${e("gateways.stopped")}: ${t}`)):(await r.start(t),c.success(`${e("gateways.started")}: ${t}`))}catch(a){c.error(a.message)}}return(t,n)=>(u(),l("div",h,[_("header",G,[_("h2",V,o(s(e)("gateways.title")),1)]),_("div",k,[f(s(F),{show:s(r).loading,size:"large"},{default:p(()=>[s(r).gateways.length===0?(u(),l("div",x,o(s(e)("common.noData")),1)):(u(),l("div",S,[(u(!0),l(Z,null,A(s(r).gateways,a=>(u(),l("div",{key:a.profile,class:"gateway-card"},[_("div",$,[_("div",C,o(a.profile),1),_("div",I,[_("span",T,o(a.host)+":"+o(a.port),1),a.pid?(u(),l("span",z,"PID: "+o(a.pid),1)):M("",!0)])]),_("div",B,[f(s(O),{type:a.running?"success":"default",size:"small",round:""},{default:p(()=>[m(o(a.running?s(e)("gateways.running"):s(e)("gateways.stopped")),1)]),_:2},1032,["type"]),f(s(E),{size:"small",type:a.running?"warning":"primary",round:"",onClick:v=>y(a.profile,a.running)},{default:p(()=>[m(o(a.running?s(e)("common.stop"):s(e)("common.start")),1)]),_:2},1032,["type","onClick"])])]))),128))]))]),_:1},8,["show"])])]))}})})),ia=d((()=>{})),na,ra=d((()=>{N(),N(),ia(),W(),na=X(D,[["__scopeId","data-v-d70aa8a3"]])}));ra();export{na as default};