@w6w/ui 0.0.0-stage → 0.1.1

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 (142) hide show
  1. package/CHANGELOG.md +68 -0
  2. package/LICENSE +21 -0
  3. package/README.md +275 -2
  4. package/dist/ActionTestForm.d.ts +76 -0
  5. package/dist/AddConnectionModal.d.ts +24 -0
  6. package/dist/AppPicker.d.ts +83 -0
  7. package/dist/CodeBlock-CZu4TFSi.cjs +15 -0
  8. package/dist/CodeBlock-CZu4TFSi.cjs.map +1 -0
  9. package/dist/CodeBlock-Dot3Pd7P.js +2889 -0
  10. package/dist/CodeBlock-Dot3Pd7P.js.map +1 -0
  11. package/dist/CodeBlock.d.ts +65 -0
  12. package/dist/CodeEditor.d.ts +42 -0
  13. package/dist/ConfirmModal-8avl9Nv8.cjs +11 -0
  14. package/dist/ConfirmModal-8avl9Nv8.cjs.map +1 -0
  15. package/dist/ConfirmModal-CD-P8mhN.js +6335 -0
  16. package/dist/ConfirmModal-CD-P8mhN.js.map +1 -0
  17. package/dist/Copyable-1niV9gUa.js +771 -0
  18. package/dist/Copyable-1niV9gUa.js.map +1 -0
  19. package/dist/Copyable-CYZU1o4X.cjs +2 -0
  20. package/dist/Copyable-CYZU1o4X.cjs.map +1 -0
  21. package/dist/JsonEditor.d.ts +60 -0
  22. package/dist/NodeConfigForm.d.ts +70 -0
  23. package/dist/ParamsForm.d.ts +56 -0
  24. package/dist/PropertyEntryForm.d.ts +56 -0
  25. package/dist/RetryPolicyFields.d.ts +18 -0
  26. package/dist/StepBuilderModal.d.ts +375 -0
  27. package/dist/TriggerFillForm.d.ts +52 -0
  28. package/dist/WaitEditor.d.ts +6 -0
  29. package/dist/WorkflowFlowEditor.d.ts +119 -0
  30. package/dist/YamlEditor.d.ts +46 -0
  31. package/dist/app-categories.d.ts +38 -0
  32. package/dist/app-pages.d.ts +111 -0
  33. package/dist/code.cjs +2 -0
  34. package/dist/code.cjs.map +1 -0
  35. package/dist/code.d.ts +29 -0
  36. package/dist/code.mjs +8 -0
  37. package/dist/code.mjs.map +1 -0
  38. package/dist/components/ApiCallsPanel.d.ts +41 -0
  39. package/dist/components/AppIcon.d.ts +25 -0
  40. package/dist/components/AuthFieldsForm.d.ts +22 -0
  41. package/dist/components/Combobox.d.ts +24 -0
  42. package/dist/components/ConfirmModal.d.ts +33 -0
  43. package/dist/components/Copyable.d.ts +51 -0
  44. package/dist/components/CopyableText.d.ts +40 -0
  45. package/dist/components/DeleteButton.d.ts +16 -0
  46. package/dist/components/EditButton.d.ts +10 -0
  47. package/dist/components/ExecutionDetail.d.ts +70 -0
  48. package/dist/components/ExecutionFilters.d.ts +59 -0
  49. package/dist/components/ExecutionList.d.ts +60 -0
  50. package/dist/components/ExecutionLogPanel.d.ts +98 -0
  51. package/dist/components/ExecutionStats.d.ts +47 -0
  52. package/dist/components/ExpressionEditorModal.d.ts +42 -0
  53. package/dist/components/ExpressionInput.d.ts +36 -0
  54. package/dist/components/ExpressionOptions.d.ts +185 -0
  55. package/dist/components/HealthStatusPill.d.ts +25 -0
  56. package/dist/components/HistoryTimeline.d.ts +56 -0
  57. package/dist/components/Icon.d.ts +34 -0
  58. package/dist/components/IconButton.d.ts +60 -0
  59. package/dist/components/InfoTip.d.ts +15 -0
  60. package/dist/components/InternalIcon.d.ts +19 -0
  61. package/dist/components/ListItem.d.ts +25 -0
  62. package/dist/components/Modal.d.ts +29 -0
  63. package/dist/components/RepoSyncIndicator.d.ts +29 -0
  64. package/dist/components/ResolvedParams.d.ts +31 -0
  65. package/dist/components/ServerResources.d.ts +47 -0
  66. package/dist/components/StepStatusPill.d.ts +51 -0
  67. package/dist/components/UptimeStrip.d.ts +56 -0
  68. package/dist/components/execution-format.d.ts +24 -0
  69. package/dist/components/expression-dom.d.ts +154 -0
  70. package/dist/components/expression-template.d.ts +86 -0
  71. package/dist/components/history-scale.d.ts +33 -0
  72. package/dist/components/icons.d.ts +41 -0
  73. package/dist/components/resolved-clip.d.ts +42 -0
  74. package/dist/components/server-resources-format.d.ts +68 -0
  75. package/dist/components/server-resources.fixture.d.ts +9 -0
  76. package/dist/components/use-copy.d.ts +14 -0
  77. package/dist/createW6WApi.d.ts +31 -0
  78. package/dist/flow-connect.d.ts +138 -0
  79. package/dist/flow-fanout.d.ts +15 -0
  80. package/dist/flow-types.d.ts +356 -0
  81. package/dist/flow-utils.d.ts +284 -0
  82. package/dist/flow.cjs +3 -0
  83. package/dist/flow.cjs.map +1 -0
  84. package/dist/flow.d.ts +24 -0
  85. package/dist/flow.mjs +1978 -0
  86. package/dist/flow.mjs.map +1 -0
  87. package/dist/index.cjs +2 -0
  88. package/dist/index.cjs.map +1 -0
  89. package/dist/index.d.ts +94 -0
  90. package/dist/index.mjs +1812 -0
  91. package/dist/index.mjs.map +1 -0
  92. package/dist/oauth-popup.d.ts +17 -0
  93. package/dist/output-shape.d.ts +58 -0
  94. package/dist/provider.d.ts +421 -0
  95. package/dist/resolve-params.d.ts +112 -0
  96. package/dist/resolved-json.d.ts +21 -0
  97. package/dist/run-visuals.d.ts +90 -0
  98. package/dist/step-preview-state.d.ts +143 -0
  99. package/dist/theme.d.ts +32 -0
  100. package/dist/trigger-fields.d.ts +56 -0
  101. package/dist/types.d.ts +413 -0
  102. package/dist/use-app-action-defs.d.ts +7 -0
  103. package/dist/use-enter-submit.d.ts +23 -0
  104. package/dist/use-seed-sources.d.ts +16 -0
  105. package/package.json +112 -3
  106. package/src/code.css +561 -0
  107. package/src/styles/_buttons.scss +38 -0
  108. package/src/styles/_chips.scss +210 -0
  109. package/src/styles/_code.scss +139 -0
  110. package/src/styles/_copyable.scss +147 -0
  111. package/src/styles/_data-vars.scss +38 -0
  112. package/src/styles/_execution-history.scss +282 -0
  113. package/src/styles/_execution-log.scss +178 -0
  114. package/src/styles/_expression-field.scss +65 -0
  115. package/src/styles/_expression-inline.scss +63 -0
  116. package/src/styles/_expression-modal.scss +292 -0
  117. package/src/styles/_fields.scss +161 -0
  118. package/src/styles/_flow.scss +217 -0
  119. package/src/styles/_fx.scss +158 -0
  120. package/src/styles/_health.scss +46 -0
  121. package/src/styles/_history-timeline.scss +156 -0
  122. package/src/styles/_icon-button.scss +22 -0
  123. package/src/styles/_icon.scss +15 -0
  124. package/src/styles/_icons.scss +31 -0
  125. package/src/styles/_incoming-state.scss +46 -0
  126. package/src/styles/_info-tip.scss +9 -0
  127. package/src/styles/_layout.scss +6 -0
  128. package/src/styles/_lists.scss +64 -0
  129. package/src/styles/_modal.scss +125 -0
  130. package/src/styles/_multiselect.scss +69 -0
  131. package/src/styles/_repo-sync-indicator.scss +99 -0
  132. package/src/styles/_scale.scss +70 -0
  133. package/src/styles/_sections.scss +36 -0
  134. package/src/styles/_server-resources.scss +163 -0
  135. package/src/styles/_step-builder.scss +376 -0
  136. package/src/styles/_step-config.scss +195 -0
  137. package/src/styles/_tabs.scss +54 -0
  138. package/src/styles/_tester.scss +111 -0
  139. package/src/styles/_tokens.scss +160 -0
  140. package/src/styles/_uptime.scss +61 -0
  141. package/src/styles.css +4894 -0
  142. package/src/styles.scss +61 -0
package/dist/flow.mjs ADDED
@@ -0,0 +1,1978 @@
1
+ "use client";
2
+ import { jsx as t, jsxs as w, Fragment as B } from "react/jsx-runtime";
3
+ import { addEdge as sn, ReactFlowProvider as on, useNodesState as rn, useEdgesState as an, useReactFlow as ln, ReactFlow as cn, ConnectionLineType as dn, Background as un, Controls as pn, ControlButton as fn, MiniMap as hn, Panel as vt, Position as we, NodeToolbar as wn, Handle as mn } from "@xyflow/react";
4
+ import { useMemo as M, useState as S, useRef as me, useEffect as _, useCallback as J, useContext as ge, createContext as Je } from "react";
5
+ import { createPortal as gn } from "react-dom";
6
+ import { u as Vt, b as bn, f as vn, i as Nn, J as qe, d as yn, r as Ft, a as Cn, c as Sn, v as kn, n as le, e as Ge, g as Xe, s as Wt, h as Pe, j as Me, w as En, k as xn, l as Rn, m as Nt, o as We, p as yt, q as Tn, t as Ct, x as An, y as $t, z as Ce, A as Pn, B as In, C as Ae, D as St, E as Dn, F as Ln, G as Vn, W as Fn, H as Wn, I as $n, S as On, K as Jn, M as Ot, L as Mn, N as Jt, O as Mt, P as _t, Q as Ye, R as kt, T as Et, U as Ht, V as Bt, X as jt, Y as Ut, Z as xt, _ as Ke, $ as _n, a0 as Hn, a1 as Bn, a2 as jn, a3 as Un, a4 as zn, a5 as Rt, a6 as qn, a7 as Kn, a8 as Gn, a9 as Xn, aa as Yn, ab as Qn, ac as Zn } from "./ConfirmModal-CD-P8mhN.js";
7
+ import { ad as Hs, ae as Bs, af as js, ag as Us, ah as zs, ai as qs, aj as Ks, ak as Gs, al as Xs } from "./ConfirmModal-CD-P8mhN.js";
8
+ import { I as ye, C as es } from "./Copyable-1niV9gUa.js";
9
+ const Tt = 220;
10
+ function ts(e) {
11
+ return e.length <= Tt ? { text: e, clipped: !1, length: e.length } : {
12
+ text: e.slice(0, Tt).trimEnd(),
13
+ clipped: !0,
14
+ length: e.length
15
+ };
16
+ }
17
+ function ns({
18
+ params: e,
19
+ values: n,
20
+ testStartState: o,
21
+ view: r = "props"
22
+ }) {
23
+ const { sampleValues: c } = Vt(), l = M(
24
+ () => bn(c, o),
25
+ [c, o]
26
+ ), u = vn(e), y = (f) => {
27
+ var a;
28
+ return n[f] !== void 0 ? n[f] : (a = u.find((g) => g.key === f)) == null ? void 0 : a.default;
29
+ }, C = u.filter((f) => f.type !== "section" && Nn(f, y));
30
+ if (r === "code") {
31
+ const f = ss(C, n, l);
32
+ return /* @__PURE__ */ t("div", { className: "w6w-resolved-params", children: /* @__PURE__ */ t(
33
+ qe,
34
+ {
35
+ value: JSON.stringify(f, null, 2),
36
+ onChange: () => {
37
+ },
38
+ readOnly: !0,
39
+ minHeight: "260px",
40
+ height: "100%",
41
+ "aria-label": "Resolved test values (JSON)"
42
+ }
43
+ ) });
44
+ }
45
+ const N = C.filter((f) => !yn(y(f.key), f.default));
46
+ return C.length === 0 ? /* @__PURE__ */ t("div", { className: "w6w-resolved-params", children: /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: "This action takes no parameters." }) }) : N.length === 0 ? /* @__PURE__ */ t("div", { className: "w6w-resolved-params", children: /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: "Every configured value matches its default — nothing to show here. Switch to JSON to see the full set." }) }) : (
47
+ // `.w6w-resolved-table` is the ONE grid this whole row list shares — each
48
+ // `.w6w-resolved-row` below is `display: contents` and contributes its
49
+ // two children straight into these column tracks, so every row's key
50
+ // column lines up with every other row's.
51
+ /* @__PURE__ */ t("div", { className: "w6w-resolved-params w6w-resolved-table", children: N.map(
52
+ (f) => f.type === "vars" ? /* @__PURE__ */ t(rs, { param: f, value: n[f.key], scope: l }, f.key) : /* @__PURE__ */ t(
53
+ os,
54
+ {
55
+ label: f.label ?? f.key,
56
+ segments: Ft(
57
+ n[f.key] !== void 0 ? n[f.key] : f.default,
58
+ l
59
+ )
60
+ },
61
+ f.key
62
+ )
63
+ ) })
64
+ );
65
+ }
66
+ function ss(e, n, o) {
67
+ const r = {};
68
+ for (const c of e)
69
+ if (c.type === "vars") {
70
+ const l = Array.isArray(n[c.key]) ? n[c.key] : Array.isArray(c.default) ? c.default : [];
71
+ r[c.key] = Cn(l, o);
72
+ } else
73
+ r[c.key] = Sn(
74
+ n[c.key] !== void 0 ? n[c.key] : c.default,
75
+ o
76
+ );
77
+ return r;
78
+ }
79
+ function os({ label: e, segments: n }) {
80
+ return /* @__PURE__ */ w("div", { className: "w6w-resolved-row", children: [
81
+ /* @__PURE__ */ t("span", { className: "w6w-resolved-label", children: e }),
82
+ /* @__PURE__ */ t("div", { className: "w6w-resolved-value", children: /* @__PURE__ */ t(zt, { segments: n }) })
83
+ ] });
84
+ }
85
+ function rs({
86
+ param: e,
87
+ value: n,
88
+ scope: o
89
+ }) {
90
+ const r = Array.isArray(n) ? n : Array.isArray(e.default) ? e.default : [];
91
+ return /* @__PURE__ */ w("div", { className: "w6w-resolved-row", children: [
92
+ /* @__PURE__ */ t("span", { className: "w6w-resolved-label", children: e.label ?? e.key }),
93
+ r.length === 0 ? /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: "None configured." }) : /* @__PURE__ */ t("div", { className: "w6w-stack", children: r.map((c, l) => (
94
+ // biome-ignore lint/suspicious/noArrayIndexKey: rows have no stable id (mirrors ParamsForm's VarsField)
95
+ /* @__PURE__ */ w("div", { className: "w6w-resolved-value", children: [
96
+ /* @__PURE__ */ t("code", { children: c.key || "(no key)" }),
97
+ " → ",
98
+ /* @__PURE__ */ t(zt, { segments: Ft(c.value, o) })
99
+ ] }, l)
100
+ )) })
101
+ ] });
102
+ }
103
+ function zt({ segments: e }) {
104
+ return /* @__PURE__ */ t(B, { children: e.map((n, o) => (
105
+ // biome-ignore lint/suspicious/noArrayIndexKey: segments are a positional, immutable render of one value's parts
106
+ /* @__PURE__ */ t(as, { segment: n }, o)
107
+ )) });
108
+ }
109
+ function as({ segment: e }) {
110
+ switch (e.status) {
111
+ case "resolved":
112
+ return e.ref ? /* @__PURE__ */ w(B, { children: [
113
+ /* @__PURE__ */ t($e, { kind: "var", refName: e.ref }),
114
+ /* @__PURE__ */ t(At, { value: e.value })
115
+ ] }) : /* @__PURE__ */ t(At, { value: e.value });
116
+ case "unresolved":
117
+ return /* @__PURE__ */ w(B, { children: [
118
+ /* @__PURE__ */ t($e, { kind: "var", refName: e.ref }),
119
+ /* @__PURE__ */ t("span", { className: "w6w-param-unresolved", children: "unresolved" })
120
+ ] });
121
+ case "not-evaluated":
122
+ return /* @__PURE__ */ w(B, { children: [
123
+ /* @__PURE__ */ t($e, { kind: "expr" }),
124
+ /* @__PURE__ */ t("span", { className: "w6w-param-unevaluated", children: "not evaluated" })
125
+ ] });
126
+ case "masked":
127
+ return /* @__PURE__ */ t($e, { kind: "secret", refName: e.ref });
128
+ }
129
+ }
130
+ function At({ value: e }) {
131
+ const [n, o] = S(!1), r = ls(e), c = ts(r);
132
+ return c.clipped ? /* @__PURE__ */ w(B, { children: [
133
+ /* @__PURE__ */ t("span", { className: n ? "w6w-resolved-text-full" : void 0, children: n ? r : `${c.text}…` }),
134
+ /* @__PURE__ */ t(
135
+ "button",
136
+ {
137
+ type: "button",
138
+ className: "w6w-resolved-more",
139
+ "aria-expanded": n,
140
+ onClick: () => o((l) => !l),
141
+ children: n ? "Show less" : `Show all (${c.length.toLocaleString()} characters)`
142
+ }
143
+ )
144
+ ] }) : /* @__PURE__ */ t("span", { children: r });
145
+ }
146
+ const is = { var: "◆", secret: "🔒", expr: "ƒ" };
147
+ function $e({ kind: e, refName: n }) {
148
+ const o = e === "expr" ? "expr" : kn(n ?? "");
149
+ return /* @__PURE__ */ w("span", { className: `w6w-expr-chip w6w-expr-chip-${e}`, children: [
150
+ /* @__PURE__ */ t("span", { className: "w6w-expr-chip-sigil", children: is[e] }),
151
+ /* @__PURE__ */ t("span", { className: "w6w-expr-chip-label", children: o })
152
+ ] });
153
+ }
154
+ function ls(e) {
155
+ if (e === null) return "null";
156
+ if (e === void 0) return "(not set)";
157
+ if (e === "") return '""';
158
+ if (typeof e == "string" || typeof e == "number" || typeof e == "boolean")
159
+ return String(e);
160
+ try {
161
+ return JSON.stringify(e);
162
+ } catch {
163
+ return String(e);
164
+ }
165
+ }
166
+ function ee(e) {
167
+ var n;
168
+ return ((n = e.data) == null ? void 0 : n.when) === "error" ? "error" : "success";
169
+ }
170
+ function qt(e, n) {
171
+ var o;
172
+ return ((o = e.find((r) => r.id === n)) == null ? void 0 : o.id) ?? null;
173
+ }
174
+ function Kt(e, n, o, r, c) {
175
+ var N, f;
176
+ if (!e || !n || e === n || r.some((a) => a.source === e && a.target === n)) return !1;
177
+ const l = (N = o.find((a) => a.id === e)) == null ? void 0 : N.data.step, u = (f = o.find((a) => a.id === n)) == null ? void 0 : f.data.step;
178
+ if (!l || !u) return !1;
179
+ const y = le(l, c), C = le(u, c);
180
+ return y.out >= 1 && C.in >= 1;
181
+ }
182
+ function Qe(e, n, o, r, c, l) {
183
+ var P, R;
184
+ if (!Kt(e, n, o, r, l) || !e || !n) return null;
185
+ const u = (P = o.find((V) => V.id === e)) == null ? void 0 : P.data.step, y = (R = o.find((V) => V.id === n)) == null ? void 0 : R.data.step;
186
+ if (!u || !y) return null;
187
+ const C = le(u, l), N = le(y, l);
188
+ let f = r;
189
+ if (f.filter((V) => V.source === e && ee(V) === c).length >= C.out)
190
+ return { next: r, conflict: null, refusal: { refused: "out_cap", cap: C.out } };
191
+ const g = f.filter((V) => V.target === n);
192
+ if (g.length >= N.in) {
193
+ const V = new Set(g.slice(0, g.length - N.in + 1).map((d) => d.id));
194
+ f = f.filter((d) => !V.has(d.id));
195
+ }
196
+ const E = Ge(e, n, c);
197
+ return {
198
+ next: sn(
199
+ {
200
+ source: e,
201
+ target: n,
202
+ id: E,
203
+ sourceHandle: Wt(c),
204
+ data: { when: c },
205
+ // No run state: this mints a freshly DRAWN edge, never a run-taken
206
+ // one — the live run-aware repaint is a separate effect
207
+ // (WorkflowFlowEditor.tsx, T1.1.1), not this creation path.
208
+ ...Xe(c, void 0)
209
+ },
210
+ f
211
+ ),
212
+ conflict: qt(f, E),
213
+ refusal: null
214
+ };
215
+ }
216
+ function Oe(e, n, o, r, c = "success", l) {
217
+ const u = Qe(e, n, o, r, c, l);
218
+ return !u || u.conflict || u.refusal ? null : u.next;
219
+ }
220
+ function cs(e, n, o, r, c = "success", l) {
221
+ var u;
222
+ return ((u = Qe(e, n, o, r, c, l)) == null ? void 0 : u.conflict) ?? null;
223
+ }
224
+ function ds(e, n, o, r, c = "success", l) {
225
+ var u;
226
+ return ((u = Qe(e, n, o, r, c, l)) == null ? void 0 : u.refusal) ?? null;
227
+ }
228
+ function Ze(e, n, o, r, c) {
229
+ var P;
230
+ const l = e.filter((R) => R.id === n);
231
+ if (l.length !== 1) return null;
232
+ const u = l[0], y = (P = r.find((R) => R.id === u.source)) == null ? void 0 : P.data.step;
233
+ if (!y) return null;
234
+ const C = le(y, c).out, N = e.filter((R) => R.id !== n);
235
+ if ((ee(u) === o ? [] : N.filter((R) => R.source === u.source && ee(R) === o)).length >= C)
236
+ return { next: e, conflict: null, refusal: { refused: "out_cap", cap: C } };
237
+ const a = Xe(o, void 0), g = {
238
+ ...u,
239
+ id: Ge(u.source, u.target, o),
240
+ data: { ...u.data, when: o },
241
+ className: a.className,
242
+ label: a.label,
243
+ sourceHandle: Wt(o)
244
+ }, E = qt(N, g.id);
245
+ return {
246
+ // `edgeId` is single-owner (guarded above), so this replaces exactly one edge.
247
+ next: e.map((R) => R.id === n ? g : R),
248
+ conflict: E,
249
+ refusal: null
250
+ };
251
+ }
252
+ function us(e, n, o, r, c) {
253
+ const l = Ze(e, n, o, r, c);
254
+ return !l || l.conflict || l.refusal ? null : l.next;
255
+ }
256
+ function ps(e, n, o, r, c) {
257
+ var l;
258
+ return ((l = Ze(e, n, o, r, c)) == null ? void 0 : l.conflict) ?? null;
259
+ }
260
+ function fs(e, n, o, r, c) {
261
+ var l;
262
+ return ((l = Ze(e, n, o, r, c)) == null ? void 0 : l.refusal) ?? null;
263
+ }
264
+ function hs(e, n, o) {
265
+ return e.map((r) => {
266
+ const c = r.source === n ? o : r.source, l = r.target === n ? o : r.target;
267
+ return { ...r, source: c, target: l, id: Ge(c, l, ee(r)) };
268
+ });
269
+ }
270
+ function ws(e, n) {
271
+ const o = { success: 0, error: 0 };
272
+ for (const c of n) c.source === e && o[ee(c)]++;
273
+ const r = Math.max(o.success, o.error);
274
+ return { enabled: r >= 2, count: r };
275
+ }
276
+ function ms(e, n) {
277
+ const { fanOut: o, ...r } = e;
278
+ return n === "parallel" ? { ...r, fanOut: "parallel" } : r;
279
+ }
280
+ function gs(e, n) {
281
+ return `Runs these ${e} steps in ${n === "parallel" ? "parallel" : "sequence"}`;
282
+ }
283
+ const bs = /* @__PURE__ */ new Set(["succeeded", "failed", "canceled"]);
284
+ function vs(e, n) {
285
+ var o;
286
+ return e ? ((o = e.steps[n]) == null ? void 0 : o.status) ?? "pending" : "no-run";
287
+ }
288
+ const Pt = {
289
+ borderColor: "var(--w6w-border)",
290
+ borderStyle: "solid",
291
+ borderWidth: 1,
292
+ opacity: 1
293
+ };
294
+ function Gt(e, n) {
295
+ const o = n !== void 0 && bs.has(n);
296
+ switch (e) {
297
+ case "no-run":
298
+ return Pt;
299
+ case "pending":
300
+ return o ? { borderColor: "var(--w6w-muted)", borderStyle: "dashed", borderWidth: 1, opacity: 0.5 } : { borderColor: "var(--w6w-border)", borderStyle: "dashed", borderWidth: 1, opacity: 1 };
301
+ case "running":
302
+ return { borderColor: "var(--w6w-accent)", borderStyle: "solid", borderWidth: 2, opacity: 1 };
303
+ case "succeeded":
304
+ return {
305
+ borderColor: "var(--w6w-success)",
306
+ borderStyle: "solid",
307
+ borderWidth: 2,
308
+ opacity: 1
309
+ };
310
+ case "failed":
311
+ return { borderColor: "var(--w6w-danger)", borderStyle: "solid", borderWidth: 2, opacity: 1 };
312
+ case "skipped":
313
+ return {
314
+ borderColor: "var(--w6w-muted)",
315
+ borderStyle: "dashed",
316
+ borderWidth: 1,
317
+ opacity: 0.7
318
+ };
319
+ default:
320
+ return Pt;
321
+ }
322
+ }
323
+ function Ns(e, n, o) {
324
+ if (!e) return;
325
+ const r = e.steps[n];
326
+ if (!r) return;
327
+ const c = o ?? "success";
328
+ if (r.status === "succeeded") return c === "success" ? "taken" : "skipped";
329
+ if (r.status === "failed") return c === "error" ? "taken" : "skipped";
330
+ if (r.status === "skipped") return "skipped";
331
+ }
332
+ function ys(e, n) {
333
+ const [o, r] = S({}), c = me(/* @__PURE__ */ new Set()), l = JSON.stringify(
334
+ [...new Set(n.map((u) => u.data.step.uses.app))].filter((u) => u && !Pe(u)).sort()
335
+ );
336
+ return _(() => {
337
+ const u = JSON.parse(l).filter(
338
+ (y) => !c.current.has(y)
339
+ );
340
+ if (u.length !== 0) {
341
+ for (const y of u) c.current.add(y);
342
+ Promise.all(
343
+ u.map(async (y) => {
344
+ try {
345
+ return [y, await e.getAppActions(y)];
346
+ } catch {
347
+ return c.current.delete(y), null;
348
+ }
349
+ })
350
+ ).then((y) => {
351
+ const C = y.filter((N) => N !== null);
352
+ C.length !== 0 && r((N) => ({ ...N, ...Object.fromEntries(C) }));
353
+ });
354
+ }
355
+ }, [e, l]), o;
356
+ }
357
+ function Cs(e) {
358
+ return (n, o) => {
359
+ var r, c;
360
+ return (c = (r = e[n]) == null ? void 0 : r.find((l) => l.key === o)) == null ? void 0 : c.ports;
361
+ };
362
+ }
363
+ const Ss = "Which outcome of the source step this edge carries. An error edge is drawn by dragging from the step's error exit port; use this control to re-lane an edge already drawn. An error edge overrides the step’s “On error” policy.";
364
+ function It(e, n, o, r) {
365
+ const c = e.find((l) => l.id === n);
366
+ return [o, r, c == null ? void 0 : c.source, c == null ? void 0 : c.target];
367
+ }
368
+ const et = Je(void 0), tt = Je(/* @__PURE__ */ new Map());
369
+ function Dt(e) {
370
+ return `Can’t draw that edge: this node allows at most ${e} outgoing edge${e === 1 ? "" : "s"} per lane.`;
371
+ }
372
+ const nt = Je(/* @__PURE__ */ new Map()), Xt = Je(null);
373
+ function Js(e) {
374
+ return /* @__PURE__ */ t(on, { children: /* @__PURE__ */ t(ks, { ...e }) });
375
+ }
376
+ function ks({
377
+ value: e,
378
+ onChange: n,
379
+ readOnly: o,
380
+ height: r = 480,
381
+ apps: c,
382
+ exprOptions: l,
383
+ project: u,
384
+ runState: y,
385
+ onTestRun: C,
386
+ fitViewKey: N
387
+ }) {
388
+ var mt, gt, bt;
389
+ const f = Me(), a = M(() => new Map((c ?? []).map((s) => [s.id, s])), [c]), [g, E] = S(null), P = M(() => En(e), [e.id]), R = M(() => xn(e), [e.id]), V = ((mt = e.settings) == null ? void 0 : mt.savePosition) !== !1, [d, I, ce] = rn(P.nodes), ne = ys(f, d), W = M(() => Cs(ne), [ne]), [b, A, de] = an(P.edges);
390
+ _(() => {
391
+ I(
392
+ (s) => s.map((i) => {
393
+ const p = vs(y, i.id);
394
+ return i.data.stepStatus === p && i.data.runStatus === (y == null ? void 0 : y.status) ? i : { ...i, data: { ...i.data, stepStatus: p, runStatus: y == null ? void 0 : y.status } };
395
+ })
396
+ ), A(
397
+ (s) => s.map((i) => {
398
+ const p = ee(i), m = Ns(y, i.source, p), v = Xe(p, m);
399
+ return i.className === v.className && i.label === v.label ? i : { ...i, className: v.className, label: v.label };
400
+ })
401
+ );
402
+ }, [y, I, A]);
403
+ const [K, G] = S(null), [x, z] = S(null), [$, te] = S(!1), [O, se] = S(null), [be, oe] = S("props"), [re, ke] = S(null), ue = me(!1), Ie = me(null), [H, X] = S(null), { screenToFlowPosition: De, fitView: j } = ln(), _e = Rn();
404
+ _(() => {
405
+ I(P.nodes), A(P.edges), G(null), se(null);
406
+ }, [P, I, A]);
407
+ const D = J(
408
+ (s, i) => {
409
+ n(Nt(e, s, i));
410
+ },
411
+ [e, n]
412
+ ), ie = J(
413
+ (s) => Kt(s.source, s.target, d, b, W),
414
+ [d, b, W]
415
+ ), ae = J(
416
+ (s) => {
417
+ if (o) return;
418
+ const i = Oe(
419
+ s.source,
420
+ s.target,
421
+ d,
422
+ b,
423
+ We(s.sourceHandle),
424
+ W
425
+ );
426
+ if (!i) {
427
+ const p = We(s.sourceHandle), m = ds(
428
+ s.source,
429
+ s.target,
430
+ d,
431
+ b,
432
+ p,
433
+ W
434
+ );
435
+ if (m) {
436
+ const k = b.find((T) => T.source === s.source && ee(T) === p);
437
+ k && (A(b.map((T) => ({ ...T, selected: T.id === k.id }))), z(k.id), F({ edgeId: k.id, message: Dt(m.cap) }));
438
+ return;
439
+ }
440
+ const v = cs(
441
+ s.source,
442
+ s.target,
443
+ d,
444
+ b,
445
+ We(s.sourceHandle)
446
+ );
447
+ if (!v) return;
448
+ A(b.map((k) => ({ ...k, selected: k.id === v }))), z(v), F({
449
+ edgeId: v,
450
+ message: yt(
451
+ "Can’t draw that edge",
452
+ v,
453
+ It(b, v, s.source, s.target)
454
+ )
455
+ });
456
+ return;
457
+ }
458
+ F(null), A(i), D(d, i);
459
+ },
460
+ [b, d, A, D, o, W]
461
+ ), He = J(
462
+ (s, i) => {
463
+ var U, L, Q;
464
+ if (o || i.isValid) return;
465
+ const p = i.fromNode;
466
+ if (!p) return;
467
+ const m = ((U = i.fromHandle) == null ? void 0 : U.type) === "target" ? "target" : "source", v = (L = d.find((Z) => Z.id === p.id)) == null ? void 0 : L.data.step;
468
+ if (v) {
469
+ const Z = le(v, W);
470
+ if ((m === "source" ? Z.out : Z.in) < 1) return;
471
+ }
472
+ const k = "changedTouches" in s ? s.changedTouches[0] : s, T = De({ x: k.clientX, y: k.clientY });
473
+ X({
474
+ nodeId: p.id,
475
+ handleType: m,
476
+ position: T,
477
+ lane: We((Q = i.fromHandle) == null ? void 0 : Q.id)
478
+ }), te(!0);
479
+ },
480
+ [o, De, d, W]
481
+ ), ve = J(
482
+ (s) => {
483
+ o || ke(s);
484
+ },
485
+ [o]
486
+ ), Le = J(
487
+ (s) => {
488
+ if (o) return;
489
+ const i = d.filter((m) => m.id !== s), p = b.filter((m) => m.source !== s && m.target !== s);
490
+ I(i), A(p), K === s && G(null), O === s && se(null), D(i, p);
491
+ },
492
+ [d, b, I, A, D, o, K, O]
493
+ ), Ee = J(() => {
494
+ if (o) return;
495
+ const s = Tn(d, b);
496
+ I(s), ue.current = !0, D(s, b);
497
+ }, [d, b, I, D, o]), xe = J(() => {
498
+ o || Ee();
499
+ }, [o, Ee]);
500
+ _(() => {
501
+ ue.current && (ue.current = !1, j({ duration: 300 }));
502
+ }, [d, j]);
503
+ const Re = me(N);
504
+ _(() => {
505
+ Object.is(Re.current, N) || (Re.current = N, j({ duration: 300 }));
506
+ }, [N, j]);
507
+ const [pe, F] = S(null), fe = M(
508
+ () => b.find((s) => s.id === x) ?? null,
509
+ [b, x]
510
+ ), Be = J(
511
+ (s) => {
512
+ if (o || !x) return;
513
+ const i = b.find((T) => T.id === x);
514
+ if (!i || ee(i) === s) return;
515
+ const p = ps(b, x, s, d), m = fs(b, x, s, d, W), v = p || m ? null : us(b, x, s, d, W);
516
+ if (!v) {
517
+ if (m) {
518
+ F({ edgeId: x, message: Dt(m.cap) });
519
+ return;
520
+ }
521
+ F({
522
+ edgeId: x,
523
+ message: p ? yt(
524
+ "Can’t switch this edge",
525
+ p,
526
+ It(b, p, i.source, i.target)
527
+ ) : "This edge can’t be switched right now."
528
+ });
529
+ return;
530
+ }
531
+ F(null), A(v);
532
+ const k = v.find(
533
+ (T) => T.source === i.source && T.target === i.target && ee(T) === s
534
+ );
535
+ z((k == null ? void 0 : k.id) ?? null), D(d, v);
536
+ },
537
+ [b, d, A, D, o, x, W]
538
+ ), Ve = J(
539
+ (s) => {
540
+ if (o) return;
541
+ const i = b.filter((p) => p.id !== s);
542
+ i.length !== b.length && (A(i), x === s && z(null), D(d, i));
543
+ },
544
+ [d, b, A, D, o, x]
545
+ ), h = J(
546
+ (s) => {
547
+ if (o) return;
548
+ const i = d.find((T) => T.id === s);
549
+ if (!i) return;
550
+ const p = Ct(
551
+ d.map((T) => T.id),
552
+ `${i.data.step.id}_copy`
553
+ ), m = { ...structuredClone(i.data.step), id: p }, v = {
554
+ id: p,
555
+ type: i.type,
556
+ position: { x: i.position.x + 40, y: i.position.y + 60 },
557
+ data: { step: m, isInternal: i.data.isInternal }
558
+ }, k = [...d, v];
559
+ I(k), G(p), D(k, b);
560
+ },
561
+ [d, b, I, D, o]
562
+ ), q = J(
563
+ (s) => {
564
+ if (o) return;
565
+ const i = Pe(s.uses.app), p = Ct(
566
+ d.map((U) => U.id),
567
+ An($t(s.uses.app, s.uses.action))
568
+ ), m = {
569
+ id: p,
570
+ uses: s.uses,
571
+ ...s.with && Object.keys(s.with).length > 0 ? { with: s.with } : {}
572
+ }, v = {
573
+ id: p,
574
+ type: i ? "control" : "step",
575
+ // Drop point when spawned from a dragged connection; else a light cascade.
576
+ position: (H == null ? void 0 : H.position) ?? { x: 80, y: 80 + d.length * 24 },
577
+ data: { step: m, isInternal: i }
578
+ }, k = [...d, v];
579
+ let T = b;
580
+ if (H) {
581
+ const [U, L] = H.handleType === "target" ? [p, H.nodeId] : [H.nodeId, p];
582
+ T = Oe(U, L, k, b, H.lane, W) ?? b;
583
+ } else {
584
+ const U = d.find((L) => Ce(L.data.step.uses.app));
585
+ if (Ce(s.uses.app)) {
586
+ if (!U) {
587
+ const L = Pn(d, b);
588
+ L && (T = Oe(p, L.id, k, b, "success", W) ?? b);
589
+ }
590
+ } else {
591
+ const Q = (U && !b.some((Z) => Z.source === U.id) ? U : void 0) ?? In(d, b);
592
+ Q && (T = Oe(Q.id, p, k, b, "success", W) ?? b);
593
+ }
594
+ }
595
+ return I(k), T !== b && A(T), G(p), D(k, T), p;
596
+ },
597
+ [d, b, I, A, D, o, H, W]
598
+ ), Y = J(
599
+ (s, i) => {
600
+ const p = i.id !== s;
601
+ if (p && d.some((v) => v.id === i.id)) return;
602
+ const m = d.map(
603
+ (v) => v.id === s ? {
604
+ ...v,
605
+ id: i.id,
606
+ data: { step: i, isInternal: Pe(i.uses.app) }
607
+ } : v
608
+ );
609
+ if (p) {
610
+ const v = hs(b, s, i.id);
611
+ I(m), A(v), K === s && G(i.id), O === s && se(i.id), D(m, v);
612
+ return;
613
+ }
614
+ I(m), D(m, b);
615
+ },
616
+ [d, b, I, A, K, O, D]
617
+ ), he = J(
618
+ (s, i, p) => {
619
+ (async () => {
620
+ const m = await f.saveStepTest(e.id, s, i).catch((v) => (console.error("step run fixture save failed", v), null));
621
+ await f.recordStepTestRun(e.id, s, {
622
+ stepTestId: (m == null ? void 0 : m.id) ?? null,
623
+ status: p.status,
624
+ input: i.input,
625
+ output: p.output,
626
+ error: p.error,
627
+ ...p.meta ? { meta: p.meta } : {}
628
+ });
629
+ })().catch((m) => {
630
+ console.error("step run persist failed", m);
631
+ });
632
+ },
633
+ [f, e.id]
634
+ ), Te = J(
635
+ (s) => {
636
+ const i = d.find((p) => p.id === s);
637
+ !i || Ae(i.data.step.uses.app) || E({ stepId: s, status: "collect" });
638
+ },
639
+ [d]
640
+ ), en = J(
641
+ async (s, i, p) => {
642
+ C == null || C();
643
+ const m = d.find((L) => L.id === s);
644
+ if (!m) return;
645
+ const v = m.data.step, k = Ce(v.uses.app), T = k ? { input: i } : { ...v.with ?? {}, ...i }, U = k ? { input: i, with: i } : { input: i, with: T };
646
+ E({ stepId: s, status: "running" });
647
+ try {
648
+ const L = await f.invokeAction(v.uses.app, v.uses.action, T, {
649
+ ...v.uses.connection ? { connectionId: v.uses.connection } : {},
650
+ // Scope document expressions to the workflow's selected project (T2.1.2).
651
+ project: u,
652
+ // Omitted when nothing upstream has a saved output, so a run with no
653
+ // seed sends exactly the request it sent before.
654
+ ...p ? { state: p } : {}
655
+ }), Q = L.logs, Z = L.meta;
656
+ E({
657
+ stepId: s,
658
+ status: "done",
659
+ value: L.value,
660
+ logs: Q,
661
+ ...Z ? { meta: Z } : {}
662
+ }), he(s, U, {
663
+ status: "succeeded",
664
+ output: L.value,
665
+ ...Z ? { meta: Z } : {}
666
+ });
667
+ } catch (L) {
668
+ const Q = L;
669
+ E({
670
+ stepId: s,
671
+ status: "error",
672
+ error: Q.message ?? String(L),
673
+ errorCode: Q.code
674
+ }), he(s, U, { status: "failed", error: Q.message ?? String(L) });
675
+ }
676
+ },
677
+ [d, f, he, u, C]
678
+ ), je = M(
679
+ () => ({
680
+ onEdit: (s) => {
681
+ oe("props"), se(s);
682
+ },
683
+ onEditJson: (s) => {
684
+ oe("json"), se(s);
685
+ },
686
+ onRun: Te,
687
+ onDuplicate: h,
688
+ onDelete: ve,
689
+ readOnly: o
690
+ }),
691
+ [Te, h, ve, o]
692
+ );
693
+ _(() => {
694
+ const s = Ie.current;
695
+ if (!s) return;
696
+ const i = (p) => {
697
+ const m = p.target.closest(".react-flow__node");
698
+ if (!m) return;
699
+ const v = m.getAttribute("data-id");
700
+ v && (p.stopPropagation(), je.onEdit(v));
701
+ };
702
+ return s.addEventListener("dblclick", i, !0), () => s.removeEventListener("dblclick", i, !0);
703
+ }, [je]);
704
+ const ot = ((gt = d.find((s) => s.id === O)) == null ? void 0 : gt.data.step) ?? null, Ue = g ? ((bt = d.find((s) => s.id === g.stepId)) == null ? void 0 : bt.data.step) ?? null : null, ze = (g == null ? void 0 : g.status) === "collect" && !!Ue, tn = M(
705
+ () => g ? St(g.stepId, d, b).steps : [],
706
+ [g, d, b]
707
+ ), rt = M(() => {
708
+ const s = /* @__PURE__ */ new Map();
709
+ for (const i of d) s.set(i.id, ws(i.id, b).count);
710
+ return s;
711
+ }, [d, b]), nn = M(
712
+ () => ({
713
+ step: xs,
714
+ control: Rs
715
+ }),
716
+ []
717
+ ), [Fe, at] = S({}), [it, lt] = S({}), ct = M(
718
+ () => ({
719
+ actionDef: (s, i) => {
720
+ var p;
721
+ return (p = ne[s]) == null ? void 0 : p.find((m) => m.key === i);
722
+ },
723
+ testOutputs: Fe
724
+ }),
725
+ [ne, Fe]
726
+ ), [dt, ut] = S(null), Ne = M(() => {
727
+ const s = St(O, d, b, ct);
728
+ return { ...s, steps: Dn(s.steps, O ?? dt) };
729
+ }, [O, dt, d, b, ct]), pt = JSON.stringify(Ne.steps.map((s) => s.id));
730
+ _(() => {
731
+ const s = JSON.parse(pt);
732
+ if (!O || s.length === 0) {
733
+ at({}), lt({});
734
+ return;
735
+ }
736
+ let i = !1;
737
+ return Promise.all(
738
+ s.map(async (p) => {
739
+ try {
740
+ const m = await f.listStepTests(e.id, p), v = m.length ? m[m.length - 1] : null;
741
+ return v ? { id: p, output: v.lastRunOutput, meta: v.lastRunMeta } : null;
742
+ } catch {
743
+ return null;
744
+ }
745
+ })
746
+ ).then((p) => {
747
+ if (i) return;
748
+ const m = {}, v = {};
749
+ for (const k of p)
750
+ k != null && k.meta && (v[k.id] = k.meta), !(!k || k.output === void 0 || k.output === null) && (m[k.id] = k.output);
751
+ at(m), lt(v);
752
+ }), () => {
753
+ i = !0;
754
+ };
755
+ }, [f, e.id, O, pt]);
756
+ const ft = M(() => {
757
+ const s = {};
758
+ for (const i of Ne.steps) {
759
+ Object.assign(s, Ln(i.id, it[i.id]));
760
+ const p = Fe[i.id];
761
+ if (p !== void 0) {
762
+ if (s[`steps.${i.id}.output`] = p, typeof p == "object" && p !== null && !Array.isArray(p))
763
+ for (const [m, v] of Object.entries(p))
764
+ s[`steps.${i.id}.output.${m}`] = v;
765
+ for (const m of i.outputs ?? []) {
766
+ if (!m.path || !m.key.includes(".")) continue;
767
+ const v = Vn(p, m.key);
768
+ v !== void 0 && (s[`steps.${i.id}.output.${m.key}`] = v);
769
+ }
770
+ }
771
+ }
772
+ return s;
773
+ }, [Ne.steps, Fe, it]), ht = Vt(), wt = M(
774
+ () => ({
775
+ ...l ?? {},
776
+ steps: Ne.steps,
777
+ hasTrigger: Ne.hasTrigger,
778
+ sampleValues: {
779
+ ...ht.sampleValues ?? {},
780
+ ...(l == null ? void 0 : l.sampleValues) ?? {},
781
+ ...ft
782
+ }
783
+ }),
784
+ [l, ht.sampleValues, Ne, ft]
785
+ );
786
+ return /* @__PURE__ */ t(Xt.Provider, { value: je, children: /* @__PURE__ */ t(et.Provider, { value: W, children: /* @__PURE__ */ t(tt.Provider, { value: rt, children: /* @__PURE__ */ t(nt.Provider, { value: a, children: /* @__PURE__ */ t(Fn, { project: u, children: /* @__PURE__ */ t(Wn, { value: wt, children: /* @__PURE__ */ w(
787
+ "div",
788
+ {
789
+ ref: Ie,
790
+ className: "w6w-flow",
791
+ style: { width: "100%", height: r, position: "relative" },
792
+ onKeyDown: (s) => {
793
+ if (s.key !== "Backspace" && s.key !== "Delete" || O || $ || !K && !x) return;
794
+ const i = s.target;
795
+ i.isContentEditable || i.tagName === "INPUT" || i.tagName === "TEXTAREA" || i.tagName === "SELECT" || i.closest("dialog, .w6w-modal") !== null || (s.preventDefault(), K ? ve(K) : x && Ve(x));
796
+ },
797
+ children: [
798
+ /* @__PURE__ */ w(
799
+ cn,
800
+ {
801
+ nodes: d,
802
+ edges: b,
803
+ defaultEdgeOptions: { type: "smoothstep" },
804
+ connectionLineType: dn.SmoothStep,
805
+ onNodesChange: ce,
806
+ onEdgesChange: de,
807
+ onConnect: ae,
808
+ onConnectEnd: He,
809
+ isValidConnection: ie,
810
+ onNodeDragStop: () => {
811
+ V && D(d, b);
812
+ },
813
+ onMoveEnd: (s, i) => {
814
+ if (!s || o) return;
815
+ const p = Nt(e, d, b), m = $n(p, i);
816
+ m !== p && n(m);
817
+ },
818
+ onSelectionChange: ({ nodes: s, edges: i }) => {
819
+ var p, m;
820
+ G(((p = s[0]) == null ? void 0 : p.id) ?? null), z(((m = i[0]) == null ? void 0 : m.id) ?? null);
821
+ },
822
+ nodeTypes: nn,
823
+ nodesDraggable: !o,
824
+ nodesConnectable: !o,
825
+ elementsSelectable: !0,
826
+ ...R ? { defaultViewport: R } : { fitView: !0 },
827
+ deleteKeyCode: null,
828
+ colorMode: _e,
829
+ proOptions: { hideAttribution: !0 },
830
+ children: [
831
+ /* @__PURE__ */ t(un, { gap: 16 }),
832
+ /* @__PURE__ */ t(pn, { showInteractive: !1, children: !o && /* @__PURE__ */ t(
833
+ fn,
834
+ {
835
+ onClick: xe,
836
+ title: "Auto-layout — re-flow the graph into columns",
837
+ "aria-label": "Auto-layout the graph",
838
+ children: /* @__PURE__ */ t(ye, { name: "layout" })
839
+ }
840
+ ) }),
841
+ /* @__PURE__ */ t(hn, { pannable: !0, zoomable: !0, style: { background: "var(--w6w-panel-2)" } }),
842
+ !o && /* @__PURE__ */ t(vt, { position: "top-left", children: /* @__PURE__ */ t(
843
+ "button",
844
+ {
845
+ type: "button",
846
+ className: "w6w-btn",
847
+ onClick: () => te(!0),
848
+ children: "+ Step"
849
+ }
850
+ ) }),
851
+ !o && fe && /* @__PURE__ */ t(vt, { position: "top-right", children: /* @__PURE__ */ w("div", { className: "w6w-edge-lane", children: [
852
+ /* @__PURE__ */ t("span", { className: "w6w-muted w6w-small", children: "Run on" }),
853
+ ["success", "error"].map((s) => /* @__PURE__ */ t(
854
+ "button",
855
+ {
856
+ type: "button",
857
+ className: `w6w-btn w6w-btn-sm w6w-btn-ghost${ee(fe) === s ? " active" : ""}`,
858
+ "aria-pressed": ee(fe) === s,
859
+ title: Ss,
860
+ onClick: () => Be(s),
861
+ children: s === "success" ? "Success" : "Error"
862
+ },
863
+ s
864
+ )),
865
+ (pe == null ? void 0 : pe.edgeId) === fe.id && /* @__PURE__ */ t("span", { className: "w6w-edge-lane-err w6w-small", role: "alert", children: pe.message })
866
+ ] }) })
867
+ ]
868
+ }
869
+ ),
870
+ $ && /* @__PURE__ */ t(
871
+ On,
872
+ {
873
+ onClose: () => {
874
+ te(!1), X(null), ut(null);
875
+ },
876
+ onAdd: (s) => {
877
+ const i = q(s);
878
+ return i && ut(i), i;
879
+ },
880
+ onDraftChange: (s, i) => Y(s, { id: s, ...i }),
881
+ workflowId: e.id,
882
+ upstreamSteps: Jn(H, d, b)
883
+ }
884
+ ),
885
+ ot && O && // No `key` on purpose: renaming a step updates `editingId`, and a keyed
886
+ // remount would drop focus mid-keystroke. The modal seeds its own state
887
+ // once and unmounts (editingId → null) between edits of different nodes.
888
+ /* @__PURE__ */ t(
889
+ Ts,
890
+ {
891
+ workflowId: e.id,
892
+ step: ot,
893
+ upstreamSteps: wt.steps ?? [],
894
+ readOnly: o,
895
+ fanOutCount: rt.get(O) ?? 0,
896
+ initialView: be,
897
+ onChange: (s) => Y(O, s),
898
+ onClose: () => se(null),
899
+ onTestRun: C
900
+ }
901
+ ),
902
+ g && /* @__PURE__ */ w(
903
+ Ot,
904
+ {
905
+ title: `${ze ? "Run step" : "Test run"}: ${g.stepId}`,
906
+ onClose: () => E(null),
907
+ children: [
908
+ ze && Ue && /* @__PURE__ */ t(
909
+ Es,
910
+ {
911
+ workflowId: e.id,
912
+ step: Ue,
913
+ upstreamSteps: tn,
914
+ onCancel: () => E(null),
915
+ onRun: (s, i) => en(g.stepId, s, i)
916
+ },
917
+ g.stepId
918
+ ),
919
+ !ze && /* @__PURE__ */ w(B, { children: [
920
+ /* @__PURE__ */ w("div", { className: "w6w-modal-body", children: [
921
+ g.status === "running" && /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: "Running…" }),
922
+ g.status === "error" && /* @__PURE__ */ w("div", { className: "w6w-result w6w-error", children: [
923
+ g.errorCode && /* @__PURE__ */ t(
924
+ "div",
925
+ {
926
+ className: "w6w-small",
927
+ style: { opacity: 0.75, marginBottom: 4 },
928
+ children: /* @__PURE__ */ t("code", { children: g.errorCode })
929
+ }
930
+ ),
931
+ g.error || "The step failed with no error message."
932
+ ] }),
933
+ g.status === "done" && /* @__PURE__ */ w("div", { children: [
934
+ /* @__PURE__ */ t("div", { className: "w6w-muted w6w-small", style: { marginBottom: 6 }, children: "Result" }),
935
+ /* @__PURE__ */ t(
936
+ "pre",
937
+ {
938
+ className: "w6w-result",
939
+ style: {
940
+ whiteSpace: "pre-wrap",
941
+ maxHeight: 360,
942
+ overflow: "auto",
943
+ margin: 0
944
+ },
945
+ children: JSON.stringify(g.value, null, 2)
946
+ }
947
+ ),
948
+ g.meta && /* @__PURE__ */ w(B, { children: [
949
+ /* @__PURE__ */ t(
950
+ "div",
951
+ {
952
+ className: "w6w-muted w6w-small",
953
+ style: { margin: "10px 0 6px" },
954
+ children: "Metadata"
955
+ }
956
+ ),
957
+ /* @__PURE__ */ t(
958
+ "pre",
959
+ {
960
+ className: "w6w-result",
961
+ style: {
962
+ whiteSpace: "pre-wrap",
963
+ maxHeight: 360,
964
+ overflow: "auto",
965
+ margin: 0
966
+ },
967
+ children: JSON.stringify(g.meta, null, 2)
968
+ }
969
+ )
970
+ ] })
971
+ ] }),
972
+ g.logs && g.logs.length > 0 && /* @__PURE__ */ w("div", { children: [
973
+ /* @__PURE__ */ t(
974
+ "div",
975
+ {
976
+ className: "w6w-muted w6w-small",
977
+ style: { margin: "10px 0 6px" },
978
+ children: "Console output"
979
+ }
980
+ ),
981
+ /* @__PURE__ */ t(
982
+ "pre",
983
+ {
984
+ className: "w6w-result",
985
+ style: {
986
+ whiteSpace: "pre-wrap",
987
+ maxHeight: 200,
988
+ overflow: "auto",
989
+ margin: 0
990
+ },
991
+ children: g.logs.join(`
992
+ `)
993
+ }
994
+ )
995
+ ] })
996
+ ] }),
997
+ /* @__PURE__ */ t("div", { className: "w6w-modal-actions", children: /* @__PURE__ */ t(
998
+ "button",
999
+ {
1000
+ type: "button",
1001
+ className: "w6w-btn",
1002
+ onClick: () => E(null),
1003
+ children: "Close"
1004
+ }
1005
+ ) })
1006
+ ] })
1007
+ ]
1008
+ }
1009
+ ),
1010
+ re !== null && /* @__PURE__ */ t(
1011
+ Mn,
1012
+ {
1013
+ title: "Delete step",
1014
+ message: `Delete step "${re}"? Its connections are removed too.`,
1015
+ confirmLabel: "Delete",
1016
+ onConfirm: () => {
1017
+ Le(re), ke(null);
1018
+ },
1019
+ onClose: () => ke(null)
1020
+ }
1021
+ )
1022
+ ]
1023
+ }
1024
+ ) }) }) }) }) }) });
1025
+ }
1026
+ function st(e) {
1027
+ try {
1028
+ const n = JSON.parse(e);
1029
+ return n && typeof n == "object" && !Array.isArray(n) ? n : null;
1030
+ } catch {
1031
+ return null;
1032
+ }
1033
+ }
1034
+ function Yt({
1035
+ text: e,
1036
+ onChange: n,
1037
+ seeds: o,
1038
+ readOnly: r
1039
+ }) {
1040
+ const c = st(e), l = c ? Object.keys(c).length : 0, u = l > 0, [y, C] = S(u);
1041
+ _(() => {
1042
+ u && C(!0);
1043
+ }, [u]);
1044
+ const N = (f) => {
1045
+ n(JSON.stringify(f.lastRunOutput ?? f.input ?? {}, null, 2)), C(!0);
1046
+ };
1047
+ return /* @__PURE__ */ w("div", { className: "w6w-field w6w-incoming-state", children: [
1048
+ /* @__PURE__ */ t("span", { children: "Incoming state" }),
1049
+ o.length > 0 && /* @__PURE__ */ t("div", { className: "w6w-seed-picker", children: /* @__PURE__ */ t("div", { className: "w6w-seed-chips", children: o.map((f) => /* @__PURE__ */ w(
1050
+ "button",
1051
+ {
1052
+ type: "button",
1053
+ className: "w6w-chip w6w-seed-chip",
1054
+ title: `Use ${f.label}'s saved test as the incoming state`,
1055
+ disabled: r,
1056
+ onClick: () => N(f.test),
1057
+ children: [
1058
+ /* @__PURE__ */ t("code", { children: f.label }),
1059
+ f.test.lastRunStatus ? /* @__PURE__ */ w("span", { className: "w6w-muted w6w-small", children: [
1060
+ " · ",
1061
+ f.test.lastRunStatus
1062
+ ] }) : null
1063
+ ]
1064
+ },
1065
+ f.stepId
1066
+ )) }) }),
1067
+ /* @__PURE__ */ w(
1068
+ "details",
1069
+ {
1070
+ className: "w6w-state-override",
1071
+ open: y,
1072
+ onToggle: (f) => C(f.currentTarget.open),
1073
+ children: [
1074
+ /* @__PURE__ */ w("summary", { children: [
1075
+ "Override the incoming state",
1076
+ l > 0 ? ` · ${l} key${l === 1 ? "" : "s"} set` : ""
1077
+ ] }),
1078
+ /* @__PURE__ */ t(
1079
+ "textarea",
1080
+ {
1081
+ rows: 3,
1082
+ value: e,
1083
+ readOnly: r,
1084
+ spellCheck: !1,
1085
+ "aria-label": "Incoming state override (JSON)",
1086
+ onChange: (f) => n(f.target.value)
1087
+ }
1088
+ ),
1089
+ /* @__PURE__ */ w("span", { className: "w6w-hint", children: [
1090
+ "JSON merged into the call (e.g. a script's ",
1091
+ /* @__PURE__ */ t("code", { children: "input" }),
1092
+ "). Reach for this to test against a state the flow cannot currently produce — a field no upstream step returns yet, or a case you can't reproduce by running the flow."
1093
+ ] })
1094
+ ]
1095
+ }
1096
+ )
1097
+ ] });
1098
+ }
1099
+ function Es({
1100
+ workflowId: e,
1101
+ step: n,
1102
+ upstreamSteps: o,
1103
+ onRun: r,
1104
+ onCancel: c
1105
+ }) {
1106
+ const l = Me(), u = Ce(n.uses.app), y = Pe(n.uses.app), C = M(
1107
+ () => {
1108
+ var x;
1109
+ return u ? Rt((x = n.with) == null ? void 0 : x.fields) : [];
1110
+ },
1111
+ [u, n.with]
1112
+ ), N = M(() => u ? qn(C) : y ? Ht(n.uses.app, n.uses.action) : null, [u, y, C, n.uses.app, n.uses.action]), [f, a] = S(null), g = N ?? f;
1113
+ _(() => {
1114
+ if (N) return;
1115
+ if (!n.uses.app || !n.uses.action) {
1116
+ a([]);
1117
+ return;
1118
+ }
1119
+ let x = !1;
1120
+ return a(null), l.getAppActions(n.uses.app).then((z) => {
1121
+ var $;
1122
+ x || a((($ = z.find((te) => te.key === n.uses.action)) == null ? void 0 : $.params) ?? []);
1123
+ }).catch(() => !x && a([])), () => {
1124
+ x = !0;
1125
+ };
1126
+ }, [l, N, n.uses.app, n.uses.action]);
1127
+ const [E, P] = S(
1128
+ () => {
1129
+ var x;
1130
+ return u ? Kn(Rt((x = n.with) == null ? void 0 : x.fields)) : {};
1131
+ }
1132
+ ), [R, V] = S("{}"), d = Bt(e, o, !u), I = jt(d), [ce, ne] = S(!1);
1133
+ _(() => {
1134
+ let x = !1;
1135
+ return l.listStepTests(e, n.id).then((z) => {
1136
+ if (x) return;
1137
+ const $ = z.length ? z[z.length - 1] : null;
1138
+ u ? $ != null && $.with && P((te) => ({ ...te, ...$.with })) : $ != null && $.input && Object.keys($.input).length > 0 && V(JSON.stringify($.input, null, 2)), ne(!0);
1139
+ }).catch(() => {
1140
+ x || ne(!0);
1141
+ }), () => {
1142
+ x = !0;
1143
+ };
1144
+ }, [l, e, n.id, u]);
1145
+ const [W, b] = S(!0), A = st(R), de = u ? W : A !== null, K = u ? E : { ...n.with ?? {}, ...A ?? {} }, G = !!g && ce && de && Ut(g, K);
1146
+ return (
1147
+ // `.w6w-stepconfig` frame + body + pinned footer (D-3): this component is a
1148
+ // direct <Modal> child, so the frame's `height:100%` resolves against the
1149
+ // dialog and only the form scrolls. The `.w6w-stack` keeps its own spacing.
1150
+ /* @__PURE__ */ w("div", { className: "w6w-stepconfig", children: [
1151
+ /* @__PURE__ */ t("div", { className: "w6w-modal-body", children: /* @__PURE__ */ t("div", { className: "w6w-stack", children: g === null || !ce ? /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: g === null ? "Loading parameters…" : "Loading saved values…" }) : u ? /* @__PURE__ */ w(B, { children: [
1152
+ /* @__PURE__ */ t(
1153
+ Gn,
1154
+ {
1155
+ params: g,
1156
+ values: E,
1157
+ onChange: P,
1158
+ onValidityChange: b
1159
+ }
1160
+ ),
1161
+ g.length === 0 && /* @__PURE__ */ w("span", { className: "w6w-hint", children: [
1162
+ "This trigger declares no fields — provide a sample payload to run with. It becomes the trigger's output state (",
1163
+ /* @__PURE__ */ t("code", { children: "input" }),
1164
+ ")."
1165
+ ] })
1166
+ ] }) : /* @__PURE__ */ w(B, { children: [
1167
+ /* @__PURE__ */ w("p", { className: "w6w-muted w6w-small", children: [
1168
+ "Runs ",
1169
+ /* @__PURE__ */ t("code", { children: n.uses.action }),
1170
+ " with the configuration saved on this step — only the incoming state changes per run. Edit the step to change how it is configured."
1171
+ ] }),
1172
+ /* @__PURE__ */ t(Yt, { text: R, onChange: V, seeds: d })
1173
+ ] }) }) }),
1174
+ /* @__PURE__ */ w("div", { className: "w6w-modal-actions", children: [
1175
+ /* @__PURE__ */ t("button", { type: "button", className: "w6w-btn w6w-btn-ghost", onClick: c, children: "Cancel" }),
1176
+ !G && g !== null && ce && /* @__PURE__ */ t("span", { className: "w6w-muted w6w-small", children: de ? u ? "Fill the required fields to test." : "This step is missing required configuration — set it on the Configure tab." : u ? "The payload must be a JSON object to run." : "The incoming state must be a JSON object to run." }),
1177
+ /* @__PURE__ */ t(
1178
+ "button",
1179
+ {
1180
+ type: "button",
1181
+ className: "w6w-btn",
1182
+ disabled: !G,
1183
+ onClick: () => r(u ? E : A ?? {}, u ? void 0 : I),
1184
+ children: "▶ Run"
1185
+ }
1186
+ )
1187
+ ] })
1188
+ ] })
1189
+ );
1190
+ }
1191
+ function Se({
1192
+ type: e,
1193
+ position: n,
1194
+ multiple: o,
1195
+ id: r,
1196
+ variant: c
1197
+ }) {
1198
+ return /* @__PURE__ */ t(
1199
+ mn,
1200
+ {
1201
+ type: e,
1202
+ position: n,
1203
+ id: r,
1204
+ className: c === "error" ? "w6w-handle-error" : o ? "w6w-handle-multi" : void 0,
1205
+ style: o ? { height: 22, borderRadius: 3, width: 8 } : void 0,
1206
+ title: c === "error" ? "On error — drag to route this step's failure separately" : o ? e === "target" ? "Accepts multiple incoming connections" : "Multiple outgoing connections" : void 0
1207
+ }
1208
+ );
1209
+ }
1210
+ function Qt({ id: e, runnable: n }) {
1211
+ const o = ge(Xt);
1212
+ return !o || o.readOnly ? null : /* @__PURE__ */ w(wn, { position: we.Top, className: "w6w-node-toolbar", children: [
1213
+ n && /* @__PURE__ */ t(
1214
+ "button",
1215
+ {
1216
+ type: "button",
1217
+ className: "w6w-node-toolbar-btn",
1218
+ title: "Test-run this step",
1219
+ "aria-label": "Test-run this step",
1220
+ onClick: () => o.onRun(e),
1221
+ children: /* @__PURE__ */ t(ye, { name: "run", size: 15 })
1222
+ }
1223
+ ),
1224
+ /* @__PURE__ */ t(
1225
+ "button",
1226
+ {
1227
+ type: "button",
1228
+ className: "w6w-node-toolbar-btn",
1229
+ title: "Edit",
1230
+ "aria-label": "Edit step",
1231
+ onClick: () => o.onEdit(e),
1232
+ children: /* @__PURE__ */ t(ye, { name: "edit", size: 15 })
1233
+ }
1234
+ ),
1235
+ /* @__PURE__ */ t(
1236
+ "button",
1237
+ {
1238
+ type: "button",
1239
+ className: "w6w-node-toolbar-btn",
1240
+ title: "Duplicate",
1241
+ "aria-label": "Duplicate step",
1242
+ onClick: () => o.onDuplicate(e),
1243
+ children: /* @__PURE__ */ t(ye, { name: "copy", size: 15 })
1244
+ }
1245
+ ),
1246
+ /* @__PURE__ */ t(
1247
+ "button",
1248
+ {
1249
+ type: "button",
1250
+ className: "w6w-node-toolbar-btn danger",
1251
+ title: "Delete",
1252
+ "aria-label": "Delete step",
1253
+ onClick: () => o.onDelete(e),
1254
+ children: /* @__PURE__ */ t(ye, { name: "trash", size: 15 })
1255
+ }
1256
+ )
1257
+ ] });
1258
+ }
1259
+ function Zt({ step: e, count: n }) {
1260
+ if (n < 2) return null;
1261
+ const o = e.fanOut === "parallel", r = gs(n, o ? "parallel" : "sequential");
1262
+ return /* @__PURE__ */ w("div", { className: "w6w-fanout-badge", role: "img", "aria-label": r, title: r, children: [
1263
+ /* @__PURE__ */ t("span", { "aria-hidden": "true", children: o ? "⇉" : "→" }),
1264
+ " ",
1265
+ n
1266
+ ] });
1267
+ }
1268
+ function xs({ id: e, data: n, selected: o }) {
1269
+ const r = n.step, l = ge(nt).get(r.uses.app), u = (l == null ? void 0 : l.displayName) || r.uses.app || "—", y = le(r, ge(et)), C = Gt(n.stepStatus ?? "no-run", n.runStatus), N = /* @__PURE__ */ t(Zt, { step: r, count: ge(tt).get(e) ?? 0 });
1270
+ return /* @__PURE__ */ w("div", { children: [
1271
+ /* @__PURE__ */ t(Qt, { id: e, runnable: !0 }),
1272
+ /* @__PURE__ */ w(
1273
+ "div",
1274
+ {
1275
+ "data-run-status": n.stepStatus ?? "no-run",
1276
+ style: {
1277
+ // `relative` so the Handles center on the CARD, not the whole node
1278
+ // (which also spans the meta line below) — keeps ports vertically centered.
1279
+ position: "relative",
1280
+ // Selection always wins the BORDER COLOUR (unchanged from before
1281
+ // T1.1.1 — the ternary this extends); width/style/opacity keep
1282
+ // reflecting the run status underneath so a selected running/failed
1283
+ // step is still distinguishable from a selected idle one.
1284
+ border: `${C.borderWidth}px ${C.borderStyle} ${o ? "var(--w6w-accent)" : C.borderColor}`,
1285
+ opacity: o ? 1 : C.opacity,
1286
+ background: "var(--w6w-panel)",
1287
+ color: "var(--w6w-text)",
1288
+ borderRadius: 4,
1289
+ padding: "8px 12px",
1290
+ minWidth: 180,
1291
+ fontSize: 13,
1292
+ display: "flex",
1293
+ alignItems: "center",
1294
+ gap: 10
1295
+ },
1296
+ children: [
1297
+ y.in > 0 && /* @__PURE__ */ t(Se, { type: "target", position: we.Left, multiple: y.in > 1 }),
1298
+ /* @__PURE__ */ t(
1299
+ Ye,
1300
+ {
1301
+ src: l == null ? void 0 : l.iconSvg,
1302
+ srcDark: l == null ? void 0 : l.iconSvgDark,
1303
+ brandColor: l == null ? void 0 : l.brandColor,
1304
+ name: u,
1305
+ size: 28
1306
+ }
1307
+ ),
1308
+ /* @__PURE__ */ w("div", { style: { minWidth: 0 }, children: [
1309
+ /* @__PURE__ */ t("div", { style: { fontWeight: 600 }, children: u }),
1310
+ /* @__PURE__ */ t("div", { className: "w6w-muted w6w-small", style: { marginTop: 2 }, children: /* @__PURE__ */ t("code", { children: r.uses.action || "—" }) })
1311
+ ] }),
1312
+ y.out > 0 && /* @__PURE__ */ w(B, { children: [
1313
+ /* @__PURE__ */ t(Se, { type: "source", position: we.Right, multiple: y.out > 1 }),
1314
+ /* @__PURE__ */ t(
1315
+ Se,
1316
+ {
1317
+ type: "source",
1318
+ position: we.Bottom,
1319
+ multiple: !1,
1320
+ id: _t,
1321
+ variant: "error"
1322
+ }
1323
+ )
1324
+ ] })
1325
+ ]
1326
+ }
1327
+ ),
1328
+ N,
1329
+ /* @__PURE__ */ w(
1330
+ "div",
1331
+ {
1332
+ className: "w6w-muted",
1333
+ style: { marginTop: 3, fontSize: 10, opacity: 0.75, paddingLeft: 2 },
1334
+ children: [
1335
+ r.id,
1336
+ l != null && l.version ? ` - v${l.version}` : ""
1337
+ ]
1338
+ }
1339
+ ),
1340
+ r.notes && /* @__PURE__ */ t("div", { className: "w6w-muted w6w-node-notes", title: r.notes, children: r.notes })
1341
+ ] });
1342
+ }
1343
+ function Rs({ id: e, data: n, selected: o }) {
1344
+ const r = n.step, c = $t(r.uses.app, r.uses.action), l = Jt(r.uses.app, r.uses.action), u = le(r, ge(et)), y = Ce(r.uses.app), C = Gt(n.stepStatus ?? "no-run", n.runStatus), N = /* @__PURE__ */ t(Zt, { step: r, count: ge(tt).get(e) ?? 0 });
1345
+ return /* @__PURE__ */ w("div", { children: [
1346
+ /* @__PURE__ */ t(Qt, { id: e, runnable: !Ae(r.uses.app) }),
1347
+ /* @__PURE__ */ w(
1348
+ "div",
1349
+ {
1350
+ "data-run-status": n.stepStatus ?? "no-run",
1351
+ style: {
1352
+ // `relative` so the Handles center on the CARD, not the whole node
1353
+ // (which also spans the meta line below) — keeps ports vertically centered.
1354
+ position: "relative",
1355
+ border: `${C.borderWidth}px ${C.borderStyle} ${o ? "var(--w6w-accent)" : C.borderColor}`,
1356
+ opacity: o ? 1 : C.opacity,
1357
+ background: "var(--w6w-panel-2)",
1358
+ color: "var(--w6w-text)",
1359
+ borderRadius: 4,
1360
+ padding: "6px 14px 6px 8px",
1361
+ minWidth: 140,
1362
+ fontSize: 13,
1363
+ display: "flex",
1364
+ alignItems: "center",
1365
+ gap: 10
1366
+ },
1367
+ children: [
1368
+ u.in > 0 && /* @__PURE__ */ t(Se, { type: "target", position: we.Left, multiple: u.in > 1 }),
1369
+ l && /* @__PURE__ */ t(Mt, { icon: l }),
1370
+ /* @__PURE__ */ w("div", { style: { minWidth: 0, textAlign: "left" }, children: [
1371
+ /* @__PURE__ */ t("div", { style: { fontWeight: 600 }, children: c }),
1372
+ /* @__PURE__ */ t("div", { className: "w6w-muted w6w-small", style: { marginTop: 2 }, children: /* @__PURE__ */ t("code", { children: r.uses.action || "—" }) })
1373
+ ] }),
1374
+ u.out > 0 && /* @__PURE__ */ w(B, { children: [
1375
+ /* @__PURE__ */ t(Se, { type: "source", position: we.Right, multiple: u.out > 1 }),
1376
+ !y && /* @__PURE__ */ t(
1377
+ Se,
1378
+ {
1379
+ type: "source",
1380
+ position: we.Bottom,
1381
+ multiple: !1,
1382
+ id: _t,
1383
+ variant: "error"
1384
+ }
1385
+ )
1386
+ ] })
1387
+ ]
1388
+ }
1389
+ ),
1390
+ N,
1391
+ /* @__PURE__ */ t(
1392
+ "div",
1393
+ {
1394
+ className: "w6w-muted",
1395
+ style: { marginTop: 3, fontSize: 10, opacity: 0.75, paddingLeft: 2 },
1396
+ children: r.id
1397
+ }
1398
+ ),
1399
+ r.notes && /* @__PURE__ */ t("div", { className: "w6w-muted w6w-node-notes", title: r.notes, children: r.notes })
1400
+ ] });
1401
+ }
1402
+ function Ts({
1403
+ workflowId: e,
1404
+ step: n,
1405
+ upstreamSteps: o,
1406
+ onChange: r,
1407
+ onClose: c,
1408
+ readOnly: l,
1409
+ initialView: u = "props",
1410
+ fanOutCount: y = 0,
1411
+ onTestRun: C
1412
+ }) {
1413
+ var Ve;
1414
+ const N = Me(), f = ge(nt), [a, g] = S(n), [E, P] = S(
1415
+ "configure"
1416
+ ), [R, V] = S(
1417
+ u === "json" ? "code" : u === "settings" ? "config" : "props"
1418
+ ), [d, I] = S("props"), [ce, ne] = S(() => kt(n)), [W, b] = S(() => Et(n)), [A, de] = S("{}"), K = me(null), [G, x] = S(!1), [z, $] = S(!1), [te, O] = S(a.id), [se, be] = S(null), [oe, re] = S(null), [ke, ue] = S(null), [Ie, H] = S(null), X = Pe(a.uses.app);
1419
+ _(() => {
1420
+ if (X) {
1421
+ re(Ht(a.uses.app, a.uses.action)), ue(null);
1422
+ return;
1423
+ }
1424
+ if (!a.uses.app) {
1425
+ ue(null), re([]);
1426
+ return;
1427
+ }
1428
+ let h = !1;
1429
+ return re(null), N.getAppActions(a.uses.app).then((q) => {
1430
+ var Y;
1431
+ h || (ue(q), re(
1432
+ a.uses.action ? ((Y = q.find((he) => he.key === a.uses.action)) == null ? void 0 : Y.params) ?? [] : []
1433
+ ));
1434
+ }).catch(() => !h && re([])), () => {
1435
+ h = !0;
1436
+ };
1437
+ }, [N, a.uses.app, a.uses.action, X]);
1438
+ const De = J(() => {
1439
+ X || !a.uses.app || N.listConnectionsForApp(a.uses.app).then((h) => H(h)).catch(() => H([]));
1440
+ }, [N, a.uses.app, X]);
1441
+ _(() => {
1442
+ if (X || !a.uses.app) return;
1443
+ let h = !1;
1444
+ return N.listConnectionsForApp(a.uses.app).then((q) => !h && H(q)).catch(() => !h && H([])), () => {
1445
+ h = !0;
1446
+ };
1447
+ }, [N, a.uses.app, X]);
1448
+ const j = J(
1449
+ (h) => {
1450
+ g(h), r(h);
1451
+ },
1452
+ [r]
1453
+ ), _e = (h) => {
1454
+ h === "code" ? ne(kt(a)) : h === "params-code" && b(Et(a)), V(h);
1455
+ }, D = () => {
1456
+ const h = te.trim(), q = h && h !== a.id ? Zn(h) : null;
1457
+ if (q) {
1458
+ be(q);
1459
+ return;
1460
+ }
1461
+ h && h !== a.id && j({ ...a, id: h }), be(null), $(!1);
1462
+ }, ie = !!a.uses.app && !!a.uses.action && !Ae(a.uses.app), ae = Ce(a.uses.app), He = E === "test" && ie && !ae, ve = Bt(e, o, ie && !ae), Le = jt(ve);
1463
+ _(() => {
1464
+ if (!ie || ae) return;
1465
+ let h = !1;
1466
+ return N.listStepTests(e, a.id).then((q) => {
1467
+ if (h) return;
1468
+ const Y = q.length ? q[q.length - 1] : null;
1469
+ if (!(Y != null && Y.input) || Object.keys(Y.input).length === 0) return;
1470
+ const he = JSON.stringify(Y.input, null, 2);
1471
+ de((Te) => Te.trim() === "{}" ? he : Te);
1472
+ }).catch(() => {
1473
+ }), () => {
1474
+ h = !0;
1475
+ };
1476
+ }, [N, e, a.id, ie, ae]);
1477
+ const Ee = st(A), xe = { ...a.with ?? {}, ...Ee ?? {} }, Re = Ee ?? {}, pe = !!oe && Ut(oe, xe), F = f.get(a.uses.app), fe = X ? Jt(a.uses.app, a.uses.action) : null, Be = X ? fe ? /* @__PURE__ */ t(Mt, { icon: fe }) : null : /* @__PURE__ */ t(
1478
+ Ye,
1479
+ {
1480
+ src: F == null ? void 0 : F.iconSvg,
1481
+ srcDark: F == null ? void 0 : F.iconSvgDark,
1482
+ brandColor: F == null ? void 0 : F.brandColor,
1483
+ name: F == null ? void 0 : F.displayName
1484
+ }
1485
+ );
1486
+ return /* @__PURE__ */ t(
1487
+ Ot,
1488
+ {
1489
+ ariaLabel: "Edit step",
1490
+ titleIcon: Be,
1491
+ title: /* @__PURE__ */ w("span", { className: "w6w-step-rename", children: [
1492
+ z && !l ? /* @__PURE__ */ t(
1493
+ "input",
1494
+ {
1495
+ autoFocus: !0,
1496
+ value: te,
1497
+ onChange: (h) => {
1498
+ O(h.target.value), be(null);
1499
+ },
1500
+ onBlur: D,
1501
+ onKeyDown: (h) => {
1502
+ h.key === "Enter" && D(), h.key === "Escape" && (O(a.id), be(null), $(!1));
1503
+ }
1504
+ }
1505
+ ) : /* @__PURE__ */ w(B, { children: [
1506
+ /* @__PURE__ */ t("code", { children: a.id }),
1507
+ !l && /* @__PURE__ */ t(
1508
+ "button",
1509
+ {
1510
+ type: "button",
1511
+ className: "w6w-icon-btn w6w-btn-sm",
1512
+ title: "Rename step",
1513
+ "aria-label": "Rename step",
1514
+ onClick: () => {
1515
+ O(a.id), $(!0);
1516
+ },
1517
+ children: /* @__PURE__ */ t(ye, { name: "edit", size: 15 })
1518
+ }
1519
+ )
1520
+ ] }),
1521
+ se && /* @__PURE__ */ t("span", { className: "w6w-hint", role: "alert", style: { color: "var(--w6w-danger)" }, children: se })
1522
+ ] }),
1523
+ onClose: c,
1524
+ size: "wide",
1525
+ children: /* @__PURE__ */ w("div", { className: "w6w-stepconfig", children: [
1526
+ /* @__PURE__ */ w("div", { className: "w6w-tabsbar", children: [
1527
+ /* @__PURE__ */ t("div", { className: "w6w-subtabs", children: ["setup", "configure", "test"].map((h) => /* @__PURE__ */ t(
1528
+ "button",
1529
+ {
1530
+ type: "button",
1531
+ className: `w6w-subtab${E === h ? " active" : ""}`,
1532
+ onClick: () => P(h),
1533
+ children: h === "setup" ? "Setup" : h === "configure" ? "Configure" : "Test"
1534
+ },
1535
+ h
1536
+ )) }),
1537
+ He ? /* @__PURE__ */ t(
1538
+ xt,
1539
+ {
1540
+ view: d,
1541
+ views: ["props", "code"],
1542
+ onChange: (h) => I(h)
1543
+ }
1544
+ ) : /* @__PURE__ */ t(
1545
+ xt,
1546
+ {
1547
+ view: R,
1548
+ onChange: _e,
1549
+ disabled: E !== "configure"
1550
+ }
1551
+ )
1552
+ ] }),
1553
+ /* @__PURE__ */ w("div", { className: "w6w-stepconfig-body", children: [
1554
+ E === "setup" && /* @__PURE__ */ t(
1555
+ Ds,
1556
+ {
1557
+ step: a,
1558
+ app: F,
1559
+ actions: ke,
1560
+ conns: Ie,
1561
+ isInternal: X,
1562
+ readOnly: l,
1563
+ onChangeAction: (h) => j({ ...a, uses: { ...a.uses, action: h }, with: {} }),
1564
+ onChangeConnection: (h) => j({ ...a, uses: { ...a.uses, connection: h } }),
1565
+ onConnectionCreated: De,
1566
+ onChangeApp: (h) => (
1567
+ // D-1: a genuinely different app clears `uses.action`/`with` and
1568
+ // drops the connection; reselecting the SAME app is a no-op —
1569
+ // still committed (so the field always collapses cleanly), but
1570
+ // with `step` itself, unchanged.
1571
+ j(
1572
+ h === a.uses.app ? a : {
1573
+ ...a,
1574
+ uses: { app: h, action: "", connection: void 0 },
1575
+ with: {}
1576
+ }
1577
+ )
1578
+ )
1579
+ }
1580
+ ),
1581
+ E === "configure" && /* @__PURE__ */ w(B, { children: [
1582
+ a.uses.app === Ke && N.listSubscriptionsForWorkflow && N.createSubscription && /* @__PURE__ */ t(Is, { workflowId: e, step: a, readOnly: l }),
1583
+ oe === null ? /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: "Loading parameters…" }) : R === "props" ? a.uses.action === "wait" && Ae(a.uses.app) ? /* @__PURE__ */ t(
1584
+ _n,
1585
+ {
1586
+ values: a.with ?? {},
1587
+ readOnly: l,
1588
+ onChange: (h) => j({ ...a, with: h })
1589
+ }
1590
+ ) : /* @__PURE__ */ t(
1591
+ Hn,
1592
+ {
1593
+ params: oe,
1594
+ values: a.with ?? {},
1595
+ readOnly: l,
1596
+ onChange: (h) => j({ ...a, with: h })
1597
+ }
1598
+ ) : R === "code" ? (
1599
+ // Full step, read-only (D-3) — `stepToJson` is the ONE serializer,
1600
+ // shared with the two other code-view hosts.
1601
+ /* @__PURE__ */ t(
1602
+ qe,
1603
+ {
1604
+ value: ce,
1605
+ onChange: () => {
1606
+ },
1607
+ readOnly: !0,
1608
+ minHeight: "260px",
1609
+ height: "100%",
1610
+ "aria-label": `Step ${a.id} JSON`,
1611
+ copyable: !0
1612
+ }
1613
+ )
1614
+ ) : R === "params-code" ? /* @__PURE__ */ t(
1615
+ qe,
1616
+ {
1617
+ value: W,
1618
+ onChange: b,
1619
+ readOnly: l,
1620
+ minHeight: "260px",
1621
+ height: "100%",
1622
+ "aria-label": `Step ${a.id} params JSON`,
1623
+ copyable: !0,
1624
+ onValidChange: (h) => h && typeof h == "object" && !Array.isArray(h) && j({ ...a, with: h })
1625
+ }
1626
+ ) : /* @__PURE__ */ w("div", { className: "w6w-stack", children: [
1627
+ /* @__PURE__ */ t(
1628
+ Bn,
1629
+ {
1630
+ config: { retry: a.retry, onError: a.onError, notes: a.notes },
1631
+ onChange: (h) => j({ ...a, ...h }),
1632
+ readOnly: l,
1633
+ failureHandling: !ae,
1634
+ retryControls: !Ae(a.uses.app) && a.uses.app !== jn
1635
+ }
1636
+ ),
1637
+ As,
1638
+ /* @__PURE__ */ t(
1639
+ Ps,
1640
+ {
1641
+ step: a,
1642
+ count: y,
1643
+ readOnly: l,
1644
+ onChange: j
1645
+ }
1646
+ )
1647
+ ] })
1648
+ ] }),
1649
+ E === "test" && /* @__PURE__ */ t("div", { className: "w6w-stack", children: ie ? ae ? /* @__PURE__ */ t(
1650
+ Un,
1651
+ {
1652
+ app: a.uses.app,
1653
+ action: a.uses.action,
1654
+ fields: (Ve = a.with) == null ? void 0 : Ve.fields,
1655
+ persist: { workflowId: e, stepId: a.id, input: Re }
1656
+ }
1657
+ ) : /* @__PURE__ */ w(B, { children: [
1658
+ /* @__PURE__ */ w("p", { className: "w6w-muted w6w-small", children: [
1659
+ "Tests ",
1660
+ /* @__PURE__ */ t("code", { children: a.uses.action }),
1661
+ " with the configuration saved on this step — only the incoming state changes per run."
1662
+ ] }),
1663
+ /* @__PURE__ */ t(
1664
+ Yt,
1665
+ {
1666
+ text: A,
1667
+ onChange: de,
1668
+ seeds: ve,
1669
+ readOnly: l
1670
+ }
1671
+ ),
1672
+ oe === null ? /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: "Loading parameters…" }) : /* @__PURE__ */ t(
1673
+ ns,
1674
+ {
1675
+ params: oe,
1676
+ values: xe,
1677
+ testStartState: Le,
1678
+ view: d
1679
+ }
1680
+ ),
1681
+ /* @__PURE__ */ t(
1682
+ zn,
1683
+ {
1684
+ ref: K,
1685
+ app: a.uses.app,
1686
+ action: a.uses.action,
1687
+ connectionId: a.uses.connection ?? void 0,
1688
+ values: xe,
1689
+ state: Le,
1690
+ canRun: pe,
1691
+ hideRunButton: !0,
1692
+ persist: { workflowId: e, stepId: a.id, input: Re },
1693
+ onBusyChange: x
1694
+ }
1695
+ )
1696
+ ] }) : /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: "Flow-control nodes can't be tested on their own." }) })
1697
+ ] }),
1698
+ /* @__PURE__ */ t("div", { className: "w6w-modal-actions w6w-stepconfig-footer", children: E !== "test" ? /* @__PURE__ */ t(
1699
+ "button",
1700
+ {
1701
+ type: "button",
1702
+ className: "w6w-btn",
1703
+ onClick: () => P(E === "setup" ? "configure" : "test"),
1704
+ children: "Next →"
1705
+ }
1706
+ ) : /* @__PURE__ */ w(B, { children: [
1707
+ /* @__PURE__ */ t("button", { type: "button", className: "w6w-btn w6w-btn-ghost", onClick: c, children: "Done" }),
1708
+ ie && !ae && // Runs the step and persists the outcome (records a run + saves
1709
+ // the fixture) via the body's <StepTestRun>, so a step test is
1710
+ // saved and re-runnable. `readOnly` viewers can't write tests.
1711
+ /* @__PURE__ */ t(
1712
+ "button",
1713
+ {
1714
+ type: "button",
1715
+ className: "w6w-btn",
1716
+ disabled: l || !pe || G,
1717
+ onClick: () => {
1718
+ var h;
1719
+ C == null || C(), (h = K.current) == null || h.run();
1720
+ },
1721
+ children: G ? "Testing…" : "Test"
1722
+ }
1723
+ )
1724
+ ] }) })
1725
+ ] })
1726
+ }
1727
+ );
1728
+ }
1729
+ const As = !1;
1730
+ function Ps({
1731
+ step: e,
1732
+ count: n,
1733
+ readOnly: o,
1734
+ onChange: r
1735
+ }) {
1736
+ const c = n >= 2, l = e.fanOut === "parallel" ? "parallel" : "sequential";
1737
+ return /* @__PURE__ */ w("label", { className: "w6w-field", children: [
1738
+ /* @__PURE__ */ t("span", { children: "Run next steps" }),
1739
+ /* @__PURE__ */ w(
1740
+ "select",
1741
+ {
1742
+ "aria-label": "Run next steps",
1743
+ value: l,
1744
+ disabled: o || !c,
1745
+ onChange: (u) => r(ms(e, u.target.value)),
1746
+ children: [
1747
+ /* @__PURE__ */ t("option", { value: "sequential", children: "In sequence" }),
1748
+ /* @__PURE__ */ t("option", { value: "parallel", children: "In parallel" })
1749
+ ]
1750
+ }
1751
+ ),
1752
+ !c && /* @__PURE__ */ t("span", { className: "w6w-muted w6w-small", children: "Connect two or more steps after this one to choose how they run." })
1753
+ ] });
1754
+ }
1755
+ function Is({
1756
+ workflowId: e,
1757
+ step: n,
1758
+ readOnly: o
1759
+ }) {
1760
+ const r = Me(), [c, l] = S(void 0), [u, y] = S(null), [C, N] = S(!1);
1761
+ _(() => {
1762
+ const a = r.listSubscriptionsForWorkflow;
1763
+ if (!a) return;
1764
+ let g = !1;
1765
+ return a(e).then((E) => {
1766
+ g || l(E.find((P) => P.appId === Ke) ?? null);
1767
+ }).catch((E) => !g && y(E.message)), () => {
1768
+ g = !0;
1769
+ };
1770
+ }, [r, e]);
1771
+ const f = () => {
1772
+ const a = r.createSubscription;
1773
+ a && (y(null), N(!0), a(Ke, n.uses.action, {
1774
+ workflowId: e,
1775
+ connectionId: null,
1776
+ params: n.with ?? {}
1777
+ }).then((g) => {
1778
+ N(!1), l(g);
1779
+ }).catch((g) => {
1780
+ N(!1), y(g instanceof Error ? g.message : String(g));
1781
+ }));
1782
+ };
1783
+ return /* @__PURE__ */ w("div", { className: "w6w-stack", children: [
1784
+ /* @__PURE__ */ w("p", { className: "w6w-muted w6w-small", children: [
1785
+ /* @__PURE__ */ t("strong", { children: "Webhook URL" }),
1786
+ " — the address a third party posts to."
1787
+ ] }),
1788
+ u && /* @__PURE__ */ t("div", { className: "w6w-result w6w-error", children: u }),
1789
+ c != null && c.webhookUrl ? /* @__PURE__ */ t(es, { value: c.webhookUrl, readOnly: !0, children: /* @__PURE__ */ t("input", { type: "text", readOnly: !0, value: c.webhookUrl, "aria-label": "Webhook URL" }) }) : c === void 0 ? /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: "Loading…" }) : !o && /* @__PURE__ */ t("button", { type: "button", className: "w6w-btn", disabled: C, onClick: f, children: C ? "Creating…" : "Create webhook URL" })
1790
+ ] });
1791
+ }
1792
+ function Lt({
1793
+ anchorRef: e,
1794
+ onClose: n,
1795
+ children: o
1796
+ }) {
1797
+ const r = me(null), [c, l] = S(null), [u, y] = S(null);
1798
+ return _(() => {
1799
+ const C = e.current;
1800
+ if (!C) return;
1801
+ const N = C.getBoundingClientRect();
1802
+ l({ top: N.bottom + 6, left: N.left, width: N.width }), y(C.closest("dialog") ?? document.body);
1803
+ }, [e]), _(() => {
1804
+ function C(f) {
1805
+ var g, E;
1806
+ const a = f.target;
1807
+ (g = r.current) != null && g.contains(a) || (E = e.current) != null && E.contains(a) || n();
1808
+ }
1809
+ function N(f) {
1810
+ f.key === "Escape" && n();
1811
+ }
1812
+ return document.addEventListener("mousedown", C), document.addEventListener("keydown", N), () => {
1813
+ document.removeEventListener("mousedown", C), document.removeEventListener("keydown", N);
1814
+ };
1815
+ }, [n, e]), !c || !u ? null : gn(
1816
+ /* @__PURE__ */ t(
1817
+ "div",
1818
+ {
1819
+ ref: r,
1820
+ className: "w6w-flyout",
1821
+ style: { top: c.top, left: c.left, width: c.width },
1822
+ children: o
1823
+ }
1824
+ ),
1825
+ u
1826
+ );
1827
+ }
1828
+ function Ds({
1829
+ step: e,
1830
+ app: n,
1831
+ actions: o,
1832
+ conns: r,
1833
+ isInternal: c,
1834
+ readOnly: l,
1835
+ onChangeAction: u,
1836
+ onChangeConnection: y,
1837
+ onChangeApp: C,
1838
+ onConnectionCreated: N
1839
+ }) {
1840
+ var V;
1841
+ const [f, a] = S(null), [g, E] = S(!1), P = me(null), R = e.uses.connection ? ((V = (r ?? []).find((d) => d.id === e.uses.connection)) == null ? void 0 : V.displayName) ?? e.uses.connection : "No connection";
1842
+ return /* @__PURE__ */ w("div", { className: "w6w-stack", children: [
1843
+ /* @__PURE__ */ w("div", { className: "w6w-field", children: [
1844
+ /* @__PURE__ */ t("span", { children: "App" }),
1845
+ /* @__PURE__ */ w("div", { className: "w6w-app-conn-row", ref: P, children: [
1846
+ /* @__PURE__ */ w(
1847
+ "button",
1848
+ {
1849
+ type: "button",
1850
+ className: "w6w-app-conn-btn",
1851
+ "aria-label": "App",
1852
+ "aria-expanded": f === "app",
1853
+ disabled: l,
1854
+ onClick: () => a((d) => d === "app" ? null : "app"),
1855
+ children: [
1856
+ !c && n && /* @__PURE__ */ t(
1857
+ Ye,
1858
+ {
1859
+ src: n.iconSvg,
1860
+ srcDark: n.iconSvgDark,
1861
+ brandColor: n.brandColor,
1862
+ name: n.displayName,
1863
+ size: 20
1864
+ }
1865
+ ),
1866
+ /* @__PURE__ */ t("span", { className: "w6w-conn-label-name", children: c ? e.uses.app : (n == null ? void 0 : n.displayName) ?? e.uses.app })
1867
+ ]
1868
+ }
1869
+ ),
1870
+ !c && /* @__PURE__ */ t(
1871
+ "button",
1872
+ {
1873
+ type: "button",
1874
+ className: "w6w-app-conn-btn",
1875
+ "aria-label": "Connection",
1876
+ "aria-expanded": f === "conn",
1877
+ disabled: l,
1878
+ onClick: () => a((d) => d === "conn" ? null : "conn"),
1879
+ children: /* @__PURE__ */ t("span", { className: "w6w-conn-label-name", children: R })
1880
+ }
1881
+ )
1882
+ ] }),
1883
+ f === "app" && /* @__PURE__ */ t(Lt, { anchorRef: P, onClose: () => a(null), children: /* @__PURE__ */ t(
1884
+ Xn,
1885
+ {
1886
+ onSelectApp: (d) => {
1887
+ const I = d.id === e.uses.app;
1888
+ C(d.id), a(I ? "conn" : null);
1889
+ }
1890
+ }
1891
+ ) }),
1892
+ f === "conn" && /* @__PURE__ */ t(Lt, { anchorRef: P, onClose: () => a(null), children: /* @__PURE__ */ w("div", { className: "w6w-stack", children: [
1893
+ /* @__PURE__ */ t("div", { className: "w6w-stepbuilder-list", children: (r ?? []).map((d) => /* @__PURE__ */ t(
1894
+ "button",
1895
+ {
1896
+ type: "button",
1897
+ className: "w6w-stepbuilder-item",
1898
+ onClick: () => {
1899
+ y(d.id), a(null);
1900
+ },
1901
+ children: /* @__PURE__ */ w("span", { className: "w6w-stepbuilder-item-main", children: [
1902
+ /* @__PURE__ */ t("strong", { children: d.displayName || d.id }),
1903
+ d.state && /* @__PURE__ */ t("span", { className: "w6w-muted w6w-small", children: d.state })
1904
+ ] })
1905
+ },
1906
+ d.id
1907
+ )) }),
1908
+ /* @__PURE__ */ t(
1909
+ "button",
1910
+ {
1911
+ type: "button",
1912
+ className: "w6w-btn",
1913
+ disabled: l,
1914
+ onClick: () => {
1915
+ E(!0), a(null);
1916
+ },
1917
+ children: "+ New connection"
1918
+ }
1919
+ )
1920
+ ] }) })
1921
+ ] }),
1922
+ !c && g && /* @__PURE__ */ t(
1923
+ Yn,
1924
+ {
1925
+ initialAppId: e.uses.app,
1926
+ onClose: () => E(!1),
1927
+ onCreated: ({ connectionId: d }) => {
1928
+ E(!1), y(d), N(), a(null);
1929
+ }
1930
+ }
1931
+ ),
1932
+ c ? /* @__PURE__ */ w("div", { className: "w6w-field", children: [
1933
+ /* @__PURE__ */ t("span", { children: "Action" }),
1934
+ /* @__PURE__ */ t("div", { className: "w6w-muted w6w-small", children: /* @__PURE__ */ t("code", { children: e.uses.action }) })
1935
+ ] }) : (
1936
+ // biome-ignore lint/a11y/noLabelWithoutControl: Combobox renders its own <select>/<input> INSIDE this label, so the field text labels the control at runtime; the rule cannot see through the component boundary.
1937
+ /* @__PURE__ */ w("label", { className: "w6w-field", children: [
1938
+ /* @__PURE__ */ t("span", { children: "Action" }),
1939
+ /* @__PURE__ */ t(
1940
+ Qn,
1941
+ {
1942
+ value: e.uses.action,
1943
+ disabled: l || o === null,
1944
+ onChange: u,
1945
+ options: o === null ? [{ value: e.uses.action, label: e.uses.action }] : o.map((d) => ({ value: d.key, label: d.title ?? d.key }))
1946
+ }
1947
+ )
1948
+ ] })
1949
+ )
1950
+ ] });
1951
+ }
1952
+ export {
1953
+ jn as CALL_APP,
1954
+ Hs as CONTROL_APP,
1955
+ Bs as DATA_APP,
1956
+ Wn as ExpressionOptionsProvider,
1957
+ js as INTERNAL_NODES,
1958
+ Us as SCHEDULER_APP,
1959
+ zs as SCRIPT_APP,
1960
+ qs as TRIGGER_APP,
1961
+ Ke as WEBHOOK_APP,
1962
+ Js as WorkflowFlowEditor,
1963
+ Rt as asFieldDefs,
1964
+ Ks as coerceDefault,
1965
+ Gs as fieldWidget,
1966
+ qn as fieldsToParams,
1967
+ Nt as flowToWorkflow,
1968
+ Xs as internalNodeDefaults,
1969
+ Jt as internalNodeIcon,
1970
+ $t as internalNodeLabel,
1971
+ Ht as internalNodeParams,
1972
+ Ae as isControlApp,
1973
+ Pe as isInternalApp,
1974
+ Ce as isTriggerApp,
1975
+ Kn as seedValues,
1976
+ En as workflowToFlow
1977
+ };
1978
+ //# sourceMappingURL=flow.mjs.map