@adoptai/genui-components 0.1.33 → 0.1.45

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 (113) hide show
  1. package/README.md +5 -0
  2. package/dist/builders/BuilderForm.d.ts +16 -1
  3. package/dist/builders/BuilderForm.d.ts.map +1 -1
  4. package/dist/builders/EscalationCard.d.ts +6 -1
  5. package/dist/builders/EscalationCard.d.ts.map +1 -1
  6. package/dist/builders/FieldRenderer.d.ts +5 -1
  7. package/dist/builders/FieldRenderer.d.ts.map +1 -1
  8. package/dist/builders/FormBuilder.d.ts +7 -1
  9. package/dist/builders/FormBuilder.d.ts.map +1 -1
  10. package/dist/builders/StepperBuilder.d.ts +6 -1
  11. package/dist/builders/StepperBuilder.d.ts.map +1 -1
  12. package/dist/builders/fields.d.ts +5 -1
  13. package/dist/builders/fields.d.ts.map +1 -1
  14. package/dist/builders/resolver.d.ts +11 -0
  15. package/dist/builders/resolver.d.ts.map +1 -1
  16. package/dist/composites/aging-report/resolver.cjs +1 -1
  17. package/dist/composites/aging-report/resolver.cjs.map +1 -1
  18. package/dist/composites/aging-report/resolver.js +1 -1
  19. package/dist/composites/aging-report/resolver.js.map +1 -1
  20. package/dist/composites/balance-sheet/resolver.cjs +1 -1
  21. package/dist/composites/balance-sheet/resolver.cjs.map +1 -1
  22. package/dist/composites/balance-sheet/resolver.js +1 -1
  23. package/dist/composites/balance-sheet/resolver.js.map +1 -1
  24. package/dist/composites/connect-integration/resolver.cjs +465 -0
  25. package/dist/composites/connect-integration/resolver.cjs.map +1 -0
  26. package/dist/composites/connect-integration/resolver.js +463 -0
  27. package/dist/composites/connect-integration/resolver.js.map +1 -0
  28. package/dist/composites/entity-card-grid/resolver.cjs +2 -2
  29. package/dist/composites/entity-card-grid/resolver.cjs.map +1 -1
  30. package/dist/composites/entity-card-grid/resolver.js +2 -2
  31. package/dist/composites/entity-card-grid/resolver.js.map +1 -1
  32. package/dist/composites/general-ledger/resolver.cjs +1 -0
  33. package/dist/composites/general-ledger/resolver.cjs.map +1 -1
  34. package/dist/composites/general-ledger/resolver.d.ts.map +1 -1
  35. package/dist/composites/general-ledger/resolver.js +1 -0
  36. package/dist/composites/general-ledger/resolver.js.map +1 -1
  37. package/dist/composites/income-statement/resolver.cjs +1 -1
  38. package/dist/composites/income-statement/resolver.cjs.map +1 -1
  39. package/dist/composites/income-statement/resolver.js +1 -1
  40. package/dist/composites/income-statement/resolver.js.map +1 -1
  41. package/dist/composites/integrations-list/resolver.cjs +511 -0
  42. package/dist/composites/integrations-list/resolver.cjs.map +1 -0
  43. package/dist/composites/integrations-list/resolver.js +509 -0
  44. package/dist/composites/integrations-list/resolver.js.map +1 -0
  45. package/dist/composites/key-value-list/resolver.cjs +28 -3
  46. package/dist/composites/key-value-list/resolver.cjs.map +1 -1
  47. package/dist/composites/key-value-list/resolver.d.ts.map +1 -1
  48. package/dist/composites/key-value-list/resolver.js +28 -3
  49. package/dist/composites/key-value-list/resolver.js.map +1 -1
  50. package/dist/composites/pipeline-preview/resolver.cjs +926 -0
  51. package/dist/composites/pipeline-preview/resolver.cjs.map +1 -0
  52. package/dist/composites/pipeline-preview/resolver.js +924 -0
  53. package/dist/composites/pipeline-preview/resolver.js.map +1 -0
  54. package/dist/composites/reconciliation-view/resolver.cjs +90 -32
  55. package/dist/composites/reconciliation-view/resolver.cjs.map +1 -1
  56. package/dist/composites/reconciliation-view/resolver.d.ts.map +1 -1
  57. package/dist/composites/reconciliation-view/resolver.js +91 -33
  58. package/dist/composites/reconciliation-view/resolver.js.map +1 -1
  59. package/dist/composites/stacked-breakdown/resolver.cjs +13 -2
  60. package/dist/composites/stacked-breakdown/resolver.cjs.map +1 -1
  61. package/dist/composites/stacked-breakdown/resolver.d.ts.map +1 -1
  62. package/dist/composites/stacked-breakdown/resolver.js +13 -2
  63. package/dist/composites/stacked-breakdown/resolver.js.map +1 -1
  64. package/dist/composites/stat-grid/resolver.cjs +83 -5
  65. package/dist/composites/stat-grid/resolver.cjs.map +1 -1
  66. package/dist/composites/stat-grid/resolver.d.ts.map +1 -1
  67. package/dist/composites/stat-grid/resolver.js +84 -6
  68. package/dist/composites/stat-grid/resolver.js.map +1 -1
  69. package/dist/composites/trial-balance/resolver.cjs +1 -1
  70. package/dist/composites/trial-balance/resolver.cjs.map +1 -1
  71. package/dist/composites/trial-balance/resolver.js +1 -1
  72. package/dist/composites/trial-balance/resolver.js.map +1 -1
  73. package/dist/composites/variance-analysis/resolver.cjs +1 -1
  74. package/dist/composites/variance-analysis/resolver.cjs.map +1 -1
  75. package/dist/composites/variance-analysis/resolver.js +1 -1
  76. package/dist/composites/variance-analysis/resolver.js.map +1 -1
  77. package/dist/composites/workflow-stepper/resolver.cjs +976 -0
  78. package/dist/composites/workflow-stepper/resolver.cjs.map +1 -0
  79. package/dist/composites/workflow-stepper/resolver.d.ts +20 -0
  80. package/dist/composites/workflow-stepper/resolver.d.ts.map +1 -0
  81. package/dist/composites/workflow-stepper/resolver.js +969 -0
  82. package/dist/composites/workflow-stepper/resolver.js.map +1 -0
  83. package/dist/index.cjs +1182 -275
  84. package/dist/index.cjs.map +1 -1
  85. package/dist/index.d.ts +7 -0
  86. package/dist/index.d.ts.map +1 -1
  87. package/dist/index.js +1019 -120
  88. package/dist/index.js.map +1 -1
  89. package/dist/renderer.cjs +1067 -211
  90. package/dist/renderer.cjs.map +1 -1
  91. package/dist/renderer.js +929 -73
  92. package/dist/renderer.js.map +1 -1
  93. package/dist/resolver.cjs +1066 -210
  94. package/dist/resolver.cjs.map +1 -1
  95. package/dist/resolver.d.ts.map +1 -1
  96. package/dist/resolver.js +929 -73
  97. package/dist/resolver.js.map +1 -1
  98. package/dist/schemas/index.cjs +75 -1
  99. package/dist/schemas/index.cjs.map +1 -1
  100. package/dist/schemas/index.d.ts +122 -0
  101. package/dist/schemas/index.d.ts.map +1 -1
  102. package/dist/schemas/index.js +75 -1
  103. package/dist/schemas/index.js.map +1 -1
  104. package/dist/schemas/workflow-stepper.d.ts +122 -0
  105. package/dist/schemas/workflow-stepper.d.ts.map +1 -0
  106. package/dist/shared/FitText.d.ts +22 -0
  107. package/dist/shared/FitText.d.ts.map +1 -0
  108. package/dist/shared/InteractionContext.d.ts +20 -0
  109. package/dist/shared/InteractionContext.d.ts.map +1 -0
  110. package/dist/shared/styles.d.ts +14 -0
  111. package/dist/shared/styles.d.ts.map +1 -0
  112. package/dist/tool-definitions.json +114 -3
  113. package/package.json +2 -2
@@ -0,0 +1,926 @@
1
+ "use client";
2
+ 'use strict';
3
+
4
+ var react = require('react');
5
+ var htmlToImage = require('html-to-image');
6
+ var jsxRuntime = require('react/jsx-runtime');
7
+
8
+ var __defProp = Object.defineProperty;
9
+ var __defProps = Object.defineProperties;
10
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
11
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
12
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
13
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
14
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
15
+ var __spreadValues = (a, b) => {
16
+ for (var prop in b || (b = {}))
17
+ if (__hasOwnProp.call(b, prop))
18
+ __defNormalProp(a, prop, b[prop]);
19
+ if (__getOwnPropSymbols)
20
+ for (var prop of __getOwnPropSymbols(b)) {
21
+ if (__propIsEnum.call(b, prop))
22
+ __defNormalProp(a, prop, b[prop]);
23
+ }
24
+ return a;
25
+ };
26
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
27
+
28
+ // src/shared/theme.ts
29
+ var BORDER = "#dedede";
30
+ var MUTED = "#777777";
31
+ var PAPER = "#f6f6f6";
32
+ var ACCENT = "#ff5000";
33
+ var ACCENT_SOFT = "#cc4000";
34
+ var SECONDARY = "#0364ff";
35
+ var CHART_PALETTE = [
36
+ "#ff5000",
37
+ "#0364ff",
38
+ "#16a34a",
39
+ "#dc2626",
40
+ "#7c3aed",
41
+ "#0891b2",
42
+ "#f59e0b",
43
+ "#6366f1",
44
+ "#ec4899",
45
+ "#84cc16",
46
+ "#e11d48",
47
+ "#0ea5e9"
48
+ ];
49
+ function ColumnSettingsPanel({ columns, hidden, onToggle, onShowAll, onHideAll }) {
50
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "6px", minWidth: "180px" }, children: [
51
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", justifyContent: "space-between", paddingBottom: "4px", borderBottom: `1px solid ${BORDER}` }, children: [
52
+ /* @__PURE__ */ jsxRuntime.jsx(
53
+ "button",
54
+ {
55
+ onClick: onShowAll,
56
+ style: { background: "none", border: "none", cursor: "pointer", fontSize: "11px", color: ACCENT, fontWeight: 500, padding: 0 },
57
+ children: "Show all"
58
+ }
59
+ ),
60
+ /* @__PURE__ */ jsxRuntime.jsx(
61
+ "button",
62
+ {
63
+ onClick: onHideAll,
64
+ style: { background: "none", border: "none", cursor: "pointer", fontSize: "11px", color: MUTED, fontWeight: 500, padding: 0 },
65
+ children: "Hide all"
66
+ }
67
+ )
68
+ ] }),
69
+ columns.map((col) => /* @__PURE__ */ jsxRuntime.jsxs(
70
+ "label",
71
+ {
72
+ style: { display: "flex", alignItems: "center", gap: "8px", cursor: "pointer", fontSize: "12px", color: "var(--foreground)" },
73
+ children: [
74
+ /* @__PURE__ */ jsxRuntime.jsx(
75
+ "input",
76
+ {
77
+ type: "checkbox",
78
+ checked: !hidden.has(col.key),
79
+ onChange: () => onToggle(col.key),
80
+ style: { accentColor: ACCENT, width: "14px", height: "14px", margin: 0, cursor: "pointer" }
81
+ }
82
+ ),
83
+ col.label
84
+ ]
85
+ },
86
+ col.key
87
+ ))
88
+ ] });
89
+ }
90
+ var DOT_COLOR = "#aaaaaa";
91
+ var DOT_HOVER = "#555555";
92
+ function ComponentActions({ children, onDownloadCSV, columnConfig, filename = "component" }) {
93
+ const [open, setOpen] = react.useState(false);
94
+ const [view, setView] = react.useState("main");
95
+ const contentRef = react.useRef(null);
96
+ const menuRef = react.useRef(null);
97
+ const btnRef = react.useRef(null);
98
+ const close = react.useCallback(() => {
99
+ setOpen(false);
100
+ setView("main");
101
+ }, []);
102
+ react.useEffect(() => {
103
+ if (!open) return;
104
+ const handler = (e) => {
105
+ var _a, _b;
106
+ if ((_a = menuRef.current) == null ? void 0 : _a.contains(e.target)) return;
107
+ if ((_b = btnRef.current) == null ? void 0 : _b.contains(e.target)) return;
108
+ close();
109
+ };
110
+ document.addEventListener("mousedown", handler);
111
+ return () => document.removeEventListener("mousedown", handler);
112
+ }, [open, close]);
113
+ const handleDownloadPNG = react.useCallback(async () => {
114
+ if (!contentRef.current) return;
115
+ try {
116
+ const url = await htmlToImage.toPng(contentRef.current, { backgroundColor: "white", pixelRatio: 2 });
117
+ const a = document.createElement("a");
118
+ a.href = url;
119
+ a.download = `${filename}.png`;
120
+ a.click();
121
+ } catch (e) {
122
+ }
123
+ close();
124
+ }, [filename, close]);
125
+ const handleCSV = react.useCallback(() => {
126
+ onDownloadCSV == null ? void 0 : onDownloadCSV();
127
+ close();
128
+ }, [onDownloadCSV, close]);
129
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { width: "100%", display: "flex", flexDirection: "column" }, children: [
130
+ /* @__PURE__ */ jsxRuntime.jsx("div", { ref: contentRef, style: { width: "100%" }, children }),
131
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", justifyContent: "flex-end", marginTop: "4px", position: "relative", zIndex: 10, flexShrink: 0 }, children: [
132
+ /* @__PURE__ */ jsxRuntime.jsx(
133
+ "button",
134
+ {
135
+ ref: btnRef,
136
+ onClick: () => {
137
+ setOpen((o) => !o);
138
+ setView("main");
139
+ },
140
+ "aria-label": "Component actions",
141
+ style: {
142
+ background: "none",
143
+ border: "none",
144
+ cursor: "pointer",
145
+ padding: "4px 8px",
146
+ display: "flex",
147
+ gap: "3px",
148
+ alignItems: "center",
149
+ borderRadius: "6px",
150
+ transition: "background 0.15s"
151
+ },
152
+ onMouseEnter: (e) => {
153
+ e.currentTarget.style.background = "#f2f2f2";
154
+ e.currentTarget.querySelectorAll("circle").forEach((c) => c.style.fill = DOT_HOVER);
155
+ },
156
+ onMouseLeave: (e) => {
157
+ e.currentTarget.style.background = "none";
158
+ e.currentTarget.querySelectorAll("circle").forEach((c) => c.style.fill = DOT_COLOR);
159
+ },
160
+ children: /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "20", height: "6", viewBox: "0 0 20 6", children: [
161
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "3", cy: "3", r: "2", style: { fill: DOT_COLOR, transition: "fill 0.15s" } }),
162
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "10", cy: "3", r: "2", style: { fill: DOT_COLOR, transition: "fill 0.15s" } }),
163
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "17", cy: "3", r: "2", style: { fill: DOT_COLOR, transition: "fill 0.15s" } })
164
+ ] })
165
+ }
166
+ ),
167
+ open && /* @__PURE__ */ jsxRuntime.jsx(
168
+ "div",
169
+ {
170
+ ref: menuRef,
171
+ style: {
172
+ position: "absolute",
173
+ bottom: "100%",
174
+ right: 0,
175
+ marginBottom: "4px",
176
+ background: "white",
177
+ border: `1px solid ${BORDER}`,
178
+ borderRadius: "0.75rem",
179
+ boxShadow: "0 4px 12px rgba(0,0,0,0.06)",
180
+ zIndex: 50,
181
+ padding: view === "columns" ? "10px" : "4px",
182
+ minWidth: view === "columns" ? "200px" : "160px"
183
+ },
184
+ children: view === "main" ? /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", flexDirection: "column" }, children: [
185
+ columnConfig && /* @__PURE__ */ jsxRuntime.jsx(MenuButton, { label: "Customize columns", onClick: () => setView("columns") }),
186
+ onDownloadCSV && /* @__PURE__ */ jsxRuntime.jsx(MenuButton, { label: "Download CSV", onClick: handleCSV }),
187
+ /* @__PURE__ */ jsxRuntime.jsx(MenuButton, { label: "Download PNG", onClick: handleDownloadPNG })
188
+ ] }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
189
+ /* @__PURE__ */ jsxRuntime.jsx(
190
+ "button",
191
+ {
192
+ onClick: () => setView("main"),
193
+ style: { background: "none", border: "none", cursor: "pointer", fontSize: "11px", color: MUTED, marginBottom: "6px", padding: 0 },
194
+ children: "\u2190 Back"
195
+ }
196
+ ),
197
+ /* @__PURE__ */ jsxRuntime.jsx(
198
+ ColumnSettingsPanel,
199
+ {
200
+ columns: columnConfig.columns,
201
+ hidden: columnConfig.hidden,
202
+ onToggle: columnConfig.onToggle,
203
+ onShowAll: columnConfig.onShowAll,
204
+ onHideAll: columnConfig.onHideAll
205
+ }
206
+ )
207
+ ] })
208
+ }
209
+ )
210
+ ] })
211
+ ] });
212
+ }
213
+ function MenuButton({ label, onClick }) {
214
+ return /* @__PURE__ */ jsxRuntime.jsx(
215
+ "button",
216
+ {
217
+ onClick,
218
+ style: {
219
+ background: "none",
220
+ border: "none",
221
+ cursor: "pointer",
222
+ padding: "8px 12px",
223
+ fontSize: "12.5px",
224
+ color: "var(--foreground)",
225
+ textAlign: "left",
226
+ borderRadius: "8px",
227
+ transition: "background 0.15s",
228
+ whiteSpace: "nowrap"
229
+ },
230
+ onMouseEnter: (e) => e.currentTarget.style.background = "#f2f2f2",
231
+ onMouseLeave: (e) => e.currentTarget.style.background = "none",
232
+ children: label
233
+ }
234
+ );
235
+ }
236
+ var DEFAULT_TOKENS = {
237
+ BORDER,
238
+ MUTED,
239
+ PAPER,
240
+ ACCENT,
241
+ ACCENT_SOFT,
242
+ SECONDARY,
243
+ CHART_PALETTE: [...CHART_PALETTE]
244
+ };
245
+ var GenUIThemeContext = react.createContext(DEFAULT_TOKENS);
246
+ function useTheme() {
247
+ return react.useContext(GenUIThemeContext);
248
+ }
249
+
250
+ // src/composites/pipeline-preview/opMeta.ts
251
+ var OP_META = {
252
+ REST: { label: "PULL DATA", color: "#3b82f6", bg: "#eff6ff", glyph: "\u21A7" },
253
+ REST_LOOP: { label: "PULL DATA", color: "#3b82f6", bg: "#eff6ff", glyph: "\u21A7" },
254
+ PAGINATION: { label: "PULL DATA", color: "#3b82f6", bg: "#eff6ff", glyph: "\u21A7" },
255
+ FILTER: { label: "FILTER", color: "#8b5cf6", bg: "#f5f3ff", glyph: "\u25BD" },
256
+ INTELLIGENT_FILTER: { label: "FILTER", color: "#8b5cf6", bg: "#f5f3ff", glyph: "\u25BD" },
257
+ JQ_FILTER: { label: "TRANSFORM", color: "#06b6d4", bg: "#ecfeff", glyph: "{}" },
258
+ PROMPT: { label: "AI ENRICH", color: "#ec4899", bg: "#fdf2f8", glyph: "\u2738" },
259
+ INTELLIGENT_OUTPUT: { label: "AI OUTPUT", color: "#ec4899", bg: "#fdf2f8", glyph: "\u2738" },
260
+ FLATTEN: { label: "DEDUPLICATE", color: "#f97316", bg: "#fff7ed", glyph: "\u21BA" },
261
+ STORE: { label: "STORE", color: "#10b981", bg: "#ecfdf5", glyph: "\u25A4" },
262
+ EXTRACT: { label: "EXTRACT", color: "#06b6d4", bg: "#ecfeff", glyph: "\u21A7" },
263
+ PROJECT: { label: "PROJECT", color: "#06b6d4", bg: "#ecfeff", glyph: "\u25A6" },
264
+ NOTIFY: { label: "NOTIFY", color: "#eab308", bg: "#fefce8", glyph: "\u25D4" },
265
+ BRANCH: { label: "BRANCH", color: "#6366f1", bg: "#eef2ff", glyph: "\u2442" },
266
+ CONDITION: { label: "BRANCH", color: "#6366f1", bg: "#eef2ff", glyph: "\u2442" },
267
+ MERGE: { label: "MERGE", color: "#14b8a6", bg: "#f0fdfa", glyph: "\u22C8" },
268
+ SORT: { label: "SORT", color: "#a855f7", bg: "#faf5ff", glyph: "\u21C5" },
269
+ OUTPUT_TABLE: { label: "OUTPUT", color: "#0ea5e9", bg: "#f0f9ff", glyph: "\u25A6" },
270
+ OUTPUT_TEXT: { label: "OUTPUT", color: "#0ea5e9", bg: "#f0f9ff", glyph: "\xB6" },
271
+ TEXT_TO_SQL: { label: "SQL QUERY", color: "#f43f5e", bg: "#fff1f2", glyph: "\u2317" },
272
+ TOOL_EXECUTION: { label: "TOOL", color: "#8b5cf6", bg: "#f5f3ff", glyph: "\u2699" },
273
+ PAYLOAD: { label: "PARSE", color: "#ca8a04", bg: "#fefce8", glyph: "\u2750" },
274
+ DATA_SOURCE_LOOKUP: { label: "LOOKUP", color: "#06b6d4", bg: "#ecfeff", glyph: "\u2315" },
275
+ FAN_OUT: { label: "LOOP", color: "#0d9488", bg: "#f0fdfa", glyph: "\u21BB" },
276
+ WRITE_TO_DB: { label: "WRITE", color: "#10b981", bg: "#ecfdf5", glyph: "\u25A4" },
277
+ READ_FROM_DB: { label: "READ DB", color: "#6366f1", bg: "#eef2ff", glyph: "\u2315" },
278
+ EMBEDDER: { label: "EMBEDDER", color: "#7c3aed", bg: "#f5f3ff", glyph: "\u2756" },
279
+ AGENTIC_SEARCH: { label: "AI SEARCH", color: "#0891b2", bg: "#ecfeff", glyph: "\u25CE" },
280
+ S3_READ: { label: "S3 READ", color: "#f59e0b", bg: "#fffbeb", glyph: "\u21A7" },
281
+ GOOGLE_DRIVE_READ: { label: "DRIVE READ", color: "#0f9d58", bg: "#e8f5e9", glyph: "\u25A4" },
282
+ GOOGLE_DRIVE_WRITE: { label: "DRIVE WRITE", color: "#0f9d58", bg: "#e8f5e9", glyph: "\u25A5" },
283
+ OUTLOOK: { label: "OUTLOOK", color: "#0078d4", bg: "#e8f2fc", glyph: "\u2709" },
284
+ GMAIL: { label: "GMAIL", color: "#ea4335", bg: "#fdecec", glyph: "\u2709" },
285
+ ESCALATE: { label: "ESCALATE", color: "#f59e0b", bg: "#fffbeb", glyph: "\u2691" },
286
+ PARSE_DOCUMENT: { label: "PARSE DOC", color: "#0d9488", bg: "#f0fdfa", glyph: "\u2750" },
287
+ RUN_ACTION: { label: "RUN ACTION", color: "#d97706", bg: "#fffbeb", glyph: "\u25B8" }
288
+ };
289
+ var FALLBACK_COLORS = [
290
+ { color: "#64748b", bg: "#f8fafc" },
291
+ { color: "#0ea5e9", bg: "#f0f9ff" },
292
+ { color: "#8b5cf6", bg: "#f5f3ff" },
293
+ { color: "#f97316", bg: "#fff7ed" },
294
+ { color: "#14b8a6", bg: "#f0fdfa" },
295
+ { color: "#ec4899", bg: "#fdf2f8" },
296
+ { color: "#6366f1", bg: "#eef2ff" },
297
+ { color: "#ca8a04", bg: "#fefce8" }
298
+ ];
299
+ function formatOpLabel(op) {
300
+ return op.split("_").map((w) => w.charAt(0).toUpperCase() + w.slice(1).toLowerCase()).join(" ");
301
+ }
302
+ function getOpMeta(operation) {
303
+ if (!operation) return { label: "Step", color: "#64748b", bg: "#f8fafc", glyph: "\u25B8" };
304
+ const known = OP_META[operation];
305
+ if (known) return known;
306
+ const { color, bg } = FALLBACK_COLORS[operation.length % FALLBACK_COLORS.length];
307
+ return { label: formatOpLabel(operation), color, bg, glyph: "\u25B8" };
308
+ }
309
+
310
+ // src/composites/pipeline-preview/layout.ts
311
+ var NODE_W = 220;
312
+ var NODE_H = 56;
313
+ var BRANCH_NODE_H = 44;
314
+ var GAP_Y = 32;
315
+ var GAP_X = 20;
316
+ var BRANCH_PAD = 12;
317
+ var BRANCH_HEADER = 36;
318
+ var FAN_OUT_PAD = 16;
319
+ var FAN_OUT_HEADER = 60;
320
+ var BRANCH_COLORS = ["#6366f1", "#0891b2", "#f59e0b", "#ec4899", "#14b8a6", "#a855f7"];
321
+ function layoutGraph(steps, startX = 0, startY = 0, keyPrefix = "") {
322
+ const nodes = [];
323
+ const edges = [];
324
+ let y = startY;
325
+ let prevId = null;
326
+ let totalW = NODE_W;
327
+ steps.forEach((step, idx) => {
328
+ var _a, _b, _c, _d;
329
+ const op = step.operation;
330
+ const isBranch = op === "BRANCH" || op === "CONDITION";
331
+ const isFanOut = op === "FAN_OUT";
332
+ const baseId = `${keyPrefix}${(_a = step.id) != null ? _a : `s${idx}`}`;
333
+ if (isFanOut && ((_b = step.subSteps) == null ? void 0 : _b.length)) {
334
+ const foNodeId = baseId;
335
+ const res = layoutGraph(step.subSteps, 0, 0, `${baseId}/`);
336
+ const containerW = Math.max(res.totalW, NODE_W) + FAN_OUT_PAD * 2;
337
+ const containerH = res.totalH + FAN_OUT_HEADER + FAN_OUT_PAD * 2 + 4;
338
+ nodes.push({
339
+ id: foNodeId,
340
+ type: "fan-out-group",
341
+ x: startX - containerW / 2,
342
+ y,
343
+ w: containerW,
344
+ h: containerH,
345
+ data: step
346
+ });
347
+ if (prevId) edges.push({ from: prevId, to: foNodeId });
348
+ const offX = res.nodes.length ? startX - res.nodes[0].x : startX;
349
+ const subNodes = [];
350
+ for (const n of res.nodes) {
351
+ const nn = __spreadProps(__spreadValues({}, n), { x: n.x + offX, y: n.y + y + FAN_OUT_HEADER });
352
+ subNodes.push(nn);
353
+ nodes.push(nn);
354
+ }
355
+ for (const e of res.edges) edges.push(e);
356
+ totalW = Math.max(totalW, containerW);
357
+ y += containerH + GAP_Y;
358
+ const lastSub = subNodes.filter((n) => n.type === "step").pop();
359
+ prevId = lastSub ? lastSub.id : foNodeId;
360
+ } else if (isBranch && ((_c = step.branches) == null ? void 0 : _c.length)) {
361
+ const bNodeId = baseId;
362
+ nodes.push({
363
+ id: bNodeId,
364
+ x: startX,
365
+ y,
366
+ w: NODE_W,
367
+ h: BRANCH_NODE_H,
368
+ data: step,
369
+ type: "branch-header"
370
+ });
371
+ if (prevId) edges.push({ from: prevId, to: bNodeId });
372
+ y += BRANCH_NODE_H + GAP_Y;
373
+ const branchResults = step.branches.map((br, bi) => {
374
+ var _a2;
375
+ return __spreadValues({
376
+ branch: __spreadProps(__spreadValues({}, br), { color: BRANCH_COLORS[bi % BRANCH_COLORS.length], _gid: `${bNodeId}-b${bi}` })
377
+ }, layoutGraph((_a2 = br.steps) != null ? _a2 : [], 0, 0, `${bNodeId}/b${bi}/`));
378
+ });
379
+ let bTotalW = branchResults.reduce((sum, r) => sum + r.totalW + GAP_X, 0) - GAP_X;
380
+ if (!Number.isFinite(bTotalW) || bTotalW <= 0) bTotalW = NODE_W;
381
+ totalW = Math.max(totalW, bTotalW);
382
+ let cx = startX - bTotalW / 2 + (((_d = branchResults[0]) == null ? void 0 : _d.totalW) || NODE_W) / 2;
383
+ for (const br of branchResults) {
384
+ const offX = br.nodes.length ? cx - br.nodes[0].x : cx;
385
+ const groupNodes = [];
386
+ for (const n of br.nodes) {
387
+ const nn = __spreadProps(__spreadValues({}, n), { x: n.x + offX, y: n.y + y + BRANCH_HEADER });
388
+ groupNodes.push(nn);
389
+ nodes.push(nn);
390
+ }
391
+ for (const e of br.edges) edges.push(e);
392
+ nodes.push({
393
+ id: `${br.branch._gid}-group`,
394
+ type: "branch-group",
395
+ x: cx - br.totalW / 2 - BRANCH_PAD,
396
+ y: y - 4,
397
+ w: br.totalW + BRANCH_PAD * 2,
398
+ h: br.totalH + BRANCH_HEADER + BRANCH_PAD * 2 + 4,
399
+ data: br.branch
400
+ });
401
+ if (groupNodes.length > 0) {
402
+ edges.push({ from: bNodeId, to: groupNodes[0].id, color: br.branch.color });
403
+ }
404
+ cx += br.totalW + GAP_X;
405
+ }
406
+ const maxBranchH = Math.max(
407
+ ...branchResults.map((b) => b.totalH + BRANCH_HEADER + BRANCH_PAD * 2 + 4)
408
+ );
409
+ y += maxBranchH + GAP_Y;
410
+ prevId = null;
411
+ } else {
412
+ const nodeId = baseId;
413
+ nodes.push({
414
+ id: nodeId,
415
+ x: startX,
416
+ y,
417
+ w: NODE_W,
418
+ h: NODE_H,
419
+ data: step,
420
+ type: "step"
421
+ });
422
+ if (prevId) edges.push({ from: prevId, to: nodeId });
423
+ prevId = nodeId;
424
+ y += NODE_H + GAP_Y;
425
+ }
426
+ });
427
+ return { nodes, edges, totalW, totalH: Math.max(y - startY - GAP_Y, 0) };
428
+ }
429
+ function layoutBounds(nodes) {
430
+ const real = nodes.filter((n) => n.type !== "branch-group" || true);
431
+ if (!real.length) return { minX: 0, minY: 0, maxX: NODE_W, maxY: NODE_H };
432
+ const left = (n) => n.type === "fan-out-group" || n.type === "branch-group" ? n.x : n.x - n.w / 2;
433
+ const right = (n) => n.type === "fan-out-group" || n.type === "branch-group" ? n.x + n.w : n.x + n.w / 2;
434
+ return {
435
+ minX: Math.min(...real.map(left)),
436
+ minY: Math.min(...real.map((n) => n.y)),
437
+ maxX: Math.max(...real.map(right)),
438
+ maxY: Math.max(...real.map((n) => n.y + n.h))
439
+ };
440
+ }
441
+ var STATE_CONFIG = {
442
+ draft: { label: "Draft", bg: "#f2f2f2", color: "#777777" },
443
+ running: { label: "Running", bg: "#dcfce7", color: "#15803d" },
444
+ paused: { label: "Paused", bg: "#fff7ed", color: "#f59e0b" }
445
+ };
446
+ var FANOUT_COLOR = getOpMeta("FAN_OUT").color;
447
+ var titleStyle = {
448
+ fontFamily: "var(--font-serif)",
449
+ fontSize: "15px",
450
+ fontWeight: 400,
451
+ color: "var(--foreground)",
452
+ letterSpacing: "-0.01em",
453
+ margin: 0
454
+ };
455
+ function Chip({
456
+ children,
457
+ bg,
458
+ color
459
+ }) {
460
+ return /* @__PURE__ */ jsxRuntime.jsx(
461
+ "span",
462
+ {
463
+ style: {
464
+ fontSize: "10px",
465
+ fontWeight: 600,
466
+ letterSpacing: "0.04em",
467
+ padding: "2px 8px",
468
+ borderRadius: "9999px",
469
+ background: bg,
470
+ color,
471
+ whiteSpace: "nowrap"
472
+ },
473
+ children
474
+ }
475
+ );
476
+ }
477
+ function edgePath(from, to) {
478
+ const isFromGroup = from.type === "fan-out-group" || from.type === "branch-group";
479
+ const isToGroup = to.type === "fan-out-group" || to.type === "branch-group";
480
+ const x1 = isFromGroup ? from.x + from.w / 2 : from.x;
481
+ const y1 = from.y + from.h;
482
+ const x2 = isToGroup ? to.x + to.w / 2 : to.x;
483
+ const y2 = to.y;
484
+ const midY = (y1 + y2) / 2;
485
+ return `M ${x1} ${y1} C ${x1} ${midY}, ${x2} ${midY}, ${x2} ${y2}`;
486
+ }
487
+ function IconBox({ color, bg, glyph }) {
488
+ return /* @__PURE__ */ jsxRuntime.jsx(
489
+ "div",
490
+ {
491
+ style: {
492
+ width: 30,
493
+ height: 30,
494
+ borderRadius: 7,
495
+ display: "flex",
496
+ alignItems: "center",
497
+ justifyContent: "center",
498
+ flexShrink: 0,
499
+ background: bg,
500
+ border: `1px solid ${color}4D`,
501
+ color,
502
+ fontSize: 14,
503
+ lineHeight: 1
504
+ },
505
+ children: glyph
506
+ }
507
+ );
508
+ }
509
+ function OpBadge({ color, bg, label }) {
510
+ return /* @__PURE__ */ jsxRuntime.jsx(
511
+ "span",
512
+ {
513
+ style: {
514
+ fontSize: 9,
515
+ fontWeight: 700,
516
+ padding: "1px 5px",
517
+ borderRadius: 3,
518
+ letterSpacing: "0.3px",
519
+ color,
520
+ background: bg
521
+ },
522
+ children: label
523
+ }
524
+ );
525
+ }
526
+ var ellipsis = {
527
+ whiteSpace: "nowrap",
528
+ overflow: "hidden",
529
+ textOverflow: "ellipsis",
530
+ display: "block"
531
+ };
532
+ function PipelinePreviewResolver(p) {
533
+ var _a, _b, _c, _d, _e, _f, _g;
534
+ const { MUTED: MUTED2, PAPER: PAPER2, BORDER: BORDER2, ACCENT: ACCENT2, ACCENT_SOFT: ACCENT_SOFT2 } = useTheme();
535
+ const [btnHovered, setBtnHovered] = react.useState(false);
536
+ const stateCfg = STATE_CONFIG[(_a = p.state) != null ? _a : "draft"];
537
+ const destinations = (_b = p.destinations) != null ? _b : [];
538
+ const steps = (_c = p.steps) != null ? _c : [];
539
+ const workstreams = (_d = p.workstreams) != null ? _d : [];
540
+ const scheduleLabel = p.schedule ? p.schedule.type === "manual" ? "Manual" : (_f = (_e = p.schedule.label) != null ? _e : p.schedule.cron) != null ? _f : "Scheduled" : null;
541
+ const { nodes, edges, viewBox, vbW, vbH } = react.useMemo(() => {
542
+ const res = layoutGraph(steps);
543
+ const b = layoutBounds(res.nodes);
544
+ const pad = 24;
545
+ const w = b.maxX - b.minX + pad * 2;
546
+ const h = b.maxY - b.minY + pad * 2;
547
+ return {
548
+ nodes: res.nodes,
549
+ edges: res.edges,
550
+ viewBox: `${b.minX - pad} ${b.minY - pad} ${w} ${h}`,
551
+ vbW: w,
552
+ vbH: h
553
+ };
554
+ }, [steps]);
555
+ const nodeMap = react.useMemo(() => {
556
+ const m = {};
557
+ nodes.forEach((n) => m[n.id] = n);
558
+ return m;
559
+ }, [nodes]);
560
+ return /* @__PURE__ */ jsxRuntime.jsx(ComponentActions, { filename: (_g = p.name) != null ? _g : "pipeline-preview", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { width: "100%", display: "flex", flexDirection: "column", gap: "12px" }, children: [
561
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "8px", flexWrap: "wrap" }, children: [
562
+ /* @__PURE__ */ jsxRuntime.jsx("p", { style: titleStyle, children: p.name }),
563
+ /* @__PURE__ */ jsxRuntime.jsx(Chip, { bg: stateCfg.bg, color: stateCfg.color, children: stateCfg.label })
564
+ ] }),
565
+ p.description && /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: "12.5px", color: MUTED2, lineHeight: 1.45, marginTop: "-4px" }, children: p.description }),
566
+ (p.source || destinations.length > 0) && /* @__PURE__ */ jsxRuntime.jsxs(
567
+ "div",
568
+ {
569
+ style: {
570
+ display: "flex",
571
+ alignItems: "center",
572
+ gap: "8px",
573
+ flexWrap: "wrap",
574
+ padding: "10px 12px",
575
+ borderRadius: "0.6rem",
576
+ border: `1px solid ${BORDER2}`,
577
+ background: PAPER2
578
+ },
579
+ children: [
580
+ p.source && /* @__PURE__ */ jsxRuntime.jsx(
581
+ "span",
582
+ {
583
+ style: {
584
+ fontSize: "12px",
585
+ fontWeight: 600,
586
+ color: "var(--foreground)",
587
+ padding: "3px 10px",
588
+ borderRadius: "9999px",
589
+ background: "white",
590
+ border: `1px solid ${BORDER2}`
591
+ },
592
+ children: p.source.name
593
+ }
594
+ ),
595
+ p.source && destinations.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: MUTED2, fontSize: "14px" }, children: "\u2192" }),
596
+ destinations.map((d, i) => /* @__PURE__ */ jsxRuntime.jsx(
597
+ "span",
598
+ {
599
+ style: {
600
+ fontSize: "12px",
601
+ fontWeight: 600,
602
+ color: "var(--foreground)",
603
+ padding: "3px 10px",
604
+ borderRadius: "9999px",
605
+ background: "white",
606
+ border: `1px solid ${BORDER2}`
607
+ },
608
+ children: d.name
609
+ },
610
+ i
611
+ ))
612
+ ]
613
+ }
614
+ ),
615
+ (scheduleLabel || workstreams.length > 0) && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "10px", flexWrap: "wrap" }, children: [
616
+ scheduleLabel && /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { fontSize: "11px", color: MUTED2 }, children: [
617
+ "\u23F1 ",
618
+ scheduleLabel
619
+ ] }),
620
+ workstreams.map((w, i) => /* @__PURE__ */ jsxRuntime.jsx(Chip, { bg: "#eef2ff", color: "#6366f1", children: w }, i))
621
+ ] }),
622
+ nodes.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
623
+ "div",
624
+ {
625
+ style: {
626
+ position: "relative",
627
+ border: `1px solid ${BORDER2}`,
628
+ borderRadius: 12,
629
+ background: PAPER2,
630
+ overflow: "auto",
631
+ maxHeight: 520,
632
+ display: "flex",
633
+ justifyContent: "center"
634
+ },
635
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
636
+ "svg",
637
+ {
638
+ width: vbW,
639
+ height: vbH,
640
+ viewBox,
641
+ style: { maxWidth: "100%", display: "block" },
642
+ preserveAspectRatio: "xMidYMid meet",
643
+ children: [
644
+ /* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsx("filter", { id: "pp-shadow", x: "-10%", y: "-10%", width: "120%", height: "130%", children: /* @__PURE__ */ jsxRuntime.jsx("feDropShadow", { dx: "0", dy: "1", stdDeviation: "2", floodOpacity: "0.08" }) }) }),
645
+ edges.map((e, i) => {
646
+ const from = nodeMap[e.from];
647
+ const to = nodeMap[e.to];
648
+ if (!from || !to) return null;
649
+ return /* @__PURE__ */ jsxRuntime.jsx(
650
+ "path",
651
+ {
652
+ d: edgePath(from, to),
653
+ fill: "none",
654
+ stroke: e.color || BORDER2,
655
+ strokeWidth: 2,
656
+ strokeLinecap: "round"
657
+ },
658
+ `edge-${i}`
659
+ );
660
+ }),
661
+ nodes.filter((n) => n.type === "branch-group").map((n) => {
662
+ const color = n.data.color || "#94a3b8";
663
+ return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
664
+ /* @__PURE__ */ jsxRuntime.jsx(
665
+ "rect",
666
+ {
667
+ x: n.x,
668
+ y: n.y,
669
+ width: n.w,
670
+ height: n.h,
671
+ rx: 10,
672
+ ry: 10,
673
+ fill: `${color}0D`,
674
+ stroke: color,
675
+ strokeWidth: 1.5,
676
+ strokeDasharray: "4 3",
677
+ opacity: 0.8
678
+ }
679
+ ),
680
+ /* @__PURE__ */ jsxRuntime.jsx(
681
+ "foreignObject",
682
+ {
683
+ x: n.x + 8,
684
+ y: n.y + 6,
685
+ width: n.w - 16,
686
+ height: 22,
687
+ style: { pointerEvents: "none" },
688
+ children: /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
689
+ /* @__PURE__ */ jsxRuntime.jsx(
690
+ "span",
691
+ {
692
+ style: {
693
+ width: 8,
694
+ height: 8,
695
+ borderRadius: "50%",
696
+ flexShrink: 0,
697
+ background: color
698
+ }
699
+ }
700
+ ),
701
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: 11, fontWeight: 700, color: "var(--foreground)" }, children: n.data.label }),
702
+ n.data.condition && /* @__PURE__ */ jsxRuntime.jsx(
703
+ "span",
704
+ {
705
+ style: __spreadValues({
706
+ fontSize: 9,
707
+ color: MUTED2,
708
+ fontFamily: "monospace"
709
+ }, ellipsis),
710
+ children: n.data.condition
711
+ }
712
+ )
713
+ ] })
714
+ }
715
+ )
716
+ ] }, n.id);
717
+ }),
718
+ nodes.filter((n) => n.type === "fan-out-group").map((n) => {
719
+ const m = getOpMeta("FAN_OUT");
720
+ const count = Array.isArray(n.data.subSteps) ? n.data.subSteps.length : 0;
721
+ const titleText = n.data.label || n.data.id || "Loop";
722
+ return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
723
+ /* @__PURE__ */ jsxRuntime.jsx(
724
+ "rect",
725
+ {
726
+ x: n.x,
727
+ y: n.y,
728
+ width: n.w,
729
+ height: n.h,
730
+ rx: 12,
731
+ ry: 12,
732
+ fill: `${FANOUT_COLOR}0D`,
733
+ stroke: FANOUT_COLOR,
734
+ strokeWidth: 1.5,
735
+ strokeDasharray: "6 3",
736
+ opacity: 0.9
737
+ }
738
+ ),
739
+ /* @__PURE__ */ jsxRuntime.jsxs(
740
+ "foreignObject",
741
+ {
742
+ x: n.x,
743
+ y: n.y,
744
+ width: n.w,
745
+ height: 60,
746
+ style: { pointerEvents: "none" },
747
+ children: [
748
+ /* @__PURE__ */ jsxRuntime.jsxs(
749
+ "div",
750
+ {
751
+ style: {
752
+ display: "flex",
753
+ alignItems: "center",
754
+ justifyContent: "space-between",
755
+ padding: "8px 12px 0 12px"
756
+ },
757
+ children: [
758
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
759
+ /* @__PURE__ */ jsxRuntime.jsx(IconBox, { color: m.color, bg: m.bg, glyph: m.glyph }),
760
+ /* @__PURE__ */ jsxRuntime.jsx(OpBadge, { color: m.color, bg: m.bg, label: m.label })
761
+ ] }),
762
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { fontWeight: 500, color: FANOUT_COLOR, fontSize: 10, whiteSpace: "nowrap" }, children: [
763
+ count,
764
+ " steps"
765
+ ] })
766
+ ]
767
+ }
768
+ ),
769
+ /* @__PURE__ */ jsxRuntime.jsx(
770
+ "div",
771
+ {
772
+ style: __spreadValues({
773
+ fontSize: 11,
774
+ color: MUTED2,
775
+ padding: "2px 12px 6px 12px"
776
+ }, ellipsis),
777
+ title: titleText,
778
+ children: titleText
779
+ }
780
+ )
781
+ ]
782
+ }
783
+ )
784
+ ] }, n.id);
785
+ }),
786
+ nodes.filter((n) => n.type === "branch-header").map((n) => {
787
+ const m = getOpMeta(n.data.operation || "CONDITION");
788
+ const branchCount = Array.isArray(n.data.branches) ? n.data.branches.length : 0;
789
+ const titleText = n.data.label || n.data.id || m.label;
790
+ return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
791
+ /* @__PURE__ */ jsxRuntime.jsx(
792
+ "rect",
793
+ {
794
+ x: n.x - n.w / 2,
795
+ y: n.y,
796
+ width: n.w,
797
+ height: n.h,
798
+ rx: 10,
799
+ ry: 10,
800
+ fill: m.bg,
801
+ stroke: m.color,
802
+ strokeWidth: 1.5,
803
+ filter: "url(#pp-shadow)"
804
+ }
805
+ ),
806
+ /* @__PURE__ */ jsxRuntime.jsx(
807
+ "foreignObject",
808
+ {
809
+ x: n.x - n.w / 2 + 8,
810
+ y: n.y + 4,
811
+ width: n.w - 16,
812
+ height: n.h - 8,
813
+ style: { pointerEvents: "none" },
814
+ children: /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 8, height: "100%" }, children: [
815
+ /* @__PURE__ */ jsxRuntime.jsx(IconBox, { color: m.color, bg: m.bg, glyph: m.glyph }),
816
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { flex: 1, minWidth: 0 }, children: [
817
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: 10, fontWeight: 700, letterSpacing: "0.5px", color: m.color, display: "block" }, children: m.label }),
818
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: __spreadValues({ fontSize: 11, color: "var(--foreground)", fontWeight: 600 }, ellipsis), title: titleText, children: titleText })
819
+ ] }),
820
+ /* @__PURE__ */ jsxRuntime.jsxs(
821
+ "span",
822
+ {
823
+ style: {
824
+ fontSize: 9,
825
+ padding: "2px 6px",
826
+ borderRadius: 8,
827
+ fontWeight: 600,
828
+ flexShrink: 0,
829
+ color: m.color,
830
+ background: `${m.color}26`
831
+ },
832
+ children: [
833
+ branchCount,
834
+ "\u2192"
835
+ ]
836
+ }
837
+ )
838
+ ] })
839
+ }
840
+ )
841
+ ] }, n.id);
842
+ }),
843
+ nodes.filter((n) => n.type === "step").map((n) => {
844
+ const m = getOpMeta(n.data.operation);
845
+ const line = n.data.label || n.data.description || n.data.id || "";
846
+ return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
847
+ /* @__PURE__ */ jsxRuntime.jsx(
848
+ "rect",
849
+ {
850
+ x: n.x - n.w / 2,
851
+ y: n.y,
852
+ width: n.w,
853
+ height: n.h,
854
+ rx: 10,
855
+ ry: 10,
856
+ fill: "white",
857
+ stroke: BORDER2,
858
+ strokeWidth: 1,
859
+ filter: "url(#pp-shadow)"
860
+ }
861
+ ),
862
+ /* @__PURE__ */ jsxRuntime.jsx(
863
+ "foreignObject",
864
+ {
865
+ x: n.x - n.w / 2 + 8,
866
+ y: n.y + 4,
867
+ width: n.w - 16,
868
+ height: n.h - 8,
869
+ style: { pointerEvents: "none" },
870
+ children: /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 8, height: "100%" }, children: [
871
+ /* @__PURE__ */ jsxRuntime.jsx(IconBox, { color: m.color, bg: m.bg, glyph: m.glyph }),
872
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { flex: 1, minWidth: 0 }, children: [
873
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "flex", alignItems: "center", gap: 4, flexWrap: "wrap" }, children: /* @__PURE__ */ jsxRuntime.jsx(OpBadge, { color: m.color, bg: m.bg, label: m.label }) }),
874
+ /* @__PURE__ */ jsxRuntime.jsx(
875
+ "span",
876
+ {
877
+ style: __spreadValues({
878
+ fontSize: 11,
879
+ color: "var(--foreground)",
880
+ fontWeight: 500,
881
+ marginTop: 2
882
+ }, ellipsis),
883
+ title: n.data.description || line,
884
+ children: line
885
+ }
886
+ )
887
+ ] })
888
+ ] })
889
+ }
890
+ )
891
+ ] }, n.id);
892
+ })
893
+ ]
894
+ }
895
+ )
896
+ }
897
+ ),
898
+ p.cta && /* @__PURE__ */ jsxRuntime.jsx(
899
+ "a",
900
+ {
901
+ href: p.cta.url,
902
+ target: "_blank",
903
+ rel: "noopener noreferrer",
904
+ onMouseEnter: () => setBtnHovered(true),
905
+ onMouseLeave: () => setBtnHovered(false),
906
+ style: {
907
+ alignSelf: "flex-start",
908
+ background: btnHovered ? ACCENT_SOFT2 : ACCENT2,
909
+ color: "white",
910
+ borderRadius: "8px",
911
+ padding: "8px 16px",
912
+ fontSize: "12px",
913
+ fontWeight: 600,
914
+ textDecoration: "none",
915
+ cursor: "pointer",
916
+ transition: "background 0.15s"
917
+ },
918
+ children: p.cta.label + " \u2192"
919
+ }
920
+ )
921
+ ] }) });
922
+ }
923
+
924
+ exports.PipelinePreviewResolver = PipelinePreviewResolver;
925
+ //# sourceMappingURL=resolver.cjs.map
926
+ //# sourceMappingURL=resolver.cjs.map