@oomol-lab/open-flow 0.1.0-alpha.8 → 0.1.0-beta.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 (55) hide show
  1. package/README.md +5 -1
  2. package/dist/browser/{createResourceDialog-A64dDFCG.js → createResourceDialog-DXQz0thK.js} +228 -191
  3. package/dist/browser/diagnostics-BGoGFvHA.js +9237 -0
  4. package/dist/browser/{dist-DhsGR_K3.js → dist-3Mj8q8Pr.js} +27 -27
  5. package/dist/browser/{dist-n9WmBm5w.js → dist-BKuSVKCC.js} +1 -1
  6. package/dist/browser/{dist-DQVavPcf.js → dist-BMqL-qR5.js} +469 -903
  7. package/dist/browser/{dist-D5mdziGP.js → dist-BN4ZCyOB.js} +9 -9
  8. package/dist/browser/{dist-CVtP-E2c.js → dist-BpopSHwP.js} +1 -1
  9. package/dist/browser/{dist-B0Q2Mn0n.js → dist-CJpzJrLM.js} +191 -191
  10. package/dist/browser/{dist-DXgEYMFx.js → dist-CPuF50D9.js} +196 -196
  11. package/dist/browser/{dist-CUkceEvN.js → dist-CUSrALSX.js} +113 -113
  12. package/dist/browser/dist-CeSZ2xSM.js +444 -0
  13. package/dist/browser/{dist-Bc9TvHYl.js → dist-DUzA0Ukh.js} +20 -20
  14. package/dist/browser/{dist-DWzdGVm9.js → dist-DWADUsVB.js} +74 -74
  15. package/dist/browser/{esm-YIGXG-Js.js → esm-DGQbgYoJ.js} +13 -13
  16. package/dist/browser/flow-authoring-node.d.ts +3 -1
  17. package/dist/browser/flow-authoring.d.ts +2 -1
  18. package/dist/browser/flow-authoring.js +386 -96
  19. package/dist/browser/flow-change.d.ts +9 -4
  20. package/dist/browser/flow-change.js +49 -46
  21. package/dist/browser/{flowRunInputEditorStore-DXOyyY7o.js → flowRunInputEditorStore-BeyUSWpO.js} +1644 -908
  22. package/dist/browser/{flowWorkspace-D7-rBA1-.js → flowWorkspace-DwyxAOBH.js} +18384 -16381
  23. package/dist/browser/getPseudoElementBounds-ESJExRFX.js +7642 -0
  24. package/dist/browser/languages-DgJehE1g.js +62 -0
  25. package/dist/browser/lib-C5Ipyfps.js +7856 -0
  26. package/dist/browser/licenses.md +119 -1
  27. package/dist/browser/main-DmjVyuWr.js +76 -0
  28. package/dist/browser/{markdownContent-ColGUxHy.js → markdownContent-DdlIRN3_.js} +4811 -4795
  29. package/dist/browser/theme.css +63 -0
  30. package/dist/browser/theme.css.d.ts +1 -0
  31. package/dist/browser/typeScriptSession-mPCiA9sV.js +2579 -0
  32. package/dist/browser/workbench-contract.d.ts +2 -1
  33. package/dist/browser/workbench.css +1 -1
  34. package/dist/browser/workbench.d.ts +45 -1
  35. package/dist/browser/workbench.js +982 -1328
  36. package/dist/browser/workbenchSelect-B2s1HV-Y.js +1374 -0
  37. package/dist/common/connector-action.d.ts +6 -0
  38. package/dist/common/connector-action.js +37 -29
  39. package/dist/common/control-api-conformance.js +45 -4
  40. package/dist/common/control-api-errors.d.ts +16 -0
  41. package/dist/common/control-api.d.ts +20 -6
  42. package/dist/common/control-api.js +151 -95
  43. package/dist/common/flow-encoding.d.ts +2 -2
  44. package/dist/common/flow-encoding.js +4 -1
  45. package/dist/common/flow-semantics.d.ts +3 -0
  46. package/dist/common/flow-semantics.js +939 -844
  47. package/dist/common/licenses.md +1 -25
  48. package/dist/common/localization.d.ts +21 -0
  49. package/dist/common/localization.js +62 -0
  50. package/dist/common/scheduler.d.ts +5 -5
  51. package/dist/common/scheduler.js +250 -236
  52. package/package.json +10 -1
  53. package/dist/browser/addNodeOptions-DRndy4EK.js +0 -6910
  54. package/dist/browser/createLucideIcon-CqjqCezK.js +0 -5537
  55. package/dist/browser/field-CKGQHCIi.js +0 -312
@@ -1,10 +1,13 @@
1
1
  import { a as e, f as t, i as n } from "./dist-C46JByB-.js";
2
- import { Ar as r, Dr as i, Ir as a, Or as o } from "./createLucideIcon-CqjqCezK.js";
3
- import { $ as s, Q as c, Y as l, _ as u, a as d, c as f, d as p, f as m, g as h, i as g, l as _, m as v, n as ee, o as y, t as b, u as te, v as x, y as ne } from "./addNodeOptions-DRndy4EK.js";
4
- import { Suspense as re, lazy as ie, useEffect as S, useRef as ae, useState as oe } from "react";
5
- import { jsx as C, jsxs as se } from "react/jsx-runtime";
2
+ import { a as r, i, s as a, t as o } from "./main-DmjVyuWr.js";
3
+ import { At as s, It as c, Jn as l, Kn as u, Mt as d, Ot as f, Qn as p, Xn as m, Yn as h, Zn as g, er as _, jt as v } from "./getPseudoElementBounds-ESJExRFX.js";
4
+ import { A as y, At as b, B as x, C as S, Ct as C, D as w, Dt as ee, E as T, Et as te, Ft as E, G as ne, H as D, I as O, K as re, Lt as k, M as A, Mt as ie, N as j, Nt as ae, O as M, Ot as oe, P as se, Pt as ce, R as N, Rt as P, S as le, Tt as ue, U as de, V as fe, W as pe, _ as me, a as F, b as he, c as ge, d as _e, f as ve, g as ye, h as be, i as xe, j as I, jt as Se, kt as Ce, l as we, m as Te, n as Ee, p as De, q as Oe, s as ke, t as Ae, u as je, v as Me, w as Ne, wt as L, x as Pe, y as Fe, z as R } from "./diagnostics-BGoGFvHA.js";
5
+ import { t as Ie } from "./workbenchSelect-B2s1HV-Y.js";
6
+ import { a as Le, i as Re, n as ze, r as Be } from "./languages-DgJehE1g.js";
7
+ import { Suspense as Ve, lazy as He, useEffect as z, useRef as Ue, useState as B } from "react";
8
+ import { Fragment as We, jsx as V, jsxs as H } from "react/jsx-runtime";
6
9
  //#region src/workbench/browser/runtime/navigation.ts
7
- var ce = class {
10
+ var Ge = class {
8
11
  #e;
9
12
  #t;
10
13
  #n;
@@ -31,14 +34,14 @@ var ce = class {
31
34
  open(e) {
32
35
  this.#i += 1, this.#s = !1, this.#u(e, !1);
33
36
  }
34
- async createFlow(e) {
35
- let t = ++this.#i;
37
+ async createFlow(e, t) {
38
+ let n = ++this.#i;
36
39
  this.#s = !0;
37
40
  try {
38
- let n = await this.#n.createFlow(e);
39
- return n && t == this.#i && this.#u("design", !1), n;
41
+ let r = await this.#n.createFlow(e, t);
42
+ return r && n == this.#i && this.#u("design", !1), r;
40
43
  } finally {
41
- t == this.#i && (this.#s = !1);
44
+ n == this.#i && (this.#s = !1);
42
45
  }
43
46
  }
44
47
  async createSubflow(e) {
@@ -63,7 +66,7 @@ var ce = class {
63
66
  this.#s = !0, await this.#n.selectFlow(void 0), e == this.#i && (this.#u("design", !1), this.#s = !1);
64
67
  }
65
68
  async apply(e) {
66
- if (w(e, this.#t)) return;
69
+ if (Ke(e, this.#t)) return;
67
70
  this.#t = e;
68
71
  let t = ++this.#i;
69
72
  this.#s = !0;
@@ -79,15 +82,450 @@ var ce = class {
79
82
  flowId: this.#n.workspace.$.flowId.value,
80
83
  view: e
81
84
  };
82
- w(n, this.#t) || (this.#t = n, this.#e(n, { replace: t })), this.#r.set(e);
85
+ Ke(n, this.#t) || (this.#t = n, this.#e(n, { replace: t })), this.#r.set(e);
83
86
  }
84
87
  };
85
- function w(e, t) {
88
+ function Ke(e, t) {
86
89
  return e.flowId == t.flowId && e.view == t.view;
87
90
  }
88
91
  //#endregion
89
- //#region src/workbench/browser/runtime/publications/publicationStore.ts
90
- var T = {
92
+ //#region src/workbench/browser/runtime/shell/resourceBrowser.tsx
93
+ var qe = He(() => import("./createResourceDialog-DXQz0thK.js")), Je = Le.map((e) => ({
94
+ label: Re[e],
95
+ value: e
96
+ }));
97
+ function Ye({ language: e, onLanguageChange: t }) {
98
+ let n = r(), [i, a] = B(null);
99
+ return t == null ? null : /* @__PURE__ */ H("div", {
100
+ className: "resource-language",
101
+ ref: a,
102
+ children: [/* @__PURE__ */ V("span", {
103
+ className: "sr-only",
104
+ children: n("language.label")
105
+ }), /* @__PURE__ */ V(Ie, {
106
+ ariaLabel: n("language.label"),
107
+ onValueChange: (e) => t(e),
108
+ options: Je,
109
+ portalRoot: i,
110
+ value: e
111
+ })]
112
+ });
113
+ }
114
+ function Xe({ badge: e, busy: t, flow: n, href: a, onSelect: o, store: s }) {
115
+ let l = i(), u = r(), [d, m] = B("idle"), [h, y] = B(n.name), b = v(h);
116
+ async function x(e) {
117
+ e.preventDefault();
118
+ let t = h.trim();
119
+ v(t) == null && await s.workspace.renameFlow(n.flowId, t) && m("idle");
120
+ }
121
+ async function S() {
122
+ await s.workspace.deleteFlow(n.flowId) && m("idle");
123
+ }
124
+ return /* @__PURE__ */ H("div", {
125
+ className: "resource-item-row",
126
+ children: [
127
+ /* @__PURE__ */ H(p, {
128
+ "aria-disabled": n.status == "retiring",
129
+ className: "resource-list-row flow-columns",
130
+ nativeButton: !1,
131
+ onClick: (e) => {
132
+ if (n.status == "retiring") {
133
+ e.preventDefault();
134
+ return;
135
+ }
136
+ C(e, () => o(n));
137
+ },
138
+ render: /* @__PURE__ */ V("a", { href: n.status == "retiring" ? void 0 : a }),
139
+ tabIndex: n.status == "retiring" ? -1 : void 0,
140
+ variant: "ghost",
141
+ children: [
142
+ /* @__PURE__ */ H("span", {
143
+ className: "resource-primary-cell",
144
+ children: [/* @__PURE__ */ V("span", {
145
+ className: "resource-icon",
146
+ children: /* @__PURE__ */ V(f, { name: "flow" })
147
+ }), /* @__PURE__ */ H("span", { children: [/* @__PURE__ */ H("span", {
148
+ className: "flex min-w-0 items-center gap-2",
149
+ children: [/* @__PURE__ */ V("strong", {
150
+ className: "min-w-0 truncate",
151
+ children: n.name
152
+ }), e != null && /* @__PURE__ */ V(ce, {
153
+ className: "min-w-0 shrink",
154
+ title: e,
155
+ variant: "secondary",
156
+ children: /* @__PURE__ */ V("span", {
157
+ className: "truncate",
158
+ children: e
159
+ })
160
+ })]
161
+ }), /* @__PURE__ */ V("code", {
162
+ translate: "no",
163
+ children: n.flowId
164
+ })] })]
165
+ }),
166
+ /* @__PURE__ */ V("time", {
167
+ dateTime: n.updatedAt,
168
+ children: new Date(n.updatedAt).toLocaleString(l)
169
+ }),
170
+ /* @__PURE__ */ H("span", {
171
+ className: `resource-status ${n.status == "active" ? "active" : "warning"}`,
172
+ children: [/* @__PURE__ */ V("span", {
173
+ "aria-hidden": "true",
174
+ className: `status-dot ${n.status == "active" ? "success" : "running"}`
175
+ }), u(n.status == "active" ? "resource.active" : "resource.retiring")]
176
+ })
177
+ ]
178
+ }),
179
+ n.status == "active" && /* @__PURE__ */ V(p, {
180
+ "aria-expanded": d != "idle",
181
+ "aria-label": u("sidebar.flowActions", { name: n.name }),
182
+ className: _("resource-row-more", d != "idle" && "active"),
183
+ disabled: t != null,
184
+ onClick: () => m(d == "idle" ? "actions" : "idle"),
185
+ size: "icon-sm",
186
+ variant: "ghost",
187
+ children: /* @__PURE__ */ V(f, { name: "more" })
188
+ }),
189
+ d == "actions" && /* @__PURE__ */ H("div", {
190
+ className: "resource-row-actions",
191
+ children: [/* @__PURE__ */ V(p, {
192
+ onClick: () => {
193
+ y(n.name), m("rename");
194
+ },
195
+ size: "sm",
196
+ variant: "outline",
197
+ children: u("common.rename")
198
+ }), /* @__PURE__ */ V(p, {
199
+ onClick: () => m("delete"),
200
+ size: "sm",
201
+ variant: "destructive",
202
+ children: u("common.delete")
203
+ })]
204
+ }),
205
+ d == "rename" && /* @__PURE__ */ H("form", {
206
+ className: "resource-row-form",
207
+ onSubmit: (e) => void x(e),
208
+ children: [
209
+ /* @__PURE__ */ V(g, {
210
+ htmlFor: `rename-flow-${n.flowId}`,
211
+ children: u("sidebar.renameFlow", { name: n.name })
212
+ }),
213
+ /* @__PURE__ */ H("span", {
214
+ className: "resource-row-field",
215
+ children: [/* @__PURE__ */ V(c, {
216
+ autoComplete: "off",
217
+ "aria-invalid": h.length > 0 && b != null,
218
+ autoFocus: !0,
219
+ id: `rename-flow-${n.flowId}`,
220
+ name: "flow-name",
221
+ onChange: (e) => y(e.target.value),
222
+ required: !0,
223
+ value: h
224
+ }), h.length > 0 && b != null && /* @__PURE__ */ V("small", {
225
+ className: "resource-name-message error",
226
+ children: u(`resource.nameIssue.${b}`, { max: 80 })
227
+ })]
228
+ }),
229
+ /* @__PURE__ */ H("div", { children: [/* @__PURE__ */ V(p, {
230
+ onClick: () => m("idle"),
231
+ size: "sm",
232
+ variant: "outline",
233
+ children: u("common.cancel")
234
+ }), /* @__PURE__ */ V(p, {
235
+ disabled: t != null || b != null,
236
+ size: "sm",
237
+ type: "submit",
238
+ children: u("common.save")
239
+ })] })
240
+ ]
241
+ }),
242
+ d == "delete" && /* @__PURE__ */ H("div", {
243
+ className: "resource-row-confirm",
244
+ role: "group",
245
+ "aria-label": u("sidebar.deleteFlow", { name: n.name }),
246
+ children: [/* @__PURE__ */ V("span", { children: /* @__PURE__ */ V("strong", { children: u("sidebar.deleteFlowConfirm", { name: n.name }) }) }), /* @__PURE__ */ H("div", { children: [/* @__PURE__ */ V(p, {
247
+ onClick: () => m("idle"),
248
+ size: "sm",
249
+ variant: "outline",
250
+ children: u("common.cancel")
251
+ }), /* @__PURE__ */ V(p, {
252
+ disabled: t != null,
253
+ onClick: () => void S(),
254
+ size: "sm",
255
+ variant: "destructive",
256
+ children: u(t == "flow" ? "common.deleting" : "common.delete")
257
+ })] })]
258
+ })
259
+ ]
260
+ });
261
+ }
262
+ function Ze() {
263
+ return /* @__PURE__ */ H("div", {
264
+ "aria-hidden": "true",
265
+ className: "resource-list-row resource-skeleton-row flow-columns",
266
+ children: [
267
+ /* @__PURE__ */ H("span", {
268
+ className: "resource-primary-cell",
269
+ children: [/* @__PURE__ */ V(L, { className: "size-8 shrink-0" }), /* @__PURE__ */ H("span", {
270
+ className: "resource-skeleton-copy",
271
+ children: [/* @__PURE__ */ V(L, { className: "h-3.5 w-36" }), /* @__PURE__ */ V(L, { className: "h-2.5 w-48 max-w-full" })]
272
+ })]
273
+ }),
274
+ /* @__PURE__ */ V(L, { className: "h-3 w-28" }),
275
+ /* @__PURE__ */ V(L, { className: "h-3 w-16" })
276
+ ]
277
+ });
278
+ }
279
+ function Qe({ createFlowDisabled: e, createFlowField: t, flowBadges: n, hrefForFlow: i, hostAction: o, hostTitle: s, language: c, onCreateFlow: l, onHostAction: u, onLanguageChange: d, onSelectFlow: m, store: h }) {
280
+ let g = r(), _ = a(h.workspace.$.busy), y = a(h.workspace.$.flowLoadFailed), x = a(h.workspace.$.flowLoadMoreFailed), S = a(h.workspace.$.flowLoading), C = a(h.workspace.$.flowLoadingMore), w = a(h.workspace.$.flowNextCursor), T = a(h.workspace.$.flows), E = a(h.workspace.$.flowTotal), [ne, D] = B(!1), [O, re] = B(""), [k, A] = B(""), j = O.trim().toLocaleLowerCase(), M = T.filter((e) => e.name.toLocaleLowerCase().includes(j));
281
+ async function se(e) {
282
+ e.preventDefault();
283
+ let t = k.trim();
284
+ v(t) != null || !await l(t) || (D(!1), A(""));
285
+ }
286
+ return /* @__PURE__ */ V("main", {
287
+ className: "resource-browser",
288
+ children: /* @__PURE__ */ H("div", {
289
+ className: "resource-page",
290
+ children: [
291
+ /* @__PURE__ */ H("header", {
292
+ className: "resource-page-header",
293
+ children: [/* @__PURE__ */ V("div", {
294
+ className: "resource-heading",
295
+ children: /* @__PURE__ */ V("h1", { children: g("resource.flows") })
296
+ }), /* @__PURE__ */ H("div", {
297
+ className: "resource-page-actions",
298
+ children: [
299
+ /* @__PURE__ */ V(Ye, {
300
+ language: c,
301
+ onLanguageChange: d
302
+ }),
303
+ /* @__PURE__ */ H(p, {
304
+ disabled: _ != null,
305
+ onClick: () => D(!0),
306
+ children: [/* @__PURE__ */ V(f, {
307
+ "data-icon": "inline-start",
308
+ name: "plus"
309
+ }), g("resource.newFlow")]
310
+ }),
311
+ o != null && s != null && u != null && /* @__PURE__ */ V(Oe, {
312
+ action: o,
313
+ onAction: u,
314
+ title: s
315
+ })
316
+ ]
317
+ })]
318
+ }),
319
+ /* @__PURE__ */ H("section", {
320
+ "aria-labelledby": "flow-list-title",
321
+ className: "resource-list-section",
322
+ children: [
323
+ /* @__PURE__ */ H("div", {
324
+ className: "resource-list-title",
325
+ children: [/* @__PURE__ */ H("div", {
326
+ className: "resource-list-heading",
327
+ children: [/* @__PURE__ */ V("h2", {
328
+ id: "flow-list-title",
329
+ children: g("resource.allFlows")
330
+ }), !S && /* @__PURE__ */ V("span", { children: g("resource.flowCount", { count: E ?? T.length }) })]
331
+ }), /* @__PURE__ */ H("div", {
332
+ className: "resource-list-actions",
333
+ children: [/* @__PURE__ */ H(ue, {
334
+ className: "w-full sm:w-56",
335
+ children: [/* @__PURE__ */ V(te, { children: /* @__PURE__ */ V(f, {
336
+ name: "search",
337
+ size: 17
338
+ }) }), /* @__PURE__ */ V(ee, {
339
+ autoComplete: "off",
340
+ "aria-label": g("resource.searchFlows"),
341
+ name: "flow-search",
342
+ onChange: (e) => re(e.target.value),
343
+ placeholder: g("resource.searchFlows"),
344
+ value: O
345
+ })]
346
+ }), /* @__PURE__ */ V(p, {
347
+ "aria-label": g("common.refresh"),
348
+ disabled: S || _ != null,
349
+ onClick: () => void h.workspace.reloadFlows(),
350
+ size: "icon",
351
+ title: g("common.refresh"),
352
+ variant: "outline",
353
+ children: /* @__PURE__ */ V(f, { name: "refresh" })
354
+ })]
355
+ })]
356
+ }),
357
+ /* @__PURE__ */ H("div", {
358
+ "aria-hidden": "true",
359
+ className: "resource-list-columns flow-columns",
360
+ children: [
361
+ /* @__PURE__ */ V("span", { children: g("resource.name") }),
362
+ /* @__PURE__ */ V("span", { children: g("resource.updated") }),
363
+ /* @__PURE__ */ V("span", { children: g("resource.status") })
364
+ ]
365
+ }),
366
+ /* @__PURE__ */ V("div", {
367
+ className: "resource-list",
368
+ children: S ? Array.from({ length: 5 }, (e, t) => /* @__PURE__ */ V(Ze, {}, t)) : y ? /* @__PURE__ */ H(oe, {
369
+ className: "min-h-64",
370
+ role: "alert",
371
+ children: [/* @__PURE__ */ H(Se, { children: [
372
+ /* @__PURE__ */ V(ie, {
373
+ variant: "icon",
374
+ children: /* @__PURE__ */ V(f, {
375
+ name: "alert",
376
+ size: 20
377
+ })
378
+ }),
379
+ /* @__PURE__ */ V(ae, { children: g("resource.flowsLoadFailed") }),
380
+ /* @__PURE__ */ V(b, { children: g("resource.flowsLoadFailedDescription") })
381
+ ] }), /* @__PURE__ */ V(Ce, { children: /* @__PURE__ */ V(p, {
382
+ onClick: () => void h.retryFlows(),
383
+ variant: "outline",
384
+ children: g("empty.retry")
385
+ }) })]
386
+ }) : M.length == 0 ? /* @__PURE__ */ H(oe, {
387
+ className: "min-h-64",
388
+ children: [/* @__PURE__ */ H(Se, { children: [
389
+ /* @__PURE__ */ V(ie, {
390
+ variant: "icon",
391
+ children: /* @__PURE__ */ V(f, {
392
+ name: "flow",
393
+ size: 20
394
+ })
395
+ }),
396
+ /* @__PURE__ */ V(ae, { children: g(j.length == 0 ? "resource.noFlows" : "resource.noMatchingFlows") }),
397
+ /* @__PURE__ */ V(b, { children: g(j.length == 0 ? "resource.noFlowsDescription" : "resource.noMatchingDescription") })
398
+ ] }), j.length == 0 && /* @__PURE__ */ V(Ce, { children: /* @__PURE__ */ H(p, {
399
+ onClick: () => D(!0),
400
+ variant: "outline",
401
+ children: [/* @__PURE__ */ V(f, {
402
+ "data-icon": "inline-start",
403
+ name: "plus"
404
+ }), g("resource.newFlow")]
405
+ }) })]
406
+ }) : M.map((e) => /* @__PURE__ */ V(Xe, {
407
+ badge: n?.[e.flowId],
408
+ busy: _,
409
+ flow: e,
410
+ href: i(e),
411
+ onSelect: m,
412
+ store: h
413
+ }, e.flowId))
414
+ }),
415
+ w != null && /* @__PURE__ */ V("div", {
416
+ className: "resource-list-footer",
417
+ children: /* @__PURE__ */ V(p, {
418
+ disabled: C,
419
+ onClick: () => void h.workspace.loadMoreFlows(),
420
+ variant: "outline",
421
+ children: g(C ? "resource.loadingMore" : x ? "resource.retryLoadMore" : "resource.loadMore")
422
+ })
423
+ })
424
+ ]
425
+ }),
426
+ ne && /* @__PURE__ */ V(Ve, {
427
+ fallback: null,
428
+ children: /* @__PURE__ */ V(qe, {
429
+ disabled: e,
430
+ field: t,
431
+ id: "flow-name",
432
+ issue: v(k),
433
+ label: g("resource.flowName"),
434
+ name: k,
435
+ onNameChange: A,
436
+ onOpenChange: D,
437
+ onSubmit: (e) => void se(e),
438
+ pending: _ == "flow",
439
+ title: g("resource.newFlow")
440
+ })
441
+ })
442
+ ]
443
+ })
444
+ });
445
+ }
446
+ //#endregion
447
+ //#region ../../node_modules/.bun/nanoid@6.0.1/node_modules/nanoid/index.browser.js
448
+ var $e = (e) => crypto.getRandomValues(new Uint8Array(e)), et = (e, t, n) => {
449
+ let r = 256 - 256 % e.length;
450
+ if (r === 256) {
451
+ let r = e.length - 1;
452
+ return (i = t) => {
453
+ if (!i) return "";
454
+ let a = "";
455
+ for (;;) {
456
+ let t = n(i), o = i;
457
+ for (; o--;) if (a += e[t[o] & r], a.length >= i) return a;
458
+ }
459
+ };
460
+ }
461
+ let i = Math.ceil(409.6 * t / r);
462
+ return (a = t) => {
463
+ if (!a) return "";
464
+ let o = "";
465
+ for (;;) {
466
+ let t = n(i), s = i;
467
+ for (; s--;) if (t[s] < r && (o += e[t[s] % e.length], o.length >= a)) return o;
468
+ }
469
+ };
470
+ }, tt = (e, t = 21) => et(e, t | 0, $e);
471
+ //#endregion
472
+ //#region src/flow/common/edgeChanges.ts
473
+ function nt(e, t, n) {
474
+ let r = {
475
+ source: n.source,
476
+ sourceHandle: n.sourceHandle,
477
+ target: n.target,
478
+ targetHandle: n.targetHandle
479
+ }, i = it(e, t)?.nodes[n.target], a = i != null && "inputs" in i ? i.inputs[n.targetHandle] : void 0;
480
+ return a?.kind == "sources" && a.sources.some((e) => e.kind == "node" && e.nodeId == n.source && e.output == n.sourceHandle) ? [] : fe(e, [{
481
+ edge: r,
482
+ kind: "graph.edge.connect",
483
+ target: t
484
+ }]);
485
+ }
486
+ function rt(e, t, n) {
487
+ let r = {
488
+ source: n.source,
489
+ sourceHandle: n.sourceHandle,
490
+ target: n.target,
491
+ targetHandle: n.targetHandle
492
+ }, i = it(e, t)?.nodes[n.target], a = i != null && "inputs" in i ? i.inputs[n.targetHandle] : void 0;
493
+ return a?.kind != "sources" || !a.sources.some((e) => e.kind == "node" && e.nodeId == n.source && e.output == n.sourceHandle) ? [] : [{
494
+ edge: r,
495
+ kind: "graph.edge.disconnect",
496
+ target: t
497
+ }];
498
+ }
499
+ function it(e, t) {
500
+ return t.kind == "flow" ? e.document.graph : e.document.subflows[t.id]?.graph;
501
+ }
502
+ //#endregion
503
+ //#region src/flow/common/moduleChanges.ts
504
+ async function at(e) {
505
+ try {
506
+ let { parse: t } = await import("./lib-C5Ipyfps.js").then((e) => e.t), n = t(e, {
507
+ errorRecovery: !0,
508
+ sourceType: "module"
509
+ }).program, r = /* @__PURE__ */ new Set();
510
+ for (let e of n.body) {
511
+ if (e.type != "ImportDeclaration") continue;
512
+ let t = /^\.\/(.+)\.mjs$/.exec(e.source.value);
513
+ t?.[1] != null && r.add(t[1]);
514
+ }
515
+ return [...r].toSorted();
516
+ } catch {
517
+ return [];
518
+ }
519
+ }
520
+ function ot(e, t, n) {
521
+ return [{
522
+ imports: n,
523
+ kind: "module.source.replace",
524
+ moduleId: e,
525
+ source: t
526
+ }];
527
+ }
528
+ var st = tt("23456789abcdefghjkmnpqrstuvwxyz", 10), U = {
91
529
  activities: [],
92
530
  activitiesLoadFailed: !1,
93
531
  activitiesLoading: !1,
@@ -100,11 +538,11 @@ var T = {
100
538
  loadingMore: !1,
101
539
  publications: [],
102
540
  publishing: !1
103
- }, le = 20, ue = 50;
104
- function E(e, t) {
541
+ }, ct = 20, lt = 50;
542
+ function W(e, t) {
105
543
  return e?.flowId == t.flowId;
106
544
  }
107
- var de = class {
545
+ var ut = class {
108
546
  #e;
109
547
  #t;
110
548
  #n;
@@ -113,10 +551,10 @@ var de = class {
113
551
  #a = new x();
114
552
  #o = new x();
115
553
  #s;
116
- #c = t(T);
554
+ #c = t(U);
117
555
  #l;
118
556
  #u;
119
- constructor(t, n, r, i = () => crypto.randomUUID(), a = l()) {
557
+ constructor(t, n, r, i = () => crypto.randomUUID(), a = E()) {
120
558
  this.#e = t, this.#t = i, this.#n = a, this.#s = r, this.#l = n, this.$ = {
121
559
  activities: e(this.#c, (e) => e.activities),
122
560
  activitiesLoadFailed: e(this.#c, (e) => e.activitiesLoadFailed),
@@ -148,12 +586,12 @@ var de = class {
148
586
  this.#c.dispose();
149
587
  }
150
588
  reset() {
151
- this.#r.invalidate(), this.#i.invalidate(), this.#a.invalidate(), this.#o.invalidate(), this.#u = void 0, this.#c.set(T);
589
+ this.#r.invalidate(), this.#i.invalidate(), this.#a.invalidate(), this.#o.invalidate(), this.#u = void 0, this.#c.set(U);
152
590
  }
153
591
  async load(e) {
154
592
  let t = { flowId: e }, n = this.#r.begin();
155
- E(this.#c.value.target, t) || (this.#u = void 0), this.#s(void 0), this.#c.set({
156
- ...T,
593
+ W(this.#c.value.target, t) || (this.#u = void 0), this.#s(void 0), this.#c.set({
594
+ ...U,
157
595
  loading: !0,
158
596
  target: t
159
597
  });
@@ -173,7 +611,7 @@ var de = class {
173
611
  this.#h({
174
612
  loadFailed: !0,
175
613
  loading: !1
176
- }), this.#s(u(e, this.#n.t));
614
+ }), this.#s(R(e, this.#n.t));
177
615
  }
178
616
  }
179
617
  async loadMore() {
@@ -187,7 +625,7 @@ var de = class {
187
625
  try {
188
626
  let e = await this.#e.listPublications(n.flowId, {
189
627
  cursor: t,
190
- limit: ue
628
+ limit: lt
191
629
  });
192
630
  if (!r()) return;
193
631
  let i = new Set(this.#c.value.publications.map((e) => e.publicationId));
@@ -202,7 +640,7 @@ var de = class {
202
640
  this.#h({
203
641
  loadMoreFailed: !0,
204
642
  loadingMore: !1
205
- }), this.#s(u(e, this.#n.t));
643
+ }), this.#s(R(e, this.#n.t));
206
644
  }
207
645
  }
208
646
  async publish() {
@@ -224,7 +662,7 @@ var de = class {
224
662
  message: this.#n.t("notice.published", { name: e.name })
225
663
  }), !0);
226
664
  } catch (e) {
227
- return o() ? (e instanceof s && e.code == "live.conflict" && await this.#f(n), this.#s(u(e, this.#n.t)), !1) : !1;
665
+ return o() ? (e instanceof P && e.code == "live.conflict" && await this.#f(n), this.#s(R(e, this.#n.t)), !1) : !1;
228
666
  } finally {
229
667
  o() && this.#h({ publishing: !1 });
230
668
  }
@@ -240,17 +678,17 @@ var de = class {
240
678
  }), o = this.#u?.signature == a ? this.#u : {
241
679
  key: this.#t(),
242
680
  signature: a
243
- }, c = this.#i.begin();
681
+ }, s = this.#i.begin();
244
682
  this.#u = o, this.#s(void 0), this.#h({ rollingBackPublicationId: e.publicationId });
245
683
  try {
246
- return await this.#e.rollbackFlow(r.flowId, e.publicationId, i, { idempotencyKey: o.key }), !c() || (await this.#d(r), !c()) ? !1 : (this.#u = void 0, this.#s({
684
+ return await this.#e.rollbackFlow(r.flowId, e.publicationId, i, { idempotencyKey: o.key }), !s() || (await this.#d(r), !s()) ? !1 : (this.#u = void 0, this.#s({
247
685
  kind: "success",
248
686
  message: this.#n.t("notice.rolledBack", { revision: e.revisionId })
249
687
  }), !0);
250
688
  } catch (e) {
251
- return c() ? (e instanceof s && e.code == "live.conflict" && await this.#f(r), this.#s(u(e, this.#n.t)), !1) : !1;
689
+ return s() ? (e instanceof P && e.code == "live.conflict" && await this.#f(r), this.#s(R(e, this.#n.t)), !1) : !1;
252
690
  } finally {
253
- c() && this.#h({ rollingBackPublicationId: void 0 });
691
+ s() && this.#h({ rollingBackPublicationId: void 0 });
254
692
  }
255
693
  }
256
694
  closeTrigger() {
@@ -283,13 +721,13 @@ var de = class {
283
721
  testingTriggerId: void 0,
284
722
  testResult: void 0
285
723
  });
286
- let [r, i] = await Promise.allSettled([this.#e.getFlowTriggerBinding(t.flowId, e), this.#e.listFlowTriggerActivities(t.flowId, e, { limit: le })]);
724
+ let [r, i] = await Promise.allSettled([this.#e.getFlowTriggerBinding(t.flowId, e), this.#e.listFlowTriggerActivities(t.flowId, e, { limit: ct })]);
287
725
  if (n()) {
288
726
  if (r.status == "rejected") {
289
727
  this.#h({
290
728
  activitiesLoading: !1,
291
729
  detailLoading: !1
292
- }), this.#s(u(r.reason, this.#n.t));
730
+ }), this.#s(R(r.reason, this.#n.t));
293
731
  return;
294
732
  }
295
733
  this.#h({
@@ -303,7 +741,7 @@ var de = class {
303
741
  }) : (this.#h({
304
742
  activitiesLoadFailed: !0,
305
743
  activitiesLoading: !1
306
- }), this.#s(u(i.reason, this.#n.t)));
744
+ }), this.#s(R(i.reason, this.#n.t)));
307
745
  }
308
746
  }
309
747
  async loadMoreTriggerActivities() {
@@ -317,7 +755,7 @@ var de = class {
317
755
  try {
318
756
  let e = await this.#e.listFlowTriggerActivities(r.flowId, n, {
319
757
  cursor: t,
320
- limit: le
758
+ limit: ct
321
759
  });
322
760
  if (!i() || this.#c.value.selectedTriggerId != n) return;
323
761
  let a = new Set(this.#c.value.activities.map((e) => e.activityId));
@@ -332,7 +770,7 @@ var de = class {
332
770
  this.#h({
333
771
  activitiesLoadFailed: !0,
334
772
  activitiesLoadingMore: !1
335
- }), this.#s(u(e, this.#n.t));
773
+ }), this.#s(R(e, this.#n.t));
336
774
  }
337
775
  }
338
776
  async testTrigger() {
@@ -347,7 +785,7 @@ var de = class {
347
785
  let e = await this.#e.testFlowPollTrigger(n.flowId, t);
348
786
  return !i() || this.#c.value.selectedTriggerId != t ? !1 : (this.#h({ testResult: e }), !0);
349
787
  } catch (e) {
350
- return i() && this.#c.value.selectedTriggerId == t && this.#s(u(e, this.#n.t)), !1;
788
+ return i() && this.#c.value.selectedTriggerId == t && this.#s(R(e, this.#n.t)), !1;
351
789
  } finally {
352
790
  i() && this.#c.value.selectedTriggerId == t && this.#h({ testingTriggerId: void 0 });
353
791
  }
@@ -365,14 +803,14 @@ var de = class {
365
803
  message: this.#n.t(e.operatorState == "active" ? "notice.triggerPaused" : "notice.triggerResumed")
366
804
  }), !0) : !1;
367
805
  } catch (e) {
368
- return n() && this.#s(u(e, this.#n.t)), !1;
806
+ return n() && this.#s(R(e, this.#n.t)), !1;
369
807
  } finally {
370
808
  n() && this.#h({ changingTriggerId: void 0 });
371
809
  }
372
810
  }
373
811
  async #d(e) {
374
812
  let [t, n, r] = await this.#p(e);
375
- this.#l.updateLive(t), await this.#l.refreshFlows(), E(this.#c.value.target, e) && this.#h({
813
+ this.#l.updateLive(t), await this.#l.refreshFlows(), W(this.#c.value.target, e) && this.#h({
376
814
  bindings: r,
377
815
  live: t,
378
816
  loadFailed: !1,
@@ -393,14 +831,14 @@ var de = class {
393
831
  this.#e.getLive(e.flowId),
394
832
  this.#e.listPublications(e.flowId, {
395
833
  includeTotal: !0,
396
- limit: ue
834
+ limit: lt
397
835
  }),
398
836
  this.#e.listFlowTriggerBindings(e.flowId)
399
837
  ]);
400
838
  }
401
839
  #m(e, t) {
402
- E(this.#c.value.target, e) ? this.#h(t) : this.#c.set({
403
- ...T,
840
+ W(this.#c.value.target, e) ? this.#h(t) : this.#c.set({
841
+ ...U,
404
842
  ...t,
405
843
  target: e
406
844
  });
@@ -411,24 +849,24 @@ var de = class {
411
849
  ...e
412
850
  });
413
851
  }
414
- }, fe = { starting: !1 };
415
- function pe(e) {
852
+ }, dt = { starting: !1 };
853
+ function ft(e) {
416
854
  switch (e.kind) {
417
855
  case "condition": return { [e.node.input.handle]: e.node.input };
418
- case "subflow": return o(e.definition?.inputs ?? []);
419
- case "task": return o(e.definition?.inputs ?? []);
856
+ case "subflow": return s(e.definition?.inputs ?? []);
857
+ case "task": return s(e.definition?.inputs ?? []);
420
858
  case "value": return {};
421
859
  }
422
860
  }
423
- function me(e) {
861
+ function pt(e) {
424
862
  return e.node.name == null ? e.kind == "task" || e.kind == "subflow" ? e.definition?.name ?? e.id : e.id : e.node.name;
425
863
  }
426
- async function he(e, t) {
427
- let { FlowRunInputEditorStore: n } = await import("./flowRunInputEditorStore-DXOyyY7o.js").then((e) => e.n), r = h(e), i = r.graph({ kind: "flow" });
864
+ async function mt(e, t) {
865
+ let { FlowRunInputEditorStore: n } = await import("./flowRunInputEditorStore-BeyUSWpO.js").then((e) => e.n), r = N(e), i = r.graph({ kind: "flow" });
428
866
  return i == null ? [] : Object.entries(i.nodes).toSorted(([e], [t]) => e.localeCompare(t)).flatMap(([e, i]) => {
429
867
  let a = r.resolveNode(e, i);
430
868
  if (a.kind == "trigger") return [];
431
- let o = Object.entries(pe(a)).filter(([e, t]) => a.node.inputs[e] == null && !Object.hasOwn(t, "value")).toSorted(([e], [t]) => e.localeCompare(t)).map(([e, t]) => Object.assign({
869
+ let o = Object.entries(ft(a)).filter(([e, t]) => a.node.inputs[e] == null && !Object.hasOwn(t, "value")).toSorted(([e], [t]) => e.localeCompare(t)).map(([e, t]) => Object.assign({
432
870
  handle: e,
433
871
  jsonSchema: t.jsonSchema,
434
872
  nullable: t.nullable
@@ -436,11 +874,11 @@ async function he(e, t) {
436
874
  return o.length == 0 ? [] : [{
437
875
  editor: new n(o, t),
438
876
  nodeId: e,
439
- title: me(a)
877
+ title: pt(a)
440
878
  }];
441
879
  });
442
880
  }
443
- var ge = class {
881
+ var ht = class {
444
882
  #e;
445
883
  #t;
446
884
  #n;
@@ -448,9 +886,9 @@ var ge = class {
448
886
  #i = new x();
449
887
  #a;
450
888
  #o;
451
- #s = t(fe);
889
+ #s = t(dt);
452
890
  #c;
453
- constructor(t, n, r, i = l(), a = () => crypto.randomUUID()) {
891
+ constructor(t, n, r, i = E(), a = () => crypto.randomUUID()) {
454
892
  this.#e = t, this.#a = n, this.#o = r, this.#n = i, this.#t = a, this.$ = {
455
893
  inputRequest: e(this.#s, (e) => e.inputRequest),
456
894
  starting: e(this.#s, (e) => e.starting),
@@ -465,7 +903,7 @@ var ge = class {
465
903
  reset() {
466
904
  this.#r.invalidate(), this.#i.invalidate(), this.#c = void 0;
467
905
  let e = this.#s.value.inputRequest;
468
- this.#s.set(fe), this.#d(e);
906
+ this.#s.set(dt), this.#d(e);
469
907
  }
470
908
  async requestDraft(e, t) {
471
909
  let n = this.#i.begin();
@@ -480,7 +918,7 @@ var ge = class {
480
918
  let r = await this.#e.getRevision(e.flowId, n.revisionId);
481
919
  return t() ? await this.#l("live", e, r, n.revisionId, t, n.publicationId) : "unavailable";
482
920
  } catch (e) {
483
- return t() && this.#o(u(e, this.#n.t)), "unavailable";
921
+ return t() && this.#o(R(e, this.#n.t)), "unavailable";
484
922
  } finally {
485
923
  t() && this.#f({ starting: !1 });
486
924
  }
@@ -504,11 +942,11 @@ var ge = class {
504
942
  this.#f({
505
943
  inputRequest: void 0,
506
944
  starting: !0,
507
- submitting: e
945
+ submitting: void 0
508
946
  }), this.#d(s);
509
947
  let c;
510
948
  try {
511
- c = await he(r, this.#n.lang$);
949
+ c = await mt(r, this.#n.lang$);
512
950
  } catch (e) {
513
951
  throw a() && this.#f({
514
952
  starting: !1,
@@ -564,7 +1002,7 @@ var ge = class {
564
1002
  });
565
1003
  return !a() || !o() ? !1 : (this.#c = void 0, this.#a.follow(s, o));
566
1004
  } catch (e) {
567
- return a() && o() && this.#o(u(e, this.#n.t)), !1;
1005
+ return a() && o() && this.#o(R(e, this.#n.t)), !1;
568
1006
  } finally {
569
1007
  a() && this.#f({
570
1008
  starting: !1,
@@ -584,18 +1022,18 @@ var ge = class {
584
1022
  ...e
585
1023
  });
586
1024
  }
587
- }, D = {
1025
+ }, gt = {
588
1026
  actions: {},
589
1027
  catalogs: {}
590
1028
  };
591
- function O(e) {
1029
+ function _t(e) {
592
1030
  return Object.entries(e).map(([e, t]) => ({
593
1031
  description: t.description,
594
1032
  handle: e,
595
1033
  jsonSchema: t.jsonSchema
596
1034
  }));
597
1035
  }
598
- function k(e, t) {
1036
+ function G(e, t) {
599
1037
  return {
600
1038
  connector: e,
601
1039
  description: e.defaultConnection == null ? t("addNode.connectorNeedsConnection", {
@@ -605,13 +1043,13 @@ function k(e, t) {
605
1043
  group: t("addNode.connectorActions"),
606
1044
  icon: e.icon ?? ":carbon:connection-signal:",
607
1045
  id: `connector:${e.actionId}`,
608
- inputs: O(e.inputs),
1046
+ inputs: _t(e.inputs),
609
1047
  kind: "connector",
610
1048
  label: e.name,
611
- outputs: O(e.outputs)
1049
+ outputs: _t(e.outputs)
612
1050
  };
613
1051
  }
614
- function _e(e, t) {
1052
+ function vt(e, t) {
615
1053
  let n = /* @__PURE__ */ new Map();
616
1054
  for (let t of e) {
617
1055
  let e = n.get(t.serviceId) ?? [];
@@ -619,7 +1057,7 @@ function _e(e, t) {
619
1057
  }
620
1058
  return [...n.values()].toSorted((e, t) => e[0].serviceName.localeCompare(t[0].serviceName)).map((e) => {
621
1059
  let n = e[0], r = e.map((e) => {
622
- let n = k(e, t);
1060
+ let n = G(e, t);
623
1061
  return {
624
1062
  description: n.description,
625
1063
  label: n.label,
@@ -640,7 +1078,7 @@ function _e(e, t) {
640
1078
  };
641
1079
  });
642
1080
  }
643
- function ve(e, t) {
1081
+ function yt(e, t) {
644
1082
  return {
645
1083
  choices: [],
646
1084
  description: t("addNode.connectorBrowseActions"),
@@ -654,7 +1092,7 @@ function ve(e, t) {
654
1092
  serviceId: e.serviceId
655
1093
  };
656
1094
  }
657
- function A(e) {
1095
+ function bt(e) {
658
1096
  if (e?.kind != "task" || e.node.task != null) return;
659
1097
  let t = e.definition;
660
1098
  if (!(t == null || !("executor" in t) || t.executor.kind != "connector")) return {
@@ -664,7 +1102,7 @@ function A(e) {
664
1102
  taskId: e.node.taskId
665
1103
  };
666
1104
  }
667
- var ye = class {
1105
+ var xt = class {
668
1106
  #e;
669
1107
  #t;
670
1108
  #n;
@@ -679,43 +1117,44 @@ var ye = class {
679
1117
  #d;
680
1118
  #f;
681
1119
  #p;
682
- constructor(r, i, a, o, s = l()) {
683
- this.#r = /* @__PURE__ */ new Map(), this.#i = /* @__PURE__ */ new Set(), this.#a = new x(), this.#l = t(D), this.#p = !1, this.browseAddNodeOptions = async (e) => {
684
- if (this.#p) return;
685
- let t = this.#u.$.flowId.value;
1120
+ #m;
1121
+ constructor(r, i, a, o, s = E()) {
1122
+ this.#r = /* @__PURE__ */ new Map(), this.#i = /* @__PURE__ */ new Set(), this.#a = new x(), this.#u = t(gt), this.#m = !1, this.browseAddNodeOptions = async (e) => {
1123
+ if (this.#m) return;
1124
+ let t = this.#d.$.flowId.value;
686
1125
  if (t == null) return;
687
- let n = this.#f ?? await this.#e.listConnectorProviders(e);
688
- if (!(e.aborted || this.#p || t != this.#u.$.flowId.value)) return this.#f = n, n.toSorted((e, t) => e.serviceName.localeCompare(t.serviceName)).map((e) => ve(e, this.#t.t));
1126
+ let n = this.#p ?? await this.#e.listConnectorProviders(e, t);
1127
+ if (!(e.aborted || this.#m || t != this.#d.$.flowId.value)) return this.#p = n, n.toSorted((e, t) => e.serviceName.localeCompare(t.serviceName)).map((e) => yt(e, this.#t.t));
689
1128
  }, this.provideAddNodeOptionChoices = async (e, t) => {
690
- if (this.#p) return;
691
- let n = this.#u.$.flowId.value, r = this.#f?.find((t) => `connector-provider:${t.serviceId}` == e);
1129
+ if (this.#m) return;
1130
+ let n = this.#d.$.flowId.value, r = this.#p?.find((t) => `connector-provider:${t.serviceId}` == e);
692
1131
  if (n == null || r == null) return;
693
- let i = this.#r.get(r.serviceId) ?? await this.#e.listConnectorActions(r.serviceId, t);
694
- if (t.aborted || this.#p || n != this.#u.$.flowId.value) return;
1132
+ let i = this.#r.get(r.serviceId) ?? await this.#e.listConnectorActions(r.serviceId, t, n);
1133
+ if (t.aborted || this.#m || n != this.#d.$.flowId.value) return;
695
1134
  let a = i.map((e) => Object.assign({}, e, e.icon == null && r.icon != null ? { icon: r.icon } : {}, { serviceName: r.serviceName }));
696
- return this.#r.set(r.serviceId, a), this.#v({ actions: {
697
- ...this.#l.value.actions,
1135
+ return this.#r.set(r.serviceId, a), this.#y({ actions: {
1136
+ ...this.#u.value.actions,
698
1137
  ...Object.fromEntries(a.map((e) => [e.actionId, e]))
699
- } }), a.map((e) => k(e, this.#t.t));
1138
+ } }), a.map((e) => G(e, this.#t.t));
700
1139
  }, this.provideAddNodeOptions = async (e, t) => {
701
- if (this.#p) return;
702
- let n = this.#u.$.flowId.value;
1140
+ if (this.#m) return;
1141
+ let n = this.#d.$.flowId.value;
703
1142
  if (n == null) return;
704
- let r = e.trim(), i = r.length == 0 ? Object.values(this.#l.value.actions) : await this.#e.searchConnectorActions(r, t);
705
- if (t.aborted || this.#p || n != this.#u.$.flowId.value) return;
706
- let a = { ...this.#l.value.actions };
1143
+ let r = e.trim(), i = r.length == 0 ? Object.values(this.#u.value.actions) : await this.#e.searchConnectorActions(r, t, n);
1144
+ if (t.aborted || this.#m || n != this.#d.$.flowId.value) return;
1145
+ let a = { ...this.#u.value.actions };
707
1146
  for (let e of i) a[e.actionId] = e;
708
- if (this.#v({ actions: a }), r.length != 0) return i.map((e) => k(e, this.#t.t));
1147
+ if (this.#y({ actions: a }), r.length != 0) return i.map((e) => G(e, this.#t.t));
709
1148
  let o = new Map(i.map((e) => [e.actionId, e]));
710
- for (let e of this.#u.$.revision.value?.connectorActionIds ?? []) {
1149
+ for (let e of this.#d.$.revision.value?.connectorActionIds ?? []) {
711
1150
  let t = a[e];
712
1151
  t != null && o.set(e, t);
713
1152
  }
714
- return _e([...o.values()], this.#t.t);
715
- }, this.#e = r, this.#n = o, this.#u = i, this.#c = a, this.#t = s;
716
- let c = e(this.#l, (e) => e.actions), u = e(this.#l, (e) => e.catalogs);
717
- this.#s = n((e) => {
718
- let t = A(e(i.$.selection)), n = e(this.#l);
1153
+ return vt([...o.values()], this.#t.t);
1154
+ }, this.#e = r, this.#n = o, this.#d = i, this.#l = a, this.#t = s;
1155
+ let c = e(this.#u, (e) => e.actions), l = e(this.#u, (e) => e.catalogs);
1156
+ this.#c = n((e) => {
1157
+ let t = bt(e(i.$.selection)), n = e(this.#u);
719
1158
  if (t == null) return { authorizationPending: !1 };
720
1159
  let r = n.actions[t.actionId], a = r == null ? void 0 : n.catalogs[r.serviceId], o = t.connectionId == null ? void 0 : a?.byId.get(t.connectionId);
721
1160
  return o == null && r?.defaultConnection?.connectionId == t.connectionId && (o = r.defaultConnection), {
@@ -727,148 +1166,148 @@ var ye = class {
727
1166
  connectionError: r != null && n.connectionError?.serviceId == r.serviceId ? n.connectionError.message : void 0
728
1167
  };
729
1168
  }), this.$ = {
730
- actionLoading: e(this.#l, (e) => e.actionLoading),
1169
+ actionLoading: e(this.#u, (e) => e.actionLoading),
731
1170
  actions: c,
732
- catalogs: u,
733
- connectionLoading: e(this.#l, (e) => e.connectionLoading),
734
- selectedAction: e(this.#s, (e) => e.action),
735
- selectedActionError: e(this.#s, (e) => e.actionError),
736
- selectedActiveConnections: e(this.#s, (e) => e.activeConnections),
737
- selectedAuthorizationPending: e(this.#s, (e) => e.authorizationPending),
738
- selectedConnection: e(this.#s, (e) => e.connection),
739
- selectedConnectionError: e(this.#s, (e) => e.connectionError)
740
- }, this.#o = i.$.revision.reaction(() => void this.#b());
1171
+ catalogs: l,
1172
+ connectionLoading: e(this.#u, (e) => e.connectionLoading),
1173
+ selectedAction: e(this.#c, (e) => e.action),
1174
+ selectedActionError: e(this.#c, (e) => e.actionError),
1175
+ selectedActiveConnections: e(this.#c, (e) => e.activeConnections),
1176
+ selectedAuthorizationPending: e(this.#c, (e) => e.authorizationPending),
1177
+ selectedConnection: e(this.#c, (e) => e.connection),
1178
+ selectedConnectionError: e(this.#c, (e) => e.connectionError)
1179
+ }, this.#o = i.$.flowId.reaction(() => this.reset()), this.#s = i.$.revision.reaction(() => void this.#x());
741
1180
  }
742
1181
  dispose() {
743
- this.#p = !0, this.#a.invalidate(), this.#o();
1182
+ this.#m = !0, this.#a.invalidate(), this.#o(), this.#s();
744
1183
  for (let e of Object.values(this.$)) e.dispose();
745
- this.#s.dispose(), this.#l.dispose();
1184
+ this.#c.dispose(), this.#u.dispose();
746
1185
  }
747
1186
  reset() {
748
- this.#p || (this.#a.invalidate(), this.#d = void 0, this.#r.clear(), this.#f = void 0, this.#i.clear(), this.#l.set(D));
1187
+ this.#m || (this.#a.invalidate(), this.#f = void 0, this.#r.clear(), this.#p = void 0, this.#i.clear(), this.#u.set(gt));
749
1188
  }
750
1189
  async refresh(e = !1) {
751
- if (this.#p) return;
752
- let t = this.#a.begin(), n = this.#u.$.flowId.value, r = A(this.#u.$.selection.value);
1190
+ if (this.#m) return;
1191
+ let t = this.#a.begin(), n = this.#d.$.flowId.value, r = bt(this.#d.$.selection.value);
753
1192
  if (n == null || r == null) {
754
- (this.#l.value.actionLoading != null || this.#l.value.connectionLoading != null) && this.#v({
1193
+ (this.#u.value.actionLoading != null || this.#u.value.connectionLoading != null) && this.#y({
755
1194
  actionLoading: void 0,
756
1195
  connectionLoading: void 0
757
1196
  });
758
1197
  return;
759
1198
  }
760
- this.#v({
1199
+ this.#y({
761
1200
  actionError: void 0,
762
1201
  actionLoading: r.actionId,
763
1202
  connectionError: void 0,
764
1203
  connectionLoading: void 0
765
1204
  });
766
1205
  try {
767
- let i = await this.#m(r.actionId, e);
768
- if (!this.#y(t, n)) return;
769
- this.#v({ actions: {
770
- ...this.#l.value.actions,
1206
+ let i = await this.#h(r.actionId, e);
1207
+ if (!this.#b(t, n)) return;
1208
+ this.#y({ actions: {
1209
+ ...this.#u.value.actions,
771
1210
  [i.actionId]: i
772
- } }), await this.#h(n, r, i.serviceId, e, t);
1211
+ } }), await this.#g(n, r, i.serviceId, e, t);
773
1212
  } catch (e) {
774
- this.#y(t, n) && this.#v({ actionError: {
1213
+ this.#b(t, n) && this.#y({ actionError: {
775
1214
  actionId: r.actionId,
776
- message: u(e, this.#t.t).message
1215
+ message: R(e, this.#t.t).message
777
1216
  } });
778
1217
  } finally {
779
- this.#y(t, n) && this.#l.value.actionLoading == r.actionId && this.#v({ actionLoading: void 0 });
1218
+ this.#b(t, n) && this.#u.value.actionLoading == r.actionId && this.#y({ actionLoading: void 0 });
780
1219
  }
781
1220
  }
782
1221
  async connect(e) {
783
- if (this.#p) return;
784
- let t = this.#u.$.flowId.value;
1222
+ if (this.#m) return;
1223
+ let t = this.#d.$.flowId.value;
785
1224
  if (t == null) return;
786
- let n = this.#l.value.catalogs[e];
1225
+ let n = this.#u.value.catalogs[e];
787
1226
  try {
788
- if (!await this.#n.openExternalPage(() => this.#e.createConnectorConnectionPage(e))) {
789
- this.#c({
1227
+ if (!await this.#n.openExternalPage(() => this.#e.createConnectorConnectionPage(e, t))) {
1228
+ this.#l({
790
1229
  kind: "error",
791
1230
  message: this.#t.t("notice.connectionPopupBlocked")
792
1231
  });
793
1232
  return;
794
1233
  }
795
- if (this.#p || t != this.#u.$.flowId.value) return;
796
- this.#d = {
1234
+ if (this.#m || t != this.#d.$.flowId.value) return;
1235
+ this.#f = {
797
1236
  connectionIds: new Set(n?.all.map((e) => e.connectionId)),
798
1237
  serviceId: e
799
- }, this.#v({ authorizationServiceId: e });
1238
+ }, this.#y({ authorizationServiceId: e });
800
1239
  } catch (e) {
801
- this.#p || this.#c(u(e, this.#t.t));
1240
+ this.#m || this.#l(R(e, this.#t.t));
802
1241
  }
803
1242
  }
804
1243
  async setConnection(e, t) {
805
- return await this.#u.setConnectorConnection(e, t);
1244
+ return await this.#d.setConnectorConnection(e, t);
806
1245
  }
807
1246
  async refreshAfterAuthorization() {
808
- if (this.#p || this.#d == null) return;
809
- let e = this.#d.serviceId;
810
- this.#r.delete(e), this.#v({ authorizationServiceId: void 0 }), this.$.selectedAction.value?.serviceId == e && await this.refresh(!0), !this.#p && this.#d?.serviceId == e && (this.#d = void 0);
1247
+ if (this.#m || this.#f == null) return;
1248
+ let e = this.#f.serviceId;
1249
+ this.#r.delete(e), this.#y({ authorizationServiceId: void 0 }), this.$.selectedAction.value?.serviceId == e && await this.refresh(!0), !this.#m && this.#f?.serviceId == e && (this.#f = void 0);
811
1250
  }
812
- async #m(e, t) {
813
- let n = this.#l.value.actions[e];
814
- return !t && n != null ? n : await this.#e.getConnectorAction(e);
1251
+ async #h(e, t) {
1252
+ let n = this.#u.value.actions[e];
1253
+ return !t && n != null ? n : await this.#e.getConnectorAction(e, void 0, this.#d.$.flowId.value);
815
1254
  }
816
- async #h(e, t, n, r, i) {
817
- this.#v({ connectionLoading: n });
1255
+ async #g(e, t, n, r, i) {
1256
+ this.#y({ connectionLoading: n });
818
1257
  try {
819
- let a = await this.#g(e, n, r, i);
820
- if (a == null || !this.#y(i, e)) return;
821
- await this.#_(t, n, a);
1258
+ let a = await this.#_(e, n, r, i);
1259
+ if (a == null || !this.#b(i, e)) return;
1260
+ await this.#v(t, n, a);
822
1261
  } finally {
823
- this.#y(i, e) && this.#l.value.connectionLoading == n && this.#v({ connectionLoading: void 0 });
1262
+ this.#b(i, e) && this.#u.value.connectionLoading == n && this.#y({ connectionLoading: void 0 });
824
1263
  }
825
1264
  }
826
- async #g(e, t, n, r) {
827
- let i = this.#l.value.catalogs[t];
1265
+ async #_(e, t, n, r) {
1266
+ let i = this.#u.value.catalogs[t];
828
1267
  if (!n && i != null) return i;
829
1268
  let a;
830
1269
  try {
831
- a = await this.#e.listConnectorConnections(t);
1270
+ a = await this.#e.listConnectorConnections(t, void 0, e);
832
1271
  } catch (n) {
833
- this.#y(r, e) && this.#v({ connectionError: {
834
- message: u(n, this.#t.t).message,
1272
+ this.#b(r, e) && this.#y({ connectionError: {
1273
+ message: R(n, this.#t.t).message,
835
1274
  serviceId: t
836
1275
  } });
837
1276
  return;
838
1277
  }
839
- if (!this.#y(r, e)) return;
840
- let o = d(a);
841
- return this.#v({ catalogs: {
842
- ...this.#l.value.catalogs,
1278
+ if (!this.#b(r, e)) return;
1279
+ let o = w(a);
1280
+ return this.#y({ catalogs: {
1281
+ ...this.#u.value.catalogs,
843
1282
  [t]: o
844
1283
  } }), o;
845
1284
  }
846
- async #_(e, t, n) {
847
- let r = this.#d?.serviceId == t ? this.#d : void 0, i = r == null ? [] : n.active.filter((e) => !r.connectionIds.has(e.connectionId)), a = i.length == 1 ? i[0] : n.preferred, o = this.#u.$.revision.value?.task(e.taskId);
848
- a != null && this.#u.$.selectedNodeIds.value.includes(e.nodeId) && o != null && "executor" in o && o.executor.kind == "connector" && o.executor.connectionId == null && await this.#u.setConnectorConnection(e.taskId, a.connectionId);
1285
+ async #v(e, t, n) {
1286
+ let r = this.#f?.serviceId == t ? this.#f : void 0, i = r == null ? [] : n.active.filter((e) => !r.connectionIds.has(e.connectionId)), a = i.length == 1 ? i[0] : n.preferred, o = this.#d.$.revision.value?.task(e.taskId);
1287
+ a != null && this.#d.$.selectedNodeIds.value.includes(e.nodeId) && o != null && "executor" in o && o.executor.kind == "connector" && o.executor.connectionId == null && await this.#d.setConnectorConnection(e.taskId, a.connectionId);
849
1288
  }
850
- #v(e) {
851
- this.#p || this.#l.set({
852
- ...this.#l.value,
1289
+ #y(e) {
1290
+ this.#m || this.#u.set({
1291
+ ...this.#u.value,
853
1292
  ...e
854
1293
  });
855
1294
  }
856
- #y(e, t) {
857
- return !this.#p && e() && t == this.#u.$.flowId.value;
1295
+ #b(e, t) {
1296
+ return !this.#m && e() && t == this.#d.$.flowId.value;
858
1297
  }
859
- async #b() {
860
- if (this.#p) return;
861
- let e = this.#a.capture(), t = this.#u.$.flowId.value, n = this.#u.$.revision.value;
1298
+ async #x() {
1299
+ if (this.#m) return;
1300
+ let e = this.#a.capture(), t = this.#d.$.flowId.value, n = this.#d.$.revision.value;
862
1301
  if (t == null || n == null) return;
863
- let r = [...n.connectorActionIds].filter((e) => this.#l.value.actions[e] == null && !this.#i.has(e));
1302
+ let r = [...n.connectorActionIds].filter((e) => this.#u.value.actions[e] == null && !this.#i.has(e));
864
1303
  if (r.length != 0) {
865
1304
  for (let e of r) this.#i.add(e);
866
1305
  try {
867
- let n = await Promise.all(r.map((e) => this.#e.getConnectorAction(e)));
868
- if (!this.#y(e, t)) return;
869
- let i = { ...this.#l.value.actions };
1306
+ let n = await Promise.all(r.map((e) => this.#e.getConnectorAction(e, void 0, t)));
1307
+ if (!this.#b(e, t)) return;
1308
+ let i = { ...this.#u.value.actions };
870
1309
  for (let e of n) i[e.actionId] = e;
871
- this.#v({ actions: i });
1310
+ this.#y({ actions: i });
872
1311
  } catch {
873
1312
  return;
874
1313
  } finally {
@@ -876,8 +1315,8 @@ var ye = class {
876
1315
  }
877
1316
  }
878
1317
  }
879
- }, j = { catalogs: {} }, M = 4, N = "trigger:";
880
- function P(e, t) {
1318
+ }, St = { catalogs: {} }, Ct = 4, K = "trigger:";
1319
+ function q(e, t) {
881
1320
  if (e?.kind != "trigger") return;
882
1321
  let n = e.trigger;
883
1322
  if (n.kind != "poll" && n.kind != "integration") return;
@@ -888,7 +1327,7 @@ function P(e, t) {
888
1327
  triggerId: e.id
889
1328
  };
890
1329
  }
891
- function F(e, t, n, r) {
1330
+ function J(e, t, n, r) {
892
1331
  return {
893
1332
  description: n,
894
1333
  group: r,
@@ -907,24 +1346,24 @@ function F(e, t, n, r) {
907
1346
  }
908
1347
  };
909
1348
  }
910
- function I(e, t) {
1349
+ function wt(e, t) {
911
1350
  return {
912
1351
  choices: [],
913
1352
  description: t.t("addNode.triggerChooseConnection"),
914
1353
  group: t.t("addNode.triggers"),
915
- id: `${N}${e.key}`,
1354
+ id: `${K}${e.key}`,
916
1355
  inputs: [],
917
1356
  kind: "trigger",
918
1357
  label: e.displayName,
919
1358
  outputs: []
920
1359
  };
921
1360
  }
922
- function L(e, t, n) {
1361
+ function Tt(e, t, n) {
923
1362
  let r = n.t("addNode.triggers"), i = t.preferred;
924
- return i == null ? t.active.length > 0 ? t.active.map((t) => F(e, t.connectionId, t.displayName, r)) : [{
1363
+ return i == null ? t.active.length > 0 ? t.active.map((t) => J(e, t.connectionId, t.displayName, r)) : [{
925
1364
  description: n.t("addNode.triggerNeedsConnection", { provider: e.provider }),
926
1365
  group: r,
927
- id: `${N}${e.key}:connect`,
1366
+ id: `${K}${e.key}:connect`,
928
1367
  inputs: [],
929
1368
  kind: "trigger",
930
1369
  label: n.t("addNode.triggerAddConnection"),
@@ -933,12 +1372,12 @@ function L(e, t, n) {
933
1372
  kind: "connect",
934
1373
  provider: e.provider
935
1374
  }
936
- }] : [F(e, i.connectionId, i.displayName, r)];
1375
+ }] : [J(e, i.connectionId, i.displayName, r)];
937
1376
  }
938
- function be(e, t, n) {
1377
+ function Et(e, t, n) {
939
1378
  let r = t.preferred;
940
- if (r != null) return F(e, r.connectionId, r.displayName, n.t("addNode.triggers"));
941
- let i = I(e, n), a = L(e, t, n);
1379
+ if (r != null) return J(e, r.connectionId, r.displayName, n.t("addNode.triggers"));
1380
+ let i = wt(e, n), a = Tt(e, t, n);
942
1381
  return {
943
1382
  ...i,
944
1383
  description: t.active.length == 0 ? n.t("addNode.triggerNeedsConnection", { provider: e.provider }) : i.description,
@@ -953,7 +1392,7 @@ function be(e, t, n) {
953
1392
  }))
954
1393
  };
955
1394
  }
956
- var xe = class {
1395
+ var Dt = class {
957
1396
  #e;
958
1397
  #t;
959
1398
  #n;
@@ -965,12 +1404,12 @@ var xe = class {
965
1404
  #c;
966
1405
  #l;
967
1406
  #u;
968
- constructor(r, i, a, o, s = l()) {
969
- this.#t = new AbortController(), this.#a = new x(), this.#c = t(j), this.#u = !1, this.browseAddNodeOptions = async (e) => {
1407
+ constructor(r, i, a, o, s = E()) {
1408
+ this.#t = new AbortController(), this.#a = new x(), this.#c = t(St), this.#u = !1, this.browseAddNodeOptions = async (e) => {
970
1409
  let t = this.#l.$.flowId.value;
971
1410
  if (e.aborted || this.#u || t == null || this.#l.$.target.value?.kind != "flow") return [];
972
1411
  let n = await this.#d();
973
- if (!(e.aborted || this.#u || t != this.#l.$.flowId.value)) return [...n.values()].map((e) => I(e, this.#i));
1412
+ if (!(e.aborted || this.#u || t != this.#l.$.flowId.value)) return [...n.values()].map((e) => wt(e, this.#i));
974
1413
  }, this.provideAddNodeOptions = async (e, t) => {
975
1414
  let n = this.#l.$.flowId.value;
976
1415
  if (t.aborted || this.#u || n == null || this.#l.$.target.value?.kind != "flow") return [];
@@ -986,31 +1425,31 @@ var xe = class {
986
1425
  e.provider,
987
1426
  e.type
988
1427
  ].some((e) => e.toLowerCase().includes(r))), o = [...new Set(a.map((e) => e.provider))].filter((e) => this.#c.value.catalogs[e] == null);
989
- for (let e = 0; e < o.length; e += M) {
990
- let r = await Promise.all(o.slice(e, e + M).map(async (e) => [e, d(await this.#n.listConnectorConnections(e, t))]));
1428
+ for (let e = 0; e < o.length; e += Ct) {
1429
+ let r = await Promise.all(o.slice(e, e + Ct).map(async (e) => [e, w(await this.#n.listConnectorConnections(e, t, n))]));
991
1430
  if (t.aborted || this.#u || n != this.#l.$.flowId.value) return;
992
1431
  this.#f({ catalogs: {
993
1432
  ...this.#c.value.catalogs,
994
1433
  ...Object.fromEntries(r)
995
1434
  } });
996
1435
  }
997
- return a.map((e) => be(e, this.#c.value.catalogs[e.provider], this.#i));
1436
+ return a.map((e) => Et(e, this.#c.value.catalogs[e.provider], this.#i));
998
1437
  }, this.provideAddNodeOptionChoices = async (e, t) => {
999
- let n = this.#l.$.flowId.value, r = e.startsWith(N) ? e.slice(8) : void 0;
1438
+ let n = this.#l.$.flowId.value, r = e.startsWith(K) ? e.slice(8) : void 0;
1000
1439
  if (t.aborted || this.#u || n == null || r == null || this.#l.$.target.value?.kind != "flow") return;
1001
1440
  let i = (await this.#d()).get(r);
1002
1441
  if (t.aborted || this.#u || n != this.#l.$.flowId.value || i == null) return;
1003
1442
  let a = this.#c.value.catalogs[i.provider];
1004
1443
  if (a == null) {
1005
- if (a = d(await this.#n.listConnectorConnections(i.provider, t)), t.aborted || this.#u || n != this.#l.$.flowId.value) return;
1444
+ if (a = w(await this.#n.listConnectorConnections(i.provider, t, n)), t.aborted || this.#u || n != this.#l.$.flowId.value) return;
1006
1445
  this.#f({ catalogs: {
1007
1446
  ...this.#c.value.catalogs,
1008
1447
  [i.provider]: a
1009
1448
  } });
1010
1449
  }
1011
- return L(i, a, this.#i);
1450
+ return Tt(i, a, this.#i);
1012
1451
  }, this.#n = r, this.#r = o, this.#i = s, this.#s = a, this.#l = i, this.#o = n((e) => {
1013
- let t = e(i.$.selection), n = P(t, i), r = e(this.#c);
1452
+ let t = e(i.$.selection), n = q(t, i), r = e(this.#c);
1014
1453
  if (t?.kind != "trigger") return { authorizationPending: !1 };
1015
1454
  let a = t.trigger;
1016
1455
  if (a.kind != "poll" && a.kind != "integration") return { authorizationPending: !1 };
@@ -1037,10 +1476,10 @@ var xe = class {
1037
1476
  this.#o.dispose(), this.#c.dispose();
1038
1477
  }
1039
1478
  reset() {
1040
- this.#u || (this.#t.abort(), this.#t = new AbortController(), this.#e = void 0, this.#a.invalidate(), this.#c.set(j));
1479
+ this.#u || (this.#t.abort(), this.#t = new AbortController(), this.#e = void 0, this.#a.invalidate(), this.#c.set(St));
1041
1480
  }
1042
1481
  async refresh(e = !1) {
1043
- let t = this.#a.begin(), n = this.#l.$.flowId.value, r = P(this.#l.$.selection.value, this.#l);
1482
+ let t = this.#a.begin(), n = this.#l.$.flowId.value, r = q(this.#l.$.selection.value, this.#l);
1044
1483
  if (!this.#u) {
1045
1484
  if (n == null || r == null) {
1046
1485
  this.#c.value.connectionLoading != null && this.#f({ connectionLoading: void 0 });
@@ -1052,7 +1491,7 @@ var xe = class {
1052
1491
  connectionLoading: r.provider
1053
1492
  });
1054
1493
  try {
1055
- let e = d(await this.#n.listConnectorConnections(r.provider));
1494
+ let e = w(await this.#n.listConnectorConnections(r.provider, void 0, n));
1056
1495
  if (!this.#p(t, n)) return;
1057
1496
  this.#f({ catalogs: {
1058
1497
  ...this.#c.value.catalogs,
@@ -1060,7 +1499,7 @@ var xe = class {
1060
1499
  } });
1061
1500
  } catch (e) {
1062
1501
  this.#p(t, n) && this.#f({ connectionError: {
1063
- message: u(e, this.#i.t).message,
1502
+ message: R(e, this.#i.t).message,
1064
1503
  provider: r.provider
1065
1504
  } });
1066
1505
  } finally {
@@ -1072,7 +1511,7 @@ var xe = class {
1072
1511
  async connect(e) {
1073
1512
  let t = this.#l.$.flowId.value;
1074
1513
  if (!(this.#u || t == null)) try {
1075
- if (!await this.#r.openExternalPage(() => this.#n.createConnectorConnectionPage(e))) {
1514
+ if (!await this.#r.openExternalPage(() => this.#n.createConnectorConnectionPage(e, t))) {
1076
1515
  this.#s({
1077
1516
  kind: "error",
1078
1517
  message: this.#i.t("notice.connectionPopupBlocked")
@@ -1081,7 +1520,7 @@ var xe = class {
1081
1520
  }
1082
1521
  !this.#u && t == this.#l.$.flowId.value && this.#f({ authorizationProvider: e });
1083
1522
  } catch (e) {
1084
- this.#u || this.#s(u(e, this.#i.t));
1523
+ this.#u || this.#s(R(e, this.#i.t));
1085
1524
  }
1086
1525
  }
1087
1526
  async setConnection(e, t) {
@@ -1097,7 +1536,7 @@ var xe = class {
1097
1536
  delete t[e], this.#f({
1098
1537
  authorizationProvider: void 0,
1099
1538
  catalogs: t
1100
- }), P(this.#l.$.selection.value, this.#l)?.provider == e && await this.refresh(!0);
1539
+ }), q(this.#l.$.selection.value, this.#l)?.provider == e && await this.refresh(!0);
1101
1540
  }
1102
1541
  #d() {
1103
1542
  if (this.#e != null) return this.#e;
@@ -1117,897 +1556,33 @@ var xe = class {
1117
1556
  }
1118
1557
  };
1119
1558
  //#endregion
1120
- //#region src/flow/common/edgeChanges.ts
1121
- function R(e, t, n) {
1122
- let r = {
1123
- source: n.source,
1124
- sourceHandle: n.sourceHandle,
1125
- target: n.target,
1126
- targetHandle: n.targetHandle
1127
- }, i = z(e, t)?.nodes[n.target], a = i != null && "inputs" in i ? i.inputs[n.targetHandle] : void 0;
1128
- return a?.kind == "sources" && a.sources.some((e) => e.kind == "node" && e.nodeId == n.source && e.output == n.sourceHandle) ? [] : [{
1129
- edge: r,
1130
- kind: "graph.edge.connect",
1131
- target: t
1132
- }];
1133
- }
1134
- function Se(e, t, n) {
1135
- let r = {
1136
- source: n.source,
1137
- sourceHandle: n.sourceHandle,
1138
- target: n.target,
1139
- targetHandle: n.targetHandle
1140
- }, i = z(e, t)?.nodes[n.target], a = i != null && "inputs" in i ? i.inputs[n.targetHandle] : void 0;
1141
- return a?.kind != "sources" || !a.sources.some((e) => e.kind == "node" && e.nodeId == n.source && e.output == n.sourceHandle) ? [] : [{
1142
- edge: r,
1143
- kind: "graph.edge.disconnect",
1144
- target: t
1145
- }];
1146
- }
1147
- function z(e, t) {
1148
- return t.kind == "flow" ? e.document.graph : e.document.subflows[t.id]?.graph;
1149
- }
1150
- //#endregion
1151
- //#region src/flow/common/moduleChanges.ts
1152
- async function Ce(e) {
1153
- try {
1154
- let { parse: t } = await import("./lib-GrGxYjsJ.js"), n = t(e, {
1155
- errorRecovery: !0,
1156
- sourceType: "module"
1157
- }).program, r = /* @__PURE__ */ new Set();
1158
- for (let e of n.body) {
1159
- if (e.type != "ImportDeclaration") continue;
1160
- let t = /^\.\/(.+)\.mjs$/.exec(e.source.value);
1161
- t?.[1] != null && r.add(t[1]);
1162
- }
1163
- return [...r].toSorted();
1164
- } catch {
1165
- return [];
1166
- }
1167
- }
1168
- function we(e, t, n) {
1169
- return [{
1170
- imports: n,
1171
- kind: "module.source.replace",
1172
- moduleId: e,
1173
- source: t
1174
- }];
1175
- }
1176
- //#endregion
1177
- //#region src/flow/common/nodeChanges.ts
1178
- function Te(e, t, n, r = {
1179
- imports: [],
1180
- source: "export default function run(input) {\n return { result: input.value }\n}\n"
1181
- }, i = {
1182
- inputs: [{
1183
- handle: "value",
1184
- jsonSchema: {},
1185
- nullable: !0,
1186
- value: null
1187
- }],
1188
- outputs: [{
1189
- handle: "result",
1190
- jsonSchema: {},
1191
- nullable: !0
1192
- }]
1193
- }) {
1194
- return [{
1195
- kind: "module.create",
1196
- module: {
1197
- ...r,
1198
- name: n
1199
- },
1200
- moduleId: t.moduleId
1201
- }, {
1202
- kind: "graph.node.create",
1203
- node: {
1204
- concurrency: 1,
1205
- inputs: U(i.inputs),
1206
- kind: "task",
1207
- name: n,
1208
- task: {
1209
- inputs: i.inputs,
1210
- moduleId: t.moduleId,
1211
- name: n,
1212
- outputs: i.outputs
1213
- }
1214
- },
1215
- nodeId: t.nodeId,
1216
- target: e
1217
- }];
1218
- }
1219
- function B(e, t, n) {
1220
- return [{
1221
- kind: "task.create",
1222
- task: n,
1223
- taskId: t.taskId
1224
- }, {
1225
- kind: "graph.node.create",
1226
- node: {
1227
- concurrency: 1,
1228
- inputs: U(n.inputs),
1229
- kind: "task",
1230
- name: n.name,
1231
- taskId: t.taskId
1232
- },
1233
- nodeId: t.nodeId,
1234
- target: e
1235
- }];
1236
- }
1237
- function Ee(e, t, n, r, i, a = {}) {
1238
- let o = a.inputs ?? {};
1239
- return B(e, t, {
1240
- executor: {
1241
- kind: "llm",
1242
- mode: r
1243
- },
1244
- inputs: [
1245
- {
1246
- handle: "messages",
1247
- jsonSchema: {
1248
- items: { type: "object" },
1249
- type: "array"
1250
- },
1251
- nullable: !0,
1252
- value: W(o, "messages", null)
1253
- },
1254
- {
1255
- handle: "input",
1256
- jsonSchema: { type: "string" },
1257
- nullable: !1,
1258
- value: W(o, "input", "Alex")
1259
- },
1260
- {
1261
- handle: "template",
1262
- jsonSchema: {
1263
- items: { type: "object" },
1264
- minItems: 1,
1265
- type: "array"
1266
- },
1267
- nullable: !1,
1268
- value: W(o, "template", [{
1269
- content: "Hello, I'm {{input}}",
1270
- role: "user"
1271
- }])
1272
- },
1273
- {
1274
- handle: "model",
1275
- jsonSchema: { type: "object" },
1276
- nullable: !1,
1277
- value: W(o, "model", { model: "deepseek-v4-flash" })
1278
- }
1279
- ],
1280
- name: n,
1281
- outputs: [{
1282
- ...a.output,
1283
- description: a.output?.description ?? i,
1284
- handle: "output",
1285
- jsonSchema: a.output?.jsonSchema ?? (r == "chat" ? { type: "string" } : {}),
1286
- nullable: a.output?.nullable ?? !1
1287
- }]
1288
- });
1289
- }
1290
- function De(e, t, n) {
1291
- return [{
1292
- kind: "graph.node.create",
1293
- node: {
1294
- cases: [{
1295
- expressions: [{
1296
- input: "value",
1297
- operator: "isTrue"
1298
- }],
1299
- output: "true",
1300
- relation: "all"
1301
- }],
1302
- concurrency: 1,
1303
- defaultOutput: "false",
1304
- input: {
1305
- handle: "value",
1306
- jsonSchema: {},
1307
- nullable: !0,
1308
- value: null
1309
- },
1310
- inputs: { value: {
1311
- kind: "value",
1312
- value: null
1313
- } },
1314
- kind: "condition",
1315
- name: n
1316
- },
1317
- nodeId: t,
1318
- target: e
1319
- }];
1320
- }
1321
- function Oe(e, t, n) {
1322
- return [{
1323
- kind: "graph.node.create",
1324
- node: {
1325
- concurrency: 1,
1326
- inputs: {},
1327
- kind: "value",
1328
- name: n,
1329
- values: [{
1330
- handle: "value",
1331
- jsonSchema: {},
1332
- nullable: !0,
1333
- value: null
1334
- }]
1335
- },
1336
- nodeId: t,
1337
- target: e
1338
- }];
1339
- }
1340
- function V(e, t, n) {
1341
- return [{
1342
- kind: "graph.node.create",
1343
- node: n,
1344
- nodeId: t,
1345
- target: e
1346
- }];
1347
- }
1348
- function ke(e, t, n, r) {
1349
- let i = r.name ?? n.displayName, a = n.type == "poll" ? {
1350
- bindingId: t.bindingId,
1351
- config: r.config,
1352
- definition: n,
1353
- kind: "poll",
1354
- name: i,
1355
- pollTimes: r.schedule ?? [{
1356
- type: "every",
1357
- unit: "minute",
1358
- value: 5
1359
- }]
1360
- } : {
1361
- bindingId: t.bindingId,
1362
- config: r.config,
1363
- definition: n,
1364
- kind: "integration",
1365
- name: i
1366
- };
1367
- return [{
1368
- binding: {
1369
- kind: "connection",
1370
- target: r.connectionId
1371
- },
1372
- bindingId: t.bindingId,
1373
- kind: "binding.create"
1374
- }, {
1375
- kind: "graph.node.create",
1376
- node: a,
1377
- nodeId: t.nodeId,
1378
- target: e
1379
- }];
1380
- }
1381
- function Ae(e, t, n) {
1382
- let r = H(e, t)?.nodes;
1383
- if (r == null) return [];
1384
- let i = new Set(n), a = n.flatMap((e) => {
1385
- let n = r[e];
1386
- return n == null ? [] : [{
1387
- kind: "graph.node.delete",
1388
- nodeId: e,
1389
- target: t
1390
- }, ...n.kind == "task" && n.task != null ? [{
1391
- kind: "module.delete",
1392
- moduleId: n.task.moduleId
1393
- }] : []];
1394
- });
1395
- if (t.kind == "subflow") return a;
1396
- let o = new Set(n.flatMap((e) => {
1397
- let t = r[e];
1398
- return t?.kind == "poll" || t?.kind == "integration" ? [t.bindingId] : [];
1399
- }));
1400
- for (let t of o) Object.entries(e.document.graph.nodes).some(([e, n]) => !i.has(e) && (n.kind == "poll" || n.kind == "integration") && n.bindingId == t) || a.push({
1401
- bindingId: t,
1402
- kind: "binding.delete"
1403
- });
1404
- return a;
1405
- }
1406
- function je(e, t, n, r) {
1407
- let i = H(e, t)?.nodes[n];
1408
- if (i == null || !("inputs" in i)) return;
1409
- let { concurrency: a, name: o, timeoutMs: s, ...c } = i;
1410
- return G(t, n, {
1411
- ...c,
1412
- ...r
1413
- });
1414
- }
1415
- function Me(e, t, n, r, i) {
1416
- return Ne(e, t, n, { [r]: i });
1417
- }
1418
- function Ne(e, t, n, r) {
1419
- let i = H(e, t)?.nodes[n];
1420
- if (i == null || !("inputs" in i)) return;
1421
- let a = { ...i.inputs };
1422
- for (let [e, t] of Object.entries(r)) t === void 0 ? delete a[e] : a[e] = {
1423
- kind: "value",
1424
- value: t
1425
- };
1426
- return G(t, n, {
1427
- ...i,
1428
- inputs: a
1429
- });
1430
- }
1431
- function Pe(e, t, n) {
1432
- let r = e.document.tasks[t];
1433
- if (!(r == null || !("executor" in r) || r.executor.kind != "connector")) return [{
1434
- kind: "task.replace",
1435
- task: {
1436
- ...r,
1437
- executor: {
1438
- ...r.executor,
1439
- connectionId: n
1440
- }
1441
- },
1442
- taskId: t
1443
- }];
1444
- }
1445
- function Fe(e, t, n, r) {
1446
- let i = e.document.graph.nodes[n];
1447
- if (i == null) return;
1448
- let a = {
1449
- ...r.description == null ? {} : { description: r.description },
1450
- icon: i.icon,
1451
- name: r.name
1452
- }, o;
1453
- switch (r.kind) {
1454
- case "webhook":
1455
- if (i.kind != "webhook") return;
1456
- o = Object.keys(r.options).length == 0 ? {
1457
- ...a,
1458
- inputsDef: r.inputs,
1459
- kind: "webhook"
1460
- } : {
1461
- ...a,
1462
- inputsDef: r.inputs,
1463
- kind: "webhook",
1464
- options: r.options
1465
- };
1466
- break;
1467
- case "cron":
1468
- if (i.kind != "cron") return;
1469
- o = {
1470
- ...a,
1471
- cronTimes: r.schedule,
1472
- kind: "cron"
1473
- };
1474
- break;
1475
- case "poll":
1476
- if (i.kind != "poll") return;
1477
- o = {
1478
- ...i,
1479
- ...a,
1480
- config: r.config,
1481
- pollTimes: r.schedule
1482
- };
1483
- break;
1484
- case "integration":
1485
- if (i.kind != "integration") return;
1486
- o = {
1487
- ...i,
1488
- ...a,
1489
- config: r.config
1490
- };
1491
- }
1492
- return G(t, n, o);
1493
- }
1494
- function Ie(e, t, n, r, i) {
1495
- let a = e.document.graph.nodes[n];
1496
- if (a == null || a.kind != "integration" && a.kind != "poll") return;
1497
- let o = { ...a.config };
1498
- return i === void 0 ? delete o[r] : o[r] = i, G(t, n, {
1499
- ...a,
1500
- config: o
1501
- });
1502
- }
1503
- function Le(e, t, n, r) {
1504
- let i = e.document.graph.nodes[n];
1505
- if (i != null) switch (i.kind) {
1506
- case "cron": return G(t, n, {
1507
- ...i,
1508
- cronTimes: r
1509
- });
1510
- case "poll": return G(t, n, {
1511
- ...i,
1512
- pollTimes: r
1513
- });
1514
- case "integration":
1515
- case "webhook": return;
1516
- default: return;
1517
- }
1518
- }
1519
- function Re(e, t, n, r) {
1520
- let i = e.document.graph.nodes[n];
1521
- if (!(i == null || i.kind != "poll" && i.kind != "integration") && e.document.bindings[i.bindingId]?.kind == "connection") return [{
1522
- binding: {
1523
- kind: "connection",
1524
- target: r
1525
- },
1526
- bindingId: i.bindingId,
1527
- kind: "binding.replace"
1528
- }];
1529
- }
1530
- function H(e, t) {
1531
- return t.kind == "flow" ? e.document.graph : e.document.subflows[t.id]?.graph;
1532
- }
1533
- function U(e) {
1534
- return Object.fromEntries(e.flatMap((e) => Object.hasOwn(e, "value") ? [[e.handle, {
1535
- kind: "value",
1536
- value: e.value
1537
- }]] : []));
1538
- }
1539
- function W(e, t, n) {
1540
- return e != null && Object.hasOwn(e, t) ? e[t] : n;
1541
- }
1542
- function G(e, t, n) {
1543
- return [{
1544
- kind: "graph.node.replace",
1545
- node: n,
1546
- nodeId: t,
1547
- target: e
1548
- }];
1549
- }
1550
- //#endregion
1551
- //#region src/workbench/browser/runtime/designer/flowChanges.ts
1552
- function K(e, t) {
1553
- return {
1554
- ...e,
1555
- content: i(e.content, t)
1556
- };
1557
- }
1558
- function ze(e, t) {
1559
- return [{
1560
- kind: "subflow.create",
1561
- subflow: {
1562
- graph: { nodes: {} },
1563
- inputs: [{
1564
- handle: "value",
1565
- jsonSchema: {},
1566
- nullable: !0,
1567
- value: null
1568
- }],
1569
- name: t,
1570
- outputs: [{
1571
- handle: "result",
1572
- jsonSchema: {},
1573
- nullable: !0,
1574
- sources: [{
1575
- input: "value",
1576
- kind: "flow"
1577
- }]
1578
- }]
1579
- },
1580
- subflowId: e
1581
- }];
1582
- }
1583
- function Be(e, t, n, r, i) {
1584
- switch (r.kind) {
1585
- case "code": return Te(t, {
1586
- moduleId: i(),
1587
- nodeId: n
1588
- }, r.name);
1589
- case "llm": return Ee(t, {
1590
- nodeId: n,
1591
- taskId: i()
1592
- }, r.name, r.mode, r.outputDescription);
1593
- case "connector": return B(t, {
1594
- nodeId: n,
1595
- taskId: i()
1596
- }, {
1597
- executor: {
1598
- action: r.action.actionId,
1599
- ...r.action.defaultConnection == null ? {} : { connectionId: r.action.defaultConnection.connectionId },
1600
- kind: "connector"
1601
- },
1602
- inputs: Object.entries(r.action.inputs).map(([e, t]) => Object.assign({ handle: e }, t)),
1603
- name: r.action.name,
1604
- outputs: Object.entries(r.action.outputs).map(([e, t]) => Object.assign({ handle: e }, t))
1605
- });
1606
- case "condition": return De(t, n, r.name);
1607
- case "value": return Oe(t, n, r.name);
1608
- case "subflow": {
1609
- let i = e.subflow(r.subflowId);
1610
- return i == null ? void 0 : tt(t, n, r.subflowId, i.inputs);
1611
- }
1612
- case "webhook": return t.kind == "flow" ? V(t, n, {
1613
- inputsDef: [],
1614
- kind: "webhook",
1615
- name: r.name
1616
- }) : void 0;
1617
- case "cron": return t.kind == "flow" ? V(t, n, {
1618
- cronTimes: [{
1619
- type: "every",
1620
- unit: "hour",
1621
- value: 1
1622
- }],
1623
- kind: "cron",
1624
- name: r.name
1625
- }) : void 0;
1626
- case "provider-trigger": return t.kind == "flow" ? ke(t, {
1627
- bindingId: i(),
1628
- nodeId: n
1629
- }, r.definition, {
1630
- config: {},
1631
- connectionId: r.connectionId
1632
- }) : void 0;
1633
- }
1634
- }
1635
- function Ve(e, t, n) {
1636
- return Ae(e.revision.content, t, n);
1637
- }
1638
- function He(e, t, n) {
1639
- let r = e.graph(t)?.nodes ?? {}, i = Object.fromEntries(n.flatMap((e) => r[e] == null ? [] : [[e, r[e]]]));
1640
- return {
1641
- modules: Object.fromEntries(Object.values(i).flatMap((t) => {
1642
- if (t.kind != "task" || t.task == null) return [];
1643
- let n = e.revision.content.modules[t.task.moduleId];
1644
- return n == null ? [] : [[t.task.moduleId, n]];
1645
- })),
1646
- nodes: i
1647
- };
1648
- }
1649
- function Ue(e, t, n, r) {
1650
- if (e.graph(t) == null) return {
1651
- changes: [],
1652
- nodeIds: [],
1653
- sourceIds: []
1654
- };
1655
- let i = Object.entries(n.nodes).filter(([, e]) => (t.kind == "flow" || "inputs" in e) && (e.kind != "task" || e.task == null || n.modules[e.task.moduleId] != null)), a = i.map(([e]) => e), o = new Map(a.map((e) => [e, r()])), s = [];
1656
- for (let [a, c] of i) {
1657
- let i = o.get(a);
1658
- if (!("inputs" in c)) {
1659
- if (c.kind == "poll" || c.kind == "integration") {
1660
- let n = e.binding(c.bindingId);
1661
- if (n == null) continue;
1662
- let a = r();
1663
- s.push({
1664
- binding: n,
1665
- bindingId: a,
1666
- kind: "binding.create"
1667
- }), s.push({
1668
- kind: "graph.node.create",
1669
- node: {
1670
- ...c,
1671
- bindingId: a,
1672
- name: `${c.name} copy`
1673
- },
1674
- nodeId: i,
1675
- target: t
1676
- });
1677
- } else s.push({
1678
- kind: "graph.node.create",
1679
- node: {
1680
- ...c,
1681
- name: `${c.name} copy`
1682
- },
1683
- nodeId: i,
1684
- target: t
1685
- });
1686
- continue;
1687
- }
1688
- let l = {};
1689
- for (let [e, t] of Object.entries(c.inputs)) {
1690
- if (t.kind == "value") {
1691
- l[e] = t;
1692
- continue;
1693
- }
1694
- let n = [];
1695
- for (let e of t.sources) {
1696
- if (e.kind != "node") {
1697
- n.push(e);
1698
- continue;
1699
- }
1700
- let t = o.get(e.nodeId);
1701
- t != null && n.push({
1702
- ...e,
1703
- nodeId: t
1704
- });
1705
- }
1706
- n.length > 0 && (l[e] = {
1707
- kind: "sources",
1708
- sources: n
1709
- });
1710
- }
1711
- let u = {
1712
- ...c,
1713
- inputs: l,
1714
- ...c.name == null ? {} : { name: `${c.name} copy` }
1715
- };
1716
- if (c.kind == "task" && c.task != null) {
1717
- let e = r(), t = n.modules[c.task.moduleId];
1718
- s.push({
1719
- kind: "module.create",
1720
- module: {
1721
- ...t,
1722
- name: `${t.name} copy`
1723
- },
1724
- moduleId: e
1725
- }), u = {
1726
- ...c,
1727
- inputs: l,
1728
- ...c.name == null ? {} : { name: `${c.name} copy` },
1729
- task: {
1730
- ...c.task,
1731
- moduleId: e,
1732
- name: `${c.task.name} copy`
1733
- }
1734
- };
1735
- }
1736
- s.push({
1737
- kind: "graph.node.create",
1738
- node: u,
1739
- nodeId: i,
1740
- target: t
1741
- });
1742
- }
1743
- return {
1744
- changes: s,
1745
- nodeIds: [...o.values()],
1746
- sourceIds: a
1747
- };
1748
- }
1749
- function We(e, t, n, r) {
1750
- return je(e.revision.content, t, n, r);
1751
- }
1752
- function Ge(e, t, n, r) {
1753
- let i = e.node(t, n)?.node;
1754
- if (i == null) return;
1755
- let { description: a, ...o } = i;
1756
- return Y(t, n, r == null ? o : {
1757
- ...o,
1758
- description: r
1759
- });
1760
- }
1761
- function Ke(e, t, n, r) {
1762
- let i = e.node(t, n)?.node;
1763
- if (i == null) return;
1764
- let { icon: a, ...o } = i;
1765
- return Y(t, n, r == null ? o : {
1766
- ...o,
1767
- icon: r
1768
- });
1769
- }
1770
- function qe(e, t, n, r) {
1771
- let i = e.node(t, n)?.node;
1772
- if (i == null) return;
1773
- if (!("inputs" in i)) return Y(t, n, {
1774
- ...i,
1775
- name: r ?? i.name
1776
- });
1777
- let { name: a, ...o } = i;
1778
- return Y(t, n, r == null ? o : {
1779
- ...o,
1780
- name: r
1781
- });
1782
- }
1783
- function Je(e, t, n, r, i) {
1784
- return Me(e.revision.content, t, n, r, i);
1785
- }
1786
- function Ye(e, t, n, r) {
1787
- let i = e.graph(t), a = i?.nodes[n];
1788
- if (i == null || a?.kind != "condition") return;
1789
- let o = Object.fromEntries([...a.cases.map((e) => [e.output, !0]), ...a.defaultOutput == null ? [] : [[a.defaultOutput, !0]]]), s = Object.fromEntries([...r.cases.map((e) => [e.output, !0]), ...r.defaultOutput == null ? [] : [[r.defaultOutput, !0]]]), c = a.input.handle == r.input.handle ? void 0 : [a.input.handle, r.input.handle], l = q(Object.keys(o).map((e) => ({ handle: e })), Object.keys(s).map((e) => ({ handle: e }))), u = new Set(Object.keys(s)), d = [];
1790
- for (let [e, o] of Object.entries(i.nodes)) {
1791
- if (!("inputs" in o)) continue;
1792
- let i = e == n, s = { ...o.inputs };
1793
- if (e == n) {
1794
- c != null && Object.hasOwn(s, c[0]) && (s[c[1]] = s[c[0]], delete s[c[0]]);
1795
- for (let e of Object.keys(s)) e != r.input.handle && delete s[e];
1796
- }
1797
- for (let [e, t] of Object.entries(s)) {
1798
- if (t.kind != "sources") continue;
1799
- let r = t.sources.flatMap((e) => e.kind != "node" || e.nodeId != n ? [e] : l != null && e.output == l[0] ? [{
1800
- ...e,
1801
- output: l[1]
1802
- }] : u.has(e.output) ? [e] : []);
1803
- r.length == t.sources.length && r.every((e, n) => e === t.sources[n]) || (i = !0, r.length == 0 ? delete s[e] : s[e] = {
1804
- kind: "sources",
1805
- sources: r
1806
- });
1807
- }
1808
- if (i) {
1809
- if (e == n) {
1810
- let { defaultOutput: n, ...i } = a;
1811
- d.push({
1812
- kind: "graph.node.replace",
1813
- node: {
1814
- ...i,
1815
- ...r,
1816
- inputs: s
1817
- },
1818
- nodeId: e,
1819
- target: t
1820
- });
1821
- } else d.push({
1822
- kind: "graph.node.replace",
1823
- node: {
1824
- ...o,
1825
- inputs: s
1826
- },
1827
- nodeId: e,
1828
- target: t
1829
- });
1830
- }
1831
- }
1832
- return d;
1833
- }
1834
- function Xe(e, t, n, r) {
1835
- let i = e.node(t, n)?.node;
1836
- if (i?.kind == "value") return Y(t, n, {
1837
- ...i,
1838
- values: r.map((e) => ({
1839
- handle: e.handle,
1840
- ...e.description == null ? {} : { description: e.description },
1841
- jsonSchema: e.jsonSchema ?? {},
1842
- nullable: e.nullable ?? !1,
1843
- ...Object.hasOwn(e, "value") ? { value: e.value } : {}
1844
- }))
1845
- });
1846
- }
1847
- function Ze(e, t, n, r) {
1848
- let i = e.graph(t)?.nodes[n];
1849
- if (i?.kind == "task") switch (r.kind) {
1850
- case "code": return i.task == null ? void 0 : J(e, t, n, {
1851
- ...i.task,
1852
- name: r.name
1853
- });
1854
- case "llm": {
1855
- if (i.task != null) return;
1856
- let t = e.task(i.taskId);
1857
- return t?.executor.kind == "llm" ? [{
1858
- kind: "task.replace",
1859
- task: {
1860
- executor: {
1861
- kind: "llm",
1862
- mode: r.mode
1863
- },
1864
- inputs: t.inputs,
1865
- name: r.name,
1866
- outputs: t.outputs
1867
- },
1868
- taskId: i.taskId
1869
- }] : void 0;
1870
- }
1871
- case "connector": {
1872
- if (i.task != null) return;
1873
- let t = e.task(i.taskId);
1874
- return t?.executor.kind == "connector" ? [{
1875
- kind: "task.replace",
1876
- task: {
1877
- ...t,
1878
- name: r.name
1879
- },
1880
- taskId: i.taskId
1881
- }] : void 0;
1882
- }
1883
- }
1884
- }
1885
- function Qe(e, t, n, r) {
1886
- let i = e.graph(t)?.nodes[n];
1887
- if (i?.kind == "task" && i.task != null) return J(e, t, n, {
1888
- ...i.task,
1889
- ...r
1890
- });
1891
- }
1892
- function $e(e, t, n, r) {
1893
- let i = e.trigger(n);
1894
- if (i == null || i.kind != "webhook") return;
1895
- let { options: a, ...o } = i;
1896
- return Y(t, n, Object.keys(r.options).length == 0 ? {
1897
- ...o,
1898
- inputsDef: r.inputs
1899
- } : {
1900
- ...i,
1901
- inputsDef: r.inputs,
1902
- options: r.options
1903
- });
1904
- }
1905
- function et(e, t, n) {
1906
- if (e.subflow(t) != null) return [{
1907
- definition: n,
1908
- kind: "subflow.definition.replace",
1909
- subflowId: t
1910
- }];
1911
- }
1912
- function tt(e, t, n, r) {
1913
- return [{
1914
- kind: "graph.node.create",
1915
- node: {
1916
- concurrency: 1,
1917
- inputs: nt(r),
1918
- kind: "subflow",
1919
- subflowId: n
1920
- },
1921
- nodeId: t,
1922
- target: e
1923
- }];
1924
- }
1925
- function nt(e) {
1926
- return Object.fromEntries(e.flatMap((e) => Object.hasOwn(e, "value") ? [[e.handle, {
1927
- kind: "value",
1928
- value: e.value
1929
- }]] : []));
1930
- }
1931
- function q(e, t) {
1932
- let n = new Set(e.map((e) => e.handle)), r = new Set(t.map((e) => e.handle)), i = [...n].filter((e) => !r.has(e)), a = [...r].filter((e) => !n.has(e));
1933
- return i.length == 1 && a.length == 1 ? [i[0], a[0]] : void 0;
1934
- }
1935
- function J(e, t, n, r) {
1936
- let i = e.graph(t), a = i?.nodes[n];
1937
- if (i == null || a?.kind != "task" || a.task == null) return;
1938
- let o = q(a.task.inputs, r.inputs), s = q(a.task.outputs, r.outputs), c = new Set(r.inputs.map((e) => e.handle)), l = new Set(r.outputs.map((e) => e.handle)), u = [];
1939
- for (let [e, d] of Object.entries(i.nodes)) {
1940
- if (!("inputs" in d)) continue;
1941
- let i = e == n, f = { ...d.inputs };
1942
- if (e == n) {
1943
- o != null && Object.hasOwn(f, o[0]) && (f[o[1]] = f[o[0]], delete f[o[0]]);
1944
- for (let e of Object.keys(f)) c.has(e) || delete f[e];
1945
- }
1946
- for (let [e, t] of Object.entries(f)) {
1947
- if (t.kind != "sources") continue;
1948
- let r = t.sources.flatMap((e) => e.kind != "node" || e.nodeId != n ? [e] : s != null && e.output == s[0] ? [{
1949
- ...e,
1950
- output: s[1]
1951
- }] : l.has(e.output) ? [e] : []);
1952
- r.length == t.sources.length && r.every((e, n) => e === t.sources[n]) || (i = !0, r.length == 0 ? delete f[e] : f[e] = {
1953
- kind: "sources",
1954
- sources: r
1955
- });
1956
- }
1957
- if (!i) continue;
1958
- let p = e == n ? {
1959
- ...a,
1960
- inputs: f,
1961
- task: r
1962
- } : {
1963
- ...d,
1964
- inputs: f
1965
- };
1966
- u.push({
1967
- kind: "graph.node.replace",
1968
- node: p,
1969
- nodeId: e,
1970
- target: t
1971
- });
1972
- }
1973
- return u;
1974
- }
1975
- function Y(e, t, n) {
1976
- return [{
1977
- kind: "graph.node.replace",
1978
- node: n,
1979
- nodeId: t,
1980
- target: e
1981
- }];
1982
- }
1983
- //#endregion
1984
1559
  //#region src/workbench/browser/runtime/designer/remoteChangeTargets.ts
1985
- function rt(e, t) {
1560
+ function Ot(e, t) {
1986
1561
  return e.kind == t.kind && (e.kind != "subflow" || t.kind == "subflow" && e.id == t.id);
1987
1562
  }
1988
- function X(e, t, n, r) {
1563
+ function Y(e, t, n, r) {
1989
1564
  for (let [i, a] of Object.entries(t.graph(n)?.nodes ?? {})) r(a) && e.add(i);
1990
1565
  }
1991
- function it(e, t, n, r) {
1566
+ function kt(e, t, n, r) {
1992
1567
  let i = /* @__PURE__ */ new Set();
1993
1568
  for (let a of r) switch (a.kind) {
1994
1569
  case "graph.node.create":
1995
1570
  case "graph.node.replace":
1996
- rt(a.target, n) && i.add(a.nodeId);
1571
+ Ot(a.target, n) && i.add(a.nodeId);
1997
1572
  break;
1998
1573
  case "task.replace":
1999
- X(i, e, n, (e) => e.kind == "task" && e.task == null && e.taskId == a.taskId), X(i, t, n, (e) => e.kind == "task" && e.task == null && e.taskId == a.taskId);
1574
+ Y(i, e, n, (e) => e.kind == "task" && e.task == null && e.taskId == a.taskId), Y(i, t, n, (e) => e.kind == "task" && e.task == null && e.taskId == a.taskId);
2000
1575
  break;
2001
1576
  case "module.source.replace":
2002
- X(i, e, n, (e) => e.kind == "task" && e.task?.moduleId == a.moduleId), X(i, t, n, (e) => e.kind == "task" && e.task?.moduleId == a.moduleId);
1577
+ Y(i, e, n, (e) => e.kind == "task" && e.task?.moduleId == a.moduleId), Y(i, t, n, (e) => e.kind == "task" && e.task?.moduleId == a.moduleId);
2003
1578
  break;
2004
- case "subflow.definition.replace": X(i, e, n, (e) => e.kind == "subflow" && e.subflowId == a.subflowId), X(i, t, n, (e) => e.kind == "subflow" && e.subflowId == a.subflowId);
1579
+ case "subflow.definition.replace": Y(i, e, n, (e) => e.kind == "subflow" && e.subflowId == a.subflowId), Y(i, t, n, (e) => e.kind == "subflow" && e.subflowId == a.subflowId);
2005
1580
  }
2006
1581
  return new Set([...i].filter((e) => t.selection(n, e) != null));
2007
1582
  }
2008
1583
  //#endregion
2009
1584
  //#region src/workbench/browser/runtime/stores/draftChanges.ts
2010
- function at(e) {
1585
+ function At(e) {
2011
1586
  if (e.length != 1) return;
2012
1587
  let t = e[0];
2013
1588
  switch (t.kind) {
@@ -2020,7 +1595,7 @@ function at(e) {
2020
1595
  default: return;
2021
1596
  }
2022
1597
  }
2023
- var ot = class {
1598
+ var jt = class {
2024
1599
  #e;
2025
1600
  #t;
2026
1601
  #n;
@@ -2048,15 +1623,15 @@ var ot = class {
2048
1623
  this.#a = e;
2049
1624
  }
2050
1625
  project(e) {
2051
- return this.#o.reduce((e, t) => K(e, t.changes), e);
1626
+ return this.#o.reduce((e, t) => F(e, t.changes), e);
2052
1627
  }
2053
1628
  enqueue(e) {
2054
1629
  let t = this.#s.then(e);
2055
1630
  return this.#s = t, t;
2056
1631
  }
2057
1632
  async change(e, t, n, r = !0) {
2058
- this.#t.beforeChange(r), this.#t.apply(K(t, n));
2059
- let i = at(n), a = this.#o.at(-1), o = i != null && a != null && !a.started && at(a.changes) == i ? a : void 0;
1633
+ this.#t.beforeChange(r), this.#t.apply(F(t, n));
1634
+ let i = At(n), a = this.#o.at(-1), o = i != null && a != null && !a.started && At(a.changes) == i ? a : void 0;
2060
1635
  if (o != null) return o.changes = n, await o.result;
2061
1636
  let s = {
2062
1637
  ...e,
@@ -2084,7 +1659,7 @@ var ot = class {
2084
1659
  let r = this.#l(e, n, t);
2085
1660
  return this.#o.length == 0 && this.#t.check(), r;
2086
1661
  } catch (n) {
2087
- if (n instanceof s && n.code == "flow.revision-conflict") {
1662
+ if (n instanceof P && n.code == "flow.revision-conflict") {
2088
1663
  if (!t && await this.#t.recover(e)) {
2089
1664
  t = !0;
2090
1665
  continue;
@@ -2093,7 +1668,7 @@ var ot = class {
2093
1668
  kind: "error",
2094
1669
  message: this.#n.t("notice.draftConflict")
2095
1670
  });
2096
- } else this.#u(e), this.#t.current(e) && this.#r(u(n, this.#n.t));
1671
+ } else this.#u(e), this.#t.current(e) && this.#r(R(n, this.#n.t));
2097
1672
  return;
2098
1673
  }
2099
1674
  }
@@ -2101,7 +1676,7 @@ var ot = class {
2101
1676
  #l(e, t, n) {
2102
1677
  let r = {
2103
1678
  ...n.revision,
2104
- content: K(t, e.changes).content
1679
+ content: F(t, e.changes).content
2105
1680
  };
2106
1681
  this.#o = this.#o.filter((t) => t !== e), this.#a = r;
2107
1682
  let i = this.#t.diagnostics(), a = this.#o.length == 0 && i?.revisionId == r.revisionId;
@@ -2110,19 +1685,19 @@ var ot = class {
2110
1685
  #u(e) {
2111
1686
  this.#o = this.#o.filter((t) => t !== e), !(!this.#t.current(e) || this.#a == null) && this.#t.apply(this.project(this.#a));
2112
1687
  }
2113
- }, st = 50, ct = {
1688
+ }, X = 50, Mt = {
2114
1689
  failed: !1,
2115
1690
  loaded: !1,
2116
1691
  loading: !0,
2117
1692
  loadingMore: !1,
2118
1693
  loadMoreFailed: !1,
2119
1694
  flows: []
2120
- }, lt = class {
1695
+ }, Nt = class {
2121
1696
  #e;
2122
1697
  #t;
2123
1698
  #n = new x();
2124
1699
  #r;
2125
- #i = t(ct);
1700
+ #i = t(Mt);
2126
1701
  #a = !1;
2127
1702
  constructor(t, n, r) {
2128
1703
  this.#e = t, this.#t = r, this.#r = n, this.$ = {
@@ -2143,10 +1718,6 @@ var ot = class {
2143
1718
  for (let e of Object.values(this.$)) e.dispose();
2144
1719
  this.#i.dispose();
2145
1720
  }
2146
- beginSelection() {
2147
- let e = this.#n.begin();
2148
- return this.#o({ loading: !1 }), e;
2149
- }
2150
1721
  capture() {
2151
1722
  return this.#n.capture();
2152
1723
  }
@@ -2168,7 +1739,7 @@ var ot = class {
2168
1739
  try {
2169
1740
  let t = await this.#e.listFlows({
2170
1741
  includeTotal: !0,
2171
- limit: st
1742
+ limit: X
2172
1743
  });
2173
1744
  if (!e()) return;
2174
1745
  this.#o({
@@ -2183,7 +1754,7 @@ var ot = class {
2183
1754
  this.#o({
2184
1755
  failed: !0,
2185
1756
  loading: !1
2186
- }), this.#r(u(t, this.#t.t));
1757
+ }), this.#r(R(t, this.#t.t));
2187
1758
  }
2188
1759
  }
2189
1760
  async loadMore() {
@@ -2197,7 +1768,7 @@ var ot = class {
2197
1768
  try {
2198
1769
  let e = await this.#e.listFlows({
2199
1770
  cursor: t,
2200
- limit: st
1771
+ limit: X
2201
1772
  });
2202
1773
  if (!n()) return;
2203
1774
  let r = new Set(this.#i.value.flows.map((e) => e.flowId));
@@ -2211,7 +1782,7 @@ var ot = class {
2211
1782
  this.#o({
2212
1783
  loadingMore: !1,
2213
1784
  loadMoreFailed: !0
2214
- }), this.#r(u(e, this.#t.t));
1785
+ }), this.#r(R(e, this.#t.t));
2215
1786
  }
2216
1787
  }
2217
1788
  async create(e) {
@@ -2229,6 +1800,12 @@ var ot = class {
2229
1800
  }
2230
1801
  this.#o({ flows: this.#i.value.flows.with(t, e) });
2231
1802
  }
1803
+ insert(e) {
1804
+ this.#i.value.flows.some((t) => t.flowId == e.flowId) || this.#o({
1805
+ flows: [...this.#i.value.flows, e],
1806
+ total: this.#i.value.total == null ? void 0 : this.#i.value.total + 1
1807
+ });
1808
+ }
2232
1809
  remove(e) {
2233
1810
  this.#o({
2234
1811
  flows: this.#i.value.flows.filter((t) => t.flowId != e),
@@ -2247,7 +1824,7 @@ var ot = class {
2247
1824
  ...e
2248
1825
  });
2249
1826
  }
2250
- }, ut = class {
1827
+ }, Pt = class {
2251
1828
  #e;
2252
1829
  #t;
2253
1830
  #n;
@@ -2290,7 +1867,7 @@ var ot = class {
2290
1867
  this.#c(a, r);
2291
1868
  } catch (r) {
2292
1869
  if (this.#o || !n()) return;
2293
- if (r instanceof s && r.code == "flow.presentation-conflict") try {
1870
+ if (r instanceof P && r.code == "flow.presentation-conflict") try {
2294
1871
  let t = await this.#e.getPresentation(e);
2295
1872
  if (this.#o || !n()) return;
2296
1873
  this.#c(a, t), this.#n({
@@ -2298,9 +1875,9 @@ var ot = class {
2298
1875
  message: this.#t.t("notice.layoutConflict")
2299
1876
  });
2300
1877
  } catch (e) {
2301
- !this.#o && n() && this.#n(u(e, this.#t.t));
1878
+ !this.#o && n() && this.#n(R(e, this.#t.t));
2302
1879
  }
2303
- else this.#c(a, t), this.#n(u(r, this.#t.t));
1880
+ else this.#c(a, t), this.#n(R(r, this.#t.t));
2304
1881
  }
2305
1882
  }), await this.#i;
2306
1883
  }
@@ -2312,76 +1889,13 @@ var ot = class {
2312
1889
  value: n
2313
1890
  });
2314
1891
  }
2315
- };
2316
- //#endregion
2317
- //#region src/workbench/browser/runtime/designer/diagnostics.ts
2318
- function dt(e, t) {
2319
- return t == e || t.startsWith(`${e}/`);
2320
- }
2321
- function ft(e, t, n, r) {
2322
- if (e == null || t == null || n == null) return [];
2323
- if (r != null) return _t(t, r, n.diagnostics);
2324
- let i = t.kind == "flow" ? "/document/graph" : `/document/subflows/${t.id}`;
2325
- return n.diagnostics.filter((e) => dt(i, e.path));
2326
- }
2327
- function pt(e) {
2328
- return e.startsWith("/modules/") ? "code" : /\/graph\/nodes\/[^/]+\/task(?:\/|$)/.test(e) ? "task" : e.includes("/graph/nodes/") ? "node" : e.startsWith("/document/tasks/") ? "task" : "flow";
2329
- }
2330
- function mt(e, t) {
2331
- return t.startsWith("/inputs/") ? "inputs" : e.kind == "task" && t.startsWith("/task") ? "task" : e.kind == "condition" && (t.startsWith("/cases/") || t.startsWith("/input") || t.startsWith("/defaultOutput")) ? "condition" : "node";
2332
- }
2333
- function ht(e, t, n) {
2334
- if (e == null || t == null) return;
2335
- let r = t.kind == "flow" ? "/document/graph/nodes/" : `/document/subflows/${t.id}/graph/nodes/`;
2336
- if (n.path.startsWith(r)) {
2337
- let i = n.path.slice(r.length), a = i.indexOf("/"), o = a < 0 ? i : i.slice(0, a), s = e.node(t, o);
2338
- return s == null ? void 0 : {
2339
- nodeId: o,
2340
- section: mt(s.node, a < 0 ? "" : i.slice(a))
2341
- };
2342
- }
2343
- let i = /^\/document\/tasks\/([^/]+)(.*)$/.exec(n.path);
2344
- if (i != null) {
2345
- let n = e.findTaskNode(t, /* @__PURE__ */ new Set([i[1]]));
2346
- return n == null ? void 0 : {
2347
- nodeId: n,
2348
- section: i[2].startsWith("/executor") ? "account" : "task"
2349
- };
2350
- }
2351
- let a = /^\/modules\/([^/]+)\/source$/.exec(n.path);
2352
- if (a != null) {
2353
- let n = e.findModuleNode(t, a[1]);
2354
- if (n != null) return {
2355
- nodeId: n,
2356
- section: "module"
2357
- };
2358
- }
2359
- }
2360
- function gt(e, t, n) {
2361
- return n?.diagnostics.map((n) => ({
2362
- diagnostic: n,
2363
- location: ht(e, t, n),
2364
- scope: pt(n.path)
2365
- })) ?? [];
2366
- }
2367
- function _t(e, t, n) {
2368
- let r = e.kind == "flow" ? `/document/graph/nodes/${t.id}` : `/document/subflows/${e.id}/graph/nodes/${t.id}`, i = [r];
2369
- if (t.kind == "task") {
2370
- t.node.task == null ? i.push(`/document/tasks/${t.node.taskId}`) : i.push(`${r}/task`);
2371
- let e = t.definition != null && "moduleId" in t.definition ? t.definition.moduleId : void 0;
2372
- e != null && i.push(`/modules/${e}`);
2373
- } else t.kind == "subflow" && i.push(`/document/subflows/${t.node.subflowId}`);
2374
- return n.filter((e) => i.some((t) => dt(t, e.path)));
2375
- }
2376
- //#endregion
2377
- //#region src/workbench/browser/runtime/stores/workspaceModel.ts
2378
- var vt = {
1892
+ }, Ft = {
2379
1893
  checkLoading: !1,
2380
1894
  selectedNodeIds: [],
2381
1895
  workspaceLoadFailed: !1,
2382
1896
  workspaceLoading: !1
2383
1897
  };
2384
- function yt(e) {
1898
+ function It(e) {
2385
1899
  return e.workspaceLoading ? "loading" : e.busy == "designer" ? "saving" : e.draft == null ? "noDraft" : "saved";
2386
1900
  }
2387
1901
  function Z(e, t) {
@@ -2397,9 +1911,9 @@ function Q(e, t, n) {
2397
1911
  source: r.module.source
2398
1912
  };
2399
1913
  }
2400
- var bt = class {
1914
+ var Lt = class {
2401
1915
  #e;
2402
- #t = t(vt);
1916
+ #t = t(Ft);
2403
1917
  #n;
2404
1918
  constructor(t, r) {
2405
1919
  let i = e(this.#t, (e) => e.busy), a = e(this.#t, (e) => e.checkLoading), o = e(this.#t, (e) => e.diagnosticFocus), s = e(this.#t, (e) => e.diagnostics), c = e(this.#t, (e) => e.draft), l = e(this.#t, (e) => {
@@ -2409,23 +1923,23 @@ var bt = class {
2409
1923
  ...n,
2410
1924
  status: Z(e.draft, e.moduleEditor)
2411
1925
  };
2412
- }), u = e(this.#t, (e) => e.nodeFocus), d = e(this.#t, (e) => e.presentation), f = e(this.#t, (e) => e.flowId), p = e(this.#t, (e) => e.live), m = e(this.#t, (e) => e.draft == null ? void 0 : h(e.draft)), g = e(this.#t, (e) => e.selectedNodeIds), _ = e(this.#t, (e) => e.target), v = e(this.#t, (e) => e.workspaceLoadFailed), y = e(this.#t, (e) => e.workspaceLoading);
1926
+ }), u = e(this.#t, (e) => e.nodeFocus), d = e(this.#t, (e) => e.presentation), f = e(this.#t, (e) => e.flowId), p = e(this.#t, (e) => e.live), m = e(this.#t, (e) => e.draft == null ? void 0 : N(e.draft)), h = e(this.#t, (e) => e.selectedNodeIds), g = e(this.#t, (e) => e.target), _ = e(this.#t, (e) => e.workspaceLoadFailed), v = e(this.#t, (e) => e.workspaceLoading);
2413
1927
  this.#e = e(this.#t, (e) => ({
2414
- revision: e.draft == null ? void 0 : h(e.draft),
1928
+ revision: e.draft == null ? void 0 : N(e.draft),
2415
1929
  target: e.target
2416
1930
  }), { equal: (e, t) => e.revision === t.revision && e.target === t.target });
2417
- let b = e(this.#t, (e) => {
2418
- if (e.draft != null && e.target != null && e.selectedNodeIds.length == 1) return h(e.draft).selection(e.target, e.selectedNodeIds[0]);
1931
+ let y = e(this.#t, (e) => {
1932
+ if (e.draft != null && e.target != null && e.selectedNodeIds.length == 1) return N(e.draft).selection(e.target, e.selectedNodeIds[0]);
2419
1933
  });
2420
1934
  this.$ = {
2421
1935
  addNodeOptions: n((e) => {
2422
1936
  let { revision: n, target: r } = e(this.#e);
2423
- return ee(n?.revision, r, e(t.t$));
1937
+ return Ne(n?.revision, r, e(t.t$));
2424
1938
  }),
2425
1939
  busy: i,
2426
1940
  checkLoading: a,
2427
1941
  diagnosticFocus: o,
2428
- diagnosticItems: e(this.#t, (e) => gt(e.draft == null ? void 0 : h(e.draft), e.target, e.diagnostics)),
1942
+ diagnosticItems: e(this.#t, (e) => Ee(e.draft == null ? void 0 : N(e.draft), e.target, e.diagnostics)),
2429
1943
  diagnostics: s,
2430
1944
  draft: c,
2431
1945
  flow: n((e) => {
@@ -2440,7 +1954,7 @@ var bt = class {
2440
1954
  flowNextCursor: r.$.nextCursor,
2441
1955
  flowTotal: r.$.total,
2442
1956
  flows: r.$.flows,
2443
- inspectorDiagnostics: e(this.#t, (e) => ft(e.draft == null ? void 0 : h(e.draft), e.target, e.diagnostics, b.value)),
1957
+ inspectorDiagnostics: e(this.#t, (e) => Ae(e.draft == null ? void 0 : N(e.draft), e.target, e.diagnostics, y.value)),
2444
1958
  live: p,
2445
1959
  moduleDiagnostics: e(this.#t, (e) => {
2446
1960
  let t = e.moduleEditor?.moduleId;
@@ -2450,16 +1964,16 @@ var bt = class {
2450
1964
  nodeFocus: u,
2451
1965
  presentation: d,
2452
1966
  revision: m,
2453
- selection: b,
2454
- selectedNodeIds: g,
2455
- status: e(this.#t, yt),
2456
- target: _,
2457
- targetFlow: n((e) => e(_)?.kind == "flow" ? e(r.$.flows).find((t) => t.flowId == e(f)) : void 0),
1967
+ selection: y,
1968
+ selectedNodeIds: h,
1969
+ status: e(this.#t, It),
1970
+ target: g,
1971
+ targetFlow: n((e) => e(g)?.kind == "flow" ? e(r.$.flows).find((t) => t.flowId == e(f)) : void 0),
2458
1972
  targetName: e(this.#t, (e) => {
2459
- if (e.target != null) return e.target.kind == "flow" ? r.flow(e.flowId ?? "")?.name : e.draft == null ? e.target.id : h(e.draft).subflow(e.target.id)?.name ?? e.target.id;
1973
+ if (e.target != null) return e.target.kind == "flow" ? r.flow(e.flowId ?? "")?.name : e.draft == null ? e.target.id : N(e.draft).subflow(e.target.id)?.name ?? e.target.id;
2460
1974
  }),
2461
- workspaceLoadFailed: v,
2462
- workspaceLoading: y
1975
+ workspaceLoadFailed: _,
1976
+ workspaceLoading: v
2463
1977
  }, this.#n = new Set(Object.values(r.$));
2464
1978
  }
2465
1979
  get value() {
@@ -2475,14 +1989,14 @@ var bt = class {
2475
1989
  for (let e of Object.values(this.$)) this.#n.has(e) || e.dispose();
2476
1990
  this.#e.dispose(), this.#t.dispose();
2477
1991
  }
2478
- }, xt = 250;
2479
- function St(e, t) {
1992
+ }, Rt = 250;
1993
+ function zt(e, t) {
2480
1994
  if (t != null) return t.kind == "flow" || e.subflow(t.id) != null ? t : { kind: "flow" };
2481
1995
  }
2482
1996
  function $(e, t) {
2483
1997
  return e?.kind == t?.kind ? e?.kind != "subflow" || t?.kind == "subflow" && e.id == t.id : !1;
2484
1998
  }
2485
- var Ct = class {
1999
+ var Bt = class {
2486
2000
  #e;
2487
2001
  #t;
2488
2002
  #n = new x();
@@ -2505,8 +2019,8 @@ var Ct = class {
2505
2019
  #y = 0;
2506
2020
  #b;
2507
2021
  #x;
2508
- constructor(e, t, n = () => crypto.randomUUID(), r = l(), i = () => {}) {
2509
- this.#e = e, this.#c = t, this.#i = n, this.#r = r, this.#s = i, this.#o = new lt(e, t, r), this.#l = new bt(r, this.#o), this.#t = new ot(e, t, r, {
2022
+ constructor(e, t, n = st, r = E(), i = () => {}) {
2023
+ this.#e = e, this.#c = t, this.#i = n, this.#r = r, this.#s = i, this.#o = new Nt(e, t, r), this.#l = new Lt(r, this.#o), this.#t = new jt(e, t, r, {
2510
2024
  apply: (e, t) => this.#w(e, t),
2511
2025
  beforeChange: (e) => {
2512
2026
  this.#M(), this.#h = !1, e && (this.#B({ busy: "designer" }), this.#c(void 0));
@@ -2519,7 +2033,7 @@ var Ct = class {
2519
2033
  },
2520
2034
  headChanged: (e, t) => this.#N(e, t),
2521
2035
  recover: (e) => this.#O(e, !0)
2522
- }), this.#a = new ut(e, t, (e) => this.#B({ presentation: e }), r), this.$ = this.#l.$;
2036
+ }), this.#a = new Pt(e, t, (e) => this.#B({ presentation: e }), r), this.$ = this.#l.$;
2523
2037
  }
2524
2038
  dispose() {
2525
2039
  this.#M(), this.#_ = !0, this.#n.invalidate(), this.#a.dispose(), this.#b?.(), this.#x?.(), this.#l.dispose(), this.#o.dispose();
@@ -2536,8 +2050,8 @@ var Ct = class {
2536
2050
  async selectFlow(e) {
2537
2051
  if (!this.#F()) return !1;
2538
2052
  this.#M();
2539
- let t = this.#o.beginSelection();
2540
- if (this.#n.invalidate(), this.#t.reset(), this.#a.reset(), this.#f = 0, this.#h = !1, this.#g = !1, this.#v = !1, this.#x?.(), this.#x = void 0, this.#B({
2053
+ let t = this.#n.begin();
2054
+ if (this.#t.reset(), this.#a.reset(), this.#f = 0, this.#h = !1, this.#g = !1, this.#v = !1, this.#x?.(), this.#x = void 0, this.#B({
2541
2055
  checkLoading: !1,
2542
2056
  diagnosticFocus: void 0,
2543
2057
  diagnostics: void 0,
@@ -2574,7 +2088,7 @@ var Ct = class {
2574
2088
  return t() ? (this.#B({
2575
2089
  workspaceLoadFailed: !0,
2576
2090
  workspaceLoading: !1
2577
- }), this.#c(u(e, this.#r.t)), !1) : !1;
2091
+ }), this.#c(R(e, this.#r.t)), !1) : !1;
2578
2092
  }
2579
2093
  return !0;
2580
2094
  }
@@ -2591,18 +2105,20 @@ var Ct = class {
2591
2105
  selectNodes(e) {
2592
2106
  return e.length == this.#l.value.selectedNodeIds.length && e.every((e, t) => e == this.#l.value.selectedNodeIds[t]) ? !0 : this.#F() ? (this.#M(), this.#B({
2593
2107
  diagnosticFocus: void 0,
2594
- moduleEditor: Q(this.#l.value.draft == null ? void 0 : h(this.#l.value.draft), this.#l.value.target, e),
2108
+ moduleEditor: Q(this.#l.value.draft == null ? void 0 : N(this.#l.value.draft), this.#l.value.target, e),
2595
2109
  nodeFocus: void 0,
2596
2110
  selectedNodeIds: e
2597
2111
  }), !0) : !1;
2598
2112
  }
2599
- async createFlow(e) {
2113
+ async createFlow(e, t) {
2600
2114
  if (this.#F()) {
2601
2115
  this.#B({ busy: "flow" }), this.#c(void 0);
2602
2116
  try {
2603
- return await this.#o.create(e);
2117
+ if (t == null) return await this.#o.create(e);
2118
+ let n = await this.#e.getFlow(await t(e));
2119
+ return this.#o.insert(n), n;
2604
2120
  } catch (e) {
2605
- this.#_ || this.#c(u(e, this.#r.t));
2121
+ this.#_ || this.#c(R(e, this.#r.t));
2606
2122
  } finally {
2607
2123
  this.#B({ busy: void 0 });
2608
2124
  }
@@ -2619,7 +2135,7 @@ var Ct = class {
2619
2135
  message: this.#r.t("notice.flowDeleteAccepted", { name: t.name })
2620
2136
  }), !0);
2621
2137
  } catch (e) {
2622
- return this.#_ || this.#c(u(e, this.#r.t)), !1;
2138
+ return this.#_ || this.#c(R(e, this.#r.t)), !1;
2623
2139
  } finally {
2624
2140
  this.#B({ busy: void 0 });
2625
2141
  }
@@ -2628,7 +2144,7 @@ var Ct = class {
2628
2144
  if (!this.#F() || this.#l.value.draft == null) return !1;
2629
2145
  let t = this.#i();
2630
2146
  this.#B({ busy: "resource" }), this.#c(void 0);
2631
- let n = await this.#C(ze(t, e), !1);
2147
+ let n = await this.#C(ge(t, e), !1);
2632
2148
  return this.#B({ busy: void 0 }), n != null && (this.selectTarget({
2633
2149
  id: t,
2634
2150
  kind: "subflow"
@@ -2646,7 +2162,7 @@ var Ct = class {
2646
2162
  try {
2647
2163
  i = await this.#e.renameFlow(e, r), i != null && this.#o.include(i);
2648
2164
  } catch (e) {
2649
- this.#_ || this.#c(u(e, this.#r.t));
2165
+ this.#_ || this.#c(R(e, this.#r.t));
2650
2166
  }
2651
2167
  return this.#B({ busy: void 0 }), i != null && (this.#c({
2652
2168
  kind: "success",
@@ -2659,32 +2175,35 @@ var Ct = class {
2659
2175
  if (r == null || i == null) return;
2660
2176
  let a = this.#i();
2661
2177
  if (e.kind == "comment") return await this.#S(i, a, t);
2662
- let o = h(r), s = b(e, o, i, this.#r.t);
2178
+ let o = N(r), s = S(e, o, i, this.#r.t);
2663
2179
  if (s == null) return;
2664
- let c = Be(o, i, a, s, this.#i);
2180
+ let c = xe(o, i, a, s, this.#i);
2665
2181
  if (c == null) return;
2666
- let l = n == null ? c : [...c, ...R(K(r, c).content, i, n(a))], u = this.#C(l);
2182
+ let l = n == null ? c : [...c, ...nt(F(r, c).content, i, n(a))], u = this.#C(l);
2667
2183
  this.selectNodes([a]);
2668
2184
  let d = this.moveNodes({ [a]: t });
2669
- if (await u != null) return await d, a;
2185
+ if (await u != null && (await d, !this.#_)) return this.#B({ nodeFocus: {
2186
+ nodeId: a,
2187
+ requestId: ++this.#y
2188
+ } }), a;
2670
2189
  }
2671
2190
  async connect(e) {
2672
2191
  let t = this.$.revision.value, n = this.#l.value.target;
2673
2192
  if (t == null || n == null) return;
2674
- let r = R(t.revision.content, n, e);
2193
+ let r = nt(t.revision.content, n, e);
2675
2194
  r.length > 0 && await this.#C(r);
2676
2195
  }
2677
2196
  async disconnect(e) {
2678
2197
  let t = this.$.revision.value, n = this.#l.value.target;
2679
2198
  if (t == null || n == null) return;
2680
- let r = Se(t.revision.content, n, e);
2199
+ let r = rt(t.revision.content, n, e);
2681
2200
  r.length > 0 && await this.#C(r);
2682
2201
  }
2683
2202
  async deleteSelectedNodes() {
2684
2203
  if (!this.#F()) return;
2685
2204
  let e = this.$.revision.value, t = this.#l.value.target;
2686
2205
  if (e == null || t == null || this.#l.value.selectedNodeIds.length == 0) return;
2687
- let n = g(this.#l.value.presentation?.value ?? {}, t), r = new Set(this.#l.value.selectedNodeIds.filter((e) => n.has(e))), i = Ve(e, t, this.#l.value.selectedNodeIds), a = i.length == 0 ? void 0 : this.#C(i), o = r.size == 0 ? void 0 : this.#T((e) => f(e, t, r));
2206
+ let n = T(this.#l.value.presentation?.value ?? {}, t), r = new Set(this.#l.value.selectedNodeIds.filter((e) => n.has(e))), i = we(e, t, this.#l.value.selectedNodeIds), a = i.length == 0 ? void 0 : this.#C(i), o = r.size == 0 ? void 0 : this.#T((e) => y(e, t, r));
2688
2207
  this.selectNodes([]), (a == null || await a != null) && await o;
2689
2208
  }
2690
2209
  copySelectedNodes() {
@@ -2698,14 +2217,14 @@ var Ct = class {
2698
2217
  sourceId: e.id,
2699
2218
  title: e.title
2700
2219
  }] : []),
2701
- nodes: He(e, t, this.#l.value.selectedNodeIds)
2220
+ nodes: ke(e, t, this.#l.value.selectedNodeIds)
2702
2221
  };
2703
2222
  }
2704
2223
  async pasteNodes(e) {
2705
2224
  if (!this.#F()) return;
2706
2225
  let t = this.$.revision.value, n = this.#l.value.target;
2707
2226
  if (t == null || n == null || this.#u == null) return;
2708
- let r = Ue(t, n, this.#u.nodes, this.#i), i = r.changes.length == 0 ? void 0 : this.#C(r.changes), a = this.#u.comments.map((e) => ({
2227
+ let r = je(t, n, this.#u.nodes, this.#i), i = r.changes.length == 0 ? void 0 : this.#C(r.changes), a = this.#u.comments.map((e) => ({
2709
2228
  ...e,
2710
2229
  nodeId: this.#i()
2711
2230
  }));
@@ -2717,8 +2236,8 @@ var Ct = class {
2717
2236
  y: (i?.y ?? 80) + 40
2718
2237
  }];
2719
2238
  })), c = this.#T((e) => {
2720
- let t = p(e, n, s);
2721
- for (let e of a) t = _(t, n, e.nodeId, {
2239
+ let t = j(e, n, s);
2240
+ for (let e of a) t = I(t, n, e.nodeId, {
2722
2241
  content: e.content,
2723
2242
  position: {
2724
2243
  x: e.position.x + 40,
@@ -2736,50 +2255,56 @@ var Ct = class {
2736
2255
  async saveNodeSettings(e, t) {
2737
2256
  let n = this.$.revision.value, r = this.#l.value.target;
2738
2257
  if (n == null || r == null) return !1;
2739
- let i = We(n, r, e, t);
2258
+ let i = Me(n, r, e, t);
2740
2259
  return i != null && await this.#C(i) != null;
2741
2260
  }
2742
2261
  async saveNodeDescription(e, t) {
2743
2262
  let n = this.$.revision.value, r = this.#l.value.target;
2744
2263
  if (n == null || r == null) return !1;
2745
- let i = Ge(n, r, e, t);
2264
+ let i = be(n, r, e, t);
2746
2265
  return i != null && await this.#C(i) != null;
2747
2266
  }
2748
2267
  async saveNodeIcon(e, t) {
2749
2268
  let n = this.$.revision.value, r = this.#l.value.target;
2750
2269
  if (n == null || r == null) return !1;
2751
- let i = Ke(n, r, e, t);
2270
+ let i = ye(n, r, e, t);
2752
2271
  return i != null && await this.#C(i) != null;
2753
2272
  }
2754
2273
  async saveNodeTitle(e, t) {
2755
2274
  let n = this.$.revision.value, r = this.#l.value.target;
2756
2275
  if (n == null || r == null) return !1;
2757
- let i = qe(n, r, e, t);
2276
+ let i = me(n, r, e, t);
2758
2277
  return i != null && await this.#C(i) != null;
2759
2278
  }
2760
2279
  async setInputValue(e, t, n) {
2761
2280
  let r = this.$.revision.value, i = this.#l.value.target;
2762
2281
  if (r == null || i == null) return !1;
2763
- let a = Je(r, i, e, t, n);
2282
+ let a = _e(r, i, e, t, n);
2283
+ return a != null && await this.#C(a) != null;
2284
+ }
2285
+ async setInputVariable(e, t, n) {
2286
+ let r = this.$.revision.value, i = this.#l.value.target;
2287
+ if (r == null || i == null) return !1;
2288
+ let a = n == null ? _e(r, i, e, t, void 0) : ve(r, i, e, t, n, this.#i());
2764
2289
  return a != null && await this.#C(a) != null;
2765
2290
  }
2766
2291
  async saveCondition(e, t) {
2767
2292
  let n = this.$.revision.value, r = this.#l.value.target;
2768
2293
  if (n == null || r == null) return !1;
2769
- let i = Ye(n, r, e, t);
2294
+ let i = Te(n, r, e, t);
2770
2295
  return i != null && await this.#C(i) != null;
2771
2296
  }
2772
2297
  async saveValue(e, t) {
2773
2298
  let n = this.$.revision.value, r = this.#l.value.target;
2774
2299
  if (n == null || r == null) return !1;
2775
- let i = Xe(n, r, e, t);
2300
+ let i = Pe(n, r, e, t);
2776
2301
  return i != null && await this.#C(i) != null;
2777
2302
  }
2778
2303
  async saveComment(e, t) {
2779
2304
  let n = this.#l.value.target;
2780
2305
  if (n == null) return;
2781
2306
  let r = this.#P().nodes.find((t) => t.id == e)?.position;
2782
- r != null && await this.#T((i) => _(i, n, e, {
2307
+ r != null && await this.#T((i) => I(i, n, e, {
2783
2308
  ...t,
2784
2309
  position: r
2785
2310
  }));
@@ -2787,55 +2312,55 @@ var Ct = class {
2787
2312
  async saveTaskSettings(e, t) {
2788
2313
  let n = this.$.revision.value, r = this.#l.value.target;
2789
2314
  if (n == null || r == null) return !1;
2790
- let i = Ze(n, r, e, t);
2315
+ let i = he(n, r, e, t);
2791
2316
  return i != null && await this.#C(i) != null;
2792
2317
  }
2793
2318
  async saveCodeTaskPorts(e, t) {
2794
2319
  let n = this.$.revision.value, r = this.#l.value.target;
2795
2320
  if (n == null || r == null) return !1;
2796
- let i = Qe(n, r, e, t);
2321
+ let i = De(n, r, e, t);
2797
2322
  return i != null && await this.#C(i) != null;
2798
2323
  }
2799
2324
  async setConnectorConnection(e, t) {
2800
2325
  let n = this.$.revision.value;
2801
2326
  if (n == null) return !1;
2802
- let r = Pe(n.revision.content, e, t);
2327
+ let r = D(n.revision.content, e, t);
2803
2328
  return r != null && await this.#C(r) != null;
2804
2329
  }
2805
2330
  async saveTriggerSettings(e, t) {
2806
2331
  let n = this.$.revision.value, r = this.#l.value.target;
2807
2332
  if (n == null || r?.kind != "flow") return !1;
2808
- let i = Fe(n.revision.content, r, e, t);
2333
+ let i = pe(n.revision.content, r, e, t);
2809
2334
  return i != null && await this.#C(i) != null;
2810
2335
  }
2811
2336
  async saveTriggerConfig(e, t, n) {
2812
2337
  let r = this.$.revision.value, i = this.#l.value.target;
2813
2338
  if (r == null || i?.kind != "flow") return !1;
2814
- let a = Ie(r.revision.content, i, e, t, n);
2339
+ let a = ne(r.revision.content, i, e, t, n);
2815
2340
  return a != null && await this.#C(a) != null;
2816
2341
  }
2817
2342
  async saveTriggerSchedule(e, t) {
2818
2343
  let n = this.$.revision.value, r = this.#l.value.target;
2819
2344
  if (n == null || r?.kind != "flow") return !1;
2820
- let i = Le(n.revision.content, r, e, t);
2345
+ let i = re(n.revision.content, r, e, t);
2821
2346
  return i != null && await this.#C(i) != null;
2822
2347
  }
2823
2348
  async saveWebhook(e, t) {
2824
2349
  let n = this.$.revision.value, r = this.#l.value.target;
2825
2350
  if (n == null || r?.kind != "flow") return !1;
2826
- let i = $e(n, r, e, t);
2351
+ let i = le(n, r, e, t);
2827
2352
  return i != null && await this.#C(i) != null;
2828
2353
  }
2829
2354
  async setTriggerConnection(e, t) {
2830
2355
  let n = this.$.revision.value, r = this.#l.value.target;
2831
2356
  if (n == null || r?.kind != "flow") return !1;
2832
- let i = Re(n.revision.content, r, e, t);
2357
+ let i = de(n.revision.content, r, e, t);
2833
2358
  return i != null && await this.#C(i) != null;
2834
2359
  }
2835
2360
  async saveSubflowSettings(e, t) {
2836
2361
  let n = this.$.revision.value;
2837
2362
  if (n == null) return !1;
2838
- let r = et(n, e, t);
2363
+ let r = Fe(n, e, t);
2839
2364
  return r != null && await this.#C(r) != null;
2840
2365
  }
2841
2366
  updateModuleSource(e) {
@@ -2866,9 +2391,9 @@ var Ct = class {
2866
2391
  ...e,
2867
2392
  phase: "saving"
2868
2393
  } });
2869
- let t = await Ce(e.source);
2394
+ let t = await at(e.source);
2870
2395
  if (this.#_) return !1;
2871
- let n = await this.#C(we(e.moduleId, e.source, t));
2396
+ let n = await this.#C(ot(e.moduleId, e.source, t));
2872
2397
  return !this.#_ && this.#l.value.moduleEditor?.moduleId == e.moduleId && this.#B({ moduleEditor: {
2873
2398
  ...this.#l.value.moduleEditor,
2874
2399
  phase: n == null ? "failed" : void 0
@@ -2876,13 +2401,13 @@ var Ct = class {
2876
2401
  }
2877
2402
  async moveNodes(e, t = "detail") {
2878
2403
  let n = this.#l.value.target;
2879
- n != null && await this.#T((r) => p(r, n, e, t));
2404
+ n != null && await this.#T((r) => j(r, n, e, t));
2880
2405
  }
2881
2406
  async moveViewport(e, t = "detail") {
2882
2407
  let n = this.#l.value.target;
2883
2408
  if (n == null) return;
2884
2409
  let r = this.#P().viewport;
2885
- (r.x != e.x || r.y != e.y || r.zoom != e.zoom) && this.#M(), await this.#T((r) => te(r, n, e, t));
2410
+ (r.x != e.x || r.y != e.y || r.zoom != e.zoom) && this.#M(), await this.#T((r) => A(r, n, e, t));
2886
2411
  }
2887
2412
  async check() {
2888
2413
  await this.#E();
@@ -2912,7 +2437,7 @@ var Ct = class {
2912
2437
  if (e.kind != "comment") return [];
2913
2438
  let t = /#(\d+)$/.exec(e.title);
2914
2439
  return t == null ? [] : [Number(t[1])];
2915
- })), i = this.#T((i) => _(i, e, t, {
2440
+ })), i = this.#T((i) => I(i, e, t, {
2916
2441
  content: "",
2917
2442
  position: n,
2918
2443
  title: this.#r.t("addNode.commentName", { number: r + 1 })
@@ -2959,7 +2484,7 @@ var Ct = class {
2959
2484
  let n = await this.#e.checkFlow(e, t.revisionId);
2960
2485
  !this.#_ && e == this.#l.value.flowId && t.revisionId == this.#l.value.draft?.revisionId && this.#B({ diagnostics: n });
2961
2486
  } catch (n) {
2962
- !this.#_ && e == this.#l.value.flowId && t.revisionId == this.#l.value.draft?.revisionId && this.#c(u(n, this.#r.t));
2487
+ !this.#_ && e == this.#l.value.flowId && t.revisionId == this.#l.value.draft?.revisionId && this.#c(R(n, this.#r.t));
2963
2488
  } finally {
2964
2489
  !this.#_ && e == this.#l.value.flowId && t.revisionId == this.#l.value.draft?.revisionId && this.#B({ checkLoading: !1 });
2965
2490
  }
@@ -2997,7 +2522,7 @@ var Ct = class {
2997
2522
  s = this.#k(a, o);
2998
2523
  }
2999
2524
  if (s.revisionId == a.revisionId) return !0;
3000
- let c = o.kind == "changes" && t != null ? it(h(a), h(s), t, o.revisions.flatMap((e) => e.operations)) : void 0;
2525
+ let c = o.kind == "changes" && t != null ? kt(N(a), N(s), t, o.revisions.flatMap((e) => e.operations)) : void 0;
3001
2526
  o.kind == "snapshot" && this.#M();
3002
2527
  let l = this.#L(s, !1);
3003
2528
  return this.#N(e.flowId, s.revisionId), o.kind == "changes" && o.revisions.length > 0 && t != null && c != null && i == this.#m && this.#A(e, t, c, i), n && (this.#c({
@@ -3005,7 +2530,7 @@ var Ct = class {
3005
2530
  message: this.#r.t(l ? "notice.moduleUpdated" : "notice.draftUpdated")
3006
2531
  }), this.#E()), !0;
3007
2532
  } catch (n) {
3008
- return t && this.#z(e) && this.#c(u(n, this.#r.t)), !1;
2533
+ return t && this.#z(e) && this.#c(R(n, this.#r.t)), !1;
3009
2534
  }
3010
2535
  }
3011
2536
  #k(e, t) {
@@ -3015,7 +2540,7 @@ var Ct = class {
3015
2540
  if (e.revision.parentRevisionId != n.revisionId) throw Error("Invalid Draft revision chain.");
3016
2541
  n = {
3017
2542
  ...e.revision,
3018
- content: K(n, e.operations).content
2543
+ content: F(n, e.operations).content
3019
2544
  };
3020
2545
  }
3021
2546
  return n;
@@ -3030,7 +2555,7 @@ var Ct = class {
3030
2555
  return;
3031
2556
  }
3032
2557
  for (let e of n) a.targets.add(e);
3033
- globalThis.clearTimeout(a.timer), a.timer = globalThis.setTimeout(() => this.#j(), xt);
2558
+ globalThis.clearTimeout(a.timer), a.timer = globalThis.setTimeout(() => this.#j(), Rt);
3034
2559
  return;
3035
2560
  }
3036
2561
  n.size == 0 || i.selectedNodeIds.length > 0 || (this.#p = {
@@ -3039,7 +2564,7 @@ var Ct = class {
3039
2564
  flowId: e.flowId,
3040
2565
  target: t,
3041
2566
  targets: new Set(n),
3042
- timer: globalThis.setTimeout(() => this.#j(), xt),
2567
+ timer: globalThis.setTimeout(() => this.#j(), Rt),
3043
2568
  viewport: this.#P().viewport
3044
2569
  });
3045
2570
  }
@@ -3050,7 +2575,7 @@ var Ct = class {
3050
2575
  if (t.flowId != e.flowId || !$(t.target, e.target) || t.selectedNodeIds.length > 0) return;
3051
2576
  let n = this.#P().viewport;
3052
2577
  if (n.x != e.viewport.x || n.y != e.viewport.y || n.zoom != e.viewport.zoom || t.draft == null) return;
3053
- let r = h(t.draft), i = [...e.targets].filter((t) => r.selection(e.target, t) != null);
2578
+ let r = N(t.draft), i = [...e.targets].filter((t) => r.selection(e.target, t) != null);
3054
2579
  i.length == 1 && this.#B({ nodeFocus: {
3055
2580
  nodeId: i[0],
3056
2581
  requestId: ++this.#y
@@ -3064,7 +2589,7 @@ var Ct = class {
3064
2589
  }
3065
2590
  #P() {
3066
2591
  let e = this.#l.value;
3067
- return y(e.draft, e.target, e.presentation?.value, e.diagnostics?.diagnostics, {}, {}, this.#r.t);
2592
+ return M(e.draft, e.target, e.presentation?.value, e.diagnostics?.diagnostics, {}, {}, this.#r.t);
3068
2593
  }
3069
2594
  #F() {
3070
2595
  let e = this.#l.value.moduleEditor;
@@ -3074,7 +2599,7 @@ var Ct = class {
3074
2599
  }), !1);
3075
2600
  }
3076
2601
  #I(e) {
3077
- let t = h(e), n = St(t, this.#l.value.target);
2602
+ let t = N(e), n = zt(t, this.#l.value.target);
3078
2603
  return {
3079
2604
  revision: t,
3080
2605
  selectedNodeIds: this.#l.value.selectedNodeIds.filter((e) => n != null && t.selection(n, e) != null),
@@ -3108,13 +2633,13 @@ var Ct = class {
3108
2633
  };
3109
2634
  //#endregion
3110
2635
  //#region src/workbench/browser/runtime/stores/workbenchStore.ts
3111
- function wt(e) {
2636
+ function Vt(e) {
3112
2637
  return new Map(e.nodes.map((e) => [e.id, e]));
3113
2638
  }
3114
- function Tt(e, t) {
3115
- return e == null || t == null ? [] : h(e).designerInputs(t);
2639
+ function Ht(e, t) {
2640
+ return e == null || t == null ? [] : N(e).designerInputs(t);
3116
2641
  }
3117
- function Et(e, t, n, r, i) {
2642
+ function Ut(e, t, n, r, i) {
3118
2643
  if (e == null || t?.kind != "flow" || n?.revisionId != e.revisionId || n.flowId != e.flowId) return /* @__PURE__ */ new Map();
3119
2644
  let a = r.find((t) => t.kind == "run.started" && t.payload.flowId == e.flowId)?.payload.scopeId;
3120
2645
  return typeof a == "string" ? new Map(r.flatMap((t) => {
@@ -3122,38 +2647,47 @@ function Et(e, t, n, r, i) {
3122
2647
  return t.payload.scopeId == a && t.payload.flowId == e.flowId && typeof n == "string" && i.has(n) ? [[t.sequence, n]] : [];
3123
2648
  })) : /* @__PURE__ */ new Map();
3124
2649
  }
3125
- var Dt = { openExternalPage: async () => !1 }, Ot = class {
2650
+ var Wt = { openExternalPage: async () => !1 }, Gt = class {
3126
2651
  #e;
3127
2652
  #t;
3128
2653
  #n;
3129
2654
  #r;
3130
- constructor(r, i, a = () => crypto.randomUUID(), o = l(), s = Dt) {
3131
- this.#e = new x(), this.#n = t(), this.#r = !1, this.provideAddNodeOptions = async (e, t) => await this.#i([this.triggers.provideAddNodeOptions(e, t), this.connectors.provideAddNodeOptions(e, t)], t), this.browseAddNodeOptions = async (e) => await this.#i([this.triggers.browseAddNodeOptions(e), this.connectors.browseAddNodeOptions(e)], e), this.provideAddNodeOptionChoices = async (e, t) => await (e.startsWith("trigger:") ? this.triggers.provideAddNodeOptionChoices(e, t) : this.connectors.provideAddNodeOptionChoices(e, t)), this.#t = o;
3132
- let c = (e) => {
3133
- this.#r || this.#n.set(e);
2655
+ #i;
2656
+ #a;
2657
+ #o;
2658
+ #s;
2659
+ #c;
2660
+ #l;
2661
+ constructor(r, i, a = () => crypto.randomUUID(), o = E(), s = Wt, c = !0) {
2662
+ this.#t = new x(), this.#r = t(), this.#a = t([]), this.#o = t(!1), this.#s = t(!1), this.#c = new x(), this.#l = !1, this.provideAddNodeOptions = async (e, t) => await this.#u([this.triggers.provideAddNodeOptions(e, t), this.connectors.provideAddNodeOptions(e, t)], t), this.browseAddNodeOptions = async (e) => await this.#u([this.triggers.browseAddNodeOptions(e), this.connectors.browseAddNodeOptions(e)], e), this.provideAddNodeOptionChoices = async (e, t) => await (e.startsWith("trigger:") ? this.triggers.provideAddNodeOptionChoices(e, t) : this.connectors.provideAddNodeOptionChoices(e, t)), this.#e = r, this.#n = o, this.#i = c;
2663
+ let l = (e) => {
2664
+ this.#l || this.#r.set(e);
3134
2665
  };
3135
- this.runs = new v(r, c, o), this.workspace = new Ct(r, c, a, o, (e) => void this.#a(r, e)), this.connectors = new ye(r, this.workspace, c, s, o), this.triggers = new xe(r, this.workspace, c, s, o), this.publications = new de(r, this.workspace, c, a, o), this.runRequests = new ge(r, this.runs, c, o, a);
2666
+ this.runs = new O(r, l, o), this.workspace = new Bt(r, l, st, o, (e) => void this.#d(r, e)), this.connectors = new xt(r, this.workspace, l, s, o), this.triggers = new Dt(r, this.workspace, l, s, o), this.publications = new ut(r, this.workspace, l, a, o), this.runRequests = new ht(r, this.runs, l, o, a);
3136
2667
  let u = /* @__PURE__ */ new Map(), d, f = n((e) => {
3137
2668
  let t = e(this.workspace.$.draft);
3138
2669
  d != t?.flowId && (u.clear(), d = t?.flowId);
3139
- let n = e(this.workspace.$.target), r = e(this.workspace.$.presentation)?.value, i = e(this.workspace.$.diagnostics)?.diagnostics, a = e(this.connectors.$.actions), s = e(this.connectors.$.catalogs), c = e(o.t$), l = e(this.runs.$.run), f = e(this.runs.$.events), p = n == null ? "" : n.kind == "flow" ? "flow" : `subflow:${n.id}`, h = [
3140
- ...Tt(t, n),
3141
- r == null || n == null ? void 0 : m(r, n),
2670
+ let n = e(this.workspace.$.target), r = e(this.workspace.$.presentation)?.value, i = e(this.workspace.$.diagnostics)?.diagnostics, a = e(this.connectors.$.actions), s = e(this.connectors.$.catalogs), c = e(o.t$), l = e(this.runs.$.run), f = e(this.runs.$.events), p = e(this.#a), m = e(this.#o), h = e(this.#s), g = n == null ? "" : n.kind == "flow" ? "flow" : `subflow:${n.id}`, _ = [
2671
+ ...Ht(t, n),
2672
+ r == null || n == null ? void 0 : se(r, n),
3142
2673
  i,
3143
2674
  a,
3144
2675
  s,
3145
2676
  c,
3146
2677
  l,
3147
2678
  f,
2679
+ p,
2680
+ m,
2681
+ h,
3148
2682
  ...l == null ? [] : [t?.revisionId]
3149
- ], g = u.get(p);
3150
- if (g != null && g.inputs.length == h.length && g.inputs.every((e, t) => e === h[t])) return g.graph;
3151
- let _ = y(t, n, r, i, a, s, c, l, f);
3152
- return u.set(p, {
3153
- graph: _,
3154
- inputs: h
3155
- }), _;
3156
- }), p = e(f, wt);
2683
+ ], v = u.get(g);
2684
+ if (v != null && v.inputs.length == _.length && v.inputs.every((e, t) => e === _[t])) return v.graph;
2685
+ let y = M(t, n, r, i, a, s, c, l, f, p, m, h, this.#i);
2686
+ return u.set(g, {
2687
+ graph: y,
2688
+ inputs: _
2689
+ }), y;
2690
+ }), p = e(f, Vt);
3157
2691
  this.$ = {
3158
2692
  busy: n((e) => {
3159
2693
  let t = e(this.workspace.$.busy);
@@ -3166,36 +2700,53 @@ var Dt = { openExternalPage: async () => !1 }, Ot = class {
3166
2700
  }),
3167
2701
  designer: f,
3168
2702
  designerNodeById: p,
3169
- notice: this.#n,
3170
- runEventNodes: n((e) => Et(e(this.workspace.$.draft), e(this.workspace.$.target), e(this.runs.$.run), e(this.runs.$.events), e(p))),
2703
+ notice: this.#r,
2704
+ runEventNodes: n((e) => Ut(e(this.workspace.$.draft), e(this.workspace.$.target), e(this.runs.$.run), e(this.runs.$.events), e(p))),
3171
2705
  selectedDesignerNode: n((e) => {
3172
2706
  let t = e(this.workspace.$.selectedNodeIds);
3173
2707
  return t.length == 1 ? e(p).get(t[0]) : void 0;
3174
- })
2708
+ }),
2709
+ variableNames: this.#a,
2710
+ variableNamesLoaded: this.#o,
2711
+ variableNamesLoading: this.#s
3175
2712
  };
3176
2713
  }
3177
2714
  dispose() {
3178
- this.#r = !0, this.#e.invalidate();
2715
+ this.#l = !0, this.#t.invalidate(), this.#c.invalidate();
3179
2716
  for (let e of Object.values(this.$)) e.dispose();
3180
- this.connectors.dispose(), this.publications.dispose(), this.runRequests.dispose(), this.runs.dispose(), this.triggers.dispose(), this.workspace.dispose();
2717
+ this.connectors.dispose(), this.publications.dispose(), this.runRequests.dispose(), this.runs.dispose(), this.triggers.dispose(), this.workspace.dispose(), this.#a.dispose(), this.#o.dispose(), this.#s.dispose();
3181
2718
  }
3182
2719
  async start(e) {
3183
- this.#e.invalidate(), this.connectors.reset(), this.triggers.reset(), this.publications.reset(), this.runRequests.reset(), this.runs.reset(), await this.workspace.start(e);
2720
+ this.#t.invalidate(), this.connectors.reset(), this.triggers.reset(), this.publications.reset(), this.runRequests.reset(), this.runs.reset(), await this.workspace.start(e);
3184
2721
  }
3185
2722
  async retryFlows() {
3186
2723
  await this.workspace.reloadFlows();
3187
2724
  }
3188
2725
  dismissNotice() {
3189
- this.#r || this.#n.set(void 0);
2726
+ this.#l || this.#r.set(void 0);
2727
+ }
2728
+ async refreshVariableNames() {
2729
+ if (this.#l || !this.#i) return;
2730
+ let e = this.#c.begin();
2731
+ this.#s.set(!0);
2732
+ try {
2733
+ let { variables: t } = await this.#e.listVariables();
2734
+ if (!e() || this.#l) return;
2735
+ this.#a.set(t.map((e) => e.name)), this.#o.set(!0);
2736
+ } catch (t) {
2737
+ e() && !this.#l && this.#r.set(R(t, this.#n.t));
2738
+ } finally {
2739
+ e() && !this.#l && this.#s.set(!1);
2740
+ }
3190
2741
  }
3191
2742
  async selectFlow(e) {
3192
- return this.#r || (this.#e.invalidate(), this.#n.set(void 0), !await this.workspace.selectFlow(e)) ? !1 : (this.connectors.reset(), this.triggers.reset(), this.publications.reset(), this.runRequests.reset(), this.runs.reset(), !0);
2743
+ return this.#l || (this.#t.invalidate(), this.#r.set(void 0), !await this.workspace.selectFlow(e)) ? !1 : (this.connectors.reset(), this.triggers.reset(), this.publications.reset(), this.runRequests.reset(), this.runs.reset(), !0);
3193
2744
  }
3194
- async createFlow(e) {
3195
- let t = await this.workspace.createFlow(e);
3196
- return this.#r || t == null ? !1 : (await this.selectFlow(t.flowId), this.#r || this.#n.set({
2745
+ async createFlow(e, t) {
2746
+ let n = await this.workspace.createFlow(e, t);
2747
+ return this.#l || n == null ? !1 : (await this.selectFlow(n.flowId), this.#l || this.#r.set({
3197
2748
  kind: "success",
3198
- message: this.#t.t("notice.created", { name: t.name })
2749
+ message: this.#n.t("notice.created", { name: n.name })
3199
2750
  }), !0);
3200
2751
  }
3201
2752
  selectNodes(e) {
@@ -3217,12 +2768,12 @@ var Dt = { openExternalPage: async () => !1 }, Ot = class {
3217
2768
  let r = await this.workspace.addNode(e, t, n);
3218
2769
  return r != null && e.kind == "connector" && this.connectors.refresh(), r != null && e.kind == "trigger" && this.triggers.refresh(), r;
3219
2770
  }
3220
- async #i(e, t) {
2771
+ async #u(e, t) {
3221
2772
  let n = await Promise.allSettled(e);
3222
- if (t.aborted || this.#r) return;
2773
+ if (t.aborted || this.#l) return;
3223
2774
  let r = n.filter((e) => e.status == "rejected");
3224
2775
  if (r.length > 0 && r.length == n.length) throw r[0].reason;
3225
- return r.length > 0 && this.#n.set(u(r[0].reason, this.#t.t)), n.flatMap((e) => e.status == "fulfilled" ? e.value ?? [] : []);
2776
+ return r.length > 0 && this.#r.set(R(r[0].reason, this.#n.t)), n.flatMap((e) => e.status == "fulfilled" ? e.value ?? [] : []);
3226
2777
  }
3227
2778
  async refreshSelectedConnector(e = !1) {
3228
2779
  await this.connectors.refresh(e);
@@ -3235,99 +2786,202 @@ var Dt = { openExternalPage: async () => !1 }, Ot = class {
3235
2786
  let e = this.workspace.$.targetFlow.value;
3236
2787
  return e == null ? "unavailable" : await this.runRequests.requestLive(e);
3237
2788
  }
3238
- async #a(e, t) {
2789
+ async #d(e, t) {
3239
2790
  let n = this.workspace.$.target.value;
3240
- if (this.#r || this.runRequests.$.submitting.value != null || n?.kind != "flow" || this.workspace.$.flowId.value != t.flowId) return;
3241
- let r = this.#e.begin();
2791
+ if (this.#l || this.runRequests.$.submitting.value != null || n?.kind != "flow" || this.workspace.$.flowId.value != t.flowId) return;
2792
+ let r = this.#t.begin();
3242
2793
  try {
3243
2794
  let n = await e.getRun(t.runId), i = this.workspace.$.target.value;
3244
- if (!r() || this.#r || i?.kind != "flow" || this.workspace.$.flowId.value != t.flowId || n.flowId != t.flowId || n.runId != t.runId) return;
2795
+ if (!r() || this.#l || i?.kind != "flow" || this.workspace.$.flowId.value != t.flowId || n.flowId != t.flowId || n.runId != t.runId) return;
3245
2796
  this.runs.followExternal(n);
3246
2797
  } catch {
3247
2798
  return;
3248
2799
  }
3249
2800
  }
3250
- }, kt = ie(() => import("./flowWorkspace-D7-rBA1-.js").then((e) => e.t));
3251
- function At({ host: e, store: t }) {
2801
+ }, Kt = He(() => import("./flowWorkspace-DwyxAOBH.js").then((e) => e.t));
2802
+ function qt({ action: e, description: t, error: n, onSubmit: r, onTokenChange: i, pending: a = !1, title: o, token: s, tokenLabel: f }) {
2803
+ let g = s != null && f != null && i != null, _ = s ?? "", v = /* @__PURE__ */ H(We, { children: [
2804
+ /* @__PURE__ */ V("div", {
2805
+ "aria-hidden": "true",
2806
+ className: "flex size-10 items-center justify-center rounded-lg bg-muted text-muted-foreground",
2807
+ children: /* @__PURE__ */ H("svg", {
2808
+ className: "size-5",
2809
+ fill: "none",
2810
+ stroke: "currentColor",
2811
+ strokeLinecap: "round",
2812
+ strokeLinejoin: "round",
2813
+ strokeWidth: "1.8",
2814
+ viewBox: "0 0 24 24",
2815
+ children: [/* @__PURE__ */ V("rect", {
2816
+ height: "9",
2817
+ rx: "2",
2818
+ width: "14",
2819
+ x: "5",
2820
+ y: "11"
2821
+ }), /* @__PURE__ */ V("path", { d: "M8 11V8a4 4 0 0 1 8 0v3" })]
2822
+ })
2823
+ }),
2824
+ /* @__PURE__ */ H("header", {
2825
+ className: "flex flex-col gap-2",
2826
+ children: [/* @__PURE__ */ V("h1", {
2827
+ className: "text-xl font-semibold tracking-tight text-balance",
2828
+ children: o
2829
+ }), /* @__PURE__ */ V("p", {
2830
+ className: "text-sm/relaxed text-muted-foreground text-pretty",
2831
+ children: t
2832
+ })]
2833
+ }),
2834
+ g && /* @__PURE__ */ V(h, { children: /* @__PURE__ */ H(u, {
2835
+ "data-invalid": n != null,
2836
+ children: [
2837
+ /* @__PURE__ */ V(m, {
2838
+ htmlFor: "session-token",
2839
+ children: f
2840
+ }),
2841
+ /* @__PURE__ */ V(c, {
2842
+ autoComplete: "username",
2843
+ name: "username",
2844
+ type: "hidden",
2845
+ value: "open-flow",
2846
+ readOnly: !0
2847
+ }),
2848
+ /* @__PURE__ */ V(c, {
2849
+ autoComplete: "current-password",
2850
+ "aria-invalid": n != null,
2851
+ autoFocus: !0,
2852
+ className: "h-9",
2853
+ id: "session-token",
2854
+ name: "session-token",
2855
+ onChange: (e) => i?.(e.target.value),
2856
+ spellCheck: !1,
2857
+ type: "password",
2858
+ value: _
2859
+ }),
2860
+ n != null && /* @__PURE__ */ V(l, { children: n })
2861
+ ]
2862
+ }) }),
2863
+ e != null && r != null && /* @__PURE__ */ H(p, {
2864
+ disabled: a || g && _.length == 0,
2865
+ size: "lg",
2866
+ type: "submit",
2867
+ children: [a && /* @__PURE__ */ V(d, {
2868
+ "aria-label": e,
2869
+ "data-icon": "inline-start"
2870
+ }), e]
2871
+ }),
2872
+ a && e == null && /* @__PURE__ */ V(d, { "aria-label": t })
2873
+ ] }), y = "m-auto flex w-full max-w-[420px] flex-col gap-5 rounded-xl bg-card p-6 shadow-lg shadow-black/10";
2874
+ return /* @__PURE__ */ V("main", {
2875
+ className: "open-flow-workbench",
2876
+ children: /* @__PURE__ */ V("div", {
2877
+ className: "grid h-full overflow-auto bg-muted/20 p-4",
2878
+ children: r == null ? /* @__PURE__ */ V("section", {
2879
+ "aria-busy": a,
2880
+ className: y,
2881
+ children: v
2882
+ }) : /* @__PURE__ */ V("form", {
2883
+ "aria-busy": a,
2884
+ className: y,
2885
+ onSubmit: r,
2886
+ children: v
2887
+ })
2888
+ })
2889
+ });
2890
+ }
2891
+ function Jt({ host: e, store: t }) {
3252
2892
  let n = a(t.$.notice);
3253
- return S(() => e.notify(n), [e, n]), S(() => () => e.notify(void 0), [e]), null;
2893
+ return z(() => e.notify(n), [e, n]), z(() => () => e.notify(void 0), [e]), null;
3254
2894
  }
3255
- function jt({ hrefFor: e, language: t, navigation: n, onLanguageChange: r, store: i, theme: o }) {
3256
- let s = a(i.workspace.$.flowId);
3257
- return /* @__PURE__ */ C("div", {
2895
+ function Yt({ createFlow: e, createFlowDisabled: t, createFlowField: n, flowBadges: r, hrefFor: i, hostAction: o, hostTitle: s, language: c, navigation: l, onHostAction: u, onLanguageChange: d, store: f, theme: p }) {
2896
+ let m = a(f.workspace.$.flowId);
2897
+ return /* @__PURE__ */ V("div", {
3258
2898
  className: "app-shell",
3259
- children: s == null ? /* @__PURE__ */ C(ne, {
3260
- hrefForFlow: (t) => e({
3261
- flowId: t.flowId,
2899
+ children: m == null ? /* @__PURE__ */ V(Qe, {
2900
+ createFlowDisabled: t,
2901
+ createFlowField: n,
2902
+ flowBadges: r,
2903
+ hrefForFlow: (e) => i({
2904
+ flowId: e.flowId,
3262
2905
  view: "design"
3263
2906
  }),
3264
- language: t,
3265
- onCreateFlow: (e) => n.createFlow(e),
3266
- onLanguageChange: r,
3267
- onSelectFlow: (e) => void n.selectFlow(e),
3268
- store: i
3269
- }) : /* @__PURE__ */ C(re, {
3270
- fallback: /* @__PURE__ */ C("main", {
2907
+ hostAction: o,
2908
+ hostTitle: s,
2909
+ language: c,
2910
+ onCreateFlow: (t) => l.createFlow(t, e),
2911
+ onHostAction: u,
2912
+ onLanguageChange: d,
2913
+ onSelectFlow: (e) => void l.selectFlow(e),
2914
+ store: f
2915
+ }) : /* @__PURE__ */ V(Ve, {
2916
+ fallback: /* @__PURE__ */ V("main", {
3271
2917
  "aria-busy": "true",
3272
2918
  className: "workspace"
3273
2919
  }),
3274
- children: /* @__PURE__ */ C(kt, {
3275
- hrefFor: e,
3276
- language: t,
3277
- navigation: n,
3278
- onLanguageChange: r,
3279
- store: i,
3280
- theme: o
2920
+ children: /* @__PURE__ */ V(Kt, {
2921
+ hostAction: o,
2922
+ hostTitle: s,
2923
+ hrefFor: i,
2924
+ navigation: l,
2925
+ onHostAction: u,
2926
+ store: f,
2927
+ theme: p
3281
2928
  })
3282
2929
  })
3283
2930
  });
3284
2931
  }
3285
- function Mt({ host: e, hrefFor: t, language: n, location: i, onLanguageChange: a, onNavigate: o, preferences: s, theme: u }) {
3286
- let d = ae(o);
3287
- d.current = o;
3288
- let [{ i18n: f, navigation: p, store: m }] = oe(() => {
3289
- let t = l(n), r = new Ot(new c((t, n) => e.request(t, n), (t, n) => e.subscribeFlow(t, n), (t) => e.subscribeFlowCatalog(t)), s, () => crypto.randomUUID(), t, e);
2932
+ function Xt({ createFlow: e, createFlowDisabled: t, createFlowField: n, flowBadges: r, host: i, hostAction: a, hostTitle: s, hrefFor: c, language: l, location: u, onHostAction: d, onLanguageChange: f, onNavigate: p, preferences: m, theme: h, variables: g = !0 }) {
2933
+ let _ = Ue(p);
2934
+ _.current = p;
2935
+ let [{ i18n: v, navigation: y, store: b }] = B(() => {
2936
+ let e = E(l), t = new Gt(new k((e, t) => i.request(e, t), (e, t) => i.subscribeFlow(e, t), (e) => i.subscribeFlowCatalog(e)), m, () => crypto.randomUUID(), e, i, g);
3290
2937
  return {
3291
- i18n: t,
3292
- navigation: new ce(r, i, (e, t) => d.current(e, t)),
3293
- store: r
2938
+ i18n: e,
2939
+ navigation: new Ge(t, u, (e, t) => _.current(e, t)),
2940
+ store: t
3294
2941
  };
3295
2942
  });
3296
- return S(() => {
3297
- p.start();
2943
+ return z(() => {
2944
+ y.start();
3298
2945
  let e = () => {
3299
- m.connectors.refreshAfterAuthorization(), m.triggers.refreshAfterAuthorization();
2946
+ b.connectors.refreshAfterAuthorization(), b.triggers.refreshAfterAuthorization(), b.refreshVariableNames();
3300
2947
  };
3301
2948
  return globalThis.addEventListener("focus", e), () => {
3302
- globalThis.removeEventListener("focus", e), p.dispose(), m.dispose(), f.dispose();
2949
+ globalThis.removeEventListener("focus", e), y.dispose(), b.dispose(), v.dispose();
3303
2950
  };
3304
2951
  }, [
3305
- f,
3306
- p,
3307
- m
3308
- ]), S(() => void p.apply(i), [i, p]), S(() => {
3309
- f.lang != n && f.switchLang(n);
3310
- }, [f, n]), /* @__PURE__ */ C(r, {
3311
- i18n: f,
3312
- children: /* @__PURE__ */ se("div", {
3313
- className: "open-flow-workbench",
3314
- "data-theme": u,
3315
- children: [/* @__PURE__ */ C(At, {
3316
- host: e,
3317
- store: m
3318
- }), /* @__PURE__ */ C(jt, {
3319
- hrefFor: t,
3320
- language: n,
3321
- navigation: p,
3322
- onLanguageChange: a,
3323
- store: m,
3324
- theme: u
2952
+ v,
2953
+ y,
2954
+ b
2955
+ ]), z(() => void y.apply(u), [u, y]), z(() => {
2956
+ v.lang != l && v.switchLang(l);
2957
+ }, [v, l]), /* @__PURE__ */ V(o, {
2958
+ i18n: v,
2959
+ children: /* @__PURE__ */ H("div", {
2960
+ className: "open-flow-theme open-flow-workbench",
2961
+ "data-theme": h,
2962
+ children: [/* @__PURE__ */ V(Jt, {
2963
+ host: i,
2964
+ store: b
2965
+ }), /* @__PURE__ */ V(Yt, {
2966
+ createFlow: e,
2967
+ createFlowDisabled: t,
2968
+ createFlowField: n,
2969
+ flowBadges: r,
2970
+ hostAction: a,
2971
+ hostTitle: s,
2972
+ hrefFor: c,
2973
+ language: l,
2974
+ navigation: y,
2975
+ onHostAction: d,
2976
+ onLanguageChange: f,
2977
+ store: b,
2978
+ theme: h
3325
2979
  })]
3326
2980
  })
3327
2981
  });
3328
2982
  }
3329
- function Nt({ sessionKey: e, ...t }) {
3330
- return /* @__PURE__ */ C(Mt, { ...t }, e);
2983
+ function Zt({ sessionKey: e, ...t }) {
2984
+ return /* @__PURE__ */ V(Xt, { ...t }, e);
3331
2985
  }
3332
2986
  //#endregion
3333
- export { Nt as OpenFlowWorkbench };
2987
+ export { qt as OpenFlowSessionGate, Zt as OpenFlowWorkbench, ze as isWorkbenchLanguage, Be as resolveWorkbenchLanguage, Re as workbenchLanguageNames, Le as workbenchLanguages };