@oomol-lab/open-flow 0.1.0-alpha.5 → 0.1.0-alpha.7

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 (40) hide show
  1. package/dist/browser/{addNodeOptions-B6tOfd2Y.js → addNodeOptions-DRndy4EK.js} +2237 -2599
  2. package/dist/browser/{createLucideIcon-BlEx4FzJ.js → createLucideIcon-CqjqCezK.js} +835 -869
  3. package/dist/browser/{createResourceDialog-CrBp3E8P.js → createResourceDialog-A64dDFCG.js} +140 -140
  4. package/dist/browser/{esm-CoE5_2w7.js → esm-YIGXG-Js.js} +1 -11
  5. package/dist/browser/{field-Daq9Lk-Y.js → field-CKGQHCIi.js} +88 -88
  6. package/dist/browser/{project-authoring-edge.d.ts → flow-authoring-edge.d.ts} +1 -1
  7. package/dist/browser/{project-authoring-module.d.ts → flow-authoring-module.d.ts} +1 -1
  8. package/dist/browser/{project-authoring-node.d.ts → flow-authoring-node.d.ts} +6 -12
  9. package/dist/browser/flow-authoring.d.ts +3 -0
  10. package/dist/browser/{project-authoring.js → flow-authoring.js} +72 -87
  11. package/dist/browser/{project-change.d.ts → flow-change.d.ts} +27 -36
  12. package/dist/browser/{project-change.js → flow-change.js} +69 -97
  13. package/dist/browser/{project-notifications.d.ts → flow-notifications.d.ts} +6 -3
  14. package/dist/browser/{flowWorkspace-CylW6hge.js → flowWorkspace-D7-rBA1-.js} +17147 -12754
  15. package/dist/browser/licenses.md +514 -0
  16. package/dist/browser/workbench-contract.d.ts +4 -4
  17. package/dist/browser/workbench.css +1 -1
  18. package/dist/browser/workbench.d.ts +1 -1
  19. package/dist/browser/workbench.js +969 -1073
  20. package/dist/common/control-api-conformance.js +219 -352
  21. package/dist/common/control-api-errors.d.ts +16 -24
  22. package/dist/common/control-api.d.ts +39 -68
  23. package/dist/common/control-api.js +136 -189
  24. package/dist/common/cron-trigger.d.ts +1 -1
  25. package/dist/common/flow-encoding.d.ts +11 -0
  26. package/dist/common/{project-encoding.js → flow-encoding.js} +14 -13
  27. package/dist/common/{project-notifications.d.ts → flow-notifications.d.ts} +6 -3
  28. package/dist/common/{project-semantics.d.ts → flow-semantics.d.ts} +9 -12
  29. package/dist/common/{project-semantics.js → flow-semantics.js} +591 -592
  30. package/dist/common/integration-trigger.d.ts +1 -1
  31. package/dist/common/poll-trigger.d.ts +1 -1
  32. package/dist/common/runtime-contract.d.ts +1 -1
  33. package/dist/common/scheduler.d.ts +3 -2
  34. package/dist/common/scheduler.js +159 -154
  35. package/dist/common/webhook-trigger.d.ts +1 -1
  36. package/dist/common/webhook-trigger.js +1 -1
  37. package/package.json +13 -13
  38. package/dist/browser/project-authoring-flow.d.ts +0 -4
  39. package/dist/browser/project-authoring.d.ts +0 -4
  40. package/dist/common/project-encoding.d.ts +0 -11
@@ -1,13 +1,10 @@
1
1
  import { a as e, f as t, i as n } from "./dist-C46JByB-.js";
2
- import { Ir as r, Rr as i, Wr as a } from "./createLucideIcon-BlEx4FzJ.js";
3
- import { _ as o, a as s, c, d as l, dt as u, f as d, g as f, i as p, l as m, m as h, n as g, o as _, p as v, st as y, t as b, u as x, ut as ee, v as S, x as te, y as ne } from "./addNodeOptions-B6tOfd2Y.js";
4
- import { Suspense as re, lazy as ie, useEffect as C, useRef as ae, useState as oe } from "react";
5
- import { jsx as w, jsxs as se } from "react/jsx-runtime";
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";
6
6
  //#region src/workbench/browser/runtime/navigation.ts
7
- function ce(e, t) {
8
- return t == null ? "design" : e == "design" && t?.draft == null && t != null ? "publications" : e;
9
- }
10
- var le = class {
7
+ var ce = class {
11
8
  #e;
12
9
  #t;
13
10
  #n;
@@ -19,12 +16,12 @@ var le = class {
19
16
  #c;
20
17
  constructor(e, n, r) {
21
18
  this.#r = t("design"), this.#i = 0, this.#a = !1, this.#o = !1, this.#s = !1, this.#c = [], this.$ = { view: this.#r }, this.#l = () => {
22
- this.#o && !this.#s && this.#d(this.#r.value, !0);
19
+ this.#o && !this.#s && this.#u(this.#r.value, !0);
23
20
  }, this.#t = n, this.#e = r, this.#n = e, this.#r.set(n.view);
24
21
  }
25
22
  async start() {
26
23
  let e = this.#t, t = ++this.#i;
27
- this.#s = !0, this.#c.push(this.#n.workspace.$.projectId.reaction(this.#l), this.#n.workspace.$.targetFlow.reaction(this.#l)), await this.#n.start(e.projectId, e.flowId), !(this.#a || t != this.#i) && (this.#d(e.view, !0), this.#s = !1, this.#o = !0);
24
+ this.#s = !0, this.#c.push(this.#n.workspace.$.flowId.reaction(this.#l)), await this.#n.start(e.flowId), !(this.#a || t != this.#i) && (this.#u(e.view, !0), this.#s = !1, this.#o = !0);
28
25
  }
29
26
  dispose() {
30
27
  this.#a = !0;
@@ -32,105 +29,65 @@ var le = class {
32
29
  this.#r.dispose();
33
30
  }
34
31
  open(e) {
35
- this.#i += 1, this.#s = !1, this.#d(e, !1);
32
+ this.#i += 1, this.#s = !1, this.#u(e, !1);
36
33
  }
37
- async createProject(e) {
34
+ async createFlow(e) {
38
35
  let t = ++this.#i;
39
36
  this.#s = !0;
40
37
  try {
41
- let n = await this.#n.createProject(e);
42
- return n && t == this.#i && this.#d("design", !1), n;
38
+ let n = await this.#n.createFlow(e);
39
+ return n && t == this.#i && this.#u("design", !1), n;
43
40
  } finally {
44
41
  t == this.#i && (this.#s = !1);
45
42
  }
46
43
  }
47
- async createFlow(e) {
44
+ async createSubflow(e) {
48
45
  let t = ++this.#i;
49
46
  this.#s = !0;
50
47
  try {
51
- let n = await this.#n.workspace.createResource("flow", e);
52
- return n && t == this.#i && this.#d("design", !1), n;
48
+ let n = await this.#n.workspace.createResource(e);
49
+ return n && t == this.#i && this.#u("design", !1), n;
53
50
  } finally {
54
51
  t == this.#i && (this.#s = !1);
55
52
  }
56
53
  }
57
- selectFlow(e) {
58
- if (this.#i += 1, this.#s = !0, !this.#n.workspace.selectTarget({
59
- id: e.flowId,
60
- kind: "flow"
61
- })) {
62
- this.#s = !1;
63
- return;
64
- }
65
- this.#n.runRequests.dismissInputs(), this.#d(e.draft == null ? "publications" : "design", !1), this.#s = !1;
66
- }
67
- async selectProject(e) {
54
+ async selectFlow(e) {
68
55
  let t = ++this.#i;
69
- this.#s = !0;
70
- let n = this.#n.selectProject(e);
71
- this.#d("design", !1);
72
- try {
73
- await n;
74
- } finally {
75
- t == this.#i && (this.#s = !1);
76
- }
56
+ this.#s = !0, this.#n.runRequests.dismissInputs(), await this.#n.selectFlow(e.flowId), t == this.#i && (this.#u("design", !1), this.#s = !1);
77
57
  }
78
- openProject() {
79
- if (this.#i += 1, this.#s = !0, !this.#n.workspace.selectTarget(void 0)) {
80
- this.#s = !1;
81
- return;
82
- }
83
- this.#n.runRequests.dismissInputs(), this.#d("design", !1), this.#s = !1;
58
+ openMainFlow() {
59
+ this.#n.workspace.selectTarget({ kind: "flow" }) && this.#u("design", !1);
84
60
  }
85
- async openProjects() {
61
+ async openFlows() {
86
62
  let e = ++this.#i;
87
- this.#s = !0;
88
- let t = this.#n.start();
89
- this.#d("design", !1);
90
- try {
91
- await t;
92
- } finally {
93
- e == this.#i && (this.#s = !1);
94
- }
63
+ this.#s = !0, await this.#n.selectFlow(void 0), e == this.#i && (this.#u("design", !1), this.#s = !1);
95
64
  }
96
65
  async apply(e) {
97
- T(e, this.#t) || (this.#t = e, await this.#u(e));
98
- }
99
- #l;
100
- async #u(e) {
66
+ if (w(e, this.#t)) return;
67
+ this.#t = e;
101
68
  let t = ++this.#i;
102
69
  this.#s = !0;
103
70
  try {
104
- if (e.projectId == null) await this.#n.start();
105
- else if (e.projectId != this.#n.workspace.$.projectId.value) await this.#n.selectProject(e.projectId, e.flowId);
106
- else if (e.flowId == null) this.#n.workspace.selectTarget(void 0);
107
- else if (e.flowId != null && e.flowId != this.#n.workspace.$.targetFlow.value?.flowId) {
108
- let t = this.#n.workspace.$.flows.value.find((t) => t.flowId == e.flowId);
109
- this.#n.workspace.selectTarget(t == null ? void 0 : {
110
- id: t.flowId,
111
- kind: "flow"
112
- });
113
- }
114
- t == this.#i && this.#d(e.view, !0);
71
+ e.flowId != this.#n.workspace.$.flowId.value && await this.#n.selectFlow(e.flowId), t == this.#i && this.#u(e.view, !0);
115
72
  } finally {
116
73
  t == this.#i && (this.#s = !1, this.#o = !0);
117
74
  }
118
75
  }
119
- #d(e, t) {
120
- let n = this.#n.workspace.$.targetFlow.value, r = ce(e, n), i = {
121
- flowId: n?.flowId,
122
- projectId: this.#n.workspace.$.projectId.value,
123
- view: r
76
+ #l;
77
+ #u(e, t) {
78
+ let n = {
79
+ flowId: this.#n.workspace.$.flowId.value,
80
+ view: e
124
81
  };
125
- T(i, this.#t) || (this.#t = i, this.#e(i, { replace: t })), this.#r.set(r);
82
+ w(n, this.#t) || (this.#t = n, this.#e(n, { replace: t })), this.#r.set(e);
126
83
  }
127
84
  };
128
- function T(e, t) {
129
- return e.projectId == t.projectId && e.flowId == t.flowId && e.view == t.view;
85
+ function w(e, t) {
86
+ return e.flowId == t.flowId && e.view == t.view;
130
87
  }
131
88
  //#endregion
132
89
  //#region src/workbench/browser/runtime/publications/publicationStore.ts
133
- var E = {
90
+ var T = {
134
91
  activities: [],
135
92
  activitiesLoadFailed: !1,
136
93
  activitiesLoading: !1,
@@ -143,23 +100,23 @@ var E = {
143
100
  loadingMore: !1,
144
101
  publications: [],
145
102
  publishing: !1
146
- }, ue = 20, de = 50;
147
- function D(e, t) {
148
- return e?.projectId == t.projectId && e.flowId == t.flowId;
103
+ }, le = 20, ue = 50;
104
+ function E(e, t) {
105
+ return e?.flowId == t.flowId;
149
106
  }
150
- var fe = class {
107
+ var de = class {
151
108
  #e;
152
109
  #t;
153
110
  #n;
154
- #r = new S();
155
- #i = new S();
156
- #a = new S();
157
- #o = new S();
111
+ #r = new x();
112
+ #i = new x();
113
+ #a = new x();
114
+ #o = new x();
158
115
  #s;
159
- #c = t(E);
116
+ #c = t(T);
160
117
  #l;
161
118
  #u;
162
- constructor(t, n, r, i = () => crypto.randomUUID(), a = y()) {
119
+ constructor(t, n, r, i = () => crypto.randomUUID(), a = l()) {
163
120
  this.#e = t, this.#t = i, this.#n = a, this.#s = r, this.#l = n, this.$ = {
164
121
  activities: e(this.#c, (e) => e.activities),
165
122
  activitiesLoadFailed: e(this.#c, (e) => e.activitiesLoadFailed),
@@ -191,35 +148,32 @@ var fe = class {
191
148
  this.#c.dispose();
192
149
  }
193
150
  reset() {
194
- this.#r.invalidate(), this.#i.invalidate(), this.#a.invalidate(), this.#o.invalidate(), this.#u = void 0, this.#c.set(E);
151
+ this.#r.invalidate(), this.#i.invalidate(), this.#a.invalidate(), this.#o.invalidate(), this.#u = void 0, this.#c.set(T);
195
152
  }
196
- async load(e, t) {
197
- let n = {
198
- flowId: t,
199
- projectId: e
200
- }, r = this.#r.begin();
201
- D(this.#c.value.target, n) || (this.#u = void 0), this.#s(void 0), this.#c.set({
202
- ...E,
153
+ async load(e) {
154
+ 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,
203
157
  loading: !0,
204
- target: n
158
+ target: t
205
159
  });
206
160
  try {
207
- let [e, t, i] = await this.#p(n);
208
- if (!r()) return;
161
+ let [e, r, i] = await this.#p(t);
162
+ if (!n()) return;
209
163
  this.#h({
210
164
  bindings: i,
211
165
  live: e,
212
166
  loading: !1,
213
- nextCursor: t.nextCursor,
214
- publications: t.publications,
215
- total: t.total
167
+ nextCursor: r.nextCursor,
168
+ publications: r.publications,
169
+ total: r.total
216
170
  });
217
171
  } catch (e) {
218
- if (!r()) return;
172
+ if (!n()) return;
219
173
  this.#h({
220
174
  loadFailed: !0,
221
175
  loading: !1
222
- }), this.#s(o(e, this.#n.t));
176
+ }), this.#s(u(e, this.#n.t));
223
177
  }
224
178
  }
225
179
  async loadMore() {
@@ -231,9 +185,9 @@ var fe = class {
231
185
  loadingMore: !0
232
186
  });
233
187
  try {
234
- let e = await this.#e.listPublications(n.projectId, n.flowId, {
188
+ let e = await this.#e.listPublications(n.flowId, {
235
189
  cursor: t,
236
- limit: de
190
+ limit: ue
237
191
  });
238
192
  if (!r()) return;
239
193
  let i = new Set(this.#c.value.publications.map((e) => e.publicationId));
@@ -248,58 +202,53 @@ var fe = class {
248
202
  this.#h({
249
203
  loadMoreFailed: !0,
250
204
  loadingMore: !1
251
- }), this.#s(o(e, this.#n.t));
205
+ }), this.#s(u(e, this.#n.t));
252
206
  }
253
207
  }
254
208
  async publish() {
255
- let e = this.#l.$.projectId.value, t = this.#l.$.targetFlow.value;
256
- if (e == null || t?.draft == null || this.#c.value.changingTriggerId != null || this.#c.value.publishing || this.#c.value.rollingBackPublicationId != null) return !1;
257
- let n = {
258
- flowId: t.flowId,
259
- projectId: e
260
- }, r = t.live?.publication.publicationId ?? null, i = JSON.stringify({
209
+ let e = this.#l.$.targetFlow.value, t = this.#l.$.draft.value;
210
+ if (e == null || t == null || this.#c.value.changingTriggerId != null || this.#c.value.publishing || this.#c.value.rollingBackPublicationId != null) return !1;
211
+ let n = { flowId: e.flowId }, r = this.#l.$.live.value?.publication?.publicationId ?? null, i = JSON.stringify({
261
212
  expectedLivePublicationId: r,
262
- flowId: t.flowId,
213
+ flowId: e.flowId,
263
214
  kind: "publish",
264
- projectId: e,
265
- revisionId: t.draft.revisionId
215
+ revisionId: t.revisionId
266
216
  }), a = this.#u?.signature == i ? this.#u : {
267
217
  key: this.#t(),
268
218
  signature: i
269
- }, s = this.#i.begin();
219
+ }, o = this.#i.begin();
270
220
  this.#u = a, this.#s(void 0), this.#m(n, { publishing: !0 });
271
221
  try {
272
- return await this.#e.publishFlow(e, t.draft.revisionId, t.flowId, r, { idempotencyKey: a.key }), !s() || (await this.#d(n), !s()) ? !1 : (this.#u = void 0, this.#s({
222
+ return await this.#e.publishFlow(e.flowId, t.revisionId, r, { idempotencyKey: a.key }), !o() || (await this.#d(n), !o()) ? !1 : (this.#u = void 0, this.#s({
273
223
  kind: "success",
274
- message: this.#n.t("notice.published", { name: t.draft.name })
224
+ message: this.#n.t("notice.published", { name: e.name })
275
225
  }), !0);
276
226
  } catch (e) {
277
- return s() ? (e instanceof u && e.code == "live.conflict" && await this.#f(n), this.#s(o(e, this.#n.t)), !1) : !1;
227
+ return o() ? (e instanceof s && e.code == "live.conflict" && await this.#f(n), this.#s(u(e, this.#n.t)), !1) : !1;
278
228
  } finally {
279
- s() && this.#h({ publishing: !1 });
229
+ o() && this.#h({ publishing: !1 });
280
230
  }
281
231
  }
282
232
  async rollback(e) {
283
233
  let { live: t, rollingBackPublicationId: n, target: r } = this.#c.value, i = t?.publication?.publicationId;
284
- if (r == null || i == null || this.#c.value.changingTriggerId != null || n != null || this.#c.value.publishing || e.projectId != r.projectId || e.flowId != r.flowId) return !1;
234
+ if (r == null || i == null || this.#c.value.changingTriggerId != null || n != null || this.#c.value.publishing || e.flowId != r.flowId) return !1;
285
235
  let a = JSON.stringify({
286
236
  currentPublicationId: i,
287
237
  flowId: r.flowId,
288
238
  kind: "rollback",
289
- projectId: r.projectId,
290
239
  targetPublicationId: e.publicationId
291
- }), s = this.#u?.signature == a ? this.#u : {
240
+ }), o = this.#u?.signature == a ? this.#u : {
292
241
  key: this.#t(),
293
242
  signature: a
294
243
  }, c = this.#i.begin();
295
- this.#u = s, this.#s(void 0), this.#h({ rollingBackPublicationId: e.publicationId });
244
+ this.#u = o, this.#s(void 0), this.#h({ rollingBackPublicationId: e.publicationId });
296
245
  try {
297
- return await this.#e.rollbackFlow(r.projectId, r.flowId, e.publicationId, i, { idempotencyKey: s.key }), !c() || (await this.#d(r), !c()) ? !1 : (this.#u = void 0, this.#s({
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({
298
247
  kind: "success",
299
248
  message: this.#n.t("notice.rolledBack", { revision: e.revisionId })
300
249
  }), !0);
301
250
  } catch (e) {
302
- return c() ? (e instanceof u && e.code == "live.conflict" && await this.#f(r), this.#s(o(e, this.#n.t)), !1) : !1;
251
+ return c() ? (e instanceof s && e.code == "live.conflict" && await this.#f(r), this.#s(u(e, this.#n.t)), !1) : !1;
303
252
  } finally {
304
253
  c() && this.#h({ rollingBackPublicationId: void 0 });
305
254
  }
@@ -334,13 +283,13 @@ var fe = class {
334
283
  testingTriggerId: void 0,
335
284
  testResult: void 0
336
285
  });
337
- let [r, i] = await Promise.allSettled([this.#e.getFlowTriggerBinding(t.projectId, t.flowId, e), this.#e.listFlowTriggerActivities(t.projectId, t.flowId, e, { limit: ue })]);
286
+ let [r, i] = await Promise.allSettled([this.#e.getFlowTriggerBinding(t.flowId, e), this.#e.listFlowTriggerActivities(t.flowId, e, { limit: le })]);
338
287
  if (n()) {
339
288
  if (r.status == "rejected") {
340
289
  this.#h({
341
290
  activitiesLoading: !1,
342
291
  detailLoading: !1
343
- }), this.#s(o(r.reason, this.#n.t));
292
+ }), this.#s(u(r.reason, this.#n.t));
344
293
  return;
345
294
  }
346
295
  this.#h({
@@ -354,7 +303,7 @@ var fe = class {
354
303
  }) : (this.#h({
355
304
  activitiesLoadFailed: !0,
356
305
  activitiesLoading: !1
357
- }), this.#s(o(i.reason, this.#n.t)));
306
+ }), this.#s(u(i.reason, this.#n.t)));
358
307
  }
359
308
  }
360
309
  async loadMoreTriggerActivities() {
@@ -366,9 +315,9 @@ var fe = class {
366
315
  activitiesLoadingMore: !0
367
316
  });
368
317
  try {
369
- let e = await this.#e.listFlowTriggerActivities(r.projectId, r.flowId, n, {
318
+ let e = await this.#e.listFlowTriggerActivities(r.flowId, n, {
370
319
  cursor: t,
371
- limit: ue
320
+ limit: le
372
321
  });
373
322
  if (!i() || this.#c.value.selectedTriggerId != n) return;
374
323
  let a = new Set(this.#c.value.activities.map((e) => e.activityId));
@@ -383,7 +332,7 @@ var fe = class {
383
332
  this.#h({
384
333
  activitiesLoadFailed: !0,
385
334
  activitiesLoadingMore: !1
386
- }), this.#s(o(e, this.#n.t));
335
+ }), this.#s(u(e, this.#n.t));
387
336
  }
388
337
  }
389
338
  async testTrigger() {
@@ -395,10 +344,10 @@ var fe = class {
395
344
  testResult: void 0
396
345
  });
397
346
  try {
398
- let e = await this.#e.testFlowPollTrigger(n.projectId, n.flowId, t);
347
+ let e = await this.#e.testFlowPollTrigger(n.flowId, t);
399
348
  return !i() || this.#c.value.selectedTriggerId != t ? !1 : (this.#h({ testResult: e }), !0);
400
349
  } catch (e) {
401
- return i() && this.#c.value.selectedTriggerId == t && this.#s(o(e, this.#n.t)), !1;
350
+ return i() && this.#c.value.selectedTriggerId == t && this.#s(u(e, this.#n.t)), !1;
402
351
  } finally {
403
352
  i() && this.#c.value.selectedTriggerId == t && this.#h({ testingTriggerId: void 0 });
404
353
  }
@@ -409,21 +358,21 @@ var fe = class {
409
358
  let n = this.#i.begin();
410
359
  this.#h({ changingTriggerId: e.triggerNodeId });
411
360
  try {
412
- if (e.operatorState == "active" ? await this.#e.pauseFlowTrigger(t.projectId, t.flowId, e.triggerNodeId) : await this.#e.resumeFlowTrigger(t.projectId, t.flowId, e.triggerNodeId), !n()) return !1;
413
- let r = await this.#e.listFlowTriggerBindings(t.projectId, t.flowId);
361
+ if (e.operatorState == "active" ? await this.#e.pauseFlowTrigger(t.flowId, e.triggerNodeId) : await this.#e.resumeFlowTrigger(t.flowId, e.triggerNodeId), !n()) return !1;
362
+ let r = await this.#e.listFlowTriggerBindings(t.flowId);
414
363
  return n() ? (this.#h({ bindings: r }), this.#c.value.selectedTriggerId == e.triggerNodeId && this.openTrigger(e.triggerNodeId), this.#s({
415
364
  kind: "success",
416
365
  message: this.#n.t(e.operatorState == "active" ? "notice.triggerPaused" : "notice.triggerResumed")
417
366
  }), !0) : !1;
418
367
  } catch (e) {
419
- return n() && this.#s(o(e, this.#n.t)), !1;
368
+ return n() && this.#s(u(e, this.#n.t)), !1;
420
369
  } finally {
421
370
  n() && this.#h({ changingTriggerId: void 0 });
422
371
  }
423
372
  }
424
373
  async #d(e) {
425
374
  let [t, n, r] = await this.#p(e);
426
- await this.#l.refreshFlows(), D(this.#c.value.target, e) && this.#h({
375
+ this.#l.updateLive(t), await this.#l.refreshFlows(), E(this.#c.value.target, e) && this.#h({
427
376
  bindings: r,
428
377
  live: t,
429
378
  loadFailed: !1,
@@ -441,17 +390,17 @@ var fe = class {
441
390
  }
442
391
  async #p(e) {
443
392
  return await Promise.all([
444
- this.#e.getLive(e.projectId, e.flowId),
445
- this.#e.listPublications(e.projectId, e.flowId, {
393
+ this.#e.getLive(e.flowId),
394
+ this.#e.listPublications(e.flowId, {
446
395
  includeTotal: !0,
447
- limit: de
396
+ limit: ue
448
397
  }),
449
- this.#e.listFlowTriggerBindings(e.projectId, e.flowId)
398
+ this.#e.listFlowTriggerBindings(e.flowId)
450
399
  ]);
451
400
  }
452
401
  #m(e, t) {
453
- D(this.#c.value.target, e) ? this.#h(t) : this.#c.set({
454
- ...E,
402
+ E(this.#c.value.target, e) ? this.#h(t) : this.#c.set({
403
+ ...T,
455
404
  ...t,
456
405
  target: e
457
406
  });
@@ -462,25 +411,22 @@ var fe = class {
462
411
  ...e
463
412
  });
464
413
  }
465
- }, O = { starting: !1 };
414
+ }, fe = { starting: !1 };
466
415
  function pe(e) {
467
416
  switch (e.kind) {
468
417
  case "condition": return { [e.node.input.handle]: e.node.input };
469
- case "subflow": return e.definition?.inputs ?? {};
470
- case "task": return e.definition?.inputs ?? {};
418
+ case "subflow": return o(e.definition?.inputs ?? []);
419
+ case "task": return o(e.definition?.inputs ?? []);
471
420
  case "value": return {};
472
421
  }
473
422
  }
474
423
  function me(e) {
475
424
  return e.node.name == null ? e.kind == "task" || e.kind == "subflow" ? e.definition?.name ?? e.id : e.id : e.node.name;
476
425
  }
477
- async function he(e, t, n) {
478
- let { FlowRunInputEditorStore: r } = await import("./flowRunInputEditorStore-DXOyyY7o.js").then((e) => e.n), i = f(e), a = i.graph({
479
- id: t,
480
- kind: "flow"
481
- });
482
- return a == null ? [] : Object.entries(a.nodes).toSorted(([e], [t]) => e.localeCompare(t)).flatMap(([e, t]) => {
483
- let a = i.resolveNode(e, t);
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" });
428
+ return i == null ? [] : Object.entries(i.nodes).toSorted(([e], [t]) => e.localeCompare(t)).flatMap(([e, i]) => {
429
+ let a = r.resolveNode(e, i);
484
430
  if (a.kind == "trigger") return [];
485
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({
486
432
  handle: e,
@@ -488,7 +434,7 @@ async function he(e, t, n) {
488
434
  nullable: t.nullable
489
435
  }, t.description == null ? {} : { description: t.description }));
490
436
  return o.length == 0 ? [] : [{
491
- editor: new r(o, n),
437
+ editor: new n(o, t),
492
438
  nodeId: e,
493
439
  title: me(a)
494
440
  }];
@@ -498,13 +444,13 @@ var ge = class {
498
444
  #e;
499
445
  #t;
500
446
  #n;
501
- #r = new S();
502
- #i = new S();
447
+ #r = new x();
448
+ #i = new x();
503
449
  #a;
504
450
  #o;
505
- #s = t(O);
451
+ #s = t(fe);
506
452
  #c;
507
- constructor(t, n, r, i = y(), a = () => crypto.randomUUID()) {
453
+ constructor(t, n, r, i = l(), a = () => crypto.randomUUID()) {
508
454
  this.#e = t, this.#a = n, this.#o = r, this.#n = i, this.#t = a, this.$ = {
509
455
  inputRequest: e(this.#s, (e) => e.inputRequest),
510
456
  starting: e(this.#s, (e) => e.starting),
@@ -519,25 +465,24 @@ var ge = class {
519
465
  reset() {
520
466
  this.#r.invalidate(), this.#i.invalidate(), this.#c = void 0;
521
467
  let e = this.#s.value.inputRequest;
522
- this.#s.set(O), this.#d(e);
468
+ this.#s.set(fe), this.#d(e);
523
469
  }
524
- async requestDraft(e, t, n) {
525
- if (t.draft == null) return "unavailable";
526
- let r = this.#i.begin();
527
- return await this.#l("draft", e, t, n, t.draft.revisionId, r);
470
+ async requestDraft(e, t) {
471
+ let n = this.#i.begin();
472
+ return await this.#l("draft", e, t, t.revisionId, n);
528
473
  }
529
- async requestLive(e, t) {
530
- let n = t.live?.publication.revisionId;
531
- if (n == null) return "unavailable";
532
- let r = this.#i.begin();
474
+ async requestLive(e) {
475
+ let t = this.#i.begin();
533
476
  this.#o(void 0), this.#f({ starting: !0 });
534
477
  try {
535
- let i = await this.#e.getRevision(e, n);
536
- return r() ? await this.#l("live", e, t, i, n, r) : "unavailable";
478
+ let n = (await this.#e.getLive(e.flowId)).publication;
479
+ if (n == null) return "unavailable";
480
+ let r = await this.#e.getRevision(e.flowId, n.revisionId);
481
+ return t() ? await this.#l("live", e, r, n.revisionId, t, n.publicationId) : "unavailable";
537
482
  } catch (e) {
538
- return r() && this.#o(o(e, this.#n.t)), "unavailable";
483
+ return t() && this.#o(u(e, this.#n.t)), "unavailable";
539
484
  } finally {
540
- r() && this.#f({ starting: !1 });
485
+ t() && this.#f({ starting: !1 });
541
486
  }
542
487
  }
543
488
  dismissInputs() {
@@ -551,7 +496,7 @@ var ge = class {
551
496
  ...e,
552
497
  attempted: !0
553
498
  } }), !1;
554
- let t = Object.fromEntries(e.groups.map((e) => [e.nodeId, e.editor.values()])), n = await this.#u(e.source, e.projectId, e.flow, e.revisionId, t);
499
+ let t = Object.fromEntries(e.groups.map((e) => [e.nodeId, e.editor.values()])), n = await this.#u(e.source, e.flow, e.revisionId, t, e.publicationId);
555
500
  return n && this.#s.value.inputRequest === e && this.dismissInputs(), n;
556
501
  }
557
502
  async #l(e, t, r, i, a, o) {
@@ -563,26 +508,26 @@ var ge = class {
563
508
  }), this.#d(s);
564
509
  let c;
565
510
  try {
566
- c = await he(i, r.flowId, this.#n.lang$);
511
+ c = await he(r, this.#n.lang$);
567
512
  } catch (e) {
568
- throw o() && this.#f({
513
+ throw a() && this.#f({
569
514
  starting: !1,
570
515
  submitting: void 0
571
516
  }), e;
572
517
  }
573
- if (!o()) {
518
+ if (!a()) {
574
519
  for (let e of c) e.editor.dispose();
575
520
  return "unavailable";
576
521
  }
577
- if (c.length == 0) return await this.#u(e, t, r, a) ? "started" : "unavailable";
522
+ if (c.length == 0) return await this.#u(e, t, i, {}, o) ? "started" : "unavailable";
578
523
  let l = n((e) => c.every((t) => e(t.editor.valid$)));
579
524
  return this.#f({
580
525
  inputRequest: {
581
526
  attempted: !1,
582
- flow: r,
527
+ flow: t,
583
528
  groups: c,
584
- projectId: t,
585
- revisionId: a,
529
+ ...o == null ? {} : { publicationId: o },
530
+ revisionId: i,
586
531
  source: e,
587
532
  valid: l
588
533
  },
@@ -590,37 +535,36 @@ var ge = class {
590
535
  submitting: void 0
591
536
  }), "input";
592
537
  }
593
- async #u(e, t, n, r, i = {}) {
594
- if (e == "draft" && n.draft == null || e == "live" && n.live == null) return !1;
595
- let a = this.#r.capture(), s = this.#a.prepareStart();
538
+ async #u(e, t, n, r = {}, i) {
539
+ if (e == "live" && i == null) return !1;
540
+ let a = this.#r.capture(), o = this.#a.prepareStart();
596
541
  this.#o(void 0), this.#f({
597
542
  starting: !0,
598
543
  submitting: e
599
544
  });
600
- let c = e == "draft" ? {
601
- flowId: n.flowId,
602
- projectId: t,
603
- revisionId: r
604
- } : { publicationId: n.live.publication.publicationId }, l = JSON.stringify({
605
- inputs: i,
545
+ let s = e == "draft" ? {
546
+ flowId: t.flowId,
547
+ revisionId: n
548
+ } : { publicationId: i }, c = JSON.stringify({
549
+ inputs: r,
606
550
  source: e,
607
- ...c
608
- }), u = this.#c?.signature == l ? this.#c : {
551
+ ...s
552
+ }), l = this.#c?.signature == c ? this.#c : {
609
553
  key: this.#t(),
610
- signature: l
554
+ signature: c
611
555
  };
612
- this.#c = u;
556
+ this.#c = l;
613
557
  try {
614
- let o = e == "draft" ? await this.#e.createDraftRun(t, r, n.flowId, {
615
- idempotencyKey: u.key,
616
- inputs: i
617
- }) : await this.#e.createLiveRun(n.live.publication.publicationId, {
618
- idempotencyKey: u.key,
619
- inputs: i
558
+ let s = e == "draft" ? await this.#e.createDraftRun(t.flowId, n, {
559
+ idempotencyKey: l.key,
560
+ inputs: r
561
+ }) : await this.#e.createLiveRun(i, {
562
+ idempotencyKey: l.key,
563
+ inputs: r
620
564
  });
621
- return !a() || !s() ? !1 : (this.#c = void 0, this.#a.follow(o, s));
565
+ return !a() || !o() ? !1 : (this.#c = void 0, this.#a.follow(s, o));
622
566
  } catch (e) {
623
- return a() && s() && this.#o(o(e, this.#n.t)), !1;
567
+ return a() && o() && this.#o(u(e, this.#n.t)), !1;
624
568
  } finally {
625
569
  a() && this.#f({
626
570
  starting: !1,
@@ -640,18 +584,18 @@ var ge = class {
640
584
  ...e
641
585
  });
642
586
  }
643
- }, k = {
587
+ }, D = {
644
588
  actions: {},
645
589
  catalogs: {}
646
590
  };
647
- function A(e) {
591
+ function O(e) {
648
592
  return Object.entries(e).map(([e, t]) => ({
649
593
  description: t.description,
650
594
  handle: e,
651
595
  jsonSchema: t.jsonSchema
652
596
  }));
653
597
  }
654
- function j(e, t) {
598
+ function k(e, t) {
655
599
  return {
656
600
  connector: e,
657
601
  description: e.defaultConnection == null ? t("addNode.connectorNeedsConnection", {
@@ -661,10 +605,10 @@ function j(e, t) {
661
605
  group: t("addNode.connectorActions"),
662
606
  icon: e.icon ?? ":carbon:connection-signal:",
663
607
  id: `connector:${e.actionId}`,
664
- inputs: A(e.inputs),
608
+ inputs: O(e.inputs),
665
609
  kind: "connector",
666
610
  label: e.name,
667
- outputs: A(e.outputs)
611
+ outputs: O(e.outputs)
668
612
  };
669
613
  }
670
614
  function _e(e, t) {
@@ -675,7 +619,7 @@ function _e(e, t) {
675
619
  }
676
620
  return [...n.values()].toSorted((e, t) => e[0].serviceName.localeCompare(t[0].serviceName)).map((e) => {
677
621
  let n = e[0], r = e.map((e) => {
678
- let n = j(e, t);
622
+ let n = k(e, t);
679
623
  return {
680
624
  description: n.description,
681
625
  label: n.label,
@@ -710,7 +654,7 @@ function ve(e, t) {
710
654
  serviceId: e.serviceId
711
655
  };
712
656
  }
713
- function ye(e) {
657
+ function A(e) {
714
658
  if (e?.kind != "task" || e.node.task != null) return;
715
659
  let t = e.definition;
716
660
  if (!(t == null || !("executor" in t) || t.executor.kind != "connector")) return {
@@ -720,7 +664,7 @@ function ye(e) {
720
664
  taskId: e.node.taskId
721
665
  };
722
666
  }
723
- var be = class {
667
+ var ye = class {
724
668
  #e;
725
669
  #t;
726
670
  #n;
@@ -735,33 +679,33 @@ var be = class {
735
679
  #d;
736
680
  #f;
737
681
  #p;
738
- constructor(r, i, a, o, s = y()) {
739
- this.#r = /* @__PURE__ */ new Map(), this.#i = /* @__PURE__ */ new Set(), this.#a = new S(), this.#l = t(k), this.#p = !1, this.browseAddNodeOptions = async (e) => {
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) => {
740
684
  if (this.#p) return;
741
- let t = this.#u.$.projectId.value;
685
+ let t = this.#u.$.flowId.value;
742
686
  if (t == null) return;
743
- let n = this.#f ?? await this.#e.listConnectorProviders(t, e);
744
- if (!(e.aborted || this.#p || t != this.#u.$.projectId.value)) return this.#f = n, n.toSorted((e, t) => e.serviceName.localeCompare(t.serviceName)).map((e) => ve(e, this.#t.t));
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));
745
689
  }, this.provideAddNodeOptionChoices = async (e, t) => {
746
690
  if (this.#p) return;
747
- let n = this.#u.$.projectId.value, r = this.#f?.find((t) => `connector-provider:${t.serviceId}` == e);
691
+ let n = this.#u.$.flowId.value, r = this.#f?.find((t) => `connector-provider:${t.serviceId}` == e);
748
692
  if (n == null || r == null) return;
749
- let i = this.#r.get(r.serviceId) ?? await this.#e.listConnectorActions(n, r.serviceId, t);
750
- if (t.aborted || this.#p || n != this.#u.$.projectId.value) 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;
751
695
  let a = i.map((e) => Object.assign({}, e, e.icon == null && r.icon != null ? { icon: r.icon } : {}, { serviceName: r.serviceName }));
752
696
  return this.#r.set(r.serviceId, a), this.#v({ actions: {
753
697
  ...this.#l.value.actions,
754
698
  ...Object.fromEntries(a.map((e) => [e.actionId, e]))
755
- } }), a.map((e) => j(e, this.#t.t));
699
+ } }), a.map((e) => k(e, this.#t.t));
756
700
  }, this.provideAddNodeOptions = async (e, t) => {
757
701
  if (this.#p) return;
758
- let n = this.#u.$.projectId.value;
702
+ let n = this.#u.$.flowId.value;
759
703
  if (n == null) return;
760
- let r = e.trim(), i = r.length == 0 ? Object.values(this.#l.value.actions) : await this.#e.searchConnectorActions(n, r, t);
761
- if (t.aborted || this.#p || n != this.#u.$.projectId.value) 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;
762
706
  let a = { ...this.#l.value.actions };
763
707
  for (let e of i) a[e.actionId] = e;
764
- if (this.#v({ actions: a }), r.length != 0) return i.map((e) => j(e, this.#t.t));
708
+ if (this.#v({ actions: a }), r.length != 0) return i.map((e) => k(e, this.#t.t));
765
709
  let o = new Map(i.map((e) => [e.actionId, e]));
766
710
  for (let e of this.#u.$.revision.value?.connectorActionIds ?? []) {
767
711
  let t = a[e];
@@ -769,9 +713,9 @@ var be = class {
769
713
  }
770
714
  return _e([...o.values()], this.#t.t);
771
715
  }, this.#e = r, this.#n = o, this.#u = i, this.#c = a, this.#t = s;
772
- let c = e(this.#l, (e) => e.actions), l = e(this.#l, (e) => e.catalogs);
716
+ let c = e(this.#l, (e) => e.actions), u = e(this.#l, (e) => e.catalogs);
773
717
  this.#s = n((e) => {
774
- let t = ye(e(i.$.selection)), n = e(this.#l);
718
+ let t = A(e(i.$.selection)), n = e(this.#l);
775
719
  if (t == null) return { authorizationPending: !1 };
776
720
  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);
777
721
  return o == null && r?.defaultConnection?.connectionId == t.connectionId && (o = r.defaultConnection), {
@@ -785,7 +729,7 @@ var be = class {
785
729
  }), this.$ = {
786
730
  actionLoading: e(this.#l, (e) => e.actionLoading),
787
731
  actions: c,
788
- catalogs: l,
732
+ catalogs: u,
789
733
  connectionLoading: e(this.#l, (e) => e.connectionLoading),
790
734
  selectedAction: e(this.#s, (e) => e.action),
791
735
  selectedActionError: e(this.#s, (e) => e.actionError),
@@ -801,11 +745,11 @@ var be = class {
801
745
  this.#s.dispose(), this.#l.dispose();
802
746
  }
803
747
  reset() {
804
- this.#p || (this.#a.invalidate(), this.#d = void 0, this.#r.clear(), this.#f = void 0, this.#i.clear(), this.#l.set(k));
748
+ this.#p || (this.#a.invalidate(), this.#d = void 0, this.#r.clear(), this.#f = void 0, this.#i.clear(), this.#l.set(D));
805
749
  }
806
750
  async refresh(e = !1) {
807
751
  if (this.#p) return;
808
- let t = this.#a.begin(), n = this.#u.$.projectId.value, r = ye(this.#u.$.selection.value);
752
+ let t = this.#a.begin(), n = this.#u.$.flowId.value, r = A(this.#u.$.selection.value);
809
753
  if (n == null || r == null) {
810
754
  (this.#l.value.actionLoading != null || this.#l.value.connectionLoading != null) && this.#v({
811
755
  actionLoading: void 0,
@@ -820,7 +764,7 @@ var be = class {
820
764
  connectionLoading: void 0
821
765
  });
822
766
  try {
823
- let i = await this.#m(n, r.actionId, e);
767
+ let i = await this.#m(r.actionId, e);
824
768
  if (!this.#y(t, n)) return;
825
769
  this.#v({ actions: {
826
770
  ...this.#l.value.actions,
@@ -829,7 +773,7 @@ var be = class {
829
773
  } catch (e) {
830
774
  this.#y(t, n) && this.#v({ actionError: {
831
775
  actionId: r.actionId,
832
- message: o(e, this.#t.t).message
776
+ message: u(e, this.#t.t).message
833
777
  } });
834
778
  } finally {
835
779
  this.#y(t, n) && this.#l.value.actionLoading == r.actionId && this.#v({ actionLoading: void 0 });
@@ -837,24 +781,24 @@ var be = class {
837
781
  }
838
782
  async connect(e) {
839
783
  if (this.#p) return;
840
- let t = this.#u.$.projectId.value;
784
+ let t = this.#u.$.flowId.value;
841
785
  if (t == null) return;
842
786
  let n = this.#l.value.catalogs[e];
843
787
  try {
844
- if (!await this.#n.openExternalPage(() => this.#e.createConnectorConnectionPage(t, e))) {
788
+ if (!await this.#n.openExternalPage(() => this.#e.createConnectorConnectionPage(e))) {
845
789
  this.#c({
846
790
  kind: "error",
847
791
  message: this.#t.t("notice.connectionPopupBlocked")
848
792
  });
849
793
  return;
850
794
  }
851
- if (this.#p || t != this.#u.$.projectId.value) return;
795
+ if (this.#p || t != this.#u.$.flowId.value) return;
852
796
  this.#d = {
853
797
  connectionIds: new Set(n?.all.map((e) => e.connectionId)),
854
798
  serviceId: e
855
799
  }, this.#v({ authorizationServiceId: e });
856
800
  } catch (e) {
857
- this.#p || this.#c(o(e, this.#t.t));
801
+ this.#p || this.#c(u(e, this.#t.t));
858
802
  }
859
803
  }
860
804
  async setConnection(e, t) {
@@ -865,9 +809,9 @@ var be = class {
865
809
  let e = this.#d.serviceId;
866
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);
867
811
  }
868
- async #m(e, t, n) {
869
- let r = this.#l.value.actions[t];
870
- return !n && r != null ? r : await this.#e.getConnectorAction(e, t);
812
+ async #m(e, t) {
813
+ let n = this.#l.value.actions[e];
814
+ return !t && n != null ? n : await this.#e.getConnectorAction(e);
871
815
  }
872
816
  async #h(e, t, n, r, i) {
873
817
  this.#v({ connectionLoading: n });
@@ -884,20 +828,20 @@ var be = class {
884
828
  if (!n && i != null) return i;
885
829
  let a;
886
830
  try {
887
- a = await this.#e.listConnectorConnections(e, t);
831
+ a = await this.#e.listConnectorConnections(t);
888
832
  } catch (n) {
889
833
  this.#y(r, e) && this.#v({ connectionError: {
890
- message: o(n, this.#t.t).message,
834
+ message: u(n, this.#t.t).message,
891
835
  serviceId: t
892
836
  } });
893
837
  return;
894
838
  }
895
839
  if (!this.#y(r, e)) return;
896
- let c = s(a);
840
+ let o = d(a);
897
841
  return this.#v({ catalogs: {
898
842
  ...this.#l.value.catalogs,
899
- [t]: c
900
- } }), c;
843
+ [t]: o
844
+ } }), o;
901
845
  }
902
846
  async #_(e, t, n) {
903
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);
@@ -910,17 +854,17 @@ var be = class {
910
854
  });
911
855
  }
912
856
  #y(e, t) {
913
- return !this.#p && e() && t == this.#u.$.projectId.value;
857
+ return !this.#p && e() && t == this.#u.$.flowId.value;
914
858
  }
915
859
  async #b() {
916
860
  if (this.#p) return;
917
- let e = this.#a.capture(), t = this.#u.$.projectId.value, n = this.#u.$.revision.value;
861
+ let e = this.#a.capture(), t = this.#u.$.flowId.value, n = this.#u.$.revision.value;
918
862
  if (t == null || n == null) return;
919
863
  let r = [...n.connectorActionIds].filter((e) => this.#l.value.actions[e] == null && !this.#i.has(e));
920
864
  if (r.length != 0) {
921
865
  for (let e of r) this.#i.add(e);
922
866
  try {
923
- let n = await Promise.all(r.map((e) => this.#e.getConnectorAction(t, e)));
867
+ let n = await Promise.all(r.map((e) => this.#e.getConnectorAction(e)));
924
868
  if (!this.#y(e, t)) return;
925
869
  let i = { ...this.#l.value.actions };
926
870
  for (let e of n) i[e.actionId] = e;
@@ -932,8 +876,8 @@ var be = class {
932
876
  }
933
877
  }
934
878
  }
935
- }, M = { catalogs: {} }, N = 4, P = "trigger:";
936
- function F(e, t) {
879
+ }, j = { catalogs: {} }, M = 4, N = "trigger:";
880
+ function P(e, t) {
937
881
  if (e?.kind != "trigger") return;
938
882
  let n = e.trigger;
939
883
  if (n.kind != "poll" && n.kind != "integration") return;
@@ -944,7 +888,7 @@ function F(e, t) {
944
888
  triggerId: e.id
945
889
  };
946
890
  }
947
- function I(e, t, n, r) {
891
+ function F(e, t, n, r) {
948
892
  return {
949
893
  description: n,
950
894
  group: r,
@@ -963,12 +907,12 @@ function I(e, t, n, r) {
963
907
  }
964
908
  };
965
909
  }
966
- function xe(e, t) {
910
+ function I(e, t) {
967
911
  return {
968
912
  choices: [],
969
913
  description: t.t("addNode.triggerChooseConnection"),
970
914
  group: t.t("addNode.triggers"),
971
- id: `${P}${e.key}`,
915
+ id: `${N}${e.key}`,
972
916
  inputs: [],
973
917
  kind: "trigger",
974
918
  label: e.displayName,
@@ -977,10 +921,10 @@ function xe(e, t) {
977
921
  }
978
922
  function L(e, t, n) {
979
923
  let r = n.t("addNode.triggers"), i = t.preferred;
980
- return i == null ? t.active.length > 0 ? t.active.map((t) => I(e, t.connectionId, t.displayName, r)) : [{
924
+ return i == null ? t.active.length > 0 ? t.active.map((t) => F(e, t.connectionId, t.displayName, r)) : [{
981
925
  description: n.t("addNode.triggerNeedsConnection", { provider: e.provider }),
982
926
  group: r,
983
- id: `${P}${e.key}:connect`,
927
+ id: `${N}${e.key}:connect`,
984
928
  inputs: [],
985
929
  kind: "trigger",
986
930
  label: n.t("addNode.triggerAddConnection"),
@@ -989,12 +933,12 @@ function L(e, t, n) {
989
933
  kind: "connect",
990
934
  provider: e.provider
991
935
  }
992
- }] : [I(e, i.connectionId, i.displayName, r)];
936
+ }] : [F(e, i.connectionId, i.displayName, r)];
993
937
  }
994
- function Se(e, t, n) {
938
+ function be(e, t, n) {
995
939
  let r = t.preferred;
996
- if (r != null) return I(e, r.connectionId, r.displayName, n.t("addNode.triggers"));
997
- let i = xe(e, n), a = L(e, t, n);
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);
998
942
  return {
999
943
  ...i,
1000
944
  description: t.active.length == 0 ? n.t("addNode.triggerNeedsConnection", { provider: e.provider }) : i.description,
@@ -1009,7 +953,7 @@ function Se(e, t, n) {
1009
953
  }))
1010
954
  };
1011
955
  }
1012
- var Ce = class {
956
+ var xe = class {
1013
957
  #e;
1014
958
  #t;
1015
959
  #n;
@@ -1021,19 +965,19 @@ var Ce = class {
1021
965
  #c;
1022
966
  #l;
1023
967
  #u;
1024
- constructor(r, i, a, o, c = y()) {
1025
- this.#t = new AbortController(), this.#a = new S(), this.#c = t(M), this.#u = !1, this.browseAddNodeOptions = async (e) => {
1026
- let t = this.#l.$.projectId.value;
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) => {
970
+ let t = this.#l.$.flowId.value;
1027
971
  if (e.aborted || this.#u || t == null || this.#l.$.target.value?.kind != "flow") return [];
1028
972
  let n = await this.#d();
1029
- if (!(e.aborted || this.#u || t != this.#l.$.projectId.value)) return [...n.values()].map((e) => xe(e, this.#i));
973
+ if (!(e.aborted || this.#u || t != this.#l.$.flowId.value)) return [...n.values()].map((e) => I(e, this.#i));
1030
974
  }, this.provideAddNodeOptions = async (e, t) => {
1031
- let n = this.#l.$.projectId.value;
975
+ let n = this.#l.$.flowId.value;
1032
976
  if (t.aborted || this.#u || n == null || this.#l.$.target.value?.kind != "flow") return [];
1033
977
  let r = e.trim().toLowerCase();
1034
978
  if (r.length == 0) return [];
1035
979
  let i = await this.#d();
1036
- if (t.aborted || this.#u || n != this.#l.$.projectId.value) return;
980
+ if (t.aborted || this.#u || n != this.#l.$.flowId.value) return;
1037
981
  let a = [...i.values()].filter((e) => [
1038
982
  e.description,
1039
983
  e.displayName,
@@ -1042,31 +986,31 @@ var Ce = class {
1042
986
  e.provider,
1043
987
  e.type
1044
988
  ].some((e) => e.toLowerCase().includes(r))), o = [...new Set(a.map((e) => e.provider))].filter((e) => this.#c.value.catalogs[e] == null);
1045
- for (let e = 0; e < o.length; e += N) {
1046
- let r = await Promise.all(o.slice(e, e + N).map(async (e) => [e, s(await this.#n.listConnectorConnections(n, e, t))]));
1047
- if (t.aborted || this.#u || n != this.#l.$.projectId.value) return;
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))]));
991
+ if (t.aborted || this.#u || n != this.#l.$.flowId.value) return;
1048
992
  this.#f({ catalogs: {
1049
993
  ...this.#c.value.catalogs,
1050
994
  ...Object.fromEntries(r)
1051
995
  } });
1052
996
  }
1053
- return a.map((e) => Se(e, this.#c.value.catalogs[e.provider], this.#i));
997
+ return a.map((e) => be(e, this.#c.value.catalogs[e.provider], this.#i));
1054
998
  }, this.provideAddNodeOptionChoices = async (e, t) => {
1055
- let n = this.#l.$.projectId.value, r = e.startsWith(P) ? e.slice(8) : void 0;
999
+ let n = this.#l.$.flowId.value, r = e.startsWith(N) ? e.slice(8) : void 0;
1056
1000
  if (t.aborted || this.#u || n == null || r == null || this.#l.$.target.value?.kind != "flow") return;
1057
1001
  let i = (await this.#d()).get(r);
1058
- if (t.aborted || this.#u || n != this.#l.$.projectId.value || i == null) return;
1002
+ if (t.aborted || this.#u || n != this.#l.$.flowId.value || i == null) return;
1059
1003
  let a = this.#c.value.catalogs[i.provider];
1060
1004
  if (a == null) {
1061
- if (a = s(await this.#n.listConnectorConnections(n, i.provider, t)), t.aborted || this.#u || n != this.#l.$.projectId.value) return;
1005
+ if (a = d(await this.#n.listConnectorConnections(i.provider, t)), t.aborted || this.#u || n != this.#l.$.flowId.value) return;
1062
1006
  this.#f({ catalogs: {
1063
1007
  ...this.#c.value.catalogs,
1064
1008
  [i.provider]: a
1065
1009
  } });
1066
1010
  }
1067
1011
  return L(i, a, this.#i);
1068
- }, this.#n = r, this.#r = o, this.#i = c, this.#s = a, this.#l = i, this.#o = n((e) => {
1069
- let t = e(i.$.selection), n = F(t, i), r = e(this.#c);
1012
+ }, 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);
1070
1014
  if (t?.kind != "trigger") return { authorizationPending: !1 };
1071
1015
  let a = t.trigger;
1072
1016
  if (a.kind != "poll" && a.kind != "integration") return { authorizationPending: !1 };
@@ -1093,10 +1037,10 @@ var Ce = class {
1093
1037
  this.#o.dispose(), this.#c.dispose();
1094
1038
  }
1095
1039
  reset() {
1096
- this.#u || (this.#t.abort(), this.#t = new AbortController(), this.#e = void 0, this.#a.invalidate(), this.#c.set(M));
1040
+ this.#u || (this.#t.abort(), this.#t = new AbortController(), this.#e = void 0, this.#a.invalidate(), this.#c.set(j));
1097
1041
  }
1098
1042
  async refresh(e = !1) {
1099
- let t = this.#a.begin(), n = this.#l.$.projectId.value, r = F(this.#l.$.selection.value, this.#l);
1043
+ let t = this.#a.begin(), n = this.#l.$.flowId.value, r = P(this.#l.$.selection.value, this.#l);
1100
1044
  if (!this.#u) {
1101
1045
  if (n == null || r == null) {
1102
1046
  this.#c.value.connectionLoading != null && this.#f({ connectionLoading: void 0 });
@@ -1108,7 +1052,7 @@ var Ce = class {
1108
1052
  connectionLoading: r.provider
1109
1053
  });
1110
1054
  try {
1111
- let e = s(await this.#n.listConnectorConnections(n, r.provider));
1055
+ let e = d(await this.#n.listConnectorConnections(r.provider));
1112
1056
  if (!this.#p(t, n)) return;
1113
1057
  this.#f({ catalogs: {
1114
1058
  ...this.#c.value.catalogs,
@@ -1116,7 +1060,7 @@ var Ce = class {
1116
1060
  } });
1117
1061
  } catch (e) {
1118
1062
  this.#p(t, n) && this.#f({ connectionError: {
1119
- message: o(e, this.#i.t).message,
1063
+ message: u(e, this.#i.t).message,
1120
1064
  provider: r.provider
1121
1065
  } });
1122
1066
  } finally {
@@ -1126,18 +1070,18 @@ var Ce = class {
1126
1070
  }
1127
1071
  }
1128
1072
  async connect(e) {
1129
- let t = this.#l.$.projectId.value;
1073
+ let t = this.#l.$.flowId.value;
1130
1074
  if (!(this.#u || t == null)) try {
1131
- if (!await this.#r.openExternalPage(() => this.#n.createConnectorConnectionPage(t, e))) {
1075
+ if (!await this.#r.openExternalPage(() => this.#n.createConnectorConnectionPage(e))) {
1132
1076
  this.#s({
1133
1077
  kind: "error",
1134
1078
  message: this.#i.t("notice.connectionPopupBlocked")
1135
1079
  });
1136
1080
  return;
1137
1081
  }
1138
- !this.#u && t == this.#l.$.projectId.value && this.#f({ authorizationProvider: e });
1082
+ !this.#u && t == this.#l.$.flowId.value && this.#f({ authorizationProvider: e });
1139
1083
  } catch (e) {
1140
- this.#u || this.#s(o(e, this.#i.t));
1084
+ this.#u || this.#s(u(e, this.#i.t));
1141
1085
  }
1142
1086
  }
1143
1087
  async setConnection(e, t) {
@@ -1153,7 +1097,7 @@ var Ce = class {
1153
1097
  delete t[e], this.#f({
1154
1098
  authorizationProvider: void 0,
1155
1099
  catalogs: t
1156
- }), F(this.#l.$.selection.value, this.#l)?.provider == e && await this.refresh(!0);
1100
+ }), P(this.#l.$.selection.value, this.#l)?.provider == e && await this.refresh(!0);
1157
1101
  }
1158
1102
  #d() {
1159
1103
  if (this.#e != null) return this.#e;
@@ -1169,11 +1113,11 @@ var Ce = class {
1169
1113
  });
1170
1114
  }
1171
1115
  #p(e, t) {
1172
- return !this.#u && e() && t == this.#l.$.projectId.value;
1116
+ return !this.#u && e() && t == this.#l.$.flowId.value;
1173
1117
  }
1174
1118
  };
1175
1119
  //#endregion
1176
- //#region src/project/common/edgeChanges.ts
1120
+ //#region src/flow/common/edgeChanges.ts
1177
1121
  function R(e, t, n) {
1178
1122
  let r = {
1179
1123
  source: n.source,
@@ -1187,7 +1131,7 @@ function R(e, t, n) {
1187
1131
  target: t
1188
1132
  }];
1189
1133
  }
1190
- function we(e, t, n) {
1134
+ function Se(e, t, n) {
1191
1135
  let r = {
1192
1136
  source: n.source,
1193
1137
  sourceHandle: n.sourceHandle,
@@ -1201,36 +1145,11 @@ function we(e, t, n) {
1201
1145
  }];
1202
1146
  }
1203
1147
  function z(e, t) {
1204
- return t.kind == "flow" ? e.document.flows[t.id]?.graph : e.document.subflows[t.id]?.graph;
1205
- }
1206
- //#endregion
1207
- //#region src/project/common/flowChanges.ts
1208
- function Te(e, t) {
1209
- return [{
1210
- flow: {
1211
- graph: { nodes: {} },
1212
- name: t
1213
- },
1214
- flowId: e,
1215
- kind: "flow.create"
1216
- }];
1217
- }
1218
- function Ee(e, t) {
1219
- return [{
1220
- flowId: e,
1221
- kind: "flow.rename",
1222
- name: t
1223
- }];
1224
- }
1225
- function De(e) {
1226
- return [{
1227
- flowId: e,
1228
- kind: "flow.delete"
1229
- }];
1148
+ return t.kind == "flow" ? e.document.graph : e.document.subflows[t.id]?.graph;
1230
1149
  }
1231
1150
  //#endregion
1232
- //#region src/project/common/moduleChanges.ts
1233
- async function Oe(e) {
1151
+ //#region src/flow/common/moduleChanges.ts
1152
+ async function Ce(e) {
1234
1153
  try {
1235
1154
  let { parse: t } = await import("./lib-GrGxYjsJ.js"), n = t(e, {
1236
1155
  errorRecovery: !0,
@@ -1246,7 +1165,7 @@ async function Oe(e) {
1246
1165
  return [];
1247
1166
  }
1248
1167
  }
1249
- function ke(e, t, n) {
1168
+ function we(e, t, n) {
1250
1169
  return [{
1251
1170
  imports: n,
1252
1171
  kind: "module.source.replace",
@@ -1255,20 +1174,22 @@ function ke(e, t, n) {
1255
1174
  }];
1256
1175
  }
1257
1176
  //#endregion
1258
- //#region src/project/common/nodeChanges.ts
1259
- function Ae(e, t, n, r = {
1177
+ //#region src/flow/common/nodeChanges.ts
1178
+ function Te(e, t, n, r = {
1260
1179
  imports: [],
1261
1180
  source: "export default function run(input) {\n return { result: input.value }\n}\n"
1262
1181
  }, i = {
1263
- inputs: { value: {
1182
+ inputs: [{
1183
+ handle: "value",
1264
1184
  jsonSchema: {},
1265
1185
  nullable: !0,
1266
1186
  value: null
1267
- } },
1268
- outputs: { result: {
1187
+ }],
1188
+ outputs: [{
1189
+ handle: "result",
1269
1190
  jsonSchema: {},
1270
1191
  nullable: !0
1271
- } }
1192
+ }]
1272
1193
  }) {
1273
1194
  return [{
1274
1195
  kind: "module.create",
@@ -1313,15 +1234,16 @@ function B(e, t, n) {
1313
1234
  target: e
1314
1235
  }];
1315
1236
  }
1316
- function je(e, t, n, r, i, a = {}) {
1237
+ function Ee(e, t, n, r, i, a = {}) {
1317
1238
  let o = a.inputs ?? {};
1318
1239
  return B(e, t, {
1319
1240
  executor: {
1320
1241
  kind: "llm",
1321
1242
  mode: r
1322
1243
  },
1323
- inputs: {
1324
- messages: {
1244
+ inputs: [
1245
+ {
1246
+ handle: "messages",
1325
1247
  jsonSchema: {
1326
1248
  items: { type: "object" },
1327
1249
  type: "array"
@@ -1329,12 +1251,14 @@ function je(e, t, n, r, i, a = {}) {
1329
1251
  nullable: !0,
1330
1252
  value: W(o, "messages", null)
1331
1253
  },
1332
- input: {
1254
+ {
1255
+ handle: "input",
1333
1256
  jsonSchema: { type: "string" },
1334
1257
  nullable: !1,
1335
1258
  value: W(o, "input", "Alex")
1336
1259
  },
1337
- template: {
1260
+ {
1261
+ handle: "template",
1338
1262
  jsonSchema: {
1339
1263
  items: { type: "object" },
1340
1264
  minItems: 1,
@@ -1346,21 +1270,24 @@ function je(e, t, n, r, i, a = {}) {
1346
1270
  role: "user"
1347
1271
  }])
1348
1272
  },
1349
- model: {
1273
+ {
1274
+ handle: "model",
1350
1275
  jsonSchema: { type: "object" },
1351
1276
  nullable: !1,
1352
1277
  value: W(o, "model", { model: "deepseek-v4-flash" })
1353
1278
  }
1354
- },
1279
+ ],
1355
1280
  name: n,
1356
- outputs: { output: a.output ?? {
1357
- description: i,
1358
- jsonSchema: r == "chat" ? { type: "string" } : {},
1359
- nullable: !1
1360
- } }
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
+ }]
1361
1288
  });
1362
1289
  }
1363
- function Me(e, t, n) {
1290
+ function De(e, t, n) {
1364
1291
  return [{
1365
1292
  kind: "graph.node.create",
1366
1293
  node: {
@@ -1391,7 +1318,7 @@ function Me(e, t, n) {
1391
1318
  target: e
1392
1319
  }];
1393
1320
  }
1394
- function Ne(e, t, n) {
1321
+ function Oe(e, t, n) {
1395
1322
  return [{
1396
1323
  kind: "graph.node.create",
1397
1324
  node: {
@@ -1399,11 +1326,12 @@ function Ne(e, t, n) {
1399
1326
  inputs: {},
1400
1327
  kind: "value",
1401
1328
  name: n,
1402
- values: { value: {
1329
+ values: [{
1330
+ handle: "value",
1403
1331
  jsonSchema: {},
1404
1332
  nullable: !0,
1405
1333
  value: null
1406
- } }
1334
+ }]
1407
1335
  },
1408
1336
  nodeId: t,
1409
1337
  target: e
@@ -1417,7 +1345,7 @@ function V(e, t, n) {
1417
1345
  target: e
1418
1346
  }];
1419
1347
  }
1420
- function Pe(e, t, n, r) {
1348
+ function ke(e, t, n, r) {
1421
1349
  let i = r.name ?? n.displayName, a = n.type == "poll" ? {
1422
1350
  bindingId: t.bindingId,
1423
1351
  config: r.config,
@@ -1450,7 +1378,7 @@ function Pe(e, t, n, r) {
1450
1378
  target: e
1451
1379
  }];
1452
1380
  }
1453
- function Fe(e, t, n) {
1381
+ function Ae(e, t, n) {
1454
1382
  let r = H(e, t)?.nodes;
1455
1383
  if (r == null) return [];
1456
1384
  let i = new Set(n), a = n.flatMap((e) => {
@@ -1469,13 +1397,13 @@ function Fe(e, t, n) {
1469
1397
  let t = r[e];
1470
1398
  return t?.kind == "poll" || t?.kind == "integration" ? [t.bindingId] : [];
1471
1399
  }));
1472
- for (let n of o) Object.entries(e.document.flows).some(([e, r]) => Object.entries(r.graph.nodes).some(([r, a]) => !(e == t.id && i.has(r)) && (a.kind == "poll" || a.kind == "integration") && a.bindingId == n)) || a.push({
1473
- bindingId: n,
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,
1474
1402
  kind: "binding.delete"
1475
1403
  });
1476
1404
  return a;
1477
1405
  }
1478
- function Ie(e, t, n, r) {
1406
+ function je(e, t, n, r) {
1479
1407
  let i = H(e, t)?.nodes[n];
1480
1408
  if (i == null || !("inputs" in i)) return;
1481
1409
  let { concurrency: a, name: o, timeoutMs: s, ...c } = i;
@@ -1484,10 +1412,10 @@ function Ie(e, t, n, r) {
1484
1412
  ...r
1485
1413
  });
1486
1414
  }
1487
- function Le(e, t, n, r, i) {
1488
- return Re(e, t, n, { [r]: i });
1415
+ function Me(e, t, n, r, i) {
1416
+ return Ne(e, t, n, { [r]: i });
1489
1417
  }
1490
- function Re(e, t, n, r) {
1418
+ function Ne(e, t, n, r) {
1491
1419
  let i = H(e, t)?.nodes[n];
1492
1420
  if (i == null || !("inputs" in i)) return;
1493
1421
  let a = { ...i.inputs };
@@ -1500,7 +1428,7 @@ function Re(e, t, n, r) {
1500
1428
  inputs: a
1501
1429
  });
1502
1430
  }
1503
- function ze(e, t, n) {
1431
+ function Pe(e, t, n) {
1504
1432
  let r = e.document.tasks[t];
1505
1433
  if (!(r == null || !("executor" in r) || r.executor.kind != "connector")) return [{
1506
1434
  kind: "task.replace",
@@ -1514,11 +1442,12 @@ function ze(e, t, n) {
1514
1442
  taskId: t
1515
1443
  }];
1516
1444
  }
1517
- function Be(e, t, n, r) {
1518
- let i = e.document.flows[t.id]?.graph.nodes[n];
1445
+ function Fe(e, t, n, r) {
1446
+ let i = e.document.graph.nodes[n];
1519
1447
  if (i == null) return;
1520
1448
  let a = {
1521
1449
  ...r.description == null ? {} : { description: r.description },
1450
+ icon: i.icon,
1522
1451
  name: r.name
1523
1452
  }, o;
1524
1453
  switch (r.kind) {
@@ -1562,8 +1491,8 @@ function Be(e, t, n, r) {
1562
1491
  }
1563
1492
  return G(t, n, o);
1564
1493
  }
1565
- function Ve(e, t, n, r, i) {
1566
- let a = e.document.flows[t.id]?.graph.nodes[n];
1494
+ function Ie(e, t, n, r, i) {
1495
+ let a = e.document.graph.nodes[n];
1567
1496
  if (a == null || a.kind != "integration" && a.kind != "poll") return;
1568
1497
  let o = { ...a.config };
1569
1498
  return i === void 0 ? delete o[r] : o[r] = i, G(t, n, {
@@ -1571,8 +1500,8 @@ function Ve(e, t, n, r, i) {
1571
1500
  config: o
1572
1501
  });
1573
1502
  }
1574
- function He(e, t, n, r) {
1575
- let i = e.document.flows[t.id]?.graph.nodes[n];
1503
+ function Le(e, t, n, r) {
1504
+ let i = e.document.graph.nodes[n];
1576
1505
  if (i != null) switch (i.kind) {
1577
1506
  case "cron": return G(t, n, {
1578
1507
  ...i,
@@ -1587,8 +1516,8 @@ function He(e, t, n, r) {
1587
1516
  default: return;
1588
1517
  }
1589
1518
  }
1590
- function Ue(e, t, n, r) {
1591
- let i = e.document.flows[t.id]?.graph.nodes[n];
1519
+ function Re(e, t, n, r) {
1520
+ let i = e.document.graph.nodes[n];
1592
1521
  if (!(i == null || i.kind != "poll" && i.kind != "integration") && e.document.bindings[i.bindingId]?.kind == "connection") return [{
1593
1522
  binding: {
1594
1523
  kind: "connection",
@@ -1599,12 +1528,12 @@ function Ue(e, t, n, r) {
1599
1528
  }];
1600
1529
  }
1601
1530
  function H(e, t) {
1602
- return t.kind == "flow" ? e.document.flows[t.id]?.graph : e.document.subflows[t.id]?.graph;
1531
+ return t.kind == "flow" ? e.document.graph : e.document.subflows[t.id]?.graph;
1603
1532
  }
1604
1533
  function U(e) {
1605
- return Object.fromEntries(Object.entries(e).flatMap(([e, t]) => Object.hasOwn(t, "value") ? [[e, {
1534
+ return Object.fromEntries(e.flatMap((e) => Object.hasOwn(e, "value") ? [[e.handle, {
1606
1535
  kind: "value",
1607
- value: t.value
1536
+ value: e.value
1608
1537
  }]] : []));
1609
1538
  }
1610
1539
  function W(e, t, n) {
@@ -1619,106 +1548,45 @@ function G(e, t, n) {
1619
1548
  }];
1620
1549
  }
1621
1550
  //#endregion
1622
- //#region src/workbench/browser/runtime/designer/diagnostics.ts
1551
+ //#region src/workbench/browser/runtime/designer/flowChanges.ts
1623
1552
  function K(e, t) {
1624
- return t == e || t.startsWith(`${e}/`);
1625
- }
1626
- function We(e, t) {
1627
- return t.kind == "flow" ? t.id : e.flowIdsUsingSubflow(t.id)[0];
1628
- }
1629
- function Ge(e, t, n, r) {
1630
- if (e == null || t == null || n == null) return [];
1631
- if (r != null) return Xe(t, r, n.diagnostics);
1632
- let i = `/document/${t.kind == "flow" ? "flows" : "subflows"}/${t.id}`;
1633
- return n.diagnostics.filter((e) => K(i, e.path));
1634
- }
1635
- function Ke(e) {
1636
- return e.startsWith("/modules/") ? "code" : /\/graph\/nodes\/[^/]+\/task(?:\/|$)/.test(e) ? "task" : e.includes("/graph/nodes/") ? "node" : e.startsWith("/document/tasks/") ? "task" : e.startsWith("/document/flows/") ? "flow" : "project";
1637
- }
1638
- function qe(e, t) {
1639
- 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";
1640
- }
1641
- function Je(e, t, n) {
1642
- if (e == null || t == null) return;
1643
- let r = `/document/${t.kind == "flow" ? "flows" : "subflows"}/${t.id}/graph/nodes/`;
1644
- if (n.path.startsWith(r)) {
1645
- let i = n.path.slice(r.length), a = i.indexOf("/"), o = a < 0 ? i : i.slice(0, a), s = e.node(t, o);
1646
- return s == null ? void 0 : {
1647
- nodeId: o,
1648
- section: qe(s.node, a < 0 ? "" : i.slice(a))
1649
- };
1650
- }
1651
- let i = /^\/document\/tasks\/([^/]+)(.*)$/.exec(n.path);
1652
- if (i != null) {
1653
- let n = e.findTaskNode(t, /* @__PURE__ */ new Set([i[1]]));
1654
- return n == null ? void 0 : {
1655
- nodeId: n,
1656
- section: i[2].startsWith("/executor") ? "account" : "task"
1657
- };
1658
- }
1659
- let a = /^\/modules\/([^/]+)\/source$/.exec(n.path);
1660
- if (a != null) {
1661
- let n = e.findModuleNode(t, a[1]);
1662
- if (n != null) return {
1663
- nodeId: n,
1664
- section: "module"
1665
- };
1666
- }
1667
- }
1668
- function Ye(e, t, n) {
1669
- return n?.diagnostics.map((n) => ({
1670
- diagnostic: n,
1671
- location: Je(e, t, n),
1672
- scope: Ke(n.path)
1673
- })) ?? [];
1674
- }
1675
- function Xe(e, t, n) {
1676
- let r = `/document/${e.kind == "flow" ? "flows" : "subflows"}/${e.id}/graph/nodes/${t.id}`, i = [r];
1677
- if (t.kind == "task") {
1678
- t.node.task == null ? i.push(`/document/tasks/${t.node.taskId}`) : i.push(`${r}/task`);
1679
- let e = t.definition != null && "moduleId" in t.definition ? t.definition.moduleId : void 0;
1680
- e != null && i.push(`/modules/${e}`);
1681
- } else t.kind == "subflow" && i.push(`/document/subflows/${t.node.subflowId}`);
1682
- return n.filter((e) => i.some((t) => K(t, e.path)));
1683
- }
1684
- //#endregion
1685
- //#region src/workbench/browser/runtime/designer/projectChanges.ts
1686
- function q(e, t) {
1687
1553
  return {
1688
1554
  ...e,
1689
- content: r(e.content, t)
1555
+ content: i(e.content, t)
1690
1556
  };
1691
1557
  }
1692
- function Ze(e, t, n) {
1693
- return e == "flow" ? Te(t, n) : [{
1558
+ function ze(e, t) {
1559
+ return [{
1694
1560
  kind: "subflow.create",
1695
1561
  subflow: {
1696
1562
  graph: { nodes: {} },
1697
- inputs: { value: {
1563
+ inputs: [{
1564
+ handle: "value",
1698
1565
  jsonSchema: {},
1699
1566
  nullable: !0,
1700
1567
  value: null
1701
- } },
1702
- name: n,
1703
- outputs: { result: {
1568
+ }],
1569
+ name: t,
1570
+ outputs: [{
1571
+ handle: "result",
1704
1572
  jsonSchema: {},
1705
1573
  nullable: !0,
1706
1574
  sources: [{
1707
1575
  input: "value",
1708
1576
  kind: "flow"
1709
1577
  }]
1710
- } }
1578
+ }]
1711
1579
  },
1712
- subflowId: t
1580
+ subflowId: e
1713
1581
  }];
1714
1582
  }
1715
- function Qe(e, t, n, r, i) {
1583
+ function Be(e, t, n, r, i) {
1716
1584
  switch (r.kind) {
1717
- case "code": return Ae(t, {
1585
+ case "code": return Te(t, {
1718
1586
  moduleId: i(),
1719
1587
  nodeId: n
1720
1588
  }, r.name);
1721
- case "llm": return je(t, {
1589
+ case "llm": return Ee(t, {
1722
1590
  nodeId: n,
1723
1591
  taskId: i()
1724
1592
  }, r.name, r.mode, r.outputDescription);
@@ -1731,15 +1599,15 @@ function Qe(e, t, n, r, i) {
1731
1599
  ...r.action.defaultConnection == null ? {} : { connectionId: r.action.defaultConnection.connectionId },
1732
1600
  kind: "connector"
1733
1601
  },
1734
- inputs: r.action.inputs,
1602
+ inputs: Object.entries(r.action.inputs).map(([e, t]) => Object.assign({ handle: e }, t)),
1735
1603
  name: r.action.name,
1736
- outputs: r.action.outputs
1604
+ outputs: Object.entries(r.action.outputs).map(([e, t]) => Object.assign({ handle: e }, t))
1737
1605
  });
1738
- case "condition": return Me(t, n, r.name);
1739
- case "value": return Ne(t, n, r.name);
1606
+ case "condition": return De(t, n, r.name);
1607
+ case "value": return Oe(t, n, r.name);
1740
1608
  case "subflow": {
1741
1609
  let i = e.subflow(r.subflowId);
1742
- return i == null ? void 0 : dt(t, n, r.subflowId, i.inputs);
1610
+ return i == null ? void 0 : tt(t, n, r.subflowId, i.inputs);
1743
1611
  }
1744
1612
  case "webhook": return t.kind == "flow" ? V(t, n, {
1745
1613
  inputsDef: [],
@@ -1755,7 +1623,7 @@ function Qe(e, t, n, r, i) {
1755
1623
  kind: "cron",
1756
1624
  name: r.name
1757
1625
  }) : void 0;
1758
- case "provider-trigger": return t.kind == "flow" ? Pe(t, {
1626
+ case "provider-trigger": return t.kind == "flow" ? ke(t, {
1759
1627
  bindingId: i(),
1760
1628
  nodeId: n
1761
1629
  }, r.definition, {
@@ -1764,10 +1632,10 @@ function Qe(e, t, n, r, i) {
1764
1632
  }) : void 0;
1765
1633
  }
1766
1634
  }
1767
- function $e(e, t, n) {
1768
- return Fe(e.revision.content, t, n);
1635
+ function Ve(e, t, n) {
1636
+ return Ae(e.revision.content, t, n);
1769
1637
  }
1770
- function et(e, t, n) {
1638
+ function He(e, t, n) {
1771
1639
  let r = e.graph(t)?.nodes ?? {}, i = Object.fromEntries(n.flatMap((e) => r[e] == null ? [] : [[e, r[e]]]));
1772
1640
  return {
1773
1641
  modules: Object.fromEntries(Object.values(i).flatMap((t) => {
@@ -1778,7 +1646,7 @@ function et(e, t, n) {
1778
1646
  nodes: i
1779
1647
  };
1780
1648
  }
1781
- function tt(e, t, n, r) {
1649
+ function Ue(e, t, n, r) {
1782
1650
  if (e.graph(t) == null) return {
1783
1651
  changes: [],
1784
1652
  nodeIds: [],
@@ -1878,25 +1746,47 @@ function tt(e, t, n, r) {
1878
1746
  sourceIds: a
1879
1747
  };
1880
1748
  }
1881
- function nt(e, t, n, r) {
1882
- return Ie(e.revision.content, t, n, r);
1749
+ function We(e, t, n, r) {
1750
+ return je(e.revision.content, t, n, r);
1883
1751
  }
1884
- function rt(e, t, n, r) {
1752
+ function Ge(e, t, n, r) {
1885
1753
  let i = e.node(t, n)?.node;
1886
1754
  if (i == null) return;
1887
1755
  let { description: a, ...o } = i;
1888
- return X(t, n, r == null ? o : {
1756
+ return Y(t, n, r == null ? o : {
1889
1757
  ...o,
1890
1758
  description: r
1891
1759
  });
1892
1760
  }
1893
- function it(e, t, n, r, i) {
1894
- return Le(e.revision.content, t, n, r, i);
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);
1895
1785
  }
1896
- function at(e, t, n, r) {
1786
+ function Ye(e, t, n, r) {
1897
1787
  let i = e.graph(t), a = i?.nodes[n];
1898
1788
  if (i == null || a?.kind != "condition") return;
1899
- 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 = J(o, s), u = new Set(Object.keys(s)), d = [];
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 = [];
1900
1790
  for (let [e, o] of Object.entries(i.nodes)) {
1901
1791
  if (!("inputs" in o)) continue;
1902
1792
  let i = e == n, s = { ...o.inputs };
@@ -1941,68 +1831,69 @@ function at(e, t, n, r) {
1941
1831
  }
1942
1832
  return d;
1943
1833
  }
1944
- function ot(e, t, n, r) {
1834
+ function Xe(e, t, n, r) {
1945
1835
  let i = e.node(t, n)?.node;
1946
- if (i?.kind == "value") return X(t, n, {
1836
+ if (i?.kind == "value") return Y(t, n, {
1947
1837
  ...i,
1948
- values: Object.fromEntries(r.map((e) => [e.handle, {
1838
+ values: r.map((e) => ({
1839
+ handle: e.handle,
1949
1840
  ...e.description == null ? {} : { description: e.description },
1950
1841
  jsonSchema: e.jsonSchema ?? {},
1951
1842
  nullable: e.nullable ?? !1,
1952
1843
  ...Object.hasOwn(e, "value") ? { value: e.value } : {}
1953
- }]))
1844
+ }))
1954
1845
  });
1955
1846
  }
1956
- function st(e, t, n, r) {
1847
+ function Ze(e, t, n, r) {
1957
1848
  let i = e.graph(t)?.nodes[n];
1958
1849
  if (i?.kind == "task") switch (r.kind) {
1959
- case "code": return i.task == null ? void 0 : Y(e, t, n, {
1850
+ case "code": return i.task == null ? void 0 : J(e, t, n, {
1960
1851
  ...i.task,
1961
- inputs: r.inputs,
1962
- name: r.name,
1963
- outputs: r.outputs
1852
+ name: r.name
1964
1853
  });
1965
- case "llm": return i.task != null || e.task(i.taskId)?.executor.kind != "llm" ? void 0 : [{
1966
- kind: "task.replace",
1967
- task: {
1968
- executor: {
1969
- kind: "llm",
1970
- mode: r.mode
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
1971
1867
  },
1972
- inputs: r.inputs,
1973
- name: r.name,
1974
- outputs: r.outputs
1975
- },
1976
- taskId: i.taskId
1977
- }];
1868
+ taskId: i.taskId
1869
+ }] : void 0;
1870
+ }
1978
1871
  case "connector": {
1979
1872
  if (i.task != null) return;
1980
1873
  let t = e.task(i.taskId);
1981
1874
  return t?.executor.kind == "connector" ? [{
1982
1875
  kind: "task.replace",
1983
1876
  task: {
1984
- executor: t.executor,
1985
- inputs: r.inputs,
1986
- name: r.name,
1987
- outputs: r.outputs
1877
+ ...t,
1878
+ name: r.name
1988
1879
  },
1989
1880
  taskId: i.taskId
1990
1881
  }] : void 0;
1991
1882
  }
1992
1883
  }
1993
1884
  }
1994
- function ct(e, t, n, r) {
1885
+ function Qe(e, t, n, r) {
1995
1886
  let i = e.graph(t)?.nodes[n];
1996
- if (i?.kind == "task" && i.task != null) return Y(e, t, n, {
1887
+ if (i?.kind == "task" && i.task != null) return J(e, t, n, {
1997
1888
  ...i.task,
1998
1889
  ...r
1999
1890
  });
2000
1891
  }
2001
- function lt(e, t, n, r) {
2002
- let i = e.trigger(t.id, n);
1892
+ function $e(e, t, n, r) {
1893
+ let i = e.trigger(n);
2003
1894
  if (i == null || i.kind != "webhook") return;
2004
1895
  let { options: a, ...o } = i;
2005
- return X(t, n, Object.keys(r.options).length == 0 ? {
1896
+ return Y(t, n, Object.keys(r.options).length == 0 ? {
2006
1897
  ...o,
2007
1898
  inputsDef: r.inputs
2008
1899
  } : {
@@ -2011,19 +1902,19 @@ function lt(e, t, n, r) {
2011
1902
  options: r.options
2012
1903
  });
2013
1904
  }
2014
- function ut(e, t, n) {
1905
+ function et(e, t, n) {
2015
1906
  if (e.subflow(t) != null) return [{
2016
1907
  definition: n,
2017
1908
  kind: "subflow.definition.replace",
2018
1909
  subflowId: t
2019
1910
  }];
2020
1911
  }
2021
- function dt(e, t, n, r) {
1912
+ function tt(e, t, n, r) {
2022
1913
  return [{
2023
1914
  kind: "graph.node.create",
2024
1915
  node: {
2025
1916
  concurrency: 1,
2026
- inputs: ft(r),
1917
+ inputs: nt(r),
2027
1918
  kind: "subflow",
2028
1919
  subflowId: n
2029
1920
  },
@@ -2031,57 +1922,57 @@ function dt(e, t, n, r) {
2031
1922
  target: e
2032
1923
  }];
2033
1924
  }
2034
- function ft(e) {
2035
- return Object.fromEntries(Object.entries(e).flatMap(([e, t]) => Object.hasOwn(t, "value") ? [[e, {
1925
+ function nt(e) {
1926
+ return Object.fromEntries(e.flatMap((e) => Object.hasOwn(e, "value") ? [[e.handle, {
2036
1927
  kind: "value",
2037
- value: t.value
1928
+ value: e.value
2038
1929
  }]] : []));
2039
1930
  }
2040
- function J(e, t) {
2041
- let n = Object.keys(e).filter((e) => !Object.hasOwn(t, e)), r = Object.keys(t).filter((t) => !Object.hasOwn(e, t));
2042
- return n.length == 1 && r.length == 1 ? [n[0], r[0]] : void 0;
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;
2043
1934
  }
2044
- function Y(e, t, n, r) {
1935
+ function J(e, t, n, r) {
2045
1936
  let i = e.graph(t), a = i?.nodes[n];
2046
1937
  if (i == null || a?.kind != "task" || a.task == null) return;
2047
- let o = J(a.task.inputs, r.inputs), s = J(a.task.outputs, r.outputs), c = new Set(Object.keys(r.outputs)), l = [];
2048
- for (let [e, u] of Object.entries(i.nodes)) {
2049
- if (!("inputs" in u)) continue;
2050
- let i = e == n, d = { ...u.inputs };
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 };
2051
1942
  if (e == n) {
2052
- o != null && Object.hasOwn(d, o[0]) && (d[o[1]] = d[o[0]], delete d[o[0]]);
2053
- for (let e of Object.keys(d)) Object.hasOwn(r.inputs, e) || delete d[e];
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];
2054
1945
  }
2055
- for (let [e, t] of Object.entries(d)) {
1946
+ for (let [e, t] of Object.entries(f)) {
2056
1947
  if (t.kind != "sources") continue;
2057
1948
  let r = t.sources.flatMap((e) => e.kind != "node" || e.nodeId != n ? [e] : s != null && e.output == s[0] ? [{
2058
1949
  ...e,
2059
1950
  output: s[1]
2060
- }] : c.has(e.output) ? [e] : []);
2061
- r.length == t.sources.length && r.every((e, n) => e === t.sources[n]) || (i = !0, r.length == 0 ? delete d[e] : d[e] = {
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] = {
2062
1953
  kind: "sources",
2063
1954
  sources: r
2064
1955
  });
2065
1956
  }
2066
1957
  if (!i) continue;
2067
- let f = e == n ? {
1958
+ let p = e == n ? {
2068
1959
  ...a,
2069
- inputs: d,
1960
+ inputs: f,
2070
1961
  task: r
2071
1962
  } : {
2072
- ...u,
2073
- inputs: d
1963
+ ...d,
1964
+ inputs: f
2074
1965
  };
2075
- l.push({
1966
+ u.push({
2076
1967
  kind: "graph.node.replace",
2077
- node: f,
1968
+ node: p,
2078
1969
  nodeId: e,
2079
1970
  target: t
2080
1971
  });
2081
1972
  }
2082
- return l;
1973
+ return u;
2083
1974
  }
2084
- function X(e, t, n) {
1975
+ function Y(e, t, n) {
2085
1976
  return [{
2086
1977
  kind: "graph.node.replace",
2087
1978
  node: n,
@@ -2091,38 +1982,37 @@ function X(e, t, n) {
2091
1982
  }
2092
1983
  //#endregion
2093
1984
  //#region src/workbench/browser/runtime/designer/remoteChangeTargets.ts
2094
- function pt(e, t) {
2095
- return e.kind == t.kind && e.id == t.id;
1985
+ function rt(e, t) {
1986
+ return e.kind == t.kind && (e.kind != "subflow" || t.kind == "subflow" && e.id == t.id);
2096
1987
  }
2097
- function Z(e, t, n, r) {
1988
+ function X(e, t, n, r) {
2098
1989
  for (let [i, a] of Object.entries(t.graph(n)?.nodes ?? {})) r(a) && e.add(i);
2099
1990
  }
2100
- function mt(e, t, n, r) {
1991
+ function it(e, t, n, r) {
2101
1992
  let i = /* @__PURE__ */ new Set();
2102
1993
  for (let a of r) switch (a.kind) {
2103
1994
  case "graph.node.create":
2104
1995
  case "graph.node.replace":
2105
- pt(a.target, n) && i.add(a.nodeId);
1996
+ rt(a.target, n) && i.add(a.nodeId);
2106
1997
  break;
2107
1998
  case "task.replace":
2108
- Z(i, e, n, (e) => e.kind == "task" && e.task == null && e.taskId == a.taskId), Z(i, t, n, (e) => e.kind == "task" && e.task == null && e.taskId == a.taskId);
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);
2109
2000
  break;
2110
2001
  case "module.source.replace":
2111
- Z(i, e, n, (e) => e.kind == "task" && e.task?.moduleId == a.moduleId), Z(i, t, n, (e) => e.kind == "task" && e.task?.moduleId == a.moduleId);
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);
2112
2003
  break;
2113
- case "subflow.definition.replace": Z(i, e, n, (e) => e.kind == "subflow" && e.subflowId == a.subflowId), Z(i, t, n, (e) => e.kind == "subflow" && e.subflowId == a.subflowId);
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);
2114
2005
  }
2115
2006
  return new Set([...i].filter((e) => t.selection(n, e) != null));
2116
2007
  }
2117
2008
  //#endregion
2118
2009
  //#region src/workbench/browser/runtime/stores/draftChanges.ts
2119
- function ht(e) {
2010
+ function at(e) {
2120
2011
  if (e.length != 1) return;
2121
2012
  let t = e[0];
2122
2013
  switch (t.kind) {
2123
2014
  case "binding.replace": return `${t.kind}:${t.bindingId}`;
2124
- case "flow.rename": return `${t.kind}:${t.flowId}`;
2125
- case "graph.node.replace": return `${t.kind}:${t.target.kind}:${t.target.id}:${t.nodeId}`;
2015
+ case "graph.node.replace": return `${t.kind}:${t.target.kind}:${t.target.kind == "subflow" ? t.target.id : ""}:${t.nodeId}`;
2126
2016
  case "module.rename":
2127
2017
  case "module.source.replace": return `${t.kind}:${t.moduleId}`;
2128
2018
  case "subflow.definition.replace": return `${t.kind}:${t.subflowId}`;
@@ -2130,24 +2020,7 @@ function ht(e) {
2130
2020
  default: return;
2131
2021
  }
2132
2022
  }
2133
- function gt(e, t, n) {
2134
- let r = new Map(e.map((e) => [e.flowId, e])), i = new Map(t.map((e) => [e.flowId, e]));
2135
- return [...i.keys()].toSorted().map((e) => {
2136
- let t = r.get(e), a = i.get(e), o = t?.live ?? null;
2137
- return {
2138
- draft: {
2139
- closureDigest: a.closureDigest,
2140
- name: a.name,
2141
- revisionDigest: n.digest,
2142
- revisionId: n.revisionId
2143
- },
2144
- flowId: e,
2145
- hasUnpublishedChanges: o == null || o.publication.closureDigest != a.closureDigest,
2146
- live: o
2147
- };
2148
- });
2149
- }
2150
- var _t = class {
2023
+ var ot = class {
2151
2024
  #e;
2152
2025
  #t;
2153
2026
  #n;
@@ -2175,28 +2048,26 @@ var _t = class {
2175
2048
  this.#a = e;
2176
2049
  }
2177
2050
  project(e) {
2178
- return this.#o.reduce((e, t) => q(e, t.changes), e);
2051
+ return this.#o.reduce((e, t) => K(e, t.changes), e);
2179
2052
  }
2180
2053
  enqueue(e) {
2181
2054
  let t = this.#s.then(e);
2182
2055
  return this.#s = t, t;
2183
2056
  }
2184
2057
  async change(e, t, n, r = !0) {
2185
- this.#t.beforeChange(r);
2186
- let i = this.#t.flows();
2187
- this.#t.apply(q(t, n), i, i);
2188
- let a = ht(n), o = this.#o.at(-1), s = a != null && o != null && !o.started && ht(o.changes) == a ? o : void 0;
2189
- if (s != null) return s.changes = n, await s.result;
2190
- let c = {
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;
2060
+ if (o != null) return o.changes = n, await o.result;
2061
+ let s = {
2191
2062
  ...e,
2192
2063
  changes: n,
2193
2064
  started: !1
2194
2065
  };
2195
- this.#a ??= t, this.#o.push(c), this.#i += 1;
2196
- let l = this.#s.then(() => (c.started = !0, this.#c(c)));
2197
- c.result = l, this.#s = l.then(() => void 0);
2066
+ this.#a ??= t, this.#o.push(s), this.#i += 1;
2067
+ let c = this.#s.then(() => (s.started = !0, this.#c(s)));
2068
+ s.result = c, this.#s = c.then(() => void 0);
2198
2069
  try {
2199
- return await l;
2070
+ return await c;
2200
2071
  } finally {
2201
2072
  --this.#i, this.#i == 0 && this.#t.finishChanges();
2202
2073
  }
@@ -2207,13 +2078,13 @@ var _t = class {
2207
2078
  let n = this.#a;
2208
2079
  if (n == null) return;
2209
2080
  try {
2210
- let t = await this.#e.changeDraft(e.projectId, n.revisionId, e.changes);
2081
+ let t = await this.#e.changeDraft(e.flowId, n.revisionId, e.changes);
2211
2082
  if (!this.#t.current(e)) return;
2212
2083
  if (t.revision.parentRevisionId != n.revisionId) throw Error("Invalid Draft change response.");
2213
2084
  let r = this.#l(e, n, t);
2214
2085
  return this.#o.length == 0 && this.#t.check(), r;
2215
2086
  } catch (n) {
2216
- if (n instanceof u && n.code == "project.revision-conflict") {
2087
+ if (n instanceof s && n.code == "flow.revision-conflict") {
2217
2088
  if (!t && await this.#t.recover(e)) {
2218
2089
  t = !0;
2219
2090
  continue;
@@ -2222,7 +2093,7 @@ var _t = class {
2222
2093
  kind: "error",
2223
2094
  message: this.#n.t("notice.draftConflict")
2224
2095
  });
2225
- } else this.#u(e), this.#t.current(e) && this.#r(o(n, this.#n.t));
2096
+ } else this.#u(e), this.#t.current(e) && this.#r(u(n, this.#n.t));
2226
2097
  return;
2227
2098
  }
2228
2099
  }
@@ -2230,95 +2101,28 @@ var _t = class {
2230
2101
  #l(e, t, n) {
2231
2102
  let r = {
2232
2103
  ...n.revision,
2233
- content: q(t, e.changes).content
2104
+ content: K(t, e.changes).content
2234
2105
  };
2235
2106
  this.#o = this.#o.filter((t) => t !== e), this.#a = r;
2236
- let i = this.#t.flows(), a = gt(i, n.draftFlows, r), o = this.#t.diagnostics(), s = this.#o.length == 0 && o != null && a.find((e) => e.flowId == o.flowId)?.draft?.closureDigest == o.closureDigest;
2237
- return this.#t.apply(this.project(r), a, i, s), this.#t.headChanged(e.projectId, r.revisionId), r;
2107
+ let i = this.#t.diagnostics(), a = this.#o.length == 0 && i?.revisionId == r.revisionId;
2108
+ return this.#t.apply(this.project(r), a), this.#t.headChanged(e.flowId, r.revisionId), r;
2238
2109
  }
2239
2110
  #u(e) {
2240
- if (this.#o = this.#o.filter((t) => t !== e), !this.#t.current(e) || this.#a == null) return;
2241
- let t = this.#t.flows();
2242
- this.#t.apply(this.project(this.#a), t, t);
2243
- }
2244
- }, vt = class {
2245
- #e;
2246
- #t;
2247
- #n;
2248
- #r;
2249
- #i = Promise.resolve();
2250
- #a;
2251
- #o = !1;
2252
- #s = [];
2253
- constructor(e, t, n, r) {
2254
- this.#e = e, this.#n = t, this.#r = n, this.#t = r;
2255
- }
2256
- reset(e) {
2257
- this.#a = e, this.#s = [];
2258
- }
2259
- dispose() {
2260
- this.#o = !0, this.#s = [];
2261
- }
2262
- async change(e, t, n, r) {
2263
- if (this.#o || this.#a == null) return;
2264
- let i = r(t.value);
2265
- if (i === t.value) return;
2266
- let a = {
2267
- current: n,
2268
- projectId: e,
2269
- update: r
2270
- };
2271
- this.#s.push(a), this.#r({
2272
- ...t,
2273
- value: i
2274
- }), this.#i = this.#i.then(async () => {
2275
- if (this.#o || !n()) return;
2276
- let t = this.#a, i = r(t.value);
2277
- if (i === t.value) {
2278
- this.#c(a, t);
2279
- return;
2280
- }
2281
- try {
2282
- let r = await this.#e.updatePresentation(e, t.revision, i);
2283
- if (this.#o || !n()) return;
2284
- this.#c(a, r);
2285
- } catch (r) {
2286
- if (this.#o || !n()) return;
2287
- if (r instanceof u && r.code == "project.presentation-conflict") try {
2288
- let t = await this.#e.getPresentation(e);
2289
- if (this.#o || !n()) return;
2290
- this.#c(a, t), this.#n({
2291
- kind: "error",
2292
- message: this.#t.t("notice.layoutConflict")
2293
- });
2294
- } catch (e) {
2295
- !this.#o && n() && this.#n(o(e, this.#t.t));
2296
- }
2297
- else this.#c(a, t), this.#n(o(r, this.#t.t));
2298
- }
2299
- }), await this.#i;
2111
+ this.#o = this.#o.filter((t) => t !== e), !(!this.#t.current(e) || this.#a == null) && this.#t.apply(this.project(this.#a));
2300
2112
  }
2301
- #c(e, t) {
2302
- this.#s = this.#s.filter((t) => t !== e), this.#a = t;
2303
- let n = this.#s.reduce((e, t) => t.update(e), t.value);
2304
- this.#r(n === t.value ? t : {
2305
- ...t,
2306
- value: n
2307
- });
2308
- }
2309
- }, yt = 50, bt = {
2113
+ }, st = 50, ct = {
2310
2114
  failed: !1,
2311
2115
  loaded: !1,
2312
2116
  loading: !0,
2313
2117
  loadingMore: !1,
2314
2118
  loadMoreFailed: !1,
2315
- projects: []
2316
- }, xt = class {
2119
+ flows: []
2120
+ }, lt = class {
2317
2121
  #e;
2318
2122
  #t;
2319
- #n = new S();
2123
+ #n = new x();
2320
2124
  #r;
2321
- #i = t(bt);
2125
+ #i = t(ct);
2322
2126
  #a = !1;
2323
2127
  constructor(t, n, r) {
2324
2128
  this.#e = t, this.#t = r, this.#r = n, this.$ = {
@@ -2327,7 +2131,7 @@ var _t = class {
2327
2131
  loadingMore: e(this.#i, (e) => e.loadingMore),
2328
2132
  loadMoreFailed: e(this.#i, (e) => e.loadMoreFailed),
2329
2133
  nextCursor: e(this.#i, (e) => e.nextCursor),
2330
- projects: e(this.#i, (e) => e.projects),
2134
+ flows: e(this.#i, (e) => e.flows),
2331
2135
  total: e(this.#i, (e) => e.total)
2332
2136
  };
2333
2137
  }
@@ -2346,8 +2150,8 @@ var _t = class {
2346
2150
  capture() {
2347
2151
  return this.#n.capture();
2348
2152
  }
2349
- project(e) {
2350
- return this.#i.value.projects.find((t) => t.projectId == e);
2153
+ flow(e) {
2154
+ return this.#i.value.flows.find((t) => t.flowId == e);
2351
2155
  }
2352
2156
  async reload() {
2353
2157
  let e = this.#n.begin();
@@ -2358,20 +2162,20 @@ var _t = class {
2358
2162
  loadingMore: !1,
2359
2163
  loadMoreFailed: !1,
2360
2164
  nextCursor: void 0,
2361
- projects: [],
2165
+ flows: [],
2362
2166
  total: void 0
2363
2167
  });
2364
2168
  try {
2365
- let t = await this.#e.listProjects({
2169
+ let t = await this.#e.listFlows({
2366
2170
  includeTotal: !0,
2367
- limit: yt
2171
+ limit: st
2368
2172
  });
2369
2173
  if (!e()) return;
2370
2174
  this.#o({
2371
2175
  loaded: !0,
2372
2176
  loading: !1,
2373
2177
  nextCursor: t.nextCursor,
2374
- projects: t.projects,
2178
+ flows: t.flows,
2375
2179
  total: t.total
2376
2180
  });
2377
2181
  } catch (t) {
@@ -2379,7 +2183,7 @@ var _t = class {
2379
2183
  this.#o({
2380
2184
  failed: !0,
2381
2185
  loading: !1
2382
- }), this.#r(o(t, this.#t.t));
2186
+ }), this.#r(u(t, this.#t.t));
2383
2187
  }
2384
2188
  }
2385
2189
  async loadMore() {
@@ -2391,43 +2195,48 @@ var _t = class {
2391
2195
  loadMoreFailed: !1
2392
2196
  });
2393
2197
  try {
2394
- let e = await this.#e.listProjects({
2198
+ let e = await this.#e.listFlows({
2395
2199
  cursor: t,
2396
- limit: yt
2200
+ limit: st
2397
2201
  });
2398
2202
  if (!n()) return;
2399
- let r = new Set(this.#i.value.projects.map((e) => e.projectId));
2203
+ let r = new Set(this.#i.value.flows.map((e) => e.flowId));
2400
2204
  this.#o({
2401
2205
  loadingMore: !1,
2402
2206
  nextCursor: e.nextCursor,
2403
- projects: [...this.#i.value.projects, ...e.projects.filter((e) => !r.has(e.projectId))]
2207
+ flows: [...this.#i.value.flows, ...e.flows.filter((e) => !r.has(e.flowId))]
2404
2208
  });
2405
2209
  } catch (e) {
2406
2210
  if (!n()) return;
2407
2211
  this.#o({
2408
2212
  loadingMore: !1,
2409
2213
  loadMoreFailed: !0
2410
- }), this.#r(o(e, this.#t.t));
2214
+ }), this.#r(u(e, this.#t.t));
2411
2215
  }
2412
2216
  }
2413
2217
  async create(e) {
2414
- let t = await this.#e.createProject(e);
2218
+ let t = await this.#e.createFlow(e);
2415
2219
  if (!this.#a) return this.#o({
2416
- projects: [...this.#i.value.projects, t],
2220
+ flows: [...this.#i.value.flows, t],
2417
2221
  total: this.#i.value.total == null ? void 0 : this.#i.value.total + 1
2418
2222
  }), t;
2419
2223
  }
2420
2224
  include(e) {
2421
- this.project(e.projectId) ?? this.#o({ projects: [...this.#i.value.projects, e] });
2225
+ let t = this.#i.value.flows.findIndex((t) => t.flowId == e.flowId);
2226
+ if (t < 0) {
2227
+ this.#o({ flows: [...this.#i.value.flows, e] });
2228
+ return;
2229
+ }
2230
+ this.#o({ flows: this.#i.value.flows.with(t, e) });
2422
2231
  }
2423
2232
  remove(e) {
2424
2233
  this.#o({
2425
- projects: this.#i.value.projects.filter((t) => t.projectId != e),
2234
+ flows: this.#i.value.flows.filter((t) => t.flowId != e),
2426
2235
  total: this.#i.value.total == null ? void 0 : this.#i.value.total - 1
2427
2236
  });
2428
2237
  }
2429
2238
  advanceHead(e, t) {
2430
- this.#o({ projects: this.#i.value.projects.map((n) => n.projectId == e ? {
2239
+ this.#o({ flows: this.#i.value.flows.map((n) => n.flowId == e ? {
2431
2240
  ...n,
2432
2241
  draftRevisionId: t
2433
2242
  } : n) });
@@ -2438,22 +2247,149 @@ var _t = class {
2438
2247
  ...e
2439
2248
  });
2440
2249
  }
2441
- }, St = {
2250
+ }, ut = class {
2251
+ #e;
2252
+ #t;
2253
+ #n;
2254
+ #r;
2255
+ #i = Promise.resolve();
2256
+ #a;
2257
+ #o = !1;
2258
+ #s = [];
2259
+ constructor(e, t, n, r) {
2260
+ this.#e = e, this.#n = t, this.#r = n, this.#t = r;
2261
+ }
2262
+ reset(e) {
2263
+ this.#a = e, this.#s = [];
2264
+ }
2265
+ dispose() {
2266
+ this.#o = !0, this.#s = [];
2267
+ }
2268
+ async change(e, t, n, r) {
2269
+ if (this.#o || this.#a == null) return;
2270
+ let i = r(t.value);
2271
+ if (i === t.value) return;
2272
+ let a = {
2273
+ current: n,
2274
+ flowId: e,
2275
+ update: r
2276
+ };
2277
+ this.#s.push(a), this.#r({
2278
+ ...t,
2279
+ value: i
2280
+ }), this.#i = this.#i.then(async () => {
2281
+ if (this.#o || !n()) return;
2282
+ let t = this.#a, i = r(t.value);
2283
+ if (i === t.value) {
2284
+ this.#c(a, t);
2285
+ return;
2286
+ }
2287
+ try {
2288
+ let r = await this.#e.updatePresentation(e, t.revision, i);
2289
+ if (this.#o || !n()) return;
2290
+ this.#c(a, r);
2291
+ } catch (r) {
2292
+ if (this.#o || !n()) return;
2293
+ if (r instanceof s && r.code == "flow.presentation-conflict") try {
2294
+ let t = await this.#e.getPresentation(e);
2295
+ if (this.#o || !n()) return;
2296
+ this.#c(a, t), this.#n({
2297
+ kind: "error",
2298
+ message: this.#t.t("notice.layoutConflict")
2299
+ });
2300
+ } catch (e) {
2301
+ !this.#o && n() && this.#n(u(e, this.#t.t));
2302
+ }
2303
+ else this.#c(a, t), this.#n(u(r, this.#t.t));
2304
+ }
2305
+ }), await this.#i;
2306
+ }
2307
+ #c(e, t) {
2308
+ this.#s = this.#s.filter((t) => t !== e), this.#a = t;
2309
+ let n = this.#s.reduce((e, t) => t.update(e), t.value);
2310
+ this.#r(n === t.value ? t : {
2311
+ ...t,
2312
+ value: n
2313
+ });
2314
+ }
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 = {
2442
2379
  checkLoading: !1,
2443
- flows: [],
2444
2380
  selectedNodeIds: [],
2445
2381
  workspaceLoadFailed: !1,
2446
2382
  workspaceLoading: !1
2447
2383
  };
2448
- function Ct(e) {
2384
+ function yt(e) {
2449
2385
  return e.workspaceLoading ? "loading" : e.busy == "designer" ? "saving" : e.draft == null ? "noDraft" : "saved";
2450
2386
  }
2451
- function Q(e, t) {
2387
+ function Z(e, t) {
2452
2388
  if (t.phase != null) return t.phase;
2453
2389
  let n = e?.content.modules[t.moduleId];
2454
2390
  return n == null ? "failed" : t.source == n.source ? "saved" : "dirty";
2455
2391
  }
2456
- function $(e, t, n) {
2392
+ function Q(e, t, n) {
2457
2393
  if (e == null || t == null || n.length != 1) return;
2458
2394
  let r = e.node(t, n[0]);
2459
2395
  if (!(r?.kind != "task" || r.definition == null || !("moduleId" in r.definition) || r.module == null)) return {
@@ -2461,72 +2397,69 @@ function $(e, t, n) {
2461
2397
  source: r.module.source
2462
2398
  };
2463
2399
  }
2464
- var wt = class {
2400
+ var bt = class {
2465
2401
  #e;
2466
- #t = t(St);
2402
+ #t = t(vt);
2467
2403
  #n;
2468
2404
  constructor(t, r) {
2469
- 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) => e.flows), u = e(this.#t, (e) => {
2405
+ 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) => {
2470
2406
  if (e.moduleEditor == null) return;
2471
2407
  let { phase: t, ...n } = e.moduleEditor;
2472
2408
  return {
2473
2409
  ...n,
2474
- status: Q(e.draft, e.moduleEditor)
2410
+ status: Z(e.draft, e.moduleEditor)
2475
2411
  };
2476
- }), d = e(this.#t, (e) => e.nodeFocus), p = e(this.#t, (e) => e.presentation), m = e(this.#t, (e) => e.projectId), h = e(this.#t, (e) => e.draft == null ? void 0 : f(e.draft)), _ = e(this.#t, (e) => e.selectedNodeIds), v = e(this.#t, (e) => e.target), y = e(this.#t, (e) => e.workspaceLoadFailed), b = e(this.#t, (e) => e.workspaceLoading);
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);
2477
2413
  this.#e = e(this.#t, (e) => ({
2478
- revision: e.draft == null ? void 0 : f(e.draft),
2414
+ revision: e.draft == null ? void 0 : h(e.draft),
2479
2415
  target: e.target
2480
2416
  }), { equal: (e, t) => e.revision === t.revision && e.target === t.target });
2481
- let x = e(this.#t, (e) => {
2482
- if (e.draft != null && e.target != null && e.selectedNodeIds.length == 1) return f(e.draft).selection(e.target, e.selectedNodeIds[0]);
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]);
2483
2419
  });
2484
2420
  this.$ = {
2485
2421
  addNodeOptions: n((e) => {
2486
2422
  let { revision: n, target: r } = e(this.#e);
2487
- return g(n?.revision, r, e(t.t$));
2423
+ return ee(n?.revision, r, e(t.t$));
2488
2424
  }),
2489
2425
  busy: i,
2490
2426
  checkLoading: a,
2491
2427
  diagnosticFocus: o,
2492
- diagnosticItems: e(this.#t, (e) => Ye(e.draft == null ? void 0 : f(e.draft), e.target, e.diagnostics)),
2428
+ diagnosticItems: e(this.#t, (e) => gt(e.draft == null ? void 0 : h(e.draft), e.target, e.diagnostics)),
2493
2429
  diagnostics: s,
2494
2430
  draft: c,
2495
- flows: l,
2496
- inspectorDiagnostics: e(this.#t, (e) => Ge(e.draft == null ? void 0 : f(e.draft), e.target, e.diagnostics, x.value)),
2431
+ flow: n((e) => {
2432
+ let t = e(f);
2433
+ return t == null ? void 0 : e(r.$.flows).find((e) => e.flowId == t);
2434
+ }),
2435
+ flowId: f,
2436
+ flowLoadFailed: r.$.failed,
2437
+ flowLoadMoreFailed: r.$.loadMoreFailed,
2438
+ flowLoading: r.$.loading,
2439
+ flowLoadingMore: r.$.loadingMore,
2440
+ flowNextCursor: r.$.nextCursor,
2441
+ flowTotal: r.$.total,
2442
+ flows: r.$.flows,
2443
+ inspectorDiagnostics: e(this.#t, (e) => ft(e.draft == null ? void 0 : h(e.draft), e.target, e.diagnostics, b.value)),
2444
+ live: p,
2497
2445
  moduleDiagnostics: e(this.#t, (e) => {
2498
2446
  let t = e.moduleEditor?.moduleId;
2499
2447
  return t == null ? [] : e.diagnostics?.diagnostics.filter((e) => e.path.startsWith(`/modules/${t}/source`)) ?? [];
2500
2448
  }),
2501
- moduleEditor: u,
2502
- nodeFocus: d,
2503
- presentation: p,
2504
- project: n((e) => {
2505
- let t = e(m);
2506
- return t == null ? void 0 : e(r.$.projects).find((e) => e.projectId == t);
2507
- }),
2508
- projectId: m,
2509
- projectLoadFailed: r.$.failed,
2510
- projectLoadMoreFailed: r.$.loadMoreFailed,
2511
- projectLoading: r.$.loading,
2512
- projectLoadingMore: r.$.loadingMore,
2513
- projectNextCursor: r.$.nextCursor,
2514
- projectTotal: r.$.total,
2515
- projects: r.$.projects,
2516
- revision: h,
2517
- selection: x,
2518
- selectedNodeIds: _,
2519
- status: e(this.#t, Ct),
2520
- target: v,
2521
- targetFlow: e(this.#t, (e) => e.target?.kind == "flow" ? e.flows.find((t) => t.flowId == e.target?.id) : void 0),
2449
+ moduleEditor: l,
2450
+ nodeFocus: u,
2451
+ presentation: d,
2452
+ 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),
2522
2458
  targetName: e(this.#t, (e) => {
2523
- if (e.target == null) return;
2524
- if (e.draft == null) return e.target.id;
2525
- let t = f(e.draft);
2526
- return (e.target.kind == "flow" ? t.flow(e.target.id)?.name : t.subflow(e.target.id)?.name) ?? e.target.id;
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;
2527
2460
  }),
2528
- workspaceLoadFailed: y,
2529
- workspaceLoading: b
2461
+ workspaceLoadFailed: v,
2462
+ workspaceLoading: y
2530
2463
  }, this.#n = new Set(Object.values(r.$));
2531
2464
  }
2532
2465
  get value() {
@@ -2542,28 +2475,17 @@ var wt = class {
2542
2475
  for (let e of Object.values(this.$)) this.#n.has(e) || e.dispose();
2543
2476
  this.#e.dispose(), this.#t.dispose();
2544
2477
  }
2545
- }, Tt = 250;
2546
- function Et(e, t, n, r) {
2547
- if (r == null) return;
2548
- if (r.kind == "subflow") {
2549
- if (e.subflow(r.id) != null) return r;
2550
- let n = c(t, null);
2551
- return n == null ? void 0 : {
2552
- id: n.flowId,
2553
- kind: "flow"
2554
- };
2555
- }
2556
- if (e.flow(r.id) != null) return r;
2557
- let i = new Set(e.flowIds), a = n.filter((e) => e.draft != null).map((e) => e.flowId), o = a.indexOf(r.id), s = (o < 0 ? a : [...a.slice(o + 1), ...a.slice(0, o).toReversed()]).find((e) => i.has(e)) ?? t.find((e) => e.draft != null && i.has(e.flowId))?.flowId ?? i.values().next().value;
2558
- return s == null ? void 0 : {
2559
- id: s,
2560
- kind: "flow"
2561
- };
2478
+ }, xt = 250;
2479
+ function St(e, t) {
2480
+ if (t != null) return t.kind == "flow" || e.subflow(t.id) != null ? t : { kind: "flow" };
2562
2481
  }
2563
- var Dt = class {
2482
+ function $(e, t) {
2483
+ return e?.kind == t?.kind ? e?.kind != "subflow" || t?.kind == "subflow" && e.id == t.id : !1;
2484
+ }
2485
+ var Ct = class {
2564
2486
  #e;
2565
2487
  #t;
2566
- #n = new S();
2488
+ #n = new x();
2567
2489
  #r;
2568
2490
  #i;
2569
2491
  #a;
@@ -2582,182 +2504,166 @@ var Dt = class {
2582
2504
  #v = !1;
2583
2505
  #y = 0;
2584
2506
  #b;
2585
- constructor(e, t, n = () => crypto.randomUUID(), r = y(), i = () => {}) {
2586
- this.#e = e, this.#c = t, this.#i = n, this.#r = r, this.#s = i, this.#o = new xt(e, t, r), this.#l = new wt(r, this.#o), this.#t = new _t(e, t, r, {
2587
- apply: (e, t, n, r) => this.#C(e, t, n, r),
2507
+ #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, {
2510
+ apply: (e, t) => this.#w(e, t),
2588
2511
  beforeChange: (e) => {
2589
- this.#j(), this.#h = !1, e && (this.#z({ busy: "designer" }), this.#c(void 0));
2512
+ this.#M(), this.#h = !1, e && (this.#B({ busy: "designer" }), this.#c(void 0));
2590
2513
  },
2591
- check: () => void this.#T(),
2592
- current: (e) => this.#R(e),
2514
+ check: () => void this.#E(),
2515
+ current: (e) => this.#z(e),
2593
2516
  diagnostics: () => this.#l.value.diagnostics,
2594
2517
  finishChanges: () => {
2595
- !this.#_ && this.#l.value.busy == "designer" && this.#z({ busy: void 0 });
2518
+ !this.#_ && this.#l.value.busy == "designer" && this.#B({ busy: void 0 });
2596
2519
  },
2597
- flows: () => this.#l.value.flows,
2598
- headChanged: (e, t) => this.#M(e, t),
2599
- recover: (e) => this.#D(e, !0)
2600
- }), this.#a = new vt(e, t, (e) => this.#z({ presentation: e }), r), this.$ = this.#l.$;
2520
+ headChanged: (e, t) => this.#N(e, t),
2521
+ recover: (e) => this.#O(e, !0)
2522
+ }), this.#a = new ut(e, t, (e) => this.#B({ presentation: e }), r), this.$ = this.#l.$;
2601
2523
  }
2602
2524
  dispose() {
2603
- this.#j(), this.#_ = !0, this.#n.invalidate(), this.#a.dispose(), this.#b?.(), this.#l.dispose(), this.#o.dispose();
2525
+ this.#M(), this.#_ = !0, this.#n.invalidate(), this.#a.dispose(), this.#b?.(), this.#x?.(), this.#l.dispose(), this.#o.dispose();
2604
2526
  }
2605
- async start(e, t) {
2606
- if (e != null) {
2607
- await this.selectProject(e, t);
2608
- return;
2609
- }
2610
- await this.selectProject(void 0) && (this.#o.loaded && !this.#o.$.failed.value || await this.reloadProjects());
2527
+ async start(e) {
2528
+ this.#b ??= this.#e.watchFlowCatalog(() => void this.reloadFlows()), await this.reloadFlows(), await this.selectFlow(e);
2611
2529
  }
2612
- async reloadProjects() {
2530
+ async reloadFlows() {
2613
2531
  await this.#o.reload();
2614
2532
  }
2615
- async loadMoreProjects() {
2533
+ async loadMoreFlows() {
2616
2534
  await this.#o.loadMore();
2617
2535
  }
2618
- async selectProject(e, t) {
2619
- if (!this.#P()) return !1;
2620
- this.#j();
2621
- let n = this.#o.beginSelection();
2622
- if (this.#n.invalidate(), this.#t.reset(), this.#a.reset(), this.#f = 0, this.#h = !1, this.#g = !1, this.#v = !1, this.#b?.(), this.#b = void 0, this.#z({
2536
+ async selectFlow(e) {
2537
+ if (!this.#F()) return !1;
2538
+ 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({
2623
2541
  checkLoading: !1,
2624
2542
  diagnosticFocus: void 0,
2625
2543
  diagnostics: void 0,
2626
2544
  draft: void 0,
2627
- flows: [],
2545
+ live: void 0,
2628
2546
  moduleEditor: void 0,
2629
2547
  nodeFocus: void 0,
2630
2548
  presentation: void 0,
2631
- projectId: e,
2549
+ flowId: e,
2632
2550
  selectedNodeIds: [],
2633
- target: t == null ? void 0 : {
2634
- id: t,
2635
- kind: "flow"
2636
- },
2551
+ target: e == null ? void 0 : { kind: "flow" },
2637
2552
  workspaceLoadFailed: !1,
2638
2553
  workspaceLoading: e != null
2639
2554
  }), e == null) return !0;
2640
2555
  try {
2641
- let r = this.#o.project(e), [i, a, o, s] = await Promise.all([
2642
- r ?? this.#e.getProject(e),
2556
+ let n = this.#o.flow(e), [r, i, a, o] = await Promise.all([
2557
+ n ?? this.#e.getFlow(e),
2643
2558
  this.#e.getDraft(e),
2644
- this.#e.listFlows(e),
2559
+ this.#e.getLive(e),
2645
2560
  this.#e.getPresentation(e)
2646
2561
  ]);
2647
- if (!n()) return !1;
2648
- let c = t == null ? void 0 : o.find((e) => e.flowId == t), l = c == null ? void 0 : {
2649
- id: c.flowId,
2650
- kind: "flow"
2651
- };
2652
- this.#t.reset(a), this.#a.reset(s), this.#o.include(i), this.#z({
2653
- draft: a,
2654
- flows: o,
2655
- presentation: s,
2656
- target: l,
2562
+ if (!t()) return !1;
2563
+ this.#t.reset(i), this.#a.reset(o), this.#o.include(r), this.#B({
2564
+ draft: i,
2565
+ live: a,
2566
+ presentation: o,
2567
+ target: { kind: "flow" },
2657
2568
  workspaceLoadFailed: !1,
2658
2569
  workspaceLoading: !1
2659
- }), this.#T(), this.#b = this.#e.watchProject(e, (e) => {
2660
- !this.#_ && e != this.#t.committed?.revisionId && this.#E(e);
2570
+ }), this.#E(), this.#x = this.#e.watchFlow(e, (e) => {
2571
+ !this.#_ && e != this.#t.committed?.revisionId && this.#D(e);
2661
2572
  }, this.#s);
2662
2573
  } catch (e) {
2663
- return n() ? (this.#z({
2574
+ return t() ? (this.#B({
2664
2575
  workspaceLoadFailed: !0,
2665
2576
  workspaceLoading: !1
2666
- }), this.#c(o(e, this.#r.t)), !1) : !1;
2577
+ }), this.#c(u(e, this.#r.t)), !1) : !1;
2667
2578
  }
2668
2579
  return !0;
2669
2580
  }
2670
2581
  selectTarget(e) {
2671
- return this.#P() ? (this.#j(), this.#z({
2582
+ return this.#F() ? (this.#M(), this.#B({
2672
2583
  diagnosticFocus: void 0,
2673
2584
  diagnostics: void 0,
2674
2585
  moduleEditor: void 0,
2675
2586
  nodeFocus: void 0,
2676
2587
  selectedNodeIds: [],
2677
2588
  target: e
2678
- }), this.#T(), !0) : !1;
2589
+ }), this.#E(), !0) : !1;
2679
2590
  }
2680
2591
  selectNodes(e) {
2681
- return e.length == this.#l.value.selectedNodeIds.length && e.every((e, t) => e == this.#l.value.selectedNodeIds[t]) ? !0 : this.#P() ? (this.#j(), this.#z({
2592
+ 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({
2682
2593
  diagnosticFocus: void 0,
2683
- moduleEditor: $(this.#l.value.draft == null ? void 0 : f(this.#l.value.draft), this.#l.value.target, e),
2594
+ moduleEditor: Q(this.#l.value.draft == null ? void 0 : h(this.#l.value.draft), this.#l.value.target, e),
2684
2595
  nodeFocus: void 0,
2685
2596
  selectedNodeIds: e
2686
2597
  }), !0) : !1;
2687
2598
  }
2688
- async createProject(e) {
2689
- if (this.#P()) {
2690
- this.#z({ busy: "project" }), this.#c(void 0);
2599
+ async createFlow(e) {
2600
+ if (this.#F()) {
2601
+ this.#B({ busy: "flow" }), this.#c(void 0);
2691
2602
  try {
2692
2603
  return await this.#o.create(e);
2693
2604
  } catch (e) {
2694
- this.#_ || this.#c(o(e, this.#r.t));
2605
+ this.#_ || this.#c(u(e, this.#r.t));
2695
2606
  } finally {
2696
- this.#z({ busy: void 0 });
2607
+ this.#B({ busy: void 0 });
2697
2608
  }
2698
2609
  }
2699
2610
  }
2700
- async deleteProject(e) {
2701
- if (!this.#P()) return !1;
2702
- let t = this.#o.project(e);
2611
+ async deleteFlow(e) {
2612
+ if (!this.#F()) return !1;
2613
+ let t = this.#o.flow(e);
2703
2614
  if (t == null || t.status == "retiring") return !1;
2704
- this.#z({ busy: "project" }), this.#c(void 0);
2615
+ this.#B({ busy: "flow" }), this.#c(void 0);
2705
2616
  try {
2706
- return await this.#e.deleteProject(e), !this.#_ && (this.#o.remove(e), this.#c({
2617
+ return await this.#e.deleteFlow(e), !this.#_ && (this.#o.remove(e), this.#c({
2707
2618
  kind: "success",
2708
- message: this.#r.t("notice.projectDeleteAccepted", { name: t.name })
2619
+ message: this.#r.t("notice.flowDeleteAccepted", { name: t.name })
2709
2620
  }), !0);
2710
2621
  } catch (e) {
2711
- return this.#_ || this.#c(o(e, this.#r.t)), !1;
2622
+ return this.#_ || this.#c(u(e, this.#r.t)), !1;
2712
2623
  } finally {
2713
- this.#z({ busy: void 0 });
2624
+ this.#B({ busy: void 0 });
2714
2625
  }
2715
2626
  }
2716
- async createResource(e, t) {
2717
- if (!this.#P() || this.#l.value.draft == null) return !1;
2718
- let n = this.#i();
2719
- this.#z({ busy: "resource" }), this.#c(void 0);
2720
- let r = await this.#S(Ze(e, n, t), !1);
2721
- return this.#z({ busy: void 0 }), r != null && (this.selectTarget({
2722
- id: n,
2723
- kind: e
2627
+ async createResource(e) {
2628
+ if (!this.#F() || this.#l.value.draft == null) return !1;
2629
+ let t = this.#i();
2630
+ this.#B({ busy: "resource" }), this.#c(void 0);
2631
+ let n = await this.#C(ze(t, e), !1);
2632
+ return this.#B({ busy: void 0 }), n != null && (this.selectTarget({
2633
+ id: t,
2634
+ kind: "subflow"
2724
2635
  }), this.#c({
2725
2636
  kind: "success",
2726
- message: this.#r.t("notice.createdInDraft", { name: t })
2637
+ message: this.#r.t("notice.createdInDraft", { name: e })
2727
2638
  }), !0);
2728
2639
  }
2729
2640
  async renameFlow(e, t) {
2730
- let n = this.$.revision.value?.flow(e), r = t.trim();
2641
+ let n = this.#o.flow(e), r = t.trim();
2731
2642
  if (n == null || r.length == 0) return !1;
2732
2643
  if (n.name == r) return !0;
2733
- this.#z({ busy: "resource" }), this.#c(void 0);
2734
- let i = await this.#S(Ee(e, r), !1);
2735
- return this.#z({ busy: void 0 }), i != null && (this.#c({
2644
+ this.#B({ busy: "flow" }), this.#c(void 0);
2645
+ let i;
2646
+ try {
2647
+ i = await this.#e.renameFlow(e, r), i != null && this.#o.include(i);
2648
+ } catch (e) {
2649
+ this.#_ || this.#c(u(e, this.#r.t));
2650
+ }
2651
+ return this.#B({ busy: void 0 }), i != null && (this.#c({
2736
2652
  kind: "success",
2737
2653
  message: this.#r.t("notice.flowRenamed", { name: r })
2738
2654
  }), !0);
2739
2655
  }
2740
- async deleteFlow(e) {
2741
- let t = this.#l.value.flows.find((t) => t.flowId == e);
2742
- if (t?.draft == null || this.#l.value.target?.kind == "flow" && this.#l.value.target.id == e && !this.#P()) return !1;
2743
- this.#z({ busy: "resource" }), this.#c(void 0);
2744
- let n = await this.#S(De(e), !1);
2745
- return this.#z({ busy: void 0 }), n != null && (this.#c({
2746
- kind: "success",
2747
- message: this.#r.t("notice.flowDeleted", { name: t.draft.name })
2748
- }), !0);
2749
- }
2750
2656
  async addNode(e, t, n) {
2751
- if (!this.#P()) return;
2657
+ if (!this.#F()) return;
2752
2658
  let r = this.#l.value.draft, i = this.#l.value.target;
2753
2659
  if (r == null || i == null) return;
2754
2660
  let a = this.#i();
2755
- if (e.kind == "comment") return await this.#x(i, a, t);
2756
- let o = f(r), s = b(e, o, i, this.#r.t);
2661
+ if (e.kind == "comment") return await this.#S(i, a, t);
2662
+ let o = h(r), s = b(e, o, i, this.#r.t);
2757
2663
  if (s == null) return;
2758
- let c = Qe(o, i, a, s, this.#i);
2664
+ let c = Be(o, i, a, s, this.#i);
2759
2665
  if (c == null) return;
2760
- let l = n == null ? c : [...c, ...R(q(r, c).content, i, n(a))], u = this.#S(l);
2666
+ let l = n == null ? c : [...c, ...R(K(r, c).content, i, n(a))], u = this.#C(l);
2761
2667
  this.selectNodes([a]);
2762
2668
  let d = this.moveNodes({ [a]: t });
2763
2669
  if (await u != null) return await d, a;
@@ -2766,19 +2672,19 @@ var Dt = class {
2766
2672
  let t = this.$.revision.value, n = this.#l.value.target;
2767
2673
  if (t == null || n == null) return;
2768
2674
  let r = R(t.revision.content, n, e);
2769
- r.length > 0 && await this.#S(r);
2675
+ r.length > 0 && await this.#C(r);
2770
2676
  }
2771
2677
  async disconnect(e) {
2772
2678
  let t = this.$.revision.value, n = this.#l.value.target;
2773
2679
  if (t == null || n == null) return;
2774
- let r = we(t.revision.content, n, e);
2775
- r.length > 0 && await this.#S(r);
2680
+ let r = Se(t.revision.content, n, e);
2681
+ r.length > 0 && await this.#C(r);
2776
2682
  }
2777
2683
  async deleteSelectedNodes() {
2778
- if (!this.#P()) return;
2684
+ if (!this.#F()) return;
2779
2685
  let e = this.$.revision.value, t = this.#l.value.target;
2780
2686
  if (e == null || t == null || this.#l.value.selectedNodeIds.length == 0) return;
2781
- let n = p(this.#l.value.presentation?.value ?? {}, t), r = new Set(this.#l.value.selectedNodeIds.filter((e) => n.has(e))), i = $e(e, t, this.#l.value.selectedNodeIds), a = i.length == 0 ? void 0 : this.#S(i), o = r.size == 0 ? void 0 : this.#w((e) => m(e, t, r));
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));
2782
2688
  this.selectNodes([]), (a == null || await a != null) && await o;
2783
2689
  }
2784
2690
  copySelectedNodes() {
@@ -2786,33 +2692,33 @@ var Dt = class {
2786
2692
  if (e == null || t == null || this.#l.value.selectedNodeIds.length == 0) return;
2787
2693
  let n = new Set(this.#l.value.selectedNodeIds);
2788
2694
  this.#u = {
2789
- comments: this.#N().nodes.flatMap((e) => e.kind == "comment" && n.has(e.id) ? [{
2695
+ comments: this.#P().nodes.flatMap((e) => e.kind == "comment" && n.has(e.id) ? [{
2790
2696
  content: e.content,
2791
2697
  position: e.position,
2792
2698
  sourceId: e.id,
2793
2699
  title: e.title
2794
2700
  }] : []),
2795
- nodes: et(e, t, this.#l.value.selectedNodeIds)
2701
+ nodes: He(e, t, this.#l.value.selectedNodeIds)
2796
2702
  };
2797
2703
  }
2798
- async pasteNodes() {
2799
- if (!this.#P()) return;
2800
- let e = this.$.revision.value, t = this.#l.value.target;
2801
- if (e == null || t == null || this.#u == null) return;
2802
- let n = tt(e, t, this.#u.nodes, this.#i), r = n.changes.length == 0 ? void 0 : this.#S(n.changes), i = this.#u.comments.map((e) => ({
2704
+ async pasteNodes(e) {
2705
+ if (!this.#F()) return;
2706
+ let t = this.$.revision.value, n = this.#l.value.target;
2707
+ 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) => ({
2803
2709
  ...e,
2804
2710
  nodeId: this.#i()
2805
2711
  }));
2806
- if (n.nodeIds.length == 0 && i.length == 0) return;
2807
- let a = new Map(this.#N().nodes.map((e) => [e.id, e])), o = Object.fromEntries(n.sourceIds.map((e, t) => {
2808
- let r = a.get(e);
2809
- return [n.nodeIds[t], {
2810
- x: (r?.position.x ?? 80) + 40,
2811
- y: (r?.position.y ?? 80) + 40
2712
+ if (r.nodeIds.length == 0 && a.length == 0) return;
2713
+ let o = new Map(this.#P().nodes.map((e) => [e.id, e])), s = Object.fromEntries(r.sourceIds.map((t, n) => {
2714
+ let i = e?.[t] ?? o.get(t)?.position;
2715
+ return [r.nodeIds[n], {
2716
+ x: (i?.x ?? 80) + 40,
2717
+ y: (i?.y ?? 80) + 40
2812
2718
  }];
2813
- })), s = this.#w((e) => {
2814
- let n = d(e, t, o);
2815
- for (let e of i) n = x(n, t, e.nodeId, {
2719
+ })), c = this.#T((e) => {
2720
+ let t = p(e, n, s);
2721
+ for (let e of a) t = _(t, n, e.nodeId, {
2816
2722
  content: e.content,
2817
2723
  position: {
2818
2724
  x: e.position.x + 40,
@@ -2820,48 +2726,60 @@ var Dt = class {
2820
2726
  },
2821
2727
  title: this.#r.t("addNode.commentCopy", { title: e.title })
2822
2728
  });
2823
- return n;
2729
+ return t;
2824
2730
  });
2825
- this.selectNodes([...n.nodeIds, ...i.map((e) => e.nodeId)]), (r == null || await r != null) && await s;
2731
+ this.selectNodes([...r.nodeIds, ...a.map((e) => e.nodeId)]), (i == null || await i != null) && await c;
2826
2732
  }
2827
- async duplicateSelectedNodes() {
2828
- this.copySelectedNodes(), await this.pasteNodes();
2733
+ async duplicateSelectedNodes(e) {
2734
+ this.copySelectedNodes(), await this.pasteNodes(e);
2829
2735
  }
2830
2736
  async saveNodeSettings(e, t) {
2831
2737
  let n = this.$.revision.value, r = this.#l.value.target;
2832
2738
  if (n == null || r == null) return !1;
2833
- let i = nt(n, r, e, t);
2834
- return i != null && await this.#S(i) != null;
2739
+ let i = We(n, r, e, t);
2740
+ return i != null && await this.#C(i) != null;
2835
2741
  }
2836
2742
  async saveNodeDescription(e, t) {
2837
2743
  let n = this.$.revision.value, r = this.#l.value.target;
2838
2744
  if (n == null || r == null) return !1;
2839
- let i = rt(n, r, e, t);
2840
- return i != null && await this.#S(i) != null;
2745
+ let i = Ge(n, r, e, t);
2746
+ return i != null && await this.#C(i) != null;
2747
+ }
2748
+ async saveNodeIcon(e, t) {
2749
+ let n = this.$.revision.value, r = this.#l.value.target;
2750
+ if (n == null || r == null) return !1;
2751
+ let i = Ke(n, r, e, t);
2752
+ return i != null && await this.#C(i) != null;
2753
+ }
2754
+ async saveNodeTitle(e, t) {
2755
+ let n = this.$.revision.value, r = this.#l.value.target;
2756
+ if (n == null || r == null) return !1;
2757
+ let i = qe(n, r, e, t);
2758
+ return i != null && await this.#C(i) != null;
2841
2759
  }
2842
2760
  async setInputValue(e, t, n) {
2843
2761
  let r = this.$.revision.value, i = this.#l.value.target;
2844
2762
  if (r == null || i == null) return !1;
2845
- let a = it(r, i, e, t, n);
2846
- return a != null && await this.#S(a) != null;
2763
+ let a = Je(r, i, e, t, n);
2764
+ return a != null && await this.#C(a) != null;
2847
2765
  }
2848
2766
  async saveCondition(e, t) {
2849
2767
  let n = this.$.revision.value, r = this.#l.value.target;
2850
2768
  if (n == null || r == null) return !1;
2851
- let i = at(n, r, e, t);
2852
- return i != null && await this.#S(i) != null;
2769
+ let i = Ye(n, r, e, t);
2770
+ return i != null && await this.#C(i) != null;
2853
2771
  }
2854
2772
  async saveValue(e, t) {
2855
2773
  let n = this.$.revision.value, r = this.#l.value.target;
2856
2774
  if (n == null || r == null) return !1;
2857
- let i = ot(n, r, e, t);
2858
- return i != null && await this.#S(i) != null;
2775
+ let i = Xe(n, r, e, t);
2776
+ return i != null && await this.#C(i) != null;
2859
2777
  }
2860
2778
  async saveComment(e, t) {
2861
2779
  let n = this.#l.value.target;
2862
2780
  if (n == null) return;
2863
- let r = this.#N().nodes.find((t) => t.id == e)?.position;
2864
- r != null && await this.#w((i) => x(i, n, e, {
2781
+ let r = this.#P().nodes.find((t) => t.id == e)?.position;
2782
+ r != null && await this.#T((i) => _(i, n, e, {
2865
2783
  ...t,
2866
2784
  position: r
2867
2785
  }));
@@ -2869,60 +2787,60 @@ var Dt = class {
2869
2787
  async saveTaskSettings(e, t) {
2870
2788
  let n = this.$.revision.value, r = this.#l.value.target;
2871
2789
  if (n == null || r == null) return !1;
2872
- let i = st(n, r, e, t);
2873
- return i != null && await this.#S(i) != null;
2790
+ let i = Ze(n, r, e, t);
2791
+ return i != null && await this.#C(i) != null;
2874
2792
  }
2875
2793
  async saveCodeTaskPorts(e, t) {
2876
2794
  let n = this.$.revision.value, r = this.#l.value.target;
2877
2795
  if (n == null || r == null) return !1;
2878
- let i = ct(n, r, e, t);
2879
- return i != null && await this.#S(i) != null;
2796
+ let i = Qe(n, r, e, t);
2797
+ return i != null && await this.#C(i) != null;
2880
2798
  }
2881
2799
  async setConnectorConnection(e, t) {
2882
2800
  let n = this.$.revision.value;
2883
2801
  if (n == null) return !1;
2884
- let r = ze(n.revision.content, e, t);
2885
- return r != null && await this.#S(r) != null;
2802
+ let r = Pe(n.revision.content, e, t);
2803
+ return r != null && await this.#C(r) != null;
2886
2804
  }
2887
2805
  async saveTriggerSettings(e, t) {
2888
2806
  let n = this.$.revision.value, r = this.#l.value.target;
2889
2807
  if (n == null || r?.kind != "flow") return !1;
2890
- let i = Be(n.revision.content, r, e, t);
2891
- return i != null && await this.#S(i) != null;
2808
+ let i = Fe(n.revision.content, r, e, t);
2809
+ return i != null && await this.#C(i) != null;
2892
2810
  }
2893
2811
  async saveTriggerConfig(e, t, n) {
2894
2812
  let r = this.$.revision.value, i = this.#l.value.target;
2895
2813
  if (r == null || i?.kind != "flow") return !1;
2896
- let a = Ve(r.revision.content, i, e, t, n);
2897
- return a != null && await this.#S(a) != null;
2814
+ let a = Ie(r.revision.content, i, e, t, n);
2815
+ return a != null && await this.#C(a) != null;
2898
2816
  }
2899
2817
  async saveTriggerSchedule(e, t) {
2900
2818
  let n = this.$.revision.value, r = this.#l.value.target;
2901
2819
  if (n == null || r?.kind != "flow") return !1;
2902
- let i = He(n.revision.content, r, e, t);
2903
- return i != null && await this.#S(i) != null;
2820
+ let i = Le(n.revision.content, r, e, t);
2821
+ return i != null && await this.#C(i) != null;
2904
2822
  }
2905
2823
  async saveWebhook(e, t) {
2906
2824
  let n = this.$.revision.value, r = this.#l.value.target;
2907
2825
  if (n == null || r?.kind != "flow") return !1;
2908
- let i = lt(n, r, e, t);
2909
- return i != null && await this.#S(i) != null;
2826
+ let i = $e(n, r, e, t);
2827
+ return i != null && await this.#C(i) != null;
2910
2828
  }
2911
2829
  async setTriggerConnection(e, t) {
2912
2830
  let n = this.$.revision.value, r = this.#l.value.target;
2913
2831
  if (n == null || r?.kind != "flow") return !1;
2914
- let i = Ue(n.revision.content, r, e, t);
2915
- return i != null && await this.#S(i) != null;
2832
+ let i = Re(n.revision.content, r, e, t);
2833
+ return i != null && await this.#C(i) != null;
2916
2834
  }
2917
2835
  async saveSubflowSettings(e, t) {
2918
2836
  let n = this.$.revision.value;
2919
2837
  if (n == null) return !1;
2920
- let r = ut(n, e, t);
2921
- return r != null && await this.#S(r) != null;
2838
+ let r = et(n, e, t);
2839
+ return r != null && await this.#C(r) != null;
2922
2840
  }
2923
2841
  updateModuleSource(e) {
2924
2842
  let t = this.#l.value.moduleEditor;
2925
- t != null && t.source != e && this.#z({ moduleEditor: {
2843
+ t != null && t.source != e && this.#B({ moduleEditor: {
2926
2844
  ...t,
2927
2845
  phase: void 0,
2928
2846
  source: e
@@ -2933,10 +2851,10 @@ var Dt = class {
2933
2851
  if (e == null) return;
2934
2852
  let t = this.#l.value.draft?.content.modules[e.moduleId];
2935
2853
  if (t == null) {
2936
- this.#z({ moduleEditor: void 0 });
2854
+ this.#B({ moduleEditor: void 0 });
2937
2855
  return;
2938
2856
  }
2939
- this.#z({ moduleEditor: {
2857
+ this.#B({ moduleEditor: {
2940
2858
  moduleId: e.moduleId,
2941
2859
  source: t.source
2942
2860
  } });
@@ -2944,311 +2862,298 @@ var Dt = class {
2944
2862
  async saveModuleEditor() {
2945
2863
  let e = this.#l.value.moduleEditor;
2946
2864
  if (e == null || e.phase == "saving") return !1;
2947
- this.#z({ moduleEditor: {
2865
+ this.#B({ moduleEditor: {
2948
2866
  ...e,
2949
2867
  phase: "saving"
2950
2868
  } });
2951
- let t = await Oe(e.source);
2869
+ let t = await Ce(e.source);
2952
2870
  if (this.#_) return !1;
2953
- let n = await this.#S(ke(e.moduleId, e.source, t));
2954
- return !this.#_ && this.#l.value.moduleEditor?.moduleId == e.moduleId && this.#z({ moduleEditor: {
2871
+ let n = await this.#C(we(e.moduleId, e.source, t));
2872
+ return !this.#_ && this.#l.value.moduleEditor?.moduleId == e.moduleId && this.#B({ moduleEditor: {
2955
2873
  ...this.#l.value.moduleEditor,
2956
2874
  phase: n == null ? "failed" : void 0
2957
2875
  } }), n != null;
2958
2876
  }
2959
- async moveNodes(e) {
2960
- let t = this.#l.value.target;
2961
- t != null && await this.#w((n) => d(n, t, e));
2877
+ async moveNodes(e, t = "detail") {
2878
+ let n = this.#l.value.target;
2879
+ n != null && await this.#T((r) => p(r, n, e, t));
2962
2880
  }
2963
- async moveViewport(e) {
2964
- let t = this.#l.value.target;
2965
- if (t == null) return;
2966
- let n = this.#N().viewport;
2967
- (n.x != e.x || n.y != e.y || n.zoom != e.zoom) && this.#j(), await this.#w((n) => l(n, t, e));
2881
+ async moveViewport(e, t = "detail") {
2882
+ let n = this.#l.value.target;
2883
+ if (n == null) return;
2884
+ 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));
2968
2886
  }
2969
2887
  async check() {
2970
- await this.#T();
2888
+ await this.#E();
2971
2889
  }
2972
2890
  async refreshFlows() {
2973
- let e = this.#l.value.projectId;
2974
- if (e == null) return;
2975
- let t = this.#o.capture(), n = await this.#e.listFlows(e);
2976
- t() && e == this.#l.value.projectId && this.#z({ flows: n });
2891
+ await this.reloadFlows();
2892
+ }
2893
+ updateLive(e) {
2894
+ e.flowId == this.#l.value.flowId && this.#B({ live: e });
2977
2895
  }
2978
2896
  locateNode(e) {
2979
2897
  let t = this.$.revision.value, n = this.#l.value.target;
2980
- return t == null || n == null || t.node(n, e) == null || !this.selectNodes([e]) ? !1 : (this.#z({ nodeFocus: {
2898
+ return t == null || n == null || t.node(n, e) == null || !this.selectNodes([e]) ? !1 : (this.#B({ nodeFocus: {
2981
2899
  nodeId: e,
2982
2900
  requestId: ++this.#y
2983
2901
  } }), !0);
2984
2902
  }
2985
2903
  locateDiagnostic(e) {
2986
- return e.location == null || !this.selectNodes([e.location.nodeId]) ? !1 : (this.#z({ diagnosticFocus: {
2904
+ return e.location == null || !this.selectNodes([e.location.nodeId]) ? !1 : (this.#B({ diagnosticFocus: {
2987
2905
  ...e.location,
2988
2906
  diagnostic: e.diagnostic,
2989
2907
  requestId: ++this.#d
2990
2908
  } }), !0);
2991
2909
  }
2992
- async #x(e, t, n) {
2993
- let r = Math.max(0, ...this.#N().nodes.flatMap((e) => {
2910
+ async #S(e, t, n) {
2911
+ let r = Math.max(0, ...this.#P().nodes.flatMap((e) => {
2994
2912
  if (e.kind != "comment") return [];
2995
2913
  let t = /#(\d+)$/.exec(e.title);
2996
2914
  return t == null ? [] : [Number(t[1])];
2997
- })), i = this.#w((i) => x(i, e, t, {
2915
+ })), i = this.#T((i) => _(i, e, t, {
2998
2916
  content: "",
2999
2917
  position: n,
3000
2918
  title: this.#r.t("addNode.commentName", { number: r + 1 })
3001
2919
  }));
3002
2920
  if (this.selectNodes([t]), await i, !this.#_) return t;
3003
2921
  }
3004
- async #S(e, t = !0) {
3005
- let n = this.#l.value.projectId, r = this.#l.value.draft;
2922
+ async #C(e, t = !0) {
2923
+ let n = this.#l.value.flowId, r = this.#l.value.draft;
3006
2924
  if (n != null && r != null) return await this.#t.change({
3007
2925
  current: this.#n.capture(),
3008
- projectId: n
2926
+ flowId: n
3009
2927
  }, r, e, t);
3010
2928
  }
3011
- #C(e, t, n, r = !1) {
3012
- let i = this.#l.value.draft, { revision: a, selectedNodeIds: o, target: s } = this.#F(e, t, n), c = this.#l.value.moduleEditor;
3013
- return this.#z({
3014
- diagnostics: r ? this.#l.value.diagnostics : void 0,
2929
+ #w(e, t = !1) {
2930
+ let n = this.#l.value.draft, { revision: r, selectedNodeIds: i, target: a } = this.#I(e), o = this.#l.value.moduleEditor;
2931
+ return this.#B({
2932
+ diagnostics: t ? this.#l.value.diagnostics : void 0,
3015
2933
  draft: e,
3016
- flows: t,
3017
- moduleEditor: c != null && i != null && Q(i, c) != "saved" ? c : $(a, s, o),
3018
- selectedNodeIds: o,
3019
- target: s
3020
- }), a;
2934
+ moduleEditor: o != null && n != null && Z(n, o) != "saved" ? o : Q(r, a, i),
2935
+ selectedNodeIds: i,
2936
+ target: a
2937
+ }), r;
3021
2938
  }
3022
- async #w(e) {
2939
+ async #T(e) {
3023
2940
  if (this.#_) return;
3024
- let t = this.#l.value.projectId, n = this.#l.value.presentation;
2941
+ let t = this.#l.value.flowId, n = this.#l.value.presentation;
3025
2942
  t != null && n != null && await this.#a.change(t, n, this.#o.capture(), e);
3026
2943
  }
3027
- async #T() {
2944
+ async #E() {
3028
2945
  if (this.#_) return;
3029
- let e = this.#l.value.projectId, t = this.#l.value.draft, n = this.#l.value.target;
2946
+ let e = this.#l.value.flowId, t = this.#l.value.draft, n = this.#l.value.target;
3030
2947
  if (e == null || t == null || n == null) {
3031
- n ?? this.#z({
3032
- checkLoading: !1,
3033
- diagnostics: void 0
3034
- });
3035
- return;
3036
- }
3037
- let r = We(f(t), n);
3038
- if (r == null) {
3039
- this.#z({
2948
+ n ?? this.#B({
3040
2949
  checkLoading: !1,
3041
2950
  diagnostics: void 0
3042
2951
  });
3043
2952
  return;
3044
2953
  }
3045
- this.#z({
2954
+ this.#B({
3046
2955
  checkLoading: !0,
3047
2956
  diagnosticFocus: void 0
3048
2957
  });
3049
2958
  try {
3050
- let n = await this.#e.checkFlow(e, t.revisionId, r);
3051
- !this.#_ && e == this.#l.value.projectId && t.revisionId == this.#l.value.draft?.revisionId && this.#z({ diagnostics: n });
2959
+ let n = await this.#e.checkFlow(e, t.revisionId);
2960
+ !this.#_ && e == this.#l.value.flowId && t.revisionId == this.#l.value.draft?.revisionId && this.#B({ diagnostics: n });
3052
2961
  } catch (n) {
3053
- !this.#_ && e == this.#l.value.projectId && t.revisionId == this.#l.value.draft?.revisionId && this.#c(o(n, this.#r.t));
2962
+ !this.#_ && e == this.#l.value.flowId && t.revisionId == this.#l.value.draft?.revisionId && this.#c(u(n, this.#r.t));
3054
2963
  } finally {
3055
- !this.#_ && e == this.#l.value.projectId && t.revisionId == this.#l.value.draft?.revisionId && this.#z({ checkLoading: !1 });
2964
+ !this.#_ && e == this.#l.value.flowId && t.revisionId == this.#l.value.draft?.revisionId && this.#B({ checkLoading: !1 });
3056
2965
  }
3057
2966
  }
3058
- async #E(e) {
2967
+ async #D(e) {
3059
2968
  if (this.#_) return;
3060
- let t = this.#l.value.projectId;
2969
+ let t = this.#l.value.flowId;
3061
2970
  if (t == null || (this.#f += 1, e != null && (this.#g = !0, this.#t.changing || (this.#h = !0)), this.#v)) return;
3062
2971
  this.#v = !0;
3063
2972
  let n = {
3064
2973
  current: this.#n.capture(),
3065
- projectId: t
2974
+ flowId: t
3066
2975
  };
3067
2976
  await this.#t.enqueue(async () => {
3068
2977
  let e;
3069
2978
  do {
3070
2979
  e = this.#f;
3071
2980
  let t = this.#h, r = this.#m, i = this.#g;
3072
- this.#h = !1, this.#g = !1, await this.#D(n, !1, i, t, r);
3073
- } while (this.#R(n) && e != this.#f);
3074
- }), this.#R(n) && (this.#v = !1);
2981
+ this.#h = !1, this.#g = !1, await this.#O(n, !1, i, t, r);
2982
+ } while (this.#z(n) && e != this.#f);
2983
+ }), this.#z(n) && (this.#v = !1);
3075
2984
  }
3076
- async #D(e, t, n = !1, r = !1, i = this.#m) {
2985
+ async #O(e, t, n = !1, r = !1, i = this.#m) {
3077
2986
  try {
3078
2987
  let t = r ? this.#l.value.target : void 0, a = this.#t.committed;
3079
2988
  if (a == null) return !1;
3080
- let o = await this.#e.syncDraft(e.projectId, a.revisionId);
3081
- if (!this.#R(e)) return !1;
2989
+ let o = await this.#e.syncDraft(e.flowId, a.revisionId);
2990
+ if (!this.#z(e)) return !1;
3082
2991
  if (o.kind == "changes" && o.revisions.length == 0) return !0;
3083
2992
  let s;
3084
2993
  try {
3085
- s = this.#O(a, o);
2994
+ s = this.#k(a, o);
3086
2995
  } catch {
3087
- if (o = await this.#e.syncDraft(e.projectId), !this.#R(e)) return !1;
3088
- s = this.#O(a, o);
2996
+ if (o = await this.#e.syncDraft(e.flowId), !this.#z(e)) return !1;
2997
+ s = this.#k(a, o);
3089
2998
  }
3090
2999
  if (s.revisionId == a.revisionId) return !0;
3091
- let c = o.kind == "changes" && t != null ? mt(f(a), f(s), t, o.revisions.flatMap((e) => e.operations)) : void 0;
3092
- o.kind == "snapshot" && this.#j();
3093
- let l = this.#l.value.flows, u = gt(l, o.draftFlows, s), d = this.#l.value.diagnostics, p = this.#t.pendingCount == 0 && d != null && u.find((e) => e.flowId == d.flowId)?.draft?.closureDigest == d.closureDigest, m = this.#I(s, u, p);
3094
- return this.#M(e.projectId, s.revisionId), o.kind == "changes" && o.revisions.length > 0 && t != null && c != null && i == this.#m && this.#k(e, t, c, i), n && (this.#c({
3095
- kind: m ? "error" : "success",
3096
- message: this.#r.t(m ? "notice.moduleUpdated" : "notice.draftUpdated")
3097
- }), p || this.#T()), !0;
3000
+ let c = o.kind == "changes" && t != null ? it(h(a), h(s), t, o.revisions.flatMap((e) => e.operations)) : void 0;
3001
+ o.kind == "snapshot" && this.#M();
3002
+ let l = this.#L(s, !1);
3003
+ 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({
3004
+ kind: l ? "error" : "success",
3005
+ message: this.#r.t(l ? "notice.moduleUpdated" : "notice.draftUpdated")
3006
+ }), this.#E()), !0;
3098
3007
  } catch (n) {
3099
- return t && this.#R(e) && this.#c(o(n, this.#r.t)), !1;
3008
+ return t && this.#z(e) && this.#c(u(n, this.#r.t)), !1;
3100
3009
  }
3101
3010
  }
3102
- #O(e, t) {
3011
+ #k(e, t) {
3103
3012
  if (t.kind == "snapshot") return t.draft;
3104
3013
  let n = e;
3105
3014
  for (let e of t.revisions) {
3106
3015
  if (e.revision.parentRevisionId != n.revisionId) throw Error("Invalid Draft revision chain.");
3107
3016
  n = {
3108
3017
  ...e.revision,
3109
- content: q(n, e.operations).content
3018
+ content: K(n, e.operations).content
3110
3019
  };
3111
3020
  }
3112
3021
  return n;
3113
3022
  }
3114
- #k(e, t, n, r) {
3023
+ #A(e, t, n, r) {
3115
3024
  let i = this.#l.value;
3116
- if (!this.#R(e) || r != this.#m || i.target?.kind != t.kind || i.target.id != t.id) return;
3025
+ if (!this.#z(e) || r != this.#m || !$(i.target, t)) return;
3117
3026
  let a = this.#p;
3118
3027
  if (a != null) {
3119
- if (a.projectId != e.projectId || a.target.kind != t.kind || a.target.id != t.id) {
3120
- this.#j();
3028
+ if (a.flowId != e.flowId || !$(a.target, t)) {
3029
+ this.#M();
3121
3030
  return;
3122
3031
  }
3123
3032
  for (let e of n) a.targets.add(e);
3124
- globalThis.clearTimeout(a.timer), a.timer = globalThis.setTimeout(() => this.#A(), Tt);
3033
+ globalThis.clearTimeout(a.timer), a.timer = globalThis.setTimeout(() => this.#j(), xt);
3125
3034
  return;
3126
3035
  }
3127
3036
  n.size == 0 || i.selectedNodeIds.length > 0 || (this.#p = {
3128
3037
  current: e.current,
3129
3038
  generation: r,
3130
- projectId: e.projectId,
3039
+ flowId: e.flowId,
3131
3040
  target: t,
3132
3041
  targets: new Set(n),
3133
- timer: globalThis.setTimeout(() => this.#A(), Tt),
3134
- viewport: this.#N().viewport
3042
+ timer: globalThis.setTimeout(() => this.#j(), xt),
3043
+ viewport: this.#P().viewport
3135
3044
  });
3136
3045
  }
3137
- #A() {
3046
+ #j() {
3138
3047
  let e = this.#p;
3139
3048
  if (this.#p = void 0, e == null || !e.current() || e.generation != this.#m) return;
3140
3049
  let t = this.#l.value;
3141
- if (t.projectId != e.projectId || t.target?.kind != e.target.kind || t.target.id != e.target.id || t.selectedNodeIds.length > 0) return;
3142
- let n = this.#N().viewport;
3050
+ if (t.flowId != e.flowId || !$(t.target, e.target) || t.selectedNodeIds.length > 0) return;
3051
+ let n = this.#P().viewport;
3143
3052
  if (n.x != e.viewport.x || n.y != e.viewport.y || n.zoom != e.viewport.zoom || t.draft == null) return;
3144
- let r = f(t.draft), i = [...e.targets].filter((t) => r.selection(e.target, t) != null);
3145
- i.length == 1 && this.#z({ nodeFocus: {
3053
+ let r = h(t.draft), i = [...e.targets].filter((t) => r.selection(e.target, t) != null);
3054
+ i.length == 1 && this.#B({ nodeFocus: {
3146
3055
  nodeId: i[0],
3147
3056
  requestId: ++this.#y
3148
3057
  } });
3149
3058
  }
3150
- #j() {
3059
+ #M() {
3151
3060
  this.#m += 1, this.#p != null && globalThis.clearTimeout(this.#p.timer), this.#p = void 0;
3152
3061
  }
3153
- #M(e, t) {
3062
+ #N(e, t) {
3154
3063
  this.#o.advanceHead(e, t);
3155
3064
  }
3156
- #N() {
3065
+ #P() {
3157
3066
  let e = this.#l.value;
3158
- return _(e.draft, e.target, e.presentation?.value, e.diagnostics?.diagnostics, {}, {}, this.#r.t);
3067
+ return y(e.draft, e.target, e.presentation?.value, e.diagnostics?.diagnostics, {}, {}, this.#r.t);
3159
3068
  }
3160
- #P() {
3069
+ #F() {
3161
3070
  let e = this.#l.value.moduleEditor;
3162
- return e == null || Q(this.#l.value.draft, e) == "saved" || (this.#c({
3071
+ return e == null || Z(this.#l.value.draft, e) == "saved" || (this.#c({
3163
3072
  kind: "error",
3164
3073
  message: this.#r.t("notice.unsavedCode")
3165
3074
  }), !1);
3166
3075
  }
3167
- #F(e, t, n) {
3168
- let r = f(e), i = Et(r, t, n, this.#l.value.target);
3076
+ #I(e) {
3077
+ let t = h(e), n = St(t, this.#l.value.target);
3169
3078
  return {
3170
- revision: r,
3171
- selectedNodeIds: this.#l.value.selectedNodeIds.filter((e) => i != null && r.selection(i, e) != null),
3172
- target: i
3079
+ revision: t,
3080
+ selectedNodeIds: this.#l.value.selectedNodeIds.filter((e) => n != null && t.selection(n, e) != null),
3081
+ target: n
3173
3082
  };
3174
3083
  }
3175
- #I(e, t, n) {
3084
+ #L(e, t) {
3176
3085
  this.#t.replaceCommitted(e);
3177
- let r = this.#t.project(e), i = this.#l.value.moduleEditor, a = i != null && Q(this.#l.value.draft, i) != "saved", o = this.#l.value.flows, s = this.#F(r, t, o), c = new Set(o.map((e) => e.flowId)), l = this.#l.value.target == null ? t.filter((e) => e.draft != null && s.revision.flow(e.flowId) != null && !c.has(e.flowId)) : [], u = l.length == 1 ? {
3178
- id: l[0].flowId,
3179
- kind: "flow"
3180
- } : s.target;
3181
- return this.#z({
3182
- diagnostics: n ? this.#l.value.diagnostics : void 0,
3183
- draft: r,
3184
- flows: t,
3185
- moduleEditor: this.#L(s.revision, u, s.selectedNodeIds),
3186
- selectedNodeIds: s.selectedNodeIds,
3187
- target: u
3188
- }), a;
3189
- }
3190
- #L(e, t, n) {
3086
+ let n = this.#t.project(e), r = this.#l.value.moduleEditor, i = r != null && Z(this.#l.value.draft, r) != "saved", a = this.#I(n), o = a.target;
3087
+ return this.#B({
3088
+ diagnostics: t ? this.#l.value.diagnostics : void 0,
3089
+ draft: n,
3090
+ moduleEditor: this.#R(a.revision, o, a.selectedNodeIds),
3091
+ selectedNodeIds: a.selectedNodeIds,
3092
+ target: o
3093
+ }), i;
3094
+ }
3095
+ #R(e, t, n) {
3191
3096
  let r = this.#l.value.moduleEditor;
3192
- return r == null || Q(this.#l.value.draft, r) == "saved" ? $(e, t, n) : {
3097
+ return r == null || Z(this.#l.value.draft, r) == "saved" ? Q(e, t, n) : {
3193
3098
  ...r,
3194
3099
  phase: "failed"
3195
3100
  };
3196
3101
  }
3197
- #R(e) {
3198
- return !this.#_ && e.projectId == this.#l.value.projectId && e.current();
3199
- }
3200
3102
  #z(e) {
3103
+ return !this.#_ && e.flowId == this.#l.value.flowId && e.current();
3104
+ }
3105
+ #B(e) {
3201
3106
  this.#_ || this.#l.set(e);
3202
3107
  }
3203
3108
  };
3204
3109
  //#endregion
3205
3110
  //#region src/workbench/browser/runtime/stores/workbenchStore.ts
3206
- function Ot(e) {
3111
+ function wt(e) {
3207
3112
  return new Map(e.nodes.map((e) => [e.id, e]));
3208
3113
  }
3209
- function kt(e, t) {
3210
- return e == null || t == null ? [] : f(e).designerInputs(t);
3114
+ function Tt(e, t) {
3115
+ return e == null || t == null ? [] : h(e).designerInputs(t);
3211
3116
  }
3212
- function At(e, t, n, r, i) {
3213
- if (e == null || t?.kind != "flow" || n?.revisionId != e.revisionId || n.flowId != t.id) return /* @__PURE__ */ new Map();
3214
- let a = r.find((e) => e.kind == "run.started" && e.payload.flowId == t.id)?.payload.scopeId;
3215
- return typeof a == "string" ? new Map(r.flatMap((e) => {
3216
- let n = e.payload.nodeId;
3217
- return e.payload.scopeId == a && e.payload.flowId == t.id && typeof n == "string" && i.has(n) ? [[e.sequence, n]] : [];
3117
+ function Et(e, t, n, r, i) {
3118
+ if (e == null || t?.kind != "flow" || n?.revisionId != e.revisionId || n.flowId != e.flowId) return /* @__PURE__ */ new Map();
3119
+ let a = r.find((t) => t.kind == "run.started" && t.payload.flowId == e.flowId)?.payload.scopeId;
3120
+ return typeof a == "string" ? new Map(r.flatMap((t) => {
3121
+ let n = t.payload.nodeId;
3122
+ return t.payload.scopeId == a && t.payload.flowId == e.flowId && typeof n == "string" && i.has(n) ? [[t.sequence, n]] : [];
3218
3123
  })) : /* @__PURE__ */ new Map();
3219
3124
  }
3220
- var jt = { openExternalPage: async () => !1 }, Mt = class {
3125
+ var Dt = { openExternalPage: async () => !1 }, Ot = class {
3221
3126
  #e;
3222
3127
  #t;
3223
3128
  #n;
3224
3129
  #r;
3225
- constructor(r, i, a = () => crypto.randomUUID(), o = y(), s = jt) {
3226
- this.#e = new S(), 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;
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;
3227
3132
  let c = (e) => {
3228
3133
  this.#r || this.#n.set(e);
3229
3134
  };
3230
- this.runs = new h(r, c, o), this.workspace = new Dt(r, c, a, o, (e) => void this.#a(r, e)), this.connectors = new be(r, this.workspace, c, s, o), this.triggers = new Ce(r, this.workspace, c, s, o), this.publications = new fe(r, this.workspace, c, a, o), this.runRequests = new ge(r, this.runs, c, o, a);
3231
- let l = /* @__PURE__ */ new Map(), u, d = n((e) => {
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);
3136
+ let u = /* @__PURE__ */ new Map(), d, f = n((e) => {
3232
3137
  let t = e(this.workspace.$.draft);
3233
- u != t?.projectId && (l.clear(), u = t?.projectId);
3234
- 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$), d = e(this.runs.$.run), f = e(this.runs.$.events), p = n == null ? "" : `${n.kind}:${n.id}`, m = [
3235
- ...kt(t, n),
3236
- r == null || n == null ? void 0 : v(r, n),
3138
+ 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),
3237
3142
  i,
3238
3143
  a,
3239
3144
  s,
3240
3145
  c,
3241
- d,
3146
+ l,
3242
3147
  f,
3243
- ...d == null ? [] : [t?.revisionId]
3244
- ], h = l.get(p);
3245
- if (h != null && h.inputs.length == m.length && h.inputs.every((e, t) => e === m[t])) return h.graph;
3246
- let g = _(t, n, r, i, a, s, c, d, f);
3247
- return l.set(p, {
3248
- graph: g,
3249
- inputs: m
3250
- }), g;
3251
- }), f = e(d, Ot);
3148
+ ...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);
3252
3157
  this.$ = {
3253
3158
  busy: n((e) => {
3254
3159
  let t = e(this.workspace.$.busy);
@@ -3259,13 +3164,13 @@ var jt = { openExternalPage: async () => !1 }, Mt = class {
3259
3164
  if (e(this.publications.$.rollingBackPublicationId) != null) return "rollback";
3260
3165
  if (e(this.publications.$.changingTriggerId) != null) return "trigger";
3261
3166
  }),
3262
- designer: d,
3263
- designerNodeById: f,
3167
+ designer: f,
3168
+ designerNodeById: p,
3264
3169
  notice: this.#n,
3265
- runEventNodes: n((e) => At(e(this.workspace.$.draft), e(this.workspace.$.target), e(this.runs.$.run), e(this.runs.$.events), e(f))),
3170
+ runEventNodes: n((e) => Et(e(this.workspace.$.draft), e(this.workspace.$.target), e(this.runs.$.run), e(this.runs.$.events), e(p))),
3266
3171
  selectedDesignerNode: n((e) => {
3267
3172
  let t = e(this.workspace.$.selectedNodeIds);
3268
- return t.length == 1 ? e(f).get(t[0]) : void 0;
3173
+ return t.length == 1 ? e(p).get(t[0]) : void 0;
3269
3174
  })
3270
3175
  };
3271
3176
  }
@@ -3274,27 +3179,31 @@ var jt = { openExternalPage: async () => !1 }, Mt = class {
3274
3179
  for (let e of Object.values(this.$)) e.dispose();
3275
3180
  this.connectors.dispose(), this.publications.dispose(), this.runRequests.dispose(), this.runs.dispose(), this.triggers.dispose(), this.workspace.dispose();
3276
3181
  }
3277
- async start(e, t) {
3278
- this.#e.invalidate(), this.connectors.reset(), this.triggers.reset(), this.publications.reset(), this.runRequests.reset(), this.runs.reset(), await this.workspace.start(e, t);
3182
+ 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);
3279
3184
  }
3280
- async retryProjects() {
3281
- await this.workspace.reloadProjects();
3185
+ async retryFlows() {
3186
+ await this.workspace.reloadFlows();
3282
3187
  }
3283
3188
  dismissNotice() {
3284
3189
  this.#r || this.#n.set(void 0);
3285
3190
  }
3286
- async selectProject(e, t) {
3287
- return this.#r || (this.#e.invalidate(), this.#n.set(void 0), !await this.workspace.selectProject(e, t)) ? !1 : (this.connectors.reset(), this.triggers.reset(), this.publications.reset(), this.runRequests.reset(), this.runs.reset(), !0);
3191
+ 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);
3288
3193
  }
3289
- async createProject(e) {
3290
- let t = await this.workspace.createProject(e);
3291
- return this.#r || t == null ? !1 : (await this.selectProject(t.projectId), this.#r || this.#n.set({
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({
3292
3197
  kind: "success",
3293
3198
  message: this.#t.t("notice.created", { name: t.name })
3294
3199
  }), !0);
3295
3200
  }
3296
3201
  selectNodes(e) {
3297
- this.workspace.selectNodes(e) && (this.connectors.refresh(), this.triggers.refresh());
3202
+ let t = this.workspace.$.selectedNodeIds.value;
3203
+ if (this.workspace.selectNodes(e)) {
3204
+ if (t === this.workspace.$.selectedNodeIds.value) return;
3205
+ this.connectors.refresh(), this.triggers.refresh();
3206
+ }
3298
3207
  }
3299
3208
  locateRunEvent(e) {
3300
3209
  let t = this.$.runEventNodes.value.get(e);
@@ -3313,69 +3222,56 @@ var jt = { openExternalPage: async () => !1 }, Mt = class {
3313
3222
  if (t.aborted || this.#r) return;
3314
3223
  let r = n.filter((e) => e.status == "rejected");
3315
3224
  if (r.length > 0 && r.length == n.length) throw r[0].reason;
3316
- return r.length > 0 && this.#n.set(o(r[0].reason, this.#t.t)), n.flatMap((e) => e.status == "fulfilled" ? e.value ?? [] : []);
3225
+ return r.length > 0 && this.#n.set(u(r[0].reason, this.#t.t)), n.flatMap((e) => e.status == "fulfilled" ? e.value ?? [] : []);
3317
3226
  }
3318
3227
  async refreshSelectedConnector(e = !1) {
3319
3228
  await this.connectors.refresh(e);
3320
3229
  }
3321
3230
  async requestDraftRun() {
3322
- let e = this.workspace.$.projectId.value, t = this.workspace.$.targetFlow.value, n = this.workspace.$.draft.value;
3323
- return e == null || t == null || n == null ? "unavailable" : await this.runRequests.requestDraft(e, t, n);
3231
+ let e = this.workspace.$.targetFlow.value, t = this.workspace.$.draft.value;
3232
+ return e == null || t == null ? "unavailable" : await this.runRequests.requestDraft(e, t);
3324
3233
  }
3325
3234
  async requestLiveRun() {
3326
- let e = this.workspace.$.projectId.value, t = this.workspace.$.targetFlow.value;
3327
- return e == null || t == null ? "unavailable" : await this.runRequests.requestLive(e, t);
3235
+ let e = this.workspace.$.targetFlow.value;
3236
+ return e == null ? "unavailable" : await this.runRequests.requestLive(e);
3328
3237
  }
3329
3238
  async #a(e, t) {
3330
3239
  let n = this.workspace.$.target.value;
3331
- if (this.#r || this.runRequests.$.submitting.value != null || this.workspace.$.projectId.value != t.projectId || n?.kind != "flow" || n.id != t.flowId) return;
3240
+ if (this.#r || this.runRequests.$.submitting.value != null || n?.kind != "flow" || this.workspace.$.flowId.value != t.flowId) return;
3332
3241
  let r = this.#e.begin();
3333
3242
  try {
3334
3243
  let n = await e.getRun(t.runId), i = this.workspace.$.target.value;
3335
- if (!r() || this.#r || this.workspace.$.projectId.value != t.projectId || i?.kind != "flow" || i.id != t.flowId || n.projectId != t.projectId || n.flowId != t.flowId || n.runId != t.runId) return;
3244
+ if (!r() || this.#r || i?.kind != "flow" || this.workspace.$.flowId.value != t.flowId || n.flowId != t.flowId || n.runId != t.runId) return;
3336
3245
  this.runs.followExternal(n);
3337
3246
  } catch {
3338
3247
  return;
3339
3248
  }
3340
3249
  }
3341
- }, Nt = ie(() => import("./flowWorkspace-CylW6hge.js"));
3342
- function Pt({ host: e, store: t }) {
3250
+ }, kt = ie(() => import("./flowWorkspace-D7-rBA1-.js").then((e) => e.t));
3251
+ function At({ host: e, store: t }) {
3343
3252
  let n = a(t.$.notice);
3344
- return C(() => e.notify(n), [e, n]), C(() => () => e.notify(void 0), [e]), null;
3253
+ return S(() => e.notify(n), [e, n]), S(() => () => e.notify(void 0), [e]), null;
3345
3254
  }
3346
- function Ft({ hrefFor: e, language: t, navigation: n, onLanguageChange: r, store: i, theme: o }) {
3347
- let s = a(i.workspace.$.projectId), c = a(i.workspace.$.target);
3348
- return /* @__PURE__ */ w("div", {
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", {
3349
3258
  className: "app-shell",
3350
- children: s == null ? /* @__PURE__ */ w(te, {
3351
- hrefForProject: (t) => e({
3352
- projectId: t,
3353
- view: "design"
3354
- }),
3355
- language: t,
3356
- onCreateProject: (e) => n.createProject(e),
3357
- onLanguageChange: r,
3358
- onSelectProject: (e) => void n.selectProject(e),
3359
- store: i
3360
- }) : c == null ? /* @__PURE__ */ w(ne, {
3259
+ children: s == null ? /* @__PURE__ */ C(ne, {
3361
3260
  hrefForFlow: (t) => e({
3362
3261
  flowId: t.flowId,
3363
- projectId: s,
3364
- view: t.draft == null ? "publications" : "design"
3262
+ view: "design"
3365
3263
  }),
3366
3264
  language: t,
3367
3265
  onCreateFlow: (e) => n.createFlow(e),
3368
3266
  onLanguageChange: r,
3369
- onOpenProjects: () => void n.openProjects(),
3370
- onSelectFlow: (e) => n.selectFlow(e),
3371
- projectsHref: e({ view: "design" }),
3267
+ onSelectFlow: (e) => void n.selectFlow(e),
3372
3268
  store: i
3373
- }) : /* @__PURE__ */ w(re, {
3374
- fallback: /* @__PURE__ */ w("main", {
3269
+ }) : /* @__PURE__ */ C(re, {
3270
+ fallback: /* @__PURE__ */ C("main", {
3375
3271
  "aria-busy": "true",
3376
3272
  className: "workspace"
3377
3273
  }),
3378
- children: /* @__PURE__ */ w(Nt, {
3274
+ children: /* @__PURE__ */ C(kt, {
3379
3275
  hrefFor: e,
3380
3276
  language: t,
3381
3277
  navigation: n,
@@ -3386,52 +3282,52 @@ function Ft({ hrefFor: e, language: t, navigation: n, onLanguageChange: r, store
3386
3282
  })
3387
3283
  });
3388
3284
  }
3389
- function It({ host: e, hrefFor: t, language: n, location: r, onLanguageChange: a, onNavigate: o, preferences: s, theme: c }) {
3390
- let l = ae(o);
3391
- l.current = o;
3392
- let [{ i18n: u, navigation: d, store: f }] = oe(() => {
3393
- let t = y(n), i = new Mt(new ee((t, n) => e.request(t, n), (t, n) => e.subscribeProject(t, n)), s, () => crypto.randomUUID(), t, e);
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);
3394
3290
  return {
3395
3291
  i18n: t,
3396
- navigation: new le(i, r, (e, t) => l.current(e, t)),
3397
- store: i
3292
+ navigation: new ce(r, i, (e, t) => d.current(e, t)),
3293
+ store: r
3398
3294
  };
3399
3295
  });
3400
- return C(() => {
3401
- d.start();
3296
+ return S(() => {
3297
+ p.start();
3402
3298
  let e = () => {
3403
- f.connectors.refreshAfterAuthorization(), f.triggers.refreshAfterAuthorization();
3299
+ m.connectors.refreshAfterAuthorization(), m.triggers.refreshAfterAuthorization();
3404
3300
  };
3405
3301
  return globalThis.addEventListener("focus", e), () => {
3406
- globalThis.removeEventListener("focus", e), d.dispose(), f.dispose(), u.dispose();
3302
+ globalThis.removeEventListener("focus", e), p.dispose(), m.dispose(), f.dispose();
3407
3303
  };
3408
3304
  }, [
3409
- u,
3410
- d,
3411
- f
3412
- ]), C(() => void d.apply(r), [r, d]), C(() => {
3413
- u.lang != n && u.switchLang(n);
3414
- }, [u, n]), /* @__PURE__ */ w(i, {
3415
- i18n: u,
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,
3416
3312
  children: /* @__PURE__ */ se("div", {
3417
3313
  className: "open-flow-workbench",
3418
- "data-theme": c,
3419
- children: [/* @__PURE__ */ w(Pt, {
3314
+ "data-theme": u,
3315
+ children: [/* @__PURE__ */ C(At, {
3420
3316
  host: e,
3421
- store: f
3422
- }), /* @__PURE__ */ w(Ft, {
3317
+ store: m
3318
+ }), /* @__PURE__ */ C(jt, {
3423
3319
  hrefFor: t,
3424
3320
  language: n,
3425
- navigation: d,
3321
+ navigation: p,
3426
3322
  onLanguageChange: a,
3427
- store: f,
3428
- theme: c
3323
+ store: m,
3324
+ theme: u
3429
3325
  })]
3430
3326
  })
3431
3327
  });
3432
3328
  }
3433
- function Lt({ sessionKey: e, ...t }) {
3434
- return /* @__PURE__ */ w(It, { ...t }, e);
3329
+ function Nt({ sessionKey: e, ...t }) {
3330
+ return /* @__PURE__ */ C(Mt, { ...t }, e);
3435
3331
  }
3436
3332
  //#endregion
3437
- export { Lt as OpenFlowWorkbench };
3333
+ export { Nt as OpenFlowWorkbench };