@industry-theme/xterm-terminal-panel 0.9.5 → 0.9.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/index.js CHANGED
@@ -1,10 +1,5 @@
1
1
  import "./styles.css";
2
2
  // src/components/ThemedTerminal.tsx
3
- import {
4
- DATA_TYPES as DATA_TYPES2,
5
- sanitizePath,
6
- useDropZone
7
- } from "@principal-ade/panel-framework-core";
8
3
  import { FitAddon } from "@xterm/addon-fit";
9
4
  import { SearchAddon } from "@xterm/addon-search";
10
5
  import { WebLinksAddon } from "@xterm/addon-web-links";
@@ -20,7 +15,7 @@ import {
20
15
  } from "lucide-react";
21
16
  import {
22
17
  forwardRef,
23
- useCallback,
18
+ useCallback as useCallback2,
24
19
  useEffect,
25
20
  useImperativeHandle,
26
21
  useRef,
@@ -28,6 +23,132 @@ import {
28
23
  } from "react";
29
24
  import "@xterm/xterm/css/xterm.css";
30
25
 
26
+ // src/hooks/useTerminalDropZone.tsx
27
+ import {
28
+ DATA_TYPES,
29
+ sanitizePath,
30
+ useDropZone
31
+ } from "@principal-ade/panel-framework-core";
32
+ import { useCallback } from "react";
33
+ import { jsx } from "react/jsx-runtime";
34
+ var FocusDelayMs = 10;
35
+ function getDroppedImageFiles(e) {
36
+ const list = e.dataTransfer?.files;
37
+ if (!list || list.length === 0) return [];
38
+ return Array.from(list).filter((f) => f.type.startsWith("image/"));
39
+ }
40
+ function useTerminalDropZone({
41
+ insertText,
42
+ focus,
43
+ onFilesDropped
44
+ }) {
45
+ const handleDroppedContent = useCallback(
46
+ (content) => {
47
+ insertText(content);
48
+ if (focus) {
49
+ setTimeout(focus, FocusDelayMs);
50
+ }
51
+ },
52
+ [insertText, focus]
53
+ );
54
+ const handleDroppedImageFiles = useCallback(
55
+ async (files) => {
56
+ if (!onFilesDropped || files.length === 0) return;
57
+ try {
58
+ const payload = await Promise.all(
59
+ files.map(async (file) => ({
60
+ name: file.name || "pasted-image.png",
61
+ mimeType: file.type || "image/png",
62
+ data: new Uint8Array(await file.arrayBuffer())
63
+ }))
64
+ );
65
+ const paths = await onFilesDropped(payload);
66
+ if (paths && paths.length > 0) {
67
+ handleDroppedContent(`${paths.map(sanitizePath).join(" ")} `);
68
+ }
69
+ } catch (err) {
70
+ console.error("[useTerminalDropZone] Failed to handle dropped files:", err);
71
+ }
72
+ },
73
+ [onFilesDropped, handleDroppedContent]
74
+ );
75
+ const {
76
+ isDragOver,
77
+ onDrop: handlePanelDrop,
78
+ ...dropZoneProps
79
+ } = useDropZone({
80
+ handlers: [
81
+ {
82
+ dataType: [DATA_TYPES.FILE_PATH, DATA_TYPES.DIRECTORY_PATH],
83
+ onDrop: (data) => {
84
+ const safePath = sanitizePath(data.primaryData);
85
+ handleDroppedContent(safePath);
86
+ }
87
+ },
88
+ {
89
+ dataType: DATA_TYPES.TEXT_SELECTION,
90
+ onDrop: (data) => {
91
+ handleDroppedContent(data.primaryData);
92
+ }
93
+ }
94
+ ],
95
+ onPlainTextDrop: (text, e) => {
96
+ if (getDroppedImageFiles(e).length > 0) return;
97
+ handleDroppedContent(text);
98
+ },
99
+ showVisualFeedback: true
100
+ });
101
+ const handleDrop = useCallback(
102
+ (e) => {
103
+ const imageFiles = getDroppedImageFiles(e);
104
+ handlePanelDrop(e);
105
+ if (imageFiles.length > 0) {
106
+ void handleDroppedImageFiles(imageFiles);
107
+ }
108
+ },
109
+ [handlePanelDrop, handleDroppedImageFiles]
110
+ );
111
+ return {
112
+ isDragOver,
113
+ dropZoneProps,
114
+ handleDrop,
115
+ dropIndicator: isDragOver ? /* @__PURE__ */ jsx(TerminalDropIndicator, {}) : null
116
+ };
117
+ }
118
+ function TerminalDropIndicator() {
119
+ return /* @__PURE__ */ jsx(
120
+ "div",
121
+ {
122
+ style: {
123
+ position: "absolute",
124
+ inset: 0,
125
+ background: "rgba(59, 130, 246, 0.1)",
126
+ border: "2px dashed #3b82f6",
127
+ borderRadius: "4px",
128
+ display: "flex",
129
+ alignItems: "center",
130
+ justifyContent: "center",
131
+ pointerEvents: "none",
132
+ zIndex: 1e3
133
+ },
134
+ children: /* @__PURE__ */ jsx(
135
+ "div",
136
+ {
137
+ style: {
138
+ padding: "8px 16px",
139
+ background: "#3b82f6",
140
+ color: "white",
141
+ borderRadius: "4px",
142
+ fontSize: "13px",
143
+ fontWeight: 500
144
+ },
145
+ children: "Drop to insert"
146
+ }
147
+ )
148
+ }
149
+ );
150
+ }
151
+
31
152
  // src/telemetry.ts
32
153
  import {
33
154
  trace,
@@ -38,7 +159,7 @@ import {
38
159
  // package.json
39
160
  var package_default = {
40
161
  name: "@industry-theme/xterm-terminal-panel",
41
- version: "0.9.5",
162
+ version: "0.9.6",
42
163
  description: "Industry-themed xterm.js terminal components with panel framework integration",
43
164
  type: "module",
44
165
  sideEffects: [
@@ -249,13 +370,13 @@ function getTerminalCSSVariables(theme) {
249
370
  // src/components/SelectionDragChip.tsx
250
371
  import {
251
372
  createDragPreview,
252
- DATA_TYPES,
373
+ DATA_TYPES as DATA_TYPES2,
253
374
  DRAG_ACTIONS,
254
375
  PANEL_TYPES,
255
376
  useDraggable
256
377
  } from "@principal-ade/panel-framework-core";
257
378
  import { GripVertical } from "lucide-react";
258
- import { jsx, jsxs } from "react/jsx-runtime";
379
+ import { jsx as jsx2, jsxs } from "react/jsx-runtime";
259
380
  function SelectionDragChip({
260
381
  text,
261
382
  x,
@@ -269,7 +390,7 @@ function SelectionDragChip({
269
390
  }) {
270
391
  const snippet = text.length > 80 ? `${text.slice(0, 77)}\u2026` : text;
271
392
  const { isDragging, ...dragProps } = useDraggable({
272
- dataType: DATA_TYPES.TEXT_SELECTION,
393
+ dataType: DATA_TYPES2.TEXT_SELECTION,
273
394
  primaryData: text,
274
395
  sourcePanel,
275
396
  suggestedActions: [DRAG_ACTIONS.INSERT_CONTENT, DRAG_ACTIONS.REFERENCE],
@@ -319,7 +440,7 @@ function SelectionDragChip({
319
440
  title: `Drag selection \u2014 ${label}`,
320
441
  "aria-label": `Drag selected terminal text \u2014 ${label}`,
321
442
  children: [
322
- /* @__PURE__ */ jsx(GripVertical, { size: 13, color: theme.colors.textSecondary }),
443
+ /* @__PURE__ */ jsx2(GripVertical, { size: 13, color: theme.colors.textSecondary }),
323
444
  label
324
445
  ]
325
446
  }
@@ -327,7 +448,7 @@ function SelectionDragChip({
327
448
  }
328
449
 
329
450
  // src/components/WorkingOverlay.tsx
330
- import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
451
+ import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
331
452
  var WorkingOverlay = ({
332
453
  theme,
333
454
  message = "Agent working...",
@@ -370,7 +491,7 @@ var WorkingOverlay = ({
370
491
  marginBottom: "8px"
371
492
  },
372
493
  children: [
373
- /* @__PURE__ */ jsx2(
494
+ /* @__PURE__ */ jsx3(
374
495
  "div",
375
496
  {
376
497
  className: "working-dot",
@@ -383,7 +504,7 @@ var WorkingOverlay = ({
383
504
  }
384
505
  }
385
506
  ),
386
- /* @__PURE__ */ jsx2(
507
+ /* @__PURE__ */ jsx3(
387
508
  "div",
388
509
  {
389
510
  className: "working-dot",
@@ -396,7 +517,7 @@ var WorkingOverlay = ({
396
517
  }
397
518
  }
398
519
  ),
399
- /* @__PURE__ */ jsx2(
520
+ /* @__PURE__ */ jsx3(
400
521
  "div",
401
522
  {
402
523
  className: "working-dot",
@@ -412,7 +533,7 @@ var WorkingOverlay = ({
412
533
  ]
413
534
  }
414
535
  ),
415
- /* @__PURE__ */ jsx2(
536
+ /* @__PURE__ */ jsx3(
416
537
  "div",
417
538
  {
418
539
  style: {
@@ -424,7 +545,7 @@ var WorkingOverlay = ({
424
545
  children: message
425
546
  }
426
547
  ),
427
- subtitle && /* @__PURE__ */ jsx2(
548
+ subtitle && /* @__PURE__ */ jsx3(
428
549
  "div",
429
550
  {
430
551
  style: {
@@ -441,7 +562,7 @@ var WorkingOverlay = ({
441
562
  };
442
563
 
443
564
  // src/components/ThemedTerminal.tsx
444
- import { Fragment, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
565
+ import { Fragment, jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
445
566
  var DEBUG_RESIZE = true;
446
567
  var ThemedTerminal = forwardRef(
447
568
  ({
@@ -530,7 +651,7 @@ var ThemedTerminal = forwardRef(
530
651
  setIsClosingOverlay(true);
531
652
  }
532
653
  }, [isWorking]);
533
- const handleOverlayCloseComplete = useCallback(() => {
654
+ const handleOverlayCloseComplete = useCallback2(() => {
534
655
  setShowWorkingOverlay(false);
535
656
  setIsClosingOverlay(false);
536
657
  const tracer = getTracer();
@@ -543,7 +664,7 @@ var ThemedTerminal = forwardRef(
543
664
  span.setStatus({ code: SpanStatusCode.OK });
544
665
  span.end();
545
666
  }, []);
546
- const trackActivity = useCallback(() => {
667
+ const trackActivity = useCallback2(() => {
547
668
  if (!activityDetection) return;
548
669
  if (activityTimeoutRef.current) {
549
670
  clearTimeout(activityTimeoutRef.current);
@@ -599,78 +720,20 @@ var ThemedTerminal = forwardRef(
599
720
  }
600
721
  };
601
722
  }, []);
602
- const handleDroppedContent = useCallback(
723
+ const insertDroppedText = useCallback2(
603
724
  (content) => {
604
- if (terminal) {
605
- terminal.paste(content);
606
- setTimeout(() => {
607
- terminal.focus();
608
- }, 10);
609
- }
725
+ terminal?.paste(content);
610
726
  },
611
727
  [terminal]
612
728
  );
613
- const getDroppedImageFiles = useCallback(
614
- (e) => {
615
- const list = e.dataTransfer?.files;
616
- if (!list || list.length === 0) return [];
617
- return Array.from(list).filter((f) => f.type.startsWith("image/"));
618
- },
619
- []
620
- );
621
- const handleDroppedImageFiles = useCallback(
622
- async (files) => {
623
- if (!onFilesDropped || files.length === 0) return;
624
- try {
625
- const payload = await Promise.all(
626
- files.map(async (file) => ({
627
- name: file.name || "pasted-image.png",
628
- mimeType: file.type || "image/png",
629
- data: new Uint8Array(await file.arrayBuffer())
630
- }))
631
- );
632
- const paths = await onFilesDropped(payload);
633
- if (paths && paths.length > 0) {
634
- handleDroppedContent(`${paths.map(sanitizePath).join(" ")} `);
635
- }
636
- } catch (err) {
637
- console.error("[ThemedTerminal] Failed to handle dropped files:", err);
638
- }
639
- },
640
- [onFilesDropped, handleDroppedContent]
641
- );
642
- const { isDragOver, onDrop: handlePanelDrop, ...dropZoneProps } = useDropZone({
643
- handlers: [
644
- {
645
- dataType: [DATA_TYPES2.FILE_PATH, DATA_TYPES2.DIRECTORY_PATH],
646
- onDrop: (data) => {
647
- const safePath = sanitizePath(data.primaryData);
648
- handleDroppedContent(safePath);
649
- }
650
- },
651
- {
652
- dataType: DATA_TYPES2.TEXT_SELECTION,
653
- onDrop: (data) => {
654
- handleDroppedContent(data.primaryData);
655
- }
656
- }
657
- ],
658
- onPlainTextDrop: (text, e) => {
659
- if (getDroppedImageFiles(e).length > 0) return;
660
- handleDroppedContent(text);
661
- },
662
- showVisualFeedback: true
729
+ const focusTerminal = useCallback2(() => {
730
+ terminal?.focus();
731
+ }, [terminal]);
732
+ const { dropZoneProps, handleDrop, dropIndicator } = useTerminalDropZone({
733
+ insertText: insertDroppedText,
734
+ focus: focusTerminal,
735
+ onFilesDropped
663
736
  });
664
- const handleDrop = useCallback(
665
- (e) => {
666
- const imageFiles = getDroppedImageFiles(e);
667
- handlePanelDrop(e);
668
- if (imageFiles.length > 0) {
669
- void handleDroppedImageFiles(imageFiles);
670
- }
671
- },
672
- [handlePanelDrop, getDroppedImageFiles, handleDroppedImageFiles]
673
- );
674
737
  useEffect(() => {
675
738
  isVisibleRef.current = isVisible;
676
739
  }, [isVisible]);
@@ -1192,8 +1255,8 @@ var ThemedTerminal = forwardRef(
1192
1255
  },
1193
1256
  children: [
1194
1257
  /* @__PURE__ */ jsxs3("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
1195
- /* @__PURE__ */ jsx3(TerminalIcon, { size: 16, color: theme.colors.text }),
1196
- /* @__PURE__ */ jsx3(
1258
+ /* @__PURE__ */ jsx4(TerminalIcon, { size: 16, color: theme.colors.text }),
1259
+ /* @__PURE__ */ jsx4(
1197
1260
  "span",
1198
1261
  {
1199
1262
  style: {
@@ -1204,7 +1267,7 @@ var ThemedTerminal = forwardRef(
1204
1267
  children: headerTitle
1205
1268
  }
1206
1269
  ),
1207
- headerSubtitle && /* @__PURE__ */ jsx3(
1270
+ headerSubtitle && /* @__PURE__ */ jsx4(
1208
1271
  "span",
1209
1272
  {
1210
1273
  style: {
@@ -1215,7 +1278,7 @@ var ThemedTerminal = forwardRef(
1215
1278
  }
1216
1279
  ),
1217
1280
  headerBadge && /* @__PURE__ */ jsxs3(Fragment, { children: [
1218
- /* @__PURE__ */ jsx3(
1281
+ /* @__PURE__ */ jsx4(
1219
1282
  "span",
1220
1283
  {
1221
1284
  style: {
@@ -1225,7 +1288,7 @@ var ThemedTerminal = forwardRef(
1225
1288
  children: "\u2022"
1226
1289
  }
1227
1290
  ),
1228
- /* @__PURE__ */ jsx3(
1291
+ /* @__PURE__ */ jsx4(
1229
1292
  "span",
1230
1293
  {
1231
1294
  style: {
@@ -1238,7 +1301,7 @@ var ThemedTerminal = forwardRef(
1238
1301
  ] })
1239
1302
  ] }),
1240
1303
  /* @__PURE__ */ jsxs3("div", { style: { display: "flex", gap: "8px" }, children: [
1241
- onPopOut && /* @__PURE__ */ jsx3(
1304
+ onPopOut && /* @__PURE__ */ jsx4(
1242
1305
  "button",
1243
1306
  {
1244
1307
  type: "button",
@@ -1265,10 +1328,10 @@ var ThemedTerminal = forwardRef(
1265
1328
  e.currentTarget.style.color = theme.colors.textSecondary;
1266
1329
  },
1267
1330
  title: "Open terminal in new window",
1268
- children: /* @__PURE__ */ jsx3(ExternalLink, { size: 16 })
1331
+ children: /* @__PURE__ */ jsx4(ExternalLink, { size: 16 })
1269
1332
  }
1270
1333
  ),
1271
- onClose && /* @__PURE__ */ jsx3(
1334
+ onClose && /* @__PURE__ */ jsx4(
1272
1335
  "button",
1273
1336
  {
1274
1337
  type: "button",
@@ -1295,10 +1358,10 @@ var ThemedTerminal = forwardRef(
1295
1358
  e.currentTarget.style.color = theme.colors.textSecondary;
1296
1359
  },
1297
1360
  title: "Hide terminal (keeps session running)",
1298
- children: /* @__PURE__ */ jsx3(ChevronDown, { size: 16 })
1361
+ children: /* @__PURE__ */ jsx4(ChevronDown, { size: 16 })
1299
1362
  }
1300
1363
  ),
1301
- onDestroy && /* @__PURE__ */ jsx3(
1364
+ onDestroy && /* @__PURE__ */ jsx4(
1302
1365
  "button",
1303
1366
  {
1304
1367
  type: "button",
@@ -1325,7 +1388,7 @@ var ThemedTerminal = forwardRef(
1325
1388
  e.currentTarget.style.color = theme.colors.textSecondary;
1326
1389
  },
1327
1390
  title: "Close terminal session (terminate process)",
1328
- children: /* @__PURE__ */ jsx3(X, { size: 16 })
1391
+ children: /* @__PURE__ */ jsx4(X, { size: 16 })
1329
1392
  }
1330
1393
  )
1331
1394
  ] })
@@ -1348,38 +1411,8 @@ var ThemedTerminal = forwardRef(
1348
1411
  minHeight: 0
1349
1412
  },
1350
1413
  children: [
1351
- isDragOver && /* @__PURE__ */ jsx3(
1352
- "div",
1353
- {
1354
- style: {
1355
- position: "absolute",
1356
- inset: 0,
1357
- background: "rgba(59, 130, 246, 0.1)",
1358
- border: "2px dashed #3b82f6",
1359
- borderRadius: "4px",
1360
- display: "flex",
1361
- alignItems: "center",
1362
- justifyContent: "center",
1363
- pointerEvents: "none",
1364
- zIndex: 1e3
1365
- },
1366
- children: /* @__PURE__ */ jsx3(
1367
- "div",
1368
- {
1369
- style: {
1370
- padding: "8px 16px",
1371
- background: "#3b82f6",
1372
- color: "white",
1373
- borderRadius: "4px",
1374
- fontSize: "13px",
1375
- fontWeight: 500
1376
- },
1377
- children: "Drop to insert"
1378
- }
1379
- )
1380
- }
1381
- ),
1382
- enableSelectionDrag && selectionDrag && /* @__PURE__ */ jsx3(
1414
+ dropIndicator,
1415
+ enableSelectionDrag && selectionDrag && /* @__PURE__ */ jsx4(
1383
1416
  SelectionDragChip,
1384
1417
  {
1385
1418
  text: selectionDrag.text,
@@ -1416,7 +1449,7 @@ var ThemedTerminal = forwardRef(
1416
1449
  animation: "copy-feedback-in 0.15s ease-out"
1417
1450
  },
1418
1451
  children: [
1419
- /* @__PURE__ */ jsx3(Check, { size: 14, strokeWidth: 3 }),
1452
+ /* @__PURE__ */ jsx4(Check, { size: 14, strokeWidth: 3 }),
1420
1453
  "Copied!"
1421
1454
  ]
1422
1455
  }
@@ -1441,8 +1474,8 @@ var ThemedTerminal = forwardRef(
1441
1474
  zIndex: 10
1442
1475
  },
1443
1476
  children: [
1444
- /* @__PURE__ */ jsx3(Monitor, { size: 48, color: theme.colors.textSecondary }),
1445
- /* @__PURE__ */ jsx3(
1477
+ /* @__PURE__ */ jsx4(Monitor, { size: 48, color: theme.colors.textSecondary }),
1478
+ /* @__PURE__ */ jsx4(
1446
1479
  "div",
1447
1480
  {
1448
1481
  style: {
@@ -1454,7 +1487,7 @@ var ThemedTerminal = forwardRef(
1454
1487
  children: overlayState.message
1455
1488
  }
1456
1489
  ),
1457
- overlayState.subtitle && /* @__PURE__ */ jsx3(
1490
+ overlayState.subtitle && /* @__PURE__ */ jsx4(
1458
1491
  "div",
1459
1492
  {
1460
1493
  style: {
@@ -1466,7 +1499,7 @@ var ThemedTerminal = forwardRef(
1466
1499
  children: overlayState.subtitle
1467
1500
  }
1468
1501
  ),
1469
- overlayState.actions && overlayState.actions.length > 0 && /* @__PURE__ */ jsx3(
1502
+ overlayState.actions && overlayState.actions.length > 0 && /* @__PURE__ */ jsx4(
1470
1503
  "div",
1471
1504
  {
1472
1505
  style: {
@@ -1519,7 +1552,7 @@ var ThemedTerminal = forwardRef(
1519
1552
  ]
1520
1553
  }
1521
1554
  ),
1522
- showWorkingOverlay && !overlayState && /* @__PURE__ */ jsx3(
1555
+ showWorkingOverlay && !overlayState && /* @__PURE__ */ jsx4(
1523
1556
  WorkingOverlay,
1524
1557
  {
1525
1558
  theme,
@@ -1542,16 +1575,16 @@ ThemedTerminal.displayName = "ThemedTerminal";
1542
1575
  // src/components/ThemedTerminalWithProvider.tsx
1543
1576
  import { useTheme } from "@principal-ade/industry-theme";
1544
1577
  import { forwardRef as forwardRef2 } from "react";
1545
- import { jsx as jsx4 } from "react/jsx-runtime";
1578
+ import { jsx as jsx5 } from "react/jsx-runtime";
1546
1579
  var ThemedTerminalWithProvider = forwardRef2((props, ref) => {
1547
1580
  const { theme } = useTheme();
1548
- return /* @__PURE__ */ jsx4(ThemedTerminal, { ref, theme, ...props });
1581
+ return /* @__PURE__ */ jsx5(ThemedTerminal, { ref, theme, ...props });
1549
1582
  });
1550
1583
  ThemedTerminalWithProvider.displayName = "ThemedTerminalWithProvider";
1551
1584
 
1552
1585
  // src/components/ProgramStatusBadge.tsx
1553
1586
  import { useTheme as useTheme2 } from "@principal-ade/industry-theme";
1554
- import { jsx as jsx5 } from "react/jsx-runtime";
1587
+ import { jsx as jsx6 } from "react/jsx-runtime";
1555
1588
  var blockedColor = (kind, colors) => {
1556
1589
  switch (kind) {
1557
1590
  case "auth":
@@ -1572,7 +1605,7 @@ var formatProgramStatusRecord = (record) => {
1572
1605
  if (record.title) parts.push(`title=${record.title}`);
1573
1606
  return parts.join("; ");
1574
1607
  };
1575
- var WaveBars = ({ color, animate }) => /* @__PURE__ */ jsx5("div", { style: { display: "flex", gap: 1, alignItems: "center", height: 12 }, children: [0, 1, 2, 3, 4].map((i) => /* @__PURE__ */ jsx5(
1608
+ var WaveBars = ({ color, animate }) => /* @__PURE__ */ jsx6("div", { style: { display: "flex", gap: 1, alignItems: "center", height: 12 }, children: [0, 1, 2, 3, 4].map((i) => /* @__PURE__ */ jsx6(
1576
1609
  "div",
1577
1610
  {
1578
1611
  style: {
@@ -1594,17 +1627,17 @@ var ProgramStatusBadge = ({
1594
1627
  const { theme } = useTheme2();
1595
1628
  switch (record.state) {
1596
1629
  case "working":
1597
- return /* @__PURE__ */ jsx5(
1630
+ return /* @__PURE__ */ jsx6(
1598
1631
  "span",
1599
1632
  {
1600
1633
  title: formatProgramStatusRecord(record),
1601
1634
  style: { display: "flex", alignItems: "center" },
1602
- children: /* @__PURE__ */ jsx5(WaveBars, { color: theme.colors.primary, animate })
1635
+ children: /* @__PURE__ */ jsx6(WaveBars, { color: theme.colors.primary, animate })
1603
1636
  }
1604
1637
  );
1605
1638
  case "blocked": {
1606
1639
  const color = blockedColor(record.kind, theme.colors);
1607
- return /* @__PURE__ */ jsx5(
1640
+ return /* @__PURE__ */ jsx6(
1608
1641
  "span",
1609
1642
  {
1610
1643
  title: formatProgramStatusRecord(record),
@@ -1628,7 +1661,7 @@ var ProgramStatusBadge = ({
1628
1661
  );
1629
1662
  }
1630
1663
  case "done":
1631
- return /* @__PURE__ */ jsx5(
1664
+ return /* @__PURE__ */ jsx6(
1632
1665
  "span",
1633
1666
  {
1634
1667
  title: formatProgramStatusRecord(record),
@@ -1642,7 +1675,7 @@ var ProgramStatusBadge = ({
1642
1675
  }
1643
1676
  );
1644
1677
  case "error":
1645
- return /* @__PURE__ */ jsx5(
1678
+ return /* @__PURE__ */ jsx6(
1646
1679
  "span",
1647
1680
  {
1648
1681
  title: formatProgramStatusRecord(record),
@@ -1664,7 +1697,7 @@ ProgramStatusBadge.displayName = "ProgramStatusBadge";
1664
1697
 
1665
1698
  // src/renderer/XtermRenderer.tsx
1666
1699
  import { forwardRef as forwardRef3, useImperativeHandle as useImperativeHandle2, useRef as useRef2 } from "react";
1667
- import { jsx as jsx6 } from "react/jsx-runtime";
1700
+ import { jsx as jsx7 } from "react/jsx-runtime";
1668
1701
  var XtermRenderer = forwardRef3(
1669
1702
  (props, ref) => {
1670
1703
  const {
@@ -1703,7 +1736,7 @@ var XtermRenderer = forwardRef3(
1703
1736
  }),
1704
1737
  []
1705
1738
  );
1706
- return /* @__PURE__ */ jsx6(
1739
+ return /* @__PURE__ */ jsx7(
1707
1740
  ThemedTerminalWithProvider,
1708
1741
  {
1709
1742
  ref: innerRef,
@@ -1724,7 +1757,7 @@ XtermRenderer.displayName = "XtermRenderer";
1724
1757
  // src/renderer/GhosttyRenderer.tsx
1725
1758
  import { useTheme as useTheme3 } from "@principal-ade/industry-theme";
1726
1759
  import { FitAddon as FitAddon2, Terminal as Terminal2 } from "ghostty-web";
1727
- import { forwardRef as forwardRef4, useCallback as useCallback2, useEffect as useEffect2, useImperativeHandle as useImperativeHandle3, useRef as useRef3 } from "react";
1760
+ import { forwardRef as forwardRef4, useCallback as useCallback3, useEffect as useEffect2, useImperativeHandle as useImperativeHandle3, useRef as useRef3 } from "react";
1728
1761
 
1729
1762
  // src/renderer/ghosttyInit.ts
1730
1763
  import { init } from "ghostty-web";
@@ -1737,7 +1770,7 @@ function ensureGhostty() {
1737
1770
  }
1738
1771
 
1739
1772
  // src/renderer/GhosttyRenderer.tsx
1740
- import { jsx as jsx7 } from "react/jsx-runtime";
1773
+ import { jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
1741
1774
  var DEFAULT_FONT_STACK = "JetBrains Mono, Menlo, Monaco, monospace";
1742
1775
  var GhosttyRenderer = forwardRef4(
1743
1776
  (props, ref) => {
@@ -1755,9 +1788,10 @@ var GhosttyRenderer = forwardRef4(
1755
1788
  cursorBlink = true,
1756
1789
  cursorStyle,
1757
1790
  fontFamily,
1758
- fontSize = 14
1791
+ fontSize = 14,
1792
+ onFilesDropped
1759
1793
  // Accepted but intentionally not implemented yet:
1760
- // onLinkClick, onFilesDropped
1794
+ // onLinkClick
1761
1795
  } = props;
1762
1796
  const { theme } = useTheme3();
1763
1797
  const containerRef = useRef3(null);
@@ -1769,7 +1803,7 @@ var GhosttyRenderer = forwardRef4(
1769
1803
  autoFocusRef.current = autoFocus;
1770
1804
  const callbacks = useRef3({ onData, onResize, onReady, onScrollPositionChange, onShortcut });
1771
1805
  callbacks.current = { onData, onResize, onReady, onScrollPositionChange, onShortcut };
1772
- const readScrollPosition = useCallback2(() => {
1806
+ const readScrollPosition = useCallback3(() => {
1773
1807
  const term = termRef.current;
1774
1808
  if (!term) return { isAtTop: false, isAtBottom: true };
1775
1809
  const viewportY = typeof term.viewportY === "number" ? term.viewportY : 0;
@@ -1779,7 +1813,7 @@ var GhosttyRenderer = forwardRef4(
1779
1813
  isAtTop: scrollbackLength <= 0 || viewportY >= scrollbackLength - 0.5
1780
1814
  };
1781
1815
  }, []);
1782
- const fit = useCallback2(() => {
1816
+ const fit = useCallback3(() => {
1783
1817
  const term = termRef.current;
1784
1818
  const addon = fitRef.current;
1785
1819
  if (!term || !addon) return;
@@ -1794,7 +1828,7 @@ var GhosttyRenderer = forwardRef4(
1794
1828
  }
1795
1829
  }
1796
1830
  }, []);
1797
- const write = useCallback2((data) => {
1831
+ const write = useCallback3((data) => {
1798
1832
  const term = termRef.current;
1799
1833
  if (term) {
1800
1834
  term.write(data);
@@ -1849,6 +1883,16 @@ var GhosttyRenderer = forwardRef4(
1849
1883
  }
1850
1884
  return false;
1851
1885
  });
1886
+ term.attachCustomWheelEventHandler((event) => {
1887
+ if (term.hasMouseTracking() && !event.shiftKey) return false;
1888
+ if (term.buffer.active.type !== "alternate") return false;
1889
+ const appCursor = term.getMode(1, false);
1890
+ const scrollingUp = event.deltaY < 0;
1891
+ const lines = Math.min(Math.abs(Math.round(event.deltaY / 33)), 5);
1892
+ const sequence = appCursor ? scrollingUp ? "\x1BOA" : "\x1BOB" : scrollingUp ? "\x1B[A" : "\x1B[B";
1893
+ for (let i = 0; i < lines; i += 1) callbacks.current.onData?.(sequence);
1894
+ return true;
1895
+ });
1852
1896
  fit();
1853
1897
  if (pendingWritesRef.current.length > 0) {
1854
1898
  const pending = pendingWritesRef.current;
@@ -1893,6 +1937,17 @@ var GhosttyRenderer = forwardRef4(
1893
1937
  useEffect2(() => {
1894
1938
  if (isVisible && autoFocus) termRef.current?.focus();
1895
1939
  }, [isVisible, autoFocus]);
1940
+ const insertDroppedText = useCallback3((content) => {
1941
+ termRef.current?.paste(content);
1942
+ }, []);
1943
+ const focusTerminal = useCallback3(() => {
1944
+ termRef.current?.focus();
1945
+ }, []);
1946
+ const { dropZoneProps, handleDrop, dropIndicator } = useTerminalDropZone({
1947
+ insertText: insertDroppedText,
1948
+ focus: focusTerminal,
1949
+ onFilesDropped
1950
+ });
1896
1951
  useImperativeHandle3(
1897
1952
  ref,
1898
1953
  () => ({
@@ -1913,20 +1968,30 @@ var GhosttyRenderer = forwardRef4(
1913
1968
  }),
1914
1969
  [fit, readScrollPosition, write]
1915
1970
  );
1916
- return /* @__PURE__ */ jsx7(
1917
- "div",
1918
- {
1919
- ref: containerRef,
1920
- style: {
1921
- width: "100%",
1922
- height: "100%",
1923
- backgroundColor: transparent ? "transparent" : theme.colors.background,
1924
- // ghostty-web's open() sets contenteditable on this container, so the
1925
- // browser would draw its own text caret on top of the canvas cursor.
1926
- // Hide it — the terminal renders its own cursor.
1927
- caretColor: "transparent"
1928
- }
1929
- }
1971
+ return (
1972
+ // ghostty-web owns its container's children (open() appends the canvas and
1973
+ // a hidden textarea), so the drop indicator lives on a wrapper instead of
1974
+ // inside it — no imperative/React child conflicts.
1975
+ /* @__PURE__ */ jsxs4("div", { style: { position: "relative", width: "100%", height: "100%" }, children: [
1976
+ /* @__PURE__ */ jsx8(
1977
+ "div",
1978
+ {
1979
+ ref: containerRef,
1980
+ ...dropZoneProps,
1981
+ onDrop: handleDrop,
1982
+ style: {
1983
+ width: "100%",
1984
+ height: "100%",
1985
+ backgroundColor: transparent ? "transparent" : theme.colors.background,
1986
+ // ghostty-web's open() sets contenteditable on this container, so the
1987
+ // browser would draw its own text caret on top of the canvas cursor.
1988
+ // Hide it — the terminal renders its own cursor.
1989
+ caretColor: "transparent"
1990
+ }
1991
+ }
1992
+ ),
1993
+ dropIndicator
1994
+ ] })
1930
1995
  );
1931
1996
  }
1932
1997
  );
@@ -1944,7 +2009,7 @@ function resolveRenderer(choice) {
1944
2009
  import { useTheme as useTheme4 } from "@principal-ade/industry-theme";
1945
2010
  import {
1946
2011
  forwardRef as forwardRef5,
1947
- useCallback as useCallback3,
2012
+ useCallback as useCallback4,
1948
2013
  useEffect as useEffect3,
1949
2014
  useImperativeHandle as useImperativeHandle4,
1950
2015
  useRef as useRef4,
@@ -1953,8 +2018,8 @@ import {
1953
2018
 
1954
2019
  // src/components/TerminalOverlay.tsx
1955
2020
  import { Monitor as Monitor2 } from "lucide-react";
1956
- import { jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
1957
- var TerminalOverlay = ({ state, theme }) => /* @__PURE__ */ jsxs4(
2021
+ import { jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
2022
+ var TerminalOverlay = ({ state, theme }) => /* @__PURE__ */ jsxs5(
1958
2023
  "div",
1959
2024
  {
1960
2025
  style: {
@@ -1974,8 +2039,8 @@ var TerminalOverlay = ({ state, theme }) => /* @__PURE__ */ jsxs4(
1974
2039
  zIndex: 10
1975
2040
  },
1976
2041
  children: [
1977
- /* @__PURE__ */ jsx8(Monitor2, { size: 48, color: theme.colors.textSecondary }),
1978
- /* @__PURE__ */ jsx8(
2042
+ /* @__PURE__ */ jsx9(Monitor2, { size: 48, color: theme.colors.textSecondary }),
2043
+ /* @__PURE__ */ jsx9(
1979
2044
  "div",
1980
2045
  {
1981
2046
  style: {
@@ -1987,7 +2052,7 @@ var TerminalOverlay = ({ state, theme }) => /* @__PURE__ */ jsxs4(
1987
2052
  children: state.message
1988
2053
  }
1989
2054
  ),
1990
- state.subtitle && /* @__PURE__ */ jsx8(
2055
+ state.subtitle && /* @__PURE__ */ jsx9(
1991
2056
  "div",
1992
2057
  {
1993
2058
  style: {
@@ -1999,7 +2064,7 @@ var TerminalOverlay = ({ state, theme }) => /* @__PURE__ */ jsxs4(
1999
2064
  children: state.subtitle
2000
2065
  }
2001
2066
  ),
2002
- state.actions && state.actions.length > 0 && /* @__PURE__ */ jsx8(
2067
+ state.actions && state.actions.length > 0 && /* @__PURE__ */ jsx9(
2003
2068
  "div",
2004
2069
  {
2005
2070
  style: {
@@ -2007,7 +2072,7 @@ var TerminalOverlay = ({ state, theme }) => /* @__PURE__ */ jsxs4(
2007
2072
  gap: "12px",
2008
2073
  marginTop: "8px"
2009
2074
  },
2010
- children: state.actions.map((action) => /* @__PURE__ */ jsxs4(
2075
+ children: state.actions.map((action) => /* @__PURE__ */ jsxs5(
2011
2076
  "button",
2012
2077
  {
2013
2078
  type: "button",
@@ -2054,7 +2119,7 @@ var TerminalOverlay = ({ state, theme }) => /* @__PURE__ */ jsxs4(
2054
2119
  );
2055
2120
 
2056
2121
  // src/components/TerminalSession.tsx
2057
- import { jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
2122
+ import { jsx as jsx10, jsxs as jsxs6 } from "react/jsx-runtime";
2058
2123
  var TerminalSession = forwardRef5(
2059
2124
  (props, ref) => {
2060
2125
  const {
@@ -2098,7 +2163,7 @@ var TerminalSession = forwardRef5(
2098
2163
  const isActiveRef = useRef4(false);
2099
2164
  const activityStartedAtRef = useRef4(0);
2100
2165
  const activityTimerRef = useRef4(null);
2101
- const claimAndConnect = useCallback3(
2166
+ const claimAndConnect = useCallback4(
2102
2167
  async (targetSessionId, force = false) => {
2103
2168
  if (!enableOwnership) return;
2104
2169
  try {
@@ -2223,7 +2288,7 @@ var TerminalSession = forwardRef5(
2223
2288
  }
2224
2289
  };
2225
2290
  }, []);
2226
- const observeActivity = useCallback3(() => {
2291
+ const observeActivity = useCallback4(() => {
2227
2292
  if (!activityDetection) return;
2228
2293
  const now = Date.now();
2229
2294
  const emitBus = (isWorking2) => {
@@ -2273,7 +2338,7 @@ var TerminalSession = forwardRef5(
2273
2338
  if (activityTimerRef.current) clearTimeout(activityTimerRef.current);
2274
2339
  };
2275
2340
  }, []);
2276
- const handleData = useCallback3(
2341
+ const handleData = useCallback4(
2277
2342
  (data) => {
2278
2343
  if (localSessionId && actions.writeToTerminal) {
2279
2344
  actions.writeToTerminal(localSessionId, data);
@@ -2281,14 +2346,14 @@ var TerminalSession = forwardRef5(
2281
2346
  },
2282
2347
  [localSessionId, actions]
2283
2348
  );
2284
- const handleFilesDropped = useCallback3(
2349
+ const handleFilesDropped = useCallback4(
2285
2350
  async (files) => {
2286
2351
  if (!localSessionId || !actions.saveDroppedFiles) return [];
2287
2352
  return actions.saveDroppedFiles(files, localSessionId);
2288
2353
  },
2289
2354
  [localSessionId, actions]
2290
2355
  );
2291
- const handleResize = useCallback3(
2356
+ const handleResize = useCallback4(
2292
2357
  (cols, rows) => {
2293
2358
  if (localSessionId && actions.resizeTerminal) {
2294
2359
  actions.resizeTerminal(localSessionId, cols, rows);
@@ -2296,7 +2361,7 @@ var TerminalSession = forwardRef5(
2296
2361
  },
2297
2362
  [localSessionId, actions]
2298
2363
  );
2299
- const handleReady = useCallback3(
2364
+ const handleReady = useCallback4(
2300
2365
  (cols, rows) => {
2301
2366
  if (!localSessionId || !actions.resizeTerminal) return;
2302
2367
  const shouldForce = needsRefreshOnResizeRef.current;
@@ -2324,7 +2389,7 @@ var TerminalSession = forwardRef5(
2324
2389
  },
2325
2390
  [localSessionId, actions]
2326
2391
  );
2327
- const handleLinkClickInternal = useCallback3(
2392
+ const handleLinkClickInternal = useCallback4(
2328
2393
  (url, modifiers) => {
2329
2394
  onLinkClick?.(url, modifiers);
2330
2395
  if (localSessionId && events) {
@@ -2345,7 +2410,7 @@ var TerminalSession = forwardRef5(
2345
2410
  },
2346
2411
  [localSessionId, events, onLinkClick]
2347
2412
  );
2348
- const handleShortcutInternal = useCallback3(
2413
+ const handleShortcutInternal = useCallback4(
2349
2414
  (evt) => {
2350
2415
  onShortcut?.(evt);
2351
2416
  if (localSessionId && events) {
@@ -2362,7 +2427,7 @@ var TerminalSession = forwardRef5(
2362
2427
  },
2363
2428
  [localSessionId, events, onShortcut]
2364
2429
  );
2365
- const handleScrollPositionChangeInternal = useCallback3(
2430
+ const handleScrollPositionChangeInternal = useCallback4(
2366
2431
  (p) => {
2367
2432
  onScrollPositionChange?.(p);
2368
2433
  },
@@ -2381,7 +2446,7 @@ var TerminalSession = forwardRef5(
2381
2446
  unsubscribe();
2382
2447
  };
2383
2448
  }, [enableOwnership, localSessionId, actions]);
2384
- const handleTakeControl = useCallback3(async () => {
2449
+ const handleTakeControl = useCallback4(async () => {
2385
2450
  if (!localSessionId) return;
2386
2451
  await claimAndConnect(localSessionId, true);
2387
2452
  }, [localSessionId, claimAndConnect]);
@@ -2396,7 +2461,7 @@ var TerminalSession = forwardRef5(
2396
2461
  [localSessionId]
2397
2462
  );
2398
2463
  if (!isInitialized) {
2399
- return /* @__PURE__ */ jsxs5(
2464
+ return /* @__PURE__ */ jsxs6(
2400
2465
  "div",
2401
2466
  {
2402
2467
  style: {
@@ -2407,7 +2472,7 @@ var TerminalSession = forwardRef5(
2407
2472
  padding: "10px 0 0 10px"
2408
2473
  },
2409
2474
  children: [
2410
- /* @__PURE__ */ jsx9(
2475
+ /* @__PURE__ */ jsx10(
2411
2476
  "div",
2412
2477
  {
2413
2478
  style: {
@@ -2418,7 +2483,7 @@ var TerminalSession = forwardRef5(
2418
2483
  }
2419
2484
  }
2420
2485
  ),
2421
- /* @__PURE__ */ jsx9("style", { children: `@keyframes terminal-session-cursor-blink {
2486
+ /* @__PURE__ */ jsx10("style", { children: `@keyframes terminal-session-cursor-blink {
2422
2487
  0%, 100% { opacity: 1; }
2423
2488
  50% { opacity: 0; }
2424
2489
  }` })
@@ -2439,8 +2504,8 @@ var TerminalSession = forwardRef5(
2439
2504
  opacity: 1
2440
2505
  } : void 0;
2441
2506
  const effectiveOverlay = ownershipLostOverlay ?? overlayState;
2442
- return /* @__PURE__ */ jsxs5("div", { style: { position: "relative", height: "100%", width: "100%" }, children: [
2443
- /* @__PURE__ */ jsx9(
2507
+ return /* @__PURE__ */ jsxs6("div", { style: { position: "relative", height: "100%", width: "100%" }, children: [
2508
+ /* @__PURE__ */ jsx10(
2444
2509
  Renderer,
2445
2510
  {
2446
2511
  ref: rendererRef,
@@ -2459,8 +2524,8 @@ var TerminalSession = forwardRef5(
2459
2524
  },
2460
2525
  shouldRenderTerminal ? "active" : "overlay"
2461
2526
  ),
2462
- effectiveOverlay && /* @__PURE__ */ jsx9(TerminalOverlay, { state: effectiveOverlay, theme }),
2463
- isWorking && !effectiveOverlay && /* @__PURE__ */ jsx9(
2527
+ effectiveOverlay && /* @__PURE__ */ jsx10(TerminalOverlay, { state: effectiveOverlay, theme }),
2528
+ isWorking && !effectiveOverlay && /* @__PURE__ */ jsx10(
2464
2529
  WorkingOverlay,
2465
2530
  {
2466
2531
  theme,
@@ -2516,12 +2581,12 @@ function useThemedTerminal() {
2516
2581
  // src/components/TabBar/TabBar.tsx
2517
2582
  import { useTheme as useTheme7 } from "@principal-ade/industry-theme";
2518
2583
  import { Plus } from "lucide-react";
2519
- import { useState as useState3, useCallback as useCallback5 } from "react";
2584
+ import { useState as useState3, useCallback as useCallback6 } from "react";
2520
2585
 
2521
2586
  // src/components/TabBar/TabButton.tsx
2522
2587
  import { useTheme as useTheme6 } from "@principal-ade/industry-theme";
2523
- import { useCallback as useCallback4 } from "react";
2524
- import { jsx as jsx10, jsxs as jsxs6 } from "react/jsx-runtime";
2588
+ import { useCallback as useCallback5 } from "react";
2589
+ import { jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
2525
2590
  var TabButton = ({
2526
2591
  tab,
2527
2592
  isActive,
@@ -2548,7 +2613,7 @@ var TabButton = ({
2548
2613
  const { theme } = useTheme6();
2549
2614
  const showCloseButton = isHovered || isActive;
2550
2615
  const closable = tab.closable !== false;
2551
- const handleDragStart = useCallback4(
2616
+ const handleDragStart = useCallback5(
2552
2617
  (e) => {
2553
2618
  const target = e.currentTarget;
2554
2619
  e.dataTransfer.setData("application/x-tab-association", tab.id);
@@ -2576,10 +2641,10 @@ var TabButton = ({
2576
2641
  },
2577
2642
  [tab.id, onDragStart]
2578
2643
  );
2579
- const handleDragEnd = useCallback4(() => {
2644
+ const handleDragEnd = useCallback5(() => {
2580
2645
  onDragEnd?.();
2581
2646
  }, [onDragEnd]);
2582
- const handleDragOver = useCallback4(
2647
+ const handleDragOver = useCallback5(
2583
2648
  (e) => {
2584
2649
  if (canAcceptDrop) {
2585
2650
  e.preventDefault();
@@ -2588,7 +2653,7 @@ var TabButton = ({
2588
2653
  },
2589
2654
  [canAcceptDrop]
2590
2655
  );
2591
- const handleDrop = useCallback4(
2656
+ const handleDrop = useCallback5(
2592
2657
  (e) => {
2593
2658
  e.preventDefault();
2594
2659
  const draggedTabId = e.dataTransfer.getData("application/x-tab-association");
@@ -2598,14 +2663,14 @@ var TabButton = ({
2598
2663
  },
2599
2664
  [tab.id, onDrop]
2600
2665
  );
2601
- const handleDragEnter = useCallback4(
2666
+ const handleDragEnter = useCallback5(
2602
2667
  (e) => {
2603
2668
  e.preventDefault();
2604
2669
  onDragEnter?.();
2605
2670
  },
2606
2671
  [onDragEnter]
2607
2672
  );
2608
- const handleDragLeave = useCallback4(
2673
+ const handleDragLeave = useCallback5(
2609
2674
  (e) => {
2610
2675
  e.preventDefault();
2611
2676
  onDragLeave?.();
@@ -2622,7 +2687,7 @@ var TabButton = ({
2622
2687
  }
2623
2688
  return {};
2624
2689
  };
2625
- return /* @__PURE__ */ jsxs6(
2690
+ return /* @__PURE__ */ jsxs7(
2626
2691
  "div",
2627
2692
  {
2628
2693
  "data-tab-id": tab.id,
@@ -2664,7 +2729,7 @@ var TabButton = ({
2664
2729
  ...getDragOverStyles()
2665
2730
  },
2666
2731
  children: [
2667
- closable && showCloseButton && /* @__PURE__ */ jsx10(
2732
+ closable && showCloseButton && /* @__PURE__ */ jsx11(
2668
2733
  "button",
2669
2734
  {
2670
2735
  onClick: (e) => {
@@ -2699,12 +2764,12 @@ var TabButton = ({
2699
2764
  (() => {
2700
2765
  const icon = renderIcon ? renderIcon(tab) : void 0;
2701
2766
  const displayIcon = icon !== void 0 ? icon : tab.icon;
2702
- return displayIcon ? /* @__PURE__ */ jsx10("div", { style: { flexShrink: 0, display: "flex", alignItems: "center", pointerEvents: "none" }, children: displayIcon }) : null;
2767
+ return displayIcon ? /* @__PURE__ */ jsx11("div", { style: { flexShrink: 0, display: "flex", alignItems: "center", pointerEvents: "none" }, children: displayIcon }) : null;
2703
2768
  })(),
2704
2769
  (() => {
2705
2770
  const label = renderLabel ? renderLabel(tab) : void 0;
2706
2771
  const displayLabel = label !== void 0 ? label : tab.label;
2707
- return /* @__PURE__ */ jsx10(
2772
+ return /* @__PURE__ */ jsx11(
2708
2773
  "span",
2709
2774
  {
2710
2775
  style: {
@@ -2718,7 +2783,7 @@ var TabButton = ({
2718
2783
  }
2719
2784
  );
2720
2785
  })(),
2721
- renderAccessory ? renderAccessory(tab) : keyboardHint && /* @__PURE__ */ jsx10(
2786
+ renderAccessory ? renderAccessory(tab) : keyboardHint && /* @__PURE__ */ jsx11(
2722
2787
  "span",
2723
2788
  {
2724
2789
  style: {
@@ -2737,7 +2802,7 @@ var TabButton = ({
2737
2802
  TabButton.displayName = "TabButton";
2738
2803
 
2739
2804
  // src/components/TabBar/TabBar.tsx
2740
- import { jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
2805
+ import { jsx as jsx12, jsxs as jsxs8 } from "react/jsx-runtime";
2741
2806
  var TabBar = ({
2742
2807
  tabs,
2743
2808
  activeTabId,
@@ -2760,14 +2825,14 @@ var TabBar = ({
2760
2825
  const [hoveredTabId, setHoveredTabId] = useState3(null);
2761
2826
  const [draggedTabId, setDraggedTabId] = useState3(null);
2762
2827
  const [dragOverTabId, setDragOverTabId] = useState3(null);
2763
- const handleDragStart = useCallback5((tabId) => {
2828
+ const handleDragStart = useCallback6((tabId) => {
2764
2829
  setDraggedTabId(tabId);
2765
2830
  }, []);
2766
- const handleDragEnd = useCallback5(() => {
2831
+ const handleDragEnd = useCallback6(() => {
2767
2832
  setDraggedTabId(null);
2768
2833
  setDragOverTabId(null);
2769
2834
  }, []);
2770
- const handleDrop = useCallback5(
2835
+ const handleDrop = useCallback6(
2771
2836
  (targetTabId, draggedId) => {
2772
2837
  if (draggedId !== targetTabId) {
2773
2838
  onTabDrop?.(draggedId, targetTabId);
@@ -2777,13 +2842,13 @@ var TabBar = ({
2777
2842
  },
2778
2843
  [onTabDrop]
2779
2844
  );
2780
- const handleDragEnter = useCallback5((tabId) => {
2845
+ const handleDragEnter = useCallback6((tabId) => {
2781
2846
  setDragOverTabId(tabId);
2782
2847
  }, []);
2783
- const handleDragLeave = useCallback5(() => {
2848
+ const handleDragLeave = useCallback6(() => {
2784
2849
  setDragOverTabId(null);
2785
2850
  }, []);
2786
- return /* @__PURE__ */ jsxs7(
2851
+ return /* @__PURE__ */ jsxs8(
2787
2852
  "div",
2788
2853
  {
2789
2854
  className,
@@ -2795,7 +2860,7 @@ var TabBar = ({
2795
2860
  boxSizing: "border-box"
2796
2861
  },
2797
2862
  children: [
2798
- leftSection && /* @__PURE__ */ jsx11(
2863
+ leftSection && /* @__PURE__ */ jsx12(
2799
2864
  "div",
2800
2865
  {
2801
2866
  style: {
@@ -2811,7 +2876,7 @@ var TabBar = ({
2811
2876
  children: leftSection
2812
2877
  }
2813
2878
  ),
2814
- /* @__PURE__ */ jsx11(
2879
+ /* @__PURE__ */ jsx12(
2815
2880
  "div",
2816
2881
  {
2817
2882
  style: {
@@ -2824,7 +2889,7 @@ var TabBar = ({
2824
2889
  },
2825
2890
  children: tabs.map((tab, index) => {
2826
2891
  const canDrop = enableDragAndDrop && draggedTabId !== null && draggedTabId !== tab.id ? canDropOnTab ? canDropOnTab(draggedTabId, tab.id) : true : false;
2827
- return /* @__PURE__ */ jsx11(
2892
+ return /* @__PURE__ */ jsx12(
2828
2893
  TabButton,
2829
2894
  {
2830
2895
  tab,
@@ -2853,7 +2918,7 @@ var TabBar = ({
2853
2918
  })
2854
2919
  }
2855
2920
  ),
2856
- rightSection !== void 0 ? rightSection && /* @__PURE__ */ jsx11(
2921
+ rightSection !== void 0 ? rightSection && /* @__PURE__ */ jsx12(
2857
2922
  "div",
2858
2923
  {
2859
2924
  style: {
@@ -2868,7 +2933,7 @@ var TabBar = ({
2868
2933
  },
2869
2934
  children: rightSection
2870
2935
  }
2871
- ) : onNewTab && /* @__PURE__ */ jsx11(
2936
+ ) : onNewTab && /* @__PURE__ */ jsx12(
2872
2937
  "div",
2873
2938
  {
2874
2939
  style: {
@@ -2881,7 +2946,7 @@ var TabBar = ({
2881
2946
  borderBottom: `1px solid ${theme.colors.border}`,
2882
2947
  boxSizing: "border-box"
2883
2948
  },
2884
- children: /* @__PURE__ */ jsx11(
2949
+ children: /* @__PURE__ */ jsx12(
2885
2950
  "button",
2886
2951
  {
2887
2952
  onClick: onNewTab,
@@ -2904,7 +2969,7 @@ var TabBar = ({
2904
2969
  e.currentTarget.style.backgroundColor = "transparent";
2905
2970
  },
2906
2971
  title: "New Tab (\u2318T)",
2907
- children: /* @__PURE__ */ jsx11(Plus, { size: 14 })
2972
+ children: /* @__PURE__ */ jsx12(Plus, { size: 14 })
2908
2973
  }
2909
2974
  )
2910
2975
  }
@@ -2963,7 +3028,7 @@ import { CollapsibleSplitPane } from "@principal-ade/panels";
2963
3028
  import { Terminal as TerminalIcon2, Box, Boxes, Paperclip } from "lucide-react";
2964
3029
  import React4, {
2965
3030
  useState as useState4,
2966
- useCallback as useCallback6,
3031
+ useCallback as useCallback7,
2967
3032
  useEffect as useEffect5,
2968
3033
  useRef as useRef5
2969
3034
  } from "react";
@@ -2972,7 +3037,7 @@ import React4, {
2972
3037
  import { useTheme as useTheme8 } from "@principal-ade/industry-theme";
2973
3038
  import { Folder, GitBranch } from "lucide-react";
2974
3039
  import React3 from "react";
2975
- import { jsx as jsx12, jsxs as jsxs8 } from "react/jsx-runtime";
3040
+ import { jsx as jsx13, jsxs as jsxs9 } from "react/jsx-runtime";
2976
3041
  var AVATAR_SIZE = 14;
2977
3042
  var TerminalStatusBar = ({
2978
3043
  directory,
@@ -3002,13 +3067,13 @@ var TerminalStatusBar = ({
3002
3067
  if (repo) {
3003
3068
  const avatarUrl = repo.avatarUrl ?? `https://github.com/${repo.owner}.png?size=48`;
3004
3069
  const showAvatar = Boolean(repo.owner) && !avatarFailed;
3005
- return /* @__PURE__ */ jsxs8(
3070
+ return /* @__PURE__ */ jsxs9(
3006
3071
  "div",
3007
3072
  {
3008
3073
  style: containerStyle,
3009
3074
  title: `${repo.owner}/${repo.repo}${repo.branch ? ` \u2014 ${repo.branch}` : ""}`,
3010
3075
  children: [
3011
- showAvatar ? /* @__PURE__ */ jsx12(
3076
+ showAvatar ? /* @__PURE__ */ jsx13(
3012
3077
  "img",
3013
3078
  {
3014
3079
  src: avatarUrl,
@@ -3023,8 +3088,8 @@ var TerminalStatusBar = ({
3023
3088
  borderRadius: "50%"
3024
3089
  }
3025
3090
  }
3026
- ) : /* @__PURE__ */ jsx12(Folder, { size: 12, style: { flex: "0 0 auto", opacity: 0.7 } }),
3027
- /* @__PURE__ */ jsxs8(
3091
+ ) : /* @__PURE__ */ jsx13(Folder, { size: 12, style: { flex: "0 0 auto", opacity: 0.7 } }),
3092
+ /* @__PURE__ */ jsxs9(
3028
3093
  "span",
3029
3094
  {
3030
3095
  style: {
@@ -3034,15 +3099,15 @@ var TerminalStatusBar = ({
3034
3099
  minWidth: 0
3035
3100
  },
3036
3101
  children: [
3037
- /* @__PURE__ */ jsxs8("span", { style: { opacity: 0.7 }, children: [
3102
+ /* @__PURE__ */ jsxs9("span", { style: { opacity: 0.7 }, children: [
3038
3103
  repo.owner,
3039
3104
  "/"
3040
3105
  ] }),
3041
- /* @__PURE__ */ jsx12("span", { style: { color: theme.colors.text }, children: repo.repo })
3106
+ /* @__PURE__ */ jsx13("span", { style: { color: theme.colors.text }, children: repo.repo })
3042
3107
  ]
3043
3108
  }
3044
3109
  ),
3045
- repo.branch && /* @__PURE__ */ jsxs8(
3110
+ repo.branch && /* @__PURE__ */ jsxs9(
3046
3111
  "span",
3047
3112
  {
3048
3113
  style: {
@@ -3053,9 +3118,9 @@ var TerminalStatusBar = ({
3053
3118
  opacity: 0.85
3054
3119
  },
3055
3120
  children: [
3056
- /* @__PURE__ */ jsx12(GitBranch, { size: 12, style: { flex: "0 0 auto", opacity: 0.7 } }),
3057
- /* @__PURE__ */ jsx12("span", { children: repo.branch }),
3058
- repo.isDirty && /* @__PURE__ */ jsx12(
3121
+ /* @__PURE__ */ jsx13(GitBranch, { size: 12, style: { flex: "0 0 auto", opacity: 0.7 } }),
3122
+ /* @__PURE__ */ jsx13("span", { children: repo.branch }),
3123
+ repo.isDirty && /* @__PURE__ */ jsx13(
3059
3124
  "span",
3060
3125
  {
3061
3126
  title: "Uncommitted changes",
@@ -3071,7 +3136,7 @@ var TerminalStatusBar = ({
3071
3136
  ]
3072
3137
  }
3073
3138
  ),
3074
- (repo.ahead || repo.behind) && /* @__PURE__ */ jsxs8("span", { style: { flex: "0 0 auto", opacity: 0.7 }, children: [
3139
+ (repo.ahead || repo.behind) && /* @__PURE__ */ jsxs9("span", { style: { flex: "0 0 auto", opacity: 0.7 }, children: [
3075
3140
  repo.ahead ? `\u2191${repo.ahead}` : "",
3076
3141
  repo.behind ? `\u2193${repo.behind}` : ""
3077
3142
  ] })
@@ -3082,9 +3147,9 @@ var TerminalStatusBar = ({
3082
3147
  if (!directory) {
3083
3148
  return null;
3084
3149
  }
3085
- return /* @__PURE__ */ jsxs8("div", { style: containerStyle, title: directory, children: [
3086
- /* @__PURE__ */ jsx12(Folder, { size: 12, style: { flex: "0 0 auto", opacity: 0.7 } }),
3087
- /* @__PURE__ */ jsx12(
3150
+ return /* @__PURE__ */ jsxs9("div", { style: containerStyle, title: directory, children: [
3151
+ /* @__PURE__ */ jsx13(Folder, { size: 12, style: { flex: "0 0 auto", opacity: 0.7 } }),
3152
+ /* @__PURE__ */ jsx13(
3088
3153
  "span",
3089
3154
  {
3090
3155
  style: {
@@ -3095,7 +3160,7 @@ var TerminalStatusBar = ({
3095
3160
  textOverflow: "ellipsis",
3096
3161
  minWidth: 0
3097
3162
  },
3098
- children: /* @__PURE__ */ jsx12("bdi", { children: directory })
3163
+ children: /* @__PURE__ */ jsx13("bdi", { children: directory })
3099
3164
  }
3100
3165
  )
3101
3166
  ] });
@@ -3103,9 +3168,9 @@ var TerminalStatusBar = ({
3103
3168
  TerminalStatusBar.displayName = "TerminalStatusBar";
3104
3169
 
3105
3170
  // src/panels/TabbedTerminalPanel.tsx
3106
- import { Fragment as Fragment2, jsx as jsx13, jsxs as jsxs9 } from "react/jsx-runtime";
3107
- var ActivityIndicator = ({ color, isAnimating }) => /* @__PURE__ */ jsxs9("div", { style: { display: "flex", gap: 1, alignItems: "center", height: 12 }, children: [
3108
- [0, 1, 2, 3, 4].map((i) => /* @__PURE__ */ jsx13(
3171
+ import { Fragment as Fragment2, jsx as jsx14, jsxs as jsxs10 } from "react/jsx-runtime";
3172
+ var ActivityIndicator = ({ color, isAnimating }) => /* @__PURE__ */ jsxs10("div", { style: { display: "flex", gap: 1, alignItems: "center", height: 12 }, children: [
3173
+ [0, 1, 2, 3, 4].map((i) => /* @__PURE__ */ jsx14(
3109
3174
  "div",
3110
3175
  {
3111
3176
  style: {
@@ -3120,7 +3185,7 @@ var ActivityIndicator = ({ color, isAnimating }) => /* @__PURE__ */ jsxs9("div",
3120
3185
  },
3121
3186
  i
3122
3187
  )),
3123
- /* @__PURE__ */ jsx13("style", { children: `
3188
+ /* @__PURE__ */ jsx14("style", { children: `
3124
3189
  @keyframes waveSine {
3125
3190
  0%, 100% { transform: scaleY(0.4); }
3126
3191
  50% { transform: scaleY(1); }
@@ -3147,17 +3212,17 @@ function TerminalTabContentInner(props, ref) {
3147
3212
  } = props;
3148
3213
  const [isWorkingFromActivity, setIsWorkingFromActivity] = useState4(false);
3149
3214
  const sessionRef = useRef5(null);
3150
- const handleSessionCreated = useCallback6(
3215
+ const handleSessionCreated = useCallback7(
3151
3216
  (sid) => onSessionCreated(tab.id, sid),
3152
3217
  [onSessionCreated, tab.id]
3153
3218
  );
3154
- const handleScrollPositionChange = useCallback6(
3219
+ const handleScrollPositionChange = useCallback7(
3155
3220
  (position) => {
3156
3221
  onScrollPositionChange?.(tab.id, position);
3157
3222
  },
3158
3223
  [onScrollPositionChange, tab.id]
3159
3224
  );
3160
- const handleActivityChange = useCallback6(
3225
+ const handleActivityChange = useCallback7(
3161
3226
  (state) => {
3162
3227
  const sid = sessionRef.current?.getSessionId();
3163
3228
  if (sid) {
@@ -3176,7 +3241,7 @@ function TerminalTabContentInner(props, ref) {
3176
3241
  }),
3177
3242
  []
3178
3243
  );
3179
- return /* @__PURE__ */ jsx13(
3244
+ return /* @__PURE__ */ jsx14(
3180
3245
  "div",
3181
3246
  {
3182
3247
  style: {
@@ -3190,7 +3255,7 @@ function TerminalTabContentInner(props, ref) {
3190
3255
  height: "100%",
3191
3256
  width: "100%"
3192
3257
  },
3193
- children: /* @__PURE__ */ jsx13(
3258
+ children: /* @__PURE__ */ jsx14(
3194
3259
  TerminalSession,
3195
3260
  {
3196
3261
  ref: sessionRef,
@@ -3349,7 +3414,7 @@ var TabbedTerminalPanelInner = ({
3349
3414
  onFocusTabHandled?.();
3350
3415
  }
3351
3416
  }, [requestFocusTabId, ownedTabs, foreignTabs, setActiveTabId, onFocusTabHandled, activeTabId]);
3352
- const getOwnedTabLabel = useCallback6((index, _directory) => {
3417
+ const getOwnedTabLabel = useCallback7((index, _directory) => {
3353
3418
  if (tabLabelPrefix) {
3354
3419
  return `${tabLabelPrefix} ${index + 1}`;
3355
3420
  }
@@ -3381,7 +3446,7 @@ var TabbedTerminalPanelInner = ({
3381
3446
  }, [tabs]);
3382
3447
  const tabRefsMap = useRef5(/* @__PURE__ */ new Map());
3383
3448
  const refCallbacksMap = useRef5(/* @__PURE__ */ new Map());
3384
- const getRefCallback = useCallback6((tabId) => {
3449
+ const getRefCallback = useCallback7((tabId) => {
3385
3450
  let callback = refCallbacksMap.current.get(tabId);
3386
3451
  if (!callback) {
3387
3452
  callback = (ref) => {
@@ -3398,7 +3463,7 @@ var TabbedTerminalPanelInner = ({
3398
3463
  const hasInitializedRef = useRef5(false);
3399
3464
  const isCreatingTabRef = useRef5(false);
3400
3465
  const headerRef = useRef5(null);
3401
- const restoreOwnedSessions = useCallback6(async () => {
3466
+ const restoreOwnedSessions = useCallback7(async () => {
3402
3467
  try {
3403
3468
  let sessions = [];
3404
3469
  if (actions.listTerminalSessions) {
@@ -3447,7 +3512,7 @@ var TabbedTerminalPanelInner = ({
3447
3512
  console.error("[TabbedTerminalPanel] Failed to restore owned sessions:", err);
3448
3513
  }
3449
3514
  }, [terminalContext, sessionIds, activeTabId, onTabsChange, actions, directory, setActiveTabId]);
3450
- const fetchForeignSessions = useCallback6(async () => {
3515
+ const fetchForeignSessions = useCallback7(async () => {
3451
3516
  try {
3452
3517
  if (!actions.listTerminalSessions) {
3453
3518
  return;
@@ -3481,7 +3546,7 @@ var TabbedTerminalPanelInner = ({
3481
3546
  console.error("[TabbedTerminalPanel] Failed to fetch foreign sessions:", err);
3482
3547
  }
3483
3548
  }, [terminalContext, actions]);
3484
- const clearForeignTabs = useCallback6(() => {
3549
+ const clearForeignTabs = useCallback7(() => {
3485
3550
  setForeignTabs((prevForeign) => {
3486
3551
  const foreignTabIds = new Set(prevForeign.map((t) => t.id));
3487
3552
  setSessionIds((prev) => {
@@ -3518,10 +3583,10 @@ var TabbedTerminalPanelInner = ({
3518
3583
  clearForeignTabs();
3519
3584
  }
3520
3585
  }, [showAllTerminals, fetchForeignSessions, clearForeignTabs]);
3521
- const switchTab = useCallback6((tabId) => {
3586
+ const switchTab = useCallback7((tabId) => {
3522
3587
  setActiveTabId(tabId);
3523
3588
  }, [setActiveTabId]);
3524
- const addNewTab = useCallback6(
3589
+ const addNewTab = useCallback7(
3525
3590
  (label, command, targetDirectory) => {
3526
3591
  const targetDir = targetDirectory || directory;
3527
3592
  const directoryName = targetDir.split("/").pop() || targetDir;
@@ -3542,10 +3607,10 @@ var TabbedTerminalPanelInner = ({
3542
3607
  },
3543
3608
  [directory, onTabsChange]
3544
3609
  );
3545
- const isForeignTab = useCallback6((tabId) => {
3610
+ const isForeignTab = useCallback7((tabId) => {
3546
3611
  return tabId.startsWith("tab-foreign-");
3547
3612
  }, []);
3548
- const closeTab = useCallback6(
3613
+ const closeTab = useCallback7(
3549
3614
  async (tabId) => {
3550
3615
  const sessionId = sessionIds.get(tabId);
3551
3616
  const isForeign = isForeignTab(tabId);
@@ -3628,10 +3693,10 @@ var TabbedTerminalPanelInner = ({
3628
3693
  if (!requestCloseTabId) return;
3629
3694
  closeTab(requestCloseTabId);
3630
3695
  }, [requestCloseTabId]);
3631
- const handleSessionCreated = useCallback6((tabId, sessionId) => {
3696
+ const handleSessionCreated = useCallback7((tabId, sessionId) => {
3632
3697
  setSessionIds((prev) => new Map(prev).set(tabId, sessionId));
3633
3698
  }, []);
3634
- const handleActivityStateChange = useCallback6((sessionId, isActive) => {
3699
+ const handleActivityStateChange = useCallback7((sessionId, isActive) => {
3635
3700
  setActivityStates((prev) => {
3636
3701
  const next = new Map(prev);
3637
3702
  if (isActive) {
@@ -3663,12 +3728,12 @@ var TabbedTerminalPanelInner = ({
3663
3728
  }
3664
3729
  }
3665
3730
  });
3666
- const renderTabAccessory = useCallback6((tab) => {
3731
+ const renderTabAccessory = useCallback7((tab) => {
3667
3732
  const tabSessionId = sessionIds.get(tab.id);
3668
3733
  const isActive = tab.id === activeTabId;
3669
3734
  const record = tabSessionId ? programStatus?.[tabSessionId] : void 0;
3670
3735
  if (record && record.state !== "idle" && record.state !== "clear") {
3671
- return /* @__PURE__ */ jsx13(
3736
+ return /* @__PURE__ */ jsx14(
3672
3737
  "div",
3673
3738
  {
3674
3739
  style: {
@@ -3680,7 +3745,7 @@ var TabbedTerminalPanelInner = ({
3680
3745
  width: "16px",
3681
3746
  height: "16px"
3682
3747
  },
3683
- children: /* @__PURE__ */ jsx13(ProgramStatusBadge, { record })
3748
+ children: /* @__PURE__ */ jsx14(ProgramStatusBadge, { record })
3684
3749
  }
3685
3750
  );
3686
3751
  }
@@ -3688,7 +3753,7 @@ var TabbedTerminalPanelInner = ({
3688
3753
  const hasInternalActivity = tabSessionId ? activityStates.get(tabSessionId) : false;
3689
3754
  const isWorking = hasExternalWorkingState || hasInternalActivity;
3690
3755
  if (!isActive) return null;
3691
- return /* @__PURE__ */ jsx13(Fragment2, { children: /* @__PURE__ */ jsx13(
3756
+ return /* @__PURE__ */ jsx14(Fragment2, { children: /* @__PURE__ */ jsx14(
3692
3757
  "div",
3693
3758
  {
3694
3759
  style: {
@@ -3701,12 +3766,12 @@ var TabbedTerminalPanelInner = ({
3701
3766
  height: "16px"
3702
3767
  },
3703
3768
  title: isWorking ? "Terminal active" : "Terminal idle",
3704
- children: /* @__PURE__ */ jsx13(ActivityIndicator, { color: theme.colors.primary, isAnimating: isWorking ?? false })
3769
+ children: /* @__PURE__ */ jsx14(ActivityIndicator, { color: theme.colors.primary, isAnimating: isWorking ?? false })
3705
3770
  }
3706
3771
  ) });
3707
3772
  }, [activeTabId, theme, sessionIds, workingStates, activityStates, programStatus]);
3708
- const renderTerminalWithAssociation = useCallback6((tab, isActive, sessionId, association) => {
3709
- const terminalContent = /* @__PURE__ */ jsx13(
3773
+ const renderTerminalWithAssociation = useCallback7((tab, isActive, sessionId, association) => {
3774
+ const terminalContent = /* @__PURE__ */ jsx14(
3710
3775
  TerminalTabContent,
3711
3776
  {
3712
3777
  ref: getRefCallback(tab.id),
@@ -3728,7 +3793,7 @@ var TabbedTerminalPanelInner = ({
3728
3793
  `terminal-${tab.id}`
3729
3794
  );
3730
3795
  const hasAssociation = !!association;
3731
- const secondaryContent = hasAssociation && renderAssociatedContent ? renderAssociatedContent(association.associatedTabId, isActive) : /* @__PURE__ */ jsx13("div", { style: {
3796
+ const secondaryContent = hasAssociation && renderAssociatedContent ? renderAssociatedContent(association.associatedTabId, isActive) : /* @__PURE__ */ jsx14("div", { style: {
3732
3797
  height: "100%",
3733
3798
  display: "flex",
3734
3799
  alignItems: "center",
@@ -3737,10 +3802,10 @@ var TabbedTerminalPanelInner = ({
3737
3802
  fontSize: "13px",
3738
3803
  backgroundColor: theme.colors.backgroundSecondary
3739
3804
  }, children: "Drag a tab here to associate it with this terminal" });
3740
- const headerConfig = hasAssociation && getAssociatedHeader ? getAssociatedHeader(association.associatedTabId) : { title: "Drop zone", icon: /* @__PURE__ */ jsx13(Paperclip, { size: 14 }) };
3805
+ const headerConfig = hasAssociation && getAssociatedHeader ? getAssociatedHeader(association.associatedTabId) : { title: "Drop zone", icon: /* @__PURE__ */ jsx14(Paperclip, { size: 14 }) };
3741
3806
  const isCollapsed = hasAssociation ? association.collapsed : true;
3742
3807
  const handleCollapsedChange = hasAssociation ? (collapsed) => onAssociationCollapsedChange?.(tab.id, collapsed) : void 0;
3743
- return /* @__PURE__ */ jsx13(
3808
+ return /* @__PURE__ */ jsx14(
3744
3809
  CollapsibleSplitPane,
3745
3810
  {
3746
3811
  style: { height: "100%" },
@@ -3772,7 +3837,7 @@ var TabbedTerminalPanelInner = ({
3772
3837
  onAssociationRatioChange,
3773
3838
  theme
3774
3839
  ]);
3775
- const handleTabDrop = useCallback6(
3840
+ const handleTabDrop = useCallback7(
3776
3841
  (draggedTabId, targetTabId) => {
3777
3842
  const draggedTab = tabs.find((t) => t.id === draggedTabId);
3778
3843
  const targetTab = tabs.find((t) => t.id === targetTabId);
@@ -3783,7 +3848,7 @@ var TabbedTerminalPanelInner = ({
3783
3848
  },
3784
3849
  [tabs, onTabAssociate, setActiveTabId]
3785
3850
  );
3786
- const canDropOnTab = useCallback6(
3851
+ const canDropOnTab = useCallback7(
3787
3852
  (draggedTabId, targetTabId) => {
3788
3853
  const draggedTab = tabs.find((t) => t.id === draggedTabId);
3789
3854
  const targetTab = tabs.find((t) => t.id === targetTabId);
@@ -3792,7 +3857,7 @@ var TabbedTerminalPanelInner = ({
3792
3857
  [tabs]
3793
3858
  );
3794
3859
  const [isDragOverContent, setIsDragOverContent] = useState4(false);
3795
- const handleContentDragEnter = useCallback6((e) => {
3860
+ const handleContentDragEnter = useCallback7((e) => {
3796
3861
  e.preventDefault();
3797
3862
  if (activeTabId) {
3798
3863
  const activeTab = tabs.find((t) => t.id === activeTabId);
@@ -3801,13 +3866,13 @@ var TabbedTerminalPanelInner = ({
3801
3866
  }
3802
3867
  }
3803
3868
  }, [activeTabId, tabs]);
3804
- const handleContentDragLeave = useCallback6((e) => {
3869
+ const handleContentDragLeave = useCallback7((e) => {
3805
3870
  const relatedTarget = e.relatedTarget;
3806
3871
  if (!e.currentTarget.contains(relatedTarget)) {
3807
3872
  setIsDragOverContent(false);
3808
3873
  }
3809
3874
  }, []);
3810
- const handleContentDrop = useCallback6((e) => {
3875
+ const handleContentDrop = useCallback7((e) => {
3811
3876
  e.preventDefault();
3812
3877
  e.stopPropagation();
3813
3878
  setIsDragOverContent(false);
@@ -3822,7 +3887,7 @@ var TabbedTerminalPanelInner = ({
3822
3887
  setActiveTabId(activeTabId);
3823
3888
  }
3824
3889
  }, [activeTabId, tabs, onTabAssociate, setActiveTabId]);
3825
- return /* @__PURE__ */ jsxs9(
3890
+ return /* @__PURE__ */ jsxs10(
3826
3891
  "div",
3827
3892
  {
3828
3893
  style: {
@@ -3832,7 +3897,7 @@ var TabbedTerminalPanelInner = ({
3832
3897
  backgroundColor: theme.colors.background
3833
3898
  },
3834
3899
  children: [
3835
- !hideHeader && /* @__PURE__ */ jsx13("div", { ref: headerRef, children: /* @__PURE__ */ jsx13(
3900
+ !hideHeader && /* @__PURE__ */ jsx14("div", { ref: headerRef, children: /* @__PURE__ */ jsx14(
3836
3901
  TabBar,
3837
3902
  {
3838
3903
  tabs: genericTabs,
@@ -3840,7 +3905,7 @@ var TabbedTerminalPanelInner = ({
3840
3905
  onTabClick: switchTab,
3841
3906
  onTabClose: closeTab,
3842
3907
  onNewTab: addNewTab,
3843
- leftSection: hideShowAllTerminalsButton ? void 0 : /* @__PURE__ */ jsx13(
3908
+ leftSection: hideShowAllTerminalsButton ? void 0 : /* @__PURE__ */ jsx14(
3844
3909
  "button",
3845
3910
  {
3846
3911
  onClick: () => onShowAllTerminalsChange?.(!showAllTerminals),
@@ -3867,7 +3932,7 @@ var TabbedTerminalPanelInner = ({
3867
3932
  }
3868
3933
  },
3869
3934
  title: showAllTerminals ? "Showing all terminals (click to filter by context)" : "Show all terminals",
3870
- children: showAllTerminals ? /* @__PURE__ */ jsx13(Boxes, { size: 14 }) : /* @__PURE__ */ jsx13(Box, { size: 14 })
3935
+ children: showAllTerminals ? /* @__PURE__ */ jsx14(Boxes, { size: 14 }) : /* @__PURE__ */ jsx14(Box, { size: 14 })
3871
3936
  }
3872
3937
  ),
3873
3938
  renderTabAccessory,
@@ -3879,7 +3944,7 @@ var TabbedTerminalPanelInner = ({
3879
3944
  canDropOnTab
3880
3945
  }
3881
3946
  ) }),
3882
- /* @__PURE__ */ jsxs9(
3947
+ /* @__PURE__ */ jsxs10(
3883
3948
  "div",
3884
3949
  {
3885
3950
  style: {
@@ -3928,7 +3993,7 @@ var TabbedTerminalPanelInner = ({
3928
3993
  const customContent = renderTabContent(tab, isActive, sessionId, width);
3929
3994
  if (customContent === null && tab.contentType === "terminal") {
3930
3995
  const association = associations?.[tab.id];
3931
- return /* @__PURE__ */ jsx13(
3996
+ return /* @__PURE__ */ jsx14(
3932
3997
  "div",
3933
3998
  {
3934
3999
  inert: !isActive,
@@ -3956,7 +4021,7 @@ var TabbedTerminalPanelInner = ({
3956
4021
  );
3957
4022
  }
3958
4023
  const hasBeenActivated = activatedTabs.has(tab.id);
3959
- return /* @__PURE__ */ jsx13(
4024
+ return /* @__PURE__ */ jsx14(
3960
4025
  "div",
3961
4026
  {
3962
4027
  inert: !isActive,
@@ -3976,7 +4041,7 @@ var TabbedTerminalPanelInner = ({
3976
4041
  }
3977
4042
  if (tab.contentType === "terminal") {
3978
4043
  const association = associations?.[tab.id];
3979
- return /* @__PURE__ */ jsx13(
4044
+ return /* @__PURE__ */ jsx14(
3980
4045
  "div",
3981
4046
  {
3982
4047
  inert: !isActive,
@@ -3994,7 +4059,7 @@ var TabbedTerminalPanelInner = ({
3994
4059
  tab.id
3995
4060
  );
3996
4061
  }
3997
- return /* @__PURE__ */ jsxs9(
4062
+ return /* @__PURE__ */ jsxs10(
3998
4063
  "div",
3999
4064
  {
4000
4065
  inert: !isActive,
@@ -4010,17 +4075,17 @@ var TabbedTerminalPanelInner = ({
4010
4075
  color: theme.colors.textSecondary
4011
4076
  },
4012
4077
  children: [
4013
- /* @__PURE__ */ jsxs9("p", { children: [
4078
+ /* @__PURE__ */ jsxs10("p", { children: [
4014
4079
  "Unknown content type: ",
4015
4080
  tab.contentType
4016
4081
  ] }),
4017
- /* @__PURE__ */ jsx13("p", { style: { fontSize: theme.fontSizes[0], marginTop: "8px" }, children: "Provide a renderTabContent prop to render custom tab types" })
4082
+ /* @__PURE__ */ jsx14("p", { style: { fontSize: theme.fontSizes[0], marginTop: "8px" }, children: "Provide a renderTabContent prop to render custom tab types" })
4018
4083
  ]
4019
4084
  },
4020
4085
  tab.id
4021
4086
  );
4022
4087
  }),
4023
- tabs.length === 0 && /* @__PURE__ */ jsxs9(
4088
+ tabs.length === 0 && /* @__PURE__ */ jsxs10(
4024
4089
  "div",
4025
4090
  {
4026
4091
  style: {
@@ -4032,14 +4097,14 @@ var TabbedTerminalPanelInner = ({
4032
4097
  color: theme.colors.textSecondary
4033
4098
  },
4034
4099
  children: [
4035
- /* @__PURE__ */ jsx13(
4100
+ /* @__PURE__ */ jsx14(
4036
4101
  TerminalIcon2,
4037
4102
  {
4038
4103
  size: 32,
4039
4104
  style: { opacity: 0.5, marginBottom: "16px" }
4040
4105
  }
4041
4106
  ),
4042
- /* @__PURE__ */ jsx13(
4107
+ /* @__PURE__ */ jsx14(
4043
4108
  "button",
4044
4109
  {
4045
4110
  onClick: () => addNewTab(),
@@ -4066,15 +4131,15 @@ var TabbedTerminalPanelInner = ({
4066
4131
  (() => {
4067
4132
  const activeTab = tabs.find((t) => t.id === activeTabId);
4068
4133
  const activeDir = activeTab?.directory;
4069
- return /* @__PURE__ */ jsxs9("div", { style: { display: "flex", alignItems: "center", flex: "0 0 auto" }, children: [
4070
- /* @__PURE__ */ jsx13(
4134
+ return /* @__PURE__ */ jsxs10("div", { style: { display: "flex", alignItems: "center", flex: "0 0 auto" }, children: [
4135
+ /* @__PURE__ */ jsx14(
4071
4136
  TerminalStatusBar,
4072
4137
  {
4073
4138
  directory: activeDir,
4074
4139
  repo: activeDir ? getRepoInfo?.(activeDir) : void 0
4075
4140
  }
4076
4141
  ),
4077
- bottomBarContent && /* @__PURE__ */ jsx13("div", { style: { marginLeft: "auto", display: "flex", alignItems: "center", height: 22 }, children: bottomBarContent })
4142
+ bottomBarContent && /* @__PURE__ */ jsx14("div", { style: { marginLeft: "auto", display: "flex", alignItems: "center", height: 22 }, children: bottomBarContent })
4078
4143
  ] });
4079
4144
  })()
4080
4145
  ]