dsh-dock 0.24.0 → 0.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/client.js CHANGED
@@ -2121,12 +2121,24 @@ var require_browser = __commonJS({
2121
2121
  // src/client.jsx
2122
2122
  var client_exports = {};
2123
2123
  __export(client_exports, {
2124
+ COMMIT_COLUMNS: () => COMMIT_COLUMNS,
2125
+ DEFAULT_VISIBLE_COLUMNS: () => DEFAULT_VISIBLE_COLUMNS,
2126
+ DirBrowser: () => DirBrowser,
2127
+ GitDragSplitter: () => DragSplitter,
2128
+ GitView: () => GitView,
2124
2129
  apply: () => apply,
2130
+ clampPercent: () => clampPercent,
2131
+ columnsTemplate: () => columnsTemplate,
2125
2132
  dockBridge: () => dockBridge,
2126
- inject: () => inject
2133
+ dragToPercent: () => dragToPercent,
2134
+ fmtDateTime: () => fmtDateTime,
2135
+ inject: () => inject,
2136
+ readSessionDir: () => currentSessionDir,
2137
+ splitterStep: () => splitterStep,
2138
+ toggleRepoSelection: () => toggleRepoSelection
2127
2139
  });
2128
2140
  module.exports = __toCommonJS(client_exports);
2129
- var import_react23 = __toESM(require("react"), 1);
2141
+ var import_react24 = __toESM(require("react"), 1);
2130
2142
 
2131
2143
  // src/shared.js
2132
2144
  var import_react = __toESM(require("react"), 1);
@@ -15764,8 +15776,1711 @@ var feature12 = {
15764
15776
  View: DshToolsView
15765
15777
  };
15766
15778
 
15779
+ // features/git/view.jsx
15780
+ var import_react23 = require("react");
15781
+
15782
+ // features/git/rpc.js
15783
+ async function rpc2(method, body) {
15784
+ const res = await fetch("dsh-dock/git/" + method, {
15785
+ method: body === void 0 ? "GET" : "POST",
15786
+ headers: body === void 0 ? void 0 : { "content-type": "application/json" },
15787
+ body: body === void 0 ? void 0 : JSON.stringify(body)
15788
+ });
15789
+ const data = await res.json().catch(() => ({}));
15790
+ if (res.ok && data && data.ok === true) return data.data;
15791
+ if (res.status === 404 || res.status === 405) {
15792
+ throw new Error("\u5BBF\u4E3B\u4FA7\u6CA1\u6709\u300CGit \u7BA1\u7406\u300D\u63A5\u53E3\uFF1A\u5BBF\u4E3B\u8FDB\u7A0B\u53EF\u80FD\u662F\u65E7\u7248\u672C\uFF0C\u6216\u8BE5\u529F\u80FD\u5728\u5BBF\u4E3B\u4FA7\u672A\u542F\u7528\uFF08\u91CD\u542F dsh web\uFF0C\u6216\u628A\u529F\u80FD\u575E\u91CC\u7684\u5F00\u5173\u5173\u6389\u518D\u6253\u5F00\uFF09");
15793
+ }
15794
+ const message = data && data.error && data.error.message;
15795
+ throw new Error(message || "HTTP " + res.status);
15796
+ }
15797
+ function fmtAgo(iso) {
15798
+ if (!iso) return "";
15799
+ const t = new Date(iso).getTime();
15800
+ if (Number.isNaN(t)) return "";
15801
+ const diff = Math.max(0, Date.now() - t);
15802
+ const min = Math.floor(diff / 6e4);
15803
+ if (min < 1) return "\u521A\u521A";
15804
+ if (min < 60) return min + " \u5206\u949F\u524D";
15805
+ const hour = Math.floor(min / 60);
15806
+ if (hour < 24) return hour + " \u5C0F\u65F6\u524D";
15807
+ const day = Math.floor(hour / 24);
15808
+ if (day < 30) return day + " \u5929\u524D";
15809
+ const month = Math.floor(day / 30);
15810
+ if (month < 12) return month + " \u4E2A\u6708\u524D";
15811
+ return Math.floor(month / 12) + " \u5E74\u524D";
15812
+ }
15813
+ function fmtTime4(iso) {
15814
+ if (!iso) return "";
15815
+ const d = new Date(iso);
15816
+ if (Number.isNaN(d.getTime())) return String(iso);
15817
+ const p = (x) => String(x).padStart(2, "0");
15818
+ return d.getFullYear() + "-" + p(d.getMonth() + 1) + "-" + p(d.getDate()) + " " + p(d.getHours()) + ":" + p(d.getMinutes());
15819
+ }
15820
+ function fmtDateTime(iso) {
15821
+ if (!iso) return "";
15822
+ const d = new Date(iso);
15823
+ if (Number.isNaN(d.getTime())) return String(iso);
15824
+ const p = (x) => String(x).padStart(2, "0");
15825
+ return d.getFullYear() + "-" + p(d.getMonth() + 1) + "-" + p(d.getDate()) + " " + p(d.getHours()) + ":" + p(d.getMinutes()) + ":" + p(d.getSeconds());
15826
+ }
15827
+ function truncate4(str, max) {
15828
+ if (!str) return "";
15829
+ const s = String(str);
15830
+ return s.length > max ? s.slice(0, max) + "\u2026" : s;
15831
+ }
15832
+ function shortRefs(refs) {
15833
+ if (!Array.isArray(refs) || refs.length === 0) return [];
15834
+ const out = [];
15835
+ for (const raw of refs) {
15836
+ const ref = String(raw).trim();
15837
+ if (!ref) continue;
15838
+ if (ref.indexOf("HEAD -> ") === 0) {
15839
+ out.push("HEAD");
15840
+ continue;
15841
+ }
15842
+ out.push(ref.replace(/^tag:\s*/, ""));
15843
+ }
15844
+ return out.slice(0, 3);
15845
+ }
15846
+ function dirOfSessionState(state, sessionId) {
15847
+ if (!state || !sessionId) return "";
15848
+ const projected = state.projectionsBySession && state.projectionsBySession[sessionId] ? state.projectionsBySession[sessionId].values : void 0;
15849
+ if (projected && typeof projected.workingDirectory === "string" && projected.workingDirectory) {
15850
+ return projected.workingDirectory;
15851
+ }
15852
+ const row = state.byId ? state.byId[sessionId] : void 0;
15853
+ if (row) {
15854
+ const rowProjected = row.projectionValues;
15855
+ if (rowProjected && typeof rowProjected.workingDirectory === "string" && rowProjected.workingDirectory) {
15856
+ return rowProjected.workingDirectory;
15857
+ }
15858
+ if (typeof row.cwd === "string" && row.cwd) return row.cwd;
15859
+ }
15860
+ return "";
15861
+ }
15862
+ function currentSessionDir(ctx, sessionId) {
15863
+ if (!ctx || typeof ctx.get !== "function") return "";
15864
+ try {
15865
+ const sessions = ctx.get("sessions");
15866
+ if (!sessions || typeof sessions.list.getSnapshot !== "function") return "";
15867
+ const state = sessions.list.getSnapshot();
15868
+ if (sessionId) {
15869
+ const direct = dirOfSessionState(state, sessionId);
15870
+ if (direct) return direct;
15871
+ }
15872
+ let fallbackId = "";
15873
+ try {
15874
+ const uiSession = ctx.get("uiSession");
15875
+ const snap = uiSession && uiSession.adapter && uiSession.adapter.current ? uiSession.adapter.current.getSnapshot() : null;
15876
+ fallbackId = snap && snap.props ? snap.props.sessionId : "";
15877
+ } catch {
15878
+ fallbackId = "";
15879
+ }
15880
+ return dirOfSessionState(state, fallbackId);
15881
+ } catch {
15882
+ return "";
15883
+ }
15884
+ }
15885
+ async function pickDirectory(ctx) {
15886
+ if (!ctx || typeof ctx.get !== "function") return null;
15887
+ let uiw = null;
15888
+ try {
15889
+ uiw = ctx.get("uiWorkspace");
15890
+ } catch {
15891
+ return null;
15892
+ }
15893
+ if (!uiw || typeof uiw.pickDirectory !== "function") return null;
15894
+ try {
15895
+ return await uiw.pickDirectory();
15896
+ } catch {
15897
+ return null;
15898
+ }
15899
+ }
15900
+
15901
+ // features/git/view.jsx
15902
+ var import_jsx_runtime15 = require("react/jsx-runtime");
15903
+ function DiffHunk(props) {
15904
+ const h = props.hunk;
15905
+ let oldNo = h.oldStart;
15906
+ let newNo = h.newStart;
15907
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-hunk", children: [
15908
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-hunk-head", children: h.header }),
15909
+ h.lines.map((line, i) => {
15910
+ const isAdd = line.kind === "+";
15911
+ const isDel = line.kind === "-";
15912
+ const oldLabel = isAdd ? "" : String(oldNo++);
15913
+ const newLabel = isDel ? "" : String(newNo++);
15914
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-line" + (isAdd ? " add" : isDel ? " del" : ""), children: [
15915
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-ln", children: oldLabel }),
15916
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-ln", children: newLabel }),
15917
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-sign", children: isAdd ? "+" : isDel ? "\u2212" : " " }),
15918
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-code", children: line.text || " " })
15919
+ ] }, i);
15920
+ })
15921
+ ] });
15922
+ }
15923
+ function DiffFile(props) {
15924
+ const f = props.file;
15925
+ const [open, setOpen] = (0, import_react23.useState)(props.defaultOpen !== false);
15926
+ const statusLabel = f.status === "added" ? "\u65B0\u589E" : f.status === "deleted" ? "\u5220\u9664" : f.status === "renamed" ? "\u91CD\u547D\u540D" : "\u4FEE\u6539";
15927
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-file" + (open ? " open" : ""), children: [
15928
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", className: "dkg-file-head", onClick: () => setOpen((v) => !v), children: [
15929
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-caret", children: open ? "\u25BE" : "\u25B8" }),
15930
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-file-path", title: f.path, children: f.path }),
15931
+ f.oldPath && f.oldPath !== f.path ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "dkg-file-old", title: f.oldPath, children: [
15932
+ "\u2190 ",
15933
+ f.oldPath
15934
+ ] }) : null,
15935
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-tag " + f.status, children: statusLabel }),
15936
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "dkg-add", children: [
15937
+ "+",
15938
+ f.additions
15939
+ ] }),
15940
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "dkg-del", children: [
15941
+ "\u2212",
15942
+ f.deletions
15943
+ ] })
15944
+ ] }),
15945
+ open ? f.binary ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-note", children: "\u4E8C\u8FDB\u5236\u6587\u4EF6\uFF0C\u4E0D\u663E\u793A\u9010\u884C\u5DEE\u5F02\u3002" }) : f.hunks.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-note", children: "\u6CA1\u6709\u53EF\u663E\u793A\u7684\u5DEE\u5F02\uFF08\u53EF\u80FD\u53EA\u662F\u6587\u4EF6\u6A21\u5F0F\u53D8\u5316\uFF09\u3002" }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-diff", children: f.hunks.map((h, i) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DiffHunk, { hunk: h }, i)) }) : null
15946
+ ] });
15947
+ }
15948
+ function buildTree(files) {
15949
+ const root = { name: "", path: "", dirs: /* @__PURE__ */ new Map(), files: [] };
15950
+ for (const f of files) {
15951
+ const parts = f.path.split("/");
15952
+ let node = root;
15953
+ for (let i = 0; i < parts.length - 1; i++) {
15954
+ const name = parts[i];
15955
+ if (!node.dirs.has(name)) {
15956
+ node.dirs.set(name, { name, path: parts.slice(0, i + 1).join("/"), dirs: /* @__PURE__ */ new Map(), files: [] });
15957
+ }
15958
+ node = node.dirs.get(name);
15959
+ }
15960
+ node.files.push(f);
15961
+ }
15962
+ return root;
15963
+ }
15964
+ function FileTree(props) {
15965
+ const tree = (0, import_react23.useMemo)(() => buildTree(props.files || []), [props.files]);
15966
+ const [collapsed, setCollapsed] = (0, import_react23.useState)({});
15967
+ const toggle = (path) => setCollapsed((prev) => Object.assign({}, prev, { [path]: !prev[path] }));
15968
+ const render = (node, depth) => {
15969
+ const out = [];
15970
+ for (const dir of node.dirs.values()) {
15971
+ const key = "d:" + dir.path;
15972
+ const isCollapsed = !!collapsed[dir.path];
15973
+ out.push(
15974
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", className: "dkg-tree-row dir", style: { paddingLeft: depth * 12 + 6 + "px" }, onClick: () => toggle(dir.path), children: [
15975
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-caret", children: isCollapsed ? "\u25B8" : "\u25BE" }),
15976
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-tree-name", children: dir.name })
15977
+ ] }, key)
15978
+ );
15979
+ if (!isCollapsed) out.push(...render(dir, depth + 1));
15980
+ }
15981
+ for (const f of node.files) {
15982
+ const selected = props.selected === f.path;
15983
+ out.push(
15984
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", className: "dkg-tree-row file" + (selected ? " on" : ""), style: { paddingLeft: depth * 12 + 18 + "px" }, onClick: () => props.onSelect(f.path), title: f.path, children: [
15985
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-tree-name", children: f.path.split("/").pop() }),
15986
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "dkg-add", children: [
15987
+ "+",
15988
+ f.additions
15989
+ ] }),
15990
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "dkg-del", children: [
15991
+ "\u2212",
15992
+ f.deletions
15993
+ ] })
15994
+ ] }, "f:" + f.path)
15995
+ );
15996
+ }
15997
+ return out;
15998
+ };
15999
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-tree", children: render(tree, 0) });
16000
+ }
16001
+ var COMMIT_COLUMNS = [
16002
+ { id: "graph", title: "", width: "12px", fixed: true },
16003
+ { id: "subject", title: "\u8BF4\u660E", width: "minmax(0,1fr)", fixed: true },
16004
+ { id: "refs", title: "\u5F15\u7528", width: "64px" },
16005
+ { id: "author", title: "\u4F5C\u8005", width: "78px" },
16006
+ { id: "date", title: "\u65E5\u671F", width: "56px" },
16007
+ { id: "datetime", title: "\u65E5\u671F\u65F6\u95F4", width: "132px" }
16008
+ ];
16009
+ var DEFAULT_VISIBLE_COLUMNS = ["graph", "subject", "refs", "author", "date"];
16010
+ function columnsTemplate(visible) {
16011
+ const set = new Set(Array.isArray(visible) ? visible : []);
16012
+ const parts = COMMIT_COLUMNS.filter((c) => c.fixed || set.has(c.id)).map((c) => c.width);
16013
+ return parts.join(" ");
16014
+ }
16015
+ function toggleRepoSelection(prev, path, current) {
16016
+ const list = Array.isArray(prev) && prev.length > 0 ? prev : [current].filter(Boolean);
16017
+ if (list.includes(path)) {
16018
+ const next = list.filter((p) => p !== path);
16019
+ return next.length > 0 ? next : list;
16020
+ }
16021
+ return list.concat(path);
16022
+ }
16023
+ function CommitRow(props) {
16024
+ const c = props.commit;
16025
+ const refs = shortRefs(c.refs);
16026
+ const visible = Array.isArray(props.visibleCols) ? props.visibleCols : null;
16027
+ const show = (id) => visible ? visible.includes(id) : true;
16028
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
16029
+ "div",
16030
+ {
16031
+ className: "dkg-tr" + (props.active ? " on" : ""),
16032
+ role: "row",
16033
+ tabIndex: -1,
16034
+ onClick: () => props.onSelect(c),
16035
+ onKeyDown: (ev) => {
16036
+ if (ev.key === "Enter" || ev.key === " ") {
16037
+ ev.preventDefault();
16038
+ props.onSelect(c);
16039
+ }
16040
+ },
16041
+ title: c.subject,
16042
+ children: [
16043
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "dkg-td graph", "aria-hidden": "true", children: [
16044
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-graph-line" }),
16045
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-graph-dot" })
16046
+ ] }),
16047
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "dkg-td subject", children: [
16048
+ c.__repo ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-repo-tag", title: c.__repo, children: c.__repo.split("/").filter(Boolean).pop() }) : null,
16049
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-commit-subject", children: c.subject }),
16050
+ refs.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-commit-refs", children: refs.map((r) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-ref" + (/^(origin|upstream)\//.test(r) ? " remote" : ""), children: r }, r)) }) : null
16051
+ ] }),
16052
+ show("refs") ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-td refs", children: refs.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-muted", children: "\u2014" }) : null }) : null,
16053
+ show("author") ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-td author", title: c.authorEmail, children: c.author }) : null,
16054
+ show("date") ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-td date", title: fmtTime4(c.authorDate), children: fmtAgo(c.authorDate) }) : null,
16055
+ show("datetime") ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-td datetime", title: fmtTime4(c.authorDate), children: fmtDateTime(c.authorDate) }) : null
16056
+ ]
16057
+ }
16058
+ );
16059
+ }
16060
+ function HistoryPane(props) {
16061
+ const { repo, refs } = props;
16062
+ const repoOptions = Array.isArray(props.repos) ? props.repos : [];
16063
+ const pickedRepos = Array.isArray(props.selectedRepos) && props.selectedRepos.length > 0 ? props.selectedRepos : [repo];
16064
+ const repoKey = pickedRepos.join("\0");
16065
+ const [commits, setCommits] = (0, import_react23.useState)([]);
16066
+ const [loading, setLoading] = (0, import_react23.useState)(false);
16067
+ const [error, setError] = (0, import_react23.useState)("");
16068
+ const [search, setSearch] = (0, import_react23.useState)("");
16069
+ const [author, setAuthor] = (0, import_react23.useState)("");
16070
+ const [path, setPath] = (0, import_react23.useState)(props.initialPath || "");
16071
+ const [branch, setBranch] = (0, import_react23.useState)("");
16072
+ const [limit, setLimit] = (0, import_react23.useState)(100);
16073
+ const [since, setSince] = (0, import_react23.useState)("");
16074
+ const [until, setUntil] = (0, import_react23.useState)("");
16075
+ const [authors, setAuthors] = (0, import_react23.useState)([]);
16076
+ const [authorPick, setAuthorPick] = (0, import_react23.useState)("");
16077
+ const [groups, setGroups] = (0, import_react23.useState)([]);
16078
+ const [visibleCols, setVisibleCols] = (0, import_react23.useState)(DEFAULT_VISIBLE_COLUMNS);
16079
+ const [colMenu, setColMenu] = (0, import_react23.useState)(false);
16080
+ const showCol = (id) => visibleCols.includes(id);
16081
+ const toggleCol = (id) => {
16082
+ const col = COMMIT_COLUMNS.find((c) => c.id === id);
16083
+ if (!col || col.fixed) return;
16084
+ setVisibleCols((prev) => prev.includes(id) ? prev.filter((x) => x !== id) : prev.concat(id));
16085
+ };
16086
+ const [selected, setSelected] = (0, import_react23.useState)(null);
16087
+ const [detail, setDetail] = (0, import_react23.useState)(null);
16088
+ const [detailLoading, setDetailLoading] = (0, import_react23.useState)(false);
16089
+ const [activeFile, setActiveFile] = (0, import_react23.useState)("");
16090
+ const load = (0, import_react23.useCallback)(async () => {
16091
+ if (!repo) return;
16092
+ setLoading(true);
16093
+ setError("");
16094
+ const repoList = repoKey.split("\0").filter(Boolean);
16095
+ if (repoList.length === 0) {
16096
+ setLoading(false);
16097
+ return;
16098
+ }
16099
+ const common = {
16100
+ limit,
16101
+ search: search.trim(),
16102
+ author: authorPick || author.trim(),
16103
+ path: path.trim(),
16104
+ branch: branch || void 0,
16105
+ since: since || void 0,
16106
+ until: until || void 0
16107
+ };
16108
+ try {
16109
+ const data = repoList.length === 1 ? await rpc2("commits", Object.assign({ repo: repoList[0] }, common)) : await rpc2("commits", Object.assign({ repos: repoList }, common));
16110
+ const results = data && data.results || [];
16111
+ const ok = results.filter((r) => r && r.ok !== false);
16112
+ const failed = results.filter((r) => r && r.ok === false);
16113
+ setGroups(ok.map((r) => ({ repo: r.repo, commits: r.commits || [] })));
16114
+ const flat = [];
16115
+ for (const r of ok) {
16116
+ for (const c of r.commits || []) flat.push(Object.assign({ __repo: r.repo }, c));
16117
+ }
16118
+ if (repoList.length > 1) {
16119
+ flat.sort((a, b) => String(b.authorDate).localeCompare(String(a.authorDate)));
16120
+ }
16121
+ setCommits(flat);
16122
+ if (failed.length > 0) setError(failed.map((r) => r.repo + "\uFF1A" + (r.error || "\u8BFB\u53D6\u5931\u8D25")).join("\uFF1B"));
16123
+ if (flat.length > 0) selectCommit(flat[0]);
16124
+ else {
16125
+ setSelected(null);
16126
+ setDetail(null);
16127
+ }
16128
+ } catch (e) {
16129
+ setCommits([]);
16130
+ setGroups([]);
16131
+ setError(e && e.message || String(e));
16132
+ } finally {
16133
+ setLoading(false);
16134
+ }
16135
+ }, [repo, repoKey, limit, search, author, authorPick, path, branch, since, until]);
16136
+ const selectCommit = async (c) => {
16137
+ setSelected(c);
16138
+ setDetailLoading(true);
16139
+ setActiveFile("");
16140
+ try {
16141
+ const owner = c.__repo || repo;
16142
+ const data = await rpc2("commit", { repo: owner, sha: c.sha });
16143
+ setDetail(data && data.commit);
16144
+ } catch (e) {
16145
+ setDetail({ error: e && e.message || String(e) });
16146
+ } finally {
16147
+ setDetailLoading(false);
16148
+ }
16149
+ };
16150
+ (0, import_react23.useEffect)(() => {
16151
+ if (!repo) return;
16152
+ const timer = setTimeout(() => {
16153
+ load();
16154
+ }, 200);
16155
+ return () => clearTimeout(timer);
16156
+ }, [load]);
16157
+ (0, import_react23.useEffect)(() => {
16158
+ if (!repo) return;
16159
+ let stopped = false;
16160
+ rpc2("authors", { repo }).then((data) => {
16161
+ if (!stopped) setAuthors(data && data.authors || []);
16162
+ }).catch(() => {
16163
+ if (!stopped) setAuthors([]);
16164
+ });
16165
+ return () => {
16166
+ stopped = true;
16167
+ };
16168
+ }, [repo]);
16169
+ const onListKeyDown = (ev) => {
16170
+ if (commits.length === 0) return;
16171
+ const index = selected ? commits.findIndex((c) => c.sha === selected.sha) : -1;
16172
+ if (ev.key === "ArrowDown") {
16173
+ ev.preventDefault();
16174
+ const next = commits[Math.min(commits.length - 1, index + 1)];
16175
+ if (next) selectCommit(next);
16176
+ } else if (ev.key === "ArrowUp") {
16177
+ ev.preventDefault();
16178
+ const prev = commits[Math.max(0, index - 1)];
16179
+ if (prev) selectCommit(prev);
16180
+ } else if (ev.key === "Home") {
16181
+ ev.preventDefault();
16182
+ selectCommit(commits[0]);
16183
+ } else if (ev.key === "End") {
16184
+ ev.preventDefault();
16185
+ selectCommit(commits[commits.length - 1]);
16186
+ }
16187
+ };
16188
+ const localBranches = refs && refs.local || [];
16189
+ const remoteBranches = refs && refs.remote || [];
16190
+ const tags = refs && refs.tags || [];
16191
+ const diffFiles = detail && detail.diff && detail.diff.files || [];
16192
+ const shownFiles = activeFile ? diffFiles.filter((f) => f.path === activeFile) : diffFiles;
16193
+ const [mainPct, setMainPct] = (0, import_react23.useState)(50);
16194
+ const [detailPct, setDetailPct] = (0, import_react23.useState)(50);
16195
+ const bodyRef = (0, import_react23.useRef)(null);
16196
+ const detailRef = (0, import_react23.useRef)(null);
16197
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-body", ref: bodyRef, style: { "--dkg-main-pct": mainPct + "%", "--dkg-detail-pct": detailPct + "%", "--dkg-cols": columnsTemplate(visibleCols) }, children: [
16198
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-side", children: [
16199
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", className: "dkg-side-item" + (branch === "" ? " on" : ""), onClick: () => setBranch(""), children: [
16200
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-side-icon", children: "\u25C8" }),
16201
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-ellipsis", children: "HEAD\uFF08\u5F53\u524D\u5206\u652F\uFF09" })
16202
+ ] }),
16203
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-side-group", children: [
16204
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-side-title", children: "\u672C\u5730" }),
16205
+ localBranches.map((b) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", className: "dkg-side-item" + (branch === b.name ? " on" : ""), onClick: () => setBranch(b.name), title: b.subject, children: [
16206
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-side-icon", children: "\u2387" }),
16207
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-ellipsis", children: b.name })
16208
+ ] }, b.full))
16209
+ ] }),
16210
+ remoteBranches.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-side-group", children: [
16211
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-side-title", children: "\u8FDC\u7AEF" }),
16212
+ remoteBranches.map((b) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", className: "dkg-side-item" + (branch === b.name ? " on" : ""), onClick: () => setBranch(b.name), title: b.subject, children: [
16213
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-side-icon remote", children: "\u2601" }),
16214
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-ellipsis", children: b.name })
16215
+ ] }, b.full))
16216
+ ] }) : null,
16217
+ tags.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-side-group", children: [
16218
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-side-title", children: "\u6807\u7B7E" }),
16219
+ tags.slice().reverse().map((t) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", className: "dkg-side-item" + (branch === t.name ? " on" : ""), onClick: () => setBranch(t.name), title: t.subject, children: [
16220
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-side-icon tag", children: "\u25C6" }),
16221
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-ellipsis", children: t.name })
16222
+ ] }, t.full))
16223
+ ] }) : null
16224
+ ] }),
16225
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-mid", children: [
16226
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-toolbar", children: [
16227
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("input", { className: "dkg-input", value: search, placeholder: "\u641C\u7D22\u5173\u952E\u8BCD\uFF08\u8BF4\u660E / \u54C8\u5E0C\uFF09", onChange: (e) => setSearch(e.target.value) }),
16228
+ authors.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("select", { className: "dkg-select", value: authorPick, onChange: (e) => setAuthorPick(e.target.value), title: "\u6309\u63D0\u4EA4\u4EBA\u7B5B\u9009", children: [
16229
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: "", children: "\u5168\u90E8\u63D0\u4EA4\u4EBA" }),
16230
+ authors.map((a) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("option", { value: a.name, children: [
16231
+ a.name,
16232
+ "\uFF08",
16233
+ a.count,
16234
+ "\uFF09"
16235
+ ] }, a.name))
16236
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("input", { className: "dkg-input sm", value: author, placeholder: "\u63D0\u4EA4\u4EBA", onChange: (e) => setAuthor(e.target.value) }),
16237
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("input", { className: "dkg-input sm", value: path, placeholder: "\u8DEF\u5F84", onChange: (e) => setPath(e.target.value) }),
16238
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("input", { className: "dkg-input sm", type: "date", value: since, onChange: (e) => setSince(e.target.value), title: "\u8D77\u59CB\u65E5\u671F\uFF08\u542B\uFF09" }),
16239
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-hint", children: "\u2192" }),
16240
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("input", { className: "dkg-input sm", type: "date", value: until, onChange: (e) => setUntil(e.target.value), title: "\u7ED3\u675F\u65E5\u671F\uFF08\u542B\uFF09" }),
16241
+ repoOptions.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
16242
+ RepoPicker,
16243
+ {
16244
+ repos: repoOptions,
16245
+ selected: pickedRepos,
16246
+ current: repo,
16247
+ onToggle: props.onToggleRepo,
16248
+ onOnlyCurrent: props.onOnlyCurrent,
16249
+ onSelectAll: props.onSelectAll
16250
+ }
16251
+ ) : null,
16252
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("select", { className: "dkg-select", value: limit, onChange: (e) => setLimit(Number(e.target.value)), children: [
16253
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: 50, children: "50" }),
16254
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: 100, children: "100" }),
16255
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: 200, children: "200" }),
16256
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: 500, children: "500" })
16257
+ ] }),
16258
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-colpick", children: [
16259
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
16260
+ "button",
16261
+ {
16262
+ type: "button",
16263
+ className: "dkg-icon-btn",
16264
+ onClick: () => setColMenu(!colMenu),
16265
+ title: "\u9009\u62E9\u8981\u663E\u793A\u7684\u5217",
16266
+ children: "\u25A4"
16267
+ }
16268
+ ),
16269
+ colMenu ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-colpick-menu", role: "listbox", "aria-multiselectable": "true", children: COMMIT_COLUMNS.map((c) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
16270
+ "button",
16271
+ {
16272
+ type: "button",
16273
+ role: "option",
16274
+ "aria-selected": c.fixed || showCol(c.id),
16275
+ disabled: !!c.fixed,
16276
+ className: "dkg-colpick-row" + (c.fixed || showCol(c.id) ? " on" : "") + (c.fixed ? " locked" : ""),
16277
+ title: c.fixed ? "\u8BE5\u5217\u4E0D\u53EF\u9690\u85CF" : "\u70B9\u51FB\u5207\u6362\u663E\u793A",
16278
+ onClick: () => toggleCol(c.id),
16279
+ children: [
16280
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-chip-check", "aria-hidden": "true", children: c.fixed || showCol(c.id) ? "\u2611" : "\u2610" }),
16281
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: c.title || "\uFF08\u5206\u652F\u56FE\uFF09" })
16282
+ ]
16283
+ },
16284
+ c.id
16285
+ )) }) : null
16286
+ ] }),
16287
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "dkg-icon-btn", onClick: load, disabled: loading, title: "\u5237\u65B0", children: loading ? "\u2026" : "\u27F3" })
16288
+ ] }),
16289
+ branch ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-filter-tag", children: [
16290
+ "\u5206\u652F\uFF1A",
16291
+ branch,
16292
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "dkg-link", onClick: () => setBranch(""), children: "\u6E05\u9664" })
16293
+ ] }) : null,
16294
+ error ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-error", children: error }) : null,
16295
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-thead", children: COMMIT_COLUMNS.filter((c) => c.fixed || showCol(c.id)).map((c) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-th " + c.id, children: c.title }, c.id)) }),
16296
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-commits", tabIndex: 0, onKeyDown: onListKeyDown, role: "grid", "aria-label": "\u63D0\u4EA4\u5217\u8868", children: [
16297
+ commits.length === 0 && !loading ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-note", children: "\u6CA1\u6709\u5339\u914D\u7684\u63D0\u4EA4\u3002" }) : null,
16298
+ commits.map((c, i) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(CommitRow, { commit: c, index: i, visibleCols, active: selected && selected.sha === c.sha, onSelect: selectCommit }, c.sha))
16299
+ ] })
16300
+ ] }),
16301
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-splitter-slot dkg-splitter-main", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DragSplitter, { value: mainPct, onChange: setMainPct, min: 20, max: 85, containerRef: bodyRef }) }),
16302
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-detail", ref: detailRef, children: [
16303
+ !selected ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-note", children: "\u9009\u62E9\u5DE6\u4FA7\u4E00\u6761\u63D0\u4EA4\u67E5\u770B\u8BE6\u60C5\u3002" }) : null,
16304
+ selected && detailLoading ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-note", children: "\u8BFB\u53D6\u4E2D\u2026" }) : null,
16305
+ detail && detail.error ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-error", children: detail.error }) : null,
16306
+ detail && !detail.error && !detailLoading ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
16307
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-detail-diff", children: diffFiles.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-detail-split", children: [
16308
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FileTree, { files: diffFiles, selected: activeFile, onSelect: (p) => setActiveFile(activeFile === p ? "" : p) }),
16309
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-diffs", children: [
16310
+ activeFile ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "dkg-link", onClick: () => setActiveFile(""), children: "\u663E\u793A\u5168\u90E8\u6587\u4EF6" }) : null,
16311
+ shownFiles.map((f) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DiffFile, { file: f, defaultOpen: !!activeFile || diffFiles.length <= 3 }, f.path)),
16312
+ detail.diff && detail.diff.truncated ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-note", children: "\u5DEE\u5F02\u8FC7\u5927\uFF0C\u5DF2\u622A\u65AD\u663E\u793A\u3002" }) : null
16313
+ ] })
16314
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-note", children: "\u8FD9\u6761\u63D0\u4EA4\u6CA1\u6709\u53EF\u663E\u793A\u7684\u5DEE\u5F02\u3002" }) }),
16315
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-splitter-slot", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DragSplitter, { value: detailPct, onChange: setDetailPct, min: 15, max: 85, containerRef: detailRef }) }),
16316
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-detail-msgbox", children: [
16317
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-detail-subject", children: detail.subject }),
16318
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-detail-meta", children: [
16319
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-sha", children: detail.sha }),
16320
+ detail.parents && detail.parents.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-tag", children: "\u5408\u5E76\u63D0\u4EA4" }) : null,
16321
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
16322
+ detail.author,
16323
+ " <",
16324
+ detail.authorEmail,
16325
+ ">"
16326
+ ] }),
16327
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: fmtTime4(detail.authorDate) }),
16328
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "dkg-add", children: [
16329
+ "+",
16330
+ detail.additions
16331
+ ] }),
16332
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "dkg-del", children: [
16333
+ "\u2212",
16334
+ detail.deletions
16335
+ ] })
16336
+ ] }),
16337
+ detail.body ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("pre", { className: "dkg-detail-msg", children: detail.body }) : null
16338
+ ] })
16339
+ ] }) : null
16340
+ ] })
16341
+ ] });
16342
+ }
16343
+ function WorktreePane(props) {
16344
+ const { repo, status, onRefresh } = props;
16345
+ const [checked, setChecked] = (0, import_react23.useState)({});
16346
+ const [message, setMessage] = (0, import_react23.useState)("");
16347
+ const [busy, setBusy] = (0, import_react23.useState)("");
16348
+ const [error, setError] = (0, import_react23.useState)("");
16349
+ const [preview, setPreview] = (0, import_react23.useState)(null);
16350
+ const [previewLoading, setPreviewLoading] = (0, import_react23.useState)(false);
16351
+ const [result, setResult] = (0, import_react23.useState)(null);
16352
+ const [activeFile, setActiveFile] = (0, import_react23.useState)("");
16353
+ const entries = status && status.entries || [];
16354
+ const staged = entries.filter((e) => e.staged);
16355
+ const unstaged = entries.filter((e) => !e.staged && !e.untracked);
16356
+ const untracked = entries.filter((e) => e.untracked);
16357
+ const toggle = (path) => setChecked((prev) => Object.assign({}, prev, { [path]: !prev[path] }));
16358
+ const toggleAll = (list) => {
16359
+ const allOn = list.length > 0 && list.every((e) => checked[e.path]);
16360
+ const next = Object.assign({}, checked);
16361
+ for (const e of list) next[e.path] = !allOn;
16362
+ setChecked(next);
16363
+ };
16364
+ const doStage = async (paths, unstage) => {
16365
+ if (paths.length === 0) return;
16366
+ setBusy(unstage ? "\u53D6\u6D88\u6682\u5B58\u2026" : "\u6682\u5B58\u4E2D\u2026");
16367
+ setError("");
16368
+ try {
16369
+ await rpc2("stage", { repo, paths, unstage: unstage === true, confirm: true });
16370
+ setChecked({});
16371
+ await onRefresh();
16372
+ } catch (e) {
16373
+ setError(e && e.message || String(e));
16374
+ } finally {
16375
+ setBusy("");
16376
+ }
16377
+ };
16378
+ const loadPreview = async () => {
16379
+ setPreviewLoading(true);
16380
+ setError("");
16381
+ setActiveFile("");
16382
+ try {
16383
+ const data = await rpc2("diff", { repo, staged: true });
16384
+ setPreview(data);
16385
+ } catch (e) {
16386
+ setError(e && e.message || String(e));
16387
+ setPreview(null);
16388
+ } finally {
16389
+ setPreviewLoading(false);
16390
+ }
16391
+ };
16392
+ const doCommit = async () => {
16393
+ if (!message.trim()) {
16394
+ setError("\u8BF7\u5148\u586B\u5199\u63D0\u4EA4\u8BF4\u660E");
16395
+ return;
16396
+ }
16397
+ if (staged.length === 0) {
16398
+ setError("\u6682\u5B58\u533A\u4E3A\u7A7A\uFF0C\u5148\u52FE\u9009\u8981\u63D0\u4EA4\u7684\u6587\u4EF6");
16399
+ return;
16400
+ }
16401
+ setBusy("\u63D0\u4EA4\u4E2D\u2026");
16402
+ setError("");
16403
+ try {
16404
+ const data = await rpc2("create-commit", { repo, message: message.trim(), confirm: true });
16405
+ setResult(data && data.commit);
16406
+ setMessage("");
16407
+ setPreview(null);
16408
+ setChecked({});
16409
+ await onRefresh();
16410
+ } catch (e) {
16411
+ setError(e && e.message || String(e));
16412
+ } finally {
16413
+ setBusy("");
16414
+ }
16415
+ };
16416
+ const doPush = async () => {
16417
+ setBusy("\u63A8\u9001\u4E2D\u2026");
16418
+ setError("");
16419
+ try {
16420
+ const data = await rpc2("push", { repo, confirm: true });
16421
+ setResult({ pushed: true, output: data && data.output });
16422
+ await onRefresh();
16423
+ } catch (e) {
16424
+ setError(e && e.message || String(e));
16425
+ } finally {
16426
+ setBusy("");
16427
+ }
16428
+ };
16429
+ const previewFiles = preview && preview.files || [];
16430
+ const shownPreview = activeFile ? previewFiles.filter((f) => f.path === activeFile) : previewFiles;
16431
+ const group = (title, list, stagedGroup) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-wt-group", children: [
16432
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-wt-head", children: [
16433
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { className: "dkg-check", children: [
16434
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("input", { type: "checkbox", checked: list.length > 0 && list.every((e) => checked[e.path]), onChange: () => toggleAll(list) }),
16435
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: title }),
16436
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-hint", children: list.length })
16437
+ ] }),
16438
+ list.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "dkg-link", disabled: !!busy, onClick: () => {
16439
+ const paths = list.filter((e) => checked[e.path]).map((e) => e.path);
16440
+ doStage(paths.length > 0 ? paths : list.map((e) => e.path), stagedGroup);
16441
+ }, children: stagedGroup ? "\u5168\u90E8\u53D6\u6D88\u6682\u5B58" : "\u5168\u90E8\u6682\u5B58" }) : null
16442
+ ] }),
16443
+ list.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-note dkg-wt-empty", children: "\u65E0" }) : list.map((e) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { className: "dkg-wt-item" + (checked[e.path] ? " on" : ""), children: [
16444
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("input", { type: "checkbox", checked: !!checked[e.path], onChange: () => toggle(e.path) }),
16445
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "dkg-wt-code", children: [
16446
+ e.index,
16447
+ e.worktree
16448
+ ] }),
16449
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-ellipsis", title: e.origPath ? e.origPath + " \u2192 " + e.path : e.path, children: e.path }),
16450
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-wt-actions", children: stagedGroup ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "dkg-link", disabled: !!busy, onClick: (ev) => {
16451
+ ev.preventDefault();
16452
+ doStage([e.path], true);
16453
+ }, children: "\u53D6\u6D88\u6682\u5B58" }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "dkg-link", disabled: !!busy, onClick: (ev) => {
16454
+ ev.preventDefault();
16455
+ doStage([e.path], false);
16456
+ }, children: "\u6682\u5B58" }) })
16457
+ ] }, e.path))
16458
+ ] });
16459
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-wt", children: [
16460
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-wt-files", children: [
16461
+ group("\u5DF2\u6682\u5B58", staged, true),
16462
+ group("\u672A\u6682\u5B58", unstaged, false),
16463
+ group("\u672A\u8DDF\u8E2A", untracked, false),
16464
+ entries.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-note", children: "\u5DE5\u4F5C\u533A\u5E72\u51C0\uFF0C\u6CA1\u6709\u53EF\u63D0\u4EA4\u7684\u6539\u52A8\u3002" }) : null
16465
+ ] }),
16466
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-wt-commit", children: [
16467
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
16468
+ "textarea",
16469
+ {
16470
+ className: "dkg-textarea",
16471
+ rows: 4,
16472
+ value: message,
16473
+ placeholder: "\u63D0\u4EA4\u8BF4\u660E\uFF08\u7B2C\u4E00\u884C\u662F\u6807\u9898\uFF0C\u7A7A\u4E00\u884C\u540E\u53EF\u5199\u6B63\u6587\uFF09",
16474
+ onChange: (e) => setMessage(e.target.value)
16475
+ }
16476
+ ),
16477
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-wt-actions", children: [
16478
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "dkg-btn", onClick: loadPreview, disabled: !!busy || staged.length === 0, children: previewLoading ? "\u8BFB\u53D6\u4E2D\u2026" : "\u9884\u89C8\u53D8\u66F4" }),
16479
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "dkg-btn primary", onClick: doCommit, disabled: !!busy || staged.length === 0 || !message.trim(), children: "\u63D0\u4EA4" }),
16480
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "dkg-btn", onClick: doPush, disabled: !!busy || status && status.ahead === 0, title: status && status.ahead === 0 ? "\u6CA1\u6709\u5F85\u63A8\u9001\u7684\u63D0\u4EA4" : "\u63A8\u9001\u5230\u8FDC\u7AEF", children: status && status.ahead > 0 ? "\u63A8\u9001 " + status.ahead + " \u4E2A\u63D0\u4EA4" : "\u63A8\u9001" })
16481
+ ] }),
16482
+ busy ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-hint", children: busy }) : null,
16483
+ error ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-error", children: error }) : null,
16484
+ result && result.pushed ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-ok", children: [
16485
+ "\u63A8\u9001\u5B8C\u6210",
16486
+ result.output ? "\uFF1A" + truncate4(result.output, 200) : ""
16487
+ ] }) : null,
16488
+ result && result.subject ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-ok", children: [
16489
+ "\u5DF2\u63D0\u4EA4 ",
16490
+ result.shortSha,
16491
+ "\uFF1A",
16492
+ truncate4(result.subject, 80)
16493
+ ] }) : null,
16494
+ preview ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-preview", children: [
16495
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-preview-head", children: [
16496
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
16497
+ "\u63D0\u4EA4\u9884\u89C8\uFF1A",
16498
+ previewFiles.length,
16499
+ " \u4E2A\u6587\u4EF6"
16500
+ ] }),
16501
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "dkg-link", onClick: () => {
16502
+ setPreview(null);
16503
+ setActiveFile("");
16504
+ }, children: "\u6536\u8D77" })
16505
+ ] }),
16506
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-detail-split", children: [
16507
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FileTree, { files: previewFiles, selected: activeFile, onSelect: (p) => setActiveFile(activeFile === p ? "" : p) }),
16508
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-diffs", children: shownPreview.map((f) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DiffFile, { file: f, defaultOpen: !!activeFile || previewFiles.length <= 3 }, f.path)) })
16509
+ ] })
16510
+ ] }) : null
16511
+ ] })
16512
+ ] });
16513
+ }
16514
+ function clampPercent(value, min, max) {
16515
+ const lo = typeof min === "number" ? min : 15;
16516
+ const hi = typeof max === "number" ? max : 85;
16517
+ const n = Number(value);
16518
+ if (!Number.isFinite(n)) return lo;
16519
+ return Math.min(hi, Math.max(lo, Math.round(n)));
16520
+ }
16521
+ function splitterStep(key, value, min, max) {
16522
+ const lo = typeof min === "number" ? min : 15;
16523
+ const hi = typeof max === "number" ? max : 85;
16524
+ if (key === "ArrowUp") return clampPercent(value + 2, lo, hi);
16525
+ if (key === "ArrowDown") return clampPercent(value - 2, lo, hi);
16526
+ if (key === "Home") return lo;
16527
+ if (key === "End") return hi;
16528
+ return null;
16529
+ }
16530
+ function dragToPercent(startValue, deltaY, containerHeight, min, max) {
16531
+ const lo = typeof min === "number" ? min : 15;
16532
+ const hi = typeof max === "number" ? max : 85;
16533
+ if (!(containerHeight > 0)) return clampPercent(startValue, lo, hi);
16534
+ const deltaPct = deltaY / containerHeight * 100;
16535
+ return clampPercent(startValue - deltaPct, lo, hi);
16536
+ }
16537
+ function RepoPicker(props) {
16538
+ const { repos, selected, current, onToggle, onOnlyCurrent, onSelectAll } = props;
16539
+ const [open, setOpen] = (0, import_react23.useState)(false);
16540
+ const rootRef = (0, import_react23.useRef)(null);
16541
+ (0, import_react23.useEffect)(() => {
16542
+ if (!open) return;
16543
+ const onDown = (ev) => {
16544
+ const root = rootRef.current;
16545
+ if (root && ev.target && !root.contains(ev.target)) setOpen(false);
16546
+ };
16547
+ const onKey = (ev) => {
16548
+ if (ev.key === "Escape") setOpen(false);
16549
+ };
16550
+ document.addEventListener("mousedown", onDown);
16551
+ document.addEventListener("keydown", onKey);
16552
+ return () => {
16553
+ document.removeEventListener("mousedown", onDown);
16554
+ document.removeEventListener("keydown", onKey);
16555
+ };
16556
+ }, [open]);
16557
+ const picked = selected.length > 0 ? selected : [current];
16558
+ const onlyCurrent = picked.length === 1 && picked[0] === current;
16559
+ const label = onlyCurrent ? "\u5F53\u524D\u4ED3\u5E93" : picked.length + " \u4E2A\u4ED3\u5E93";
16560
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-repopick", ref: rootRef, children: [
16561
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
16562
+ "button",
16563
+ {
16564
+ type: "button",
16565
+ className: "dkg-repopick-btn" + (picked.length > 1 ? " on" : ""),
16566
+ onClick: () => setOpen(!open),
16567
+ title: picked.join("\n"),
16568
+ children: [
16569
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
16570
+ "\u4ED3\u5E93\uFF1A",
16571
+ label
16572
+ ] }),
16573
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-caret", "aria-hidden": "true", children: open ? "\u25B4" : "\u25BE" })
16574
+ ]
16575
+ }
16576
+ ),
16577
+ open ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-repopick-menu", role: "listbox", "aria-multiselectable": "true", children: [
16578
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-repopick-all", children: [
16579
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
16580
+ "button",
16581
+ {
16582
+ type: "button",
16583
+ className: "dkg-repopick-allbtn",
16584
+ onClick: () => onSelectAll(repos.map((r) => r.path)),
16585
+ title: "\u52FE\u9009\u5168\u90E8\u4ED3\u5E93",
16586
+ children: "\u2611 \u5168\u9009"
16587
+ }
16588
+ ),
16589
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
16590
+ "button",
16591
+ {
16592
+ type: "button",
16593
+ className: "dkg-repopick-allbtn",
16594
+ onClick: () => onSelectAll([current]),
16595
+ title: "\u53EA\u4FDD\u7559\u5F53\u524D\u4ED3\u5E93",
16596
+ children: "\u2610 \u53D6\u6D88\u5168\u9009"
16597
+ }
16598
+ )
16599
+ ] }),
16600
+ repos.map((r) => {
16601
+ const checked = picked.includes(r.path);
16602
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
16603
+ "button",
16604
+ {
16605
+ type: "button",
16606
+ role: "option",
16607
+ "aria-selected": checked,
16608
+ className: "dkg-repopick-row" + (checked ? " on" : ""),
16609
+ title: r.path,
16610
+ onClick: () => onToggle(r.path),
16611
+ children: [
16612
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-chip-check", "aria-hidden": "true", children: checked ? "\u2611" : "\u2610" }),
16613
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-ellipsis", children: r.isRoot ? r.name + "\uFF08\u5F53\u524D\u76EE\u5F55\uFF09" : r.relPath }),
16614
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "dkg-hint", children: [
16615
+ r.branch,
16616
+ r.dirty > 0 ? " \xB7 " + r.dirty : ""
16617
+ ] })
16618
+ ]
16619
+ },
16620
+ r.path
16621
+ );
16622
+ }),
16623
+ picked.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "dkg-repopick-foot", onClick: onOnlyCurrent, children: "\u53EA\u770B\u5F53\u524D\u4ED3\u5E93" }) : null
16624
+ ] }) : null
16625
+ ] });
16626
+ }
16627
+ function DragSplitter(props) {
16628
+ const { value, onChange } = props;
16629
+ const min = typeof props.min === "number" ? props.min : 15;
16630
+ const max = typeof props.max === "number" ? props.max : 85;
16631
+ const [dragging, setDragging] = (0, import_react23.useState)(false);
16632
+ const boxRef = (0, import_react23.useRef)(null);
16633
+ const session = (0, import_react23.useRef)(null);
16634
+ const frame = (0, import_react23.useRef)(0);
16635
+ const pendingY = (0, import_react23.useRef)(0);
16636
+ const latestValue = (0, import_react23.useRef)(value);
16637
+ latestValue.current = value;
16638
+ const resolveContainer = () => {
16639
+ const given = props.containerRef && props.containerRef.current;
16640
+ if (given) return given;
16641
+ let node = boxRef.current;
16642
+ while (node && node.parentElement) {
16643
+ node = node.parentElement;
16644
+ if (node.getBoundingClientRect().height > 60) return node;
16645
+ }
16646
+ return null;
16647
+ };
16648
+ const begin = (clientY) => {
16649
+ const container = resolveContainer();
16650
+ if (!container) return;
16651
+ const rect2 = container.getBoundingClientRect();
16652
+ if (rect2.height <= 0) return;
16653
+ session.current = {
16654
+ top: rect2.top,
16655
+ height: rect2.height,
16656
+ startY: clientY,
16657
+ startValue: clampPercent(latestValue.current, min, max)
16658
+ };
16659
+ setDragging(true);
16660
+ };
16661
+ const apply2 = () => {
16662
+ frame.current = 0;
16663
+ const s = session.current;
16664
+ if (!s) return;
16665
+ onChange(dragToPercent(s.startValue, pendingY.current - s.startY, s.height, min, max));
16666
+ };
16667
+ const moveTo = (clientY) => {
16668
+ pendingY.current = clientY;
16669
+ if (frame.current) return;
16670
+ if (typeof requestAnimationFrame === "function") {
16671
+ frame.current = requestAnimationFrame(apply2);
16672
+ } else {
16673
+ apply2();
16674
+ }
16675
+ };
16676
+ const end = () => {
16677
+ session.current = null;
16678
+ if (frame.current && typeof cancelAnimationFrame === "function") {
16679
+ cancelAnimationFrame(frame.current);
16680
+ frame.current = 0;
16681
+ }
16682
+ setDragging(false);
16683
+ };
16684
+ (0, import_react23.useEffect)(() => {
16685
+ if (!dragging) return;
16686
+ const onMouseMove = (ev) => moveTo(ev.clientY);
16687
+ const onTouchMove = (ev) => {
16688
+ const t = ev.touches && ev.touches[0];
16689
+ if (!t) return;
16690
+ if (typeof ev.preventDefault === "function" && ev.cancelable !== false) ev.preventDefault();
16691
+ moveTo(t.clientY);
16692
+ };
16693
+ const onUp = () => end();
16694
+ document.addEventListener("mousemove", onMouseMove);
16695
+ document.addEventListener("mouseup", onUp);
16696
+ document.addEventListener("touchmove", onTouchMove, { passive: false });
16697
+ document.addEventListener("touchend", onUp);
16698
+ document.addEventListener("touchcancel", onUp);
16699
+ window.addEventListener("blur", onUp);
16700
+ document.body.classList.add("dkg-resizing");
16701
+ return () => {
16702
+ document.removeEventListener("mousemove", onMouseMove);
16703
+ document.removeEventListener("mouseup", onUp);
16704
+ document.removeEventListener("touchmove", onTouchMove);
16705
+ document.removeEventListener("touchend", onUp);
16706
+ document.removeEventListener("touchcancel", onUp);
16707
+ window.removeEventListener("blur", onUp);
16708
+ document.body.classList.remove("dkg-resizing");
16709
+ if (frame.current && typeof cancelAnimationFrame === "function") {
16710
+ cancelAnimationFrame(frame.current);
16711
+ frame.current = 0;
16712
+ }
16713
+ };
16714
+ }, [dragging, onChange, min, max]);
16715
+ const onKeyDown = (ev) => {
16716
+ const next = splitterStep(ev.key, value, min, max);
16717
+ if (next === null) return;
16718
+ ev.preventDefault();
16719
+ onChange(next);
16720
+ };
16721
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
16722
+ "div",
16723
+ {
16724
+ ref: boxRef,
16725
+ className: "dkg-splitter" + (dragging ? " dragging" : ""),
16726
+ role: "separator",
16727
+ "aria-orientation": "horizontal",
16728
+ "aria-valuenow": value,
16729
+ "aria-valuemin": min,
16730
+ "aria-valuemax": max,
16731
+ tabIndex: 0,
16732
+ title: "\u62D6\u52A8\u8C03\u6574\u9AD8\u5EA6\uFF08\u4E5F\u53EF\u7528\u65B9\u5411\u952E\uFF09",
16733
+ onMouseDown: (ev) => {
16734
+ ev.preventDefault();
16735
+ begin(ev.clientY);
16736
+ },
16737
+ onTouchStart: (ev) => {
16738
+ const t = ev.touches && ev.touches[0];
16739
+ if (t) begin(t.clientY);
16740
+ },
16741
+ onKeyDown,
16742
+ onDoubleClick: () => onChange(50),
16743
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-splitter-grip", "aria-hidden": "true" })
16744
+ }
16745
+ );
16746
+ }
16747
+ function DirBrowser(props) {
16748
+ const ctx = props.ctx;
16749
+ const [listing, setListing] = (0, import_react23.useState)(null);
16750
+ const [loading, setLoading] = (0, import_react23.useState)(false);
16751
+ const [error, setError] = (0, import_react23.useState)("");
16752
+ const [showHidden, setShowHidden] = (0, import_react23.useState)(false);
16753
+ const [input, setInput] = (0, import_react23.useState)(props.startPath || "");
16754
+ const load = (0, import_react23.useCallback)(async (path) => {
16755
+ setLoading(true);
16756
+ setError("");
16757
+ try {
16758
+ const uiw = ctx && typeof ctx.get === "function" ? ctx.get("uiWorkspace") : null;
16759
+ if (!uiw || typeof uiw.listDirectory !== "function") {
16760
+ throw new Error("\u5F53\u524D\u73AF\u5883\u6CA1\u6709\u76EE\u5F55\u6D4F\u89C8\u80FD\u529B\uFF08uiWorkspace.listDirectory \u4E0D\u53EF\u7528\uFF09");
16761
+ }
16762
+ const data = await uiw.listDirectory(path || void 0);
16763
+ setListing(data);
16764
+ setInput(data && data.path ? data.path : "");
16765
+ } catch (e) {
16766
+ setError(e && e.message || String(e));
16767
+ } finally {
16768
+ setLoading(false);
16769
+ }
16770
+ }, [ctx]);
16771
+ (0, import_react23.useEffect)(() => {
16772
+ load(props.startPath || "");
16773
+ }, [load, props.startPath]);
16774
+ const entries = (listing && listing.entries || []).filter((e) => showHidden || !e.hidden);
16775
+ const crumbs = listing && listing.crumbs || [];
16776
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-picker", children: [
16777
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-picker-head", children: [
16778
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-picker-title", children: "\u9009\u62E9\u76EE\u5F55" }),
16779
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "dkg-link", onClick: props.onClose, children: "\u5173\u95ED" })
16780
+ ] }),
16781
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-crumbs", children: crumbs.map((c, i) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
16782
+ "button",
16783
+ {
16784
+ type: "button",
16785
+ className: "dkg-crumb" + (i === crumbs.length - 1 ? " on" : ""),
16786
+ title: c.path,
16787
+ onClick: () => load(c.path),
16788
+ children: i === 0 ? c.name || "/" : c.name
16789
+ },
16790
+ c.path
16791
+ )) }),
16792
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-picker-bar", children: [
16793
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
16794
+ "input",
16795
+ {
16796
+ className: "dkg-input",
16797
+ value: input,
16798
+ placeholder: "\u7EDD\u5BF9\u8DEF\u5F84",
16799
+ spellCheck: false,
16800
+ onChange: (e) => setInput(e.target.value),
16801
+ onKeyDown: (e) => {
16802
+ if (e.key === "Enter") load(input.trim());
16803
+ }
16804
+ }
16805
+ ),
16806
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "dkg-btn", onClick: () => load(input.trim()), disabled: loading, children: "\u524D\u5F80" }),
16807
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { className: "dkg-check", children: [
16808
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("input", { type: "checkbox", checked: showHidden, onChange: (e) => setShowHidden(e.target.checked) }),
16809
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: "\u9690\u85CF\u9879" })
16810
+ ] })
16811
+ ] }),
16812
+ error ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-error", children: error }) : null,
16813
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-picker-list", children: [
16814
+ loading ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-note", children: "\u8BFB\u53D6\u4E2D\u2026" }) : null,
16815
+ !loading && entries.length === 0 && !error ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-note", children: "\u8FD9\u4E2A\u76EE\u5F55\u4E0B\u6CA1\u6709\u5B50\u76EE\u5F55\u3002" }) : null,
16816
+ entries.map((entry) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
16817
+ "button",
16818
+ {
16819
+ type: "button",
16820
+ className: "dkg-picker-row",
16821
+ title: entry.path,
16822
+ onClick: () => load(entry.path),
16823
+ children: [
16824
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-folder", children: "\u25B8" }),
16825
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-ellipsis", children: entry.name })
16826
+ ]
16827
+ },
16828
+ entry.path
16829
+ )),
16830
+ listing && listing.truncated ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-note", children: "\u76EE\u5F55\u8FC7\u591A\uFF0C\u53EA\u663E\u793A\u4E86\u524D\u9762\u4E00\u90E8\u5206\u3002" }) : null
16831
+ ] }),
16832
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-picker-foot", children: [
16833
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-hint", title: listing && listing.path, children: listing && listing.path ? truncate4(listing.path, 60) : "" }),
16834
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
16835
+ "button",
16836
+ {
16837
+ type: "button",
16838
+ className: "dkg-btn primary",
16839
+ disabled: !listing || loading,
16840
+ onClick: () => {
16841
+ if (listing && listing.path) props.onPick(listing.path);
16842
+ },
16843
+ children: "\u9009\u8FD9\u4E2A\u76EE\u5F55"
16844
+ }
16845
+ )
16846
+ ] })
16847
+ ] });
16848
+ }
16849
+ function GitView(props) {
16850
+ const ctx = props && props.ctx;
16851
+ const [dir, setDir] = (0, import_react23.useState)(props && props.repo ? props.repo : "");
16852
+ const [includeSubdirs, setIncludeSubdirs] = (0, import_react23.useState)(true);
16853
+ const [repos, setRepos] = (0, import_react23.useState)([]);
16854
+ const [selectedRepos, setSelectedRepos] = (0, import_react23.useState)([]);
16855
+ const setAllRepos = (paths) => {
16856
+ const list = Array.isArray(paths) ? paths.filter(Boolean) : [];
16857
+ setSelectedRepos(list.length > 0 ? list : [repo]);
16858
+ };
16859
+ const toggleRepo = (path) => setSelectedRepos((prev) => toggleRepoSelection(prev, path, repo));
16860
+ const [repo, setRepo] = (0, import_react23.useState)(props && props.repo ? props.repo : "");
16861
+ const [refs, setRefs] = (0, import_react23.useState)(null);
16862
+ const [status, setStatus] = (0, import_react23.useState)(null);
16863
+ const [tab, setTab] = (0, import_react23.useState)("history");
16864
+ const [loading, setLoading] = (0, import_react23.useState)(false);
16865
+ const [error, setError] = (0, import_react23.useState)("");
16866
+ const [note, setError2] = (0, import_react23.useState)("");
16867
+ const booted = (0, import_react23.useRef)(false);
16868
+ (0, import_react23.useEffect)(() => {
16869
+ if (booted.current) return;
16870
+ booted.current = true;
16871
+ let stopped = false;
16872
+ rpc2("info").then((info) => {
16873
+ if (stopped) return;
16874
+ const given = props && props.repo;
16875
+ const sessionDir = currentSessionDir(ctx, props && props.sessionId);
16876
+ const start = given || sessionDir || info && info.defaultDir || "";
16877
+ setDir(start);
16878
+ if (given) setRepo(given);
16879
+ if (!given && !sessionDir) {
16880
+ setError("\u6CA1\u80FD\u8BFB\u5230\u5F53\u524D\u4F1A\u8BDD\u7684\u5DE5\u4F5C\u76EE\u5F55\uFF0C\u5148\u663E\u793A\u5BBF\u4E3B\u8FDB\u7A0B\u7684\u76EE\u5F55\u3002\u53EF\u4EE5\u5728\u4E0A\u65B9\u624B\u52A8\u586B\u5199\u4ED3\u5E93\u8DEF\u5F84\uFF0C\u6216\u70B9\u300C\u9009\u62E9\u76EE\u5F55\u2026\u300D\u3002");
16881
+ }
16882
+ if (info && info.available === false) {
16883
+ setError("\u672C\u673A\u6CA1\u6709\u53EF\u7528\u7684 git \u547D\u4EE4\uFF08PATH \u91CC\u627E\u4E0D\u5230 git\uFF09\uFF0C\u65E0\u6CD5\u8BFB\u53D6\u63D0\u4EA4\u8BB0\u5F55\u3002");
16884
+ }
16885
+ }).catch((e) => {
16886
+ if (!stopped) setError(e && e.message || String(e));
16887
+ });
16888
+ return () => {
16889
+ stopped = true;
16890
+ };
16891
+ }, []);
16892
+ const resolveAndSet = (0, import_react23.useCallback)(async (target) => {
16893
+ if (!target) return;
16894
+ setLoading(true);
16895
+ setError("");
16896
+ try {
16897
+ const resolved = await rpc2("resolve", { path: target });
16898
+ setRepo(resolved.repo);
16899
+ if (!props || !props.repo) setDir(resolved.repo);
16900
+ } catch (e) {
16901
+ try {
16902
+ const scanned = await rpc2("repos", { dir: target, includeSubdirs: true, depth: 3 });
16903
+ const list = scanned && scanned.repos || [];
16904
+ setRepos(list);
16905
+ if (list.length > 0) {
16906
+ const first = list[0];
16907
+ setRepo(first.path);
16908
+ if (!props || !props.repo) setDir(first.path);
16909
+ return;
16910
+ }
16911
+ } catch {
16912
+ }
16913
+ setRepos([]);
16914
+ setRepo("");
16915
+ setError(e && e.message || String(e));
16916
+ } finally {
16917
+ setLoading(false);
16918
+ }
16919
+ }, []);
16920
+ (0, import_react23.useEffect)(() => {
16921
+ if (!dir) return;
16922
+ let stopped = false;
16923
+ const timer = setTimeout(() => {
16924
+ if (!stopped) resolveAndSet(dir);
16925
+ }, 200);
16926
+ return () => {
16927
+ stopped = true;
16928
+ clearTimeout(timer);
16929
+ };
16930
+ }, [dir, resolveAndSet]);
16931
+ const scanRepos = (0, import_react23.useCallback)(async (target) => {
16932
+ if (!target || !includeSubdirs) {
16933
+ setRepos([]);
16934
+ return;
16935
+ }
16936
+ try {
16937
+ const data = await rpc2("repos", { dir: target, includeSubdirs: true, depth: 3 });
16938
+ setRepos(data && data.repos || []);
16939
+ } catch {
16940
+ setRepos([]);
16941
+ }
16942
+ }, [includeSubdirs]);
16943
+ (0, import_react23.useEffect)(() => {
16944
+ scanRepos(dir);
16945
+ }, [dir, scanRepos]);
16946
+ const refreshRepo = (0, import_react23.useCallback)(async () => {
16947
+ if (!repo) {
16948
+ setRefs(null);
16949
+ setStatus(null);
16950
+ return;
16951
+ }
16952
+ try {
16953
+ const [r, s] = await Promise.all([rpc2("refs", { repo }), rpc2("status", { repo })]);
16954
+ setRefs(r);
16955
+ setStatus(s);
16956
+ } catch (e) {
16957
+ setError(e && e.message || String(e));
16958
+ setRefs(null);
16959
+ setStatus(null);
16960
+ }
16961
+ }, [repo]);
16962
+ (0, import_react23.useEffect)(() => {
16963
+ refreshRepo();
16964
+ }, [refreshRepo]);
16965
+ const [picking, setPicking] = (0, import_react23.useState)(false);
16966
+ const canBrowse = (() => {
16967
+ try {
16968
+ const uiw = ctx && typeof ctx.get === "function" ? ctx.get("uiWorkspace") : null;
16969
+ return !!(uiw && typeof uiw.listDirectory === "function");
16970
+ } catch {
16971
+ return false;
16972
+ }
16973
+ })();
16974
+ const pick = async () => {
16975
+ if (canBrowse) {
16976
+ setPicking(true);
16977
+ return;
16978
+ }
16979
+ const chosen = await pickDirectory(ctx);
16980
+ if (chosen) setDir(chosen);
16981
+ };
16982
+ const branch = refs && refs.branch || "";
16983
+ const ahead = status && status.ahead || 0;
16984
+ const behind = status && status.behind || 0;
16985
+ const dirty = status ? status.stagedCount + status.unstagedCount + status.untrackedCount : 0;
16986
+ const compact = props && props.compact === true;
16987
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg" + (compact ? " dkg-compact" : ""), children: [
16988
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-bar", children: [
16989
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("input", { className: "dkg-input", value: dir, placeholder: "\u4ED3\u5E93\u6216\u7236\u76EE\u5F55\u7684\u7EDD\u5BF9\u8DEF\u5F84", spellCheck: false, onChange: (e) => setDir(e.target.value) }),
16990
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "dkg-btn", onClick: () => resolveAndSet(dir), disabled: !dir || loading, children: loading ? "\u2026" : "\u6253\u5F00" }),
16991
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "dkg-btn", onClick: pick, title: canBrowse ? "\u6D4F\u89C8\u76EE\u5F55\uFF08\u670D\u52A1\u5668\u53EF\u7528\uFF09" : "\u6253\u5F00\u7CFB\u7EDF\u76EE\u5F55\u5BF9\u8BDD\u6846", children: picking ? "\u6D4F\u89C8\u4E2D\u2026" : "\u9009\u62E9\u76EE\u5F55\u2026" })
16992
+ ] }),
16993
+ picking ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
16994
+ DirBrowser,
16995
+ {
16996
+ ctx,
16997
+ startPath: dir,
16998
+ onClose: () => setPicking(false),
16999
+ onPick: (chosen) => {
17000
+ setPicking(false);
17001
+ setDir(chosen);
17002
+ resolveAndSet(chosen);
17003
+ }
17004
+ }
17005
+ ) : null,
17006
+ !compact ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-bar", children: [
17007
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { className: "dkg-check", children: [
17008
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("input", { type: "checkbox", checked: includeSubdirs, onChange: (e) => setIncludeSubdirs(e.target.checked) }),
17009
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: "\u5305\u542B\u5B50\u76EE\u5F55\u4ED3\u5E93" })
17010
+ ] }),
17011
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-hint", children: loading ? "\u6B63\u5728\u89E3\u6790\u2026" : repos.length > 0 ? repos.length + " \u4E2A\u4ED3\u5E93" : "" })
17012
+ ] }) : null,
17013
+ error ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-error", children: error }) : null,
17014
+ repo ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
17015
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-tabbar", children: [
17016
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-repo-name", title: repo, children: repo }),
17017
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-badge", children: branch || "(\u5206\u79BB HEAD)" }),
17018
+ behind > 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "dkg-badge warn", children: [
17019
+ "\u843D\u540E ",
17020
+ behind
17021
+ ] }) : null,
17022
+ ahead > 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "dkg-badge ok", children: [
17023
+ "\u5F85\u63A8\u9001 ",
17024
+ ahead
17025
+ ] }) : null,
17026
+ dirty > 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "dkg-badge", children: [
17027
+ dirty,
17028
+ " \u5904\u6539\u52A8"
17029
+ ] }) : null,
17030
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-tabs", children: [
17031
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "dkg-tab" + (tab === "history" ? " on" : ""), onClick: () => setTab("history"), children: "\u5386\u53F2" }),
17032
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", className: "dkg-tab" + (tab === "worktree" ? " on" : ""), onClick: () => setTab("worktree"), children: [
17033
+ "\u5DE5\u4F5C\u533A",
17034
+ dirty > 0 ? " (" + dirty + ")" : ""
17035
+ ] })
17036
+ ] }),
17037
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "dkg-btn", onClick: refreshRepo, children: "\u5237\u65B0" })
17038
+ ] }),
17039
+ tab === "history" ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
17040
+ HistoryPane,
17041
+ {
17042
+ repo,
17043
+ repos,
17044
+ selectedRepos: selectedRepos.length > 0 ? selectedRepos : [repo],
17045
+ currentRepo: repo,
17046
+ onToggleRepo: toggleRepo,
17047
+ onOnlyCurrent: () => setSelectedRepos([repo]),
17048
+ onSelectAll: setAllRepos,
17049
+ refs,
17050
+ initialPath: props && props.initialPath
17051
+ }
17052
+ ) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(WorktreePane, { repo, status, onRefresh: refreshRepo })
17053
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-note", children: "\u6B63\u5728\u89E3\u6790\u76EE\u5F55\u6240\u5728\u7684\u4ED3\u5E93\u2026\uFF08\u4E5F\u53EF\u4EE5\u5728\u4E0A\u9762\u586B\u4E00\u4E2A\u7EDD\u5BF9\u8DEF\u5F84\u540E\u70B9\u300C\u6253\u5F00\u300D\uFF09" })
17054
+ ] });
17055
+ }
17056
+ var GIT_TAB_ID = "dsh-dock.git";
17057
+ var GIT_TAB_KIND = "dsh-dock-git";
17058
+ var GIT_ICON_KEY = "dsh-dock.git";
17059
+ var GIT_PANEL_NAME = "Git\u4ED3\u5E93\u64CD\u4F5C";
17060
+ var dockCtx = null;
17061
+ function GitTabBody(props) {
17062
+ const tab = props.useTabInfo();
17063
+ const params = tab && tab.tab && tab.tab.navigation && tab.tab.navigation.params || {};
17064
+ const repo = typeof params.repo === "string" ? params.repo : "";
17065
+ const path = typeof params.path === "string" ? params.path : "";
17066
+ const [target, setTarget] = (0, import_react23.useState)({ repo, path });
17067
+ (0, import_react23.useEffect)(() => {
17068
+ setTarget({ repo, path });
17069
+ }, [repo, path]);
17070
+ const ctx = props.ctx || dockCtx;
17071
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(GitView, { ctx, repo: target.repo, initialPath: target.path, sessionId: props.sessionId, compact: true });
17072
+ }
17073
+ function GitTabTitle(props) {
17074
+ const tab = props.useTabInfo();
17075
+ const params = tab && tab.tab && tab.tab.navigation && tab.tab.navigation.params || {};
17076
+ const repo = typeof params.repo === "string" ? params.repo : "";
17077
+ const name = repo ? repo.split("/").filter(Boolean).pop() : "";
17078
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { title: repo, children: name || GIT_PANEL_NAME });
17079
+ }
17080
+ var css6 = [
17081
+ ".dkg{display:flex;flex-direction:column;gap:8px;min-height:0;height:100%;}",
17082
+ ".dkg.dkg-compact{gap:6px;padding:0;}",
17083
+ ".dkg-bar{display:flex;align-items:center;gap:6px;flex-wrap:wrap;}",
17084
+ ".dkg-input{flex:1;min-width:120px;box-sizing:border-box;font-family:inherit;font-size:12px;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l2);border-radius:8px;padding:4px 8px;}",
17085
+ ".dkg-input.sm{min-width:70px;flex:0 1 100px;}",
17086
+ ".dkg-input:focus{outline:none;border-color:var(--dk-accent);}",
17087
+ ".dkg-select{flex:none;font-family:inherit;font-size:12px;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l2);border-radius:8px;padding:4px 6px;}",
17088
+ ".dkg-btn{flex:none;cursor:pointer;font-family:inherit;font-size:12px;color:var(--dsw-alias-label-primary);background:transparent;border:1px solid var(--dsw-alias-border-l2);border-radius:8px;padding:3px 9px;}",
17089
+ ".dkg-btn:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover);}",
17090
+ ".dkg-btn:disabled{opacity:.45;cursor:default;}",
17091
+ ".dkg-btn.primary{border-color:var(--dk-accent);color:var(--dk-accent);}",
17092
+ ".dkg-btn.primary:hover:not(:disabled){background:var(--dk-accent-soft);}",
17093
+ ".dkg-link{cursor:pointer;font-family:inherit;font-size:11px;color:var(--dk-accent);background:transparent;border:0;padding:0;}",
17094
+ ".dkg-link:disabled{opacity:.5;cursor:default;}",
17095
+ ".dkg-check{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--dsw-alias-label-secondary);cursor:pointer;}",
17096
+ ".dkg-hint{font-size:11px;color:var(--dsw-alias-label-tertiary);}",
17097
+ ".dkg-note{color:var(--dsw-alias-label-secondary);font-size:12px;line-height:1.6;}",
17098
+ ".dkg-error{border:1px solid color-mix(in srgb,var(--dsw-alias-state-error-primary) 45%,transparent);background:color-mix(in srgb,var(--dsw-alias-state-error-primary) 8%,transparent);color:var(--dsw-alias-state-error-primary);border-radius:8px;padding:6px 10px;font-size:12px;line-height:1.6;word-break:break-all;}",
17099
+ ".dkg-ok{border:1px solid color-mix(in srgb,var(--dsw-alias-state-success-primary) 45%,transparent);background:color-mix(in srgb,var(--dsw-alias-state-success-primary) 8%,transparent);color:var(--dsw-alias-state-success-primary);border-radius:8px;padding:6px 10px;font-size:12px;line-height:1.6;word-break:break-all;}",
17100
+ // 子仓库多选下拉
17101
+ ".dkg-repopick{position:relative;flex:0 1 auto;}",
17102
+ ".dkg-repopick-btn{display:flex;align-items:center;gap:4px;cursor:pointer;font-family:inherit;font-size:11px;color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l2);border-radius:6px;padding:4px 8px;white-space:nowrap;}",
17103
+ ".dkg-repopick-btn:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary);}",
17104
+ ".dkg-repopick-btn.on{border-color:var(--dk-accent);color:var(--dk-accent);}",
17105
+ ".dkg-caret{font-size:9px;opacity:.8;}",
17106
+ ".dkg-repopick-menu{position:absolute;top:calc(100% + 4px);right:0;z-index:20;min-width:260px;max-width:min(420px,90vw);max-height:300px;overflow:auto;display:flex;flex-direction:column;gap:1px;padding:4px;background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l2);border-radius:8px;box-shadow:0 8px 24px rgba(0,0,0,.28);}",
17107
+ ".dkg-repopick-row{display:flex;align-items:center;gap:6px;width:100%;box-sizing:border-box;text-align:left;cursor:pointer;font-family:inherit;font-size:11px;color:var(--dsw-alias-label-secondary);background:transparent;border:1px solid transparent;border-radius:5px;padding:4px 6px;min-width:0;}",
17108
+ ".dkg-repopick-row:hover{background:var(--dsw-alias-interactive-bg-hover);}",
17109
+ ".dkg-repopick-row.on{color:var(--dsw-alias-label-primary);}",
17110
+ ".dkg-repopick-all{display:flex;gap:4px;flex:none;border-bottom:1px solid var(--dsw-alias-border-l1);padding:2px 2px 5px;margin-bottom:2px;}",
17111
+ ".dkg-repopick-allbtn{flex:1;cursor:pointer;font-family:inherit;font-size:11px;color:var(--dk-accent);background:transparent;border:1px solid var(--dsw-alias-border-l1);border-radius:5px;padding:3px 6px;}",
17112
+ ".dkg-repopick-allbtn:hover{background:var(--dsw-alias-interactive-bg-hover);border-color:var(--dk-accent);}",
17113
+ ".dkg-repopick-foot{flex:none;cursor:pointer;font-family:inherit;font-size:11px;color:var(--dk-accent);background:transparent;border:0;border-top:1px solid var(--dsw-alias-border-l1);padding:5px 6px;margin-top:2px;text-align:left;}",
17114
+ ".dkg-repopick-foot:hover{text-decoration:underline;}",
17115
+ ".dkg-tabbar{display:flex;align-items:center;gap:6px;flex-wrap:wrap;border-bottom:1px solid var(--dsw-alias-border-l1);padding-bottom:5px;}",
17116
+ ".dkg-repo-name{font-size:12px;font-weight:600;color:var(--dsw-alias-label-primary);max-width:42%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;direction:rtl;text-align:left;}",
17117
+ ".dkg-badge{font-size:10px;border:1px solid var(--dsw-alias-border-l2);border-radius:999px;padding:0 8px;color:var(--dsw-alias-label-tertiary);}",
17118
+ ".dkg-badge.ok{color:var(--dsw-alias-state-success-primary);border-color:currentColor;}",
17119
+ ".dkg-badge.warn{color:var(--dk-warn);border-color:currentColor;}",
17120
+ ".dkg-tabs{display:flex;gap:4px;margin-left:auto;}",
17121
+ ".dkg-tab{cursor:pointer;font-family:inherit;font-size:12px;color:var(--dsw-alias-label-secondary);background:transparent;border:1px solid transparent;border-radius:8px;padding:2px 9px;}",
17122
+ ".dkg-tab.on{color:var(--dk-accent);border-color:currentColor;background:var(--dk-accent-soft);}",
17123
+ // 抽屉里三栏改为上下堆叠,宽度不够时更可用
17124
+ ".dkg-body{display:flex;gap:6px;min-height:0;flex:1;overflow:hidden;}",
17125
+ ".dkg-compact .dkg-body{flex-direction:column;}",
17126
+ ".dkg-side{flex:none;width:150px;overflow:auto;border:1px solid var(--dsw-alias-border-l1);border-radius:8px;background:var(--dsw-alias-bg-layer-1);padding:5px;display:flex;flex-direction:column;gap:1px;}",
17127
+ ".dkg-compact .dkg-side{width:auto;max-height:110px;flex-direction:row;flex-wrap:wrap;align-items:center;}",
17128
+ ".dkg-compact .dkg-side-group{flex-direction:row;flex-wrap:wrap;margin-top:0;}",
17129
+ ".dkg-compact .dkg-side-title{display:none;}",
17130
+ ".dkg-compact .dkg-side-item{width:auto;flex:none;max-width:180px;}",
17131
+ ".dkg-side-group{display:flex;flex-direction:column;gap:1px;margin-top:4px;}",
17132
+ ".dkg-side-title{font-size:10px;text-transform:uppercase;letter-spacing:.04em;color:var(--dsw-alias-label-tertiary);padding:4px 6px 2px;}",
17133
+ ".dkg-side-item{display:flex;align-items:center;gap:6px;width:100%;box-sizing:border-box;text-align:left;cursor:pointer;font-family:inherit;font-size:12px;color:var(--dsw-alias-label-secondary);background:transparent;border:1px solid transparent;border-radius:6px;padding:2px 6px;min-width:0;}",
17134
+ ".dkg-side-item:hover{background:var(--dsw-alias-interactive-bg-hover);}",
17135
+ ".dkg-side-item.on{color:var(--dk-accent);background:var(--dk-accent-soft);border-color:color-mix(in srgb,var(--dk-accent) 35%,transparent);}",
17136
+ ".dkg-branch-icon{flex:none;font-size:10px;color:var(--dsw-alias-label-tertiary);}",
17137
+ ".dkg-branch-icon.remote{color:var(--dsw-alias-label-secondary);}",
17138
+ ".dkg-branch-icon.tag{color:var(--dk-warn);}",
17139
+ ".dkg-ellipsis{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}",
17140
+ ".dkg-mid{flex:1 1 40%;min-width:0;min-height:0;display:flex;flex-direction:column;gap:5px;border:1px solid var(--dsw-alias-border-l1);border-radius:8px;background:var(--dsw-alias-bg-layer-1);padding:6px;}",
17141
+ ".dkg-compact .dkg-mid{flex:1 1 auto;min-height:80px;overflow:hidden;}",
17142
+ ".dkg-filters{display:flex;flex-direction:column;gap:5px;}",
17143
+ ".dkg-filter-row{display:flex;gap:5px;flex-wrap:wrap;align-items:center;}",
17144
+ ".dkg-filter-tag{display:flex;align-items:center;gap:8px;font-size:11px;color:var(--dk-accent);}",
17145
+ ".dkg-commits{flex:1;min-height:60px;overflow:auto;display:flex;flex-direction:column;gap:1px;}",
17146
+ ".dkg-commit{display:grid;grid-template-columns:12px minmax(0,1fr) auto;align-items:center;gap:6px;width:100%;box-sizing:border-box;text-align:left;cursor:pointer;font-family:inherit;font-size:12px;color:var(--dsw-alias-label-primary);background:transparent;border:1px solid transparent;border-radius:6px;padding:3px 5px;}",
17147
+ ".dkg-commit:hover{background:var(--dsw-alias-interactive-bg-hover);}",
17148
+ ".dkg-commit.on{background:var(--dk-accent-soft);border-color:color-mix(in srgb,var(--dk-accent) 35%,transparent);}",
17149
+ ".dkg-graph{display:flex;align-items:center;justify-content:center;position:relative;height:100%;}",
17150
+ ".dkg-graph::before{content:'';position:absolute;top:-4px;bottom:-4px;width:1px;background:var(--dsw-alias-border-l2);}",
17151
+ ".dkg-graph-dot{position:relative;width:6px;height:6px;border-radius:50%;background:var(--dk-accent);box-shadow:0 0 0 2px var(--dsw-alias-bg-layer-1);}",
17152
+ ".dkg-commit-subject{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}",
17153
+ ".dkg-commit-refs{display:none;}",
17154
+ ".dkg-compact .dkg-commit-refs{display:none;}",
17155
+ ".dkg-commit-meta-line{display:flex;align-items:center;gap:6px;font-size:10px;color:var(--dsw-alias-label-tertiary);overflow:hidden;}",
17156
+ ".dkg-ref{font-size:10px;border:1px solid var(--dsw-alias-border-l2);border-radius:999px;padding:0 6px;color:var(--dsw-alias-label-secondary);}",
17157
+ ".dkg-ref.remote{color:var(--dsw-alias-label-tertiary);}",
17158
+ ".dkg-commit-author{font-size:11px;color:var(--dsw-alias-label-secondary);flex:none;max-width:80px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}",
17159
+ ".dkg-commit-time{font-size:11px;color:var(--dsw-alias-label-tertiary);flex:none;min-width:58px;text-align:right;}",
17160
+ ".dkg-detail{flex:1 1 46%;min-width:0;min-height:0;overflow:hidden;border:1px solid var(--dsw-alias-border-l1);border-radius:8px;background:var(--dsw-alias-bg-layer-1);padding:8px;display:flex;flex-direction:column;gap:4px;}",
17161
+ ".dkg-compact .dkg-detail{flex:none;height:var(--dkg-main-pct,50%);max-height:none;min-height:80px;}",
17162
+ // 拖动分隔条:只在上下堆叠(抽屉)时占位,宽屏三栏下隐藏
17163
+ // 列表↔详情 的分隔条:只在抽屉(上下堆叠)时出现;宽屏三栏时详情在右侧,不需要它
17164
+ ".dkg-splitter-main{display:none;}",
17165
+ ".dkg-compact .dkg-splitter-main{display:block;flex:none;}",
17166
+ // 详情内部(差异↔说明)的分隔条:任何布局都显示
17167
+ // 拖动期间:全局光标改成上下调整,并禁止选中文字
17168
+ // (不禁止的话拖快了会连带选中面板里的文本,出现蓝色选区,视觉上就是「闪」)
17169
+ "body.dkg-resizing{cursor:row-resize !important;user-select:none !important;}",
17170
+ "body.dkg-resizing *{cursor:row-resize !important;user-select:none !important;}",
17171
+ // 拖动期间禁用过渡/动画:任何过渡都会让高度变化「追」不上指针,看起来像抖
17172
+ "body.dkg-resizing *{transition:none !important;animation:none !important;}",
17173
+ ".dkg-splitter{will-change:transform;}",
17174
+ ".dkg-splitter-slot{display:block;flex:none;}",
17175
+ ".dkg-splitter{display:flex;align-items:center;justify-content:center;height:10px;cursor:row-resize;border-radius:4px;background:transparent;touch-action:none;}",
17176
+ ".dkg-splitter:hover,.dkg-splitter.dragging{background:var(--dk-accent-soft);}",
17177
+ ".dkg-splitter:focus-visible{outline:2px solid var(--dk-accent);outline-offset:-2px;}",
17178
+ ".dkg-splitter-grip{display:block;width:36px;height:2px;border-radius:1px;background:var(--dsw-alias-border-l2);}",
17179
+ ".dkg-splitter:hover .dkg-splitter-grip,.dkg-splitter.dragging .dkg-splitter-grip{background:var(--dk-accent);}",
17180
+ // ---- GoLand 风格提交表格 ----
17181
+ ".dkg-toolbar{display:flex;align-items:center;gap:4px;flex-wrap:wrap;flex:none;}",
17182
+ ".dkg-toolbar .dkg-input{flex:1 1 120px;min-width:80px;}",
17183
+ ".dkg-toolbar .dkg-input.sm{flex:0 1 84px;min-width:60px;}",
17184
+ ".dkg-icon-btn{flex:none;cursor:pointer;font-family:inherit;font-size:13px;line-height:1;color:var(--dsw-alias-label-secondary);background:transparent;border:1px solid var(--dsw-alias-border-l1);border-radius:6px;padding:4px 7px;}",
17185
+ ".dkg-icon-btn:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary);}",
17186
+ ".dkg-icon-btn:disabled{opacity:.5;cursor:default;}",
17187
+ ".dkg-colpick{position:relative;flex:none;}",
17188
+ ".dkg-colpick-menu{position:absolute;top:calc(100% + 4px);right:0;z-index:20;min-width:150px;display:flex;flex-direction:column;gap:1px;padding:4px;background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l2);border-radius:8px;box-shadow:0 8px 24px rgba(0,0,0,.28);}",
17189
+ ".dkg-colpick-row{display:flex;align-items:center;gap:6px;width:100%;box-sizing:border-box;text-align:left;cursor:pointer;font-family:inherit;font-size:11px;color:var(--dsw-alias-label-secondary);background:transparent;border:1px solid transparent;border-radius:5px;padding:4px 6px;}",
17190
+ ".dkg-colpick-row:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover);}",
17191
+ ".dkg-colpick-row.on{color:var(--dsw-alias-label-primary);}",
17192
+ ".dkg-colpick-row.locked{opacity:.55;cursor:default;}",
17193
+ // 表头与行共用同一套列宽:图 14px / 说明 1fr / 引用 88px / 作者 96px / 日期 64px
17194
+ ".dkg-thead,.dkg-tr{display:grid;grid-template-columns:var(--dkg-cols,12px minmax(0,1fr) 64px 78px 56px);align-items:center;gap:5px;}",
17195
+ ".dkg-thead{flex:none;padding:3px 6px;border-bottom:1px solid var(--dsw-alias-border-l1);font-size:11px;color:var(--dsw-alias-label-tertiary);user-select:none;}",
17196
+ ".dkg-th.date,.dkg-td.date{text-align:right;}",
17197
+ ".dkg-th.refs,.dkg-td.refs{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}",
17198
+ ".dkg-tr{cursor:default;padding:3px 6px;border-radius:4px;font-size:12px;color:var(--dsw-alias-label-primary);border:1px solid transparent;}",
17199
+ ".dkg-tr:hover{background:var(--dsw-alias-interactive-bg-hover);}",
17200
+ ".dkg-tr.on{background:var(--dk-accent-soft);border-color:var(--dk-accent);}",
17201
+ ".dkg-td{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}",
17202
+ ".dkg-td.subject{display:flex;align-items:center;gap:5px;min-width:0;}",
17203
+ ".dkg-td.author{font-size:11px;color:var(--dsw-alias-label-secondary);}",
17204
+ ".dkg-td.date{font-size:11px;color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;}",
17205
+ ".dkg-td.datetime{font-size:11px;color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;white-space:nowrap;}",
17206
+ ".dkg-th.datetime{white-space:nowrap;}",
17207
+ // 抽屉很窄时先牺牲「引用」列:它多数行是空的,说明与时间更要紧
17208
+ ".dkg-muted{color:var(--dsw-alias-label-tertiary);}",
17209
+ ".dkg-repo-tag{flex:none;font-size:10px;padding:0 4px;border-radius:3px;background:var(--dk-accent-soft);color:var(--dk-accent);white-space:nowrap;}",
17210
+ ".dkg-chip-check{flex:none;font-size:11px;line-height:1;}",
17211
+ ".dkg-toolbar input[type=date]{flex:0 1 120px;min-width:100px;}",
17212
+ // 分支图:一条竖线 + 一个点,像 IDE 的 Log 图列
17213
+ ".dkg-td.graph{position:relative;display:flex;align-items:center;justify-content:center;height:100%;}",
17214
+ ".dkg-graph-line{position:absolute;top:0;bottom:0;left:50%;width:1px;background:var(--dsw-alias-border-l2);transform:translateX(-50%);}",
17215
+ ".dkg-graph-dot{position:relative;width:6px;height:6px;border-radius:50%;background:var(--dk-accent);box-shadow:0 0 0 2px var(--dsw-alias-bg-layer-1);}",
17216
+ // 右栏详情:上下分区(上方差异 / 下方说明),可拖动
17217
+ ".dkg-detail-diff{flex:1 1 0;min-height:60px;overflow:auto;display:flex;flex-direction:column;gap:6px;}",
17218
+ ".dkg-detail-msgbox{flex:0 0 auto;overflow:auto;display:flex;flex-direction:column;gap:5px;border-top:1px solid var(--dsw-alias-border-l1);padding-top:6px;height:var(--dkg-detail-pct,50%);}",
17219
+ ".dkg-detail .dkg-splitter-slot{display:block;flex:none;}",
17220
+ ".dkg-detail-head{display:flex;flex-direction:column;gap:5px;border-bottom:1px solid var(--dsw-alias-border-l1);padding-bottom:6px;}",
17221
+ ".dkg-detail-subject{font-size:12px;font-weight:600;color:var(--dsw-alias-label-primary);word-break:break-word;}",
17222
+ ".dkg-detail-meta{display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:11px;color:var(--dsw-alias-label-tertiary);word-break:break-all;}",
17223
+ ".dkg-sha{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;color:var(--dk-accent);}",
17224
+ ".dkg-detail-msg{margin:0;font-size:11px;line-height:1.55;color:var(--dsw-alias-label-secondary);white-space:pre-wrap;word-break:break-word;max-height:120px;overflow:auto;background:var(--dsw-alias-bg-layer-2);border-radius:6px;padding:6px 8px;}",
17225
+ ".dkg-detail-split{display:flex;gap:6px;min-height:0;}",
17226
+ ".dkg-compact .dkg-detail-split{flex-direction:column;}",
17227
+ ".dkg-diffs{flex:1;min-width:0;display:flex;flex-direction:column;gap:5px;}",
17228
+ ".dkg-tree{flex:none;width:150px;max-height:280px;overflow:auto;border:1px solid var(--dsw-alias-border-l1);border-radius:6px;padding:3px;display:flex;flex-direction:column;gap:1px;}",
17229
+ ".dkg-compact .dkg-tree{width:auto;max-height:110px;flex-direction:row;flex-wrap:wrap;}",
17230
+ ".dkg-tree-row{display:flex;align-items:center;gap:5px;width:100%;box-sizing:border-box;text-align:left;cursor:pointer;font-family:inherit;font-size:11px;color:var(--dsw-alias-label-secondary);background:transparent;border:0;border-radius:5px;padding:1px 4px;min-width:0;}",
17231
+ ".dkg-tree-row:hover{background:var(--dsw-alias-interactive-bg-hover);}",
17232
+ ".dkg-tree-row.file.on{background:var(--dk-accent-soft);color:var(--dk-accent);}",
17233
+ ".dkg-tree-row.dir{color:var(--dsw-alias-label-tertiary);}",
17234
+ ".dkg-tree-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}",
17235
+ ".dkg-file{border:1px solid var(--dsw-alias-border-l1);border-radius:6px;overflow:hidden;background:var(--dsw-alias-bg-layer-2);}",
17236
+ ".dkg-file-head{display:flex;align-items:center;gap:6px;width:100%;box-sizing:border-box;text-align:left;cursor:pointer;font-family:inherit;font-size:11px;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-1);border:0;padding:4px 6px;min-width:0;}",
17237
+ ".dkg-file-head:hover{background:var(--dsw-alias-interactive-bg-hover);}",
17238
+ ".dkg-file-path{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;}",
17239
+ ".dkg-file-old{font-size:10px;color:var(--dsw-alias-label-tertiary);max-width:30%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}",
17240
+ ".dkg-caret{flex:none;font-size:9px;color:var(--dsw-alias-label-tertiary);width:10px;}",
17241
+ ".dkg-tag{flex:none;font-size:10px;border-radius:999px;padding:0 6px;color:var(--dsw-alias-label-tertiary);border:1px solid var(--dsw-alias-border-l2);}",
17242
+ ".dkg-tag.added{color:var(--dsw-alias-state-success-primary);border-color:currentColor;}",
17243
+ ".dkg-tag.deleted{color:var(--dsw-alias-state-error-primary);border-color:currentColor;}",
17244
+ ".dkg-add{color:var(--dsw-alias-state-success-primary);flex:none;font-size:11px;}",
17245
+ ".dkg-del{color:var(--dsw-alias-state-error-primary);flex:none;font-size:11px;}",
17246
+ ".dkg-diff{max-height:320px;overflow:auto;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11px;line-height:1.5;}",
17247
+ ".dkg-hunk-head{color:var(--dk-accent);background:color-mix(in srgb,var(--dk-accent) 8%,transparent);padding:2px 6px;font-size:10px;white-space:pre;}",
17248
+ ".dkg-line{display:flex;align-items:flex-start;gap:0;white-space:pre;}",
17249
+ ".dkg-line.add{background:color-mix(in srgb,var(--dsw-alias-state-success-primary) 12%,transparent);}",
17250
+ ".dkg-line.del{background:color-mix(in srgb,var(--dsw-alias-state-error-primary) 12%,transparent);}",
17251
+ ".dkg-ln{flex:none;width:34px;text-align:right;padding-right:5px;color:var(--dsw-alias-label-tertiary);user-select:none;}",
17252
+ ".dkg-sign{flex:none;width:10px;color:var(--dsw-alias-label-tertiary);}",
17253
+ ".dkg-code{flex:1;min-width:0;overflow-x:auto;color:var(--dsw-alias-label-primary);}",
17254
+ ".dkg-wt{display:flex;gap:6px;min-height:0;flex:1;overflow:hidden;}",
17255
+ ".dkg-compact .dkg-wt{flex-direction:column;}",
17256
+ ".dkg-wt-files{flex:1 1 48%;min-width:0;overflow:auto;border:1px solid var(--dsw-alias-border-l1);border-radius:8px;background:var(--dsw-alias-bg-layer-1);padding:6px;display:flex;flex-direction:column;gap:6px;}",
17257
+ ".dkg-compact .dkg-wt-files{max-height:44%;}",
17258
+ ".dkg-wt-group{display:flex;flex-direction:column;gap:1px;}",
17259
+ ".dkg-wt-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:2px 4px;border-bottom:1px solid var(--dsw-alias-border-l1);margin-bottom:2px;}",
17260
+ ".dkg-wt-empty{padding-left:22px;font-size:11px;}",
17261
+ ".dkg-wt-item{display:flex;align-items:center;gap:6px;padding:2px 5px;border-radius:5px;cursor:pointer;font-size:12px;min-width:0;color:var(--dsw-alias-label-secondary);}",
17262
+ ".dkg-wt-item:hover{background:var(--dsw-alias-interactive-bg-hover);}",
17263
+ ".dkg-wt-item.on{background:var(--dk-accent-soft);}",
17264
+ ".dkg-wt-code{flex:none;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:10px;color:var(--dk-warn);width:20px;}",
17265
+ ".dkg-wt-actions{flex:none;}",
17266
+ ".dkg-wt-commit{flex:1 1 52%;min-width:0;display:flex;flex-direction:column;gap:6px;border:1px solid var(--dsw-alias-border-l1);border-radius:8px;background:var(--dsw-alias-bg-layer-1);padding:6px;overflow:auto;}",
17267
+ ".dkg-textarea{width:100%;box-sizing:border-box;font-family:inherit;font-size:12px;line-height:1.55;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l2);border-radius:6px;padding:6px 8px;resize:vertical;}",
17268
+ ".dkg-textarea:focus{outline:none;border-color:var(--dk-accent);}",
17269
+ ".dkg-wt-actions{display:flex;gap:5px;flex-wrap:wrap;}",
17270
+ ".dkg-preview{border-top:1px solid var(--dsw-alias-border-l1);padding-top:6px;display:flex;flex-direction:column;gap:5px;}",
17271
+ ".dkg-preview-head{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:12px;color:var(--dsw-alias-label-primary);}",
17272
+ // 目录浏览器
17273
+ ".dkg-picker{display:flex;flex-direction:column;gap:6px;border:1px solid var(--dsw-alias-border-l2);border-radius:10px;background:var(--dsw-alias-bg-layer-2);padding:8px;max-height:340px;overflow:hidden;}",
17274
+ ".dkg-picker-head{display:flex;align-items:center;justify-content:space-between;gap:8px;}",
17275
+ ".dkg-picker-title{font-size:12px;font-weight:600;color:var(--dsw-alias-label-primary);}",
17276
+ ".dkg-crumbs{display:flex;align-items:center;gap:2px;flex-wrap:wrap;font-size:11px;max-height:48px;overflow:auto;}",
17277
+ ".dkg-crumb{cursor:pointer;font-family:inherit;font-size:11px;color:var(--dk-accent);background:transparent;border:0;padding:1px 4px;border-radius:4px;max-width:160px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}",
17278
+ ".dkg-crumb:hover{background:var(--dsw-alias-interactive-bg-hover);}",
17279
+ ".dkg-crumb.on{color:var(--dsw-alias-label-primary);font-weight:600;}",
17280
+ ".dkg-picker-bar{display:flex;align-items:center;gap:6px;flex-wrap:wrap;}",
17281
+ ".dkg-picker-list{flex:1;min-height:80px;overflow:auto;display:flex;flex-direction:column;gap:1px;}",
17282
+ ".dkg-picker-row{display:flex;align-items:center;gap:6px;width:100%;box-sizing:border-box;text-align:left;cursor:pointer;font-family:inherit;font-size:12px;color:var(--dsw-alias-label-primary);background:transparent;border:1px solid transparent;border-radius:6px;padding:3px 6px;min-width:0;}",
17283
+ ".dkg-picker-row:hover{background:var(--dsw-alias-interactive-bg-hover);border-color:var(--dsw-alias-border-l1);}",
17284
+ ".dkg-folder{flex:none;font-size:10px;color:var(--dk-warn);}",
17285
+ ".dkg-picker-foot{display:flex;align-items:center;justify-content:space-between;gap:8px;border-top:1px solid var(--dsw-alias-border-l1);padding-top:6px;}"
17286
+ ].join("\n");
17287
+ function serviceOf2(scope, name) {
17288
+ if (!scope) return void 0;
17289
+ try {
17290
+ if (typeof scope.get === "function") {
17291
+ const viaGet = scope.get(name);
17292
+ if (viaGet !== void 0) return viaGet;
17293
+ }
17294
+ } catch {
17295
+ }
17296
+ try {
17297
+ return scope[name];
17298
+ } catch {
17299
+ return void 0;
17300
+ }
17301
+ }
17302
+ function onServices2(ctx, names, run) {
17303
+ if (typeof ctx.inject === "function") {
17304
+ try {
17305
+ ctx.inject(names, (scope) => run(scope));
17306
+ return;
17307
+ } catch (e) {
17308
+ }
17309
+ }
17310
+ run(ctx);
17311
+ }
17312
+ function gitPanelEnabled() {
17313
+ try {
17314
+ const state = stateOf("dshtools");
17315
+ if (!state || state.enabled !== true) return false;
17316
+ return valueOf("interface", "gitPanel") === true;
17317
+ } catch {
17318
+ return false;
17319
+ }
17320
+ }
17321
+ async function resolveTarget(path) {
17322
+ try {
17323
+ const data = await rpc2("resolve", { path });
17324
+ return data && data.repo ? data : null;
17325
+ } catch {
17326
+ return null;
17327
+ }
17328
+ }
17329
+ function openGit(ctx, target) {
17330
+ try {
17331
+ const sidebar = serviceOf2(ctx, "sidebarRight");
17332
+ if (!sidebar) return false;
17333
+ const params = {};
17334
+ if (target && target.repo) params.repo = target.repo;
17335
+ if (target && target.path) params.path = target.path;
17336
+ if (target && target.sessionId && typeof sidebar.openTabIn === "function") {
17337
+ sidebar.openTabIn(target.sessionId, GIT_TAB_KIND, { params });
17338
+ } else if (typeof sidebar.openTab === "function") {
17339
+ sidebar.openTab(GIT_TAB_KIND, { params });
17340
+ } else {
17341
+ return false;
17342
+ }
17343
+ return true;
17344
+ } catch {
17345
+ return false;
17346
+ }
17347
+ }
17348
+ function installClient2(ctx) {
17349
+ if (!ctx || typeof ctx !== "object") return;
17350
+ dockCtx = ctx;
17351
+ try {
17352
+ ensureLoaded();
17353
+ } catch {
17354
+ }
17355
+ onServices2(ctx, ["sidebarRightTabs", "slots"], (scope) => {
17356
+ const tabs = serviceOf2(scope, "sidebarRightTabs");
17357
+ const slots = serviceOf2(scope, "slots");
17358
+ if (!tabs || typeof tabs.register !== "function") return;
17359
+ if (!slots || typeof slots.inject !== "function" || typeof slots.register !== "function") return;
17360
+ const register = () => {
17361
+ const disposers = [];
17362
+ disposers.push(tabs.register({
17363
+ id: GIT_TAB_ID,
17364
+ kind: GIT_TAB_KIND,
17365
+ priority: "extension",
17366
+ // 页签标题与引导卡片统一叫「Git仓库操作」:只写 Git 会被当成 Git 客户端/工具入口,
17367
+ // 这个名字说明它是「对仓库做操作」的面板。
17368
+ title: () => GIT_PANEL_NAME,
17369
+ guide: [{
17370
+ id: "git",
17371
+ order: 40,
17372
+ title: () => GIT_PANEL_NAME,
17373
+ description: () => "\u67E5\u770B\u5F53\u524D\u76EE\u5F55\u7684\u63D0\u4EA4\u5386\u53F2\u4E0E\u5DE5\u4F5C\u533A\uFF0C\u652F\u6301\u63D0\u4EA4\u4E0E\u63A8\u9001",
17374
+ icon: GitGuideArtwork
17375
+ }]
17376
+ }));
17377
+ disposers.push(slots.inject("sidebar.right.pane.tab", () => slots.register(
17378
+ { name: "sidebar.right.pane.tab", key: GIT_TAB_ID },
17379
+ GitTabBody
17380
+ )));
17381
+ disposers.push(slots.inject("sidebar.right.pane.tab.title", () => slots.register(
17382
+ { name: "sidebar.right.pane.tab.title", key: GIT_TAB_ID },
17383
+ GitTabTitle
17384
+ )));
17385
+ return () => {
17386
+ for (const dispose of disposers) {
17387
+ try {
17388
+ dispose();
17389
+ } catch {
17390
+ }
17391
+ }
17392
+ };
17393
+ };
17394
+ if (typeof scope.effect === "function") scope.effect(register, "dsh-dock: Git \u62BD\u5C49\u9875\u7B7E");
17395
+ else register();
17396
+ });
17397
+ onServices2(ctx, ["slots"], (scope) => {
17398
+ const slots = serviceOf2(scope, "slots");
17399
+ if (!slots || typeof slots.inject !== "function" || typeof slots.register !== "function") return;
17400
+ const register = () => {
17401
+ const disposers = [];
17402
+ disposers.push(slots.inject("contextMenu.icon", function* () {
17403
+ yield slots.register({ name: "contextMenu.icon", key: GIT_ICON_KEY }, GitHistoryIcon);
17404
+ }));
17405
+ return () => {
17406
+ for (const dispose of disposers) {
17407
+ try {
17408
+ dispose();
17409
+ } catch {
17410
+ }
17411
+ }
17412
+ };
17413
+ };
17414
+ if (typeof scope.effect === "function") scope.effect(register, "dsh-dock: Git \u83DC\u5355\u56FE\u6807");
17415
+ else register();
17416
+ });
17417
+ onServices2(ctx, ["contextMenus", "sidebarRight"], (scope) => {
17418
+ const menus = serviceOf2(scope, "contextMenus");
17419
+ if (!menus || typeof menus.register !== "function") return;
17420
+ const makeResolve = (kind) => async (target, signal) => {
17421
+ if (!gitPanelEnabled()) return [];
17422
+ const resolved = await resolveTarget(target.path);
17423
+ if (signal && typeof signal.throwIfAborted === "function") signal.throwIfAborted();
17424
+ if (!resolved) return [];
17425
+ return [{
17426
+ id: "git-history",
17427
+ label: kind === "directory" ? "\u67E5\u770B Git \u5386\u53F2" : "\u67E5\u770B\u8BE5\u6587\u4EF6\u7684 Git \u5386\u53F2",
17428
+ icon: { key: GIT_ICON_KEY },
17429
+ // run 绝不抛错:抛了 ui-context-menu 只会弹「操作失败,请重试」,把真实原因盖掉。
17430
+ // 打不开时自己用菜单的通知通道说清楚原因。
17431
+ run: () => {
17432
+ const ok = openGit(scope, {
17433
+ repo: resolved.repo,
17434
+ path: resolved.relPath === "." ? "" : resolved.relPath,
17435
+ sessionId: target.sessionId
17436
+ });
17437
+ if (!ok) {
17438
+ try {
17439
+ menus.notify("Git \u9762\u677F\u672A\u5C31\u7EEA\uFF1A\u8BF7\u786E\u8BA4\u300CDSH\u529F\u80FD \u2192 \u754C\u9762\u589E\u5F3A \u2192 Git \u7BA1\u7406\u9762\u677F\u300D\u5DF2\u6253\u5F00\uFF0C\u5E76\u91CD\u542F\u8FC7 dsh web", false);
17440
+ } catch {
17441
+ }
17442
+ }
17443
+ }
17444
+ }];
17445
+ };
17446
+ const register = () => {
17447
+ const disposers = [
17448
+ menus.register({ id: "dsh-dock.git.directory", target: "directory", order: 220, resolve: makeResolve("directory") }),
17449
+ menus.register({ id: "dsh-dock.git.file", target: "file", order: 220, resolve: makeResolve("file") })
17450
+ ];
17451
+ return () => {
17452
+ for (const dispose of disposers) {
17453
+ try {
17454
+ dispose();
17455
+ } catch {
17456
+ }
17457
+ }
17458
+ };
17459
+ };
17460
+ if (typeof scope.effect === "function") scope.effect(register, "dsh-dock: Git \u53F3\u952E\u5165\u53E3");
17461
+ else register();
17462
+ });
17463
+ }
17464
+ function GitGuideArtwork({ size = 36, className } = {}) {
17465
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("svg", { width: size, height: size, className, "aria-hidden": "true", viewBox: "0 0 36 36", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
17466
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("circle", { cx: "11", cy: "8", r: "3", stroke: "#F97316", strokeWidth: "2" }),
17467
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("circle", { cx: "11", cy: "28", r: "3", stroke: "#F97316", strokeWidth: "2" }),
17468
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("circle", { cx: "25", cy: "18", r: "3", stroke: "#F97316", strokeWidth: "2" }),
17469
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("path", { d: "M11 11v14", stroke: "#F97316", strokeWidth: "2", strokeLinecap: "square" }),
17470
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("path", { d: "M14 8h4a4 4 0 0 1 4 4v2M14 28h4a4 4 0 0 0 4-4v-2", stroke: "#F97316", strokeWidth: "2", strokeLinecap: "square" })
17471
+ ] });
17472
+ }
17473
+ function GitHistoryIcon() {
17474
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("svg", { width: "14", height: "14", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: [
17475
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("circle", { cx: "4", cy: "3.5", r: "1.6", stroke: "currentColor", strokeWidth: "1.3" }),
17476
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("circle", { cx: "4", cy: "12.5", r: "1.6", stroke: "currentColor", strokeWidth: "1.3" }),
17477
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("circle", { cx: "12", cy: "8", r: "1.6", stroke: "currentColor", strokeWidth: "1.3" }),
17478
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("path", { d: "M4 5.1v5.8M5.6 3.5h2.6a2.2 2.2 0 0 1 2.2 2.2v.7M5.6 12.5h2.6a2.2 2.2 0 0 0 2.2-2.2v-.7", stroke: "currentColor", strokeWidth: "1.3", strokeLinecap: "round" })
17479
+ ] });
17480
+ }
17481
+
15767
17482
  // src/client.jsx
15768
- var DOCK_VERSION = "0.24.0";
17483
+ var DOCK_VERSION = "0.25.0";
15769
17484
  var BUILTIN_FEATURES = [feature, feature2, feature3, feature11, feature4, feature5, feature6, feature7, feature8, feature9, feature10, feature12];
15770
17485
  var PLANNED_FEATURES = [];
15771
17486
  var PLANNED_NOTES = {};
@@ -15986,6 +17701,7 @@ function cancelInitialCssSchedule() {
15986
17701
  function fullDockCss() {
15987
17702
  const parts = [SHELL_CSS];
15988
17703
  for (const f of BUILTIN_FEATURES) if (f.css) parts.push(f.css);
17704
+ if (css6) parts.push(css6);
15989
17705
  for (const f of externalDefs) if (f.css) parts.push(f.css);
15990
17706
  return parts.join("\n");
15991
17707
  }
@@ -16009,8 +17725,8 @@ function ensureCss() {
16009
17725
  }
16010
17726
  }
16011
17727
  function useExternalVersion() {
16012
- const [, bump] = import_react23.default.useReducer((n) => n + 1, 0);
16013
- import_react23.default.useEffect(() => {
17728
+ const [, bump] = import_react24.default.useReducer((n) => n + 1, 0);
17729
+ import_react24.default.useEffect(() => {
16014
17730
  externalListeners.add(bump);
16015
17731
  return () => {
16016
17732
  externalListeners.delete(bump);
@@ -16020,25 +17736,25 @@ function useExternalVersion() {
16020
17736
  var lastGeom = { x: null, y: null, w: null, h: null };
16021
17737
  function DockIcon(props) {
16022
17738
  const size = props && props.size || 16;
16023
- return import_react23.default.createElement(
17739
+ return import_react24.default.createElement(
16024
17740
  "svg",
16025
17741
  { width: size, height: size, viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: 1.3, "aria-hidden": true },
16026
- import_react23.default.createElement("rect", { x: 2.5, y: 2.5, width: 4.4, height: 4.4, rx: 1.2 }),
16027
- import_react23.default.createElement("rect", { x: 9, y: 2.5, width: 4.4, height: 4.4, rx: 1.2 }),
16028
- import_react23.default.createElement("rect", { x: 2.5, y: 9, width: 4.4, height: 4.4, rx: 1.2 }),
16029
- import_react23.default.createElement("rect", { x: 9, y: 9, width: 4.4, height: 4.4, rx: 1.2 })
17742
+ import_react24.default.createElement("rect", { x: 2.5, y: 2.5, width: 4.4, height: 4.4, rx: 1.2 }),
17743
+ import_react24.default.createElement("rect", { x: 9, y: 2.5, width: 4.4, height: 4.4, rx: 1.2 }),
17744
+ import_react24.default.createElement("rect", { x: 2.5, y: 9, width: 4.4, height: 4.4, rx: 1.2 }),
17745
+ import_react24.default.createElement("rect", { x: 9, y: 9, width: 4.4, height: 4.4, rx: 1.2 })
16030
17746
  );
16031
17747
  }
16032
17748
  function DockWorkspace() {
16033
- const [nav, setNav] = import_react23.default.useState({ open: panelNav.open, active: panelNav.active, params: panelNav.params });
16034
- import_react23.default.useEffect(() => subscribePanel(() => setNav({ open: panelNav.open, active: panelNav.active, params: panelNav.params })), []);
17749
+ const [nav, setNav] = import_react24.default.useState({ open: panelNav.open, active: panelNav.active, params: panelNav.params });
17750
+ import_react24.default.useEffect(() => subscribePanel(() => setNav({ open: panelNav.open, active: panelNav.active, params: panelNav.params })), []);
16035
17751
  const active = nav.active;
16036
17752
  const navParams = nav.params;
16037
17753
  const setActive = navigatePanel;
16038
- const [, force] = import_react23.default.useReducer((n) => n + 1, 0);
17754
+ const [, force] = import_react24.default.useReducer((n) => n + 1, 0);
16039
17755
  useExternalVersion();
16040
- const contentRef = import_react23.default.useRef(null);
16041
- import_react23.default.useEffect(() => {
17756
+ const contentRef = import_react24.default.useRef(null);
17757
+ import_react24.default.useEffect(() => {
16042
17758
  if (contentRef.current) contentRef.current.scrollTop = 0;
16043
17759
  }, [active]);
16044
17760
  const MODULES = allModules();
@@ -16046,26 +17762,26 @@ function DockWorkspace() {
16046
17762
  const mod = isHome ? null : MODULES.find((m) => m.id === active) || MODULES[0];
16047
17763
  const st = mod ? stateOf(mod.id) : null;
16048
17764
  const View = mod ? mod.View : null;
16049
- const viewNode = mod && View ? import_react23.default.createElement(
17765
+ const viewNode = mod && View ? import_react24.default.createElement(
16050
17766
  "div",
16051
17767
  { className: "dockm-view" },
16052
- import_react23.default.createElement(
17768
+ import_react24.default.createElement(
16053
17769
  FeatureBoundary,
16054
17770
  { key: mod.id, label: mod.name },
16055
- import_react23.default.createElement(View, { ctx: ctxRef.current, feature: mod, params: navParams })
17771
+ import_react24.default.createElement(View, { ctx: ctxRef.current, feature: mod, params: navParams })
16056
17772
  )
16057
17773
  ) : null;
16058
17774
  const enabledCount = MODULES.filter((m) => {
16059
17775
  const s = stateOf(m.id);
16060
17776
  return !!(s && s.enabled);
16061
17777
  }).length;
16062
- return import_react23.default.createElement(
17778
+ return import_react24.default.createElement(
16063
17779
  "div",
16064
17780
  { className: "dockm-body" },
16065
- import_react23.default.createElement(
17781
+ import_react24.default.createElement(
16066
17782
  "nav",
16067
17783
  { className: "dockm-nav", "aria-label": "\u529F\u80FD\u6A21\u5757" },
16068
- import_react23.default.createElement(
17784
+ import_react24.default.createElement(
16069
17785
  "button",
16070
17786
  {
16071
17787
  type: "button",
@@ -16073,10 +17789,10 @@ function DockWorkspace() {
16073
17789
  className: "dockm-nav-item" + (isHome ? " on" : ""),
16074
17790
  onClick: () => setActive("home")
16075
17791
  },
16076
- import_react23.default.createElement("span", { className: "dockm-navhome" }, import_react23.default.createElement(DockIcon, null)),
16077
- import_react23.default.createElement("span", null, "\u9996\u9875")
17792
+ import_react24.default.createElement("span", { className: "dockm-navhome" }, import_react24.default.createElement(DockIcon, null)),
17793
+ import_react24.default.createElement("span", null, "\u9996\u9875")
16078
17794
  ),
16079
- MODULES.map((m) => import_react23.default.createElement(
17795
+ MODULES.map((m) => import_react24.default.createElement(
16080
17796
  "button",
16081
17797
  {
16082
17798
  type: "button",
@@ -16084,42 +17800,42 @@ function DockWorkspace() {
16084
17800
  className: "dockm-nav-item" + (m.id === active ? " on" : ""),
16085
17801
  onClick: () => setActive(m.id)
16086
17802
  },
16087
- import_react23.default.createElement("span", { className: "dockm-dot", style: { background: m.accent } }),
16088
- import_react23.default.createElement("span", null, m.name),
16089
- m.planned ? import_react23.default.createElement("span", { className: "dockm-badge" }, "\u89C4\u5212\u4E2D") : null,
16090
- m.external ? import_react23.default.createElement("span", { className: "dockm-badge" }, "\u5916\u90E8") : null
17803
+ import_react24.default.createElement("span", { className: "dockm-dot", style: { background: m.accent } }),
17804
+ import_react24.default.createElement("span", null, m.name),
17805
+ m.planned ? import_react24.default.createElement("span", { className: "dockm-badge" }, "\u89C4\u5212\u4E2D") : null,
17806
+ m.external ? import_react24.default.createElement("span", { className: "dockm-badge" }, "\u5916\u90E8") : null
16091
17807
  ))
16092
17808
  ),
16093
- import_react23.default.createElement(
17809
+ import_react24.default.createElement(
16094
17810
  "div",
16095
17811
  { className: "dockm-content", ref: contentRef },
16096
- import_react23.default.createElement(
17812
+ import_react24.default.createElement(
16097
17813
  "div",
16098
17814
  { className: "dockm-content-head" },
16099
- import_react23.default.createElement(
17815
+ import_react24.default.createElement(
16100
17816
  "div",
16101
17817
  { className: "dockm-name" },
16102
- isHome ? import_react23.default.createElement("span", { className: "dockm-navhome" }, import_react23.default.createElement(DockIcon, null)) : import_react23.default.createElement("span", { className: "dockm-dot", style: { background: mod.accent } }),
17818
+ isHome ? import_react24.default.createElement("span", { className: "dockm-navhome" }, import_react24.default.createElement(DockIcon, null)) : import_react24.default.createElement("span", { className: "dockm-dot", style: { background: mod.accent } }),
16103
17819
  isHome ? "\u9996\u9875" : mod.name,
16104
- !isHome && mod.planned ? import_react23.default.createElement("span", { className: "dockm-badge" }, "\u89C4\u5212\u4E2D") : null,
16105
- !isHome && mod.external ? import_react23.default.createElement("span", { className: "dockm-badge" }, "\u5916\u90E8\u5305" + (mod.package ? " \xB7 " + mod.package : "")) : null
17820
+ !isHome && mod.planned ? import_react24.default.createElement("span", { className: "dockm-badge" }, "\u89C4\u5212\u4E2D") : null,
17821
+ !isHome && mod.external ? import_react24.default.createElement("span", { className: "dockm-badge" }, "\u5916\u90E8\u5305" + (mod.package ? " \xB7 " + mod.package : "")) : null
16106
17822
  ),
16107
- import_react23.default.createElement(
17823
+ import_react24.default.createElement(
16108
17824
  "div",
16109
17825
  { className: "dockm-desc" },
16110
17826
  isHome ? "\u6240\u6709\u5B50\u529F\u80FD\u603B\u63FD\uFF1A\u8FD0\u884C\u72B6\u6001\u3001\u6982\u8981\u4E0E\u5FEB\u6377\u5F00\u5173\uFF0C\u70B9\u51FB\u5361\u7247\u8FDB\u5165\u5BF9\u5E94\u529F\u80FD\u9875\u3002" : mod.description
16111
17827
  )
16112
17828
  ),
16113
- isHome ? import_react23.default.createElement("div", { className: "dockm-view" }, import_react23.default.createElement(HomeView, { ctx: ctxRef.current, onOpen: setActive, onToggle: force })) : mod.planned ? import_react23.default.createElement("div", { className: "dockm-note" }, PLANNED_NOTES[mod.id] || "\u5F85\u63A5\u5165\uFF1A\u89C1 README \u8DEF\u7EBF\u56FE") : st && st.enabled && viewNode ? viewNode : st && st.error ? import_react23.default.createElement("div", { className: "dockm-note dockm-err" }, "\u529F\u80FD\u51FA\u9519\uFF1A" + st.error) : import_react23.default.createElement("div", { className: "dockm-note" }, "\u8BE5\u529F\u80FD\u5F53\u524D\u4E3A\u505C\u7528\u72B6\u6001\uFF08\u5F00\u5173\u5DF2\u6301\u4E45\u5316\uFF0C\u91CD\u542F\u540E\u4FDD\u6301\uFF09"),
16114
- import_react23.default.createElement(
17829
+ isHome ? import_react24.default.createElement("div", { className: "dockm-view" }, import_react24.default.createElement(HomeView, { ctx: ctxRef.current, onOpen: setActive, onToggle: force })) : mod.planned ? import_react24.default.createElement("div", { className: "dockm-note" }, PLANNED_NOTES[mod.id] || "\u5F85\u63A5\u5165\uFF1A\u89C1 README \u8DEF\u7EBF\u56FE") : st && st.enabled && viewNode ? viewNode : st && st.error ? import_react24.default.createElement("div", { className: "dockm-note dockm-err" }, "\u529F\u80FD\u51FA\u9519\uFF1A" + st.error) : import_react24.default.createElement("div", { className: "dockm-note" }, "\u8BE5\u529F\u80FD\u5F53\u524D\u4E3A\u505C\u7528\u72B6\u6001\uFF08\u5F00\u5173\u5DF2\u6301\u4E45\u5316\uFF0C\u91CD\u542F\u540E\u4FDD\u6301\uFF09"),
17830
+ import_react24.default.createElement(
16115
17831
  "div",
16116
17832
  { className: "dockm-foot" },
16117
- import_react23.default.createElement("span", null, isHome ? "\u529F\u80FD\u575E v" + DOCK_VERSION + " \xB7 \u5171 " + MODULES.length + " \u4E2A\u529F\u80FD\u6A21\u5757\uFF0C" + enabledCount + " \u4E2A\u5DF2\u542F\u7528" : "\u529F\u80FD\u575E v" + DOCK_VERSION + " \xB7 \u65B0\u529F\u80FD\u6309\u8DEF\u7EBF\u56FE\u8FFD\u52A0"),
16118
- !isHome && mod && !mod.planned && st ? import_react23.default.createElement(
17833
+ import_react24.default.createElement("span", null, isHome ? "\u529F\u80FD\u575E v" + DOCK_VERSION + " \xB7 \u5171 " + MODULES.length + " \u4E2A\u529F\u80FD\u6A21\u5757\uFF0C" + enabledCount + " \u4E2A\u5DF2\u542F\u7528" : "\u529F\u80FD\u575E v" + DOCK_VERSION + " \xB7 \u65B0\u529F\u80FD\u6309\u8DEF\u7EBF\u56FE\u8FFD\u52A0"),
17834
+ !isHome && mod && !mod.planned && st ? import_react24.default.createElement(
16119
17835
  "span",
16120
17836
  { className: "dockm-foot-sw" },
16121
- import_react23.default.createElement("span", { className: "dockm-foot-swlabel" + (st.enabled ? " on" : "") }, st.enabled ? "\u5DF2\u542F\u7528" : "\u5DF2\u505C\u7528"),
16122
- import_react23.default.createElement("button", {
17837
+ import_react24.default.createElement("span", { className: "dockm-foot-swlabel" + (st.enabled ? " on" : "") }, st.enabled ? "\u5DF2\u542F\u7528" : "\u5DF2\u505C\u7528"),
17838
+ import_react24.default.createElement("button", {
16123
17839
  type: "button",
16124
17840
  className: "dock-sw" + (st.enabled ? " on" : ""),
16125
17841
  role: "switch",
@@ -16132,11 +17848,11 @@ function DockWorkspace() {
16132
17848
  }
16133
17849
  })
16134
17850
  ) : null,
16135
- !isHome && mod && typeof mod.Chip === "function" ? import_react23.default.createElement(
17851
+ !isHome && mod && typeof mod.Chip === "function" ? import_react24.default.createElement(
16136
17852
  "span",
16137
17853
  { className: "dockm-foot-sw" },
16138
- import_react23.default.createElement("span", { className: "dockm-foot-swlabel" + (chipShown(mod.id) ? " on" : "") }, "\u4F1A\u8BDD\u9875\u5C0F\u63A7\u4EF6"),
16139
- import_react23.default.createElement("button", {
17854
+ import_react24.default.createElement("span", { className: "dockm-foot-swlabel" + (chipShown(mod.id) ? " on" : "") }, "\u4F1A\u8BDD\u9875\u5C0F\u63A7\u4EF6"),
17855
+ import_react24.default.createElement("button", {
16140
17856
  type: "button",
16141
17857
  className: "dock-sw" + (chipShown(mod.id) ? " on" : ""),
16142
17858
  role: "switch",
@@ -16154,12 +17870,12 @@ function DockWorkspace() {
16154
17870
  );
16155
17871
  }
16156
17872
  function DockModal() {
16157
- const [nav, setNav] = import_react23.default.useState({ open: panelNav.open });
16158
- import_react23.default.useEffect(() => subscribePanel(() => setNav({ open: panelNav.open })), []);
17873
+ const [nav, setNav] = import_react24.default.useState({ open: panelNav.open });
17874
+ import_react24.default.useEffect(() => subscribePanel(() => setNav({ open: panelNav.open })), []);
16159
17875
  const open = nav.open || typeof document === "undefined";
16160
- const [win, setWin] = import_react23.default.useState(() => ({ mode: "normal", x: null, y: null, w: null, h: null }));
16161
- const dlgRef = import_react23.default.useRef(null);
16162
- import_react23.default.useEffect(() => {
17876
+ const [win, setWin] = import_react24.default.useState(() => ({ mode: "normal", x: null, y: null, w: null, h: null }));
17877
+ const dlgRef = import_react24.default.useRef(null);
17878
+ import_react24.default.useEffect(() => {
16163
17879
  if (lastGeom.w) setWin({ mode: "normal", x: lastGeom.x, y: lastGeom.y, w: lastGeom.w, h: lastGeom.h });
16164
17880
  }, []);
16165
17881
  function beginDrag(e, type) {
@@ -16199,10 +17915,10 @@ function DockModal() {
16199
17915
  width: win.w != null ? win.w : void 0,
16200
17916
  height: win.mode === "min" ? "auto" : win.h != null ? win.h : void 0
16201
17917
  } : null;
16202
- return import_react23.default.createElement(
17918
+ return import_react24.default.createElement(
16203
17919
  "div",
16204
17920
  { className: "dockm-backdrop", onClick: () => setPanelOpen(false) },
16205
- import_react23.default.createElement(
17921
+ import_react24.default.createElement(
16206
17922
  "div",
16207
17923
  {
16208
17924
  className: "dockm-dialog" + (win.mode === "max" ? " dockm-max" : "") + (win.mode === "min" ? " dockm-min" : ""),
@@ -16210,59 +17926,59 @@ function DockModal() {
16210
17926
  ref: dlgRef,
16211
17927
  onClick: (e) => e.stopPropagation()
16212
17928
  },
16213
- import_react23.default.createElement(
17929
+ import_react24.default.createElement(
16214
17930
  "div",
16215
17931
  {
16216
17932
  className: "dockm-head",
16217
17933
  onPointerDown: (e) => beginDrag(e, "move"),
16218
17934
  onDoubleClick: () => setWin((s) => Object.assign({}, s, { mode: s.mode === "max" ? "normal" : "max" }))
16219
17935
  },
16220
- import_react23.default.createElement(DockIcon, null),
16221
- import_react23.default.createElement("span", { className: "dockm-title" }, "\u529F\u80FD\u575E"),
16222
- import_react23.default.createElement("span", { className: "dockm-sub" }, "dsh-dock \xB7 \u4E5F\u53EF\u5728 \u8BBE\u7F6E \u2192 \u529F\u80FD\u575E \u6253\u5F00\u7BA1\u7406\u9875"),
16223
- import_react23.default.createElement(
17936
+ import_react24.default.createElement(DockIcon, null),
17937
+ import_react24.default.createElement("span", { className: "dockm-title" }, "\u529F\u80FD\u575E"),
17938
+ import_react24.default.createElement("span", { className: "dockm-sub" }, "dsh-dock \xB7 \u4E5F\u53EF\u5728 \u8BBE\u7F6E \u2192 \u529F\u80FD\u575E \u6253\u5F00\u7BA1\u7406\u9875"),
17939
+ import_react24.default.createElement(
16224
17940
  "span",
16225
17941
  { className: "dockm-ctrls" },
16226
- import_react23.default.createElement("button", {
17942
+ import_react24.default.createElement("button", {
16227
17943
  type: "button",
16228
17944
  className: "dockm-win",
16229
17945
  title: win.mode === "min" ? "\u8FD8\u539F" : "\u6700\u5C0F\u5316",
16230
17946
  onClick: () => setWin((s) => Object.assign({}, s, { mode: s.mode === "min" ? "normal" : "min" }))
16231
17947
  }, "\u2581"),
16232
- import_react23.default.createElement("button", {
17948
+ import_react24.default.createElement("button", {
16233
17949
  type: "button",
16234
17950
  className: "dockm-win",
16235
17951
  title: win.mode === "max" ? "\u8FD8\u539F" : "\u6700\u5927\u5316",
16236
17952
  onClick: () => setWin((s) => Object.assign({}, s, { mode: s.mode === "max" ? "normal" : "max" }))
16237
17953
  }, win.mode === "max" ? "\u2750" : "\u25A2"),
16238
- import_react23.default.createElement("button", { type: "button", className: "dockm-close", "aria-label": "\u5173\u95ED", title: "\u5173\u95ED", onClick: () => setPanelOpen(false) }, "\u2715")
17954
+ import_react24.default.createElement("button", { type: "button", className: "dockm-close", "aria-label": "\u5173\u95ED", title: "\u5173\u95ED", onClick: () => setPanelOpen(false) }, "\u2715")
16239
17955
  )
16240
17956
  ),
16241
- import_react23.default.createElement(DockWorkspace, null),
16242
- win.mode === "normal" ? import_react23.default.createElement("div", { className: "dockm-resize", onPointerDown: (e) => beginDrag(e, "size") }) : null
17957
+ import_react24.default.createElement(DockWorkspace, null),
17958
+ win.mode === "normal" ? import_react24.default.createElement("div", { className: "dockm-resize", onPointerDown: (e) => beginDrag(e, "size") }) : null
16243
17959
  )
16244
17960
  );
16245
17961
  }
16246
17962
  function HomeView(props) {
16247
17963
  const ctx = props && props.ctx;
16248
- const [, force] = import_react23.default.useReducer((n) => n + 1, 0);
17964
+ const [, force] = import_react24.default.useReducer((n) => n + 1, 0);
16249
17965
  useExternalVersion();
16250
17966
  const open = (id) => {
16251
17967
  if (props && typeof props.onOpen === "function") props.onOpen(id);
16252
17968
  };
16253
- return import_react23.default.createElement(
17969
+ return import_react24.default.createElement(
16254
17970
  "div",
16255
17971
  { className: "dockh-grid" },
16256
17972
  allModules().map((m) => {
16257
17973
  const st = stateOf(m.id);
16258
17974
  const enabled = !!(st && st.enabled);
16259
17975
  const Stat = m.HomeStat;
16260
- const statNode = m.planned ? import_react23.default.createElement("span", null, PLANNED_NOTES[m.id] || "\u5F85\u63A5\u5165\uFF1A\u89C1 README \u8DEF\u7EBF\u56FE") : enabled && Stat ? import_react23.default.createElement(
17976
+ const statNode = m.planned ? import_react24.default.createElement("span", null, PLANNED_NOTES[m.id] || "\u5F85\u63A5\u5165\uFF1A\u89C1 README \u8DEF\u7EBF\u56FE") : enabled && Stat ? import_react24.default.createElement(
16261
17977
  FeatureBoundary,
16262
17978
  { key: m.id, label: m.name },
16263
- import_react23.default.createElement(Stat, { ctx })
16264
- ) : import_react23.default.createElement("span", null, "\u5DF2\u505C\u7528\uFF0C\u542F\u7528\u540E\u5728\u6B64\u5C55\u793A\u8FD0\u884C\u6982\u8981");
16265
- return import_react23.default.createElement(
17979
+ import_react24.default.createElement(Stat, { ctx })
17980
+ ) : import_react24.default.createElement("span", null, "\u5DF2\u505C\u7528\uFF0C\u542F\u7528\u540E\u5728\u6B64\u5C55\u793A\u8FD0\u884C\u6982\u8981");
17981
+ return import_react24.default.createElement(
16266
17982
  "div",
16267
17983
  {
16268
17984
  key: m.id,
@@ -16277,21 +17993,21 @@ function HomeView(props) {
16277
17993
  }
16278
17994
  }
16279
17995
  },
16280
- import_react23.default.createElement(
17996
+ import_react24.default.createElement(
16281
17997
  "div",
16282
17998
  { className: "dockh-head" },
16283
- import_react23.default.createElement("span", { className: "dockm-dot", style: { background: m.accent } }),
16284
- import_react23.default.createElement("span", { className: "dockh-name" }, m.name),
16285
- m.external ? import_react23.default.createElement("span", { className: "dockh-badge", title: m.package || void 0 }, "\u5916\u90E8") : null,
17999
+ import_react24.default.createElement("span", { className: "dockm-dot", style: { background: m.accent } }),
18000
+ import_react24.default.createElement("span", { className: "dockh-name" }, m.name),
18001
+ m.external ? import_react24.default.createElement("span", { className: "dockh-badge", title: m.package || void 0 }, "\u5916\u90E8") : null,
16286
18002
  // 状态标识:圆点 + 文字(纯展示,与开关视觉区分)
16287
- import_react23.default.createElement(
18003
+ import_react24.default.createElement(
16288
18004
  "span",
16289
18005
  { className: "dockh-status" + (m.planned ? " plan" : enabled ? "" : " off") },
16290
- import_react23.default.createElement("span", { className: "dockh-sdot" }),
16291
- import_react23.default.createElement("span", null, m.planned ? "\u89C4\u5212\u4E2D" : enabled ? "\u8FD0\u884C\u4E2D" : "\u5DF2\u505C\u7528")
18006
+ import_react24.default.createElement("span", { className: "dockh-sdot" }),
18007
+ import_react24.default.createElement("span", null, m.planned ? "\u89C4\u5212\u4E2D" : enabled ? "\u8FD0\u884C\u4E2D" : "\u5DF2\u505C\u7528")
16292
18008
  ),
16293
18009
  // 启停开关(规划中的功能不显示)
16294
- m.planned ? null : import_react23.default.createElement("button", {
18010
+ m.planned ? null : import_react24.default.createElement("button", {
16295
18011
  type: "button",
16296
18012
  className: "dock-sw" + (enabled ? " on" : ""),
16297
18013
  role: "switch",
@@ -16306,12 +18022,12 @@ function HomeView(props) {
16306
18022
  }
16307
18023
  })
16308
18024
  ),
16309
- import_react23.default.createElement("div", { className: "dockh-desc" }, m.description),
16310
- import_react23.default.createElement("div", { className: "dockh-stat" }, statNode),
16311
- import_react23.default.createElement(
18025
+ import_react24.default.createElement("div", { className: "dockh-desc" }, m.description),
18026
+ import_react24.default.createElement("div", { className: "dockh-stat" }, statNode),
18027
+ import_react24.default.createElement(
16312
18028
  "div",
16313
18029
  { className: "dockh-foot" },
16314
- import_react23.default.createElement("span", { className: "dockh-go" }, "\u67E5\u770B\u8BE6\u60C5 \u2192")
18030
+ import_react24.default.createElement("span", { className: "dockh-go" }, "\u67E5\u770B\u8BE6\u60C5 \u2192")
16315
18031
  )
16316
18032
  );
16317
18033
  })
@@ -16319,16 +18035,16 @@ function HomeView(props) {
16319
18035
  }
16320
18036
  function DockPanel(props) {
16321
18037
  const ctx = ctxRef.current;
16322
- const [, force] = import_react23.default.useReducer((n) => n + 1, 0);
18038
+ const [, force] = import_react24.default.useReducer((n) => n + 1, 0);
16323
18039
  useExternalVersion();
16324
18040
  const toggle = (id) => {
16325
18041
  toggleFeature(id);
16326
18042
  force();
16327
18043
  };
16328
- return import_react23.default.createElement(
18044
+ return import_react24.default.createElement(
16329
18045
  "div",
16330
18046
  { className: "dock-root" },
16331
- import_react23.default.createElement(
18047
+ import_react24.default.createElement(
16332
18048
  "div",
16333
18049
  { className: "dock-intro" },
16334
18050
  "\u529F\u80FD\u575E\uFF08dsh-dock\uFF09\xB7 \u6240\u6709\u5C0F\u529F\u80FD\u96C6\u4E2D\u5728\u8FD9\u4E00\u4E2A\u9762\u677F\u91CC\u7BA1\u7406\u3002v0.4.0 \u8D77\u6BCF\u4E2A\u529F\u80FD\u662F\u72EC\u7ACB\u6A21\u5757\uFF08features/<id>/\uFF09\uFF0C",
@@ -16337,25 +18053,25 @@ function DockPanel(props) {
16337
18053
  allModules().map((f) => {
16338
18054
  const st = stateOf(f.id);
16339
18055
  const View = f.View;
16340
- const viewNode = !f.planned && st.enabled && View ? import_react23.default.createElement(
18056
+ const viewNode = !f.planned && st.enabled && View ? import_react24.default.createElement(
16341
18057
  "div",
16342
18058
  { className: "dock-body" },
16343
- import_react23.default.createElement(
18059
+ import_react24.default.createElement(
16344
18060
  FeatureBoundary,
16345
18061
  { key: f.id, label: f.name },
16346
- import_react23.default.createElement(View, { ctx, feature: f, params: props && props.params })
18062
+ import_react24.default.createElement(View, { ctx, feature: f, params: props && props.params })
16347
18063
  )
16348
18064
  ) : null;
16349
- return import_react23.default.createElement(
18065
+ return import_react24.default.createElement(
16350
18066
  "div",
16351
18067
  { className: "dock-card", key: f.id },
16352
- import_react23.default.createElement(
18068
+ import_react24.default.createElement(
16353
18069
  "div",
16354
18070
  { className: "dock-card-head" },
16355
- import_react23.default.createElement("span", { className: "dock-dot" + (st.error ? " err" : st.enabled ? " on" : "") }),
16356
- import_react23.default.createElement("span", { className: "dock-name" }, f.name),
16357
- import_react23.default.createElement("span", { className: "dock-desc" }, f.description + (f.external ? "\uFF08\u6765\u81EA\u5916\u90E8\u5305" + (f.package ? " " + f.package : "") + "\uFF09" : "")),
16358
- f.planned ? import_react23.default.createElement("span", { className: "dock-badge" }, "\u89C4\u5212\u4E2D") : import_react23.default.createElement("button", {
18071
+ import_react24.default.createElement("span", { className: "dock-dot" + (st.error ? " err" : st.enabled ? " on" : "") }),
18072
+ import_react24.default.createElement("span", { className: "dock-name" }, f.name),
18073
+ import_react24.default.createElement("span", { className: "dock-desc" }, f.description + (f.external ? "\uFF08\u6765\u81EA\u5916\u90E8\u5305" + (f.package ? " " + f.package : "") + "\uFF09" : "")),
18074
+ f.planned ? import_react24.default.createElement("span", { className: "dock-badge" }, "\u89C4\u5212\u4E2D") : import_react24.default.createElement("button", {
16359
18075
  type: "button",
16360
18076
  className: "dock-sw" + (st.enabled ? " on" : ""),
16361
18077
  role: "switch",
@@ -16364,11 +18080,11 @@ function DockPanel(props) {
16364
18080
  title: st.enabled ? "\u505C\u7528\u300C" + f.name + "\u300D" : "\u542F\u7528\u300C" + f.name + "\u300D",
16365
18081
  onClick: () => toggle(f.id)
16366
18082
  }),
16367
- !f.planned && typeof f.Chip === "function" ? import_react23.default.createElement(
18083
+ !f.planned && typeof f.Chip === "function" ? import_react24.default.createElement(
16368
18084
  "span",
16369
18085
  { className: "dockm-foot-sw" },
16370
- import_react23.default.createElement("span", { className: "dockm-foot-swlabel" + (chipShown(f.id) ? " on" : "") }, "\u4F1A\u8BDD\u9875\u5C0F\u63A7\u4EF6"),
16371
- import_react23.default.createElement("button", {
18086
+ import_react24.default.createElement("span", { className: "dockm-foot-swlabel" + (chipShown(f.id) ? " on" : "") }, "\u4F1A\u8BDD\u9875\u5C0F\u63A7\u4EF6"),
18087
+ import_react24.default.createElement("button", {
16372
18088
  type: "button",
16373
18089
  className: "dock-sw" + (chipShown(f.id) ? " on" : ""),
16374
18090
  role: "switch",
@@ -16382,7 +18098,7 @@ function DockPanel(props) {
16382
18098
  })
16383
18099
  ) : null
16384
18100
  ),
16385
- f.planned ? import_react23.default.createElement("div", { className: "dock-body" }, PLANNED_NOTES[f.id] || "\u5F85\u63A5\u5165\uFF1A\u89C1 README \u8DEF\u7EBF\u56FE") : st.error ? import_react23.default.createElement("div", { className: "dock-body dockm-err" }, "\u529F\u80FD\u51FA\u9519\uFF1A" + st.error) : null,
18101
+ f.planned ? import_react24.default.createElement("div", { className: "dock-body" }, PLANNED_NOTES[f.id] || "\u5F85\u63A5\u5165\uFF1A\u89C1 README \u8DEF\u7EBF\u56FE") : st.error ? import_react24.default.createElement("div", { className: "dock-body dockm-err" }, "\u529F\u80FD\u51FA\u9519\uFF1A" + st.error) : null,
16386
18102
  viewNode
16387
18103
  );
16388
18104
  })
@@ -16390,7 +18106,7 @@ function DockPanel(props) {
16390
18106
  }
16391
18107
  function DockPage() {
16392
18108
  const ctx = ctxRef.current;
16393
- const [wide, setWide] = import_react23.default.useState(false);
18109
+ const [wide, setWide] = import_react24.default.useState(false);
16394
18110
  const toggleWide = () => {
16395
18111
  try {
16396
18112
  const layout = ctx && typeof ctx.get === "function" ? ctx.get("layout") : null;
@@ -16401,20 +18117,20 @@ function DockPage() {
16401
18117
  } catch (e) {
16402
18118
  }
16403
18119
  };
16404
- return import_react23.default.createElement(
18120
+ return import_react24.default.createElement(
16405
18121
  "div",
16406
18122
  { className: "dockm-page" + (wide ? " dockm-page-wide" : "") },
16407
- import_react23.default.createElement(
18123
+ import_react24.default.createElement(
16408
18124
  "div",
16409
18125
  { className: "dockm-page-head" },
16410
- import_react23.default.createElement("span", { className: "dockm-page-icon" }, import_react23.default.createElement(DockIcon, { size: 20 })),
16411
- import_react23.default.createElement(
18126
+ import_react24.default.createElement("span", { className: "dockm-page-icon" }, import_react24.default.createElement(DockIcon, { size: 20 })),
18127
+ import_react24.default.createElement(
16412
18128
  "div",
16413
18129
  { className: "dockm-page-titles" },
16414
- import_react23.default.createElement("div", { className: "dockm-page-title" }, "\u529F\u80FD\u575E"),
16415
- import_react23.default.createElement("div", { className: "dockm-page-sub" }, "\u6240\u6709\u5C0F\u529F\u80FD\u96C6\u4E2D\u5728\u8FD9\u91CC\u7BA1\u7406\u3002\u4FA7\u680F\u56FE\u6807\u53EF\u5728\u300C\u66F4\u591A\u300D\u83DC\u5355\u91CC Pin \u5230\u9876\u90E8\uFF0C\u6216\u53D6\u6D88\u56FA\u5B9A\u6536\u8FDB\u66F4\u591A\u3002")
18130
+ import_react24.default.createElement("div", { className: "dockm-page-title" }, "\u529F\u80FD\u575E"),
18131
+ import_react24.default.createElement("div", { className: "dockm-page-sub" }, "\u6240\u6709\u5C0F\u529F\u80FD\u96C6\u4E2D\u5728\u8FD9\u91CC\u7BA1\u7406\u3002\u4FA7\u680F\u56FE\u6807\u53EF\u5728\u300C\u66F4\u591A\u300D\u83DC\u5355\u91CC Pin \u5230\u9876\u90E8\uFF0C\u6216\u53D6\u6D88\u56FA\u5B9A\u6536\u8FDB\u66F4\u591A\u3002")
16416
18132
  ),
16417
- import_react23.default.createElement("button", {
18133
+ import_react24.default.createElement("button", {
16418
18134
  type: "button",
16419
18135
  className: "dockm-page-wide-btn",
16420
18136
  title: wide ? "\u8FD8\u539F\u4FA7\u680F\u5BBD\u5EA6" : "\u6536\u8D77\u5DE6\u4FA7\u680F\uFF0C\u5168\u5C4F\u663E\u793A\u529F\u80FD\u575E",
@@ -16422,19 +18138,19 @@ function DockPage() {
16422
18138
  onClick: toggleWide
16423
18139
  }, wide ? "\u2750 \u8FD8\u539F" : "\u25A2 \u5168\u5C4F")
16424
18140
  ),
16425
- import_react23.default.createElement("div", { className: "dockm-page-body" }, import_react23.default.createElement(DockWorkspace, null))
18141
+ import_react24.default.createElement("div", { className: "dockm-page-body" }, import_react24.default.createElement(DockWorkspace, null))
16426
18142
  );
16427
18143
  }
16428
18144
  function DockChips(props) {
16429
- const [, force] = import_react23.default.useReducer((n) => n + 1, 0);
16430
- import_react23.default.useEffect(() => subscribeFeatureState(() => force()), []);
18145
+ const [, force] = import_react24.default.useReducer((n) => n + 1, 0);
18146
+ import_react24.default.useEffect(() => subscribeFeatureState(() => force()), []);
16431
18147
  const items = [];
16432
18148
  for (const f of allModules()) {
16433
18149
  if (f.planned || !stateOf(f.id).enabled || !chipShown(f.id) || typeof f.Chip !== "function") continue;
16434
- items.push(import_react23.default.createElement(
18150
+ items.push(import_react24.default.createElement(
16435
18151
  FeatureBoundary,
16436
18152
  { key: f.id, label: f.name },
16437
- import_react23.default.createElement(f.Chip, {
18153
+ import_react24.default.createElement(f.Chip, {
16438
18154
  ctx: props.ctx,
16439
18155
  feature: f,
16440
18156
  session: props.session,
@@ -16444,38 +18160,38 @@ function DockChips(props) {
16444
18160
  ));
16445
18161
  }
16446
18162
  if (items.length === 0) return null;
16447
- return import_react23.default.createElement("div", { className: "dockchip-row" }, items);
18163
+ return import_react24.default.createElement("div", { className: "dockchip-row" }, items);
16448
18164
  }
16449
18165
  function FeatureOverlays() {
16450
- const [, force] = import_react23.default.useReducer((n) => n + 1, 0);
18166
+ const [, force] = import_react24.default.useReducer((n) => n + 1, 0);
16451
18167
  useExternalVersion();
16452
- import_react23.default.useEffect(() => subscribeFeatureState(() => force()), []);
18168
+ import_react24.default.useEffect(() => subscribeFeatureState(() => force()), []);
16453
18169
  const items = [];
16454
18170
  for (const f of allModules()) {
16455
18171
  if (f.planned || !stateOf(f.id).enabled || typeof f.Overlay !== "function") continue;
16456
- items.push(import_react23.default.createElement(
18172
+ items.push(import_react24.default.createElement(
16457
18173
  FeatureBoundary,
16458
18174
  { key: f.id, label: f.name },
16459
- import_react23.default.createElement(f.Overlay, { ctx: ctxRef.current, feature: f })
18175
+ import_react24.default.createElement(f.Overlay, { ctx: ctxRef.current, feature: f })
16460
18176
  ));
16461
18177
  }
16462
18178
  if (items.length === 0) return null;
16463
- return import_react23.default.createElement(import_react23.default.Fragment, null, items);
18179
+ return import_react24.default.createElement(import_react24.default.Fragment, null, items);
16464
18180
  }
16465
18181
  function FeatureTurnTail(props) {
16466
- const [, force] = import_react23.default.useReducer((n) => n + 1, 0);
16467
- import_react23.default.useEffect(() => subscribeFeatureState(() => force()), []);
18182
+ const [, force] = import_react24.default.useReducer((n) => n + 1, 0);
18183
+ import_react24.default.useEffect(() => subscribeFeatureState(() => force()), []);
16468
18184
  const items = [];
16469
18185
  for (const f of allModules()) {
16470
18186
  if (f.planned || !stateOf(f.id).enabled || typeof f.TurnTail !== "function") continue;
16471
- items.push(import_react23.default.createElement(
18187
+ items.push(import_react24.default.createElement(
16472
18188
  FeatureBoundary,
16473
18189
  { key: f.id, label: f.name },
16474
- import_react23.default.createElement(f.TurnTail, Object.assign({}, props, { ctx: ctxRef.current, feature: f }))
18190
+ import_react24.default.createElement(f.TurnTail, Object.assign({}, props, { ctx: ctxRef.current, feature: f }))
16475
18191
  ));
16476
18192
  }
16477
18193
  if (items.length === 0) return null;
16478
- return import_react23.default.createElement(import_react23.default.Fragment, null, items);
18194
+ return import_react24.default.createElement(import_react24.default.Fragment, null, items);
16479
18195
  }
16480
18196
  var ctxRef = { current: null };
16481
18197
  function apply(ctx) {
@@ -16486,33 +18202,34 @@ function apply(ctx) {
16486
18202
  if (slots === void 0) return;
16487
18203
  slots.inject("sidebar.panellist", () => slots.register(
16488
18204
  { name: "sidebar.panellist", id: "dsh-dock", order: 30, label: "\u529F\u80FD\u575E" },
16489
- (props) => import_react23.default.createElement(DockIcon, { size: props && props.size || 18 })
18205
+ (props) => import_react24.default.createElement(DockIcon, { size: props && props.size || 18 })
16490
18206
  ));
16491
18207
  slots.inject("main", () => slots.register(
16492
18208
  { name: "main", key: "dsh-dock", label: "\u529F\u80FD\u575E" },
16493
- () => import_react23.default.createElement(DockPage, null)
18209
+ () => import_react24.default.createElement(DockPage, null)
16494
18210
  ));
16495
18211
  slots.inject("shell.overlay", () => slots.register(
16496
18212
  { name: "shell.overlay", id: "dsh-dock-panel", order: 21, label: "\u529F\u80FD\u575E\u9762\u677F" },
16497
- () => import_react23.default.createElement(DockModal, null)
18213
+ () => import_react24.default.createElement(DockModal, null)
16498
18214
  ));
16499
18215
  slots.inject("shell.overlay", () => slots.register(
16500
18216
  { name: "shell.overlay", id: "dsh-dock-feature-overlays", order: 22, label: "\u529F\u80FD\u575E\u5168\u5C40\u6D6E\u5C42" },
16501
- () => import_react23.default.createElement(FeatureOverlays, null)
18217
+ () => import_react24.default.createElement(FeatureOverlays, null)
16502
18218
  ));
16503
18219
  slots.inject("settings.section", () => slots.register(
16504
18220
  { name: "settings.section", id: "dsh-dock", order: 90, label: "\u529F\u80FD\u575E" },
16505
- (props) => import_react23.default.createElement(DockPanel, props)
18221
+ (props) => import_react24.default.createElement(DockPanel, props)
16506
18222
  ));
16507
18223
  slots.inject("conversation.input.left", () => slots.register(
16508
18224
  { name: "conversation.input.left", id: "dsh-dock-chips", order: 10, label: "\u529F\u80FD\u575E" },
16509
- (zone) => import_react23.default.createElement(DockChips, Object.assign({}, zone, { ctx: ctxRef.current }))
18225
+ (zone) => import_react24.default.createElement(DockChips, Object.assign({}, zone, { ctx: ctxRef.current }))
16510
18226
  ));
16511
18227
  slots.inject("conversation.chat.turnTail", () => slots.register(
16512
18228
  { name: "conversation.chat.turnTail", id: "dsh-dock-turn-tail", order: 40, label: "\u529F\u80FD\u575E" },
16513
- (owner) => import_react23.default.createElement(FeatureTurnTail, owner)
18229
+ (owner) => import_react24.default.createElement(FeatureTurnTail, owner)
16514
18230
  ));
16515
18231
  installClient(ctx);
18232
+ installClient2(ctx);
16516
18233
  }
16517
18234
  var inject = ["timer"];
16518
18235