zen-gitsync 2.13.26 → 2.13.27
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 +1 -1
- package/scripts/README_COLOR_CONVERTER.md +196 -196
- package/scripts/README_FONTSIZE_CONVERTER.md +278 -278
- package/scripts/README_SPACING_CONVERTER.md +126 -126
- package/scripts/README_STYLE_VARS.md +180 -180
- package/src/ui/public/assets/{AppVersionBadge-BEeW0AL-.js → AppVersionBadge-V4NxO9cu.js} +2 -2
- package/src/ui/public/assets/{BranchSelector-c59Odoj0.js → BranchSelector-2uX5HSm5.js} +1 -1
- package/src/ui/public/assets/{CommandConsole-Bbt0wo4y.js → CommandConsole-BwejhA4f.js} +2 -2
- package/src/ui/public/assets/{CommitForm-hBWfGKDe.js → CommitForm-COb6kHLF.js} +1 -1
- package/src/ui/public/assets/{CustomCommandManager-B5uJC47H.js → CustomCommandManager-B8Qjz_eU.js} +1 -1
- package/src/ui/public/assets/{EditorView-DGwTbiKa.js → EditorView-BFke8nSV.js} +0 -0
- package/src/ui/public/assets/{FileDiffViewer-CJ9hE0rc.js → FileDiffViewer-D3PiL3r9.js} +1 -1
- package/src/ui/public/assets/{FlowExecutionViewer-DgzkadXS.js → FlowExecutionViewer-BJPlBrrT.js} +1 -1
- package/src/ui/public/assets/{FlowOrchestrationWorkspace-aX2jblSj.js → FlowOrchestrationWorkspace-0BR-Uf93.js} +1 -1
- package/src/ui/public/assets/{GitStatus-Bfo5BFiv.js → GitStatus--jezFZl6.js} +2 -2
- package/src/ui/public/assets/{GitStatus-CGnFB5Iq.css → GitStatus-7pgefQUu.css} +1 -1
- package/src/ui/public/assets/{ImagePreview-CYQ1rWsB.js → ImagePreview-yFJVtpwT.js} +1 -1
- package/src/ui/public/assets/{LogList-C-b_SAKs.js → LogList-Bd5tlqhN.js} +1 -1
- package/src/ui/public/assets/{ProjectStartupButton-J9QJ2l5s.js → ProjectStartupButton-Bf-htfPw.js} +1 -1
- package/src/ui/public/assets/RemoteRepoCard-BJtZtGu9.js +1 -0
- package/src/ui/public/assets/RemoteRepoCard-d0klonVb.css +1 -0
- package/src/ui/public/assets/{ResetToRemoteButton-BCaqTKWF.js → ResetToRemoteButton-BedpKd_z.js} +1 -1
- package/src/ui/public/assets/{SourceMapView-CoxtZ_m3.js → SourceMapView-4KZkPsZ5.js} +1 -1
- package/src/ui/public/assets/{TemplateManager-2AgSIFTO.js → TemplateManager-BELcp36h.js} +1 -1
- package/src/ui/public/assets/{UserInputNode-DHV_enhz.js → UserInputNode-DQky_rGr.js} +1 -1
- package/src/ui/public/assets/{WorkbenchView-CHR2r0tw.js → WorkbenchView-bJR8tgXK.js} +1 -1
- package/src/ui/public/assets/_plugin-vue_export-helper-Cpm3JOKV.js +9 -0
- package/src/ui/public/assets/{index-D7_4Vxc8.js → index-SLuwYU5Z.js} +4 -4
- package/src/ui/public/favicon.svg +75 -75
- package/src/ui/public/index.html +19 -19
- package/src/ui/public/logo.svg +74 -74
- package/src/ui/server/routes/workbench.js +2 -2
- package/src/ui/public/assets/RemoteRepoCard-9OdXr68_.js +0 -1
- package/src/ui/public/assets/RemoteRepoCard-DkcYbJtw.css +0 -1
- package/src/ui/public/assets/_plugin-vue_export-helper-RXm384te.js +0 -9
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-CMxvf4Kt.js";import{An as t,At as n,B as r,Bn as i,C as a,Cn as o,En as s,Et as c,F as l,G as u,Hn as d,In as f,K as p,L as m,Ln as h,Lt as g,M as _,Nn as ee,On as v,P as y,Pt as b,R as te,S as ne,St as x,T as re,Vn as S,Vt as ie,W as ae,Xt as C,Y as oe,Yn as w,Zn as T,_n as E,a as D,at as se,b as ce,cr as O,ct as le,d as k,dn as A,dt as j,g as M,gn as N,hn as P,hr as ue,i as de,ir as F,lt as fe,mr as I,q as pe,u as L,un as R,vn as z,vr as B,vt as me,w as he,wn as V,wt as H,yn as U,yt as ge,zn as W}from"./element-plus-CJjFCgLP.js";import{s as _e}from"./vendor-0YbzMuxw.js";import{n as G,t as K}from"./_plugin-vue_export-helper-RXm384te.js";import{i as q,l as ve,n as ye,s as be}from"./vue-flow-HHfhvx4N.js";import{i as xe,l as Se,r as J,s as Y}from"./index-D7_4Vxc8.js";import{t as Ce}from"./commandParser-wwLxoJ92.js";import{a as we,c as Te,i as Ee,n as De,o as Oe,r as ke,s as Ae,t as X}from"./UserInputNode-DHV_enhz.js";import{t as je}from"./dagre-CWIGcX9d.js";var Me=e(je(),1),Ne=s({__name:`NodeContextMenu`,props:{nodeId:{}},emits:[`execute-from-node`,`execute-single-node`],setup(e,{emit:t}){let n=e,r=t,i=O(!1);function s(e){e===`executeFrom`?r(`execute-from-node`,n.nodeId):e===`executeSingle`&&r(`execute-single-node`,n.nodeId)}return(e,t)=>{let n=oe,r=he,c=re,l=a;return W(),E(l,{trigger:`contextmenu`,onCommand:s,onVisibleChange:t[0]||=e=>i.value=e,"popper-class":`flow-node-dropdown`},{dropdown:T(()=>[V(c,null,{default:T(()=>[V(r,{command:`executeFrom`},{default:T(()=>[V(n,null,{default:T(()=>[V(I(C))]),_:1}),t[1]||=o(` 从此处开始执行 `,-1)]),_:1}),V(r,{command:`executeSingle`},{default:T(()=>[V(n,null,{default:T(()=>[V(I(C))]),_:1}),t[2]||=o(` 只执行此节点 `,-1)]),_:1})]),_:1})]),default:T(()=>[d(e.$slots,`default`,{dropdownVisible:i.value})]),_:3})}}}),Pe={class:`package-json-selector`},Fe={class:`selector-container`},Ie={class:`option-content`},Z={class:`option-main`},Le={class:`package-name`},Re={class:`option-path`},ze={key:0,class:`empty-hint`},Be=K(s({__name:`PackageJsonSelector`,props:{modelValue:{},placeholder:{},clearable:{type:Boolean},disabled:{type:Boolean}},emits:[`update:modelValue`,`change`],setup(e,{emit:t}){let n=e,i=t,a=O(!1),s=O([]),l=O(``),u=P({get:()=>n.modelValue,set:e=>{l.value=e,i(`update:modelValue`,e),i(`change`,s.value.find(t=>t.fullPath===e)||null)}}),d=P(()=>s.value.map(e=>({label:e.displayName,value:e.fullPath,relativePath:e.relativePath,version:e.version})));async function f(e){a.value=!0;try{let t=e?`/api/scan-package-files?directory=${encodeURIComponent(e)}`:`/api/scan-package-files`,n=await fetch(t);if(!n.ok)throw Error(`HTTP ${n.status}: ${n.statusText}`);let r=await n.json();if(r.success){s.value=r.packages||[],u.value&&!s.value.some(e=>e.fullPath===u.value)&&(u.value=``);let t=e?`目录 ${e}`:`当前项目`;D.success(`扫描 ${t} 完成,找到 ${s.value.length} 个 package.json 文件`)}else throw Error(r.error||`扫描失败`)}catch(e){console.error(`扫描package.json文件失败:`,e),D.error(`扫描失败: ${e.message}`),s.value=[]}finally{a.value=!1}}async function p(){try{let e=await(await fetch(`/api/browse_directory`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({currentPath:``})})).json();e.success?h(e):e.error&&D.error(e.error)}catch(e){D.error(`浏览目录失败: ${e.message}`)}}function h(e){if(!e||!e.items)return;let t=String(e.path||``),n=()=>{let e=String(t||``).trim();if(!e){D.warning(`请输入目录路径`);return}_(e)};de.alert(v(`div`,{class:`directory-browser`},[v(`div`,{class:`current-path`},[v(`span`,{class:`path-label`},`当前路径:`),v(`input`,{class:`path-value`,value:t,onInput:e=>{t=e.target.value},onKeydown:e=>{e.key===`Enter`&&(e.preventDefault(),n())}}),v(`button`,{type:`button`,class:`path-jump-btn`,onClick:n},`跳转`)]),v(`div`,{class:`directory-list`},[e.parentPath?v(`div`,{class:`directory-item parent-dir`,onClick:()=>_(e.parentPath)},[v(`span`,{class:`dir-icon`},v(`svg`,{class:`folder-icon`,viewBox:`0 0 24 24`,width:`20`,height:`20`,style:{fill:`var(--color-warning)`}},[v(`path`,{d:`M10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z`})])),v(`span`,{class:`dir-name`},`返回上级目录`)]):null,...e.items.map(e=>v(`div`,{class:`directory-item`,onClick:()=>_(e.path)},[v(`span`,{class:`dir-icon`},v(`svg`,{class:`folder-icon`,viewBox:`0 0 24 24`,width:`20`,height:`20`,style:{fill:`var(--color-primary)`}},[v(`path`,{d:`M10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z`})])),v(`span`,{class:`dir-name`},e.name)]))])]),`浏览并选择目录`,{confirmButtonText:`确定`,cancelButtonText:`取消`,showCancelButton:!0,customClass:`directory-browser-dialog`,callback:n=>{if(n===`confirm`){let n=String(t||e.path||``).trim();if(!n){D.warning(`请输入目录路径`);return}f(n)}}})}async function _(e){try{de.close(),setTimeout(async()=>{try{let t=await(await fetch(`/api/browse_directory`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({currentPath:e})})).json();t.success?h(t):t.error&&D.error(t.error)}catch(e){D.error(`浏览目录失败: ${e.message}`)}},100)}catch(e){D.error(`处理目录选择时出错: ${e.message}`)}}return f(),w(()=>n.modelValue,e=>{l.value=e},{immediate:!0}),(t,n)=>{let i=oe,l=m,h=te,_=r,ee=k;return W(),U(`div`,Pe,[N(`div`,Fe,[V(h,{modelValue:u.value,"onUpdate:modelValue":n[0]||=e=>u.value=e,placeholder:e.placeholder||`选择 package.json 文件`,clearable:e.clearable,disabled:e.disabled||a.value,filterable:``,class:`package-select`},{default:T(()=>[(W(!0),U(A,null,S(d.value,e=>(W(),E(l,{key:e.value,label:e.label,value:e.value},{default:T(()=>[N(`div`,Ie,[N(`div`,Z,[V(i,{class:`folder-icon`},{default:T(()=>[V(I(ge))]),_:1}),N(`span`,Le,B(e.label),1)]),N(`div`,Re,B(e.relativePath),1)])]),_:2},1032,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`,`clearable`,`disabled`]),V(_,{icon:a.value?I(c):I(g),loading:a.value,disabled:e.disabled,size:`default`,onClick:n[1]||=e=>f(),class:`refresh-btn`,title:`刷新当前项目`},{default:T(()=>[o(B(a.value?`扫描中...`:`刷新`),1)]),_:1},8,[`icon`,`loading`,`disabled`]),V(_,{icon:I(me),disabled:e.disabled||a.value,size:`default`,onClick:p,class:`custom-dir-btn`,title:`浏览并选择其他目录`},{default:T(()=>[...n[2]||=[o(` 其他目录 `,-1)]]),_:1},8,[`icon`,`disabled`])]),s.value.length===0&&!a.value?(W(),U(`div`,ze,[V(ee,{type:`info`,size:`small`},{default:T(()=>[...n[3]||=[o(` 未找到 package.json 文件,请确保项目包含有效的 package.json `,-1)]]),_:1})])):z(``,!0)])}}}),[[`__scopeId`,`data-v-2f8c5bc0`]]),Ve={class:`param-list`},Q={key:0,class:`param-list__title`},He={key:0,class:`param-list__title-text`},$={class:`param-list__title-actions`},Ue={key:1,class:`param-list__empty`},We={key:2,class:`param-list__body`},Ge={class:`param-list__row-content`},Ke={key:0,class:`param-list__row-actions`},qe=K(s({__name:`ParamListContainer`,props:{modelValue:{},title:{},addable:{type:Boolean},removable:{type:Boolean},minItems:{},createItem:{type:Function},itemKey:{type:Function},disableAdd:{type:Boolean},disableRemove:{type:Function}},emits:[`update:modelValue`,`add`,`remove`],setup(e,{emit:t}){let n=e,i=t,a=P(()=>Array.isArray(n.modelValue)?n.modelValue:[]);function o(){if(!n.addable||n.disableAdd)return;let e=n.createItem;e&&(i(`update:modelValue`,[...a.value,e()]),i(`add`))}function s(e){if(!n.removable)return;let t=typeof n.minItems==`number`?n.minItems:0;if(a.value.length<=t)return;let r=a.value[e];if(n.disableRemove&&n.disableRemove(r,e))return;let o=[...a.value];o.splice(e,1),i(`update:modelValue`,o),i(`remove`,e)}function c(e,t){return n.itemKey?n.itemKey(e,t):t}return(t,n)=>{let i=r;return W(),U(`div`,Ve,[e.title!==void 0||e.addable?(W(),U(`div`,Q,[e.title?(W(),U(`span`,He,B(e.title),1)):z(``,!0),N(`div`,$,[d(t.$slots,`title-actions`,{},void 0,!0),e.addable?(W(),E(i,{key:0,type:`primary`,plain:``,icon:I(b),disabled:e.disableAdd||!e.createItem,onClick:o},null,8,[`icon`,`disabled`])):z(``,!0)])])):z(``,!0),a.value.length===0?(W(),U(`div`,Ue,[d(t.$slots,`empty`,{},void 0,!0)])):(W(),U(`div`,We,[(W(!0),U(A,null,S(a.value,(n,r)=>(W(),U(`div`,{key:c(n,r),class:ue([`param-list__row`,{"param-list__row--no-actions":!e.removable}])},[N(`div`,Ge,[d(t.$slots,`row`,{item:n,index:r},void 0,!0)]),e.removable?(W(),U(`div`,Ke,[V(i,{type:`danger`,plain:``,icon:I(fe),disabled:typeof e.minItems==`number`&&a.value.length<=e.minItems||(e.disableRemove?e.disableRemove(n,r):!1),onClick:e=>s(r)},null,8,[`icon`,`disabled`,`onClick`])])):z(``,!0)],2))),128))]))])}}}),[[`__scopeId`,`data-v-e8a38cd0`]]),Je={class:`node-input-config`},Ye={class:`input-row`},Xe={class:`input-field param-name-field`},Ze={class:`field-label`},Qe={class:`input-field type-field`},$e={class:`field-label`},et={class:`input-field value-field`},tt={class:`field-label`},nt={class:`tree-node-label`},rt={class:`input-field required-field`},it={class:`field-label`},at=K(s({__name:`NodeInputConfig`,props:{modelValue:{},paramNames:{},disableParamNameEdit:{type:Boolean},predecessorNodes:{}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,i=O([]);w(()=>n.modelValue,e=>{i.value=e?[...e]:[]},{immediate:!0,deep:!0}),w(()=>n.paramNames,e=>{if(!e||e.length===0){i.value=[],r(`update:modelValue`,[]);return}let t=new Map(i.value.map(e=>[e.paramName,e])),n=[];for(let r of e)t.has(r)?n.push(t.get(r)):n.push({paramName:r,inputType:`manual`,required:!1,manualValue:``});i.value=n,r(`update:modelValue`,n)},{immediate:!0});function a(e,t,n){if(!i.value[e])return;let a=[...i.value];a[e]={...a[e],[t]:n},t===`inputType`&&(n===`manual`?(a[e].referenceNodeId=void 0,a[e].referenceOutputKey=void 0):a[e].manualValue=void 0),i.value=a,r(`update:modelValue`,a)}function s(e){return e.type===`command`?e.data.config?.displayName||e.data.config?.commandName||e.data.label||G(`@FLOWNODE:命令节点`):e.type===`code`?e.data.config?.displayName||e.data.label||G(`@FLOWNODE:代码节点`):e.data.label||e.id}function c(e){if(e.type===`command`)return[{key:`stdout`,label:G(`@NODEINPUT:标准输出(stdout)`)},{key:`stderr`,label:G(`@NODEINPUT:标准错误(stderr)`)},{key:`error`,label:G(`@NODEINPUT:错误(error)`)}];if(e.type===`code`){let t=e.data?.config,n=Array.isArray(t?.codeOutputParams)?t.codeOutputParams:[];if(n.length>0)return n.map(e=>String(e?.key||``).trim()).filter(e=>!!e).map(e=>({key:e,label:e}));let r=t?.codeOutputKeys;return(Array.isArray(r)?r:[]).map(e=>String(e||``).trim()).filter(e=>!!e).map(e=>({key:e,label:e}))}if(e.type===`user_input`){let t=e.data?.config;return(Array.isArray(t?.userInputParams)?t.userInputParams:[]).map(e=>String(e?.name||``).trim()).filter(e=>!!e).map(e=>({key:e,label:e}))}return[]}let l=P(()=>!n.predecessorNodes||n.predecessorNodes.length===0?[]:n.predecessorNodes.map(e=>({value:e.id,label:s(e),children:c(e).map(t=>({value:`${e.id}::${t.key}`,label:t.label}))})));function u(e,t){if(!t)return;let[n,a]=t.split(`::`),o=[...i.value];o[e]={...o[e],referenceNodeId:n,referenceOutputKey:a},i.value=o,r(`update:modelValue`,o)}function d(e){return e.referenceNodeId&&e.referenceOutputKey?`${e.referenceNodeId}::${e.referenceOutputKey}`:``}return(t,n)=>{let r=ae,s=m,c=te,f=oe,p=L,h=M;return W(),U(`div`,Je,[V(qe,{"model-value":i.value,title:void 0,addable:!1,removable:!1},{empty:T(()=>[o(B(I(G)(`@NODEINPUT:命令中未检测到变量参数`)),1)]),row:T(({item:t,index:n})=>[N(`div`,Ye,[N(`div`,Xe,[N(`label`,Ze,B(I(G)(`@NODEINPUT:参数名`)),1),V(r,{"model-value":t.paramName,disabled:e.disableParamNameEdit,placeholder:I(G)(`@NODEINPUT:参数名`),size:`default`,"onUpdate:modelValue":e=>a(n,`paramName`,e)},null,8,[`model-value`,`disabled`,`placeholder`,`onUpdate:modelValue`])]),N(`div`,Qe,[N(`label`,$e,B(I(G)(`@NODEINPUT:类型`)),1),V(c,{"model-value":t.inputType,placeholder:I(G)(`@NODEINPUT:选择类型`),size:`default`,"onUpdate:modelValue":e=>a(n,`inputType`,e)},{default:T(()=>[V(s,{value:`manual`,label:I(G)(`@NODEINPUT:手动输入`)},null,8,[`label`]),V(s,{value:`reference`,label:I(G)(`@NODEINPUT:引用节点`),disabled:!e.predecessorNodes||e.predecessorNodes.length===0},null,8,[`label`,`disabled`])]),_:1},8,[`model-value`,`placeholder`,`onUpdate:modelValue`])]),N(`div`,et,[N(`label`,tt,B(I(G)(`@NODEINPUT:值`)),1),t.inputType===`manual`?(W(),E(r,{key:0,"model-value":t.manualValue,placeholder:I(G)(`@NODEINPUT:输入参数值`),size:`default`,clearable:``,"onUpdate:modelValue":e=>a(n,`manualValue`,e)},null,8,[`model-value`,`placeholder`,`onUpdate:modelValue`])):(W(),E(p,{key:1,"model-value":d(t),data:l.value,placeholder:I(G)(`@NODEINPUT:选择节点输出`),size:`default`,clearable:``,filterable:``,"check-strictly":``,"render-after-expand":!1,"onUpdate:modelValue":e=>u(n,e)},{default:T(({data:e})=>[N(`span`,nt,[e.children?z(``,!0):(W(),E(f,{key:0},{default:T(()=>[V(I(H))]),_:1})),o(` `+B(e.label),1)])]),_:1},8,[`model-value`,`data`,`placeholder`,`onUpdate:modelValue`]))]),N(`div`,rt,[N(`label`,it,B(I(G)(`@NODEINPUT:必填`)),1),V(h,{"model-value":!!t.required,"onUpdate:modelValue":e=>a(n,`required`,e)},null,8,[`model-value`,`onUpdate:modelValue`])])])]),_:1},8,[`model-value`])])}}}),[[`__scopeId`,`data-v-1e9fd815`]]),ot={class:`code-node-input-config`},st={class:`input-row`},ct={class:`input-field name-field`},lt={class:`field-label`},ut={class:`input-field type-field`},dt={class:`field-label`},ft={class:`input-field value-field`},pt={class:`field-label`},mt={class:`input-field action-field`},ht={class:`field-label`},gt=K(s({__name:`CodeNodeInputConfig`,props:{modelValue:{},predecessorNodes:{},title:{},addable:{type:Boolean}},emits:[`update:modelValue`],setup(e,{expose:t,emit:n}){let r=e,i=n,a=O([]);w(()=>r.modelValue,e=>{a.value=Array.isArray(e)?[...e]:[]},{immediate:!0,deep:!0});function s(e){return e.type===`command`?e.data.config?.displayName||e.data.config?.commandName||e.data.label||G(`@FLOWNODE:命令节点`):e.type===`code`?e.data.config?.displayName||e.data.label||G(`@FLOWNODE:代码节点`):e.data.label||e.id}function c(e){if(!e)return[];if(e.type===`command`)return[{key:`stdout`,label:G(`@NODEINPUT:标准输出(stdout)`)},{key:`stderr`,label:G(`@NODEINPUT:标准错误(stderr)`)},{key:`error`,label:G(`@NODEINPUT:错误(error)`)}];if(e.type===`code`){let t=e.data?.config;return(Array.isArray(t?.codeOutputParams)?t.codeOutputParams:[]).map(e=>String(e?.key||``).trim()).filter(e=>!!e).map(e=>({key:e,label:e}))}if(e.type===`user_input`){let t=e.data?.config;return(Array.isArray(t?.userInputParams)?t.userInputParams:[]).map(e=>String(e?.name||``).trim()).filter(e=>!!e).map(e=>({key:e,label:e}))}return[]}let l=P(()=>!r.predecessorNodes||r.predecessorNodes.length===0?[]:r.predecessorNodes.map(e=>({value:e.id,label:s(e),children:c(e).map(t=>({value:`${e.id}::${t.key}`,label:t.label}))})));function u(){return{name:``,source:`reference`,required:!1,ref:{nodeId:``,outputKey:`stdout`}}}function d(){let e=[...a.value,u()];a.value=e,i(`update:modelValue`,e)}t({addRow:d});function f(e,t){if(!a.value[e])return;let n=[...a.value];n[e]={...n[e],...t},t.source&&(t.source===`manual`?(n[e].ref=void 0,n[e].manualValue===void 0&&(n[e].manualValue=``)):(n[e].manualValue=void 0,n[e].ref||(n[e].ref={nodeId:``,outputKey:`stdout`}))),a.value=n,i(`update:modelValue`,n)}function p(e,t){if(!t)return;let[n,r]=t.split(`::`);f(e,{ref:{nodeId:n,outputKey:r}})}function h(e){return e.ref?.nodeId&&e.ref?.outputKey?`${e.ref.nodeId}::${e.ref.outputKey}`:``}return(t,n)=>{let r=ae,s=m,c=te,d=L,g=M;return W(),U(`div`,ot,[V(qe,{"model-value":a.value,title:e.title,addable:e.addable!==!1,removable:!0,"min-items":0,"create-item":u,"onUpdate:modelValue":n[0]||=e=>i(`update:modelValue`,e)},{empty:T(()=>[o(B(I(G)(`@NODECFG:暂无输入参数`)),1)]),row:T(({item:t,index:n})=>[N(`div`,st,[N(`div`,ct,[N(`label`,lt,B(I(G)(`@NODECFG:参数名`)),1),V(r,{modelValue:t.name,"onUpdate:modelValue":[e=>t.name=e,e=>f(n,{name:e})],placeholder:I(G)(`@NODECFG:参数名`)},null,8,[`modelValue`,`onUpdate:modelValue`,`placeholder`])]),N(`div`,ut,[N(`label`,dt,B(I(G)(`@NODECFG:参数值`)),1),V(c,{modelValue:t.source,"onUpdate:modelValue":[e=>t.source=e,e=>f(n,{source:e})],style:{width:`110px`}},{default:T(()=>[V(s,{label:I(G)(`@NODECFG:引用`),value:`reference`,disabled:!e.predecessorNodes||e.predecessorNodes.length===0},null,8,[`label`,`disabled`]),V(s,{label:I(G)(`@NODECFG:手动`),value:`manual`},null,8,[`label`])]),_:1},8,[`modelValue`,`onUpdate:modelValue`])]),N(`div`,ft,[N(`label`,pt,B(I(G)(`@NODECFG:值`)),1),t.source===`manual`?(W(),E(r,{key:0,modelValue:t.manualValue,"onUpdate:modelValue":[e=>t.manualValue=e,e=>f(n,{manualValue:e})],placeholder:I(G)(`@NODECFG:请输入`)},null,8,[`modelValue`,`onUpdate:modelValue`,`placeholder`])):(W(),E(d,{key:1,"model-value":h(t),data:l.value,placeholder:I(G)(`@NODEINPUT:选择节点输出`),clearable:``,filterable:``,"check-strictly":``,"render-after-expand":!1,"onUpdate:modelValue":e=>p(n,e)},null,8,[`model-value`,`data`,`placeholder`,`onUpdate:modelValue`]))]),N(`div`,mt,[N(`label`,ht,B(I(G)(`@NODEINPUT:必填`)),1),V(g,{"model-value":!!t.required,"onUpdate:modelValue":e=>f(n,{required:e})},null,8,[`model-value`,`onUpdate:modelValue`])])])]),_:1},8,[`model-value`,`title`,`addable`])])}}}),[[`__scopeId`,`data-v-b90fd34c`]]),_t={class:`user-input-param-config`},vt={class:`input-row`},yt={class:`input-field name-field`},bt={class:`field-label`},xt={class:`input-field type-field`},St={class:`field-label`},Ct={class:`input-field value-field`},wt={class:`field-label`},Tt={class:`tree-node-label`},Et={class:`input-field action-field`},Dt={class:`field-label`},Ot=K(s({__name:`UserInputParamConfig`,props:{modelValue:{},predecessorNodes:{},title:{},addable:{type:Boolean}},emits:[`update:modelValue`],setup(e,{expose:t,emit:n}){let i=e,a=n,s=O([]);w(()=>i.modelValue,e=>{s.value=Array.isArray(e)?[...e]:[]},{immediate:!0,deep:!0});function c(){return{name:``,source:`manual`,defaultValue:``,required:!1}}function l(){let e=[...s.value,c()];s.value=e,a(`update:modelValue`,e)}t({addRow:l});function u(e,t){if(!s.value[e])return;let n=[...s.value];n[e]={...n[e],...t},t.source&&(t.source===`manual`?(n[e].ref=void 0,n[e].defaultValue===void 0&&(n[e].defaultValue=``)):(n[e].defaultValue=void 0,n[e].ref||(n[e].ref={nodeId:``,outputKey:`stdout`}))),s.value=n,a(`update:modelValue`,n)}function d(e){return e.type===`command`?e.data.config?.displayName||e.data.config?.commandName||e.data.label||G(`@FLOWNODE:命令节点`):e.type===`code`?e.data.config?.displayName||e.data.label||G(`@FLOWNODE:代码节点`):e.type===`user_input`?e.data.config?.displayName||e.data.label||G(`@FLOWNODE:用户输入`):e.data.label||e.id}function f(e){if(!e)return[];if(e.type===`command`)return[{key:`stdout`,label:G(`@NODEINPUT:标准输出(stdout)`)},{key:`stderr`,label:G(`@NODEINPUT:标准错误(stderr)`)},{key:`error`,label:G(`@NODEINPUT:错误(error)`)}];if(e.type===`code`){let t=e.data?.config;return(Array.isArray(t?.codeOutputParams)?t.codeOutputParams:[]).map(e=>String(e?.key||``).trim()).filter(e=>!!e).map(e=>({key:e,label:e}))}if(e.type===`user_input`){let t=e.data?.config;return(Array.isArray(t?.userInputParams)?t.userInputParams:[]).map(e=>String(e?.name||``).trim()).filter(e=>!!e).map(e=>({key:e,label:e}))}return[]}let p=P(()=>!i.predecessorNodes||i.predecessorNodes.length===0?[]:i.predecessorNodes.map(e=>({value:e.id,label:d(e),children:f(e).map(t=>({value:`${e.id}::${t.key}`,label:t.label}))})));function h(e,t){if(!t)return;let[n,r]=t.split(`::`);u(e,{ref:{nodeId:n,outputKey:r}})}function g(e){return e.ref?.nodeId&&e.ref?.outputKey?`${e.ref.nodeId}::${e.ref.outputKey}`:``}return(t,n)=>{let d=ae,f=m,_=te,ee=oe,v=L,y=M,b=r;return W(),U(`div`,_t,[V(qe,{"model-value":s.value,title:e.title,addable:e.addable!==!1,removable:!0,"min-items":0,"create-item":c,"onUpdate:modelValue":n[0]||=e=>a(`update:modelValue`,e)},{empty:T(()=>[o(B(I(G)(`@UINPUT:暂无输入参数`)),1)]),row:T(({item:e,index:t})=>[N(`div`,vt,[N(`div`,yt,[N(`label`,bt,B(I(G)(`@UINPUT:参数名`)),1),V(d,{modelValue:e.name,"onUpdate:modelValue":[t=>e.name=t,e=>u(t,{name:e})],placeholder:I(G)(`@UINPUT:参数名`)},null,8,[`modelValue`,`onUpdate:modelValue`,`placeholder`])]),N(`div`,xt,[N(`label`,St,B(I(G)(`@UINPUT:类型`)),1),V(_,{modelValue:e.source,"onUpdate:modelValue":[t=>e.source=t,e=>u(t,{source:e})],style:{width:`130px`}},{default:T(()=>[V(f,{label:I(G)(`@UINPUT:手动输入`),value:`manual`},null,8,[`label`]),V(f,{label:I(G)(`@UINPUT:引用`),value:`reference`,disabled:!i.predecessorNodes||i.predecessorNodes.length===0},null,8,[`label`,`disabled`])]),_:1},8,[`modelValue`,`onUpdate:modelValue`])]),N(`div`,Ct,[N(`label`,wt,B(e.source===`manual`?I(G)(`@UINPUT:默认值`):I(G)(`@UINPUT:引用输出`)),1),e.source===`manual`?(W(),E(d,{key:0,modelValue:e.defaultValue,"onUpdate:modelValue":[t=>e.defaultValue=t,e=>u(t,{defaultValue:e})],placeholder:I(G)(`@UINPUT:默认值`),clearable:``},null,8,[`modelValue`,`onUpdate:modelValue`,`placeholder`])):(W(),E(v,{key:1,"model-value":g(e),data:p.value,placeholder:I(G)(`@NODEINPUT:选择节点输出`),clearable:``,filterable:``,"check-strictly":``,"render-after-expand":!1,"onUpdate:modelValue":e=>h(t,e)},{default:T(({data:e})=>[N(`span`,Tt,[e.children?z(``,!0):(W(),E(ee,{key:0},{default:T(()=>[V(I(H))]),_:1})),o(` `+B(e.label),1)])]),_:1},8,[`model-value`,`data`,`placeholder`,`onUpdate:modelValue`]))]),N(`div`,Et,[N(`label`,Dt,B(I(G)(`@NODEINPUT:必填`)),1),V(y,{"model-value":!!e.required,"onUpdate:modelValue":e=>u(t,{required:e})},null,8,[`model-value`,`onUpdate:modelValue`])])])]),actions:T(()=>[e.addable===!1?z(``,!0):(W(),E(b,{key:0,type:`primary`,plain:``,size:`small`,onClick:l},{default:T(()=>[o(B(I(G)(`@UINPUT:添加参数`)),1)]),_:1}))]),_:1},8,[`model-value`,`title`,`addable`])])}}}),[[`__scopeId`,`data-v-5dc978f3`]]),kt={key:0,class:`config-content`},At={class:`config-section`},jt={class:`section-title`},Mt={key:0,class:`config-section`},Nt={class:`section-title`},Pt={key:1,class:`config-section`},Ft={class:`section-title`},It={class:`sub-section`},Lt={class:`sub-title`},Rt={key:0,class:`empty-tip`},zt={key:1,class:`condition-branch-list`},Bt={class:`branch-main`},Vt={class:`branch-header`},Ht={class:`branch-title`},Ut={key:0,class:`branch-badge`},Wt={class:`branch-meta`},Gt={key:0,class:`branch-rules`},Kt={class:`rules-header`},qt={class:`rule-col`},Jt={class:`field-label`},Yt={class:`rule-col`},Xt={class:`field-label`},Zt={class:`rule-col`},Qt={class:`field-label`},$t={class:`rule-col`,style:{"align-self":`flex-end`}},en={key:1,class:`branch-default-tip`},tn={key:0,class:`branch-actions`},nn={key:2,class:`config-section`},rn={class:`section-title`},an={key:3,class:`config-section`},on={class:`section-title`},sn={key:4,class:`config-section`},cn={class:`section-title`},ln={key:5,class:`config-section`},un={class:`section-title`},dn={key:6,class:`config-section`},fn={class:`section-title`},pn={class:`output-param-row`},mn={class:`output-param-field`},hn={class:`field-label`},gn={key:7,class:`config-section`},_n={class:`section-title`},vn={key:0,class:`empty-tip`},yn={key:1,class:`command-list`},bn=[`onClick`],xn={class:`command-info`},Sn={class:`command-header`},Cn={class:`command-name`},wn={key:0,class:`command-desc`},Tn={class:`command-code`},En={class:`command-dir`},Dn={key:8,class:`config-section`},On={class:`section-title`},kn={style:{"margin-left":`var(--spacing-md)`}},An={key:9,class:`config-section`},jn={class:`section-title`},Mn={class:`sub-section`},Nn={class:`sub-title`},Pn={class:`code-examples`},Fn={class:`examples-title`},In={class:`examples-actions`},Ln={key:10,class:`config-section`},Rn={class:`section-title`},zn={class:`reference-tip`},Bn={class:`reference-tip`},Vn={class:`node-option`},Hn={class:`node-name`},Un={class:`node-id`},Wn={class:`reference-tip`},Gn={class:`reference-tip`},Kn={key:11,class:`config-section`},qn={class:`section-title`},Jn={class:`output-param-row`},Yn={class:`output-param-field`},Xn={class:`field-label`},Zn={class:`output-param-field`},Qn={class:`field-label`},$n={key:12,class:`config-section`},er={class:`section-title`},tr={class:`output-param-row`},nr={class:`output-param-field`},rr={class:`field-label`},ir={class:`output-param-field`},ar={class:`field-label`},or={class:`dialog-footer`},sr={class:`footer-actions`},cr=`function main(param) {
|
|
1
|
+
import{o as e}from"./rolldown-runtime-CMxvf4Kt.js";import{An as t,At as n,B as r,Bn as i,C as a,Cn as o,En as s,Et as c,F as l,G as u,Hn as d,In as f,K as p,L as m,Ln as h,Lt as g,M as _,Nn as ee,On as v,P as y,Pt as b,R as te,S as ne,St as x,T as re,Vn as S,Vt as ie,W as ae,Xt as C,Y as oe,Yn as w,Zn as T,_n as E,a as D,at as se,b as ce,cr as O,ct as le,d as k,dn as A,dt as j,g as M,gn as N,hn as P,hr as ue,i as de,ir as F,lt as fe,mr as I,q as pe,u as L,un as R,vn as z,vr as B,vt as me,w as he,wn as V,wt as H,yn as U,yt as ge,zn as W}from"./element-plus-CJjFCgLP.js";import{s as _e}from"./vendor-0YbzMuxw.js";import{n as G,t as K}from"./_plugin-vue_export-helper-Cpm3JOKV.js";import{i as q,l as ve,n as ye,s as be}from"./vue-flow-HHfhvx4N.js";import{i as xe,l as Se,r as J,s as Y}from"./index-SLuwYU5Z.js";import{t as Ce}from"./commandParser-wwLxoJ92.js";import{a as we,c as Te,i as Ee,n as De,o as Oe,r as ke,s as Ae,t as X}from"./UserInputNode-DQky_rGr.js";import{t as je}from"./dagre-CWIGcX9d.js";var Me=e(je(),1),Ne=s({__name:`NodeContextMenu`,props:{nodeId:{}},emits:[`execute-from-node`,`execute-single-node`],setup(e,{emit:t}){let n=e,r=t,i=O(!1);function s(e){e===`executeFrom`?r(`execute-from-node`,n.nodeId):e===`executeSingle`&&r(`execute-single-node`,n.nodeId)}return(e,t)=>{let n=oe,r=he,c=re,l=a;return W(),E(l,{trigger:`contextmenu`,onCommand:s,onVisibleChange:t[0]||=e=>i.value=e,"popper-class":`flow-node-dropdown`},{dropdown:T(()=>[V(c,null,{default:T(()=>[V(r,{command:`executeFrom`},{default:T(()=>[V(n,null,{default:T(()=>[V(I(C))]),_:1}),t[1]||=o(` 从此处开始执行 `,-1)]),_:1}),V(r,{command:`executeSingle`},{default:T(()=>[V(n,null,{default:T(()=>[V(I(C))]),_:1}),t[2]||=o(` 只执行此节点 `,-1)]),_:1})]),_:1})]),default:T(()=>[d(e.$slots,`default`,{dropdownVisible:i.value})]),_:3})}}}),Pe={class:`package-json-selector`},Fe={class:`selector-container`},Ie={class:`option-content`},Z={class:`option-main`},Le={class:`package-name`},Re={class:`option-path`},ze={key:0,class:`empty-hint`},Be=K(s({__name:`PackageJsonSelector`,props:{modelValue:{},placeholder:{},clearable:{type:Boolean},disabled:{type:Boolean}},emits:[`update:modelValue`,`change`],setup(e,{emit:t}){let n=e,i=t,a=O(!1),s=O([]),l=O(``),u=P({get:()=>n.modelValue,set:e=>{l.value=e,i(`update:modelValue`,e),i(`change`,s.value.find(t=>t.fullPath===e)||null)}}),d=P(()=>s.value.map(e=>({label:e.displayName,value:e.fullPath,relativePath:e.relativePath,version:e.version})));async function f(e){a.value=!0;try{let t=e?`/api/scan-package-files?directory=${encodeURIComponent(e)}`:`/api/scan-package-files`,n=await fetch(t);if(!n.ok)throw Error(`HTTP ${n.status}: ${n.statusText}`);let r=await n.json();if(r.success){s.value=r.packages||[],u.value&&!s.value.some(e=>e.fullPath===u.value)&&(u.value=``);let t=e?`目录 ${e}`:`当前项目`;D.success(`扫描 ${t} 完成,找到 ${s.value.length} 个 package.json 文件`)}else throw Error(r.error||`扫描失败`)}catch(e){console.error(`扫描package.json文件失败:`,e),D.error(`扫描失败: ${e.message}`),s.value=[]}finally{a.value=!1}}async function p(){try{let e=await(await fetch(`/api/browse_directory`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({currentPath:``})})).json();e.success?h(e):e.error&&D.error(e.error)}catch(e){D.error(`浏览目录失败: ${e.message}`)}}function h(e){if(!e||!e.items)return;let t=String(e.path||``),n=()=>{let e=String(t||``).trim();if(!e){D.warning(`请输入目录路径`);return}_(e)};de.alert(v(`div`,{class:`directory-browser`},[v(`div`,{class:`current-path`},[v(`span`,{class:`path-label`},`当前路径:`),v(`input`,{class:`path-value`,value:t,onInput:e=>{t=e.target.value},onKeydown:e=>{e.key===`Enter`&&(e.preventDefault(),n())}}),v(`button`,{type:`button`,class:`path-jump-btn`,onClick:n},`跳转`)]),v(`div`,{class:`directory-list`},[e.parentPath?v(`div`,{class:`directory-item parent-dir`,onClick:()=>_(e.parentPath)},[v(`span`,{class:`dir-icon`},v(`svg`,{class:`folder-icon`,viewBox:`0 0 24 24`,width:`20`,height:`20`,style:{fill:`var(--color-warning)`}},[v(`path`,{d:`M10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z`})])),v(`span`,{class:`dir-name`},`返回上级目录`)]):null,...e.items.map(e=>v(`div`,{class:`directory-item`,onClick:()=>_(e.path)},[v(`span`,{class:`dir-icon`},v(`svg`,{class:`folder-icon`,viewBox:`0 0 24 24`,width:`20`,height:`20`,style:{fill:`var(--color-primary)`}},[v(`path`,{d:`M10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z`})])),v(`span`,{class:`dir-name`},e.name)]))])]),`浏览并选择目录`,{confirmButtonText:`确定`,cancelButtonText:`取消`,showCancelButton:!0,customClass:`directory-browser-dialog`,callback:n=>{if(n===`confirm`){let n=String(t||e.path||``).trim();if(!n){D.warning(`请输入目录路径`);return}f(n)}}})}async function _(e){try{de.close(),setTimeout(async()=>{try{let t=await(await fetch(`/api/browse_directory`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({currentPath:e})})).json();t.success?h(t):t.error&&D.error(t.error)}catch(e){D.error(`浏览目录失败: ${e.message}`)}},100)}catch(e){D.error(`处理目录选择时出错: ${e.message}`)}}return f(),w(()=>n.modelValue,e=>{l.value=e},{immediate:!0}),(t,n)=>{let i=oe,l=m,h=te,_=r,ee=k;return W(),U(`div`,Pe,[N(`div`,Fe,[V(h,{modelValue:u.value,"onUpdate:modelValue":n[0]||=e=>u.value=e,placeholder:e.placeholder||`选择 package.json 文件`,clearable:e.clearable,disabled:e.disabled||a.value,filterable:``,class:`package-select`},{default:T(()=>[(W(!0),U(A,null,S(d.value,e=>(W(),E(l,{key:e.value,label:e.label,value:e.value},{default:T(()=>[N(`div`,Ie,[N(`div`,Z,[V(i,{class:`folder-icon`},{default:T(()=>[V(I(ge))]),_:1}),N(`span`,Le,B(e.label),1)]),N(`div`,Re,B(e.relativePath),1)])]),_:2},1032,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`,`clearable`,`disabled`]),V(_,{icon:a.value?I(c):I(g),loading:a.value,disabled:e.disabled,size:`default`,onClick:n[1]||=e=>f(),class:`refresh-btn`,title:`刷新当前项目`},{default:T(()=>[o(B(a.value?`扫描中...`:`刷新`),1)]),_:1},8,[`icon`,`loading`,`disabled`]),V(_,{icon:I(me),disabled:e.disabled||a.value,size:`default`,onClick:p,class:`custom-dir-btn`,title:`浏览并选择其他目录`},{default:T(()=>[...n[2]||=[o(` 其他目录 `,-1)]]),_:1},8,[`icon`,`disabled`])]),s.value.length===0&&!a.value?(W(),U(`div`,ze,[V(ee,{type:`info`,size:`small`},{default:T(()=>[...n[3]||=[o(` 未找到 package.json 文件,请确保项目包含有效的 package.json `,-1)]]),_:1})])):z(``,!0)])}}}),[[`__scopeId`,`data-v-2f8c5bc0`]]),Ve={class:`param-list`},Q={key:0,class:`param-list__title`},He={key:0,class:`param-list__title-text`},$={class:`param-list__title-actions`},Ue={key:1,class:`param-list__empty`},We={key:2,class:`param-list__body`},Ge={class:`param-list__row-content`},Ke={key:0,class:`param-list__row-actions`},qe=K(s({__name:`ParamListContainer`,props:{modelValue:{},title:{},addable:{type:Boolean},removable:{type:Boolean},minItems:{},createItem:{type:Function},itemKey:{type:Function},disableAdd:{type:Boolean},disableRemove:{type:Function}},emits:[`update:modelValue`,`add`,`remove`],setup(e,{emit:t}){let n=e,i=t,a=P(()=>Array.isArray(n.modelValue)?n.modelValue:[]);function o(){if(!n.addable||n.disableAdd)return;let e=n.createItem;e&&(i(`update:modelValue`,[...a.value,e()]),i(`add`))}function s(e){if(!n.removable)return;let t=typeof n.minItems==`number`?n.minItems:0;if(a.value.length<=t)return;let r=a.value[e];if(n.disableRemove&&n.disableRemove(r,e))return;let o=[...a.value];o.splice(e,1),i(`update:modelValue`,o),i(`remove`,e)}function c(e,t){return n.itemKey?n.itemKey(e,t):t}return(t,n)=>{let i=r;return W(),U(`div`,Ve,[e.title!==void 0||e.addable?(W(),U(`div`,Q,[e.title?(W(),U(`span`,He,B(e.title),1)):z(``,!0),N(`div`,$,[d(t.$slots,`title-actions`,{},void 0,!0),e.addable?(W(),E(i,{key:0,type:`primary`,plain:``,icon:I(b),disabled:e.disableAdd||!e.createItem,onClick:o},null,8,[`icon`,`disabled`])):z(``,!0)])])):z(``,!0),a.value.length===0?(W(),U(`div`,Ue,[d(t.$slots,`empty`,{},void 0,!0)])):(W(),U(`div`,We,[(W(!0),U(A,null,S(a.value,(n,r)=>(W(),U(`div`,{key:c(n,r),class:ue([`param-list__row`,{"param-list__row--no-actions":!e.removable}])},[N(`div`,Ge,[d(t.$slots,`row`,{item:n,index:r},void 0,!0)]),e.removable?(W(),U(`div`,Ke,[V(i,{type:`danger`,plain:``,icon:I(fe),disabled:typeof e.minItems==`number`&&a.value.length<=e.minItems||(e.disableRemove?e.disableRemove(n,r):!1),onClick:e=>s(r)},null,8,[`icon`,`disabled`,`onClick`])])):z(``,!0)],2))),128))]))])}}}),[[`__scopeId`,`data-v-e8a38cd0`]]),Je={class:`node-input-config`},Ye={class:`input-row`},Xe={class:`input-field param-name-field`},Ze={class:`field-label`},Qe={class:`input-field type-field`},$e={class:`field-label`},et={class:`input-field value-field`},tt={class:`field-label`},nt={class:`tree-node-label`},rt={class:`input-field required-field`},it={class:`field-label`},at=K(s({__name:`NodeInputConfig`,props:{modelValue:{},paramNames:{},disableParamNameEdit:{type:Boolean},predecessorNodes:{}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,i=O([]);w(()=>n.modelValue,e=>{i.value=e?[...e]:[]},{immediate:!0,deep:!0}),w(()=>n.paramNames,e=>{if(!e||e.length===0){i.value=[],r(`update:modelValue`,[]);return}let t=new Map(i.value.map(e=>[e.paramName,e])),n=[];for(let r of e)t.has(r)?n.push(t.get(r)):n.push({paramName:r,inputType:`manual`,required:!1,manualValue:``});i.value=n,r(`update:modelValue`,n)},{immediate:!0});function a(e,t,n){if(!i.value[e])return;let a=[...i.value];a[e]={...a[e],[t]:n},t===`inputType`&&(n===`manual`?(a[e].referenceNodeId=void 0,a[e].referenceOutputKey=void 0):a[e].manualValue=void 0),i.value=a,r(`update:modelValue`,a)}function s(e){return e.type===`command`?e.data.config?.displayName||e.data.config?.commandName||e.data.label||G(`@FLOWNODE:命令节点`):e.type===`code`?e.data.config?.displayName||e.data.label||G(`@FLOWNODE:代码节点`):e.data.label||e.id}function c(e){if(e.type===`command`)return[{key:`stdout`,label:G(`@NODEINPUT:标准输出(stdout)`)},{key:`stderr`,label:G(`@NODEINPUT:标准错误(stderr)`)},{key:`error`,label:G(`@NODEINPUT:错误(error)`)}];if(e.type===`code`){let t=e.data?.config,n=Array.isArray(t?.codeOutputParams)?t.codeOutputParams:[];if(n.length>0)return n.map(e=>String(e?.key||``).trim()).filter(e=>!!e).map(e=>({key:e,label:e}));let r=t?.codeOutputKeys;return(Array.isArray(r)?r:[]).map(e=>String(e||``).trim()).filter(e=>!!e).map(e=>({key:e,label:e}))}if(e.type===`user_input`){let t=e.data?.config;return(Array.isArray(t?.userInputParams)?t.userInputParams:[]).map(e=>String(e?.name||``).trim()).filter(e=>!!e).map(e=>({key:e,label:e}))}return[]}let l=P(()=>!n.predecessorNodes||n.predecessorNodes.length===0?[]:n.predecessorNodes.map(e=>({value:e.id,label:s(e),children:c(e).map(t=>({value:`${e.id}::${t.key}`,label:t.label}))})));function u(e,t){if(!t)return;let[n,a]=t.split(`::`),o=[...i.value];o[e]={...o[e],referenceNodeId:n,referenceOutputKey:a},i.value=o,r(`update:modelValue`,o)}function d(e){return e.referenceNodeId&&e.referenceOutputKey?`${e.referenceNodeId}::${e.referenceOutputKey}`:``}return(t,n)=>{let r=ae,s=m,c=te,f=oe,p=L,h=M;return W(),U(`div`,Je,[V(qe,{"model-value":i.value,title:void 0,addable:!1,removable:!1},{empty:T(()=>[o(B(I(G)(`@NODEINPUT:命令中未检测到变量参数`)),1)]),row:T(({item:t,index:n})=>[N(`div`,Ye,[N(`div`,Xe,[N(`label`,Ze,B(I(G)(`@NODEINPUT:参数名`)),1),V(r,{"model-value":t.paramName,disabled:e.disableParamNameEdit,placeholder:I(G)(`@NODEINPUT:参数名`),size:`default`,"onUpdate:modelValue":e=>a(n,`paramName`,e)},null,8,[`model-value`,`disabled`,`placeholder`,`onUpdate:modelValue`])]),N(`div`,Qe,[N(`label`,$e,B(I(G)(`@NODEINPUT:类型`)),1),V(c,{"model-value":t.inputType,placeholder:I(G)(`@NODEINPUT:选择类型`),size:`default`,"onUpdate:modelValue":e=>a(n,`inputType`,e)},{default:T(()=>[V(s,{value:`manual`,label:I(G)(`@NODEINPUT:手动输入`)},null,8,[`label`]),V(s,{value:`reference`,label:I(G)(`@NODEINPUT:引用节点`),disabled:!e.predecessorNodes||e.predecessorNodes.length===0},null,8,[`label`,`disabled`])]),_:1},8,[`model-value`,`placeholder`,`onUpdate:modelValue`])]),N(`div`,et,[N(`label`,tt,B(I(G)(`@NODEINPUT:值`)),1),t.inputType===`manual`?(W(),E(r,{key:0,"model-value":t.manualValue,placeholder:I(G)(`@NODEINPUT:输入参数值`),size:`default`,clearable:``,"onUpdate:modelValue":e=>a(n,`manualValue`,e)},null,8,[`model-value`,`placeholder`,`onUpdate:modelValue`])):(W(),E(p,{key:1,"model-value":d(t),data:l.value,placeholder:I(G)(`@NODEINPUT:选择节点输出`),size:`default`,clearable:``,filterable:``,"check-strictly":``,"render-after-expand":!1,"onUpdate:modelValue":e=>u(n,e)},{default:T(({data:e})=>[N(`span`,nt,[e.children?z(``,!0):(W(),E(f,{key:0},{default:T(()=>[V(I(H))]),_:1})),o(` `+B(e.label),1)])]),_:1},8,[`model-value`,`data`,`placeholder`,`onUpdate:modelValue`]))]),N(`div`,rt,[N(`label`,it,B(I(G)(`@NODEINPUT:必填`)),1),V(h,{"model-value":!!t.required,"onUpdate:modelValue":e=>a(n,`required`,e)},null,8,[`model-value`,`onUpdate:modelValue`])])])]),_:1},8,[`model-value`])])}}}),[[`__scopeId`,`data-v-1e9fd815`]]),ot={class:`code-node-input-config`},st={class:`input-row`},ct={class:`input-field name-field`},lt={class:`field-label`},ut={class:`input-field type-field`},dt={class:`field-label`},ft={class:`input-field value-field`},pt={class:`field-label`},mt={class:`input-field action-field`},ht={class:`field-label`},gt=K(s({__name:`CodeNodeInputConfig`,props:{modelValue:{},predecessorNodes:{},title:{},addable:{type:Boolean}},emits:[`update:modelValue`],setup(e,{expose:t,emit:n}){let r=e,i=n,a=O([]);w(()=>r.modelValue,e=>{a.value=Array.isArray(e)?[...e]:[]},{immediate:!0,deep:!0});function s(e){return e.type===`command`?e.data.config?.displayName||e.data.config?.commandName||e.data.label||G(`@FLOWNODE:命令节点`):e.type===`code`?e.data.config?.displayName||e.data.label||G(`@FLOWNODE:代码节点`):e.data.label||e.id}function c(e){if(!e)return[];if(e.type===`command`)return[{key:`stdout`,label:G(`@NODEINPUT:标准输出(stdout)`)},{key:`stderr`,label:G(`@NODEINPUT:标准错误(stderr)`)},{key:`error`,label:G(`@NODEINPUT:错误(error)`)}];if(e.type===`code`){let t=e.data?.config;return(Array.isArray(t?.codeOutputParams)?t.codeOutputParams:[]).map(e=>String(e?.key||``).trim()).filter(e=>!!e).map(e=>({key:e,label:e}))}if(e.type===`user_input`){let t=e.data?.config;return(Array.isArray(t?.userInputParams)?t.userInputParams:[]).map(e=>String(e?.name||``).trim()).filter(e=>!!e).map(e=>({key:e,label:e}))}return[]}let l=P(()=>!r.predecessorNodes||r.predecessorNodes.length===0?[]:r.predecessorNodes.map(e=>({value:e.id,label:s(e),children:c(e).map(t=>({value:`${e.id}::${t.key}`,label:t.label}))})));function u(){return{name:``,source:`reference`,required:!1,ref:{nodeId:``,outputKey:`stdout`}}}function d(){let e=[...a.value,u()];a.value=e,i(`update:modelValue`,e)}t({addRow:d});function f(e,t){if(!a.value[e])return;let n=[...a.value];n[e]={...n[e],...t},t.source&&(t.source===`manual`?(n[e].ref=void 0,n[e].manualValue===void 0&&(n[e].manualValue=``)):(n[e].manualValue=void 0,n[e].ref||(n[e].ref={nodeId:``,outputKey:`stdout`}))),a.value=n,i(`update:modelValue`,n)}function p(e,t){if(!t)return;let[n,r]=t.split(`::`);f(e,{ref:{nodeId:n,outputKey:r}})}function h(e){return e.ref?.nodeId&&e.ref?.outputKey?`${e.ref.nodeId}::${e.ref.outputKey}`:``}return(t,n)=>{let r=ae,s=m,c=te,d=L,g=M;return W(),U(`div`,ot,[V(qe,{"model-value":a.value,title:e.title,addable:e.addable!==!1,removable:!0,"min-items":0,"create-item":u,"onUpdate:modelValue":n[0]||=e=>i(`update:modelValue`,e)},{empty:T(()=>[o(B(I(G)(`@NODECFG:暂无输入参数`)),1)]),row:T(({item:t,index:n})=>[N(`div`,st,[N(`div`,ct,[N(`label`,lt,B(I(G)(`@NODECFG:参数名`)),1),V(r,{modelValue:t.name,"onUpdate:modelValue":[e=>t.name=e,e=>f(n,{name:e})],placeholder:I(G)(`@NODECFG:参数名`)},null,8,[`modelValue`,`onUpdate:modelValue`,`placeholder`])]),N(`div`,ut,[N(`label`,dt,B(I(G)(`@NODECFG:参数值`)),1),V(c,{modelValue:t.source,"onUpdate:modelValue":[e=>t.source=e,e=>f(n,{source:e})],style:{width:`110px`}},{default:T(()=>[V(s,{label:I(G)(`@NODECFG:引用`),value:`reference`,disabled:!e.predecessorNodes||e.predecessorNodes.length===0},null,8,[`label`,`disabled`]),V(s,{label:I(G)(`@NODECFG:手动`),value:`manual`},null,8,[`label`])]),_:1},8,[`modelValue`,`onUpdate:modelValue`])]),N(`div`,ft,[N(`label`,pt,B(I(G)(`@NODECFG:值`)),1),t.source===`manual`?(W(),E(r,{key:0,modelValue:t.manualValue,"onUpdate:modelValue":[e=>t.manualValue=e,e=>f(n,{manualValue:e})],placeholder:I(G)(`@NODECFG:请输入`)},null,8,[`modelValue`,`onUpdate:modelValue`,`placeholder`])):(W(),E(d,{key:1,"model-value":h(t),data:l.value,placeholder:I(G)(`@NODEINPUT:选择节点输出`),clearable:``,filterable:``,"check-strictly":``,"render-after-expand":!1,"onUpdate:modelValue":e=>p(n,e)},null,8,[`model-value`,`data`,`placeholder`,`onUpdate:modelValue`]))]),N(`div`,mt,[N(`label`,ht,B(I(G)(`@NODEINPUT:必填`)),1),V(g,{"model-value":!!t.required,"onUpdate:modelValue":e=>f(n,{required:e})},null,8,[`model-value`,`onUpdate:modelValue`])])])]),_:1},8,[`model-value`,`title`,`addable`])])}}}),[[`__scopeId`,`data-v-b90fd34c`]]),_t={class:`user-input-param-config`},vt={class:`input-row`},yt={class:`input-field name-field`},bt={class:`field-label`},xt={class:`input-field type-field`},St={class:`field-label`},Ct={class:`input-field value-field`},wt={class:`field-label`},Tt={class:`tree-node-label`},Et={class:`input-field action-field`},Dt={class:`field-label`},Ot=K(s({__name:`UserInputParamConfig`,props:{modelValue:{},predecessorNodes:{},title:{},addable:{type:Boolean}},emits:[`update:modelValue`],setup(e,{expose:t,emit:n}){let i=e,a=n,s=O([]);w(()=>i.modelValue,e=>{s.value=Array.isArray(e)?[...e]:[]},{immediate:!0,deep:!0});function c(){return{name:``,source:`manual`,defaultValue:``,required:!1}}function l(){let e=[...s.value,c()];s.value=e,a(`update:modelValue`,e)}t({addRow:l});function u(e,t){if(!s.value[e])return;let n=[...s.value];n[e]={...n[e],...t},t.source&&(t.source===`manual`?(n[e].ref=void 0,n[e].defaultValue===void 0&&(n[e].defaultValue=``)):(n[e].defaultValue=void 0,n[e].ref||(n[e].ref={nodeId:``,outputKey:`stdout`}))),s.value=n,a(`update:modelValue`,n)}function d(e){return e.type===`command`?e.data.config?.displayName||e.data.config?.commandName||e.data.label||G(`@FLOWNODE:命令节点`):e.type===`code`?e.data.config?.displayName||e.data.label||G(`@FLOWNODE:代码节点`):e.type===`user_input`?e.data.config?.displayName||e.data.label||G(`@FLOWNODE:用户输入`):e.data.label||e.id}function f(e){if(!e)return[];if(e.type===`command`)return[{key:`stdout`,label:G(`@NODEINPUT:标准输出(stdout)`)},{key:`stderr`,label:G(`@NODEINPUT:标准错误(stderr)`)},{key:`error`,label:G(`@NODEINPUT:错误(error)`)}];if(e.type===`code`){let t=e.data?.config;return(Array.isArray(t?.codeOutputParams)?t.codeOutputParams:[]).map(e=>String(e?.key||``).trim()).filter(e=>!!e).map(e=>({key:e,label:e}))}if(e.type===`user_input`){let t=e.data?.config;return(Array.isArray(t?.userInputParams)?t.userInputParams:[]).map(e=>String(e?.name||``).trim()).filter(e=>!!e).map(e=>({key:e,label:e}))}return[]}let p=P(()=>!i.predecessorNodes||i.predecessorNodes.length===0?[]:i.predecessorNodes.map(e=>({value:e.id,label:d(e),children:f(e).map(t=>({value:`${e.id}::${t.key}`,label:t.label}))})));function h(e,t){if(!t)return;let[n,r]=t.split(`::`);u(e,{ref:{nodeId:n,outputKey:r}})}function g(e){return e.ref?.nodeId&&e.ref?.outputKey?`${e.ref.nodeId}::${e.ref.outputKey}`:``}return(t,n)=>{let d=ae,f=m,_=te,ee=oe,v=L,y=M,b=r;return W(),U(`div`,_t,[V(qe,{"model-value":s.value,title:e.title,addable:e.addable!==!1,removable:!0,"min-items":0,"create-item":c,"onUpdate:modelValue":n[0]||=e=>a(`update:modelValue`,e)},{empty:T(()=>[o(B(I(G)(`@UINPUT:暂无输入参数`)),1)]),row:T(({item:e,index:t})=>[N(`div`,vt,[N(`div`,yt,[N(`label`,bt,B(I(G)(`@UINPUT:参数名`)),1),V(d,{modelValue:e.name,"onUpdate:modelValue":[t=>e.name=t,e=>u(t,{name:e})],placeholder:I(G)(`@UINPUT:参数名`)},null,8,[`modelValue`,`onUpdate:modelValue`,`placeholder`])]),N(`div`,xt,[N(`label`,St,B(I(G)(`@UINPUT:类型`)),1),V(_,{modelValue:e.source,"onUpdate:modelValue":[t=>e.source=t,e=>u(t,{source:e})],style:{width:`130px`}},{default:T(()=>[V(f,{label:I(G)(`@UINPUT:手动输入`),value:`manual`},null,8,[`label`]),V(f,{label:I(G)(`@UINPUT:引用`),value:`reference`,disabled:!i.predecessorNodes||i.predecessorNodes.length===0},null,8,[`label`,`disabled`])]),_:1},8,[`modelValue`,`onUpdate:modelValue`])]),N(`div`,Ct,[N(`label`,wt,B(e.source===`manual`?I(G)(`@UINPUT:默认值`):I(G)(`@UINPUT:引用输出`)),1),e.source===`manual`?(W(),E(d,{key:0,modelValue:e.defaultValue,"onUpdate:modelValue":[t=>e.defaultValue=t,e=>u(t,{defaultValue:e})],placeholder:I(G)(`@UINPUT:默认值`),clearable:``},null,8,[`modelValue`,`onUpdate:modelValue`,`placeholder`])):(W(),E(v,{key:1,"model-value":g(e),data:p.value,placeholder:I(G)(`@NODEINPUT:选择节点输出`),clearable:``,filterable:``,"check-strictly":``,"render-after-expand":!1,"onUpdate:modelValue":e=>h(t,e)},{default:T(({data:e})=>[N(`span`,Tt,[e.children?z(``,!0):(W(),E(ee,{key:0},{default:T(()=>[V(I(H))]),_:1})),o(` `+B(e.label),1)])]),_:1},8,[`model-value`,`data`,`placeholder`,`onUpdate:modelValue`]))]),N(`div`,Et,[N(`label`,Dt,B(I(G)(`@NODEINPUT:必填`)),1),V(y,{"model-value":!!e.required,"onUpdate:modelValue":e=>u(t,{required:e})},null,8,[`model-value`,`onUpdate:modelValue`])])])]),actions:T(()=>[e.addable===!1?z(``,!0):(W(),E(b,{key:0,type:`primary`,plain:``,size:`small`,onClick:l},{default:T(()=>[o(B(I(G)(`@UINPUT:添加参数`)),1)]),_:1}))]),_:1},8,[`model-value`,`title`,`addable`])])}}}),[[`__scopeId`,`data-v-5dc978f3`]]),kt={key:0,class:`config-content`},At={class:`config-section`},jt={class:`section-title`},Mt={key:0,class:`config-section`},Nt={class:`section-title`},Pt={key:1,class:`config-section`},Ft={class:`section-title`},It={class:`sub-section`},Lt={class:`sub-title`},Rt={key:0,class:`empty-tip`},zt={key:1,class:`condition-branch-list`},Bt={class:`branch-main`},Vt={class:`branch-header`},Ht={class:`branch-title`},Ut={key:0,class:`branch-badge`},Wt={class:`branch-meta`},Gt={key:0,class:`branch-rules`},Kt={class:`rules-header`},qt={class:`rule-col`},Jt={class:`field-label`},Yt={class:`rule-col`},Xt={class:`field-label`},Zt={class:`rule-col`},Qt={class:`field-label`},$t={class:`rule-col`,style:{"align-self":`flex-end`}},en={key:1,class:`branch-default-tip`},tn={key:0,class:`branch-actions`},nn={key:2,class:`config-section`},rn={class:`section-title`},an={key:3,class:`config-section`},on={class:`section-title`},sn={key:4,class:`config-section`},cn={class:`section-title`},ln={key:5,class:`config-section`},un={class:`section-title`},dn={key:6,class:`config-section`},fn={class:`section-title`},pn={class:`output-param-row`},mn={class:`output-param-field`},hn={class:`field-label`},gn={key:7,class:`config-section`},_n={class:`section-title`},vn={key:0,class:`empty-tip`},yn={key:1,class:`command-list`},bn=[`onClick`],xn={class:`command-info`},Sn={class:`command-header`},Cn={class:`command-name`},wn={key:0,class:`command-desc`},Tn={class:`command-code`},En={class:`command-dir`},Dn={key:8,class:`config-section`},On={class:`section-title`},kn={style:{"margin-left":`var(--spacing-md)`}},An={key:9,class:`config-section`},jn={class:`section-title`},Mn={class:`sub-section`},Nn={class:`sub-title`},Pn={class:`code-examples`},Fn={class:`examples-title`},In={class:`examples-actions`},Ln={key:10,class:`config-section`},Rn={class:`section-title`},zn={class:`reference-tip`},Bn={class:`reference-tip`},Vn={class:`node-option`},Hn={class:`node-name`},Un={class:`node-id`},Wn={class:`reference-tip`},Gn={class:`reference-tip`},Kn={key:11,class:`config-section`},qn={class:`section-title`},Jn={class:`output-param-row`},Yn={class:`output-param-field`},Xn={class:`field-label`},Zn={class:`output-param-field`},Qn={class:`field-label`},$n={key:12,class:`config-section`},er={class:`section-title`},tr={class:`output-param-row`},nr={class:`output-param-field`},rr={class:`field-label`},ir={class:`output-param-field`},ar={class:`field-label`},or={class:`dialog-footer`},sr={class:`footer-actions`},cr=`function main(param) {
|
|
2
2
|
const out = new Object()
|
|
3
3
|
out.key0 = param.input
|
|
4
4
|
return out
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import"./rolldown-runtime-CMxvf4Kt.js";import{B as e,Cn as t,Ct as n,Dt as r,En as i,Et as a,F as o,G as s,In as c,Jt as l,K as u,Lt as d,M as f,P as p,Q as m,Qn as h,Qt as g,S as _,Ut as v,Vn as y,W as ee,X as b,Y as te,Yn as x,Zn as S,_n as C,_r as w,a as T,bt as E,cn as ne,cr as D,ct as re,dn as O,f as ie,gn as k,hn as A,hr as j,i as M,ln as ae,mr as N,o as oe,p as se,pt as ce,q as P,tt as le,un as F,ut as ue,vn as I,vr as L,wn as R,yn as z,yt as de,z as fe,zn as B}from"./element-plus-CJjFCgLP.js";import{n as V,t as H}from"./_plugin-vue_export-helper-RXm384te.js";import{a as pe,i as U,l as me,r as W,s as he}from"./index-D7_4Vxc8.js";import{n as ge}from"./commandParser-wwLxoJ92.js";import{t as G}from"./CustomCommandManager-B5uJC47H.js";import{t as _e}from"./fileIcon-B5p5pGN9.js";import{n as ve}from"./ImagePreview-CYQ1rWsB.js";import{i as ye,n as be,o as xe,r as Se,s as Ce,t as we}from"./ResetToRemoteButton-BCaqTKWF.js";import{a as Te,c as Ee,i as De,n as Oe,r as ke,s as Ae,t as je}from"./FileDiffViewer-CJ9hE0rc.js";var Me={key:0,class:`file-group`},Ne={class:`file-count`},Pe={class:`file-list`},Fe=[`onClick`],Ie={class:`file-info`},Le={class:`file-type-icon mit-icon`,"aria-hidden":`true`},Re=[`xlink:href`],ze={class:`file-name-section`},K=[`title`],q={class:`file-directory`},Be={key:0,class:`file-actions`},Ve=H(i({__name:`FileGroup`,props:{files:{},title:{},groupKey:{},collapsedGroups:{},isFileLocked:{type:Function},isLocking:{type:Function},getFileName:{type:Function},getFileDirectory:{type:Function},isSelectionMode:{type:Boolean},isFileSelected:{type:Function}},emits:[`toggleCollapse`,`fileClick`,`toggleFileLock`,`stageFile`,`unstageFile`,`revertFileChanges`,`manageLockedFiles`,`toggleFileSelection`],setup(e,{emit:n}){let i=e,a=n,c=A(()=>i.files.length>0),l=A(()=>i.collapsedGroups[i.groupKey]);function u(){a(`toggleCollapse`,i.groupKey)}function d(e,t){i.isSelectionMode?(t?.stopPropagation(),a(`toggleFileSelection`,e.path)):a(`fileClick`,e)}function f(e){a(`toggleFileSelection`,e)}function p(e){a(`toggleFileLock`,e)}function m(){a(`manageLockedFiles`)}function g(e){a(`stageFile`,e)}function _(e){a(`unstageFile`,e)}function v(e){a(`revertFileChanges`,e)}function ee(e){switch(e){case`added`:return`A`;case`modified`:return`M`;case`deleted`:return`D`;case`conflicted`:return`!`;case`untracked`:return`U`;default:return``}}let x=e=>_e(i.getFileName(e));return(n,a)=>{let w=te,T=o,E=s;return c.value?(B(),z(`div`,Me,[k(`div`,{class:`file-group-header`,onClick:u},[R(w,{class:j([`collapse-icon`,{collapsed:l.value}])},{default:S(()=>[R(N(b))]),_:1},8,[`class`]),k(`span`,null,L(e.title),1),k(`span`,Ne,`(`+L(e.files.length)+`)`,1)]),h(k(`div`,Pe,[(B(!0),z(O,null,y(e.files,e=>(B(),z(`div`,{key:e.path,class:j([`file-item file-group-item`,{"is-loading":i.isLocking(e.path),locked:i.isFileLocked(e.path),selected:i.isSelectionMode&&i.isFileSelected?.(e.path),[`file-type-${e.type}`]:e.type}]),onClick:t=>d(e,t)},[k(`div`,Ie,[i.isSelectionMode?(B(),C(T,{key:0,"model-value":i.isFileSelected?.(e.path),onChange:t=>f(e.path),onClick:a[0]||=F(()=>{},[`stop`]),class:`file-checkbox`},null,8,[`model-value`,`onChange`])):I(``,!0),(B(),z(`svg`,Le,[k(`use`,{"xlink:href":`#${x(e.path)}`},null,8,Re)])),k(`div`,ze,[R(E,{content:i.getFileName(e.path),placement:`top`,disabled:i.getFileName(e.path).length<=25,"show-after":200},{default:S(()=>[k(`div`,{class:j([`file-name`,{"locked-file-name":i.isFileLocked(e.path),"deleted-file-name":e.type===`deleted`}])},[t(L(i.getFileName(e.path))+` `,1),i.isFileLocked(e.path)?(B(),C(w,{key:0,class:`lock-indicator`},{default:S(()=>[R(N(r))]),_:1})):I(``,!0)],2)]),_:2},1032,[`content`,`disabled`])]),k(`div`,{class:`file-path-section`,title:i.getFileDirectory(e.path)},[R(E,{content:i.getFileDirectory(e.path),placement:`top`,disabled:i.getFileDirectory(e.path).length<=30,"show-after":200},{default:S(()=>[k(`span`,q,L(i.getFileDirectory(e.path)),1)]),_:2},1032,[`content`,`disabled`])],8,K),k(`div`,{class:j([`file-status-indicator`,[e.type,{locked:i.isFileLocked(e.path)}]])},L(ee(e.type)),3)]),i.isSelectionMode?I(``,!0):(B(),z(`div`,Be,[R(Te,{"file-path":e.path,"file-type":e.type,"is-locked":i.isFileLocked(e.path),"is-locking":i.isLocking(e.path),onToggleLock:p,onStage:g,onUnstage:_,onRevert:v,onManageLockedFiles:m},null,8,[`file-path`,`file-type`,`is-locked`,`is-locking`])]))],10,Fe))),128))],512),[[ne,!l.value]])])):I(``,!0)}}}),[[`__scopeId`,`data-v-c6289494`]]),He={class:`settings-content`},Ue={class:`package-info-bar`},We={class:`info-label`},Ge={class:`info-value`},Ke={class:`info-path`},qe={class:`tab-content`},Je={class:`current-version`},J={class:`version-label`},Ye={class:`version-value`},Xe={class:`version-options`},Ze={class:`option-label`},Qe={class:`radio-content`},$e={class:`radio-label`},et={class:`radio-desc`},tt={class:`tab-content script-management`},Y={class:`scripts-list-section`},nt={class:`section-header`},rt={class:`section-title`},it={class:`script-count`},at={key:0,class:`empty-scripts`},X={key:1,class:`script-items`},ot={class:`script-item-content`},st={class:`script-name-tag`},ct={class:`name-text`},lt={class:`script-command`},ut={class:`script-item-actions`},dt={class:`script-form-section`},ft={class:`section-header`},pt={class:`section-title`},mt={class:`form-group`},ht={class:`form-item`},gt={class:`form-label`},_t={key:0,class:`error-tip`},vt={key:1,class:`success-tip`},Z={class:`form-item`},Q={class:`form-label`},$=H(i({__name:`NpmSettingsDialog`,props:{visible:{type:Boolean},packageInfo:{}},emits:[`close`,`complete`],setup(n,{emit:r}){let i=n,a=r,o=D(`version`),s=D(`patch`),c=D(!1),l=D(``),u=D(``),d=D(!1),m=D(``),h=D(!1),g=D(!1),v=D(!1),b=D(``);function x(e){return e.trim()?e.includes(` `)?(b.value=V(`@NPM01:脚本名称不能包含空格`),!1):/^[a-zA-Z_:][a-zA-Z0-9_:.-]*$/.test(e)?(b.value=``,!0):(b.value=V(`@NPM01:脚本名称只能包含字母、数字、连字符、冒号、下划线和点号,且不能以数字开头`),!1):(b.value=``,!1)}function w(){l.value.trim()?x(l.value):b.value=``}let E=[{label:V(`@NPM01:主版本号 (major)`),value:`major`,desc:`1.0.0 → 2.0.0`},{label:V(`@NPM01:次版本号 (minor)`),value:`minor`,desc:`1.0.0 → 1.1.0`},{label:V(`@NPM01:修订号 (patch)`),value:`patch`,desc:`1.0.0 → 1.0.1`}];async function ne(){try{c.value=!0;let e=await(await fetch(`/api/update-npm-version`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({packagePath:i.packageInfo.path,versionType:s.value})})).json();e.success?(T.success(`${V(`@NPM01:版本号已更新`)}: ${e.oldVersion} → ${e.newVersion}`),a(`complete`)):T.error(e.error||V(`@NPM01:更新版本号失败`))}catch(e){console.error(`更新版本号失败:`,e),T.error(V(`@NPM01:更新版本号失败`))}finally{c.value=!1}}async function re(){if(!l.value.trim()){T.warning(V(`@NPM01:请输入脚本名称`));return}if(!x(l.value)){T.warning(b.value||V(`@NPM01:脚本名称格式不正确`));return}if(!u.value.trim()){T.warning(V(`@NPM01:请输入脚本命令`));return}try{d.value=!0;let e=v.value?`/api/update-npm-script`:`/api/add-npm-script`,t=await(await fetch(e,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({packagePath:i.packageInfo.path,scriptName:l.value.trim(),scriptCommand:u.value.trim(),oldScriptName:v.value?m.value:void 0})})).json();t.success?(T.success(v.value?V(`@NPM01:脚本已更新`):V(`@NPM01:脚本已添加`)),j(),a(`complete`)):T.error(t.error||(v.value?V(`@NPM01:更新脚本失败`):V(`@NPM01:添加脚本失败`)))}catch(e){console.error(`保存脚本失败:`,e),T.error(v.value?V(`@NPM01:更新脚本失败`):V(`@NPM01:添加脚本失败`))}finally{d.value=!1}}function A(e,t){v.value=!0,m.value=e,l.value=e,u.value=t,b.value=``}function j(){v.value=!1,m.value=``,l.value=``,u.value=``,b.value=``}async function ae(e){try{g.value=!0;let t=await(await fetch(`/api/pin-npm-script`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({packagePath:i.packageInfo.path,scriptName:e})})).json();t.success?(T.success(V(`@NPM01:脚本已置顶`)),a(`complete`)):T.error(t.error||V(`@NPM01:置顶脚本失败`))}catch(e){console.error(`置顶脚本失败:`,e),T.error(V(`@NPM01:置顶脚本失败`))}finally{g.value=!1}}async function oe(e){try{await M.confirm(V(`@NPM01:确定要删除脚本`)+` "${e}" `+V(`@NPM01:吗?`),V(`@NPM01:删除脚本`),{confirmButtonText:V(`@NPM01:确定`),cancelButtonText:V(`@NPM01:取消`),type:`warning`}),h.value=!0;let t=await(await fetch(`/api/delete-npm-script`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({packagePath:i.packageInfo.path,scriptName:e})})).json();t.success?(T.success(V(`@NPM01:脚本已删除`)),a(`complete`)):T.error(t.error||V(`@NPM01:删除脚本失败`))}catch(e){e!==`cancel`&&(console.error(`删除脚本失败:`,e),T.error(V(`@NPM01:删除脚本失败`)))}finally{h.value=!1}}function ce(){o.value=`version`,s.value=`patch`,j(),a(`close`)}return(r,i)=>{let a=f,x=p,T=e,D=ie,M=_,P=te,le=U,F=ee,ue=se;return B(),C(me,{"model-value":n.visible,title:n.packageInfo.name+` - `+N(V)(`@NPM01:NPM 设置`),size:`medium`,onClose:ce},{default:S(()=>[k(`div`,He,[k(`div`,Ue,[k(`span`,We,L(N(V)(`@NPM01:包名称`))+`:`,1),k(`span`,Ge,L(n.packageInfo.name),1),k(`span`,Ke,L(n.packageInfo.relativePath),1)]),R(ue,{modelValue:o.value,"onUpdate:modelValue":i[3]||=e=>o.value=e,class:`settings-tabs`},{default:S(()=>[R(D,{label:N(V)(`@NPM01:版本号管理`),name:`version`},{default:S(()=>[k(`div`,qe,[k(`div`,Je,[k(`span`,J,L(N(V)(`@NPM01:当前版本`))+`:`,1),k(`span`,Ye,L(n.packageInfo.version),1)]),k(`div`,Xe,[k(`label`,Ze,L(N(V)(`@NPM01:选择要增加的版本号类型`))+`:`,1),R(x,{modelValue:s.value,"onUpdate:modelValue":i[0]||=e=>s.value=e,class:`version-radio-group`},{default:S(()=>[(B(),z(O,null,y(E,e=>R(a,{key:e.value,value:e.value,border:``,class:`version-radio`},{default:S(()=>[k(`div`,Qe,[k(`span`,$e,L(e.label),1),k(`span`,et,L(e.desc),1)])]),_:2},1032,[`value`])),64))]),_:1},8,[`modelValue`])]),R(T,{type:`primary`,loading:c.value,onClick:ne,class:`action-button`},{default:S(()=>[t(L(N(V)(`@NPM01:更新版本号`)),1)]),_:1},8,[`loading`])])]),_:1},8,[`label`]),R(D,{label:N(V)(`@NPM01:脚本管理`),name:`script`},{default:S(()=>[k(`div`,tt,[k(`div`,Y,[k(`div`,nt,[k(`span`,rt,L(N(V)(`@NPM01:当前脚本列表`)),1),k(`span`,it,L(Object.keys(n.packageInfo.scripts||{}).length)+` `+L(N(V)(`@NPM01:个脚本`)),1)]),Object.keys(n.packageInfo.scripts||{}).length===0?(B(),z(`div`,at,[R(M,{description:N(V)(`@NPM01:暂无脚本`),"image-size":80},null,8,[`description`])])):(B(),z(`div`,X,[(B(!0),z(O,null,y(n.packageInfo.scripts,(e,t)=>(B(),z(`div`,{key:t,class:`script-item-card`},[k(`div`,ot,[k(`div`,st,[R(P,{class:`script-icon`},{default:S(()=>[...i[4]||=[k(`svg`,{viewBox:`0 0 1024 1024`,xmlns:`http://www.w3.org/2000/svg`},[k(`path`,{fill:`currentColor`,d:`M160 224a64 64 0 0 0-64 64v448a64 64 0 0 0 64 64h704a64 64 0 0 0 64-64V288a64 64 0 0 0-64-64H160zm0-64h704a128 128 0 0 1 128 128v448a128 128 0 0 1-128 128H160A128 128 0 0 1 32 736V288a128 128 0 0 1 128-128z`}),k(`path`,{fill:`currentColor`,d:`m448 327.872 163.2 160-163.2 160-45.248-46.08L502.4 487.872l-99.648-99.84L448 327.872z`})],-1)]]),_:1}),k(`span`,ct,L(t),1)]),k(`div`,lt,[k(`code`,null,L(e),1)])]),k(`div`,ut,[R(T,{size:`small`,text:``,class:`pin-button`,onClick:e=>ae(t),loading:g.value,title:`置顶`},{default:S(()=>[R(le,{"icon-class":`pin`,"class-name":`pin-icon`})]),_:1},8,[`onClick`,`loading`]),R(T,{size:`small`,type:`primary`,text:``,onClick:n=>A(t,e),disabled:v.value&&m.value===t,title:N(V)(`@NPM01:编辑`)},{default:S(()=>[R(P,null,{default:S(()=>[...i[5]||=[k(`svg`,{viewBox:`0 0 1024 1024`,xmlns:`http://www.w3.org/2000/svg`},[k(`path`,{fill:`currentColor`,d:`M832 512a32 32 0 1 1 64 0v352a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h352a32 32 0 0 1 0 64H192v640h640V512z`}),k(`path`,{fill:`currentColor`,d:`m469.952 554.24 52.8-7.552L847.104 222.4a32 32 0 1 0-45.248-45.248L477.44 501.44l-7.552 52.8zm422.4-422.4a96 96 0 0 1 0 135.808l-331.84 331.84a32 32 0 0 1-18.112 9.088l-139.456 19.904a32 32 0 0 1-36.224-36.224l19.904-139.456a32 32 0 0 1 9.024-18.112l331.904-331.84a96 96 0 0 1 135.808 0z`})],-1)]]),_:1})]),_:1},8,[`onClick`,`disabled`,`title`]),R(T,{size:`small`,type:`danger`,text:``,onClick:e=>oe(t),loading:h.value,title:N(V)(`@NPM01:删除`)},{default:S(()=>[R(P,null,{default:S(()=>[...i[6]||=[k(`svg`,{viewBox:`0 0 1024 1024`,xmlns:`http://www.w3.org/2000/svg`},[k(`path`,{fill:`currentColor`,d:`M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32V256zm448-64v-64H416v64h192zM224 896h576V256H224v640zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32zm192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32z`})],-1)]]),_:1})]),_:1},8,[`onClick`,`loading`,`title`])])]))),128))]))]),k(`div`,dt,[k(`div`,ft,[k(`span`,pt,L(v.value?N(V)(`@NPM01:编辑脚本`):N(V)(`@NPM01:添加新脚本`)),1),v.value?(B(),C(T,{key:0,size:`small`,text:``,onClick:j},{default:S(()=>[t(L(N(V)(`@NPM01:取消编辑`)),1)]),_:1})):I(``,!0)]),k(`div`,mt,[k(`div`,ht,[k(`label`,gt,L(N(V)(`@NPM01:脚本名称`))+`:`,1),R(F,{modelValue:l.value,"onUpdate:modelValue":i[1]||=e=>l.value=e,placeholder:N(V)(`@NPM01:例如: build, dev, test`),disabled:v.value,clearable:``,onInput:w},null,8,[`modelValue`,`placeholder`,`disabled`]),b.value?(B(),z(`div`,_t,[R(P,null,{default:S(()=>[...i[7]||=[k(`svg`,{viewBox:`0 0 1024 1024`,xmlns:`http://www.w3.org/2000/svg`},[k(`path`,{fill:`currentColor`,d:`M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896zm0 832a384 384 0 1 0 0-768 384 384 0 0 0 0 768zm48-176a48 48 0 1 1-96 0 48 48 0 0 1 96 0zm-48-464a32 32 0 0 1 32 32v288a32 32 0 0 1-64 0V288a32 32 0 0 1 32-32z`})],-1)]]),_:1}),k(`span`,null,L(b.value),1)])):l.value.trim()&&!v.value?(B(),z(`div`,vt,[R(P,null,{default:S(()=>[...i[8]||=[k(`svg`,{viewBox:`0 0 1024 1024`,xmlns:`http://www.w3.org/2000/svg`},[k(`path`,{fill:`currentColor`,d:`M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896zm-55.808 536.384-99.52-99.584a38.4 38.4 0 1 0-54.336 54.336l126.72 126.72a38.272 38.272 0 0 0 54.336 0l262.4-262.464a38.4 38.4 0 1 0-54.272-54.336L456.192 600.384z`})],-1)]]),_:1}),k(`span`,null,L(N(V)(`@NPM01:脚本名称格式正确`)),1)])):I(``,!0)]),k(`div`,Z,[k(`label`,Q,L(N(V)(`@NPM01:脚本命令`))+`:`,1),R(F,{modelValue:u.value,"onUpdate:modelValue":i[2]||=e=>u.value=e,placeholder:N(V)(`@NPM01:例如: vite build, vite dev`),clearable:``},null,8,[`modelValue`,`placeholder`])])]),R(T,{type:`primary`,loading:d.value,disabled:!l.value.trim()||!u.value.trim(),onClick:re,class:`action-button`},{default:S(()=>[t(L(v.value?N(V)(`@NPM01:更新脚本`):N(V)(`@NPM01:添加脚本`)),1)]),_:1},8,[`loading`,`disabled`])])])]),_:1},8,[`label`])]),_:1},8,[`modelValue`])])]),_:1},8,[`model-value`,`title`])}}}),[[`__scopeId`,`data-v-d06ae56a`]]),yt={class:`npm-scripts-panel`},bt={class:`header-left`},xt={class:`panel-title`},St=[`aria-valuenow`,`aria-label`],Ct={key:0,class:`loading-container`},wt={class:`loading-text`},Tt={key:1,class:`empty-container`},Et={class:`empty-text`},Dt=[`onClick`],Ot={class:`package-info`},kt={class:`package-name`},At={class:`package-path`},jt={key:0,class:`scripts-list`},Mt=[`onClick`],Nt={class:`script-left`},Pt={class:`script-name`},Ft={class:`script-command`},It=200,Lt=600,Rt=16,zt=H(i({__name:`NpmScriptsPanel`,setup(e){let t=D(!0);function n(){t.value=!t.value}let r=D([]),i=D(!1),a=D(new Set),o=D(!1),l=D(``),u=D(null);function d(e){l.value=e.path,u.value=e,o.value=!0}function f(){o.value=!1,l.value=``,u.value=null}function p(){f(),M()}function m(e){if(!e)return null;if(typeof e==`string`)return e;if(typeof e==`object`&&e.url){let t=e.url;return t=t.replace(/^git\+/,``),t=t.replace(/\.git$/,``),t}return null}function g(e){let t=m(e.repository);t&&window.open(t,`_blank`)}let _=D(300),v=D(!1),ee=D(0),b=D(0);function x(e){v.value=!0,ee.value=e.clientY,b.value=_.value,document.addEventListener(`mousemove`,re),document.addEventListener(`mouseup`,ie),e.preventDefault()}function re(e){if(!v.value)return;let t=ee.value-e.clientY;_.value=Math.max(It,Math.min(Lt,b.value+t))}function ie(){v.value=!1,document.removeEventListener(`mousemove`,re),document.removeEventListener(`mouseup`,ie)}function A(e){e.key===`ArrowUp`?(e.preventDefault(),_.value=Math.min(Lt,_.value+Rt)):e.key===`ArrowDown`?(e.preventDefault(),_.value=Math.max(It,_.value-Rt)):e.key===`Home`?(e.preventDefault(),_.value=Lt):e.key===`End`&&(e.preventDefault(),_.value=It)}async function M(){let e=Date.now();console.log(`[NPM面板] 开始加载npm脚本...`);try{i.value=!0;let t=new AbortController,n=3e4,a=setTimeout(()=>{t.abort(),console.warn(`[NPM面板] 超时${n}ms,中断请求`)},n);console.log(`[NPM面板] 发起请求到后端(超时${n}ms)...`);let o=Date.now(),s=await fetch(`/api/scan-npm-scripts`,{signal:t.signal});clearTimeout(a);let c=Date.now()-o;console.log(`[NPM面板] 后端响应完成,耗时${c}ms`);let l=Date.now(),u=await s.json(),d=Date.now()-l;if(console.log(`[NPM面板] JSON解析完成,耗时${d}ms`),u.success){if(u.cancelled){console.log(`[NPM面板] 扫描被取消,总耗时${Date.now()-e}ms`);return}r.value=u.packages,console.log(`[NPM面板] 加载完成,找到${r.value.length}个package.json,共${u.totalScripts}个脚本,总耗时${Date.now()-e}ms`),r.value.length===0&&console.log(`[NPM面板] 未找到包含scripts的package.json`)}else console.error(`[NPM面板] 加载失败,耗时${Date.now()-e}ms`),T.error(V(`@NPM01:加载npm脚本失败`))}catch(t){t.name===`AbortError`?(console.warn(`[NPM面板] 请求超时被中断,耗时${Date.now()-e}ms`),T.warning(`NPM脚本扫描超时,请稍后重试`)):console.error(`[NPM面板] 加载失败,耗时${Date.now()-e}ms,错误:`,t)}finally{i.value=!1}}function ae(e){a.value.has(e)?a.value.delete(e):a.value.add(e)}async function oe(e,t){try{let n=await(await fetch(`/api/run-npm-script`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({packagePath:e,scriptName:t})})).json();n.success?T.success(`${V(`@NPM01:已在新终端中执行`)}: ${t}`):T.error(n.error||V(`@NPM01:执行脚本失败`))}catch(e){console.error(`执行npm脚本失败:`,e),T.error(`${V(`@NPM01:执行脚本失败`)}: ${e.message}`)}}return c(()=>{M()}),(e,c)=>{let l=te,v=s;return B(),z(`div`,yt,[k(`div`,{class:`panel-header accordion-header`,onClick:n},[k(`div`,bt,[R(l,{class:j([`accordion-chevron`,{"is-collapsed":t.value}])},{default:S(()=>[...c[1]||=[k(`svg`,{viewBox:`0 0 1024 1024`,xmlns:`http://www.w3.org/2000/svg`},[k(`path`,{fill:`currentColor`,d:`M340.864 149.312a30.592 30.592 0 0 0 0 42.752L652.736 512 340.864 831.872a30.592 30.592 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z`})],-1)]]),_:1},8,[`class`]),R(U,{"icon-class":`npm`,"class-name":`npm-icon`}),k(`span`,xt,L(N(V)(`@NPM01:NPM 脚本`)),1)]),k(`div`,{class:`header-right`,onClick:c[0]||=F(()=>{},[`stop`])},[R(W,{size:`small`,disabled:i.value,onClick:M},{default:S(()=>[R(l,{class:j({"is-rotating":i.value})},{default:S(()=>[...c[2]||=[k(`svg`,{viewBox:`0 0 1024 1024`,xmlns:`http://www.w3.org/2000/svg`},[k(`path`,{fill:`currentColor`,d:`M784.512 230.272v-50.56a32 32 0 1 1 64 0v149.056a32 32 0 0 1-32 32H667.52a32 32 0 1 1 0-64h92.992A320 320 0 1 0 524.8 833.152a320 320 0 0 0 320-320h64a384 384 0 0 1-384 384 384 384 0 0 1-384-384 384 384 0 0 1 643.712-282.88z`})],-1)]]),_:1},8,[`class`])]),_:1},8,[`disabled`])])]),h(k(`div`,{class:`resize-handle`,role:`separator`,tabindex:`0`,"aria-orientation":`horizontal`,"aria-valuenow":_.value,"aria-valuemin":It,"aria-valuemax":Lt,"aria-label":N(V)(`@NPM01:调整 NPM 脚本面板高度(上下方向键)`),onMousedown:x,onKeydown:A},null,40,St),[[ne,!t.value]]),!t.value&&i.value?(B(),z(`div`,Ct,[R(l,{class:`is-loading loading-icon`},{default:S(()=>[...c[3]||=[k(`svg`,{viewBox:`0 0 1024 1024`,xmlns:`http://www.w3.org/2000/svg`},[k(`path`,{fill:`currentColor`,d:`M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32zm0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32zm448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32zm-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32z`})],-1)]]),_:1}),k(`p`,wt,L(N(V)(`@NPM01:正在扫描项目中的 npm 脚本...`)),1)])):!t.value&&r.value.length===0?(B(),z(`div`,Tt,[c[4]||=k(`svg`,{class:`empty-icon`,viewBox:`0 0 1024 1024`,width:`64`,height:`64`},[k(`path`,{fill:`currentColor`,d:`M832 384H576V128H192v768h640V384zm-26.496-64L640 154.496V320h165.504zM160 64h480l256 256v608a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32z`})],-1),k(`p`,Et,L(N(V)(`@NPM01:当前项目中未找到包含 scripts 的 package.json`)),1)])):t.value?I(``,!0):(B(),z(`div`,{key:2,class:`packages-container`,style:w({maxHeight:_.value+`px`})},[(B(!0),z(O,null,y(r.value,e=>(B(),z(`div`,{key:e.path,class:`package-item`},[k(`div`,{class:`package-header`,onClick:t=>ae(e.path)},[R(l,{class:j([`expand-icon`,{expanded:a.value.has(e.path)}])},{default:S(()=>[...c[5]||=[k(`svg`,{viewBox:`0 0 1024 1024`,xmlns:`http://www.w3.org/2000/svg`},[k(`path`,{fill:`currentColor`,d:`M340.864 149.312a30.592 30.592 0 0 0 0 42.752L652.736 512 340.864 831.872a30.592 30.592 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z`})],-1)]]),_:1},8,[`class`]),R(l,{class:`folder-icon`},{default:S(()=>[R(N(E))]),_:1}),k(`div`,Ot,[k(`span`,kt,L(e.name),1),k(`span`,At,L(e.relativePath),1)]),m(e.repository)?(B(),C(v,{key:0,content:m(e.repository),placement:`bottom`,"show-after":300},{default:S(()=>[R(l,{class:`repo-icon`,onClick:F(t=>g(e),[`stop`])},{default:S(()=>[...c[6]||=[k(`svg`,{viewBox:`0 0 1024 1024`,xmlns:`http://www.w3.org/2000/svg`},[k(`path`,{fill:`currentColor`,d:`M458.64 119.072a84.176 84.176 0 0 1 106.72 0l366.912 300.4a32 32 0 0 1-40.544 49.52L524.816 168.592a20.176 20.176 0 0 0-25.632 0L132.272 468.992a32 32 0 1 1-40.544-49.52L458.64 119.072zM304.32 415.184c0-27.2 22-49.568 49.472-49.568h96.048a49.504 49.504 0 0 1 49.456 49.568v96.544c0 27.2-21.984 49.552-49.456 49.552H353.76a49.504 49.504 0 0 1-49.472-49.552V415.2z m64 14.432v67.68h66.976v-67.68H368.32z m-162.976 36.96a32 32 0 0 1 32 32v307.2c0 21.28 17.12 38.224 37.856 38.224h471.52a38.032 38.032 0 0 0 37.84-38.224v-307.2a32 32 0 1 1 64 0v307.2c0 56.304-45.44 102.224-101.856 102.224H275.2c-56.4 0-101.856-45.92-101.856-102.224v-307.2a32 32 0 0 1 32-32z m98.976 168.048c0-27.216 22-49.568 49.472-49.568h96.048a49.504 49.504 0 0 1 49.456 49.568v96.544c0 27.2-21.984 49.552-49.456 49.552H353.76a49.504 49.504 0 0 1-49.472-49.552v-96.544z m64 14.432v67.68h66.976v-67.68H368.32z m154.288-14.432c0-27.216 21.984-49.568 49.472-49.568h96.048a49.504 49.504 0 0 1 49.456 49.568v96.544c0 27.2-21.984 49.552-49.456 49.552h-96.048a49.504 49.504 0 0 1-49.472-49.552v-96.544z m64 14.432v67.68h66.976v-67.68h-66.976z`})],-1)]]),_:1},8,[`onClick`])]),_:2},1032,[`content`])):I(``,!0),R(l,{class:`settings-icon`,onClick:F(t=>d(e),[`stop`])},{default:S(()=>[...c[7]||=[k(`svg`,{viewBox:`0 0 1024 1024`,xmlns:`http://www.w3.org/2000/svg`},[k(`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},8,[`onClick`])],8,Dt),a.value.has(e.path)?(B(),z(`div`,jt,[(B(!0),z(O,null,y(e.scripts,(t,n)=>(B(),z(`div`,{key:n,class:`script-item`,onClick:t=>oe(e.path,n)},[k(`div`,Nt,[R(l,{class:`play-icon`},{default:S(()=>[...c[8]||=[k(`svg`,{viewBox:`0 0 1024 1024`,xmlns:`http://www.w3.org/2000/svg`},[k(`path`,{fill:`currentColor`,d:`M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z`}),k(`path`,{fill:`currentColor`,d:`M719.4 499.1l-296.1-215A15.9 15.9 0 0 0 398 297v430c0 13.1 14.8 20.5 25.3 12.9l296.1-215a15.9 15.9 0 0 0 0-25.8zm-257.6 134V390.9L628.5 512 461.8 633.1z`})],-1)]]),_:1}),k(`span`,Pt,L(n),1)]),k(`span`,Ft,L(t),1)],8,Mt))),128))])):I(``,!0)]))),128))],4)),u.value?(B(),C($,{key:3,visible:o.value,"package-info":u.value,onClose:f,onComplete:p},null,8,[`visible`,`package-info`])):I(``,!0)])}}}),[[`__scopeId`,`data-v-27b77c5b`]]),Bt={class:`custom-commands-panel`},Vt={class:`header-left`},Ht={class:`panel-title`},Ut=[`aria-valuenow`,`aria-label`],Wt={key:0,class:`empty-container`},Gt={class:`empty-text`},Kt=[`onClick`],qt={class:`command-left`},Jt={key:0,viewBox:`0 0 1024 1024`,xmlns:`http://www.w3.org/2000/svg`},Yt={key:1,viewBox:`0 0 1024 1024`,xmlns:`http://www.w3.org/2000/svg`},Xt={class:`command-info`},Zt={class:`command-name`},Qt={key:0,class:`command-desc`},$t={key:1,class:`command-desc command-text`},en=120,tn=600,nn=16,rn=H(i({__name:`CustomCommandsPanel`,setup(n){let r=D(!1);function i(){r.value=!r.value}let a=D(!1);function o(){a.value=!0}let s=he(),c=A(()=>s.customCommands||[]),l=D({}),u=D(240),d=D(!1),f=D(0),p=D(0);function m(e){d.value=!0,f.value=e.clientY,p.value=u.value,document.addEventListener(`mousemove`,g),document.addEventListener(`mouseup`,_),e.preventDefault()}function g(e){if(!d.value)return;let t=f.value-e.clientY;u.value=Math.max(en,Math.min(tn,p.value+t))}function _(){d.value=!1,document.removeEventListener(`mousemove`,g),document.removeEventListener(`mouseup`,_)}function v(e){e.key===`ArrowUp`?(e.preventDefault(),u.value=Math.min(tn,u.value+nn)):e.key===`ArrowDown`?(e.preventDefault(),u.value=Math.max(en,u.value-nn)):e.key===`Home`?(e.preventDefault(),u.value=tn):e.key===`End`&&(e.preventDefault(),u.value=en)}async function ee(e){let t=String(e.id||e.name);if(l.value[t])return;let n=e.directory||s.currentDirectory||``,r={};if(Array.isArray(e.params))for(let t of e.params)r[t.name]=t.defaultValue||``;let i=ge(e.command,r);l.value[t]=!0;try{let t=await(await fetch(`/api/exec-in-terminal`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({command:i,workingDirectory:n})})).json();t?.success?(T.success(V(`@CMDPANEL:已在新终端中执行`,{name:e.name})),window.dispatchEvent(new Event(`zen-gitsync:terminal-session-created`))):T.error(t?.error||V(`@CMDPANEL:执行失败`))}catch(e){T.error(e?.message||V(`@CMDPANEL:执行失败`))}finally{l.value[t]=!1}}return(n,s)=>{let d=te,f=e;return B(),z(O,null,[k(`div`,Bt,[k(`div`,{class:`panel-header accordion-header`,onClick:i},[k(`div`,Vt,[R(d,{class:j([`accordion-chevron`,{"is-collapsed":r.value}])},{default:S(()=>[...s[2]||=[k(`svg`,{viewBox:`0 0 1024 1024`,xmlns:`http://www.w3.org/2000/svg`},[k(`path`,{fill:`currentColor`,d:`M340.864 149.312a30.592 30.592 0 0 0 0 42.752L652.736 512 340.864 831.872a30.592 30.592 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z`})],-1)]]),_:1},8,[`class`]),R(U,{"icon-class":`command-list`,"class-name":`cmd-panel-icon`}),k(`span`,Ht,L(N(V)(`@CMDPANEL:自定义命令`)),1)]),k(`div`,{class:`header-right`,onClick:s[0]||=F(()=>{},[`stop`])},[R(W,{size:`small`,tooltip:N(V)(`@CMDPANEL:管理命令`),onClick:o},{default:S(()=>[R(d,null,{default:S(()=>[...s[3]||=[k(`svg`,{viewBox:`0 0 1024 1024`,xmlns:`http://www.w3.org/2000/svg`},[k(`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},8,[`tooltip`])])]),h(k(`div`,{class:`resize-handle`,role:`separator`,tabindex:`0`,"aria-orientation":`horizontal`,"aria-valuenow":u.value,"aria-valuemin":en,"aria-valuemax":tn,"aria-label":N(V)(`@CMDPANEL:调整自定义命令面板高度(上下方向键)`),onMousedown:m,onKeydown:v},null,40,Ut),[[ne,!r.value]]),!r.value&&c.value.length===0?(B(),z(`div`,Wt,[s[4]||=k(`svg`,{class:`empty-icon`,viewBox:`0 0 1024 1024`,width:`40`,height:`40`},[k(`path`,{fill:`currentColor`,d:`M832 384H576V128H192v768h640V384zm-26.496-64L640 154.496V320h165.504zM160 64h480l256 256v608a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32z`})],-1),k(`p`,Gt,L(N(V)(`@CMDPANEL:暂无自定义命令`)),1),R(f,{size:`small`,text:``,type:`primary`,onClick:o},{default:S(()=>[t(L(N(V)(`@CMDPANEL:去添加`)),1)]),_:1})])):r.value?I(``,!0):(B(),z(`div`,{key:1,class:`commands-list`,style:w({maxHeight:u.value+`px`})},[(B(!0),z(O,null,y(c.value,e=>(B(),z(`div`,{key:e.id||e.name,class:j([`command-item`,{running:l.value[String(e.id||e.name)]}]),onClick:t=>ee(e)},[k(`div`,qt,[R(d,{class:j([`play-icon`,{"is-loading":l.value[String(e.id||e.name)]}])},{default:S(()=>[l.value[String(e.id||e.name)]?(B(),z(`svg`,Yt,[...s[6]||=[k(`path`,{fill:`currentColor`,d:`M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32zm0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32zm448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32zm-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32z`},null,-1)]])):(B(),z(`svg`,Jt,[...s[5]||=[k(`path`,{fill:`currentColor`,d:`M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z`},null,-1),k(`path`,{fill:`currentColor`,d:`M719.4 499.1l-296.1-215A15.9 15.9 0 0 0 398 297v430c0 13.1 14.8 20.5 25.3 12.9l296.1-215a15.9 15.9 0 0 0 0-25.8zm-257.6 134V390.9L628.5 512 461.8 633.1z`},null,-1)]]))]),_:2},1032,[`class`]),k(`div`,Xt,[k(`span`,Zt,L(e.name),1),e.description?(B(),z(`span`,Qt,L(e.description),1)):(B(),z(`span`,$t,L(e.command),1))])])],10,Kt))),128))],4))]),R(G,{visible:a.value,"onUpdate:visible":s[1]||=e=>a.value=e,fullscreen:!0,onExecuteCommand:ee},null,8,[`visible`])],64)}}}),[[`__scopeId`,`data-v-d3276a57`]]),an={key:0,class:`stash-selected-files-button`},on={class:`stash-dialog-content`},sn={class:`stash-info-card`},cn={class:`info-icon`},ln={class:`info-content`},un={class:`stash-options`},dn={class:`options-title`},fn={class:`option-item`},pn={class:`option-label`},mn={class:`option-desc`},hn={class:`option-item`},gn={class:`option-label`},_n={class:`option-desc`},vn={key:0,class:`locked-count`},yn={class:`stash-preview`},bn={class:`preview-title`},xn={class:`file-count-info`},Sn={class:`file-list-preview`},Cn={key:0,class:`more-files`},wn={class:`dialog-footer`},Tn={class:`footer-actions`},En=[`disabled`],Dn=H(i({__name:`StashSelectedFilesButton`,props:{selectedFiles:{},variant:{default:`icon`}},emits:[`success`],setup(n,{emit:r}){let i=n,s=r,c=pe(),l=he(),d=D(!1),f=D(``),p=D(!0),m=D(!1),h=A(()=>i.selectedFiles.length>0),g=A(()=>i.selectedFiles.filter(e=>{let t=e.replace(/\\/g,`/`);return l.lockedFiles.some(e=>t===e.replace(/\\/g,`/`))}));function _(){if(!h.value){T.warning(V(`@76872:请先选择要储藏的文件`));return}f.value=``,m.value=!1,d.value=!0}async function b(){try{let e=i.selectedFiles;if(m.value&&g.value.length>0&&(e=i.selectedFiles.filter(e=>{let t=e.replace(/\\/g,`/`);return!l.lockedFiles.some(e=>t===e.replace(/\\/g,`/`))}),e.length===0)){T.warning(V(`@76872:所有选中的文件都是锁定文件,无法储藏`));return}await c.savePartialStash(e,f.value,p.value),d.value=!1,s(`success`)}catch(e){console.error(`储藏选中文件失败:`,e)}}function x(e){if(!(e.isComposing||e.keyCode===229)&&e.key===`Enter`&&!e.shiftKey){if(e.preventDefault(),c.isSavingStash)return;b()}}return(n,r)=>{let s=te,l=e,w=ee,T=P,E=o,ne=fe,D=u;return h.value?(B(),z(`div`,an,[i.variant===`icon`?(B(),C(W,{key:0,tooltip:N(V)(`@76872:储藏选中的文件`),size:`large`,disabled:N(c).isSavingStash||!h.value,"hover-color":`var(--color-warning)`,onClick:_},{default:S(()=>[N(c).isSavingStash?(B(),C(s,{key:0,class:`is-loading`},{default:S(()=>[R(N(a))]),_:1})):(B(),C(U,{key:1,"icon-class":`git-stash`}))]),_:1},8,[`tooltip`,`disabled`])):(B(),C(l,{key:1,type:`warning`,class:`action-button`,onClick:_,loading:N(c).isSavingStash,disabled:!h.value},{default:S(()=>[t(L(N(V)(`@76872:储藏选中文件`))+` (`+L(i.selectedFiles.length)+`) `,1)]),_:1},8,[`loading`,`disabled`])),R(me,{modelValue:d.value,"onUpdate:modelValue":r[4]||=e=>d.value=e,title:N(V)(`@76872:储藏选中的文件`),size:`medium`,"close-on-click-modal":!1,"custom-class":`stash-dialog`},{footer:S(()=>[k(`div`,wn,[k(`div`,Tn,[k(`button`,{type:`button`,class:`dialog-cancel-btn`,onClick:r[3]||=e=>d.value=!1},L(N(V)(`@76872:取消`)),1),k(`button`,{type:`button`,class:`dialog-confirm-btn`,onClick:b,disabled:N(c).isSavingStash},[N(c).isSavingStash?(B(),C(s,{key:1,class:`is-loading`},{default:S(()=>[R(N(a))]),_:1})):(B(),C(s,{key:0},{default:S(()=>[R(N(le))]),_:1})),k(`span`,null,L(N(V)(`@76872:储藏`)),1)],8,En)])])]),default:S(()=>[k(`div`,on,[k(`div`,sn,[k(`div`,cn,[R(U,{"icon-class":`git-stash`})]),k(`div`,ln,[k(`h4`,null,L(N(V)(`@76872:储藏选中的文件`)),1),k(`p`,null,L(N(V)(`@76872:将选中的文件更改临时保存,稍后可以重新应用`)),1)])]),R(D,{"label-position":`top`,class:`stash-form`},{default:S(()=>[R(T,{label:N(V)(`@76872:储藏说明`)},{default:S(()=>[R(w,{modelValue:f.value,"onUpdate:modelValue":r[0]||=e=>f.value=e,placeholder:N(V)(`@76872:为这次储藏添加描述信息(可选)`),clearable:``,onKeydown:x,rows:2,type:`textarea`,resize:`none`,maxlength:`200`,"show-word-limit":``},null,8,[`modelValue`,`placeholder`])]),_:1},8,[`label`]),k(`div`,un,[k(`h5`,dn,[R(s,null,{default:S(()=>[R(N(v))]),_:1}),t(` `+L(N(V)(`@76872:储藏选项`)),1)]),k(`div`,fn,[R(E,{modelValue:p.value,"onUpdate:modelValue":r[1]||=e=>p.value=e,size:`large`},{default:S(()=>[k(`span`,pn,L(N(V)(`@76872:包含未跟踪文件`)),1)]),_:1},8,[`modelValue`]),k(`p`,mn,L(N(V)(`@76872:对于未跟踪的文件,同时储藏 (--include-untracked)`)),1)]),k(`div`,hn,[R(E,{modelValue:m.value,"onUpdate:modelValue":r[2]||=e=>m.value=e,size:`large`},{default:S(()=>[k(`span`,gn,L(N(V)(`@76872:排除锁定文件`)),1)]),_:1},8,[`modelValue`]),k(`p`,_n,[t(L(N(V)(`@76872:不储藏被锁定的文件,保持其当前状态`))+` `,1),g.value.length>0?(B(),z(`span`,vn,` (`+L(N(V)(`@76872:选中`))+` `+L(g.value.length)+` `+L(N(V)(`@76872:个锁定文件`))+`) `,1)):I(``,!0)])])]),k(`div`,yn,[k(`h5`,bn,[R(U,{"icon-class":`git-stash`,style:{"font-size":`16px`}}),t(` `+L(N(V)(`@76872:将要储藏的文件`)),1)]),k(`div`,xn,[R(ne,{type:`warning`},{default:S(()=>[t(L(N(V)(`@76872:已选中: `))+L(i.selectedFiles.length)+` `+L(N(V)(`@76872:个文件`)),1)]),_:1})]),k(`div`,Sn,[(B(!0),z(O,null,y(i.selectedFiles.slice(0,10),e=>(B(),z(`div`,{key:e,class:`file-preview-item`},L(e),1))),128)),i.selectedFiles.length>10?(B(),z(`div`,Cn,L(N(V)(`@76872:...还有`))+` `+L(i.selectedFiles.length-10)+` `+L(N(V)(`@76872:个文件`)),1)):I(``,!0)])])]),_:1})])]),_:1},8,[`modelValue`,`title`])])):I(``,!0)}}}),[[`__scopeId`,`data-v-596abfbb`]]),On=H(i({__name:`DiscardAllChangesButton`,props:{variant:{default:`icon`},size:{default:`large`},selectedFiles:{default:()=>[]}},setup(n){let r=n,i=pe(),a=A(()=>Array.isArray(r.selectedFiles)&&r.selectedFiles.length>0),o=A(()=>r.selectedFiles?.length??0),c=A(()=>i.fileList.length>0);async function l(){try{await M.confirm(V(`@76872:确定要清除本地所有更改吗?`),V(`@76872:清除所有本地更改`),{confirmButtonText:V(`@76872:确定`),cancelButtonText:V(`@76872:取消`),confirmButtonClass:`el-button--danger`,dangerouslyUseHTMLString:!0,type:`warning`}),await i.discardAllChanges()&&(i.fetchStatus(),i.fetchLog())}catch(e){e!==`cancel`&&console.error(`清除本地更改失败:`,e)}}async function u(){let e=r.selectedFiles??[];if(e.length!==0)try{await M.confirm(V(`@76872:确定要清除所选的 {count} 个文件吗?`,{count:e.length}),V(`@76872:清除所选文件`),{confirmButtonText:V(`@76872:确定`),cancelButtonText:V(`@76872:取消`),confirmButtonClass:`el-button--danger`,dangerouslyUseHTMLString:!0,type:`warning`}),await i.discardSelectedFiles(e)&&(i.fetchStatus(),i.fetchLog())}catch(e){e!==`cancel`&&console.error(`清除所选文件失败:`,e)}}return(n,d)=>{let f=te,p=e,m=s;return c.value?(B(),z(O,{key:0},[r.variant===`icon`?(B(),C(W,{key:0,tooltip:a.value?N(V)(`@76872:清除所选 {count} 个文件`,{count:o.value}):N(V)(`@76872:清除所有本地更改`),size:r.size,"hover-color":`#f56c6c`,disabled:N(i).isResetting,onClick:d[0]||=e=>a.value?u():l()},{default:S(()=>[R(f,null,{default:S(()=>[R(N(ue))]),_:1})]),_:1},8,[`tooltip`,`size`,`disabled`])):(B(),C(m,{key:1,content:a.value?N(V)(`@76872:对所选文件执行 git checkout / git clean`):`git reset --hard && git clean -fd`,placement:`top`},{default:S(()=>[R(p,{type:`danger`,icon:N(ue),onClick:d[1]||=e=>a.value?u():l(),loading:N(i).isResetting,class:`action-button danger-button`},{default:S(()=>[t(L(a.value?N(V)(`@76872:清除所选 {count} 个文件`,{count:o.value}):N(V)(`@76872:清除所有本地更改`)),1)]),_:1},8,[`icon`,`loading`])]),_:1},8,[`content`]))],64)):I(``,!0)}}}),[[`__scopeId`,`data-v-ebfab1a0`]]),kn={class:`card git-status-card flex flex-col`},An={class:`status-header`},jn={class:`title-row`},Mn={class:`header-actions`},Nn={class:`flex items-center`},Pn=[`element-loading-text`],Fn={key:0,class:`status-box not-git-repo`},In={class:`empty-status`},Ln={class:`empty-title`},Rn={class:`empty-desc`},zn={class:`recent-projects`},Bn={class:`recent-projects__head`},Vn={class:`recent-projects__title`},Hn={class:`recent-projects__hint`},Un={key:0,class:`recent-projects__empty`},Wn={key:1,class:`recent-projects__empty`},Gn=[`aria-label`],Kn=[`title`,`aria-label`,`onClick`],qn={class:`recent-projects__name`},Jn={key:0,class:`recent-projects__tag`},Yn={class:`no-remote-tip`},Xn={class:`tip-header`},Zn={class:`tip-title`},Qn={class:`tip-body`},$n={class:`tip-text`},er={class:`tip-input-row`},tr={key:1,class:`status-box-wrap`},nr={key:0,class:`no-remote-tip`},rr={class:`tip-header`},ir={class:`tip-title`},ar={class:`tip-body`},or={class:`tip-text`},sr={class:`tip-input-row`},cr={key:1,class:`upstream-tip`},lr={class:`tip-header`},ur={class:`tip-title`},dr={class:`tip-body`},fr={class:`tip-text`},pr={class:`tip-actions`},mr={key:2,class:`branch-status-info`},hr={class:`branch-sync-status`},gr={class:`sync-status-content`},_r={class:`status-badges`},vr={class:`badge-content`},yr={class:`badge-content`},br={key:3,class:`file-list-wrapper`},xr={class:`file-list-header`},Sr={class:`header-left`},Cr={key:2,class:`file-count`},wr={class:`view-mode-toggle`},Tr={key:0,class:`selection-mode-banner`},Er={class:`banner-content`},Dr={class:`banner-text`},Or={class:`banner-actions`},kr={class:`file-list-container`},Ar={key:0,class:`tree-group`},jr=[`aria-expanded`],Mr={class:`file-count`},Nr={key:1,class:`tree-group`},Pr=[`aria-expanded`],Fr={class:`file-count`},Ir={key:2,class:`tree-group`},Lr=[`aria-expanded`],Rr={class:`file-count`},zr={key:3,class:`tree-group`},Br=[`aria-expanded`],Vr={class:`file-count`},Hr={key:4,class:`empty-status`},Ur={class:`empty-icon`},Wr={class:`empty-text`},Gr={class:`empty-subtext`},Kr={class:`lock-feature-description`},qr={class:`description-header`},Jr={class:`description-title`},Yr={class:`description-content`},Xr={key:0,class:`empty-locked-files`},Zr={class:`empty-icon`},Qr={class:`empty-tip`},$r={key:1,class:`locked-files-list`},ei={class:`locked-files-header`},ti={class:`locked-file-items`},ni={class:`file-info`},ri={class:`file-path-container`},ii={class:`file-name`},ai={class:`file-directory`},oi={class:`file-actions`},si={class:`pull-error-content`},ci={key:0},li={key:1},ui={class:`pull-error-detail`},di={class:`pull-error-label`},fi={class:`pull-error-pre`},pi={key:0,class:`pull-error-detail`},mi={class:`pull-error-label`},hi={class:`pull-error-pre`},gi=H(i({__name:`GitStatus`,props:{initialDirectory:{type:String,default:``}},setup(i,{expose:o}){let u=i,f=pe(),p=he(),_=A(()=>f.isLoadingStatus),v=D(``),w=D(``),E=D(null),ne=D(!1),ie=D(!1),se=D(-1),P=D(`compare`),le=D(``),F=D(``),ue=D({});function H(e){return!!ue.value[e]}let ge=A(()=>f.selectedFiles),G=A(()=>f.isSelectionMode);function _e(){f.toggleSelectionMode()}function Te(e){f.toggleFileSelection(e)}function Me(){f.selectedFiles.size===f.fileList.length?f.clearSelection():f.selectAllFiles()}function Ne(e){return f.selectedFiles.has(e)}let Pe=A(()=>Array.from(f.selectedFiles)),Fe=A(()=>f.fileList.map(e=>({path:e.path,name:e.path.split(`/`).pop()||e.path,type:e.type,locked:Z(e.path)})));async function Ie(e){P.value===`compare`?await Je(e):await Ge(e)}async function Le(e,t){try{let n=await(await fetch(`/api/open-file`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({filePath:e,context:t})})).json();n.success?T.success(n.message):T.error(n.error||V(`@13D1C:打开文件失败`))}catch(e){T.error(`${V(`@13D1C:打开文件失败: `)}${e.message}`)}}async function Re(e,t){try{let n=await(await fetch(`/api/open-with-vscode`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({filePath:e,context:t})})).json();n.success?T.success(n.message):T.error(n.error||V(`@13D1C:用VSCode打开文件失败`))}catch(e){T.error(`${V(`@13D1C:用VSCode打开文件失败: `)}${e.message}`)}}let ze=D(!1),K=D({staged:!1,unstaged:!1,untracked:!1,conflicted:!1}),q=A({get:()=>p.ui.fileListViewMode,set:e=>{p.ui.fileListViewMode=e}}),Be=D(u.initialDirectory||``);async function He(){try{if(Be.value||=(await(await fetch(`/api/current_directory`)).json()).directory||V(`@13D1C:未知目录`),!f.isGitRepo)return;await f.fetchStatus(),await f.getBranchStatus(),T({message:V(`@13D1C:Git 状态已刷新`),type:`success`})}catch(e){T({message:`刷新失败: `+e.message,type:`error`})}}async function Ue(e){try{await M.confirm(`确认解锁该文件?\n${e}`,V(`@13D1C:确认解锁`),{type:`warning`,confirmButtonText:V(`@13D1C:解锁`),cancelButtonText:V(`@13D1C:取消`)}),await p.unlockFile(e)}catch{}}async function We(){if(p.lockedFiles.length)try{await M.confirm(`${V(`@13D1C:确认解锁所有已锁定文件?共 `)}${p.lockedFiles.length}${V(`@13D1C: 个。`)}`,V(`@13D1C:清空全部锁定`),{type:`warning`,confirmButtonText:V(`@13D1C:全部解锁`),cancelButtonText:V(`@13D1C:取消`)});let e=[...p.lockedFiles];await Promise.all(e.map(e=>p.unlockFile(e))),await p.loadLockedFiles(),T.success(V(`@13D1C:已清空所有文件锁定`))}catch{}}async function Ge(e){try{ie.value=!0,w.value=``,le.value=``,F.value=``,E.value=null,v.value=e,se.value=f.fileList.findIndex(t=>t.path===e);let t=f.fileList[se.value];if(ve(e)){w.value=``,E.value=null;return}if(t&&t.type===`untracked`)try{let t=await(await fetch(`/api/file-content?file=${encodeURIComponent(e)}`)).json();t.success&&t.content?w.value=`diff --git a/${e} b/${e}\n${V(`@13D1C:新文件: `)}${e}\n--- /dev/null\n+++ b/${e}\n@@ -0,0 +1,${t.content.split(`
|
|
1
|
+
import"./rolldown-runtime-CMxvf4Kt.js";import{B as e,Cn as t,Ct as n,Dt as r,En as i,Et as a,F as o,G as s,In as c,Jt as l,K as u,Lt as d,M as f,P as p,Q as m,Qn as h,Qt as g,S as _,Ut as v,Vn as y,W as ee,X as b,Y as te,Yn as x,Zn as S,_n as C,_r as w,a as T,bt as E,cn as ne,cr as D,ct as re,dn as O,f as ie,gn as k,hn as A,hr as j,i as M,ln as ae,mr as N,o as oe,p as se,pt as ce,q as P,tt as le,un as F,ut as ue,vn as I,vr as L,wn as R,yn as z,yt as de,z as fe,zn as B}from"./element-plus-CJjFCgLP.js";import{n as V,t as H}from"./_plugin-vue_export-helper-Cpm3JOKV.js";import{a as pe,i as U,l as me,r as W,s as he}from"./index-SLuwYU5Z.js";import{n as ge}from"./commandParser-wwLxoJ92.js";import{t as G}from"./CustomCommandManager-B8Qjz_eU.js";import{t as _e}from"./fileIcon-B5p5pGN9.js";import{n as ve}from"./ImagePreview-yFJVtpwT.js";import{i as ye,n as be,o as xe,r as Se,s as Ce,t as we}from"./ResetToRemoteButton-BedpKd_z.js";import{a as Te,c as Ee,i as De,n as Oe,r as ke,s as Ae,t as je}from"./FileDiffViewer-D3PiL3r9.js";var Me={key:0,class:`file-group`},Ne={class:`file-count`},Pe={class:`file-list`},Fe=[`onClick`],Ie={class:`file-info`},Le={class:`file-type-icon mit-icon`,"aria-hidden":`true`},Re=[`xlink:href`],ze={class:`file-name-section`},K=[`title`],q={class:`file-directory`},Be={key:0,class:`file-actions`},Ve=H(i({__name:`FileGroup`,props:{files:{},title:{},groupKey:{},collapsedGroups:{},isFileLocked:{type:Function},isLocking:{type:Function},getFileName:{type:Function},getFileDirectory:{type:Function},isSelectionMode:{type:Boolean},isFileSelected:{type:Function}},emits:[`toggleCollapse`,`fileClick`,`toggleFileLock`,`stageFile`,`unstageFile`,`revertFileChanges`,`manageLockedFiles`,`toggleFileSelection`],setup(e,{emit:n}){let i=e,a=n,c=A(()=>i.files.length>0),l=A(()=>i.collapsedGroups[i.groupKey]);function u(){a(`toggleCollapse`,i.groupKey)}function d(e,t){i.isSelectionMode?(t?.stopPropagation(),a(`toggleFileSelection`,e.path)):a(`fileClick`,e)}function f(e){a(`toggleFileSelection`,e)}function p(e){a(`toggleFileLock`,e)}function m(){a(`manageLockedFiles`)}function g(e){a(`stageFile`,e)}function _(e){a(`unstageFile`,e)}function v(e){a(`revertFileChanges`,e)}function ee(e){switch(e){case`added`:return`A`;case`modified`:return`M`;case`deleted`:return`D`;case`conflicted`:return`!`;case`untracked`:return`U`;default:return``}}let x=e=>_e(i.getFileName(e));return(n,a)=>{let w=te,T=o,E=s;return c.value?(B(),z(`div`,Me,[k(`div`,{class:`file-group-header`,onClick:u},[R(w,{class:j([`collapse-icon`,{collapsed:l.value}])},{default:S(()=>[R(N(b))]),_:1},8,[`class`]),k(`span`,null,L(e.title),1),k(`span`,Ne,`(`+L(e.files.length)+`)`,1)]),h(k(`div`,Pe,[(B(!0),z(O,null,y(e.files,e=>(B(),z(`div`,{key:e.path,class:j([`file-item file-group-item`,{"is-loading":i.isLocking(e.path),locked:i.isFileLocked(e.path),selected:i.isSelectionMode&&i.isFileSelected?.(e.path),[`file-type-${e.type}`]:e.type}]),onClick:t=>d(e,t)},[k(`div`,Ie,[i.isSelectionMode?(B(),C(T,{key:0,"model-value":i.isFileSelected?.(e.path),onChange:t=>f(e.path),onClick:a[0]||=F(()=>{},[`stop`]),class:`file-checkbox`},null,8,[`model-value`,`onChange`])):I(``,!0),(B(),z(`svg`,Le,[k(`use`,{"xlink:href":`#${x(e.path)}`},null,8,Re)])),k(`div`,ze,[R(E,{content:i.getFileName(e.path),placement:`top`,disabled:i.getFileName(e.path).length<=25,"show-after":200},{default:S(()=>[k(`div`,{class:j([`file-name`,{"locked-file-name":i.isFileLocked(e.path),"deleted-file-name":e.type===`deleted`}])},[t(L(i.getFileName(e.path))+` `,1),i.isFileLocked(e.path)?(B(),C(w,{key:0,class:`lock-indicator`},{default:S(()=>[R(N(r))]),_:1})):I(``,!0)],2)]),_:2},1032,[`content`,`disabled`])]),k(`div`,{class:`file-path-section`,title:i.getFileDirectory(e.path)},[R(E,{content:i.getFileDirectory(e.path),placement:`top`,disabled:i.getFileDirectory(e.path).length<=30,"show-after":200},{default:S(()=>[k(`span`,q,L(i.getFileDirectory(e.path)),1)]),_:2},1032,[`content`,`disabled`])],8,K),k(`div`,{class:j([`file-status-indicator`,[e.type,{locked:i.isFileLocked(e.path)}]])},L(ee(e.type)),3)]),i.isSelectionMode?I(``,!0):(B(),z(`div`,Be,[R(Te,{"file-path":e.path,"file-type":e.type,"is-locked":i.isFileLocked(e.path),"is-locking":i.isLocking(e.path),onToggleLock:p,onStage:g,onUnstage:_,onRevert:v,onManageLockedFiles:m},null,8,[`file-path`,`file-type`,`is-locked`,`is-locking`])]))],10,Fe))),128))],512),[[ne,!l.value]])])):I(``,!0)}}}),[[`__scopeId`,`data-v-c6289494`]]),He={class:`settings-content`},Ue={class:`package-info-bar`},We={class:`info-label`},Ge={class:`info-value`},Ke={class:`info-path`},qe={class:`tab-content`},Je={class:`current-version`},J={class:`version-label`},Ye={class:`version-value`},Xe={class:`version-options`},Ze={class:`option-label`},Qe={class:`radio-content`},$e={class:`radio-label`},et={class:`radio-desc`},tt={class:`tab-content script-management`},Y={class:`scripts-list-section`},nt={class:`section-header`},rt={class:`section-title`},it={class:`script-count`},at={key:0,class:`empty-scripts`},X={key:1,class:`script-items`},ot={class:`script-item-content`},st={class:`script-name-tag`},ct={class:`name-text`},lt={class:`script-command`},ut={class:`script-item-actions`},dt={class:`script-form-section`},ft={class:`section-header`},pt={class:`section-title`},mt={class:`form-group`},ht={class:`form-item`},gt={class:`form-label`},_t={key:0,class:`error-tip`},vt={key:1,class:`success-tip`},Z={class:`form-item`},Q={class:`form-label`},$=H(i({__name:`NpmSettingsDialog`,props:{visible:{type:Boolean},packageInfo:{}},emits:[`close`,`complete`],setup(n,{emit:r}){let i=n,a=r,o=D(`version`),s=D(`patch`),c=D(!1),l=D(``),u=D(``),d=D(!1),m=D(``),h=D(!1),g=D(!1),v=D(!1),b=D(``);function x(e){return e.trim()?e.includes(` `)?(b.value=V(`@NPM01:脚本名称不能包含空格`),!1):/^[a-zA-Z_:][a-zA-Z0-9_:.-]*$/.test(e)?(b.value=``,!0):(b.value=V(`@NPM01:脚本名称只能包含字母、数字、连字符、冒号、下划线和点号,且不能以数字开头`),!1):(b.value=``,!1)}function w(){l.value.trim()?x(l.value):b.value=``}let E=[{label:V(`@NPM01:主版本号 (major)`),value:`major`,desc:`1.0.0 → 2.0.0`},{label:V(`@NPM01:次版本号 (minor)`),value:`minor`,desc:`1.0.0 → 1.1.0`},{label:V(`@NPM01:修订号 (patch)`),value:`patch`,desc:`1.0.0 → 1.0.1`}];async function ne(){try{c.value=!0;let e=await(await fetch(`/api/update-npm-version`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({packagePath:i.packageInfo.path,versionType:s.value})})).json();e.success?(T.success(`${V(`@NPM01:版本号已更新`)}: ${e.oldVersion} → ${e.newVersion}`),a(`complete`)):T.error(e.error||V(`@NPM01:更新版本号失败`))}catch(e){console.error(`更新版本号失败:`,e),T.error(V(`@NPM01:更新版本号失败`))}finally{c.value=!1}}async function re(){if(!l.value.trim()){T.warning(V(`@NPM01:请输入脚本名称`));return}if(!x(l.value)){T.warning(b.value||V(`@NPM01:脚本名称格式不正确`));return}if(!u.value.trim()){T.warning(V(`@NPM01:请输入脚本命令`));return}try{d.value=!0;let e=v.value?`/api/update-npm-script`:`/api/add-npm-script`,t=await(await fetch(e,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({packagePath:i.packageInfo.path,scriptName:l.value.trim(),scriptCommand:u.value.trim(),oldScriptName:v.value?m.value:void 0})})).json();t.success?(T.success(v.value?V(`@NPM01:脚本已更新`):V(`@NPM01:脚本已添加`)),j(),a(`complete`)):T.error(t.error||(v.value?V(`@NPM01:更新脚本失败`):V(`@NPM01:添加脚本失败`)))}catch(e){console.error(`保存脚本失败:`,e),T.error(v.value?V(`@NPM01:更新脚本失败`):V(`@NPM01:添加脚本失败`))}finally{d.value=!1}}function A(e,t){v.value=!0,m.value=e,l.value=e,u.value=t,b.value=``}function j(){v.value=!1,m.value=``,l.value=``,u.value=``,b.value=``}async function ae(e){try{g.value=!0;let t=await(await fetch(`/api/pin-npm-script`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({packagePath:i.packageInfo.path,scriptName:e})})).json();t.success?(T.success(V(`@NPM01:脚本已置顶`)),a(`complete`)):T.error(t.error||V(`@NPM01:置顶脚本失败`))}catch(e){console.error(`置顶脚本失败:`,e),T.error(V(`@NPM01:置顶脚本失败`))}finally{g.value=!1}}async function oe(e){try{await M.confirm(V(`@NPM01:确定要删除脚本`)+` "${e}" `+V(`@NPM01:吗?`),V(`@NPM01:删除脚本`),{confirmButtonText:V(`@NPM01:确定`),cancelButtonText:V(`@NPM01:取消`),type:`warning`}),h.value=!0;let t=await(await fetch(`/api/delete-npm-script`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({packagePath:i.packageInfo.path,scriptName:e})})).json();t.success?(T.success(V(`@NPM01:脚本已删除`)),a(`complete`)):T.error(t.error||V(`@NPM01:删除脚本失败`))}catch(e){e!==`cancel`&&(console.error(`删除脚本失败:`,e),T.error(V(`@NPM01:删除脚本失败`)))}finally{h.value=!1}}function ce(){o.value=`version`,s.value=`patch`,j(),a(`close`)}return(r,i)=>{let a=f,x=p,T=e,D=ie,M=_,P=te,le=U,F=ee,ue=se;return B(),C(me,{"model-value":n.visible,title:n.packageInfo.name+` - `+N(V)(`@NPM01:NPM 设置`),size:`medium`,onClose:ce},{default:S(()=>[k(`div`,He,[k(`div`,Ue,[k(`span`,We,L(N(V)(`@NPM01:包名称`))+`:`,1),k(`span`,Ge,L(n.packageInfo.name),1),k(`span`,Ke,L(n.packageInfo.relativePath),1)]),R(ue,{modelValue:o.value,"onUpdate:modelValue":i[3]||=e=>o.value=e,class:`settings-tabs`},{default:S(()=>[R(D,{label:N(V)(`@NPM01:版本号管理`),name:`version`},{default:S(()=>[k(`div`,qe,[k(`div`,Je,[k(`span`,J,L(N(V)(`@NPM01:当前版本`))+`:`,1),k(`span`,Ye,L(n.packageInfo.version),1)]),k(`div`,Xe,[k(`label`,Ze,L(N(V)(`@NPM01:选择要增加的版本号类型`))+`:`,1),R(x,{modelValue:s.value,"onUpdate:modelValue":i[0]||=e=>s.value=e,class:`version-radio-group`},{default:S(()=>[(B(),z(O,null,y(E,e=>R(a,{key:e.value,value:e.value,border:``,class:`version-radio`},{default:S(()=>[k(`div`,Qe,[k(`span`,$e,L(e.label),1),k(`span`,et,L(e.desc),1)])]),_:2},1032,[`value`])),64))]),_:1},8,[`modelValue`])]),R(T,{type:`primary`,loading:c.value,onClick:ne,class:`action-button`},{default:S(()=>[t(L(N(V)(`@NPM01:更新版本号`)),1)]),_:1},8,[`loading`])])]),_:1},8,[`label`]),R(D,{label:N(V)(`@NPM01:脚本管理`),name:`script`},{default:S(()=>[k(`div`,tt,[k(`div`,Y,[k(`div`,nt,[k(`span`,rt,L(N(V)(`@NPM01:当前脚本列表`)),1),k(`span`,it,L(Object.keys(n.packageInfo.scripts||{}).length)+` `+L(N(V)(`@NPM01:个脚本`)),1)]),Object.keys(n.packageInfo.scripts||{}).length===0?(B(),z(`div`,at,[R(M,{description:N(V)(`@NPM01:暂无脚本`),"image-size":80},null,8,[`description`])])):(B(),z(`div`,X,[(B(!0),z(O,null,y(n.packageInfo.scripts,(e,t)=>(B(),z(`div`,{key:t,class:`script-item-card`},[k(`div`,ot,[k(`div`,st,[R(P,{class:`script-icon`},{default:S(()=>[...i[4]||=[k(`svg`,{viewBox:`0 0 1024 1024`,xmlns:`http://www.w3.org/2000/svg`},[k(`path`,{fill:`currentColor`,d:`M160 224a64 64 0 0 0-64 64v448a64 64 0 0 0 64 64h704a64 64 0 0 0 64-64V288a64 64 0 0 0-64-64H160zm0-64h704a128 128 0 0 1 128 128v448a128 128 0 0 1-128 128H160A128 128 0 0 1 32 736V288a128 128 0 0 1 128-128z`}),k(`path`,{fill:`currentColor`,d:`m448 327.872 163.2 160-163.2 160-45.248-46.08L502.4 487.872l-99.648-99.84L448 327.872z`})],-1)]]),_:1}),k(`span`,ct,L(t),1)]),k(`div`,lt,[k(`code`,null,L(e),1)])]),k(`div`,ut,[R(T,{size:`small`,text:``,class:`pin-button`,onClick:e=>ae(t),loading:g.value,title:`置顶`},{default:S(()=>[R(le,{"icon-class":`pin`,"class-name":`pin-icon`})]),_:1},8,[`onClick`,`loading`]),R(T,{size:`small`,type:`primary`,text:``,onClick:n=>A(t,e),disabled:v.value&&m.value===t,title:N(V)(`@NPM01:编辑`)},{default:S(()=>[R(P,null,{default:S(()=>[...i[5]||=[k(`svg`,{viewBox:`0 0 1024 1024`,xmlns:`http://www.w3.org/2000/svg`},[k(`path`,{fill:`currentColor`,d:`M832 512a32 32 0 1 1 64 0v352a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h352a32 32 0 0 1 0 64H192v640h640V512z`}),k(`path`,{fill:`currentColor`,d:`m469.952 554.24 52.8-7.552L847.104 222.4a32 32 0 1 0-45.248-45.248L477.44 501.44l-7.552 52.8zm422.4-422.4a96 96 0 0 1 0 135.808l-331.84 331.84a32 32 0 0 1-18.112 9.088l-139.456 19.904a32 32 0 0 1-36.224-36.224l19.904-139.456a32 32 0 0 1 9.024-18.112l331.904-331.84a96 96 0 0 1 135.808 0z`})],-1)]]),_:1})]),_:1},8,[`onClick`,`disabled`,`title`]),R(T,{size:`small`,type:`danger`,text:``,onClick:e=>oe(t),loading:h.value,title:N(V)(`@NPM01:删除`)},{default:S(()=>[R(P,null,{default:S(()=>[...i[6]||=[k(`svg`,{viewBox:`0 0 1024 1024`,xmlns:`http://www.w3.org/2000/svg`},[k(`path`,{fill:`currentColor`,d:`M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32V256zm448-64v-64H416v64h192zM224 896h576V256H224v640zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32zm192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32z`})],-1)]]),_:1})]),_:1},8,[`onClick`,`loading`,`title`])])]))),128))]))]),k(`div`,dt,[k(`div`,ft,[k(`span`,pt,L(v.value?N(V)(`@NPM01:编辑脚本`):N(V)(`@NPM01:添加新脚本`)),1),v.value?(B(),C(T,{key:0,size:`small`,text:``,onClick:j},{default:S(()=>[t(L(N(V)(`@NPM01:取消编辑`)),1)]),_:1})):I(``,!0)]),k(`div`,mt,[k(`div`,ht,[k(`label`,gt,L(N(V)(`@NPM01:脚本名称`))+`:`,1),R(F,{modelValue:l.value,"onUpdate:modelValue":i[1]||=e=>l.value=e,placeholder:N(V)(`@NPM01:例如: build, dev, test`),disabled:v.value,clearable:``,onInput:w},null,8,[`modelValue`,`placeholder`,`disabled`]),b.value?(B(),z(`div`,_t,[R(P,null,{default:S(()=>[...i[7]||=[k(`svg`,{viewBox:`0 0 1024 1024`,xmlns:`http://www.w3.org/2000/svg`},[k(`path`,{fill:`currentColor`,d:`M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896zm0 832a384 384 0 1 0 0-768 384 384 0 0 0 0 768zm48-176a48 48 0 1 1-96 0 48 48 0 0 1 96 0zm-48-464a32 32 0 0 1 32 32v288a32 32 0 0 1-64 0V288a32 32 0 0 1 32-32z`})],-1)]]),_:1}),k(`span`,null,L(b.value),1)])):l.value.trim()&&!v.value?(B(),z(`div`,vt,[R(P,null,{default:S(()=>[...i[8]||=[k(`svg`,{viewBox:`0 0 1024 1024`,xmlns:`http://www.w3.org/2000/svg`},[k(`path`,{fill:`currentColor`,d:`M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896zm-55.808 536.384-99.52-99.584a38.4 38.4 0 1 0-54.336 54.336l126.72 126.72a38.272 38.272 0 0 0 54.336 0l262.4-262.464a38.4 38.4 0 1 0-54.272-54.336L456.192 600.384z`})],-1)]]),_:1}),k(`span`,null,L(N(V)(`@NPM01:脚本名称格式正确`)),1)])):I(``,!0)]),k(`div`,Z,[k(`label`,Q,L(N(V)(`@NPM01:脚本命令`))+`:`,1),R(F,{modelValue:u.value,"onUpdate:modelValue":i[2]||=e=>u.value=e,placeholder:N(V)(`@NPM01:例如: vite build, vite dev`),clearable:``},null,8,[`modelValue`,`placeholder`])])]),R(T,{type:`primary`,loading:d.value,disabled:!l.value.trim()||!u.value.trim(),onClick:re,class:`action-button`},{default:S(()=>[t(L(v.value?N(V)(`@NPM01:更新脚本`):N(V)(`@NPM01:添加脚本`)),1)]),_:1},8,[`loading`,`disabled`])])])]),_:1},8,[`label`])]),_:1},8,[`modelValue`])])]),_:1},8,[`model-value`,`title`])}}}),[[`__scopeId`,`data-v-d06ae56a`]]),yt={class:`npm-scripts-panel`},bt={class:`header-left`},xt={class:`panel-title`},St=[`aria-valuenow`,`aria-label`],Ct={key:0,class:`loading-container`},wt={class:`loading-text`},Tt={key:1,class:`empty-container`},Et={class:`empty-text`},Dt=[`onClick`],Ot={class:`package-info`},kt={class:`package-name`},At={class:`package-path`},jt={key:0,class:`scripts-list`},Mt=[`onClick`],Nt={class:`script-left`},Pt={class:`script-name`},Ft={class:`script-command`},It=200,Lt=600,Rt=16,zt=H(i({__name:`NpmScriptsPanel`,setup(e){let t=D(!0);function n(){t.value=!t.value}let r=D([]),i=D(!1),a=D(new Set),o=D(!1),l=D(``),u=D(null);function d(e){l.value=e.path,u.value=e,o.value=!0}function f(){o.value=!1,l.value=``,u.value=null}function p(){f(),M()}function m(e){if(!e)return null;if(typeof e==`string`)return e;if(typeof e==`object`&&e.url){let t=e.url;return t=t.replace(/^git\+/,``),t=t.replace(/\.git$/,``),t}return null}function g(e){let t=m(e.repository);t&&window.open(t,`_blank`)}let _=D(300),v=D(!1),ee=D(0),b=D(0);function x(e){v.value=!0,ee.value=e.clientY,b.value=_.value,document.addEventListener(`mousemove`,re),document.addEventListener(`mouseup`,ie),e.preventDefault()}function re(e){if(!v.value)return;let t=ee.value-e.clientY;_.value=Math.max(It,Math.min(Lt,b.value+t))}function ie(){v.value=!1,document.removeEventListener(`mousemove`,re),document.removeEventListener(`mouseup`,ie)}function A(e){e.key===`ArrowUp`?(e.preventDefault(),_.value=Math.min(Lt,_.value+Rt)):e.key===`ArrowDown`?(e.preventDefault(),_.value=Math.max(It,_.value-Rt)):e.key===`Home`?(e.preventDefault(),_.value=Lt):e.key===`End`&&(e.preventDefault(),_.value=It)}async function M(){let e=Date.now();console.log(`[NPM面板] 开始加载npm脚本...`);try{i.value=!0;let t=new AbortController,n=3e4,a=setTimeout(()=>{t.abort(),console.warn(`[NPM面板] 超时${n}ms,中断请求`)},n);console.log(`[NPM面板] 发起请求到后端(超时${n}ms)...`);let o=Date.now(),s=await fetch(`/api/scan-npm-scripts`,{signal:t.signal});clearTimeout(a);let c=Date.now()-o;console.log(`[NPM面板] 后端响应完成,耗时${c}ms`);let l=Date.now(),u=await s.json(),d=Date.now()-l;if(console.log(`[NPM面板] JSON解析完成,耗时${d}ms`),u.success){if(u.cancelled){console.log(`[NPM面板] 扫描被取消,总耗时${Date.now()-e}ms`);return}r.value=u.packages,console.log(`[NPM面板] 加载完成,找到${r.value.length}个package.json,共${u.totalScripts}个脚本,总耗时${Date.now()-e}ms`),r.value.length===0&&console.log(`[NPM面板] 未找到包含scripts的package.json`)}else console.error(`[NPM面板] 加载失败,耗时${Date.now()-e}ms`),T.error(V(`@NPM01:加载npm脚本失败`))}catch(t){t.name===`AbortError`?(console.warn(`[NPM面板] 请求超时被中断,耗时${Date.now()-e}ms`),T.warning(`NPM脚本扫描超时,请稍后重试`)):console.error(`[NPM面板] 加载失败,耗时${Date.now()-e}ms,错误:`,t)}finally{i.value=!1}}function ae(e){a.value.has(e)?a.value.delete(e):a.value.add(e)}async function oe(e,t){try{let n=await(await fetch(`/api/run-npm-script`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({packagePath:e,scriptName:t})})).json();n.success?T.success(`${V(`@NPM01:已在新终端中执行`)}: ${t}`):T.error(n.error||V(`@NPM01:执行脚本失败`))}catch(e){console.error(`执行npm脚本失败:`,e),T.error(`${V(`@NPM01:执行脚本失败`)}: ${e.message}`)}}return c(()=>{M()}),(e,c)=>{let l=te,v=s;return B(),z(`div`,yt,[k(`div`,{class:`panel-header accordion-header`,onClick:n},[k(`div`,bt,[R(l,{class:j([`accordion-chevron`,{"is-collapsed":t.value}])},{default:S(()=>[...c[1]||=[k(`svg`,{viewBox:`0 0 1024 1024`,xmlns:`http://www.w3.org/2000/svg`},[k(`path`,{fill:`currentColor`,d:`M340.864 149.312a30.592 30.592 0 0 0 0 42.752L652.736 512 340.864 831.872a30.592 30.592 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z`})],-1)]]),_:1},8,[`class`]),R(U,{"icon-class":`npm`,"class-name":`npm-icon`}),k(`span`,xt,L(N(V)(`@NPM01:NPM 脚本`)),1)]),k(`div`,{class:`header-right`,onClick:c[0]||=F(()=>{},[`stop`])},[R(W,{size:`small`,disabled:i.value,onClick:M},{default:S(()=>[R(l,{class:j({"is-rotating":i.value})},{default:S(()=>[...c[2]||=[k(`svg`,{viewBox:`0 0 1024 1024`,xmlns:`http://www.w3.org/2000/svg`},[k(`path`,{fill:`currentColor`,d:`M784.512 230.272v-50.56a32 32 0 1 1 64 0v149.056a32 32 0 0 1-32 32H667.52a32 32 0 1 1 0-64h92.992A320 320 0 1 0 524.8 833.152a320 320 0 0 0 320-320h64a384 384 0 0 1-384 384 384 384 0 0 1-384-384 384 384 0 0 1 643.712-282.88z`})],-1)]]),_:1},8,[`class`])]),_:1},8,[`disabled`])])]),h(k(`div`,{class:`resize-handle`,role:`separator`,tabindex:`0`,"aria-orientation":`horizontal`,"aria-valuenow":_.value,"aria-valuemin":It,"aria-valuemax":Lt,"aria-label":N(V)(`@NPM01:调整 NPM 脚本面板高度(上下方向键)`),onMousedown:x,onKeydown:A},null,40,St),[[ne,!t.value]]),!t.value&&i.value?(B(),z(`div`,Ct,[R(l,{class:`is-loading loading-icon`},{default:S(()=>[...c[3]||=[k(`svg`,{viewBox:`0 0 1024 1024`,xmlns:`http://www.w3.org/2000/svg`},[k(`path`,{fill:`currentColor`,d:`M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32zm0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32zm448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32zm-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32z`})],-1)]]),_:1}),k(`p`,wt,L(N(V)(`@NPM01:正在扫描项目中的 npm 脚本...`)),1)])):!t.value&&r.value.length===0?(B(),z(`div`,Tt,[c[4]||=k(`svg`,{class:`empty-icon`,viewBox:`0 0 1024 1024`,width:`64`,height:`64`},[k(`path`,{fill:`currentColor`,d:`M832 384H576V128H192v768h640V384zm-26.496-64L640 154.496V320h165.504zM160 64h480l256 256v608a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32z`})],-1),k(`p`,Et,L(N(V)(`@NPM01:当前项目中未找到包含 scripts 的 package.json`)),1)])):t.value?I(``,!0):(B(),z(`div`,{key:2,class:`packages-container`,style:w({maxHeight:_.value+`px`})},[(B(!0),z(O,null,y(r.value,e=>(B(),z(`div`,{key:e.path,class:`package-item`},[k(`div`,{class:`package-header`,onClick:t=>ae(e.path)},[R(l,{class:j([`expand-icon`,{expanded:a.value.has(e.path)}])},{default:S(()=>[...c[5]||=[k(`svg`,{viewBox:`0 0 1024 1024`,xmlns:`http://www.w3.org/2000/svg`},[k(`path`,{fill:`currentColor`,d:`M340.864 149.312a30.592 30.592 0 0 0 0 42.752L652.736 512 340.864 831.872a30.592 30.592 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z`})],-1)]]),_:1},8,[`class`]),R(l,{class:`folder-icon`},{default:S(()=>[R(N(E))]),_:1}),k(`div`,Ot,[k(`span`,kt,L(e.name),1),k(`span`,At,L(e.relativePath),1)]),m(e.repository)?(B(),C(v,{key:0,content:m(e.repository),placement:`bottom`,"show-after":300},{default:S(()=>[R(l,{class:`repo-icon`,onClick:F(t=>g(e),[`stop`])},{default:S(()=>[...c[6]||=[k(`svg`,{viewBox:`0 0 1024 1024`,xmlns:`http://www.w3.org/2000/svg`},[k(`path`,{fill:`currentColor`,d:`M458.64 119.072a84.176 84.176 0 0 1 106.72 0l366.912 300.4a32 32 0 0 1-40.544 49.52L524.816 168.592a20.176 20.176 0 0 0-25.632 0L132.272 468.992a32 32 0 1 1-40.544-49.52L458.64 119.072zM304.32 415.184c0-27.2 22-49.568 49.472-49.568h96.048a49.504 49.504 0 0 1 49.456 49.568v96.544c0 27.2-21.984 49.552-49.456 49.552H353.76a49.504 49.504 0 0 1-49.472-49.552V415.2z m64 14.432v67.68h66.976v-67.68H368.32z m-162.976 36.96a32 32 0 0 1 32 32v307.2c0 21.28 17.12 38.224 37.856 38.224h471.52a38.032 38.032 0 0 0 37.84-38.224v-307.2a32 32 0 1 1 64 0v307.2c0 56.304-45.44 102.224-101.856 102.224H275.2c-56.4 0-101.856-45.92-101.856-102.224v-307.2a32 32 0 0 1 32-32z m98.976 168.048c0-27.216 22-49.568 49.472-49.568h96.048a49.504 49.504 0 0 1 49.456 49.568v96.544c0 27.2-21.984 49.552-49.456 49.552H353.76a49.504 49.504 0 0 1-49.472-49.552v-96.544z m64 14.432v67.68h66.976v-67.68H368.32z m154.288-14.432c0-27.216 21.984-49.568 49.472-49.568h96.048a49.504 49.504 0 0 1 49.456 49.568v96.544c0 27.2-21.984 49.552-49.456 49.552h-96.048a49.504 49.504 0 0 1-49.472-49.552v-96.544z m64 14.432v67.68h66.976v-67.68h-66.976z`})],-1)]]),_:1},8,[`onClick`])]),_:2},1032,[`content`])):I(``,!0),R(l,{class:`settings-icon`,onClick:F(t=>d(e),[`stop`])},{default:S(()=>[...c[7]||=[k(`svg`,{viewBox:`0 0 1024 1024`,xmlns:`http://www.w3.org/2000/svg`},[k(`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},8,[`onClick`])],8,Dt),a.value.has(e.path)?(B(),z(`div`,jt,[(B(!0),z(O,null,y(e.scripts,(t,n)=>(B(),z(`div`,{key:n,class:`script-item`,onClick:t=>oe(e.path,n)},[k(`div`,Nt,[R(l,{class:`play-icon`},{default:S(()=>[...c[8]||=[k(`svg`,{viewBox:`0 0 1024 1024`,xmlns:`http://www.w3.org/2000/svg`},[k(`path`,{fill:`currentColor`,d:`M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z`}),k(`path`,{fill:`currentColor`,d:`M719.4 499.1l-296.1-215A15.9 15.9 0 0 0 398 297v430c0 13.1 14.8 20.5 25.3 12.9l296.1-215a15.9 15.9 0 0 0 0-25.8zm-257.6 134V390.9L628.5 512 461.8 633.1z`})],-1)]]),_:1}),k(`span`,Pt,L(n),1)]),k(`span`,Ft,L(t),1)],8,Mt))),128))])):I(``,!0)]))),128))],4)),u.value?(B(),C($,{key:3,visible:o.value,"package-info":u.value,onClose:f,onComplete:p},null,8,[`visible`,`package-info`])):I(``,!0)])}}}),[[`__scopeId`,`data-v-27b77c5b`]]),Bt={class:`custom-commands-panel`},Vt={class:`header-left`},Ht={class:`panel-title`},Ut=[`aria-valuenow`,`aria-label`],Wt={key:0,class:`empty-container`},Gt={class:`empty-text`},Kt=[`onClick`],qt={class:`command-left`},Jt={key:0,viewBox:`0 0 1024 1024`,xmlns:`http://www.w3.org/2000/svg`},Yt={key:1,viewBox:`0 0 1024 1024`,xmlns:`http://www.w3.org/2000/svg`},Xt={class:`command-info`},Zt={class:`command-name`},Qt={key:0,class:`command-desc`},$t={key:1,class:`command-desc command-text`},en=120,tn=600,nn=16,rn=H(i({__name:`CustomCommandsPanel`,setup(n){let r=D(!1);function i(){r.value=!r.value}let a=D(!1);function o(){a.value=!0}let s=he(),c=A(()=>s.customCommands||[]),l=D({}),u=D(240),d=D(!1),f=D(0),p=D(0);function m(e){d.value=!0,f.value=e.clientY,p.value=u.value,document.addEventListener(`mousemove`,g),document.addEventListener(`mouseup`,_),e.preventDefault()}function g(e){if(!d.value)return;let t=f.value-e.clientY;u.value=Math.max(en,Math.min(tn,p.value+t))}function _(){d.value=!1,document.removeEventListener(`mousemove`,g),document.removeEventListener(`mouseup`,_)}function v(e){e.key===`ArrowUp`?(e.preventDefault(),u.value=Math.min(tn,u.value+nn)):e.key===`ArrowDown`?(e.preventDefault(),u.value=Math.max(en,u.value-nn)):e.key===`Home`?(e.preventDefault(),u.value=tn):e.key===`End`&&(e.preventDefault(),u.value=en)}async function ee(e){let t=String(e.id||e.name);if(l.value[t])return;let n=e.directory||s.currentDirectory||``,r={};if(Array.isArray(e.params))for(let t of e.params)r[t.name]=t.defaultValue||``;let i=ge(e.command,r);l.value[t]=!0;try{let t=await(await fetch(`/api/exec-in-terminal`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({command:i,workingDirectory:n})})).json();t?.success?(T.success(V(`@CMDPANEL:已在新终端中执行`,{name:e.name})),window.dispatchEvent(new Event(`zen-gitsync:terminal-session-created`))):T.error(t?.error||V(`@CMDPANEL:执行失败`))}catch(e){T.error(e?.message||V(`@CMDPANEL:执行失败`))}finally{l.value[t]=!1}}return(n,s)=>{let d=te,f=e;return B(),z(O,null,[k(`div`,Bt,[k(`div`,{class:`panel-header accordion-header`,onClick:i},[k(`div`,Vt,[R(d,{class:j([`accordion-chevron`,{"is-collapsed":r.value}])},{default:S(()=>[...s[2]||=[k(`svg`,{viewBox:`0 0 1024 1024`,xmlns:`http://www.w3.org/2000/svg`},[k(`path`,{fill:`currentColor`,d:`M340.864 149.312a30.592 30.592 0 0 0 0 42.752L652.736 512 340.864 831.872a30.592 30.592 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z`})],-1)]]),_:1},8,[`class`]),R(U,{"icon-class":`command-list`,"class-name":`cmd-panel-icon`}),k(`span`,Ht,L(N(V)(`@CMDPANEL:自定义命令`)),1)]),k(`div`,{class:`header-right`,onClick:s[0]||=F(()=>{},[`stop`])},[R(W,{size:`small`,tooltip:N(V)(`@CMDPANEL:管理命令`),onClick:o},{default:S(()=>[R(d,null,{default:S(()=>[...s[3]||=[k(`svg`,{viewBox:`0 0 1024 1024`,xmlns:`http://www.w3.org/2000/svg`},[k(`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},8,[`tooltip`])])]),h(k(`div`,{class:`resize-handle`,role:`separator`,tabindex:`0`,"aria-orientation":`horizontal`,"aria-valuenow":u.value,"aria-valuemin":en,"aria-valuemax":tn,"aria-label":N(V)(`@CMDPANEL:调整自定义命令面板高度(上下方向键)`),onMousedown:m,onKeydown:v},null,40,Ut),[[ne,!r.value]]),!r.value&&c.value.length===0?(B(),z(`div`,Wt,[s[4]||=k(`svg`,{class:`empty-icon`,viewBox:`0 0 1024 1024`,width:`40`,height:`40`},[k(`path`,{fill:`currentColor`,d:`M832 384H576V128H192v768h640V384zm-26.496-64L640 154.496V320h165.504zM160 64h480l256 256v608a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32z`})],-1),k(`p`,Gt,L(N(V)(`@CMDPANEL:暂无自定义命令`)),1),R(f,{size:`small`,text:``,type:`primary`,onClick:o},{default:S(()=>[t(L(N(V)(`@CMDPANEL:去添加`)),1)]),_:1})])):r.value?I(``,!0):(B(),z(`div`,{key:1,class:`commands-list`,style:w({maxHeight:u.value+`px`})},[(B(!0),z(O,null,y(c.value,e=>(B(),z(`div`,{key:e.id||e.name,class:j([`command-item`,{running:l.value[String(e.id||e.name)]}]),onClick:t=>ee(e)},[k(`div`,qt,[R(d,{class:j([`play-icon`,{"is-loading":l.value[String(e.id||e.name)]}])},{default:S(()=>[l.value[String(e.id||e.name)]?(B(),z(`svg`,Yt,[...s[6]||=[k(`path`,{fill:`currentColor`,d:`M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32zm0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32zm448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32zm-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32z`},null,-1)]])):(B(),z(`svg`,Jt,[...s[5]||=[k(`path`,{fill:`currentColor`,d:`M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z`},null,-1),k(`path`,{fill:`currentColor`,d:`M719.4 499.1l-296.1-215A15.9 15.9 0 0 0 398 297v430c0 13.1 14.8 20.5 25.3 12.9l296.1-215a15.9 15.9 0 0 0 0-25.8zm-257.6 134V390.9L628.5 512 461.8 633.1z`},null,-1)]]))]),_:2},1032,[`class`]),k(`div`,Xt,[k(`span`,Zt,L(e.name),1),e.description?(B(),z(`span`,Qt,L(e.description),1)):(B(),z(`span`,$t,L(e.command),1))])])],10,Kt))),128))],4))]),R(G,{visible:a.value,"onUpdate:visible":s[1]||=e=>a.value=e,fullscreen:!0,onExecuteCommand:ee},null,8,[`visible`])],64)}}}),[[`__scopeId`,`data-v-d3276a57`]]),an={key:0,class:`stash-selected-files-button`},on={class:`stash-dialog-content`},sn={class:`stash-info-card`},cn={class:`info-icon`},ln={class:`info-content`},un={class:`stash-options`},dn={class:`options-title`},fn={class:`option-item`},pn={class:`option-label`},mn={class:`option-desc`},hn={class:`option-item`},gn={class:`option-label`},_n={class:`option-desc`},vn={key:0,class:`locked-count`},yn={class:`stash-preview`},bn={class:`preview-title`},xn={class:`file-count-info`},Sn={class:`file-list-preview`},Cn={key:0,class:`more-files`},wn={class:`dialog-footer`},Tn={class:`footer-actions`},En=[`disabled`],Dn=H(i({__name:`StashSelectedFilesButton`,props:{selectedFiles:{},variant:{default:`icon`}},emits:[`success`],setup(n,{emit:r}){let i=n,s=r,c=pe(),l=he(),d=D(!1),f=D(``),p=D(!0),m=D(!1),h=A(()=>i.selectedFiles.length>0),g=A(()=>i.selectedFiles.filter(e=>{let t=e.replace(/\\/g,`/`);return l.lockedFiles.some(e=>t===e.replace(/\\/g,`/`))}));function _(){if(!h.value){T.warning(V(`@76872:请先选择要储藏的文件`));return}f.value=``,m.value=!1,d.value=!0}async function b(){try{let e=i.selectedFiles;if(m.value&&g.value.length>0&&(e=i.selectedFiles.filter(e=>{let t=e.replace(/\\/g,`/`);return!l.lockedFiles.some(e=>t===e.replace(/\\/g,`/`))}),e.length===0)){T.warning(V(`@76872:所有选中的文件都是锁定文件,无法储藏`));return}await c.savePartialStash(e,f.value,p.value),d.value=!1,s(`success`)}catch(e){console.error(`储藏选中文件失败:`,e)}}function x(e){if(!(e.isComposing||e.keyCode===229)&&e.key===`Enter`&&!e.shiftKey){if(e.preventDefault(),c.isSavingStash)return;b()}}return(n,r)=>{let s=te,l=e,w=ee,T=P,E=o,ne=fe,D=u;return h.value?(B(),z(`div`,an,[i.variant===`icon`?(B(),C(W,{key:0,tooltip:N(V)(`@76872:储藏选中的文件`),size:`large`,disabled:N(c).isSavingStash||!h.value,"hover-color":`var(--color-warning)`,onClick:_},{default:S(()=>[N(c).isSavingStash?(B(),C(s,{key:0,class:`is-loading`},{default:S(()=>[R(N(a))]),_:1})):(B(),C(U,{key:1,"icon-class":`git-stash`}))]),_:1},8,[`tooltip`,`disabled`])):(B(),C(l,{key:1,type:`warning`,class:`action-button`,onClick:_,loading:N(c).isSavingStash,disabled:!h.value},{default:S(()=>[t(L(N(V)(`@76872:储藏选中文件`))+` (`+L(i.selectedFiles.length)+`) `,1)]),_:1},8,[`loading`,`disabled`])),R(me,{modelValue:d.value,"onUpdate:modelValue":r[4]||=e=>d.value=e,title:N(V)(`@76872:储藏选中的文件`),size:`medium`,"close-on-click-modal":!1,"custom-class":`stash-dialog`},{footer:S(()=>[k(`div`,wn,[k(`div`,Tn,[k(`button`,{type:`button`,class:`dialog-cancel-btn`,onClick:r[3]||=e=>d.value=!1},L(N(V)(`@76872:取消`)),1),k(`button`,{type:`button`,class:`dialog-confirm-btn`,onClick:b,disabled:N(c).isSavingStash},[N(c).isSavingStash?(B(),C(s,{key:1,class:`is-loading`},{default:S(()=>[R(N(a))]),_:1})):(B(),C(s,{key:0},{default:S(()=>[R(N(le))]),_:1})),k(`span`,null,L(N(V)(`@76872:储藏`)),1)],8,En)])])]),default:S(()=>[k(`div`,on,[k(`div`,sn,[k(`div`,cn,[R(U,{"icon-class":`git-stash`})]),k(`div`,ln,[k(`h4`,null,L(N(V)(`@76872:储藏选中的文件`)),1),k(`p`,null,L(N(V)(`@76872:将选中的文件更改临时保存,稍后可以重新应用`)),1)])]),R(D,{"label-position":`top`,class:`stash-form`},{default:S(()=>[R(T,{label:N(V)(`@76872:储藏说明`)},{default:S(()=>[R(w,{modelValue:f.value,"onUpdate:modelValue":r[0]||=e=>f.value=e,placeholder:N(V)(`@76872:为这次储藏添加描述信息(可选)`),clearable:``,onKeydown:x,rows:2,type:`textarea`,resize:`none`,maxlength:`200`,"show-word-limit":``},null,8,[`modelValue`,`placeholder`])]),_:1},8,[`label`]),k(`div`,un,[k(`h5`,dn,[R(s,null,{default:S(()=>[R(N(v))]),_:1}),t(` `+L(N(V)(`@76872:储藏选项`)),1)]),k(`div`,fn,[R(E,{modelValue:p.value,"onUpdate:modelValue":r[1]||=e=>p.value=e,size:`large`},{default:S(()=>[k(`span`,pn,L(N(V)(`@76872:包含未跟踪文件`)),1)]),_:1},8,[`modelValue`]),k(`p`,mn,L(N(V)(`@76872:对于未跟踪的文件,同时储藏 (--include-untracked)`)),1)]),k(`div`,hn,[R(E,{modelValue:m.value,"onUpdate:modelValue":r[2]||=e=>m.value=e,size:`large`},{default:S(()=>[k(`span`,gn,L(N(V)(`@76872:排除锁定文件`)),1)]),_:1},8,[`modelValue`]),k(`p`,_n,[t(L(N(V)(`@76872:不储藏被锁定的文件,保持其当前状态`))+` `,1),g.value.length>0?(B(),z(`span`,vn,` (`+L(N(V)(`@76872:选中`))+` `+L(g.value.length)+` `+L(N(V)(`@76872:个锁定文件`))+`) `,1)):I(``,!0)])])]),k(`div`,yn,[k(`h5`,bn,[R(U,{"icon-class":`git-stash`,style:{"font-size":`16px`}}),t(` `+L(N(V)(`@76872:将要储藏的文件`)),1)]),k(`div`,xn,[R(ne,{type:`warning`},{default:S(()=>[t(L(N(V)(`@76872:已选中: `))+L(i.selectedFiles.length)+` `+L(N(V)(`@76872:个文件`)),1)]),_:1})]),k(`div`,Sn,[(B(!0),z(O,null,y(i.selectedFiles.slice(0,10),e=>(B(),z(`div`,{key:e,class:`file-preview-item`},L(e),1))),128)),i.selectedFiles.length>10?(B(),z(`div`,Cn,L(N(V)(`@76872:...还有`))+` `+L(i.selectedFiles.length-10)+` `+L(N(V)(`@76872:个文件`)),1)):I(``,!0)])])]),_:1})])]),_:1},8,[`modelValue`,`title`])])):I(``,!0)}}}),[[`__scopeId`,`data-v-596abfbb`]]),On=H(i({__name:`DiscardAllChangesButton`,props:{variant:{default:`icon`},size:{default:`large`},selectedFiles:{default:()=>[]}},setup(n){let r=n,i=pe(),a=A(()=>Array.isArray(r.selectedFiles)&&r.selectedFiles.length>0),o=A(()=>r.selectedFiles?.length??0),c=A(()=>i.fileList.length>0);async function l(){try{await M.confirm(V(`@76872:确定要清除本地所有更改吗?`),V(`@76872:清除所有本地更改`),{confirmButtonText:V(`@76872:确定`),cancelButtonText:V(`@76872:取消`),confirmButtonClass:`el-button--danger`,dangerouslyUseHTMLString:!0,type:`warning`}),await i.discardAllChanges()&&(i.fetchStatus(),i.fetchLog())}catch(e){e!==`cancel`&&console.error(`清除本地更改失败:`,e)}}async function u(){let e=r.selectedFiles??[];if(e.length!==0)try{await M.confirm(V(`@76872:确定要清除所选的 {count} 个文件吗?`,{count:e.length}),V(`@76872:清除所选文件`),{confirmButtonText:V(`@76872:确定`),cancelButtonText:V(`@76872:取消`),confirmButtonClass:`el-button--danger`,dangerouslyUseHTMLString:!0,type:`warning`}),await i.discardSelectedFiles(e)&&(i.fetchStatus(),i.fetchLog())}catch(e){e!==`cancel`&&console.error(`清除所选文件失败:`,e)}}return(n,d)=>{let f=te,p=e,m=s;return c.value?(B(),z(O,{key:0},[r.variant===`icon`?(B(),C(W,{key:0,tooltip:a.value?N(V)(`@76872:清除所选 {count} 个文件`,{count:o.value}):N(V)(`@76872:清除所有本地更改`),size:r.size,"hover-color":`#f56c6c`,disabled:N(i).isResetting,onClick:d[0]||=e=>a.value?u():l()},{default:S(()=>[R(f,null,{default:S(()=>[R(N(ue))]),_:1})]),_:1},8,[`tooltip`,`size`,`disabled`])):(B(),C(m,{key:1,content:a.value?N(V)(`@76872:对所选文件执行 git checkout / git clean`):`git reset --hard && git clean -fd`,placement:`top`},{default:S(()=>[R(p,{type:`danger`,icon:N(ue),onClick:d[1]||=e=>a.value?u():l(),loading:N(i).isResetting,class:`action-button danger-button`},{default:S(()=>[t(L(a.value?N(V)(`@76872:清除所选 {count} 个文件`,{count:o.value}):N(V)(`@76872:清除所有本地更改`)),1)]),_:1},8,[`icon`,`loading`])]),_:1},8,[`content`]))],64)):I(``,!0)}}}),[[`__scopeId`,`data-v-ebfab1a0`]]),kn={class:`card git-status-card flex flex-col`},An={class:`status-header`},jn={class:`title-row`},Mn={class:`header-actions`},Nn={class:`flex items-center`},Pn=[`element-loading-text`],Fn={key:0,class:`status-box not-git-repo`},In={class:`empty-status`},Ln={class:`empty-title`},Rn={class:`empty-desc`},zn={class:`recent-projects`},Bn={class:`recent-projects__head`},Vn={class:`recent-projects__title`},Hn={class:`recent-projects__hint`},Un={key:0,class:`recent-projects__empty`},Wn={key:1,class:`recent-projects__empty`},Gn=[`aria-label`],Kn=[`title`,`aria-label`,`onClick`],qn={class:`recent-projects__name`},Jn={key:0,class:`recent-projects__tag`},Yn={class:`no-remote-tip`},Xn={class:`tip-header`},Zn={class:`tip-title`},Qn={class:`tip-body`},$n={class:`tip-text`},er={class:`tip-input-row`},tr={key:1,class:`status-box-wrap`},nr={key:0,class:`no-remote-tip`},rr={class:`tip-header`},ir={class:`tip-title`},ar={class:`tip-body`},or={class:`tip-text`},sr={class:`tip-input-row`},cr={key:1,class:`upstream-tip`},lr={class:`tip-header`},ur={class:`tip-title`},dr={class:`tip-body`},fr={class:`tip-text`},pr={class:`tip-actions`},mr={key:2,class:`branch-status-info`},hr={class:`branch-sync-status`},gr={class:`sync-status-content`},_r={class:`status-badges`},vr={class:`badge-content`},yr={class:`badge-content`},br={key:3,class:`file-list-wrapper`},xr={class:`file-list-header`},Sr={class:`header-left`},Cr={key:2,class:`file-count`},wr={class:`view-mode-toggle`},Tr={key:0,class:`selection-mode-banner`},Er={class:`banner-content`},Dr={class:`banner-text`},Or={class:`banner-actions`},kr={class:`file-list-container`},Ar={key:0,class:`tree-group`},jr=[`aria-expanded`],Mr={class:`file-count`},Nr={key:1,class:`tree-group`},Pr=[`aria-expanded`],Fr={class:`file-count`},Ir={key:2,class:`tree-group`},Lr=[`aria-expanded`],Rr={class:`file-count`},zr={key:3,class:`tree-group`},Br=[`aria-expanded`],Vr={class:`file-count`},Hr={key:4,class:`empty-status`},Ur={class:`empty-icon`},Wr={class:`empty-text`},Gr={class:`empty-subtext`},Kr={class:`lock-feature-description`},qr={class:`description-header`},Jr={class:`description-title`},Yr={class:`description-content`},Xr={key:0,class:`empty-locked-files`},Zr={class:`empty-icon`},Qr={class:`empty-tip`},$r={key:1,class:`locked-files-list`},ei={class:`locked-files-header`},ti={class:`locked-file-items`},ni={class:`file-info`},ri={class:`file-path-container`},ii={class:`file-name`},ai={class:`file-directory`},oi={class:`file-actions`},si={class:`pull-error-content`},ci={key:0},li={key:1},ui={class:`pull-error-detail`},di={class:`pull-error-label`},fi={class:`pull-error-pre`},pi={key:0,class:`pull-error-detail`},mi={class:`pull-error-label`},hi={class:`pull-error-pre`},gi=H(i({__name:`GitStatus`,props:{initialDirectory:{type:String,default:``}},setup(i,{expose:o}){let u=i,f=pe(),p=he(),_=A(()=>f.isLoadingStatus),v=D(``),w=D(``),E=D(null),ne=D(!1),ie=D(!1),se=D(-1),P=D(`compare`),le=D(``),F=D(``),ue=D({});function H(e){return!!ue.value[e]}let ge=A(()=>f.selectedFiles),G=A(()=>f.isSelectionMode);function _e(){f.toggleSelectionMode()}function Te(e){f.toggleFileSelection(e)}function Me(){f.selectedFiles.size===f.fileList.length?f.clearSelection():f.selectAllFiles()}function Ne(e){return f.selectedFiles.has(e)}let Pe=A(()=>Array.from(f.selectedFiles)),Fe=A(()=>f.fileList.map(e=>({path:e.path,name:e.path.split(`/`).pop()||e.path,type:e.type,locked:Z(e.path)})));async function Ie(e){P.value===`compare`?await Je(e):await Ge(e)}async function Le(e,t){try{let n=await(await fetch(`/api/open-file`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({filePath:e,context:t})})).json();n.success?T.success(n.message):T.error(n.error||V(`@13D1C:打开文件失败`))}catch(e){T.error(`${V(`@13D1C:打开文件失败: `)}${e.message}`)}}async function Re(e,t){try{let n=await(await fetch(`/api/open-with-vscode`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({filePath:e,context:t})})).json();n.success?T.success(n.message):T.error(n.error||V(`@13D1C:用VSCode打开文件失败`))}catch(e){T.error(`${V(`@13D1C:用VSCode打开文件失败: `)}${e.message}`)}}let ze=D(!1),K=D({staged:!1,unstaged:!1,untracked:!1,conflicted:!1}),q=A({get:()=>p.ui.fileListViewMode,set:e=>{p.ui.fileListViewMode=e}}),Be=D(u.initialDirectory||``);async function He(){try{if(Be.value||=(await(await fetch(`/api/current_directory`)).json()).directory||V(`@13D1C:未知目录`),!f.isGitRepo)return;await f.fetchStatus(),await f.getBranchStatus(),T({message:V(`@13D1C:Git 状态已刷新`),type:`success`})}catch(e){T({message:`刷新失败: `+e.message,type:`error`})}}async function Ue(e){try{await M.confirm(`确认解锁该文件?\n${e}`,V(`@13D1C:确认解锁`),{type:`warning`,confirmButtonText:V(`@13D1C:解锁`),cancelButtonText:V(`@13D1C:取消`)}),await p.unlockFile(e)}catch{}}async function We(){if(p.lockedFiles.length)try{await M.confirm(`${V(`@13D1C:确认解锁所有已锁定文件?共 `)}${p.lockedFiles.length}${V(`@13D1C: 个。`)}`,V(`@13D1C:清空全部锁定`),{type:`warning`,confirmButtonText:V(`@13D1C:全部解锁`),cancelButtonText:V(`@13D1C:取消`)});let e=[...p.lockedFiles];await Promise.all(e.map(e=>p.unlockFile(e))),await p.loadLockedFiles(),T.success(V(`@13D1C:已清空所有文件锁定`))}catch{}}async function Ge(e){try{ie.value=!0,w.value=``,le.value=``,F.value=``,E.value=null,v.value=e,se.value=f.fileList.findIndex(t=>t.path===e);let t=f.fileList[se.value];if(ve(e)){w.value=``,E.value=null;return}if(t&&t.type===`untracked`)try{let t=await(await fetch(`/api/file-content?file=${encodeURIComponent(e)}`)).json();t.success&&t.content?w.value=`diff --git a/${e} b/${e}\n${V(`@13D1C:新文件: `)}${e}\n--- /dev/null\n+++ b/${e}\n@@ -0,0 +1,${t.content.split(`
|
|
2
2
|
`).length} @@\n`+t.content.split(`
|
|
3
3
|
`).map(e=>`+${e}`).join(`
|
|
4
4
|
`):w.value=`这是一个新文件,尚未被Git跟踪。
|
|
5
5
|
添加到暂存区后可以提交该文件。`}catch(e){console.error(`获取未跟踪文件内容失败:`,e),w.value=`这是一个新文件,尚未被Git跟踪。
|
|
6
|
-
添加到暂存区后可以提交该文件。`}else if(t&&t.type===`added`){let t=await(await fetch(`/api/diff-cached?file=${encodeURIComponent(e)}`)).json();w.value=t.diff||V(`@13D1C:没有变更`),E.value=t.stats||null}else{let t=await(await fetch(`/api/diff?file=${encodeURIComponent(e)}`)).json();w.value=t.diff||V(`@13D1C:没有变更`),E.value=t.stats||null}}catch(e){T({message:`获取文件差异失败: `+e.message,type:`error`}),w.value=`获取差异失败: `+e.message}finally{ie.value=!1}}async function Ke(e,t){let n=await(await fetch(`/api/git-file-content?rev=${encodeURIComponent(t)}&file=${encodeURIComponent(e)}`)).json();return n&&n.success?n.content||``:n?.error?`⚠️ ${n.error}`:``}async function qe(e){let t=await(await fetch(`/api/file-content?file=${encodeURIComponent(e)}`)).json();return t&&t.success?t.content||``:t?.error?`⚠️ ${t.error}`:``}async function Je(e){try{ie.value=!0,w.value=``,E.value=null,v.value=e,se.value=f.fileList.findIndex(t=>t.path===e);let t=f.fileList[se.value];if(t&&t.type===`untracked`){le.value=``,F.value=await qe(e);return}if(t&&t.type===`deleted`){le.value=await Ke(e,`HEAD`),F.value=``;return}if(t&&t.type===`added`){le.value=await Ke(e,`HEAD`),F.value=await Ke(e,`:`);return}let n=t&&(t.type===`staged`||t.type===`modified-staged`||t.type===`added`);le.value=await Ke(e,`HEAD`),F.value=n?await Ke(e,`:`):await qe(e)}finally{ie.value=!1}}function J(e){ne.value=!0,P.value=`compare`,f.fileList.length>0&&Je((f.fileList.find(t=>t.path===e.path)||f.fileList[0]).path)}function Ye(){P.value=`diff`,v.value&&Ge(v.value)}function Xe(){P.value=`compare`,v.value&&Je(v.value)}async function Ze(){if(!v.value){T.warning(V(`@13D1C:没有变更`));return}let e=w.value;if(!e)try{let t=f.fileList.find(e=>e.path===v.value);t?.type===`added`?e=(await(await fetch(`/api/diff-cached?file=${encodeURIComponent(v.value)}`)).json()).diff||``:t?.type!==`untracked`&&(e=(await(await fetch(`/api/diff?file=${encodeURIComponent(v.value)}`)).json()).diff||``)}catch{}if(!e){T.warning(V(`@13D1C:没有变更`));return}navigator.clipboard.writeText(e).then(()=>{T.success(V(`@13D1C:差异已复制到剪贴板`))}).catch(()=>{T.error(V(`@13D1C:复制失败`))})}async function Qe(e){await f.addFileToStage(e)}async function $e(e){await f.unstageFile(e)}async function et(){try{if(!f.isGitRepo)return;await f.fetchStatus(),await f.getBranchStatus(!0),T.success(V(`@13D1C:Git 状态已刷新`))}catch(e){T.error(`${V(`@13D1C:刷新失败: `)}${e.message}`)}}let tt=D(!1),Y=D({needsMerge:!1,error:``,fullError:``,pullOutput:``}),nt=D(!1);async function rt(){try{let e=await f.gitPull();e.success?await He():(Y.value={needsMerge:e.needsMerge,error:e.error,fullError:e.fullError,pullOutput:e.pullOutput},tt.value=!0)}catch(e){console.error(`拉取操作发生错误:`,e)}}async function it(){if(!nt.value){nt.value=!0;try{if(!await f.saveStash(void 0,!1,!1)){nt.value=!1;return}let e=await f.gitPull();if(await f.applyStash(`stash@{0}`,!0),!e.success){Y.value={needsMerge:e.needsMerge,error:e.error,fullError:e.fullError,pullOutput:e.pullOutput},tt.value=!0;return}await He()}catch(e){console.error(`Stash Pull Pop 操作发生错误:`,e)}finally{nt.value=!1}}}let at=D(!1),X=D(``),ot=D(!1);async function st(){if(!X.value.trim()){T.warning(V(`@13D1C:请输入远程仓库地址`));return}ot.value=!0;try{await f.addRemote(X.value.trim())&&(T.success(V(`@13D1C:已添加远程仓库`)),X.value=``)}finally{ot.value=!1}}let ct=D(!1),lt=D([]),ut=D(!1);async function dt(){ut.value=!0;try{let e=await(await fetch(`/api/recent_directories`,{cache:`no-store`})).json();e&&Array.isArray(e.directories)?lt.value=e.directories:lt.value=[]}catch{lt.value=[]}finally{ut.value=!1}}async function ft(e){if(e)try{let t=await(await fetch(`/api/open-new-tab-gui`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:e})})).json();t?.success||T.error(t?.error||V(`@13D1C:打开失败`))}catch(e){T.error(`${V(`@13D1C:打开失败`)}: ${e.message}`)}}function pt(e){if(!e.exists){T.warning(V(`@13D1C:目录不存在,无法打开`));return}ft(e.path)}x(()=>f.isGitRepo,e=>{!e&<.value.length===0&&dt()},{immediate:!0});async function mt(){ct.value=!0;try{await f.gitInit()&&(T.success(V(`@13D1C:Git仓库初始化成功`)),X.value.trim()&&(await f.addRemote(X.value.trim()),X.value=``),await He())}finally{ct.value=!1}}async function ht(){if(!f.currentBranch){T.warning(V(`@13D1C:未知当前分支`));return}try{at.value=!0;let e=`git push -u origin ${f.currentBranch}`,t=await(await fetch(`/api/exec`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({command:e})})).json();t.success?(T.success(V(`@13D1C:已推送并设置上游分支`)),await f.getAllBranches(),await f.getCurrentBranch(!0),await f.getBranchStatus(!0)):T.error(t.error||V(`@13D1C:设置上游失败`))}catch(e){T.error(`${V(`@13D1C:设置上游失败: `)}${e.message}`)}finally{at.value=!1}}async function gt(e){try{await M.confirm(`${V(`@13D1C:确定要撤回文件 "`)}${e}${V(`@13D1C:" 的所有修改吗?此操作无法撤销。`)}`,V(`@13D1C:撤回修改`),{confirmButtonText:V(`@13D1C:确定`),cancelButtonText:V(`@13D1C:取消`),type:`warning`});let t=await(await fetch(`/api/revert_file`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({filePath:e})})).json();t.success?(T.success(V(`@13D1C:已撤回文件修改`)),await He()):T.error(t.error?`${V(`@13D1C:撤回失败: `)}${t.error}`:V(`@13D1C:撤回文件修改失败,请重试`))}catch(e){if(e===`cancel`||e.message===`cancel`)return;let t=e.message||V(`@13D1C:未知错误`);t===`undefined`?T.error(V(`@13D1C:撤回文件修改失败,请重试`)):T.error(`${V(`@13D1C:撤回文件修改失败: `)}${t}`)}}function _t(e){let t=e.split(`/`);return t[t.length-1]}function vt(e){let t=e.split(`/`);return t.length<=1?``:t.slice(0,-1).join(`/`)}function Z(e){return xe(e,p.lockedFiles)}async function Q(e){if(!ue.value[e]){ue.value[e]=!0;try{xe(e,p.lockedFiles)?await p.unlockFile(e):await p.lockFile(e)}finally{delete ue.value[e]}}}function $(e){K.value[e]=!K.value[e]}let yt=D([]),bt=D([]),xt=D([]),St=D([]);function Ct(){let e=ke(f.fileList.filter(e=>e.type===`conflicted`).map(e=>({path:e.path,type:e.type,locked:Z(e.path)})));yt.value.length>0&&De(e,yt.value),yt.value=e;let t=ke(f.fileList.filter(e=>e.type===`added`).map(e=>({path:e.path,type:e.type,locked:Z(e.path)})));bt.value.length>0&&De(t,bt.value),bt.value=t;let n=ke(f.fileList.filter(e=>e.type===`modified`||e.type===`deleted`).map(e=>({path:e.path,type:e.type,locked:Z(e.path)})));xt.value.length>0&&De(n,xt.value),xt.value=n;let r=ke(f.fileList.filter(e=>e.type===`untracked`).map(e=>({path:e.path,type:e.type,locked:Z(e.path)})));St.value.length>0&&De(r,St.value),St.value=r}return x(()=>f.fileList,()=>{q.value===`tree`&&Ct()},{deep:!0}),x(q,e=>{e===`tree`&&Ct(),window.dispatchEvent(new CustomEvent(`file-list-view-mode-change`,{detail:{mode:e}}))}),c(()=>{He(),p.loadConfig(),p.loadLockedFiles(),q.value===`tree`&&Ct();let e=e=>{let t=e.detail.mode;q.value!==t&&(q.value=t)},t=()=>{He(),v.value&&Ge(v.value)};window.addEventListener(`file-list-view-mode-change`,e),window.addEventListener(`git-status-refresh`,t);let n=()=>{document.visibilityState===`visible`&&f.isGitRepo&&(console.log(`[页面可见性] 标签页已激活,刷新Git状态和分支信息`),Promise.all([f.fetchStatus(),f.getBranchStatus()]).catch(e=>console.error(`刷新失败:`,e)))},r=()=>{f.isGitRepo&&(console.log(`[窗口焦点] 浏览器窗口已激活,刷新Git状态和分支信息`),Promise.all([f.fetchStatus(),f.getBranchStatus()]).catch(e=>console.error(`刷新失败:`,e)))};return document.addEventListener(`visibilitychange`,n),window.addEventListener(`focus`,r),()=>{window.removeEventListener(`file-list-view-mode-change`,e),window.removeEventListener(`git-status-refresh`,t),document.removeEventListener(`visibilitychange`,n),window.removeEventListener(`focus`,r)}}),o({refreshStatus:et}),(i,o)=>{let c=te,u=e,x=ee,T=fe,D=s,A=oe;return B(),z(O,null,[k(`div`,kn,[k(`div`,An,[k(`div`,jn,[k(`div`,Mn,[R(W,{tooltip:N(V)(`@13D1C:Git Pull (拉取远程更新)`),size:`medium`,"hover-color":`var(--color-primary)`,disabled:!N(f).hasUpstream||N(f).isGitPulling,onClick:rt},{default:S(()=>[N(f).isGitPulling?(B(),C(c,{key:0,class:`is-loading`},{default:S(()=>[R(N(a))]),_:1})):(B(),C(U,{key:1,"icon-class":`git-pull-request`}))]),_:1},8,[`tooltip`,`disabled`]),N(f).fileList.length>0?(B(),C(W,{key:0,tooltip:N(V)(`@13D1C:Stash → Pull → Stash Pop (储藏后拉取再还原)`),size:`medium`,"hover-color":`var(--color-primary)`,disabled:!N(f).hasUpstream||N(f).isGitPulling||nt.value,onClick:it},{default:S(()=>[nt.value?(B(),C(c,{key:0,class:`is-loading`},{default:S(()=>[R(N(a))]),_:1})):(B(),C(U,{key:1,"icon-class":`git-pull-request-with-stash`}))]),_:1},8,[`tooltip`,`disabled`])):I(``,!0),R(ye),R(Ce,{from:`status`}),G.value?I(``,!0):(B(),C(Se,{key:1})),R(be),G.value?I(``,!0):(B(),C(we,{key:2}))]),k(`div`,Nn,[N(f).fileList.length>0?(B(),C(W,{key:0,tooltip:N(V)(`@13D1C:复制全量 Diff`),size:`medium`,"hover-color":`var(--color-primary)`,onClick:o[0]||=e=>N(f).copyCurrentDiff()},{default:S(()=>[R(c,null,{default:S(()=>[R(N(re))]),_:1})]),_:1},8,[`tooltip`])):I(``,!0),R(W,{tooltip:N(V)(`@13D1C:刷新状态`),size:`medium`,disabled:_.value,onClick:et},{default:S(()=>[_.value?(B(),C(c,{key:0,class:`is-loading`},{default:S(()=>[R(N(a))]),_:1})):(B(),C(c,{key:1},{default:S(()=>[R(N(d))]),_:1}))]),_:1},8,[`tooltip`,`disabled`])])])]),h((B(),z(`div`,{class:`card-content`,"element-loading-text":N(f).isGitPulling?N(V)(`@13D1C:正在拉取代码...`):N(V)(`@13D1C:正在获取远程分支信息...`)},[N(f).isGitRepo?(B(),z(`div`,tr,[!N(f).remoteUrl&&!N(f).hasUpstream?(B(),z(`div`,nr,[k(`div`,rr,[R(c,{class:`tip-icon`},{default:S(()=>[R(N(g))]),_:1}),k(`span`,ir,L(N(V)(`@13D1C:尚未配置远程仓库`)),1)]),k(`div`,ar,[k(`div`,or,L(N(V)(`@13D1C:添加远程仓库后,即可推送分支并与团队协作。`)),1),k(`div`,sr,[R(x,{modelValue:X.value,"onUpdate:modelValue":o[2]||=e=>X.value=e,size:`small`,placeholder:N(V)(`@13D1C:输入远程仓库地址,例如 https://github.com/user/repo.git`),disabled:ot.value,onKeyup:ae(st,[`enter`])},null,8,[`modelValue`,`placeholder`,`disabled`]),R(u,{size:`small`,type:`primary`,plain:``,loading:ot.value,disabled:ot.value||!X.value.trim(),onClick:st},{default:S(()=>[t(L(N(V)(`@13D1C:添加远程仓库`)),1)]),_:1},8,[`loading`,`disabled`])])])])):I(``,!0),N(f).hasUpstream?I(``,!0):(B(),z(`div`,cr,[k(`div`,lr,[R(c,{class:`tip-icon`},{default:S(()=>[R(N(n))]),_:1}),k(`span`,ur,L(N(V)(`@13D1C:当前分支未设置上游分支`)),1)]),k(`div`,dr,[k(`div`,fr,L(N(V)(`@13D1C:首次推送后即可建立与远程的跟踪关系,后续可直接 pull/push。`)),1),k(`div`,pr,[R(u,{size:`small`,type:`primary`,plain:``,loading:at.value,disabled:at.value,onClick:ht},{default:S(()=>[t(L(N(V)(`@13D1C:设置上游并推送`)),1)]),_:1},8,[`loading`,`disabled`])])])])),N(f).hasUpstream&&(N(f).branchAhead>0||N(f).branchBehind>0)?(B(),z(`div`,mr,[k(`div`,hr,[k(`div`,gr,[R(D,{content:N(V)(`@13D1C:本地分支与远程分支的状态对比`),placement:`top`,"show-after":200},{default:S(()=>[k(`div`,_r,[N(f).branchAhead>0?(B(),C(T,{key:0,size:`small`,type:`warning`,class:`status-badge`},{default:S(()=>[k(`span`,vr,[R(c,null,{default:S(()=>[R(N(m))]),_:1}),t(` `+L(N(V)(`@13D1C:你的分支领先`,{branch:`origin/${N(f).currentBranch}`,count:N(f).branchAhead})),1)])]),_:1})):I(``,!0),N(f).branchBehind>0?(B(),C(T,{key:1,size:`small`,type:`info`,class:`status-badge`},{default:S(()=>[k(`span`,yr,[R(c,null,{default:S(()=>[R(N(b))]),_:1}),t(` `+L(N(V)(`@13D1C:你的分支落后`,{branch:`origin/${N(f).currentBranch}`,count:N(f).branchBehind})),1)])]),_:1})):I(``,!0)])]),_:1},8,[`content`])])])])):I(``,!0),N(f).fileList.length?(B(),z(`div`,br,[k(`div`,xr,[k(`div`,Sr,[N(f).fileList.length>0?(B(),C(W,{key:0,tooltip:G.value?N(V)(`@13D1C:退出选择模式`):N(V)(`@13D1C:选择文件进行储藏`),size:`small`,active:G.value,"hover-color":`var(--color-primary)`,onClick:_e},{default:S(()=>[R(U,{"icon-class":`muti-choose`})]),_:1},8,[`tooltip`,`active`])):I(``,!0),G.value&&ge.value.size>0?(B(),C(Dn,{key:1,"selected-files":Pe.value,onSuccess:_e},null,8,[`selected-files`])):I(``,!0),k(`h4`,null,L(N(V)(`@13D1C:文件列表`)),1),N(f).fileList.length>0?(B(),z(`span`,Cr,`(`+L(N(f).fileList.length)+`)`,1)):I(``,!0),R(On,{"selected-files":G.value?Pe.value:[],size:`small`},null,8,[`selected-files`])]),k(`div`,wr,[R(W,{tooltip:N(V)(`@E80AC:列表视图`),size:`small`,active:q.value===`list`,onClick:o[3]||=e=>q.value=`list`},{default:S(()=>[R(Ae,{style:{width:`1em`,height:`1em`}})]),_:1},8,[`tooltip`,`active`]),R(W,{tooltip:N(V)(`@E80AC:树状视图`),size:`small`,active:q.value===`tree`,onClick:o[4]||=e=>q.value=`tree`},{default:S(()=>[R(Ee,{style:{width:`1em`,height:`1em`}})]),_:1},8,[`tooltip`,`active`])])]),G.value?(B(),z(`div`,Tr,[k(`div`,Er,[k(`span`,Dr,[t(L(N(V)(`@13D1C:已选中`))+` `,1),k(`strong`,null,L(ge.value.size),1),t(` `+L(N(V)(`@13D1C:个文件`)),1)])]),k(`div`,Or,[R(u,{size:`small`,type:`primary`,plain:``,onClick:Me},{default:S(()=>[t(L(ge.value.size===N(f).fileList.length?N(V)(`@13D1C:取消全选`):N(V)(`@13D1C:全选`)),1)]),_:1})])])):I(``,!0),k(`div`,kr,[q.value===`list`?(B(),z(O,{key:0},[R(Ve,{files:N(f).fileList.filter(e=>e.type===`conflicted`),title:N(V)(`@13D1C:冲突文件`),"group-key":`conflicted`,"collapsed-groups":K.value,"is-file-locked":Z,"is-locking":H,"get-file-name":_t,"get-file-directory":vt,"is-selection-mode":G.value,"is-file-selected":Ne,onToggleCollapse:$,onFileClick:J,onToggleFileLock:Q,onToggleFileSelection:Te,onStageFile:Qe,onRevertFileChanges:gt},null,8,[`files`,`title`,`collapsed-groups`,`is-selection-mode`]),R(Ve,{files:N(f).fileList.filter(e=>e.type===`added`),title:N(V)(`@13D1C:已暂存的更改`),"group-key":`staged`,"collapsed-groups":K.value,"is-file-locked":Z,"is-locking":H,"get-file-name":_t,"get-file-directory":vt,"is-selection-mode":G.value,"is-file-selected":Ne,onToggleCollapse:$,onFileClick:J,onToggleFileLock:Q,onToggleFileSelection:Te,onUnstageFile:$e},null,8,[`files`,`title`,`collapsed-groups`,`is-selection-mode`]),R(Ve,{files:N(f).fileList.filter(e=>e.type===`modified`||e.type===`deleted`),title:N(V)(`@13D1C:未暂存的更改`),"group-key":`unstaged`,"collapsed-groups":K.value,"is-file-locked":Z,"is-locking":H,"get-file-name":_t,"get-file-directory":vt,"is-selection-mode":G.value,"is-file-selected":Ne,onToggleCollapse:$,onFileClick:J,onToggleFileLock:Q,onToggleFileSelection:Te,onStageFile:Qe,onRevertFileChanges:gt,onManageLockedFiles:o[5]||=e=>ze.value=!0},null,8,[`files`,`title`,`collapsed-groups`,`is-selection-mode`]),R(Ve,{files:N(f).fileList.filter(e=>e.type===`untracked`),title:N(V)(`@13D1C:未跟踪的文件`),"group-key":`untracked`,"collapsed-groups":K.value,"is-file-locked":Z,"is-locking":H,"get-file-name":_t,"get-file-directory":vt,"is-selection-mode":G.value,"is-file-selected":Ne,onToggleCollapse:$,onFileClick:J,onToggleFileLock:Q,onToggleFileSelection:Te,onStageFile:Qe,onRevertFileChanges:gt,onManageLockedFiles:o[6]||=e=>ze.value=!0},null,8,[`files`,`title`,`collapsed-groups`,`is-selection-mode`])],64)):(B(),z(O,{key:1},[N(f).fileList.filter(e=>e.type===`conflicted`).length?(B(),z(`div`,Ar,[k(`button`,{type:`button`,class:`tree-group-header`,"aria-expanded":!K.value.conflicted,"aria-controls":`tree-group-conflicted`,onClick:o[7]||=e=>$(`conflicted`)},[R(c,{class:j([`collapse-icon`,{collapsed:K.value.conflicted}]),"aria-hidden":`true`},{default:S(()=>[R(N(b))]),_:1},8,[`class`]),k(`h5`,null,L(N(V)(`@13D1C:冲突文件`)),1),k(`span`,Mr,L(N(f).fileList.filter(e=>e.type===`conflicted`).length),1)],8,jr),K.value.conflicted?I(``,!0):(B(),C(Oe,{key:0,"tree-data":yt.value,"selected-file":``,"show-action-buttons":!0,"is-file-locked":Z,"is-locking":H,onFileSelect:o[8]||=e=>J({path:e,type:`conflicted`}),onToggleLock:Q,onStage:Qe,onRevert:gt},null,8,[`tree-data`]))])):I(``,!0),N(f).fileList.filter(e=>e.type===`added`).length?(B(),z(`div`,Nr,[k(`button`,{type:`button`,class:`tree-group-header`,"aria-expanded":!K.value.staged,"aria-controls":`tree-group-staged`,onClick:o[9]||=e=>$(`staged`)},[R(c,{class:j([`collapse-icon`,{collapsed:K.value.staged}]),"aria-hidden":`true`},{default:S(()=>[R(N(b))]),_:1},8,[`class`]),k(`h5`,null,L(N(V)(`@13D1C:已暂存的更改`)),1),k(`span`,Fr,L(N(f).fileList.filter(e=>e.type===`added`).length),1)],8,Pr),K.value.staged?I(``,!0):(B(),C(Oe,{key:0,"tree-data":bt.value,"selected-file":``,"show-action-buttons":!0,"is-file-locked":Z,"is-locking":H,onFileSelect:o[10]||=e=>J({path:e,type:`added`}),onToggleLock:Q,onUnstage:$e},null,8,[`tree-data`]))])):I(``,!0),N(f).fileList.filter(e=>e.type===`modified`||e.type===`deleted`).length?(B(),z(`div`,Ir,[k(`button`,{type:`button`,class:`tree-group-header`,"aria-expanded":!K.value.unstaged,"aria-controls":`tree-group-unstaged`,onClick:o[11]||=e=>$(`unstaged`)},[R(c,{class:j([`collapse-icon`,{collapsed:K.value.unstaged}]),"aria-hidden":`true`},{default:S(()=>[R(N(b))]),_:1},8,[`class`]),k(`h5`,null,L(N(V)(`@13D1C:未暂存的更改`)),1),k(`span`,Rr,L(N(f).fileList.filter(e=>e.type===`modified`||e.type===`deleted`).length),1)],8,Lr),K.value.unstaged?I(``,!0):(B(),C(Oe,{key:0,"tree-data":xt.value,"selected-file":``,"show-action-buttons":!0,"is-file-locked":Z,"is-locking":H,onFileSelect:o[12]||=e=>J({path:e,type:`modified`}),onToggleLock:Q,onStage:Qe,onRevert:gt},null,8,[`tree-data`]))])):I(``,!0),N(f).fileList.filter(e=>e.type===`untracked`).length?(B(),z(`div`,zr,[k(`button`,{type:`button`,class:`tree-group-header`,"aria-expanded":!K.value.untracked,"aria-controls":`tree-group-untracked`,onClick:o[13]||=e=>$(`untracked`)},[R(c,{class:j([`collapse-icon`,{collapsed:K.value.untracked}]),"aria-hidden":`true`},{default:S(()=>[R(N(b))]),_:1},8,[`class`]),k(`h5`,null,L(N(V)(`@13D1C:未跟踪的文件`)),1),k(`span`,Vr,L(N(f).fileList.filter(e=>e.type===`untracked`).length),1)],8,Br),K.value.untracked?I(``,!0):(B(),C(Oe,{key:0,"tree-data":St.value,"selected-file":``,"show-action-buttons":!0,"is-file-locked":Z,"is-locking":H,onFileSelect:o[14]||=e=>J({path:e,type:`untracked`}),onToggleLock:Q,onStage:Qe,onRevert:gt},null,8,[`tree-data`]))])):I(``,!0)],64))])])):N(f).isGitRepo?(B(),z(`div`,Hr,[k(`div`,Ur,[R(c,null,{default:S(()=>[R(N(ce))]),_:1})]),k(`div`,Wr,L(N(V)(`@13D1C:没有检测到任何更改`)),1),k(`div`,Gr,L(N(V)(`@13D1C:工作区是干净的`)),1)])):I(``,!0)])):(B(),z(`div`,Fn,[k(`div`,In,[R(c,{class:`empty-icon`},{default:S(()=>[R(N(de))]),_:1}),k(`p`,Ln,L(N(V)(`@13D1C:当前目录不是Git仓库`)),1),k(`p`,Rn,L(N(V)(`@13D1C:请初始化Git仓库或切换到Git仓库目录`)),1),R(u,{size:`small`,type:`primary`,plain:``,loading:ct.value,disabled:ct.value,style:{"margin-top":`12px`},onClick:mt},{default:S(()=>[t(L(N(V)(`@13D1C:初始化Git仓库`)),1)]),_:1},8,[`loading`,`disabled`])]),k(`div`,zn,[k(`div`,Bn,[k(`span`,Vn,L(N(V)(`@13D1C:最近项目`)),1),k(`span`,Hn,L(N(V)(`@13D1C:点击在新标签页打开`)),1)]),ut.value&<.value.length===0?(B(),z(`div`,Un,[R(c,null,{default:S(()=>[R(N(a))]),_:1}),k(`span`,null,L(N(V)(`@13D1C:加载中…`)),1)])):lt.value.length===0?(B(),z(`div`,Wn,L(N(V)(`@13D1C:暂无最近项目`)),1)):(B(),z(`ul`,{key:2,class:`recent-projects__list`,"aria-label":N(V)(`@13D1C:最近项目列表`)},[(B(!0),z(O,null,y(lt.value,e=>(B(),z(`li`,{key:e.path,class:j([`recent-projects__item`,{"is-missing":!e.exists}])},[k(`button`,{type:`button`,class:`recent-projects__btn`,title:e.exists?e.path:N(V)(`@13D1C:目录不存在`),"aria-label":e.exists?N(V)(`@13D1C:在新标签页打开 {path}`,{path:e.path}):N(V)(`@13D1C:{path} (目录不存在)`,{path:e.path}),onClick:t=>pt(e)},[R(c,{class:`recent-projects__icon`,"aria-hidden":`true`},{default:S(()=>[R(N(de))]),_:1}),k(`span`,qn,L(e.path),1),e.exists?I(``,!0):(B(),z(`span`,Jn,L(N(V)(`@13D1C:不存在`)),1))],8,Kn)],2))),128))],8,Gn))]),k(`div`,Yn,[k(`div`,Xn,[R(c,{class:`tip-icon`},{default:S(()=>[R(N(g))]),_:1}),k(`span`,Zn,L(N(V)(`@13D1C:尚未配置远程仓库`)),1)]),k(`div`,Qn,[k(`div`,$n,L(N(V)(`@13D1C:添加远程仓库后,即可推送分支并与团队协作。`)),1),k(`div`,er,[R(x,{modelValue:X.value,"onUpdate:modelValue":o[1]||=e=>X.value=e,size:`small`,placeholder:N(V)(`@13D1C:输入远程仓库地址,例如 https://github.com/user/repo.git`),disabled:ct.value,onKeyup:ae(mt,[`enter`])},null,8,[`modelValue`,`placeholder`,`disabled`]),R(u,{size:`small`,type:`primary`,plain:``,loading:ct.value,disabled:ct.value,onClick:mt},{default:S(()=>[t(L(N(V)(`@13D1C:初始化并添加远程`)),1)]),_:1},8,[`loading`,`disabled`])])])])]))],8,Pn)),[[A,N(f).isGitPulling||N(f).isGitFetching]]),R(zt),R(rn)]),R(me,{modelValue:ne.value,"onUpdate:modelValue":o[15]||=e=>ne.value=e,title:N(V)(`@13D1C:文件差异`),"custom-class":`file-diff-dialog`,size:`fullscreen`,type:`flex`,"destroy-on-close":``,heightMode:`fixed`},{default:S(()=>[R(je,{files:Fe.value,diffContent:w.value,diffStats:E.value,selectedFile:v.value,isLoading:ie.value,compareMode:P.value===`compare`,compareOriginal:le.value,compareModified:F.value,context:`git-status`,showOpenButton:!0,showActionButtons:!0,isFileLocked:Z,isLocking:H,onFileSelect:Ie,onOpenFile:Le,onOpenWithVscode:Re,onToggleLock:Q,onStage:Qe,onUnstage:$e,onRevert:gt},{"header-extra":S(()=>[R(u,{size:`small`,type:P.value===`diff`?`primary`:`default`,onClick:Ye},{default:S(()=>[t(L(N(V)(`@13D1C:仅显示差异`)),1)]),_:1},8,[`type`]),R(u,{size:`small`,type:P.value===`compare`?`primary`:`default`,onClick:Xe},{default:S(()=>[t(L(N(V)(`@13D1C:显示完整对比`)),1)]),_:1},8,[`type`]),R(u,{size:`small`,disabled:!v.value,onClick:Ze},{default:S(()=>[t(L(N(V)(`@13D1C:复制差异`)),1)]),_:1},8,[`disabled`])]),_:1},8,[`files`,`diffContent`,`diffStats`,`selectedFile`,`isLoading`,`compareMode`,`compareOriginal`,`compareModified`])]),_:1},8,[`modelValue`,`title`]),R(me,{modelValue:ze.value,"onUpdate:modelValue":o[16]||=e=>ze.value=e,title:N(V)(`@13D1C:锁定文件管理`),size:`large`,"destroy-on-close":``},{default:S(()=>[k(`div`,Kr,[k(`div`,qr,[R(c,{class:`description-icon`},{default:S(()=>[R(N(n))]),_:1}),k(`span`,Jr,L(N(V)(`@13D1C:文件锁定功能说明`)),1)]),k(`div`,Yr,[k(`ul`,null,[k(`li`,null,L(N(V)(`@13D1C:锁定的文件在执行 Git 提交时会被自动跳过,不会被添加到暂存区`)),1)])])]),N(p).lockedFiles.length===0?(B(),z(`div`,Xr,[k(`div`,Zr,[R(c,null,{default:S(()=>[R(N(r))]),_:1})]),k(`p`,null,L(N(V)(`@13D1C:当前没有锁定的文件`)),1),k(`p`,Qr,L(N(V)(`@13D1C:您可以在文件列表中点击锁定按钮来锁定文件`)),1)])):(B(),z(`div`,$r,[k(`div`,ei,[k(`span`,null,`🔒 已锁定 `+L(N(p).lockedFiles.length)+` `+L(N(V)(`@13D1C:个文件`)),1),R(D,{content:N(V)(`@13D1C:这些文件在提交时会被自动跳过`),placement:`top`},{default:S(()=>[R(c,{class:`info-icon`},{default:S(()=>[R(N(n))]),_:1})]),_:1},8,[`content`]),o[19]||=k(`div`,{style:{flex:`1`}},null,-1),R(u,{type:`danger`,size:`small`,plain:``,disabled:!N(p).lockedFiles.length,onClick:We},{default:S(()=>[t(L(N(V)(`@13D1C:清空全部锁定`)),1)]),_:1},8,[`disabled`])]),k(`div`,ti,[(B(!0),z(O,null,y(N(p).lockedFiles,e=>(B(),z(`div`,{key:e,class:`locked-file-item`},[k(`div`,ni,[o[20]||=k(`div`,{class:`file-status-indicator locked`},null,-1),k(`div`,ri,[k(`span`,ii,L(_t(e)),1),k(`span`,ai,L(vt(e)),1)])]),k(`div`,oi,[R(W,{tooltip:N(V)(`@13D1C:解锁文件`),size:`small`,"hover-color":`var(--color-danger)`,"custom-class":`file-action-btn`,onClick:t=>Ue(e)},{default:S(()=>[R(c,null,{default:S(()=>[R(N(l))]),_:1})]),_:1},8,[`tooltip`,`onClick`])])]))),128))])]))]),_:1},8,[`modelValue`,`title`]),R(me,{modelValue:tt.value,"onUpdate:modelValue":o[17]||=e=>tt.value=e,title:Y.value.needsMerge?N(V)(`@13D1C:需要合并更改`):N(V)(`@13D1C:拉取失败`),size:`medium`,"show-footer":!0,"show-cancel":!1,"confirm-text":N(V)(`@13D1C:我知道了`),onConfirm:o[18]||=e=>tt.value=!1},{default:S(()=>[k(`div`,si,[k(`div`,{class:j([`pull-error-type`,Y.value.needsMerge?`is-warning`:`is-error`])},[R(c,{class:`pull-error-icon`},{default:S(()=>[R(N(n))]),_:1}),Y.value.needsMerge?(B(),z(`span`,ci,L(N(V)(`@13D1C:本地存在未提交的更改,与远程内容冲突,请先处理本地更改后再拉取。`)),1)):(B(),z(`span`,li,L(N(V)(`@13D1C:执行 git pull 时发生错误,请查看详细信息。`)),1))],2),k(`div`,ui,[k(`div`,di,L(N(V)(`@13D1C:错误详情`))+`:`,1),k(`pre`,fi,L(Y.value.fullError||Y.value.error),1)]),Y.value.pullOutput?(B(),z(`div`,pi,[k(`div`,mi,L(N(V)(`@13D1C:冲突详情`))+`:`,1),k(`pre`,hi,L(Y.value.pullOutput),1)])):I(``,!0)])]),_:1},8,[`modelValue`,`title`,`confirm-text`])],64)}}}),[[`__scopeId`,`data-v-bb60f150`]]);export{gi as default};
|
|
6
|
+
添加到暂存区后可以提交该文件。`}else if(t&&t.type===`added`){let t=await(await fetch(`/api/diff-cached?file=${encodeURIComponent(e)}`)).json();w.value=t.diff||V(`@13D1C:没有变更`),E.value=t.stats||null}else{let t=await(await fetch(`/api/diff?file=${encodeURIComponent(e)}`)).json();w.value=t.diff||V(`@13D1C:没有变更`),E.value=t.stats||null}}catch(e){T({message:`获取文件差异失败: `+e.message,type:`error`}),w.value=`获取差异失败: `+e.message}finally{ie.value=!1}}async function Ke(e,t){let n=await(await fetch(`/api/git-file-content?rev=${encodeURIComponent(t)}&file=${encodeURIComponent(e)}`)).json();return n&&n.success?n.content||``:n?.error?`⚠️ ${n.error}`:``}async function qe(e){let t=await(await fetch(`/api/file-content?file=${encodeURIComponent(e)}`)).json();return t&&t.success?t.content||``:t?.error?`⚠️ ${t.error}`:``}async function Je(e){try{ie.value=!0,w.value=``,E.value=null,v.value=e,se.value=f.fileList.findIndex(t=>t.path===e);let t=f.fileList[se.value];if(t&&t.type===`untracked`){le.value=``,F.value=await qe(e);return}if(t&&t.type===`deleted`){le.value=await Ke(e,`HEAD`),F.value=``;return}if(t&&t.type===`added`){le.value=await Ke(e,`HEAD`),F.value=await Ke(e,`:`);return}let n=t&&(t.type===`staged`||t.type===`modified-staged`||t.type===`added`);le.value=await Ke(e,`HEAD`),F.value=n?await Ke(e,`:`):await qe(e)}finally{ie.value=!1}}function J(e){ne.value=!0,P.value=`compare`,f.fileList.length>0&&Je((f.fileList.find(t=>t.path===e.path)||f.fileList[0]).path)}function Ye(){P.value=`diff`,v.value&&Ge(v.value)}function Xe(){P.value=`compare`,v.value&&Je(v.value)}async function Ze(){if(!v.value){T.warning(V(`@13D1C:没有变更`));return}let e=w.value;if(!e)try{let t=f.fileList.find(e=>e.path===v.value);t?.type===`added`?e=(await(await fetch(`/api/diff-cached?file=${encodeURIComponent(v.value)}`)).json()).diff||``:t?.type!==`untracked`&&(e=(await(await fetch(`/api/diff?file=${encodeURIComponent(v.value)}`)).json()).diff||``)}catch{}if(!e){T.warning(V(`@13D1C:没有变更`));return}navigator.clipboard.writeText(e).then(()=>{T.success(V(`@13D1C:差异已复制到剪贴板`))}).catch(()=>{T.error(V(`@13D1C:复制失败`))})}async function Qe(e){await f.addFileToStage(e)}async function $e(e){await f.unstageFile(e)}async function et(){try{if(!f.isGitRepo)return;await f.fetchStatus(),await f.getBranchStatus(!0),T.success(V(`@13D1C:Git 状态已刷新`))}catch(e){T.error(`${V(`@13D1C:刷新失败: `)}${e.message}`)}}let tt=D(!1),Y=D({needsMerge:!1,error:``,fullError:``,pullOutput:``}),nt=D(!1);async function rt(){try{let e=await f.gitPull();e.success?await He():(Y.value={needsMerge:e.needsMerge,error:e.error,fullError:e.fullError,pullOutput:e.pullOutput},tt.value=!0)}catch(e){console.error(`拉取操作发生错误:`,e)}}async function it(){if(!nt.value){nt.value=!0;try{if(!await f.saveStash(void 0,!1,!1)){nt.value=!1;return}let e=await f.gitPull();if(await f.applyStash(`stash@{0}`,!0),!e.success){Y.value={needsMerge:e.needsMerge,error:e.error,fullError:e.fullError,pullOutput:e.pullOutput},tt.value=!0;return}await He()}catch(e){console.error(`Stash Pull Pop 操作发生错误:`,e)}finally{nt.value=!1}}}let at=D(!1),X=D(``),ot=D(!1);async function st(){if(!X.value.trim()){T.warning(V(`@13D1C:请输入远程仓库地址`));return}ot.value=!0;try{await f.addRemote(X.value.trim())&&(T.success(V(`@13D1C:已添加远程仓库`)),X.value=``)}finally{ot.value=!1}}let ct=D(!1),lt=D([]),ut=D(!1);async function dt(){ut.value=!0;try{let e=await(await fetch(`/api/recent_directories`,{cache:`no-store`})).json();e&&Array.isArray(e.directories)?lt.value=e.directories:lt.value=[]}catch{lt.value=[]}finally{ut.value=!1}}async function ft(e){if(e)try{let t=await(await fetch(`/api/open-new-tab-gui`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:e})})).json();t?.success||T.error(t?.error||V(`@13D1C:打开失败`))}catch(e){T.error(`${V(`@13D1C:打开失败`)}: ${e.message}`)}}function pt(e){if(!e.exists){T.warning(V(`@13D1C:目录不存在,无法打开`));return}ft(e.path)}x(()=>f.isGitRepo,e=>{!e&<.value.length===0&&dt()},{immediate:!0});async function mt(){ct.value=!0;try{await f.gitInit()&&(T.success(V(`@13D1C:Git仓库初始化成功`)),X.value.trim()&&(await f.addRemote(X.value.trim()),X.value=``),await He())}finally{ct.value=!1}}async function ht(){if(!f.currentBranch){T.warning(V(`@13D1C:未知当前分支`));return}try{at.value=!0;let e=`git push -u origin ${f.currentBranch}`,t=await(await fetch(`/api/exec`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({command:e})})).json();t.success?(T.success(V(`@13D1C:已推送并设置上游分支`)),await f.getAllBranches(),await f.getCurrentBranch(!0),await f.getBranchStatus(!0)):T.error(t.error||V(`@13D1C:设置上游失败`))}catch(e){T.error(`${V(`@13D1C:设置上游失败: `)}${e.message}`)}finally{at.value=!1}}async function gt(e){try{await M.confirm(`${V(`@13D1C:确定要撤回文件 "`)}${e}${V(`@13D1C:" 的所有修改吗?此操作无法撤销。`)}`,V(`@13D1C:撤回修改`),{confirmButtonText:V(`@13D1C:确定`),cancelButtonText:V(`@13D1C:取消`),type:`warning`});let t=await(await fetch(`/api/revert_file`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({filePath:e})})).json();t.success?(T.success(V(`@13D1C:已撤回文件修改`)),await He()):T.error(t.error?`${V(`@13D1C:撤回失败: `)}${t.error}`:V(`@13D1C:撤回文件修改失败,请重试`))}catch(e){if(e===`cancel`||e.message===`cancel`)return;let t=e.message||V(`@13D1C:未知错误`);t===`undefined`?T.error(V(`@13D1C:撤回文件修改失败,请重试`)):T.error(`${V(`@13D1C:撤回文件修改失败: `)}${t}`)}}function _t(e){let t=e.split(`/`);return t[t.length-1]}function vt(e){let t=e.split(`/`);return t.length<=1?``:t.slice(0,-1).join(`/`)}function Z(e){return xe(e,p.lockedFiles)}async function Q(e){if(!ue.value[e]){ue.value[e]=!0;try{xe(e,p.lockedFiles)?await p.unlockFile(e):await p.lockFile(e)}finally{delete ue.value[e]}}}function $(e){K.value[e]=!K.value[e]}let yt=D([]),bt=D([]),xt=D([]),St=D([]);function Ct(){let e=ke(f.fileList.filter(e=>e.type===`conflicted`).map(e=>({path:e.path,type:e.type,locked:Z(e.path)})));yt.value.length>0&&De(e,yt.value),yt.value=e;let t=ke(f.fileList.filter(e=>e.type===`added`).map(e=>({path:e.path,type:e.type,locked:Z(e.path)})));bt.value.length>0&&De(t,bt.value),bt.value=t;let n=ke(f.fileList.filter(e=>e.type===`modified`||e.type===`deleted`).map(e=>({path:e.path,type:e.type,locked:Z(e.path)})));xt.value.length>0&&De(n,xt.value),xt.value=n;let r=ke(f.fileList.filter(e=>e.type===`untracked`).map(e=>({path:e.path,type:e.type,locked:Z(e.path)})));St.value.length>0&&De(r,St.value),St.value=r}return x(()=>f.fileList,()=>{q.value===`tree`&&Ct()},{deep:!0}),x(q,e=>{e===`tree`&&Ct(),window.dispatchEvent(new CustomEvent(`file-list-view-mode-change`,{detail:{mode:e}}))}),c(()=>{He(),p.loadConfig(),p.loadLockedFiles(),q.value===`tree`&&Ct();let e=e=>{let t=e.detail.mode;q.value!==t&&(q.value=t)},t=()=>{He(),v.value&&Ge(v.value)};window.addEventListener(`file-list-view-mode-change`,e),window.addEventListener(`git-status-refresh`,t);let n=()=>{document.visibilityState===`visible`&&f.isGitRepo&&(console.log(`[页面可见性] 标签页已激活,刷新Git状态和分支信息`),Promise.all([f.fetchStatus(),f.getBranchStatus()]).catch(e=>console.error(`刷新失败:`,e)))},r=()=>{f.isGitRepo&&(console.log(`[窗口焦点] 浏览器窗口已激活,刷新Git状态和分支信息`),Promise.all([f.fetchStatus(),f.getBranchStatus()]).catch(e=>console.error(`刷新失败:`,e)))};return document.addEventListener(`visibilitychange`,n),window.addEventListener(`focus`,r),()=>{window.removeEventListener(`file-list-view-mode-change`,e),window.removeEventListener(`git-status-refresh`,t),document.removeEventListener(`visibilitychange`,n),window.removeEventListener(`focus`,r)}}),o({refreshStatus:et}),(i,o)=>{let c=te,u=e,x=ee,T=fe,D=s,A=oe;return B(),z(O,null,[k(`div`,kn,[k(`div`,An,[k(`div`,jn,[k(`div`,Mn,[R(W,{tooltip:N(V)(`@13D1C:Git Pull (拉取远程更新)`),size:`medium`,"hover-color":`var(--color-primary)`,disabled:!N(f).hasUpstream||N(f).isGitPulling,onClick:rt},{default:S(()=>[N(f).isGitPulling?(B(),C(c,{key:0,class:`is-loading`},{default:S(()=>[R(N(a))]),_:1})):(B(),C(U,{key:1,"icon-class":`git-pull-request`}))]),_:1},8,[`tooltip`,`disabled`]),N(f).fileList.length>0?(B(),C(W,{key:0,tooltip:N(V)(`@13D1C:Stash → Pull → Stash Pop (储藏后拉取再还原)`),size:`medium`,"hover-color":`var(--color-primary)`,disabled:!N(f).hasUpstream||N(f).isGitPulling||nt.value,onClick:it},{default:S(()=>[nt.value?(B(),C(c,{key:0,class:`is-loading`},{default:S(()=>[R(N(a))]),_:1})):(B(),C(U,{key:1,"icon-class":`git-pull-request-with-stash`}))]),_:1},8,[`tooltip`,`disabled`])):I(``,!0),R(ye),R(Ce,{from:`status`}),G.value?I(``,!0):(B(),C(Se,{key:1})),R(be),G.value?I(``,!0):(B(),C(we,{key:2}))]),k(`div`,Nn,[N(f).fileList.length>0?(B(),C(W,{key:0,tooltip:N(V)(`@13D1C:复制全量 Diff`),size:`medium`,"hover-color":`var(--color-primary)`,onClick:o[0]||=e=>N(f).copyCurrentDiff()},{default:S(()=>[R(c,null,{default:S(()=>[R(N(re))]),_:1})]),_:1},8,[`tooltip`])):I(``,!0),R(W,{tooltip:N(V)(`@13D1C:刷新状态`),size:`medium`,disabled:_.value,onClick:et},{default:S(()=>[_.value?(B(),C(c,{key:0,class:`is-loading`},{default:S(()=>[R(N(a))]),_:1})):(B(),C(c,{key:1},{default:S(()=>[R(N(d))]),_:1}))]),_:1},8,[`tooltip`,`disabled`])])])]),h((B(),z(`div`,{class:`card-content`,"element-loading-text":N(f).isGitPulling?N(V)(`@13D1C:正在拉取代码...`):N(V)(`@13D1C:正在获取远程分支信息...`)},[N(f).isGitRepo?(B(),z(`div`,tr,[!N(f).remoteUrl&&!N(f).hasUpstream?(B(),z(`div`,nr,[k(`div`,rr,[R(c,{class:`tip-icon`},{default:S(()=>[R(N(g))]),_:1}),k(`span`,ir,L(N(V)(`@13D1C:尚未配置远程仓库`)),1)]),k(`div`,ar,[k(`div`,or,L(N(V)(`@13D1C:添加远程仓库后,即可推送分支并与团队协作。`)),1),k(`div`,sr,[R(x,{modelValue:X.value,"onUpdate:modelValue":o[2]||=e=>X.value=e,size:`small`,placeholder:N(V)(`@13D1C:输入远程仓库地址,例如 https://github.com/user/repo.git`),disabled:ot.value,onKeyup:ae(st,[`enter`])},null,8,[`modelValue`,`placeholder`,`disabled`]),R(u,{size:`small`,type:`primary`,plain:``,loading:ot.value,disabled:ot.value||!X.value.trim(),onClick:st},{default:S(()=>[t(L(N(V)(`@13D1C:添加远程仓库`)),1)]),_:1},8,[`loading`,`disabled`])])])])):I(``,!0),N(f).hasUpstream?I(``,!0):(B(),z(`div`,cr,[k(`div`,lr,[R(c,{class:`tip-icon`},{default:S(()=>[R(N(n))]),_:1}),k(`span`,ur,L(N(V)(`@13D1C:当前分支未设置上游分支`)),1)]),k(`div`,dr,[k(`div`,fr,L(N(V)(`@13D1C:首次推送后即可建立与远程的跟踪关系,后续可直接 pull/push。`)),1),k(`div`,pr,[R(u,{size:`small`,type:`primary`,plain:``,loading:at.value,disabled:at.value,onClick:ht},{default:S(()=>[t(L(N(V)(`@13D1C:设置上游并推送`)),1)]),_:1},8,[`loading`,`disabled`])])])])),N(f).hasUpstream&&(N(f).branchAhead>0||N(f).branchBehind>0)?(B(),z(`div`,mr,[k(`div`,hr,[k(`div`,gr,[R(D,{content:N(V)(`@13D1C:本地分支与远程分支的状态对比`),placement:`top`,"show-after":200},{default:S(()=>[k(`div`,_r,[N(f).branchAhead>0?(B(),C(T,{key:0,size:`small`,type:`warning`,class:`status-badge`},{default:S(()=>[k(`span`,vr,[R(c,null,{default:S(()=>[R(N(m))]),_:1}),t(` `+L(N(V)(`@13D1C:你的分支领先`,{branch:`origin/${N(f).currentBranch}`,count:N(f).branchAhead})),1)])]),_:1})):I(``,!0),N(f).branchBehind>0?(B(),C(T,{key:1,size:`small`,type:`info`,class:`status-badge`},{default:S(()=>[k(`span`,yr,[R(c,null,{default:S(()=>[R(N(b))]),_:1}),t(` `+L(N(V)(`@13D1C:你的分支落后`,{branch:`origin/${N(f).currentBranch}`,count:N(f).branchBehind})),1)])]),_:1})):I(``,!0)])]),_:1},8,[`content`])])])])):I(``,!0),N(f).fileList.length?(B(),z(`div`,br,[k(`div`,xr,[k(`div`,Sr,[N(f).fileList.length>0?(B(),C(W,{key:0,tooltip:G.value?N(V)(`@13D1C:退出选择模式`):N(V)(`@13D1C:选择文件进行储藏`),size:`small`,active:G.value,"hover-color":`var(--color-primary)`,onClick:_e},{default:S(()=>[R(U,{"icon-class":`muti-choose`})]),_:1},8,[`tooltip`,`active`])):I(``,!0),G.value&&ge.value.size>0?(B(),C(Dn,{key:1,"selected-files":Pe.value,onSuccess:_e},null,8,[`selected-files`])):I(``,!0),k(`h4`,null,L(N(V)(`@13D1C:文件列表`)),1),N(f).fileList.length>0?(B(),z(`span`,Cr,`(`+L(N(f).fileList.length)+`)`,1)):I(``,!0),R(On,{"selected-files":G.value?Pe.value:[],size:`small`},null,8,[`selected-files`])]),k(`div`,wr,[R(W,{tooltip:N(V)(`@E80AC:列表视图`),size:`small`,active:q.value===`list`,onClick:o[3]||=e=>q.value=`list`},{default:S(()=>[R(Ae,{style:{width:`1em`,height:`1em`}})]),_:1},8,[`tooltip`,`active`]),R(W,{tooltip:N(V)(`@E80AC:树状视图`),size:`small`,active:q.value===`tree`,onClick:o[4]||=e=>q.value=`tree`},{default:S(()=>[R(Ee,{style:{width:`1em`,height:`1em`}})]),_:1},8,[`tooltip`,`active`])])]),G.value?(B(),z(`div`,Tr,[k(`div`,Er,[k(`span`,Dr,[t(L(N(V)(`@13D1C:已选中`))+` `,1),k(`strong`,null,L(ge.value.size),1),t(` `+L(N(V)(`@13D1C:个文件`)),1)])]),k(`div`,Or,[R(u,{size:`small`,type:`primary`,plain:``,onClick:Me},{default:S(()=>[t(L(ge.value.size===N(f).fileList.length?N(V)(`@13D1C:取消全选`):N(V)(`@13D1C:全选`)),1)]),_:1})])])):I(``,!0),k(`div`,kr,[q.value===`list`?(B(),z(O,{key:0},[R(Ve,{files:N(f).fileList.filter(e=>e.type===`conflicted`),title:N(V)(`@13D1C:冲突文件`),"group-key":`conflicted`,"collapsed-groups":K.value,"is-file-locked":Z,"is-locking":H,"get-file-name":_t,"get-file-directory":vt,"is-selection-mode":G.value,"is-file-selected":Ne,onToggleCollapse:$,onFileClick:J,onToggleFileLock:Q,onToggleFileSelection:Te,onStageFile:Qe,onRevertFileChanges:gt},null,8,[`files`,`title`,`collapsed-groups`,`is-selection-mode`]),R(Ve,{files:N(f).fileList.filter(e=>e.type===`added`),title:N(V)(`@13D1C:已暂存的更改`),"group-key":`staged`,"collapsed-groups":K.value,"is-file-locked":Z,"is-locking":H,"get-file-name":_t,"get-file-directory":vt,"is-selection-mode":G.value,"is-file-selected":Ne,onToggleCollapse:$,onFileClick:J,onToggleFileLock:Q,onToggleFileSelection:Te,onUnstageFile:$e},null,8,[`files`,`title`,`collapsed-groups`,`is-selection-mode`]),R(Ve,{files:N(f).fileList.filter(e=>e.type===`modified`||e.type===`deleted`),title:N(V)(`@13D1C:未暂存的更改`),"group-key":`unstaged`,"collapsed-groups":K.value,"is-file-locked":Z,"is-locking":H,"get-file-name":_t,"get-file-directory":vt,"is-selection-mode":G.value,"is-file-selected":Ne,onToggleCollapse:$,onFileClick:J,onToggleFileLock:Q,onToggleFileSelection:Te,onStageFile:Qe,onRevertFileChanges:gt,onManageLockedFiles:o[5]||=e=>ze.value=!0},null,8,[`files`,`title`,`collapsed-groups`,`is-selection-mode`]),R(Ve,{files:N(f).fileList.filter(e=>e.type===`untracked`),title:N(V)(`@13D1C:未跟踪的文件`),"group-key":`untracked`,"collapsed-groups":K.value,"is-file-locked":Z,"is-locking":H,"get-file-name":_t,"get-file-directory":vt,"is-selection-mode":G.value,"is-file-selected":Ne,onToggleCollapse:$,onFileClick:J,onToggleFileLock:Q,onToggleFileSelection:Te,onStageFile:Qe,onRevertFileChanges:gt,onManageLockedFiles:o[6]||=e=>ze.value=!0},null,8,[`files`,`title`,`collapsed-groups`,`is-selection-mode`])],64)):(B(),z(O,{key:1},[N(f).fileList.filter(e=>e.type===`conflicted`).length?(B(),z(`div`,Ar,[k(`button`,{type:`button`,class:`tree-group-header`,"aria-expanded":!K.value.conflicted,"aria-controls":`tree-group-conflicted`,onClick:o[7]||=e=>$(`conflicted`)},[R(c,{class:j([`collapse-icon`,{collapsed:K.value.conflicted}]),"aria-hidden":`true`},{default:S(()=>[R(N(b))]),_:1},8,[`class`]),k(`h5`,null,L(N(V)(`@13D1C:冲突文件`)),1),k(`span`,Mr,L(N(f).fileList.filter(e=>e.type===`conflicted`).length),1)],8,jr),K.value.conflicted?I(``,!0):(B(),C(Oe,{key:0,"tree-data":yt.value,"selected-file":``,"show-action-buttons":!0,"is-file-locked":Z,"is-locking":H,onFileSelect:o[8]||=e=>J({path:e,type:`conflicted`}),onToggleLock:Q,onStage:Qe,onRevert:gt},null,8,[`tree-data`]))])):I(``,!0),N(f).fileList.filter(e=>e.type===`added`).length?(B(),z(`div`,Nr,[k(`button`,{type:`button`,class:`tree-group-header`,"aria-expanded":!K.value.staged,"aria-controls":`tree-group-staged`,onClick:o[9]||=e=>$(`staged`)},[R(c,{class:j([`collapse-icon`,{collapsed:K.value.staged}]),"aria-hidden":`true`},{default:S(()=>[R(N(b))]),_:1},8,[`class`]),k(`h5`,null,L(N(V)(`@13D1C:已暂存的更改`)),1),k(`span`,Fr,L(N(f).fileList.filter(e=>e.type===`added`).length),1)],8,Pr),K.value.staged?I(``,!0):(B(),C(Oe,{key:0,"tree-data":bt.value,"selected-file":``,"show-action-buttons":!0,"is-file-locked":Z,"is-locking":H,onFileSelect:o[10]||=e=>J({path:e,type:`added`}),onToggleLock:Q,onUnstage:$e},null,8,[`tree-data`]))])):I(``,!0),N(f).fileList.filter(e=>e.type===`modified`||e.type===`deleted`).length?(B(),z(`div`,Ir,[k(`button`,{type:`button`,class:`tree-group-header`,"aria-expanded":!K.value.unstaged,"aria-controls":`tree-group-unstaged`,onClick:o[11]||=e=>$(`unstaged`)},[R(c,{class:j([`collapse-icon`,{collapsed:K.value.unstaged}]),"aria-hidden":`true`},{default:S(()=>[R(N(b))]),_:1},8,[`class`]),k(`h5`,null,L(N(V)(`@13D1C:未暂存的更改`)),1),k(`span`,Rr,L(N(f).fileList.filter(e=>e.type===`modified`||e.type===`deleted`).length),1)],8,Lr),K.value.unstaged?I(``,!0):(B(),C(Oe,{key:0,"tree-data":xt.value,"selected-file":``,"show-action-buttons":!0,"is-file-locked":Z,"is-locking":H,onFileSelect:o[12]||=e=>J({path:e,type:`modified`}),onToggleLock:Q,onStage:Qe,onRevert:gt},null,8,[`tree-data`]))])):I(``,!0),N(f).fileList.filter(e=>e.type===`untracked`).length?(B(),z(`div`,zr,[k(`button`,{type:`button`,class:`tree-group-header`,"aria-expanded":!K.value.untracked,"aria-controls":`tree-group-untracked`,onClick:o[13]||=e=>$(`untracked`)},[R(c,{class:j([`collapse-icon`,{collapsed:K.value.untracked}]),"aria-hidden":`true`},{default:S(()=>[R(N(b))]),_:1},8,[`class`]),k(`h5`,null,L(N(V)(`@13D1C:未跟踪的文件`)),1),k(`span`,Vr,L(N(f).fileList.filter(e=>e.type===`untracked`).length),1)],8,Br),K.value.untracked?I(``,!0):(B(),C(Oe,{key:0,"tree-data":St.value,"selected-file":``,"show-action-buttons":!0,"is-file-locked":Z,"is-locking":H,onFileSelect:o[14]||=e=>J({path:e,type:`untracked`}),onToggleLock:Q,onStage:Qe,onRevert:gt},null,8,[`tree-data`]))])):I(``,!0)],64))])])):N(f).isGitRepo?(B(),z(`div`,Hr,[k(`div`,Ur,[R(c,null,{default:S(()=>[R(N(ce))]),_:1})]),k(`div`,Wr,L(N(V)(`@13D1C:没有检测到任何更改`)),1),k(`div`,Gr,L(N(V)(`@13D1C:工作区是干净的`)),1)])):I(``,!0)])):(B(),z(`div`,Fn,[k(`div`,In,[R(c,{class:`empty-icon`},{default:S(()=>[R(N(de))]),_:1}),k(`p`,Ln,L(N(V)(`@13D1C:当前目录不是Git仓库`)),1),k(`p`,Rn,L(N(V)(`@13D1C:请初始化Git仓库或切换到Git仓库目录`)),1),R(u,{size:`small`,type:`primary`,plain:``,loading:ct.value,disabled:ct.value,style:{"margin-top":`12px`},onClick:mt},{default:S(()=>[t(L(N(V)(`@13D1C:初始化Git仓库`)),1)]),_:1},8,[`loading`,`disabled`])]),k(`div`,zn,[k(`div`,Bn,[k(`span`,Vn,L(N(V)(`@13D1C:最近项目`)),1),k(`span`,Hn,L(N(V)(`@13D1C:点击在新标签页打开`)),1)]),ut.value&<.value.length===0?(B(),z(`div`,Un,[R(c,null,{default:S(()=>[R(N(a))]),_:1}),k(`span`,null,L(N(V)(`@13D1C:加载中…`)),1)])):lt.value.length===0?(B(),z(`div`,Wn,L(N(V)(`@13D1C:暂无最近项目`)),1)):(B(),z(`ul`,{key:2,class:`recent-projects__list`,"aria-label":N(V)(`@13D1C:最近项目列表`)},[(B(!0),z(O,null,y(lt.value,e=>(B(),z(`li`,{key:e.path,class:j([`recent-projects__item`,{"is-missing":!e.exists}])},[k(`button`,{type:`button`,class:`recent-projects__btn`,title:e.exists?e.path:N(V)(`@13D1C:目录不存在`),"aria-label":e.exists?N(V)(`@13D1C:在新标签页打开 {path}`,{path:e.path}):N(V)(`@13D1C:{path} (目录不存在)`,{path:e.path}),onClick:t=>pt(e)},[R(c,{class:`recent-projects__icon`,"aria-hidden":`true`},{default:S(()=>[R(N(de))]),_:1}),k(`span`,qn,L(e.path),1),e.exists?I(``,!0):(B(),z(`span`,Jn,L(N(V)(`@13D1C:不存在`)),1))],8,Kn)],2))),128))],8,Gn))]),k(`div`,Yn,[k(`div`,Xn,[R(c,{class:`tip-icon`},{default:S(()=>[R(N(g))]),_:1}),k(`span`,Zn,L(N(V)(`@13D1C:尚未配置远程仓库`)),1)]),k(`div`,Qn,[k(`div`,$n,L(N(V)(`@13D1C:添加远程仓库后,即可推送分支并与团队协作。`)),1),k(`div`,er,[R(x,{modelValue:X.value,"onUpdate:modelValue":o[1]||=e=>X.value=e,size:`small`,placeholder:N(V)(`@13D1C:输入远程仓库地址,例如 https://github.com/user/repo.git`),disabled:ct.value,onKeyup:ae(mt,[`enter`])},null,8,[`modelValue`,`placeholder`,`disabled`]),R(u,{size:`small`,type:`primary`,plain:``,loading:ct.value,disabled:ct.value,onClick:mt},{default:S(()=>[t(L(N(V)(`@13D1C:初始化并添加远程`)),1)]),_:1},8,[`loading`,`disabled`])])])])]))],8,Pn)),[[A,N(f).isGitPulling||N(f).isGitFetching]]),R(zt),R(rn)]),R(me,{modelValue:ne.value,"onUpdate:modelValue":o[15]||=e=>ne.value=e,title:N(V)(`@13D1C:文件差异`),"custom-class":`file-diff-dialog`,size:`fullscreen`,type:`flex`,"destroy-on-close":``,heightMode:`fixed`},{default:S(()=>[R(je,{files:Fe.value,diffContent:w.value,diffStats:E.value,selectedFile:v.value,isLoading:ie.value,compareMode:P.value===`compare`,compareOriginal:le.value,compareModified:F.value,context:`git-status`,showOpenButton:!0,showActionButtons:!0,isFileLocked:Z,isLocking:H,onFileSelect:Ie,onOpenFile:Le,onOpenWithVscode:Re,onToggleLock:Q,onStage:Qe,onUnstage:$e,onRevert:gt},{"header-extra":S(()=>[R(u,{size:`small`,type:P.value===`diff`?`primary`:`default`,onClick:Ye},{default:S(()=>[t(L(N(V)(`@13D1C:仅显示差异`)),1)]),_:1},8,[`type`]),R(u,{size:`small`,type:P.value===`compare`?`primary`:`default`,onClick:Xe},{default:S(()=>[t(L(N(V)(`@13D1C:显示完整对比`)),1)]),_:1},8,[`type`]),R(u,{size:`small`,disabled:!v.value,onClick:Ze},{default:S(()=>[t(L(N(V)(`@13D1C:复制差异`)),1)]),_:1},8,[`disabled`])]),_:1},8,[`files`,`diffContent`,`diffStats`,`selectedFile`,`isLoading`,`compareMode`,`compareOriginal`,`compareModified`])]),_:1},8,[`modelValue`,`title`]),R(me,{modelValue:ze.value,"onUpdate:modelValue":o[16]||=e=>ze.value=e,title:N(V)(`@13D1C:锁定文件管理`),size:`large`,"destroy-on-close":``},{default:S(()=>[k(`div`,Kr,[k(`div`,qr,[R(c,{class:`description-icon`},{default:S(()=>[R(N(n))]),_:1}),k(`span`,Jr,L(N(V)(`@13D1C:文件锁定功能说明`)),1)]),k(`div`,Yr,[k(`ul`,null,[k(`li`,null,L(N(V)(`@13D1C:锁定的文件在执行 Git 提交时会被自动跳过,不会被添加到暂存区`)),1)])])]),N(p).lockedFiles.length===0?(B(),z(`div`,Xr,[k(`div`,Zr,[R(c,null,{default:S(()=>[R(N(r))]),_:1})]),k(`p`,null,L(N(V)(`@13D1C:当前没有锁定的文件`)),1),k(`p`,Qr,L(N(V)(`@13D1C:您可以在文件列表中点击锁定按钮来锁定文件`)),1)])):(B(),z(`div`,$r,[k(`div`,ei,[k(`span`,null,`🔒 已锁定 `+L(N(p).lockedFiles.length)+` `+L(N(V)(`@13D1C:个文件`)),1),R(D,{content:N(V)(`@13D1C:这些文件在提交时会被自动跳过`),placement:`top`},{default:S(()=>[R(c,{class:`info-icon`},{default:S(()=>[R(N(n))]),_:1})]),_:1},8,[`content`]),o[19]||=k(`div`,{style:{flex:`1`}},null,-1),R(u,{type:`danger`,size:`small`,plain:``,disabled:!N(p).lockedFiles.length,onClick:We},{default:S(()=>[t(L(N(V)(`@13D1C:清空全部锁定`)),1)]),_:1},8,[`disabled`])]),k(`div`,ti,[(B(!0),z(O,null,y(N(p).lockedFiles,e=>(B(),z(`div`,{key:e,class:`locked-file-item`},[k(`div`,ni,[o[20]||=k(`div`,{class:`file-status-indicator locked`},null,-1),k(`div`,ri,[k(`span`,ii,L(_t(e)),1),k(`span`,ai,L(vt(e)),1)])]),k(`div`,oi,[R(W,{tooltip:N(V)(`@13D1C:解锁文件`),size:`small`,"hover-color":`var(--color-danger)`,"custom-class":`file-action-btn`,onClick:t=>Ue(e)},{default:S(()=>[R(c,null,{default:S(()=>[R(N(l))]),_:1})]),_:1},8,[`tooltip`,`onClick`])])]))),128))])]))]),_:1},8,[`modelValue`,`title`]),R(me,{modelValue:tt.value,"onUpdate:modelValue":o[17]||=e=>tt.value=e,title:Y.value.needsMerge?N(V)(`@13D1C:需要合并更改`):N(V)(`@13D1C:拉取失败`),size:`medium`,"show-footer":!0,"show-cancel":!1,"confirm-text":N(V)(`@13D1C:我知道了`),onConfirm:o[18]||=e=>tt.value=!1},{default:S(()=>[k(`div`,si,[k(`div`,{class:j([`pull-error-type`,Y.value.needsMerge?`is-warning`:`is-error`])},[R(c,{class:`pull-error-icon`},{default:S(()=>[R(N(n))]),_:1}),Y.value.needsMerge?(B(),z(`span`,ci,L(N(V)(`@13D1C:本地存在未提交的更改,与远程内容冲突,请先处理本地更改后再拉取。`)),1)):(B(),z(`span`,li,L(N(V)(`@13D1C:执行 git pull 时发生错误,请查看详细信息。`)),1))],2),k(`div`,ui,[k(`div`,di,L(N(V)(`@13D1C:错误详情`))+`:`,1),k(`pre`,fi,L(Y.value.fullError||Y.value.error),1)]),Y.value.pullOutput?(B(),z(`div`,pi,[k(`div`,mi,L(N(V)(`@13D1C:冲突详情`))+`:`,1),k(`pre`,hi,L(Y.value.pullOutput),1)])):I(``,!0)])]),_:1},8,[`modelValue`,`title`,`confirm-text`])],64)}}}),[[`__scopeId`,`data-v-bfebf682`]]);export{gi as default};
|