@oomol-lab/open-flow 0.1.0-beta.27 → 0.1.0-beta.29

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 (56) hide show
  1. package/dist/browser/{createResourceDialog-BwI2JmPE.js → createResourceDialog-C_8I3Fua.js} +1 -1
  2. package/dist/browser/dist-CoszrK7m.js +4 -0
  3. package/dist/browser/{switch-CyZ96-UF.js → editorComponent-Dq4IKp5R.js} +5787 -651
  4. package/dist/browser/flow-authoring-node.d.ts +6 -2
  5. package/dist/browser/flow-authoring.js +1489 -1638
  6. package/dist/browser/flow-change-schema.d.ts +4 -0
  7. package/dist/browser/flow-change.d.ts +20 -14
  8. package/dist/browser/flow-change.js +1057 -1179
  9. package/dist/browser/flow-notifications.d.ts +6 -2
  10. package/dist/browser/{flowChanges-DhEjA0n5.js → flowChanges-BBtkyUGd.js} +2192 -1975
  11. package/dist/browser/{flowRunInputEditorStore-BBqQIOCR.js → flowRunInputEditorStore-CTORQcA2.js} +378 -429
  12. package/dist/browser/{flowWorkspace-zcweMsLS.js → flowWorkspace-DNmBb3ZW.js} +62886 -66618
  13. package/dist/browser/host-conformance.js +7 -1
  14. package/dist/browser/{inputValues-C5ExCCf0.js → inputValues-BbSVOWQP.js} +2 -2
  15. package/dist/browser/{markdownContent-SIlWuHve.js → markdownContent-D2oHGWc6.js} +24 -24
  16. package/dist/browser/ui.css +1 -1
  17. package/dist/browser/value-DPg_9yXB.js +93 -0
  18. package/dist/browser/workbench.css +1 -1
  19. package/dist/browser/workbench.js +769 -605
  20. package/dist/browser/{workbenchSelect-BUu7CjUA.js → workbenchSelect-CQOvpteT.js} +1507 -1642
  21. package/dist/common/authoringExamples.d.ts +28 -0
  22. package/dist/common/control-api-conformance.js +1449 -1556
  23. package/dist/common/control-api-errors.d.ts +8 -0
  24. package/dist/common/control-api.d.ts +12 -4
  25. package/dist/common/control-api.js +1480 -1560
  26. package/dist/common/control-requests.d.ts +13 -6
  27. package/dist/common/control-requests.js +1886 -1445
  28. package/dist/common/cron-trigger.d.ts +2 -1
  29. package/dist/common/cron-trigger.js +27 -24
  30. package/dist/common/draftOperations.d.ts +14 -0
  31. package/dist/common/engine-contract.d.ts +2 -2
  32. package/dist/common/flow-encoding.d.ts +3 -0
  33. package/dist/common/flow-encoding.js +1488 -1524
  34. package/dist/common/flow-graph.d.ts +18 -2
  35. package/dist/common/flow-notifications.d.ts +6 -2
  36. package/dist/common/flow-schema.d.ts +1 -2
  37. package/dist/common/flow-semantics.d.ts +2 -1
  38. package/dist/common/flow-semantics.js +7809 -7820
  39. package/dist/common/flowInspection.d.ts +16 -0
  40. package/dist/common/integration-trigger.d.ts +2 -2
  41. package/dist/common/integration-trigger.js +8 -8
  42. package/dist/common/mcp.d.ts +2 -1
  43. package/dist/common/mcp.js +985 -1060
  44. package/dist/common/poll-trigger.d.ts +3 -0
  45. package/dist/common/poll-trigger.js +26 -22
  46. package/dist/common/provider-triggers.js +3096 -3126
  47. package/dist/common/run-events.js +1 -0
  48. package/dist/common/runtime-contract.js +3 -3
  49. package/dist/common/scheduler.d.ts +6 -5
  50. package/dist/common/scheduler.js +2318 -2383
  51. package/dist/common/trigger-contract.d.ts +5 -0
  52. package/dist/common/webhook-trigger.d.ts +3 -3
  53. package/dist/common/webhook-trigger.js +64 -18
  54. package/package.json +1 -1
  55. package/dist/browser/dist-B_T-OpQp.js +0 -4
  56. package/dist/browser/languages-C0zQ4GSo.js +0 -42
@@ -1,11 +1,11 @@
1
1
  import { a as e, i as t, l as n } from "./dist-Dz6Nglsd.js";
2
2
  import { a as r, i, r as a, t as o } from "./main-BDnNHhkU.js";
3
3
  import { Bn as s, Hn as c, kt as l, t as u } from "./lite-BuKZ8joP.js";
4
- import { i as d, n as f, o as p, r as m, t as h } from "./switch-CyZ96-UF.js";
5
- import { At as g, B as _, C as v, Ct as y, D as b, Dt as x, E as S, Et as C, F as w, Ft as ee, G as te, H as T, I as E, J as ne, K as D, L as re, M as ie, Nt as ae, O, Ot as oe, P as k, R as se, S as ce, St as le, Tt as ue, U as de, Ut as A, W as j, Y as M, _ as fe, _n as pe, _t as me, a as he, an as ge, b as _e, bn as ve, bt as N, c as ye, d as be, dn as xe, dt as Se, f as Ce, fn as P, g as we, gn as Te, gt as Ee, h as De, hn as F, ht as Oe, in as ke, it as Ae, j as I, jt as je, k as Me, kt as Ne, l as Pe, lt as L, m as Fe, mn as Ie, o as Le, p as Re, pn as ze, q as Be, r as R, rt as z, s as Ve, st as He, t as Ue, tt as We, u as Ge, un as B, ut as Ke, v as qe, vn as V, vt as Je, w as Ye, wt as H, x as Xe, xt as Ze, y as Qe, yn as U, yt as $e, z as et } from "./flowChanges-DhEjA0n5.js";
6
- import { C as tt, V as nt, _ as rt, a as it, c as at, d as ot, f as st, g as ct, h as lt, i as ut, l as dt, m as ft, n as W, o as pt, r as mt, s as ht, t as gt, v as _t, w as vt } from "./workbenchSelect-BUu7CjUA.js";
7
- import { i as yt, n as bt, r as xt, t as St } from "./languages-C0zQ4GSo.js";
8
- import { o as G } from "./dist-B_T-OpQp.js";
4
+ import { _ as d, f, h as p, m, p as h } from "./editorComponent-Dq4IKp5R.js";
5
+ import { A as g, At as _, C as v, Ct as y, D as b, Dt as x, E as S, Et as C, F as w, G as T, H as E, I as ee, It as D, J as O, K as te, L as k, Mt as ne, N as A, O as re, Ot as ie, P as j, Pt as ae, R as M, S as oe, St as se, Tt as N, U as P, V as ce, W as le, Wt as ue, _ as de, _n as fe, _t as pe, a as me, an as he, b as ge, bn as F, bt as _e, c as ve, d as ye, dn as I, dt as be, et as xe, f as Se, fn as Ce, ft as we, g as Te, gn as L, gt as Ee, h as De, hn as Oe, it as ke, j as Ae, jt as je, kt as Me, l as Ne, lt as Pe, m as Fe, mn as Ie, o as Le, on as Re, ot as ze, p as Be, pn as R, q as Ve, r as z, rt as B, s as He, t as Ue, u as We, ut as V, v as Ge, vn as Ke, vt as qe, w as Je, wt as Ye, x as Xe, xn as Ze, xt as H, y as Qe, yn as U, yt as $e, z as et } from "./flowChanges-BBtkyUGd.js";
6
+ import { C as tt, V as nt, _ as rt, a as it, c as at, d as ot, f as st, g as ct, h as lt, i as ut, l as dt, m as ft, n as W, o as pt, r as mt, s as ht, t as gt, v as _t, w as vt } from "./workbenchSelect-CQOvpteT.js";
7
+ import { c as yt, l as bt, s as xt, u as St } from "./value-DPg_9yXB.js";
8
+ import { a as G } from "./dist-CoszrK7m.js";
9
9
  import { Fragment as Ct, jsx as K, jsxs as q } from "react/jsx-runtime";
10
10
  import { Suspense as wt, lazy as Tt, useEffect as J, useRef as Et, useState as Y } from "react";
11
11
  import * as Dt from "effect/Cause";
@@ -96,8 +96,8 @@ function jt(e, t) {
96
96
  }
97
97
  //#endregion
98
98
  //#region src/workbench/browser/runtime/shell/resourceBrowser.tsx
99
- var Mt = Tt(() => import("./createResourceDialog-BwI2JmPE.js")), Nt = yt.map((e) => ({
100
- label: xt[e],
99
+ var Mt = Tt(() => import("./createResourceDialog-C_8I3Fua.js")), Nt = St.map((e) => ({
100
+ label: bt[e],
101
101
  value: e
102
102
  }));
103
103
  function Pt({ language: e, onLanguageChange: t }) {
@@ -118,23 +118,23 @@ function Pt({ language: e, onLanguageChange: t }) {
118
118
  });
119
119
  }
120
120
  function Ft({ badge: e, busy: t, flow: n, href: r, onSelect: o, store: c }) {
121
- let [u, d] = Y(null), f = Et(null), p = Et(null), m = Et(null), g = a(), _ = i(), [v, b] = Y("idle"), [x, S] = Y(n.name), [C, w] = Y(), te = n.live != null && n.live.revisionId != n.draftRevisionId;
121
+ let [u, d] = Y(null), p = Et(null), m = Et(null), h = Et(null), g = a(), _ = i(), [v, y] = Y("idle"), [b, x] = Y(n.name), [S, C] = Y(), w = n.live != null && n.live.revisionId != n.draftRevisionId;
122
122
  async function T(e) {
123
- w(e == "publish" ? "publish" : "enabled");
123
+ C(e == "publish" ? "publish" : "enabled");
124
124
  try {
125
125
  e == "publish" ? await c.workspace.publishFlow(n) : await c.workspace.setFlowEnabled(n, e);
126
126
  } finally {
127
- w(void 0);
127
+ C(void 0);
128
128
  }
129
129
  }
130
- let E = vt(x);
131
- async function ne(e) {
130
+ let E = vt(b);
131
+ async function ee(e) {
132
132
  e.preventDefault();
133
- let t = x.trim();
134
- vt(t) == null && await c.workspace.renameFlow(n.flowId, t) && b("idle");
133
+ let t = b.trim();
134
+ vt(t) == null && await c.workspace.renameFlow(n.flowId, t) && y("idle");
135
135
  }
136
- async function D() {
137
- await c.workspace.deleteFlow(n.flowId) && b("idle");
136
+ async function O() {
137
+ await c.workspace.deleteFlow(n.flowId) && y("idle");
138
138
  }
139
139
  return /* @__PURE__ */ q("div", {
140
140
  className: "resource-item-row",
@@ -149,7 +149,7 @@ function Ft({ badge: e, busy: t, flow: n, href: r, onSelect: o, store: c }) {
149
149
  e.preventDefault();
150
150
  return;
151
151
  }
152
- y(e, () => o(n));
152
+ Ye(e, () => o(n));
153
153
  },
154
154
  render: /* @__PURE__ */ K("a", { href: n.status == "retiring" ? void 0 : r }),
155
155
  tabIndex: n.status == "retiring" ? -1 : void 0,
@@ -165,7 +165,7 @@ function Ft({ badge: e, busy: t, flow: n, href: r, onSelect: o, store: c }) {
165
165
  children: [/* @__PURE__ */ K("strong", {
166
166
  className: "min-w-0 truncate",
167
167
  children: n.name
168
- }), e != null && /* @__PURE__ */ K(ke, {
168
+ }), e != null && /* @__PURE__ */ K(he, {
169
169
  className: "min-w-0 shrink",
170
170
  title: e,
171
171
  variant: "secondary",
@@ -185,13 +185,13 @@ function Ft({ badge: e, busy: t, flow: n, href: r, onSelect: o, store: c }) {
185
185
  }),
186
186
  /* @__PURE__ */ K("span", {
187
187
  className: "resource-status",
188
- children: _(n.status == "retiring" ? "resource.retiring" : n.live == null ? "resource.notPublished" : te ? "resource.unpublishedChanges" : "resource.isPublished")
188
+ children: _(n.status == "retiring" ? "resource.retiring" : n.live == null ? "resource.notPublished" : w ? "resource.unpublishedChanges" : "resource.isPublished")
189
189
  })
190
190
  ]
191
191
  }),
192
192
  /* @__PURE__ */ q("div", {
193
193
  className: "resource-live-controls",
194
- "aria-busy": C != null,
194
+ "aria-busy": S != null,
195
195
  children: [n.live == null ? /* @__PURE__ */ K("span", {
196
196
  className: "resource-status",
197
197
  title: _("resource.publishFirst"),
@@ -199,27 +199,27 @@ function Ft({ badge: e, busy: t, flow: n, href: r, onSelect: o, store: c }) {
199
199
  }) : /* @__PURE__ */ q(nt, {
200
200
  className: "resource-enable",
201
201
  title: _("resource.enabledHint"),
202
- children: [/* @__PURE__ */ K(h, {
202
+ children: [/* @__PURE__ */ K(f, {
203
203
  "aria-label": _("resource.enableFlow", { name: n.name }),
204
204
  checked: n.live?.enabled ?? !1,
205
- disabled: n.status != "active" || n.live == null || t != null || C != null,
205
+ disabled: n.status != "active" || n.live == null || t != null || S != null,
206
206
  onCheckedChange: (e) => void T(e),
207
207
  size: "sm"
208
208
  }), /* @__PURE__ */ K("span", { children: _(n.live?.enabled ? "resource.enabled" : "resource.disabled") })]
209
209
  }), /* @__PURE__ */ K(s, {
210
- disabled: n.status != "active" || t != null || C != null || n.live != null && !te,
210
+ disabled: n.status != "active" || t != null || S != null || n.live != null && !w,
211
211
  onClick: () => void T("publish"),
212
212
  size: "sm",
213
213
  variant: "outline",
214
- children: _(C == "publish" ? "workspace.publishing" : n.live == null ? "resource.publish" : "resource.publishUpdate")
214
+ children: _(S == "publish" ? "workspace.publishing" : n.live == null ? "resource.publish" : "resource.publishUpdate")
215
215
  })]
216
216
  }),
217
- n.status == "active" && /* @__PURE__ */ q(je, { children: [/* @__PURE__ */ K(A, {
217
+ n.status == "active" && /* @__PURE__ */ q(ne, { children: [/* @__PURE__ */ K(ue, {
218
218
  "aria-label": _("sidebar.flowActions", { name: n.name }),
219
- disabled: t != null || C != null,
219
+ disabled: t != null || S != null,
220
220
  render: /* @__PURE__ */ K(s, {
221
221
  className: "resource-row-more",
222
- ref: f,
222
+ ref: p,
223
223
  size: "icon-sm",
224
224
  variant: "ghost",
225
225
  children: /* @__PURE__ */ K(W, { name: "more" })
@@ -229,13 +229,13 @@ function Ft({ badge: e, busy: t, flow: n, href: r, onSelect: o, store: c }) {
229
229
  className: "min-w-36",
230
230
  container: u,
231
231
  finalFocus: v == "idle",
232
- children: [/* @__PURE__ */ K(ee, {
232
+ children: [/* @__PURE__ */ K(D, {
233
233
  onClick: () => {
234
- S(n.name), b("rename");
234
+ x(n.name), y("rename");
235
235
  },
236
236
  children: _("common.rename")
237
- }), /* @__PURE__ */ K(ee, {
238
- onClick: () => b("delete"),
237
+ }), /* @__PURE__ */ K(D, {
238
+ onClick: () => y("delete"),
239
239
  variant: "destructive",
240
240
  children: _("common.delete")
241
241
  })]
@@ -243,20 +243,20 @@ function Ft({ badge: e, busy: t, flow: n, href: r, onSelect: o, store: c }) {
243
243
  /* @__PURE__ */ K(mt, {
244
244
  open: v == "rename",
245
245
  onOpenChange: (e) => {
246
- e || b("idle");
246
+ e || y("idle");
247
247
  },
248
248
  children: /* @__PURE__ */ K(it, {
249
249
  container: u,
250
- initialFocus: p,
251
- finalFocus: f,
250
+ initialFocus: m,
251
+ finalFocus: p,
252
252
  closeLabel: _("common.cancel"),
253
253
  children: /* @__PURE__ */ q("form", {
254
254
  className: "flex flex-col gap-4",
255
- onSubmit: (e) => void ne(e),
255
+ onSubmit: (e) => void ee(e),
256
256
  children: [
257
257
  /* @__PURE__ */ K(at, { children: /* @__PURE__ */ K(dt, { children: _("sidebar.renameFlow", { name: n.name }) }) }),
258
258
  /* @__PURE__ */ q(st, {
259
- "data-invalid": x.length > 0 && E != null,
259
+ "data-invalid": b.length > 0 && E != null,
260
260
  children: [
261
261
  /* @__PURE__ */ K(ct, {
262
262
  htmlFor: `rename-flow-${n.flowId}`,
@@ -264,16 +264,16 @@ function Ft({ badge: e, busy: t, flow: n, href: r, onSelect: o, store: c }) {
264
264
  }),
265
265
  /* @__PURE__ */ K(l, {
266
266
  autoComplete: "off",
267
- "aria-invalid": x.length > 0 && E != null,
268
- "aria-describedby": x.length > 0 && E != null ? `rename-error-${n.flowId}` : void 0,
267
+ "aria-invalid": b.length > 0 && E != null,
268
+ "aria-describedby": b.length > 0 && E != null ? `rename-error-${n.flowId}` : void 0,
269
269
  id: `rename-flow-${n.flowId}`,
270
270
  name: "flow-name",
271
- onChange: (e) => S(e.target.value),
272
- ref: p,
271
+ onChange: (e) => x(e.target.value),
272
+ ref: m,
273
273
  required: !0,
274
- value: x
274
+ value: b
275
275
  }),
276
- x.length > 0 && E != null && /* @__PURE__ */ K(ft, {
276
+ b.length > 0 && E != null && /* @__PURE__ */ K(ft, {
277
277
  id: `rename-error-${n.flowId}`,
278
278
  children: _(`resource.nameIssue.${E}`, { max: 80 })
279
279
  })
@@ -295,22 +295,22 @@ function Ft({ badge: e, busy: t, flow: n, href: r, onSelect: o, store: c }) {
295
295
  /* @__PURE__ */ K(mt, {
296
296
  open: v == "delete",
297
297
  onOpenChange: (e) => {
298
- e || b("idle");
298
+ e || y("idle");
299
299
  },
300
300
  children: /* @__PURE__ */ q(it, {
301
301
  container: u,
302
- initialFocus: m,
303
- finalFocus: f,
302
+ initialFocus: h,
303
+ finalFocus: p,
304
304
  showCloseButton: !1,
305
305
  children: [/* @__PURE__ */ q(at, { children: [/* @__PURE__ */ K(dt, { children: _("sidebar.deleteFlowConfirm", { name: n.name }) }), /* @__PURE__ */ K(pt, { children: _("resource.deleteDescription") })] }), /* @__PURE__ */ q(ht, { children: [/* @__PURE__ */ K(ut, {
306
306
  render: /* @__PURE__ */ K(s, {
307
- ref: m,
307
+ ref: h,
308
308
  variant: "outline"
309
309
  }),
310
310
  children: _("common.cancel")
311
311
  }), /* @__PURE__ */ K(s, {
312
312
  disabled: t != null,
313
- onClick: () => void D(),
313
+ onClick: () => void O(),
314
314
  variant: "destructive",
315
315
  children: _(t == "flow" ? "common.deleting" : "common.delete")
316
316
  })] })]
@@ -326,22 +326,22 @@ function It() {
326
326
  children: [
327
327
  /* @__PURE__ */ q("span", {
328
328
  className: "resource-primary-cell",
329
- children: [/* @__PURE__ */ K(H, { className: "size-8 shrink-0" }), /* @__PURE__ */ q("span", {
329
+ children: [/* @__PURE__ */ K(N, { className: "size-8 shrink-0" }), /* @__PURE__ */ q("span", {
330
330
  className: "resource-skeleton-copy",
331
- children: [/* @__PURE__ */ K(H, { className: "h-3.5 w-36" }), /* @__PURE__ */ K(H, { className: "h-2.5 w-48 max-w-full" })]
331
+ children: [/* @__PURE__ */ K(N, { className: "h-3.5 w-36" }), /* @__PURE__ */ K(N, { className: "h-2.5 w-48 max-w-full" })]
332
332
  })]
333
333
  }),
334
- /* @__PURE__ */ K(H, { className: "h-3 w-28" }),
335
- /* @__PURE__ */ K(H, { className: "h-3 w-16" })
334
+ /* @__PURE__ */ K(N, { className: "h-3 w-28" }),
335
+ /* @__PURE__ */ K(N, { className: "h-3 w-16" })
336
336
  ]
337
337
  });
338
338
  }
339
- function Lt({ catalogWidth: e, createFlowDisabled: t, createFlowField: n, flowBadges: a, hrefForFlow: o, hostAction: l, hostTitle: u, language: p, onCreateFlow: h, onHostAction: _, onLanguageChange: v, onSelectFlow: y, store: b }) {
340
- let S = i(), w = r(b.workspace.$.busy), ee = r(b.workspace.$.flowLoadFailed), te = r(b.workspace.$.flowLoadMoreFailed), T = r(b.workspace.$.flowLoading), E = r(b.workspace.$.flowLoadingMore), ne = r(b.workspace.$.flowNextCursor), D = r(b.workspace.$.flowRefreshing), re = r(b.workspace.$.flows), ie = r(b.workspace.$.flowTotal), [ae, O] = Y(!1), [k, se] = Y(""), [ce, de] = Y(""), A = k.trim().toLocaleLowerCase(), j = re.filter((e) => e.name.toLocaleLowerCase().includes(A));
341
- async function M(e) {
339
+ function Lt({ catalogWidth: e, createFlowDisabled: t, createFlowField: n, flowBadges: a, hrefForFlow: o, hostAction: l, hostTitle: u, language: d, onCreateFlow: f, onHostAction: g, onLanguageChange: v, onSelectFlow: b, store: S }) {
340
+ let w = i(), T = r(S.workspace.$.busy), E = r(S.workspace.$.flowLoadFailed), ee = r(S.workspace.$.flowLoadMoreFailed), D = r(S.workspace.$.flowLoading), O = r(S.workspace.$.flowLoadingMore), te = r(S.workspace.$.flowNextCursor), k = r(S.workspace.$.flowRefreshing), ne = r(S.workspace.$.flows), A = r(S.workspace.$.flowTotal), [re, j] = Y(!1), [ae, M] = Y(""), [oe, se] = Y(""), N = ae.trim().toLocaleLowerCase(), P = ne.filter((e) => e.name.toLocaleLowerCase().includes(N));
341
+ async function ce(e) {
342
342
  e.preventDefault();
343
- let t = ce.trim();
344
- vt(t) != null || !await h(t) || (O(!1), de(""));
343
+ let t = oe.trim();
344
+ vt(t) != null || !await f(t) || (j(!1), se(""));
345
345
  }
346
346
  return /* @__PURE__ */ K("main", {
347
347
  className: "resource-browser",
@@ -350,7 +350,7 @@ function Lt({ catalogWidth: e, createFlowDisabled: t, createFlowField: n, flowBa
350
350
  children: [
351
351
  /* @__PURE__ */ K("h1", {
352
352
  className: "sr-only",
353
- children: S("resource.flows")
353
+ children: w("resource.flows")
354
354
  }),
355
355
  /* @__PURE__ */ q("section", {
356
356
  "aria-labelledby": "flow-list-title",
@@ -362,53 +362,53 @@ function Lt({ catalogWidth: e, createFlowDisabled: t, createFlowField: n, flowBa
362
362
  className: "resource-list-heading",
363
363
  children: [/* @__PURE__ */ K("h2", {
364
364
  id: "flow-list-title",
365
- children: S("resource.allFlows")
366
- }), !T && /* @__PURE__ */ K("span", { children: S("resource.flowCount", { count: ie ?? re.length }) })]
365
+ children: w("resource.allFlows")
366
+ }), !D && /* @__PURE__ */ K("span", { children: w("resource.flowCount", { count: A ?? ne.length }) })]
367
367
  }), /* @__PURE__ */ q("div", {
368
368
  className: "resource-list-actions",
369
369
  children: [
370
370
  /* @__PURE__ */ K(Pt, {
371
- language: p,
371
+ language: d,
372
372
  onLanguageChange: v
373
373
  }),
374
- /* @__PURE__ */ q(f, {
374
+ /* @__PURE__ */ q(h, {
375
375
  className: "w-full sm:w-56",
376
376
  children: [/* @__PURE__ */ K(m, { children: /* @__PURE__ */ K(W, {
377
377
  name: "search",
378
378
  size: 17
379
- }) }), /* @__PURE__ */ K(d, {
379
+ }) }), /* @__PURE__ */ K(p, {
380
380
  autoComplete: "off",
381
- "aria-label": S("resource.searchFlows"),
381
+ "aria-label": w("resource.searchFlows"),
382
382
  name: "flow-search",
383
- onChange: (e) => se(e.target.value),
384
- placeholder: S("resource.searchFlows"),
385
- value: k
383
+ onChange: (e) => M(e.target.value),
384
+ placeholder: w("resource.searchFlows"),
385
+ value: ae
386
386
  })]
387
387
  }),
388
388
  /* @__PURE__ */ K(s, {
389
- "aria-label": S("common.refresh"),
390
- disabled: T || D || w != null,
391
- onClick: () => void b.workspace.reloadFlows(),
389
+ "aria-label": w("common.refresh"),
390
+ disabled: D || k || T != null,
391
+ onClick: () => void S.workspace.reloadFlows(),
392
392
  size: "icon",
393
- title: S("common.refresh"),
393
+ title: w("common.refresh"),
394
394
  variant: "outline",
395
395
  children: /* @__PURE__ */ K(W, {
396
- className: D ? "animate-spin" : void 0,
396
+ className: k ? "animate-spin" : void 0,
397
397
  name: "refresh"
398
398
  })
399
399
  }),
400
400
  /* @__PURE__ */ q(s, {
401
401
  className: "resource-page-primary-action",
402
- disabled: w != null,
403
- onClick: () => O(!0),
402
+ disabled: T != null,
403
+ onClick: () => j(!0),
404
404
  children: [/* @__PURE__ */ K(W, {
405
405
  "data-icon": "inline-start",
406
406
  name: "plus"
407
- }), S("resource.newFlow")]
407
+ }), w("resource.newFlow")]
408
408
  }),
409
- l != null && u != null && _ != null && /* @__PURE__ */ K(le, {
409
+ l != null && u != null && g != null && /* @__PURE__ */ K(y, {
410
410
  action: l,
411
- onAction: _,
411
+ onAction: g,
412
412
  title: u
413
413
  })
414
414
  ]
@@ -418,86 +418,86 @@ function Lt({ catalogWidth: e, createFlowDisabled: t, createFlowField: n, flowBa
418
418
  "aria-hidden": "true",
419
419
  className: "resource-list-columns flow-columns",
420
420
  children: [
421
- /* @__PURE__ */ K("span", { children: S("resource.name") }),
422
- /* @__PURE__ */ K("span", { children: S("resource.updated") }),
423
- /* @__PURE__ */ K("span", { children: S("resource.publication") }),
424
- /* @__PURE__ */ K("span", { children: S("resource.enabledColumn") })
421
+ /* @__PURE__ */ K("span", { children: w("resource.name") }),
422
+ /* @__PURE__ */ K("span", { children: w("resource.updated") }),
423
+ /* @__PURE__ */ K("span", { children: w("resource.publication") }),
424
+ /* @__PURE__ */ K("span", { children: w("resource.enabledColumn") })
425
425
  ]
426
426
  }),
427
427
  /* @__PURE__ */ K("div", {
428
428
  className: "resource-list",
429
- children: T ? Array.from({ length: 5 }, (e, t) => /* @__PURE__ */ K(It, {}, t)) : ee ? /* @__PURE__ */ q(ue, {
429
+ children: D ? Array.from({ length: 5 }, (e, t) => /* @__PURE__ */ K(It, {}, t)) : E ? /* @__PURE__ */ q(C, {
430
430
  className: "min-h-64",
431
431
  role: "alert",
432
- children: [/* @__PURE__ */ q(oe, { children: [
433
- /* @__PURE__ */ K(Ne, {
432
+ children: [/* @__PURE__ */ q(Me, { children: [
433
+ /* @__PURE__ */ K(_, {
434
434
  variant: "icon",
435
435
  children: /* @__PURE__ */ K(W, {
436
436
  name: "alert",
437
437
  size: 20
438
438
  })
439
439
  }),
440
- /* @__PURE__ */ K(g, { children: S("resource.flowsLoadFailed") }),
441
- /* @__PURE__ */ K(x, { children: S("resource.flowsLoadFailedDescription") })
442
- ] }), /* @__PURE__ */ K(C, { children: /* @__PURE__ */ K(s, {
443
- onClick: () => void b.retryFlows(),
440
+ /* @__PURE__ */ K(je, { children: w("resource.flowsLoadFailed") }),
441
+ /* @__PURE__ */ K(ie, { children: w("resource.flowsLoadFailedDescription") })
442
+ ] }), /* @__PURE__ */ K(x, { children: /* @__PURE__ */ K(s, {
443
+ onClick: () => void S.retryFlows(),
444
444
  variant: "outline",
445
- children: S("empty.retry")
445
+ children: w("empty.retry")
446
446
  }) })]
447
- }) : j.length == 0 ? /* @__PURE__ */ q(ue, {
447
+ }) : P.length == 0 ? /* @__PURE__ */ q(C, {
448
448
  className: "min-h-64",
449
- children: [/* @__PURE__ */ q(oe, { children: [
450
- /* @__PURE__ */ K(Ne, {
449
+ children: [/* @__PURE__ */ q(Me, { children: [
450
+ /* @__PURE__ */ K(_, {
451
451
  variant: "icon",
452
452
  children: /* @__PURE__ */ K(W, {
453
453
  name: "flow",
454
454
  size: 20
455
455
  })
456
456
  }),
457
- /* @__PURE__ */ K(g, { children: S(A.length == 0 ? "resource.noFlows" : "resource.noMatchingFlows") }),
458
- /* @__PURE__ */ K(x, { children: S(A.length == 0 ? "resource.noFlowsDescription" : "resource.noMatchingDescription") })
459
- ] }), A.length == 0 && /* @__PURE__ */ K(C, { children: /* @__PURE__ */ q(s, {
460
- onClick: () => O(!0),
457
+ /* @__PURE__ */ K(je, { children: w(N.length == 0 ? "resource.noFlows" : "resource.noMatchingFlows") }),
458
+ /* @__PURE__ */ K(ie, { children: w(N.length == 0 ? "resource.noFlowsDescription" : "resource.noMatchingDescription") })
459
+ ] }), N.length == 0 && /* @__PURE__ */ K(x, { children: /* @__PURE__ */ q(s, {
460
+ onClick: () => j(!0),
461
461
  variant: "outline",
462
462
  children: [/* @__PURE__ */ K(W, {
463
463
  "data-icon": "inline-start",
464
464
  name: "plus"
465
- }), S("resource.newFlow")]
465
+ }), w("resource.newFlow")]
466
466
  }) })]
467
- }) : j.map((e) => /* @__PURE__ */ K(Ft, {
467
+ }) : P.map((e) => /* @__PURE__ */ K(Ft, {
468
468
  badge: a?.[e.flowId],
469
- busy: w,
469
+ busy: T,
470
470
  flow: e,
471
471
  href: o(e),
472
- onSelect: y,
473
- store: b
472
+ onSelect: b,
473
+ store: S
474
474
  }, e.flowId))
475
475
  }),
476
- ne != null && /* @__PURE__ */ K("div", {
476
+ te != null && /* @__PURE__ */ K("div", {
477
477
  className: "resource-list-footer",
478
478
  children: /* @__PURE__ */ K(s, {
479
- disabled: E || D,
480
- onClick: () => void b.workspace.loadMoreFlows(),
479
+ disabled: O || k,
480
+ onClick: () => void S.workspace.loadMoreFlows(),
481
481
  variant: "outline",
482
- children: S(E ? "resource.loadingMore" : te ? "resource.retryLoadMore" : "resource.loadMore")
482
+ children: w(O ? "resource.loadingMore" : ee ? "resource.retryLoadMore" : "resource.loadMore")
483
483
  })
484
484
  })
485
485
  ]
486
486
  }),
487
- ae && /* @__PURE__ */ K(wt, {
487
+ re && /* @__PURE__ */ K(wt, {
488
488
  fallback: null,
489
489
  children: /* @__PURE__ */ K(Mt, {
490
490
  disabled: t,
491
491
  field: n,
492
492
  id: "flow-name",
493
- issue: vt(ce),
494
- label: S("resource.flowName"),
495
- name: ce,
496
- onNameChange: de,
497
- onOpenChange: O,
498
- onSubmit: (e) => void M(e),
499
- pending: w == "flow",
500
- title: S("resource.newFlow")
493
+ issue: vt(oe),
494
+ label: w("resource.flowName"),
495
+ name: oe,
496
+ onNameChange: se,
497
+ onOpenChange: j,
498
+ onSubmit: (e) => void ce(e),
499
+ pending: T == "flow",
500
+ title: w("resource.newFlow")
501
501
  })
502
502
  })
503
503
  ]
@@ -641,17 +641,17 @@ var $t = class {
641
641
  #e;
642
642
  #t;
643
643
  #n;
644
- #r = new L();
645
- #i = new L();
644
+ #r = new V();
645
+ #i = new V();
646
646
  #a;
647
- #o = new L();
648
- #s = new L();
647
+ #o = new V();
648
+ #s = new V();
649
649
  #c;
650
650
  #l = n(Yt);
651
651
  #u;
652
652
  #d;
653
653
  #f;
654
- constructor(t, n, r, i, a = P, o = p()) {
654
+ constructor(t, n, r, i, a = R, o = d()) {
655
655
  this.#e = t, this.#t = a, this.#n = o, this.#a = i, this.#c = r, this.#u = n, this.$ = {
656
656
  activities: e(this.#l, (e) => e.activities),
657
657
  activitiesLoadFailed: e(this.#l, (e) => e.activitiesLoadFailed),
@@ -725,7 +725,7 @@ var $t = class {
725
725
  loadFailed: !r,
726
726
  loading: !1,
727
727
  refreshing: !1
728
- }), this.#c(B(e, this.#n.t));
728
+ }), this.#c(I(e, this.#n.t));
729
729
  }
730
730
  }
731
731
  async loadMore() {
@@ -754,7 +754,7 @@ var $t = class {
754
754
  this.#S({
755
755
  loadMoreFailed: !0,
756
756
  loadingMore: !1
757
- }), this.#c(B(e, this.#n.t));
757
+ }), this.#c(I(e, this.#n.t));
758
758
  }
759
759
  }
760
760
  async publish() {
@@ -781,7 +781,7 @@ var $t = class {
781
781
  publishing: e.status == "pending"
782
782
  }), await this.#_(r, e, s, t.name)) : !1;
783
783
  } catch (e) {
784
- return s() ? (e instanceof U && e.code == "live.conflict" && await this.#m(r), this.#c(B(e, this.#n.t)), !1) : !1;
784
+ return s() ? (e instanceof F && e.code == "live.conflict" && await this.#m(r), this.#c(I(e, this.#n.t)), !1) : !1;
785
785
  } finally {
786
786
  s() && this.#S({ publishing: !1 });
787
787
  }
@@ -807,7 +807,7 @@ var $t = class {
807
807
  message: this.#n.t("notice.rolledBack", { revision: e.revisionId })
808
808
  }), !0);
809
809
  } catch (e) {
810
- return s() ? (e instanceof U && e.code == "live.conflict" && await this.#m(r), this.#c(B(e, this.#n.t)), !1) : !1;
810
+ return s() ? (e instanceof F && e.code == "live.conflict" && await this.#m(r), this.#c(I(e, this.#n.t)), !1) : !1;
811
811
  } finally {
812
812
  s() && this.#S({ rollingBackPublicationId: void 0 });
813
813
  }
@@ -848,7 +848,7 @@ var $t = class {
848
848
  this.#S({
849
849
  activitiesLoading: !1,
850
850
  detailLoading: !1
851
- }), this.#c(B(r.reason, this.#n.t));
851
+ }), this.#c(I(r.reason, this.#n.t));
852
852
  return;
853
853
  }
854
854
  this.#S({
@@ -862,7 +862,7 @@ var $t = class {
862
862
  }) : (this.#S({
863
863
  activitiesLoadFailed: !0,
864
864
  activitiesLoading: !1
865
- }), this.#c(B(i.reason, this.#n.t)));
865
+ }), this.#c(I(i.reason, this.#n.t)));
866
866
  }
867
867
  }
868
868
  async loadMoreTriggerActivities() {
@@ -891,7 +891,7 @@ var $t = class {
891
891
  this.#S({
892
892
  activitiesLoadFailed: !0,
893
893
  activitiesLoadingMore: !1
894
- }), this.#c(B(e, this.#n.t));
894
+ }), this.#c(I(e, this.#n.t));
895
895
  }
896
896
  }
897
897
  async testTrigger() {
@@ -906,7 +906,7 @@ var $t = class {
906
906
  let e = await this.#e.testFlowPollTrigger(n.flowId, t);
907
907
  return !i() || this.#l.value.selectedTriggerId != t ? !1 : (this.#S({ testResult: e }), !0);
908
908
  } catch (e) {
909
- return i() && this.#l.value.selectedTriggerId == t && this.#c(B(e, this.#n.t)), !1;
909
+ return i() && this.#l.value.selectedTriggerId == t && this.#c(I(e, this.#n.t)), !1;
910
910
  } finally {
911
911
  i() && this.#l.value.selectedTriggerId == t && this.#S({ testingTriggerId: void 0 });
912
912
  }
@@ -925,7 +925,7 @@ var $t = class {
925
925
  message: this.#n.t(e.operatorState == "active" ? "notice.triggerPaused" : "notice.triggerResumed")
926
926
  }), !0) : !1;
927
927
  } catch (e) {
928
- return n() && this.#c(B(e, this.#n.t)), !1;
928
+ return n() && this.#c(I(e, this.#n.t)), !1;
929
929
  } finally {
930
930
  n() && this.#S({ changingTriggerId: void 0 });
931
931
  }
@@ -968,7 +968,7 @@ var $t = class {
968
968
  if (t != null && t != "") try {
969
969
  return await this.#e.getPublishOperation(e.flowId, t);
970
970
  } catch (t) {
971
- if (t instanceof U && t.code == "publication.operation-not-found") {
971
+ if (t instanceof F && t.code == "publication.operation-not-found") {
972
972
  this.#a.setItem(this.#b(e.flowId), "");
973
973
  return;
974
974
  }
@@ -991,7 +991,7 @@ var $t = class {
991
991
  try: (t) => this.#p(e, t),
992
992
  catch: (e) => e
993
993
  }).pipe(X.match({
994
- onFailure: (e) => (n() && this.#c(B(e, this.#n.t)), !1),
994
+ onFailure: (e) => (n() && this.#c(I(e, this.#n.t)), !1),
995
995
  onSuccess: () => !0
996
996
  }));
997
997
  return n() ? (a && this.#c({
@@ -1020,14 +1020,14 @@ var $t = class {
1020
1020
  if (!n()) return;
1021
1021
  if ("error" in t) {
1022
1022
  let n = t.error;
1023
- if (n instanceof U && n.code == "publication.operation-not-found") {
1023
+ if (n instanceof F && n.code == "publication.operation-not-found") {
1024
1024
  this.#a.setItem(this.#b(e.flowId), ""), this.#x(e, {
1025
1025
  operation: void 0,
1026
1026
  publishing: !1
1027
- }), this.#c(B(n, this.#n.t));
1027
+ }), this.#c(I(n, this.#n.t));
1028
1028
  return;
1029
1029
  }
1030
- this.#c(B(n, this.#n.t));
1030
+ this.#c(I(n, this.#n.t));
1031
1031
  continue;
1032
1032
  }
1033
1033
  r = t.value, this.#x(e, { operation: r });
@@ -1061,6 +1061,7 @@ function tn(e) {
1061
1061
  case "subflow": return tt(e.definition?.inputs ?? []);
1062
1062
  case "task": return tt(e.definition?.inputs ?? []);
1063
1063
  case "value": return {};
1064
+ case "approval":
1064
1065
  case "wait": return { [e.node.input.handle]: e.node.input };
1065
1066
  }
1066
1067
  }
@@ -1068,7 +1069,7 @@ function nn(e) {
1068
1069
  return e.node.name == null ? e.kind == "task" || e.kind == "subflow" ? e.definition?.name ?? e.id : e.id : e.node.name;
1069
1070
  }
1070
1071
  function rn(e, t) {
1071
- let n = z(e), r = n.graph({ kind: "flow" });
1072
+ let n = B(e), r = n.graph({ kind: "flow" });
1072
1073
  if (r == null) return [];
1073
1074
  let i = /* @__PURE__ */ new Set([t]), a = [t];
1074
1075
  for (; a.length > 0;) {
@@ -1078,11 +1079,7 @@ function rn(e, t) {
1078
1079
  return Object.entries(r.nodes).filter(([e]) => i.has(e)).toSorted(([e], [t]) => e.localeCompare(t)).flatMap(([e, t]) => {
1079
1080
  let r = n.resolveNode(e, t);
1080
1081
  if (r.kind == "trigger") return r.trigger.kind == "manual" || r.trigger.kind == "cron" ? [] : [{
1081
- definitions: [{
1082
- handle: "payload",
1083
- jsonSchema: He(r.trigger),
1084
- nullable: !1
1085
- }],
1082
+ definitions: ze(r.trigger),
1086
1083
  nodeId: e,
1087
1084
  title: r.trigger.name
1088
1085
  }];
@@ -1106,7 +1103,7 @@ function an(e) {
1106
1103
  ])]));
1107
1104
  }
1108
1105
  async function on(e, t, n) {
1109
- let { FlowRunInputEditorStore: r } = await import("./flowRunInputEditorStore-BBqQIOCR.js").then((e) => e.n);
1106
+ let { FlowRunInputEditorStore: r } = await import("./flowRunInputEditorStore-CTORQcA2.js").then((e) => e.n);
1110
1107
  return e.map((e) => {
1111
1108
  let i = new r(e.definitions, t);
1112
1109
  return n?.[e.nodeId] != null && i.replaceValues(n[e.nodeId]), {
@@ -1120,24 +1117,27 @@ function sn(e) {
1120
1117
  return Object.fromEntries(e.map((e) => [e.nodeId, e.editor.values()]));
1121
1118
  }
1122
1119
  function cn(e, t) {
1120
+ return B(e).graph({ kind: "flow" })?.nodes[t]?.kind === "cron" ? { scheduledAt: (/* @__PURE__ */ new Date()).toISOString() } : {};
1121
+ }
1122
+ function ln(e, t, n) {
1123
1123
  return {
1124
1124
  inputs: Object.fromEntries(e.filter((e) => e.nodeId != t).map((e) => [e.nodeId, e.editor.values()])),
1125
- payload: e.find((e) => e.nodeId == t)?.editor.values().payload ?? {}
1125
+ outputs: e.find((e) => e.nodeId == t)?.editor.values() ?? cn(n, t)
1126
1126
  };
1127
1127
  }
1128
- var ln = class {
1128
+ var un = class {
1129
1129
  #e;
1130
1130
  #t;
1131
1131
  #n;
1132
1132
  #r;
1133
- #i = new L();
1134
- #a = new L();
1133
+ #i = new V();
1134
+ #a = new V();
1135
1135
  #o;
1136
1136
  #s = /* @__PURE__ */ new Map();
1137
1137
  #c;
1138
1138
  #l = n(en);
1139
1139
  #u;
1140
- constructor(t, n, r, i, a = p(), o = P) {
1140
+ constructor(t, n, r, i, a = d(), o = R) {
1141
1141
  this.#e = i, this.#t = t, this.#o = n, this.#c = r, this.#r = a, this.#n = o, this.$ = {
1142
1142
  inputRequest: e(this.#l, (e) => e.inputRequest),
1143
1143
  starting: e(this.#l, (e) => e.starting),
@@ -1159,7 +1159,7 @@ var ln = class {
1159
1159
  try {
1160
1160
  return await this.#d("draft", e, t, t.revisionId, r, void 0, n);
1161
1161
  } catch (e) {
1162
- return r() && this.#c(B(e, this.#r.t)), "unavailable";
1162
+ return r() && this.#c(I(e, this.#r.t)), "unavailable";
1163
1163
  } finally {
1164
1164
  r() && this.#g({ starting: !1 });
1165
1165
  }
@@ -1169,7 +1169,7 @@ var ln = class {
1169
1169
  try {
1170
1170
  return await this.#d("draft", e, t, t.revisionId, r, void 0, n, !0);
1171
1171
  } catch (e) {
1172
- return r() && this.#c(B(e, this.#r.t)), "unavailable";
1172
+ return r() && this.#c(I(e, this.#r.t)), "unavailable";
1173
1173
  } finally {
1174
1174
  r() && this.#g({ starting: !1 });
1175
1175
  }
@@ -1189,7 +1189,7 @@ var ln = class {
1189
1189
  let r = await this.#t.getRevision(e.flowId, n.revisionId);
1190
1190
  return t() ? await this.#d("live", e, r, n.revisionId, t, n.publicationId) : "unavailable";
1191
1191
  } catch (e) {
1192
- return t() && this.#c(B(e, this.#r.t)), "unavailable";
1192
+ return t() && this.#c(I(e, this.#r.t)), "unavailable";
1193
1193
  } finally {
1194
1194
  t() && this.#g({ starting: !1 });
1195
1195
  }
@@ -1206,9 +1206,9 @@ var ln = class {
1206
1206
  attempted: !0
1207
1207
  } }), !1;
1208
1208
  this.#h(e);
1209
- let { inputs: t, payload: n } = cn(e.groups, e.triggerId), r = await this.#f(e.source, e.flow, e.revisionId, {
1209
+ let { inputs: t, outputs: n } = ln(e.groups, e.triggerId, e.revision), r = await this.#f(e.source, e.flow, e.revisionId, {
1210
1210
  nodeId: e.triggerId,
1211
- payload: n
1211
+ outputs: n
1212
1212
  }, t, e.publicationId);
1213
1213
  return r && this.#l.value.inputRequest === e && this.dismissInputs(), r;
1214
1214
  }
@@ -1232,7 +1232,7 @@ var ln = class {
1232
1232
  valid: s
1233
1233
  } }), this.#p(n);
1234
1234
  } catch (e) {
1235
- r() && this.#c(B(e, this.#r.t));
1235
+ r() && this.#c(I(e, this.#r.t));
1236
1236
  } finally {
1237
1237
  r() && this.#g({ starting: !1 });
1238
1238
  }
@@ -1244,7 +1244,7 @@ var ln = class {
1244
1244
  starting: !c,
1245
1245
  submitting: void 0
1246
1246
  }), this.#p(l);
1247
- let u = z(r).graph({ kind: "flow" }), d = Object.entries(u?.nodes ?? {}).flatMap(([e, t]) => "inputs" in t ? [] : [{
1247
+ let u = B(r).graph({ kind: "flow" }), d = Object.entries(u?.nodes ?? {}).flatMap(([e, t]) => "inputs" in t ? [] : [{
1248
1248
  nodeId: e,
1249
1249
  title: t.name
1250
1250
  }]);
@@ -1264,14 +1264,14 @@ var ln = class {
1264
1264
  }
1265
1265
  if (!c && f != null && g.length == 0) return await this.#f(e, n, i, {
1266
1266
  nodeId: f.nodeId,
1267
- payload: {}
1267
+ outputs: cn(r, f.nodeId)
1268
1268
  }, {}, o) ? "started" : "unavailable";
1269
1269
  if (!c && f != null && h?.valid == 1 && h.signature == m && g.every((e) => e.editor.valid$.value)) {
1270
- let t = cn(g, f.nodeId);
1270
+ let t = ln(g, f.nodeId, r);
1271
1271
  for (let e of g) e.editor.dispose();
1272
1272
  return await this.#f(e, n, i, {
1273
1273
  nodeId: f.nodeId,
1274
- payload: t.payload
1274
+ outputs: t.outputs
1275
1275
  }, t.inputs, o) ? "started" : "unavailable";
1276
1276
  }
1277
1277
  let _ = t((e) => f != null && g.every((t) => e(t.editor.valid$)));
@@ -1329,7 +1329,7 @@ var ln = class {
1329
1329
  });
1330
1330
  return !o() || !s() ? !1 : (this.#u = void 0, this.#o.follow(d, s));
1331
1331
  } catch (e) {
1332
- return o() && s() && this.#c(B(e, this.#r.t)), !1;
1332
+ return o() && s() && this.#c(I(e, this.#r.t)), !1;
1333
1333
  } finally {
1334
1334
  o() && this.#g({
1335
1335
  starting: !1,
@@ -1362,67 +1362,67 @@ var ln = class {
1362
1362
  };
1363
1363
  //#endregion
1364
1364
  //#region src/connector/common/actionSchema.ts
1365
- function un(e, t) {
1366
- let n = dn(e);
1365
+ function dn(e, t) {
1366
+ let n = fn(e);
1367
1367
  return {
1368
1368
  inputs: n,
1369
1369
  initialInputs: n.flatMap((e) => e.value === void 0 ? [] : [{
1370
1370
  handle: e.handle,
1371
1371
  value: e.value
1372
1372
  }]),
1373
- outputs: fn(t)
1373
+ outputs: pn(t)
1374
1374
  };
1375
1375
  }
1376
- function dn(e) {
1376
+ function fn(e) {
1377
1377
  let t = G(e);
1378
1378
  if (t == null || t.type != "object" && t.properties == null) throw Error("Connector action inputSchema must be an object schema.");
1379
1379
  let n = G(t.properties);
1380
1380
  if (n == null) return [];
1381
- let r = gn(t.required);
1381
+ let r = _n(t.required);
1382
1382
  return Object.entries(n).map(([e, n]) => {
1383
1383
  let i = !r.has(e) || $(n, t);
1384
1384
  return {
1385
- description: mn(t, n),
1385
+ description: hn(t, n),
1386
1386
  handle: e,
1387
- json_schema: pn(t, n),
1387
+ json_schema: mn(t, n),
1388
1388
  nullable: i,
1389
- value: hn(t, n, i)
1389
+ value: gn(t, n, i)
1390
1390
  };
1391
1391
  });
1392
1392
  }
1393
- function fn(e) {
1393
+ function pn(e) {
1394
1394
  let t = G(e), n = G(t?.properties);
1395
1395
  if (t != null && (t.type == "object" || n != null)) {
1396
1396
  if (n == null) return [];
1397
- let e = gn(t.required);
1397
+ let e = _n(t.required);
1398
1398
  return Object.entries(n).map(([n, r]) => ({
1399
- description: mn(t, r),
1399
+ description: hn(t, r),
1400
1400
  handle: n,
1401
- json_schema: pn(t, r),
1401
+ json_schema: mn(t, r),
1402
1402
  nullable: !e.has(n) || $(r, t)
1403
1403
  }));
1404
1404
  }
1405
1405
  return [{
1406
- description: mn(t, e),
1406
+ description: hn(t, e),
1407
1407
  handle: "output",
1408
1408
  json_schema: e,
1409
1409
  nullable: $(e)
1410
1410
  }];
1411
1411
  }
1412
- function pn(e, t) {
1412
+ function mn(e, t) {
1413
1413
  let n = G(t);
1414
1414
  if (n == null) return t;
1415
1415
  let r = Object.assign({}, n);
1416
1416
  return r.$defs == null && e.$defs != null && (r.$defs = e.$defs), r.definitions == null && e.definitions != null && (r.definitions = e.definitions), r;
1417
1417
  }
1418
- function mn(e, t) {
1419
- for (let n of _n(e, t)) if (typeof n.description == "string") return n.description;
1418
+ function hn(e, t) {
1419
+ for (let n of vn(e, t)) if (typeof n.description == "string") return n.description;
1420
1420
  }
1421
- function hn(e, t, n) {
1422
- for (let n of _n(e, t)) if (Object.hasOwn(n, "default")) return n.default;
1421
+ function gn(e, t, n) {
1422
+ for (let n of vn(e, t)) if (Object.hasOwn(n, "default")) return n.default;
1423
1423
  return n ? null : void 0;
1424
1424
  }
1425
- function gn(e) {
1425
+ function _n(e) {
1426
1426
  return Array.isArray(e) ? new Set(e.filter((e) => typeof e == "string")) : /* @__PURE__ */ new Set();
1427
1427
  }
1428
1428
  function $(e, t = e, n = /* @__PURE__ */ new Set()) {
@@ -1433,12 +1433,12 @@ function $(e, t = e, n = /* @__PURE__ */ new Set()) {
1433
1433
  for (let e of ["anyOf", "oneOf"]) if (Object.hasOwn(r, e)) return Array.isArray(r[e]) && r[e].some((e) => $(e, t, n));
1434
1434
  let i = typeof r.$ref == "string" ? r.$ref : void 0;
1435
1435
  if (i == null || n.has(i)) return !1;
1436
- let a = vn(t, i);
1436
+ let a = yn(t, i);
1437
1437
  if (a === void 0) return !1;
1438
1438
  let o = new Set(n);
1439
1439
  return o.add(i), $(a, t, o);
1440
1440
  }
1441
- function _n(e, t) {
1441
+ function vn(e, t) {
1442
1442
  let n = [], r = /* @__PURE__ */ new Set(), i = t;
1443
1443
  for (;;) {
1444
1444
  let t = G(i);
@@ -1446,12 +1446,12 @@ function _n(e, t) {
1446
1446
  n.push(t);
1447
1447
  let a = typeof t.$ref == "string" ? t.$ref : void 0;
1448
1448
  if (a == null || r.has(a)) return n;
1449
- let o = vn(e, a);
1449
+ let o = yn(e, a);
1450
1450
  if (o === void 0) return n;
1451
1451
  r.add(a), i = o;
1452
1452
  }
1453
1453
  }
1454
- function vn(e, t) {
1454
+ function yn(e, t) {
1455
1455
  if (t == "#") return e;
1456
1456
  if (!t.startsWith("#/")) return;
1457
1457
  let n = e;
@@ -1464,77 +1464,77 @@ function vn(e, t) {
1464
1464
  }
1465
1465
  //#endregion
1466
1466
  //#region src/workbench/browser/runtime/stores/proxyCatalog.ts
1467
- function yn(e, t) {
1468
- let n = pe(e);
1469
- if (n.success === !1) throw new U(502, typeof n.errorCode == "string" ? n.errorCode : "connector.unavailable", typeof n.message == "string" ? n.message : "Connector request failed.");
1470
- if (n.success !== !0 || !Array.isArray(n.data)) return F();
1471
- for (let e of n.data) t(pe(e));
1467
+ function bn(e, t) {
1468
+ let n = Ke(e);
1469
+ if (n.success === !1) throw new F(502, typeof n.errorCode == "string" ? n.errorCode : "connector.unavailable", typeof n.message == "string" ? n.message : "Connector request failed.");
1470
+ if (n.success !== !0 || !Array.isArray(n.data)) return L();
1471
+ for (let e of n.data) t(Ke(e));
1472
1472
  return n;
1473
1473
  }
1474
- function bn(e) {
1475
- return !Array.isArray(e.authTypes) || e.authTypes.some((e) => typeof e != "string") ? F() : {
1476
- serviceId: V(e.service),
1477
- serviceName: V(e.displayName),
1474
+ function xn(e) {
1475
+ return !Array.isArray(e.authTypes) || e.authTypes.some((e) => typeof e != "string") ? L() : {
1476
+ serviceId: U(e.service),
1477
+ serviceName: U(e.displayName),
1478
1478
  noSetup: e.authTypes.length == 1 && e.authTypes[0] == "no_auth",
1479
- ...e.iconUrl == null || e.iconUrl === "" ? {} : { icon: V(e.iconUrl) },
1480
- ...e.homepageUrl == null || e.homepageUrl === "" ? {} : { homepageUrl: V(e.homepageUrl) }
1479
+ ...e.iconUrl == null || e.iconUrl === "" ? {} : { icon: U(e.iconUrl) },
1480
+ ...e.homepageUrl == null || e.homepageUrl === "" ? {} : { homepageUrl: U(e.homepageUrl) }
1481
1481
  };
1482
1482
  }
1483
- function xn(e) {
1483
+ function Sn(e) {
1484
1484
  return typeof e.isDefault != "boolean" || typeof e.status != "string" || ![
1485
1485
  "active",
1486
1486
  "disconnected",
1487
1487
  "error",
1488
1488
  "reauth_required"
1489
- ].includes(e.status) ? F() : {
1490
- connectionId: V(e.id),
1491
- serviceId: V(e.service),
1492
- displayName: V(e.displayName),
1489
+ ].includes(e.status) ? L() : {
1490
+ connectionId: U(e.id),
1491
+ serviceId: U(e.service),
1492
+ displayName: U(e.displayName),
1493
1493
  isDefault: e.isDefault,
1494
1494
  status: e.status,
1495
- ...e.alias == null ? {} : { alias: V(e.alias) },
1495
+ ...e.alias == null ? {} : { alias: U(e.alias) },
1496
1496
  ...e.marketplace == null ? {} : { builtInAccount: !0 }
1497
1497
  };
1498
1498
  }
1499
- function Sn(e) {
1500
- if (V(e.id), V(e.service), V(e.name), typeof e.description != "string") return F();
1501
- un(e.inputSchema, e.outputSchema);
1502
- }
1503
1499
  function Cn(e) {
1500
+ if (U(e.id), U(e.service), U(e.name), typeof e.description != "string") return L();
1501
+ dn(e.inputSchema, e.outputSchema);
1502
+ }
1503
+ function wn(e) {
1504
1504
  return {
1505
1505
  nullable: e.nullable,
1506
- jsonSchema: Te(e.json_schema),
1506
+ jsonSchema: fe(e.json_schema),
1507
1507
  ...e.description == null ? {} : { description: e.description },
1508
- ...e.value === void 0 ? {} : { value: Te(e.value) }
1508
+ ...e.value === void 0 ? {} : { value: fe(e.value) }
1509
1509
  };
1510
1510
  }
1511
- function wn(e, t) {
1511
+ function Tn(e, t) {
1512
1512
  let n = t.data.find((t) => t.service == e.service);
1513
- if (n == null) return F();
1514
- let r = bn(n), i = un(e.inputSchema, e.outputSchema);
1513
+ if (n == null) return L();
1514
+ let r = xn(n), i = dn(e.inputSchema, e.outputSchema);
1515
1515
  return {
1516
1516
  serviceId: r.serviceId,
1517
1517
  serviceName: r.serviceName,
1518
1518
  ...r.icon == null ? {} : { icon: r.icon },
1519
1519
  ...r.homepageUrl == null ? {} : { homepageUrl: r.homepageUrl },
1520
- actionId: V(e.id),
1521
- ...e.operationType == null ? {} : { operationType: V(e.operationType) },
1522
- name: V(e.name),
1520
+ actionId: U(e.id),
1521
+ ...e.operationType == null ? {} : { operationType: U(e.operationType) },
1522
+ name: U(e.name),
1523
1523
  description: e.description,
1524
1524
  authenticated: !n.authTypes.includes("no_auth"),
1525
- inputSchema: Te(e.inputSchema),
1526
- outputSchema: Te(e.outputSchema),
1527
- inputs: Object.fromEntries(i.inputs.map((e) => [e.handle, Cn(e)])),
1528
- outputs: Object.fromEntries(i.outputs.map((e) => [e.handle, Cn(e)]))
1525
+ inputSchema: fe(e.inputSchema),
1526
+ outputSchema: fe(e.outputSchema),
1527
+ inputs: Object.fromEntries(i.inputs.map((e) => [e.handle, wn(e)])),
1528
+ outputs: Object.fromEntries(i.outputs.map((e) => [e.handle, wn(e)]))
1529
1529
  };
1530
1530
  }
1531
1531
  //#endregion
1532
1532
  //#region src/workbench/browser/runtime/stores/catalogStores.ts
1533
- function Tn(e) {
1534
- let t = pe(e);
1535
- return t.version != 1 || !Array.isArray(t.actions) ? F() : t.actions.map(ze);
1533
+ function En(e) {
1534
+ let t = Ke(e);
1535
+ return t.version != 1 || !Array.isArray(t.actions) ? L() : t.actions.map(Ie);
1536
1536
  }
1537
- var En = (...e) => JSON.stringify(e), Dn = class {
1537
+ var Dn = (...e) => JSON.stringify(e), On = class {
1538
1538
  constructor(e, t, n) {
1539
1539
  this.client = e, this.kind = t, this.options = n, this.entries = /* @__PURE__ */ new Map();
1540
1540
  }
@@ -1545,10 +1545,10 @@ var En = (...e) => JSON.stringify(e), Dn = class {
1545
1545
  ...t == null ? {} : { locale: t }
1546
1546
  }), a = `/v1/connector/proxy/${this.kind}${i.size ? `?${i}` : ""}`, o = this.entries.get(a);
1547
1547
  if (o == null) {
1548
- let e = (e) => yn(e, this.kind == "providers" ? bn : this.kind == "apps" ? xn : (e) => {
1549
- if (Sn(e), e.service != n) return F();
1548
+ let e = (e) => bn(e, this.kind == "providers" ? xn : this.kind == "apps" ? Sn : (e) => {
1549
+ if (Cn(e), e.service != n) return L();
1550
1550
  });
1551
- o = new ie((t, n) => this.client.readProxyCatalog({
1551
+ o = new Ae((t, n) => this.client.readProxyCatalog({
1552
1552
  path: a,
1553
1553
  decode: e
1554
1554
  }, t, n), this.kind == "providers" ? 3e5 : 3e4, this.options == null ? void 0 : {
@@ -1566,7 +1566,7 @@ var En = (...e) => JSON.stringify(e), Dn = class {
1566
1566
  for (let e of this.entries.values()) e.dispose();
1567
1567
  this.entries.clear();
1568
1568
  }
1569
- }, On = class {
1569
+ }, kn = class {
1570
1570
  constructor() {
1571
1571
  this.entries = /* @__PURE__ */ new Map();
1572
1572
  }
@@ -1604,13 +1604,13 @@ var En = (...e) => JSON.stringify(e), Dn = class {
1604
1604
  for (let e of this.entries.values()) e.dispose();
1605
1605
  this.entries.clear();
1606
1606
  }
1607
- }, kn = class {
1608
- #e = new On();
1607
+ }, An = class {
1608
+ #e = new kn();
1609
1609
  constructor(e, t) {
1610
- this.raw = new Dn(e, "providers", t);
1610
+ this.raw = new On(e, "providers", t);
1611
1611
  }
1612
1612
  get(e, t = "en", n = !1) {
1613
- return this.#e.get(En(e, t), [this.raw.get(e, t, void 0, n)], (e) => e.data.map(bn));
1613
+ return this.#e.get(Dn(e, t), [this.raw.get(e, t, void 0, n)], (e) => e.data.map(xn));
1614
1614
  }
1615
1615
  retryFailed() {
1616
1616
  this.raw.retryFailed();
@@ -1618,14 +1618,14 @@ var En = (...e) => JSON.stringify(e), Dn = class {
1618
1618
  dispose() {
1619
1619
  this.#e.dispose(), this.raw.dispose();
1620
1620
  }
1621
- }, An = class {
1621
+ }, jn = class {
1622
1622
  #e;
1623
- #t = new On();
1623
+ #t = new kn();
1624
1624
  constructor(e, t) {
1625
- this.#e = new Dn(e, "apps", t);
1625
+ this.#e = new On(e, "apps", t);
1626
1626
  }
1627
1627
  get(e, t, n = !1) {
1628
- return this.#t.get(En(t, e), [this.#e.get(t, void 0, void 0, n)], (t) => t.data.filter((t) => e == null || t.service == e).map(xn));
1628
+ return this.#t.get(Dn(t, e), [this.#e.get(t, void 0, void 0, n)], (t) => t.data.filter((t) => e == null || t.service == e).map(Sn));
1629
1629
  }
1630
1630
  retryFailed() {
1631
1631
  this.#e.retryFailed();
@@ -1633,20 +1633,20 @@ var En = (...e) => JSON.stringify(e), Dn = class {
1633
1633
  dispose() {
1634
1634
  this.#t.dispose(), this.#e.dispose();
1635
1635
  }
1636
- }, jn = class {
1636
+ }, Mn = class {
1637
1637
  #e;
1638
- #t = new On();
1638
+ #t = new kn();
1639
1639
  #n = /* @__PURE__ */ new Map();
1640
1640
  #r = /* @__PURE__ */ new Set();
1641
1641
  #i = /* @__PURE__ */ new WeakMap();
1642
1642
  constructor(e, t, n) {
1643
- this.client = e, this.providers = t, this.#e = new Dn(e, "actions", n);
1643
+ this.client = e, this.providers = t, this.#e = new On(e, "actions", n);
1644
1644
  }
1645
1645
  get(e, t, n = "en", r = !1) {
1646
- return this.#t.get(En(t, e, n), [this.#e.get(t, n, e, r), this.providers.raw.get(t, n)], (e, t) => e.data.map((e) => wn(e, t)));
1646
+ return this.#t.get(Dn(t, e, n), [this.#e.get(t, n, e, r), this.providers.raw.get(t, n)], (e, t) => e.data.map((e) => Tn(e, t)));
1647
1647
  }
1648
1648
  detail(e, n, r = "en", i = !1) {
1649
- let a = this.get(e.slice(0, e.indexOf(".")), n, r, i), o = En(n, e, r), s = this.#n.get(o);
1649
+ let a = this.get(e.slice(0, e.indexOf(".")), n, r, i), o = Dn(n, e, r), s = this.#n.get(o);
1650
1650
  return s ?? (s = t((t) => {
1651
1651
  let n = t(a), r = n.data?.find((t) => t.actionId == e);
1652
1652
  return {
@@ -1672,9 +1672,9 @@ var En = (...e) => JSON.stringify(e), Dn = class {
1672
1672
  }
1673
1673
  let s = o.get(a);
1674
1674
  if (s != null) return s.refresh(), s;
1675
- let c = new ie((e, t) => this.client.readCatalog({
1675
+ let c = new Ae((e, t) => this.client.readCatalog({
1676
1676
  path: `/v1/connector/action-metadata?${i}`,
1677
- decode: Tn
1677
+ decode: En
1678
1678
  }, null, t), 3e4);
1679
1679
  return r.aborted ? c.dispose() : (o.set(a, c), this.#r.add(c)), c;
1680
1680
  }
@@ -1687,22 +1687,22 @@ var En = (...e) => JSON.stringify(e), Dn = class {
1687
1687
  for (let e of this.#n.values()) e.dispose();
1688
1688
  this.#n.clear(), this.#t.dispose(), this.#e.dispose();
1689
1689
  }
1690
- }, Mn = class {
1690
+ }, Nn = class {
1691
1691
  constructor(e, t) {
1692
- this.providers = new kn(e, t), this.actions = new jn(e, this.providers, t), this.connections = new An(e, t);
1692
+ this.providers = new An(e, t), this.actions = new Mn(e, this.providers, t), this.connections = new jn(e, t);
1693
1693
  }
1694
1694
  dispose() {
1695
1695
  this.actions.dispose(), this.connections.dispose(), this.providers.dispose();
1696
1696
  }
1697
- }, Nn = {};
1698
- function Pn(e) {
1697
+ }, Pn = {};
1698
+ function Fn(e) {
1699
1699
  return Object.entries(e).map(([e, t]) => ({
1700
1700
  description: t.description,
1701
1701
  handle: e,
1702
1702
  jsonSchema: t.jsonSchema
1703
1703
  }));
1704
1704
  }
1705
- function Fn(e, t) {
1705
+ function In(e, t) {
1706
1706
  return {
1707
1707
  connector: e,
1708
1708
  description: e.authenticated && e.defaultConnection == null ? t("addNode.connectorNeedsConnection", {
@@ -1710,15 +1710,15 @@ function Fn(e, t) {
1710
1710
  service: e.serviceName
1711
1711
  }) : e.description,
1712
1712
  group: t("addNode.connectorActions"),
1713
- icon: M(e),
1713
+ icon: O(e),
1714
1714
  id: `connector:${e.actionId}`,
1715
- inputs: Pn(e.inputs),
1715
+ inputs: Fn(e.inputs),
1716
1716
  kind: "connector",
1717
1717
  label: e.name,
1718
- outputs: Pn(e.outputs)
1718
+ outputs: Fn(e.outputs)
1719
1719
  };
1720
1720
  }
1721
- function In(e, t) {
1721
+ function Ln(e, t) {
1722
1722
  let n = /* @__PURE__ */ new Map();
1723
1723
  for (let t of e) {
1724
1724
  let e = n.get(t.serviceId) ?? [];
@@ -1726,7 +1726,7 @@ function In(e, t) {
1726
1726
  }
1727
1727
  return [...n.values()].toSorted((e, t) => e[0].serviceName.localeCompare(t[0].serviceName)).map((e) => {
1728
1728
  let n = e[0], r = e.map((e) => {
1729
- let n = Fn(e, t);
1729
+ let n = In(e, t);
1730
1730
  return {
1731
1731
  description: n.description,
1732
1732
  label: n.label,
@@ -1737,7 +1737,7 @@ function In(e, t) {
1737
1737
  choices: r,
1738
1738
  description: t(r.length == 1 ? "addNode.connectorActionCountOne" : "addNode.connectorActionCount", { count: r.length }),
1739
1739
  group: t("addNode.connectorActions"),
1740
- icon: M(n),
1740
+ icon: O(n),
1741
1741
  id: `connector-provider:${n.serviceId}`,
1742
1742
  inputs: [],
1743
1743
  kind: "connector-group",
@@ -1747,12 +1747,12 @@ function In(e, t) {
1747
1747
  };
1748
1748
  });
1749
1749
  }
1750
- function Ln(e, t) {
1750
+ function Rn(e, t) {
1751
1751
  return {
1752
1752
  choices: [],
1753
1753
  description: t("addNode.connectorBrowseActions"),
1754
1754
  group: t("addNode.connectorActions"),
1755
- icon: M(e),
1755
+ icon: O(e),
1756
1756
  id: `connector-provider:${e.serviceId}`,
1757
1757
  inputs: [],
1758
1758
  kind: "connector-group",
@@ -1762,7 +1762,7 @@ function Ln(e, t) {
1762
1762
  serviceId: e.serviceId
1763
1763
  };
1764
1764
  }
1765
- function Rn(e, t) {
1765
+ function zn(e, t) {
1766
1766
  if (e == null) return;
1767
1767
  let n = e.kind == "task" && e.node.task == null ? e.node.taskId : void 0;
1768
1768
  if (n == null) return;
@@ -1774,10 +1774,10 @@ function Rn(e, t) {
1774
1774
  taskId: n
1775
1775
  };
1776
1776
  }
1777
- function zn(e, t, n) {
1777
+ function Bn(e, t, n) {
1778
1778
  if (e == null) return [];
1779
1779
  let r = [];
1780
- for (let i of [...Ae(e.revision.content).tasks].toSorted()) {
1780
+ for (let i of [...ke(e.revision.content).tasks].toSorted()) {
1781
1781
  let a = e.task(i);
1782
1782
  if (a?.executor.kind != "connector") continue;
1783
1783
  let o = t[a.executor.action];
@@ -1794,7 +1794,7 @@ function zn(e, t, n) {
1794
1794
  }
1795
1795
  return r;
1796
1796
  }
1797
- var Bn = class {
1797
+ var Vn = class {
1798
1798
  #e;
1799
1799
  #t;
1800
1800
  #n;
@@ -1812,26 +1812,26 @@ var Bn = class {
1812
1812
  #m;
1813
1813
  #h;
1814
1814
  #g;
1815
- constructor(r, i, a, o, s = p(), c = i.catalogs) {
1816
- this.data = c, this.#i = /* @__PURE__ */ new Set(), this.#a = new L(), this.#o = new L(), this.#d = n(Nn), this.#f = n([]), this.#p = n([]), this.#g = !1, this.loadConnections = async (e) => {
1815
+ constructor(r, i, a, o, s = d(), c = i.catalogs) {
1816
+ this.data = c, this.#i = /* @__PURE__ */ new Set(), this.#a = new V(), this.#o = new V(), this.#d = n(Pn), this.#f = n([]), this.#p = n([]), this.#g = !1, this.loadConnections = async (e) => {
1817
1817
  let t = this.#m.$.flowId.value;
1818
- this.#g || t == null || await w(this.data.connections.get(void 0, t), e);
1818
+ this.#g || t == null || await j(this.data.connections.get(void 0, t), e);
1819
1819
  }, this.browseAddNodeOptions = (e) => {
1820
1820
  let t = this.data.providers.get(this.#m.$.flowId.value, this.#n);
1821
- return I(e, (e) => {
1821
+ return g(e, (e) => {
1822
1822
  let n = e(t), r = e(this.#t.t$);
1823
1823
  return {
1824
1824
  ...n,
1825
- data: n.data?.toSorted((e, t) => e.serviceName.localeCompare(t.serviceName)).map((e) => Ln(e, r))
1825
+ data: n.data?.toSorted((e, t) => e.serviceName.localeCompare(t.serviceName)).map((e) => Rn(e, r))
1826
1826
  };
1827
1827
  });
1828
1828
  }, this.provideAddNodeOptionChoices = (e, t) => {
1829
1829
  let n = e.slice(19), r = this.#m.$.flowId.value, i = this.data.actions.get(n, r, this.#n), a = this.data.providers.get(r, this.#n), o = this.data.connections.get(n, r);
1830
- return I(t, (e) => {
1830
+ return g(t, (e) => {
1831
1831
  let t = e(i), r = e(a).data?.find((e) => e.serviceId == n), s = e(o).data, c = e(this.#t.t$);
1832
1832
  return {
1833
1833
  ...t,
1834
- data: t.data?.map((e) => Fn(E({
1834
+ data: t.data?.map((e) => In(w({
1835
1835
  ...e,
1836
1836
  ...r == null ? {} : {
1837
1837
  serviceName: r.serviceName,
@@ -1842,17 +1842,17 @@ var Bn = class {
1842
1842
  });
1843
1843
  }, this.provideAddNodeOptions = (e, t, n = t) => {
1844
1844
  let r = this.#m.$.flowId.value, i = e.trim();
1845
- if (i.length == 0) return I(t, (e) => ({
1846
- data: In(Object.values(e(this.$.actions)), e(this.#t.t$)),
1845
+ if (i.length == 0) return g(t, (e) => ({
1846
+ data: Ln(Object.values(e(this.$.actions)), e(this.#t.t$)),
1847
1847
  refreshing: !1,
1848
1848
  error: void 0
1849
1849
  }));
1850
1850
  let a = this.data.actions.search(i, r, this.#n, n).get();
1851
- return I(t, (e) => {
1851
+ return g(t, (e) => {
1852
1852
  let t = e(a), n = e(this.#t.t$);
1853
1853
  return {
1854
1854
  ...t,
1855
- data: t.data?.map((t) => Fn(E(t, e(k(this.data.connections.get(t.serviceId, r)))), n))
1855
+ data: t.data?.map((t) => In(w(t, e(A(this.data.connections.get(t.serviceId, r)))), n))
1856
1856
  };
1857
1857
  });
1858
1858
  }, this.retryCatalog = () => {
@@ -1861,38 +1861,38 @@ var Bn = class {
1861
1861
  let l = t((e) => {
1862
1862
  let t = e(i.$.flowId);
1863
1863
  return Object.fromEntries(e(this.#f).flatMap((n) => {
1864
- let r = e(k(this.data.actions.detail(n, t, this.#n)));
1865
- return r == null ? [] : [[n, E(r, e(k(this.data.connections.get(r.serviceId, t))))]];
1864
+ let r = e(A(this.data.actions.detail(n, t, this.#n)));
1865
+ return r == null ? [] : [[n, w(r, e(A(this.data.connections.get(r.serviceId, t))))]];
1866
1866
  }));
1867
1867
  }), u = t((e) => {
1868
1868
  let t = e(i.$.flowId);
1869
1869
  return Object.fromEntries(e(this.#p).flatMap((n) => {
1870
- let r = e(k(this.data.connections.get(n, t)));
1871
- return r == null ? [] : [[n, et(r)]];
1870
+ let r = e(A(this.data.connections.get(n, t)));
1871
+ return r == null ? [] : [[n, M(r)]];
1872
1872
  }));
1873
1873
  });
1874
1874
  this.#l = t((e) => {
1875
- let t = Rn(e(i.$.selection), e(i.$.revision)), n = e(this.#d);
1875
+ let t = zn(e(i.$.selection), e(i.$.revision)), n = e(this.#d);
1876
1876
  if (t == null) return { authorizationPending: !1 };
1877
1877
  let r = e(l)[t.actionId], a = r == null ? void 0 : e(u)[r.serviceId], o = e(this.data.actions.detail(t.actionId, e(i.$.flowId), this.#n)).error, s = r == null ? void 0 : e(this.data.connections.get(r.serviceId, e(i.$.flowId))).error, c = t.connectionId == null ? void 0 : a?.byId.get(t.connectionId);
1878
1878
  return {
1879
1879
  action: r,
1880
- actionError: o == null ? void 0 : B(o, this.#t.t).message,
1880
+ actionError: o == null ? void 0 : I(o, this.#t.t).message,
1881
1881
  activeConnections: a?.active,
1882
1882
  authorizationPending: r != null && n.authorizationServiceId == r.serviceId,
1883
1883
  connection: c,
1884
- connectionError: s == null ? void 0 : B(s, this.#t.t).message
1884
+ connectionError: s == null ? void 0 : I(s, this.#t.t).message
1885
1885
  };
1886
1886
  }), this.$ = {
1887
1887
  connections: t((e) => {
1888
1888
  let t = e(i.$.flowId);
1889
- return t == null ? [] : e(k(this.data.connections.get(void 0, t))) ?? [];
1889
+ return t == null ? [] : e(A(this.data.connections.get(void 0, t))) ?? [];
1890
1890
  }),
1891
1891
  actionLoading: e(this.#d, (e) => e.actionLoading),
1892
1892
  actions: l,
1893
1893
  catalogs: u,
1894
1894
  connectionLoading: e(this.#d, (e) => e.connectionLoading),
1895
- diagnostics: t((e) => zn(e(i.$.revision), e(l), e(u))),
1895
+ diagnostics: t((e) => Bn(e(i.$.revision), e(l), e(u))),
1896
1896
  selectedAction: e(this.#l, (e) => e.action),
1897
1897
  selectedActionError: e(this.#l, (e) => e.actionError),
1898
1898
  selectedActiveConnections: e(this.#l, (e) => e.activeConnections),
@@ -1910,11 +1910,11 @@ var Bn = class {
1910
1910
  e == this.#n || this.#g || (this.#n = e, this.reset(), this.#C());
1911
1911
  }
1912
1912
  reset() {
1913
- this.#g || (this.#a.invalidate(), this.#o.invalidate(), this.#h = void 0, this.#i.clear(), this.#d.set(Nn), this.#f.set([]), this.#p.set([]));
1913
+ this.#g || (this.#a.invalidate(), this.#o.invalidate(), this.#h = void 0, this.#i.clear(), this.#d.set(Pn), this.#f.set([]), this.#p.set([]));
1914
1914
  }
1915
1915
  async refresh(e = !1) {
1916
1916
  if (this.#g) return;
1917
- let t = this.#o.begin(), n = this.#m.$.flowId.value, r = Rn(this.#m.$.selection.value, this.#m.$.revision.value);
1917
+ let t = this.#o.begin(), n = this.#m.$.flowId.value, r = zn(this.#m.$.selection.value, this.#m.$.revision.value);
1918
1918
  if (n == null || r == null) {
1919
1919
  (this.#d.value.actionLoading != null || this.#d.value.connectionLoading != null) && this.#x({
1920
1920
  actionLoading: void 0,
@@ -1930,13 +1930,13 @@ var Bn = class {
1930
1930
  connectionLoading: void 0
1931
1931
  });
1932
1932
  try {
1933
- let a = await w(i);
1933
+ let a = await j(i);
1934
1934
  if (!this.#S(t, n)) return;
1935
1935
  this.#b(this.#f, [a.actionId]), a.authenticated && await this.#_(n, r, a.serviceId, e, t);
1936
1936
  } catch (e) {
1937
1937
  this.#S(t, n) && this.#x({ actionError: {
1938
1938
  actionId: r.actionId,
1939
- message: B(e, this.#t.t).message
1939
+ message: I(e, this.#t.t).message
1940
1940
  } });
1941
1941
  } finally {
1942
1942
  this.#S(t, n) && this.#d.value.actionLoading == r.actionId && this.#x({ actionLoading: void 0 });
@@ -1944,11 +1944,11 @@ var Bn = class {
1944
1944
  }
1945
1945
  async loadCodeConnections(e, t) {
1946
1946
  let n = this.#m.$.flowId.value;
1947
- n == null || this.#g || (await w(this.data.connections.get(e, n), t), !(t.aborted || this.#g || n != this.#m.$.flowId.value) && this.#b(this.#p, [e]));
1947
+ n == null || this.#g || (await j(this.data.connections.get(e, n), t), !(t.aborted || this.#g || n != this.#m.$.flowId.value) && this.#b(this.#p, [e]));
1948
1948
  }
1949
1949
  async loadCodeAction(e, t) {
1950
1950
  let n = this.#n, r = this.#m.$.flowId.value;
1951
- r == null || this.#g || (await w(this.data.actions.detail(e, r, n), t), !(t.aborted || this.#g || n != this.#n || r != this.#m.$.flowId.value) && this.#b(this.#f, [e]));
1951
+ r == null || this.#g || (await j(this.data.actions.detail(e, r, n), t), !(t.aborted || this.#g || n != this.#n || r != this.#m.$.flowId.value) && this.#b(this.#f, [e]));
1952
1952
  }
1953
1953
  async connect(e) {
1954
1954
  if (this.#g) return;
@@ -1969,7 +1969,7 @@ var Bn = class {
1969
1969
  serviceId: e
1970
1970
  }, this.#x({ authorizationServiceId: e });
1971
1971
  } catch (e) {
1972
- this.#g || this.#u(B(e, this.#t.t));
1972
+ this.#g || this.#u(I(e, this.#t.t));
1973
1973
  }
1974
1974
  }
1975
1975
  async setConnection(e, t) {
@@ -1995,16 +1995,16 @@ var Bn = class {
1995
1995
  let i;
1996
1996
  try {
1997
1997
  let r = this.data.connections.get(t, e, n);
1998
- await Promise.resolve(), i = await w(r, void 0, n);
1998
+ await Promise.resolve(), i = await j(r, void 0, n);
1999
1999
  } catch (n) {
2000
2000
  this.#S(r, e) && this.#x({ connectionError: {
2001
- message: B(n, this.#t.t).message,
2001
+ message: I(n, this.#t.t).message,
2002
2002
  serviceId: t
2003
2003
  } });
2004
2004
  return;
2005
2005
  }
2006
2006
  if (!this.#S(r, e)) return;
2007
- let a = et(i);
2007
+ let a = M(i);
2008
2008
  return this.#b(this.#p, [t]), a;
2009
2009
  }
2010
2010
  async #y(e, t, n) {
@@ -2032,7 +2032,7 @@ var Bn = class {
2032
2032
  if (r.length > 0) {
2033
2033
  for (let e of r) this.#i.add(e);
2034
2034
  try {
2035
- let n = await Promise.all(r.map((e) => w(this.data.actions.detail(e, t, this.#n))));
2035
+ let n = await Promise.all(r.map((e) => j(this.data.actions.detail(e, t, this.#n))));
2036
2036
  if (!this.#S(e, t)) return;
2037
2037
  this.#b(this.#f, n.map((e) => e.actionId));
2038
2038
  } catch {
@@ -2043,7 +2043,7 @@ var Bn = class {
2043
2043
  }
2044
2044
  if (!this.#S(e, t)) return;
2045
2045
  let i = /* @__PURE__ */ new Set();
2046
- for (let e of Ae(n.revision.content).tasks) {
2046
+ for (let e of ke(n.revision.content).tasks) {
2047
2047
  let t = n.task(e);
2048
2048
  if (t?.executor.kind != "connector") continue;
2049
2049
  let r = this.$.actions.value[t.executor.action];
@@ -2054,14 +2054,14 @@ var Bn = class {
2054
2054
  };
2055
2055
  //#endregion
2056
2056
  //#region src/workbench/browser/runtime/stores/triggerCatalog.ts
2057
- function Vn(e, t) {
2057
+ function Hn(e, t) {
2058
2058
  let n = `open-flow:trigger-catalog:v2:${encodeURIComponent(e)}:`;
2059
2059
  return {
2060
2060
  getItem: (e) => (t ?? window.localStorage).getItem(n + e),
2061
2061
  setItem: (e, r) => (t ?? window.localStorage).setItem(n + e, r)
2062
2062
  };
2063
2063
  }
2064
- var Hn = class {
2064
+ var Un = class {
2065
2065
  #e;
2066
2066
  #t;
2067
2067
  constructor(e, r, i) {
@@ -2073,16 +2073,16 @@ var Hn = class {
2073
2073
  let t = this.#t.get(e);
2074
2074
  if (t == null) {
2075
2075
  let n = (t) => {
2076
- let n = Ie(t);
2076
+ let n = Oe(t);
2077
2077
  if (n.locale != e) throw Error("Unexpected Trigger catalog language.");
2078
2078
  return n;
2079
2079
  }, r = this.host.triggerCatalogCache;
2080
- t = new ie((t, r) => this.client.readCatalog({
2080
+ t = new Ae((t, r) => this.client.readCatalog({
2081
2081
  path: `/v1/trigger-keys/catalog?locale=${encodeURIComponent(e)}`,
2082
2082
  decode: n
2083
2083
  }, t, r), 3e5, r == null ? void 0 : {
2084
2084
  key: e,
2085
- storage: () => Vn(r.namespace, r.storage),
2085
+ storage: () => Hn(r.namespace, r.storage),
2086
2086
  decode: n
2087
2087
  }), this.#t.set(e, t);
2088
2088
  }
@@ -2102,8 +2102,8 @@ var Hn = class {
2102
2102
  for (let e of this.#t.values()) e.dispose();
2103
2103
  this.#t.clear();
2104
2104
  }
2105
- }, Un = {}, Wn = "trigger:";
2106
- function Gn(e, t) {
2105
+ }, Wn = {}, Gn = "trigger:";
2106
+ function Kn(e, t) {
2107
2107
  if (e?.kind != "trigger") return;
2108
2108
  let n = e.trigger;
2109
2109
  if (n.kind != "poll" && n.kind != "integration") return;
@@ -2114,29 +2114,26 @@ function Gn(e, t) {
2114
2114
  triggerId: e.id
2115
2115
  };
2116
2116
  }
2117
- function Kn(e, t, n) {
2117
+ function qn(e, t, n) {
2118
2118
  return {
2119
2119
  description: n?.description ?? e.description,
2120
2120
  group: t.t("addNode.integrationTriggers"),
2121
- icon: M({
2121
+ icon: O({
2122
2122
  serviceId: e.provider,
2123
2123
  serviceName: e.provider
2124
2124
  }),
2125
- id: `${Wn}${e.key}`,
2125
+ id: `${Gn}${e.key}`,
2126
2126
  inputs: [],
2127
2127
  kind: "trigger",
2128
2128
  label: n?.displayName ?? e.displayName,
2129
- outputs: [{
2130
- handle: "payload",
2131
- jsonSchema: e.payloadSchema
2132
- }],
2129
+ outputs: e.outputs,
2133
2130
  trigger: {
2134
2131
  definition: e,
2135
2132
  kind: "catalog"
2136
2133
  }
2137
2134
  };
2138
2135
  }
2139
- var qn = class {
2136
+ var Jn = class {
2140
2137
  #e;
2141
2138
  #t;
2142
2139
  #n;
@@ -2147,18 +2144,18 @@ var qn = class {
2147
2144
  #s;
2148
2145
  #c;
2149
2146
  #l;
2150
- constructor(r, i, a, o, s = p()) {
2151
- this.#r = new L(), this.#i = /* @__PURE__ */ new Set(), this.#s = n(Un), this.#l = !1, this.browseAddNodeOptions = (e) => this.#u("", e), this.provideAddNodeOptions = (e, t) => this.#u(e, t), this.catalog = new Hn(r, bt([s.lang]), o), this.#e = r, this.#t = o, this.#n = s, this.#o = a, this.#c = i, this.#a = t((e) => {
2152
- let t = e(i.$.selection), n = Gn(t, i), r = e(this.#s);
2147
+ constructor(r, i, a, o, s = d()) {
2148
+ this.#r = new V(), this.#i = /* @__PURE__ */ new Set(), this.#s = n(Wn), this.#l = !1, this.browseAddNodeOptions = (e) => this.#u("", e), this.provideAddNodeOptions = (e, t) => this.#u(e, t), this.catalog = new Un(r, yt([s.lang]), o), this.#e = r, this.#t = o, this.#n = s, this.#o = a, this.#c = i, this.#a = t((e) => {
2149
+ let t = e(i.$.selection), n = Kn(t, i), r = e(this.#s);
2153
2150
  if (t?.kind != "trigger") return { authorizationPending: !1 };
2154
2151
  let a = t.trigger;
2155
2152
  if (a.kind != "poll" && a.kind != "integration") return { authorizationPending: !1 };
2156
- let o = n == null ? void 0 : e(i.catalogs.connections.get(n.provider, e(i.$.flowId))).data, s = o == null ? void 0 : et(o), c = n == null ? void 0 : e(i.catalogs.connections.get(n.provider, e(i.$.flowId))).error;
2153
+ let o = n == null ? void 0 : e(i.catalogs.connections.get(n.provider, e(i.$.flowId))).data, s = o == null ? void 0 : M(o), c = n == null ? void 0 : e(i.catalogs.connections.get(n.provider, e(i.$.flowId))).error;
2157
2154
  return {
2158
2155
  activeConnections: s?.active,
2159
2156
  authorizationPending: r.authorizationProvider == n?.provider,
2160
2157
  connection: n?.connectionId == null ? void 0 : s?.byId.get(n.connectionId),
2161
- connectionError: c == null ? void 0 : B(c, this.#n.t).message,
2158
+ connectionError: c == null ? void 0 : I(c, this.#n.t).message,
2162
2159
  definition: a.definition
2163
2160
  };
2164
2161
  }), this.$ = {
@@ -2176,11 +2173,11 @@ var qn = class {
2176
2173
  this.#a.dispose(), this.#s.dispose();
2177
2174
  }
2178
2175
  reset() {
2179
- this.#l || (this.#i.clear(), this.#r.invalidate(), this.#s.set(Un));
2176
+ this.#l || (this.#i.clear(), this.#r.invalidate(), this.#s.set(Wn));
2180
2177
  }
2181
2178
  #u(e, t) {
2182
2179
  let n = this.catalog.get(), r = e.trim().toLowerCase();
2183
- return I(t, (e) => {
2180
+ return g(t, (e) => {
2184
2181
  let t = e(n);
2185
2182
  e(this.#n.t$);
2186
2183
  let i = e(this.#c.$.flowId) != null && e(this.#c.$.target)?.kind == "flow", a = t.data, o = a?.definitions.filter((e) => !r || [
@@ -2195,13 +2192,13 @@ var qn = class {
2195
2192
  ].some((e) => e?.toLowerCase().includes(r)));
2196
2193
  return {
2197
2194
  ...t,
2198
- data: i ? o?.map((e) => Kn(e, this.#n, a.display[e.key])) : []
2195
+ data: i ? o?.map((e) => qn(e, this.#n, a.display[e.key])) : []
2199
2196
  };
2200
2197
  });
2201
2198
  }
2202
2199
  async refresh(e = !1) {
2203
2200
  if (this.#l) return;
2204
- let t = this.#r.begin(), n = this.#c.$.flowId.value, r = Gn(this.#c.$.selection.value, this.#c);
2201
+ let t = this.#r.begin(), n = this.#c.$.flowId.value, r = Kn(this.#c.$.selection.value, this.#c);
2205
2202
  if (n == null || r == null) {
2206
2203
  this.#s.value.connectionLoading != null && this.#d({ connectionLoading: void 0 });
2207
2204
  return;
@@ -2212,11 +2209,11 @@ var qn = class {
2212
2209
  });
2213
2210
  try {
2214
2211
  let i = this.#c.catalogs.connections.get(r.provider, n, e || this.#i.has(r.provider));
2215
- if (await Promise.resolve(), await w(i, void 0, e || this.#i.has(r.provider)), !this.#f(t, n)) return;
2212
+ if (await Promise.resolve(), await j(i, void 0, e || this.#i.has(r.provider)), !this.#f(t, n)) return;
2216
2213
  this.#i.delete(r.provider);
2217
2214
  } catch (e) {
2218
2215
  this.#f(t, n) && this.#d({ connectionError: {
2219
- message: B(e, this.#n.t).message,
2216
+ message: I(e, this.#n.t).message,
2220
2217
  provider: r.provider
2221
2218
  } });
2222
2219
  } finally {
@@ -2235,7 +2232,7 @@ var qn = class {
2235
2232
  }
2236
2233
  !this.#l && t == this.#c.$.flowId.value && this.#d({ authorizationProvider: e });
2237
2234
  } catch (e) {
2238
- this.#l || this.#o(B(e, this.#n.t));
2235
+ this.#l || this.#o(I(e, this.#n.t));
2239
2236
  }
2240
2237
  }
2241
2238
  async setConnection(e, t) {
@@ -2244,7 +2241,7 @@ var qn = class {
2244
2241
  async refreshAfterAuthorization() {
2245
2242
  if (this.#l) return;
2246
2243
  let e = this.#s.value.authorizationProvider;
2247
- e != null && (this.#i.add(e), this.#d({ authorizationProvider: void 0 }), Gn(this.#c.$.selection.value, this.#c)?.provider == e && await this.refresh(!0));
2244
+ e != null && (this.#i.add(e), this.#d({ authorizationProvider: void 0 }), Kn(this.#c.$.selection.value, this.#c)?.provider == e && await this.refresh(!0));
2248
2245
  }
2249
2246
  #d(e) {
2250
2247
  this.#l || this.#s.set({
@@ -2258,7 +2255,7 @@ var qn = class {
2258
2255
  };
2259
2256
  //#endregion
2260
2257
  //#region src/flow/common/inverseChanges.ts
2261
- function Jn(e, t) {
2258
+ function Yn(e, t) {
2262
2259
  let n = e, r = [];
2263
2260
  for (let e of t) {
2264
2261
  let t = _t(n, [e]), i = [];
@@ -2375,6 +2372,125 @@ function Jn(e, t) {
2375
2372
  value: e.before
2376
2373
  });
2377
2374
  break;
2375
+ case "binding.target.set":
2376
+ i.push({
2377
+ ...e,
2378
+ before: e.value,
2379
+ value: e.before
2380
+ });
2381
+ break;
2382
+ case "graph.node.additional-inputs.set":
2383
+ i.push({
2384
+ ...e,
2385
+ before: e.value,
2386
+ value: e.before
2387
+ });
2388
+ break;
2389
+ case "graph.node.condition.set":
2390
+ i.push({
2391
+ ...e,
2392
+ before: e.value,
2393
+ value: e.before
2394
+ });
2395
+ break;
2396
+ case "graph.node.field.set":
2397
+ i.push({
2398
+ ...e,
2399
+ before: e.value,
2400
+ value: e.before
2401
+ });
2402
+ break;
2403
+ case "graph.node.task.ports.set":
2404
+ i.push({
2405
+ ...e,
2406
+ before: e.value,
2407
+ value: e.before
2408
+ });
2409
+ break;
2410
+ case "graph.node.task.name.set":
2411
+ i.push({
2412
+ ...e,
2413
+ before: e.value,
2414
+ value: e.before
2415
+ });
2416
+ break;
2417
+ case "graph.node.task.capabilities.set":
2418
+ i.push({
2419
+ ...e,
2420
+ before: e.value,
2421
+ value: e.before
2422
+ });
2423
+ break;
2424
+ case "graph.node.values.set":
2425
+ i.push({
2426
+ ...e,
2427
+ before: e.value,
2428
+ value: e.before
2429
+ });
2430
+ break;
2431
+ case "graph.node.resolution.set":
2432
+ i.push({
2433
+ ...e,
2434
+ before: e.value,
2435
+ value: e.before
2436
+ });
2437
+ break;
2438
+ case "graph.node.webhook.set":
2439
+ i.push({
2440
+ ...e,
2441
+ before: e.value,
2442
+ value: e.before
2443
+ });
2444
+ break;
2445
+ case "graph.trigger.config.set":
2446
+ i.push({
2447
+ ...e,
2448
+ before: e.value,
2449
+ value: e.before
2450
+ });
2451
+ break;
2452
+ case "graph.trigger.schedule.set":
2453
+ i.push({
2454
+ ...e,
2455
+ before: e.value,
2456
+ value: e.before
2457
+ });
2458
+ break;
2459
+ case "task.connector.connection.set":
2460
+ i.push({
2461
+ ...e,
2462
+ before: e.value,
2463
+ value: e.before
2464
+ });
2465
+ break;
2466
+ case "task.agent.set":
2467
+ i.push({
2468
+ ...e,
2469
+ before: e.value,
2470
+ value: e.before
2471
+ });
2472
+ break;
2473
+ case "task.llm.mode.set":
2474
+ i.push({
2475
+ ...e,
2476
+ before: e.value,
2477
+ value: e.before
2478
+ });
2479
+ break;
2480
+ case "task.name.set":
2481
+ i.push({
2482
+ ...e,
2483
+ before: e.value,
2484
+ value: e.before
2485
+ });
2486
+ break;
2487
+ case "subflow.definition.set":
2488
+ i.push({
2489
+ ...e,
2490
+ before: e.definition,
2491
+ definition: e.before
2492
+ });
2493
+ break;
2378
2494
  default: throw Error(`Unsupported canvas history operation: ${e.kind}`);
2379
2495
  }
2380
2496
  r.push(i), n = t;
@@ -2383,7 +2499,7 @@ function Jn(e, t) {
2383
2499
  }
2384
2500
  //#endregion
2385
2501
  //#region src/workbench/browser/runtime/stores/canvasHistory.ts
2386
- var Yn = class {
2502
+ var Xn = class {
2387
2503
  constructor() {
2388
2504
  this.state$ = n({
2389
2505
  canUndo: !1,
@@ -2426,7 +2542,7 @@ var Yn = class {
2426
2542
  };
2427
2543
  //#endregion
2428
2544
  //#region src/workbench/browser/runtime/stores/draftChanges.ts
2429
- function Xn(e, t) {
2545
+ function Zn(e, t) {
2430
2546
  if (e.length != 1 || t.length != 1) return;
2431
2547
  let n = e[0], r = t[0];
2432
2548
  if (n?.kind == "graph.node.field.set" && r?.kind == "graph.node.field.set") return n.nodeId != r.nodeId || n.field != r.field || n.target.kind != r.target.kind || n.target.kind == "subflow" && (r.target.kind != "subflow" || n.target.id != r.target.id) ? void 0 : [{
@@ -2446,7 +2562,7 @@ function Xn(e, t) {
2446
2562
  value: r.value
2447
2563
  }];
2448
2564
  }
2449
- var Zn = class {
2565
+ var Qn = class {
2450
2566
  #e;
2451
2567
  #t;
2452
2568
  #n;
@@ -2474,7 +2590,7 @@ var Zn = class {
2474
2590
  this.#a = e;
2475
2591
  let t = e, n = [];
2476
2592
  for (let e of this.#o) try {
2477
- t = R(t, e.changes), n.push(e);
2593
+ t = z(t, e.changes), n.push(e);
2478
2594
  } catch (t) {
2479
2595
  if (!(t instanceof rt)) throw t;
2480
2596
  e.active = !1;
@@ -2482,7 +2598,7 @@ var Zn = class {
2482
2598
  return this.#o = n, t;
2483
2599
  }
2484
2600
  project(e) {
2485
- return this.#o.reduce((e, t) => R(e, t.changes), e);
2601
+ return this.#o.reduce((e, t) => z(e, t.changes), e);
2486
2602
  }
2487
2603
  async settled() {
2488
2604
  await this.#s;
@@ -2496,13 +2612,13 @@ var Zn = class {
2496
2612
  return this.#s = t, t;
2497
2613
  }
2498
2614
  async change(e, t, n, r = !0) {
2499
- let i = this.#o.at(-1), a = i == null || i.started || !i.active ? void 0 : Xn(i.changes, n);
2615
+ let i = this.#o.at(-1), a = i == null || i.started || !i.active ? void 0 : Zn(i.changes, n);
2500
2616
  if (i != null && a != null) return i.changes = a, this.#a != null && this.#t.apply(this.project(this.#a)), i.result;
2501
2617
  this.#t.beforeChange(r);
2502
2618
  let o = {
2503
2619
  ...e,
2504
2620
  active: !0,
2505
- changeId: P(),
2621
+ changeId: R(),
2506
2622
  changes: n,
2507
2623
  started: !1
2508
2624
  };
@@ -2527,21 +2643,21 @@ var Zn = class {
2527
2643
  let r = this.#l(e, n, t);
2528
2644
  return this.#o.length == 0 && this.#t.check(), r;
2529
2645
  } catch (n) {
2530
- if (n instanceof U && n.code == "flow.revision-conflict") {
2646
+ if (n instanceof F && n.code == "flow.revision-conflict") {
2531
2647
  if (!t && await this.#t.recover(e)) {
2532
- t = !0, e.changeId = P();
2648
+ t = !0, e.changeId = R();
2533
2649
  continue;
2534
2650
  }
2535
2651
  t && await this.#t.recover(e), this.#u(e);
2536
2652
  } else {
2537
- if (!(n instanceof U) && !t) {
2653
+ if (!(n instanceof F) && !t) {
2538
2654
  let n = this.#a?.revisionId;
2539
2655
  if (await this.#t.recover(e)) {
2540
- t = !0, e.active && this.#a?.revisionId != n && (e.changeId = P());
2656
+ t = !0, e.active && this.#a?.revisionId != n && (e.changeId = R());
2541
2657
  continue;
2542
2658
  }
2543
2659
  }
2544
- this.#u(e), this.#t.current(e) && this.#r(B(n, this.#n.t));
2660
+ this.#u(e), this.#t.current(e) && this.#r(I(n, this.#n.t));
2545
2661
  }
2546
2662
  return;
2547
2663
  }
@@ -2550,14 +2666,14 @@ var Zn = class {
2550
2666
  #l(e, t, n) {
2551
2667
  let r = {
2552
2668
  ...n.revision,
2553
- content: R(t, e.changes).content
2669
+ content: z(t, e.changes).content
2554
2670
  };
2555
2671
  return this.#o = this.#o.filter((t) => t !== e), this.#a = r, this.#t.apply(this.project(r)), this.#t.headChanged(e.flowId, r.revisionId), r;
2556
2672
  }
2557
2673
  #u(e) {
2558
2674
  e.active = !1, this.#o = this.#o.filter((t) => t !== e), !(!this.#t.current(e) || this.#a == null) && this.#t.apply(this.project(this.#a));
2559
2675
  }
2560
- }, Qn = 50, $n = {
2676
+ }, $n = 50, er = {
2561
2677
  failed: !1,
2562
2678
  loaded: !1,
2563
2679
  loading: !0,
@@ -2565,12 +2681,12 @@ var Zn = class {
2565
2681
  loadMoreFailed: !1,
2566
2682
  refreshing: !1,
2567
2683
  flows: []
2568
- }, er = class {
2684
+ }, tr = class {
2569
2685
  #e;
2570
2686
  #t;
2571
- #n = new L();
2687
+ #n = new V();
2572
2688
  #r;
2573
- #i = n($n);
2689
+ #i = n(er);
2574
2690
  #a = new AbortController();
2575
2691
  #o = /* @__PURE__ */ new Set();
2576
2692
  #s = !1;
@@ -2617,7 +2733,7 @@ var Zn = class {
2617
2733
  try {
2618
2734
  let t = await this.#e.listFlows({
2619
2735
  includeTotal: !0,
2620
- limit: Qn
2736
+ limit: $n
2621
2737
  });
2622
2738
  if (!e()) return;
2623
2739
  this.#c({
@@ -2634,7 +2750,7 @@ var Zn = class {
2634
2750
  failed: !t,
2635
2751
  loading: !1,
2636
2752
  refreshing: !1
2637
- }), this.#r(B(n, this.#t.t));
2753
+ }), this.#r(I(n, this.#t.t));
2638
2754
  }
2639
2755
  }
2640
2756
  async loadMore() {
@@ -2648,7 +2764,7 @@ var Zn = class {
2648
2764
  try {
2649
2765
  let e = await this.#e.listFlows({
2650
2766
  cursor: t,
2651
- limit: Qn
2767
+ limit: $n
2652
2768
  });
2653
2769
  if (!r()) return;
2654
2770
  let n = new Set(this.#i.value.flows.map((e) => e.flowId));
@@ -2662,7 +2778,7 @@ var Zn = class {
2662
2778
  this.#c({
2663
2779
  loadingMore: !1,
2664
2780
  loadMoreFailed: !0
2665
- }), this.#r(B(e, this.#t.t));
2781
+ }), this.#r(I(e, this.#t.t));
2666
2782
  }
2667
2783
  }
2668
2784
  async setEnabled(e, t) {
@@ -2672,7 +2788,7 @@ var Zn = class {
2672
2788
  let n = await this.#e.setFlowEnabled(e.flowId, e.live.publicationId, t);
2673
2789
  this.#s || this.include(n);
2674
2790
  } catch (e) {
2675
- this.#s || (this.#r(B(e, this.#t.t)), await this.reload());
2791
+ this.#s || (this.#r(I(e, this.#t.t)), await this.reload());
2676
2792
  } finally {
2677
2793
  this.#o.delete(e.flowId);
2678
2794
  }
@@ -2698,7 +2814,7 @@ var Zn = class {
2698
2814
  message: this.#t.t("notice.published", { name: e.name })
2699
2815
  }), this.include(await this.#e.getFlow(e.flowId));
2700
2816
  } catch (e) {
2701
- this.#s || this.#r(B(e, this.#t.t));
2817
+ this.#s || this.#r(I(e, this.#t.t));
2702
2818
  } finally {
2703
2819
  this.#o.delete(e.flowId);
2704
2820
  }
@@ -2740,7 +2856,7 @@ var Zn = class {
2740
2856
  ...e
2741
2857
  });
2742
2858
  }
2743
- }, tr = class {
2859
+ }, nr = class {
2744
2860
  #e;
2745
2861
  #t;
2746
2862
  #n;
@@ -2788,7 +2904,7 @@ var Zn = class {
2788
2904
  this.#c(a, r), o = !0;
2789
2905
  } catch (r) {
2790
2906
  if (this.#o || !n()) return;
2791
- if (r instanceof U && r.code == "flow.presentation-conflict") try {
2907
+ if (r instanceof F && r.code == "flow.presentation-conflict") try {
2792
2908
  let t = await this.#e.getPresentation(e);
2793
2909
  if (this.#o || !n()) return;
2794
2910
  this.#c(a, t), this.#n({
@@ -2796,9 +2912,9 @@ var Zn = class {
2796
2912
  message: this.#t.t("notice.layoutConflict")
2797
2913
  });
2798
2914
  } catch (e) {
2799
- !this.#o && n() && this.#c(a, t), !this.#o && n() && this.#n(B(e, this.#t.t));
2915
+ !this.#o && n() && this.#c(a, t), !this.#o && n() && this.#n(I(e, this.#t.t));
2800
2916
  }
2801
- else this.#c(a, t), this.#n(B(r, this.#t.t));
2917
+ else this.#c(a, t), this.#n(I(r, this.#t.t));
2802
2918
  }
2803
2919
  }), await this.#i, o;
2804
2920
  }
@@ -2810,21 +2926,22 @@ var Zn = class {
2810
2926
  value: n
2811
2927
  });
2812
2928
  }
2813
- }, nr = {
2929
+ }, rr = {
2814
2930
  checkLoading: !1,
2815
2931
  selectedNodeIds: [],
2816
2932
  workspaceLoadFailed: !1,
2817
- workspaceLoading: !1
2933
+ workspaceLoading: !1,
2934
+ workspaceRepairing: !1
2818
2935
  };
2819
- function rr(e) {
2936
+ function ir(e) {
2820
2937
  return e.workspaceLoading ? "loading" : e.moduleSaveStatus == null ? e.busy == "designer" ? "saving" : e.draft == null ? "noDraft" : "saved" : e.moduleSaveStatus;
2821
2938
  }
2822
- function ir(e, t) {
2939
+ function ar(e, t) {
2823
2940
  if (t.phase != null) return t.phase;
2824
2941
  let n = e?.content.modules[t.moduleId];
2825
2942
  return n == null ? "failed" : t.source == n.source ? "saved" : "dirty";
2826
2943
  }
2827
- function ar(e, t, n) {
2944
+ function or(e, t, n) {
2828
2945
  if (e == null || t == null || n.length != 1) return;
2829
2946
  let r = e.node(t, n[0]);
2830
2947
  if (!(r?.kind != "task" || r.definition == null || !("moduleId" in r.definition) || r.module == null)) return {
@@ -2832,9 +2949,9 @@ function ar(e, t, n) {
2832
2949
  source: r.module.source
2833
2950
  };
2834
2951
  }
2835
- var or = class {
2952
+ var sr = class {
2836
2953
  #e;
2837
- #t = n(nr);
2954
+ #t = n(rr);
2838
2955
  #n;
2839
2956
  constructor(n, r) {
2840
2957
  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) => {
@@ -2842,25 +2959,25 @@ var or = class {
2842
2959
  let { phase: t, ...n } = e.moduleEditor;
2843
2960
  return {
2844
2961
  ...n,
2845
- status: ir(e.draft, e.moduleEditor)
2962
+ status: ar(e.draft, e.moduleEditor)
2846
2963
  };
2847
- }), 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 : z(e.draft)), h = e(this.#t, (e) => e.selectedNodeIds), g = e(this.#t, (e) => e.target), _ = e(this.#t, (e) => e.workspaceLoadFailed), v = e(this.#t, (e) => e.workspaceLoading);
2964
+ }), 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 : B(e.draft)), h = e(this.#t, (e) => e.selectedNodeIds), g = e(this.#t, (e) => e.target), _ = e(this.#t, (e) => e.workspaceLoadFailed), v = e(this.#t, (e) => e.workspaceLoadProblem), y = e(this.#t, (e) => e.workspaceLoading), b = e(this.#t, (e) => e.workspaceRepairing);
2848
2965
  this.#e = e(this.#t, (e) => ({
2849
- revision: e.draft == null ? void 0 : z(e.draft),
2966
+ revision: e.draft == null ? void 0 : B(e.draft),
2850
2967
  target: e.target
2851
2968
  }), { equal: (e, t) => e.revision === t.revision && e.target === t.target });
2852
- let y = e(this.#t, (e) => {
2853
- if (e.draft != null && e.target != null && e.selectedNodeIds.length == 1) return z(e.draft).selection(e.target, e.selectedNodeIds[0]);
2969
+ let x = e(this.#t, (e) => {
2970
+ if (e.draft != null && e.target != null && e.selectedNodeIds.length == 1) return B(e.draft).selection(e.target, e.selectedNodeIds[0]);
2854
2971
  });
2855
2972
  this.$ = {
2856
2973
  addNodeOptions: t((e) => {
2857
2974
  let { revision: t, target: r } = e(this.#e);
2858
- return Ye(t?.revision, r, e(n.t$));
2975
+ return Je(t?.revision, r, e(n.t$));
2859
2976
  }),
2860
2977
  busy: i,
2861
2978
  checkLoading: a,
2862
2979
  diagnosticFocus: o,
2863
- diagnosticItems: e(this.#t, (e) => Se(e.draft == null ? void 0 : z(e.draft), e.target, e.diagnostics)),
2980
+ diagnosticItems: e(this.#t, (e) => we(e.draft == null ? void 0 : B(e.draft), e.target, e.diagnostics)),
2864
2981
  diagnostics: s,
2865
2982
  draft: c,
2866
2983
  flow: t((e) => {
@@ -2876,22 +2993,24 @@ var or = class {
2876
2993
  flowRefreshing: r.$.refreshing,
2877
2994
  flowTotal: r.$.total,
2878
2995
  flows: r.$.flows,
2879
- inspectorDiagnostics: e(this.#t, (e) => Ke(e.draft == null ? void 0 : z(e.draft), e.target, e.diagnostics, y.value)),
2996
+ inspectorDiagnostics: e(this.#t, (e) => be(e.draft == null ? void 0 : B(e.draft), e.target, e.diagnostics, x.value)),
2880
2997
  live: p,
2881
2998
  moduleEditor: l,
2882
2999
  nodeFocus: u,
2883
3000
  presentation: d,
2884
3001
  revision: m,
2885
- selection: y,
3002
+ selection: x,
2886
3003
  selectedNodeIds: h,
2887
- status: e(this.#t, rr),
3004
+ status: e(this.#t, ir),
2888
3005
  target: g,
2889
3006
  targetFlow: t((e) => e(g)?.kind == "flow" ? e(r.$.flows).find((t) => t.flowId == e(f)) : void 0),
2890
3007
  targetName: e(this.#t, (e) => {
2891
- if (e.target != null) return e.target.kind == "flow" ? r.flow(e.flowId ?? "")?.name : e.draft == null ? e.target.id : z(e.draft).subflow(e.target.id)?.name ?? e.target.id;
3008
+ if (e.target != null) return e.target.kind == "flow" ? r.flow(e.flowId ?? "")?.name : e.draft == null ? e.target.id : B(e.draft).subflow(e.target.id)?.name ?? e.target.id;
2892
3009
  }),
2893
3010
  workspaceLoadFailed: _,
2894
- workspaceLoading: v
3011
+ workspaceLoadProblem: v,
3012
+ workspaceLoading: y,
3013
+ workspaceRepairing: b
2895
3014
  }, this.#n = new Set(Object.values(r.$));
2896
3015
  }
2897
3016
  get value() {
@@ -2907,14 +3026,14 @@ var or = class {
2907
3026
  for (let e of Object.values(this.$)) this.#n.has(e) || e.dispose();
2908
3027
  this.#e.dispose(), this.#t.dispose();
2909
3028
  }
2910
- }, sr = {
3029
+ }, cr = {
2911
3030
  x: 40,
2912
3031
  y: 40
2913
3032
  };
2914
- function cr(e, t) {
3033
+ function lr(e, t) {
2915
3034
  if (t != null) return t.kind == "flow" || e.subflow(t.id) != null ? t : { kind: "flow" };
2916
3035
  }
2917
- var lr = class {
3036
+ var ur = class {
2918
3037
  #e;
2919
3038
  #t;
2920
3039
  #n;
@@ -2938,30 +3057,34 @@ var lr = class {
2938
3057
  #b;
2939
3058
  #x;
2940
3059
  #S;
2941
- constructor(e, t, n = Jt, r = p(), i = () => {}, a = new Mn(e)) {
2942
- this.catalogs = a, this.#n = new L(), this.#u = /* @__PURE__ */ new Map(), this.#d = new Yn(), this.history$ = this.#d.state$, this.#h = 0, this.#g = 0, this.#_ = !1, this.#v = !1, this.#y = !1, this.#b = 0, this.#e = e, this.#c = t, this.#i = n, this.#r = r, this.#s = i, this.#o = new er(e, t, r), this.#l = new or(r, this.#o), this.#t = new Zn(e, t, r, {
2943
- apply: (e) => this.#O(e, "local"),
3060
+ #C;
3061
+ #w;
3062
+ constructor(e, t, n = Jt, r = d(), i = () => {}, a = new Nn(e), o = () => {}) {
3063
+ this.catalogs = a, this.flowCreated = o, this.#n = new V(), this.#u = /* @__PURE__ */ new Map(), this.#d = new Xn(), this.history$ = this.#d.state$, this.#h = 0, this.#g = 0, this.#_ = !1, this.#v = !1, this.#y = !1, this.#b = !1, this.#x = 0, this.#e = e, this.#c = t, this.#i = n, this.#r = r, this.#s = i, this.#o = new tr(e, t, r), this.#l = new sr(r, this.#o), this.#t = new Qn(e, t, r, {
3064
+ apply: (e) => this.#j(e, "local"),
2944
3065
  beforeChange: (e) => {
2945
- e && this.#V({ busy: "designer" });
3066
+ e && this.#W({ busy: "designer" });
2946
3067
  },
2947
- check: () => void this.#N(),
2948
- current: (e) => this.#R(e),
3068
+ check: () => void this.#I(),
3069
+ current: (e) => this.#V(e),
2949
3070
  finishChanges: () => {
2950
- !this.#v && this.#l.value.busy == "designer" && this.#V({ busy: void 0 });
3071
+ !this.#v && this.#l.value.busy == "designer" && this.#W({ busy: void 0 });
2951
3072
  },
2952
3073
  headChanged: (e, t) => this.#o.advanceHead(e, t),
2953
- recover: (e) => (this.retryHistorySync(), this.#F(e, !0))
2954
- }), this.#a = new tr(e, t, (e) => this.#V({ presentation: e }), r), this.$ = this.#l.$;
3074
+ recover: (e) => (this.retryHistorySync(), this.#R(e, !0))
3075
+ }), this.#a = new nr(e, t, (e) => this.#W({ presentation: e }), r), this.$ = this.#l.$;
2955
3076
  }
2956
3077
  dispose() {
2957
- this.catalogs.dispose(), this.#v = !0, this.#n.invalidate(), this.#a.dispose(), this.#x?.(), this.#S?.(), this.history$.dispose(), this.#l.dispose(), this.#o.dispose();
3078
+ this.catalogs.dispose(), this.#v = !0, this.#n.invalidate(), this.#a.dispose(), this.#C?.(), this.#w?.(), this.history$.dispose(), this.#l.dispose(), this.#o.dispose();
2958
3079
  }
2959
3080
  async start(e) {
2960
- if (this.#x == null) {
2961
- let e = this.#e.watchFlowCatalog(() => void this.reloadFlows());
2962
- this.#x = e.stop, await e.ready;
3081
+ if (this.#y = !1, this.#C == null) {
3082
+ let e = this.#e.watchFlowCatalog((e) => {
3083
+ this.#v || (this.reloadFlows(), e?.kind == "flow.created" && this.#y && this.#l.value.flowId == null && this.#l.value.busy == null && this.flowCreated(e.flowId));
3084
+ });
3085
+ this.#C = e.stop, await e.ready;
2963
3086
  }
2964
- this.#v || (await this.reloadFlows(), this.#v || await this.selectFlow(e));
3087
+ this.#v || (await this.reloadFlows(), this.#v || await this.selectFlow(e), this.#y = !this.#v);
2965
3088
  }
2966
3089
  async reloadFlows() {
2967
3090
  await this.#o.reload();
@@ -2977,9 +3100,9 @@ var lr = class {
2977
3100
  }
2978
3101
  async selectFlow(e) {
2979
3102
  if (this.#d.applying || !await this.saveModuleEditor() || this.#v) return !1;
2980
- this.#d.clear(), this.#d.failed = !1, this.#d.publish();
3103
+ this.#d.clear(), this.#S = void 0, this.#d.failed = !1, this.#d.publish();
2981
3104
  let t = this.#n.begin();
2982
- if (this.#t.reset(), this.#a.reset(), this.#g = 0, this.#_ = !1, this.#y = !1, this.#S?.(), this.#S = void 0, this.#V({
3105
+ if (this.#t.reset(), this.#a.reset(), this.#g = 0, this.#_ = !1, this.#b = !1, this.#w?.(), this.#w = void 0, this.#W({
2983
3106
  checkLoading: !1,
2984
3107
  diagnosticFocus: void 0,
2985
3108
  diagnostics: void 0,
@@ -2992,73 +3115,100 @@ var lr = class {
2992
3115
  selectedNodeIds: [],
2993
3116
  target: e == null ? void 0 : { kind: "flow" },
2994
3117
  workspaceLoadFailed: !1,
2995
- workspaceLoading: e != null
3118
+ workspaceLoadProblem: void 0,
3119
+ workspaceLoading: e != null,
3120
+ workspaceRepairing: !1
2996
3121
  }), e == null) return !0;
2997
3122
  try {
2998
3123
  let n = !1, r, i = this.#e.watchFlow(e, (e) => {
2999
- t() && (this.#t.committed == null ? (n = !0, r = e) : e != this.#t.committed.revisionId && this.#P(e));
3124
+ t() && (this.#t.committed == null ? (n = !0, r = e) : e != this.#t.committed.revisionId && this.#L(e));
3000
3125
  }, (e) => {
3001
3126
  t() && this.#s(e);
3002
3127
  });
3003
- if (this.#S = i.stop, await i.ready, !t()) return !1;
3128
+ if (this.#w = i.stop, await i.ready, !t()) return !1;
3004
3129
  let { flow: a, draft: o, live: s, presentation: c } = await this.#e.getEditor(e);
3005
3130
  if (!t()) return !1;
3006
- this.#t.reset(o), this.#a.reset(c), this.#o.include(a), this.#V({
3131
+ this.#t.reset(o), this.#a.reset(c), this.#o.include(a), this.#W({
3007
3132
  draft: o,
3008
3133
  live: s,
3009
3134
  presentation: c,
3010
3135
  target: { kind: "flow" },
3011
3136
  workspaceLoadFailed: !1,
3137
+ workspaceLoadProblem: void 0,
3012
3138
  workspaceLoading: !1
3013
- }), await this.#D(t), n && r != o.revisionId && this.#P(r);
3139
+ }), await this.#A(t), n && r != o.revisionId && this.#L(r);
3014
3140
  } catch (e) {
3015
3141
  if (!t()) return !1;
3016
- this.#S?.(), this.#S = void 0;
3017
- let n = e instanceof U && e.code == ve.flowNotFound;
3018
- return this.#V(n ? {
3019
- flowId: void 0,
3020
- target: void 0,
3021
- workspaceLoadFailed: !1,
3022
- workspaceLoading: !1
3023
- } : {
3142
+ this.#w?.(), this.#w = void 0;
3143
+ let n = e instanceof F && e.code == Ze.flowUpgradeRequired ? "upgrade" : e instanceof F && e.code == Ze.flowRepairRequired ? "repair" : "failed";
3144
+ return this.#W({
3024
3145
  workspaceLoadFailed: !0,
3146
+ workspaceLoadProblem: {
3147
+ kind: n,
3148
+ ...n == "failed" ? { message: I(e, this.#r.t).message } : {}
3149
+ },
3025
3150
  workspaceLoading: !1
3026
- }), this.#c(n ? {
3027
- kind: "error",
3028
- message: this.#r.t("notice.flowMissing")
3029
- } : B(e, this.#r.t)), !1;
3151
+ }), !1;
3030
3152
  }
3031
3153
  return !0;
3032
3154
  }
3155
+ async repairWorkspace() {
3156
+ let e = this.#l.value.flowId, t = e == null ? void 0 : this.#o.flow(e);
3157
+ if (e == null || t == null || this.#l.value.workspaceRepairing) return;
3158
+ let n = this.#S ??= {
3159
+ changeId: this.#i(),
3160
+ expectedRevisionId: t.draftRevisionId
3161
+ };
3162
+ this.#W({
3163
+ workspaceRepairing: !0,
3164
+ workspaceLoadProblem: this.#l.value.workspaceLoadProblem
3165
+ });
3166
+ try {
3167
+ await this.#e.repairDraft(e, n.expectedRevisionId, n.changeId), this.#S = void 0, await this.selectFlow(e);
3168
+ } catch (t) {
3169
+ if (this.#v) return;
3170
+ if (t instanceof F && t.code == Ze.flowRevisionConflict) {
3171
+ this.#S = void 0, await this.selectFlow(e);
3172
+ return;
3173
+ }
3174
+ this.#W({
3175
+ workspaceLoadProblem: {
3176
+ kind: this.#l.value.workspaceLoadProblem?.kind == "upgrade" ? "upgrade" : "repair",
3177
+ message: I(t, this.#r.t).message
3178
+ },
3179
+ workspaceRepairing: !1
3180
+ });
3181
+ }
3182
+ }
3033
3183
  selectTarget(e) {
3034
- return !this.#d.applying && (u(e, this.#l.value.target) || this.#d.clear(), this.#C(), this.#V({
3184
+ return !this.#d.applying && (u(e, this.#l.value.target) || this.#d.clear(), this.#T(), this.#W({
3035
3185
  diagnosticFocus: void 0,
3036
3186
  diagnostics: void 0,
3037
3187
  moduleEditor: void 0,
3038
3188
  nodeFocus: void 0,
3039
3189
  selectedNodeIds: [],
3040
3190
  target: e
3041
- }), this.#N(), !0);
3191
+ }), this.#I(), !0);
3042
3192
  }
3043
3193
  selectNodes(e) {
3044
- return e.length == this.#l.value.selectedNodeIds.length && e.every((e, t) => e == this.#l.value.selectedNodeIds[t]) ? !0 : (this.#C(), this.#V({
3194
+ return e.length == this.#l.value.selectedNodeIds.length && e.every((e, t) => e == this.#l.value.selectedNodeIds[t]) ? !0 : (this.#T(), this.#W({
3045
3195
  diagnosticFocus: void 0,
3046
- moduleEditor: ar(this.#l.value.draft == null ? void 0 : z(this.#l.value.draft), this.#l.value.target, e),
3196
+ moduleEditor: or(this.#l.value.draft == null ? void 0 : B(this.#l.value.draft), this.#l.value.target, e),
3047
3197
  nodeFocus: void 0,
3048
3198
  selectedNodeIds: e
3049
3199
  }), !0);
3050
3200
  }
3051
3201
  async createFlow(e, t) {
3052
3202
  if (await this.saveModuleEditor()) {
3053
- this.#V({ busy: "flow" });
3203
+ this.#W({ busy: "flow" });
3054
3204
  try {
3055
3205
  if (t == null) return await this.#o.create(e);
3056
3206
  let n = await this.#e.getFlow(await t(e));
3057
3207
  return this.#o.insert(n), n;
3058
3208
  } catch (e) {
3059
- this.#v || this.#c(B(e, this.#r.t));
3209
+ this.#v || this.#c(I(e, this.#r.t));
3060
3210
  } finally {
3061
- this.#V({ busy: void 0 });
3211
+ this.#W({ busy: void 0 });
3062
3212
  }
3063
3213
  }
3064
3214
  }
@@ -3066,24 +3216,24 @@ var lr = class {
3066
3216
  if (!await this.saveModuleEditor()) return !1;
3067
3217
  let t = this.#o.flow(e);
3068
3218
  if (t == null || t.status == "retiring") return !1;
3069
- this.#V({ busy: "flow" });
3219
+ this.#W({ busy: "flow" });
3070
3220
  try {
3071
3221
  return await this.#e.deleteFlow(e), !this.#v && (this.#o.remove(e), this.#c({
3072
3222
  kind: "success",
3073
3223
  message: this.#r.t("notice.flowDeleteAccepted", { name: t.name })
3074
3224
  }), !0);
3075
3225
  } catch (e) {
3076
- return this.#v || this.#c(B(e, this.#r.t)), !1;
3226
+ return this.#v || this.#c(I(e, this.#r.t)), !1;
3077
3227
  } finally {
3078
- this.#V({ busy: void 0 });
3228
+ this.#W({ busy: void 0 });
3079
3229
  }
3080
3230
  }
3081
3231
  async createResource(e) {
3082
3232
  if (!await this.saveModuleEditor() || this.#l.value.draft == null) return !1;
3083
3233
  let t = this.#i();
3084
- this.#V({ busy: "resource" });
3085
- let n = await this.#E(Le(t, e), !1);
3086
- return this.#V({ busy: void 0 }), n != null && (this.selectTarget({
3234
+ this.#W({ busy: "resource" });
3235
+ let n = await this.#k(Le(t, e), !1);
3236
+ return this.#W({ busy: void 0 }), n != null && (this.selectTarget({
3087
3237
  id: t,
3088
3238
  kind: "subflow"
3089
3239
  }), this.#c({
@@ -3095,14 +3245,14 @@ var lr = class {
3095
3245
  let n = this.#o.flow(e), r = t.trim();
3096
3246
  if (n == null || r.length == 0) return !1;
3097
3247
  if (n.name == r) return !0;
3098
- this.#V({ busy: "flow" });
3248
+ this.#W({ busy: "flow" });
3099
3249
  let i;
3100
3250
  try {
3101
3251
  i = await this.#e.renameFlow(e, r), i != null && this.#o.include(i);
3102
3252
  } catch (e) {
3103
- this.#v || this.#c(B(e, this.#r.t));
3253
+ this.#v || this.#c(I(e, this.#r.t));
3104
3254
  }
3105
- return this.#V({ busy: void 0 }), i != null && (this.#c({
3255
+ return this.#W({ busy: void 0 }), i != null && (this.#c({
3106
3256
  kind: "success",
3107
3257
  message: this.#r.t("notice.flowRenamed", { name: r })
3108
3258
  }), !0);
@@ -3112,31 +3262,31 @@ var lr = class {
3112
3262
  let r = this.#l.value.draft, i = this.#l.value.target;
3113
3263
  if (r == null || i == null) return;
3114
3264
  let a = this.#i();
3115
- if (e.kind == "comment") return await this.#T(i, a, t);
3116
- let o = z(r), s = v(e, o, i, this.#r.t);
3265
+ if (e.kind == "comment") return await this.#D(i, a, t);
3266
+ let o = B(r), s = v(e, o, i, this.#r.t);
3117
3267
  if (s == null) return;
3118
3268
  if (s.kind == "provider-trigger" && s.connectionId == null && s.definition.key != "feishu_app_bot.on_event") {
3119
3269
  try {
3120
- let e = await w(this.catalogs.connections.get(s.definition.provider, r.flowId));
3270
+ let e = await j(this.catalogs.connections.get(s.definition.provider, r.flowId));
3121
3271
  s = {
3122
3272
  ...s,
3123
- connectionId: et(e).preferred?.connectionId
3273
+ connectionId: M(e).preferred?.connectionId
3124
3274
  };
3125
3275
  } catch (e) {
3126
- !this.#v && this.#l.value.draft == r && this.#c(B(e, this.#r.t));
3276
+ !this.#v && this.#l.value.draft == r && this.#c(I(e, this.#r.t));
3127
3277
  }
3128
3278
  if (this.#v || this.#l.value.draft != r || this.#l.value.target != i) return;
3129
3279
  }
3130
3280
  let c = n?.(a), l = Ue(o, i, a, s, this.#i);
3131
3281
  if (l == null) return;
3132
- let u = c == null ? l : [...l, ...Ut(R(r, l).content, i, {
3282
+ let u = c == null ? l : [...l, ...Ut(z(r, l).content, i, {
3133
3283
  source: c.source,
3134
3284
  target: c.target,
3135
3285
  ...c.sourceHandle.startsWith("$branch:") ? { sourceHandle: c.sourceHandle.slice(8) } : {}
3136
3286
  })];
3137
- if (await this.#j("add", 1, u, (e) => Be(e, i, { [a]: t }), [a]) && !this.#v) return this.#V({ nodeFocus: {
3287
+ if (await this.#P("add", 1, u, (e) => te(e, i, { [a]: t }), [a]) && !this.#v) return this.#W({ nodeFocus: {
3138
3288
  nodeId: a,
3139
- requestId: ++this.#b
3289
+ requestId: ++this.#x
3140
3290
  } }), a;
3141
3291
  }
3142
3292
  async connect(e) {
@@ -3147,7 +3297,7 @@ var lr = class {
3147
3297
  target: e.target,
3148
3298
  ...e.sourceHandle.startsWith("$branch:") ? { sourceHandle: e.sourceHandle.slice(8) } : {}
3149
3299
  });
3150
- r.length > 0 && await this.#j("connect", 1, r);
3300
+ r.length > 0 && await this.#P("connect", 1, r);
3151
3301
  }
3152
3302
  async disconnect(e) {
3153
3303
  let t = this.$.revision.value, n = this.#l.value.target;
@@ -3157,16 +3307,16 @@ var lr = class {
3157
3307
  target: e.target,
3158
3308
  ...e.sourceHandle.startsWith("$branch:") ? { sourceHandle: e.sourceHandle.slice(8) } : {}
3159
3309
  });
3160
- r.length > 0 && await this.#j("disconnect", 1, r);
3310
+ r.length > 0 && await this.#P("disconnect", 1, r);
3161
3311
  }
3162
3312
  async deleteSelectedNodes() {
3163
3313
  if (!await this.saveModuleEditor()) return;
3164
3314
  let e = this.$.revision.value, t = this.#l.value.target;
3165
3315
  if (e == null || t == null || this.#l.value.selectedNodeIds.length == 0) return;
3166
- let n = [...this.#l.value.selectedNodeIds], r = se(this.#l.value.presentation?.value ?? {}, t), i = new Set(this.#l.value.selectedNodeIds.filter((e) => r.has(e))), a = Ve(e, t, this.#l.value.selectedNodeIds);
3167
- await this.#j("delete", this.#l.value.selectedNodeIds.length, a, (e) => {
3168
- let r = i.size == 0 ? e : T(e, t, i);
3169
- for (let e of n) r = D(r, t, e, !1);
3316
+ let n = [...this.#l.value.selectedNodeIds], r = k(this.#l.value.presentation?.value ?? {}, t), i = new Set(this.#l.value.selectedNodeIds.filter((e) => r.has(e))), a = He(e, t, this.#l.value.selectedNodeIds);
3317
+ await this.#P("delete", this.#l.value.selectedNodeIds.length, a, (e) => {
3318
+ let r = i.size == 0 ? e : ce(e, t, i);
3319
+ for (let e of n) r = T(r, t, e, !1);
3170
3320
  return r;
3171
3321
  }, []);
3172
3322
  }
@@ -3175,26 +3325,26 @@ var lr = class {
3175
3325
  if (e == null || t == null || this.#l.value.selectedNodeIds.length == 0) return;
3176
3326
  let n = new Set(this.#l.value.selectedNodeIds);
3177
3327
  this.#m = {
3178
- hiddenNodeIds: this.#I().nodes.flatMap((e) => e.contentHidden && n.has(e.id) ? [e.id] : []),
3179
- comments: this.#I().nodes.flatMap((e) => e.kind == "comment" && n.has(e.id) ? [{
3328
+ hiddenNodeIds: this.#z().nodes.flatMap((e) => e.contentHidden && n.has(e.id) ? [e.id] : []),
3329
+ comments: this.#z().nodes.flatMap((e) => e.kind == "comment" && n.has(e.id) ? [{
3180
3330
  content: e.content,
3181
3331
  position: e.position,
3182
3332
  sourceId: e.id,
3183
3333
  title: e.title
3184
3334
  }] : []),
3185
- nodes: he(e, t, this.#l.value.selectedNodeIds)
3335
+ nodes: me(e, t, this.#l.value.selectedNodeIds)
3186
3336
  };
3187
3337
  }
3188
- async pasteNodes(e, t = sr) {
3338
+ async pasteNodes(e, t = cr) {
3189
3339
  if (!await this.saveModuleEditor()) return;
3190
3340
  let n = this.$.revision.value, r = this.#l.value.target;
3191
3341
  if (n == null || r == null || this.#m == null) return;
3192
- let i = new Set(this.#m.hiddenNodeIds), a = ye(n, r, this.#m.nodes, this.#i), o = this.#m.comments.map((e) => ({
3342
+ let i = new Set(this.#m.hiddenNodeIds), a = ve(n, r, this.#m.nodes, this.#i), o = this.#m.comments.map((e) => ({
3193
3343
  ...e,
3194
3344
  nodeId: this.#i()
3195
3345
  }));
3196
3346
  if (a.nodeIds.length == 0 && o.length == 0) return;
3197
- let s = new Map(this.#I().nodes.map((e) => [e.id, e])), c = /* @__PURE__ */ new Set([...a.nodeIds, ...o.map((e) => e.nodeId)]), l = new Set([...s].filter(([e]) => !c.has(e)).map(([, e]) => `${e.position.x}\0${e.position.y}`)), u = [...a.sourceIds.map((t) => e?.[t] ?? s.get(t)?.position ?? {
3347
+ let s = new Map(this.#z().nodes.map((e) => [e.id, e])), c = /* @__PURE__ */ new Set([...a.nodeIds, ...o.map((e) => e.nodeId)]), l = new Set([...s].filter(([e]) => !c.has(e)).map(([, e]) => `${e.position.x}\0${e.position.y}`)), u = [...a.sourceIds.map((t) => e?.[t] ?? s.get(t)?.position ?? {
3198
3348
  x: 80,
3199
3349
  y: 80
3200
3350
  }), ...o.map((e) => e.position)], d = 1;
@@ -3206,10 +3356,10 @@ var lr = class {
3206
3356
  y: (i?.y ?? 80) + t.y * d
3207
3357
  }];
3208
3358
  }));
3209
- await this.#j("paste", c.size, a.changes, (e) => {
3210
- let n = Be(e, r, f);
3211
- for (let [e, t] of a.sourceIds.entries()) i.has(t) && (n = D(n, r, a.nodeIds[e], !0));
3212
- for (let e of o) i.has(e.sourceId) && (n = D(n, r, e.nodeId, !0)), n = j(n, r, e.nodeId, {
3359
+ await this.#P("paste", c.size, a.changes, (e) => {
3360
+ let n = te(e, r, f);
3361
+ for (let [e, t] of a.sourceIds.entries()) i.has(t) && (n = T(n, r, a.nodeIds[e], !0));
3362
+ for (let e of o) i.has(e.sourceId) && (n = T(n, r, e.nodeId, !0)), n = P(n, r, e.nodeId, {
3213
3363
  content: e.content,
3214
3364
  position: {
3215
3365
  x: e.position.x + t.x * d,
@@ -3227,35 +3377,35 @@ var lr = class {
3227
3377
  let n = this.$.revision.value, r = this.#l.value.target;
3228
3378
  if (n == null || r == null) return !1;
3229
3379
  let i = De(n, r, e, t);
3230
- return i != null && await this.#E(i) != null;
3380
+ return i != null && await this.#O(i) != null;
3231
3381
  }
3232
3382
  async saveNodeDescription(e, t) {
3233
3383
  let n = this.$.revision.value, r = this.#l.value.target;
3234
3384
  if (n == null || r == null) return !1;
3235
- let i = Ce(n, r, e, t);
3236
- return i != null && await this.#E(i) != null;
3385
+ let i = Se(n, r, e, t);
3386
+ return i != null && await this.#O(i) != null;
3237
3387
  }
3238
3388
  async saveNodeIcon(e, t) {
3239
3389
  let n = this.$.revision.value, r = this.#l.value.target;
3240
3390
  if (n == null || r == null) return !1;
3241
- let i = Re(n, r, e, t);
3242
- return i != null && await this.#E(i) != null;
3391
+ let i = Be(n, r, e, t);
3392
+ return i != null && await this.#O(i) != null;
3243
3393
  }
3244
3394
  async saveNodeTitle(e, t) {
3245
3395
  let n = this.$.revision.value, r = this.#l.value.target;
3246
3396
  if (n == null || r == null) return !1;
3247
3397
  let i = Fe(n, r, e, t);
3248
- return i != null && await this.#E(i) != null;
3398
+ return i != null && await this.#O(i) != null;
3249
3399
  }
3250
3400
  async setInputValue(e, t, n) {
3251
3401
  let r = this.$.revision.value, i = this.#l.value.target;
3252
3402
  if (r == null || i == null) return !1;
3253
- let a = Pe(r, i, e, t, n);
3254
- return a != null && await this.#E(a) != null;
3403
+ let a = Ne(r, i, e, t, n);
3404
+ return a != null && await this.#O(a) != null;
3255
3405
  }
3256
3406
  async setInputSource(e, t, n) {
3257
3407
  let r = this.$.revision.value, i = this.#l.value.target;
3258
- return r == null || i == null ? !1 : await this.#E(Je(r.revision.content, i, e, t, [{
3408
+ return r == null || i == null ? !1 : await this.#O($e(r.revision.content, i, e, t, [{
3259
3409
  kind: "node",
3260
3410
  ...n
3261
3411
  }])) != null;
@@ -3263,36 +3413,36 @@ var lr = class {
3263
3413
  async setInputVariable(e, t, n) {
3264
3414
  let r = this.$.revision.value, i = this.#l.value.target;
3265
3415
  if (r == null || i == null) return !1;
3266
- let a = n == null ? Pe(r, i, e, t, void 0) : Ge(r, i, e, t, n, this.#i());
3267
- return a != null && await this.#E(a) != null;
3416
+ let a = n == null ? Ne(r, i, e, t, void 0) : We(r, i, e, t, n, this.#i());
3417
+ return a != null && await this.#O(a) != null;
3268
3418
  }
3269
3419
  async saveCondition(e, t) {
3270
3420
  let n = this.$.revision.value, r = this.#l.value.target;
3271
3421
  if (n == null || r == null) return !1;
3272
- let i = be(n, r, e, t);
3273
- return i != null && await this.#E(i) != null;
3422
+ let i = ye(n, r, e, t);
3423
+ return i != null && await this.#O(i) != null;
3274
3424
  }
3275
3425
  async saveValue(e, t) {
3276
3426
  let n = this.$.revision.value, r = this.#l.value.target;
3277
3427
  if (n == null || r == null) return !1;
3278
- let i = _e(n, r, e, t);
3279
- return i != null && await this.#E(i) != null;
3428
+ let i = Xe(n, r, e, t);
3429
+ return i != null && await this.#O(i) != null;
3280
3430
  }
3281
- async saveWait(e, t) {
3431
+ async saveResolution(e, t) {
3282
3432
  let n = this.$.revision.value, r = this.#l.value.target;
3283
3433
  if (n == null || r?.kind != "flow") return !1;
3284
- let i = Xe(n, r, e, t);
3285
- return i != null && await this.#E(i) != null;
3434
+ let i = Te(n, r, e, t);
3435
+ return i != null && await this.#O(i) != null;
3286
3436
  }
3287
3437
  async saveNodeContentHidden(e, t) {
3288
- let n = this.#l.value.target, r = this.#I().nodes.find((t) => t.id == e);
3289
- n != null && r != null && r.kind != "condition" && await this.#k((r) => D(r, n, e, t));
3438
+ let n = this.#l.value.target, r = this.#z().nodes.find((t) => t.id == e);
3439
+ n != null && r != null && r.kind != "condition" && await this.#P("edit", 1, [], (r) => T(r, n, e, t));
3290
3440
  }
3291
3441
  async saveComment(e, t) {
3292
3442
  let n = this.#l.value.target;
3293
3443
  if (n == null) return;
3294
- let r = this.#I().nodes.find((t) => t.id == e)?.position;
3295
- r != null && await this.#k((i) => j(i, n, e, {
3444
+ let r = this.#z().nodes.find((t) => t.id == e)?.position;
3445
+ r != null && await this.#P("edit", 1, [], (i) => P(i, n, e, {
3296
3446
  ...t,
3297
3447
  position: r
3298
3448
  }));
@@ -3300,32 +3450,32 @@ var lr = class {
3300
3450
  async saveTaskSettings(e, t) {
3301
3451
  let n = this.$.revision.value, r = this.#l.value.target;
3302
3452
  if (n == null || r == null) return !1;
3303
- let i = fe(n, r, e, t);
3304
- return i != null && await this.#E(i) != null;
3453
+ let i = Ge(n, r, e, t);
3454
+ return i != null && await this.#O(i) != null;
3305
3455
  }
3306
3456
  async saveCodeActions(e, t) {
3307
3457
  let n = this.$.revision.value, r = this.#l.value.target;
3308
3458
  if (n == null || r == null) return !1;
3309
- let i = Ee(n.revision.content, r, e, t);
3310
- return i == null || await this.#E(i) != null;
3459
+ let i = pe(n.revision.content, r, e, t);
3460
+ return i == null || await this.#O(i) != null;
3311
3461
  }
3312
3462
  async saveTaskPorts(e, t) {
3313
3463
  let n = this.$.revision.value, r = this.#l.value.target;
3314
3464
  if (n == null || r == null) return !1;
3315
- let i = Qe(n, r, e, t);
3316
- return i != null && await this.#E(i) != null;
3465
+ let i = ge(n, r, e, t);
3466
+ return i != null && await this.#O(i) != null;
3317
3467
  }
3318
3468
  async saveTaskAdditionalInputs(e, t) {
3319
3469
  let n = this.$.revision.value, r = this.#l.value.target;
3320
3470
  if (n == null || r == null) return !1;
3321
- let i = qe(n, r, e, t);
3322
- return i != null && await this.#E(i) != null;
3471
+ let i = Qe(n, r, e, t);
3472
+ return i != null && await this.#O(i) != null;
3323
3473
  }
3324
3474
  async setConnectorConnection(e, t) {
3325
3475
  let n = this.$.revision.value;
3326
3476
  if (n == null) return !1;
3327
- let r = me(n.revision.content, e, t);
3328
- return r != null && await this.#E(r) != null;
3477
+ let r = qe(n.revision.content, e, t);
3478
+ return r != null && await this.#O(r) != null;
3329
3479
  }
3330
3480
  get eventSourceClient() {
3331
3481
  return this.#e;
@@ -3340,15 +3490,15 @@ var lr = class {
3340
3490
  if (n == null || r?.kind != "flow") return !1;
3341
3491
  let i = n.graph(r)?.nodes[e];
3342
3492
  if (i?.kind != "integration" || i.definition.key != "feishu_app_bot.on_event" || t.provider != i.definition.provider) return !1;
3343
- let a = $e(n.revision.content, r, e, t.connectionId);
3493
+ let a = _e(n.revision.content, r, e, t.connectionId);
3344
3494
  if (a == null) return !1;
3345
3495
  let o = i.config.sourceId != t.sourceId;
3346
- return await this.#E([
3496
+ return await this.#O([
3347
3497
  ...a,
3348
- ...N(n.revision.content, r, e, "sourceId", t.sourceId) ?? [],
3349
- ...o ? N(n.revision.content, r, e, "eventTypes", []) ?? [] : [],
3350
- ...o ? N(n.revision.content, r, e, "resource", void 0) ?? [] : [],
3351
- ...o ? N(n.revision.content, r, e, "chatIds", void 0) ?? [] : []
3498
+ ...H(n.revision.content, r, e, "sourceId", t.sourceId) ?? [],
3499
+ ...o ? H(n.revision.content, r, e, "eventTypes", []) ?? [] : [],
3500
+ ...o ? H(n.revision.content, r, e, "resource", void 0) ?? [] : [],
3501
+ ...o ? H(n.revision.content, r, e, "chatIds", void 0) ?? [] : []
3352
3502
  ]) != null;
3353
3503
  }
3354
3504
  async loadTriggerConfigOptions(e, t, n) {
@@ -3359,45 +3509,45 @@ var lr = class {
3359
3509
  async saveTriggerConfig(e, t, n) {
3360
3510
  let r = this.$.revision.value, i = this.#l.value.target;
3361
3511
  if (r == null || i?.kind != "flow") return !1;
3362
- let a = N(r.revision.content, i, e, t, n);
3512
+ let a = H(r.revision.content, i, e, t, n);
3363
3513
  if (a == null) return !1;
3364
3514
  let o = r.graph(i)?.nodes[e];
3365
3515
  if (a.length > 0 && o?.kind == "integration" && o.definition.key == "feishu_app_bot.on_event" && t == "eventTypes") {
3366
3516
  let t = Array.isArray(n) ? n.filter((e) => typeof e == "string") : [];
3367
- b(t) || (a = [...a, ...N(r.revision.content, i, e, "chatIds", void 0) ?? []]), O(o.config.resource) && o.config.resource.kind != S(t) && (a = [...a, ...N(r.revision.content, i, e, "resource", void 0) ?? []]);
3517
+ b(t) || (a = [...a, ...H(r.revision.content, i, e, "chatIds", void 0) ?? []]), Pe(o.config.resource) && o.config.resource.kind != S(t) && (a = [...a, ...H(r.revision.content, i, e, "resource", void 0) ?? []]);
3368
3518
  }
3369
- return a.length > 0 && o?.kind == "poll" && o.definition.key == "linear.on_issue_changed" && t == "teamId" ? await this.#E([...a, ...N(r.revision.content, i, e, "stateIds", void 0) ?? []]) != null : await this.#E(a) != null;
3519
+ return a.length > 0 && o?.kind == "poll" && o.definition.key == "linear.on_issue_changed" && t == "teamId" ? await this.#O([...a, ...H(r.revision.content, i, e, "stateIds", void 0) ?? []]) != null : await this.#O(a) != null;
3370
3520
  }
3371
3521
  async saveTriggerSchedule(e, t) {
3372
3522
  let n = this.$.revision.value, r = this.#l.value.target;
3373
3523
  if (n == null || r?.kind != "flow") return !1;
3374
- let i = Ze(n.revision.content, r, e, t);
3375
- return i != null && await this.#E(i) != null;
3524
+ let i = se(n.revision.content, r, e, t);
3525
+ return i != null && await this.#O(i) != null;
3376
3526
  }
3377
3527
  async saveWebhook(e, t) {
3378
3528
  let n = this.$.revision.value, r = this.#l.value.target;
3379
3529
  if (n == null || r?.kind != "flow") return !1;
3380
- let i = ce(n, r, e, t);
3381
- return i != null && await this.#E(i) != null;
3530
+ let i = oe(n, r, e, t);
3531
+ return i != null && await this.#O(i) != null;
3382
3532
  }
3383
3533
  async setTriggerConnection(e, t) {
3384
3534
  let n = this.$.revision.value, r = this.#l.value.target;
3385
3535
  if (n == null || r?.kind != "flow") return !1;
3386
- let i = $e(n.revision.content, r, e, t);
3536
+ let i = _e(n.revision.content, r, e, t);
3387
3537
  if (i == null) return !1;
3388
3538
  let a = n.graph(r)?.nodes[e];
3389
- return i.length > 0 && a?.kind == "poll" && a.definition.key == "linear.on_issue_changed" ? await this.#E([...i, ...["teamId", "stateIds"].flatMap((t) => N(n.revision.content, r, e, t, void 0) ?? [])]) != null : await this.#E(i) != null;
3539
+ return i.length > 0 && a?.kind == "poll" && a.definition.key == "linear.on_issue_changed" ? await this.#O([...i, ...["teamId", "stateIds"].flatMap((t) => H(n.revision.content, r, e, t, void 0) ?? [])]) != null : await this.#O(i) != null;
3390
3540
  }
3391
3541
  async saveSubflowSettings(e, t) {
3392
3542
  let n = this.$.revision.value;
3393
3543
  if (n == null) return !1;
3394
- let r = we(n, e, t);
3395
- return r != null && await this.#E(r) != null;
3544
+ let r = de(n, e, t);
3545
+ return r != null && await this.#O(r) != null;
3396
3546
  }
3397
3547
  updateModuleSource(e) {
3398
3548
  let t = this.#l.value.moduleEditor;
3399
3549
  if (this.#d.applying || this.#d.failed || t == null || t.source == e) return;
3400
- this.#A();
3550
+ this.#N();
3401
3551
  let n = this.#u.get(t.moduleId)?.base ?? this.#l.value.draft?.content.modules[t.moduleId];
3402
3552
  n != null && (this.#u.set(t.moduleId, {
3403
3553
  base: n,
@@ -3406,14 +3556,14 @@ var lr = class {
3406
3556
  phase: void 0,
3407
3557
  source: e
3408
3558
  }
3409
- }), this.#B());
3559
+ }), this.#U());
3410
3560
  }
3411
3561
  discardModuleChanges() {
3412
3562
  let e = this.#l.value.moduleEditor;
3413
3563
  if (e == null || this.#p != null) return;
3414
3564
  this.#u.delete(e.moduleId);
3415
3565
  let t = this.#l.value.draft?.content.modules[e.moduleId];
3416
- this.#V({ moduleEditor: t == null ? void 0 : {
3566
+ this.#W({ moduleEditor: t == null ? void 0 : {
3417
3567
  moduleId: e.moduleId,
3418
3568
  source: t.source
3419
3569
  } });
@@ -3431,18 +3581,18 @@ var lr = class {
3431
3581
  ...e.editor,
3432
3582
  phase: void 0
3433
3583
  });
3434
- return this.#B(), await this.#C();
3584
+ return this.#U(), await this.#T();
3435
3585
  }
3436
- #C() {
3586
+ #T() {
3437
3587
  if (this.#p != null) return this.#p;
3438
3588
  if (this.#v) return Promise.resolve(!1);
3439
3589
  if (![...this.#u.values()].some((e) => e.editor.phase != "failed")) return Promise.resolve(this.#u.size == 0);
3440
3590
  let e = this.#n.capture();
3441
- return this.#p = this.#w(e).finally(() => {
3591
+ return this.#p = this.#E(e).finally(() => {
3442
3592
  this.#p = void 0;
3443
3593
  }), this.#p;
3444
3594
  }
3445
- async #w(e) {
3595
+ async #E(e) {
3446
3596
  for (; !this.#v && e();) {
3447
3597
  let t = [...this.#u.entries()].find(([, e]) => e.editor.phase != "failed");
3448
3598
  if (t == null) return this.#u.size == 0;
@@ -3450,20 +3600,20 @@ var lr = class {
3450
3600
  r.editor = {
3451
3601
  ...r.editor,
3452
3602
  phase: "saving"
3453
- }, this.#B();
3603
+ }, this.#U();
3454
3604
  try {
3455
3605
  let t = await Kt(i);
3456
3606
  if (this.#v || !e()) return !1;
3457
3607
  let a = this.#l.value.draft?.content.modules[n];
3458
3608
  if (a == null || a.source != r.base.source || JSON.stringify(a.imports) != JSON.stringify(r.base.imports)) throw Error(this.#r.t("notice.moduleUpdated"));
3459
- let o = i == a.source && JSON.stringify(t) == JSON.stringify(a.imports) ? this.#l.value.draft : await this.#E(qt(n, r.base.source, r.base.imports, i, t), !1);
3609
+ let o = i == a.source && JSON.stringify(t) == JSON.stringify(a.imports) ? this.#l.value.draft : await this.#k(qt(n, r.base.source, r.base.imports, i, t), !1);
3460
3610
  if (this.#v || !e()) return !1;
3461
3611
  let s = this.#u.get(n);
3462
3612
  if (s == null) continue;
3463
3613
  o == null ? s.editor = {
3464
3614
  ...s.editor,
3465
3615
  phase: "failed"
3466
- } : s.editor.source == i ? (this.#u.delete(n), this.#l.value.moduleEditor?.moduleId == n && this.#V({ moduleEditor: {
3616
+ } : s.editor.source == i ? (this.#u.delete(n), this.#l.value.moduleEditor?.moduleId == n && this.#W({ moduleEditor: {
3467
3617
  moduleId: n,
3468
3618
  source: i
3469
3619
  } })) : (s.base = {
@@ -3480,60 +3630,63 @@ var lr = class {
3480
3630
  r != null && (r.editor = {
3481
3631
  ...r.editor,
3482
3632
  phase: "failed"
3483
- }), this.#c(B(t, this.#r.t));
3633
+ }), this.#c(I(t, this.#r.t));
3484
3634
  }
3485
- this.#B();
3635
+ this.#U();
3486
3636
  }
3487
3637
  return !1;
3488
3638
  }
3489
3639
  async moveNodes(e) {
3490
3640
  let t = this.#l.value.target;
3491
- t != null && await this.#j("move", Object.keys(e).length, [], (n) => Be(n, t, e));
3641
+ t != null && await this.#P("move", Object.keys(e).length, [], (n) => te(n, t, e));
3492
3642
  }
3493
3643
  async moveViewport(e) {
3494
3644
  let t = this.#l.value.target;
3495
- t != null && await this.#k((n) => te(n, t, e), !0);
3645
+ t != null && await this.#M((n) => le(n, t, e), !0);
3496
3646
  }
3497
3647
  async check() {
3498
- await this.#N();
3648
+ await this.#I();
3499
3649
  }
3500
3650
  async refreshFlows() {
3501
3651
  await this.reloadFlows();
3502
3652
  }
3503
3653
  updateLive(e) {
3504
- e.flowId == this.#l.value.flowId && this.#V({ live: e });
3654
+ e.flowId == this.#l.value.flowId && this.#W({ live: e });
3505
3655
  }
3506
- locateNode(e) {
3507
- let t = this.$.revision.value, n = this.#l.value.target;
3508
- return t == null || n == null || t.node(n, e) == null || !this.selectNodes([e]) ? !1 : (this.#V({ nodeFocus: {
3656
+ locateNode(e, { preserveSelection: t = !1 } = {}) {
3657
+ let n = this.$.revision.value, r = this.#l.value.target;
3658
+ return n == null || r == null || n.node(r, e) == null && !k(this.#l.value.presentation?.value ?? {}, r).has(e) || !t && !this.selectNodes([e]) ? !1 : (this.#W({ nodeFocus: {
3509
3659
  nodeId: e,
3510
- requestId: ++this.#b
3660
+ requestId: ++this.#x
3511
3661
  } }), !0);
3512
3662
  }
3513
3663
  locateDiagnostic(e) {
3514
- return e.location == null || !this.selectNodes([e.location.nodeId]) ? !1 : (this.#V({ diagnosticFocus: {
3664
+ return e.location == null || !this.selectNodes([e.location.nodeId]) ? !1 : (this.#W({ diagnosticFocus: {
3515
3665
  ...e.location,
3516
3666
  diagnostic: e.diagnostic,
3517
3667
  requestId: ++this.#h
3518
3668
  } }), !0);
3519
3669
  }
3520
- async #T(e, t, n) {
3521
- let r = Math.max(0, ...this.#I().nodes.flatMap((e) => {
3670
+ async #D(e, t, n) {
3671
+ let r = Math.max(0, ...this.#z().nodes.flatMap((e) => {
3522
3672
  if (e.kind != "comment") return [];
3523
3673
  let t = /#(\d+)$/.exec(e.title);
3524
3674
  return t == null ? [] : [Number(t[1])];
3525
3675
  }));
3526
- if (!(!await this.#j("add", 1, [], (i) => j(i, e, t, {
3676
+ if (!(!await this.#P("add", 1, [], (i) => P(i, e, t, {
3527
3677
  content: "",
3528
3678
  position: n,
3529
3679
  title: this.#r.t("addNode.commentName", { number: r + 1 })
3530
3680
  }), [t]) || this.#v)) return t;
3531
3681
  }
3532
- async #E(e, t = !0, n = !1) {
3682
+ async #O(e) {
3683
+ return await this.#P("edit", 1, e) ? this.#l.value.draft : void 0;
3684
+ }
3685
+ async #k(e, t = !0, n = !1) {
3533
3686
  if (this.#v || (this.#d.applying || this.#d.failed) && !n) return;
3534
3687
  let r = this.#l.value.flowId, i = this.#l.value.draft;
3535
3688
  if (r == null || i == null) return;
3536
- if (e.length == 0 || u(R(i, e).content, i.content)) return i;
3689
+ if (e.length == 0 || u(z(i, e).content, i.content)) return i;
3537
3690
  let a = !n && this.#d.clear(), o = this.#n.capture();
3538
3691
  this.#d.pending++, this.#d.publish();
3539
3692
  try {
@@ -3551,38 +3704,38 @@ var lr = class {
3551
3704
  this.#d.pending--, this.#v || this.#d.publish();
3552
3705
  }
3553
3706
  }
3554
- async #D(e) {
3707
+ async #A(e) {
3555
3708
  for (let t = 0; t < 2 && e(); t += 1) {
3556
3709
  let t = this.#l.value.draft;
3557
3710
  if (t == null) return;
3558
- let n = Oe(t.content);
3711
+ let n = Ee(t.content);
3559
3712
  if (n.length == 0) {
3560
- this.#N();
3713
+ this.#I();
3561
3714
  return;
3562
3715
  }
3563
- if (await this.#E(n, !1) != null || !e()) return;
3716
+ if (await this.#k(n, !1) != null || !e()) return;
3564
3717
  if (this.#l.value.draft?.revisionId == t.revisionId) break;
3565
3718
  }
3566
- e() && this.#N();
3719
+ e() && this.#I();
3567
3720
  }
3568
- #O(e, t) {
3569
- let n = this.#l.value.draft, { revision: r, selectedNodeIds: i, target: a } = this.#L(e), o = this.#l.value.moduleEditor, s = o != null && (t == "external" || n != null) && ir(n, o) != "saved", c;
3721
+ #j(e, t) {
3722
+ let n = this.#l.value.draft, { revision: r, selectedNodeIds: i, target: a } = this.#B(e), o = this.#l.value.moduleEditor, s = o != null && (t == "external" || n != null) && ar(n, o) != "saved", c;
3570
3723
  return c = s ? t == "external" ? {
3571
3724
  ...o,
3572
3725
  phase: "failed"
3573
- } : o : ar(r, a, i), this.#V({
3726
+ } : o : or(r, a, i), this.#W({
3574
3727
  draft: e,
3575
3728
  moduleEditor: c,
3576
3729
  selectedNodeIds: i,
3577
3730
  target: a
3578
3731
  }), s;
3579
3732
  }
3580
- async #k(e, t = !1) {
3733
+ async #M(e, t = !1) {
3581
3734
  if (this.#v || (this.#d.applying || this.#d.failed) && !t) return !1;
3582
3735
  let n = this.#l.value.flowId, r = this.#l.value.presentation;
3583
3736
  if (n == null || r == null) return !1;
3584
3737
  if (u(e(r.value), r.value)) return !0;
3585
- t || this.#A();
3738
+ t || this.#N();
3586
3739
  let i = this.#n.capture();
3587
3740
  this.#d.pending++, this.#d.publish();
3588
3741
  try {
@@ -3592,19 +3745,19 @@ var lr = class {
3592
3745
  this.#d.pending--, this.#v || this.#d.publish();
3593
3746
  }
3594
3747
  }
3595
- #A() {
3748
+ #N() {
3596
3749
  this.#d.clear() && this.#c({
3597
3750
  kind: "success",
3598
3751
  message: this.#r.t("history.cleared")
3599
3752
  });
3600
3753
  }
3601
- async #j(e, t, n, r, i = this.#l.value.selectedNodeIds) {
3754
+ async #P(e, t, n, r, i = this.#l.value.selectedNodeIds) {
3602
3755
  if (this.#v || this.#d.applying || this.#d.failed) return !1;
3603
3756
  let { draft: a, target: o, presentation: s, selectedNodeIds: c } = this.#l.value;
3604
3757
  if (a == null || o == null || s == null) return !1;
3605
- let l = r?.(s.value) ?? s.value, d = re(s.value, l, o);
3606
- if (u(R(a, n).content, a.content) && d.nodeIds.length == 0) return !0;
3607
- let f = this.#d.generation, p = Jn(a.content, n);
3758
+ let l = r?.(s.value) ?? s.value, d = ee(s.value, l, o);
3759
+ if (u(z(a, n).content, a.content) && d.nodeIds.length == 0) return !0;
3760
+ let f = this.#d.generation, p = Yn(a.content, n);
3608
3761
  this.#d.pending++;
3609
3762
  let m = this.#d.record({
3610
3763
  action: e,
@@ -3617,7 +3770,7 @@ var lr = class {
3617
3770
  afterSelection: i
3618
3771
  });
3619
3772
  try {
3620
- let e = n.length == 0 ? Promise.resolve(a) : this.#E(n, !0, !0), t = r == null ? Promise.resolve(!0) : this.#k(r, !0);
3773
+ let e = n.length == 0 ? Promise.resolve(a) : this.#k(n, !0, !0), t = r == null ? Promise.resolve(!0) : this.#M(r, !0);
3621
3774
  this.selectNodes(i), m || this.#c({
3622
3775
  kind: "success",
3623
3776
  message: this.#r.t("history.tooLarge")
@@ -3625,18 +3778,18 @@ var lr = class {
3625
3778
  let [o, s] = await Promise.all([e, t]);
3626
3779
  return o != null && s && (!m || f == this.#d.generation);
3627
3780
  } catch (e) {
3628
- return this.#c(B(e, this.#r.t)), this.retryHistorySync(), !1;
3781
+ return this.#c(I(e, this.#r.t)), this.retryHistorySync(), !1;
3629
3782
  } finally {
3630
3783
  this.#d.pending--, this.#v || this.#d.publish();
3631
3784
  }
3632
3785
  }
3633
3786
  async undo() {
3634
- await this.#M(!1);
3787
+ await this.#F(!1);
3635
3788
  }
3636
3789
  async redo() {
3637
- await this.#M(!0);
3790
+ await this.#F(!0);
3638
3791
  }
3639
- async #M(e) {
3792
+ async #F(e) {
3640
3793
  let t = this.history$.value;
3641
3794
  if (!(e ? t.canRedo : t.canUndo)) return;
3642
3795
  let n = e ? t.redo : t.undo;
@@ -3644,10 +3797,10 @@ var lr = class {
3644
3797
  let r = this.#d.generation;
3645
3798
  this.#d.applying = !0, this.#d.publish();
3646
3799
  try {
3647
- let [t, i] = await Promise.all([this.#E(e ? n.forward : n.inverse, !0, !0), this.#k((t) => de(t, n.target, n.presentation, e), !0)]);
3800
+ let [t, i] = await Promise.all([this.#k(e ? n.forward : n.inverse, !0, !0), this.#M((t) => E(t, n.target, n.presentation, e), !0)]);
3648
3801
  t != null && i && r == this.#d.generation && (this.selectNodes(e ? n.afterSelection : n.beforeSelection), this.#d.complete(e));
3649
3802
  } catch (e) {
3650
- this.#c(B(e, this.#r.t)), this.retryHistorySync();
3803
+ this.#c(I(e, this.#r.t)), this.retryHistorySync();
3651
3804
  } finally {
3652
3805
  this.#d.applying = !1, this.#v || this.#d.publish();
3653
3806
  }
@@ -3662,10 +3815,10 @@ var lr = class {
3662
3815
  if (await Promise.allSettled([this.#t.settled(), this.#a.settled()]), !(!t() || this.#v)) try {
3663
3816
  let { draft: n, presentation: r } = await this.#e.getEditor(e);
3664
3817
  if (!t() || this.#v) return;
3665
- this.#t.reset(n), this.#a.reset(r), this.#O(n, "external"), this.#V({ presentation: r }), this.#o.advanceHead(e, n.revisionId), this.#d.failed = !1, this.#c({
3818
+ this.#t.reset(n), this.#a.reset(r), this.#j(n, "external"), this.#W({ presentation: r }), this.#o.advanceHead(e, n.revisionId), this.#d.failed = !1, this.#c({
3666
3819
  kind: "error",
3667
3820
  message: this.#r.t("history.resynced")
3668
- }), this.#N();
3821
+ }), this.#I();
3669
3822
  } catch {
3670
3823
  t() && !this.#v && this.#c({
3671
3824
  kind: "error",
@@ -3677,17 +3830,17 @@ var lr = class {
3677
3830
  this.#f = void 0, this.#v || this.#d.publish();
3678
3831
  }), this.#f;
3679
3832
  }
3680
- async #N() {
3833
+ async #I() {
3681
3834
  if (this.#v) return;
3682
3835
  let e = this.#l.value.flowId, t = this.#l.value.draft, n = this.#l.value.target;
3683
3836
  if (e == null || t == null || n == null) {
3684
- n ?? this.#V({
3837
+ n ?? this.#W({
3685
3838
  checkLoading: !1,
3686
3839
  diagnostics: void 0
3687
3840
  });
3688
3841
  return;
3689
3842
  }
3690
- this.#V({
3843
+ this.#W({
3691
3844
  checkLoading: !0,
3692
3845
  diagnosticFocus: void 0
3693
3846
  });
@@ -3695,7 +3848,7 @@ var lr = class {
3695
3848
  let n = await this.#e.checkFlow(e, t.revisionId);
3696
3849
  if (!this.#v && e == this.#l.value.flowId && t.revisionId == this.#l.value.draft?.revisionId) {
3697
3850
  let e = this.#l.value.live;
3698
- this.#V({
3851
+ this.#W({
3699
3852
  diagnostics: n,
3700
3853
  live: e == null ? void 0 : {
3701
3854
  ...e,
@@ -3704,16 +3857,16 @@ var lr = class {
3704
3857
  });
3705
3858
  }
3706
3859
  } catch (n) {
3707
- !this.#v && e == this.#l.value.flowId && t.revisionId == this.#l.value.draft?.revisionId && this.#c(B(n, this.#r.t));
3860
+ !this.#v && e == this.#l.value.flowId && t.revisionId == this.#l.value.draft?.revisionId && this.#c(I(n, this.#r.t));
3708
3861
  } finally {
3709
- !this.#v && e == this.#l.value.flowId && t.revisionId == this.#l.value.draft?.revisionId && this.#V({ checkLoading: !1 });
3862
+ !this.#v && e == this.#l.value.flowId && t.revisionId == this.#l.value.draft?.revisionId && this.#W({ checkLoading: !1 });
3710
3863
  }
3711
3864
  }
3712
- async #P(e) {
3865
+ async #L(e) {
3713
3866
  if (this.#v) return;
3714
3867
  let t = this.#l.value.flowId;
3715
- if (t == null || (this.#g += 1, e != null && (this.#_ = !0), this.#y)) return;
3716
- this.#y = !0;
3868
+ if (t == null || (this.#g += 1, e != null && (this.#_ = !0), this.#b)) return;
3869
+ this.#b = !0;
3717
3870
  let n = {
3718
3871
  current: this.#n.capture(),
3719
3872
  flowId: t
@@ -3723,74 +3876,74 @@ var lr = class {
3723
3876
  do {
3724
3877
  e = this.#g;
3725
3878
  let t = this.#_;
3726
- this.#_ = !1, await this.#F(n, !1, t);
3727
- } while (this.#R(n) && e != this.#g);
3728
- }), this.#R(n) && (this.#y = !1);
3879
+ this.#_ = !1, await this.#R(n, !1, t);
3880
+ } while (this.#V(n) && e != this.#g);
3881
+ }), this.#V(n) && (this.#b = !1);
3729
3882
  }
3730
- async #F(e, t, n = !1) {
3883
+ async #R(e, t, n = !1) {
3731
3884
  try {
3732
3885
  let t = this.#t.committed;
3733
3886
  if (t == null) return !1;
3734
3887
  let r = await this.#e.syncDraft(e.flowId);
3735
- if (!this.#R(e)) return !1;
3888
+ if (!this.#V(e)) return !1;
3736
3889
  let i = r.draft;
3737
3890
  if (i.revisionId == t.revisionId) return !0;
3738
3891
  this.#d.clear() && this.#c({
3739
3892
  kind: "success",
3740
3893
  message: this.#r.t("history.external")
3741
3894
  });
3742
- let a = this.#t.replaceCommitted(i), o = this.#O(a, "external");
3895
+ let a = this.#t.replaceCommitted(i), o = this.#j(a, "external");
3743
3896
  return this.#o.advanceHead(e.flowId, i.revisionId), n && this.#c({
3744
3897
  kind: o ? "error" : "success",
3745
3898
  message: this.#r.t(o ? "notice.moduleUpdated" : "notice.draftUpdated")
3746
- }), this.#N(), !0;
3899
+ }), this.#I(), !0;
3747
3900
  } catch (n) {
3748
- return t && this.#R(e) && this.#c(B(n, this.#r.t)), !1;
3901
+ return t && this.#V(e) && this.#c(I(n, this.#r.t)), !1;
3749
3902
  }
3750
3903
  }
3751
- #I() {
3904
+ #z() {
3752
3905
  let e = this.#l.value;
3753
- return _(e.draft, e.target, e.presentation?.value, e.diagnostics?.diagnostics, {}, {}, this.#r.t);
3906
+ return et(e.draft, e.target, e.presentation?.value, e.diagnostics?.diagnostics, {}, {}, this.#r.t);
3754
3907
  }
3755
- #L(e) {
3756
- let t = z(e), n = cr(t, this.#l.value.target);
3908
+ #B(e) {
3909
+ let t = B(e), n = lr(t, this.#l.value.target);
3757
3910
  return {
3758
3911
  revision: t,
3759
3912
  selectedNodeIds: this.#l.value.selectedNodeIds.filter((e) => n != null && t.selection(n, e) != null),
3760
3913
  target: n
3761
3914
  };
3762
3915
  }
3763
- #R(e) {
3916
+ #V(e) {
3764
3917
  return !this.#v && e.flowId == this.#l.value.flowId && e.current();
3765
3918
  }
3766
- #z(e) {
3919
+ #H(e) {
3767
3920
  let t = e == null ? void 0 : this.#u.get(e.moduleId)?.editor ?? e, n;
3768
3921
  return [...this.#u.values()].some((e) => e.editor.phase == "failed") ? n = "failed" : this.#u.size > 0 && (n = "saving"), {
3769
3922
  moduleEditor: t,
3770
3923
  moduleSaveStatus: n
3771
3924
  };
3772
3925
  }
3773
- #B() {
3774
- this.#v || this.#l.set(this.#z(this.#l.value.moduleEditor));
3926
+ #U() {
3927
+ this.#v || this.#l.set(this.#H(this.#l.value.moduleEditor));
3775
3928
  }
3776
- #V(e) {
3929
+ #W(e) {
3777
3930
  if (this.#v) return;
3778
3931
  let t = Object.hasOwn(e, "moduleEditor") ? e.moduleEditor : this.#l.value.moduleEditor;
3779
3932
  this.#l.set({
3780
3933
  ...e,
3781
- ...this.#z(t)
3934
+ ...this.#H(t)
3782
3935
  });
3783
3936
  }
3784
3937
  };
3785
3938
  //#endregion
3786
3939
  //#region src/workbench/browser/runtime/stores/workbenchStore.ts
3787
- function ur(e) {
3940
+ function dr(e) {
3788
3941
  return new Map(e.nodes.map((e) => [e.id, e]));
3789
3942
  }
3790
- function dr(e, t) {
3791
- return e == null || t == null ? [] : z(e).designerInputs(t);
3943
+ function fr(e, t) {
3944
+ return e == null || t == null ? [] : B(e).designerInputs(t);
3792
3945
  }
3793
- function fr(e, t, n, r, i) {
3946
+ function pr(e, t, n, r, i) {
3794
3947
  if (e == null || t?.kind != "flow" || n?.revisionId != e.revisionId || n.flowId != e.flowId) return /* @__PURE__ */ new Map();
3795
3948
  let a = r.find((t) => t.kind == "run.started" && t.payload.flowId == e.flowId)?.payload.scopeId;
3796
3949
  return typeof a == "string" ? new Map(r.flatMap((t) => {
@@ -3798,7 +3951,7 @@ function fr(e, t, n, r, i) {
3798
3951
  return t.payload.scopeId == a && t.payload.flowId == e.flowId && typeof n == "string" && i.has(n) ? [[t.sequence, n]] : [];
3799
3952
  })) : /* @__PURE__ */ new Map();
3800
3953
  }
3801
- var pr = { openExternalPage: async () => !1 }, mr = class {
3954
+ var mr = { openExternalPage: async () => !1 }, hr = class {
3802
3955
  #e;
3803
3956
  #t;
3804
3957
  #n;
@@ -3813,16 +3966,17 @@ var pr = { openExternalPage: async () => !1 }, mr = class {
3813
3966
  #c;
3814
3967
  #l;
3815
3968
  #u;
3816
- constructor(r, i, a = P, o = p(), s = pr, c = !0) {
3817
- this.#t = new L(), this.#r = n(), this.#a = n([]), this.#o = n(!1), this.#s = n(!1), this.#c = !0, this.#u = !1, this.retryCatalog = () => {
3969
+ #d;
3970
+ constructor(r, i, a = R, o = d(), s = mr, c = !0) {
3971
+ this.#t = new V(), this.#r = n(), this.#a = n([]), this.#o = n(!1), this.#s = n(!1), this.#c = !0, this.#u = !1, this.#d = !1, this.retryCatalog = () => {
3818
3972
  this.connectors.retryCatalog(), this.triggers.catalog.retry();
3819
- }, this.provideAddNodeOptions = (e, t, n = t) => Me(t, [this.triggers.provideAddNodeOptions(e, t), this.connectors.provideAddNodeOptions(e, t, n)]), this.browseAddNodeOptions = (e) => Me(e, [this.triggers.browseAddNodeOptions(e), this.connectors.browseAddNodeOptions(e)]), this.provideAddNodeOptionChoices = (e, t) => this.connectors.provideAddNodeOptionChoices(e, t), this.#e = r, this.results = r, this.#n = o, this.#i = c;
3973
+ }, this.provideAddNodeOptions = (e, t, n = t) => re(t, [this.triggers.provideAddNodeOptions(e, t), this.connectors.provideAddNodeOptions(e, t, n)]), this.browseAddNodeOptions = (e) => re(e, [this.triggers.browseAddNodeOptions(e), this.connectors.browseAddNodeOptions(e)]), this.provideAddNodeOptionChoices = (e, t) => this.connectors.provideAddNodeOptionChoices(e, t), this.preferences = i, this.#e = r, this.results = r, this.#n = o, this.#i = c;
3820
3974
  let l = (e) => {
3821
3975
  this.#u || this.#r.set(e);
3822
3976
  };
3823
- this.runs = new We(r, l, o), this.workspace = new lr(r, l, Jt, o, (e) => {
3824
- e.kind == "run.created" ? this.#d(r, e) : this.runs.changed(e.runId);
3825
- }, new Mn(r, s.connectorCache)), this.connectors = new Bn(r, this.workspace, l, s, o), this.triggers = new qn(r, this.workspace, l, s, o), this.publications = new $t(r, this.workspace, l, i, a, o), this.runRequests = new ln(r, this.runs, l, async (e) => {
3977
+ this.runs = new xe(r, l, o), this.workspace = new ur(r, l, Jt, o, (e) => {
3978
+ e.kind == "run.created" ? this.#p(r, e) : this.runs.changed(e.runId);
3979
+ }, new Nn(r, s.connectorCache), (e) => void this.#f(e)), this.connectors = new Vn(r, this.workspace, l, s, o), this.triggers = new Jn(r, this.workspace, l, s, o), this.publications = new $t(r, this.workspace, l, i, a, o), this.runRequests = new un(r, this.runs, l, async (e) => {
3826
3980
  if (!(e != this.workspace.$.flowId.value || !await this.workspace.saveModuleEditor() || this.#u || e != this.workspace.$.flowId.value)) return this.workspace.$.draft.value?.revisionId;
3827
3981
  }, o, a);
3828
3982
  let u = t((e) => {
@@ -3834,28 +3988,28 @@ var pr = { openExternalPage: async () => !1 }, mr = class {
3834
3988
  diagnostics: [...t.diagnostics, ...n],
3835
3989
  valid: !1
3836
3990
  };
3837
- }), d = /* @__PURE__ */ new Map(), f, m = t((e) => {
3991
+ }), f = /* @__PURE__ */ new Map(), p, m = t((e) => {
3838
3992
  let t = e(this.workspace.$.draft);
3839
- f != t?.flowId && (d.clear(), f = t?.flowId);
3840
- let n = e(this.workspace.$.target), r = e(this.workspace.$.presentation)?.value, i = e(u)?.diagnostics ?? e(this.connectors.$.diagnostics), a = t == null ? void 0 : e(k(this.workspace.catalogs.providers.get(t.flowId, o.lang))), s = Object.fromEntries((a ?? []).map((e) => [e.serviceId, e])), c = e(this.connectors.$.actions), l = e(this.connectors.$.catalogs), p = e(o.t$), m = e(this.runs.$.run), h = e(this.runs.$.events), g = n == null ? "" : n.kind == "flow" ? "flow" : `subflow:${n.id}`, v = [
3841
- ...dr(t, n),
3842
- r == null || n == null ? void 0 : ne(r, n),
3993
+ p != t?.flowId && (f.clear(), p = t?.flowId);
3994
+ let n = e(this.workspace.$.target), r = e(this.workspace.$.presentation)?.value, i = e(u)?.diagnostics ?? e(this.connectors.$.diagnostics), a = t == null ? void 0 : e(A(this.workspace.catalogs.providers.get(t.flowId, o.lang))), s = Object.fromEntries((a ?? []).map((e) => [e.serviceId, e])), c = e(this.connectors.$.actions), l = e(this.connectors.$.catalogs), d = e(o.t$), m = e(this.runs.$.run), h = e(this.runs.$.events), g = n == null ? "" : n.kind == "flow" ? "flow" : `subflow:${n.id}`, _ = [
3995
+ ...fr(t, n),
3996
+ r == null || n == null ? void 0 : Ve(r, n),
3843
3997
  i,
3844
3998
  c,
3845
3999
  a,
3846
4000
  l,
3847
- p,
4001
+ d,
3848
4002
  m,
3849
4003
  h,
3850
4004
  ...m == null ? [] : [t?.revisionId]
3851
- ], y = d.get(g);
3852
- if (y != null && y.inputs.length == v.length && y.inputs.every((e, t) => e === v[t])) return y.graph;
3853
- let b = _(t, n, r, i, c, l, p, m, h, s);
3854
- return d.set(g, {
3855
- graph: b,
3856
- inputs: v
3857
- }), b;
3858
- }), h = e(m, ur);
4005
+ ], v = f.get(g);
4006
+ if (v != null && v.inputs.length == _.length && v.inputs.every((e, t) => e === _[t])) return v.graph;
4007
+ let y = et(t, n, r, i, c, l, d, m, h, s);
4008
+ return f.set(g, {
4009
+ graph: y,
4010
+ inputs: _
4011
+ }), y;
4012
+ }), h = e(m, dr);
3859
4013
  this.$ = {
3860
4014
  busy: t((e) => {
3861
4015
  let t = e(this.workspace.$.busy);
@@ -3866,13 +4020,13 @@ var pr = { openExternalPage: async () => !1 }, mr = class {
3866
4020
  if (e(this.publications.$.rollingBackPublicationId) != null) return "rollback";
3867
4021
  if (e(this.publications.$.changingTriggerId) != null) return "trigger";
3868
4022
  }),
3869
- diagnosticItems: t((e) => Se(e(this.workspace.$.revision), e(this.workspace.$.target), e(u))),
4023
+ diagnosticItems: t((e) => we(e(this.workspace.$.revision), e(this.workspace.$.target), e(u))),
3870
4024
  diagnostics: u,
3871
4025
  designer: m,
3872
4026
  designerNodeById: h,
3873
4027
  sourceNodeIcons: e(m, (e) => Object.fromEntries(e.nodes.flatMap((e) => "icon" in e ? [[e.id, e.icon]] : [])), { equal: Z }),
3874
4028
  notice: this.#r,
3875
- runEventNodes: t((e) => fr(e(this.workspace.$.draft), e(this.workspace.$.target), e(this.runs.$.run), e(this.runs.$.events), e(h))),
4029
+ runEventNodes: t((e) => pr(e(this.workspace.$.draft), e(this.workspace.$.target), e(this.runs.$.run), e(this.runs.$.events), e(h))),
3876
4030
  selectedDesignerNode: t((e) => {
3877
4031
  let t = e(this.workspace.$.selectedNodeIds);
3878
4032
  return t.length == 1 ? e(h).get(t[0]) : void 0;
@@ -3908,7 +4062,7 @@ var pr = { openExternalPage: async () => !1 }, mr = class {
3908
4062
  if (this.#u) return;
3909
4063
  this.#a.set(e.map((e) => e.name)), this.#o.set(!0);
3910
4064
  } catch (e) {
3911
- this.#c = !0, this.#u || this.#r.set(B(e, this.#n.t));
4065
+ this.#c = !0, this.#u || this.#r.set(I(e, this.#n.t));
3912
4066
  } finally {
3913
4067
  this.#l = void 0, this.#u || this.#s.set(!1);
3914
4068
  }
@@ -3921,6 +4075,16 @@ var pr = { openExternalPage: async () => !1 }, mr = class {
3921
4075
  let t = this.workspace.$.flowId.value, n = this.#r.value;
3922
4076
  return !await this.workspace.selectFlow(e) || this.#u ? !1 : (e != t && this.#r.value === n && this.#r.set(void 0), this.connectors.reset(), this.triggers.reset(), this.publications.reset(), this.runRequests.reset(), this.runs.reset(), !0);
3923
4077
  }
4078
+ async #f(e) {
4079
+ if (!(this.#u || this.#d || this.workspace.$.flowId.value != null)) {
4080
+ this.#d = !0;
4081
+ try {
4082
+ await this.selectFlow(e);
4083
+ } finally {
4084
+ this.#d = !1;
4085
+ }
4086
+ }
4087
+ }
3924
4088
  async createFlow(e, t) {
3925
4089
  let n = await this.workspace.createFlow(e, t);
3926
4090
  return this.#u || n == null ? !1 : (await this.selectFlow(n.flowId), this.#u || this.#r.set({
@@ -3952,7 +4116,7 @@ var pr = { openExternalPage: async () => !1 }, mr = class {
3952
4116
  let r = await this.workspace.addNode(e, t, n);
3953
4117
  return r != null && e.kind == "connector" && this.connectors.refresh(), r != null && e.kind == "trigger" && this.triggers.refresh(), r;
3954
4118
  } catch (e) {
3955
- this.#u || this.#r.set(B(e, this.#n.t));
4119
+ this.#u || this.#r.set(I(e, this.#n.t));
3956
4120
  return;
3957
4121
  }
3958
4122
  }
@@ -3975,7 +4139,7 @@ var pr = { openExternalPage: async () => !1 }, mr = class {
3975
4139
  let e = this.workspace.$.targetFlow.value;
3976
4140
  return e == null ? "unavailable" : await this.runRequests.requestLive(e);
3977
4141
  }
3978
- async #d(e, t) {
4142
+ async #p(e, t) {
3979
4143
  let n = this.workspace.$.target.value;
3980
4144
  if (this.#u || this.runRequests.$.submitting.value != null || n?.kind != "flow" || this.workspace.$.flowId.value != t.flowId) return;
3981
4145
  let r = this.#t.begin();
@@ -3987,8 +4151,8 @@ var pr = { openExternalPage: async () => !1 }, mr = class {
3987
4151
  return;
3988
4152
  }
3989
4153
  }
3990
- }, hr = Tt(() => import("./flowWorkspace-zcweMsLS.js").then((e) => e.t));
3991
- function gr({ action: e, description: t, error: n, onSubmit: r, onTokenChange: i, pending: a = !1, title: o, token: c, tokenLabel: u }) {
4154
+ }, gr = Tt(() => import("./flowWorkspace-DNmBb3ZW.js").then((e) => e.t));
4155
+ function _r({ action: e, description: t, error: n, onSubmit: r, onTokenChange: i, pending: a = !1, title: o, token: c, tokenLabel: u }) {
3992
4156
  let d = c != null && u != null && i != null, f = c ?? "", p = /* @__PURE__ */ q(Ct, { children: [
3993
4157
  /* @__PURE__ */ K("div", {
3994
4158
  "aria-hidden": "true",
@@ -4077,11 +4241,11 @@ function gr({ action: e, description: t, error: n, onSubmit: r, onTokenChange: i
4077
4241
  })
4078
4242
  });
4079
4243
  }
4080
- function _r({ host: e, store: t }) {
4244
+ function vr({ host: e, store: t }) {
4081
4245
  let [n] = Y(() => e.notify.bind(e)), i = r(t.$.notice);
4082
4246
  return J(() => n(i), [n, i]), J(() => () => n(void 0), [n]), null;
4083
4247
  }
4084
- function vr({ catalogWidth: e, createFlow: t, createFlowDisabled: n, createFlowField: i, flowBadges: a, hrefFor: o, hostAction: s, hostTitle: c, language: l, navigation: u, onConfigureConnector: d, onHostAction: f, onLanguageChange: p, store: m, theme: h }) {
4248
+ function yr({ catalogWidth: e, createFlow: t, createFlowDisabled: n, createFlowField: i, flowBadges: a, hrefFor: o, hostAction: s, hostTitle: c, language: l, navigation: u, onConfigureConnector: d, onHostAction: f, onLanguageChange: p, store: m, theme: h }) {
4085
4249
  let g = r(m.workspace.$.flowId);
4086
4250
  return /* @__PURE__ */ K("div", {
4087
4251
  className: "app-shell",
@@ -4107,7 +4271,7 @@ function vr({ catalogWidth: e, createFlow: t, createFlowDisabled: n, createFlowF
4107
4271
  "aria-busy": "true",
4108
4272
  className: "workspace"
4109
4273
  }),
4110
- children: /* @__PURE__ */ K(hr, {
4274
+ children: /* @__PURE__ */ K(gr, {
4111
4275
  hostAction: s,
4112
4276
  hostTitle: c,
4113
4277
  hrefFor: o,
@@ -4120,14 +4284,14 @@ function vr({ catalogWidth: e, createFlow: t, createFlowDisabled: n, createFlowF
4120
4284
  })
4121
4285
  });
4122
4286
  }
4123
- function yr({ catalogWidth: e, createFlow: t, createFlowDisabled: n, createFlowField: r, flowBadges: i, host: a, hostAction: s, hostTitle: c, hrefFor: l, language: u, location: d, onConfigureConnector: f, onHostAction: m, onLanguageChange: h, onNavigate: g, preferences: _, theme: v, variables: y = !0 }) {
4287
+ function br({ catalogWidth: e, createFlow: t, createFlowDisabled: n, createFlowField: r, flowBadges: i, host: a, hostAction: s, hostTitle: c, hrefFor: l, language: u, location: f, onConfigureConnector: p, onHostAction: m, onLanguageChange: h, onNavigate: g, preferences: _, theme: v, variables: y = !0 }) {
4124
4288
  let b = Et(g);
4125
4289
  b.current = g;
4126
4290
  let [{ i18n: x, navigation: S, store: C }] = Y(() => {
4127
- let e = p(u), t = new mr(new xe((e, t) => a.request(e, t), (e, t) => a.subscribeFlow(e, t), (e) => a.subscribeFlowCatalog(e)), _, P, e, a, y);
4291
+ let e = d(u), t = new hr(new Ce((e, t) => a.request(e, t), (e, t) => a.subscribeFlow(e, t), (e) => a.subscribeFlowCatalog(e)), _, R, e, a, y);
4128
4292
  return {
4129
4293
  i18n: e,
4130
- navigation: new At(t, d, (e, t) => b.current(e, t)),
4294
+ navigation: new At(t, f, (e, t) => b.current(e, t)),
4131
4295
  store: t
4132
4296
  };
4133
4297
  });
@@ -4143,7 +4307,7 @@ function yr({ catalogWidth: e, createFlow: t, createFlowDisabled: n, createFlowF
4143
4307
  x,
4144
4308
  S,
4145
4309
  C
4146
- ]), J(() => void S.apply(d), [d, S]), J(() => {
4310
+ ]), J(() => void S.apply(f), [f, S]), J(() => {
4147
4311
  C.triggers.catalog.setLanguage(u), C.connectors.setLanguage(u), x.lang != u && x.switchLang(u);
4148
4312
  }, [
4149
4313
  x,
@@ -4154,10 +4318,10 @@ function yr({ catalogWidth: e, createFlow: t, createFlowDisabled: n, createFlowF
4154
4318
  children: /* @__PURE__ */ q("div", {
4155
4319
  className: "open-flow-theme open-flow-workbench",
4156
4320
  "data-theme": v,
4157
- children: [/* @__PURE__ */ K(_r, {
4321
+ children: [/* @__PURE__ */ K(vr, {
4158
4322
  host: a,
4159
4323
  store: C
4160
- }), /* @__PURE__ */ K(vr, {
4324
+ }), /* @__PURE__ */ K(yr, {
4161
4325
  catalogWidth: e,
4162
4326
  createFlow: t,
4163
4327
  createFlowDisabled: n,
@@ -4168,7 +4332,7 @@ function yr({ catalogWidth: e, createFlow: t, createFlowDisabled: n, createFlowF
4168
4332
  hrefFor: l,
4169
4333
  language: u,
4170
4334
  navigation: S,
4171
- onConfigureConnector: f,
4335
+ onConfigureConnector: p,
4172
4336
  onHostAction: m,
4173
4337
  onLanguageChange: h,
4174
4338
  store: C,
@@ -4177,8 +4341,8 @@ function yr({ catalogWidth: e, createFlow: t, createFlowDisabled: n, createFlowF
4177
4341
  })
4178
4342
  });
4179
4343
  }
4180
- function br({ sessionKey: e, ...t }) {
4181
- return /* @__PURE__ */ K(yr, { ...t }, e);
4344
+ function xr({ sessionKey: e, ...t }) {
4345
+ return /* @__PURE__ */ K(br, { ...t }, e);
4182
4346
  }
4183
4347
  //#endregion
4184
- export { ge as EventSourcesPage, gr as OpenFlowSessionGate, br as OpenFlowWorkbench, St as isWorkbenchLanguage, bt as resolveWorkbenchLanguage, xt as workbenchLanguageNames, yt as workbenchLanguages };
4348
+ export { Re as EventSourcesPage, _r as OpenFlowSessionGate, xr as OpenFlowWorkbench, xt as isWorkbenchLanguage, yt as resolveWorkbenchLanguage, bt as workbenchLanguageNames, St as workbenchLanguages };