@dyyz1993/codenomad 0.15.4 → 0.15.6
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/dist/auth/manager.js +3 -3
- package/dist/auth/session-manager.js +9 -2
- package/dist/background-processes/manager.js +1 -0
- package/dist/events/bus.js +4 -0
- package/dist/server/routes/events.js +2 -0
- package/dist/server/routes/workspaces.js +22 -0
- package/dist/workspaces/instance-events.js +25 -0
- package/dist/workspaces/manager.js +152 -0
- package/package.json +1 -1
- package/public/assets/{ChangesTab-COrfNORR.js → ChangesTab-BJhUbvWs.js} +1 -1
- package/public/assets/{DiffToolbar-QnXHmp3q.js → DiffToolbar-BYUtkOdF.js} +1 -1
- package/public/assets/{FilesTab-x2nbmTV-.js → FilesTab-WmW_H6y6.js} +1 -1
- package/public/assets/{GitChangesTab-BvjEhSAv.js → GitChangesTab-DRHySaNp.js} +1 -1
- package/public/assets/{StatusTab-DgV0vYyF.js → StatusTab-CntJx0xy.js} +1 -1
- package/public/assets/{align-justify-B0Fj8sHg.js → align-justify-DhnuvBq-.js} +1 -1
- package/public/assets/{diff-viewer-DUTVYyc3.js → diff-viewer-BjnhPluh.js} +1 -1
- package/public/assets/main-2ELpIX7K.js +57 -0
- package/public/assets/{markdown-Dyz0QwDg.js → markdown-DxZ9SDWq.js} +1 -1
- package/public/assets/{tool-call-CWVlP7WR.js → tool-call-BmDS5coL.js} +3 -3
- package/public/assets/{wrap-text-Cx3H2UIz.js → wrap-text-YfDjYTh2.js} +1 -1
- package/public/index.html +1 -1
- package/public/sw.js +1 -1
- package/public/assets/main-Bnnuz06l.js +0 -57
package/dist/auth/manager.js
CHANGED
|
@@ -128,13 +128,13 @@ function resolvePath(filePath) {
|
|
|
128
128
|
}
|
|
129
129
|
return path.resolve(filePath);
|
|
130
130
|
}
|
|
131
|
+
const DEFAULT_SESSION_MAX_AGE = 315360000; // 10 years in seconds
|
|
131
132
|
function buildSessionCookie(name, value, options) {
|
|
133
|
+
const maxAge = options?.maxAgeSeconds ?? DEFAULT_SESSION_MAX_AGE;
|
|
132
134
|
const parts = [`${name}=${encodeURIComponent(value)}`, "HttpOnly", "Path=/", "SameSite=Lax"];
|
|
133
135
|
if (options?.secure) {
|
|
134
136
|
parts.push("Secure");
|
|
135
137
|
}
|
|
136
|
-
|
|
137
|
-
parts.push(`Max-Age=${Math.max(0, Math.floor(options.maxAgeSeconds))}`);
|
|
138
|
-
}
|
|
138
|
+
parts.push(`Max-Age=${Math.max(0, Math.floor(maxAge))}`);
|
|
139
139
|
return parts.join("; ");
|
|
140
140
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import crypto from "crypto";
|
|
2
|
-
const SESSION_TTL_MS =
|
|
2
|
+
const SESSION_TTL_MS = 315360000 * 1000; // 10 years in ms
|
|
3
3
|
const CLEANUP_INTERVAL_MS = 30 * 60 * 1000;
|
|
4
4
|
export class SessionManager {
|
|
5
5
|
constructor() {
|
|
@@ -15,7 +15,14 @@ export class SessionManager {
|
|
|
15
15
|
getSession(id) {
|
|
16
16
|
if (!id)
|
|
17
17
|
return undefined;
|
|
18
|
-
|
|
18
|
+
const info = this.sessions.get(id);
|
|
19
|
+
if (!info)
|
|
20
|
+
return undefined;
|
|
21
|
+
if (Date.now() - info.createdAt > SESSION_TTL_MS) {
|
|
22
|
+
this.sessions.delete(id);
|
|
23
|
+
return undefined;
|
|
24
|
+
}
|
|
25
|
+
return info;
|
|
19
26
|
}
|
|
20
27
|
validateSession(sessionId) {
|
|
21
28
|
const info = this.sessions.get(sessionId);
|
|
@@ -14,6 +14,7 @@ export class BackgroundProcessManager {
|
|
|
14
14
|
this.deps = deps;
|
|
15
15
|
this.running = new Map();
|
|
16
16
|
this.deps.eventBus.on("workspace.stopped", (event) => this.cleanupWorkspace(event.workspaceId));
|
|
17
|
+
this.deps.eventBus.on("workspace.suspended", (event) => this.cleanupWorkspace(event.workspace.id));
|
|
17
18
|
this.deps.eventBus.on("workspace.error", (event) => this.cleanupWorkspace(event.workspace.id));
|
|
18
19
|
}
|
|
19
20
|
async list(workspaceId) {
|
package/dist/events/bus.js
CHANGED
|
@@ -19,6 +19,8 @@ export class EventBus extends EventEmitter {
|
|
|
19
19
|
this.on("workspace.started", handler);
|
|
20
20
|
this.on("workspace.error", handler);
|
|
21
21
|
this.on("workspace.stopped", handler);
|
|
22
|
+
this.on("workspace.suspended", handler);
|
|
23
|
+
this.on("workspace.resumed", handler);
|
|
22
24
|
this.on("workspace.log", handler);
|
|
23
25
|
this.on("sidecar.updated", handler);
|
|
24
26
|
this.on("sidecar.removed", handler);
|
|
@@ -32,6 +34,8 @@ export class EventBus extends EventEmitter {
|
|
|
32
34
|
this.off("workspace.started", handler);
|
|
33
35
|
this.off("workspace.error", handler);
|
|
34
36
|
this.off("workspace.stopped", handler);
|
|
37
|
+
this.off("workspace.suspended", handler);
|
|
38
|
+
this.off("workspace.resumed", handler);
|
|
35
39
|
this.off("workspace.log", handler);
|
|
36
40
|
this.off("sidecar.updated", handler);
|
|
37
41
|
this.off("sidecar.removed", handler);
|
|
@@ -27,6 +27,8 @@ export function registerEventRoutes(app, deps) {
|
|
|
27
27
|
case "workspace.created":
|
|
28
28
|
case "workspace.started":
|
|
29
29
|
case "workspace.error":
|
|
30
|
+
case "workspace.suspended":
|
|
31
|
+
case "workspace.resumed":
|
|
30
32
|
return event.workspace?.id;
|
|
31
33
|
case "workspace.stopped":
|
|
32
34
|
return event.workspaceId;
|
|
@@ -59,8 +59,30 @@ export function registerWorkspaceRoutes(app, deps) {
|
|
|
59
59
|
reply.code(404);
|
|
60
60
|
return { error: "Workspace not found" };
|
|
61
61
|
}
|
|
62
|
+
if (workspace.status === "suspended") {
|
|
63
|
+
try {
|
|
64
|
+
return await deps.workspaceManager.resumeWorkspace(request.params.id);
|
|
65
|
+
}
|
|
66
|
+
catch (error) {
|
|
67
|
+
request.log.error({ err: error }, "Failed to resume workspace");
|
|
68
|
+
const message = error instanceof Error ? error.message : "Failed to resume workspace";
|
|
69
|
+
reply.code(500).type("text/plain").send(message);
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
62
73
|
return workspace;
|
|
63
74
|
});
|
|
75
|
+
app.post("/api/workspaces/:id/resume", async (request, reply) => {
|
|
76
|
+
try {
|
|
77
|
+
const workspace = await deps.workspaceManager.resumeWorkspace(request.params.id);
|
|
78
|
+
return workspace;
|
|
79
|
+
}
|
|
80
|
+
catch (error) {
|
|
81
|
+
request.log.error({ err: error }, "Failed to resume workspace");
|
|
82
|
+
const message = error instanceof Error ? error.message : "Failed to resume workspace";
|
|
83
|
+
reply.code(400).type("text/plain").send(message);
|
|
84
|
+
}
|
|
85
|
+
});
|
|
64
86
|
app.delete("/api/workspaces/:id", async (request, reply) => {
|
|
65
87
|
await deps.workspaceManager.delete(request.params.id);
|
|
66
88
|
reply.code(204);
|
|
@@ -11,7 +11,9 @@ export class InstanceEventBridge {
|
|
|
11
11
|
this.lastLogTime = new Map();
|
|
12
12
|
const bus = this.options.eventBus;
|
|
13
13
|
bus.on("workspace.started", (event) => this.startStream(event.workspace.id));
|
|
14
|
+
bus.on("workspace.resumed", (event) => this.startStream(event.workspace.id));
|
|
14
15
|
bus.on("workspace.stopped", (event) => this.stopStream(event.workspaceId, "workspace stopped"));
|
|
16
|
+
bus.on("workspace.suspended", (event) => this.stopStream(event.workspace.id, "workspace suspended"));
|
|
15
17
|
bus.on("workspace.error", (event) => this.stopStream(event.workspace.id, "workspace error"));
|
|
16
18
|
}
|
|
17
19
|
shutdown() {
|
|
@@ -111,6 +113,7 @@ export class InstanceEventBridge {
|
|
|
111
113
|
return buffer;
|
|
112
114
|
}
|
|
113
115
|
processChunk(chunk, workspaceId) {
|
|
116
|
+
this.options.workspaceManager.recordActivity(workspaceId);
|
|
114
117
|
const lines = chunk.split(/\r?\n/);
|
|
115
118
|
const dataLines = [];
|
|
116
119
|
for (const line of lines) {
|
|
@@ -150,6 +153,7 @@ export class InstanceEventBridge {
|
|
|
150
153
|
this.options.logger.warn({ workspaceId, chunk: payload }, "Dropped malformed instance event");
|
|
151
154
|
return;
|
|
152
155
|
}
|
|
156
|
+
this.trackSessionState(workspaceId, event);
|
|
153
157
|
this.options.logger.debug({ workspaceId, eventType: event.type }, "Instance SSE event received");
|
|
154
158
|
if (this.options.logger.isLevelEnabled("trace")) {
|
|
155
159
|
this.options.logger.trace({ workspaceId, event }, "Instance SSE event payload");
|
|
@@ -168,6 +172,27 @@ export class InstanceEventBridge {
|
|
|
168
172
|
this.options.logger.warn({ workspaceId, chunk: payload, err: error }, "Failed to parse instance SSE payload");
|
|
169
173
|
}
|
|
170
174
|
}
|
|
175
|
+
trackSessionState(workspaceId, event) {
|
|
176
|
+
const BUSY_EVENTS = new Set([
|
|
177
|
+
"message.updated",
|
|
178
|
+
"message.part.updated",
|
|
179
|
+
"message.part.delta",
|
|
180
|
+
"session.compacted",
|
|
181
|
+
"permission.asked",
|
|
182
|
+
"question.asked",
|
|
183
|
+
]);
|
|
184
|
+
const IDLE_EVENTS = new Set([
|
|
185
|
+
"session.idle",
|
|
186
|
+
]);
|
|
187
|
+
const eventType = event.type;
|
|
188
|
+
if (IDLE_EVENTS.has(eventType)) {
|
|
189
|
+
this.options.workspaceManager.markIdle(workspaceId);
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
if (BUSY_EVENTS.has(eventType)) {
|
|
193
|
+
this.options.workspaceManager.markBusy(workspaceId);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
171
196
|
publishStatus(instanceId, status, reason) {
|
|
172
197
|
this.options.logger.debug({ instanceId, status, reason }, "Instance SSE status updated");
|
|
173
198
|
this.options.eventBus.publish({ type: "instance.eventStatus", instanceId, status, reason });
|
|
@@ -10,6 +10,9 @@ import { WorkspaceRuntime } from "./runtime";
|
|
|
10
10
|
import { getOpencodeConfigDir } from "../opencode-config.js";
|
|
11
11
|
import { OPENCODE_SERVER_BASE_URL_ENV, buildOpencodeBasicAuthHeader, OPENCODE_SERVER_PASSWORD_ENV, OPENCODE_SERVER_USERNAME_ENV, resolveOpencodeServerAuth, } from "./opencode-auth";
|
|
12
12
|
const STARTUP_STABILITY_DELAY_MS = 1500;
|
|
13
|
+
const IDLE_TIMEOUT_MS = 10 * 60 * 1000;
|
|
14
|
+
const IDLE_CHECK_INTERVAL_MS = 60 * 1000;
|
|
15
|
+
const MAX_ACTIVE_WORKSPACES = 3;
|
|
13
16
|
export class WorkspaceManager {
|
|
14
17
|
async acquireStartupSlot() {
|
|
15
18
|
if (this.activeStartups < this.MAX_CONCURRENT_STARTUPS) {
|
|
@@ -35,8 +38,11 @@ export class WorkspaceManager {
|
|
|
35
38
|
this.MAX_CONCURRENT_STARTUPS = 3;
|
|
36
39
|
this.activeStartups = 0;
|
|
37
40
|
this.startupQueue = [];
|
|
41
|
+
this.lastActivityTime = new Map();
|
|
42
|
+
this.workspaceBusy = new Map();
|
|
38
43
|
this.runtime = new WorkspaceRuntime(this.options.eventBus, this.options.logger);
|
|
39
44
|
this.opencodeConfigDir = getOpencodeConfigDir();
|
|
45
|
+
this.startIdleCheck();
|
|
40
46
|
}
|
|
41
47
|
list() {
|
|
42
48
|
return Array.from(this.workspaces.values());
|
|
@@ -140,6 +146,7 @@ export class WorkspaceManager {
|
|
|
140
146
|
descriptor.status = "ready";
|
|
141
147
|
descriptor.updatedAt = new Date().toISOString();
|
|
142
148
|
this.options.eventBus.publish({ type: "workspace.started", workspace: descriptor });
|
|
149
|
+
this.recordActivity(id);
|
|
143
150
|
this.options.logger.info({ workspaceId: id, port }, "Workspace ready");
|
|
144
151
|
return descriptor;
|
|
145
152
|
}
|
|
@@ -168,6 +175,8 @@ export class WorkspaceManager {
|
|
|
168
175
|
}
|
|
169
176
|
this.workspaces.delete(id);
|
|
170
177
|
this.opencodeAuth.delete(id);
|
|
178
|
+
this.lastActivityTime.delete(id);
|
|
179
|
+
this.workspaceBusy.delete(id);
|
|
171
180
|
clearWorkspaceSearchCache(workspace.path);
|
|
172
181
|
if (!wasRunning) {
|
|
173
182
|
this.options.eventBus.publish({ type: "workspace.stopped", workspaceId: id });
|
|
@@ -176,6 +185,12 @@ export class WorkspaceManager {
|
|
|
176
185
|
}
|
|
177
186
|
async shutdown() {
|
|
178
187
|
this.options.logger.info("Shutting down all workspaces");
|
|
188
|
+
if (this.idleCheckTimer) {
|
|
189
|
+
clearInterval(this.idleCheckTimer);
|
|
190
|
+
this.idleCheckTimer = undefined;
|
|
191
|
+
}
|
|
192
|
+
this.lastActivityTime.clear();
|
|
193
|
+
this.workspaceBusy.clear();
|
|
179
194
|
const stopTasks = [];
|
|
180
195
|
for (const [id, workspace] of this.workspaces) {
|
|
181
196
|
if (!workspace.pid) {
|
|
@@ -405,4 +420,141 @@ export class WorkspaceManager {
|
|
|
405
420
|
this.options.eventBus.publish({ type: "workspace.error", workspace });
|
|
406
421
|
}
|
|
407
422
|
}
|
|
423
|
+
recordActivity(workspaceId) {
|
|
424
|
+
this.lastActivityTime.set(workspaceId, Date.now());
|
|
425
|
+
}
|
|
426
|
+
markBusy(workspaceId) {
|
|
427
|
+
this.workspaceBusy.set(workspaceId, true);
|
|
428
|
+
this.recordActivity(workspaceId);
|
|
429
|
+
}
|
|
430
|
+
markIdle(workspaceId) {
|
|
431
|
+
this.workspaceBusy.set(workspaceId, false);
|
|
432
|
+
this.recordActivity(workspaceId);
|
|
433
|
+
}
|
|
434
|
+
startIdleCheck() {
|
|
435
|
+
this.idleCheckTimer = setInterval(() => {
|
|
436
|
+
this.checkIdleWorkspaces().catch((err) => {
|
|
437
|
+
this.options.logger.error({ err }, "Idle check failed");
|
|
438
|
+
});
|
|
439
|
+
}, IDLE_CHECK_INTERVAL_MS);
|
|
440
|
+
}
|
|
441
|
+
async checkIdleWorkspaces() {
|
|
442
|
+
const now = Date.now();
|
|
443
|
+
for (const [id, lastTime] of this.lastActivityTime) {
|
|
444
|
+
const workspace = this.workspaces.get(id);
|
|
445
|
+
if (!workspace || workspace.status !== "ready")
|
|
446
|
+
continue;
|
|
447
|
+
if (this.workspaceBusy.get(id) === true)
|
|
448
|
+
continue;
|
|
449
|
+
if (now - lastTime > IDLE_TIMEOUT_MS) {
|
|
450
|
+
this.options.logger.info({ workspaceId: id, idleMinutes: Math.round((now - lastTime) / 60000) }, "Suspending idle workspace");
|
|
451
|
+
await this.suspendWorkspace(id);
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
async suspendWorkspace(id) {
|
|
456
|
+
const workspace = this.workspaces.get(id);
|
|
457
|
+
if (!workspace || workspace.status !== "ready")
|
|
458
|
+
return;
|
|
459
|
+
await this.runtime.stop(id);
|
|
460
|
+
workspace.status = "suspended";
|
|
461
|
+
workspace.pid = undefined;
|
|
462
|
+
workspace.port = undefined;
|
|
463
|
+
workspace.updatedAt = new Date().toISOString();
|
|
464
|
+
this.options.eventBus.publish({ type: "workspace.suspended", workspace: { ...workspace } });
|
|
465
|
+
this.lastActivityTime.delete(id);
|
|
466
|
+
this.workspaceBusy.delete(id);
|
|
467
|
+
}
|
|
468
|
+
async resumeWorkspace(id) {
|
|
469
|
+
const workspace = this.workspaces.get(id);
|
|
470
|
+
if (!workspace || workspace.status !== "suspended") {
|
|
471
|
+
throw new Error("Workspace not found or not suspended");
|
|
472
|
+
}
|
|
473
|
+
const activeCount = Array.from(this.workspaces.values()).filter((w) => w.status === "ready" || w.status === "starting").length;
|
|
474
|
+
if (activeCount >= MAX_ACTIVE_WORKSPACES) {
|
|
475
|
+
await this.evictLeastRecentlyUsed(id);
|
|
476
|
+
}
|
|
477
|
+
await this.acquireStartupSlot();
|
|
478
|
+
try {
|
|
479
|
+
workspace.status = "starting";
|
|
480
|
+
workspace.updatedAt = new Date().toISOString();
|
|
481
|
+
const binary = await this.options.binaryResolver.resolveDefault();
|
|
482
|
+
const resolvedBinaryPath = await this.resolveBinaryPath(binary.path);
|
|
483
|
+
const serverConfig = await this.options.settings.getOwner("config", "server");
|
|
484
|
+
const envVars = serverConfig?.environmentVariables;
|
|
485
|
+
const userEnvironment = envVars && typeof envVars === "object" && !Array.isArray(envVars) ? envVars : {};
|
|
486
|
+
const serverBaseUrl = this.options.getServerBaseUrl();
|
|
487
|
+
const normalizedServerBaseUrl = serverBaseUrl.replace(/\/+$/, "");
|
|
488
|
+
const { username: opencodeUsername, password: opencodePassword } = resolveOpencodeServerAuth({
|
|
489
|
+
userEnvironment,
|
|
490
|
+
processEnv: process.env,
|
|
491
|
+
});
|
|
492
|
+
const authorization = buildOpencodeBasicAuthHeader({ username: opencodeUsername, password: opencodePassword });
|
|
493
|
+
if (!authorization) {
|
|
494
|
+
throw new Error("Failed to build OpenCode auth header");
|
|
495
|
+
}
|
|
496
|
+
this.opencodeAuth.set(id, { username: opencodeUsername, password: opencodePassword, authorization });
|
|
497
|
+
const environment = {
|
|
498
|
+
...userEnvironment,
|
|
499
|
+
OPENCODE_CONFIG_DIR: this.opencodeConfigDir,
|
|
500
|
+
CODENOMAD_INSTANCE_ID: id,
|
|
501
|
+
CODENOMAD_BASE_URL: serverBaseUrl,
|
|
502
|
+
...(this.options.nodeExtraCaCertsPath ? { NODE_EXTRA_CA_CERTS: this.options.nodeExtraCaCertsPath } : {}),
|
|
503
|
+
[OPENCODE_SERVER_BASE_URL_ENV]: `${normalizedServerBaseUrl}${workspace.proxyPath}`,
|
|
504
|
+
[OPENCODE_SERVER_USERNAME_ENV]: opencodeUsername,
|
|
505
|
+
[OPENCODE_SERVER_PASSWORD_ENV]: opencodePassword,
|
|
506
|
+
};
|
|
507
|
+
const logLevel = serverConfig?.logLevel;
|
|
508
|
+
const { pid, port, exitPromise, getLastOutput } = await this.runtime.launch({
|
|
509
|
+
workspaceId: id,
|
|
510
|
+
folder: workspace.path,
|
|
511
|
+
binaryPath: resolvedBinaryPath,
|
|
512
|
+
environment,
|
|
513
|
+
logLevel,
|
|
514
|
+
onExit: (info) => this.handleProcessExit(info.workspaceId, info),
|
|
515
|
+
});
|
|
516
|
+
const runtimeVersion = await this.waitForWorkspaceReadiness({ workspaceId: id, port, exitPromise, getLastOutput });
|
|
517
|
+
if (runtimeVersion) {
|
|
518
|
+
workspace.binaryVersion = runtimeVersion;
|
|
519
|
+
}
|
|
520
|
+
workspace.pid = pid;
|
|
521
|
+
workspace.port = port;
|
|
522
|
+
workspace.status = "ready";
|
|
523
|
+
workspace.updatedAt = new Date().toISOString();
|
|
524
|
+
this.recordActivity(id);
|
|
525
|
+
this.options.eventBus.publish({ type: "workspace.resumed", workspace: { ...workspace } });
|
|
526
|
+
this.options.logger.info({ workspaceId: id, port }, "Workspace resumed");
|
|
527
|
+
return workspace;
|
|
528
|
+
}
|
|
529
|
+
catch (error) {
|
|
530
|
+
workspace.status = "error";
|
|
531
|
+
workspace.error = error instanceof Error ? error.message : String(error);
|
|
532
|
+
workspace.updatedAt = new Date().toISOString();
|
|
533
|
+
this.options.eventBus.publish({ type: "workspace.error", workspace });
|
|
534
|
+
this.options.logger.error({ workspaceId: id, err: error }, "Workspace failed to resume");
|
|
535
|
+
throw error;
|
|
536
|
+
}
|
|
537
|
+
finally {
|
|
538
|
+
this.releaseStartupSlot();
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
async evictLeastRecentlyUsed(excludeId) {
|
|
542
|
+
let lruId;
|
|
543
|
+
let lruTime = Infinity;
|
|
544
|
+
for (const [id, lastTime] of this.lastActivityTime) {
|
|
545
|
+
if (id === excludeId)
|
|
546
|
+
continue;
|
|
547
|
+
const workspace = this.workspaces.get(id);
|
|
548
|
+
if (!workspace || workspace.status !== "ready")
|
|
549
|
+
continue;
|
|
550
|
+
if (lastTime < lruTime) {
|
|
551
|
+
lruTime = lastTime;
|
|
552
|
+
lruId = id;
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
if (lruId) {
|
|
556
|
+
this.options.logger.info({ workspaceId: lruId }, "Evicting least recently used workspace");
|
|
557
|
+
await this.suspendWorkspace(lruId);
|
|
558
|
+
}
|
|
559
|
+
}
|
|
408
560
|
}
|
package/package.json
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-viewer-YY9yfE-p.js","assets/git-diff-vendor-CSgooKT_.js","assets/fast-diff-vendor-DgdwVvTQ.js","assets/highlight-vendor-8FKMu9os.js","assets/git-diff-vendor-HAZkIolJ.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{_ as K}from"./index-BCGPLzO4.js";import{m as B,t as g,i as a,d as w,a as z,f as N}from"./monaco-viewer-YY9yfE-p.js";import{c as f,n as c,a as L,F,S as W,z as j,A as q}from"./git-diff-vendor-CSgooKT_.js";import{D as G}from"./DiffToolbar-
|
|
2
|
+
import{_ as K}from"./index-BCGPLzO4.js";import{m as B,t as g,i as a,d as w,a as z,f as N}from"./monaco-viewer-YY9yfE-p.js";import{c as f,n as c,a as L,F,S as W,z as j,A as q}from"./git-diff-vendor-CSgooKT_.js";import{D as G}from"./DiffToolbar-BYUtkOdF.js";import{S as H}from"./SplitFilePanel-CA0D92l1.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";import"./main-2ELpIX7K.js";import"./align-justify-DhnuvBq-.js";import"./wrap-text-YfDjYTh2.js";var J=g('<div class="file-viewer-panel flex-1"><div class="file-viewer-content file-viewer-content--monaco">'),T=g("<div class=file-viewer-empty><span class=file-viewer-empty-text>"),Q=g('<div class="p-3 text-xs text-secondary">'),E=g("<div><div class=file-list-item-content><div class=file-list-item-path><span class=file-path-text></span></div><div class=file-list-item-stats><span class=file-list-item-additions>+</span><span class=file-list-item-deletions>-"),U=g("<span class=files-tab-selected-path><span class=file-path-text>"),X=g('<div class=files-tab-stats style="flex:0 0 auto"><span class="files-tab-stat files-tab-stat-additions"><span class=files-tab-stat-value>+</span></span><span class="files-tab-stat files-tab-stat-deletions"><span class=files-tab-stat-value>-'),Y=g("<div style=margin-left:auto>");const Z=q(()=>K(()=>import("./monaco-viewer-YY9yfE-p.js").then(e=>e.ad),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.MonacoDiffViewer}))),ce=e=>{const M=f(()=>e.activeSessionId()),S=f(()=>!!(M()&&M()!=="info")),D=f(()=>S()?e.activeSessionDiffs():null),m=f(()=>{const n=D();return Array.isArray(n)?[...n].sort((i,l)=>String(i.file||"").localeCompare(String(l.file||""))):[]}),R=f(()=>m().reduce((n,i)=>(n.additions+=typeof i.additions=="number"?i.additions:0,n.deletions+=typeof i.deletions=="number"?i.deletions:0,n),{additions:0,deletions:0})),I=f(()=>{const n=m();return n.length===0?null:n.reduce((i,l)=>{const v=typeof(i==null?void 0:i.additions)=="number"?i.additions:0,y=typeof(i==null?void 0:i.deletions)=="number"?i.deletions:0,x=v+y,k=typeof(l==null?void 0:l.additions)=="number"?l.additions:0,t=typeof(l==null?void 0:l.deletions)=="number"?l.deletions:0,r=k+t;return r>x?l:r<x?i:String(l.file||"").localeCompare(String((i==null?void 0:i.file)||""))<0?l:i},n[0])}),P=f(()=>{const n=e.selectedFile(),i=m();if(n){const l=i.find(v=>v.file===n);if(l)return l}return I()}),O=f(()=>`${e.instanceId}:${S()?M():"no-session"}`),V=f(()=>{if(!S())return e.t("instanceShell.sessionChanges.noSessionSelected");const n=D();return n===void 0?e.t("instanceShell.sessionChanges.loading"):!Array.isArray(n)||n.length===0?e.t("instanceShell.sessionChanges.empty"):e.t("instanceShell.filesShell.viewerEmpty")}),A=f(()=>{const n=P();return n!=null&&n.file?String(n.file):e.t("instanceShell.rightPanel.tabs.changes")});return B(()=>{const n=m(),i=R(),l=P(),v=()=>(()=>{var t=J(),r=t.firstChild;return a(r,c(W,{get when(){return l&&S()&&n.length>0?l:null},get fallback(){return(()=>{var d=T(),s=d.firstChild;return a(s,V),d})()},children:d=>c(j,{get fallback(){return(()=>{var s=T(),u=s.firstChild;return a(u,()=>e.t("instanceInfo.loading")),s})()},get children(){return c(Z,{get scopeKey(){return O()},get path(){return String(d().file||"")},get patch(){return String(d().patch||"")},get viewMode(){return e.diffViewMode()},get contextMode(){return e.diffContextMode()},get wordWrap(){return e.diffWordWrapMode()}})}})})),t})(),y=()=>(()=>{var t=Q();return a(t,V),t})();return c(H,{get header(){return[(()=>{var t=U(),r=t.firstChild;return a(r,A),L(()=>w(t,"title",A())),t})(),(()=>{var t=X(),r=t.firstChild,d=r.firstChild;d.firstChild;var s=r.nextSibling,u=s.firstChild;return u.firstChild,a(d,()=>i.additions,null),a(u,()=>i.deletions,null),t})(),(()=>{var t=Y();return a(t,c(G,{get viewMode(){return e.diffViewMode()},get contextMode(){return e.diffContextMode()},get wordWrapMode(){return e.diffWordWrapMode()},get onViewModeChange(){return e.onViewModeChange},get onContextModeChange(){return e.onContextModeChange},get onWordWrapModeChange(){return e.onWordWrapModeChange}})),t})()]},list:{panel:()=>c(W,{get when(){return n.length>0},get fallback(){return y()},get children(){return c(F,{each:n,children:t=>(()=>{var r=E(),d=r.firstChild,s=d.firstChild,u=s.firstChild,b=s.nextSibling,h=b.firstChild;h.firstChild;var C=h.nextSibling;return C.firstChild,r.$$click=()=>{e.onSelectFile(t.file,e.isPhoneLayout())},a(u,()=>t.file),a(h,()=>t.additions,null),a(C,()=>t.deletions,null),L(o=>{var _=`file-list-item ${(l==null?void 0:l.file)===t.file?"file-list-item-active":""}`,$=t.file;return _!==o.e&&z(r,o.e=_),$!==o.t&&w(s,"title",o.t=$),o},{e:void 0,t:void 0}),r})()})}}),overlay:()=>c(W,{get when(){return n.length>0},get fallback(){return y()},get children(){return c(F,{each:n,children:t=>(()=>{var r=E(),d=r.firstChild,s=d.firstChild,u=s.firstChild,b=s.nextSibling,h=b.firstChild;h.firstChild;var C=h.nextSibling;return C.firstChild,r.$$click=()=>{e.onSelectFile(t.file,!0)},a(u,()=>t.file),a(h,()=>t.additions,null),a(C,()=>t.deletions,null),L(o=>{var _=`file-list-item ${(l==null?void 0:l.file)===t.file?"file-list-item-active":""}`,$=t.file,p=t.file;return _!==o.e&&z(r,o.e=_),$!==o.t&&w(r,"title",o.t=$),p!==o.a&&w(s,"title",o.a=p),o},{e:void 0,t:void 0,a:void 0}),r})()})}})},get viewer(){return v()},get listOpen(){return e.listOpen()},get onToggleList(){return e.onToggleList},get splitWidth(){return e.splitWidth()},get onResizeMouseDown(){return e.onResizeMouseDown},get onResizeTouchStart(){return e.onResizeTouchStart},get isPhoneLayout(){return e.isPhoneLayout()},get overlayAriaLabel(){return e.t("instanceShell.rightPanel.tabs.changes")}})})};N(["click"]);export{ce as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as g,i as c,m as W,d as i,a as S,f as C}from"./monaco-viewer-YY9yfE-p.js";import{u as T}from"./index-BCGPLzO4.js";import{n as o,m as $,a as V}from"./git-diff-vendor-CSgooKT_.js";import{I as U,S as A,K as I}from"./main-
|
|
1
|
+
import{t as g,i as c,m as W,d as i,a as S,f as C}from"./monaco-viewer-YY9yfE-p.js";import{u as T}from"./index-BCGPLzO4.js";import{n as o,m as $,a as V}from"./git-diff-vendor-CSgooKT_.js";import{I as U,S as A,K as I}from"./main-2ELpIX7K.js";import{A as D}from"./align-justify-DhnuvBq-.js";import{W as E}from"./wrap-text-YfDjYTh2.js";const F=[["path",{d:"M12 22v-6",key:"6o8u61"}],["path",{d:"M12 8V2",key:"1wkif3"}],["path",{d:"M4 12H2",key:"rhcxmi"}],["path",{d:"M10 12H8",key:"s88cx1"}],["path",{d:"M16 12h-2",key:"10asgb"}],["path",{d:"M22 12h-2",key:"14jgyd"}],["path",{d:"m15 19-3 3-3-3",key:"11eu04"}],["path",{d:"m15 5-3-3-3 3",key:"itvq4r"}]],H=t=>o(U,$(t,{name:"UnfoldVertical",iconNode:F}));var N=g("<div class=file-viewer-toolbar><button type=button class=file-viewer-toolbar-icon-button></button><button type=button class=file-viewer-toolbar-icon-button></button><button type=button>");const z=t=>{const{t:a}=T(),d=()=>t.viewMode==="split"?"unified":"split",s=()=>t.contextMode==="collapsed"?"expanded":"collapsed",f=()=>t.wordWrapMode==="on"?"off":"on",h=()=>d()==="split"?a("instanceShell.diff.switchToSplit"):a("instanceShell.diff.switchToUnified"),v=()=>s()==="collapsed"?a("instanceShell.diff.hideUnchanged"):a("instanceShell.diff.showFull"),u=()=>f()==="on"?a("instanceShell.diff.enableWordWrap"):a("instanceShell.diff.disableWordWrap");return(()=>{var b=N(),n=b.firstChild,l=n.nextSibling,r=l.nextSibling;return n.$$click=()=>t.onViewModeChange(d()),c(n,(()=>{var e=W(()=>d()==="split");return()=>e()?o(A,{class:"h-4 w-4","aria-hidden":"true"}):o(D,{class:"h-4 w-4","aria-hidden":"true"})})()),l.$$click=()=>t.onContextModeChange(s()),c(l,(()=>{var e=W(()=>s()==="collapsed");return()=>e()?o(I,{class:"h-4 w-4","aria-hidden":"true"}):o(H,{class:"h-4 w-4","aria-hidden":"true"})})()),r.$$click=()=>t.onWordWrapModeChange(f()),c(r,o(E,{class:"h-4 w-4","aria-hidden":"true"})),V(e=>{var m=h(),w=h(),M=v(),p=v(),x=`file-viewer-toolbar-icon-button${t.wordWrapMode==="on"?" active":""}`,k=u(),y=u();return m!==e.e&&i(n,"aria-label",e.e=m),w!==e.t&&i(n,"title",e.t=w),M!==e.a&&i(l,"aria-label",e.a=M),p!==e.o&&i(l,"title",e.o=p),x!==e.i&&S(r,e.i=x),k!==e.n&&i(r,"aria-label",e.n=k),y!==e.s&&i(r,"title",e.s=y),e},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),b})()};C(["click"]);export{z as D};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-viewer-YY9yfE-p.js","assets/git-diff-vendor-CSgooKT_.js","assets/fast-diff-vendor-DgdwVvTQ.js","assets/highlight-vendor-8FKMu9os.js","assets/git-diff-vendor-HAZkIolJ.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{_ as G}from"./index-BCGPLzO4.js";import{Z as J,m,t as h,i as s,d as u,a as C,u as U,f as X}from"./monaco-viewer-YY9yfE-p.js";import{n as o,m as Y,d as A,b as P,c as $,S as g,a as w,z as p,A as ee,F as te}from"./git-diff-vendor-CSgooKT_.js";import{S as le}from"./SplitFilePanel-CA0D92l1.js";import{I as ne,R as K,M as re,N as ae,C as ie,e as se,O as oe}from"./main-
|
|
2
|
+
import{_ as G}from"./index-BCGPLzO4.js";import{Z as J,m,t as h,i as s,d as u,a as C,u as U,f as X}from"./monaco-viewer-YY9yfE-p.js";import{n as o,m as Y,d as A,b as P,c as $,S as g,a as w,z as p,A as ee,F as te}from"./git-diff-vendor-CSgooKT_.js";import{S as le}from"./SplitFilePanel-CA0D92l1.js";import{I as ne,R as K,M as re,N as ae,C as ie,e as se,O as oe}from"./main-2ELpIX7K.js";import{W as ce}from"./wrap-text-YfDjYTh2.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";const de=[["path",{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z",key:"1owoqh"}],["polyline",{points:"17 21 17 13 7 13 7 21",key:"1md35c"}],["polyline",{points:"7 3 7 8 15 8",key:"8nz8an"}]],he=e=>o(ne,Y(e,{name:"Save",iconNode:de}));var ue=h('<div class="px-2 py-2 border-b border-base"><div class=selector-input-group><div class="flex items-center gap-2 px-3 text-muted"></div><input type=text class=selector-input>'),ve=h("<div class=file-list-header><span class=file-list-title></span><span class=file-list-count>"),O=h('<div class="p-3 text-xs text-secondary">'),fe=h("<div class=file-list-item><div class=file-list-item-content><div class=file-list-item-path><span class=file-path-text>.."),ge=h('<div class="p-3 text-xs text-error">'),we=h('<div><div class=file-list-item-content><div class=file-list-item-path><span class=file-path-text></span></div><div class="flex items-center gap-2 shrink-0"><div class=file-list-item-stats><span class="text-[10px] text-secondary"></span></div><button type=button class=git-change-row-action>'),k=h("<div class=file-viewer-empty><span class=file-viewer-empty-text>"),Se=h('<div class="file-viewer-panel flex-1"><div>'),be=h('<div class="h-full outline-none"tabindex=0>'),me=h("<span>"),$e=h("<div class=files-tab-stats><span class=files-tab-stat><span class=files-tab-selected-path><span class=file-path-text>"),ye=h("<button type=button style=margin-inline-start:auto>"),_e=h("<button type=button>"),q=h("<button type=button class=files-header-icon-button>"),Ce=h("<span class=text-error>");const ke=ee(()=>G(()=>import("./monaco-viewer-YY9yfE-p.js").then(e=>e.ae),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.MonacoFileViewer})));function xe(e){return e?/\.(md|markdown|mdown|mkdn)$/i.test(e):!1}const Ie=e=>{const[E,L]=A(""),{isDark:N}=J(),[Q,M]=A(!1);let S;P(()=>{e.browserPath(),L("")});const H=$(()=>[...e.browserEntries()||[]].sort((i,d)=>{const l=i.type==="directory"?0:1,t=d.type==="directory"?0:1;return l!==t?l-t:String(i.name||"").localeCompare(String(d.name||""))})),W=$(()=>E().trim().toLowerCase()),x=$(()=>{const n=W(),i=H();return n?i.filter(d=>String(d.name||"").toLowerCase().includes(n)):i}),y=()=>e.browserLoading()&&e.browserEntries()===null,Z=()=>W()?e.t("instanceShell.filesShell.search.empty"):e.t("instanceShell.filesShell.listEmpty"),_=$(()=>xe(e.browserSelectedPath())),b=$(()=>_()&&Q());P(()=>{_()||M(!1)});const D=()=>{const n=e.browserSelectedContent();n!=null&&e.onSave(n)},j=async(n,i)=>{i==null||i.stopPropagation();const d=await se(n);oe({message:d?e.t("instanceShell.filesShell.toast.copyPathSuccess"):e.t("instanceShell.filesShell.toast.copyPathError"),variant:d?"success":"error"})};P(()=>{b()&&requestAnimationFrame(()=>S==null?void 0:S.focus())});const T=()=>[(()=>{var n=ue(),i=n.firstChild,d=i.firstChild,l=d.nextSibling;return s(d,o(ae,{class:"w-4 h-4"})),l.$$input=t=>L(t.currentTarget.value),w(t=>{var a=e.t("instanceShell.filesShell.search.placeholder"),r=e.t("instanceShell.filesShell.search.ariaLabel");return a!==t.e&&u(l,"placeholder",t.e=a),r!==t.t&&u(l,"aria-label",t.t=r),t},{e:void 0,t:void 0}),w(()=>l.value=E()),n})(),(()=>{var n=ve(),i=n.firstChild,d=i.nextSibling;return s(i,()=>e.t("instanceShell.filesShell.fileListTitle")),s(d,()=>x().length),n})(),o(g,{get when(){return e.parentPath()},children:n=>(()=>{var i=fe(),d=i.firstChild,l=d.firstChild;return i.$$click=()=>e.onLoadEntries(n()),w(()=>u(l,"title",n())),i})()}),o(g,{get when(){return y()},get children(){var n=O();return s(n,()=>e.t("instanceInfo.loading")),n}}),o(g,{get when(){return m(()=>!e.browserError()&&!y())()&&x().length>0},get fallback(){return m(()=>!y())()?m(()=>!!e.browserError())()?(()=>{var n=ge();return s(n,()=>e.browserError()),n})():(()=>{var n=O();return s(n,Z),n})():void 0},get children(){return o(te,{get each(){return x()},children:n=>(()=>{var i=we(),d=i.firstChild,l=d.firstChild,t=l.firstChild,a=l.nextSibling,r=a.firstChild,c=r.firstChild,f=r.nextSibling;return i.$$click=()=>{if(n.type==="directory"){e.onLoadEntries(n.path);return}e.onRequestOpenFile(n.path)},s(t,()=>n.name),s(c,()=>n.type),f.$$click=v=>void j(n.path,v),s(f,o(ie,{class:"w-3 h-3"})),w(v=>{var F=`file-list-item ${e.browserSelectedPath()===n.path?"file-list-item-active":""}`,z=n.path,I=n.path,R=e.t("instanceShell.filesShell.actions.copyPath"),V=e.t("instanceShell.filesShell.actions.copyPath");return F!==v.e&&C(i,v.e=F),z!==v.t&&u(i,"title",v.t=z),I!==v.a&&u(l,"title",v.a=I),R!==v.o&&u(f,"title",v.o=R),V!==v.i&&u(f,"aria-label",v.i=V),v},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),i})()})}})],B=n=>{!(n.ctrlKey||n.metaKey)||n.key.toLowerCase()!=="s"||e.browserSelectedSaving()||!e.browserSelectedDirty()||(n.preventDefault(),D())};return m(()=>{const n=()=>e.browserSelectedPath()||e.browserPath(),i=()=>y()?e.t("instanceInfo.loading"):e.t("instanceShell.filesShell.viewerEmpty"),d=()=>(()=>{var l=Se(),t=l.firstChild;return s(t,o(g,{get when(){return e.browserSelectedLoading()},get fallback(){return o(g,{get when(){return e.browserSelectedError()},get fallback(){return o(g,{get when(){return m(()=>!!(e.browserSelectedPath()&&e.browserSelectedContent()!==null))()?{path:e.browserSelectedPath(),content:e.browserSelectedContent()}:null},get fallback(){return(()=>{var a=k(),r=a.firstChild;return s(r,i),a})()},children:a=>o(g,{get when(){return b()},get fallback(){return o(p,{get fallback(){return(()=>{var r=k(),c=r.firstChild;return s(c,()=>e.t("instanceInfo.loading")),r})()},get children(){return o(ke,{get scopeKey(){return e.scopeKey()},get path(){return a().path},get content(){return a().content},get wordWrap(){return e.wordWrapMode()},get onSave(){return e.onSave},get onContentChange(){return e.onContentChange}})}})},get children(){var r=be();r.$$mousedown=()=>S==null?void 0:S.focus(),r.$$keydown=B;var c=S;return typeof c=="function"?U(c,r):S=r,s(r,o(re,{get part(){return{type:"text",text:a().content}},get isDark(){return N()},escapeRawHtml:!0})),r}})})},children:a=>(()=>{var r=k(),c=r.firstChild;return s(c,a),r})()})},get children(){var a=k(),r=a.firstChild;return s(r,()=>e.t("instanceInfo.loading")),a}})),w(()=>C(t,b()?"file-viewer-content":"file-viewer-content file-viewer-content--monaco")),l})();return o(le,{get header(){return[(()=>{var l=$e(),t=l.firstChild,a=t.firstChild,r=a.firstChild;return s(r,n),s(l,o(g,{get when(){return e.browserLoading()},get children(){var c=me();return s(c,()=>e.t("instanceInfo.loading")),c}}),null),s(l,o(g,{get when(){return e.browserError()},children:c=>(()=>{var f=Ce();return s(f,c),f})()}),null),w(()=>u(a,"title",n())),l})(),(()=>{var l=ye();return l.$$click=()=>_()&&M(t=>!t),s(l,(()=>{var t=m(()=>!!b());return()=>t()?e.t("instanceShell.filesShell.showSource"):e.t("instanceShell.filesShell.previewMarkdown")})()),w(t=>{var a=`file-viewer-toolbar-button${b()?" active":""}`,r=!_();return a!==t.e&&C(l,t.e=a),r!==t.t&&(l.disabled=t.t=r),t},{e:void 0,t:void 0}),l})(),(()=>{var l=_e();return l.$$click=()=>e.onWordWrapModeChange(e.wordWrapMode()==="on"?"off":"on"),s(l,o(ce,{class:"h-4 w-4"})),w(t=>{var a=`file-viewer-toolbar-icon-button${e.wordWrapMode()==="on"?" active":""}`,r=e.wordWrapMode()==="on"?e.t("instanceShell.filesShell.disableWordWrap"):e.t("instanceShell.filesShell.enableWordWrap"),c=e.wordWrapMode()==="on"?e.t("instanceShell.filesShell.disableWordWrap"):e.t("instanceShell.filesShell.enableWordWrap"),f=b();return a!==t.e&&C(l,t.e=a),r!==t.t&&u(l,"title",t.t=r),c!==t.a&&u(l,"aria-label",t.a=c),f!==t.o&&(l.disabled=t.o=f),t},{e:void 0,t:void 0,a:void 0,o:void 0}),l})(),(()=>{var l=q();return l.$$click=D,s(l,o(g,{get when(){return e.browserSelectedSaving()},get fallback(){return o(he,{class:"h-4 w-4"})},get children(){return o(K,{class:"h-4 w-4 animate-spin"})}})),w(t=>{var a=e.t("instanceShell.rightPanel.actions.save")||"Save (Ctrl+S)",r=e.t("instanceShell.rightPanel.actions.save")||"Save",c=e.browserSelectedSaving()||!e.browserSelectedDirty();return a!==t.e&&u(l,"title",t.e=a),r!==t.t&&u(l,"aria-label",t.t=r),c!==t.a&&(l.disabled=t.a=c),t},{e:void 0,t:void 0,a:void 0}),l})(),(()=>{var l=q();return l.$$click=()=>e.onRefresh(),s(l,o(K,{get class(){return`h-4 w-4${e.browserLoading()?" animate-spin":""}`}})),w(t=>{var a=e.t("instanceShell.rightPanel.actions.refresh"),r=e.t("instanceShell.rightPanel.actions.refresh"),c=e.browserLoading();return a!==t.e&&u(l,"title",t.e=a),r!==t.t&&u(l,"aria-label",t.t=r),c!==t.a&&(l.disabled=t.a=c),t},{e:void 0,t:void 0,a:void 0}),l})()]},list:{panel:()=>o(T,{}),overlay:()=>o(T,{})},get viewer(){return d()},get listOpen(){return e.listOpen()},get onToggleList(){return e.onToggleList},get splitWidth(){return e.splitWidth()},get onResizeMouseDown(){return e.onResizeMouseDown},get onResizeTouchStart(){return e.onResizeTouchStart},get isPhoneLayout(){return e.isPhoneLayout()},get overlayAriaLabel(){return e.t("instanceShell.rightPanel.tabs.files")}})})};X(["input","click","keydown","mousedown"]);export{Ie as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-viewer-YY9yfE-p.js","assets/git-diff-vendor-CSgooKT_.js","assets/fast-diff-vendor-DgdwVvTQ.js","assets/highlight-vendor-8FKMu9os.js","assets/git-diff-vendor-HAZkIolJ.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{_ as se}from"./index-BCGPLzO4.js";import{m as R,t as h,i as n,d as b,h as U,a as H,f as le}from"./monaco-viewer-YY9yfE-p.js";import{n as r,m as re,c as m,a as L,S as w,F as J,z as ce,A as oe}from"./git-diff-vendor-CSgooKT_.js";import{D as de}from"./DiffToolbar-QnXHmp3q.js";import{S as ge}from"./SplitFilePanel-CA0D92l1.js";import{I as he,G as ue,R as fe,H as j,J as Q}from"./main-Bnnuz06l.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";import"./align-justify-B0Fj8sHg.js";import"./wrap-text-Cx3H2UIz.js";const me=[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]],ve=e=>r(he,re(e,{name:"GitBranch",iconNode:me}));var V=h("<div class=file-viewer-empty><span class=file-viewer-empty-text>"),Ce=h('<div class="file-viewer-panel flex-1"><div class="file-viewer-content file-viewer-content--monaco">'),$e=h('<div class="p-3 text-xs text-secondary">'),be=h('<span class="git-change-row-action-bar git-change-row-action-bar-vertical">'),_e=h('<div><div class=file-list-item-content><div class=file-list-item-path><span class=file-path-text></span></div><div class=git-change-list-item-right><div class=file-list-item-stats><span class=file-list-item-additions>+</span><span class=file-list-item-deletions>-</span></div></div></div><div class=git-change-list-item-actions-zone><div class=git-change-list-item-actions><button type=button class=git-change-row-action><span aria-hidden=true><span class="git-change-row-action-bar git-change-row-action-bar-horizontal">'),we=h("<div class=git-change-section-items>"),Se=h("<div class=git-change-section><button type=button class=git-change-section-header><span class=git-change-section-header-main><span class=git-change-section-chevron></span><span class=git-change-section-title></span></span><span class=git-change-section-count>"),ye=h('<div class=git-change-section-items><div class=git-change-commit-box><div class=git-change-commit-input-wrap><textarea class=git-change-commit-input rows=1></textarea><button type=button class="git-change-commit-button git-change-commit-button-overlay">'),xe=h("<div class=git-change-sections><div class=git-change-section><button type=button class=git-change-section-header><span class=git-change-section-header-main><span class=git-change-section-chevron></span><span class=git-change-section-title-row><span class=git-change-section-title></span></span></span><span class=git-change-section-count>"),Ie=h('<span class="status-indicator session-status-list worktree-indicator git-change-section-badge"><span class=worktree-indicator-label>'),Me=h("<span class=files-tab-selected-path><span class=file-path-text>"),ke=h('<div class=files-tab-stats style="flex:0 0 auto"><span class="files-tab-stat files-tab-stat-additions"><span class=files-tab-stat-value>+</span></span><span class="files-tab-stat files-tab-stat-deletions"><span class=files-tab-stat-value>-'),Le=h("<button type=button class=files-header-icon-button style=margin-left:auto>"),Ee=h("<span class=text-error>");const Pe=oe(()=>se(()=>import("./monaco-viewer-YY9yfE-p.js").then(e=>e.ad),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.MonacoDiffViewer}))),Ke=e=>{const T=m(()=>e.activeSessionId()),W=m(()=>!!(T()&&T()!=="info")),A=m(()=>W()?e.entries():null),X=m(()=>{const o=A();return Array.isArray(o)?[...o].sort((d,x)=>String(d.path||"").localeCompare(String(x.path||""))):[]}),S=m(()=>ue(X())),Y=m(()=>S().reduce((o,d)=>(o.additions+=typeof d.additions=="number"?d.additions:0,o.deletions+=typeof d.deletions=="number"?d.deletions:0,o),{additions:0,deletions:0})),z=m(()=>S().filter(o=>o.section==="staged")),Z=m(()=>S().filter(o=>o.section==="unstaged")),p=m(()=>z().length>0&&e.commitMessage().trim().length>0&&!e.commitSubmitting()),ee=m(()=>{const o=S(),d=e.selectedItemId(),x=e.mostChangedItemId(),I=o.find(E=>E.id===d)||(x?o.find(E=>E.id===x):void 0);return(I==null?void 0:I.entry)??null}),D=m(()=>W()?A()===null?e.t("instanceShell.gitChanges.loading"):S().length===0?e.t("instanceShell.gitChanges.empty"):e.t("instanceShell.filesShell.viewerEmpty"):e.t("instanceShell.gitChanges.noSessionSelected")),te=m(()=>e.selectedError()===e.t("instanceShell.gitChanges.binaryViewer"));return R(()=>{const o=Y(),d=ee(),x=S(),I=z(),E=Z(),ne=()=>(()=>{var t=Ce(),l=t.firstChild;return n(l,r(w,{get when(){return e.selectedLoading()},get fallback(){return r(w,{get when(){return e.selectedError()},get fallback(){return r(w,{get when(){return R(()=>!!(d&&e.selectedBefore()!==null&&e.selectedAfter()!==null))()?{path:d.path,before:e.selectedBefore(),after:e.selectedAfter()}:null},get fallback(){return(()=>{var i=V(),s=i.firstChild;return n(s,D),i})()},children:i=>r(ce,{get fallback(){return(()=>{var s=V(),a=s.firstChild;return n(a,()=>e.t("instanceInfo.loading")),s})()},get children(){return r(Pe,{get scopeKey(){return e.scopeKey()},get path(){return String(i().path||"")},get before(){return String(i().before||"")},get after(){return String(i().after||"")},get viewMode(){return e.diffViewMode()},get contextMode(){return e.diffContextMode()},get wordWrap(){return e.diffWordWrapMode()},get insertContextLabel(){return e.t("instanceShell.gitChanges.actions.insertContext")},get onRequestInsertContext(){return te()?void 0:s=>{const a=e.selectedItemId();if(!a)return;const g=S().find(u=>u.id===a);g&&e.onInsertContext(g,s)}}})}})})},children:i=>(()=>{var s=V(),a=s.firstChild;return n(a,i),s})()})},get children(){var i=V(),s=i.firstChild;return n(s,()=>e.t("instanceInfo.loading")),i}})),t})(),ie=()=>(()=>{var t=$e();return n(t,D),t})(),B=t=>{const l=m(()=>e.selectedBulkItemIds().has(t.id)),i=t.section==="staged"?e.t("instanceShell.gitChanges.actions.unstage"):e.t("instanceShell.gitChanges.actions.stage"),s=()=>{t.section==="staged"?e.onUnstageFile(t):e.onStageFile(t)};return(()=>{var a=_e(),g=a.firstChild,u=g.firstChild,M=u.firstChild,v=u.nextSibling,$=v.firstChild,C=$.firstChild;C.firstChild;var _=C.nextSibling;_.firstChild;var P=g.nextSibling,f=P.firstChild,y=f.firstChild,k=y.firstChild;return k.firstChild,a.$$click=c=>e.onRowClick(t,c),a.$$mousedown=c=>{(c.shiftKey||c.ctrlKey||c.metaKey)&&c.preventDefault()},n(M,()=>t.path),n(C,()=>t.additions,null),n(_,()=>t.deletions,null),y.$$click=c=>{c.stopPropagation(),s()},b(y,"title",i),b(y,"aria-label",i),n(k,r(w,{get when(){return t.section!=="staged"},get children(){return be()}}),null),L(c=>{var G=`file-list-item git-change-list-item ${e.selectedItemId()===t.id?"file-list-item-active":""} ${l()?"git-change-list-item-bulk-selected":""}`,F=t.path,K=t.path,q=t.path,N=`git-change-row-action-glyph ${t.section==="staged"?"git-change-row-action-glyph-minus":"git-change-row-action-glyph-plus"}`;return G!==c.e&&H(a,c.e=G),F!==c.t&&b(a,"title",c.t=F),K!==c.a&&b(g,"title",c.a=K),q!==c.o&&b(u,"title",c.o=q),N!==c.i&&H(k,c.i=N),c},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),a})()},ae=(t,l,i,s)=>(()=>{var a=Se(),g=a.firstChild,u=g.firstChild,M=u.firstChild,v=M.nextSibling,$=u.nextSibling;return U(g,"click",s,!0),n(M,i?r(j,{class:"h-3.5 w-3.5"}):r(Q,{class:"h-3.5 w-3.5"})),n(v,t),n($,()=>l.length),n(a,r(w,{when:i,get children(){var C=we();return n(C,r(J,{each:l,children:_=>B(_)})),C}}),null),a})(),O=()=>r(w,{get when(){return x.length>0},get fallback(){return ie()},get children(){var t=xe(),l=t.firstChild,i=l.firstChild,s=i.firstChild,a=s.firstChild,g=a.nextSibling,u=g.firstChild,M=s.nextSibling;return U(i,"click",e.onToggleStagedOpen,!0),n(a,(()=>{var v=R(()=>!!e.stagedOpen());return()=>v()?r(j,{class:"h-3.5 w-3.5"}):r(Q,{class:"h-3.5 w-3.5"})})()),n(u,()=>e.t("instanceShell.gitChanges.sections.staged")),n(g,r(w,{get when(){return e.branchLabel()},children:v=>(()=>{var $=Ie(),C=$.firstChild;return n($,r(ve,{class:"w-3.5 h-3.5","aria-hidden":"true"}),C),n(C,v),L(()=>b($,"title",`Branch: ${v()}`)),$})()}),null),n(M,()=>I.length),n(l,r(w,{get when(){return e.stagedOpen()},get children(){var v=ye(),$=v.firstChild,C=$.firstChild,_=C.firstChild,P=_.nextSibling;return _.$$input=f=>e.onCommitMessageInput(f.currentTarget.value),P.$$click=()=>e.onSubmitCommit(),n(P,(()=>{var f=R(()=>!!e.commitSubmitting());return()=>f()?e.t("instanceShell.gitChanges.commit.submitting"):e.t("instanceShell.gitChanges.commit.submit")})()),n(v,r(J,{each:I,children:f=>B(f)}),null),L(f=>{var y=e.t("instanceShell.gitChanges.commit.placeholder"),k=!p();return y!==f.e&&b(_,"placeholder",f.e=y),k!==f.t&&(P.disabled=f.t=k),f},{e:void 0,t:void 0}),L(()=>_.value=e.commitMessage()),v}}),null),n(t,()=>ae(e.t("instanceShell.gitChanges.sections.unstaged"),E,e.unstagedOpen(),e.onToggleUnstagedOpen),null),t}});return r(ge,{get header(){return[(()=>{var t=Me(),l=t.firstChild;return n(l,()=>(d==null?void 0:d.path)||e.t("instanceShell.rightPanel.tabs.gitChanges")),L(()=>b(t,"title",(d==null?void 0:d.path)||e.t("instanceShell.rightPanel.tabs.gitChanges"))),t})(),(()=>{var t=ke(),l=t.firstChild,i=l.firstChild;i.firstChild;var s=l.nextSibling,a=s.firstChild;return a.firstChild,n(i,()=>o.additions,null),n(a,()=>o.deletions,null),n(t,r(w,{get when(){return e.statusError()},children:g=>(()=>{var u=Ee();return n(u,g),u})()}),null),t})(),(()=>{var t=Le();return t.$$click=()=>e.onRefresh(),n(t,r(fe,{get class(){return`h-4 w-4${e.statusLoading()?" animate-spin":""}`}})),L(l=>{var i=e.t("instanceShell.rightPanel.actions.refresh"),s=e.t("instanceShell.rightPanel.actions.refresh"),a=!W()||e.statusLoading()||A()===null;return i!==l.e&&b(t,"title",l.e=i),s!==l.t&&b(t,"aria-label",l.t=s),a!==l.a&&(t.disabled=l.a=a),l},{e:void 0,t:void 0,a:void 0}),t})(),r(de,{get viewMode(){return e.diffViewMode()},get contextMode(){return e.diffContextMode()},get wordWrapMode(){return e.diffWordWrapMode()},get onViewModeChange(){return e.onViewModeChange},get onContextModeChange(){return e.onContextModeChange},get onWordWrapModeChange(){return e.onWordWrapModeChange}})]},list:{panel:O,overlay:O},get viewer(){return ne()},get listOpen(){return e.listOpen()},get onToggleList(){return e.onToggleList},get splitWidth(){return e.splitWidth()},get onResizeMouseDown(){return e.onResizeMouseDown},get onResizeTouchStart(){return e.onResizeTouchStart},get isPhoneLayout(){return e.isPhoneLayout()},get overlayAriaLabel(){return e.t("instanceShell.rightPanel.tabs.gitChanges")}})})};le(["mousedown","click","input"]);export{Ke as default};
|
|
2
|
+
import{_ as se}from"./index-BCGPLzO4.js";import{m as R,t as h,i as n,d as b,h as U,a as H,f as le}from"./monaco-viewer-YY9yfE-p.js";import{n as r,m as re,c as m,a as L,S as w,F as J,z as ce,A as oe}from"./git-diff-vendor-CSgooKT_.js";import{D as de}from"./DiffToolbar-BYUtkOdF.js";import{S as ge}from"./SplitFilePanel-CA0D92l1.js";import{I as he,G as ue,R as fe,H as j,J as Q}from"./main-2ELpIX7K.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";import"./align-justify-DhnuvBq-.js";import"./wrap-text-YfDjYTh2.js";const me=[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]],ve=e=>r(he,re(e,{name:"GitBranch",iconNode:me}));var V=h("<div class=file-viewer-empty><span class=file-viewer-empty-text>"),Ce=h('<div class="file-viewer-panel flex-1"><div class="file-viewer-content file-viewer-content--monaco">'),$e=h('<div class="p-3 text-xs text-secondary">'),be=h('<span class="git-change-row-action-bar git-change-row-action-bar-vertical">'),_e=h('<div><div class=file-list-item-content><div class=file-list-item-path><span class=file-path-text></span></div><div class=git-change-list-item-right><div class=file-list-item-stats><span class=file-list-item-additions>+</span><span class=file-list-item-deletions>-</span></div></div></div><div class=git-change-list-item-actions-zone><div class=git-change-list-item-actions><button type=button class=git-change-row-action><span aria-hidden=true><span class="git-change-row-action-bar git-change-row-action-bar-horizontal">'),we=h("<div class=git-change-section-items>"),Se=h("<div class=git-change-section><button type=button class=git-change-section-header><span class=git-change-section-header-main><span class=git-change-section-chevron></span><span class=git-change-section-title></span></span><span class=git-change-section-count>"),ye=h('<div class=git-change-section-items><div class=git-change-commit-box><div class=git-change-commit-input-wrap><textarea class=git-change-commit-input rows=1></textarea><button type=button class="git-change-commit-button git-change-commit-button-overlay">'),xe=h("<div class=git-change-sections><div class=git-change-section><button type=button class=git-change-section-header><span class=git-change-section-header-main><span class=git-change-section-chevron></span><span class=git-change-section-title-row><span class=git-change-section-title></span></span></span><span class=git-change-section-count>"),Ie=h('<span class="status-indicator session-status-list worktree-indicator git-change-section-badge"><span class=worktree-indicator-label>'),Me=h("<span class=files-tab-selected-path><span class=file-path-text>"),ke=h('<div class=files-tab-stats style="flex:0 0 auto"><span class="files-tab-stat files-tab-stat-additions"><span class=files-tab-stat-value>+</span></span><span class="files-tab-stat files-tab-stat-deletions"><span class=files-tab-stat-value>-'),Le=h("<button type=button class=files-header-icon-button style=margin-left:auto>"),Ee=h("<span class=text-error>");const Pe=oe(()=>se(()=>import("./monaco-viewer-YY9yfE-p.js").then(e=>e.ad),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.MonacoDiffViewer}))),Ke=e=>{const T=m(()=>e.activeSessionId()),W=m(()=>!!(T()&&T()!=="info")),A=m(()=>W()?e.entries():null),X=m(()=>{const o=A();return Array.isArray(o)?[...o].sort((d,x)=>String(d.path||"").localeCompare(String(x.path||""))):[]}),S=m(()=>ue(X())),Y=m(()=>S().reduce((o,d)=>(o.additions+=typeof d.additions=="number"?d.additions:0,o.deletions+=typeof d.deletions=="number"?d.deletions:0,o),{additions:0,deletions:0})),z=m(()=>S().filter(o=>o.section==="staged")),Z=m(()=>S().filter(o=>o.section==="unstaged")),p=m(()=>z().length>0&&e.commitMessage().trim().length>0&&!e.commitSubmitting()),ee=m(()=>{const o=S(),d=e.selectedItemId(),x=e.mostChangedItemId(),I=o.find(E=>E.id===d)||(x?o.find(E=>E.id===x):void 0);return(I==null?void 0:I.entry)??null}),D=m(()=>W()?A()===null?e.t("instanceShell.gitChanges.loading"):S().length===0?e.t("instanceShell.gitChanges.empty"):e.t("instanceShell.filesShell.viewerEmpty"):e.t("instanceShell.gitChanges.noSessionSelected")),te=m(()=>e.selectedError()===e.t("instanceShell.gitChanges.binaryViewer"));return R(()=>{const o=Y(),d=ee(),x=S(),I=z(),E=Z(),ne=()=>(()=>{var t=Ce(),l=t.firstChild;return n(l,r(w,{get when(){return e.selectedLoading()},get fallback(){return r(w,{get when(){return e.selectedError()},get fallback(){return r(w,{get when(){return R(()=>!!(d&&e.selectedBefore()!==null&&e.selectedAfter()!==null))()?{path:d.path,before:e.selectedBefore(),after:e.selectedAfter()}:null},get fallback(){return(()=>{var i=V(),s=i.firstChild;return n(s,D),i})()},children:i=>r(ce,{get fallback(){return(()=>{var s=V(),a=s.firstChild;return n(a,()=>e.t("instanceInfo.loading")),s})()},get children(){return r(Pe,{get scopeKey(){return e.scopeKey()},get path(){return String(i().path||"")},get before(){return String(i().before||"")},get after(){return String(i().after||"")},get viewMode(){return e.diffViewMode()},get contextMode(){return e.diffContextMode()},get wordWrap(){return e.diffWordWrapMode()},get insertContextLabel(){return e.t("instanceShell.gitChanges.actions.insertContext")},get onRequestInsertContext(){return te()?void 0:s=>{const a=e.selectedItemId();if(!a)return;const g=S().find(u=>u.id===a);g&&e.onInsertContext(g,s)}}})}})})},children:i=>(()=>{var s=V(),a=s.firstChild;return n(a,i),s})()})},get children(){var i=V(),s=i.firstChild;return n(s,()=>e.t("instanceInfo.loading")),i}})),t})(),ie=()=>(()=>{var t=$e();return n(t,D),t})(),B=t=>{const l=m(()=>e.selectedBulkItemIds().has(t.id)),i=t.section==="staged"?e.t("instanceShell.gitChanges.actions.unstage"):e.t("instanceShell.gitChanges.actions.stage"),s=()=>{t.section==="staged"?e.onUnstageFile(t):e.onStageFile(t)};return(()=>{var a=_e(),g=a.firstChild,u=g.firstChild,M=u.firstChild,v=u.nextSibling,$=v.firstChild,C=$.firstChild;C.firstChild;var _=C.nextSibling;_.firstChild;var P=g.nextSibling,f=P.firstChild,y=f.firstChild,k=y.firstChild;return k.firstChild,a.$$click=c=>e.onRowClick(t,c),a.$$mousedown=c=>{(c.shiftKey||c.ctrlKey||c.metaKey)&&c.preventDefault()},n(M,()=>t.path),n(C,()=>t.additions,null),n(_,()=>t.deletions,null),y.$$click=c=>{c.stopPropagation(),s()},b(y,"title",i),b(y,"aria-label",i),n(k,r(w,{get when(){return t.section!=="staged"},get children(){return be()}}),null),L(c=>{var G=`file-list-item git-change-list-item ${e.selectedItemId()===t.id?"file-list-item-active":""} ${l()?"git-change-list-item-bulk-selected":""}`,F=t.path,K=t.path,q=t.path,N=`git-change-row-action-glyph ${t.section==="staged"?"git-change-row-action-glyph-minus":"git-change-row-action-glyph-plus"}`;return G!==c.e&&H(a,c.e=G),F!==c.t&&b(a,"title",c.t=F),K!==c.a&&b(g,"title",c.a=K),q!==c.o&&b(u,"title",c.o=q),N!==c.i&&H(k,c.i=N),c},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),a})()},ae=(t,l,i,s)=>(()=>{var a=Se(),g=a.firstChild,u=g.firstChild,M=u.firstChild,v=M.nextSibling,$=u.nextSibling;return U(g,"click",s,!0),n(M,i?r(j,{class:"h-3.5 w-3.5"}):r(Q,{class:"h-3.5 w-3.5"})),n(v,t),n($,()=>l.length),n(a,r(w,{when:i,get children(){var C=we();return n(C,r(J,{each:l,children:_=>B(_)})),C}}),null),a})(),O=()=>r(w,{get when(){return x.length>0},get fallback(){return ie()},get children(){var t=xe(),l=t.firstChild,i=l.firstChild,s=i.firstChild,a=s.firstChild,g=a.nextSibling,u=g.firstChild,M=s.nextSibling;return U(i,"click",e.onToggleStagedOpen,!0),n(a,(()=>{var v=R(()=>!!e.stagedOpen());return()=>v()?r(j,{class:"h-3.5 w-3.5"}):r(Q,{class:"h-3.5 w-3.5"})})()),n(u,()=>e.t("instanceShell.gitChanges.sections.staged")),n(g,r(w,{get when(){return e.branchLabel()},children:v=>(()=>{var $=Ie(),C=$.firstChild;return n($,r(ve,{class:"w-3.5 h-3.5","aria-hidden":"true"}),C),n(C,v),L(()=>b($,"title",`Branch: ${v()}`)),$})()}),null),n(M,()=>I.length),n(l,r(w,{get when(){return e.stagedOpen()},get children(){var v=ye(),$=v.firstChild,C=$.firstChild,_=C.firstChild,P=_.nextSibling;return _.$$input=f=>e.onCommitMessageInput(f.currentTarget.value),P.$$click=()=>e.onSubmitCommit(),n(P,(()=>{var f=R(()=>!!e.commitSubmitting());return()=>f()?e.t("instanceShell.gitChanges.commit.submitting"):e.t("instanceShell.gitChanges.commit.submit")})()),n(v,r(J,{each:I,children:f=>B(f)}),null),L(f=>{var y=e.t("instanceShell.gitChanges.commit.placeholder"),k=!p();return y!==f.e&&b(_,"placeholder",f.e=y),k!==f.t&&(P.disabled=f.t=k),f},{e:void 0,t:void 0}),L(()=>_.value=e.commitMessage()),v}}),null),n(t,()=>ae(e.t("instanceShell.gitChanges.sections.unstaged"),E,e.unstagedOpen(),e.onToggleUnstagedOpen),null),t}});return r(ge,{get header(){return[(()=>{var t=Me(),l=t.firstChild;return n(l,()=>(d==null?void 0:d.path)||e.t("instanceShell.rightPanel.tabs.gitChanges")),L(()=>b(t,"title",(d==null?void 0:d.path)||e.t("instanceShell.rightPanel.tabs.gitChanges"))),t})(),(()=>{var t=ke(),l=t.firstChild,i=l.firstChild;i.firstChild;var s=l.nextSibling,a=s.firstChild;return a.firstChild,n(i,()=>o.additions,null),n(a,()=>o.deletions,null),n(t,r(w,{get when(){return e.statusError()},children:g=>(()=>{var u=Ee();return n(u,g),u})()}),null),t})(),(()=>{var t=Le();return t.$$click=()=>e.onRefresh(),n(t,r(fe,{get class(){return`h-4 w-4${e.statusLoading()?" animate-spin":""}`}})),L(l=>{var i=e.t("instanceShell.rightPanel.actions.refresh"),s=e.t("instanceShell.rightPanel.actions.refresh"),a=!W()||e.statusLoading()||A()===null;return i!==l.e&&b(t,"title",l.e=i),s!==l.t&&b(t,"aria-label",l.t=s),a!==l.a&&(t.disabled=l.a=a),l},{e:void 0,t:void 0,a:void 0}),t})(),r(de,{get viewMode(){return e.diffViewMode()},get contextMode(){return e.diffContextMode()},get wordWrapMode(){return e.diffWordWrapMode()},get onViewModeChange(){return e.onViewModeChange},get onContextModeChange(){return e.onContextModeChange},get onWordWrapModeChange(){return e.onWordWrapModeChange}})]},list:{panel:O,overlay:O},get viewer(){return ne()},get listOpen(){return e.listOpen()},get onToggleList(){return e.onToggleList},get splitWidth(){return e.splitWidth()},get onResizeMouseDown(){return e.onResizeMouseDown},get onResizeTouchStart(){return e.onResizeTouchStart},get isPhoneLayout(){return e.isPhoneLayout()},get overlayAriaLabel(){return e.t("instanceShell.rightPanel.tabs.gitChanges")}})})};le(["mousedown","click","input"]);export{Ke as default};
|