@neuralnomads/codenomad-dev 0.13.3-dev-20260405-403a3ff1 → 0.13.3-dev-20260409-0ef57df3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/dist/background-processes/manager.js +164 -25
  2. package/dist/opencode-config/plugin/lib/background-process.ts +14 -2
  3. package/dist/server/routes/background-processes.js +19 -1
  4. package/package.json +1 -1
  5. package/public/assets/ChangesTab-DzF8BErb.js +2 -0
  6. package/public/assets/{DiffToolbar-BAqvjGMM.js → DiffToolbar-Djf4opPv.js} +1 -1
  7. package/public/assets/{FilesTab-BnSYu5eZ.js → FilesTab-DDIL9JPH.js} +2 -2
  8. package/public/assets/{GitChangesTab-KyANcfGR.js → GitChangesTab-BVSauxNO.js} +2 -2
  9. package/public/assets/{SplitFilePanel-CJZ8TIzk.js → SplitFilePanel-BFobT5PM.js} +1 -1
  10. package/public/assets/StatusTab-Crp2blnK.js +1 -0
  11. package/public/assets/{bundle-full-D-PJ737v.js → bundle-full-CLbXuul1.js} +1 -1
  12. package/public/assets/diff-viewer-DvSrWObE.js +1 -0
  13. package/public/assets/index-5nPz_bY0.js +1 -0
  14. package/public/assets/index-BH-1Bh5Y.js +1 -0
  15. package/public/assets/index-BWiPuI0N.js +1 -0
  16. package/public/assets/index-BcZbY-A3.js +2 -0
  17. package/public/assets/index-BqP0tHQ0.js +1 -0
  18. package/public/assets/index-C6I7WSb7.js +1 -0
  19. package/public/assets/{index-1jZG0xMR.js → index-CFuAuE1e.js} +1 -1
  20. package/public/assets/{index-B-S2eiTI.js → index-CMh4RuTd.js} +1 -1
  21. package/public/assets/index-DdQMxpGQ.js +1 -0
  22. package/public/assets/{loading-DAzqh5qY.js → loading-Ch5qXnEp.js} +1 -1
  23. package/public/assets/main-zsdi8JzY.js +52 -0
  24. package/public/assets/{markdown-S4S791Uz.js → markdown-LGa--AVk.js} +3 -3
  25. package/public/assets/{monaco-viewer-C7NpFe3J.js → monaco-viewer-Bxr3Yl9j.js} +15 -5
  26. package/public/assets/{todo-CExSzssd.js → todo-_i0FVuIM.js} +1 -1
  27. package/public/assets/{tool-call-BXdKi8DT.js → tool-call-RA-xhZx3.js} +3 -3
  28. package/public/assets/{unified-picker-DXZD_cM6.js → unified-picker-DGoHbQjU.js} +1 -1
  29. package/public/assets/{wrap-text-DAgGusLM.js → wrap-text-DdRZJaCp.js} +1 -1
  30. package/public/index.html +3 -3
  31. package/public/loading.html +3 -3
  32. package/public/sw.js +1 -1
  33. package/public/assets/ChangesTab-BBCh2sNB.js +0 -2
  34. package/public/assets/StatusTab-B2A4cYum.js +0 -1
  35. package/public/assets/diff-viewer-C2H3ewsc.js +0 -1
  36. package/public/assets/index-B08PHYpV.js +0 -1
  37. package/public/assets/index-BFhdUjhW.js +0 -2
  38. package/public/assets/index-BOu7ZL6i.js +0 -1
  39. package/public/assets/index-C5NlVYv4.js +0 -1
  40. package/public/assets/index-C9umHWb3.js +0 -1
  41. package/public/assets/index-LY95W8DU.js +0 -1
  42. package/public/assets/index-WzRtEG4k.js +0 -1
  43. package/public/assets/main-UDLNq9xC.js +0 -56
@@ -19,12 +19,12 @@ export class BackgroundProcessManager {
19
19
  async list(workspaceId) {
20
20
  const records = await this.readIndex(workspaceId);
21
21
  const enriched = await Promise.all(records.map(async (record) => ({
22
- ...record,
22
+ ...this.toPublicProcess(record),
23
23
  outputSizeBytes: await this.getOutputSize(workspaceId, record.id),
24
24
  })));
25
25
  return enriched;
26
26
  }
27
- async start(workspaceId, title, command) {
27
+ async start(workspaceId, title, command, options = {}) {
28
28
  const workspace = this.deps.workspaceManager.get(workspaceId);
29
29
  if (!workspace) {
30
30
  throw new Error("Workspace not found");
@@ -53,21 +53,35 @@ export class BackgroundProcessManager {
53
53
  pid: child.pid,
54
54
  startedAt: new Date().toISOString(),
55
55
  outputSizeBytes: 0,
56
+ notify: options.notify && options.notification
57
+ ? {
58
+ sessionID: options.notification.sessionID,
59
+ directory: options.notification.directory,
60
+ }
61
+ : undefined,
62
+ };
63
+ const runningState = {
64
+ id,
65
+ child,
66
+ outputPath,
67
+ exitPromise: Promise.resolve(),
68
+ workspaceId,
56
69
  };
57
70
  const exitPromise = new Promise((resolve) => {
58
71
  child.on("close", async (code) => {
59
72
  await new Promise((resolve) => outputStream.end(resolve));
60
73
  this.running.delete(id);
61
- record.status = this.statusFromExit(code);
74
+ const completion = runningState.completion ?? this.completionFromExit(code);
75
+ record.terminalReason = completion.reason;
76
+ record.status = this.statusFromReason(completion.reason);
62
77
  record.exitCode = code === null ? undefined : code;
63
78
  record.stoppedAt = new Date().toISOString();
64
- await this.upsertIndex(workspaceId, record);
65
- record.outputSizeBytes = await this.getOutputSize(workspaceId, record.id);
66
- this.publishUpdate(workspaceId, record);
79
+ await this.finalizeRecord(workspaceId, record, completion);
67
80
  resolve();
68
81
  });
69
82
  });
70
- this.running.set(id, { id, child, outputPath, exitPromise, workspaceId });
83
+ runningState.exitPromise = exitPromise;
84
+ this.running.set(id, runningState);
71
85
  let lastPublishAt = 0;
72
86
  const maybePublishSize = () => {
73
87
  const now = Date.now();
@@ -90,7 +104,7 @@ export class BackgroundProcessManager {
90
104
  await this.upsertIndex(workspaceId, record);
91
105
  record.outputSizeBytes = await this.getOutputSize(workspaceId, record.id);
92
106
  this.publishUpdate(workspaceId, record);
93
- return record;
107
+ return this.toPublicProcess(record);
94
108
  }
95
109
  async stop(workspaceId, processId) {
96
110
  const record = await this.findProcess(workspaceId, processId);
@@ -99,17 +113,19 @@ export class BackgroundProcessManager {
99
113
  }
100
114
  const running = this.running.get(processId);
101
115
  if (running?.child && !running.child.killed) {
116
+ running.completion = { reason: "user_stopped", endContext: "normal" };
102
117
  this.killProcessTree(running.child, "SIGTERM");
103
118
  await this.waitForExit(running);
119
+ const updated = await this.findProcess(workspaceId, processId);
120
+ return updated ? this.toPublicProcess(updated) : this.toPublicProcess(record);
104
121
  }
105
122
  if (record.status === "running") {
106
123
  record.status = "stopped";
124
+ record.terminalReason = "user_stopped";
107
125
  record.stoppedAt = new Date().toISOString();
108
- await this.upsertIndex(workspaceId, record);
109
- record.outputSizeBytes = await this.getOutputSize(workspaceId, record.id);
110
- this.publishUpdate(workspaceId, record);
126
+ await this.finalizeRecord(workspaceId, record, { reason: "user_stopped", endContext: "normal" });
111
127
  }
112
- return record;
128
+ return this.toPublicProcess(record);
113
129
  }
114
130
  async terminate(workspaceId, processId) {
115
131
  const record = await this.findProcess(workspaceId, processId);
@@ -117,15 +133,18 @@ export class BackgroundProcessManager {
117
133
  return;
118
134
  const running = this.running.get(processId);
119
135
  if (running?.child && !running.child.killed) {
136
+ running.completion = { reason: "user_terminated", endContext: "normal", removeAfterFinalize: true };
120
137
  this.killProcessTree(running.child, "SIGTERM");
121
138
  await this.waitForExit(running);
139
+ return;
122
140
  }
123
- await this.removeFromIndex(workspaceId, processId);
124
- await this.removeProcessDir(workspaceId, processId);
125
- this.deps.eventBus.publish({
126
- type: "instance.event",
127
- instanceId: workspaceId,
128
- event: { type: "background.process.removed", properties: { processId } },
141
+ record.status = "stopped";
142
+ record.terminalReason = "user_terminated";
143
+ record.stoppedAt = new Date().toISOString();
144
+ await this.finalizeRecord(workspaceId, record, {
145
+ reason: "user_terminated",
146
+ endContext: "normal",
147
+ removeAfterFinalize: true,
129
148
  });
130
149
  }
131
150
  async readOutput(workspaceId, processId, options) {
@@ -204,6 +223,11 @@ export class BackgroundProcessManager {
204
223
  for (const [, running] of this.running.entries()) {
205
224
  if (running.workspaceId !== workspaceId)
206
225
  continue;
226
+ running.completion = {
227
+ reason: "user_terminated",
228
+ endContext: "workspace_cleanup",
229
+ removeAfterFinalize: true,
230
+ };
207
231
  this.killProcessTree(running.child, "SIGTERM");
208
232
  await this.waitForExit(running);
209
233
  }
@@ -287,12 +311,16 @@ export class BackgroundProcessManager {
287
311
  }
288
312
  return args;
289
313
  }
290
- statusFromExit(code) {
291
- if (code === null)
292
- return "stopped";
293
- if (code === 0)
294
- return "stopped";
295
- return "error";
314
+ completionFromExit(code) {
315
+ if (code === 0) {
316
+ return { reason: "finished", endContext: "normal" };
317
+ }
318
+ return { reason: "failed", endContext: "normal" };
319
+ }
320
+ statusFromReason(reason) {
321
+ if (reason === "failed")
322
+ return "error";
323
+ return "stopped";
296
324
  }
297
325
  async readOutputBytes(outputPath, sizeBytes, maxBytes) {
298
326
  if (maxBytes === undefined || sizeBytes <= maxBytes) {
@@ -426,8 +454,119 @@ export class BackgroundProcessManager {
426
454
  this.deps.eventBus.publish({
427
455
  type: "instance.event",
428
456
  instanceId: workspaceId,
429
- event: { type: "background.process.updated", properties: { process: record } },
457
+ event: { type: "background.process.updated", properties: { process: this.toPublicProcess(record) } },
458
+ });
459
+ }
460
+ toPublicProcess(record) {
461
+ return {
462
+ id: record.id,
463
+ workspaceId: record.workspaceId,
464
+ title: record.title,
465
+ command: record.command,
466
+ cwd: record.cwd,
467
+ status: record.status,
468
+ pid: record.pid,
469
+ startedAt: record.startedAt,
470
+ stoppedAt: record.stoppedAt,
471
+ exitCode: record.exitCode,
472
+ outputSizeBytes: record.outputSizeBytes,
473
+ terminalReason: record.terminalReason,
474
+ notifyEnabled: Boolean(record.notify),
475
+ };
476
+ }
477
+ async finalizeRecord(workspaceId, record, completion) {
478
+ if (this.shouldSendCompletionPrompt(record, completion)) {
479
+ try {
480
+ await this.sendCompletionPrompt(workspaceId, record);
481
+ if (record.notify) {
482
+ record.notify.sentAt = new Date().toISOString();
483
+ }
484
+ }
485
+ catch (error) {
486
+ this.deps.logger.warn({ err: error, workspaceId, processId: record.id }, "Failed to send background process completion prompt");
487
+ }
488
+ }
489
+ if (completion.removeAfterFinalize) {
490
+ await this.removeFromIndex(workspaceId, record.id);
491
+ await this.removeProcessDir(workspaceId, record.id);
492
+ this.deps.eventBus.publish({
493
+ type: "instance.event",
494
+ instanceId: workspaceId,
495
+ event: { type: "background.process.removed", properties: { processId: record.id } },
496
+ });
497
+ return;
498
+ }
499
+ await this.upsertIndex(workspaceId, record);
500
+ record.outputSizeBytes = await this.getOutputSize(workspaceId, record.id);
501
+ this.publishUpdate(workspaceId, record);
502
+ }
503
+ shouldSendCompletionPrompt(record, completion) {
504
+ if (completion.endContext === "workspace_cleanup")
505
+ return false;
506
+ if (!record.notify)
507
+ return false;
508
+ return !record.notify.sentAt;
509
+ }
510
+ async sendCompletionPrompt(workspaceId, record) {
511
+ const notify = record.notify;
512
+ if (!notify || !record.terminalReason)
513
+ return;
514
+ if (!this.deps.workspaceManager.get(workspaceId)) {
515
+ throw new Error("Workspace not found");
516
+ }
517
+ const port = this.deps.workspaceManager.getInstancePort(workspaceId);
518
+ if (!port) {
519
+ throw new Error("Workspace instance is not ready");
520
+ }
521
+ const targetUrl = `http://127.0.0.1:${port}/session/${encodeURIComponent(notify.sessionID)}/prompt_async`;
522
+ const headers = {
523
+ "content-type": "application/json",
524
+ "x-opencode-directory": /[^\x00-\x7F]/.test(notify.directory) ? encodeURIComponent(notify.directory) : notify.directory,
525
+ };
526
+ const authorization = this.deps.workspaceManager.getInstanceAuthorizationHeader(workspaceId);
527
+ if (authorization) {
528
+ headers.authorization = authorization;
529
+ }
530
+ const response = await fetch(targetUrl, {
531
+ method: "POST",
532
+ headers,
533
+ body: JSON.stringify({
534
+ parts: [
535
+ {
536
+ type: "text",
537
+ text: this.buildSyntheticCompletionPrompt(record),
538
+ synthetic: true,
539
+ },
540
+ ],
541
+ }),
430
542
  });
543
+ if (!response.ok) {
544
+ const message = await response.text().catch(() => "");
545
+ throw new Error(message || `Prompt request failed with ${response.status}`);
546
+ }
547
+ }
548
+ buildCompletionPrompt(record) {
549
+ const ref = `Background process "${record.title}" (${record.id})`;
550
+ switch (record.terminalReason) {
551
+ case "finished":
552
+ return `${ref} finished successfully.`;
553
+ case "failed":
554
+ return record.exitCode === undefined ? `${ref} failed.` : `${ref} failed with exit code ${record.exitCode}.`;
555
+ case "user_stopped":
556
+ return `${ref} was stopped by user.`;
557
+ case "user_terminated":
558
+ return `${ref} was terminated by user.`;
559
+ }
560
+ return `${ref} ended.`;
561
+ }
562
+ buildSyntheticCompletionPrompt(record) {
563
+ return `<system-message>${this.escapeTaggedText(this.buildCompletionPrompt(record))}</system-message>`;
564
+ }
565
+ escapeTaggedText(input) {
566
+ return input
567
+ .replace(/&/g, "&amp;")
568
+ .replace(/</g, "&lt;")
569
+ .replace(/>/g, "&gt;");
431
570
  }
432
571
  generateId() {
433
572
  const timestamp = new Date().toISOString().replace(/[:.]/g, "").slice(0, 15);
@@ -13,6 +13,11 @@ type BackgroundProcess = {
13
13
  outputSizeBytes?: number
14
14
  }
15
15
 
16
+ type BackgroundProcessNotificationRequest = {
17
+ sessionID: string
18
+ directory: string
19
+ }
20
+
16
21
  type BackgroundProcessOptions = {
17
22
  baseDir: string
18
23
  }
@@ -36,12 +41,19 @@ export function createBackgroundProcessTools(config: CodeNomadConfig, options: B
36
41
  args: {
37
42
  title: tool.schema.string().describe("Short label for the process (e.g. Dev server, DB server)"),
38
43
  command: tool.schema.string().describe("Shell command to run in the workspace"),
44
+ notify: tool.schema.boolean().optional().describe("Notify the current session when the process ends"),
39
45
  },
40
- async execute(args) {
46
+ async execute(args, context) {
41
47
  assertCommandWithinBase(args.command, options.baseDir)
48
+ const notification: BackgroundProcessNotificationRequest | undefined = args.notify
49
+ ? {
50
+ sessionID: context.sessionID,
51
+ directory: context.directory,
52
+ }
53
+ : undefined
42
54
  const process = await request<BackgroundProcess>("", {
43
55
  method: "POST",
44
- body: JSON.stringify({ title: args.title, command: args.command }),
56
+ body: JSON.stringify({ title: args.title, command: args.command, notify: args.notify, notification }),
45
57
  })
46
58
 
47
59
  return `Started background process ${process.id} (${process.title})\nStatus: ${process.status}\nCommand: ${process.command}`
@@ -2,6 +2,21 @@ import { z } from "zod";
2
2
  const StartSchema = z.object({
3
3
  title: z.string().trim().min(1),
4
4
  command: z.string().trim().min(1),
5
+ notify: z.boolean().optional(),
6
+ notification: z
7
+ .object({
8
+ sessionID: z.string().trim().min(1),
9
+ directory: z.string().trim().min(1),
10
+ })
11
+ .optional(),
12
+ }).superRefine((value, ctx) => {
13
+ if (value.notify && !value.notification) {
14
+ ctx.addIssue({
15
+ code: z.ZodIssueCode.custom,
16
+ message: "Notification metadata is required when notify is enabled",
17
+ path: ["notification"],
18
+ });
19
+ }
5
20
  });
6
21
  const OutputQuerySchema = z.object({
7
22
  method: z.enum(["full", "tail", "head", "grep"]).optional(),
@@ -17,7 +32,10 @@ export function registerBackgroundProcessRoutes(app, deps) {
17
32
  });
18
33
  app.post("/workspaces/:id/plugin/background-processes", async (request, reply) => {
19
34
  const payload = StartSchema.parse(request.body ?? {});
20
- const process = await deps.backgroundProcessManager.start(request.params.id, payload.title, payload.command);
35
+ const process = await deps.backgroundProcessManager.start(request.params.id, payload.title, payload.command, {
36
+ notify: payload.notify,
37
+ notification: payload.notification,
38
+ });
21
39
  reply.code(201);
22
40
  return process;
23
41
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neuralnomads/codenomad-dev",
3
- "version": "0.13.3-dev-20260405-403a3ff1",
3
+ "version": "0.13.3-dev-20260409-0ef57df3",
4
4
  "description": "CodeNomad Server",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-viewer-Bxr3Yl9j.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-BcZbY-A3.js";import{m as B,t as g,i as a,d as w,a as F,f as N}from"./monaco-viewer-Bxr3Yl9j.js";import{c as f,n as c,a as L,F as T,S as W,z as j,A as q}from"./git-diff-vendor-CSgooKT_.js";import{D as G}from"./DiffToolbar-Djf4opPv.js";import{S as H}from"./SplitFilePanel-BFobT5PM.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";import"./main-zsdi8JzY.js";import"./wrap-text-DdRZJaCp.js";var J=g('<div class="file-viewer-panel flex-1"><div class="file-viewer-content file-viewer-content--monaco">'),p=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-Bxr3Yl9j.js").then(e=>e.ad),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.MonacoDiffViewer}))),fe=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=p(),s=d.firstChild;return a(s,V),d})()},children:d=>c(j,{get fallback(){return(()=>{var s=p(),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(T,{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&&F(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(T,{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,z=t.file;return _!==o.e&&F(r,o.e=_),$!==o.t&&w(r,"title",o.t=$),z!==o.a&&w(s,"title",o.a=z),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{fe 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-C7NpFe3J.js";import{u as T}from"./index-BFhdUjhW.js";import{n as o,m as $,a as V}from"./git-diff-vendor-CSgooKT_.js";import{I as U,S as A,O as I}from"./main-UDLNq9xC.js";import{A as D,W as E}from"./wrap-text-DAgGusLM.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 R=t=>{const{t:a}=T(),r=()=>t.viewMode==="split"?"unified":"split",s=()=>t.contextMode==="collapsed"?"expanded":"collapsed",h=()=>t.wordWrapMode==="on"?"off":"on",f=()=>r()==="split"?a("instanceShell.diff.switchToSplit"):a("instanceShell.diff.switchToUnified"),v=()=>s()==="collapsed"?a("instanceShell.diff.hideUnchanged"):a("instanceShell.diff.showFull"),u=()=>h()==="on"?a("instanceShell.diff.enableWordWrap"):a("instanceShell.diff.disableWordWrap");return(()=>{var b=N(),n=b.firstChild,l=n.nextSibling,d=l.nextSibling;return n.$$click=()=>t.onViewModeChange(r()),c(n,(()=>{var e=W(()=>r()==="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"})})()),d.$$click=()=>t.onWordWrapModeChange(h()),c(d,o(E,{class:"h-4 w-4","aria-hidden":"true"})),V(e=>{var m=f(),w=f(),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(d,e.i=x),k!==e.n&&i(d,"aria-label",e.n=k),y!==e.s&&i(d,"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{R as D};
1
+ import{t as g,i as c,m as W,d as i,a as S,f as C}from"./monaco-viewer-Bxr3Yl9j.js";import{u as T}from"./index-BcZbY-A3.js";import{n as o,m as $,a as V}from"./git-diff-vendor-CSgooKT_.js";import{I as U,S as A,O as I}from"./main-zsdi8JzY.js";import{A as D,W as E}from"./wrap-text-DdRZJaCp.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 R=t=>{const{t:a}=T(),r=()=>t.viewMode==="split"?"unified":"split",s=()=>t.contextMode==="collapsed"?"expanded":"collapsed",h=()=>t.wordWrapMode==="on"?"off":"on",f=()=>r()==="split"?a("instanceShell.diff.switchToSplit"):a("instanceShell.diff.switchToUnified"),v=()=>s()==="collapsed"?a("instanceShell.diff.hideUnchanged"):a("instanceShell.diff.showFull"),u=()=>h()==="on"?a("instanceShell.diff.enableWordWrap"):a("instanceShell.diff.disableWordWrap");return(()=>{var b=N(),n=b.firstChild,l=n.nextSibling,d=l.nextSibling;return n.$$click=()=>t.onViewModeChange(r()),c(n,(()=>{var e=W(()=>r()==="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"})})()),d.$$click=()=>t.onWordWrapModeChange(h()),c(d,o(E,{class:"h-4 w-4","aria-hidden":"true"})),V(e=>{var m=f(),w=f(),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(d,e.i=x),k!==e.n&&i(d,"aria-label",e.n=k),y!==e.s&&i(d,"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{R as D};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-viewer-C7NpFe3J.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 R}from"./index-BFhdUjhW.js";import{m as _,t as c,i as s,d as o,a as z,f as I}from"./monaco-viewer-C7NpFe3J.js";import{n as i,m as D,S as d,a as v,F,z as V,A as M}from"./git-diff-vendor-CSgooKT_.js";import{S as T}from"./SplitFilePanel-CJZ8TIzk.js";import{I as A,R as y}from"./main-UDLNq9xC.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";const O=[["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"}]],q=e=>i(A,D(e,{name:"Save",iconNode:O}));var g=c("<div class=file-viewer-empty><span class=file-viewer-empty-text>"),K=c('<div class="file-viewer-panel flex-1"><div class="file-viewer-content file-viewer-content--monaco">'),N=c('<div class="p-3 text-xs text-secondary">'),W=c("<div class=file-list-item><div class=file-list-item-content><div class=file-list-item-path><span class=file-path-text>.."),H=c('<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="text-[10px] text-secondary">'),j=c("<span>"),B=c("<div class=files-tab-stats><span class=files-tab-stat><span class=files-tab-selected-path><span class=file-path-text>"),G=c("<button type=button class=files-header-icon-button style=margin-inline-start:auto>"),J=c("<button type=button class=files-header-icon-button>"),Q=c("<span class=text-error>");const U=M(()=>R(()=>import("./monaco-viewer-C7NpFe3J.js").then(e=>e.ac),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.MonacoFileViewer}))),ae=e=>{const C=()=>{const h=e.browserSelectedContent();h!=null&&e.onSave(h)};return _(()=>{const h=e.browserEntries(),P=[...h||[]].sort((t,n)=>{const r=t.type==="directory"?0:1,l=n.type==="directory"?0:1;return r!==l?r-l:String(t.name||"").localeCompare(String(n.name||""))}),L=e.parentPath(),w=()=>e.browserSelectedPath()||e.browserPath(),x=()=>e.browserLoading()&&h===null?e.t("instanceInfo.loading"):e.t("instanceShell.filesShell.viewerEmpty"),k=()=>(()=>{var t=K(),n=t.firstChild;return s(n,i(d,{get when(){return e.browserSelectedLoading()},get fallback(){return i(d,{get when(){return e.browserSelectedError()},get fallback(){return i(d,{get when(){return _(()=>!!(e.browserSelectedPath()&&e.browserSelectedContent()!==null))()?{path:e.browserSelectedPath(),content:e.browserSelectedContent()}:null},get fallback(){return(()=>{var r=g(),l=r.firstChild;return s(l,x),r})()},children:r=>i(V,{get fallback(){return(()=>{var l=g(),a=l.firstChild;return s(a,()=>e.t("instanceInfo.loading")),l})()},get children(){return i(U,{get scopeKey(){return e.scopeKey()},get path(){return r().path},get content(){return r().content},get onSave(){return e.onSave},get onContentChange(){return e.onContentChange}})}})})},children:r=>(()=>{var l=g(),a=l.firstChild;return s(a,r),l})()})},get children(){var r=g(),l=r.firstChild;return s(l,()=>e.t("instanceInfo.loading")),r}})),t})(),m=()=>[i(d,{when:L,children:t=>(()=>{var n=W(),r=n.firstChild,l=r.firstChild;return n.$$click=()=>e.onLoadEntries(t()),v(()=>o(l,"title",t())),n})()}),i(d,{get when(){return e.browserLoading()&&h===null},get children(){var t=N();return s(t,()=>e.t("instanceInfo.loading")),t}}),i(F,{each:P,children:t=>(()=>{var n=H(),r=n.firstChild,l=r.firstChild,a=l.firstChild,f=l.nextSibling,E=f.firstChild;return n.$$click=()=>{if(t.type==="directory"){e.onLoadEntries(t.path);return}e.onRequestOpenFile(t.path)},s(a,()=>t.name),s(E,()=>t.type),v(u=>{var b=`file-list-item ${e.browserSelectedPath()===t.path?"file-list-item-active":""}`,S=t.path,$=t.path;return b!==u.e&&z(n,u.e=b),S!==u.t&&o(n,"title",u.t=S),$!==u.a&&o(l,"title",u.a=$),u},{e:void 0,t:void 0,a:void 0}),n})()})];return i(T,{get header(){return[(()=>{var t=B(),n=t.firstChild,r=n.firstChild,l=r.firstChild;return s(l,w),s(t,i(d,{get when(){return e.browserLoading()},get children(){var a=j();return s(a,()=>e.t("instanceInfo.loading")),a}}),null),s(t,i(d,{get when(){return e.browserError()},children:a=>(()=>{var f=Q();return s(f,a),f})()}),null),v(()=>o(r,"title",w())),t})(),(()=>{var t=G();return t.$$click=C,s(t,i(d,{get when(){return e.browserSelectedSaving()},get fallback(){return i(q,{class:"h-4 w-4"})},get children(){return i(y,{class:"h-4 w-4 animate-spin"})}})),v(n=>{var r=e.t("instanceShell.rightPanel.actions.save")||"Save (Ctrl+S)",l=e.t("instanceShell.rightPanel.actions.save")||"Save",a=e.browserSelectedSaving()||!e.browserSelectedDirty();return r!==n.e&&o(t,"title",n.e=r),l!==n.t&&o(t,"aria-label",n.t=l),a!==n.a&&(t.disabled=n.a=a),n},{e:void 0,t:void 0,a:void 0}),t})(),(()=>{var t=J();return t.$$click=()=>e.onRefresh(),s(t,i(y,{get class(){return`h-4 w-4${e.browserLoading()?" animate-spin":""}`}})),v(n=>{var r=e.t("instanceShell.rightPanel.actions.refresh"),l=e.t("instanceShell.rightPanel.actions.refresh"),a=e.browserLoading();return r!==n.e&&o(t,"title",n.e=r),l!==n.t&&o(t,"aria-label",n.t=l),a!==n.a&&(t.disabled=n.a=a),n},{e:void 0,t:void 0,a:void 0}),t})()]},list:{panel:m,overlay:m},get viewer(){return k()},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")}})})};I(["click"]);export{ae as default};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-viewer-Bxr3Yl9j.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 R}from"./index-BcZbY-A3.js";import{m as _,t as o,i as s,d as c,a as z,f as I}from"./monaco-viewer-Bxr3Yl9j.js";import{n as i,m as D,S as d,a as v,F,z as V,A as M}from"./git-diff-vendor-CSgooKT_.js";import{S as T}from"./SplitFilePanel-BFobT5PM.js";import{I as A,R as y}from"./main-zsdi8JzY.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";const O=[["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"}]],q=e=>i(A,D(e,{name:"Save",iconNode:O}));var g=o("<div class=file-viewer-empty><span class=file-viewer-empty-text>"),K=o('<div class="file-viewer-panel flex-1"><div class="file-viewer-content file-viewer-content--monaco">'),N=o('<div class="p-3 text-xs text-secondary">'),W=o("<div class=file-list-item><div class=file-list-item-content><div class=file-list-item-path><span class=file-path-text>.."),H=o('<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="text-[10px] text-secondary">'),j=o("<span>"),B=o("<div class=files-tab-stats><span class=files-tab-stat><span class=files-tab-selected-path><span class=file-path-text>"),G=o("<button type=button class=files-header-icon-button style=margin-inline-start:auto>"),J=o("<button type=button class=files-header-icon-button>"),Q=o("<span class=text-error>");const U=M(()=>R(()=>import("./monaco-viewer-Bxr3Yl9j.js").then(e=>e.ae),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.MonacoFileViewer}))),ae=e=>{const C=()=>{const h=e.browserSelectedContent();h!=null&&e.onSave(h)};return _(()=>{const h=e.browserEntries(),P=[...h||[]].sort((t,n)=>{const r=t.type==="directory"?0:1,l=n.type==="directory"?0:1;return r!==l?r-l:String(t.name||"").localeCompare(String(n.name||""))}),L=e.parentPath(),w=()=>e.browserSelectedPath()||e.browserPath(),x=()=>e.browserLoading()&&h===null?e.t("instanceInfo.loading"):e.t("instanceShell.filesShell.viewerEmpty"),k=()=>(()=>{var t=K(),n=t.firstChild;return s(n,i(d,{get when(){return e.browserSelectedLoading()},get fallback(){return i(d,{get when(){return e.browserSelectedError()},get fallback(){return i(d,{get when(){return _(()=>!!(e.browserSelectedPath()&&e.browserSelectedContent()!==null))()?{path:e.browserSelectedPath(),content:e.browserSelectedContent()}:null},get fallback(){return(()=>{var r=g(),l=r.firstChild;return s(l,x),r})()},children:r=>i(V,{get fallback(){return(()=>{var l=g(),a=l.firstChild;return s(a,()=>e.t("instanceInfo.loading")),l})()},get children(){return i(U,{get scopeKey(){return e.scopeKey()},get path(){return r().path},get content(){return r().content},get onSave(){return e.onSave},get onContentChange(){return e.onContentChange}})}})})},children:r=>(()=>{var l=g(),a=l.firstChild;return s(a,r),l})()})},get children(){var r=g(),l=r.firstChild;return s(l,()=>e.t("instanceInfo.loading")),r}})),t})(),m=()=>[i(d,{when:L,children:t=>(()=>{var n=W(),r=n.firstChild,l=r.firstChild;return n.$$click=()=>e.onLoadEntries(t()),v(()=>c(l,"title",t())),n})()}),i(d,{get when(){return e.browserLoading()&&h===null},get children(){var t=N();return s(t,()=>e.t("instanceInfo.loading")),t}}),i(F,{each:P,children:t=>(()=>{var n=H(),r=n.firstChild,l=r.firstChild,a=l.firstChild,f=l.nextSibling,E=f.firstChild;return n.$$click=()=>{if(t.type==="directory"){e.onLoadEntries(t.path);return}e.onRequestOpenFile(t.path)},s(a,()=>t.name),s(E,()=>t.type),v(u=>{var b=`file-list-item ${e.browserSelectedPath()===t.path?"file-list-item-active":""}`,S=t.path,$=t.path;return b!==u.e&&z(n,u.e=b),S!==u.t&&c(n,"title",u.t=S),$!==u.a&&c(l,"title",u.a=$),u},{e:void 0,t:void 0,a:void 0}),n})()})];return i(T,{get header(){return[(()=>{var t=B(),n=t.firstChild,r=n.firstChild,l=r.firstChild;return s(l,w),s(t,i(d,{get when(){return e.browserLoading()},get children(){var a=j();return s(a,()=>e.t("instanceInfo.loading")),a}}),null),s(t,i(d,{get when(){return e.browserError()},children:a=>(()=>{var f=Q();return s(f,a),f})()}),null),v(()=>c(r,"title",w())),t})(),(()=>{var t=G();return t.$$click=C,s(t,i(d,{get when(){return e.browserSelectedSaving()},get fallback(){return i(q,{class:"h-4 w-4"})},get children(){return i(y,{class:"h-4 w-4 animate-spin"})}})),v(n=>{var r=e.t("instanceShell.rightPanel.actions.save")||"Save (Ctrl+S)",l=e.t("instanceShell.rightPanel.actions.save")||"Save",a=e.browserSelectedSaving()||!e.browserSelectedDirty();return r!==n.e&&c(t,"title",n.e=r),l!==n.t&&c(t,"aria-label",n.t=l),a!==n.a&&(t.disabled=n.a=a),n},{e:void 0,t:void 0,a:void 0}),t})(),(()=>{var t=J();return t.$$click=()=>e.onRefresh(),s(t,i(y,{get class(){return`h-4 w-4${e.browserLoading()?" animate-spin":""}`}})),v(n=>{var r=e.t("instanceShell.rightPanel.actions.refresh"),l=e.t("instanceShell.rightPanel.actions.refresh"),a=e.browserLoading();return r!==n.e&&c(t,"title",n.e=r),l!==n.t&&c(t,"aria-label",n.t=l),a!==n.a&&(t.disabled=n.a=a),n},{e:void 0,t:void 0,a:void 0}),t})()]},list:{panel:m,overlay:m},get viewer(){return k()},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")}})})};I(["click"]);export{ae as default};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-viewer-C7NpFe3J.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 B}from"./index-BFhdUjhW.js";import{m as V,t as h,i as r,d as $,a as D,f as K}from"./monaco-viewer-C7NpFe3J.js";import{c as f,n as d,a as w,S as c,F as R,z as G,A as N}from"./git-diff-vendor-CSgooKT_.js";import{D as j}from"./DiffToolbar-BAqvjGMM.js";import{S as q}from"./SplitFilePanel-CJZ8TIzk.js";import{R as H}from"./main-UDLNq9xC.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";import"./wrap-text-DAgGusLM.js";var S=h("<div class=file-viewer-empty><span class=file-viewer-empty-text>"),J=h('<div class="file-viewer-panel flex-1"><div class="file-viewer-content file-viewer-content--monaco">'),Q=h('<div class="p-3 text-xs text-secondary">'),A=h('<span class="text-[10px] text-secondary">'),z=h("<span class=file-list-item-additions>+"),O=h("<span class=file-list-item-deletions>-"),T=h("<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>"),U=h("<span class=files-tab-selected-path><span class=file-path-text>"),X=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>-'),Y=h("<button type=button class=files-header-icon-button style=margin-left:auto>"),Z=h("<span class=text-error>");const p=N(()=>B(()=>import("./monaco-viewer-C7NpFe3J.js").then(e=>e.ab),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.MonacoDiffViewer}))),ce=e=>{const P=f(()=>e.activeSessionId()),y=f(()=>!!(P()&&P()!=="info")),M=f(()=>y()?e.entries():null),b=f(()=>{const o=M();return Array.isArray(o)?[...o].sort((s,g)=>String(s.path||"").localeCompare(String(g.path||""))):[]}),F=f(()=>b().reduce((o,s)=>(o.additions+=typeof s.added=="number"?s.added:0,o.deletions+=typeof s.removed=="number"?s.removed:0,o),{additions:0,deletions:0})),L=f(()=>b().filter(o=>o&&o.status!=="deleted")),I=f(()=>{const o=b(),s=e.selectedPath(),g=e.mostChangedPath();return(o.find(_=>_.path===s)||(g?o.find(_=>_.path===g):void 0))??null}),W=f(()=>y()?M()===null?e.t("instanceShell.gitChanges.loading"):L().length===0?e.t("instanceShell.gitChanges.empty"):e.t("instanceShell.filesShell.viewerEmpty"):e.t("instanceShell.gitChanges.noSessionSelected"));return V(()=>{const o=F(),s=I(),g=b(),x=L(),_=()=>(()=>{var t=J(),l=t.firstChild;return r(l,d(c,{get when(){return e.selectedLoading()},get fallback(){return d(c,{get when(){return e.selectedError()},get fallback(){return d(c,{get when(){return V(()=>!!(s&&e.selectedBefore()!==null&&e.selectedAfter()!==null&&s.status!=="deleted"))()?{path:s.path,before:e.selectedBefore(),after:e.selectedAfter()}:null},get fallback(){return(()=>{var i=S(),a=i.firstChild;return r(a,W),i})()},children:i=>d(G,{get fallback(){return(()=>{var a=S(),u=a.firstChild;return r(u,()=>e.t("instanceInfo.loading")),a})()},get children(){return d(p,{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()}})}})})},children:i=>(()=>{var a=S(),u=a.firstChild;return r(u,i),a})()})},get children(){var i=S(),a=i.firstChild;return r(a,()=>e.t("instanceInfo.loading")),i}})),t})(),k=()=>(()=>{var t=Q();return r(t,W),t})();return d(q,{get header(){return[(()=>{var t=U(),l=t.firstChild;return r(l,()=>(s==null?void 0:s.path)||e.t("instanceShell.rightPanel.tabs.gitChanges")),w(()=>$(t,"title",(s==null?void 0:s.path)||e.t("instanceShell.rightPanel.tabs.gitChanges"))),t})(),(()=>{var t=X(),l=t.firstChild,i=l.firstChild;i.firstChild;var a=l.nextSibling,u=a.firstChild;return u.firstChild,r(i,()=>o.additions,null),r(u,()=>o.deletions,null),r(t,d(c,{get when(){return e.statusError()},children:v=>(()=>{var n=Z();return r(n,v),n})()}),null),t})(),(()=>{var t=Y();return t.$$click=()=>e.onRefresh(),r(t,d(H,{get class(){return`h-4 w-4${e.statusLoading()?" animate-spin":""}`}})),w(l=>{var i=e.t("instanceShell.rightPanel.actions.refresh"),a=e.t("instanceShell.rightPanel.actions.refresh"),u=!y()||e.statusLoading()||M()===null;return i!==l.e&&$(t,"title",l.e=i),a!==l.t&&$(t,"aria-label",l.t=a),u!==l.a&&(t.disabled=l.a=u),l},{e:void 0,t:void 0,a:void 0}),t})(),d(j,{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:()=>d(c,{get when(){return x.length>0},get fallback(){return k()},get children(){return d(R,{each:g,children:t=>(()=>{var l=T(),i=l.firstChild,a=i.firstChild,u=a.firstChild,v=a.nextSibling;return l.$$click=()=>{e.onOpenFile(t.path)},r(u,()=>t.path),r(v,d(c,{get when(){return t.status==="deleted"},get children(){var n=A();return r(n,()=>e.t("instanceShell.gitChanges.deleted")),n}}),null),r(v,d(c,{get when(){return t.status!=="deleted"},get children(){return[(()=>{var n=z();return n.firstChild,r(n,()=>t.added,null),n})(),(()=>{var n=O();return n.firstChild,r(n,()=>t.removed,null),n})()]}}),null),w(n=>{var C=`file-list-item ${e.selectedPath()===t.path?"file-list-item-active":""}`,m=t.path;return C!==n.e&&D(l,n.e=C),m!==n.t&&$(a,"title",n.t=m),n},{e:void 0,t:void 0}),l})()})}}),overlay:()=>d(c,{get when(){return x.length>0},get fallback(){return k()},get children(){return d(R,{each:g,children:t=>(()=>{var l=T(),i=l.firstChild,a=i.firstChild,u=a.firstChild,v=a.nextSibling;return l.$$click=()=>e.onOpenFile(t.path),r(u,()=>t.path),r(v,d(c,{get when(){return t.status==="deleted"},get children(){var n=A();return r(n,()=>e.t("instanceShell.gitChanges.deleted")),n}}),null),r(v,d(c,{get when(){return t.status!=="deleted"},get children(){return[(()=>{var n=z();return n.firstChild,r(n,()=>t.added,null),n})(),(()=>{var n=O();return n.firstChild,r(n,()=>t.removed,null),n})()]}}),null),w(n=>{var C=`file-list-item ${e.selectedPath()===t.path?"file-list-item-active":""}`,m=t.path,E=t.path;return C!==n.e&&D(l,n.e=C),m!==n.t&&$(l,"title",n.t=m),E!==n.a&&$(a,"title",n.a=E),n},{e:void 0,t:void 0,a:void 0}),l})()})}})},get viewer(){return _()},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")}})})};K(["click"]);export{ce as default};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-viewer-Bxr3Yl9j.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 B}from"./index-BcZbY-A3.js";import{m as V,t as h,i as r,d as $,a as D,f as K}from"./monaco-viewer-Bxr3Yl9j.js";import{c as f,n as d,a as w,S as c,F as R,z as G,A as N}from"./git-diff-vendor-CSgooKT_.js";import{D as j}from"./DiffToolbar-Djf4opPv.js";import{S as q}from"./SplitFilePanel-BFobT5PM.js";import{R as H}from"./main-zsdi8JzY.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";import"./wrap-text-DdRZJaCp.js";var S=h("<div class=file-viewer-empty><span class=file-viewer-empty-text>"),J=h('<div class="file-viewer-panel flex-1"><div class="file-viewer-content file-viewer-content--monaco">'),Q=h('<div class="p-3 text-xs text-secondary">'),A=h('<span class="text-[10px] text-secondary">'),z=h("<span class=file-list-item-additions>+"),O=h("<span class=file-list-item-deletions>-"),T=h("<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>"),U=h("<span class=files-tab-selected-path><span class=file-path-text>"),X=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>-'),Y=h("<button type=button class=files-header-icon-button style=margin-left:auto>"),Z=h("<span class=text-error>");const p=N(()=>B(()=>import("./monaco-viewer-Bxr3Yl9j.js").then(e=>e.ad),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.MonacoDiffViewer}))),ce=e=>{const P=f(()=>e.activeSessionId()),y=f(()=>!!(P()&&P()!=="info")),M=f(()=>y()?e.entries():null),b=f(()=>{const o=M();return Array.isArray(o)?[...o].sort((s,g)=>String(s.path||"").localeCompare(String(g.path||""))):[]}),F=f(()=>b().reduce((o,s)=>(o.additions+=typeof s.added=="number"?s.added:0,o.deletions+=typeof s.removed=="number"?s.removed:0,o),{additions:0,deletions:0})),L=f(()=>b().filter(o=>o&&o.status!=="deleted")),I=f(()=>{const o=b(),s=e.selectedPath(),g=e.mostChangedPath();return(o.find(_=>_.path===s)||(g?o.find(_=>_.path===g):void 0))??null}),W=f(()=>y()?M()===null?e.t("instanceShell.gitChanges.loading"):L().length===0?e.t("instanceShell.gitChanges.empty"):e.t("instanceShell.filesShell.viewerEmpty"):e.t("instanceShell.gitChanges.noSessionSelected"));return V(()=>{const o=F(),s=I(),g=b(),x=L(),_=()=>(()=>{var t=J(),l=t.firstChild;return r(l,d(c,{get when(){return e.selectedLoading()},get fallback(){return d(c,{get when(){return e.selectedError()},get fallback(){return d(c,{get when(){return V(()=>!!(s&&e.selectedBefore()!==null&&e.selectedAfter()!==null&&s.status!=="deleted"))()?{path:s.path,before:e.selectedBefore(),after:e.selectedAfter()}:null},get fallback(){return(()=>{var i=S(),a=i.firstChild;return r(a,W),i})()},children:i=>d(G,{get fallback(){return(()=>{var a=S(),u=a.firstChild;return r(u,()=>e.t("instanceInfo.loading")),a})()},get children(){return d(p,{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()}})}})})},children:i=>(()=>{var a=S(),u=a.firstChild;return r(u,i),a})()})},get children(){var i=S(),a=i.firstChild;return r(a,()=>e.t("instanceInfo.loading")),i}})),t})(),k=()=>(()=>{var t=Q();return r(t,W),t})();return d(q,{get header(){return[(()=>{var t=U(),l=t.firstChild;return r(l,()=>(s==null?void 0:s.path)||e.t("instanceShell.rightPanel.tabs.gitChanges")),w(()=>$(t,"title",(s==null?void 0:s.path)||e.t("instanceShell.rightPanel.tabs.gitChanges"))),t})(),(()=>{var t=X(),l=t.firstChild,i=l.firstChild;i.firstChild;var a=l.nextSibling,u=a.firstChild;return u.firstChild,r(i,()=>o.additions,null),r(u,()=>o.deletions,null),r(t,d(c,{get when(){return e.statusError()},children:v=>(()=>{var n=Z();return r(n,v),n})()}),null),t})(),(()=>{var t=Y();return t.$$click=()=>e.onRefresh(),r(t,d(H,{get class(){return`h-4 w-4${e.statusLoading()?" animate-spin":""}`}})),w(l=>{var i=e.t("instanceShell.rightPanel.actions.refresh"),a=e.t("instanceShell.rightPanel.actions.refresh"),u=!y()||e.statusLoading()||M()===null;return i!==l.e&&$(t,"title",l.e=i),a!==l.t&&$(t,"aria-label",l.t=a),u!==l.a&&(t.disabled=l.a=u),l},{e:void 0,t:void 0,a:void 0}),t})(),d(j,{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:()=>d(c,{get when(){return x.length>0},get fallback(){return k()},get children(){return d(R,{each:g,children:t=>(()=>{var l=T(),i=l.firstChild,a=i.firstChild,u=a.firstChild,v=a.nextSibling;return l.$$click=()=>{e.onOpenFile(t.path)},r(u,()=>t.path),r(v,d(c,{get when(){return t.status==="deleted"},get children(){var n=A();return r(n,()=>e.t("instanceShell.gitChanges.deleted")),n}}),null),r(v,d(c,{get when(){return t.status!=="deleted"},get children(){return[(()=>{var n=z();return n.firstChild,r(n,()=>t.added,null),n})(),(()=>{var n=O();return n.firstChild,r(n,()=>t.removed,null),n})()]}}),null),w(n=>{var C=`file-list-item ${e.selectedPath()===t.path?"file-list-item-active":""}`,m=t.path;return C!==n.e&&D(l,n.e=C),m!==n.t&&$(a,"title",n.t=m),n},{e:void 0,t:void 0}),l})()})}}),overlay:()=>d(c,{get when(){return x.length>0},get fallback(){return k()},get children(){return d(R,{each:g,children:t=>(()=>{var l=T(),i=l.firstChild,a=i.firstChild,u=a.firstChild,v=a.nextSibling;return l.$$click=()=>e.onOpenFile(t.path),r(u,()=>t.path),r(v,d(c,{get when(){return t.status==="deleted"},get children(){var n=A();return r(n,()=>e.t("instanceShell.gitChanges.deleted")),n}}),null),r(v,d(c,{get when(){return t.status!=="deleted"},get children(){return[(()=>{var n=z();return n.firstChild,r(n,()=>t.added,null),n})(),(()=>{var n=O();return n.firstChild,r(n,()=>t.removed,null),n})()]}}),null),w(n=>{var C=`file-list-item ${e.selectedPath()===t.path?"file-list-item-active":""}`,m=t.path,E=t.path;return C!==n.e&&D(l,n.e=C),m!==n.t&&$(l,"title",n.t=m),E!==n.a&&$(a,"title",n.a=E),n},{e:void 0,t:void 0,a:void 0}),l})()})}})},get viewer(){return _()},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")}})})};K(["click"]);export{ce as default};
@@ -1 +1 @@
1
- import{t as d,i as l,d as m,j as s,m as b,g as _,f as w}from"./monaco-viewer-C7NpFe3J.js";import{a as g,n as r,S as n}from"./git-diff-vendor-CSgooKT_.js";import{u as S}from"./index-BFhdUjhW.js";var y=d("<div class=file-list-overlay role=dialog><div class=file-list-scroll>");const L=e=>(()=>{var t=y(),a=t.firstChild;return l(a,()=>e.children),g(()=>m(t,"aria-label",e.ariaLabel)),t})();var C=d('<div class=files-split><div class=file-list-panel><div class=file-list-scroll></div></div><div class=file-split-handle role=separator aria-orientation=vertical aria-label="Resize file list">'),x=d("<div class=files-tab-container><div class=files-tab-header><div class=files-tab-header-row><button type=button class=files-toggle-button></button></div></div><div class=files-tab-body>");const z=e=>{const{t}=S();return(()=>{var a=x(),c=a.firstChild,o=c.firstChild,u=o.firstChild,h=c.nextSibling;return s(u,"click",e.onToggleList,!0),l(u,(()=>{var i=b(()=>!!e.listOpen);return()=>i()?t("instanceShell.filesShell.hideFiles"):t("instanceShell.filesShell.showFiles")})()),l(o,()=>e.header,null),l(h,r(n,{get when(){return b(()=>!e.isPhoneLayout)()&&e.listOpen},get fallback(){return e.viewer},get children(){var i=C(),v=i.firstChild,$=v.firstChild,f=v.nextSibling;return l($,()=>e.list.panel()),s(f,"touchstart",e.onResizeTouchStart,!0),s(f,"mousedown",e.onResizeMouseDown,!0),l(i,()=>e.viewer,null),g(O=>_(i,"--files-pane-width",`${e.splitWidth}px`)),i}}),null),l(h,r(n,{get when(){return e.isPhoneLayout},get children(){return r(n,{get when(){return e.listOpen},get children(){return r(L,{get ariaLabel(){return e.overlayAriaLabel},get children(){return e.list.overlay()}})}})}}),null),a})()};w(["click","mousedown","touchstart"]);export{z as S};
1
+ import{t as d,i as l,d as m,j as s,m as b,g as _,f as w}from"./monaco-viewer-Bxr3Yl9j.js";import{a as g,n as r,S as n}from"./git-diff-vendor-CSgooKT_.js";import{u as S}from"./index-BcZbY-A3.js";var y=d("<div class=file-list-overlay role=dialog><div class=file-list-scroll>");const L=e=>(()=>{var t=y(),a=t.firstChild;return l(a,()=>e.children),g(()=>m(t,"aria-label",e.ariaLabel)),t})();var C=d('<div class=files-split><div class=file-list-panel><div class=file-list-scroll></div></div><div class=file-split-handle role=separator aria-orientation=vertical aria-label="Resize file list">'),x=d("<div class=files-tab-container><div class=files-tab-header><div class=files-tab-header-row><button type=button class=files-toggle-button></button></div></div><div class=files-tab-body>");const z=e=>{const{t}=S();return(()=>{var a=x(),c=a.firstChild,o=c.firstChild,u=o.firstChild,h=c.nextSibling;return s(u,"click",e.onToggleList,!0),l(u,(()=>{var i=b(()=>!!e.listOpen);return()=>i()?t("instanceShell.filesShell.hideFiles"):t("instanceShell.filesShell.showFiles")})()),l(o,()=>e.header,null),l(h,r(n,{get when(){return b(()=>!e.isPhoneLayout)()&&e.listOpen},get fallback(){return e.viewer},get children(){var i=C(),v=i.firstChild,$=v.firstChild,f=v.nextSibling;return l($,()=>e.list.panel()),s(f,"touchstart",e.onResizeTouchStart,!0),s(f,"mousedown",e.onResizeMouseDown,!0),l(i,()=>e.viewer,null),g(O=>_(i,"--files-pane-width",`${e.splitWidth}px`)),i}}),null),l(h,r(n,{get when(){return e.isPhoneLayout},get children(){return r(n,{get when(){return e.listOpen},get children(){return r(L,{get ariaLabel(){return e.overlayAriaLabel},get children(){return e.list.overlay()}})}})}}),null),a})()};w(["click","mousedown","touchstart"]);export{z as S};
@@ -0,0 +1 @@
1
+ import{m as Pe,P as Xe,t as _,i as h,a as Ye,d as O,f as Ge}from"./monaco-viewer-Bxr3Yl9j.js";import{n as d,m as S,b as T,o as k,k as ee,l as te,q as ae,s as M,d as I,c as W,S as J,t as Qe,w as we,a as he,F as ge}from"./git-diff-vendor-CSgooKT_.js";import{I as ce,P as Ze,Q as F,T as re,U as Je,V as et,W as ke,X as Ie,Y as Te,Z as tt,_ as fe,$ as le,a0 as de,a1 as $e,a2 as ne,a3 as oe,a4 as nt,a5 as me,a6 as ot,a7 as st,a8 as A,a9 as be,aa as it,ab as rt,ac as lt,ad as R,ae as at,af as ct,ag as Se,ah as dt,ai as pe,aj as ut,ak as gt,al as ft,am as pt}from"./main-zsdi8JzY.js";import{u as ht}from"./index-BcZbY-A3.js";import{T as mt}from"./todo-_i0FVuIM.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";const bt=[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}],["path",{d:"M4 2C2.8 3.7 2 5.7 2 8",key:"tap9e0"}],["path",{d:"M22 8c0-2.3-.8-4.3-2-6",key:"5bb3ad"}]],vt=e=>d(ce,S(e,{name:"BellRing",iconNode:bt})),yt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],xt=e=>d(ce,S(e,{name:"Info",iconNode:yt})),Ct=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],wt=e=>d(ce,S(e,{name:"TerminalSquare",iconNode:Ct})),St=[["polygon",{points:"7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2",key:"h1p8hx"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Pt=e=>d(ce,S(e,{name:"XOctagon",iconNode:St}));var De=ee();function kt(){return te(De)}function It(){const e=kt();if(e===void 0)throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return e}function Oe(e,o){return!!(o.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function Tt(e,o){var t;const l=o.ref();if(!l)return-1;let r=e.length;if(!r)return-1;for(;r--;){const n=(t=e[r])==null?void 0:t.ref();if(n&&Oe(n,l))return r+1}return 0}function $t(e){const o=e.map((r,t)=>[t,r]);let l=!1;return o.sort(([r,t],[n,s])=>{const i=t.ref(),c=s.ref();return i===c||!i||!c?0:Oe(i,c)?(r>n&&(l=!0),-1):(r<n&&(l=!0),1)}),l?o.map(([r,t])=>t):e}function _e(e,o){const l=$t(e);e!==l&&o(l)}function Dt(e){var t,n;const o=e[0],l=(t=e[e.length-1])==null?void 0:t.ref();let r=(n=o==null?void 0:o.ref())==null?void 0:n.parentElement;for(;r;){if(l&&r.contains(l))return r;r=r.parentElement}return re(r).body}function Ot(e,o){T(()=>{const l=setTimeout(()=>{_e(e(),o)});k(()=>clearTimeout(l))})}function _t(e,o){if(typeof IntersectionObserver!="function"){Ot(e,o);return}let l=[];T(()=>{const r=()=>{const s=!!l.length;l=e(),s&&_e(e(),o)},t=Dt(e()),n=new IntersectionObserver(r,{root:t});for(const s of e()){const i=s.ref();i&&n.observe(i)}k(()=>n.disconnect())})}function Mt(e={}){const[o,l]=Ze({value:()=>et(e.items),onChange:n=>{var s;return(s=e.onItemsChange)==null?void 0:s.call(e,n)}});_t(o,l);const r=n=>(l(s=>{const i=Tt(s,n);return Je(s,n,i)}),()=>{l(s=>{const i=s.filter(c=>c.ref()!==n.ref());return s.length===i.length?s:i})});return{DomCollectionProvider:n=>d(De.Provider,{value:{registerItem:r},get children(){return n.children}})}}function Et(e){const o=It(),l=F({shouldRegisterItem:!0},e);T(()=>{if(!l.shouldRegisterItem)return;const r=o.registerItem(l.getItem());k(r)})}var At={};be(At,{Arrow:()=>ke,Content:()=>Ee,Portal:()=>Ae,Root:()=>Re,Tooltip:()=>Z,Trigger:()=>Fe,useTooltipContext:()=>ue});var Me=ee();function ue(){const e=te(Me);if(e===void 0)throw new Error("[kobalte]: `useTooltipContext` must be used within a `Tooltip` component");return e}function Ee(e){const o=ue(),l=F({id:o.generateId("content")},e),[r,t]=M(l,["ref","style"]);return T(()=>k(o.registerContentId(t.id))),d(J,{get when(){return o.contentPresent()},get children(){return d($e.Positioner,{get children(){return d(nt,S({ref(n){var s=ne(i=>{o.setContentRef(i)},r.ref);typeof s=="function"&&s(n)},role:"tooltip",disableOutsidePointerEvents:!1,get style(){return me({"--kb-tooltip-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},r.style)},onFocusOutside:n=>n.preventDefault(),onDismiss:()=>o.hideTooltip(!0)},()=>o.dataset(),t))}})}})}function Ae(e){const o=ue();return d(J,{get when(){return o.contentPresent()},get children(){return d(Xe,e)}})}function Rt(e,o,l){const r=e.split("-")[0],t=o.getBoundingClientRect(),n=l.getBoundingClientRect(),s=[],i=t.left+t.width/2,c=t.top+t.height/2;switch(r){case"top":s.push([t.left,c]),s.push([n.left,n.bottom]),s.push([n.left,n.top]),s.push([n.right,n.top]),s.push([n.right,n.bottom]),s.push([t.right,c]);break;case"right":s.push([i,t.top]),s.push([n.left,n.top]),s.push([n.right,n.top]),s.push([n.right,n.bottom]),s.push([n.left,n.bottom]),s.push([i,t.bottom]);break;case"bottom":s.push([t.left,c]),s.push([n.left,n.top]),s.push([n.left,n.bottom]),s.push([n.right,n.bottom]),s.push([n.right,n.top]),s.push([t.right,c]);break;case"left":s.push([i,t.top]),s.push([n.right,n.top]),s.push([n.left,n.top]),s.push([n.left,n.bottom]),s.push([n.right,n.bottom]),s.push([i,t.bottom]);break}return s}var H={},Ft=0,X=!1,E,Q,Y;function Re(e){const o=`tooltip-${ae()}`,l=`${++Ft}`,r=F({id:o,openDelay:700,closeDelay:300,skipDelayDuration:300},e),[t,n]=M(r,["id","open","defaultOpen","onOpenChange","disabled","triggerOnFocusOnly","openDelay","closeDelay","skipDelayDuration","ignoreSafeArea","forceMount"]);let s;const[i,c]=I(),[a,f]=I(),[u,g]=I(),[y,v]=I(n.placement),x=Ie({open:()=>t.open,defaultOpen:()=>t.defaultOpen,onOpenChange:b=>{var P;return(P=t.onOpenChange)==null?void 0:P.call(t,b)}}),{present:$}=Te({show:()=>t.forceMount||x.isOpen(),element:()=>u()??null}),m=()=>{H[l]=C},w=()=>{for(const b in H)b!==l&&(H[b](!0),delete H[b])},C=(b=!1)=>{b||t.closeDelay&&t.closeDelay<=0?(window.clearTimeout(s),s=void 0,x.close()):s||(s=window.setTimeout(()=>{s=void 0,x.close()},t.closeDelay)),window.clearTimeout(E),E=void 0,t.skipDelayDuration&&t.skipDelayDuration>=0&&(Y=window.setTimeout(()=>{window.clearTimeout(Y),Y=void 0},t.skipDelayDuration)),X&&(window.clearTimeout(Q),Q=window.setTimeout(()=>{delete H[l],Q=void 0,X=!1},t.closeDelay))},p=()=>{clearTimeout(s),s=void 0,w(),m(),X=!0,x.open(),window.clearTimeout(E),E=void 0,window.clearTimeout(Q),Q=void 0,window.clearTimeout(Y),Y=void 0},q=()=>{w(),m(),!x.isOpen()&&!E&&!X?E=window.setTimeout(()=>{E=void 0,X=!0,p()},t.openDelay):x.isOpen()||p()},K=(b=!1)=>{!b&&t.openDelay&&t.openDelay>0&&!s&&!Y?q():p()},z=()=>{window.clearTimeout(E),E=void 0,X=!1},B=()=>{window.clearTimeout(s),s=void 0},U=b=>fe(a(),b)||fe(u(),b),D=b=>{const P=a(),N=u();if(!(!P||!N))return Rt(b,P,N)},L=b=>{const P=b.target;if(U(P)){B();return}if(!t.ignoreSafeArea){const N=D(y());if(N&&ot(st(b),N)){B();return}}s||C()};T(()=>{if(!x.isOpen())return;const b=re();b.addEventListener("pointermove",L,!0),k(()=>{b.removeEventListener("pointermove",L,!0)})}),T(()=>{const b=a();if(!b||!x.isOpen())return;const P=ze=>{const Ve=ze.target;fe(Ve,b)&&C(!0)},N=tt();N.addEventListener("scroll",P,{capture:!0}),k(()=>{N.removeEventListener("scroll",P,{capture:!0})})}),k(()=>{clearTimeout(s),H[l]&&delete H[l]});const ie={dataset:W(()=>({"data-expanded":x.isOpen()?"":void 0,"data-closed":x.isOpen()?void 0:""})),isOpen:x.isOpen,isDisabled:()=>t.disabled??!1,triggerOnFocusOnly:()=>t.triggerOnFocusOnly??!1,contentId:i,contentPresent:$,openTooltip:K,hideTooltip:C,cancelOpening:z,generateId:de(()=>r.id),registerContentId:le(c),isTargetOnTooltip:U,setTriggerRef:f,setContentRef:g};return d(Me.Provider,{value:ie,get children(){return d($e,S({anchorRef:a,contentRef:u,onCurrentPlacementChange:v},n))}})}function Fe(e){let o;const l=ue(),[r,t]=M(e,["ref","onPointerEnter","onPointerLeave","onPointerDown","onClick","onFocus","onBlur"]);let n=!1,s=!1,i=!1;const c=()=>{n=!1},a=()=>{!l.isOpen()&&(s||i)&&l.openTooltip(i)},f=m=>{l.isOpen()&&!s&&!i&&l.hideTooltip(m)},u=m=>{A(m,r.onPointerEnter),!(m.pointerType==="touch"||l.triggerOnFocusOnly()||l.isDisabled()||m.defaultPrevented)&&(s=!0,a())},g=m=>{A(m,r.onPointerLeave),m.pointerType!=="touch"&&(s=!1,i=!1,l.isOpen()?f():l.cancelOpening())},y=m=>{A(m,r.onPointerDown),n=!0,re(o).addEventListener("pointerup",c,{once:!0})},v=m=>{A(m,r.onClick),s=!1,i=!1,f(!0)},x=m=>{A(m,r.onFocus),!(l.isDisabled()||m.defaultPrevented||n)&&(i=!0,a())},$=m=>{A(m,r.onBlur);const w=m.relatedTarget;l.isTargetOnTooltip(w)||(s=!1,i=!1,f(!0))};return k(()=>{re(o).removeEventListener("pointerup",c)}),d(oe,S({as:"button",ref(m){var w=ne(C=>{l.setTriggerRef(C),o=C},r.ref);typeof w=="function"&&w(m)},get"aria-describedby"(){return Pe(()=>!!l.isOpen())()?l.contentId():void 0},onPointerEnter:u,onPointerLeave:g,onPointerDown:y,onClick:v,onFocus:x,onBlur:$},()=>l.dataset(),t))}var Z=Object.assign(Re,{Arrow:ke,Content:Ee,Portal:Ae,Trigger:Fe}),Kt={};be(Kt,{Collapsible:()=>Bt,Content:()=>ve,Root:()=>ye,Trigger:()=>xe,useCollapsibleContext:()=>se});var Ke=ee();function se(){const e=te(Ke);if(e===void 0)throw new Error("[kobalte]: `useCollapsibleContext` must be used within a `Collapsible.Root` component");return e}function ve(e){const[o,l]=I(),r=se(),t=F({id:r.generateId("content")},e),[n,s]=M(t,["ref","id","style"]),{present:i}=Te({show:r.shouldMount,element:()=>o()??null}),[c,a]=I(0),[f,u]=I(0);let y=r.isOpen()||i();return Qe(()=>{const v=requestAnimationFrame(()=>{y=!1});k(()=>{cancelAnimationFrame(v)})}),T(we(i,()=>{if(!o())return;o().style.transitionDuration="0s",o().style.animationName="none";const v=o().getBoundingClientRect();a(v.height),u(v.width),y||(o().style.transitionDuration="",o().style.animationName="")})),T(we(r.isOpen,v=>{!v&&o()&&(o().style.transitionDuration="",o().style.animationName="")},{defer:!0})),T(()=>k(r.registerContentId(n.id))),d(J,{get when(){return i()},get children(){return d(oe,S({as:"div",ref(v){var x=ne(l,n.ref);typeof x=="function"&&x(v)},get id(){return n.id},get style(){return me({"--kb-collapsible-content-height":c()?`${c()}px`:void 0,"--kb-collapsible-content-width":f()?`${f()}px`:void 0},n.style)}},()=>r.dataset(),s))}})}function ye(e){const o=`collapsible-${ae()}`,l=F({id:o},e),[r,t]=M(l,["open","defaultOpen","onOpenChange","disabled","forceMount"]),[n,s]=I(),i=Ie({open:()=>r.open,defaultOpen:()=>r.defaultOpen,onOpenChange:f=>{var u;return(u=r.onOpenChange)==null?void 0:u.call(r,f)}}),c=W(()=>({"data-expanded":i.isOpen()?"":void 0,"data-closed":i.isOpen()?void 0:"","data-disabled":r.disabled?"":void 0})),a={dataset:c,isOpen:i.isOpen,disabled:()=>r.disabled??!1,shouldMount:()=>r.forceMount||i.isOpen(),contentId:n,toggle:i.toggle,generateId:de(()=>t.id),registerContentId:le(s)};return d(Ke.Provider,{value:a,get children(){return d(oe,S({as:"div"},c,t))}})}function xe(e){const o=se(),[l,r]=M(e,["onClick"]);return d(it,S({get"aria-expanded"(){return o.isOpen()},get"aria-controls"(){return Pe(()=>!!o.isOpen())()?o.contentId():void 0},get disabled(){return o.disabled()},onClick:n=>{A(n,l.onClick),o.toggle()}},()=>o.dataset(),r))}var Bt=Object.assign(ye,{Content:ve,Trigger:xe}),G={};be(G,{Accordion:()=>Lt,Content:()=>Ne,Header:()=>Ue,Item:()=>je,Root:()=>We,Trigger:()=>qe,useAccordionContext:()=>Ce});var Be=ee();function Le(){const e=te(Be);if(e===void 0)throw new Error("[kobalte]: `useAccordionItemContext` must be used within a `Accordion.Item` component");return e}function Ne(e){const o=Le(),l=o.generateId("content"),r=F({id:l},e),[t,n]=M(r,["id","style"]);return T(()=>k(o.registerContentId(t.id))),d(ve,S({role:"region",get"aria-labelledby"(){return o.triggerId()},get style(){return me({"--kb-accordion-content-height":"var(--kb-collapsible-content-height)","--kb-accordion-content-width":"var(--kb-collapsible-content-width)"},t.style)}},n))}function Ue(e){const o=se();return d(oe,S({as:"h3"},()=>o.dataset(),e))}var He=ee();function Ce(){const e=te(He);if(e===void 0)throw new Error("[kobalte]: `useAccordionContext` must be used within a `Accordion.Root` component");return e}function je(e){const o=Ce(),l=`${o.generateId("item")}-${ae()}`,r=F({id:l},e),[t,n]=M(r,["value","disabled"]),[s,i]=I(),[c,a]=I(),f=()=>o.listState().selectionManager(),u=()=>f().isSelected(t.value),g={value:()=>t.value,triggerId:s,contentId:c,generateId:de(()=>n.id),registerTriggerId:le(i),registerContentId:le(a)};return d(Be.Provider,{value:g,get children(){return d(ye,S({get open(){return u()},get disabled(){return t.disabled}},n))}})}function We(e){let o;const l=`accordion-${ae()}`,r=F({id:l,multiple:!1,collapsible:!1,shouldFocusWrap:!0},e),[t,n]=M(r,["id","ref","value","defaultValue","onChange","multiple","collapsible","shouldFocusWrap","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]),[s,i]=I([]),{DomCollectionProvider:c}=Mt({items:s,onItemsChange:i}),a=rt({selectedKeys:()=>t.value,defaultSelectedKeys:()=>t.defaultValue,onSelectionChange:g=>{var y;return(y=t.onChange)==null?void 0:y.call(t,Array.from(g))},disallowEmptySelection:()=>!t.multiple&&!t.collapsible,selectionMode:()=>t.multiple?"multiple":"single",dataSource:s});a.selectionManager().setFocusedKey("item-1");const f=lt({selectionManager:()=>a.selectionManager(),collection:()=>a.collection(),disallowEmptySelection:()=>a.selectionManager().disallowEmptySelection(),shouldFocusWrap:()=>t.shouldFocusWrap,disallowTypeAhead:!0,allowsTabNavigation:!0},()=>o),u={listState:()=>a,generateId:de(()=>t.id)};return d(c,{get children(){return d(He.Provider,{value:u,get children(){return d(oe,S({as:"div",get id(){return t.id},ref(g){var y=ne(v=>o=v,t.ref);typeof y=="function"&&y(g)},get onKeyDown(){return R([t.onKeyDown,f.onKeyDown])},get onMouseDown(){return R([t.onMouseDown,f.onMouseDown])},get onFocusIn(){return R([t.onFocusIn])},get onFocusOut(){return R([t.onFocusOut,f.onFocusOut])}},n))}})}})}function qe(e){let o;const l=Ce(),r=Le(),t=se(),n=r.generateId("trigger"),s=F({id:n},e),[i,c]=M(s,["ref","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]);Et({getItem:()=>({ref:()=>o,type:"item",key:r.value(),textValue:"",disabled:t.disabled()})});const a=at({key:()=>r.value(),selectionManager:()=>l.listState().selectionManager(),disabled:()=>t.disabled(),shouldSelectOnPressUp:!0},()=>o),f=u=>{["Enter"," "].includes(u.key)&&u.preventDefault(),A(u,i.onKeyDown),A(u,a.onKeyDown)};return T(()=>k(r.registerTriggerId(c.id))),d(xe,S({ref(u){var g=ne(y=>o=y,i.ref);typeof g=="function"&&g(u)},get"data-key"(){return a.dataKey()},get onPointerDown(){return R([i.onPointerDown,a.onPointerDown])},get onPointerUp(){return R([i.onPointerUp,a.onPointerUp])},get onClick(){return R([i.onClick,a.onClick])},onKeyDown:f,get onMouseDown(){return R([i.onMouseDown,a.onMouseDown])},get onFocus(){return R([i.onFocus,a.onFocus])}},c))}var Lt=Object.assign(We,{Content:Ne,Header:Ue,Item:je,Trigger:qe}),Nt=_('<div><div class="flex flex-wrap items-center gap-2 text-xs text-primary"><div class="inline-flex items-center gap-1 rounded-full border border-base px-2 py-0.5 text-xs text-primary"><span class="uppercase text-[10px] tracking-wide text-muted"></span><span class="font-semibold text-primary"></span></div><div class="inline-flex items-center gap-1 rounded-full border border-base px-2 py-0.5 text-xs text-primary"><span class="uppercase text-[10px] tracking-wide text-muted"></span><span class="font-semibold text-primary"></span></div><div class="inline-flex items-center gap-1 rounded-full border border-base px-2 py-0.5 text-xs text-primary"><span class="uppercase text-[10px] tracking-wide text-muted"></span><span class="font-semibold text-primary">');const Ut=e=>{const{t:o}=ht(),l=W(()=>ct(e.instanceId,e.sessionId)??{cost:0,contextWindow:0,isSubscriptionModel:!1,inputTokens:0,outputTokens:0,reasoningTokens:0,actualUsageTokens:0,modelOutputLimit:0,contextAvailableTokens:null}),r=W(()=>l().inputTokens??0),t=W(()=>l().outputTokens??0),n=W(()=>{const i=l().isSubscriptionModel?0:l().cost;return i>0?i:0}),s=W(()=>`$${n().toFixed(2)}`);return(()=>{var i=Nt(),c=i.firstChild,a=c.firstChild,f=a.firstChild,u=f.nextSibling,g=a.nextSibling,y=g.firstChild,v=y.nextSibling,x=g.nextSibling,$=x.firstChild,m=$.nextSibling;return h(f,()=>o("contextUsagePanel.labels.input")),h(u,()=>Se(r())),h(y,()=>o("contextUsagePanel.labels.output")),h(v,()=>Se(t())),h($,()=>o("contextUsagePanel.labels.cost")),h(m,s),he(()=>Ye(i,`session-context-panel px-4 py-2 ${e.class??""}`)),i})()};var j=_('<div class="right-panel-empty right-panel-empty--left"><span class=text-xs>'),Ht=_('<div class="rounded-md border border-base bg-surface-secondary px-3 py-2"><div class="flex items-start justify-between gap-3"><div class=min-w-0><div class="text-sm font-medium text-primary"></div><p class="mt-1 text-xs text-secondary">'),jt=_('<div class="flex flex-col gap-3 min-h-0"><div class="flex items-center justify-between gap-2 text-[11px] text-secondary"><span></span><span class="flex items-center gap-2"><span style=color:var(--session-status-idle-fg)></span><span style=color:var(--session-status-working-fg)></span></span></div><div class="rounded-md border border-base bg-surface-secondary p-2 max-h-[40vh] overflow-y-auto"><div class="flex flex-col">'),Wt=_('<button type=button class="border-b border-base last:border-b-0 text-left hover:bg-surface-muted rounded-sm"><div class="flex items-center justify-between gap-3"><div class="text-xs font-mono text-primary min-w-0 flex-1 overflow-hidden whitespace-nowrap"style=text-overflow:ellipsis;direction:rtl;text-align:left;unicode-bidi:plaintext></div><div class="flex items-center gap-2 text-[11px] flex-shrink-0"><span style=color:var(--session-status-idle-fg)></span><span style=color:var(--session-status-working-fg)>'),qt=_('<div class="flex flex-col gap-2">'),zt=_("<span>"),Vt=_('<div class=status-process-card><div class=status-process-header><span class=status-process-title></span><div class=status-process-meta><span></span><span></span></div></div><div class=status-process-actions><button type=button class="button-tertiary w-full p-1 inline-flex items-center justify-center"></button><button type=button class="button-tertiary w-full p-1 inline-flex items-center justify-center"></button><button type=button class="button-tertiary w-full p-1 inline-flex items-center justify-center">'),Xt=_("<div class=status-tab-container>"),Yt=_("<span class=section-left><span class=section-label>");const on=e=>{const o=i=>e.expandedItems().includes(i),s=[{id:"yolo-mode",labelKey:"instanceShell.rightPanel.sections.yoloMode",tooltipKey:"instanceShell.rightPanel.sections.yoloMode.tooltip",render:()=>{const i=e.activeSession();return i?(()=>{var c=Ht(),a=c.firstChild,f=a.firstChild,u=f.firstChild,g=u.nextSibling;return h(u,()=>e.t("instanceShell.yoloMode.title")),h(g,()=>e.t("instanceShell.yoloMode.description")),h(a,d(ft,{get checked(){return gt(e.instanceId,i.id)},color:"warning",size:"small",get inputProps(){return{"aria-label":e.t("instanceShell.yoloMode.title")}},onChange:()=>ut(e.instanceId,i.id)}),null),c})():(()=>{var c=j(),a=c.firstChild;return h(a,()=>e.t("instanceShell.yoloMode.noSessionSelected")),c})()}},{id:"session-changes",labelKey:"instanceShell.rightPanel.sections.sessionChanges",tooltipKey:"instanceShell.rightPanel.sections.sessionChanges.tooltip",render:()=>{const i=e.activeSessionId();if(!i||i==="info")return(()=>{var u=j(),g=u.firstChild;return h(g,()=>e.t("instanceShell.sessionChanges.noSessionSelected")),u})();const c=e.activeSessionDiffs();if(c===void 0)return(()=>{var u=j(),g=u.firstChild;return h(g,()=>e.t("instanceShell.sessionChanges.loading")),u})();if(!Array.isArray(c)||c.length===0)return(()=>{var u=j(),g=u.firstChild;return h(g,()=>e.t("instanceShell.sessionChanges.empty")),u})();const a=[...c].sort((u,g)=>String(u.file||"").localeCompare(String(g.file||""))),f=a.reduce((u,g)=>(u.additions+=typeof g.additions=="number"?g.additions:0,u.deletions+=typeof g.deletions=="number"?g.deletions:0,u),{additions:0,deletions:0});return(()=>{var u=jt(),g=u.firstChild,y=g.firstChild,v=y.nextSibling,x=v.firstChild,$=x.nextSibling,m=g.nextSibling,w=m.firstChild;return h(y,()=>e.t("instanceShell.sessionChanges.filesChanged",{count:a.length})),h(x,()=>`+${f.additions}`),h($,()=>`-${f.deletions}`),h(w,d(ge,{each:a,children:C=>(()=>{var p=Wt(),q=p.firstChild,K=q.firstChild,z=K.nextSibling,B=z.firstChild,U=B.nextSibling;return p.$$click=()=>e.onOpenChangesTab(C.file),h(K,()=>C.file),h(B,()=>`+${C.additions}`),h(U,()=>`-${C.deletions}`),he(D=>{var L=e.t("instanceShell.sessionChanges.actions.show"),V=C.file;return L!==D.e&&O(p,"title",D.e=L),V!==D.t&&O(K,"title",D.t=V),D},{e:void 0,t:void 0}),p})()})),u})()}},{id:"plan",labelKey:"instanceShell.rightPanel.sections.plan",tooltipKey:"instanceShell.rightPanel.sections.plan.tooltip",render:()=>{const i=e.activeSessionId();if(!i||i==="info")return(()=>{var a=j(),f=a.firstChild;return h(f,()=>e.t("instanceShell.plan.noSessionSelected")),a})();const c=e.latestTodoState();return c?d(mt,{state:c,get emptyLabel(){return e.t("instanceShell.plan.empty")},showStatusLabel:!1}):(()=>{var a=j(),f=a.firstChild;return h(f,()=>e.t("instanceShell.plan.empty")),a})()}},{id:"background-processes",labelKey:"instanceShell.rightPanel.sections.backgroundProcesses",tooltipKey:"instanceShell.rightPanel.sections.backgroundProcesses.tooltip",render:()=>{const i=e.backgroundProcessList();return i.length===0?(()=>{var c=j(),a=c.firstChild;return h(a,()=>e.t("instanceShell.backgroundProcesses.empty")),c})():(()=>{var c=qt();return h(c,d(ge,{each:i,children:a=>(()=>{var f=Vt(),u=f.firstChild,g=u.firstChild,y=g.nextSibling,v=y.firstChild,x=v.nextSibling,$=u.nextSibling,m=$.firstChild,w=m.nextSibling,C=w.nextSibling;return h(g,()=>a.title),h(v,d(vt,{class:"h-3.5 w-3.5"})),h(x,()=>e.t("instanceShell.backgroundProcesses.status",{status:a.status})),h(y,d(J,{get when(){return typeof a.outputSizeBytes=="number"},get children(){var p=zt();return h(p,()=>e.t("instanceShell.backgroundProcesses.output",{sizeKb:Math.round((a.outputSizeBytes??0)/1024)})),p}}),null),m.$$click=()=>e.onOpenBackgroundOutput(a),h(m,d(wt,{class:"h-4 w-4"})),w.$$click=()=>e.onStopBackgroundProcess(a.id),h(w,d(Pt,{class:"h-4 w-4"})),C.$$click=()=>e.onTerminateBackgroundProcess(a.id),h(C,d(pt,{class:"h-4 w-4"})),he(p=>{var q=!!a.notifyEnabled,K=!a.notifyEnabled,z=e.t(a.notifyEnabled?"instanceShell.backgroundProcesses.notify.enabled":"instanceShell.backgroundProcesses.notify.disabled"),B=e.t(a.notifyEnabled?"instanceShell.backgroundProcesses.notify.enabled":"instanceShell.backgroundProcesses.notify.disabled"),U=e.t("instanceShell.backgroundProcesses.actions.output"),D=e.t("instanceShell.backgroundProcesses.actions.output"),L=a.status!=="running",V=e.t("instanceShell.backgroundProcesses.actions.stop"),ie=e.t("instanceShell.backgroundProcesses.actions.stop"),b=e.t("instanceShell.backgroundProcesses.actions.terminate"),P=e.t("instanceShell.backgroundProcesses.actions.terminate");return q!==p.e&&v.classList.toggle("text-success",p.e=q),K!==p.t&&v.classList.toggle("text-tertiary",p.t=K),z!==p.a&&O(v,"aria-label",p.a=z),B!==p.o&&O(v,"title",p.o=B),U!==p.i&&O(m,"aria-label",p.i=U),D!==p.n&&O(m,"title",p.n=D),L!==p.s&&(w.disabled=p.s=L),V!==p.h&&O(w,"aria-label",p.h=V),ie!==p.r&&O(w,"title",p.r=ie),b!==p.d&&O(C,"aria-label",p.d=b),P!==p.l&&O(C,"title",p.l=P),p},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0}),f})()})),c})()}},{id:"mcp",labelKey:"instanceShell.rightPanel.sections.mcp",tooltipKey:"instanceShell.rightPanel.sections.mcp.tooltip",render:()=>d(pe,{get initialInstance(){return e.instance},sections:["mcp"],showSectionHeadings:!1,class:"space-y-2"})},{id:"lsp",labelKey:"instanceShell.rightPanel.sections.lsp",tooltipKey:"instanceShell.rightPanel.sections.lsp.tooltip",render:()=>d(pe,{get initialInstance(){return e.instance},sections:["lsp"],showSectionHeadings:!1,class:"space-y-2"})},{id:"plugins",labelKey:"instanceShell.rightPanel.sections.plugins",tooltipKey:"instanceShell.rightPanel.sections.plugins.tooltip",render:()=>d(pe,{get initialInstance(){return e.instance},sections:["plugins"],showSectionHeadings:!1,class:"space-y-2"})}];return(()=>{var i=Xt();return h(i,d(J,{get when(){return e.activeSession()},children:c=>d(Ut,{get instanceId(){return e.instanceId},get sessionId(){return c().id},class:"status-tab-context-panel"})}),null),h(i,d(G.Root,{class:"right-panel-accordion",collapsible:!0,multiple:!0,get value(){return e.expandedItems()},get onChange(){return e.onExpandedItemsChange},get children(){return d(ge,{each:s,children:c=>d(G.Item,{get value(){return c.id},class:"right-panel-accordion-item",get children(){return[d(G.Header,{class:"right-panel-accordion-header-row",get children(){return[d(G.Trigger,{class:"right-panel-accordion-trigger",get children(){return[(()=>{var a=Yt(),f=a.firstChild;return h(f,()=>e.t(c.labelKey)),a})(),d(dt,{get class(){return`right-panel-accordion-chevron ${o(c.id)?"right-panel-accordion-chevron-expanded":""}`}})]}}),d(Z,{openDelay:200,gutter:4,placement:"top",get children(){return[d(Z.Trigger,{as:"button",type:"button",class:"section-info-trigger",get"aria-label"(){return e.t(c.tooltipKey)},get children(){return d(xt,{class:"section-info-icon"})}}),d(Z.Portal,{get children(){return d(Z.Content,{class:"section-info-tooltip",get children(){return e.t(c.tooltipKey)}})}})]}})]}}),d(G.Content,{class:"right-panel-accordion-content",get children(){return c.render()}})]}})})}}),null),i})()};Ge(["click"]);export{on as default};