zen-gitsync 2.17.42 → 2.17.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +7 -1
- package/src/ui/public/assets/AgentEngineSelector-BwFdXZnh.js +2 -0
- package/src/ui/public/assets/AgentView-CMQ7TzwN.js +11 -0
- package/src/ui/public/assets/AppVersionBadge-Bk4XGXki.js +2 -0
- package/src/ui/public/assets/BranchSelector-DL37Ho4j.js +1 -0
- package/src/ui/public/assets/CommitForm-BGpFU-fp.css +1 -0
- package/src/ui/public/assets/CommitForm-DdvYlUtA.js +14 -0
- package/src/ui/public/assets/{CommonDialog-q8bffY57.js → CommonDialog-BT6e135Y.js} +1 -1
- package/src/ui/public/assets/EditorView-CeZ-EvP1.js +37 -0
- package/src/ui/public/assets/{EditorView-QROmuz4O.css → EditorView-X6M5DS2w.css} +1 -1
- package/src/ui/public/assets/{FlowExecutionViewer-DMxdFp7T.js → FlowExecutionViewer-DIlgernH.js} +1 -1
- package/src/ui/public/assets/FlowOrchestrationWorkspace-BIFFckMG.js +21 -0
- package/src/ui/public/assets/LogList-CYU0YVnC.js +7 -0
- package/src/ui/public/assets/MindmapView-B2Oz9nCS.css +1 -0
- package/src/ui/public/assets/MindmapView-DYB3_94z.js +2 -0
- package/src/ui/public/assets/MonitorView-CTtuMls4.css +1 -0
- package/src/ui/public/assets/MonitorView-DKXSFbyq.js +3 -0
- package/src/ui/public/assets/ProjectStartupButton-BMICmCA_.js +1 -0
- package/src/ui/public/assets/RecentDirectoriesChat-LOD3UBFM.js +3 -0
- package/src/ui/public/assets/RemoteManagerDialog-S3xLgN02.js +4 -0
- package/src/ui/public/assets/{RemoteRepoCard-muY6G96M.js → RemoteRepoCard-BLb8tACY.js} +2 -2
- package/src/ui/public/assets/{SourceMapView-CLrtq2ey.js → SourceMapView-BA7E3JX7.js} +3 -3
- package/src/ui/public/assets/{SvgIcon-CVenF0Ye.js → SvgIcon-Dd0dgVcd.js} +1 -1
- package/src/ui/public/assets/UserInputNode-B0YtQfhh.js +1 -0
- package/src/ui/public/assets/WorkbenchView-lgVbWRyY.js +287 -0
- package/src/ui/public/assets/{_plugin-vue_export-helper-BUtBXJ4L.js → _plugin-vue_export-helper-DibQ4qNS.js} +3 -3
- package/src/ui/public/assets/{agentConversations-COO5r7ra.js → agentConversations-CyGrxt-h.js} +4 -4
- package/src/ui/public/assets/{configStore-B8_uxBp2.js → configStore-DQ92GVaR.js} +1 -1
- package/src/ui/public/assets/{css.worker-BDCmgL4U.js → css.worker-DFdt6_zu.js} +9 -9
- package/src/ui/public/assets/{dagre-BWDqZwmv.js → dagre-BPEW99Ym.js} +4 -4
- package/src/ui/public/assets/editor.worker-O-CH8JUO.js +26 -0
- package/src/ui/public/assets/element-plus-C8IhrglD.js +48 -0
- package/src/ui/public/assets/element-plus-DJ3ZQa98.css +1 -0
- package/src/ui/public/assets/{flow-mindmap-CY72TleH.js → flow-mindmap-BQUUIfaR.js} +1 -1
- package/src/ui/public/assets/{html.worker-DG8hnSJR.js → html.worker-JUzsMP-j.js} +8 -8
- package/src/ui/public/assets/index-DavZzOom.css +1 -0
- package/src/ui/public/assets/index-ED00NaPI.js +198 -0
- package/src/ui/public/assets/json.worker-B4dEhy0e.js +58 -0
- package/src/ui/public/assets/{monaco-CpT1sgBA.js → monaco-kXz8a-yc.js} +6 -6
- package/src/ui/public/assets/{office-docx-COuLzG9K.js → office-docx-4ZL-nECj.js} +1 -1
- package/src/ui/public/assets/{office-excel-BTtyMAdK.js → office-excel-BlPftvU4.js} +1 -1
- package/src/ui/public/assets/{office-pptx-BB2cWQB-.js → office-pptx-CVP1caLm.js} +3 -3
- package/src/ui/public/assets/{ts.worker-DgFMIcEs.js → ts.worker-CmEKzkmF.js} +49 -49
- package/src/ui/public/assets/{vendor-JPxCsYZA.js → vendor-CazUJJkv.js} +8 -8
- package/src/ui/public/assets/{vue-flow-DinCMZbP.js → vue-flow-BABZEIJA.js} +1 -1
- package/src/ui/public/index.html +14 -26
- package/src/ui/server/routes/instances.js +42 -13
- package/src/ui/server/routes/instances.test.js +55 -32
- package/src/ui/server/routes/workbench/executorModels.test.js +326 -326
- package/src/ui/public/assets/AgentEngineSelector-CLJ4rGGb.js +0 -2
- package/src/ui/public/assets/AgentView-C7tbE1pr.js +0 -11
- package/src/ui/public/assets/AppVersionBadge-CjrqnPHZ.js +0 -2
- package/src/ui/public/assets/BranchSelector-B1RkRjkT.js +0 -1
- package/src/ui/public/assets/CommitForm-Dlr6QTba.js +0 -6
- package/src/ui/public/assets/CommitForm-DoR9UNBD.css +0 -1
- package/src/ui/public/assets/EditorView-WQIQHdqS.js +0 -37
- package/src/ui/public/assets/FileDiffViewer-CFJFN_xQ.js +0 -15
- package/src/ui/public/assets/FileDiffViewer-D1aR4rba.css +0 -1
- package/src/ui/public/assets/FlowOrchestrationWorkspace-vBWYTGeM.js +0 -21
- package/src/ui/public/assets/IconButton-Ca_axHSP.css +0 -1
- package/src/ui/public/assets/IconButton-Chpl6IGZ.js +0 -1
- package/src/ui/public/assets/LogList-CinD-VGc.js +0 -7
- package/src/ui/public/assets/MindmapView-BXCi5cvH.css +0 -1
- package/src/ui/public/assets/MindmapView-CAod7lPv.js +0 -2
- package/src/ui/public/assets/MonitorView-B2YVWNrs.css +0 -1
- package/src/ui/public/assets/MonitorView-B5sOfRgx.js +0 -1
- package/src/ui/public/assets/ProjectStartupButton-ZzSQN2oO.js +0 -1
- package/src/ui/public/assets/RecentDirectoriesChat-DiiaL2lT.js +0 -3
- package/src/ui/public/assets/RemoteManagerDialog-D8pMeIHt.js +0 -4
- package/src/ui/public/assets/TemplateManager-Bnek7hoV.css +0 -1
- package/src/ui/public/assets/TemplateManager-DTQ0Oir3.js +0 -1
- package/src/ui/public/assets/UserInputNode-CGKrY_Y8.js +0 -1
- package/src/ui/public/assets/WorkbenchView-BnHSL8Lr.js +0 -287
- package/src/ui/public/assets/editor.worker-GCPm6rMv.js +0 -26
- package/src/ui/public/assets/element-plus-0wIX-Gk-.js +0 -48
- package/src/ui/public/assets/element-plus-C1xzgNSR.css +0 -1
- package/src/ui/public/assets/fileIcon-B5p5pGN9.js +0 -1
- package/src/ui/public/assets/gitStore-bZysdieB.js +0 -6
- package/src/ui/public/assets/index-BetEwMCp.js +0 -162
- package/src/ui/public/assets/index-JVjC2bGh.css +0 -1
- package/src/ui/public/assets/json.worker-CxwlJRnL.js +0 -58
- package/src/ui/public/assets/previewSandbox-BcYj-0Up.css +0 -1
- package/src/ui/public/assets/previewSandbox-CgcL-OLc.js +0 -9
- package/src/ui/public/assets/toolsStore-CofRox1m.js +0 -1
- package/src/ui/public/assets/useThemeObserver-D0lx06N9.js +0 -1
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import"./rolldown-runtime-C0FnF6B9.js";import{$n as e,Bn as t,Cn as n,Dn as r,En as i,Fr as a,In as o,Jr as s,Mn as c,Nn as l,On as u,Pn as d,Tn as f,W as ee,Wn as p,Xr as m,Yn as te,Zn as h,_n as g,bn as _,br as v,cr as y,dn as b,ei as x,i as S,kn as C,lr as w,or as T,pr as E,qn as ne,r as re,vn as ie,xn as D,xr as ae,yn as oe}from"./element-plus-0wIX-Gk-.js";import{a as se,r as ce,t as le}from"./vendor-JPxCsYZA.js";import{n as O,t as k}from"./_plugin-vue_export-helper-BUtBXJ4L.js";import{t as ue}from"./SvgIcon-CVenF0Ye.js";import{t as de}from"./configStore-B8_uxBp2.js";import{n as fe,t as pe}from"./fileIcon-B5p5pGN9.js";import{a as me,i as he,n as ge,r as _e,s as ve,t as A}from"./previewSandbox-CgcL-OLc.js";import{a as j,c as ye,i as M,n as be,o as xe,r as N,s as Se}from"./monaco-CpT1sgBA.js";import{t as Ce}from"./useThemeObserver-D0lx06N9.js";import{n as we,r as Te}from"./flow-mindmap-CY72TleH.js";import{a as Ee}from"./index-BetEwMCp.js";import{a as P,i as F,n as I,o as De,r as Oe,s as ke,t as Ae}from"./agentConversations-COO5r7ra.js";import{n as je,t as L}from"./AgentEngineSelector-CLJ4rGGb.js";function Me(e){return{ts:`typescript`,tsx:`typescript`,js:`javascript`,mjs:`javascript`,cjs:`javascript`,jsx:`javascript`,vue:`html`,html:`html`,htm:`html`,css:`css`,scss:`scss`,less:`less`,json:`json`,jsonc:`json`,md:`markdown`,markdown:`markdown`,yaml:`yaml`,yml:`yaml`,toml:`ini`,xml:`xml`,svg:`xml`,sh:`shell`,bash:`shell`,zsh:`shell`,fish:`shell`,ps1:`powershell`,py:`python`,go:`go`,rs:`rust`,java:`java`,kt:`kotlin`,rb:`ruby`,php:`php`,c:`c`,cpp:`cpp`,h:`cpp`,cs:`csharp`,sql:`sql`,graphql:`graphql`,gql:`graphql`,txt:`plaintext`,log:`plaintext`,ini:`ini`,env:`ini`,gitignore:`ini`,dockerfile:`dockerfile`}[e.toLowerCase()]??`plaintext`}t();var Ne=o({__name:`MindmapPreview`,props:{content:{type:String,required:!0}},setup(e,{expose:t}){t();let n=e,r={props:n,data:f(()=>Te(n.content||``,`未命名文档`)),get MindMap(){return we}};return Object.defineProperty(r,"__isScriptSetup",{enumerable:!1,value:!0}),r}});t();var Pe={class:`mindmap-preview`},Fe={class:`mindmap-preview-canvas`};function Ie(e,t,n,r,a,o){return h(),C(`div`,Pe,[t[0]||=i(`div`,{class:`mindmap-preview-header`},[i(`span`,{class:`mindmap-preview-title`},`整篇导图`),i(`span`,{class:`mindmap-preview-hint`},`基于整篇 Markdown 自动生成 · 阅读模式`)],-1),i(`div`,Fe,[d(r.MindMap,{data:r.data,"preview-mode":``},null,8,[`data`])])])}var Le=k(Ne,[[`render`,Ie],[`__scopeId`,`data-v-3969a8bf`],[`__file`,`D:/workspace/github_workspace/zen-gitsync/src/ui/client/src/components/MindmapPreview.vue`]]);t(),E();var R=o({__name:`EditorAgentPanel`,props:{activeFilePath:{type:[String,null],required:!1},activeFileName:{type:String,required:!1},active:{type:Boolean,required:!1}},emits:[`close`],setup(e,{expose:t,emit:n}){t();let r=e,i=n,{theme:a}=Ce(),o=f(()=>a.value===`dark`?`dark`:`light`),{sessions:s,sessionsLoading:c,currentSessionId:l,messages:u,isStreaming:d,pendingQuestion:ee,answeringQuestion:m,isSessionGenerating:h,currentEngine:g,pendingEngine:_,isEngineLocked:y,pickEngine:b,loadSessions:x,loadSession:S,deleteSession:C,renameSession:w,newSession:E,sendMessage:re,answerQuestion:ie,stop:D}=ke(),ae=f(()=>y.value?g.value:_.value);function oe(e){y.value||b(e)}let k=f(()=>P(s.value,h)),ue=Oe(),de=F(),fe=v(null),pe=v(null),me=v(null),he=v(null),ge=v(null),{width:_e,narrow:ve}=je(ge),A=v(`chat`),j=v(null),ye=v(!1),M=null,be=f(()=>!!r.activeFileName&&!ye.value);function xe(e){return Array.from(e.children).find(e=>e.classList?.contains(`acu-input-attachments`))??null}function N(){let e=pe.value?.$el;if(!e)return;let t=e.querySelector(`.agent-context-slot`);if(!be.value){if(!t)return;j.value=null,p(()=>t.remove());return}let n=j.value&&e.contains(j.value)?j.value:t;n||(n=document.createElement(`div`),n.className=`agent-context-slot`);let r=xe(e),i=r??e;n.parentElement!==i&&i.insertBefore(n,r?r.firstChild:e.firstChild),j.value=n}function Se(e=!0){fe.value?.scrollToBottom(e)}async function we(e){let t=ye.value?void 0:r.activeFilePath||void 0;await re(e.text,e.files,{openFilePath:t}),await p(),Se()}function Te(e){S(e),A.value=`chat`}function Ee(){E(),A.value=`chat`}T(()=>u.value.length,()=>{p(()=>Se(!1))});function Me(){let e=he.value;!e||typeof MutationObserver>`u`||(M?.disconnect(),M=new MutationObserver(()=>N()),M.observe(e,{childList:!0,subtree:!0}))}T(()=>r.active,e=>{e&&(A.value=`chat`,x().catch(()=>{}),p(()=>{N(),Se(!1)}))}),T(ve,e=>{e||(A.value=`chat`)}),T(()=>r.activeFilePath,()=>{ye.value=!1}),T(be,e=>{e&&p(N)}),te(()=>{x().catch(()=>{}),p(()=>{N(),Me()})}),ne(()=>{M?.disconnect(),M=null,j.value=null});let Ne={props:r,emit:i,theme:a,chatTheme:o,sessions:s,sessionsLoading:c,currentSessionId:l,messages:u,isStreaming:d,pendingQuestion:ee,answeringQuestion:m,isSessionGenerating:h,currentEngine:g,pendingEngine:_,isEngineLocked:y,pickEngine:b,loadSessions:x,loadSession:S,deleteSession:C,renameSession:w,newSession:E,sendMessage:re,answerQuestion:ie,stop:D,displayEngine:ae,onEngineSelect:oe,conversationItems:k,conversationLabels:ue,questionLabels:de,chatRef:fe,inputRef:pe,chatHostRef:me,composerRef:he,rootRef:ge,width:_e,narrow:ve,page:A,contextSlot:j,contextDismissed:ye,get slotObserver(){return M},set slotObserver(e){M=e},showContextCard:be,findAttachmentsHost:xe,syncContextSlot:N,scrollToBottom:Se,onSend:we,onSelectSession:Te,onNewSession:Ee,watchChatDom:Me,get $t(){return O},get ChatContainer(){return se},get ChatInput(){return ce},get ConversationList(){return le},get AGENT_UPLOAD_ACCEPT(){return De},get AGENT_ASSISTANT_NAME(){return I},get AGENT_ASSISTANT_AVATAR(){return Ae},AgentEngineSelector:L};return Object.defineProperty(Ne,"__isScriptSetup",{enumerable:!1,value:!0}),Ne}});t(),a(),b();var z={ref:`rootRef`,class:`editor-agent-panel`},Re={class:`agent-panel-header`},ze=[`title`,`aria-label`],Be={class:`agent-panel-title`},B={key:1,class:`agent-panel-title`},Ve=[`title`,`aria-label`],He=[`title`],Ue={class:`agent-panel-convs`},We={ref:`chatHostRef`,class:`agent-panel-chat`},Ge=[`data-theme`],Ke=[`title`],qe={class:`agent-context-att-name`},V=[`title`,`aria-label`];function Je(e,t,a,o,l,f){return h(),C(D,null,[u(`
|
|
2
|
-
文件空间右侧的 g ai 对话面板。
|
|
3
|
-
- 够宽(≥680px,判据同「智能体」视图):左边一列会话历史 + 右边对话,历史**直接摆在那儿**,
|
|
4
|
-
不用先点按钮翻过去;不够宽就折成两页,头部按钮来回翻
|
|
5
|
-
- 输入框常驻底部:ChatContainer 传 show-input=false,输入框拆出来自己摆在面板最下方。
|
|
6
|
-
于是两种形态、两个页面都有输入框 —— 列表页也能直接开聊,翻页时草稿与附件都不丢
|
|
7
|
-
- 复用的都是组件库的独立导出:ConversationList(列表)+ ChatContainer(气泡区)+ ChatInput(输入框)
|
|
8
|
-
- "当前打开的文档"通过请求级注入告知模型(sendMessage 的 openFilePath 选项);
|
|
9
|
-
它修饰的是**这一条消息的上下文**,所以做成附件卡片、搬进输入框内部(见 contextSlot)
|
|
10
|
-
- 自己持有一个 useAgentChat 实例:runs/refs 与「对话」Tab 隔离,互不打断
|
|
11
|
-
`),i(`div`,z,[i(`div`,Re,[u(` 窄屏的列表页:整条 header 让给「返回对话 + 标题」 `),o.narrow&&o.page===`list`?(h(),C(D,{key:0},[i(`button`,{class:`agent-panel-icon-btn agent-panel-back-btn`,title:o.$t(`@EDITOR:返回对话`),"aria-label":o.$t(`@EDITOR:返回对话`),onClick:t[0]||=e=>o.page=`chat`},[...t[4]||=[i(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[i(`line`,{x1:`19`,y1:`12`,x2:`5`,y2:`12`}),i(`polyline`,{points:`12 19 5 12 12 5`})],-1)]],8,ze),i(`span`,Be,x(o.$t(`@EDITOR:会话列表`)),1)],64)):(h(),C(`span`,B,x(o.$t(`@EDITOR:g ai 对话`)),1)),t[7]||=i(`div`,{class:`agent-panel-spacer`},null,-1),u(` 引擎切换:与「智能体」视图同一套(同一个 AgentEngineSelector)。
|
|
12
|
-
宽屏左边摆着历史,对话区一直在,所以常驻;窄屏只在对话页出现 ——
|
|
13
|
-
列表页没有正在跑的对话,摆这儿只会挤占标题。 `),!o.narrow||o.page===`chat`?(h(),r(o.AgentEngineSelector,{key:2,class:`agent-panel-engine`,engine:o.displayEngine,locked:o.isEngineLocked,onSelect:o.onEngineSelect},null,8,[`engine`,`locked`])):u(`v-if`,!0),u(` 会话列表按钮:只有"列表是独立一页"时才需要它(宽屏列表就在旁边) `),o.narrow&&o.page===`chat`?(h(),C(`button`,{key:3,class:`agent-panel-icon-btn agent-panel-list-btn`,title:o.$t(`@EDITOR:会话列表`),"aria-label":o.$t(`@EDITOR:会话列表`),onClick:t[1]||=e=>o.page=`list`},[...t[5]||=[c(`<svg viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" data-v-7cc12c51><line x1="8" y1="6" x2="21" y2="6" data-v-7cc12c51></line><line x1="8" y1="12" x2="21" y2="12" data-v-7cc12c51></line><line x1="8" y1="18" x2="21" y2="18" data-v-7cc12c51></line><line x1="3" y1="6" x2="3.01" y2="6" data-v-7cc12c51></line><line x1="3" y1="12" x2="3.01" y2="12" data-v-7cc12c51></line><line x1="3" y1="18" x2="3.01" y2="18" data-v-7cc12c51></line></svg>`,1)]],8,Ve)):u(`v-if`,!0),i(`button`,{class:`agent-panel-icon-btn`,title:o.$t(`@EDITOR:关闭对话`),onClick:t[2]||=e=>o.emit(`close`)},[...t[6]||=[i(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.5`,"stroke-linecap":`round`},[i(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),i(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})],-1)]],8,He)]),i(`div`,{class:s([`agent-panel-body`,{"is-wide":!o.narrow}])},[u(` 会话历史:宽屏是常驻左列(行高正常 + 带搜索框),窄屏是独享整页 `),w(i(`div`,Ue,[d(o.ConversationList,{"show-search":!0,items:o.conversationItems,"active-id":o.currentSessionId,loading:o.sessionsLoading,labels:o.conversationLabels,onSelect:o.onSelectSession,onNew:o.onNewSession,onRename:o.renameSession,onDelete:o.deleteSession},null,8,[`items`,`active-id`,`loading`,`labels`,`onRename`,`onDelete`])],512),[[ie,!o.narrow||o.page===`list`]]),u(` 气泡区:输入框已经不在这里了(show-input=false),见下面常驻的那一条 `),w(i(`div`,We,[d(o.ChatContainer,{ref:`chatRef`,"show-input":!1,messages:o.messages,"assistant-name":o.AGENT_ASSISTANT_NAME,"assistant-avatar":o.AGENT_ASSISTANT_AVATAR,theme:o.chatTheme,question:o.pendingQuestion,"question-submitting":o.answeringQuestion,"question-labels":o.questionLabels,"plan-config":{labels:{title:o.$t(`@AGENT:计划`),raw:o.$t(`@AGENT:原始参数`)}},onAnswer:o.answerQuestion},null,8,[`messages`,`assistant-name`,`assistant-avatar`,`theme`,`question`,`question-submitting`,`question-labels`,`plan-config`,`onAnswer`])],512),[[ie,!o.narrow||o.page===`chat`]]),u(`
|
|
14
|
-
输入框常驻:两种形态、两个页面都在最下方(与演示页同一套做法)。
|
|
15
|
-
它被拆到 ChatContainer 外面,所以 acu-root 与 data-theme 得自己套上:
|
|
16
|
-
库把盒模型重置限定在 .acu-root 子树里,而 ChatInput 根节点是 div(不是 button),
|
|
17
|
-
少了它就会退回 content-box、横着溢出面板。
|
|
18
|
-
|
|
19
|
-
v-if="width > 0":**等量到本面板的宽度再挂载输入框**。库的 ChatInput 只在
|
|
20
|
-
onMounted 里量一次 scrollHeight,量到的宽度不对就再也纠不回来 —— 实测首帧挂载时
|
|
21
|
-
容器还没宽度,占位文案被折成十几行,textarea 直接顶到 200px 上限并一直卡在那里。
|
|
22
|
-
宽度是 useNarrowPane 在 onMounted 里同步量到的,所以这里晚的只是一次重渲染。
|
|
23
|
-
`),o.width>0?(h(),C(`div`,{key:0,ref:`composerRef`,class:`agent-panel-composer acu-root`,"data-theme":o.chatTheme},[d(o.ChatInput,{ref:`inputRef`,disabled:o.isStreaming,generating:o.isStreaming,placeholder:o.isStreaming?o.$t(`@AGENT:正在生成中...`):o.$t(`@AGENT:输入消息,Enter 发送`),"upload-config":{accept:o.AGENT_UPLOAD_ACCEPT},onSend:o.onSend,onStop:o.stop},null,8,[`disabled`,`generating`,`placeholder`,`upload-config`,`onStop`]),u(`
|
|
24
|
-
当前文档:**和添加的附件同处一行、同一副样子**。
|
|
25
|
-
组件库的 ChatContainer / ChatInput 没有任何插槽(dist 里 \`slots\` 出现 0 次),
|
|
26
|
-
没法声明式地往输入框里放东西,所以:
|
|
27
|
-
· 往 \`.acu-input-wrap\` 插一个锚点,再把卡片 Teleport 进去(节点仍是 Vue 渲染的);
|
|
28
|
-
· **有附件行(.acu-input-attachments)时锚点住进它内部** —— 卡片因此成为那一行的
|
|
29
|
-
flex item,与附件并排、共用同一套 gap/wrap。只插在输入框最前面是不行的:
|
|
30
|
-
Vue 更新输入框时会用自己的锚点 \`insertBefore\`,把外来节点挤到后面去。
|
|
31
|
-
`),o.contextSlot?(h(),r(n,{key:0,to:o.contextSlot},[o.showContextCard?(h(),C(`div`,{key:0,class:`agent-context-att`,title:a.activeFilePath||``},[t[9]||=i(`svg`,{class:`agent-context-att-icon`,viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.7`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[i(`path`,{d:`M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z`}),i(`polyline`,{points:`14 3 14 8 19 8`})],-1),i(`span`,qe,x(a.activeFileName),1),i(`button`,{type:`button`,class:`agent-context-att-remove`,title:o.$t(`@EDITOR:不引用当前文档`),"aria-label":o.$t(`@EDITOR:不引用当前文档`),onClick:t[3]||=e=>o.contextDismissed=!0},[...t[8]||=[i(`svg`,{viewBox:`0 0 24 24`,width:`10`,height:`10`,fill:`none`,stroke:`currentColor`,"stroke-width":`3`,"stroke-linecap":`round`,"aria-hidden":`true`},[i(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),i(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})],-1)]],8,V)],8,Ke)):u(`v-if`,!0)],8,[`to`])):u(`v-if`,!0)],8,Ge)):u(`v-if`,!0)],2)],512)],2112)}var Ye=k(R,[[`render`,Je],[`__scopeId`,`data-v-7cc12c51`],[`__file`,`D:/workspace/github_workspace/zen-gitsync/src/ui/client/src/components/EditorAgentPanel.vue`]]);t(),E();var Xe=6e4,Ze=3e4,Qe=o({__name:`EditorView`,props:{pendingFilePath:{type:[String,null],required:!1}},setup(e,{expose:t}){t(),self.MonacoEnvironment={getWorker(e,t){return t===`json`?new Se:t===`css`||t===`scss`||t===`less`?new xe:t===`html`||t===`handlebars`||t===`razor`?new j:t===`typescript`||t===`javascript`?new M:new ye}};let n=e,r=de(),i=Ee(),a=v([]),o=v(!1),s=v(``),c=v(``),l=null;function u(){s.value=``,c.value=``,l&&=(clearTimeout(l),null)}T(s,e=>{l&&clearTimeout(l),l=setTimeout(()=>{c.value=e,l=null},180)}),ne(()=>{l&&clearTimeout(l),h(),Qe()});let d=null;function m(){h(),r.ui.fileTreeAutoRefresh&&(d=setInterval(()=>{document.hidden||r.currentDirectory&&(s.value.trim()||w())},Xe))}function h(){d&&=(clearInterval(d),null)}T(()=>r.currentDirectory,async()=>{if(L=!1,m(),await _(),P.value.some(e=>e.isDirty)){L=!0;return}P.value=[],F.value=null,ze(),await Fe()}),T(()=>r.ui.fileTreeAutoRefresh,()=>{m()});async function g(e,t=0){let n=await(await fetch(`/api/browse_directory?path=${encodeURIComponent(e)}`)).json();return n.success?n.items.map(e=>({...e,depth:t,expanded:!1,loading:!1,children:(e.type,void 0)})):[]}async function _(){let e=r.currentDirectory;if(e){o.value=!0;try{a.value=await g(e,0)}finally{o.value=!1}}}function y(e,t=new Set){for(let n of e)n.type===`directory`&&n.expanded&&(t.add(n.path),n.children&&y(n.children,t));return t}function b(e,t=0){return(e||[]).map(e=>{let n={name:e.name,path:e.path,type:e.type,depth:t,expanded:!1,loading:!1};return n.type===`directory`&&Array.isArray(e.children)&&(n.children=b(e.children,t+1),n.expanded=!0),n})}async function x(e){let t=r.currentDirectory;if(!t)return null;try{let n=await(await fetch(`/api/browse_directory_tree`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:t,expand:e})})).json().catch(()=>null);return!n?.success||!Array.isArray(n.items)?null:b(n.items,0)}catch{return null}}function C(e,t){let n=new Map(e.map(e=>[e.path,e])),r=e.length!==t.length;if(!r){for(let n=0;n<t.length;n++)if(e[n].path!==t[n].path){r=!0;break}}for(let e=0;e<t.length;e++){let i=t[e],a=n.get(i.path);a&&(t[e]=a,a.name!==i.name&&(a.name=i.name,r=!0),a.type===`directory`&&a.expanded&&Array.isArray(i.children)&&(Array.isArray(a.children)?C(a.children,i.children)&&(a.children=i.children,r=!0):(a.children=i.children,r=!0)))}return r}async function w(e={}){if(!r.currentDirectory)return;let t=await x([...y(a.value)]);if(!t){e.notifyOnError&&S.error(O(`@EDITOR:刷新失败`));return}if(a.value.length===0){a.value=t;return}C(a.value,t)&&(a.value=t)}async function E(e){if(e.type===`directory`){if(e.expanded)e.expanded=!1;else{if(!e.children){e.loading=!0;try{e.children=await g(e.path,e.depth+1)}finally{e.loading=!1}}e.expanded=!0}}}function ie(e){let t=[];for(let n of e)t.push(n),n.type===`directory`&&n.expanded&&n.children&&t.push(...ie(n.children));return t}let D=f(()=>c.value.trim().toLowerCase());function oe(e,t){if(!t)return e;let n=[];for(let r of e){let e=r.children?oe(r.children,t):[],i=r.name.toLowerCase().includes(t);r.type===`directory`?(i||e.length>0)&&(r.expanded=!0,r.children!==void 0&&(r.children=e),n.push(r)):i&&n.push(r)}return n}let se=f(()=>oe(a.value,D.value)),ce=f(()=>D.value.length>0&&se.value.length===0);function le(e){let t=c.value.trim();if(!t)return[{text:e,hit:!1}];let n=e.toLowerCase(),r=t.toLowerCase(),i=[],a=0,o=n.indexOf(r,a);for(;o!==-1;)o>a&&i.push({text:e.slice(a,o),hit:!1}),i.push({text:e.slice(o,o+r.length),hit:!0}),a=o+r.length,o=n.indexOf(r,a);return a<e.length&&i.push({text:e.slice(a),hit:!1}),i}let k=v(null);function we(){let e=k.value;e&&(e.focus(),e.select())}function Te(){s.value?(u(),k.value?.focus()):(k.value?.blur(),R.value?.focus())}let P=v([]),F=v(null),I=v(null);async function De(e){if(I.value=e,e.type!==`file`){E(e);return}let t=P.value.find(t=>t.path===e.path);if(console.log(`[debug-open-in-editor] EditorView openFile existing tab check:`,{path:e.path,found:!!t,tabsCount:P.value.length}),t){F.value=e.path,p(()=>B());return}let n=e.name.split(`.`).pop()||``;if(Ft.has(n.toLowerCase())){let t={path:e.path,name:e.name,content:``,originalContent:``,isDirty:!1,language:`plaintext`,diskMtimeMs:null};P.value.push(t),F.value=e.path,Y.value=!0;return}if(ve(e.name)){let t={path:e.path,name:e.name,content:``,originalContent:``,isDirty:!1,language:`office`,diskMtimeMs:null};P.value.push(t),F.value=e.path,X.value=!1,Y.value=!0;return}try{let t=await fetch(`/api/editor/file?path=${encodeURIComponent(e.path)}`),r=await t.json();if(console.log(`[debug-open-in-editor] EditorView fetch /api/editor/file response:`,{path:e.path,status:t.status,data:r}),!r.success){S.error(`${O(`@EDITOR:打开文件失败: `)}${r.error}`);return}let i=Me(n),a=z.get(e.path);a&&!a.isDisposed()&&a.setValue(r.content);let o={path:e.path,name:e.name,content:r.content,originalContent:r.content,isDirty:!1,language:i,diskMtimeMs:typeof r.mtimeMs==`number`?r.mtimeMs:null};console.log(`[debug-open-in-editor] EditorView pushing tab:`,{path:o.path,name:o.name,contentLen:o.content.length,lang:o.language}),P.value.push(o),F.value=e.path,console.log(`[debug-open-in-editor] EditorView tabs after push:`,P.value.length,`activeTabPath=`,F.value)}catch(e){console.log(`[debug-open-in-editor] EditorView fetch threw:`,e),S.error(`${O(`@EDITOR:打开文件失败: `)}${e.message}`)}}T(()=>n.pendingFilePath,async e=>{if(console.log(`[debug-open-in-editor] EditorView watcher fired, filePath=`,e),!e)return;await p();let t=e.split(/[\\/]/).pop()||e;console.log(`[debug-open-in-editor] EditorView calling openFile, name=`,t,`path=`,e),await De({name:t,path:e,type:`file`,depth:0}),console.log(`[debug-open-in-editor] EditorView openFile returned`)},{immediate:!0});function Oe(e,t){t.stopPropagation();let n=P.value.findIndex(t=>t.path===e);n!==-1&&(!P.value[n].isDirty||confirm(O(`@EDITOR:文件未保存,确认关闭?`)))&&(P.value.splice(n,1),F.value===e&&(F.value=P.value[Math.min(n,P.value.length-1)]?.path??null))}let ke=()=>P.value.find(e=>e.path===F.value)??null,Ae=f(()=>({expandedDirs:[...y(a.value)],tabs:P.value.map(e=>e.path),activeTab:F.value})),je=!1,L=!1;function Ne(){L&&!je&&r.isUiLoaded&&r.saveEditorWorkspace(Ae.value)}T(Ae,()=>Ne());async function Pe(e){if(P.value.some(t=>t.path===e))return;let t=e.split(/[\\/]/).pop()||e,n=(t.split(`.`).pop()||``).toLowerCase();if(Ft.has(n)){P.value.push({path:e,name:t,content:``,originalContent:``,isDirty:!1,language:`plaintext`,diskMtimeMs:null});return}if(ve(t)){P.value.push({path:e,name:t,content:``,originalContent:``,isDirty:!1,language:`office`,diskMtimeMs:null});return}try{let r=await(await fetch(`/api/editor/file?path=${encodeURIComponent(e)}`)).json();if(!r.success)return;let i=z.get(e);i&&!i.isDisposed()&&R.value?.getModel()!==i&&(i.dispose(),z.delete(e)),P.value.push({path:e,name:t,content:r.content,originalContent:r.content,isDirty:!1,language:Me(n),diskMtimeMs:typeof r.mtimeMs==`number`?r.mtimeMs:null})}catch{}}async function Fe(){try{for(let e=0;e<100&&!r.isUiLoaded;e++)await new Promise(e=>setTimeout(e,50));if(!r.isUiLoaded)return;W.value=r.ui.editorSidebarWidth;let e=r.getEditorWorkspace();if(!e)return;je=!0;try{if(e.expandedDirs.length>0){let t=await x(e.expandedDirs);t&&(a.value=t)}for(let t of e.tabs)await Pe(t);if(!n.pendingFilePath&&e.activeTab&&P.value.some(t=>t.path===e.activeTab)){F.value=e.activeTab;let t=ke(),n=(t?.name.split(`.`).pop()||``).toLowerCase();t&&(Ft.has(n)||ve(t.name))&&(Y.value=!0)}}finally{je=!1}}finally{L=!0,Ne()}}let Ie=v(null),R=ae(null),z=new Map;function Re(e){let t=z.get(e.path);return(!t||t.isDisposed())&&(t=N.createModel(e.content,e.language,be.file(e.path)),z.set(e.path,t)),t}function ze(){R.value?.setModel(null);for(let e of z.values())e.isDisposed()||e.dispose();z.clear()}function Be(){if(!Ie.value)return;let e=document.documentElement.getAttribute(`data-theme`)===`dark`;R.value=N.create(Ie.value,{theme:e?`vs-dark`:`vs`,fontSize:13,lineHeight:20,fontFamily:`'JetBrains Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace`,minimap:{enabled:!0},scrollBeyondLastLine:!1,renderWhitespace:`selection`,automaticLayout:!0,tabSize:2,wordWrap:`off`,smoothScrolling:!0,cursorBlinking:`smooth`,padding:{top:8,bottom:8},editContext:!1}),R.value.onDidChangeModelContent(()=>{let e=ke();if(!e)return;let t=R.value.getValue();e.content=t,e.isDirty=t!==e.originalContent}),R.value.onDidBlurEditorText(()=>{r.ui.editorAutoSave&&ke()?.isDirty&&et(!1),requestAnimationFrame(()=>{if(!U.value||U.value.offsetParent===null)return;let e=document.activeElement;e&&(e.tagName===`INPUT`||e.tagName===`TEXTAREA`||e.isContentEditable||e.classList?.contains(`native-edit-context`)||e.classList?.contains(`monaco-editor`))||B()})})}T(F,e=>{if(!R.value||!e)return;let t=P.value.find(t=>t.path===e);if(!t)return;let n=Re(t);R.value.setModel(n),p(()=>B()),Ke(e)});function B(){if(!R.value)return;R.value.focus();let e=document.querySelector(`.monaco-editor .native-edit-context`);e&&document.activeElement!==e&&requestAnimationFrame(()=>e.focus?.())}let Ve=0,He=new Map;async function Ue(e){try{let t=await(await fetch(`/api/editor/file?path=${encodeURIComponent(e)}&meta=1`)).json();return!t?.success||typeof t.mtimeMs!=`number`?null:{mtimeMs:t.mtimeMs}}catch{return null}}async function We(e){try{let t=await(await fetch(`/api/editor/file?path=${encodeURIComponent(e)}`)).json();return t?.success?{content:t.content,mtimeMs:typeof t.mtimeMs==`number`?t.mtimeMs:null}:null}catch{return null}}function Ge(e,t,n){e.content=t,e.originalContent=t,e.isDirty=!1,e.diskMtimeMs=n;let r=z.get(e.path);if(!r||r.isDisposed())return;let i=R.value;if(!i||i.getModel()!==r){r.setValue(t);return}let a=i.saveViewState();r.pushEditOperations([],[{range:r.getFullModelRange(),text:t}],()=>null),i.restoreViewState(a)}async function Ke(e){if(!e)return;let t=P.value.find(t=>t.path===e);if(!t||t.diskMtimeMs===null)return;let n=++Ve,r=await Ue(e);if(n!==Ve||P.value.find(t=>t.path===e)!==t||!r||r.mtimeMs===t.diskMtimeMs)return;if(t.isDirty){if(He.get(e)===r.mtimeMs)return;He.set(e,r.mtimeMs);try{await re.confirm(O(`@EDITOR:这个文件在磁盘上已被改动,你这边也有未保存的编辑。重新加载会丢弃你的改动。`),O(`@EDITOR:文件已被外部改动`),{confirmButtonText:O(`@EDITOR:重新加载`),cancelButtonText:O(`@EDITOR:保留我的`),type:`warning`})}catch{return}if(t.isDirty)return}let i=await We(e);i&&P.value.find(t=>t.path===e)===t&&Ge(t,i.content,i.mtimeMs)}function qe(){document.hidden||Ke(F.value)}let V=null;function Je(){Qe(),V=setInterval(()=>{document.hidden||Ke(F.value)},Ze)}function Qe(){V&&=(clearInterval(V),null)}T(()=>P.value.filter(e=>e.isDirty).length,e=>{i.setDirtyCount(e)},{immediate:!0}),ne(()=>i.setDirtyCount(0)),Ce(()=>{let e=document.documentElement.getAttribute(`data-theme`)===`dark`;N.setTheme(e?`vs-dark`:`vs`)});let H=null;function $e(){if(H||!U.value)return;let e=[U.value],t=U.value.parentElement;for(;t;){if(t.classList.contains(`view-pane`)||t.classList.contains(`editor-pane`)){e.push(t);break}t=t.parentElement}H=new MutationObserver(()=>{U.value&&U.value.offsetParent!==null&&F.value&&R.value&&(Ke(F.value),requestAnimationFrame(()=>{let e=document.activeElement;e&&(e.tagName===`INPUT`||e.tagName===`TEXTAREA`||e.isContentEditable||e.classList?.contains(`native-edit-context`)||e.classList?.contains(`monaco-editor`))||B()}))});let n=H;e.forEach(e=>n.observe(e,{attributes:!0,attributeFilter:[`style`,`class`,`hidden`]}))}te(async()=>{Be(),await _(),await Fe(),$e(),m(),window.addEventListener(`focus`,qe),document.addEventListener(`visibilitychange`,qe),Je(),F.value&&p(()=>B())}),ne(()=>{H?.disconnect(),H=null,window.removeEventListener(`focus`,qe),document.removeEventListener(`visibilitychange`,qe),R.value?.dispose(),z.forEach(e=>e.dispose()),z.clear()});async function et(e=!1){let t=ke();if(t)try{let n=await(await fetch(`/api/editor/file`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:t.path,content:t.content})})).json();if(!n.success){S.error(`${O(`@EDITOR:保存失败: `)}${n.error}`);return}t.originalContent=t.content,t.isDirty=!1,typeof n.mtimeMs==`number`&&(t.diskMtimeMs=n.mtimeMs),e||S.success(O(`@EDITOR:已保存`))}catch(e){S.error(`${O(`@EDITOR:保存失败: `)}${e.message}`)}}function tt(e){let t=e.ctrlKey||e.metaKey;if(t&&e.key.toLowerCase()===`f`){e.preventDefault(),we();return}t&&e.key===`s`&&(e.preventDefault(),et())}te(()=>window.addEventListener(`keydown`,tt)),ne(()=>window.removeEventListener(`keydown`,tt));let U=v(null),W=v(r.ui.editorSidebarWidth),nt=!1,rt=0,it=0;function at(e){nt=!0,rt=e.clientX,it=W.value,document.addEventListener(`mousemove`,ot),document.addEventListener(`mouseup`,st),e.preventDefault()}function ot(e){if(!nt)return;let t=e.clientX-rt;W.value=Math.max(140,Math.min(400,it+t))}function st(){nt=!1,document.removeEventListener(`mousemove`,ot),document.removeEventListener(`mouseup`,st),W.value!==r.ui.editorSidebarWidth&&r.setEditorSidebarWidth(W.value)}function ct(e){return e.type===`directory`?fe(e.name):pe(e.name)}let G=v(null),K=v(null),lt=v(null),ut=v(null);function dt(){let e=I.value;return e?e.type===`directory`?{parentPath:e.path,afterNode:e,depth:e.depth+1}:{parentPath:e.path.includes(`/`)||e.path.includes(`\\`)?e.path.replace(/[\\/][^\\/]+$/,``):r.currentDirectory??``,afterNode:e,depth:e.depth}:{parentPath:r.currentDirectory??``,afterNode:null,depth:0}}async function ft(){let e=dt();I.value?.type===`directory`&&!I.value.expanded&&await E(I.value),G.value={...e,kind:`file`,value:``},await p(),lt.value?.focus()}async function pt(){let e=dt();I.value?.type===`directory`&&!I.value.expanded&&await E(I.value),G.value={...e,kind:`directory`,value:``},await p(),lt.value?.focus()}function mt(){G.value=null}async function ht(){let e=G.value;if(!e||!e.value.trim()){G.value=null;return}let t=e.value.trim(),n=e.parentPath.replace(/[/\\]$/,``)+`/`+t;if(e.kind===`file`){let e=await(await fetch(`/api/editor/file`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:n})})).json();if(!e.success){S.error(e.error);return}S.success(O(`@EDITOR:创建成功`))}else{let e=await(await fetch(`/api/editor/directory`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:n})})).json();if(!e.success){S.error(e.error);return}S.success(O(`@EDITOR:创建成功`))}G.value=null,await w()}function gt(e){e.key===`Enter`&&(e.preventDefault(),ht()),e.key===`Escape`&&(e.preventDefault(),mt())}let q=v(null),_t=v(null);function vt(e,t){e.preventDefault(),q.value={x:e.clientX,y:e.clientY,node:t}}function J(){q.value=null}async function yt(){let e=q.value?.node;J(),e&&(I.value=e),e?.type===`directory`&&!e.expanded&&await E(e);let t=dt();G.value={...t,kind:`file`,value:``},await p(),lt.value?.focus()}async function bt(){let e=q.value?.node;J(),e&&(I.value=e),e?.type===`directory`&&!e.expanded&&await E(e);let t=dt();G.value={...t,kind:`directory`,value:``},await p(),lt.value?.focus()}async function xt(){let e=q.value?.node;J(),e&&(K.value={node:e,value:e.name},await p(),ut.value?.focus(),ut.value?.select())}async function St(){let e=K.value;if(!e||!e.value.trim()||e.value.trim()===e.node.name){K.value=null;return}let t=e.value.trim(),n=e.node.path.replace(/[\\/][^\\/]+$/,``).replace(/[/\\]$/,``)+`/`+t,r=await(await fetch(`/api/editor/rename`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({oldPath:e.node.path,newPath:n})})).json();if(!r.success){S.error(r.error);return}let i=P.value.find(t=>t.path===e.node.path);i&&(i.path=n,i.name=t,F.value===e.node.path&&(F.value=n)),K.value=null,await w()}function Ct(e){e.key===`Enter`&&(e.preventDefault(),St()),e.key===`Escape`&&(e.preventDefault(),K.value=null)}async function wt(){let e=q.value?.node;if(J(),!e)return;let t=e.type===`directory`?O(`@EDITOR:文件夹`):O(`@EDITOR:文件`);if(!confirm(`${O(`@EDITOR:确认删除`)} ${t} "${e.name}"?`))return;let n=await(await fetch(`/api/editor/entry?path=${encodeURIComponent(e.path)}`,{method:`DELETE`})).json();if(!n.success){S.error(n.error);return}let r=P.value.findIndex(t=>t.path===e.path);r!==-1&&(P.value.splice(r,1),F.value===e.path&&(F.value=P.value[Math.max(0,r-1)]?.path??null)),S.success(O(`@EDITOR:已删除`)),await w()}async function Tt(){let e=q.value?.node;if(J(),e)try{let t=await(await fetch(`/api/editor/reveal`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:e.path})})).json();t.success||S.error(t.error)}catch(e){S.error(e?.message||String(e))}}function Et(e){let t=r.currentDirectory;if(!t)return e;let n=e=>e.replace(/\\/g,`/`).replace(/\/+$/,``),i=n(t),a=n(e);return a===i?`.`:a.startsWith(i+`/`)?a.slice(i.length+1):a}async function Dt(e){try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(e),!0}catch{}try{let t=document.createElement(`textarea`);t.value=e,t.style.position=`fixed`,t.style.left=`-9999px`,document.body.appendChild(t),t.select();let n=document.execCommand(`copy`);return document.body.removeChild(t),n}catch{return!1}}async function Ot(){let e=q.value?.node;J(),e&&(await Dt(e.path)?S.success(O(`@EDITOR:已复制到剪贴板`)):S.error(O(`@EDITOR:复制失败`)))}async function kt(){let e=q.value?.node;J(),e&&(await Dt(Et(e.path))?S.success(O(`@EDITOR:已复制到剪贴板`)):S.error(O(`@EDITOR:复制失败`)))}async function At(){let e=q.value?.node;if(J(),e)try{let t=await(await fetch(`/api/editor/open-in-vscode`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:e.path})})).json();t.success||S.error(t.error||O(`@EDITOR:VSCode 未安装`))}catch(e){S.error(e?.message||String(e))}}let jt=new Set([`html`,`htm`]),Mt=f(()=>{let e=q.value?.node;if(!e||e.type!==`file`)return!1;let t=e.name.slice(e.name.lastIndexOf(`.`)+1).toLowerCase();return jt.has(t)});async function Nt(){let e=q.value?.node;if(J(),e)try{let t=await(await fetch(`/api/editor/open-in-browser`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:e.path})})).json();t.success||S.error(t.error||O(`@EDITOR:浏览器打开失败`))}catch(e){S.error(e?.message||String(e))}}te(()=>document.addEventListener(`click`,J)),ne(()=>document.removeEventListener(`click`,J));let Pt=new Set([`md`,`html`,`htm`,`svg`]),Ft=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`ico`,`bmp`]),Y=v(!1),X=v(!1),Z=v(!1),It=v(!1),Lt=v(0),Q=f(()=>P.value.find(e=>e.path===F.value)??null),Rt=f(()=>Q.value?.language===`plaintext`&&Q.value?.content===``),zt=f(()=>Q.value?.language===`office`),$=f(()=>(Q.value?.name??``).split(`.`).pop()?.toLowerCase()??``),Bt=f(()=>Pt.has($.value)||Ft.has($.value)||ve($.value)),Vt=f(()=>((Q.value?.content??``).match(/^#{1,6}\s+/gm)||[]).length),Ht=f(()=>$.value===`md`&&Vt.value>0);T(F,()=>{Y.value&&!Bt.value&&(Y.value=!1),X.value&&!Ht.value&&(X.value=!1)});function Ut(){Bt.value&&(Y.value||(X.value=!1,Z.value=!1),Y.value=!Y.value)}function Wt(){Ht.value&&(X.value||(Y.value=!1,Z.value=!1),X.value=!X.value)}function Gt(){Z.value||(Y.value=!1,X.value=!1),Z.value=!Z.value,It.value=!0}let Kt=f(()=>{let e=Q.value;if(!e)return``;let t=$.value,n=document.documentElement.getAttribute(`data-theme`)===`light`?`#ffffff`:`#0d1117`;return t===`html`||t===`htm`?ge(e.content):t===`svg`?`<!DOCTYPE html><html><head><meta charset="utf-8"><style>html,body{margin:0;padding:0;background:${n};display:flex;align-items:center;justify-content:center;min-height:100vh;}svg{max-width:100%;max-height:90vh;}</style></head><body>${e.content}</body></html>`:``}),qt=!1,Jt=0,Yt=0;function Xt(e){qt=!0,Jt=e.clientX,Yt=Lt.value,document.addEventListener(`mousemove`,Zt),document.addEventListener(`mouseup`,Qt),e.preventDefault()}function Zt(e){if(!qt)return;let t=e.clientX-Jt;Lt.value=Math.max(200,Math.min(900,Yt+t))}function Qt(){qt=!1,document.removeEventListener(`mousemove`,Zt),document.removeEventListener(`mouseup`,Qt)}let $t={props:n,configStore:r,editorTabsStore:i,treeNodes:a,treeLoading:o,searchQuery:s,debouncedSearchQuery:c,get searchDebounceTimer(){return l},set searchDebounceTimer(e){l=e},clearSearch:u,TREE_POLL_MS:Xe,get treePollTimer(){return d},set treePollTimer(e){d=e},startTreePolling:m,stopTreePolling:h,loadDir:g,initTree:_,collectExpandedPaths:y,toTreeNodes:b,fetchTreeSnapshot:x,reconcileTree:C,refreshTree:w,toggleDir:E,flattenTree:ie,searchQueryLower:D,filterTree:oe,visibleTree:se,noSearchResults:ce,highlightName:le,searchInputRef:k,focusSearchInput:we,onSearchEscape:Te,tabs:P,activeTabPath:F,selectedNode:I,openFile:De,closeTab:Oe,activeTab:ke,workspaceSnapshot:Ae,get workspaceRestoring(){return je},set workspaceRestoring(e){je=e},get workspaceHydrated(){return L},set workspaceHydrated(e){L=e},persistWorkspace:Ne,restoreTab:Pe,restoreWorkspace:Fe,editorContainerRef:Ie,editorInstance:R,modelCache:z,getOrCreateModel:Re,disposeAllModels:ze,mountEditor:Be,focusEditor:B,get diskSyncSeq(){return Ve},set diskSyncSeq(e){Ve=e},diskConflictPromptedAt:He,fetchFileMeta:Ue,fetchFileContent:We,applyDiskContent:Ge,syncActiveTabWithDisk:Ke,handleWindowFocus:qe,DISK_SYNC_POLL_MS:Ze,get diskSyncTimer(){return V},set diskSyncTimer(e){V=e},startDiskSyncPolling:Je,stopDiskSyncPolling:Qe,get viewVisibilityObserver(){return H},set viewVisibilityObserver(e){H=e},setupViewVisibilityObserver:$e,saveCurrentFile:et,handleKeydown:tt,containerRef:U,sidebarWidth:W,get isResizing(){return nt},set isResizing(e){nt=e},get resizeStartX(){return rt},set resizeStartX(e){rt=e},get resizeStartW(){return it},set resizeStartW(e){it=e},startSidebarResize:at,onSidebarResize:ot,stopSidebarResize:st,getNodeSpriteId:ct,inlineInput:G,renameInput:K,inlineInputRef:lt,renameInputRef:ut,getTargetDir:dt,startNewFile:ft,startNewFolder:pt,cancelInlineInput:mt,confirmInlineInput:ht,handleInlineKeydown:gt,ctxMenu:q,ctxMenuRef:_t,openContextMenu:vt,closeContextMenu:J,ctxNewFile:yt,ctxNewFolder:bt,ctxRename:xt,confirmRename:St,handleRenameKeydown:Ct,ctxDelete:wt,ctxRevealInExplorer:Tt,toWorkspaceRelative:Et,copyToClipboard:Dt,ctxCopyAbsolutePath:Ot,ctxCopyRelativePath:kt,ctxOpenInVscode:At,BROWSER_OPEN_EXTS:jt,ctxMenuCanOpenInBrowser:Mt,ctxOpenInBrowser:Nt,PREVIEW_TEXT_EXTS:Pt,IMAGE_EXTS:Ft,showPreview:Y,showMindmap:X,showAgentChat:Z,agentOpened:It,previewWidth:Lt,activeTabRef:Q,activeTabIsImage:Rt,activeTabIsOffice:zt,activeExt:$,isPreviewable:Bt,mindmapTitleCount:Vt,isMindmapable:Ht,togglePreview:Ut,toggleMindmap:Wt,toggleAgentChat:Gt,previewSrcdoc:Kt,get isPreviewResizing(){return qt},set isPreviewResizing(e){qt=e},get previewResizeStartX(){return Jt},set previewResizeStartX(e){Jt=e},get previewResizeStartW(){return Yt},set previewResizeStartW(e){Yt=e},startPreviewResize:Xt,onPreviewResize:Zt,stopPreviewResize:Qt,get $t(){return O},get ElTooltip(){return ee},ImagePreview:me,OfficePreview:_e,MarkdownPreview:he,MindmapPreview:Le,EditorAgentPanel:Ye,SvgIcon:ue,get PREVIEW_IFRAME_SANDBOX(){return A}};return Object.defineProperty($t,"__isScriptSetup",{enumerable:!1,value:!0}),$t}});t(),a(),b();var H={class:`editor-view`,ref:`containerRef`},$e={class:`sidebar-header`},et={class:`sidebar-title`},tt={class:`sidebar-actions`},U={class:`sidebar-search`},W=[`placeholder`,`title`],nt=[`title`,`aria-label`],rt={key:0,class:`sidebar-tree`},it={key:1,class:`tree-arrow-spacer`},at={class:`tree-icon mit-icon`,"aria-hidden":`true`},ot=[`xlink:href`],st=[`onClick`,`onContextmenu`],ct={key:1,class:`tree-arrow-spacer`},G={key:2,class:`tree-icon mit-icon`,"aria-hidden":`true`},K=[`xlink:href`],lt={key:3,class:`tree-icon mit-icon`,"aria-hidden":`true`},ut=[`xlink:href`],dt=[`title`],ft={key:0,class:`tree-name-hit`},pt={key:4,class:`tree-loading`},mt={key:0,viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:{"flex-shrink":`0`,color:`var(--color-warning-dark)`}},ht={key:1,viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:{"flex-shrink":`0`,color:`var(--text-meta)`}},gt=[`placeholder`],q={key:0,class:`tree-node tree-inline-input-row`,style:{paddingLeft:`12px`}},_t={key:0,viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:{"flex-shrink":`0`,color:`var(--color-warning-dark)`}},vt={key:1,viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:{"flex-shrink":`0`,color:`var(--text-meta)`}},J=[`placeholder`],yt={key:1,class:`tree-empty`},bt={key:1,class:`sidebar-loading`},xt={class:`editor-main`},St={key:0,class:`editor-tabs`},Ct=[`onClick`,`title`],wt={class:`tab-name`},Tt={key:0,class:`tab-dirty-dot`},Et=[`onClick`],Dt=[`title`],Ot=[`disabled`,`title`],kt=[`title`],At={key:1,class:`editor-empty`},jt={viewBox:`0 0 24 24`,width:`48`,height:`48`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:{opacity:`.3`}},Mt={class:`editor-empty-hint`},Nt={class:`editor-body`},Pt={key:0,class:`image-tab-placeholder`},Ft={viewBox:`0 0 24 24`,width:`56`,height:`56`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:{opacity:`.35`}},Y={class:`image-tab-placeholder-title`},X={class:`image-tab-placeholder-hint`},Z={class:`preview-header`},It={class:`preview-title`},Lt={class:`preview-ext-badge`},Q=[`title`],Rt={class:`preview-body`},zt=[`sandbox`,`srcdoc`];function $(t,a,o,f,ee,p){return h(),C(D,null,[i(`div`,H,[u(` 左侧文件树 `),i(`div`,{class:`editor-sidebar`,style:m({width:f.sidebarWidth+`px`})},[i(`div`,$e,[i(`span`,et,x(f.$t(`@EDITOR:资源管理器`)),1),i(`div`,tt,[d(f.ElTooltip,{content:f.$t(`@EDITOR:新建文件`),placement:`bottom`,"show-after":300},{default:y(()=>[i(`button`,{class:`sidebar-action-btn`,onClick:f.startNewFile},[u(` new-file icon `),a[11]||=i(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[i(`path`,{d:`M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z`}),i(`polyline`,{points:`14 2 14 8 20 8`}),i(`line`,{x1:`12`,y1:`13`,x2:`12`,y2:`19`}),i(`line`,{x1:`9`,y1:`16`,x2:`15`,y2:`16`})],-1)])]),_:1},8,[`content`]),d(f.ElTooltip,{content:f.$t(`@EDITOR:新建文件夹`),placement:`bottom`,"show-after":300},{default:y(()=>[i(`button`,{class:`sidebar-action-btn`,onClick:f.startNewFolder},[u(` new-folder icon `),a[12]||=i(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[i(`path`,{d:`M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z`}),i(`line`,{x1:`12`,y1:`11`,x2:`12`,y2:`17`}),i(`line`,{x1:`9`,y1:`14`,x2:`15`,y2:`14`})],-1)])]),_:1},8,[`content`]),d(f.ElTooltip,{content:f.$t(`@EDITOR:刷新`),placement:`bottom`,"show-after":300},{default:y(()=>[i(`button`,{class:`sidebar-action-btn`,onClick:a[0]||=e=>f.refreshTree({notifyOnError:!0})},[...a[13]||=[i(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[i(`polyline`,{points:`1 4 1 10 7 10`}),i(`polyline`,{points:`23 20 23 14 17 14`}),i(`path`,{d:`M20.49 9A9 9 0 0 0 5.64 5.64L1 10m22 4l-4.64 4.36A9 9 0 0 1 3.51 15`})],-1)]])]),_:1},8,[`content`])])]),i(`div`,U,[a[15]||=i(`svg`,{class:`sidebar-search-icon`,viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[i(`circle`,{cx:`11`,cy:`11`,r:`7`}),i(`line`,{x1:`21`,y1:`21`,x2:`16.65`,y2:`16.65`})],-1),w(i(`input`,{ref:`searchInputRef`,"onUpdate:modelValue":a[1]||=e=>f.searchQuery=e,type:`text`,class:`sidebar-search-input`,placeholder:f.$t(`@EDITOR:搜索文件...`),title:f.$t(`@EDITOR:搜索文件...`),spellcheck:`false`,autocomplete:`off`,onKeydown:oe(f.onSearchEscape,[`escape`])},null,40,W),[[g,f.searchQuery]]),f.searchQuery?(h(),C(`button`,{key:0,class:`sidebar-search-clear`,title:f.$t(`@EDITOR:清除搜索`),"aria-label":f.$t(`@EDITOR:清除搜索`),onClick:f.clearSearch},[...a[14]||=[i(`svg`,{viewBox:`0 0 24 24`,width:`12`,height:`12`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.5`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[i(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),i(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})],-1)]],8,nt)):u(`v-if`,!0)]),f.treeLoading?(h(),C(`div`,bt,[...a[24]||=[i(`span`,{class:`spin-icon`},null,-1)]])):(h(),C(`div`,rt,[(h(!0),C(D,null,e(f.flattenTree(f.visibleTree),t=>(h(),C(D,{key:t.path},[u(` 重命名时用输入框替换节点 `),f.renameInput&&f.renameInput.node.path===t.path?(h(),C(`div`,{key:0,class:`tree-node tree-inline-input-row`,style:m({paddingLeft:12+t.depth*14+`px`})},[t.type===`directory`?(h(),C(`span`,{key:0,class:s([`tree-arrow`,{expanded:t.expanded}])},[...a[16]||=[i(`svg`,{viewBox:`0 0 24 24`,width:`10`,height:`10`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.5`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[i(`polyline`,{points:`9 18 15 12 9 6`})],-1)]],2)):(h(),C(`span`,it)),(h(),C(`svg`,at,[i(`use`,{"xlink:href":`#${f.getNodeSpriteId(t)}`},null,8,ot)])),w(i(`input`,{ref_for:!0,ref:`renameInputRef`,"onUpdate:modelValue":a[2]||=e=>f.renameInput.value=e,onKeydown:f.handleRenameKeydown,onBlur:f.confirmRename,onClick:a[3]||=_(()=>{},[`stop`])},null,544),[[g,f.renameInput.value]])],4)):(h(),C(D,{key:1},[u(` 普通节点 `),i(`div`,{class:s([`tree-node`,{"tree-node--dir":t.type===`directory`,"tree-node--file":t.type===`file`,"tree-node--active":f.activeTabPath===t.path,"tree-node--selected":f.selectedNode?.path===t.path&&f.activeTabPath!==t.path}]),style:m({paddingLeft:12+t.depth*14+`px`}),onClick:e=>f.openFile(t),onContextmenu:e=>f.openContextMenu(e,t)},[u(` 展开箭头 `),t.type===`directory`?(h(),C(`span`,{key:0,class:s([`tree-arrow`,{expanded:t.expanded}])},[...a[17]||=[i(`svg`,{viewBox:`0 0 24 24`,width:`10`,height:`10`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.5`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[i(`polyline`,{points:`9 18 15 12 9 6`})],-1)]],2)):(h(),C(`span`,ct)),u(` 图标 `),t.type===`directory`?(h(),C(`svg`,G,[i(`use`,{"xlink:href":`#${f.getNodeSpriteId(t)}`},null,8,K)])):(h(),C(`svg`,lt,[i(`use`,{"xlink:href":`#${f.getNodeSpriteId(t)}`},null,8,ut)])),u(` 名称(命中关键字高亮) `),i(`span`,{class:`tree-name`,title:t.path},[(h(!0),C(D,null,e(f.highlightName(t.name),(e,t)=>(h(),C(D,{key:t},[e.hit?(h(),C(`span`,ft,x(e.text),1)):(h(),C(D,{key:1},[l(x(e.text),1)],64))],64))),128))],8,dt),t.loading?(h(),C(`span`,pt)):u(`v-if`,!0)],46,st)],2112)),u(` 内联新建输入框:紧跟在 afterNode 之后 `),f.inlineInput&&f.inlineInput.afterNode?.path===t.path?(h(),C(`div`,{key:2,class:`tree-node tree-inline-input-row`,style:m({paddingLeft:12+f.inlineInput.depth*14+`px`})},[a[20]||=i(`span`,{class:`tree-arrow-spacer`},null,-1),f.inlineInput.kind===`directory`?(h(),C(`svg`,mt,[...a[18]||=[i(`path`,{d:`M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z`},null,-1)]])):(h(),C(`svg`,ht,[...a[19]||=[i(`path`,{d:`M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z`},null,-1),i(`polyline`,{points:`14 2 14 8 20 8`},null,-1)]])),w(i(`input`,{ref_for:!0,ref:`inlineInputRef`,class:`tree-inline-input`,"onUpdate:modelValue":a[4]||=e=>f.inlineInput.value=e,placeholder:f.inlineInput.kind===`file`?f.$t(`@EDITOR:输入文件名`):f.$t(`@EDITOR:输入文件夹名`),onKeydown:f.handleInlineKeydown,onBlur:f.cancelInlineInput,onClick:a[5]||=_(()=>{},[`stop`])},null,40,gt),[[g,f.inlineInput.value]])],4)):u(`v-if`,!0)],64))),128)),u(` 根级输入框(无选中节点时出现在列表末尾) `),f.inlineInput&&f.inlineInput.afterNode===null?(h(),C(`div`,q,[a[23]||=i(`span`,{class:`tree-arrow-spacer`},null,-1),f.inlineInput.kind===`directory`?(h(),C(`svg`,_t,[...a[21]||=[i(`path`,{d:`M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z`},null,-1)]])):(h(),C(`svg`,vt,[...a[22]||=[i(`path`,{d:`M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z`},null,-1),i(`polyline`,{points:`14 2 14 8 20 8`},null,-1)]])),w(i(`input`,{ref:`inlineInputRef`,class:`tree-inline-input`,"onUpdate:modelValue":a[6]||=e=>f.inlineInput.value=e,placeholder:f.inlineInput.kind===`file`?f.$t(`@EDITOR:输入文件名`):f.$t(`@EDITOR:输入文件夹名`),onKeydown:f.handleInlineKeydown,onBlur:f.cancelInlineInput,onClick:a[7]||=_(()=>{},[`stop`])},null,40,J),[[g,f.inlineInput.value]])])):u(`v-if`,!0),!f.inlineInput&&(f.noSearchResults||f.treeNodes.length===0)?(h(),C(`div`,yt,x(f.noSearchResults?f.$t(`@EDITOR:未找到匹配文件`):f.$t(`@EDITOR:暂无文件`)),1)):u(`v-if`,!0)]))],4),u(` 拖拽分隔条 `),i(`div`,{class:`editor-resizer`,onMousedown:f.startSidebarResize},null,32),u(` 右侧编辑区 `),i(`div`,xt,[u(` 标签栏 `),f.tabs.length>0?(h(),C(`div`,St,[(h(!0),C(D,null,e(f.tabs,e=>(h(),C(`div`,{key:e.path,class:s([`editor-tab`,{active:f.activeTabPath===e.path,dirty:e.isDirty}]),onClick:t=>f.activeTabPath=e.path,title:e.path},[i(`span`,wt,x(e.name),1),e.isDirty?(h(),C(`span`,Tt)):u(`v-if`,!0),i(`button`,{class:`tab-close`,onClick:t=>f.closeTab(e.path,t)},[...a[25]||=[i(`svg`,{viewBox:`0 0 24 24`,width:`12`,height:`12`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.5`,"stroke-linecap":`round`},[i(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),i(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})],-1)]],8,Et)],10,Ct))),128)),a[29]||=i(`div`,{class:`editor-tabs-spacer`},null,-1),u(` 预览切换按钮 `),f.isPreviewable?(h(),C(`button`,{key:0,class:s([`preview-toggle-btn`,{active:f.showPreview}]),title:f.showPreview?f.$t(`@EDITOR:关闭预览`):f.$t(`@EDITOR:打开预览`),onClick:f.togglePreview},[a[26]||=i(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[i(`path`,{d:`M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z`}),i(`circle`,{cx:`12`,cy:`12`,r:`3`})],-1),i(`span`,null,x(f.$t(`@EDITOR:预览`)),1)],10,Dt)):u(`v-if`,!0),u(` 思维导图:整篇 markdown 渲染为一张大导图 `),f.isMindmapable?(h(),C(`button`,{key:1,class:s([`preview-toggle-btn mindmap-toggle-btn`,{active:f.showMindmap,disabled:!f.isMindmapable}]),disabled:!f.isMindmapable,title:f.isMindmapable?f.showMindmap?f.$t(`@EDITOR:关闭思维导图`):f.$t(`@EDITOR:打开思维导图`):f.$t(`@EDITOR:需要至少一个 # 标题`),onClick:f.toggleMindmap},[a[27]||=c(`<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" data-v-fc2ebf13><circle cx="12" cy="12" r="2" data-v-fc2ebf13></circle><circle cx="5" cy="6" r="1.6" data-v-fc2ebf13></circle><circle cx="19" cy="6" r="1.6" data-v-fc2ebf13></circle><circle cx="5" cy="18" r="1.6" data-v-fc2ebf13></circle><circle cx="19" cy="18" r="1.6" data-v-fc2ebf13></circle><line x1="11" y1="11" x2="6.4" y2="7" data-v-fc2ebf13></line><line x1="13" y1="11" x2="17.6" y2="7" data-v-fc2ebf13></line><line x1="11" y1="13" x2="6.4" y2="17" data-v-fc2ebf13></line><line x1="13" y1="13" x2="17.6" y2="17" data-v-fc2ebf13></line></svg>`,1),i(`span`,null,x(f.$t(`@EDITOR:思维导图`)),1)],10,Ot)):u(`v-if`,!0),u(` g ai 对话:文件空间右侧的智能体面板(与预览/思维导图互斥) `),i(`button`,{class:s([`preview-toggle-btn agent-toggle-btn`,{active:f.showAgentChat}]),title:f.showAgentChat?f.$t(`@EDITOR:关闭 g ai 对话`):f.$t(`@EDITOR:打开 g ai 对话`),onClick:f.toggleAgentChat},[a[28]||=i(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[i(`path`,{d:`M12 3l1.9 4.6L18.5 9.5l-4.6 1.9L12 16l-1.9-4.6L5.5 9.5l4.6-1.9z`}),i(`path`,{d:`M18 16.5l.9 2.1 2.1.9-2.1.9-.9 2.1-.9-2.1-2.1-.9 2.1-.9z`})],-1),i(`span`,null,x(f.$t(`@EDITOR:g ai 对话`)),1)],10,kt)])):u(`v-if`,!0),u(` 无文件打开时的提示 `),f.tabs.length===0?(h(),C(`div`,At,[(h(),C(`svg`,jt,[...a[30]||=[i(`path`,{d:`M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z`},null,-1),i(`polyline`,{points:`14 2 14 8 20 8`},null,-1)]])),i(`p`,null,x(f.$t(`@EDITOR:从左侧选择文件打开`)),1),i(`p`,Mt,x(f.$t(`@EDITOR:Ctrl+S 保存`)),1)])):u(`v-if`,!0),u(` Monaco 容器(始终挂载,tab 为空或 image tab 时隐藏) `),i(`div`,Nt,[i(`div`,{class:s([`monaco-container`,{hidden:f.tabs.length===0||f.activeTabIsImage||f.activeTabIsOffice}]),ref:`editorContainerRef`},null,2),u(` 图片 tab 时的占位提示(主预览区在右侧 preview-panel) `),f.activeTabIsImage&&f.tabs.length>0&&!f.showPreview&&!f.showMindmap?(h(),C(`div`,Pt,[(h(),C(`svg`,Ft,[...a[31]||=[i(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`},null,-1),i(`circle`,{cx:`9`,cy:`9`,r:`2`},null,-1),i(`path`,{d:`m21 15-5-5L5 21`},null,-1)]])),i(`p`,Y,x(f.activeTabRef?.name),1),i(`p`,X,x(f.$t(`@EDITOR:这是图片文件,已在右侧预览面板中打开`)),1)])):u(`v-if`,!0),u(` 预览分隔条(在面板右侧,拉动调整面板宽度) `),(f.showPreview||f.showMindmap||f.showAgentChat)&&f.tabs.length>0?(h(),C(`div`,{key:1,class:`preview-resizer`,onMousedown:f.startPreviewResize},null,32)):u(`v-if`,!0),u(` g ai 对话面板:v-if 懒挂载 + v-show 保状态(切到预览再切回来,进行中的流还在) `),f.agentOpened?w((h(),r(f.EditorAgentPanel,{key:2,active:f.showAgentChat&&f.tabs.length>0,"active-file-path":f.activeTabPath,"active-file-name":f.activeTabRef?.name??``,style:m({flexBasis:f.previewWidth+`px`}),onClose:a[8]||=e=>f.showAgentChat=!1},null,8,[`active`,`active-file-path`,`active-file-name`,`style`])),[[ie,f.showAgentChat&&f.tabs.length>0]]):u(`v-if`,!0),u(` 预览面板 `),(f.showPreview||f.showMindmap)&&f.tabs.length>0?(h(),C(`div`,{key:3,class:`preview-panel`,style:m({flexBasis:f.previewWidth+`px`})},[i(`div`,Z,[i(`span`,It,x(f.showMindmap?f.$t(`@EDITOR:思维导图`):f.$t(`@EDITOR:预览`)),1),i(`span`,Lt,x(f.activeExt.toUpperCase()),1),a[33]||=i(`div`,{class:`preview-header-spacer`},null,-1),i(`button`,{class:`preview-close-btn`,title:f.showMindmap?f.$t(`@EDITOR:关闭思维导图`):f.$t(`@EDITOR:关闭预览`),onClick:a[9]||=e=>f.showMindmap?f.showMindmap=!1:f.showPreview=!1},[...a[32]||=[i(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.5`,"stroke-linecap":`round`},[i(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),i(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})],-1)]],8,Q)]),i(`div`,Rt,[u(` 思维导图:整篇 markdown → 一张大导图 `),f.showMindmap&&f.activeExt===`md`&&f.activeTabRef?(h(),r(f.MindmapPreview,{key:0,content:f.activeTabRef.content,class:`preview-mindmap`},null,8,[`content`])):f.showPreview&&f.activeExt===`md`&&f.activeTabRef?(h(),C(D,{key:1},[u(` Markdown → in-app 渲染 `),u(` :key 按文件路径切 —— 预览的滚动容器就是这个组件自己的根节点
|
|
32
|
-
(.preview-markdown[overflow:auto]),不换 key 时切 tab 走的是同类型
|
|
33
|
-
组件 → Vue 复用同一个 DOM 节点、只把内容换掉,scrollTop 不在 patch
|
|
34
|
-
范围里,会从上一个文件原样带过来(表现为"新文件预览停在上一个文件的
|
|
35
|
-
滚动位置")。key 随路径变 → 重建节点,天然回到顶部。
|
|
36
|
-
注意 key 只取 path、不取 content:同一个文件里改字时预览是实时镜像,
|
|
37
|
-
那种情况下不该把用户踢回顶部。 `),(h(),r(f.MarkdownPreview,{key:f.activeTabRef.path,content:f.activeTabRef.content,class:`preview-markdown`},null,8,[`content`]))],2112)):f.showPreview&&[`html`,`htm`,`svg`].includes(f.activeExt)?(h(),C(D,{key:2},[u(` HTML / SVG → sandboxed iframe (JS 可执行,不透明 origin 隔离宿主) `),i(`iframe`,{class:`preview-iframe`,sandbox:f.PREVIEW_IFRAME_SANDBOX,srcdoc:f.previewSrcdoc},null,8,zt)],2112)):f.showPreview&&f.IMAGE_EXTS.has(f.activeExt)&&f.activeTabRef?(h(),C(D,{key:3},[u(` 图片预览(使用增强版 ImagePreview,支持缩放/拖拽) `),d(f.ImagePreview,{"file-path":f.activeTabRef.path,"file-name":f.activeTabRef.name},null,8,[`file-path`,`file-name`])],2112)):f.showPreview&&f.activeTabIsOffice&&f.activeTabRef?(h(),r(f.OfficePreview,{key:4,"file-path":f.activeTabRef.path},null,8,[`file-path`])):u(`v-if`,!0)])],4)):u(`v-if`,!0)])])],512),u(` 右键菜单 `),(h(),r(n,{to:`body`},[f.ctxMenu?(h(),C(`div`,{key:0,ref:`ctxMenuRef`,class:`ctx-menu`,style:m({left:f.ctxMenu.x+`px`,top:f.ctxMenu.y+`px`}),onClick:a[10]||=_(()=>{},[`stop`])},[i(`button`,{class:`ctx-menu-item`,onClick:f.ctxNewFile},[a[34]||=i(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[i(`path`,{d:`M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z`}),i(`polyline`,{points:`14 2 14 8 20 8`}),i(`line`,{x1:`12`,y1:`13`,x2:`12`,y2:`19`}),i(`line`,{x1:`9`,y1:`16`,x2:`15`,y2:`16`})],-1),l(` `+x(f.$t(`@EDITOR:新建文件`)),1)]),i(`button`,{class:`ctx-menu-item`,onClick:f.ctxNewFolder},[a[35]||=i(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[i(`path`,{d:`M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z`}),i(`line`,{x1:`12`,y1:`11`,x2:`12`,y2:`17`}),i(`line`,{x1:`9`,y1:`14`,x2:`15`,y2:`14`})],-1),l(` `+x(f.$t(`@EDITOR:新建文件夹`)),1)]),a[42]||=i(`div`,{class:`ctx-menu-sep`},null,-1),i(`button`,{class:`ctx-menu-item`,onClick:f.ctxCopyAbsolutePath},[a[36]||=i(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[i(`rect`,{x:`9`,y:`9`,width:`13`,height:`13`,rx:`2`,ry:`2`}),i(`path`,{d:`M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1`})],-1),l(` `+x(f.$t(`@EDITOR:复制绝对路径`)),1)]),i(`button`,{class:`ctx-menu-item`,onClick:f.ctxCopyRelativePath},[a[37]||=i(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[i(`path`,{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`}),i(`path`,{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`})],-1),l(` `+x(f.$t(`@EDITOR:复制相对路径`)),1)]),a[43]||=i(`div`,{class:`ctx-menu-sep`},null,-1),u(` 只有 HTML 才有"用浏览器打开":浏览器能直接渲染出结果 `),f.ctxMenuCanOpenInBrowser?(h(),C(`button`,{key:0,class:`ctx-menu-item`,onClick:f.ctxOpenInBrowser},[a[38]||=i(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[i(`circle`,{cx:`12`,cy:`12`,r:`9`}),i(`line`,{x1:`3`,y1:`12`,x2:`21`,y2:`12`}),i(`path`,{d:`M12 3a13 13 0 0 1 3.5 9 13 13 0 0 1-3.5 9 13 13 0 0 1-3.5-9A13 13 0 0 1 12 3z`})],-1),l(` `+x(f.$t(`@EDITOR:在浏览器中打开`)),1)])):u(`v-if`,!0),i(`button`,{class:`ctx-menu-item`,onClick:f.ctxRevealInExplorer},[a[39]||=i(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[i(`path`,{d:`M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`}),i(`path`,{d:`M3 7v10a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2`})],-1),l(` `+x(f.$t(`@EDITOR:在资源管理器中打开`)),1)]),i(`button`,{class:`ctx-menu-item`,onClick:f.ctxOpenInVscode},[d(f.SvgIcon,{"icon-class":`vscode`,"class-name":`ctx-menu-icon`}),l(` `+x(f.$t(`@EDITOR:在 VSCode 中打开`)),1)]),i(`button`,{class:`ctx-menu-item`,onClick:f.ctxRename},[a[40]||=i(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[i(`path`,{d:`M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`}),i(`path`,{d:`M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z`})],-1),l(` `+x(f.$t(`@EDITOR:重命名`)),1)]),i(`button`,{class:`ctx-menu-item ctx-menu-item--danger`,onClick:f.ctxDelete},[a[41]||=i(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[i(`polyline`,{points:`3 6 5 6 21 6`}),i(`path`,{d:`M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6`}),i(`path`,{d:`M10 11v6`}),i(`path`,{d:`M14 11v6`}),i(`path`,{d:`M9 6V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2`})],-1),l(` `+x(f.$t(`@EDITOR:删除`)),1)])],4)):u(`v-if`,!0)]))],64)}var Bt=k(Qe,[[`render`,$],[`__scopeId`,`data-v-fc2ebf13`],[`__file`,`D:/workspace/github_workspace/zen-gitsync/src/ui/client/src/views/EditorView.vue`]]);export{Bt as default};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-CpT1sgBA.js","assets/rolldown-runtime-C0FnF6B9.js","assets/dagre-BWDqZwmv.js","assets/monaco-B2lPvkrc.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import"./rolldown-runtime-C0FnF6B9.js";import{$n as e,At as t,Bn as n,Ct as r,Dn as i,En as a,Fr as o,Gt as s,H as c,Ht as l,In as u,J as d,Jr as f,Mt as p,Nn as m,On as h,Pn as g,Q as _,Tn as v,U as y,W as b,Wt as x,Xr as S,Y as C,Yn as ee,Zn as w,a as T,an as E,br as D,cr as O,ct as te,dn as ne,ei as k,er as A,ft as re,i as j,in as ie,jt as M,kn as N,lr as P,nr as ae,nt as oe,o as se,or as F,ot as ce,pr as I,pt as le,qn as ue,s as de,tn as fe,tr as pe,vn as me,wt as he,x as ge,xn as L,z as _e}from"./element-plus-0wIX-Gk-.js";import{n as R,t as z}from"./_plugin-vue_export-helper-BUtBXJ4L.js";import{ir as ve}from"./dagre-BWDqZwmv.js";import{t as ye}from"./SvgIcon-CVenF0Ye.js";import{t as be}from"./IconButton-Chpl6IGZ.js";import{t as xe}from"./configStore-B8_uxBp2.js";import{r as Se}from"./gitStore-bZysdieB.js";import{r as Ce,t as we}from"./fileIcon-B5p5pGN9.js";import{a as Te,c as Ee,i as De,n as Oe,o as ke,r as Ae,s as je,t as Me}from"./previewSandbox-CgcL-OLc.js";import{a as B,c as Ne,i as V,o as H,s as Pe}from"./monaco-CpT1sgBA.js";import{t as Fe}from"./useThemeObserver-D0lx06N9.js";import{t as Ie}from"./CommonDialog-q8bffY57.js";n();var U=u({__name:`TreeIcon`,props:{size:{type:[String,Number],required:!1,default:`1em`}},setup(e,{expose:t}){t();let n={};return Object.defineProperty(n,"__isScriptSetup",{enumerable:!1,value:!0}),n}});n();var W=[`width`,`height`];function G(e,t,n,r,i,o){return w(),N(`svg`,{viewBox:`0 0 16 16`,xmlns:`http://www.w3.org/2000/svg`,width:n.size,height:n.size,fill:`none`,stroke:`currentColor`,"stroke-width":`1.5`,"stroke-linecap":`round`},[h(` 垂直主线 `),t[0]||=a(`line`,{x1:`3`,y1:`2`,x2:`3`,y2:`14`},null,-1),h(` 第一个分支 `),t[1]||=a(`line`,{x1:`3`,y1:`4`,x2:`6`,y2:`4`},null,-1),t[2]||=a(`rect`,{x:`2`,y:`3`,width:`8`,height:`2`,rx:`0.5`,fill:`currentColor`,stroke:`none`},null,-1),h(` 第二个分支 `),t[3]||=a(`line`,{x1:`3`,y1:`8`,x2:`6`,y2:`8`},null,-1),t[4]||=a(`rect`,{x:`4`,y:`7`,width:`8`,height:`2`,rx:`0.5`,fill:`currentColor`,stroke:`none`},null,-1),h(` 第三个分支 `),t[5]||=a(`line`,{x1:`3`,y1:`12`,x2:`6`,y2:`12`},null,-1),t[6]||=a(`rect`,{x:`6`,y:`11`,width:`8`,height:`2`,rx:`0.5`,fill:`currentColor`,stroke:`none`},null,-1)],8,W)}var Le=z(U,[[`render`,G],[`__file`,`D:/workspace/github_workspace/zen-gitsync/src/ui/client/src/components/icons/TreeIcon.vue`]]);n();var Re=u({__name:`ListIcon`,props:{size:{type:[String,Number],required:!1,default:`1em`}},setup(e,{expose:t}){t();let n={};return Object.defineProperty(n,"__isScriptSetup",{enumerable:!1,value:!0}),n}});n();var K=[`width`,`height`];function q(e,t,n,r,i,o){return w(),N(`svg`,{viewBox:`0 0 16 16`,xmlns:`http://www.w3.org/2000/svg`,width:n.size,height:n.size,fill:`currentColor`,stroke:`none`},[h(` 简洁的列表图标 - 三条横线 `),t[0]||=a(`rect`,{x:`2`,y:`3`,width:`12`,height:`2`,rx:`0.5`},null,-1),t[1]||=a(`rect`,{x:`2`,y:`7`,width:`12`,height:`2`,rx:`0.5`},null,-1),t[2]||=a(`rect`,{x:`2`,y:`11`,width:`12`,height:`2`,rx:`0.5`},null,-1)],8,K)}var ze=z(Re,[[`render`,q],[`__file`,`D:/workspace/github_workspace/zen-gitsync/src/ui/client/src/components/icons/ListIcon.vue`]]);function J(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}function Be(e){if(!e)return``;let t=e.split(`
|
|
3
|
-
`),n=!1,r=null;return t.map(e=>{let t=J(e);return e.startsWith(`diff --git`)||e.startsWith(`diff --cc`)||e.startsWith(`diff --combined`)?`<div class="diff-header">${t}</div>`:e.startsWith(`---`)?`<div class="diff-old-file">${t}</div>`:e.startsWith(`+++`)?`<div class="diff-new-file">${t}</div>`:e.startsWith(`@@`)?`<div class="diff-hunk-header">${t}</div>`:e.match(/^[+\-\s]*<{7,}\s+(HEAD|.*)/)?(n=!0,r=`current`,`<div class="diff-conflict-start">${t}</div>`):e.match(/^[+\-\s]*={7,}\s*$/)?(r=`incoming`,`<div class="diff-conflict-separator">${t}</div>`):e.match(/^[+\-\s]*>{7,}\s+.*/)?(n=!1,r=null,`<div class="diff-conflict-end">${t}</div>`):n&&r?r===`current`?`<div class="diff-conflict-current">${t}</div>`:`<div class="diff-conflict-incoming">${t}</div>`:e.startsWith(`+`)?`<div class="diff-added">${` `+t.substring(1)}</div>`:e.startsWith(`-`)?`<div class="diff-removed">${` `+t.substring(1)}</div>`:`<div class="diff-context">${t}</div>`}).join(``)}function Ve(e){if(!e)return``;let t=e.match(/^(feat|fix|docs|style|refactor|perf|test|chore|build|ci|revert)(\([^)]+\))?\s*:\s*(.+)$/s);return t?t[3].trim():e.trim()}n();var He=u({__name:`FileActionButtons`,props:{filePath:{type:String,required:!0},fileType:{type:String,required:!0},isLocked:{type:Boolean,required:!1,default:!1},isLocking:{type:Boolean,required:!1,default:!1},showLockButton:{type:Boolean,required:!1,default:!0}},emits:[`toggleLock`,`stage`,`unstage`,`revert`,`manageLockedFiles`],setup(e,{expose:t,emit:n}){t();let r=e,i=n,a=v(()=>{switch(r.fileType){case`added`:return[{type:`unstage`,tooltip:R(`@0883F:取消暂存`),buttonType:`warning`,icon:`-`,handler:()=>i(`unstage`,r.filePath)}];case`modified`:case`deleted`:return[{type:`stage`,tooltip:R(`@0883F:添加到暂存区`),buttonType:`success`,icon:`+`,handler:()=>i(`stage`,r.filePath)},{type:`revert`,tooltip:R(`@0883F:撤回修改`),buttonType:`danger`,icon:x,handler:()=>i(`revert`,r.filePath)}];case`untracked`:return[{type:`stage`,tooltip:R(`@0883F:添加到暂存区`),buttonType:`success`,icon:`+`,handler:()=>i(`stage`,r.filePath)},{type:`delete`,tooltip:R(`@0883F:删除文件`),buttonType:`danger`,icon:ce,handler:()=>i(`revert`,r.filePath)}];default:return[]}});function o(e){e.stopPropagation(),i(`toggleLock`,r.filePath)}function s(e,t){t.stopPropagation(),e()}function c(e){e.stopPropagation(),i(`manageLockedFiles`)}let l={props:r,emit:i,actionButtons:a,handleToggleLock:o,handleActionClick:s,handleManageLockedFiles:c,get $t(){return R},get Lock(){return M},get Unlock(){return fe}};return Object.defineProperty(l,"__isScriptSetup",{enumerable:!1,value:!0}),l}});n(),o();var Ue={class:`file-action-buttons`},Y={key:1,style:{"font-size":`var(--font-size-md)`,"font-weight":`bold`}};function We(t,n,r,o,s,c){let l=d,u=_e,f=b;return w(),N(`div`,Ue,[h(` 锁定/解锁按钮 `),r.showLockButton?(w(),i(f,{key:0,content:r.isLocking?o.$t(`@0883F:处理中...`):r.isLocked?o.$t(`@0883F:解锁文件`):o.$t(`@0883F:锁定文件`),placement:`top`,disabled:r.isLocking,"show-after":200},{default:O(()=>[g(u,{type:r.isLocked?`danger`:`info`,size:`small`,text:``,loading:r.isLocking,disabled:r.isLocking,onClick:o.handleToggleLock,class:`file-action-btn`},{default:O(()=>[r.isLocking?h(`v-if`,!0):(w(),i(l,{key:0,size:`16`},{default:O(()=>[(w(),i(ae(r.isLocked?o.Lock:o.Unlock)))]),_:1}))]),_:1},8,[`type`,`loading`,`disabled`])]),_:1},8,[`content`,`disabled`])):h(`v-if`,!0),h(` 管理锁定文件按钮(只在文件被锁定时显示) `),r.isLocked?(w(),i(f,{key:1,content:o.$t(`@13D1C:管理锁定文件`),placement:`top`,"show-after":200},{default:O(()=>[g(u,{type:`warning`,size:`small`,text:``,onClick:o.handleManageLockedFiles,class:`file-action-btn`},{default:O(()=>[g(l,{size:`16`},{default:O(()=>[...n[0]||=[a(`svg`,{viewBox:`0 0 1024 1024`,xmlns:`http://www.w3.org/2000/svg`},[a(`path`,{fill:`currentColor`,d:`M600.704 64a32 32 0 0 1 30.464 22.208l35.2 109.376c14.784 7.232 28.928 15.36 42.432 24.512l112.384-24.192a32 32 0 0 1 34.432 15.36L944.32 364.8a32 32 0 0 1-4.032 37.504l-77.12 85.12a357.12 357.12 0 0 1 0 49.024l77.12 85.248a32 32 0 0 1 4.032 37.504l-88.704 153.6a32 32 0 0 1-34.432 15.296L708.8 803.904c-13.44 9.088-27.648 17.28-42.368 24.512l-35.264 109.376A32 32 0 0 1 600.704 960H423.296a32 32 0 0 1-30.464-22.208L357.696 828.48a351.616 351.616 0 0 1-42.56-24.64l-112.32 24.256a32 32 0 0 1-34.432-15.36L79.68 659.2a32 32 0 0 1 4.032-37.504l77.12-85.248a357.12 357.12 0 0 1 0-48.896l-77.12-85.248A32 32 0 0 1 79.68 364.8l88.704-153.6a32 32 0 0 1 34.432-15.296L315.2 220.096c13.568-9.152 27.776-17.408 42.56-24.64l35.2-109.312A32 32 0 0 1 423.232 64H600.64zm-23.424 64H446.72l-36.352 113.088-24.512 11.968a294.113 294.113 0 0 0-34.816 20.096l-22.656 15.36-116.224-25.088-65.28 113.152 79.68 88.192-1.92 27.136a293.12 293.12 0 0 0 0 40.192l1.92 27.136-79.808 88.192 65.344 113.152 116.224-25.024 22.656 15.296a294.113 294.113 0 0 0 34.816 20.096l24.512 11.968L446.72 896h130.688l36.48-113.152 24.448-11.904a288.282 288.282 0 0 0 34.752-20.096l22.592-15.296 116.288 25.024 65.28-113.152-79.744-88.192 1.92-27.136a293.12 293.12 0 0 0 0-40.256l-1.92-27.136 79.808-88.128-65.344-113.152-116.288 24.96-22.592-15.232a287.616 287.616 0 0 0-34.752-20.096l-24.448-11.904L577.344 128zM512 320a192 192 0 1 1 0 384 192 192 0 0 1 0-384zm0 64a128 128 0 1 0 0 256 128 128 0 0 0 0-256z`})],-1)]]),_:1})]),_:1})]),_:1},8,[`content`])):h(`v-if`,!0),h(` 动态操作按钮(锁定文件也显示:锁定语义=不随提交走,不影响暂存/撤回等文件操作) `),(w(!0),N(L,null,e(o.actionButtons,e=>(w(),i(f,{key:e.type,content:e.tooltip,placement:`top`,"show-after":200},{default:O(()=>[g(u,{type:e.buttonType,size:`small`,text:``,onClick:t=>o.handleActionClick(e.handler,t),class:`file-action-btn`},{default:O(()=>[typeof e.icon==`string`?(w(),N(`span`,Y,k(e.icon),1)):(w(),i(l,{key:0,size:`16`},{default:O(()=>[(w(),i(ae(e.icon)))]),_:2},1024))]),_:2},1032,[`type`,`onClick`])]),_:2},1032,[`content`]))),128))])}var Ge=z(He,[[`render`,We],[`__scopeId`,`data-v-eb859d1f`],[`__file`,`D:/workspace/github_workspace/zen-gitsync/src/ui/client/src/components/FileActionButtons.vue`]]);function Ke(e){let t=[],n=new Map;return[...e].sort((e,t)=>e.path.localeCompare(t.path)).forEach(e=>{let r=e.path.split(`/`).filter(e=>e),i=``,a=t;r.forEach((t,o)=>{let s=o===r.length-1;i=i?`${i}/${t}`:t;let c=n.get(i);c||(c={name:t,path:i,isDirectory:!s,expanded:!0},s?(c.file=e,c.type=e.type,c.locked=e.locked):c.children=[],n.set(i,c),a.push(c)),!s&&c.children&&(a=c.children)})}),t}function X(e){e.expanded=!e.expanded}function qe(e,t){let n=new Map,r=e=>{e.forEach(e=>{e.isDirectory&&(n.set(e.path,e.expanded||!1),e.children&&r(e.children))})},i=e=>{e.forEach(e=>{if(e.isDirectory){let t=n.get(e.path);t!==void 0&&(e.expanded=t),e.children&&i(e.children)}})};r(t),i(e)}n();var Je=u({__name:`TreeNodeItem`,props:{node:{type:Object,required:!0},level:{type:Number,required:!0},selectedFile:{type:String,required:!1,default:``},showActionButtons:{type:Boolean,required:!1,default:!1},isFileLocked:{type:Function,required:!1,default:()=>!1},isLocking:{type:Function,required:!1,default:()=>!1}},emits:[`file-select`,`toggle-lock`,`stage`,`unstage`,`revert`,`node-click`],setup(e,{expose:t,emit:n}){t();let r=e,i=n;function a(e){return`${e*20+10}px`}function o(e){return Ce(e.name,e.isDirectory,!!e.expanded)}function s(e){return!e.isDirectory&&e.path===r.selectedFile}function c(){i(`node-click`,r.node)}let l={props:r,emit:i,getIndent:a,getIconInfo:o,isSelected:s,handleClick:c,get $t(){return R},get ElIcon(){return d},get ElTooltip(){return b},get Lock(){return M},FileActionButtons:Ge};return Object.defineProperty(l,"__isScriptSetup",{enumerable:!1,value:!0}),l}});n(),o();var Ye={class:`tree-node-wrapper`},Xe=[`xlink:href`],Z={class:`node-name`},Ze={key:0,class:`file-type-tag`},Qe={key:2,class:`file-actions`},$e={key:0,class:`tree-children`};function et(t,n,r,o,s,c){let l=pe(`TreeNodeItem`,!0);return w(),N(`div`,Ye,[a(`div`,{class:f([`tree-node`,{"is-directory":r.node.isDirectory,"is-file":!r.node.isDirectory,"is-selected":o.isSelected(r.node),"is-locked":r.node.locked,[`file-type-${r.node.type}`]:r.node.type}]),style:S({paddingLeft:o.getIndent(r.level)}),onClick:o.handleClick},[h(` 文件/文件夹图标 `),(w(),N(`svg`,{class:f([`node-icon mit-icon`,{"folder-icon":o.getIconInfo(r.node).key.startsWith(`folder-`)}]),"aria-hidden":`true`},[a(`use`,{"xlink:href":`#${o.getIconInfo(r.node).spriteId}`},null,8,Xe)],2)),h(` 节点名称 `),g(o.ElTooltip,{content:r.node.path,placement:`top`,disabled:r.node.name.length<=35,"show-after":200},{default:O(()=>[a(`span`,Z,k(r.node.name),1)]),_:1},8,[`content`,`disabled`]),h(` 文件类型标签 `),r.node.isDirectory?h(`v-if`,!0):(w(),N(`span`,Ze,k(r.node.type||`modified`),1)),h(` 锁定图标 `),r.node.locked?(w(),i(o.ElTooltip,{key:1,content:o.$t(`@E80AC:该文件已被锁定,提交时会被跳过`),placement:`top`,"show-after":200},{default:O(()=>[g(o.ElIcon,{class:`lock-icon`,color:`var(--color-warning)`},{default:O(()=>[g(o.Lock)]),_:1})]),_:1},8,[`content`])):h(`v-if`,!0),h(` 文件操作按钮 `),r.showActionButtons&&!r.node.isDirectory&&r.node.file?(w(),N(`div`,Qe,[g(o.FileActionButtons,{"file-path":r.node.path,"file-type":r.node.type||`modified`,"is-locked":r.isFileLocked(r.node.path),"is-locking":r.isLocking(r.node.path),onToggleLock:n[0]||=e=>o.emit(`toggle-lock`,e),onStage:n[1]||=e=>o.emit(`stage`,e),onUnstage:n[2]||=e=>o.emit(`unstage`,e),onRevert:n[3]||=e=>o.emit(`revert`,e)},null,8,[`file-path`,`file-type`,`is-locked`,`is-locking`])])):h(`v-if`,!0)],6),h(` 递归渲染子节点 `),r.node.isDirectory&&r.node.expanded&&r.node.children&&r.node.children.length>0?(w(),N(`div`,$e,[(w(!0),N(L,null,e(r.node.children,e=>(w(),i(l,{key:e.path+`-`+(e.expanded?`open`:`closed`),node:e,level:r.level+1,"selected-file":r.selectedFile,"show-action-buttons":r.showActionButtons,"is-file-locked":r.isFileLocked,"is-locking":r.isLocking,onFileSelect:n[4]||=e=>o.emit(`file-select`,e),onToggleLock:n[5]||=e=>o.emit(`toggle-lock`,e),onStage:n[6]||=e=>o.emit(`stage`,e),onUnstage:n[7]||=e=>o.emit(`unstage`,e),onRevert:n[8]||=e=>o.emit(`revert`,e),onNodeClick:n[9]||=e=>o.emit(`node-click`,e)},null,8,[`node`,`level`,`selected-file`,`show-action-buttons`,`is-file-locked`,`is-locking`]))),128))])):h(`v-if`,!0)])}var tt=z(Je,[[`render`,et],[`__scopeId`,`data-v-ed1cd59c`],[`__file`,`D:/workspace/github_workspace/zen-gitsync/src/ui/client/src/components/TreeNodeItem.vue`]]);n(),I();var nt=u({__name:`FileTreeView`,props:{treeData:{type:Array,required:!0},selectedFile:{type:String,required:!1,default:``},showActionButtons:{type:Boolean,required:!1,default:!1},isFileLocked:{type:Function,required:!1,default:()=>!1},isLocking:{type:Function,required:!1,default:()=>!1}},emits:[`file-select`,`toggle-lock`,`stage`,`unstage`,`revert`],setup(e,{expose:t,emit:n}){t();let r=n,i=D(0);function a(e){e.isDirectory?(X(e),i.value++):e.file&&r(`file-select`,e.path)}let o={emit:r,updateKey:i,handleNodeClick:a,TreeNodeItem:tt};return Object.defineProperty(o,"__isScriptSetup",{enumerable:!1,value:!0}),o}});n();var rt={class:`file-tree-view`};function it(t,n,r,a,o,s){return w(),N(`div`,rt,[(w(!0),N(L,null,e(r.treeData,e=>(w(),i(a.TreeNodeItem,{key:e.path+`-`+(e.expanded?`open`:`closed`),node:e,level:0,"selected-file":r.selectedFile,"show-action-buttons":r.showActionButtons,"is-file-locked":r.isFileLocked,"is-locking":r.isLocking,onFileSelect:n[0]||=e=>a.emit(`file-select`,e),onToggleLock:n[1]||=e=>a.emit(`toggle-lock`,e),onStage:n[2]||=e=>a.emit(`stage`,e),onUnstage:n[3]||=e=>a.emit(`unstage`,e),onRevert:n[4]||=e=>a.emit(`revert`,e),onNodeClick:a.handleNodeClick},null,8,[`node`,`selected-file`,`show-action-buttons`,`is-file-locked`,`is-locking`]))),128))])}var at=z(nt,[[`render`,it],[`__scopeId`,`data-v-0c3cfe6b`],[`__file`,`D:/workspace/github_workspace/zen-gitsync/src/ui/client/src/components/FileTreeView.vue`]]);n(),I();var ot=u({__name:`MonacoDiffViewer`,props:{original:{type:String,required:!0},modified:{type:String,required:!0},language:{type:String,required:!1,default:`plaintext`},filePath:{type:String,required:!1,default:``},theme:{type:String,required:!1,default:`auto`},readOnly:{type:Boolean,required:!1,default:!0}},setup(e,{expose:t}){t();let n=e,r=D(null),i=null,a=null,o=null,s=null,c=null;async function l(){return i||c||(c=(async()=>{let e=self;return e.MonacoEnvironment||={getWorker(e,t){return t===`json`?new Pe:t===`css`||t===`scss`||t===`less`?new H:t===`html`||t===`handlebars`||t===`razor`?new B:t===`typescript`||t===`javascript`?new V:new Ne}},i=await ve(()=>import(`./monaco-CpT1sgBA.js`).then(e=>e.t),__vite__mapDeps([0,1,2,3])),i})(),c)}function u(e){let t=(e||``).toLowerCase().match(/\.([a-z0-9]+)$/),n=t?t[1]:``;return n===`ts`||n===`tsx`?`typescript`:n===`js`||n===`jsx`||n===`cjs`||n===`mjs`?`javascript`:n===`json`?`json`:n===`html`||n===`htm`||n===`vue`?`html`:n===`css`?`css`:n===`scss`?`scss`:n===`less`?`less`:n===`md`||n===`markdown`?`markdown`:n===`yml`||n===`yaml`?`yaml`:n===`xml`?`xml`:n===`sh`?`shell`:n===`ps1`?`powershell`:n===`go`?`go`:n===`rs`?`rust`:n===`py`?`python`:n===`java`?`java`:n===`cpp`||n===`cc`||n===`cxx`||n===`hpp`||n===`h`?`cpp`:n===`cs`?`csharp`:`plaintext`}function d(){return n.language===`auto`?u(n.filePath||``):n.language||`plaintext`}function f(){return n.theme&&n.theme!==`auto`?n.theme:document.documentElement.getAttribute(`data-theme`)===`dark`?`vs-dark`:`vs`}function p(){if(!i)return;let e=f();i.editor.setTheme(e)}Fe(()=>p());function m(){if(!i)return;o?.dispose(),s?.dispose();let e=d();o=i.editor.createModel(n.original||``,e),s=i.editor.createModel(n.modified||``,e)}function h(){a&&o&&s&&a.setModel({original:o,modified:s})}function g(){o&&o.getValue()!==(n.original||``)&&o.setValue(n.original||``),s&&s.getValue()!==(n.modified||``)&&s.setValue(n.modified||``)}ee(async()=>{r.value&&(i=await l(),p(),m(),a=i.editor.createDiffEditor(r.value,{automaticLayout:!0,readOnly:n.readOnly,renderSideBySide:!0,minimap:{enabled:!1},fontSize:13,wordWrap:`on`,scrollBeyondLastLine:!1,renderWhitespace:`selection`,originalEditable:!n.readOnly}),h())}),F(()=>n.language,()=>{if(!i)return;let e=d();o&&i.editor.setModelLanguage(o,e),s&&i.editor.setModelLanguage(s,e)}),F(()=>n.filePath,()=>{if(!i||n.language!==`auto`)return;let e=d();o&&i.editor.setModelLanguage(o,e),s&&i.editor.setModelLanguage(s,e)}),F(()=>n.theme,()=>{p()}),F(()=>[n.original,n.modified],()=>{g()}),ue(()=>{a?.dispose(),a=null,o?.dispose(),s?.dispose(),o=null,s=null});let _={props:n,containerRef:r,get monaco(){return i},set monaco(e){i=e},get diffEditor(){return a},set diffEditor(e){a=e},get originalModel(){return o},set originalModel(e){o=e},get modifiedModel(){return s},set modifiedModel(e){s=e},get monacoLoaderPromise(){return c},set monacoLoaderPromise(e){c=e},ensureMonacoLoaded:l,detectLanguageFromPath:u,getResolvedLanguage:d,getResolvedTheme:f,applyTheme:p,createModels:m,setModelsToEditor:h,updateTextToModels:g};return Object.defineProperty(_,"__isScriptSetup",{enumerable:!1,value:!0}),_}});n();var st={ref:`containerRef`,class:`monaco-diff-container`};function ct(e,t,n,r,i,a){return w(),N(`div`,st,null,512)}var lt=z(ot,[[`render`,ct],[`__scopeId`,`data-v-f27f0ad0`],[`__file`,`D:/workspace/github_workspace/zen-gitsync/src/ui/client/src/components/MonacoDiffViewer.vue`]]);n(),I();var ut=u({__name:`MonacoEditor`,props:{modelValue:{type:String,required:!0},language:{type:String,required:!1,default:`plaintext`},filePath:{type:String,required:!1,default:``},theme:{type:String,required:!1,default:`auto`},readOnly:{type:Boolean,required:!1,default:!1},minHeight:{type:String,required:!1,default:`360px`},revealLine:{type:[Number,null],required:!1,default:null},highlightRange:{type:[Object,null],required:!1,default:null},dimHighlightRanges:{type:[Array,null],required:!1,default:null},highlightKind:{type:String,required:!1,default:``},gutterPlacement:{type:String,required:!1,default:`glyph`},gutterItems:{type:Array,required:!1,default:()=>[]},rightActions:{type:Array,required:!1,default:()=>[]},appliedBlocks:{type:Array,required:!1,default:()=>[]},syncGroup:{type:[String,null],required:!1,default:null},syncScrollTop:{type:[Number,null],required:!1,default:null}},emits:[`update:modelValue`,`gutter-click`,`scroll-change`],setup(e,{expose:t,emit:n}){t();let r=e,i=n,a=D(null),o=null,s=null,c=null,l=null,u=!1,d=[],f=[],p=[],m=null,h=null,g=new Map,_=null,v=null;function y(){if(!s)return;let e=r.gutterItems||[],t=r.gutterPlacement===`glyph`&&e.length>0;try{s.updateOptions({glyphMargin:t})}catch{}}function b(){if(!s||h)return;let e=s.getDomNode?.();e&&(h=document.createElement(`div`),h.className=`merge-right-actions`,e.appendChild(h))}function x(){h&&(h.innerHTML=``,g.clear())}function S(){if(!s||!o||!h)return;let e=r.rightActions||[];if(!e.length)return;let t=s.getLayoutInfo?.(),n=t?.contentLeft??0,i=t?.contentWidth??0,a=Math.max(0,n+i-44);for(let t of e){let e=g.get(t.blockId);if(!e)continue;let n=c?.getLineMaxColumn?.(t.line)??1,r=s.getScrolledVisiblePosition?.({lineNumber:t.line,column:n});if(!r){e.style.display=`none`;continue}e.style.display=``,e.style.top=`${r.top}px`,e.style.left=`${a}px`,e.style.height=`${r.height}px`}}function C(e,t){let n=(r.appliedBlocks||[]).find(t=>t.blockId===e);return n?t===`current`?n.choice===`current`||n.choice===`both`:n.choice===`incoming`||n.choice===`both`:!1}function w(e,t){let n=(r.appliedBlocks||[]).find(t=>t.blockId===e);return n?t===`current`?n.choice===`incoming`:n.choice===`current`:!1}function T(e,t,n){e.setAttribute(`role`,`button`),e.setAttribute(`tabindex`,`0`),e.setAttribute(`aria-label`,t),n&&e.setAttribute(`aria-pressed`,`true`),e.addEventListener(`keydown`,t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),e.click())})}function E(){if(!s||(b(),!h))return;let e=(r.rightActions||[]).filter(e=>e&&e.line&&e.line>0);if(!e.length){x();return}x();for(let t of e){let e=C(t.blockId,t.kind),n=w(t.blockId,t.kind),r=document.createElement(`div`);if(r.className=`merge-right-action-wrapper`,t.kind===`current`){let a=document.createElement(`div`);a.className=`merge-right-action merge-right-action-current${e?` is-applied`:``}`,a.textContent=e?`✓`:`→`,a.title=e?`已采用当前更改`:`采用当前更改`,T(a,a.title,e),a.addEventListener(`mousedown`,e=>{e.preventDefault(),e.stopPropagation()}),a.addEventListener(`click`,e=>{e.preventDefault(),e.stopPropagation(),i(`gutter-click`,t.blockId,`accept`)});let o=document.createElement(`div`);o.className=`merge-right-action merge-right-action-close${n?` is-discarded`:``}`,o.textContent=`✕`,o.title=n?`已丢弃当前更改`:`丢弃当前更改`,T(o,o.title,n),o.addEventListener(`mousedown`,e=>{e.preventDefault(),e.stopPropagation()}),o.addEventListener(`click`,e=>{e.preventDefault(),e.stopPropagation(),i(`gutter-click`,t.blockId,`discard`)}),r.appendChild(a),r.appendChild(o)}else{let a=document.createElement(`div`);a.className=`merge-right-action merge-right-action-close${n?` is-discarded`:``}`,a.textContent=`✕`,a.title=n?`已丢弃传入更改`:`丢弃传入更改`,T(a,a.title,n),a.addEventListener(`mousedown`,e=>{e.preventDefault(),e.stopPropagation()}),a.addEventListener(`click`,e=>{e.preventDefault(),e.stopPropagation(),i(`gutter-click`,t.blockId,`discard`)});let o=document.createElement(`div`);o.className=`merge-right-action merge-right-action-incoming${e?` is-applied`:``}`,o.textContent=e?`✓`:`←`,o.title=e?`已采用传入更改`:`采用传入更改`,T(o,o.title,e),o.addEventListener(`mousedown`,e=>{e.preventDefault(),e.stopPropagation()}),o.addEventListener(`click`,e=>{e.preventDefault(),e.stopPropagation(),i(`gutter-click`,t.blockId,`accept`)}),r.appendChild(a),r.appendChild(o)}h.appendChild(r),g.set(t.blockId,r)}S()}async function O(){return o||l||(l=(async()=>{let e=self;return e.MonacoEnvironment||={getWorker(e,t){return t===`json`?new Pe:t===`css`||t===`scss`||t===`less`?new H:t===`html`||t===`handlebars`||t===`razor`?new B:t===`typescript`||t===`javascript`?new V:new Ne}},o=await ve(()=>import(`./monaco-CpT1sgBA.js`).then(e=>e.t),__vite__mapDeps([0,1,2,3])),o})(),l)}function te(e){let t=(e||``).toLowerCase().match(/\.([a-z0-9]+)$/),n=t?t[1]:``;return n===`ts`||n===`tsx`?`typescript`:n===`js`||n===`jsx`||n===`cjs`||n===`mjs`?`javascript`:n===`json`?`json`:n===`html`||n===`htm`||n===`vue`?`html`:n===`css`?`css`:n===`scss`?`scss`:n===`less`?`less`:n===`md`||n===`markdown`?`markdown`:n===`yml`||n===`yaml`?`yaml`:n===`xml`?`xml`:n===`sh`?`shell`:n===`ps1`?`powershell`:n===`go`?`go`:n===`rs`?`rust`:n===`py`?`python`:n===`java`?`java`:n===`cpp`||n===`cc`||n===`cxx`||n===`hpp`||n===`h`?`cpp`:n===`cs`?`csharp`:`plaintext`}function ne(){return r.language===`auto`?te(r.filePath||``):r.language||`plaintext`}function k(){return r.theme&&r.theme!==`auto`?r.theme:document.documentElement.getAttribute(`data-theme`)===`dark`?`vs-dark`:`vs`}function A(){o&&o.editor.setTheme(k())}Fe(()=>A());function re(){if(!o)return;let e=ne();if(!c){c=o.editor.createModel(r.modelValue||``,e);return}try{o.editor.setModelLanguage(c,e)}catch{}}function j(){if(!c)return;let e=r.modelValue||``;c.getValue()!==e&&(u=!0,c.setValue(e),u=!1)}function ie(){if(!s)return;let e=r.revealLine;if(!(!e||e<=0))try{s.revealLineInCenter(e)}catch{}}function M(){if(!o||!s)return;if(!r.dimHighlightRanges||!r.dimHighlightRanges.length||!r.highlightKind)f=s.deltaDecorations(f,[]);else{let e=r.highlightKind===`current`?`merge-highlight-current-dim`:r.highlightKind===`incoming`?`merge-highlight-incoming-dim`:`merge-highlight-merged-dim`;f=s.deltaDecorations(f,r.dimHighlightRanges.filter(e=>e&&e.startLine>0&&e.endLine>0).map(t=>{let n=Math.max(1,t.startLine),r=Math.max(n,t.endLine);return{range:new o.Range(n,1,r,1),options:{isWholeLine:!0,className:e,linesDecorationsClassName:e}}}))}if(!r.highlightRange||!r.highlightKind){d=s.deltaDecorations(d,[]);return}let e=Math.max(1,r.highlightRange.startLine),t=Math.max(e,r.highlightRange.endLine),n=r.highlightKind===`current`?`merge-highlight-current`:r.highlightKind===`incoming`?`merge-highlight-incoming`:`merge-highlight-merged`;d=s.deltaDecorations(d,[{range:new o.Range(e,1,t,1),options:{isWholeLine:!0,className:n,linesDecorationsClassName:n}}])}function N(){if(!o||!s)return;let e=r.gutterItems||[];if(!e.length){p=s.deltaDecorations(p,[]),y();return}y();let t=r.gutterPlacement===`line`;p=s.deltaDecorations(p,e.filter(e=>e&&e.line&&e.line>0).map(e=>{let n=C(e.blockId,e.kind),r=e.kind===`current`?n?`merge-glyph-current is-applied`:`merge-glyph-current`:n?`merge-glyph-incoming is-applied`:`merge-glyph-incoming`;return{range:new o.Range(e.line,1,e.line,1),options:{isWholeLine:!0,...t?{linesDecorationsClassName:r}:{glyphMarginClassName:r}}}}))}ee(async()=>{a.value&&(o=await O(),A(),re(),s=o.editor.create(a.value,{automaticLayout:!0,readOnly:r.readOnly,glyphMargin:!1,minimap:{enabled:!1},fontSize:13,wordWrap:`on`,scrollBeyondLastLine:!1,renderWhitespace:`selection`,scrollbar:{verticalScrollbarSize:10,horizontalScrollbarSize:10}}),s.setModel(c),s.onDidChangeModelContent(()=>{if(u)return;let e=c?.getValue?.()??``;i(`update:modelValue`,e)}),ie(),M(),N(),E(),_=s.onDidScrollChange(e=>{S(),r.syncGroup&&e.scrollTopChanged&&i(`scroll-change`,e.scrollTop)}),v=s.onDidLayoutChange(()=>{S()}),m=s.onMouseDown(e=>{try{let t=e?.target,n=t?.position;if(!n?.lineNumber)return;let a=t?.type;if(a!==o.editor.MouseTargetType.GUTTER_GLYPH_MARGIN&&a!==o.editor.MouseTargetType.GUTTER_LINE_DECORATIONS)return;let s=n.lineNumber,c=(r.gutterItems||[]).find(e=>e.line===s);if(!c)return;i(`gutter-click`,c.blockId)}catch{}}))}),F(()=>r.modelValue,()=>{j()}),F(()=>r.revealLine,()=>{ie()}),F(()=>[r.highlightRange,r.highlightKind],()=>{M()},{deep:!0}),F(()=>r.dimHighlightRanges,()=>{M()},{deep:!0}),F(()=>r.gutterItems,()=>{N()},{deep:!0}),F(()=>r.rightActions,()=>{E()},{deep:!0}),F(()=>r.appliedBlocks,()=>{E(),N()},{deep:!0}),F(()=>r.syncScrollTop,e=>{if(e!=null&&s){let t=s.getScrollTop();Math.abs(t-e)>5&&s.setScrollTop(e)}}),F(()=>r.gutterPlacement,()=>{N()}),F(()=>[r.language,r.filePath],()=>{o&&re()}),F(()=>r.theme,()=>{A()}),F(()=>r.readOnly,e=>{s&&s.updateOptions({readOnly:e})}),ue(()=>{try{m?.dispose?.()}catch{}m=null;try{_?.dispose?.()}catch{}_=null;try{v?.dispose?.()}catch{}v=null;try{h?.remove?.()}catch{}h=null,g.clear(),s?.dispose(),s=null,f=[],c?.dispose(),c=null});let P={props:r,emit:i,containerRef:a,get monaco(){return o},set monaco(e){o=e},get editor(){return s},set editor(e){s=e},get model(){return c},set model(e){c=e},get monacoLoaderPromise(){return l},set monacoLoaderPromise(e){l=e},get suppressEmit(){return u},set suppressEmit(e){u=e},get decorationIds(){return d},set decorationIds(e){d=e},get dimDecorationIds(){return f},set dimDecorationIds(e){f=e},get gutterDecorationIds(){return p},set gutterDecorationIds(e){p=e},get mouseDownDisposable(){return m},set mouseDownDisposable(e){m=e},get rightActionsContainer(){return h},set rightActionsContainer(e){h=e},get rightActionNodes(){return g},set rightActionNodes(e){g=e},get scrollDisposable(){return _},set scrollDisposable(e){_=e},get layoutDisposable(){return v},set layoutDisposable(e){v=e},applyGutterMarginOption:y,ensureRightActionsContainer:b,clearRightActions:x,layoutRightActions:S,isBlockApplied:C,isBlockDiscarded:w,decorateAsButton:T,applyRightActions:E,ensureMonacoLoaded:O,detectLanguageFromPath:te,getResolvedLanguage:ne,getResolvedTheme:k,applyTheme:A,ensureModel:re,updateModelValueFromProps:j,applyRevealLine:ie,applyHighlight:M,applyGutterItems:N};return Object.defineProperty(P,"__isScriptSetup",{enumerable:!1,value:!0}),P}});o(),n();function dt(e,t,n,r,i,a){return w(),N(`div`,{ref:`containerRef`,class:`monaco-editor-container`,style:S(n.minHeight?{minHeight:n.minHeight}:{flex:1,minHeight:`200px`})},null,4)}var ft=z(ut,[[`render`,dt],[`__scopeId`,`data-v-aa2a1a7a`],[`__file`,`D:/workspace/github_workspace/zen-gitsync/src/ui/client/src/components/MonacoEditor.vue`]]);n(),I();var pt=u({__name:`AiDiffSummary`,props:{source:{type:String,required:!0},scope:{type:String,required:!0},commitHash:{type:String,required:!1,default:``},file:{type:String,required:!1,default:``},fileName:{type:String,required:!1,default:``},fileRevision:{type:String,required:!1,default:``},revision:{type:String,required:!1,default:``},auto:{type:Boolean,required:!1,default:!0}},setup(e,{expose:n}){n();let r=e,i=xe(),a=v(()=>Array.isArray(i.models)&&i.models.length>0),o=v(()=>(i.locale||``).startsWith(`en`)?`en`:`zh`),s=v(()=>{let e=Array.isArray(i.models)?i.models:[],t=e.find(e=>e.isDefault)||e[0];return t?`${t.id}|${t.baseURL}|${t.model}`:``}),c=D({status:`idle`,text:``,error:``}),u=D(!1),d=D(!1),f=new Map,m=null,h=null;function g(e){let t=2166136261;for(let n=0;n<e.length;n+=1)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return`${e.length}:${(t>>>0).toString(36)}`}function y(){let e=`${r.source}|${r.commitHash||``}|${r.scope}|${o.value}|${s.value}`;if(r.scope===`overall`)return`${e}|${r.source===`worktree`?g(r.revision):``}`;let t=r.source===`worktree`?g(r.fileRevision):``;return`${e}|${r.file||``}|${t}`}function b(){let e=f.get(y());c.value=e?{status:`done`,text:e,error:``}:{status:`idle`,text:``,error:``}}function x(){m?.abort(),m=null}async function S(e=!1){if(!a.value||r.scope===`file`&&!r.file||r.source===`commit`&&!r.commitHash)return;let t=y();if(!e&&f.has(t)){c.value={status:`done`,text:f.get(t)||``,error:``};return}x();let n=new AbortController;m=n,c.value={status:`loading`,text:``,error:``};let i=``,s=e=>{let t=e.trim();if(!t.startsWith(`data:`))return;let n=t.slice(5).trim();if(!n)return;let r;try{r=JSON.parse(n)}catch{return}if(r.type===`delta`)i+=r.content||``,c.value={status:`loading`,text:i,error:``};else if(r.type===`done`)c.value={status:`done`,text:i,error:``};else if(r.type===`error`){let e=r.code===`NO_MODEL`?`no-model`:r.code===`EMPTY_DIFF`?`empty`:`error`;c.value={status:e,text:``,error:r.error||R(`@DIFFAI:生成失败`)}}};try{let a={scope:r.scope,source:r.source,locale:o.value};r.scope===`file`&&(a.file=r.file),r.source===`commit`&&(a.hash=r.commitHash),e&&(a.bypassCache=!0);let l=await fetch(`/api/ai/diff-summary`,{method:`POST`,headers:{"Content-Type":`application/json`,Accept:`text/event-stream`},body:JSON.stringify(a),signal:n.signal});if(!l.ok||!l.body)throw Error(`HTTP ${l.status}`);let u=l.body.getReader(),d=new TextDecoder,p=``;for(;;){let{done:e,value:t}=await u.read();if(e)break;p+=d.decode(t,{stream:!0});let n=p.split(`
|
|
4
|
-
`);p=n.pop()||``,n.forEach(s)}p+=d.decode(),p&&s(p),c.value.status===`loading`&&(c.value={status:i?`done`:`empty`,text:i,error:``}),c.value.status===`done`&&i&&f.set(t,i)}catch(e){e?.name!==`AbortError`&&m===n&&(c.value={status:`error`,text:``,error:e?.message||R(`@DIFFAI:生成失败`)})}finally{m===n&&(m=null)}}function ee(){f.delete(y()),S(!0)}function w(){r.auto&&a.value&&(r.scope!==`file`||r.file)&&S()}function T(){h&&clearTimeout(h),h=setTimeout(w,350)}F(()=>[r.file,r.fileRevision,r.revision,r.commitHash,r.source,r.scope,a.value,o.value,s.value,r.auto],()=>{x(),b(),a.value&&T()},{immediate:!0}),ue(()=>{x(),h&&clearTimeout(h)});let O={props:r,configStore:i,hasModel:a,locale:o,modelKey:s,state:c,collapsed:u,dialogVisible:d,cache:f,get controller(){return m},set controller(e){m=e},get debounceTimer(){return h},set debounceTimer(e){h=e},fingerprint:g,cacheKey:y,restoreState:b,abort:x,generate:S,refresh:ee,triggerAuto:w,scheduleAuto:T,title:v(()=>r.scope===`file`?R(`@DIFFAI:AI 文件说明`):R(`@DIFFAI:AI 整体说明`)),context:v(()=>r.scope===`file`?r.fileName||r.file:r.source===`commit`?R(`@DIFFAI:本次提交`):R(`@DIFFAI:未提交变更`)),get ArrowDown(){return C},get ArrowUp(){return _},get FullScreen(){return he},get Loading(){return t},get Memo(){return p},get Refresh(){return l},get Warning(){return E},MarkdownPreview:De,get $t(){return R},CommonDialog:Ie};return Object.defineProperty(O,"__isScriptSetup",{enumerable:!1,value:!0}),O}});n(),o(),ne();var mt={class:`summary-head`},ht={class:`summary-heading`},gt={class:`summary-label`},_t=[`title`],vt={class:`summary-actions`},Q={class:`summary-body`},yt={key:1,class:`summary-placeholder is-loading`},bt={key:2,class:`summary-placeholder`},$={key:3,class:`summary-placeholder`},xt={key:4,class:`summary-error`},St={class:`err-msg`},Ct={key:0,class:`dialog-context`},wt={class:`dialog-body`},Tt={key:1,class:`summary-placeholder is-loading`},Et={key:2,class:`summary-placeholder`};function Dt(e,t,n,r,o,s){let c=d,l=_e;return r.hasModel?(w(),N(`section`,{key:0,class:f([`ai-diff-summary`,`is-${n.scope}`])},[a(`header`,mt,[a(`div`,ht,[g(c,{class:`ai-badge`},{default:O(()=>[g(r.Memo)]),_:1}),a(`span`,gt,k(r.title),1)]),a(`span`,{class:`summary-context`,title:r.context},k(r.context),9,_t),a(`div`,vt,[r.state.status===`loading`?(w(),i(c,{key:0,class:`spin`},{default:O(()=>[g(r.Loading)]),_:1})):h(`v-if`,!0),g(l,{text:``,size:`small`,icon:r.FullScreen,disabled:!r.state.text,title:r.$t(`@DIFFAI:弹窗查看`),onClick:t[0]||=e=>r.dialogVisible=!0},null,8,[`icon`,`disabled`,`title`]),g(l,{text:``,size:`small`,icon:r.Refresh,disabled:r.state.status===`loading`,title:r.$t(`@DIFFAI:重新生成`),onClick:r.refresh},null,8,[`icon`,`disabled`,`title`]),g(l,{text:``,size:`small`,icon:r.collapsed?r.ArrowDown:r.ArrowUp,title:r.collapsed?r.$t(`@DIFFAI:展开说明`):r.$t(`@DIFFAI:收起说明`),onClick:t[1]||=e=>r.collapsed=!r.collapsed},null,8,[`icon`,`title`])])]),P(a(`div`,Q,[r.state.text?(w(),i(r.MarkdownPreview,{key:0,content:r.state.text,"allow-html":!1},null,8,[`content`])):r.state.status===`loading`?(w(),N(`div`,yt,k(r.$t(`@DIFFAI:正在生成差异说明...`)),1)):r.state.status===`empty`?(w(),N(`div`,bt,k(n.scope===`file`?r.$t(`@DIFFAI:该文件没有可总结的变更`):r.$t(`@DIFFAI:没有可总结的变更`)),1)):r.state.status===`no-model`?(w(),N(`div`,$,k(r.state.error),1)):r.state.status===`error`?(w(),N(`div`,xt,[g(c,null,{default:O(()=>[g(r.Warning)]),_:1}),a(`span`,St,k(r.state.error),1),g(l,{text:``,size:`small`,icon:r.Refresh,onClick:r.refresh},{default:O(()=>[m(k(r.$t(`@DIFFAI:重试`)),1)]),_:1},8,[`icon`])])):h(`v-if`,!0)],512),[[me,!r.collapsed]]),h(` 弹窗:完整显示 AI 说明 `),g(r.CommonDialog,{modelValue:r.dialogVisible,"onUpdate:modelValue":t[2]||=e=>r.dialogVisible=e,title:r.title,width:`680px`,type:`flex`,"close-on-click-modal":!0,"destroy-on-close":``,"custom-class":`ai-summary-dialog`},{default:O(()=>[r.context?(w(),N(`div`,Ct,k(r.context),1)):h(`v-if`,!0),a(`div`,wt,[r.state.text?(w(),i(r.MarkdownPreview,{key:0,content:r.state.text,"allow-html":!1},null,8,[`content`])):r.state.status===`loading`?(w(),N(`div`,Tt,k(r.$t(`@DIFFAI:正在生成差异说明...`)),1)):(w(),N(`div`,Et,k(r.$t(`@DIFFAI:暂无说明内容`)),1))])]),_:1},8,[`modelValue`,`title`])],2)):h(`v-if`,!0)}var Ot=z(pt,[[`render`,Dt],[`__scopeId`,`data-v-e99f6f8f`],[`__file`,`D:/workspace/github_workspace/zen-gitsync/src/ui/client/src/components/AiDiffSummary.vue`]]);n(),I();var kt=u({__name:`DiffPreviewPanel`,props:{filePath:{type:String,required:!0},content:{type:String,required:!0},loading:{type:Boolean,required:!1,default:!1},error:{type:String,required:!1,default:``},context:{type:String,required:!1,default:`git-status`},commitHash:{type:String,required:!1,default:``},officePreviewUrl:{type:String,required:!1,default:``}},emits:[`refresh`],setup(e,{expose:t,emit:n}){t();let r=e,i=n,a=v(()=>(r.filePath||``).split(`.`).pop()?.toLowerCase()??``),o=v(()=>a.value===`md`||a.value===`markdown`),s=v(()=>a.value===`html`||a.value===`htm`||a.value===`svg`),c=v(()=>[`doc`,`docx`,`xls`,`xlsx`,`ppt`,`pptx`,`odt`,`ods`,`odp`].includes(a.value)),u=v(()=>o.value||s.value||c.value&&!!r.officePreviewUrl),f=D(!0);function p(){typeof document>`u`||(f.value=document.documentElement.getAttribute(`data-theme`)!==`light`)}let m=v(()=>{if(!s.value)return``;let e=f.value?`#0d1117`:`#ffffff`,t=f.value?`#e6edf3`:`var(--md-text-strong)`;return a.value===`svg`?`<!DOCTYPE html><html><head><meta charset="utf-8"><style>html,body{margin:0;padding:0;background:${e};color:${t};display:flex;align-items:center;justify-content:center;min-height:100vh;}svg{max-width:100%;max-height:90vh;}</style></head><body>${r.content||``}</body></html>`:Oe(r.content||``)});F(()=>r.filePath,()=>{p()},{immediate:!0}),p();let h={props:r,emit:i,ext:a,isMarkdown:o,isHtmlLike:s,isOffice:c,isPreviewable:u,isDark:f,syncTheme:p,previewSrcdoc:m,get ElIcon(){return d},get ElTooltip(){return b},get Refresh(){return l},MarkdownPreview:De,OfficePreview:Ae,get PREVIEW_IFRAME_SANDBOX(){return Me}};return Object.defineProperty(h,"__isScriptSetup",{enumerable:!1,value:!0}),h}});o(),n();var At={key:0,class:`diff-preview-panel`},jt={class:`diff-preview-header`},Mt={class:`diff-preview-title`},Nt={class:`diff-preview-ext-badge`},Pt=[`title`],Ft={class:`diff-preview-body`},It={key:0,class:`diff-preview-loading`},Lt={key:1,class:`diff-preview-error`},Rt=[`sandbox`,`srcdoc`],zt={key:1,class:`diff-preview-panel diff-preview-unsupported`},Bt={class:`diff-preview-body`},Vt={class:`diff-preview-empty`};function Ht(e,t,n,r,o,s){return r.isPreviewable?(w(),N(`div`,At,[a(`div`,jt,[a(`span`,Mt,k(e.$t(`@E80AC:文件预览`)),1),a(`span`,Nt,k(r.ext.toUpperCase()),1),t[1]||=a(`div`,{class:`diff-preview-spacer`},null,-1),g(r.ElTooltip,{content:e.$t(`@E80AC:刷新预览`),placement:`top`},{default:O(()=>[a(`button`,{class:`diff-preview-btn`,title:e.$t(`@E80AC:刷新预览`),onClick:t[0]||=e=>r.emit(`refresh`)},[g(r.ElIcon,null,{default:O(()=>[g(r.Refresh)]),_:1})],8,Pt)]),_:1},8,[`content`])]),a(`div`,Ft,[n.loading?(w(),N(`div`,It,[a(`span`,null,k(e.$t(`@E80AC:正在加载预览...`)),1)])):n.error?(w(),N(`div`,Lt,[a(`span`,null,k(n.error),1)])):r.isHtmlLike?(w(),N(`iframe`,{key:2,class:`diff-preview-iframe`,sandbox:r.PREVIEW_IFRAME_SANDBOX,srcdoc:r.previewSrcdoc},null,8,Rt)):r.isOffice&&n.officePreviewUrl?(w(),i(r.OfficePreview,{key:3,"file-path":n.filePath,source:n.context===`commit-detail`?`git`:`worktree`,rev:n.commitHash},null,8,[`file-path`,`source`,`rev`])):r.isMarkdown?(w(),i(r.MarkdownPreview,{key:4,content:r.props.content||``,class:`diff-preview-markdown`},null,8,[`content`])):h(`v-if`,!0)])])):(w(),N(`div`,zt,[a(`div`,Bt,[a(`span`,Vt,k(e.$t(`@E80AC:当前文件类型不支持预览`)),1)])]))}var Ut=z(kt,[[`render`,Ht],[`__scopeId`,`data-v-3a22f39b`],[`__file`,`D:/workspace/github_workspace/zen-gitsync/src/ui/client/src/components/DiffPreviewPanel.vue`]]);n(),I();var Wt=`merge-three-pane`,Gt=u({__name:`FileDiffViewer`,props:{files:{type:Array,required:!0},emptyText:{type:String,required:!1,default:R(`@E80AC:没有找到变更文件`)},diffContent:{type:String,required:!1,default:``},diffStats:{type:[Object,null],required:!1,default:null},selectedFile:{type:String,required:!1,default:``},isLoading:{type:Boolean,required:!1,default:!1},plainText:{type:Boolean,required:!1,default:!1},compareMode:{type:Boolean,required:!1,default:!1},compareOriginal:{type:String,required:!1,default:``},compareModified:{type:String,required:!1,default:``},height:{type:String,required:!1,default:`100%`},showFileList:{type:Boolean,required:!1,default:!0},context:{type:String,required:!1,default:`git-status`},showOpenButton:{type:Boolean,required:!1,default:!0},showActionButtons:{type:Boolean,required:!1,default:!1},showVscodeButton:{type:Boolean,required:!1,default:!0},showEditorButton:{type:Boolean,required:!1,default:!0},isFileLocked:{type:Function,required:!1,default:()=>!1},isLocking:{type:Function,required:!1,default:()=>!1},commitHash:{type:String,required:!1,default:``}},emits:[`file-select`,`open-file`,`open-with-vscode`,`open-in-editor`,`toggle-lock`,`stage`,`unstage`,`revert`],setup(e,{expose:t,emit:n}){t();let i=new Set([`md`,`markdown`,`html`,`htm`,`svg`,`doc`,`docx`,`xls`,`xlsx`,`ppt`,`pptx`,`odt`,`ods`,`odp`]),a=e,o=n,l=xe(),u=Se(),f=D(``),p=D(``),m=e=>Math.min(85,Math.max(15,e)),h=v({get:()=>l.ui.fileListViewMode,set:e=>{l.ui.fileListViewMode=e}}),g=v({get:()=>m(l.ui.fileDiffSplitPercent),set:e=>{l.ui.fileDiffSplitPercent=m(e)}}),_=D(!1),x=D(``),S=D(!1),C=D(``),w=D(``),T=0,O=v({get:()=>m(l.ui.diffPreviewSplitPercent??55),set:e=>{l.ui.diffPreviewSplitPercent=m(e)}}),ne=v(()=>{let e=A.value||``;return(e.split(`/`).pop()||e).split(`.`).pop()?.toLowerCase()??``}),k=v(()=>i.has(ne.value)),A=v(()=>a.selectedFile||f.value),M=v(()=>a.context===`commit-detail`?`commit`:a.context===`git-status`?`worktree`:``),N=v(()=>!!(M.value&&l.aiDiffSummaryEnabled)),P=v(()=>a.files.map(e=>`${e.path}\0${e.type||``}`).sort().join(`\0`)),ae=v(()=>Ee(A.value||``)),ce=v(()=>A.value?a.files.find(e=>e.path===A.value)?.type===`conflicted`:!1),I=v(()=>B.value.length>0),de=v(()=>a.files.map(e=>{let t=e.name||e.path.split(`/`).pop()||e.path;return{...e,displayName:t,dirPath:(()=>{let t=(e.path||``).split(`/`);return t.length>1?t.slice(0,-1).join(`/`):``})(),iconClass:we(t)}})),fe=v(()=>{if(!p.value.trim())return de.value;let e=p.value.toLowerCase().trim();return de.value.filter(t=>t.displayName.toLowerCase().includes(e)||t.path.toLowerCase().includes(e))}),pe=D([]);function me(){let e=Ke(fe.value);pe.value.length>0&&qe(e,pe.value),pe.value=e}F(fe,()=>{h.value===`tree`&&me()},{deep:!0}),F(h,e=>{e===`tree`&&me(),window.dispatchEvent(new CustomEvent(`file-list-view-mode-change`,{detail:{mode:e}}))});let he=v(()=>a.compareMode?!0:a.diffContent&&a.diffContent.trim()!==``),L=v(()=>{if(!A.value)return``;let e=A.value.split(`/`);return e.slice(0,-1).join(`/`)+(e.length>1?`/`:``)}),z=v(()=>{if(!A.value)return``;let e=A.value.split(`/`);return e[e.length-1]||A.value});function ve(e){f.value=e,o(`file-select`,e)}function Ce(){if(!A.value){j.warning(R(`@E80AC:请先选择一个文件`));return}o(`open-file`,A.value,a.context)}function De(){if(!A.value){j.warning(R(`@E80AC:请先选择一个文件`));return}navigator.clipboard.writeText(A.value).then(()=>{j.success(R(`@E80AC:文件路径已复制到剪贴板`))}).catch(()=>{j.error(R(`@E80AC:复制失败`))})}function Oe(){u.copyCurrentDiff()}function Ae(){if(!A.value){j.warning(R(`@E80AC:请先选择一个文件`));return}o(`open-with-vscode`,A.value,a.context)}function Me(){if(console.log(`[debug-open-in-editor] FileDiffViewer handleOpenInEditor start`),!A.value){j.warning(R(`@E80AC:请先选择一个文件`));return}console.log(`[debug-open-in-editor] FileDiffViewer emit, filePath=`,A.value,`context=`,a.context),o(`open-in-editor`,A.value,a.context)}let B=D([]),Ne=D(!0),V=D(``),H=D(!1),Pe=D(``),Fe=D(``),Ie=D(``),U=D(``),W=D(new Map),G=D(null),Re=D(null),K=D(new Map),q=D(new Map),J=D(new Map);async function Ve(e){let t=await(await fetch(`/api/file-content?file=${encodeURIComponent(e)}`)).json();if(!t.success)throw Error(t.error||R(`@E80AC:无法读取文件内容`));return String(t.content??``)}async function He(){let e=A.value;if(!e||!k.value)return;let t=++T;S.value=!0,C.value=``,w.value=``;try{if(je(e)){w.value=ke(e,{source:a.context===`commit-detail`?`git`:`worktree`,rev:a.context===`commit-detail`?a.commitHash:void 0}),S.value=!1;return}let n=null;if(n=a.context===`commit-detail`&&a.commitHash?await(await fetch(`/api/git-file-content?rev=${encodeURIComponent(a.commitHash)}&file=${encodeURIComponent(e)}`)).json():await(await fetch(`/api/file-content?file=${encodeURIComponent(e)}`)).json(),t!==T)return;if(!n||!n.success){C.value=n?.error||R(`@E80AC:无法读取文件内容`),x.value=``;return}x.value=String(n.content??``)}catch(e){if(t!==T)return;C.value=e.message||R(`@E80AC:无法读取文件内容`),x.value=``}finally{t===T&&(S.value=!1)}}function Ue(){k.value&&(_.value=!_.value,_.value&&!x.value&&!S.value&&He())}F([A,()=>a.context,()=>a.commitHash],()=>{if(x.value=``,w.value=``,C.value=``,!k.value&&_.value){_.value=!1;return}_.value&&He()});let Y=!1,We=0,X=0;function Je(e){Y=!0,We=e.clientY,X=O.value,document.addEventListener(`mousemove`,Ye),document.addEventListener(`mouseup`,Xe),e.preventDefault()}function Ye(e){if(!Y)return;let t=e.target?.closest(`.diff-panel`);if(!t)return;let n=t.getBoundingClientRect().height-34;if(n<=0)return;let r=e.clientY-We,i=X+r/n*100;O.value=m(i)}function Xe(){Y=!1,document.removeEventListener(`mousemove`,Ye),document.removeEventListener(`mouseup`,Xe)}ue(()=>{Y&&Xe()});function Z(e,t){let n=e.split(`
|
|
5
|
-
`),r=[],i=new Map,a=0,o=0;for(;a<n.length;){let e=n[a];if(e.includes(`<<<<<<<`)){o++;let e=[],s=[];for(a++;a<n.length&&!n[a].includes(`=======`);)e.push(n[a]),a++;for(a++;a<n.length&&!n[a].includes(`>>>>>>>`);)s.push(n[a]),a++;a<n.length&&n[a].includes(`>>>>>>>`)&&a++;let c=t(o),l=[];l=c===`incoming`?s:c===`both`?[...e,...s]:c===`none`?[]:e;let u=r.length+1;r.push(...l);let d=Math.max(u,r.length);i.set(o,{startLine:u,endLine:d});continue}r.push(e),a++}return{text:r.join(`
|
|
6
|
-
`),anchors:i}}let Ze=v(()=>G.value&&K.value.get(G.value)||null),Qe=v(()=>G.value&&q.value.get(G.value)||null),$e=v(()=>G.value&&J.value.get(G.value)||null),et=v(()=>{let e=G.value;return B.value.filter(t=>t.id!==e).map(e=>K.value.get(e.id)).filter(Boolean)}),tt=v(()=>{let e=G.value;return B.value.filter(t=>t.id!==e).map(e=>q.value.get(e.id)).filter(Boolean)}),nt=v(()=>{let e=G.value;return B.value.filter(t=>t.id!==e).map(e=>J.value.get(e.id)).filter(Boolean)}),rt=v(()=>Ze.value?.startLine??null),it=v(()=>Qe.value?.startLine??null),ot=v(()=>$e.value?.startLine??null),st=v(()=>B.value.map(e=>{let t=K.value.get(e.id);return t?{blockId:e.id,line:t.startLine,kind:`current`}:null}).filter(Boolean)),ct=v(()=>B.value.map(e=>{let t=q.value.get(e.id);return t?{blockId:e.id,line:t.startLine,kind:`incoming`}:null}).filter(Boolean)),ut=v(()=>{let e=[];return W.value.forEach((t,n)=>{t!==`none`&&e.push({blockId:n,choice:t})}),e});function dt(){if(!U.value)return;let{text:e,anchors:t}=Z(U.value,e=>W.value.get(e)||`current`);V.value=e,J.value=t,H.value=!0}function pt(e,t,n){let r=W.value.get(e),i=null;if(t===`current`){if(n===`discard`)switch(r){case`current`:case null:case void 0:i=`none`;break;case`incoming`:i=`incoming`;break;case`both`:i=`incoming`;break;case`none`:i=`none`}else switch(r){case`current`:i=`current`;break;case null:case void 0:i=`current`;break;case`incoming`:i=`both`;break;case`both`:i=`both`;break;case`none`:i=`current`}}else if(t===`incoming`){if(n===`discard`)switch(r){case`incoming`:i=`none`;break;case null:case void 0:i=`current`;break;case`current`:i=`current`;break;case`both`:i=`current`;break;case`none`:i=`none`}else switch(r){case`incoming`:i=`incoming`;break;case null:case void 0:i=`incoming`;break;case`current`:i=`both`;break;case`both`:i=`both`;break;case`none`:i=`incoming`}}i===null?W.value.delete(e):W.value.set(e,i),G.value=e,dt()}function mt(e){let t=[],n=e.split(`
|
|
7
|
-
`),r=0,i=0;for(;i<n.length;){let e=n[i];if(e.includes(`<<<<<<<`)){r++;let a=e.replace(/^<<<<<<< /,``).trim()||`HEAD`,o=[],s=[],c=[],l=[],u=Math.max(0,i-3);for(let e=u;e<i;e++)o.push(n[e]);let d=i+1;for(i++;i<n.length&&!n[i].includes(`=======`);)s.push(n[i]),i++;i++;let f=``;for(;i<n.length&&!n[i].includes(`>>>>>>>`);)c.push(n[i]),i++;i<n.length&&n[i].includes(`>>>>>>>`)&&(f=n[i].replace(/^>>>>>>> /,``).trim()||`incoming`,i++);let p=Math.min(n.length,i+3);for(let e=i;e<p&&e<n.length;e++)l.push(n[e]);t.push({id:r,startLine:d,currentLines:s,incomingLines:c,beforeLines:o,afterLines:l,currentLabel:a,incomingLabel:f})}else i++}return t}function ht(e){let t=[],n=e.split(`
|
|
8
|
-
`),r=`common`,i=[];for(let e=0;e<n.length;e++){let a=n[e];a.includes(`<<<<<<<`)?(i.length>0&&(t.push({type:`common`,lines:[...i]}),i=[]),r=`current`):a.includes(`=======`)?(i.length>0&&(t.push({type:`current`,lines:[...i]}),i=[]),t.push({type:`separator`,lines:[a]}),r=`incoming`):a.includes(`>>>>>>>`)?(i.length>0&&(t.push({type:`incoming`,lines:[...i]}),i=[]),r=`common`):i.push(a)}return i.length>0&&t.push({type:r,lines:[...i]}),t}async function gt(){if(A.value)try{let e=await(await fetch(`/api/file-content?file=${encodeURIComponent(A.value)}`)).json();if(!e.success||!e.content){j.error(R(`@E80AC:无法读取文件内容`));return}let t=e.content,n=ht(t),r=``;for(let e of n)if(e.type===`current`||e.type===`common`)r+=e.lines.join(`
|
|
9
|
-
`)+`
|
|
10
|
-
`;else if(e.type===`separator`||e.type===`incoming`)continue;await Q(r.trim())}catch(e){j.error(`${R(`@E80AC:解决冲突失败: `)}${e.message}`)}}async function _t(){if(A.value)try{let e=await(await fetch(`/api/file-content?file=${encodeURIComponent(A.value)}`)).json();if(!e.success||!e.content){j.error(R(`@E80AC:无法读取文件内容`));return}let t=e.content,n=ht(t),r=``;for(let e of n)if(e.type===`incoming`||e.type===`common`)r+=e.lines.join(`
|
|
11
|
-
`)+`
|
|
12
|
-
`;else if(e.type===`separator`||e.type===`current`)continue;await Q(r.trim())}catch(e){j.error(`${R(`@E80AC:解决冲突失败: `)}${e.message}`)}}async function vt(){if(A.value)try{let e=await(await fetch(`/api/file-content?file=${encodeURIComponent(A.value)}`)).json();if(!e.success||!e.content){j.error(R(`@E80AC:无法读取文件内容`));return}let t=e.content,n=ht(t),r=``;for(let e of n)(e.type===`common`||e.type===`current`||e.type===`incoming`)&&(r+=e.lines.join(`
|
|
13
|
-
`)+`
|
|
14
|
-
`);await Q(r.trim())}catch(e){j.error(`${R(`@E80AC:解决冲突失败: `)}${e.message}`)}}async function Q(e){if(A.value)try{let t=await(await fetch(`/api/resolve-conflict`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({filePath:A.value,content:e})})).json();t.success?(j.success(R(`@E80AC:冲突已解决,文件已更新`)),window.dispatchEvent(new CustomEvent(`git-status-refresh`)),setTimeout(()=>{o(`file-select`,A.value)},500)):j.error(t.error||R(`@E80AC:保存失败`))}catch(e){j.error(`${R(`@E80AC:保存失败: `)}${e.message}`)}}let yt=v(()=>{switch(a.context){case`git-status`:return R(`@E80AC:在系统默认编辑器中打开文件`);case`commit-detail`:return R(`@E80AC:打开该提交时的文件版本`);case`stash-detail`:return R(`@E80AC:打开该stash中的文件版本`);default:return R(`@E80AC:打开文件`)}});async function bt(){if(A.value&&Ne.value){if(V.value.trim().length===0){j.warning(R(`@E80AC:保存失败`));return}await Q(V.value),H.value=!1;return}}F(()=>a.selectedFile,e=>{e!==void 0&&(f.value=e)}),F([()=>a.diffContent,A,ce],async([e,t,n])=>{if(B.value=[],V.value=``,H.value=!1,Pe.value=``,Fe.value=``,Ie.value=``,U.value=``,W.value.clear(),G.value=null,K.value=new Map,q.value=new Map,J.value=new Map,n&&t)try{console.log(`[ConflictParse] Fetching content for conflicted file:`,t);let e=await Ve(t);if(e){console.log(`[ConflictParse] File content loaded, parsing blocks...`),U.value=e;let t=mt(e);console.log(`[ConflictParse] Parsed blocks:`,t.length),B.value=t,G.value=t.length>0?t[0].id:null;let n=Z(e,()=>`current`),r=Z(e,()=>`incoming`),i=Z(e,()=>`both`),a=Z(e,e=>W.value.get(e)||`current`);Pe.value=n.text,Fe.value=r.text,Ie.value=i.text,V.value=a.text,K.value=n.anchors,q.value=r.anchors,J.value=a.anchors}else console.error(`[ConflictParse] Failed to load file content`)}catch(e){console.error(`[ConflictParse] Error fetching file content:`,e)}else console.log(`[ConflictParse] File is not conflicted or no file selected`)},{immediate:!0}),F(()=>a.files,e=>{if(e.length>0&&!A.value){let t=e[0];ve(t.path)}},{immediate:!0}),ee(()=>{h.value===`tree`&&me();let e=e=>{let t=e.detail.mode;h.value!==t&&(h.value=t)};return window.addEventListener(`file-list-view-mode-change`,e),()=>{window.removeEventListener(`file-list-view-mode-change`,e)}});let $=D(null),xt=()=>{let e=$.value?.$el??$.value;if(e&&e.clientWidth)return e.clientWidth;try{return e?.getBoundingClientRect?.().width??0}catch{return 0}},St={PREVIEWABLE_EXTS:i,props:a,emit:o,configStore:l,gitStore:u,internalSelectedFile:f,searchQuery:p,clampPercent:m,viewMode:h,splitPercent:g,showPreview:_,previewContent:x,previewLoading:S,previewError:C,officePreviewUrl:w,get previewRequestToken(){return T},set previewRequestToken(e){T=e},previewTopPercent:O,currentExt:ne,isCurrentPreviewable:k,currentSelectedFile:A,aiSource:M,showAiDiffSummary:N,overallDiffRevision:P,isCurrentImage:ae,isConflictedFile:ce,hasActualConflictMarkers:I,displayFiles:de,filteredFiles:fe,treeData:pe,updateTreeData:me,hasDiffContent:he,selectedFileDir:L,selectedFileName:z,handleFileSelect:ve,handleOpenFile:Ce,handleCopyPath:De,handleCopyFullDiff:Oe,handleOpenWithVSCode:Ae,handleOpenInEditor:Me,conflictBlocks:B,useBlockMode:Ne,mergedEditorContent:V,mergedEditorDirty:H,currentVersionContent:Pe,incomingVersionContent:Fe,bothVersionContent:Ie,conflictOriginalContent:U,blockChoice:W,activeBlockId:G,syncScrollTop:Re,SYNC_GROUP:Wt,anchorsCurrent:K,anchorsIncoming:q,anchorsMerged:J,loadConflictFileContent:Ve,loadPreviewContent:He,togglePreview:Ue,get isPreviewSplitResizing(){return Y},set isPreviewSplitResizing(e){Y=e},get previewSplitStartY(){return We},set previewSplitStartY(e){We=e},get previewSplitStartPercent(){return X},set previewSplitStartPercent(e){X=e},startPreviewSplitResize:Je,onPreviewSplitResize:Ye,stopPreviewSplitResize:Xe,buildTextAndAnchors:Z,activeAnchorCurrent:Ze,activeAnchorIncoming:Qe,activeAnchorMerged:$e,dimAnchorsCurrent:et,dimAnchorsIncoming:tt,dimAnchorsMerged:nt,revealLineCurrent:rt,revealLineIncoming:it,revealLineMerged:ot,rightActionsCurrent:st,rightActionsIncoming:ct,appliedBlocks:ut,rebuildMergedFromChoices:dt,applyBlockChoice:pt,parseConflictBlocks:mt,parseConflict:ht,resolveConflictAcceptCurrent:gt,resolveConflictAcceptIncoming:_t,resolveConflictAcceptBoth:vt,saveResolvedContent:Q,openButtonTooltip:yt,saveAllBlockResolutions:bt,splitterRef:$,getSplitterWidth:xt,updateSplitFromDom:()=>{let e=$.value?.$el??$.value;if(!e)return;let t=e.querySelectorAll?.(`.el-splitter__panel`),n=xt();if(!t||t.length<1||n<=0)return;let r=t[0]?.getBoundingClientRect?.().width??0;if(r>0){let e=m(r/n*100);e!==g.value&&(g.value=e)}},panelSize:v({get(){return`${m(g.value)}%`},set(e){let t=NaN;if(typeof e==`number`){let n=e,r=xt();r>0&&!isNaN(n)&&(t=n/r*100)}else if(typeof e==`string`){if(e.endsWith(`%`))t=parseFloat(e);else if(e.endsWith(`px`)){let n=parseFloat(e),r=xt();r>0&&!isNaN(n)&&(t=n/r*100)}}isNaN(t)||(g.value=m(t))}}),get $t(){return R},get ElEmpty(){return ge},get ElScrollbar(){return c},get ElTooltip(){return b},get ElIcon(){return d},get ElSplitter(){return se},get ElInput(){return y},get ElButton(){return _e},get FolderOpened(){return r},get DocumentCopy(){return re},get CopyDocument(){return te},get Document(){return le},get Search(){return s},get Warning(){return E},get CircleCheck(){return oe},get View(){return ie},TreeIcon:Le,ListIcon:ze,IconButton:be,SvgIcon:ye,get formatDiff(){return Be},FileActionButtons:Ge,FileTreeView:at,MonacoDiffViewer:lt,MonacoEditor:ft,ImagePreview:Te,AiDiffSummary:Ot,DiffPreviewPanel:Ut};return Object.defineProperty(St,"__isScriptSetup",{enumerable:!1,value:!0}),St}});n(),o();var Kt={class:`diff-viewer-main`},qt={class:`files-panel`},Jt={class:`panel-header`},Yt={class:`header-left`},Xt={key:0,class:`file-count`},Zt={class:`view-mode-toggle`},Qt={class:`search-box`},$t={class:`files-list`},en=[`onClick`],tn={class:`file-icon mit-icon`,"aria-hidden":`true`},nn=[`xlink:href`],rn={key:0,class:`conflict-marker`,title:`冲突文件`},an={class:`file-name`},on=[`title`],sn={class:`file-directory path-badge`},cn={key:2,class:`file-actions`},ln={key:0,class:`ai-summary-float`},un={class:`diff-panel`},dn={class:`panel-header`},fn={class:`header-right`},pn={class:`selected-file`},mn={class:`path-dir`},hn={class:`path-name`},gn={key:1,class:`diff-stats-badge`},_n={class:`stats-added`},vn={class:`stats-deleted`},yn={key:2,class:`action-buttons`},bn=[`aria-pressed`],xn={key:0,class:`conflict-resolution-container`},Sn={key:0,class:`resolution-mode-switch`},Cn={key:1,class:`block-conflict-resolution`},wn={class:`merge-three-pane`},Tn={class:`pane`},En={class:`pane-header`},Dn={class:`pane-title`},On={class:`pane-body`},kn={class:`pane pane-merged`},An={class:`pane-header`},jn={class:`pane-title`},Mn={class:`pane-subhint`},Nn={class:`pane-body`},Pn={class:`pane`},Fn={class:`pane-header`},In={class:`pane-title`},Ln={class:`pane-body`},Rn={class:`save-resolution-bar`},zn={key:2,class:`global-conflict-wrapper`},Bn={class:`global-conflict-resolution`},Vn={class:`conflict-warning`},Hn={class:`conflict-buttons`},Un={class:`diff-content`},Wn=[`textContent`],Gn=[`innerHTML`],Kn={class:`conflict-resolved-container`},qn={class:`resolved-notice`},Jn={class:`notice-text`},Yn={class:`diff-content`},Xn=[`textContent`],Zn=[`innerHTML`],Qn={key:2,class:`diff-and-preview-wrapper`},$n={key:2,class:`compare-view`},er=[`textContent`],tr=[`innerHTML`],nr={class:`diff-panel full-width`},rr={class:`panel-header`},ir={class:`header-right`},ar={class:`selected-file`},or={class:`path-dir`},sr={class:`path-name`},cr={key:1,class:`action-buttons`},lr={key:0,class:`conflict-resolution-container`},ur={key:0,class:`resolution-mode-switch`},dr={key:1,class:`block-conflict-resolution`},fr={class:`merge-three-pane`},pr={class:`pane`},mr={class:`pane-header`},hr={class:`pane-title`},gr={class:`pane-body`},_r={class:`pane pane-merged`},vr={class:`pane-header`},yr={class:`pane-title`},br={class:`pane-subhint`},xr={class:`pane-body`},Sr={class:`pane`},Cr={class:`pane-header`},wr={class:`pane-title`},Tr={class:`pane-body`},Er={class:`save-resolution-bar`},Dr={key:2,class:`global-conflict-wrapper`},Or={class:`global-conflict-resolution`},kr={class:`conflict-warning`},Ar={class:`conflict-buttons`},jr={class:`diff-content`},Mr=[`textContent`],Nr=[`innerHTML`],Pr={key:1,class:`diff-and-preview-wrapper`},Fr={key:2,class:`compare-view`},Ir=[`textContent`],Lr=[`innerHTML`];function Rr(t,n,r,o,s,c){let l=de,u=T;return w(),N(`div`,{class:`file-diff-viewer`,style:S({height:r.height})},[a(`div`,Kt,[h(` 使用 Splitter 控制左右面板比例 `),r.showFileList?(w(),i(o.ElSplitter,{key:0,ref:`splitterRef`,layout:`horizontal`,onResize:o.updateSplitFromDom,onResizeEnd:o.updateSplitFromDom},{default:O(()=>[g(l,{size:o.panelSize,"onUpdate:size":n[11]||=e=>o.panelSize=e,min:`15%`,max:`85%`},{default:O(()=>[h(` 左侧:文件列表面板 `),a(`div`,qt,[a(`div`,Jt,[a(`div`,Yt,[a(`h4`,null,k(o.$t(`@E80AC:变更文件`)),1),r.files.length>0?(w(),N(`span`,Xt,`(`+k(r.files.length)+`)`,1)):h(`v-if`,!0),h(` 复制全量 Diff:从右侧头部迁移到这里,与"变更文件"标题并列,
|
|
15
|
-
语义上与"对全部变更文件的整体操作"对齐 `),r.files.length>0?(w(),i(o.ElTooltip,{key:1,content:o.$t(`@E80AC:复制全量 Diff`),placement:`top`,effect:`light`},{default:O(()=>[a(`button`,{class:`modern-btn btn-icon-24`,onClick:o.handleCopyFullDiff},[g(o.ElIcon,{class:`btn-icon`},{default:O(()=>[g(o.CopyDocument)]),_:1})])]),_:1},8,[`content`])):h(`v-if`,!0)]),a(`div`,Zt,[g(o.IconButton,{tooltip:o.$t(`@E80AC:列表视图`),size:`small`,active:o.viewMode===`list`,onClick:n[0]||=e=>o.viewMode=`list`},{default:O(()=>[g(o.ListIcon,{style:{width:`1em`,height:`1em`}})]),_:1},8,[`tooltip`,`active`]),g(o.IconButton,{tooltip:o.$t(`@E80AC:树状视图`),size:`small`,active:o.viewMode===`tree`,onClick:n[1]||=e=>o.viewMode=`tree`},{default:O(()=>[g(o.TreeIcon,{style:{width:`1em`,height:`1em`}})]),_:1},8,[`tooltip`,`active`])])]),h(` 搜索框 `),a(`div`,Qt,[g(o.ElInput,{modelValue:o.searchQuery,"onUpdate:modelValue":n[2]||=e=>o.searchQuery=e,placeholder:o.$t(`@E80AC:搜索文件名或路径...`),"prefix-icon":o.Search,clearable:``,size:`small`},null,8,[`modelValue`,`placeholder`,`prefix-icon`])]),a(`div`,$t,[g(o.ElScrollbar,{height:`100%`},{default:O(()=>[r.files.length===0?(w(),i(o.ElEmpty,{key:0,description:r.emptyText,"image-size":60},null,8,[`description`])):o.filteredFiles.length===0?(w(),i(o.ElEmpty,{key:1,description:o.$t(`@E80AC:没有找到匹配的文件`),"image-size":60},null,8,[`description`])):o.viewMode===`list`?(w(),N(L,{key:2},[h(` 列表视图 `),(w(!0),N(L,null,e(o.filteredFiles,e=>(w(),N(`div`,{key:e.path,class:f([`file-item`,{active:e.path===o.currentSelectedFile,[`file-type-${e.type}`]:e.type,"is-locked":e.locked}]),onClick:t=>o.handleFileSelect(e.path)},[(w(),N(`svg`,tn,[a(`use`,{"xlink:href":`#${e.iconClass}`},null,8,nn)])),h(` 冲突文件标记 `),e.type===`conflicted`?(w(),N(`span`,rn,`⚠`)):h(`v-if`,!0),g(o.ElTooltip,{content:e.path,placement:`top`,disabled:e.displayName.length<=35,"show-after":200},{default:O(()=>[a(`span`,an,k(e.displayName),1)]),_:2},1032,[`content`,`disabled`]),e.dirPath?(w(),N(`div`,{key:1,class:`file-path-section`,title:e.dirPath},[g(o.ElTooltip,{content:e.dirPath,placement:`top`,disabled:e.dirPath.length<=30,"show-after":200},{default:O(()=>[a(`div`,sn,k(e.dirPath),1)]),_:2},1032,[`content`,`disabled`])],8,on)):h(`v-if`,!0),h(` 文件操作按钮(悬浮在右侧,不占布局空间) `),r.showActionButtons?(w(),N(`div`,cn,[g(o.FileActionButtons,{"file-path":e.path,"file-type":e.type||`modified`,"is-locked":r.isFileLocked(e.path),"is-locking":r.isLocking(e.path),onToggleLock:n[3]||=e=>o.emit(`toggle-lock`,e),onStage:n[4]||=e=>o.emit(`stage`,e),onUnstage:n[5]||=e=>o.emit(`unstage`,e),onRevert:n[6]||=e=>o.emit(`revert`,e)},null,8,[`file-path`,`file-type`,`is-locked`,`is-locking`])])):h(`v-if`,!0)],10,en))),128))],64)):(w(),N(L,{key:3},[h(` 树状视图 `),g(o.FileTreeView,{"tree-data":o.treeData,"selected-file":o.currentSelectedFile,"show-action-buttons":r.showActionButtons,"is-file-locked":r.isFileLocked,"is-locking":r.isLocking,onFileSelect:o.handleFileSelect,onToggleLock:n[7]||=e=>o.emit(`toggle-lock`,e),onStage:n[8]||=e=>o.emit(`stage`,e),onUnstage:n[9]||=e=>o.emit(`unstage`,e),onRevert:n[10]||=e=>o.emit(`revert`,e)},null,8,[`tree-data`,`selected-file`,`show-action-buttons`,`is-file-locked`,`is-locking`])],2112))]),_:1})]),h(` AI 说明悬浮窗:固定在文件列表底部 `),o.showAiDiffSummary?(w(),N(`div`,ln,[g(o.AiDiffSummary,{class:`ai-summary-item`,source:o.aiSource||`worktree`,scope:`overall`,"commit-hash":r.commitHash,revision:o.overallDiffRevision},null,8,[`source`,`commit-hash`,`revision`]),o.currentSelectedFile?(w(),i(o.AiDiffSummary,{key:0,class:`ai-summary-item`,source:o.aiSource||`worktree`,scope:`file`,"commit-hash":r.commitHash,file:o.currentSelectedFile,"file-name":o.selectedFileName,"file-revision":r.diffContent},null,8,[`source`,`commit-hash`,`file`,`file-name`,`file-revision`])):h(`v-if`,!0)])):h(`v-if`,!0)])]),_:1},8,[`size`]),g(l,{min:`15%`,max:`85%`},{default:O(()=>[h(` 右侧:差异显示面板 `),a(`div`,un,[a(`div`,dn,[a(`h4`,null,k(o.$t(`@E80AC:文件差异`)),1),a(`div`,fn,[A(t.$slots,`header-extra`,{},void 0,!0),o.currentSelectedFile?(w(),i(o.ElTooltip,{key:0,content:o.currentSelectedFile,placement:`top`,effect:`light`,"show-after":200},{default:O(()=>[a(`span`,pn,[a(`span`,mn,k(o.selectedFileDir),1),a(`span`,hn,k(o.selectedFileName),1)])]),_:1},8,[`content`])):h(`v-if`,!0),h(` Diff统计信息 `),r.diffStats?(w(),N(`div`,gn,[a(`span`,_n,`+`+k(r.diffStats.added),1),a(`span`,vn,`-`+k(r.diffStats.deleted),1)])):h(`v-if`,!0),r.showOpenButton&&o.currentSelectedFile?(w(),N(`div`,yn,[g(o.ElTooltip,{content:o.$t(`@E80AC:复制文件路径`),placement:`top`,effect:`light`},{default:O(()=>[a(`button`,{class:`modern-btn btn-icon-24`,onClick:o.handleCopyPath},[g(o.ElIcon,{class:`btn-icon`},{default:O(()=>[g(o.DocumentCopy)]),_:1})])]),_:1},8,[`content`]),g(o.ElTooltip,{content:o.openButtonTooltip,placement:`top`,effect:`light`},{default:O(()=>[a(`button`,{class:`modern-btn btn-icon-24`,onClick:o.handleOpenFile},[g(o.ElIcon,{class:`btn-icon`},{default:O(()=>[g(o.FolderOpened)]),_:1})])]),_:1},8,[`content`]),r.showVscodeButton?(w(),i(o.ElTooltip,{key:0,content:o.$t(`@E80AC:用VSCode打开文件`),placement:`top`,effect:`light`},{default:O(()=>[a(`button`,{class:`modern-btn btn-icon-24`,onClick:o.handleOpenWithVSCode},[g(o.SvgIcon,{"icon-class":`vscode`,class:`btn-icon`})])]),_:1},8,[`content`])):h(`v-if`,!0),r.showEditorButton?(w(),i(o.ElTooltip,{key:1,content:o.$t(`@E80AC:在编辑器中打开`),placement:`top`,effect:`light`},{default:O(()=>[a(`button`,{class:`modern-btn btn-icon-24`,onClick:o.handleOpenInEditor},[g(o.ElIcon,{class:`btn-icon`},{default:O(()=>[g(o.Document)]),_:1})])]),_:1},8,[`content`])):h(`v-if`,!0),o.isCurrentPreviewable?(w(),i(o.ElTooltip,{key:2,content:o.$t(`@E80AC:预览HTML/MD文件`),placement:`top`,effect:`light`},{default:O(()=>[a(`button`,{class:f([`modern-btn btn-icon-24`,{active:o.showPreview}]),"aria-pressed":o.showPreview,onClick:o.togglePreview},[g(o.ElIcon,{class:`btn-icon`},{default:O(()=>[g(o.View)]),_:1})],10,bn)]),_:1},8,[`content`])):h(`v-if`,!0)])):h(`v-if`,!0)])]),h(` 冲突解决区域 `),o.isConflictedFile&&o.hasActualConflictMarkers?(w(),N(`div`,xn,[h(` 模式切换按钮 `),o.conflictBlocks.length>0?(w(),N(`div`,Sn,[g(o.ElButton,{type:o.useBlockMode?`primary`:`default`,size:`small`,onClick:n[12]||=e=>o.useBlockMode=!0},{default:O(()=>[m(k(o.$t(`@E80AC:逐块解决`)),1)]),_:1},8,[`type`]),g(o.ElButton,{type:o.useBlockMode?`default`:`primary`,size:`small`,onClick:n[13]||=e=>o.useBlockMode=!1},{default:O(()=>[m(k(o.$t(`@E80AC:全局解决`)),1)]),_:1},8,[`type`])])):h(`v-if`,!0),h(` 逐块冲突解决 `),o.conflictBlocks.length>0&&o.useBlockMode?(w(),N(`div`,Cn,[a(`div`,wn,[a(`div`,Tn,[a(`div`,En,[a(`div`,Dn,k(o.$t(`@E80AC:当前更改`)),1)]),n[30]||=a(`div`,{class:`pane-subhint placeholder`},null,-1),a(`div`,On,[g(o.MonacoEditor,{"model-value":o.currentVersionContent,language:`auto`,"file-path":o.currentSelectedFile,theme:`auto`,"read-only":!0,"min-height":`280px`,"reveal-line":o.revealLineCurrent,"highlight-range":o.activeAnchorCurrent,"dim-highlight-ranges":o.dimAnchorsCurrent,"highlight-kind":`current`,onGutterClick:n[14]||=(e,t)=>o.applyBlockChoice(e,`current`,t),"right-actions":o.rightActionsCurrent,"applied-blocks":o.appliedBlocks,"sync-group":o.SYNC_GROUP,"sync-scroll-top":o.syncScrollTop,onScrollChange:n[15]||=e=>o.syncScrollTop=e,"onUpdate:modelValue":()=>{}},null,8,[`model-value`,`file-path`,`reveal-line`,`highlight-range`,`dim-highlight-ranges`,`right-actions`,`applied-blocks`,`sync-scroll-top`])])]),a(`div`,kn,[a(`div`,An,[a(`div`,jn,k(o.$t(`@E80AC:合并结果`)),1)]),a(`div`,Mn,k(o.$t(`@E80AC:可直接编辑合并结果(整文件)`)),1),a(`div`,Nn,[g(o.MonacoEditor,{modelValue:o.mergedEditorContent,"onUpdate:modelValue":[n[16]||=e=>o.mergedEditorContent=e,n[18]||=()=>o.mergedEditorDirty=!0],language:`auto`,"file-path":o.currentSelectedFile,theme:`auto`,"read-only":!1,"min-height":`280px`,"reveal-line":o.revealLineMerged,"highlight-range":o.activeAnchorMerged,"dim-highlight-ranges":o.dimAnchorsMerged,"highlight-kind":`merged`,"sync-group":o.SYNC_GROUP,"sync-scroll-top":o.syncScrollTop,onScrollChange:n[17]||=e=>o.syncScrollTop=e},null,8,[`modelValue`,`file-path`,`reveal-line`,`highlight-range`,`dim-highlight-ranges`,`sync-scroll-top`])])]),a(`div`,Pn,[a(`div`,Fn,[a(`div`,In,k(o.$t(`@E80AC:传入的更改`)),1)]),n[31]||=a(`div`,{class:`pane-subhint placeholder`},null,-1),a(`div`,Ln,[g(o.MonacoEditor,{"model-value":o.incomingVersionContent,language:`auto`,"file-path":o.currentSelectedFile,theme:`auto`,"read-only":!0,"min-height":`280px`,"reveal-line":o.revealLineIncoming,"highlight-range":o.activeAnchorIncoming,"dim-highlight-ranges":o.dimAnchorsIncoming,"highlight-kind":`incoming`,"right-actions":o.rightActionsIncoming,"applied-blocks":o.appliedBlocks,"sync-group":o.SYNC_GROUP,"sync-scroll-top":o.syncScrollTop,onScrollChange:n[19]||=e=>o.syncScrollTop=e,onGutterClick:n[20]||=(e,t)=>o.applyBlockChoice(e,`incoming`,t),"onUpdate:modelValue":()=>{}},null,8,[`model-value`,`file-path`,`reveal-line`,`highlight-range`,`dim-highlight-ranges`,`right-actions`,`applied-blocks`,`sync-scroll-top`])])])]),a(`div`,Rn,[g(o.ElButton,{type:`primary`,size:`large`,onClick:o.saveAllBlockResolutions},{default:O(()=>[m(k(o.$t(`@E80AC:保存所有解决方案`)),1)]),_:1})])])):h(`v-if`,!0),h(` 全局冲突解决 `),!o.useBlockMode||o.conflictBlocks.length===0?(w(),N(`div`,zn,[a(`div`,Bn,[a(`div`,Vn,[g(o.ElIcon,{class:`warning-icon`},{default:O(()=>[g(o.Warning)]),_:1}),a(`span`,null,k(o.$t(`@E80AC:检测到冲突,请选择解决方式`)),1)]),a(`div`,Hn,[g(o.ElButton,{type:`primary`,size:`small`,onClick:o.resolveConflictAcceptCurrent},{default:O(()=>[m(k(o.$t(`@E80AC:接受当前版本`)),1)]),_:1}),g(o.ElButton,{type:`success`,size:`small`,onClick:o.resolveConflictAcceptIncoming},{default:O(()=>[m(k(o.$t(`@E80AC:接受传入版本`)),1)]),_:1}),g(o.ElButton,{type:`warning`,size:`small`,onClick:o.resolveConflictAcceptBoth},{default:O(()=>[m(k(o.$t(`@E80AC:接受两者`)),1)]),_:1})])]),P((w(),N(`div`,Un,[!o.hasDiffContent&&!r.isLoading?(w(),i(o.ElEmpty,{key:0,description:o.$t(`@E80AC:该文件没有差异内容`),"image-size":80},null,8,[`description`])):o.hasDiffContent&&r.plainText?(w(),N(`pre`,{key:1,class:`diff-text plain-text`,textContent:k(r.diffContent)},null,8,Wn)):o.hasDiffContent?(w(),N(`div`,{key:2,class:`diff-text`,innerHTML:o.formatDiff(r.diffContent)},null,8,Gn)):h(`v-if`,!0)])),[[u,r.isLoading]])])):h(`v-if`,!0)])):o.isConflictedFile&&!o.hasActualConflictMarkers?(w(),N(L,{key:1},[h(` 冲突已手动解决 `),a(`div`,Kn,[a(`div`,qn,[g(o.ElIcon,{class:`success-icon`,style:{color:`var(--color-success-dark)`,"font-size":`var(--font-size-xl)`}},{default:O(()=>[g(o.CircleCheck)]),_:1}),a(`span`,Jn,k(o.$t(`@E80AC:冲突已解决,可以添加到暂存区`)),1),g(o.ElButton,{type:`success`,size:`default`,onClick:n[21]||=e=>o.emit(`stage`,o.currentSelectedFile)},{default:O(()=>[m(k(o.$t(`@E80AC:添加到暂存区`)),1)]),_:1})]),P((w(),N(`div`,Yn,[!o.hasDiffContent&&!r.isLoading?(w(),i(o.ElEmpty,{key:0,description:o.$t(`@E80AC:该文件没有差异内容`),"image-size":80},null,8,[`description`])):o.hasDiffContent&&r.plainText?(w(),N(`pre`,{key:1,class:`diff-text plain-text`,textContent:k(r.diffContent)},null,8,Xn)):o.hasDiffContent?(w(),N(`div`,{key:2,class:`diff-text`,innerHTML:o.formatDiff(r.diffContent)},null,8,Zn)):h(`v-if`,!0)])),[[u,r.isLoading]])])],2112)):o.isConflictedFile?h(`v-if`,!0):(w(),N(`div`,Qn,[P((w(),N(`div`,{class:`diff-content diff-content-top`,style:S({flexBasis:o.showPreview?o.previewTopPercent+`%`:`100%`})},[o.isCurrentImage?(w(),i(o.ImagePreview,{key:0,"file-path":o.currentSelectedFile||``},null,8,[`file-path`])):!o.hasDiffContent&&!r.isLoading?(w(),i(o.ElEmpty,{key:1,description:o.currentSelectedFile?o.$t(`@E80AC:该文件没有差异内容`):o.$t(`@E80AC:请选择文件查看差异`),"image-size":80},null,8,[`description`])):r.compareMode&&!o.isCurrentImage?(w(),N(`div`,$n,[g(o.MonacoDiffViewer,{original:r.compareOriginal,modified:r.compareModified,language:`auto`,"file-path":o.currentSelectedFile,theme:`auto`,"read-only":!0},null,8,[`original`,`modified`,`file-path`])])):o.hasDiffContent&&r.plainText?(w(),N(`pre`,{key:3,class:`diff-text plain-text`,textContent:k(r.diffContent)},null,8,er)):o.hasDiffContent?(w(),N(`div`,{key:4,class:`diff-text`,innerHTML:o.formatDiff(r.diffContent)},null,8,tr)):h(`v-if`,!0)],4)),[[u,r.isLoading]]),h(` 预览分割条:上下拖拽调整比例 `),o.showPreview&&o.isCurrentPreviewable?(w(),N(`div`,{key:0,class:`preview-vertical-resizer`,onMousedown:o.startPreviewSplitResize},null,32)):h(`v-if`,!0),h(` 文件预览面板:HTML/MD/SVG 直接预览 `),o.showPreview&&o.isCurrentPreviewable?(w(),i(o.DiffPreviewPanel,{key:1,class:`diff-content-bottom`,style:S({flexBasis:100-o.previewTopPercent+`%`}),"file-path":o.currentSelectedFile||``,content:o.previewContent,loading:o.previewLoading,error:o.previewError,"office-preview-url":o.officePreviewUrl,context:o.props.context,"commit-hash":r.commitHash,onRefresh:o.loadPreviewContent},null,8,[`style`,`file-path`,`content`,`loading`,`error`,`office-preview-url`,`context`,`commit-hash`])):h(`v-if`,!0)]))])]),_:3})]),_:3},512)):(w(),N(L,{key:1},[h(` 当隐藏文件列表时,仅显示右侧面板 `),a(`div`,nr,[a(`div`,rr,[a(`h4`,null,k(o.$t(`@E80AC:文件差异`)),1),a(`div`,ir,[A(t.$slots,`header-extra`,{},void 0,!0),o.currentSelectedFile?(w(),i(o.ElTooltip,{key:0,content:o.currentSelectedFile,placement:`top`,effect:`light`,"show-after":200},{default:O(()=>[a(`span`,ar,[a(`span`,or,k(o.selectedFileDir),1),a(`span`,sr,k(o.selectedFileName),1)])]),_:1},8,[`content`])):h(`v-if`,!0),r.showOpenButton&&o.currentSelectedFile?(w(),N(`div`,cr,[g(o.ElTooltip,{content:o.$t(`@E80AC:复制文件路径`),placement:`top`,effect:`light`},{default:O(()=>[a(`button`,{class:`modern-btn btn-icon-24`,onClick:o.handleCopyPath},[g(o.ElIcon,{class:`btn-icon`},{default:O(()=>[g(o.DocumentCopy)]),_:1})])]),_:1},8,[`content`]),g(o.ElTooltip,{content:o.openButtonTooltip,placement:`top`,effect:`light`},{default:O(()=>[a(`button`,{class:`modern-btn btn-icon-24 btn-primary`,onClick:o.handleOpenFile},[g(o.ElIcon,{class:`btn-icon`},{default:O(()=>[g(o.FolderOpened)]),_:1})])]),_:1},8,[`content`]),r.showVscodeButton?(w(),i(o.ElTooltip,{key:0,content:o.$t(`@E80AC:用VSCode打开文件`),placement:`top`,effect:`light`},{default:O(()=>[a(`button`,{class:`modern-btn btn-icon-24 btn-success`,onClick:o.handleOpenWithVSCode},[g(o.SvgIcon,{"icon-class":`vscode`,class:`btn-icon`})])]),_:1},8,[`content`])):h(`v-if`,!0)])):h(`v-if`,!0)])]),h(` 冲突解决区域 `),o.isConflictedFile?(w(),N(`div`,lr,[h(` 模式切换按钮 `),o.conflictBlocks.length>0?(w(),N(`div`,ur,[g(o.ElButton,{type:o.useBlockMode?`primary`:`default`,size:`small`,onClick:n[22]||=e=>o.useBlockMode=!0},{default:O(()=>[m(k(o.$t(`@E80AC:逐块解决`)),1)]),_:1},8,[`type`]),g(o.ElButton,{type:o.useBlockMode?`default`:`primary`,size:`small`,onClick:n[23]||=e=>o.useBlockMode=!1},{default:O(()=>[m(k(o.$t(`@E80AC:全局解决`)),1)]),_:1},8,[`type`])])):h(`v-if`,!0),h(` 逐块冲突解决 `),o.conflictBlocks.length>0&&o.useBlockMode?(w(),N(`div`,dr,[a(`div`,fr,[a(`div`,pr,[a(`div`,mr,[a(`div`,hr,k(o.$t(`@E80AC:当前更改`)),1)]),a(`div`,gr,[g(o.MonacoEditor,{modelValue:o.currentVersionContent,"onUpdate:modelValue":[n[24]||=e=>o.currentVersionContent=e,()=>{}],language:`auto`,"file-path":o.currentSelectedFile,theme:`auto`,"read-only":!0,"min-height":`360px`,"reveal-line":o.revealLineCurrent,"highlight-range":o.activeAnchorCurrent,"dim-highlight-ranges":o.dimAnchorsCurrent,"highlight-kind":`current`,"right-actions":o.rightActionsCurrent,"applied-blocks":o.appliedBlocks,onGutterClick:n[25]||=(e,t)=>o.applyBlockChoice(e,`current`,t)},null,8,[`modelValue`,`file-path`,`reveal-line`,`highlight-range`,`dim-highlight-ranges`,`right-actions`,`applied-blocks`])])]),a(`div`,_r,[a(`div`,vr,[a(`div`,yr,k(o.$t(`@E80AC:合并结果`)),1)]),a(`div`,br,k(o.$t(`@E80AC:可直接编辑合并结果(整文件)`)),1),a(`div`,xr,[g(o.MonacoEditor,{modelValue:o.mergedEditorContent,"onUpdate:modelValue":[n[26]||=e=>o.mergedEditorContent=e,n[27]||=()=>o.mergedEditorDirty=!0],language:`auto`,"file-path":o.currentSelectedFile,theme:`auto`,"read-only":!1,"min-height":`360px`,"reveal-line":o.revealLineMerged,"highlight-range":o.activeAnchorMerged,"dim-highlight-ranges":o.dimAnchorsMerged,"highlight-kind":`merged`},null,8,[`modelValue`,`file-path`,`reveal-line`,`highlight-range`,`dim-highlight-ranges`])])]),a(`div`,Sr,[a(`div`,Cr,[a(`div`,wr,k(o.$t(`@E80AC:传入的更改`)),1)]),a(`div`,Tr,[g(o.MonacoEditor,{modelValue:o.incomingVersionContent,"onUpdate:modelValue":[n[28]||=e=>o.incomingVersionContent=e,()=>{}],language:`auto`,"file-path":o.currentSelectedFile,theme:`auto`,"read-only":!0,"min-height":`360px`,"reveal-line":o.revealLineIncoming,"highlight-range":o.activeAnchorIncoming,"dim-highlight-ranges":o.dimAnchorsIncoming,"highlight-kind":`incoming`,"right-actions":o.rightActionsIncoming,"applied-blocks":o.appliedBlocks,onGutterClick:n[29]||=(e,t)=>o.applyBlockChoice(e,`incoming`,t)},null,8,[`modelValue`,`file-path`,`reveal-line`,`highlight-range`,`dim-highlight-ranges`,`right-actions`,`applied-blocks`])])])]),a(`div`,Er,[g(o.ElButton,{type:`primary`,size:`large`,onClick:o.saveAllBlockResolutions},{default:O(()=>[m(k(o.$t(`@E80AC:保存所有解决方案`)),1)]),_:1})])])):h(`v-if`,!0),h(` 全局冲突解决 `),!o.useBlockMode||o.conflictBlocks.length===0?(w(),N(`div`,Dr,[a(`div`,Or,[a(`div`,kr,[g(o.ElIcon,{class:`warning-icon`},{default:O(()=>[g(o.Warning)]),_:1}),a(`span`,null,k(o.$t(`@E80AC:检测到冲突,请选择解决方式`)),1)]),a(`div`,Ar,[g(o.ElButton,{type:`primary`,size:`small`,onClick:o.resolveConflictAcceptCurrent},{default:O(()=>[m(k(o.$t(`@E80AC:接受当前版本`)),1)]),_:1}),g(o.ElButton,{type:`success`,size:`small`,onClick:o.resolveConflictAcceptIncoming},{default:O(()=>[m(k(o.$t(`@E80AC:接受传入版本`)),1)]),_:1}),g(o.ElButton,{type:`warning`,size:`small`,onClick:o.resolveConflictAcceptBoth},{default:O(()=>[m(k(o.$t(`@E80AC:接受两者`)),1)]),_:1})])]),P((w(),N(`div`,jr,[!o.hasDiffContent&&!r.isLoading?(w(),i(o.ElEmpty,{key:0,description:o.$t(`@E80AC:该文件没有差异内容`),"image-size":80},null,8,[`description`])):o.hasDiffContent&&r.plainText?(w(),N(`pre`,{key:1,class:`diff-text plain-text`,textContent:k(r.diffContent)},null,8,Mr)):o.hasDiffContent?(w(),N(`div`,{key:2,class:`diff-text`,innerHTML:o.formatDiff(r.diffContent)},null,8,Nr)):h(`v-if`,!0)])),[[u,r.isLoading]])])):h(`v-if`,!0)])):o.isConflictedFile?h(`v-if`,!0):(w(),N(`div`,Pr,[P((w(),N(`div`,{class:`diff-content diff-content-top`,style:S({flexBasis:o.showPreview?o.previewTopPercent+`%`:`100%`})},[o.isCurrentImage?(w(),i(o.ImagePreview,{key:0,"file-path":o.currentSelectedFile||``},null,8,[`file-path`])):!o.hasDiffContent&&!r.isLoading?(w(),i(o.ElEmpty,{key:1,description:o.currentSelectedFile?o.$t(`@E80AC:该文件没有差异内容`):o.$t(`@E80AC:请选择文件查看差异`),"image-size":80},null,8,[`description`])):r.compareMode&&!o.isCurrentImage?(w(),N(`div`,Fr,[g(o.MonacoDiffViewer,{original:r.compareOriginal,modified:r.compareModified,language:`auto`,"file-path":o.currentSelectedFile,theme:`auto`,"read-only":!0},null,8,[`original`,`modified`,`file-path`])])):o.hasDiffContent&&r.plainText?(w(),N(`pre`,{key:3,class:`diff-text plain-text`,textContent:k(r.diffContent)},null,8,Ir)):o.hasDiffContent?(w(),N(`div`,{key:4,class:`diff-text`,innerHTML:o.formatDiff(r.diffContent)},null,8,Lr)):h(`v-if`,!0)],4)),[[u,r.isLoading]]),o.showPreview&&o.isCurrentPreviewable?(w(),N(`div`,{key:0,class:`preview-vertical-resizer`,onMousedown:o.startPreviewSplitResize},null,32)):h(`v-if`,!0),o.showPreview&&o.isCurrentPreviewable?(w(),i(o.DiffPreviewPanel,{key:1,class:`diff-content-bottom`,style:S({flexBasis:100-o.previewTopPercent+`%`}),"file-path":o.currentSelectedFile||``,content:o.previewContent,loading:o.previewLoading,error:o.previewError,"office-preview-url":o.officePreviewUrl,context:o.props.context,"commit-hash":r.commitHash,onRefresh:o.loadPreviewContent},null,8,[`style`,`file-path`,`content`,`loading`,`error`,`office-preview-url`,`context`,`commit-hash`])):h(`v-if`,!0)]))])],2112))])],4)}var zr=z(Gt,[[`render`,Rr],[`__scopeId`,`data-v-8dbcc08c`],[`__file`,`D:/workspace/github_workspace/zen-gitsync/src/ui/client/src/components/FileDiffViewer.vue`]]);export{X as a,ze as c,qe as i,Le as l,tt as n,Ge as o,Ke as r,Ve as s,zr as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.file-action-buttons[data-v-eb859d1f]{justify-content:center;align-items:center;margin-left:auto;display:flex}.file-action-btn[data-v-eb859d1f]{padding:var(--spacing-sm);min-width:24px;height:24px}.tree-node-wrapper[data-v-ed1cd59c]{width:100%}.tree-node[data-v-ed1cd59c]{align-items:center;gap:var(--spacing-sm);padding:6px var(--spacing-md);cursor:pointer;transition:var(--transition-all);background:0 0;border-bottom:1px solid #ffffff1a;min-height:32px;display:flex;position:relative}.tree-node[data-v-ed1cd59c]:before{content:"";width:3px;height:100%;transition:var(--transition-all);background:0 0;position:absolute;top:0;left:0}.tree-node[data-v-ed1cd59c]:hover{background:var(--bg-panel)}.tree-node[data-v-ed1cd59c]:hover:before{background:var(--color-primary)}.tree-node.is-selected[data-v-ed1cd59c]{background:var(--action-blue-soft);color:var(--color-primary);border-left:3px solid var(--color-primary)}.tree-node.is-selected[data-v-ed1cd59c]:before{background:var(--color-primary);width:4px}.tree-node.is-selected .node-icon[data-v-ed1cd59c]{color:var(--color-primary)}[data-theme=dark] .tree-node.is-selected[data-v-ed1cd59c]{color:var(--color-primary);border-left-color:var(--color-primary);background:#1890ff26}[data-theme=dark] .tree-node.is-selected[data-v-ed1cd59c]:before{background:var(--color-primary)}[data-theme=dark] .tree-node.is-selected .node-icon[data-v-ed1cd59c]{color:var(--color-primary)}.tree-node.is-directory[data-v-ed1cd59c]{font-weight:var(--font-weight-medium)}.tree-node.is-directory[data-v-ed1cd59c]:hover{background:var(--bg-icon-hover)}.tree-node.file-type-added[data-v-ed1cd59c]:before{background:var(--git-status-added)}.tree-node.file-type-added[data-v-ed1cd59c]:not(.is-selected):hover{background:linear-gradient(90deg,#10b9811a 0%,#fffc 100%)}.tree-node.file-type-added[data-v-ed1cd59c]:not(.is-selected):hover:before{background:var(--git-status-added);width:4px}.tree-node.file-type-modified[data-v-ed1cd59c]:before{background:var(--git-status-modified)}.tree-node.file-type-modified[data-v-ed1cd59c]:not(.is-selected):hover{background:linear-gradient(90deg,#f59e0b1a 0%,#fffc 100%)}.tree-node.file-type-modified[data-v-ed1cd59c]:not(.is-selected):hover:before{background:var(--git-status-modified);width:4px}.tree-node.file-type-deleted[data-v-ed1cd59c]:before{background:var(--git-status-deleted)}.tree-node.file-type-deleted[data-v-ed1cd59c]:not(.is-selected):hover{background:linear-gradient(90deg,#ef44441a 0%,#fffc 100%)}.tree-node.file-type-deleted[data-v-ed1cd59c]:not(.is-selected):hover:before{background:var(--git-status-deleted);width:4px}.tree-node.file-type-untracked[data-v-ed1cd59c]:before{background:var(--git-status-untracked)}.tree-node.file-type-untracked[data-v-ed1cd59c]:not(.is-selected):hover{background:linear-gradient(90deg,#8b5cf61a 0%,#fffc 100%)}.tree-node.file-type-untracked[data-v-ed1cd59c]:not(.is-selected):hover:before{background:var(--git-status-untracked);width:4px}.node-icon[data-v-ed1cd59c]{font-size:var(--font-size-md);margin-right:var(--spacing-xs);flex-shrink:0;line-height:1}.node-icon.folder-icon[data-v-ed1cd59c]{color:#faad14}.mit-icon[data-v-ed1cd59c]{fill:currentColor;vertical-align:middle;width:16px;height:16px;display:inline-block}.node-name[data-v-ed1cd59c]{text-overflow:ellipsis;white-space:nowrap;font-size:var(--font-size-sm);font-weight:var(--font-weight-medium);color:var(--text-primary);transition:var(--transition-color);flex:1;min-width:40px;overflow:hidden}.is-selected .node-name[data-v-ed1cd59c]{color:var(--color-primary);font-weight:var(--font-weight-semibold)}[data-theme=dark] .is-selected .node-name[data-v-ed1cd59c]{color:var(--color-primary)}.is-directory .node-name[data-v-ed1cd59c]{font-weight:var(--font-weight-semibold)}.file-type-tag[data-v-ed1cd59c]{font-size:var(--font-size-xs);padding:var(--spacing-xs) var(--spacing-base);border-radius:var(--radius-base);background:var(--bg-panel);color:var(--text-meta);flex-shrink:0}.lock-icon[data-v-ed1cd59c]{opacity:.9;flex-shrink:0;margin-left:auto}.file-actions[data-v-ed1cd59c]{align-items:center;gap:var(--spacing-xs);border-radius:var(--radius-base);background:var(--bg-container);box-shadow:var(--shadow-sm);border:1px solid var(--border-color-light);display:none;position:absolute;top:50%;right:12px;transform:translateY(-50%)}.tree-node:hover .file-actions[data-v-ed1cd59c]{display:flex}.tree-children[data-v-ed1cd59c]{width:100%}.file-tree-view[data-v-0c3cfe6b]{width:100%;height:100%;overflow:hidden auto}.monaco-diff-container[data-v-f27f0ad0]{height:100%;min-height:320px}.monaco-editor-container[data-v-aa2a1a7a]{width:100%;height:100%}.monaco-editor-container[data-v-aa2a1a7a] .merge-highlight-current{background:#3b82f629}.monaco-editor-container[data-v-aa2a1a7a] .merge-highlight-current-dim{background:#3b82f612}.monaco-editor-container[data-v-aa2a1a7a] .merge-highlight-incoming{background:#22c55e29}.monaco-editor-container[data-v-aa2a1a7a] .merge-highlight-incoming-dim{background:#22c55e12}.monaco-editor-container[data-v-aa2a1a7a] .merge-highlight-merged{background:#f59e0b24}.monaco-editor-container[data-v-aa2a1a7a] .merge-highlight-merged-dim{background:#f59e0b0f}.monaco-editor-container[data-v-aa2a1a7a] .merge-glyph-current{cursor:pointer}.monaco-editor-container[data-v-aa2a1a7a] .merge-glyph-current:before{content:"→";text-align:center;color:#3b82f6f2;width:100%;font-weight:700;display:inline-block}.monaco-editor-container[data-v-aa2a1a7a] .merge-glyph-incoming{cursor:pointer}.monaco-editor-container[data-v-aa2a1a7a] .merge-glyph-incoming:before{content:"←";text-align:center;color:#22c55ef2;width:100%;font-weight:700;display:inline-block}.monaco-editor-container[data-v-aa2a1a7a] .merge-right-actions{pointer-events:none;z-index:5;position:absolute;inset:0}.monaco-editor-container[data-v-aa2a1a7a] .merge-right-action-wrapper{pointer-events:auto;flex-direction:row;width:44px;display:flex;position:absolute}.monaco-editor-container[data-v-aa2a1a7a] .merge-right-action{text-align:center;cursor:pointer;pointer-events:auto;-webkit-user-select:none;user-select:none;border-radius:var(--radius-base);justify-content:center;align-items:center;width:22px;font-weight:700;display:flex}.monaco-editor-container[data-v-aa2a1a7a] .merge-right-action:hover{background:#0000000f}.monaco-editor-container[data-v-aa2a1a7a] .merge-right-action-current{color:#3b82f6f2}.monaco-editor-container[data-v-aa2a1a7a] .merge-right-action-incoming{color:#22c55ef2}.monaco-editor-container[data-v-aa2a1a7a] .merge-right-action-close{color:#ef4444d9}.monaco-editor-container[data-v-aa2a1a7a] .merge-right-action-close:hover{color:#ef4444;background:#ef44441a}.monaco-editor-container[data-v-aa2a1a7a] .merge-right-action.is-applied{font-weight:700;color:#22c55e!important;background:#22c55e26!important}.monaco-editor-container[data-v-aa2a1a7a] .merge-right-action.is-discarded{font-weight:700;color:#ef4444!important;background:#ef444426!important}.monaco-editor-container[data-v-aa2a1a7a] .merge-glyph-current.is-applied:before,.monaco-editor-container[data-v-aa2a1a7a] .merge-glyph-incoming.is-applied:before{content:"✓";color:#22c55ef2}.ai-diff-summary[data-v-e99f6f8f]{border-bottom:1px solid var(--border-color);background:var(--bg-container);flex:none;overflow:hidden}.ai-diff-summary.is-overall[data-v-e99f6f8f]{border:1px solid color-mix(in srgb, var(--color-primary) 22%, transparent);background:color-mix(in srgb, var(--color-primary) 3%, var(--bg-container))}.summary-head[data-v-e99f6f8f]{align-items:center;gap:var(--spacing-sm);min-height:36px;padding:4px var(--spacing-md);background:color-mix(in srgb, var(--bg-panel) 88%, transparent);display:flex}.summary-heading[data-v-e99f6f8f],.summary-actions[data-v-e99f6f8f]{flex:none;align-items:center;display:flex}.summary-heading[data-v-e99f6f8f]{gap:6px}.summary-actions[data-v-e99f6f8f]{gap:2px;margin-left:auto}.ai-badge[data-v-e99f6f8f]{border-radius:var(--radius-base);background:color-mix(in srgb, var(--color-primary) 9%, transparent);width:20px;height:20px;color:color-mix(in srgb, var(--color-primary) 82%, var(--text-primary));font-size:var(--font-size-mid)}.summary-label[data-v-e99f6f8f]{color:var(--text-primary);font-size:var(--font-size-xs);font-weight:var(--font-weight-semibold)}.summary-context[data-v-e99f6f8f]{min-width:0;color:var(--text-meta);font-family:var(--font-mono);font-size:var(--font-size-xs);text-overflow:ellipsis;white-space:nowrap;max-width:120px;overflow:hidden}.summary-body[data-v-e99f6f8f]{min-height:40px;max-height:180px;padding:8px var(--spacing-md) 10px;color:var(--text-primary);font-size:var(--font-size-sm);overflow:auto}.summary-body[data-v-e99f6f8f] .md-preview{padding:0}.summary-body[data-v-e99f6f8f] .md-preview p:last-child,.summary-body[data-v-e99f6f8f] .md-preview ul:last-child,.summary-body[data-v-e99f6f8f] .md-preview ol:last-child{margin-bottom:0}.summary-placeholder[data-v-e99f6f8f]{color:var(--text-meta);line-height:24px}.summary-placeholder.is-loading[data-v-e99f6f8f]{color:var(--text-secondary)}.summary-error[data-v-e99f6f8f]{align-items:center;gap:var(--spacing-xs);color:var(--color-danger,var(--color-danger));display:flex}.err-msg[data-v-e99f6f8f]{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.spin[data-v-e99f6f8f]{color:var(--color-primary);animation:1s linear infinite ai-spin-e99f6f8f}@keyframes ai-spin-e99f6f8f{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.ai-summary-dialog[data-v-e99f6f8f] .el-dialog__body{padding:0}.dialog-context[data-v-e99f6f8f]{padding:8px var(--spacing-lg) 0;color:var(--text-meta);font-family:var(--font-mono);font-size:var(--font-size-sm);word-break:break-all}.dialog-body[data-v-e99f6f8f]{max-height:60vh;padding:var(--spacing-md) var(--spacing-lg) var(--spacing-lg);font-size:var(--font-size-base);line-height:var(--line-height-normal);overflow:auto}.dialog-body[data-v-e99f6f8f] .md-preview{padding:0}@media (width<=720px){.summary-context[data-v-e99f6f8f]{display:none}.summary-head[data-v-e99f6f8f]{gap:var(--spacing-xs);padding-inline:var(--spacing-sm)}.summary-body[data-v-e99f6f8f]{max-height:140px;padding-inline:var(--spacing-sm)}}.diff-preview-panel[data-v-3a22f39b]{background:var(--bg-panel);border:1px solid var(--border-color);border-radius:var(--radius-base);flex-direction:column;height:100%;display:flex;overflow:hidden}.diff-preview-header[data-v-3a22f39b]{background:var(--bg-panel);border-bottom:1px solid var(--border-color-light);flex-shrink:0;align-items:center;gap:6px;height:34px;padding:0 10px;display:flex}.diff-preview-title[data-v-3a22f39b]{font-size:var(--font-size-xs);letter-spacing:.08em;text-transform:uppercase;color:var(--text-secondary);-webkit-user-select:none;user-select:none;font-weight:700}.diff-preview-ext-badge[data-v-3a22f39b]{font-size:var(--font-size-xs);border-radius:var(--radius-base);background:var(--tint-primary-16);color:var(--color-primary);letter-spacing:.04em;padding:1px 5px;font-weight:600}.diff-preview-spacer[data-v-3a22f39b]{flex:1}.diff-preview-btn[data-v-3a22f39b]{cursor:pointer;color:var(--text-meta);border-radius:var(--radius-base);transition:color var(--transition-fast), background var(--transition-fast);font-size:var(--font-size-mid);background:0 0;border:none;align-items:center;padding:3px;display:flex}.diff-preview-btn[data-v-3a22f39b]:hover{color:var(--color-primary);background:var(--bg-hover)}.diff-preview-body[data-v-3a22f39b]{background:var(--bg-container,#fff);color:var(--text-primary,inherit);flex-direction:column;flex:1;display:flex;overflow:hidden}.diff-preview-iframe[data-v-3a22f39b]{background:0 0;border:none;flex:1;width:100%;height:100%}.diff-preview-markdown[data-v-3a22f39b]{flex:1;width:100%;height:100%;overflow:auto}.diff-preview-loading[data-v-3a22f39b],.diff-preview-error[data-v-3a22f39b]{color:var(--text-secondary);font-size:var(--font-size-mid);flex:1;justify-content:center;align-items:center;display:flex}.diff-preview-error[data-v-3a22f39b]{color:var(--color-danger,var(--color-danger))}.diff-preview-unsupported[data-v-3a22f39b]{background:0 0;border-style:dashed}.diff-preview-empty[data-v-3a22f39b]{color:var(--text-meta);font-size:var(--font-size-sm)}.file-diff-viewer[data-v-8dbcc08c]{border:1px solid var(--border-color);border-radius:var(--radius-lg);background-color:var(--bg-container);height:100%;min-height:0;box-shadow:var(--shadow-base);transition:var(--transition-all);flex-direction:column;flex:1;display:flex;overflow:hidden}.diff-viewer-main[data-v-8dbcc08c]{flex:1;width:100%;min-height:0;display:flex;overflow:hidden}.plain-text[data-v-8dbcc08c]{white-space:pre;word-break:break-word}.compare-view[data-v-8dbcc08c]{flex:1;height:100%;min-height:320px}[data-v-8dbcc08c] .el-splitter{width:100%;height:100%}[data-v-8dbcc08c] .el-splitter__panel{flex:none;overflow:hidden}[data-v-8dbcc08c] .el-splitter__panel:first-child{min-width:250px}[data-v-8dbcc08c] .el-splitter__panel:last-child{min-width:360px}.files-panel[data-v-8dbcc08c]{background:var(--bg-icon);flex-direction:column;width:100%;height:100%;display:flex}.ai-summary-float[data-v-8dbcc08c]{border-top:1px solid var(--border-color);background:var(--bg-container);flex-direction:column;flex:none;min-height:0;max-height:45%;display:flex;overflow:hidden}.ai-summary-item[data-v-8dbcc08c]{flex:none;min-height:0}.ai-summary-item+.ai-summary-item[data-v-8dbcc08c]{border-top:1px solid var(--border-color-light)}.diff-panel[data-v-8dbcc08c]{background:var(--bg-container);flex-direction:column;flex:1;min-width:0;height:100%;display:flex}.diff-panel.full-width[data-v-8dbcc08c]{width:100%}.diff-panel.is-locked .lock-icon[data-v-8dbcc08c]{opacity:1}.panel-header[data-v-8dbcc08c]{padding:var(--spacing-md) var(--spacing-lg);background:var(--bg-container);box-shadow:var(--shadow-sm);justify-content:space-between;align-items:center;display:flex}.panel-header h4[data-v-8dbcc08c]{font-size:var(--font-size-md);font-weight:var(--font-weight-semibold);margin:0}.header-left[data-v-8dbcc08c]{align-items:center;gap:var(--spacing-sm);display:flex}.view-mode-toggle[data-v-8dbcc08c]{gap:var(--spacing-xs);padding:var(--spacing-xs);background:var(--bg-panel);border-radius:var(--radius-base);border:1px solid var(--border-card);display:flex}.header-right[data-v-8dbcc08c]{align-items:center;gap:var(--spacing-sm);display:flex}.action-buttons[data-v-8dbcc08c]{align-items:center;gap:var(--spacing-xs);display:flex}.file-count[data-v-8dbcc08c]{font-size:var(--font-size-xs);color:var(--text-secondary);font-weight:var(--font-weight-medium);background:var(--bg-panel);padding:var(--spacing-xs) var(--spacing-sm);border-radius:var(--radius-full);border:1px solid var(--border-card)}.search-box[data-v-8dbcc08c]{padding:var(--spacing-sm) 0;background:var(--bg-container)}.search-box[data-v-8dbcc08c] .el-input .el-input__wrapper{background:var(--bg-input);border:1px solid var(--border-input);border-radius:var(--radius-base);transition:var(--transition-all)}.search-box[data-v-8dbcc08c] .el-input .el-input__wrapper:hover{background:var(--bg-input-hover);border-color:var(--color-primary)}.search-box[data-v-8dbcc08c] .el-input .el-input__wrapper.is-focus{background:var(--bg-input);border-color:var(--color-primary);box-shadow:0 0 0 2px var(--tint-primary-10)}.search-box[data-v-8dbcc08c] .el-input .el-input__inner{color:var(--text-primary)}.search-box[data-v-8dbcc08c] .el-input .el-input__inner::placeholder{color:var(--text-meta)}.search-box[data-v-8dbcc08c] .el-input .el-input__prefix,.search-box[data-v-8dbcc08c] .el-input .el-input__suffix .el-input__clear{color:var(--text-secondary)}.search-box[data-v-8dbcc08c] .el-input .el-input__suffix .el-input__clear:hover{color:var(--color-primary)}.selected-file[data-v-8dbcc08c]{font-size:var(--font-size-sm);color:var(--text-secondary);text-overflow:ellipsis;white-space:nowrap;background:var(--bg-icon);max-width:360px;padding:var(--spacing-xs) var(--spacing-sm);border-radius:var(--radius-base);align-items:center;gap:var(--spacing-xs);font-family:var(--font-mono);border:1px solid #d9d9d9;display:inline-flex;overflow:hidden}.path-dir[data-v-8dbcc08c]{color:var(--text-meta)}.path-name[data-v-8dbcc08c]{font-weight:var(--font-weight-semibold)}.diff-stats-badge[data-v-8dbcc08c]{align-items:center;gap:var(--spacing-xs);padding:var(--spacing-xs) var(--spacing-base);border-radius:var(--radius-base);background:var(--bg-container);border:1px solid var(--border-color);font-size:var(--font-size-sm);font-family:var(--font-mono);font-weight:500;display:inline-flex}.stats-added[data-v-8dbcc08c]{color:#52c41a}.stats-deleted[data-v-8dbcc08c]{color:#ff4d4f}.files-list[data-v-8dbcc08c]{background:var(--bg-container);flex:1;min-height:0;overflow:hidden}.file-item[data-v-8dbcc08c]{align-items:center;gap:var(--spacing-sm);width:100%;padding:var(--spacing-base) var(--spacing-md);cursor:pointer;transition:var(--transition-all);background:0 0;border-bottom:1px solid #ffffff1a;display:flex;position:relative}.file-item .conflict-marker[data-v-8dbcc08c]{color:var(--git-status-conflicted);font-size:var(--font-size-md);margin-left:-4px;margin-right:var(--spacing-xs);animation:2s ease-in-out infinite pulse-8dbcc08c}.file-item[data-v-8dbcc08c]:before{content:"";width:3px;height:100%;transition:var(--transition-all);background:0 0;position:absolute;top:0;left:0}.file-item[data-v-8dbcc08c]:hover{background:var(--bg-panel)}.file-item[data-v-8dbcc08c]:hover:before{background:var(--color-primary)}.file-item.file-type-added[data-v-8dbcc08c]:before{background:var(--git-status-added)}.file-item.file-type-added[data-v-8dbcc08c]:not(.active):hover,.file-item.file-type-added.active[data-v-8dbcc08c]{background:linear-gradient(90deg,#10b9811a 0%,#fffc 100%)}.file-item.file-type-added[data-v-8dbcc08c]:not(.active):hover:before,.file-item.file-type-added.active[data-v-8dbcc08c]:before{background:var(--git-status-added);width:4px}.file-item.file-type-modified[data-v-8dbcc08c]:before{background:var(--git-status-modified)}.file-item.file-type-modified[data-v-8dbcc08c]:not(.active):hover,.file-item.file-type-modified.active[data-v-8dbcc08c]{background:linear-gradient(90deg,#f59e0b1a 0%,#fffc 100%)}.file-item.file-type-modified[data-v-8dbcc08c]:not(.active):hover:before,.file-item.file-type-modified.active[data-v-8dbcc08c]:before{background:var(--git-status-modified);width:4px}.file-item.file-type-deleted[data-v-8dbcc08c]:before{background:var(--git-status-deleted)}.file-item.file-type-deleted[data-v-8dbcc08c]:not(.active):hover,.file-item.file-type-deleted.active[data-v-8dbcc08c]{background:linear-gradient(90deg,#ef44441a 0%,#fffc 100%)}.file-item.file-type-deleted[data-v-8dbcc08c]:not(.active):hover:before,.file-item.file-type-deleted.active[data-v-8dbcc08c]:before{background:var(--git-status-deleted);width:4px}.file-item.file-type-untracked[data-v-8dbcc08c]:before{background:var(--git-status-untracked)}.file-item.file-type-untracked[data-v-8dbcc08c]:not(.active):hover,.file-item.file-type-untracked.active[data-v-8dbcc08c]{background:linear-gradient(90deg,#8b5cf61a 0%,#fffc 100%)}.file-item.file-type-untracked[data-v-8dbcc08c]:not(.active):hover:before,.file-item.file-type-untracked.active[data-v-8dbcc08c]:before{background:var(--git-status-untracked);width:4px}.file-item.file-type-conflicted[data-v-8dbcc08c]{background-color:#f9731614!important}.file-item.file-type-conflicted .file-icon[data-v-8dbcc08c]{color:var(--git-status-conflicted)}.file-item.file-type-conflicted[data-v-8dbcc08c]:not(.active):hover,.file-item.file-type-conflicted.active[data-v-8dbcc08c]{border-left-color:var(--git-status-conflicted);box-shadow:0 0 0 1px #f9731633;background:linear-gradient(90deg,#f9731626 0%,#f9731614 100%)!important}.file-item.file-type-conflicted[data-v-8dbcc08c]:not(.active):hover:before,.file-item.file-type-conflicted.active[data-v-8dbcc08c]:before{background:var(--git-status-conflicted)}.file-item.is-locked[data-v-8dbcc08c]{opacity:.5}.file-item.is-locked[data-v-8dbcc08c]:hover{opacity:.65}.file-icon[data-v-8dbcc08c]{margin-right:var(--spacing-base);font-size:var(--font-size-md);flex-shrink:0;line-height:1;display:inline-block}.file-icon.mit-icon[data-v-8dbcc08c]{fill:currentColor;vertical-align:middle;width:16px;height:16px}.file-name[data-v-8dbcc08c]{text-overflow:ellipsis;white-space:nowrap;font-size:var(--font-size-sm);font-weight:var(--font-weight-medium);color:var(--text-primary);transition:var(--transition-color);min-width:40px;overflow:hidden}.active .file-name[data-v-8dbcc08c]{color:var(--color-primary);font-weight:var(--font-weight-semibold)}.file-path-section[data-v-8dbcc08c]{min-width:0;overflow:hidden}.file-path-section[data-v-8dbcc08c] .el-tooltip__trigger{width:100%;display:block;overflow:hidden}.path-badge[data-v-8dbcc08c]{text-overflow:ellipsis;white-space:nowrap;font-size:var(--font-size-xs);color:var(--text-meta);background:var(--bg-file-path);padding:1px var(--spacing-sm);border-radius:var(--radius-base);margin-left:var(--spacing-sm);box-sizing:border-box;overflow:hidden}.file-item:hover .path-badge[data-v-8dbcc08c]{background:var(--bg-file-path-hover);color:var(--color-file-path-hover)}.file-actions[data-v-8dbcc08c]{align-items:center;gap:var(--spacing-xs);border-radius:var(--radius-base);background:var(--bg-container);box-shadow:var(--shadow-sm);border:1px solid var(--border-color-light);display:none;position:absolute;top:50%;right:12px;transform:translateY(-50%)}.file-item:hover .file-actions[data-v-8dbcc08c]{display:flex}.conflict-resolution-container[data-v-8dbcc08c],.conflict-resolved-container[data-v-8dbcc08c]{background:var(--bg-container);flex-direction:column;flex:1;display:flex;overflow:hidden}.conflict-resolved-container .resolved-notice[data-v-8dbcc08c]{padding:var(--spacing-lg) var(--spacing-xl);border-bottom:2px solid var(--color-success);align-items:center;gap:var(--spacing-md);background:linear-gradient(135deg,#67c23a1a 0%,#67c23a0d 100%);display:flex}.conflict-resolved-container .resolved-notice .success-icon[data-v-8dbcc08c]{flex-shrink:0}.conflict-resolved-container .resolved-notice .notice-text[data-v-8dbcc08c]{color:var(--text-primary);flex:1;font-weight:500}.conflict-resolved-container .resolved-notice .el-button[data-v-8dbcc08c]{flex-shrink:0}.conflict-resolved-container .diff-content[data-v-8dbcc08c]{flex:1;overflow-y:auto}.resolution-mode-switch[data-v-8dbcc08c]{padding:var(--spacing-sm) var(--spacing-lg);background:var(--bg-container);gap:var(--spacing-base);flex-shrink:0;justify-content:center;display:flex}.resolution-mode-switch .el-button[data-v-8dbcc08c]{min-width:100px}.block-conflict-resolution[data-v-8dbcc08c]{gap:var(--spacing-sm);flex-direction:column;flex:1;min-height:0;display:flex}.merge-three-pane[data-v-8dbcc08c]{gap:var(--spacing-sm);flex:1;grid-template-columns:1fr 1.2fr 1fr;min-height:0;display:grid;overflow:hidden}.pane[data-v-8dbcc08c]{border:1px solid var(--border-component);border-radius:var(--radius-lg);background:var(--bg-container);flex-direction:column;min-width:0;max-height:100%;display:flex;overflow:hidden}.pane-header[data-v-8dbcc08c]{justify-content:space-between;align-items:center;gap:var(--spacing-sm);padding:var(--spacing-sm) var(--spacing-md);background:var(--bg-panel);flex-shrink:0;display:flex}.pane-subhint[data-v-8dbcc08c]{padding:var(--spacing-xs) var(--spacing-md);font-size:var(--font-size-xs);color:var(--text-secondary);background:var(--bg-container);box-sizing:border-box;flex-shrink:0;height:20px;line-height:20px}.pane-subhint.placeholder[data-v-8dbcc08c]{visibility:hidden}.pane-title[data-v-8dbcc08c]{color:var(--text-title);font-weight:600}.pane-hint[data-v-8dbcc08c]{font-size:var(--font-size-sm);color:var(--text-secondary)}.pane-body[data-v-8dbcc08c]{padding:var(--spacing-sm);background:var(--bg-container);flex-direction:column;flex:1;min-height:0;display:flex;overflow:hidden}.save-resolution-bar[data-v-8dbcc08c]{padding:var(--spacing-sm) var(--spacing-lg);background:var(--bg-container);flex-shrink:0;justify-content:center;display:flex;box-shadow:0 -2px 8px #0000000d}.save-resolution-bar .el-button[data-v-8dbcc08c]{min-width:160px}.global-conflict-wrapper[data-v-8dbcc08c]{flex-direction:column;flex:1;display:flex;overflow:hidden}.global-conflict-resolution[data-v-8dbcc08c]{padding:var(--spacing-md) var(--spacing-lg);border:1px solid color-mix(in srgb, var(--git-status-conflicted) 30%, transparent);justify-content:space-between;align-items:center;gap:var(--spacing-lg);background:#f973161a;flex-wrap:wrap;flex-shrink:0;display:flex}.conflict-warning[data-v-8dbcc08c]{align-items:center;gap:var(--spacing-base);color:var(--git-status-conflicted);font-weight:var(--font-weight-medium);flex:1;min-width:200px;display:flex}.warning-icon[data-v-8dbcc08c]{font-size:var(--font-size-lg);color:var(--git-status-conflicted)}.conflict-buttons[data-v-8dbcc08c]{gap:var(--spacing-base);flex-wrap:wrap;display:flex}.diff-content[data-v-8dbcc08c]{padding:var(--spacing-lg);background:var(--bg-container);flex:1;min-height:0;position:relative;overflow:auto}.diff-content .diff-text[data-v-8dbcc08c]{font-family:var(--font-mono);font-size:var(--font-size-sm);line-height:var(--line-height-normal);white-space:pre-wrap;word-break:break-all;padding:var(--spacing-md);background:var(--bg-code);border-radius:var(--radius-base);border:1px solid var(--border-color-light)}.diff-and-preview-wrapper[data-v-8dbcc08c]{flex-direction:column;flex:1;min-height:0;display:flex;overflow:hidden}.diff-content-top[data-v-8dbcc08c]{border-bottom:1px solid #0000;flex-grow:0;flex-shrink:0}.diff-content-bottom[data-v-8dbcc08c]{padding:0 var(--spacing-lg) var(--spacing-lg) var(--spacing-lg);flex-direction:column;flex-grow:0;flex-shrink:0;min-height:0;display:flex;overflow:hidden}.preview-vertical-resizer[data-v-8dbcc08c]{cursor:row-resize;background:var(--border-color-light,transparent);-webkit-user-select:none;user-select:none;transition:background var(--transition-fast);flex:0 0 6px;position:relative}.preview-vertical-resizer[data-v-8dbcc08c]:after{content:"";background:var(--text-tertiary,#888);opacity:.5;border-radius:1px;width:32px;height:2px;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.preview-vertical-resizer[data-v-8dbcc08c]:hover,.preview-vertical-resizer[data-v-8dbcc08c]:active{background:var(--color-primary,var(--color-primary));opacity:.3}.modern-btn.btn-icon-24.active[data-v-8dbcc08c]{color:var(--color-primary);background:var(--tint-primary-10);border-color:var(--color-primary)}[data-v-8dbcc08c] .el-scrollbar__view{height:100%}[data-v-8dbcc08c] .el-scrollbar__bar .el-scrollbar__thumb{background-color:var(--scrollbar-thumb)}[data-v-8dbcc08c] .el-scrollbar__bar .el-scrollbar__thumb:hover{background-color:var(--scrollbar-thumb-hover)}@keyframes pulse-8dbcc08c{0%,to{opacity:1}50%{opacity:.5}}.diff-text[data-v-8dbcc08c]{border-radius:var(--radius-base);background:var(--bg-code);border:1px solid var(--border-color-light)}@media (width<=720px){.panel-header[data-v-8dbcc08c]{padding:var(--spacing-sm);gap:4px}.panel-header h4[data-v-8dbcc08c]{font-size:var(--font-size-xs);white-space:nowrap;flex:none}.header-left[data-v-8dbcc08c],.header-right[data-v-8dbcc08c]{gap:4px;min-width:0}.file-count[data-v-8dbcc08c],.diff-panel .action-buttons[data-v-8dbcc08c]{display:none}.view-mode-toggle[data-v-8dbcc08c]{gap:0;padding:2px}.selected-file[data-v-8dbcc08c]{max-width:92px;font-size:var(--font-size-xs);padding-inline:4px}.diff-content[data-v-8dbcc08c]{padding:var(--spacing-sm)}}
|