@oomol-lab/open-flow 0.1.0-beta.36 → 0.1.0-beta.38

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.
@@ -1,19 +1,19 @@
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-BA96NG4M.js";
4
- import { E as d, M as f, N as p, O as m, P as h, T as g, _, h as v, j as y, k as b, m as x, w as S } from "./editorComponent-DsbY5PNw.js";
5
- import { $t as C, Bt as w, E as T, G as E, Gt as ee, H as D, Ht as O, K as te, Kt as ne, M as k, N as A, O as j, Qt as M, R as re, Rt as ie, S as ae, T as N, U as P, Ut as oe, V as F, Vt as se, W as ce, Wt as le, X as ue, Y as I, Z as de, Zt as L, _ as fe, a as pe, an as me, at as he, b as ge, c as _e, cn as ve, ct as ye, d as be, dt as xe, en as Se, f as Ce, g as we, h as Te, i as Ee, in as De, it as Oe, j as ke, k as Ae, l as je, lt as R, m as Me, nn as Ne, o as Pe, on as z, ot as Fe, p as Ie, r as B, rn as V, rt as Le, s as Re, sn as H, st as ze, t as Be, tn as Ve, tt as He, u as Ue, ut as We, v as Ge, w as Ke, x as qe, y as Je, zt as U } from "./flowChanges-DwZmz0xb.js";
6
- import { C as Ye, D as Xe, O as Ze, _ as Qe, a as $e, c as et, d as tt, f as nt, g as rt, h as it, i as at, l as ot, m as st, n as ct, o as lt, r as ut, s as dt, t as ft, v as pt, w as mt } from "./workbenchSelect-DNteZJYP.js";
7
- import { c as ht, d as gt, l as _t, u as vt } from "./value-B_yE9ean.js";
8
- import { a as W } from "./dist-CoszrK7m.js";
9
- import { Fragment as yt, jsx as G, jsxs as K } from "react/jsx-runtime";
10
- import { Suspense as bt, lazy as xt, useEffect as St, useRef as Ct, useState as q } from "react";
11
- import * as wt from "effect/Cause";
12
- import * as J from "effect/Effect";
13
- import * as Tt from "effect/Exit";
14
- import * as Et from "effect/Fiber";
4
+ import { E as d, M as f, N as p, O as m, P as h, T as g, _, h as v, j as y, k as b, m as x, w as S } from "./editorComponent-BUEAVBsL.js";
5
+ import { $ as C, $t as w, Bt as ee, E as T, Gt as te, H as E, Ht as D, J as ne, Lt as re, M as O, N as k, O as A, Q as ie, Qt as j, R as ae, Rt as M, S as oe, T as N, U as se, Ut as ce, V as P, Vt as le, W as ue, Wt as de, X as fe, Xt as F, Y as pe, Z as me, Zt as he, _ as ge, a as _e, an as ve, b as ye, c as be, cn as I, d as xe, en as Se, et as Ce, f as we, g as Te, h as Ee, i as De, in as L, j as R, k as Oe, l as ke, ln as Ae, lt as je, m as Me, nn as Ne, nt as Pe, o as Fe, on as Ie, ot as Le, p as Re, r as z, rn as ze, rt as Be, s as Ve, sn as B, st as He, t as Ue, tn as We, tt as Ge, u as Ke, ut as qe, v as Je, w as Ye, x as Xe, y as Ze, zt as Qe } from "./flowChanges-Bu_BEtpj.js";
6
+ import { C as $e, D as et, O as tt, _ as nt, a as rt, c as it, d as at, f as ot, g as st, h as ct, i as lt, l as ut, m as dt, n as ft, o as pt, r as mt, s as ht, t as gt, v as _t, w as vt } from "./workbenchSelect-DNteZJYP.js";
7
+ import { c as yt, d as bt, l as xt, u as St } from "./value-B_yE9ean.js";
8
+ import { a as V } from "./dist-CoszrK7m.js";
9
+ import { Fragment as Ct, jsx as H, jsxs as U } from "react/jsx-runtime";
10
+ import { Suspense as wt, lazy as Tt, useEffect as Et, useRef as Dt, useState as W } from "react";
11
+ import * as Ot from "effect/Cause";
12
+ import * as G from "effect/Effect";
13
+ import * as kt from "effect/Exit";
14
+ import * as At from "effect/Fiber";
15
15
  //#region src/workbench/browser/runtime/navigation.ts
16
- var Dt = class {
16
+ var jt = class {
17
17
  #e;
18
18
  #t;
19
19
  #n;
@@ -72,7 +72,7 @@ var Dt = class {
72
72
  this.#s = !0, await this.#n.selectFlow(void 0), e == this.#i && (this.#u("design", !1), this.#s = !1);
73
73
  }
74
74
  async apply(e) {
75
- if (Ot(e, this.#t)) return;
75
+ if (Mt(e, this.#t)) return;
76
76
  this.#t = e;
77
77
  let t = ++this.#i;
78
78
  this.#s = !0;
@@ -88,39 +88,39 @@ var Dt = class {
88
88
  flowId: n,
89
89
  view: n == null ? "design" : e
90
90
  };
91
- Ot(r, this.#t) || (this.#t = r, this.#e(r, { replace: t })), this.#r.set(r.view);
91
+ Mt(r, this.#t) || (this.#t = r, this.#e(r, { replace: t })), this.#r.set(r.view);
92
92
  }
93
93
  };
94
- function Ot(e, t) {
94
+ function Mt(e, t) {
95
95
  return e.flowId == t.flowId && e.view == t.view;
96
96
  }
97
97
  //#endregion
98
98
  //#region src/workbench/browser/runtime/shell/resourceBrowser.tsx
99
- var kt = xt(() => import("./createResourceDialog-DRB0OEtr.js")), At = gt.map((e) => ({
100
- label: vt[e],
99
+ var Nt = Tt(() => import("./createResourceDialog-DRB0OEtr.js")), Pt = bt.map((e) => ({
100
+ label: St[e],
101
101
  value: e
102
- })), jt = 44, Mt = -12, Nt = 8, Pt = "a, button, input, select, textarea, [data-slot=\"tooltip-trigger\"]";
103
- function Ft({ language: e, onLanguageChange: t }) {
104
- let n = i(), [r, a] = q(null);
105
- return t == null ? null : /* @__PURE__ */ K("div", {
102
+ })), Ft = 44, It = -12, Lt = 8, Rt = "a, button, input, select, textarea, [data-slot=\"tooltip-trigger\"]";
103
+ function zt({ language: e, onLanguageChange: t }) {
104
+ let n = i(), [r, a] = W(null);
105
+ return t == null ? null : /* @__PURE__ */ U("div", {
106
106
  className: "resource-language",
107
107
  ref: a,
108
- children: [/* @__PURE__ */ G("span", {
108
+ children: [/* @__PURE__ */ H("span", {
109
109
  className: "sr-only",
110
110
  children: n("language.label")
111
- }), /* @__PURE__ */ G(ft, {
111
+ }), /* @__PURE__ */ H(gt, {
112
112
  ariaLabel: n("language.label"),
113
113
  onValueChange: (e) => t(e),
114
- options: At,
114
+ options: Pt,
115
115
  portalRoot: r,
116
116
  value: e
117
117
  })]
118
118
  });
119
119
  }
120
- function It(e) {
120
+ function Bt(e) {
121
121
  return e.length <= 20 ? e : `${e.slice(0, 10)}…${e.slice(-6)}`;
122
122
  }
123
- function Lt(e, t) {
123
+ function Vt(e, t) {
124
124
  let n = new Date(e), r = /* @__PURE__ */ new Date();
125
125
  return n.toLocaleString(t, {
126
126
  day: "numeric",
@@ -130,51 +130,51 @@ function Lt(e, t) {
130
130
  year: n.getFullYear() == r.getFullYear() ? void 0 : "numeric"
131
131
  });
132
132
  }
133
- function Rt(e) {
134
- return e.target instanceof Element && e.target.closest(Pt) != null;
133
+ function Ht(e) {
134
+ return e.target instanceof Element && e.target.closest(Rt) != null;
135
135
  }
136
- function zt({ badge: e, busy: t, flow: n, href: r, onSelect: o, store: u }) {
137
- let [f, p] = q(null), h = Ct(null), y = Ct(null), C = Ct(null), w = Ct(null), T = a(), E = i(), [ee, D] = q("idle"), [O, te] = q(n.name), [ne, k] = q(!1), [A, j] = q(), M = n.live != null && n.live.revisionId != n.draftRevisionId, re = n.status == "retiring" ? "resource.retiring" : n.live == null ? "resource.notPublished" : M ? "resource.unpublishedChanges" : "resource.isPublished", ae = n.status == "retiring" ? "danger" : n.live == null ? "neutral" : M ? "running" : "success";
138
- async function N(e) {
139
- j(e == "publish" ? "publish" : "enabled");
136
+ function Ut({ badge: e, busy: t, flow: n, href: r, onSelect: o, store: u }) {
137
+ let [f, p] = W(null), h = Dt(null), y = Dt(null), C = Dt(null), w = Dt(null), ee = a(), T = i(), [te, E] = W("idle"), [D, ne] = W(n.name), [O, k] = W(!1), [A, ie] = W(), j = n.live != null && n.live.revisionId != n.draftRevisionId, ae = n.status == "retiring" ? "resource.retiring" : n.live == null ? "resource.notPublished" : j ? "resource.unpublishedChanges" : "resource.isPublished", M = n.status == "retiring" ? "danger" : n.live == null ? "neutral" : j ? "running" : "success";
138
+ async function oe(e) {
139
+ ie(e == "publish" ? "publish" : "enabled");
140
140
  try {
141
141
  e == "publish" ? await u.workspace.publishFlow(n) : await u.workspace.setFlowEnabled(n, e);
142
142
  } finally {
143
- j(void 0);
143
+ ie(void 0);
144
144
  }
145
145
  }
146
- let P = mt(O);
147
- async function oe(e) {
146
+ let N = vt(D);
147
+ async function se(e) {
148
148
  e.preventDefault();
149
- let t = O.trim();
150
- mt(t) == null && await u.workspace.renameFlow(n.flowId, t) && D("idle");
149
+ let t = D.trim();
150
+ vt(t) == null && await u.workspace.renameFlow(n.flowId, t) && E("idle");
151
151
  }
152
- async function F() {
153
- await u.workspace.deleteFlow(n.flowId) && D("idle");
152
+ async function ce() {
153
+ await u.workspace.deleteFlow(n.flowId) && E("idle");
154
154
  }
155
- function se(e) {
156
- Rt(e) || o(n);
155
+ function P(e) {
156
+ Ht(e) || o(n);
157
157
  }
158
- return /* @__PURE__ */ K("div", {
158
+ return /* @__PURE__ */ U("div", {
159
159
  className: "resource-item-row",
160
160
  ref: p,
161
161
  children: [
162
- /* @__PURE__ */ K("div", {
162
+ /* @__PURE__ */ U("div", {
163
163
  className: "resource-list-row flow-columns",
164
- onClick: se,
164
+ onClick: P,
165
165
  children: [
166
- /* @__PURE__ */ K("span", {
166
+ /* @__PURE__ */ U("span", {
167
167
  className: "resource-primary-cell",
168
- children: [/* @__PURE__ */ G("span", {
168
+ children: [/* @__PURE__ */ H("span", {
169
169
  "aria-hidden": "true",
170
170
  className: "resource-flow-icon",
171
- children: /* @__PURE__ */ G("i", { className: "i-lucide-light:workflow" })
172
- }), /* @__PURE__ */ K("span", {
171
+ children: /* @__PURE__ */ H("i", { className: "i-lucide-light:workflow" })
172
+ }), /* @__PURE__ */ U("span", {
173
173
  className: "resource-primary-copy",
174
- children: [/* @__PURE__ */ K("span", {
174
+ children: [/* @__PURE__ */ U("span", {
175
175
  className: "resource-primary-heading",
176
176
  ref: h,
177
- children: [/* @__PURE__ */ G(s, {
177
+ children: [/* @__PURE__ */ H(s, {
178
178
  "aria-disabled": n.status == "retiring",
179
179
  className: "resource-primary-title",
180
180
  nativeButton: !1,
@@ -183,33 +183,33 @@ function zt({ badge: e, busy: t, flow: n, href: r, onSelect: o, store: u }) {
183
183
  e.preventDefault();
184
184
  return;
185
185
  }
186
- ie(e, () => o(n));
186
+ re(e, () => o(n));
187
187
  },
188
- render: /* @__PURE__ */ G("a", { href: n.status == "retiring" ? void 0 : r }),
188
+ render: /* @__PURE__ */ H("a", { href: n.status == "retiring" ? void 0 : r }),
189
189
  tabIndex: n.status == "retiring" ? -1 : void 0,
190
190
  title: n.name,
191
191
  variant: "link",
192
192
  children: n.name
193
- }), n.status == "active" && /* @__PURE__ */ K(g, {
193
+ }), n.status == "active" && /* @__PURE__ */ U(g, {
194
194
  onOpenChange: (e) => {
195
- D(e ? "rename" : "idle"), e && te(n.name);
195
+ E(e ? "rename" : "idle"), e && ne(n.name);
196
196
  },
197
- open: ee == "rename",
198
- children: [/* @__PURE__ */ G(b, {
199
- render: /* @__PURE__ */ G(s, {
200
- "aria-label": E("sidebar.renameFlow", { name: n.name }),
197
+ open: te == "rename",
198
+ children: [/* @__PURE__ */ H(b, {
199
+ render: /* @__PURE__ */ H(s, {
200
+ "aria-label": T("sidebar.renameFlow", { name: n.name }),
201
201
  className: "resource-rename-trigger",
202
202
  size: "icon-xs",
203
203
  type: "button",
204
204
  variant: "ghost"
205
205
  }),
206
- children: /* @__PURE__ */ G("i", {
206
+ children: /* @__PURE__ */ H("i", {
207
207
  "aria-hidden": "true",
208
208
  className: "i-lucide-light:pencil"
209
209
  })
210
- }), /* @__PURE__ */ K(d, {
210
+ }), /* @__PURE__ */ U(d, {
211
211
  align: "start",
212
- alignOffset: Mt,
212
+ alignOffset: It,
213
213
  anchor: h,
214
214
  className: "resource-rename-popover",
215
215
  collisionBoundary: [],
@@ -217,84 +217,84 @@ function zt({ badge: e, busy: t, flow: n, href: r, onSelect: o, store: u }) {
217
217
  initialFocus: C,
218
218
  positionMethod: "fixed",
219
219
  side: "top",
220
- sideOffset: ({ anchor: e, positioner: t }) => -(e.height + t.height) / 2 - Nt,
221
- children: [/* @__PURE__ */ G(m, {
220
+ sideOffset: ({ anchor: e, positioner: t }) => -(e.height + t.height) / 2 - Lt,
221
+ children: [/* @__PURE__ */ H(m, {
222
222
  className: "sr-only",
223
- children: E("sidebar.renameFlow", { name: n.name })
224
- }), /* @__PURE__ */ K("form", {
223
+ children: T("sidebar.renameFlow", { name: n.name })
224
+ }), /* @__PURE__ */ U("form", {
225
225
  className: "resource-rename-form",
226
- onSubmit: (e) => void oe(e),
226
+ onSubmit: (e) => void se(e),
227
227
  children: [
228
- /* @__PURE__ */ K(nt, {
228
+ /* @__PURE__ */ U(ot, {
229
229
  className: "min-w-0 flex-1",
230
- "data-invalid": O.length > 0 && P != null,
230
+ "data-invalid": D.length > 0 && N != null,
231
231
  children: [
232
- /* @__PURE__ */ G(rt, {
232
+ /* @__PURE__ */ H(st, {
233
233
  className: "sr-only",
234
234
  htmlFor: `rename-flow-${n.flowId}`,
235
- children: E("resource.flowName")
235
+ children: T("resource.flowName")
236
236
  }),
237
- /* @__PURE__ */ G(l, {
237
+ /* @__PURE__ */ H(l, {
238
238
  autoComplete: "off",
239
- "aria-invalid": O.length > 0 && P != null,
240
- "aria-describedby": O.length > 0 && P != null ? `rename-error-${n.flowId}` : void 0,
239
+ "aria-invalid": D.length > 0 && N != null,
240
+ "aria-describedby": D.length > 0 && N != null ? `rename-error-${n.flowId}` : void 0,
241
241
  id: `rename-flow-${n.flowId}`,
242
242
  name: "flow-name",
243
- onChange: (e) => te(e.target.value),
243
+ onChange: (e) => ne(e.target.value),
244
244
  ref: C,
245
245
  required: !0,
246
- value: O
246
+ value: D
247
247
  }),
248
- O.length > 0 && P != null && /* @__PURE__ */ G(st, {
248
+ D.length > 0 && N != null && /* @__PURE__ */ H(dt, {
249
249
  id: `rename-error-${n.flowId}`,
250
- children: E(`resource.nameIssue.${P}`, { max: 80 })
250
+ children: T(`resource.nameIssue.${N}`, { max: 80 })
251
251
  })
252
252
  ]
253
253
  }),
254
- /* @__PURE__ */ G(s, {
255
- onClick: () => D("idle"),
254
+ /* @__PURE__ */ H(s, {
255
+ onClick: () => E("idle"),
256
256
  size: "sm",
257
257
  type: "button",
258
258
  variant: "ghost",
259
- children: E("common.cancel")
259
+ children: T("common.cancel")
260
260
  }),
261
- /* @__PURE__ */ G(s, {
262
- disabled: t != null || P != null,
261
+ /* @__PURE__ */ H(s, {
262
+ disabled: t != null || N != null,
263
263
  size: "sm",
264
264
  type: "submit",
265
- children: E("common.save")
265
+ children: T("common.save")
266
266
  })
267
267
  ]
268
268
  })]
269
269
  })]
270
270
  })]
271
- }), e != null && /* @__PURE__ */ G("span", {
271
+ }), e != null && /* @__PURE__ */ H("span", {
272
272
  className: "resource-team-label",
273
273
  title: e,
274
274
  children: e
275
275
  })]
276
276
  })]
277
277
  }),
278
- /* @__PURE__ */ G("span", {
278
+ /* @__PURE__ */ H("span", {
279
279
  className: "resource-flow-id-cell",
280
- children: /* @__PURE__ */ K(x, { children: [/* @__PURE__ */ G(_, {
281
- render: /* @__PURE__ */ G("code", {
280
+ children: /* @__PURE__ */ U(x, { children: [/* @__PURE__ */ H(_, {
281
+ render: /* @__PURE__ */ H("code", {
282
282
  className: "resource-flow-id",
283
283
  tabIndex: 0,
284
284
  translate: "no"
285
285
  }),
286
- children: It(n.flowId)
287
- }), /* @__PURE__ */ K(v, {
286
+ children: Bt(n.flowId)
287
+ }), /* @__PURE__ */ U(v, {
288
288
  align: "start",
289
- alignOffset: jt,
289
+ alignOffset: Ft,
290
290
  className: "resource-flow-id-tooltip",
291
291
  collisionBoundary: [],
292
292
  container: f,
293
293
  positionMethod: "fixed",
294
294
  side: "top",
295
295
  sideOffset: 6,
296
- children: [/* @__PURE__ */ G(s, {
297
- "aria-label": E(ne ? "resource.flowIdCopied" : "resource.copyFlowId"),
296
+ children: [/* @__PURE__ */ H(s, {
297
+ "aria-label": T(O ? "resource.flowIdCopied" : "resource.copyFlowId"),
298
298
  className: "resource-tooltip-icon-button",
299
299
  onClick: () => {
300
300
  navigator.clipboard.writeText(n.flowId).then(() => k(!0));
@@ -302,206 +302,206 @@ function zt({ badge: e, busy: t, flow: n, href: r, onSelect: o, store: u }) {
302
302
  size: "icon-xs",
303
303
  type: "button",
304
304
  variant: "ghost",
305
- children: /* @__PURE__ */ G("i", {
305
+ children: /* @__PURE__ */ H("i", {
306
306
  "aria-hidden": "true",
307
307
  className: "i-lucide-light:copy"
308
308
  })
309
- }), /* @__PURE__ */ G("code", {
309
+ }), /* @__PURE__ */ H("code", {
310
310
  translate: "no",
311
311
  children: n.flowId
312
312
  })]
313
313
  })] })
314
314
  }),
315
- /* @__PURE__ */ K(x, { children: [/* @__PURE__ */ G(_, {
316
- render: /* @__PURE__ */ G("time", {
315
+ /* @__PURE__ */ U(x, { children: [/* @__PURE__ */ H(_, {
316
+ render: /* @__PURE__ */ H("time", {
317
317
  className: "resource-updated-at",
318
318
  dateTime: n.updatedAt,
319
319
  tabIndex: 0
320
320
  }),
321
- children: Lt(n.updatedAt, T)
322
- }), /* @__PURE__ */ G(v, {
321
+ children: Vt(n.updatedAt, ee)
322
+ }), /* @__PURE__ */ H(v, {
323
323
  align: "center",
324
324
  collisionBoundary: [],
325
325
  container: f,
326
326
  positionMethod: "fixed",
327
327
  side: "top",
328
328
  sideOffset: 6,
329
- children: new Date(n.updatedAt).toLocaleString(T)
329
+ children: new Date(n.updatedAt).toLocaleString(ee)
330
330
  })] }),
331
- /* @__PURE__ */ K("span", {
331
+ /* @__PURE__ */ U("span", {
332
332
  className: "resource-status",
333
333
  children: [
334
- /* @__PURE__ */ G("span", {
334
+ /* @__PURE__ */ H("span", {
335
335
  "aria-hidden": "true",
336
- className: c("status-dot", ae)
336
+ className: c("status-dot", M)
337
337
  }),
338
- E(re),
339
- n.live != null && /* @__PURE__ */ K(yt, { children: [/* @__PURE__ */ G("span", {
338
+ T(ae),
339
+ n.live != null && /* @__PURE__ */ U(Ct, { children: [/* @__PURE__ */ H("span", {
340
340
  "aria-hidden": "true",
341
341
  className: "resource-status-separator",
342
342
  children: "·"
343
- }), /* @__PURE__ */ G("span", { children: E(n.live.enabled ? "resource.enabled" : "resource.disabled") })] })
343
+ }), /* @__PURE__ */ H("span", { children: T(n.live.enabled ? "resource.enabled" : "resource.disabled") })] })
344
344
  ]
345
345
  })
346
346
  ]
347
347
  }),
348
- /* @__PURE__ */ K("div", {
348
+ /* @__PURE__ */ U("div", {
349
349
  className: "resource-live-controls",
350
350
  "aria-busy": A != null,
351
- onClick: se,
351
+ onClick: P,
352
352
  children: [
353
- n.live != null && /* @__PURE__ */ G(S, {
354
- "aria-label": E("resource.enableFlow", { name: n.name }),
353
+ n.live != null && /* @__PURE__ */ H(S, {
354
+ "aria-label": T("resource.enableFlow", { name: n.name }),
355
355
  checked: n.live.enabled,
356
356
  disabled: n.status != "active" || t != null || A != null,
357
- onCheckedChange: (e) => void N(e),
357
+ onCheckedChange: (e) => void oe(e),
358
358
  size: "sm",
359
- title: E("resource.enabledHint")
359
+ title: T("resource.enabledHint")
360
360
  }),
361
- n.status == "active" && /* @__PURE__ */ G(s, {
361
+ n.status == "active" && /* @__PURE__ */ H(s, {
362
362
  onClick: () => o(n),
363
363
  size: "sm",
364
364
  variant: "outline",
365
- children: E("resource.edit")
365
+ children: T("resource.edit")
366
366
  }),
367
- /* @__PURE__ */ G(s, {
368
- disabled: n.status != "active" || t != null || A != null || n.live != null && !M,
369
- onClick: () => void N("publish"),
367
+ /* @__PURE__ */ H(s, {
368
+ disabled: n.status != "active" || t != null || A != null || n.live != null && !j,
369
+ onClick: () => void oe("publish"),
370
370
  size: "sm",
371
371
  variant: "outline",
372
- children: E(A == "publish" ? "workspace.publishing" : n.live == null ? "resource.publish" : "resource.publishUpdate")
372
+ children: T(A == "publish" ? "workspace.publishing" : n.live == null ? "resource.publish" : "resource.publishUpdate")
373
373
  }),
374
- n.status == "active" && /* @__PURE__ */ K(x, { children: [/* @__PURE__ */ G(_, {
375
- render: /* @__PURE__ */ G(s, {
376
- "aria-label": E("sidebar.deleteFlow", { name: n.name }),
374
+ n.status == "active" && /* @__PURE__ */ U(x, { children: [/* @__PURE__ */ H(_, {
375
+ render: /* @__PURE__ */ H(s, {
376
+ "aria-label": T("sidebar.deleteFlow", { name: n.name }),
377
377
  ref: y,
378
378
  disabled: t != null || A != null,
379
- onClick: () => D("delete"),
379
+ onClick: () => E("delete"),
380
380
  size: "icon-sm",
381
381
  variant: "destructive"
382
382
  }),
383
- children: /* @__PURE__ */ G("i", {
383
+ children: /* @__PURE__ */ H("i", {
384
384
  "aria-hidden": "true",
385
385
  className: "i-lucide-light:trash-2"
386
386
  })
387
- }), /* @__PURE__ */ G(v, {
387
+ }), /* @__PURE__ */ H(v, {
388
388
  align: "center",
389
389
  collisionBoundary: [],
390
390
  container: f,
391
391
  positionMethod: "fixed",
392
392
  side: "top",
393
- children: E("common.delete")
393
+ children: T("common.delete")
394
394
  })] })
395
395
  ]
396
396
  }),
397
- /* @__PURE__ */ G(ut, {
398
- open: ee == "delete",
397
+ /* @__PURE__ */ H(mt, {
398
+ open: te == "delete",
399
399
  onOpenChange: (e) => {
400
- e || D("idle");
400
+ e || E("idle");
401
401
  },
402
- children: /* @__PURE__ */ K($e, {
402
+ children: /* @__PURE__ */ U(rt, {
403
403
  container: f,
404
404
  initialFocus: w,
405
405
  finalFocus: y,
406
406
  showCloseButton: !1,
407
- children: [/* @__PURE__ */ K(et, { children: [/* @__PURE__ */ G(ot, { children: E("sidebar.deleteFlowConfirm", { name: n.name }) }), /* @__PURE__ */ G(lt, { children: E("resource.deleteDescription") })] }), /* @__PURE__ */ K(dt, { children: [/* @__PURE__ */ G(at, {
408
- render: /* @__PURE__ */ G(s, {
407
+ children: [/* @__PURE__ */ U(it, { children: [/* @__PURE__ */ H(ut, { children: T("sidebar.deleteFlowConfirm", { name: n.name }) }), /* @__PURE__ */ H(pt, { children: T("resource.deleteDescription") })] }), /* @__PURE__ */ U(ht, { children: [/* @__PURE__ */ H(lt, {
408
+ render: /* @__PURE__ */ H(s, {
409
409
  ref: w,
410
410
  variant: "outline"
411
411
  }),
412
- children: E("common.cancel")
413
- }), /* @__PURE__ */ G(s, {
412
+ children: T("common.cancel")
413
+ }), /* @__PURE__ */ H(s, {
414
414
  disabled: t != null,
415
- onClick: () => void F(),
415
+ onClick: () => void ce(),
416
416
  variant: "destructive",
417
- children: E(t == "flow" ? "common.deleting" : "common.delete")
417
+ children: T(t == "flow" ? "common.deleting" : "common.delete")
418
418
  })] })]
419
419
  })
420
420
  })
421
421
  ]
422
422
  });
423
423
  }
424
- function Bt() {
425
- return /* @__PURE__ */ K("div", {
424
+ function Wt() {
425
+ return /* @__PURE__ */ U("div", {
426
426
  "aria-hidden": "true",
427
427
  className: "resource-item-row",
428
- children: [/* @__PURE__ */ K("div", {
428
+ children: [/* @__PURE__ */ U("div", {
429
429
  className: "resource-list-row resource-skeleton-row flow-columns",
430
430
  children: [
431
- /* @__PURE__ */ K("span", {
431
+ /* @__PURE__ */ U("span", {
432
432
  className: "resource-skeleton-copy",
433
- children: [/* @__PURE__ */ G(U, { className: "h-3.5 w-36 max-w-full" }), /* @__PURE__ */ G(U, { className: "h-3 w-24 max-w-full" })]
433
+ children: [/* @__PURE__ */ H(M, { className: "h-3.5 w-36 max-w-full" }), /* @__PURE__ */ H(M, { className: "h-3 w-24 max-w-full" })]
434
434
  }),
435
- /* @__PURE__ */ G(U, { className: "h-3 w-36 max-w-full" }),
436
- /* @__PURE__ */ G(U, { className: "h-3 w-28 max-w-full" }),
437
- /* @__PURE__ */ G(U, { className: "h-3 w-16" })
435
+ /* @__PURE__ */ H(M, { className: "h-3 w-36 max-w-full" }),
436
+ /* @__PURE__ */ H(M, { className: "h-3 w-28 max-w-full" }),
437
+ /* @__PURE__ */ H(M, { className: "h-3 w-16" })
438
438
  ]
439
- }), /* @__PURE__ */ K("div", {
439
+ }), /* @__PURE__ */ U("div", {
440
440
  className: "resource-live-controls",
441
- children: [/* @__PURE__ */ G(U, { className: "h-7 w-16" }), /* @__PURE__ */ G(U, { className: "h-7 w-14" })]
441
+ children: [/* @__PURE__ */ H(M, { className: "h-7 w-16" }), /* @__PURE__ */ H(M, { className: "h-7 w-14" })]
442
442
  })]
443
443
  });
444
444
  }
445
- function Vt({ catalogWidth: e, createFlowDisabled: t, createFlowField: n, flowBadges: a, hrefForFlow: o, hostAction: l, hostTitle: u, language: d, onCreateFlow: m, onHostAction: h, onLanguageChange: g, onSelectFlow: _, store: v }) {
446
- let b = i(), x = r(v.workspace.$.busy), S = r(v.workspace.$.flowLoadFailed), C = r(v.workspace.$.flowLoadMoreFailed), T = r(v.workspace.$.flowLoading), E = r(v.workspace.$.flowLoadingMore), D = r(v.workspace.$.flowNextCursor), te = r(v.workspace.$.flowRefreshing), ne = r(v.workspace.$.flows), k = r(v.workspace.$.flowTotal), [A, j] = q(!1), [M, re] = q(""), [ie, ae] = q(""), N = M.trim().toLocaleLowerCase(), P = ne.filter((e) => e.name.toLocaleLowerCase().includes(N));
447
- async function F(e) {
445
+ function Gt({ catalogWidth: e, createFlowDisabled: t, createFlowField: n, flowBadges: a, hrefForFlow: o, hostAction: l, hostTitle: u, language: d, onCreateFlow: m, onHostAction: h, onLanguageChange: g, onSelectFlow: _, store: v }) {
446
+ let b = i(), x = r(v.workspace.$.busy), S = r(v.workspace.$.flowLoadFailed), C = r(v.workspace.$.flowLoadMoreFailed), w = r(v.workspace.$.flowLoading), T = r(v.workspace.$.flowLoadingMore), te = r(v.workspace.$.flowNextCursor), E = r(v.workspace.$.flowRefreshing), ne = r(v.workspace.$.flows), re = r(v.workspace.$.flowTotal), [O, k] = W(!1), [A, ie] = W(""), [j, ae] = W(""), M = A.trim().toLocaleLowerCase(), oe = ne.filter((e) => e.name.toLocaleLowerCase().includes(M));
447
+ async function N(e) {
448
448
  e.preventDefault();
449
- let t = ie.trim();
450
- mt(t) != null || !await m(t) || (j(!1), ae(""));
449
+ let t = j.trim();
450
+ vt(t) != null || !await m(t) || (k(!1), ae(""));
451
451
  }
452
- return /* @__PURE__ */ G("main", {
452
+ return /* @__PURE__ */ H("main", {
453
453
  className: "resource-browser",
454
454
  "data-tooltip-portal": !0,
455
- children: /* @__PURE__ */ K("div", {
455
+ children: /* @__PURE__ */ U("div", {
456
456
  className: c("resource-page", e != "default" && "resource-page-full"),
457
457
  children: [
458
- /* @__PURE__ */ G("h1", {
458
+ /* @__PURE__ */ H("h1", {
459
459
  className: "sr-only",
460
460
  children: b("resource.flows")
461
461
  }),
462
- /* @__PURE__ */ K("section", {
462
+ /* @__PURE__ */ U("section", {
463
463
  "aria-labelledby": "flow-list-title",
464
464
  className: "resource-list-section rounded-lg",
465
465
  children: [
466
- /* @__PURE__ */ K("div", {
466
+ /* @__PURE__ */ U("div", {
467
467
  className: "resource-list-title",
468
- children: [/* @__PURE__ */ K("div", {
468
+ children: [/* @__PURE__ */ U("div", {
469
469
  className: "resource-list-heading",
470
- children: [/* @__PURE__ */ G("h2", {
470
+ children: [/* @__PURE__ */ H("h2", {
471
471
  id: "flow-list-title",
472
472
  children: b("resource.all")
473
- }), !T && /* @__PURE__ */ G("span", { children: b("resource.flowCount", { count: k ?? ne.length }) })]
474
- }), /* @__PURE__ */ K("div", {
473
+ }), !w && /* @__PURE__ */ H("span", { children: b("resource.flowCount", { count: re ?? ne.length }) })]
474
+ }), /* @__PURE__ */ U("div", {
475
475
  className: "resource-list-actions",
476
476
  children: [
477
- /* @__PURE__ */ G(Ft, {
477
+ /* @__PURE__ */ H(zt, {
478
478
  language: d,
479
479
  onLanguageChange: g
480
480
  }),
481
- /* @__PURE__ */ K(y, {
481
+ /* @__PURE__ */ U(y, {
482
482
  className: "w-full sm:w-56",
483
- children: [/* @__PURE__ */ G(f, { children: /* @__PURE__ */ G(ct, {
483
+ children: [/* @__PURE__ */ H(f, { children: /* @__PURE__ */ H(ft, {
484
484
  name: "search",
485
485
  size: 17
486
- }) }), /* @__PURE__ */ G(p, {
486
+ }) }), /* @__PURE__ */ H(p, {
487
487
  autoComplete: "off",
488
488
  "aria-label": b("resource.searchByName"),
489
489
  name: "flow-search",
490
- onChange: (e) => re(e.target.value),
490
+ onChange: (e) => ie(e.target.value),
491
491
  placeholder: b("resource.searchByName"),
492
- value: M
492
+ value: A
493
493
  })]
494
494
  }),
495
- /* @__PURE__ */ K(s, {
495
+ /* @__PURE__ */ U(s, {
496
496
  className: "pr-3",
497
497
  disabled: x != null,
498
- onClick: () => j(!0),
499
- children: [/* @__PURE__ */ G(ct, {
498
+ onClick: () => k(!0),
499
+ children: [/* @__PURE__ */ H(ft, {
500
500
  "data-icon": "inline-start",
501
501
  name: "plus"
502
502
  }), b("resource.newFlow")]
503
503
  }),
504
- l != null && u != null && h != null && /* @__PURE__ */ G(xe, {
504
+ l != null && u != null && h != null && /* @__PURE__ */ H(qe, {
505
505
  action: l,
506
506
  onAction: h,
507
507
  title: u
@@ -509,69 +509,69 @@ function Vt({ catalogWidth: e, createFlowDisabled: t, createFlowField: n, flowBa
509
509
  ]
510
510
  })]
511
511
  }),
512
- /* @__PURE__ */ K("div", {
512
+ /* @__PURE__ */ U("div", {
513
513
  "aria-hidden": "true",
514
514
  className: "resource-list-columns-shell",
515
- children: [/* @__PURE__ */ K("div", {
515
+ children: [/* @__PURE__ */ U("div", {
516
516
  className: "resource-list-columns flow-columns",
517
517
  children: [
518
- /* @__PURE__ */ G("span", { children: b("resource.name") }),
519
- /* @__PURE__ */ G("span", {
518
+ /* @__PURE__ */ H("span", { children: b("resource.name") }),
519
+ /* @__PURE__ */ H("span", {
520
520
  className: "resource-flow-id-heading",
521
521
  children: b("resource.flowId")
522
522
  }),
523
- /* @__PURE__ */ G("span", {
523
+ /* @__PURE__ */ H("span", {
524
524
  className: "resource-updated-heading",
525
525
  children: b("resource.updated")
526
526
  }),
527
- /* @__PURE__ */ G("span", { children: b("resource.status") })
527
+ /* @__PURE__ */ H("span", { children: b("resource.status") })
528
528
  ]
529
- }), /* @__PURE__ */ G("span", {
529
+ }), /* @__PURE__ */ H("span", {
530
530
  className: "resource-actions-heading",
531
531
  children: b("resource.actions")
532
532
  })]
533
533
  }),
534
- /* @__PURE__ */ G("div", {
534
+ /* @__PURE__ */ H("div", {
535
535
  className: "resource-list",
536
- children: T ? Array.from({ length: 5 }, (e, t) => /* @__PURE__ */ G(Bt, {}, t)) : S ? /* @__PURE__ */ K(w, {
536
+ children: w ? Array.from({ length: 5 }, (e, t) => /* @__PURE__ */ H(Wt, {}, t)) : S ? /* @__PURE__ */ U(Qe, {
537
537
  className: "min-h-64",
538
538
  role: "alert",
539
- children: [/* @__PURE__ */ K(oe, { children: [
540
- /* @__PURE__ */ G(le, {
539
+ children: [/* @__PURE__ */ U(D, { children: [
540
+ /* @__PURE__ */ H(ce, {
541
541
  variant: "icon",
542
- children: /* @__PURE__ */ G(ct, {
542
+ children: /* @__PURE__ */ H(ft, {
543
543
  name: "alert",
544
544
  size: 20
545
545
  })
546
546
  }),
547
- /* @__PURE__ */ G(ee, { children: b("resource.flowsLoadFailed") }),
548
- /* @__PURE__ */ G(O, { children: b("resource.flowsLoadFailedDescription") })
549
- ] }), /* @__PURE__ */ G(se, { children: /* @__PURE__ */ G(s, {
547
+ /* @__PURE__ */ H(de, { children: b("resource.flowsLoadFailed") }),
548
+ /* @__PURE__ */ H(le, { children: b("resource.flowsLoadFailedDescription") })
549
+ ] }), /* @__PURE__ */ H(ee, { children: /* @__PURE__ */ H(s, {
550
550
  onClick: () => void v.retryFlows(),
551
551
  variant: "outline",
552
552
  children: b("empty.retry")
553
553
  }) })]
554
- }) : P.length == 0 ? /* @__PURE__ */ K(w, {
554
+ }) : oe.length == 0 ? /* @__PURE__ */ U(Qe, {
555
555
  className: "min-h-64",
556
- children: [/* @__PURE__ */ K(oe, { children: [
557
- /* @__PURE__ */ G(le, {
556
+ children: [/* @__PURE__ */ U(D, { children: [
557
+ /* @__PURE__ */ H(ce, {
558
558
  variant: "icon",
559
- children: /* @__PURE__ */ G(ct, {
559
+ children: /* @__PURE__ */ H(ft, {
560
560
  name: "flow",
561
561
  size: 20
562
562
  })
563
563
  }),
564
- /* @__PURE__ */ G(ee, { children: b(N.length == 0 ? "resource.noFlows" : "resource.noMatchingFlows") }),
565
- /* @__PURE__ */ G(O, { children: b(N.length == 0 ? "resource.noFlowsDescription" : "resource.noMatchingDescription") })
566
- ] }), N.length == 0 && /* @__PURE__ */ G(se, { children: /* @__PURE__ */ K(s, {
567
- onClick: () => j(!0),
564
+ /* @__PURE__ */ H(de, { children: b(M.length == 0 ? "resource.noFlows" : "resource.noMatchingFlows") }),
565
+ /* @__PURE__ */ H(le, { children: b(M.length == 0 ? "resource.noFlowsDescription" : "resource.noMatchingDescription") })
566
+ ] }), M.length == 0 && /* @__PURE__ */ H(ee, { children: /* @__PURE__ */ U(s, {
567
+ onClick: () => k(!0),
568
568
  variant: "outline",
569
- children: [/* @__PURE__ */ G(ct, {
569
+ children: [/* @__PURE__ */ H(ft, {
570
570
  "data-icon": "inline-start",
571
571
  name: "plus"
572
572
  }), b("resource.newFlow")]
573
573
  }) })]
574
- }) : P.map((e) => /* @__PURE__ */ G(zt, {
574
+ }) : oe.map((e) => /* @__PURE__ */ H(Ut, {
575
575
  badge: a?.[e.flowId],
576
576
  busy: x,
577
577
  flow: e,
@@ -580,29 +580,29 @@ function Vt({ catalogWidth: e, createFlowDisabled: t, createFlowField: n, flowBa
580
580
  store: v
581
581
  }, e.flowId))
582
582
  }),
583
- D != null && /* @__PURE__ */ G("div", {
583
+ te != null && /* @__PURE__ */ H("div", {
584
584
  className: "resource-list-footer",
585
- children: /* @__PURE__ */ G(s, {
586
- disabled: E || te,
585
+ children: /* @__PURE__ */ H(s, {
586
+ disabled: T || E,
587
587
  onClick: () => void v.workspace.loadMoreFlows(),
588
588
  variant: "outline",
589
- children: b(E ? "resource.loadingMore" : C ? "resource.retryLoadMore" : "resource.loadMore")
589
+ children: b(T ? "resource.loadingMore" : C ? "resource.retryLoadMore" : "resource.loadMore")
590
590
  })
591
591
  })
592
592
  ]
593
593
  }),
594
- A && /* @__PURE__ */ G(bt, {
594
+ O && /* @__PURE__ */ H(wt, {
595
595
  fallback: null,
596
- children: /* @__PURE__ */ G(kt, {
596
+ children: /* @__PURE__ */ H(Nt, {
597
597
  disabled: t,
598
598
  field: n,
599
599
  id: "flow-name",
600
- issue: mt(ie),
600
+ issue: vt(j),
601
601
  label: b("resource.flowName"),
602
- name: ie,
602
+ name: j,
603
603
  onNameChange: ae,
604
- onOpenChange: j,
605
- onSubmit: (e) => void F(e),
604
+ onOpenChange: k,
605
+ onSubmit: (e) => void N(e),
606
606
  pending: x == "flow",
607
607
  title: b("resource.newFlow")
608
608
  })
@@ -613,28 +613,28 @@ function Vt({ catalogWidth: e, createFlowDisabled: t, createFlowField: n, flowBa
613
613
  }
614
614
  //#endregion
615
615
  //#region ../../node_modules/.bun/dequal@2.0.3/node_modules/dequal/dist/index.mjs
616
- var Ht = Object.prototype.hasOwnProperty;
617
- function Ut(e, t, n) {
618
- for (n of e.keys()) if (Wt(n, t)) return n;
616
+ var Kt = Object.prototype.hasOwnProperty;
617
+ function qt(e, t, n) {
618
+ for (n of e.keys()) if (K(n, t)) return n;
619
619
  }
620
- function Wt(e, t) {
620
+ function K(e, t) {
621
621
  var n, r, i;
622
622
  if (e === t) return !0;
623
623
  if (e && t && (n = e.constructor) === t.constructor) {
624
624
  if (n === Date) return e.getTime() === t.getTime();
625
625
  if (n === RegExp) return e.toString() === t.toString();
626
626
  if (n === Array) {
627
- if ((r = e.length) === t.length) for (; r-- && Wt(e[r], t[r]););
627
+ if ((r = e.length) === t.length) for (; r-- && K(e[r], t[r]););
628
628
  return r === -1;
629
629
  }
630
630
  if (n === Set) {
631
631
  if (e.size !== t.size) return !1;
632
- for (r of e) if (i = r, i && typeof i == "object" && (i = Ut(t, i), !i) || !t.has(i)) return !1;
632
+ for (r of e) if (i = r, i && typeof i == "object" && (i = qt(t, i), !i) || !t.has(i)) return !1;
633
633
  return !0;
634
634
  }
635
635
  if (n === Map) {
636
636
  if (e.size !== t.size) return !1;
637
- for (r of e) if (i = r[0], i && typeof i == "object" && (i = Ut(t, i), !i) || !Wt(r[1], t.get(i))) return !1;
637
+ for (r of e) if (i = r[0], i && typeof i == "object" && (i = qt(t, i), !i) || !K(r[1], t.get(i))) return !1;
638
638
  return !0;
639
639
  }
640
640
  if (n === ArrayBuffer) e = new Uint8Array(e), t = new Uint8Array(t);
@@ -647,7 +647,7 @@ function Wt(e, t) {
647
647
  return r === -1;
648
648
  }
649
649
  if (!n || typeof e == "object") {
650
- for (n in r = 0, e) if (Ht.call(e, n) && ++r && !Ht.call(t, n) || !(n in t) || !Wt(e[n], t[n])) return !1;
650
+ for (n in r = 0, e) if (Kt.call(e, n) && ++r && !Kt.call(t, n) || !(n in t) || !K(e[n], t[n])) return !1;
651
651
  return Object.keys(t).length === r;
652
652
  }
653
653
  }
@@ -655,7 +655,7 @@ function Wt(e, t) {
655
655
  }
656
656
  //#endregion
657
657
  //#region ../../node_modules/.bun/nanoid@6.0.1/node_modules/nanoid/index.browser.js
658
- var Gt = (e) => crypto.getRandomValues(new Uint8Array(e)), Kt = (e, t, n) => {
658
+ var Jt = (e) => crypto.getRandomValues(new Uint8Array(e)), Yt = (e, t, n) => {
659
659
  let r = 256 - 256 % e.length;
660
660
  if (r === 256) {
661
661
  let r = e.length - 1;
@@ -677,29 +677,29 @@ var Gt = (e) => crypto.getRandomValues(new Uint8Array(e)), Kt = (e, t, n) => {
677
677
  for (; s--;) if (t[s] < r && (o += e[t[s] % e.length], o.length >= a)) return o;
678
678
  }
679
679
  };
680
- }, qt = (e, t = 21) => Kt(e, t | 0, Gt);
680
+ }, Xt = (e, t = 21) => Yt(e, t | 0, Jt);
681
681
  //#endregion
682
682
  //#region src/flow/common/edgeChanges.ts
683
- function Jt(e, t, n) {
684
- return Xt(e, t)?.edges.some((e) => u(e, n)) ? [] : [{
683
+ function Zt(e, t, n) {
684
+ return $t(e, t)?.edges.some((e) => u(e, n)) ? [] : [{
685
685
  edge: n,
686
686
  kind: "graph.edge.connect",
687
687
  target: t
688
688
  }];
689
689
  }
690
- function Yt(e, t, n) {
691
- return Xt(e, t)?.edges.some((e) => u(e, n)) ? [{
690
+ function Qt(e, t, n) {
691
+ return $t(e, t)?.edges.some((e) => u(e, n)) ? [{
692
692
  edge: n,
693
693
  kind: "graph.edge.disconnect",
694
694
  target: t
695
695
  }] : [];
696
696
  }
697
- function Xt(e, t) {
697
+ function $t(e, t) {
698
698
  return t.kind == "flow" ? e.document.graph : e.document.subflows[t.id]?.graph;
699
699
  }
700
700
  //#endregion
701
701
  //#region src/flow/common/moduleChanges.ts
702
- async function Zt(e) {
702
+ async function en(e) {
703
703
  try {
704
704
  let { parse: t } = await import("./lib-C5Ipyfps.js").then((e) => e.t), n = t(e, {
705
705
  errorRecovery: !0,
@@ -715,7 +715,7 @@ async function Zt(e) {
715
715
  return [];
716
716
  }
717
717
  }
718
- function Qt(e, t, n, r, i) {
718
+ function tn(e, t, n, r, i) {
719
719
  return [{
720
720
  beforeImports: n,
721
721
  beforeSource: t,
@@ -725,51 +725,51 @@ function Qt(e, t, n, r, i) {
725
725
  source: r
726
726
  }];
727
727
  }
728
- var $t = qt("23456789abcdefghjkmnpqrstuvwxyz", 10);
728
+ var nn = Xt("23456789abcdefghjkmnpqrstuvwxyz", 10);
729
729
  //#endregion
730
730
  //#region src/workbench/browser/runtime/canvasPresentation.ts
731
- function Y(e) {
731
+ function q(e) {
732
732
  if (!(typeof e != "object" || !e || Array.isArray(e))) return e;
733
733
  }
734
- function en(e) {
734
+ function rn(e) {
735
735
  return typeof e == "number" && Number.isFinite(e) ? e : void 0;
736
736
  }
737
- function X(e, t) {
738
- let n = Y(e.designer);
739
- if (n?.version == 1) return on(n, t);
737
+ function J(e, t) {
738
+ let n = q(e.designer);
739
+ if (n?.version == 1) return ln(n, t);
740
740
  }
741
- function tn(e, t) {
742
- return ((e) => Object.fromEntries(Object.entries(Y(e) ?? {}).flatMap(([e, t]) => {
743
- let n = Y(t), r = en(n?.x), i = en(n?.y);
741
+ function an(e, t) {
742
+ return ((e) => Object.fromEntries(Object.entries(q(e) ?? {}).flatMap(([e, t]) => {
743
+ let n = q(t), r = rn(n?.x), i = rn(n?.y);
744
744
  return r == null || i == null ? [] : [[e, {
745
745
  x: r,
746
746
  y: i
747
747
  }]];
748
- })))(X(e, t)?.nodes);
748
+ })))(J(e, t)?.nodes);
749
749
  }
750
- function Z(e, t) {
751
- let n = tn(e, t), r = X(e, t)?.order, i = Array.isArray(r) ? r.flatMap((e) => typeof e == "string" && n[e] != null ? [e] : []) : [];
750
+ function Y(e, t) {
751
+ let n = an(e, t), r = J(e, t)?.order, i = Array.isArray(r) ? r.flatMap((e) => typeof e == "string" && n[e] != null ? [e] : []) : [];
752
752
  return [.../* @__PURE__ */ new Set([...i, ...Object.keys(n)])];
753
753
  }
754
- function nn(e, t) {
755
- let n = Y(X(e, t)?.viewport), r = en(n?.x), i = en(n?.y), a = en(n?.zoom);
754
+ function on(e, t) {
755
+ let n = q(J(e, t)?.viewport), r = rn(n?.x), i = rn(n?.y), a = rn(n?.zoom);
756
756
  return r == null || i == null || a == null || a <= 0 ? void 0 : {
757
757
  x: r,
758
758
  y: i,
759
759
  zoom: a
760
760
  };
761
761
  }
762
- function rn(e, t) {
763
- return nn(e, t) ?? {
762
+ function sn(e, t) {
763
+ return on(e, t) ?? {
764
764
  x: 0,
765
765
  y: 0,
766
766
  zoom: 1
767
767
  };
768
768
  }
769
- function an(e, t, n) {
770
- let r = Y(X(e, t)?.comments) ?? {};
769
+ function cn(e, t, n) {
770
+ let r = q(J(e, t)?.comments) ?? {};
771
771
  return Object.fromEntries(Object.entries(r).flatMap(([e, t]) => {
772
- let r = Y(t), i = typeof r?.title == "string" ? r.title : void 0, a = typeof r?.content == "string" ? r.content : void 0;
772
+ let r = q(t), i = typeof r?.title == "string" ? r.title : void 0, a = typeof r?.content == "string" ? r.content : void 0;
773
773
  return i == null || a == null ? [] : [[e, {
774
774
  content: a,
775
775
  position: n[e] ?? {
@@ -780,20 +780,20 @@ function an(e, t, n) {
780
780
  }]];
781
781
  }));
782
782
  }
783
- function Q(e) {
784
- let t = Y(e.designer);
783
+ function X(e) {
784
+ let t = q(e.designer);
785
785
  return t?.version == 1 ? t : { version: 1 };
786
786
  }
787
- function on(e, t) {
788
- return t.kind == "flow" ? Y(e.flow) : Y(Y(e.subflows)?.[t.id]);
787
+ function ln(e, t) {
788
+ return t.kind == "flow" ? q(e.flow) : q(q(e.subflows)?.[t.id]);
789
789
  }
790
- function sn(e, t, n) {
790
+ function Z(e, t, n) {
791
791
  if (t.kind == "flow") return {
792
792
  ...e,
793
793
  flow: n,
794
794
  version: 1
795
795
  };
796
- let r = Y(e.subflows) ?? {};
796
+ let r = q(e.subflows) ?? {};
797
797
  return {
798
798
  ...e,
799
799
  subflows: {
@@ -803,17 +803,17 @@ function sn(e, t, n) {
803
803
  version: 1
804
804
  };
805
805
  }
806
- function $(e, t) {
806
+ function Q(e, t) {
807
807
  let n = {
808
- ...X(e, t),
809
- viewport: { ...rn(e, t) },
810
- nodes: tn(e, t),
811
- order: Z(e, t)
808
+ ...J(e, t),
809
+ viewport: { ...sn(e, t) },
810
+ nodes: an(e, t),
811
+ order: Y(e, t)
812
812
  };
813
813
  return delete n.layouts, n;
814
814
  }
815
- function cn(e, t, n) {
816
- let r = Q(e), i = $(e, t), a = Y(i.nodes) ?? {}, o = [...Z(e, t)];
815
+ function un(e, t, n) {
816
+ let r = X(e), i = Q(e, t), a = q(i.nodes) ?? {}, o = [...Y(e, t)];
817
817
  for (let e of Object.keys(n)) o.includes(e) || o.push(e);
818
818
  let s = {
819
819
  ...a,
@@ -824,29 +824,29 @@ function cn(e, t, n) {
824
824
  };
825
825
  return {
826
826
  ...e,
827
- designer: sn(r, t, {
827
+ designer: Z(r, t, {
828
828
  ...i,
829
829
  nodes: s,
830
830
  order: o
831
831
  })
832
832
  };
833
833
  }
834
- function ln(e, t, n, r) {
835
- if (Y(X(e, t)?.hiddenNodeContent)?.[n] === !0 === r) return e;
836
- let i = $(e, t), a = { ...Y(i.hiddenNodeContent) };
834
+ function dn(e, t, n, r) {
835
+ if (q(J(e, t)?.hiddenNodeContent)?.[n] === !0 === r) return e;
836
+ let i = Q(e, t), a = { ...q(i.hiddenNodeContent) };
837
837
  return r ? a[n] = !0 : delete a[n], {
838
838
  ...e,
839
- designer: sn(Q(e), t, {
839
+ designer: Z(X(e), t, {
840
840
  ...i,
841
841
  hiddenNodeContent: a
842
842
  })
843
843
  };
844
844
  }
845
- function un(e, t, n, r) {
846
- let i = cn(e, t, { [n]: r.position }), a = Q(i), o = on(a, t) ?? {}, s = Y(o.comments) ?? {};
845
+ function fn(e, t, n, r) {
846
+ let i = un(e, t, { [n]: r.position }), a = X(i), o = ln(a, t) ?? {}, s = q(o.comments) ?? {};
847
847
  return {
848
848
  ...i,
849
- designer: sn(a, t, {
849
+ designer: Z(a, t, {
850
850
  ...o,
851
851
  comments: {
852
852
  ...s,
@@ -858,13 +858,13 @@ function un(e, t, n, r) {
858
858
  })
859
859
  };
860
860
  }
861
- function dn(e, t, n) {
862
- let r = Q(e), i = $(e, t), a = { ...Y(i.comments) }, o = { ...Y(i.nodes) };
861
+ function pn(e, t, n) {
862
+ let r = X(e), i = Q(e, t), a = { ...q(i.comments) }, o = { ...q(i.nodes) };
863
863
  for (let e of n) delete a[e], delete o[e];
864
- let s = Z(e, t).filter((e) => !n.has(e));
864
+ let s = Y(e, t).filter((e) => !n.has(e));
865
865
  return {
866
866
  ...e,
867
- designer: sn(r, t, {
867
+ designer: Z(r, t, {
868
868
  ...i,
869
869
  comments: a,
870
870
  nodes: o,
@@ -872,16 +872,16 @@ function dn(e, t, n) {
872
872
  })
873
873
  };
874
874
  }
875
- function fn(e, t) {
876
- return new Set(Object.keys(Y(X(e, t)?.comments) ?? {}));
875
+ function mn(e, t) {
876
+ return new Set(Object.keys(q(J(e, t)?.comments) ?? {}));
877
877
  }
878
- function pn(e, t, n) {
879
- let r = nn(e, t);
878
+ function hn(e, t, n) {
879
+ let r = on(e, t);
880
880
  if (r?.x == n.x && r.y == n.y && r.zoom == n.zoom) return e;
881
- let i = Q(e), a = $(e, t);
881
+ let i = X(e), a = Q(e, t);
882
882
  return {
883
883
  ...e,
884
- designer: sn(i, t, {
884
+ designer: Z(i, t, {
885
885
  ...a,
886
886
  viewport: {
887
887
  x: n.x,
@@ -891,52 +891,52 @@ function pn(e, t, n) {
891
891
  })
892
892
  };
893
893
  }
894
- function mn(e, t, n) {
895
- let r = $(e, n), i = $(t, n), a = /* @__PURE__ */ new Set();
894
+ function gn(e, t, n) {
895
+ let r = Q(e, n), i = Q(t, n), a = /* @__PURE__ */ new Set();
896
896
  for (let e of [
897
897
  "nodes",
898
898
  "comments",
899
899
  "hiddenNodeContent"
900
900
  ]) {
901
- let t = Y(r[e]) ?? {}, n = Y(i[e]) ?? {};
901
+ let t = q(r[e]) ?? {}, n = q(i[e]) ?? {};
902
902
  for (let e of /* @__PURE__ */ new Set([...Object.keys(t), ...Object.keys(n)])) u(t[e], n[e]) || a.add(e);
903
903
  }
904
904
  let o = (e) => Object.fromEntries([
905
905
  "nodes",
906
906
  "comments",
907
907
  "hiddenNodeContent"
908
- ].map((t) => [t, Object.fromEntries(Object.entries(Y(e[t]) ?? {}).filter(([e]) => a.has(e)))]));
908
+ ].map((t) => [t, Object.fromEntries(Object.entries(q(e[t]) ?? {}).filter(([e]) => a.has(e)))]));
909
909
  return {
910
910
  before: o(r),
911
911
  after: o(i),
912
912
  nodeIds: [...a],
913
- beforeOrder: Z(e, n),
914
- afterOrder: Z(t, n)
913
+ beforeOrder: Y(e, n),
914
+ afterOrder: Y(t, n)
915
915
  };
916
916
  }
917
- function hn(e, t, n, r) {
917
+ function _n(e, t, n, r) {
918
918
  if (n.nodeIds.length == 0) return e;
919
- let i = $(e, t), a = r ? n.after : n.before;
919
+ let i = Q(e, t), a = r ? n.after : n.before;
920
920
  for (let e of [
921
921
  "nodes",
922
922
  "comments",
923
923
  "hiddenNodeContent"
924
924
  ]) {
925
- let t = { ...Y(i[e]) }, r = Y(a[e]) ?? {};
925
+ let t = { ...q(i[e]) }, r = q(a[e]) ?? {};
926
926
  for (let e of n.nodeIds) r[e] == null ? delete t[e] : t[e] = r[e];
927
927
  i[e] = t;
928
928
  }
929
929
  return i.order = [...r ? n.afterOrder : n.beforeOrder], {
930
930
  ...e,
931
- designer: sn(Q(e), t, i)
931
+ designer: Z(X(e), t, i)
932
932
  };
933
933
  }
934
- function gn(e, t) {
935
- return Y(X(e, t)?.hiddenNodeContent);
934
+ function vn(e, t) {
935
+ return q(J(e, t)?.hiddenNodeContent);
936
936
  }
937
937
  //#endregion
938
938
  //#region src/workbench/browser/runtime/publications/publicationStore.ts
939
- var _n = {
939
+ var yn = {
940
940
  activities: [],
941
941
  activitiesLoadFailed: !1,
942
942
  activitiesLoading: !1,
@@ -951,25 +951,25 @@ var _n = {
951
951
  publications: [],
952
952
  publishing: !1,
953
953
  refreshing: !1
954
- }, vn = 20, yn = 50, bn = 750;
955
- function xn(e, t) {
954
+ }, bn = 20, xn = 50, Sn = 750;
955
+ function Cn(e, t) {
956
956
  return e?.flowId == t.flowId;
957
957
  }
958
- var Sn = class {
958
+ var wn = class {
959
959
  #e;
960
960
  #t;
961
961
  #n;
962
- #r = new I();
963
- #i = new I();
962
+ #r = new E();
963
+ #i = new E();
964
964
  #a;
965
- #o = new I();
966
- #s = new I();
965
+ #o = new E();
966
+ #s = new E();
967
967
  #c;
968
- #l = n(_n);
968
+ #l = n(yn);
969
969
  #u;
970
970
  #d;
971
971
  #f;
972
- constructor(t, n, r, i, a = C, o = h()) {
972
+ constructor(t, n, r, i, a = j, o = h()) {
973
973
  this.#e = t, this.#t = a, this.#n = o, this.#a = i, this.#c = r, this.#u = n, this.$ = {
974
974
  activities: e(this.#l, (e) => e.activities),
975
975
  activitiesLoadFailed: e(this.#l, (e) => e.activitiesLoadFailed),
@@ -1003,17 +1003,17 @@ var Sn = class {
1003
1003
  this.#l.dispose();
1004
1004
  }
1005
1005
  reset() {
1006
- this.#r.invalidate(), this.#i.invalidate(), this.#y(), this.#o.invalidate(), this.#s.invalidate(), this.#f = void 0, this.#l.set(_n);
1006
+ this.#r.invalidate(), this.#i.invalidate(), this.#y(), this.#o.invalidate(), this.#s.invalidate(), this.#f = void 0, this.#l.set(yn);
1007
1007
  }
1008
1008
  async load(e) {
1009
- let t = { flowId: e }, n = this.#l.value, r = n.loaded && xn(n.target, t), i = this.#r.begin();
1010
- xn(n.target, t) || (this.#i.invalidate(), this.#y(), this.#f = void 0), r ? this.#S({
1009
+ let t = { flowId: e }, n = this.#l.value, r = n.loaded && Cn(n.target, t), i = this.#r.begin();
1010
+ Cn(n.target, t) || (this.#i.invalidate(), this.#y(), this.#f = void 0), r ? this.#S({
1011
1011
  loadFailed: !1,
1012
1012
  loadingMore: !1,
1013
1013
  loadMoreFailed: !1,
1014
1014
  refreshing: !0
1015
1015
  }) : this.#l.set({
1016
- ..._n,
1016
+ ...yn,
1017
1017
  loading: !0,
1018
1018
  target: t
1019
1019
  });
@@ -1043,7 +1043,7 @@ var Sn = class {
1043
1043
  loadFailed: !r,
1044
1044
  loading: !1,
1045
1045
  refreshing: !1
1046
- }), this.#c(L(e, this.#n.t));
1046
+ }), this.#c(F(e, this.#n.t));
1047
1047
  }
1048
1048
  }
1049
1049
  async loadMore() {
@@ -1057,7 +1057,7 @@ var Sn = class {
1057
1057
  try {
1058
1058
  let e = await this.#e.listPublications(n.flowId, {
1059
1059
  cursor: t,
1060
- limit: yn
1060
+ limit: xn
1061
1061
  });
1062
1062
  if (!r()) return;
1063
1063
  let i = new Set(this.#l.value.publications.map((e) => e.publicationId));
@@ -1072,7 +1072,7 @@ var Sn = class {
1072
1072
  this.#S({
1073
1073
  loadMoreFailed: !0,
1074
1074
  loadingMore: !1
1075
- }), this.#c(L(e, this.#n.t));
1075
+ }), this.#c(F(e, this.#n.t));
1076
1076
  }
1077
1077
  }
1078
1078
  async publish() {
@@ -1099,7 +1099,7 @@ var Sn = class {
1099
1099
  publishing: e.status == "pending"
1100
1100
  }), await this.#_(r, e, s, t.name)) : !1;
1101
1101
  } catch (e) {
1102
- return s() ? (e instanceof H && e.code == "live.conflict" && await this.#m(r), this.#c(L(e, this.#n.t)), !1) : !1;
1102
+ return s() ? (e instanceof I && e.code == "live.conflict" && await this.#m(r), this.#c(F(e, this.#n.t)), !1) : !1;
1103
1103
  } finally {
1104
1104
  s() && this.#S({ publishing: !1 });
1105
1105
  }
@@ -1125,7 +1125,7 @@ var Sn = class {
1125
1125
  message: this.#n.t("notice.rolledBack", { revision: e.revisionId })
1126
1126
  }), !0);
1127
1127
  } catch (e) {
1128
- return s() ? (e instanceof H && e.code == "live.conflict" && await this.#m(r), this.#c(L(e, this.#n.t)), !1) : !1;
1128
+ return s() ? (e instanceof I && e.code == "live.conflict" && await this.#m(r), this.#c(F(e, this.#n.t)), !1) : !1;
1129
1129
  } finally {
1130
1130
  s() && this.#S({ rollingBackPublicationId: void 0 });
1131
1131
  }
@@ -1160,13 +1160,13 @@ var Sn = class {
1160
1160
  testingTriggerId: void 0,
1161
1161
  testResult: void 0
1162
1162
  });
1163
- let [r, i] = await Promise.allSettled([this.#e.getFlowTriggerBinding(t.flowId, e), this.#e.listFlowTriggerActivities(t.flowId, e, { limit: vn })]);
1163
+ let [r, i] = await Promise.allSettled([this.#e.getFlowTriggerBinding(t.flowId, e), this.#e.listFlowTriggerActivities(t.flowId, e, { limit: bn })]);
1164
1164
  if (n()) {
1165
1165
  if (r.status == "rejected") {
1166
1166
  this.#S({
1167
1167
  activitiesLoading: !1,
1168
1168
  detailLoading: !1
1169
- }), this.#c(L(r.reason, this.#n.t));
1169
+ }), this.#c(F(r.reason, this.#n.t));
1170
1170
  return;
1171
1171
  }
1172
1172
  this.#S({
@@ -1180,7 +1180,7 @@ var Sn = class {
1180
1180
  }) : (this.#S({
1181
1181
  activitiesLoadFailed: !0,
1182
1182
  activitiesLoading: !1
1183
- }), this.#c(L(i.reason, this.#n.t)));
1183
+ }), this.#c(F(i.reason, this.#n.t)));
1184
1184
  }
1185
1185
  }
1186
1186
  async loadMoreTriggerActivities() {
@@ -1194,7 +1194,7 @@ var Sn = class {
1194
1194
  try {
1195
1195
  let e = await this.#e.listFlowTriggerActivities(r.flowId, n, {
1196
1196
  cursor: t,
1197
- limit: vn
1197
+ limit: bn
1198
1198
  });
1199
1199
  if (!i() || this.#l.value.selectedTriggerId != n) return;
1200
1200
  let a = new Set(this.#l.value.activities.map((e) => e.activityId));
@@ -1209,7 +1209,7 @@ var Sn = class {
1209
1209
  this.#S({
1210
1210
  activitiesLoadFailed: !0,
1211
1211
  activitiesLoadingMore: !1
1212
- }), this.#c(L(e, this.#n.t));
1212
+ }), this.#c(F(e, this.#n.t));
1213
1213
  }
1214
1214
  }
1215
1215
  async testTrigger() {
@@ -1224,7 +1224,7 @@ var Sn = class {
1224
1224
  let e = await this.#e.testFlowPollTrigger(n.flowId, t);
1225
1225
  return !i() || this.#l.value.selectedTriggerId != t ? !1 : (this.#S({ testResult: e }), !0);
1226
1226
  } catch (e) {
1227
- return i() && this.#l.value.selectedTriggerId == t && this.#c(L(e, this.#n.t)), !1;
1227
+ return i() && this.#l.value.selectedTriggerId == t && this.#c(F(e, this.#n.t)), !1;
1228
1228
  } finally {
1229
1229
  i() && this.#l.value.selectedTriggerId == t && this.#S({ testingTriggerId: void 0 });
1230
1230
  }
@@ -1243,16 +1243,16 @@ var Sn = class {
1243
1243
  message: this.#n.t(e.operatorState == "active" ? "notice.triggerPaused" : "notice.triggerResumed")
1244
1244
  }), !0) : !1;
1245
1245
  } catch (e) {
1246
- return n() && this.#c(L(e, this.#n.t)), !1;
1246
+ return n() && this.#c(F(e, this.#n.t)), !1;
1247
1247
  } finally {
1248
1248
  n() && this.#S({ changingTriggerId: void 0 });
1249
1249
  }
1250
1250
  }
1251
1251
  async #p(e, t) {
1252
1252
  let n = this.#r.begin(), [r, i, a] = await this.#h(e, t).catch((t) => {
1253
- throw n() && xn(this.#l.value.target, e) && this.#S({ refreshing: !1 }), t;
1253
+ throw n() && Cn(this.#l.value.target, e) && this.#S({ refreshing: !1 }), t;
1254
1254
  });
1255
- t?.throwIfAborted(), n() && this.#u.updateLive(r), n() && xn(this.#l.value.target, e) && this.#S({
1255
+ t?.throwIfAborted(), n() && this.#u.updateLive(r), n() && Cn(this.#l.value.target, e) && this.#S({
1256
1256
  bindings: a,
1257
1257
  live: r,
1258
1258
  loaded: !0,
@@ -1276,7 +1276,7 @@ var Sn = class {
1276
1276
  this.#e.getLive(e.flowId, t),
1277
1277
  this.#e.listPublications(e.flowId, {
1278
1278
  includeTotal: !0,
1279
- limit: yn
1279
+ limit: xn
1280
1280
  }, t),
1281
1281
  this.#e.listFlowTriggerBindings(e.flowId, t)
1282
1282
  ]);
@@ -1286,7 +1286,7 @@ var Sn = class {
1286
1286
  if (t != null && t != "") try {
1287
1287
  return await this.#e.getPublishOperation(e.flowId, t);
1288
1288
  } catch (t) {
1289
- if (t instanceof H && t.code == "publication.operation-not-found") {
1289
+ if (t instanceof I && t.code == "publication.operation-not-found") {
1290
1290
  this.#a.setItem(this.#b(e.flowId), "");
1291
1291
  return;
1292
1292
  }
@@ -1295,7 +1295,7 @@ var Sn = class {
1295
1295
  }
1296
1296
  async #_(e, t, n, r) {
1297
1297
  this.#y();
1298
- let i = J.runFork(J.gen({ self: this }, function* () {
1298
+ let i = G.runFork(G.gen({ self: this }, function* () {
1299
1299
  let i = yield* this.#v(e, t, n);
1300
1300
  if (i == null || !n()) return !1;
1301
1301
  if (this.#f = void 0, this.#x(e, {
@@ -1305,11 +1305,11 @@ var Sn = class {
1305
1305
  kind: "error",
1306
1306
  message: i.issue.message
1307
1307
  }), !1;
1308
- let a = yield* J.tryPromise({
1308
+ let a = yield* G.tryPromise({
1309
1309
  try: (t) => this.#p(e, t),
1310
1310
  catch: (e) => e
1311
- }).pipe(J.match({
1312
- onFailure: (e) => (n() && this.#c(L(e, this.#n.t)), !1),
1311
+ }).pipe(G.match({
1312
+ onFailure: (e) => (n() && this.#c(F(e, this.#n.t)), !1),
1313
1313
  onSuccess: () => !0
1314
1314
  }));
1315
1315
  return n() ? (a && this.#c({
@@ -1318,34 +1318,34 @@ var Sn = class {
1318
1318
  }), !0) : !1;
1319
1319
  }));
1320
1320
  this.#d = i;
1321
- let a = await J.runPromiseExit(Et.join(i));
1322
- if (Tt.isSuccess(a)) return a.value;
1323
- if (wt.hasInterruptsOnly(a.cause)) return !1;
1324
- throw wt.squash(a.cause);
1321
+ let a = await G.runPromiseExit(At.join(i));
1322
+ if (kt.isSuccess(a)) return a.value;
1323
+ if (Ot.hasInterruptsOnly(a.cause)) return !1;
1324
+ throw Ot.squash(a.cause);
1325
1325
  }
1326
1326
  #v(e, t, n) {
1327
- return J.gen({ self: this }, function* () {
1327
+ return G.gen({ self: this }, function* () {
1328
1328
  let r = t;
1329
1329
  for (; r.status == "pending";) {
1330
- if (yield* J.sleep(bn), !n()) return;
1331
- let t = yield* J.tryPromise({
1330
+ if (yield* G.sleep(Sn), !n()) return;
1331
+ let t = yield* G.tryPromise({
1332
1332
  try: (t) => this.#e.getPublishOperation(e.flowId, r.operationId, t),
1333
1333
  catch: (e) => e
1334
- }).pipe(J.match({
1334
+ }).pipe(G.match({
1335
1335
  onFailure: (e) => ({ error: e }),
1336
1336
  onSuccess: (e) => ({ value: e })
1337
1337
  }));
1338
1338
  if (!n()) return;
1339
1339
  if ("error" in t) {
1340
1340
  let n = t.error;
1341
- if (n instanceof H && n.code == "publication.operation-not-found") {
1341
+ if (n instanceof I && n.code == "publication.operation-not-found") {
1342
1342
  this.#a.setItem(this.#b(e.flowId), ""), this.#x(e, {
1343
1343
  operation: void 0,
1344
1344
  publishing: !1
1345
- }), this.#c(L(n, this.#n.t));
1345
+ }), this.#c(F(n, this.#n.t));
1346
1346
  return;
1347
1347
  }
1348
- this.#c(L(n, this.#n.t));
1348
+ this.#c(F(n, this.#n.t));
1349
1349
  continue;
1350
1350
  }
1351
1351
  r = t.value, this.#x(e, { operation: r });
@@ -1360,8 +1360,8 @@ var Sn = class {
1360
1360
  return `publish-operation:${e}`;
1361
1361
  }
1362
1362
  #x(e, t) {
1363
- xn(this.#l.value.target, e) ? this.#S(t) : this.#l.set({
1364
- ..._n,
1363
+ Cn(this.#l.value.target, e) ? this.#S(t) : this.#l.set({
1364
+ ...yn,
1365
1365
  ...t,
1366
1366
  target: e
1367
1367
  });
@@ -1372,22 +1372,22 @@ var Sn = class {
1372
1372
  ...e
1373
1373
  });
1374
1374
  }
1375
- }, Cn = { starting: !1 };
1376
- function wn(e) {
1375
+ }, Tn = { starting: !1 };
1376
+ function En(e) {
1377
1377
  switch (e.kind) {
1378
1378
  case "condition": return {};
1379
- case "subflow": return Ye(e.definition?.inputs ?? []);
1380
- case "task": return Ye(e.definition?.inputs ?? []);
1379
+ case "subflow": return $e(e.definition?.inputs ?? []);
1380
+ case "task": return $e(e.definition?.inputs ?? []);
1381
1381
  case "value": return {};
1382
1382
  case "approval":
1383
- case "wait": return Ye(e.node.inputDefinitions);
1383
+ case "wait": return $e(e.node.inputDefinitions);
1384
1384
  }
1385
1385
  }
1386
- function Tn(e) {
1386
+ function Dn(e) {
1387
1387
  return e.node.name == null ? e.kind == "task" || e.kind == "subflow" ? e.definition?.name ?? e.id : e.id : e.node.name;
1388
1388
  }
1389
- function En(e, t) {
1390
- let n = F(e), r = n.graph({ kind: "flow" });
1389
+ function On(e, t) {
1390
+ let n = P(e), r = n.graph({ kind: "flow" });
1391
1391
  if (r == null) return [];
1392
1392
  let i = /* @__PURE__ */ new Set([t]), a = [t];
1393
1393
  for (; a.length > 0;) {
@@ -1397,11 +1397,11 @@ function En(e, t) {
1397
1397
  return Object.entries(r.nodes).filter(([e]) => i.has(e)).toSorted(([e], [t]) => e.localeCompare(t)).flatMap(([e, t]) => {
1398
1398
  let r = n.resolveNode(e, t);
1399
1399
  if (r.kind == "trigger") return r.trigger.kind == "manual" || r.trigger.kind == "cron" ? [] : [{
1400
- definitions: ce(r.trigger),
1400
+ definitions: Le(r.trigger),
1401
1401
  nodeId: e,
1402
1402
  title: r.trigger.name
1403
1403
  }];
1404
- let i = Object.entries(wn(r)).filter(([e, t]) => r.node.inputs[e] == null && !Object.hasOwn(t, "value")).toSorted(([e], [t]) => e.localeCompare(t)).map(([e, t]) => Object.assign({
1404
+ let i = Object.entries(En(r)).filter(([e, t]) => r.node.inputs[e] == null && !Object.hasOwn(t, "value")).toSorted(([e], [t]) => e.localeCompare(t)).map(([e, t]) => Object.assign({
1405
1405
  handle: e,
1406
1406
  jsonSchema: t.jsonSchema,
1407
1407
  nullable: t.nullable
@@ -1409,18 +1409,18 @@ function En(e, t) {
1409
1409
  return i.length == 0 ? [] : [{
1410
1410
  definitions: i,
1411
1411
  nodeId: e,
1412
- title: Tn(r)
1412
+ title: Dn(r)
1413
1413
  }];
1414
1414
  });
1415
1415
  }
1416
- function Dn(e) {
1416
+ function kn(e) {
1417
1417
  return JSON.stringify(e.map((e) => [e.nodeId, e.definitions.map((e) => [
1418
1418
  e.handle,
1419
1419
  e.jsonSchema,
1420
1420
  e.nullable
1421
1421
  ])]));
1422
1422
  }
1423
- async function On(e, t, n) {
1423
+ async function An(e, t, n) {
1424
1424
  let { FlowRunInputEditorStore: r } = await import("./flowRunInputEditorStore-Bgb5vSeS.js").then((e) => e.n);
1425
1425
  return e.map((e) => {
1426
1426
  let i = new r(e.definitions, t);
@@ -1431,31 +1431,31 @@ async function On(e, t, n) {
1431
1431
  };
1432
1432
  });
1433
1433
  }
1434
- function kn(e) {
1434
+ function jn(e) {
1435
1435
  return Object.fromEntries(e.map((e) => [e.nodeId, e.editor.values()]));
1436
1436
  }
1437
- function An(e, t) {
1438
- return F(e).graph({ kind: "flow" })?.nodes[t]?.kind === "cron" ? { scheduledAt: (/* @__PURE__ */ new Date()).toISOString() } : {};
1437
+ function Mn(e, t) {
1438
+ return P(e).graph({ kind: "flow" })?.nodes[t]?.kind === "cron" ? { scheduledAt: (/* @__PURE__ */ new Date()).toISOString() } : {};
1439
1439
  }
1440
- function jn(e, t, n) {
1440
+ function Nn(e, t, n) {
1441
1441
  return {
1442
1442
  inputs: Object.fromEntries(e.filter((e) => e.nodeId != t).map((e) => [e.nodeId, e.editor.values()])),
1443
- outputs: e.find((e) => e.nodeId == t)?.editor.values() ?? An(n, t)
1443
+ outputs: e.find((e) => e.nodeId == t)?.editor.values() ?? Mn(n, t)
1444
1444
  };
1445
1445
  }
1446
- var Mn = class {
1446
+ var Pn = class {
1447
1447
  #e;
1448
1448
  #t;
1449
1449
  #n;
1450
1450
  #r;
1451
- #i = new I();
1452
- #a = new I();
1451
+ #i = new E();
1452
+ #a = new E();
1453
1453
  #o;
1454
1454
  #s = /* @__PURE__ */ new Map();
1455
1455
  #c;
1456
- #l = n(Cn);
1456
+ #l = n(Tn);
1457
1457
  #u;
1458
- constructor(t, n, r, i, a = h(), o = C) {
1458
+ constructor(t, n, r, i, a = h(), o = j) {
1459
1459
  this.#e = i, this.#t = t, this.#o = n, this.#c = r, this.#r = a, this.#n = o, this.$ = {
1460
1460
  inputRequest: e(this.#l, (e) => e.inputRequest),
1461
1461
  starting: e(this.#l, (e) => e.starting),
@@ -1470,14 +1470,14 @@ var Mn = class {
1470
1470
  reset() {
1471
1471
  this.#i.invalidate(), this.#a.invalidate(), this.#u = void 0;
1472
1472
  let e = this.#l.value.inputRequest;
1473
- this.#h(e), this.#l.set(Cn), this.#p(e);
1473
+ this.#h(e), this.#l.set(Tn), this.#p(e);
1474
1474
  }
1475
1475
  async requestDraft(e, t, n) {
1476
1476
  let r = this.#a.begin();
1477
1477
  try {
1478
1478
  return await this.#d("draft", e, t, t.revisionId, r, void 0, n);
1479
1479
  } catch (e) {
1480
- return r() && this.#c(L(e, this.#r.t)), "unavailable";
1480
+ return r() && this.#c(F(e, this.#r.t)), "unavailable";
1481
1481
  } finally {
1482
1482
  r() && this.#g({ starting: !1 });
1483
1483
  }
@@ -1487,16 +1487,16 @@ var Mn = class {
1487
1487
  try {
1488
1488
  return await this.#d("draft", e, t, t.revisionId, r, void 0, n, !0);
1489
1489
  } catch (e) {
1490
- return r() && this.#c(L(e, this.#r.t)), "unavailable";
1490
+ return r() && this.#c(F(e, this.#r.t)), "unavailable";
1491
1491
  } finally {
1492
1492
  r() && this.#g({ starting: !1 });
1493
1493
  }
1494
1494
  }
1495
1495
  inputStatus(e, t, n) {
1496
- let r = En(t, n);
1496
+ let r = On(t, n);
1497
1497
  if (r.length == 0) return "none";
1498
1498
  let i = this.#s.get(this.#m(e, n));
1499
- return i?.valid == 1 && i.signature == Dn(r) ? "ready" : "missing";
1499
+ return i?.valid == 1 && i.signature == kn(r) ? "ready" : "missing";
1500
1500
  }
1501
1501
  async requestLive(e) {
1502
1502
  let t = this.#a.begin();
@@ -1507,7 +1507,7 @@ var Mn = class {
1507
1507
  let r = await this.#t.getRevision(e.flowId, n.revisionId);
1508
1508
  return t() ? await this.#d("live", e, r, n.revisionId, t, n.publicationId) : "unavailable";
1509
1509
  } catch (e) {
1510
- return t() && this.#c(L(e, this.#r.t)), "unavailable";
1510
+ return t() && this.#c(F(e, this.#r.t)), "unavailable";
1511
1511
  } finally {
1512
1512
  t() && this.#g({ starting: !1 });
1513
1513
  }
@@ -1524,7 +1524,7 @@ var Mn = class {
1524
1524
  attempted: !0
1525
1525
  } }), !1;
1526
1526
  this.#h(e);
1527
- let { inputs: t, outputs: n } = jn(e.groups, e.triggerId, e.revision), r = await this.#f(e.source, e.flow, e.revisionId, {
1527
+ let { inputs: t, outputs: n } = Nn(e.groups, e.triggerId, e.revision), r = await this.#f(e.source, e.flow, e.revisionId, {
1528
1528
  nodeId: e.triggerId,
1529
1529
  outputs: n
1530
1530
  }, t, e.publicationId);
@@ -1536,7 +1536,7 @@ var Mn = class {
1536
1536
  let r = this.#a.begin();
1537
1537
  this.#h(n), this.#g({ starting: !0 });
1538
1538
  try {
1539
- let i = En(n.revision, e), a = this.#s.get(this.#m(n.flow.flowId, e)), o = await On(i, this.#r.lang$, a?.values);
1539
+ let i = On(n.revision, e), a = this.#s.get(this.#m(n.flow.flowId, e)), o = await An(i, this.#r.lang$, a?.values);
1540
1540
  if (!r() || this.#l.value.inputRequest !== n) {
1541
1541
  for (let e of o) e.editor.dispose();
1542
1542
  return;
@@ -1550,7 +1550,7 @@ var Mn = class {
1550
1550
  valid: s
1551
1551
  } }), this.#p(n);
1552
1552
  } catch (e) {
1553
- r() && this.#c(L(e, this.#r.t));
1553
+ r() && this.#c(F(e, this.#r.t));
1554
1554
  } finally {
1555
1555
  r() && this.#g({ starting: !1 });
1556
1556
  }
@@ -1562,7 +1562,7 @@ var Mn = class {
1562
1562
  starting: !c,
1563
1563
  submitting: void 0
1564
1564
  }), this.#p(l);
1565
- let u = F(r).graph({ kind: "flow" }), d = Object.entries(u?.nodes ?? {}).flatMap(([e, t]) => "inputs" in t ? [] : [{
1565
+ let u = P(r).graph({ kind: "flow" }), d = Object.entries(u?.nodes ?? {}).flatMap(([e, t]) => "inputs" in t ? [] : [{
1566
1566
  nodeId: e,
1567
1567
  title: t.name
1568
1568
  }]);
@@ -1575,17 +1575,17 @@ var Mn = class {
1575
1575
  kind: "error",
1576
1576
  message: this.#r.t("runInput.selectTrigger")
1577
1577
  }), "unavailable";
1578
- let p = f == null ? [] : En(r, f.nodeId), m = Dn(p), h = f == null ? void 0 : this.#s.get(this.#m(n.flowId, f.nodeId)), g = f == null ? [] : await On(p, this.#r.lang$, h?.values);
1578
+ let p = f == null ? [] : On(r, f.nodeId), m = kn(p), h = f == null ? void 0 : this.#s.get(this.#m(n.flowId, f.nodeId)), g = f == null ? [] : await An(p, this.#r.lang$, h?.values);
1579
1579
  if (!a()) {
1580
1580
  for (let e of g) e.editor.dispose();
1581
1581
  return "unavailable";
1582
1582
  }
1583
1583
  if (!c && f != null && g.length == 0) return await this.#f(e, n, i, {
1584
1584
  nodeId: f.nodeId,
1585
- outputs: An(r, f.nodeId)
1585
+ outputs: Mn(r, f.nodeId)
1586
1586
  }, {}, o) ? "started" : "unavailable";
1587
1587
  if (!c && f != null && h?.valid == 1 && h.signature == m && g.every((e) => e.editor.valid$.value)) {
1588
- let t = jn(g, f.nodeId, r);
1588
+ let t = Nn(g, f.nodeId, r);
1589
1589
  for (let e of g) e.editor.dispose();
1590
1590
  return await this.#f(e, n, i, {
1591
1591
  nodeId: f.nodeId,
@@ -1647,7 +1647,7 @@ var Mn = class {
1647
1647
  });
1648
1648
  return !o() || !s() ? !1 : (this.#u = void 0, this.#o.follow(d, s));
1649
1649
  } catch (e) {
1650
- return o() && s() && this.#c(L(e, this.#r.t)), !1;
1650
+ return o() && s() && this.#c(F(e, this.#r.t)), !1;
1651
1651
  } finally {
1652
1652
  o() && this.#g({
1653
1653
  starting: !1,
@@ -1666,9 +1666,9 @@ var Mn = class {
1666
1666
  }
1667
1667
  #h(e) {
1668
1668
  e?.triggerId != null && e.groups.length != 0 && this.#s.set(this.#m(e.flow.flowId, e.triggerId), {
1669
- signature: Dn(En(e.revision, e.triggerId)),
1669
+ signature: kn(On(e.revision, e.triggerId)),
1670
1670
  valid: e.valid.value,
1671
- values: kn(e.groups)
1671
+ values: jn(e.groups)
1672
1672
  });
1673
1673
  }
1674
1674
  #g(e) {
@@ -1680,22 +1680,22 @@ var Mn = class {
1680
1680
  };
1681
1681
  //#endregion
1682
1682
  //#region src/workbench/browser/runtime/workspace.ts
1683
- function Nn(e, t) {
1683
+ function Fn(e, t) {
1684
1684
  if (e.node.icon != null) return e.node.icon;
1685
- if (e.kind != "task" || e.definition == null || !("executor" in e.definition) || e.definition.executor.kind != "connector") return In(e);
1685
+ if (e.kind != "task" || e.definition == null || !("executor" in e.definition) || e.definition.executor.kind != "connector") return Rn(e);
1686
1686
  let n = t[e.definition.executor.action];
1687
- return n == null ? In(e) : A(n);
1687
+ return n == null ? Rn(e) : k(n);
1688
1688
  }
1689
- function Pn(e, t) {
1689
+ function In(e, t) {
1690
1690
  return e.kind == "trigger" ? {
1691
- icon: Gn(e.trigger, t.providers),
1691
+ icon: qn(e.trigger, t.providers),
1692
1692
  title: e.trigger.name
1693
1693
  } : {
1694
- icon: Nn(e, t.connectorActions),
1695
- title: Fn(e, t.t)
1694
+ icon: Fn(e, t.connectorActions),
1695
+ title: Ln(e, t.t)
1696
1696
  };
1697
1697
  }
1698
- function Fn(e, t) {
1698
+ function Ln(e, t) {
1699
1699
  if (e.node.name != null) return e.node.name;
1700
1700
  switch (e.kind) {
1701
1701
  case "condition": return t?.("addNode.condition") ?? "Condition";
@@ -1706,7 +1706,7 @@ function Fn(e, t) {
1706
1706
  case "task": return e.definition?.name ?? (e.node.task == null ? e.node.taskId : e.node.task.moduleId);
1707
1707
  }
1708
1708
  }
1709
- function In(e) {
1709
+ function Rn(e) {
1710
1710
  switch (e.kind) {
1711
1711
  case "condition": return ":carbon:child-node:";
1712
1712
  case "subflow": return ":carbon:subflow:";
@@ -1719,7 +1719,7 @@ function In(e) {
1719
1719
  }
1720
1720
  }
1721
1721
  }
1722
- function Ln(e, t, n, r) {
1722
+ function zn(e, t, n, r) {
1723
1723
  return JSON.stringify([
1724
1724
  e,
1725
1725
  t,
@@ -1727,10 +1727,10 @@ function Ln(e, t, n, r) {
1727
1727
  r
1728
1728
  ]);
1729
1729
  }
1730
- function Rn(e) {
1730
+ function Bn(e) {
1731
1731
  if (e.kind == "trigger") return {
1732
1732
  inputs: /* @__PURE__ */ new Map(),
1733
- outputs: new Map(Object.entries(E(e.trigger)))
1733
+ outputs: new Map(Object.entries(He(e.trigger)))
1734
1734
  };
1735
1735
  let t = new Map(Object.keys(e.node.inputs).map((e) => [e, {}])), n = /* @__PURE__ */ new Map();
1736
1736
  switch (e.kind) {
@@ -1753,7 +1753,7 @@ function Rn(e) {
1753
1753
  jsonSchema: n.jsonSchema,
1754
1754
  nullable: n.nullable
1755
1755
  });
1756
- for (let [t, r] of Object.entries(P(e.node))) n.set(t, r);
1756
+ for (let [t, r] of Object.entries(Pe(e.node))) n.set(t, r);
1757
1757
  break;
1758
1758
  case "subflow": {
1759
1759
  let r = e.definition;
@@ -1799,7 +1799,7 @@ function Rn(e) {
1799
1799
  outputs: n
1800
1800
  };
1801
1801
  }
1802
- function zn(e) {
1802
+ function Vn(e) {
1803
1803
  switch (e) {
1804
1804
  case "endsWith": return "ends with";
1805
1805
  case "hasKey": return "has key";
@@ -1823,7 +1823,7 @@ function zn(e) {
1823
1823
  case "contains": return e;
1824
1824
  }
1825
1825
  }
1826
- function Bn(e, t) {
1826
+ function Hn(e, t) {
1827
1827
  if (e.kind == "value") return JSON.stringify(e.value) ?? "…";
1828
1828
  let n = e.source;
1829
1829
  if (n.kind == "flow") return n.input;
@@ -1831,14 +1831,14 @@ function Bn(e, t) {
1831
1831
  kind: "environment",
1832
1832
  label: t.t?.("nodeInput.variable") ?? "Env"
1833
1833
  };
1834
- let r = t.nodes.get(n.nodeId), i = r == null ? void 0 : Pn(r, t);
1834
+ let r = t.nodes.get(n.nodeId), i = r == null ? void 0 : In(r, t);
1835
1835
  return {
1836
1836
  icon: i?.icon,
1837
1837
  kind: "node",
1838
- label: `${i?.title ?? n.nodeId} · ${He(n)}`
1838
+ label: `${i?.title ?? n.nodeId} · ${Be(n)}`
1839
1839
  };
1840
1840
  }
1841
- function Vn(e, t, n) {
1841
+ function Un(e, t, n) {
1842
1842
  let r = e.kind == "flow" ? `/document/graph/nodes/${t.id}` : `/document/subflows/${e.id}/graph/nodes/${t.id}`, i = [r];
1843
1843
  if (t.kind == "task") {
1844
1844
  t.node.task == null ? i.push(`/document/tasks/${t.node.taskId}`) : i.push(`${r}/task`);
@@ -1847,7 +1847,7 @@ function Vn(e, t, n) {
1847
1847
  } else t.kind == "subflow" && i.push(`/document/subflows/${t.node.subflowId}`);
1848
1848
  return n.filter((e) => i.some((t) => e.path.startsWith(t))).length;
1849
1849
  }
1850
- function Hn(e, t, n, r) {
1850
+ function Wn(e, t, n, r) {
1851
1851
  if (t.kind != "flow" || n?.flowId != e.revision.flowId || n.revisionId != e.revision.revisionId) return { nodes: /* @__PURE__ */ new Map() };
1852
1852
  let i = n.status == "queued" || n.status == "starting" || n.status == "running" || n.status == "waiting", a = /* @__PURE__ */ new Map();
1853
1853
  if ("waits" in n) for (let e of n.waits) a.set(e.nodeId, {
@@ -1946,10 +1946,10 @@ function Hn(e, t, n, r) {
1946
1946
  status: i ? "running" : "idle"
1947
1947
  };
1948
1948
  }
1949
- function Un(e, t, n) {
1949
+ function Gn(e, t, n) {
1950
1950
  if (e != null) return "moduleId" in e ? n?.("designer.executorJavaScript") ?? "javascript" : e.executor.kind == "agent" ? "Agent" : e.executor.kind == "llm" ? n?.("designer.executorLlm") ?? "llm" : `${n?.("designer.executorConnector") ?? "connector"} · ${t ?? e.executor.action.split(".")[0]}`;
1951
1951
  }
1952
- function Wn(e) {
1952
+ function Kn(e) {
1953
1953
  switch (e.kind) {
1954
1954
  case "manual": return ":carbon:play:";
1955
1955
  case "cron": return ":carbon:time:";
@@ -1958,17 +1958,17 @@ function Wn(e) {
1958
1958
  case "webhook": return ":carbon:webhook:";
1959
1959
  }
1960
1960
  }
1961
- function Gn(e, t) {
1962
- return e.icon == null ? e.kind != "integration" && e.kind != "poll" ? Wn(e) : A(t[e.definition.provider] ?? {
1961
+ function qn(e, t) {
1962
+ return e.icon == null ? e.kind != "integration" && e.kind != "poll" ? Kn(e) : k(t[e.definition.provider] ?? {
1963
1963
  serviceId: e.definition.provider,
1964
1964
  serviceName: e.definition.provider
1965
1965
  }) : e.icon;
1966
1966
  }
1967
- function Kn(e, t) {
1967
+ function Jn(e, t) {
1968
1968
  let n = `/document/graph/nodes/${e}`;
1969
1969
  return t.filter((e) => e.code != "trigger.config-incomplete" && (e.path == n || e.path.startsWith(`${n}/`)));
1970
1970
  }
1971
- function qn(e, t) {
1971
+ function Yn(e, t) {
1972
1972
  let n = [], r = new Map([...t].map((e) => [e, /* @__PURE__ */ new Set()])), i = new Map([...t].map((e) => [e, /* @__PURE__ */ new Set()])), a = Array.isArray(e.edges) ? e.edges : [];
1973
1973
  for (let e of a) {
1974
1974
  if (typeof e != "object" || !e || Array.isArray(e)) continue;
@@ -1976,7 +1976,7 @@ function qn(e, t) {
1976
1976
  if (typeof a.source != "string" || typeof a.target != "string" || a.sourceHandle != null && typeof a.sourceHandle != "string" || !t.has(a.source) || !t.has(a.target)) continue;
1977
1977
  let o = a.sourceHandle == null ? "$out" : `$branch:${a.sourceHandle}`;
1978
1978
  n.push({
1979
- id: Ln(a.source, o, a.target, "$in"),
1979
+ id: zn(a.source, o, a.target, "$in"),
1980
1980
  source: a.source,
1981
1981
  sourceHandle: o,
1982
1982
  target: a.target,
@@ -1989,7 +1989,7 @@ function qn(e, t) {
1989
1989
  edges: n
1990
1990
  };
1991
1991
  }
1992
- function Jn(e, t, n) {
1992
+ function Xn(e, t, n) {
1993
1993
  let r = new Map([...t].map(([e, t]) => [e, t.size])), i = /* @__PURE__ */ new Map(), a = [], o = /* @__PURE__ */ new Set(), s = [...r].filter(([, e]) => e == 0).map(([e]) => e).toSorted();
1994
1994
  for (let e = 0; e < s.length; e += 1) {
1995
1995
  let t = s[e];
@@ -2008,14 +2008,14 @@ function Jn(e, t, n) {
2008
2008
  ordered: a
2009
2009
  };
2010
2010
  }
2011
- function Yn(e, t, n) {
2011
+ function Zn(e, t, n) {
2012
2012
  if (!("inputs" in t)) return [];
2013
2013
  let r = [];
2014
2014
  for (let [i, a] of n.inputs) {
2015
2015
  let n = t.inputs[i], o = [], s = /* @__PURE__ */ new Set();
2016
2016
  if (n?.kind == "sources") for (let t of n.sources) {
2017
2017
  if (t.kind != "node") continue;
2018
- let n = t.nodeId, r = t.output, a = Ln(n, r, e, i);
2018
+ let n = t.nodeId, r = t.output, a = zn(n, r, e, i);
2019
2019
  s.has(a) || (s.add(a), o.push({
2020
2020
  nodeId: n,
2021
2021
  output: r
@@ -2030,10 +2030,10 @@ function Yn(e, t, n) {
2030
2030
  }
2031
2031
  return r;
2032
2032
  }
2033
- function Xn(e) {
2033
+ function Qn(e) {
2034
2034
  return [...e.outputs].map(([e, t]) => Object.assign({ handle: e }, t));
2035
2035
  }
2036
- function Zn(e, t) {
2036
+ function $n(e, t) {
2037
2037
  if (e.kind != "task" || e.definition == null) return t;
2038
2038
  let n = new Map(t.map((e) => [e.handle, e])), r = [];
2039
2039
  for (let t of e.definition.inputs) {
@@ -2046,7 +2046,7 @@ function Zn(e, t) {
2046
2046
  }
2047
2047
  return r.push(...n.values()), r;
2048
2048
  }
2049
- function Qn(e, t) {
2049
+ function er(e, t) {
2050
2050
  if (e.kind != "task" || e.definition == null) return t;
2051
2051
  let n = new Map(t.map((e) => [e.handle, e])), r = [];
2052
2052
  for (let t of e.definition.outputs) {
@@ -2059,8 +2059,8 @@ function Qn(e, t) {
2059
2059
  }
2060
2060
  return r.push(...n.values()), r;
2061
2061
  }
2062
- function $n(e, t, n, r, i) {
2063
- let a = Kn(e, r), o = a.some((e) => e.code == "trigger.connection-missing" || e.code == "trigger.connection-invalid"), s = t.kind == "integration" || t.kind == "poll" ? i[t.definition.provider] : void 0, c;
2062
+ function tr(e, t, n, r, i) {
2063
+ let a = Jn(e, r), o = a.some((e) => e.code == "trigger.connection-missing" || e.code == "trigger.connection-invalid"), s = t.kind == "integration" || t.kind == "poll" ? i[t.definition.provider] : void 0, c;
2064
2064
  switch (t.kind) {
2065
2065
  case "manual":
2066
2066
  c = {
@@ -2097,27 +2097,27 @@ function $n(e, t, n, r, i) {
2097
2097
  description: t.description,
2098
2098
  diagnostics: a.length,
2099
2099
  connectionRequired: o,
2100
- icon: Gn(t, i),
2100
+ icon: qn(t, i),
2101
2101
  id: e,
2102
2102
  inputs: [],
2103
2103
  kind: "trigger",
2104
- outputs: Object.entries(E(t)).map(([e, t]) => Object.assign({ handle: e }, t)),
2104
+ outputs: Object.entries(He(t)).map(([e, t]) => Object.assign({ handle: e }, t)),
2105
2105
  presentation: c,
2106
2106
  position: n,
2107
2107
  title: t.name
2108
2108
  };
2109
2109
  }
2110
- function er(e, t, n, r, i) {
2111
- let a = t.node, o = Zn(t, Yn(e, a, n)), s = Qn(t, Xn(n)), c = t.kind == "task" ? t.definition : void 0, l = c != null && "executor" in c && c.executor.kind == "connector" ? c.executor : void 0, u = l == null ? void 0 : i.connectorActions[l.action], d = u == null ? void 0 : i.connectionCatalogs[u.serviceId], f = l?.connectionId, p = f == null ? void 0 : d?.byId.get(f), m = u?.authenticated == 1 && (l?.connectionId == null || d != null && p?.status != "active"), h = i.runNodes.get(e), g = {
2110
+ function nr(e, t, n, r, i) {
2111
+ let a = t.node, o = $n(t, Zn(e, a, n)), s = er(t, Qn(n)), c = t.kind == "task" ? t.definition : void 0, l = c != null && "executor" in c && c.executor.kind == "connector" ? c.executor : void 0, u = l == null ? void 0 : i.connectorActions[l.action], d = u == null ? void 0 : i.connectionCatalogs[u.serviceId], f = l?.connectionId, p = f == null ? void 0 : d?.byId.get(f), m = u?.authenticated == 1 && (l?.connectionId == null || d != null && p?.status != "active"), h = i.runNodes.get(e), g = {
2112
2112
  description: a.description,
2113
- diagnostics: Vn(i.target, t, i.diagnostics),
2114
- icon: Nn(t, i.connectorActions),
2113
+ diagnostics: Un(i.target, t, i.diagnostics),
2114
+ icon: Fn(t, i.connectorActions),
2115
2115
  id: e,
2116
2116
  inputs: o,
2117
2117
  outputs: s,
2118
2118
  position: r,
2119
2119
  ...h == null ? {} : { run: h },
2120
- title: Fn(t, i.t)
2120
+ title: Ln(t, i.t)
2121
2121
  };
2122
2122
  switch (a.kind) {
2123
2123
  case "condition": return {
@@ -2126,9 +2126,9 @@ function er(e, t, n, r, i) {
2126
2126
  cases: a.cases.map((e) => ({
2127
2127
  ...e.description == null ? {} : { description: e.description },
2128
2128
  groups: e.groups.map((e) => ({ expressions: e.expressions.map((e) => ({
2129
- left: Bn(e.left, i),
2130
- operator: zn(e.operator),
2131
- right: e.right == null ? void 0 : Bn(e.right, i)
2129
+ left: Hn(e.left, i),
2130
+ operator: Vn(e.operator),
2131
+ right: e.right == null ? void 0 : Hn(e.right, i)
2132
2132
  })) })),
2133
2133
  output: e.output
2134
2134
  })),
@@ -2147,13 +2147,13 @@ function er(e, t, n, r, i) {
2147
2147
  return t == null || "group" in t ? [] : [t];
2148
2148
  }),
2149
2149
  kind: a.kind,
2150
- executorName: Un(c, u?.serviceName, i.t),
2150
+ executorName: Gn(c, u?.serviceName, i.t),
2151
2151
  connectionRequired: m,
2152
2152
  ...c != null && "executor" in c && c.executor.kind == "agent" ? { tools: c.executor.tools.map((e) => {
2153
2153
  let t = i.connectorActions[e.action], n = t?.serviceId ?? e.action.split(".")[0], r = t?.serviceName ?? n;
2154
2154
  return {
2155
2155
  id: e.id,
2156
- icon: A(t ?? {
2156
+ icon: k(t ?? {
2157
2157
  serviceId: n,
2158
2158
  serviceName: r
2159
2159
  }),
@@ -2174,8 +2174,8 @@ function er(e, t, n, r, i) {
2174
2174
  };
2175
2175
  }
2176
2176
  }
2177
- function tr(e, t, n = {}, r = [], i = {}, a = {}, o, s, c = [], l = {}) {
2178
- let u = e == null ? void 0 : F(e), d = u == null || t == null ? void 0 : u.graph(t);
2177
+ function rr(e, t, n = {}, r = [], i = {}, a = {}, o, s, c = [], l = {}) {
2178
+ let u = e == null ? void 0 : P(e), d = u == null || t == null ? void 0 : u.graph(t);
2179
2179
  if (u == null || t == null || d == null) return {
2180
2180
  edges: [],
2181
2181
  nodes: [],
@@ -2185,7 +2185,7 @@ function tr(e, t, n = {}, r = [], i = {}, a = {}, o, s, c = [], l = {}) {
2185
2185
  zoom: 1
2186
2186
  }
2187
2187
  };
2188
- let f = Hn(u, t, s, c), p = Object.entries(d.nodes), m = new Map(p.map(([e, t]) => [e, u.resolveNode(e, t)])), h = new Set(p.map(([e]) => e)), g = new Map([...m].map(([e, t]) => [e, Rn(t)])), _ = qn(d, h), v = Jn(h, _.dependencies, _.dependents), y = tn(n, t), b = gn(n, t), x = {
2188
+ let f = Wn(u, t, s, c), p = Object.entries(d.nodes), m = new Map(p.map(([e, t]) => [e, u.resolveNode(e, t)])), h = new Set(p.map(([e]) => e)), g = new Map([...m].map(([e, t]) => [e, Bn(t)])), _ = Yn(d, h), v = Xn(h, _.dependencies, _.dependents), y = an(n, t), b = vn(n, t), x = {
2189
2189
  connectionCatalogs: a,
2190
2190
  connectorActions: i,
2191
2191
  diagnostics: r,
@@ -2205,128 +2205,128 @@ function tr(e, t, n = {}, r = [], i = {}, a = {}, o, s, c = [], l = {}) {
2205
2205
  }, a = m.get(e);
2206
2206
  if (a.kind == "trigger") {
2207
2207
  C.push({
2208
- ...$n(e, a.trigger, i, r, l),
2208
+ ...tr(e, a.trigger, i, r, l),
2209
2209
  contentHidden: b?.[e] === !0
2210
2210
  });
2211
2211
  continue;
2212
2212
  }
2213
- let o = er(e, a, g.get(e), i, x);
2213
+ let o = nr(e, a, g.get(e), i, x);
2214
2214
  C.push({
2215
2215
  ...o,
2216
2216
  contentHidden: b?.[e] === !0
2217
2217
  });
2218
2218
  }
2219
- for (let [e, r] of Object.entries(an(n, t, y)).toSorted(([e], [t]) => e.localeCompare(t))) C.push({
2219
+ for (let [e, r] of Object.entries(cn(n, t, y)).toSorted(([e], [t]) => e.localeCompare(t))) C.push({
2220
2220
  ...r,
2221
2221
  id: e,
2222
2222
  kind: "comment",
2223
2223
  contentHidden: b?.[e] === !0
2224
2224
  });
2225
- let w = new Map(Z(n, t).map((e, t) => [e, t]));
2225
+ let w = new Map(Y(n, t).map((e, t) => [e, t]));
2226
2226
  return C.sort((e, t) => (w.get(e.id) ?? -1) - (w.get(t.id) ?? -1)), {
2227
2227
  edges: _.edges,
2228
2228
  nodes: C,
2229
2229
  ...f.status == null ? {} : { runStatus: f.status },
2230
- viewport: rn(n, t)
2230
+ viewport: sn(n, t)
2231
2231
  };
2232
2232
  }
2233
2233
  //#endregion
2234
2234
  //#region src/connector/common/actionSchema.ts
2235
- function nr(e, t) {
2236
- let n = rr(e);
2235
+ function ir(e, t) {
2236
+ let n = ar(e);
2237
2237
  return {
2238
2238
  inputs: n,
2239
2239
  initialInputs: n.flatMap((e) => e.value === void 0 ? [] : [{
2240
2240
  handle: e.handle,
2241
2241
  value: e.value
2242
2242
  }]),
2243
- outputs: ir(t)
2243
+ outputs: or(t)
2244
2244
  };
2245
2245
  }
2246
- function rr(e) {
2247
- let t = W(e);
2246
+ function ar(e) {
2247
+ let t = V(e);
2248
2248
  if (t == null || t.type != "object" && t.properties == null) throw Error("Connector action inputSchema must be an object schema.");
2249
- let n = W(t.properties);
2249
+ let n = V(t.properties);
2250
2250
  if (n == null) return [];
2251
- let r = cr(t.required);
2251
+ let r = ur(t.required);
2252
2252
  return Object.entries(n).map(([e, n]) => {
2253
- let i = !r.has(e) || lr(n, t);
2253
+ let i = !r.has(e) || dr(n, t);
2254
2254
  return {
2255
- description: or(t, n),
2255
+ description: cr(t, n),
2256
2256
  handle: e,
2257
- json_schema: ar(t, n),
2257
+ json_schema: sr(t, n),
2258
2258
  nullable: i,
2259
- value: sr(t, n, i)
2259
+ value: lr(t, n, i)
2260
2260
  };
2261
2261
  });
2262
2262
  }
2263
- function ir(e) {
2264
- let t = W(e), n = W(t?.properties);
2263
+ function or(e) {
2264
+ let t = V(e), n = V(t?.properties);
2265
2265
  if (t != null && (t.type == "object" || n != null)) {
2266
2266
  if (n == null) return [];
2267
- let e = cr(t.required);
2267
+ let e = ur(t.required);
2268
2268
  return Object.entries(n).map(([n, r]) => ({
2269
- description: or(t, r),
2269
+ description: cr(t, r),
2270
2270
  handle: n,
2271
- json_schema: ar(t, r),
2272
- nullable: !e.has(n) || lr(r, t)
2271
+ json_schema: sr(t, r),
2272
+ nullable: !e.has(n) || dr(r, t)
2273
2273
  }));
2274
2274
  }
2275
2275
  return [{
2276
- description: or(t, e),
2276
+ description: cr(t, e),
2277
2277
  handle: "output",
2278
2278
  json_schema: e,
2279
- nullable: lr(e)
2279
+ nullable: dr(e)
2280
2280
  }];
2281
2281
  }
2282
- function ar(e, t) {
2283
- let n = W(t);
2282
+ function sr(e, t) {
2283
+ let n = V(t);
2284
2284
  if (n == null) return t;
2285
2285
  let r = Object.assign({}, n);
2286
2286
  return r.$defs == null && e.$defs != null && (r.$defs = e.$defs), r.definitions == null && e.definitions != null && (r.definitions = e.definitions), r;
2287
2287
  }
2288
- function or(e, t) {
2289
- for (let n of ur(e, t)) if (typeof n.description == "string") return n.description;
2288
+ function cr(e, t) {
2289
+ for (let n of fr(e, t)) if (typeof n.description == "string") return n.description;
2290
2290
  }
2291
- function sr(e, t, n) {
2292
- for (let n of ur(e, t)) if (Object.hasOwn(n, "default")) return n.default;
2291
+ function lr(e, t, n) {
2292
+ for (let n of fr(e, t)) if (Object.hasOwn(n, "default")) return n.default;
2293
2293
  return n ? null : void 0;
2294
2294
  }
2295
- function cr(e) {
2295
+ function ur(e) {
2296
2296
  return Array.isArray(e) ? new Set(e.filter((e) => typeof e == "string")) : /* @__PURE__ */ new Set();
2297
2297
  }
2298
- function lr(e, t = e, n = /* @__PURE__ */ new Set()) {
2299
- let r = W(e);
2298
+ function dr(e, t = e, n = /* @__PURE__ */ new Set()) {
2299
+ let r = V(e);
2300
2300
  if (r == null) return !1;
2301
2301
  if (Object.hasOwn(r, "type")) return r.type == "null" || Array.isArray(r.type) && r.type.includes("null");
2302
2302
  if (Object.hasOwn(r, "enum")) return Array.isArray(r.enum) && r.enum.includes(null);
2303
- for (let e of ["anyOf", "oneOf"]) if (Object.hasOwn(r, e)) return Array.isArray(r[e]) && r[e].some((e) => lr(e, t, n));
2303
+ for (let e of ["anyOf", "oneOf"]) if (Object.hasOwn(r, e)) return Array.isArray(r[e]) && r[e].some((e) => dr(e, t, n));
2304
2304
  let i = typeof r.$ref == "string" ? r.$ref : void 0;
2305
2305
  if (i == null || n.has(i)) return !1;
2306
- let a = dr(t, i);
2306
+ let a = pr(t, i);
2307
2307
  if (a === void 0) return !1;
2308
2308
  let o = new Set(n);
2309
- return o.add(i), lr(a, t, o);
2309
+ return o.add(i), dr(a, t, o);
2310
2310
  }
2311
- function ur(e, t) {
2311
+ function fr(e, t) {
2312
2312
  let n = [], r = /* @__PURE__ */ new Set(), i = t;
2313
2313
  for (;;) {
2314
- let t = W(i);
2314
+ let t = V(i);
2315
2315
  if (t == null) return n;
2316
2316
  n.push(t);
2317
2317
  let a = typeof t.$ref == "string" ? t.$ref : void 0;
2318
2318
  if (a == null || r.has(a)) return n;
2319
- let o = dr(e, a);
2319
+ let o = pr(e, a);
2320
2320
  if (o === void 0) return n;
2321
2321
  r.add(a), i = o;
2322
2322
  }
2323
2323
  }
2324
- function dr(e, t) {
2324
+ function pr(e, t) {
2325
2325
  if (t == "#") return e;
2326
2326
  if (!t.startsWith("#/")) return;
2327
2327
  let n = e;
2328
2328
  for (let e of t.slice(2).split("/")) {
2329
- let t = W(n), r = e.replaceAll("~1", "/").replaceAll("~0", "~");
2329
+ let t = V(n), r = e.replaceAll("~1", "/").replaceAll("~0", "~");
2330
2330
  if (t == null || !Object.hasOwn(t, r)) return;
2331
2331
  n = t[r];
2332
2332
  }
@@ -2334,77 +2334,61 @@ function dr(e, t) {
2334
2334
  }
2335
2335
  //#endregion
2336
2336
  //#region src/workbench/browser/runtime/stores/proxyCatalog.ts
2337
- function fr(e, t) {
2338
- let n = me(e);
2339
- if (n.success === !1) throw new H(502, typeof n.errorCode == "string" ? n.errorCode : "connector.unavailable", typeof n.message == "string" ? n.message : "Connector request failed.");
2340
- if (n.success !== !0 || !Array.isArray(n.data)) return V();
2341
- for (let e of n.data) t(me(e));
2337
+ function mr(e, t) {
2338
+ let n = Ie(e);
2339
+ if (n.success === !1) throw new I(502, typeof n.errorCode == "string" ? n.errorCode : "connector.unavailable", typeof n.message == "string" ? n.message : "Connector request failed.");
2340
+ if (n.success !== !0 || !Array.isArray(n.data)) return L();
2341
+ if (t != null) for (let e of n.data) t(Ie(e));
2342
2342
  return n;
2343
2343
  }
2344
- function pr(e) {
2345
- return !Array.isArray(e.authTypes) || e.authTypes.some((e) => typeof e != "string") ? V() : {
2346
- serviceId: z(e.service),
2347
- serviceName: z(e.displayName),
2344
+ function hr(e) {
2345
+ return !Array.isArray(e.authTypes) || e.authTypes.some((e) => typeof e != "string") ? L() : {
2346
+ serviceId: B(e.service),
2347
+ serviceName: B(e.displayName),
2348
2348
  noSetup: e.authTypes.length == 1 && e.authTypes[0] == "no_auth",
2349
- ...e.iconUrl == null || e.iconUrl === "" ? {} : { icon: z(e.iconUrl) },
2350
- ...e.homepageUrl == null || e.homepageUrl === "" ? {} : { homepageUrl: z(e.homepageUrl) }
2351
- };
2352
- }
2353
- function mr(e) {
2354
- return typeof e.isDefault != "boolean" || typeof e.status != "string" || ![
2355
- "active",
2356
- "disconnected",
2357
- "error",
2358
- "reauth_required"
2359
- ].includes(e.status) ? V() : {
2360
- connectionId: z(e.id),
2361
- serviceId: z(e.service),
2362
- displayName: z(e.displayName),
2363
- isDefault: e.isDefault,
2364
- status: e.status,
2365
- ...e.alias == null ? {} : { alias: z(e.alias) },
2366
- ...e.marketplace == null ? {} : { builtInAccount: !0 }
2349
+ ...e.iconUrl == null || e.iconUrl === "" ? {} : { icon: B(e.iconUrl) },
2350
+ ...e.homepageUrl == null || e.homepageUrl === "" ? {} : { homepageUrl: B(e.homepageUrl) }
2367
2351
  };
2368
2352
  }
2369
- function hr(e) {
2370
- if (z(e.id), z(e.service), z(e.name), typeof e.description != "string") return V();
2371
- nr(e.inputSchema, e.outputSchema);
2372
- }
2373
2353
  function gr(e) {
2354
+ if (B(e.id), B(e.service), B(e.name), typeof e.description != "string") return L();
2355
+ ir(e.inputSchema, e.outputSchema);
2356
+ }
2357
+ function _r(e) {
2374
2358
  return {
2375
2359
  nullable: e.nullable,
2376
- jsonSchema: De(e.json_schema),
2360
+ jsonSchema: ve(e.json_schema),
2377
2361
  ...e.description == null ? {} : { description: e.description },
2378
- ...e.value === void 0 ? {} : { value: De(e.value) }
2362
+ ...e.value === void 0 ? {} : { value: ve(e.value) }
2379
2363
  };
2380
2364
  }
2381
- function _r(e, t) {
2365
+ function vr(e, t) {
2382
2366
  let n = t.data.find((t) => t.service == e.service);
2383
- if (n == null) return V();
2384
- let r = pr(n), i = nr(e.inputSchema, e.outputSchema);
2367
+ if (n == null) return L();
2368
+ let r = hr(n), i = ir(e.inputSchema, e.outputSchema);
2385
2369
  return {
2386
2370
  serviceId: r.serviceId,
2387
2371
  serviceName: r.serviceName,
2388
2372
  ...r.icon == null ? {} : { icon: r.icon },
2389
2373
  ...r.homepageUrl == null ? {} : { homepageUrl: r.homepageUrl },
2390
- actionId: z(e.id),
2391
- ...e.operationType == null ? {} : { operationType: z(e.operationType) },
2392
- name: z(e.name),
2374
+ actionId: B(e.id),
2375
+ ...e.operationType == null ? {} : { operationType: B(e.operationType) },
2376
+ name: B(e.name),
2393
2377
  description: e.description,
2394
2378
  authenticated: !n.authTypes.includes("no_auth"),
2395
- inputSchema: De(e.inputSchema),
2396
- outputSchema: De(e.outputSchema),
2397
- inputs: Object.fromEntries(i.inputs.map((e) => [e.handle, gr(e)])),
2398
- outputs: Object.fromEntries(i.outputs.map((e) => [e.handle, gr(e)]))
2379
+ inputSchema: ve(e.inputSchema),
2380
+ outputSchema: ve(e.outputSchema),
2381
+ inputs: Object.fromEntries(i.inputs.map((e) => [e.handle, _r(e)])),
2382
+ outputs: Object.fromEntries(i.outputs.map((e) => [e.handle, _r(e)]))
2399
2383
  };
2400
2384
  }
2401
2385
  //#endregion
2402
2386
  //#region src/workbench/browser/runtime/stores/catalogStores.ts
2403
- function vr(e) {
2404
- let t = me(e);
2405
- return t.version != 1 || !Array.isArray(t.actions) ? V() : t.actions.map(Se);
2387
+ function yr(e) {
2388
+ let t = Ie(e);
2389
+ return t.version != 1 || !Array.isArray(t.actions) ? L() : t.actions.map(Ne);
2406
2390
  }
2407
- var yr = (...e) => JSON.stringify(e), br = class {
2391
+ var br = (...e) => JSON.stringify(e), xr = class {
2408
2392
  constructor(e, t, n) {
2409
2393
  this.client = e, this.kind = t, this.options = n, this.entries = /* @__PURE__ */ new Map();
2410
2394
  }
@@ -2415,15 +2399,13 @@ var yr = (...e) => JSON.stringify(e), br = class {
2415
2399
  ...t == null ? {} : { locale: t }
2416
2400
  }), a = `/v1/connector/proxy/${this.kind}${i.size ? `?${i}` : ""}`, o = this.entries.get(a);
2417
2401
  if (o == null) {
2418
- let e = (e) => fr(e, this.kind == "providers" ? pr : this.kind == "apps" ? mr : (e) => {
2419
- if (hr(e), e.service != n) return V();
2420
- });
2421
- o = new Ae((t, n) => this.client.readProxyCatalog({
2402
+ let e = (e) => mr(e, this.kind == "providers" ? hr : void 0);
2403
+ o = new Oe((t, n) => this.client.readProxyCatalog({
2422
2404
  path: a,
2423
2405
  decode: e
2424
2406
  }, t, n), this.kind == "providers" ? 3e5 : 3e4, this.options == null ? void 0 : {
2425
2407
  key: `open-flow:proxy:${this.kind}:v1:${encodeURIComponent(this.options.namespace)}:${a}`,
2426
- storage: () => this.kind == "apps" ? this.options.sessionStorage ?? window.sessionStorage : this.options.localStorage ?? window.localStorage,
2408
+ storage: () => this.options.localStorage ?? window.localStorage,
2427
2409
  decode: e
2428
2410
  }), this.entries.set(a, o);
2429
2411
  }
@@ -2439,7 +2421,7 @@ var yr = (...e) => JSON.stringify(e), br = class {
2439
2421
  for (let e of this.entries.values()) e.dispose();
2440
2422
  this.entries.clear();
2441
2423
  }
2442
- }, xr = class {
2424
+ }, Sr = class {
2443
2425
  constructor() {
2444
2426
  this.entries = /* @__PURE__ */ new Map();
2445
2427
  }
@@ -2477,13 +2459,13 @@ var yr = (...e) => JSON.stringify(e), br = class {
2477
2459
  for (let e of this.entries.values()) e.dispose();
2478
2460
  this.entries.clear();
2479
2461
  }
2480
- }, Sr = class {
2481
- #e = new xr();
2462
+ }, Cr = class {
2463
+ #e = new Sr();
2482
2464
  constructor(e, t) {
2483
- this.raw = new br(e, "providers", t);
2465
+ this.raw = new xr(e, "providers", t);
2484
2466
  }
2485
2467
  get(e, t = "en", n = !1) {
2486
- return this.#e.get(yr(e, t), [this.raw.get(e, t, void 0, n)], (e) => e.data.map(pr));
2468
+ return this.#e.get(br(e, t), [this.raw.get(e, t, void 0, n)], (e) => e.data.map(hr));
2487
2469
  }
2488
2470
  retryFailed() {
2489
2471
  this.raw.retryFailed();
@@ -2494,50 +2476,79 @@ var yr = (...e) => JSON.stringify(e), br = class {
2494
2476
  dispose() {
2495
2477
  this.#e.dispose(), this.raw.dispose();
2496
2478
  }
2497
- }, Cr = class {
2498
- #e;
2499
- #t = new xr();
2479
+ }, wr = class {
2480
+ #e = /* @__PURE__ */ new Map();
2481
+ #t = /* @__PURE__ */ new Map();
2500
2482
  constructor(e, t) {
2501
- this.#e = new br(e, "apps", t);
2483
+ this.client = e, this.options = t;
2502
2484
  }
2503
- get(e, t, n = !1) {
2504
- return this.#t.get(yr(t, e), [this.#e.get(t, void 0, void 0, n)], (t) => t.data.filter((t) => e == null || t.service == e).map(mr));
2485
+ get(t, n, r = !1) {
2486
+ let i = this.#e.get(n);
2487
+ if (i == null) {
2488
+ let e = w(n);
2489
+ i = new Oe((t, n) => this.client.readCatalog(e, t, n), 3e4, this.options == null ? void 0 : {
2490
+ key: `open-flow:connections:v1:${encodeURIComponent(this.options.namespace)}:${e.path}`,
2491
+ storage: () => this.options.sessionStorage ?? window.sessionStorage,
2492
+ decode: (e) => Array.isArray(e) ? e.map(We) : L()
2493
+ }), this.#e.set(n, i);
2494
+ }
2495
+ let a = i.get(r);
2496
+ if (t == null) return a;
2497
+ let o = br(n, t), s = this.#t.get(o);
2498
+ return s ?? (s = e(a, (e) => ({
2499
+ ...e,
2500
+ data: e.data?.filter((e) => e.serviceId == t)
2501
+ })), this.#t.set(o, s)), s;
2505
2502
  }
2506
2503
  retryFailed() {
2507
- this.#e.retryFailed();
2504
+ for (let e of this.#e.values()) e.state.value.error != null && e.refresh();
2508
2505
  }
2509
2506
  refreshFlow(e) {
2510
- this.#e.refreshFlow(e);
2507
+ this.#e.get(e)?.refresh(!0);
2511
2508
  }
2512
2509
  dispose() {
2513
- this.#t.dispose(), this.#e.dispose();
2510
+ for (let e of this.#t.values()) e.dispose();
2511
+ this.#t.clear();
2512
+ for (let e of this.#e.values()) e.dispose();
2513
+ this.#e.clear();
2514
2514
  }
2515
- }, wr = class {
2515
+ }, Tr = class {
2516
2516
  #e;
2517
- #t = new xr();
2517
+ #t = new Sr();
2518
2518
  #n = /* @__PURE__ */ new Map();
2519
2519
  #r = /* @__PURE__ */ new Set();
2520
2520
  #i = /* @__PURE__ */ new WeakMap();
2521
2521
  constructor(e, t, n) {
2522
- this.client = e, this.providers = t, this.#e = new br(e, "actions", n);
2522
+ this.client = e, this.providers = t, this.#e = new xr(e, "actions", n);
2523
2523
  }
2524
2524
  get(e, t, n = "en", r = !1) {
2525
- return this.#t.get(yr(t, e, n), [this.#e.get(t, n, e, r), this.providers.raw.get(t, n)], (e, t) => e.data.map((e) => _r(e, t)));
2526
- }
2527
- detail(e, t, n = "en", r = !1) {
2528
- let i = new URLSearchParams({
2529
- ...t == null ? {} : { flowId: t },
2530
- locale: n
2531
- }), a = `/v1/connector/action-metadata/${encodeURIComponent(e)}?${i}`, o = this.#n.get(a);
2532
- return o ?? (o = new Ae((t, n) => this.client.readCatalog({
2533
- path: a,
2534
- decode: (t) => {
2535
- let n = me(t);
2536
- if (n.version != 1) return V();
2537
- let r = Se(n.action);
2538
- return r.actionId == e ? r : V();
2525
+ return this.#t.get(br(t, e, n), [this.#e.get(t, n, e, r), this.providers.raw.get(t, n)], (t, n) => t.data.flatMap((t) => {
2526
+ try {
2527
+ let r = Ie(t);
2528
+ return gr(r), r.service == e ? [vr(r, n)] : L();
2529
+ } catch (n) {
2530
+ return console.warn("Could not load Connector Action.", {
2531
+ serviceId: e,
2532
+ actionId: t?.id,
2533
+ error: n
2534
+ }), [];
2539
2535
  }
2540
- }, t, n), 3e4), this.#n.set(a, o)), o.get(r);
2536
+ }));
2537
+ }
2538
+ detail(t, n, r = "en", i = !1) {
2539
+ let a = t.split(".")[0], o = this.get(a, n, r, i), s = br(n, t, r), c = this.#n.get(s);
2540
+ if (c == null) {
2541
+ let n = new I(404, "connector.action-not-found", `Connector Action "${t}" was not found.`);
2542
+ c = e(o, (e) => {
2543
+ let r = e.data?.find((e) => e.actionId == t);
2544
+ return {
2545
+ data: r,
2546
+ refreshing: e.refreshing,
2547
+ error: e.error ?? (e.data != null && r == null && !e.refreshing ? n : void 0)
2548
+ };
2549
+ }), this.#n.set(s, c);
2550
+ }
2551
+ return c;
2541
2552
  }
2542
2553
  search(e, t, n, r) {
2543
2554
  let i = new URLSearchParams({
@@ -2555,19 +2566,17 @@ var yr = (...e) => JSON.stringify(e), br = class {
2555
2566
  }
2556
2567
  let s = o.get(a);
2557
2568
  if (s != null) return s.refresh(), s;
2558
- let c = new Ae((e, t) => this.client.readCatalog({
2569
+ let c = new Oe((e, t) => this.client.readCatalog({
2559
2570
  path: `/v1/connector/action-metadata?${i}`,
2560
- decode: vr
2571
+ decode: yr
2561
2572
  }, null, t), 3e4);
2562
2573
  return r.aborted ? c.dispose() : (o.set(a, c), this.#r.add(c)), c;
2563
2574
  }
2564
2575
  retryFailed() {
2565
2576
  this.#e.retryFailed();
2566
- for (let e of this.#n.values()) e.state.value.error != null && e.refresh();
2567
2577
  }
2568
2578
  refreshFlow(e) {
2569
2579
  this.#e.refreshFlow(e);
2570
- for (let [t, n] of this.#n) new URL(t, "https://open-flow.invalid").searchParams.get("flowId") == e && n.refresh(!0);
2571
2580
  }
2572
2581
  dispose() {
2573
2582
  for (let e of this.#r) e.dispose();
@@ -2575,9 +2584,9 @@ var yr = (...e) => JSON.stringify(e), br = class {
2575
2584
  for (let e of this.#n.values()) e.dispose();
2576
2585
  this.#n.clear(), this.#t.dispose(), this.#e.dispose();
2577
2586
  }
2578
- }, Tr = class {
2587
+ }, Er = class {
2579
2588
  constructor(e, t) {
2580
- this.providers = new Sr(e, t), this.actions = new wr(e, this.providers, t), this.connections = new Cr(e, t);
2589
+ this.providers = new Cr(e, t), this.actions = new Tr(e, this.providers, t), this.connections = new wr(e, t);
2581
2590
  }
2582
2591
  dispose() {
2583
2592
  this.actions.dispose(), this.connections.dispose(), this.providers.dispose();
@@ -2585,38 +2594,37 @@ var yr = (...e) => JSON.stringify(e), br = class {
2585
2594
  refreshFlow(e) {
2586
2595
  this.actions.refreshFlow(e), this.connections.refreshFlow(e), this.providers.refreshFlow(e);
2587
2596
  }
2588
- }, Er = {
2597
+ }, Dr = {
2589
2598
  candidates: {},
2590
2599
  candidateErrors: [],
2591
2600
  loading: !1,
2592
2601
  loadingCandidates: []
2593
- }, Dr = class {
2602
+ }, Or = class {
2594
2603
  #e;
2595
2604
  #t;
2596
2605
  #n;
2597
2606
  #r;
2598
- constructor(e, t, r = h()) {
2599
- this.client = e, this.setNotice = t, this.i18n = r, this.#e = n(Er), this.#n = 0, this.#r = !1, this.$ = this.#e;
2607
+ #i;
2608
+ constructor(e, t, r = h(), i = () => {}) {
2609
+ this.client = e, this.setNotice = t, this.i18n = r, this.onSaved = i, this.#e = n(Dr), this.#n = 0, this.#r = !1, this.#i = new AbortController(), this.$ = this.#e;
2600
2610
  }
2601
2611
  async load(e) {
2602
2612
  let t = e != null && e == this.#t && this.#e.value.access != null, n = ++this.#n;
2603
- if (this.#t = e, t || this.#e.set(e == null ? Er : {
2604
- ...Er,
2613
+ if (this.#t = e, t || (this.#i.abort(), this.#i = new AbortController(), this.#e.set(e == null ? Dr : {
2614
+ ...Dr,
2605
2615
  loading: !0
2606
- }), e != null) try {
2607
- let r = await this.client.getConnectorAccess(e);
2616
+ })), e != null) try {
2617
+ let t = await this.client.getConnectorAccess(e);
2608
2618
  if (!this.#r && n == this.#n) {
2609
- let e = this.#e.value, n = e.access != null && e.access.accessRevision > r.accessRevision ? e.access : r;
2610
- this.#e.set(t ? {
2619
+ let e = this.#e.value, n = e.access != null && e.access.accessRevision > t.accessRevision ? e.access : t;
2620
+ this.#e.set({
2611
2621
  ...e,
2612
- access: n
2613
- } : {
2614
- ...Er,
2615
- access: n
2622
+ access: n,
2623
+ loading: !1
2616
2624
  });
2617
2625
  }
2618
2626
  } catch (e) {
2619
- !this.#r && n == this.#n && (t || this.#e.set(Er), this.setNotice(L(e, this.i18n.t)));
2627
+ !this.#r && n == this.#n && (t || this.#e.set(Dr), this.setNotice(F(e, this.i18n.t)));
2620
2628
  }
2621
2629
  }
2622
2630
  changed(e) {
@@ -2625,77 +2633,115 @@ var yr = (...e) => JSON.stringify(e), br = class {
2625
2633
  configure(e) {
2626
2634
  this.#r || this.#t == null || (this.#e.set({
2627
2635
  ...this.#e.value,
2628
- configuration: { providerId: e }
2629
- }), this.loadCandidates(e));
2630
- }
2631
- async loadCandidates(e) {
2632
- let t = this.#t, n = this.#e.value;
2633
- if (!(t == null || n.access?.mode != "selectable" || n.loadingCandidates.includes(e))) {
2636
+ configuration: e == null ? {} : { providerId: e }
2637
+ }), e != null && this.loadCandidates([e], !0));
2638
+ }
2639
+ async loadCandidates(e, t = !1) {
2640
+ let n = this.#t, r = this.#e.value;
2641
+ if (this.#r || n == null || r.access?.mode != "selectable") return;
2642
+ let i = [...new Set(e)].filter((e) => !r.loadingCandidates.includes(e) && (t || r.candidates[e] == null && !r.candidateErrors.includes(e)));
2643
+ if (i.length == 0) return;
2644
+ let a = this.#i.signal;
2645
+ this.#e.set({
2646
+ ...r,
2647
+ candidateErrors: r.candidateErrors.filter((e) => !i.includes(e)),
2648
+ loadingCandidates: [...r.loadingCandidates, ...i]
2649
+ });
2650
+ try {
2651
+ let e = await this.client.listProviderAccessBindingCandidates(n, i, a);
2652
+ if (a.aborted) return;
2653
+ let t = this.#e.value, r = { ...t.candidates }, o = [...t.candidateErrors];
2654
+ for (let t of e.results) "error" in t ? o.push(t.providerId) : r[t.providerId] = t;
2634
2655
  this.#e.set({
2635
- ...n,
2636
- candidateErrors: n.candidateErrors.filter((t) => t != e),
2637
- loadingCandidates: [...n.loadingCandidates, e]
2656
+ ...t,
2657
+ candidates: r,
2658
+ candidateErrors: o,
2659
+ loadingCandidates: t.loadingCandidates.filter((e) => !i.includes(e))
2638
2660
  });
2639
- try {
2640
- let n = await this.client.listProviderAccessBindingCandidates(t, e);
2641
- if (this.#r || t != this.#t) return;
2642
- let r = this.#e.value;
2643
- this.#e.set({
2644
- ...r,
2645
- candidates: {
2646
- ...r.candidates,
2647
- [e]: n
2648
- },
2649
- loadingCandidates: r.loadingCandidates.filter((t) => t != e)
2650
- });
2651
- } catch (n) {
2652
- if (this.#r || t != this.#t) return;
2653
- let r = this.#e.value;
2654
- this.#e.set({
2655
- ...r,
2656
- candidateErrors: [...r.candidateErrors.filter((t) => t != e), e],
2657
- loadingCandidates: r.loadingCandidates.filter((t) => t != e)
2658
- }), this.setNotice(L(n, this.i18n.t));
2659
- }
2661
+ let s = e.results.find((e) => "error" in e);
2662
+ s != null && "error" in s && this.setNotice(F(new I(502, s.error.code, s.error.message), this.i18n.t));
2663
+ } catch (e) {
2664
+ if (a.aborted) return;
2665
+ let t = this.#e.value;
2666
+ this.#e.set({
2667
+ ...t,
2668
+ candidateErrors: [...t.candidateErrors, ...i],
2669
+ loadingCandidates: t.loadingCandidates.filter((e) => !i.includes(e))
2670
+ }), this.setNotice(F(e, this.i18n.t));
2660
2671
  }
2661
2672
  }
2662
2673
  async select(e, t, n = !0) {
2663
2674
  let r = this.#t, i = this.#e.value.access;
2664
- if (r == null || i?.mode != "selectable" || this.#e.value.savingProviderId != null) return !1;
2675
+ if (this.#r || r == null || i?.mode != "selectable" || this.#e.value.savingProviderId != null) return !1;
2665
2676
  this.#e.set({
2666
2677
  ...this.#e.value,
2667
- savingProviderId: e
2678
+ savingProviderId: e,
2679
+ pendingSelection: {
2680
+ providerId: e,
2681
+ accessBindingId: t,
2682
+ selected: n
2683
+ }
2668
2684
  });
2669
2685
  try {
2670
2686
  let a = n ? await this.client.addProviderAccessBinding(r, e, t, i.accessRevision) : await this.client.removeProviderAccessBinding(r, e, t, i.accessRevision);
2671
- if (!this.#r && r == this.#t) return this.#e.set({
2672
- ...this.#e.value,
2673
- access: a,
2674
- savingProviderId: void 0
2675
- }), !0;
2687
+ if (!this.#r && r == this.#t) {
2688
+ let e = this.#e.value.access;
2689
+ return this.#e.set({
2690
+ ...this.#e.value,
2691
+ access: e != null && e.accessRevision > a.accessRevision ? e : a,
2692
+ savingProviderId: void 0,
2693
+ pendingSelection: void 0
2694
+ }), this.onSaved(r), !0;
2695
+ }
2676
2696
  } catch (e) {
2677
2697
  if (this.#r || r != this.#t) return !1;
2678
2698
  this.#e.set({
2679
2699
  ...this.#e.value,
2680
- savingProviderId: void 0
2681
- }), this.setNotice(L(e, this.i18n.t)), await this.load(r);
2700
+ savingProviderId: void 0,
2701
+ pendingSelection: void 0
2702
+ }), this.setNotice(F(e, this.i18n.t)), await this.load(r);
2682
2703
  }
2683
2704
  return !1;
2684
2705
  }
2706
+ async setService(e, t) {
2707
+ let n = this.#t, r = this.#e.value.access;
2708
+ if (this.#r || n == null || r?.mode != "selectable" || this.#e.value.savingProviderId != null) return !1;
2709
+ this.#e.set({
2710
+ ...this.#e.value,
2711
+ savingProviderId: e
2712
+ });
2713
+ try {
2714
+ let i = await this.client.setConnectorService(n, e, t, r.accessRevision);
2715
+ if (this.#r || n != this.#t) return !1;
2716
+ let a = this.#e.value.access;
2717
+ return this.#e.set({
2718
+ ...this.#e.value,
2719
+ access: a != null && a.accessRevision > i.accessRevision ? a : i,
2720
+ savingProviderId: void 0,
2721
+ ...!t && this.#e.value.configuration?.providerId == e ? { configuration: {} } : {}
2722
+ }), this.onSaved(n), t && this.configure(e), !0;
2723
+ } catch (e) {
2724
+ return this.#r || n != this.#t ? !1 : (this.#e.set({
2725
+ ...this.#e.value,
2726
+ savingProviderId: void 0,
2727
+ pendingSelection: void 0
2728
+ }), this.setNotice(F(e, this.i18n.t)), await this.load(n), !1);
2729
+ }
2730
+ }
2685
2731
  dispose() {
2686
- this.#r = !0, this.#n += 1, this.#e.dispose();
2732
+ this.#r = !0, this.#i.abort(), this.#n += 1, this.#e.dispose();
2687
2733
  }
2688
2734
  };
2689
2735
  //#endregion
2690
2736
  //#region src/workbench/browser/runtime/connectionCatalog.ts
2691
- function Or(e, t) {
2692
- let n = e.authenticated && t != null ? kr(t).preferred : void 0;
2737
+ function kr(e, t) {
2738
+ let n = e.authenticated && t != null ? $(t).preferred : void 0;
2693
2739
  return {
2694
2740
  ...e,
2695
2741
  ...n == null ? {} : { defaultConnection: n }
2696
2742
  };
2697
2743
  }
2698
- function kr(e) {
2744
+ function $(e) {
2699
2745
  let t = [], n = /* @__PURE__ */ new Map(), r;
2700
2746
  for (let i of e) n.set(i.connectionId, i), i.status == "active" && (t.push(i), i.isDefault && (r = i));
2701
2747
  return {
@@ -2723,7 +2769,7 @@ function Mr(e, t) {
2723
2769
  service: e.serviceName
2724
2770
  }) : e.description,
2725
2771
  group: t("addNode.connectorActions"),
2726
- icon: A(e),
2772
+ icon: k(e),
2727
2773
  id: `connector:${e.actionId}`,
2728
2774
  inputs: jr(e.inputs),
2729
2775
  kind: "connector",
@@ -2750,7 +2796,7 @@ function Nr(e, t) {
2750
2796
  choices: r,
2751
2797
  description: t(r.length == 1 ? "addNode.connectorActionCountOne" : "addNode.connectorActionCount", { count: r.length }),
2752
2798
  group: t("addNode.connectorActions"),
2753
- icon: A(n),
2799
+ icon: k(n),
2754
2800
  id: `connector-provider:${n.serviceId}`,
2755
2801
  inputs: [],
2756
2802
  kind: "connector-group",
@@ -2765,7 +2811,7 @@ function Pr(e, t) {
2765
2811
  choices: [],
2766
2812
  description: t("addNode.connectorBrowseActions"),
2767
2813
  group: t("addNode.connectorActions"),
2768
- icon: A(e),
2814
+ icon: k(e),
2769
2815
  id: `connector-provider:${e.serviceId}`,
2770
2816
  inputs: [],
2771
2817
  kind: "connector-group",
@@ -2790,7 +2836,7 @@ function Fr(e, t) {
2790
2836
  function Ir(e, t, n) {
2791
2837
  if (e == null) return [];
2792
2838
  let r = [];
2793
- for (let i of [...D(e.revision.content).tasks].toSorted()) {
2839
+ for (let i of [...Ge(e.revision.content).tasks].toSorted()) {
2794
2840
  let a = e.task(i);
2795
2841
  if (a?.executor.kind != "connector") continue;
2796
2842
  let o = t[a.executor.action];
@@ -2826,12 +2872,12 @@ var Lr = class {
2826
2872
  #h;
2827
2873
  #g;
2828
2874
  constructor(r, i, a, o, s = h(), c = i.catalogs) {
2829
- this.data = c, this.#i = /* @__PURE__ */ new Set(), this.#a = new I(), this.#o = new I(), this.#d = n(Ar), this.#f = n([]), this.#p = n([]), this.#g = !1, this.loadConnections = async (e) => {
2875
+ this.data = c, this.#i = /* @__PURE__ */ new Set(), this.#a = new E(), this.#o = new E(), this.#d = n(Ar), this.#f = n([]), this.#p = n([]), this.#g = !1, this.loadConnections = async (e) => {
2830
2876
  let t = this.#m.$.flowId.value;
2831
- this.#g || t == null || await k(this.data.connections.get(void 0, t), e);
2877
+ this.#g || t == null || await O(this.data.connections.get(void 0), e);
2832
2878
  }, this.browseAddNodeOptions = (e) => {
2833
2879
  let t = this.data.providers.get(void 0, this.#n);
2834
- return j(e, (e) => {
2880
+ return A(e, (e) => {
2835
2881
  let n = e(t), r = e(this.#t.t$);
2836
2882
  return {
2837
2883
  ...n,
@@ -2840,11 +2886,11 @@ var Lr = class {
2840
2886
  });
2841
2887
  }, this.provideAddNodeOptionChoices = (e, t) => {
2842
2888
  let n = e.slice(19), r = this.data.actions.get(n, void 0, this.#n), i = this.data.providers.get(void 0, this.#n);
2843
- return j(t, (e) => {
2889
+ return A(t, (e) => {
2844
2890
  let t = e(r), a = e(i).data?.find((e) => e.serviceId == n), o = e(this.#t.t$);
2845
2891
  return {
2846
2892
  ...t,
2847
- data: t.data?.map((e) => Mr(Or({
2893
+ data: t.data?.map((e) => Mr(kr({
2848
2894
  ...e,
2849
2895
  ...a == null ? {} : {
2850
2896
  serviceName: a.serviceName,
@@ -2855,17 +2901,17 @@ var Lr = class {
2855
2901
  });
2856
2902
  }, this.provideAddNodeOptions = (e, t, n = t) => {
2857
2903
  let r = e.trim();
2858
- if (r.length == 0) return j(t, (e) => ({
2904
+ if (r.length == 0) return A(t, (e) => ({
2859
2905
  data: Nr(Object.values(e(this.$.actions)), e(this.#t.t$)),
2860
2906
  refreshing: !1,
2861
2907
  error: void 0
2862
2908
  }));
2863
2909
  let i = this.data.actions.search(r, void 0, this.#n, n).get();
2864
- return j(t, (e) => {
2910
+ return A(t, (e) => {
2865
2911
  let t = e(i), n = e(this.#t.t$);
2866
2912
  return {
2867
2913
  ...t,
2868
- data: t.data?.map((e) => Mr(Or(e, void 0), n))
2914
+ data: t.data?.map((e) => Mr(kr(e, void 0), n))
2869
2915
  };
2870
2916
  });
2871
2917
  }, this.retryCatalog = () => {
@@ -2874,14 +2920,14 @@ var Lr = class {
2874
2920
  let l = t((e) => {
2875
2921
  let t = e(i.$.flowId);
2876
2922
  return Object.fromEntries(e(this.#f).flatMap((n) => {
2877
- let r = e(ke(this.data.actions.detail(n, t, this.#n)));
2878
- return r == null ? [] : [[n, Or(r, e(ke(this.data.connections.get(r.serviceId, t))))]];
2923
+ let r = e(R(this.data.actions.detail(n, t, this.#n)));
2924
+ return r == null ? [] : [[n, kr(r, e(R(this.data.connections.get(r.serviceId, t))))]];
2879
2925
  }));
2880
2926
  }), u = t((e) => {
2881
2927
  let t = e(i.$.flowId);
2882
2928
  return Object.fromEntries(e(this.#p).flatMap((n) => {
2883
- let r = e(ke(this.data.connections.get(n, t)));
2884
- return r == null ? [] : [[n, kr(r)]];
2929
+ let r = e(R(this.data.connections.get(n, t)));
2930
+ return r == null ? [] : [[n, $(r)]];
2885
2931
  }));
2886
2932
  });
2887
2933
  this.#l = t((e) => {
@@ -2891,18 +2937,19 @@ var Lr = class {
2891
2937
  return {
2892
2938
  action: r,
2893
2939
  actionError: o == null ? void 0 : {
2894
- ...o instanceof H ? { code: o.code } : {},
2895
- message: L(o, this.#t.t).message
2940
+ ...o instanceof I ? { code: o.code } : {},
2941
+ message: F(o, this.#t.t).message
2896
2942
  },
2897
2943
  activeConnections: a?.active,
2898
2944
  authorizationPending: r != null && n.authorizationServiceId == r.serviceId,
2899
2945
  connection: c,
2900
- connectionError: s == null ? void 0 : L(s, this.#t.t).message
2946
+ connectionError: s == null ? void 0 : F(s, this.#t.t).message
2901
2947
  };
2902
2948
  }), this.$ = {
2949
+ pickerConnections: t((e) => e(i.$.flowId) == null ? [] : e(R(this.data.connections.get(void 0))) ?? []),
2903
2950
  connections: t((e) => {
2904
2951
  let t = e(i.$.flowId);
2905
- return t == null ? [] : e(ke(this.data.connections.get(void 0, t))) ?? [];
2952
+ return t == null ? [] : e(R(this.data.connections.get(void 0, t))) ?? [];
2906
2953
  }),
2907
2954
  actionLoading: e(this.#d, (e) => e.actionLoading),
2908
2955
  actions: l,
@@ -2932,10 +2979,10 @@ var Lr = class {
2932
2979
  let t = this.#m.$.flowId.value;
2933
2980
  if (t == null || this.#g) throw Error("Connector Action cannot be resolved without an active Flow.");
2934
2981
  await Promise.resolve();
2935
- let n = await k(this.data.actions.detail(e, t, this.#n), void 0, !0), r = n.authenticated ? await k(this.data.connections.get(n.serviceId, t), void 0, !0) : [];
2982
+ let n = await O(this.data.actions.detail(e, t, this.#n), void 0, !0), r = n.authenticated ? await O(this.data.connections.get(n.serviceId, t), void 0, !0) : [];
2936
2983
  return this.#b(this.#f, [e]), n.authenticated && this.#b(this.#p, [n.serviceId]), {
2937
- action: Or(n, r),
2938
- connections: kr(r).active
2984
+ action: kr(n, r),
2985
+ connections: $(r).active
2939
2986
  };
2940
2987
  }
2941
2988
  async refresh(e = !1) {
@@ -2957,13 +3004,13 @@ var Lr = class {
2957
3004
  });
2958
3005
  try {
2959
3006
  await Promise.resolve();
2960
- let a = await k(i, void 0, e);
3007
+ let a = await O(i, void 0, e);
2961
3008
  if (!this.#S(t, n)) return;
2962
3009
  this.#b(this.#f, [a.actionId]), a.authenticated && await this.#_(n, r, a.serviceId, e, t);
2963
3010
  } catch (e) {
2964
3011
  this.#S(t, n) && this.#x({ actionError: {
2965
3012
  actionId: r.actionId,
2966
- message: L(e, this.#t.t).message
3013
+ message: F(e, this.#t.t).message
2967
3014
  } });
2968
3015
  } finally {
2969
3016
  this.#S(t, n) && this.#d.value.actionLoading == r.actionId && this.#x({ actionLoading: void 0 });
@@ -2971,11 +3018,11 @@ var Lr = class {
2971
3018
  }
2972
3019
  async loadCodeConnections(e, t) {
2973
3020
  let n = this.#m.$.flowId.value;
2974
- n == null || this.#g || (await k(this.data.connections.get(e, n), t), !(t.aborted || this.#g || n != this.#m.$.flowId.value) && this.#b(this.#p, [e]));
3021
+ n == null || this.#g || (await O(this.data.connections.get(e, n), t), !(t.aborted || this.#g || n != this.#m.$.flowId.value) && this.#b(this.#p, [e]));
2975
3022
  }
2976
3023
  async loadCodeAction(e, t) {
2977
3024
  let n = this.#n, r = this.#m.$.flowId.value;
2978
- r == null || this.#g || (await k(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]));
3025
+ r == null || this.#g || (await O(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]));
2979
3026
  }
2980
3027
  async connect(e) {
2981
3028
  if (this.#g) return;
@@ -2996,7 +3043,7 @@ var Lr = class {
2996
3043
  serviceId: e
2997
3044
  }, this.#x({ authorizationServiceId: e });
2998
3045
  } catch (e) {
2999
- this.#g || this.#u(L(e, this.#t.t));
3046
+ this.#g || this.#u(F(e, this.#t.t));
3000
3047
  }
3001
3048
  }
3002
3049
  async setConnection(e, t) {
@@ -3022,16 +3069,16 @@ var Lr = class {
3022
3069
  let i;
3023
3070
  try {
3024
3071
  let r = this.data.connections.get(t, e, n);
3025
- await Promise.resolve(), i = await k(r, void 0, n);
3072
+ await Promise.resolve(), i = await O(r, void 0, n);
3026
3073
  } catch (n) {
3027
3074
  this.#S(r, e) && this.#x({ connectionError: {
3028
- message: L(n, this.#t.t).message,
3075
+ message: F(n, this.#t.t).message,
3029
3076
  serviceId: t
3030
3077
  } });
3031
3078
  return;
3032
3079
  }
3033
3080
  if (!this.#S(r, e)) return;
3034
- let a = kr(i);
3081
+ let a = $(i);
3035
3082
  return this.#b(this.#p, [t]), a;
3036
3083
  }
3037
3084
  async #y(e, t, n) {
@@ -3059,7 +3106,7 @@ var Lr = class {
3059
3106
  if (r.length > 0) {
3060
3107
  for (let e of r) this.#i.add(e);
3061
3108
  try {
3062
- let n = await Promise.all(r.map((e) => k(this.data.actions.detail(e, t, this.#n))));
3109
+ let n = await Promise.all(r.map((e) => O(this.data.actions.detail(e, t, this.#n))));
3063
3110
  if (!this.#S(e, t)) return;
3064
3111
  this.#b(this.#f, n.map((e) => e.actionId));
3065
3112
  } catch {
@@ -3070,7 +3117,7 @@ var Lr = class {
3070
3117
  }
3071
3118
  if (!this.#S(e, t)) return;
3072
3119
  let i = /* @__PURE__ */ new Set();
3073
- for (let e of D(n.revision.content).tasks) {
3120
+ for (let e of Ge(n.revision.content).tasks) {
3074
3121
  let t = n.task(e);
3075
3122
  if (t?.executor.kind != "connector") continue;
3076
3123
  let r = this.$.actions.value[t.executor.action];
@@ -3100,11 +3147,11 @@ var zr = class {
3100
3147
  let t = this.#t.get(e);
3101
3148
  if (t == null) {
3102
3149
  let n = (t) => {
3103
- let n = Ne(t);
3150
+ let n = Se(t);
3104
3151
  if (n.locale != e) throw Error("Unexpected Trigger catalog language.");
3105
3152
  return n;
3106
3153
  }, r = this.host.triggerCatalogCache;
3107
- t = new Ae((t, r) => this.client.readCatalog({
3154
+ t = new Oe((t, r) => this.client.readCatalog({
3108
3155
  path: `/v1/trigger-keys/catalog?locale=${encodeURIComponent(e)}`,
3109
3156
  decode: n
3110
3157
  }, t, r), 3e5, r == null ? void 0 : {
@@ -3145,7 +3192,7 @@ function Ur(e, t, n) {
3145
3192
  return {
3146
3193
  description: n?.description ?? e.description,
3147
3194
  group: t.t("addNode.integrationTriggers"),
3148
- icon: A({
3195
+ icon: k({
3149
3196
  serviceId: e.provider,
3150
3197
  serviceName: e.provider
3151
3198
  }),
@@ -3178,17 +3225,17 @@ var Wr = class {
3178
3225
  #c;
3179
3226
  #l;
3180
3227
  constructor(r, i, a, o, s = h()) {
3181
- this.#r = new I(), this.#i = /* @__PURE__ */ new Set(), this.#s = n(Br), this.#l = !1, this.browseAddNodeOptions = (e) => this.#u("", e), this.provideAddNodeOptions = (e, t) => this.#u(e, t), this.catalog = new zr(r, _t([s.lang]), o), this.#e = r, this.#t = o, this.#n = s, this.#o = a, this.#c = i, this.#a = t((e) => {
3228
+ this.#r = new E(), this.#i = /* @__PURE__ */ new Set(), this.#s = n(Br), this.#l = !1, this.browseAddNodeOptions = (e) => this.#u("", e), this.provideAddNodeOptions = (e, t) => this.#u(e, t), this.catalog = new zr(r, xt([s.lang]), o), this.#e = r, this.#t = o, this.#n = s, this.#o = a, this.#c = i, this.#a = t((e) => {
3182
3229
  let t = e(i.$.selection), n = Hr(t, i), r = e(this.#s);
3183
3230
  if (t?.kind != "trigger") return { authorizationPending: !1 };
3184
3231
  let a = t.trigger;
3185
3232
  if (a.kind != "poll" && a.kind != "integration") return { authorizationPending: !1 };
3186
- let o = n == null ? void 0 : e(i.catalogs.connections.get(n.provider, e(i.$.flowId))).data, s = o == null ? void 0 : kr(o), c = n == null ? void 0 : e(i.catalogs.connections.get(n.provider, e(i.$.flowId))).error;
3233
+ let o = n == null ? void 0 : e(i.catalogs.connections.get(n.provider, e(i.$.flowId))).data, s = o == null ? void 0 : $(o), c = n == null ? void 0 : e(i.catalogs.connections.get(n.provider, e(i.$.flowId))).error;
3187
3234
  return {
3188
3235
  activeConnections: s?.active,
3189
3236
  authorizationPending: r.authorizationProvider == n?.provider,
3190
3237
  connection: n?.connectionId == null ? void 0 : s?.byId.get(n.connectionId),
3191
- connectionError: c == null ? void 0 : L(c, this.#n.t).message,
3238
+ connectionError: c == null ? void 0 : F(c, this.#n.t).message,
3192
3239
  definition: a.definition
3193
3240
  };
3194
3241
  }), this.$ = {
@@ -3210,7 +3257,7 @@ var Wr = class {
3210
3257
  }
3211
3258
  #u(e, t) {
3212
3259
  let n = this.catalog.get(), r = e.trim().toLowerCase();
3213
- return j(t, (e) => {
3260
+ return A(t, (e) => {
3214
3261
  let t = e(n);
3215
3262
  e(this.#n.t$);
3216
3263
  let i = e(this.#c.$.flowId) != null && e(this.#c.$.target)?.kind == "flow", a = t.data, o = a?.definitions.filter((e) => !r || [
@@ -3242,11 +3289,11 @@ var Wr = class {
3242
3289
  });
3243
3290
  try {
3244
3291
  let i = this.#c.catalogs.connections.get(r.provider, n, e || this.#i.has(r.provider));
3245
- if (await Promise.resolve(), await k(i, void 0, e || this.#i.has(r.provider)), !this.#f(t, n)) return;
3292
+ if (await Promise.resolve(), await O(i, void 0, e || this.#i.has(r.provider)), !this.#f(t, n)) return;
3246
3293
  this.#i.delete(r.provider);
3247
3294
  } catch (e) {
3248
3295
  this.#f(t, n) && this.#d({ connectionError: {
3249
- message: L(e, this.#n.t).message,
3296
+ message: F(e, this.#n.t).message,
3250
3297
  provider: r.provider
3251
3298
  } });
3252
3299
  } finally {
@@ -3265,7 +3312,7 @@ var Wr = class {
3265
3312
  }
3266
3313
  !this.#l && t == this.#c.$.flowId.value && this.#d({ authorizationProvider: e });
3267
3314
  } catch (e) {
3268
- this.#l || this.#o(L(e, this.#n.t));
3315
+ this.#l || this.#o(F(e, this.#n.t));
3269
3316
  }
3270
3317
  }
3271
3318
  async setConnection(e, t) {
@@ -3291,7 +3338,7 @@ var Wr = class {
3291
3338
  function Gr(e, t) {
3292
3339
  let n = e, r = [];
3293
3340
  for (let e of t) {
3294
- let t = pt(n, [e]), i = [];
3341
+ let t = _t(n, [e]), i = [];
3295
3342
  switch (e.kind) {
3296
3343
  case "graph.node.create":
3297
3344
  i.push({
@@ -3550,7 +3597,7 @@ function Kr(e, t, n) {
3550
3597
  let r = e.graph(t)?.nodes ?? {}, i = Object.fromEntries(n.flatMap((e) => r[e] == null ? [] : [[e, r[e]]]));
3551
3598
  return {
3552
3599
  edges: (e.graph(t)?.edges ?? []).filter((e) => i[e.source] != null && i[e.target] != null),
3553
- bindings: Object.fromEntries(Object.values(i).flatMap((t) => "inputs" in t ? Object.values(Ze(t)).flatMap((t) => t.kind == "sources" ? t.sources.flatMap((t) => {
3600
+ bindings: Object.fromEntries(Object.values(i).flatMap((t) => "inputs" in t ? Object.values(tt(t)).flatMap((t) => t.kind == "sources" ? t.sources.flatMap((t) => {
3554
3601
  if (t.kind != "binding") return [];
3555
3602
  let n = e.binding(t.bindingId);
3556
3603
  return n?.kind == "variable" ? [[t.bindingId, n]] : [];
@@ -3572,7 +3619,7 @@ function qr(e, t, n, r) {
3572
3619
  let i = Object.values(e.graph(t)?.nodes ?? {}).some((e) => e.kind === "manual"), a = Object.entries(n.nodes).filter(([, e]) => (t.kind == "flow" || "inputs" in e) && (e.kind !== "manual" || !i) && (e.kind != "task" || e.task == null || n.modules[e.task.moduleId] != null)), o = a.map(([e]) => e), s = new Map(o.map((e) => [e, r()])), c = [], l = /* @__PURE__ */ new Map();
3573
3620
  for (let [, e] of a) {
3574
3621
  if (!("inputs" in e)) continue;
3575
- let t = Object.values(Ze(e));
3622
+ let t = Object.values(tt(e));
3576
3623
  for (let e of t) if (e.kind == "sources") for (let t of e.sources) t.kind != "binding" || n.bindings[t.bindingId]?.kind != "variable" || l.has(t.bindingId) || l.set(t.bindingId, r());
3577
3624
  }
3578
3625
  for (let [e, t] of l) {
@@ -3646,7 +3693,7 @@ function qr(e, t, n, r) {
3646
3693
  ...o,
3647
3694
  inputs: u
3648
3695
  };
3649
- if (o.kind == "condition" && (d = Xe(o, (e) => e.kind == "node" ? {
3696
+ if (o.kind == "condition" && (d = et(o, (e) => e.kind == "node" ? {
3650
3697
  ...e,
3651
3698
  nodeId: s.get(e.nodeId) ?? e.nodeId
3652
3699
  } : e.kind == "binding" ? {
@@ -3692,7 +3739,7 @@ function qr(e, t, n, r) {
3692
3739
  });
3693
3740
  }
3694
3741
  return {
3695
- changes: Pe(e, t, c),
3742
+ changes: Fe(e, t, c),
3696
3743
  nodeIds: [...s.values()],
3697
3744
  sourceIds: o
3698
3745
  };
@@ -3790,15 +3837,15 @@ var Xr = class {
3790
3837
  this.#a = e;
3791
3838
  let t = e, n = [];
3792
3839
  for (let e of this.#o) try {
3793
- t = B(t, e.changes), n.push(e);
3840
+ t = z(t, e.changes), n.push(e);
3794
3841
  } catch (t) {
3795
- if (!(t instanceof Qe)) throw t;
3842
+ if (!(t instanceof nt)) throw t;
3796
3843
  e.active = !1;
3797
3844
  }
3798
3845
  return this.#o = n, t;
3799
3846
  }
3800
3847
  project(e) {
3801
- return this.#o.reduce((e, t) => B(e, t.changes), e);
3848
+ return this.#o.reduce((e, t) => z(e, t.changes), e);
3802
3849
  }
3803
3850
  async settled() {
3804
3851
  await this.#s;
@@ -3818,7 +3865,7 @@ var Xr = class {
3818
3865
  let o = {
3819
3866
  ...e,
3820
3867
  active: !0,
3821
- changeId: C(),
3868
+ changeId: j(),
3822
3869
  changes: n,
3823
3870
  started: !1
3824
3871
  };
@@ -3843,21 +3890,21 @@ var Xr = class {
3843
3890
  let r = this.#l(e, n, t);
3844
3891
  return this.#o.length == 0 && this.#t.check(), r;
3845
3892
  } catch (n) {
3846
- if (n instanceof H && n.code == "flow.revision-conflict") {
3893
+ if (n instanceof I && n.code == "flow.revision-conflict") {
3847
3894
  if (!t && await this.#t.recover(e)) {
3848
- t = !0, e.changeId = C();
3895
+ t = !0, e.changeId = j();
3849
3896
  continue;
3850
3897
  }
3851
3898
  t && await this.#t.recover(e), this.#u(e);
3852
3899
  } else {
3853
- if (!(n instanceof H) && !t) {
3900
+ if (!(n instanceof I) && !t) {
3854
3901
  let n = this.#a?.revisionId;
3855
3902
  if (await this.#t.recover(e)) {
3856
- t = !0, e.active && this.#a?.revisionId != n && (e.changeId = C());
3903
+ t = !0, e.active && this.#a?.revisionId != n && (e.changeId = j());
3857
3904
  continue;
3858
3905
  }
3859
3906
  }
3860
- this.#u(e), this.#t.current(e) && this.#r(L(n, this.#n.t));
3907
+ this.#u(e), this.#t.current(e) && this.#r(F(n, this.#n.t));
3861
3908
  }
3862
3909
  return;
3863
3910
  }
@@ -3866,7 +3913,7 @@ var Xr = class {
3866
3913
  #l(e, t, n) {
3867
3914
  let r = {
3868
3915
  ...n.revision,
3869
- content: B(t, e.changes).content
3916
+ content: z(t, e.changes).content
3870
3917
  };
3871
3918
  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;
3872
3919
  }
@@ -3884,7 +3931,7 @@ var Xr = class {
3884
3931
  }, $r = class {
3885
3932
  #e;
3886
3933
  #t;
3887
- #n = new I();
3934
+ #n = new E();
3888
3935
  #r;
3889
3936
  #i = n(Qr);
3890
3937
  #a = new AbortController();
@@ -3950,7 +3997,7 @@ var Xr = class {
3950
3997
  failed: !t,
3951
3998
  loading: !1,
3952
3999
  refreshing: !1
3953
- }), this.#r(L(n, this.#t.t));
4000
+ }), this.#r(F(n, this.#t.t));
3954
4001
  }
3955
4002
  }
3956
4003
  async loadMore() {
@@ -3978,7 +4025,7 @@ var Xr = class {
3978
4025
  this.#c({
3979
4026
  loadingMore: !1,
3980
4027
  loadMoreFailed: !0
3981
- }), this.#r(L(e, this.#t.t));
4028
+ }), this.#r(F(e, this.#t.t));
3982
4029
  }
3983
4030
  }
3984
4031
  async setEnabled(e, t) {
@@ -3988,7 +4035,7 @@ var Xr = class {
3988
4035
  let n = await this.#e.setFlowEnabled(e.flowId, e.live.publicationId, t);
3989
4036
  this.#s || this.include(n);
3990
4037
  } catch (e) {
3991
- this.#s || (this.#r(L(e, this.#t.t)), await this.reload());
4038
+ this.#s || (this.#r(F(e, this.#t.t)), await this.reload());
3992
4039
  } finally {
3993
4040
  this.#o.delete(e.flowId);
3994
4041
  }
@@ -4000,9 +4047,9 @@ var Xr = class {
4000
4047
  try {
4001
4048
  let t = await this.#e.publishFlow(e.flowId, e.draftRevisionId, e.live?.publicationId ?? null);
4002
4049
  if (this.#s) return;
4003
- let n = await J.runPromise(J.gen({ self: this }, function* () {
4050
+ let n = await G.runPromise(G.gen({ self: this }, function* () {
4004
4051
  let n = t;
4005
- for (; n.status == "pending";) yield* J.sleep(1e3), n = yield* J.tryPromise((t) => this.#e.getPublishOperation(e.flowId, n.operationId, t));
4052
+ for (; n.status == "pending";) yield* G.sleep(1e3), n = yield* G.tryPromise((t) => this.#e.getPublishOperation(e.flowId, n.operationId, t));
4006
4053
  return n;
4007
4054
  }), { signal: this.#a.signal });
4008
4055
  if (this.#s) return;
@@ -4014,7 +4061,7 @@ var Xr = class {
4014
4061
  message: this.#t.t("notice.published", { name: e.name })
4015
4062
  }), this.include(await this.#e.getFlow(e.flowId));
4016
4063
  } catch (e) {
4017
- this.#s || this.#r(L(e, this.#t.t));
4064
+ this.#s || this.#r(F(e, this.#t.t));
4018
4065
  } finally {
4019
4066
  this.#o.delete(e.flowId);
4020
4067
  }
@@ -4123,11 +4170,11 @@ var Xr = class {
4123
4170
  phase: "saving"
4124
4171
  }, this.#c();
4125
4172
  try {
4126
- let t = await Zt(i);
4173
+ let t = await en(i);
4127
4174
  if (this.#n || !e()) return !1;
4128
4175
  let a = this.#r.value.draft?.content.modules[n];
4129
4176
  if (a == null || a.source != r.base.source || JSON.stringify(a.imports) != JSON.stringify(r.base.imports)) throw Error(this.#o.t("notice.moduleUpdated"));
4130
- let o = i == a.source && JSON.stringify(t) == JSON.stringify(a.imports) ? this.#r.value.draft : await this.changeDraft(Qt(n, r.base.source, r.base.imports, i, t));
4177
+ let o = i == a.source && JSON.stringify(t) == JSON.stringify(a.imports) ? this.#r.value.draft : await this.changeDraft(tn(n, r.base.source, r.base.imports, i, t));
4131
4178
  if (this.#n || !e()) return !1;
4132
4179
  let s = this.#e.get(n);
4133
4180
  if (s == null) continue;
@@ -4151,7 +4198,7 @@ var Xr = class {
4151
4198
  r != null && (r.editor = {
4152
4199
  ...r.editor,
4153
4200
  phase: "failed"
4154
- }), this.#a(L(t, this.#o.t));
4201
+ }), this.#a(F(t, this.#o.t));
4155
4202
  }
4156
4203
  this.#c();
4157
4204
  }
@@ -4215,7 +4262,7 @@ var Xr = class {
4215
4262
  this.#c(a, r), o = !0;
4216
4263
  } catch (r) {
4217
4264
  if (this.#o || !n()) return;
4218
- if (r instanceof H && r.code == "flow.presentation-conflict") try {
4265
+ if (r instanceof I && r.code == "flow.presentation-conflict") try {
4219
4266
  let t = await this.#e.getPresentation(e);
4220
4267
  if (this.#o || !n()) return;
4221
4268
  this.#c(a, t), this.#n({
@@ -4223,9 +4270,9 @@ var Xr = class {
4223
4270
  message: this.#t.t("notice.layoutConflict")
4224
4271
  });
4225
4272
  } catch (e) {
4226
- !this.#o && n() && this.#c(a, t), !this.#o && n() && this.#n(L(e, this.#t.t));
4273
+ !this.#o && n() && this.#c(a, t), !this.#o && n() && this.#n(F(e, this.#t.t));
4227
4274
  }
4228
- else this.#c(a, t), this.#n(L(r, this.#t.t));
4275
+ else this.#c(a, t), this.#n(F(r, this.#t.t));
4229
4276
  }
4230
4277
  }), await this.#i, o;
4231
4278
  }
@@ -4272,23 +4319,23 @@ var oi = class {
4272
4319
  ...n,
4273
4320
  status: ii(e.draft, e.moduleEditor)
4274
4321
  };
4275
- }), 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 : F(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);
4322
+ }), 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 : P(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);
4276
4323
  this.#e = e(this.#t, (e) => ({
4277
- revision: e.draft == null ? void 0 : F(e.draft),
4324
+ revision: e.draft == null ? void 0 : P(e.draft),
4278
4325
  target: e.target
4279
4326
  }), { equal: (e, t) => e.revision === t.revision && e.target === t.target });
4280
4327
  let x = e(this.#t, (e) => {
4281
- if (e.draft != null && e.target != null && e.selectedNodeIds.length == 1) return F(e.draft).selection(e.target, e.selectedNodeIds[0]);
4328
+ if (e.draft != null && e.target != null && e.selectedNodeIds.length == 1) return P(e.draft).selection(e.target, e.selectedNodeIds[0]);
4282
4329
  });
4283
4330
  this.$ = {
4284
4331
  addNodeOptions: t((e) => {
4285
4332
  let { revision: t, target: r } = e(this.#e);
4286
- return ae(t?.revision, r, e(n.t$));
4333
+ return oe(t?.revision, r, e(n.t$));
4287
4334
  }),
4288
4335
  busy: i,
4289
4336
  checkLoading: a,
4290
4337
  diagnosticFocus: o,
4291
- diagnosticItems: e(this.#t, (e) => de(e.draft == null ? void 0 : F(e.draft), e.target, e.diagnostics)),
4338
+ diagnosticItems: e(this.#t, (e) => ue(e.draft == null ? void 0 : P(e.draft), e.target, e.diagnostics)),
4292
4339
  diagnostics: s,
4293
4340
  draft: c,
4294
4341
  flow: t((e) => {
@@ -4304,7 +4351,7 @@ var oi = class {
4304
4351
  flowRefreshing: r.$.refreshing,
4305
4352
  flowTotal: r.$.total,
4306
4353
  flows: r.$.flows,
4307
- inspectorDiagnostics: e(this.#t, (e) => ue(e.draft == null ? void 0 : F(e.draft), e.target, e.diagnostics, x.value)),
4354
+ inspectorDiagnostics: e(this.#t, (e) => se(e.draft == null ? void 0 : P(e.draft), e.target, e.diagnostics, x.value)),
4308
4355
  live: p,
4309
4356
  moduleEditor: l,
4310
4357
  nodeFocus: u,
@@ -4316,7 +4363,7 @@ var oi = class {
4316
4363
  target: g,
4317
4364
  targetFlow: t((e) => e(g)?.kind == "flow" ? e(r.$.flows).find((t) => t.flowId == e(f)) : void 0),
4318
4365
  targetName: e(this.#t, (e) => {
4319
- if (e.target != null) return e.target.kind == "flow" ? r.flow(e.flowId ?? "")?.name : e.draft == null ? e.target.id : F(e.draft).subflow(e.target.id)?.name ?? e.target.id;
4366
+ if (e.target != null) return e.target.kind == "flow" ? r.flow(e.flowId ?? "")?.name : e.draft == null ? e.target.id : P(e.draft).subflow(e.target.id)?.name ?? e.target.id;
4320
4367
  }),
4321
4368
  workspaceLoadFailed: _,
4322
4369
  workspaceLoadProblem: v,
@@ -4378,8 +4425,8 @@ var ui = class {
4378
4425
  #x;
4379
4426
  #S;
4380
4427
  #C;
4381
- constructor(e, t, n = $t, r = h(), i = () => {}, a = new Tr(e), o = () => {}, s = () => {}) {
4382
- this.catalogs = a, this.flowCreated = o, this.accessChanged = s, this.#n = new I(), this.#d = new Jr(), this.history$ = this.#d.state$, this.#m = 0, this.#h = 0, this.#g = !1, 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 $r(e, t, r), this.#l = new oi(r, this.#o), this.#u = new ei(this.#l, this.#n, (e) => this.#O(e, !1), t, r), this.#t = new Xr(e, t, r, {
4428
+ constructor(e, t, n = nn, r = h(), i = () => {}, a = new Er(e), o = () => {}, s = () => {}) {
4429
+ this.catalogs = a, this.flowCreated = o, this.accessChanged = s, this.#n = new E(), this.#d = new Jr(), this.history$ = this.#d.state$, this.#m = 0, this.#h = 0, this.#g = !1, 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 $r(e, t, r), this.#l = new oi(r, this.#o), this.#u = new ei(this.#l, this.#n, (e) => this.#O(e, !1), t, r), this.#t = new Xr(e, t, r, {
4383
4430
  apply: (e) => this.#A(e, "local"),
4384
4431
  beforeChange: (e) => {
4385
4432
  e && this.#V({ busy: "designer" });
@@ -4461,12 +4508,12 @@ var ui = class {
4461
4508
  } catch (e) {
4462
4509
  if (!t()) return !1;
4463
4510
  this.#C?.(), this.#C = void 0;
4464
- let n = e instanceof H && e.code == ve.flowUpgradeRequired ? "upgrade" : e instanceof H && (e.code == ve.flowRepairRequired || e.code == ve.flowInvalid) ? "repair" : "failed";
4511
+ let n = e instanceof I && e.code == Ae.flowUpgradeRequired ? "upgrade" : e instanceof I && (e.code == Ae.flowRepairRequired || e.code == Ae.flowInvalid) ? "repair" : "failed";
4465
4512
  return this.#V({
4466
4513
  workspaceLoadFailed: !0,
4467
4514
  workspaceLoadProblem: {
4468
4515
  kind: n,
4469
- ...n == "failed" ? { message: L(e, this.#r.t).message } : {}
4516
+ ...n == "failed" ? { message: F(e, this.#r.t).message } : {}
4470
4517
  },
4471
4518
  workspaceLoading: !1
4472
4519
  }), !1;
@@ -4488,14 +4535,14 @@ var ui = class {
4488
4535
  await this.#e.repairDraft(e, n.expectedRevisionId, n.changeId), this.#x = void 0, await this.selectFlow(e);
4489
4536
  } catch (t) {
4490
4537
  if (this.#_) return;
4491
- if (t instanceof H && t.code == ve.flowRevisionConflict) {
4538
+ if (t instanceof I && t.code == Ae.flowRevisionConflict) {
4492
4539
  this.#x = void 0, await this.selectFlow(e);
4493
4540
  return;
4494
4541
  }
4495
4542
  this.#V({
4496
4543
  workspaceLoadProblem: {
4497
4544
  kind: this.#l.value.workspaceLoadProblem?.kind == "upgrade" ? "upgrade" : "repair",
4498
- message: L(t, this.#r.t).message
4545
+ message: F(t, this.#r.t).message
4499
4546
  },
4500
4547
  workspaceRepairing: !1
4501
4548
  });
@@ -4506,7 +4553,7 @@ var ui = class {
4506
4553
  let n = await this.#e.getLive(e);
4507
4554
  t() && this.#l.value.flowId == e && this.#V({ live: n });
4508
4555
  } catch (n) {
4509
- t() && this.#l.value.flowId == e && this.#c(L(n, this.#r.t));
4556
+ t() && this.#l.value.flowId == e && this.#c(F(n, this.#r.t));
4510
4557
  }
4511
4558
  }
4512
4559
  selectTarget(e) {
@@ -4522,7 +4569,7 @@ var ui = class {
4522
4569
  selectNodes(e) {
4523
4570
  return e.length == this.#l.value.selectedNodeIds.length && e.every((e, t) => e == this.#l.value.selectedNodeIds[t]) ? !0 : (this.#u.flush(), this.#V({
4524
4571
  diagnosticFocus: void 0,
4525
- moduleEditor: ai(this.#l.value.draft == null ? void 0 : F(this.#l.value.draft), this.#l.value.target, e),
4572
+ moduleEditor: ai(this.#l.value.draft == null ? void 0 : P(this.#l.value.draft), this.#l.value.target, e),
4526
4573
  nodeFocus: void 0,
4527
4574
  selectedNodeIds: e
4528
4575
  }), !0);
@@ -4535,7 +4582,7 @@ var ui = class {
4535
4582
  let n = await this.#e.getFlow(await t(e));
4536
4583
  return this.#o.insert(n), n;
4537
4584
  } catch (e) {
4538
- this.#_ || this.#c(L(e, this.#r.t));
4585
+ this.#_ || this.#c(F(e, this.#r.t));
4539
4586
  } finally {
4540
4587
  this.#V({ busy: void 0 });
4541
4588
  }
@@ -4552,7 +4599,7 @@ var ui = class {
4552
4599
  message: this.#r.t("notice.flowDeleteAccepted", { name: t.name })
4553
4600
  }), !0);
4554
4601
  } catch (e) {
4555
- return this.#_ || this.#c(L(e, this.#r.t)), !1;
4602
+ return this.#_ || this.#c(F(e, this.#r.t)), !1;
4556
4603
  } finally {
4557
4604
  this.#V({ busy: void 0 });
4558
4605
  }
@@ -4561,7 +4608,7 @@ var ui = class {
4561
4608
  if (!await this.saveModuleEditor() || this.#l.value.draft == null) return !1;
4562
4609
  let t = this.#i();
4563
4610
  this.#V({ busy: "resource" });
4564
- let n = await this.#O(Ee(t, e), !1);
4611
+ let n = await this.#O(De(t, e), !1);
4565
4612
  return this.#V({ busy: void 0 }), n != null && (this.selectTarget({
4566
4613
  id: t,
4567
4614
  kind: "subflow"
@@ -4579,7 +4626,7 @@ var ui = class {
4579
4626
  try {
4580
4627
  i = await this.#e.renameFlow(e, r), i != null && this.#o.include(i);
4581
4628
  } catch (e) {
4582
- this.#_ || this.#c(L(e, this.#r.t));
4629
+ this.#_ || this.#c(F(e, this.#r.t));
4583
4630
  }
4584
4631
  return this.#V({ busy: void 0 }), i != null && (this.#c({
4585
4632
  kind: "success",
@@ -4592,28 +4639,28 @@ var ui = class {
4592
4639
  if (r == null || i == null) return;
4593
4640
  let a = this.#i();
4594
4641
  if (e.kind == "comment") return await this.#T(i, a, t);
4595
- let o = F(r), s = qe(e, o, i, this.#r.t);
4642
+ let o = P(r), s = Xe(e, o, i, this.#r.t);
4596
4643
  if (s == null) return;
4597
4644
  if (s.kind == "provider-trigger" && s.connectionId == null && s.definition.key != "feishu_app_bot.on_event") {
4598
4645
  try {
4599
- let e = await k(this.catalogs.connections.get(s.definition.provider, r.flowId));
4646
+ let e = await O(this.catalogs.connections.get(s.definition.provider, r.flowId));
4600
4647
  s = {
4601
4648
  ...s,
4602
- connectionId: kr(e).preferred?.connectionId
4649
+ connectionId: $(e).preferred?.connectionId
4603
4650
  };
4604
4651
  } catch (e) {
4605
- !this.#_ && this.#l.value.draft == r && this.#c(L(e, this.#r.t));
4652
+ !this.#_ && this.#l.value.draft == r && this.#c(F(e, this.#r.t));
4606
4653
  }
4607
4654
  if (this.#_ || this.#l.value.draft != r || this.#l.value.target != i) return;
4608
4655
  }
4609
- let c = n?.(a), l = Be(o, i, a, s, this.#i);
4656
+ let c = n?.(a), l = Ue(o, i, a, s, this.#i);
4610
4657
  if (l == null) return;
4611
- let u = c == null ? l : [...l, ...Jt(B(r, l).content, i, {
4658
+ let u = c == null ? l : [...l, ...Zt(z(r, l).content, i, {
4612
4659
  source: c.source,
4613
4660
  target: c.target,
4614
4661
  ...c.sourceHandle.startsWith("$branch:") ? { sourceHandle: c.sourceHandle.slice(8) } : {}
4615
4662
  })];
4616
- if (await this.#N("add", 1, u, (e) => cn(e, i, { [a]: t }), [a]) && !this.#_) return this.#V({ nodeFocus: {
4663
+ if (await this.#N("add", 1, u, (e) => un(e, i, { [a]: t }), [a]) && !this.#_) return this.#V({ nodeFocus: {
4617
4664
  nodeId: a,
4618
4665
  requestId: ++this.#b
4619
4666
  } }), a;
@@ -4621,7 +4668,7 @@ var ui = class {
4621
4668
  async connect(e) {
4622
4669
  let t = this.$.revision.value, n = this.#l.value.target;
4623
4670
  if (t == null || n == null) return;
4624
- let r = Jt(t.revision.content, n, {
4671
+ let r = Zt(t.revision.content, n, {
4625
4672
  source: e.source,
4626
4673
  target: e.target,
4627
4674
  ...e.sourceHandle.startsWith("$branch:") ? { sourceHandle: e.sourceHandle.slice(8) } : {}
@@ -4631,7 +4678,7 @@ var ui = class {
4631
4678
  async disconnect(e) {
4632
4679
  let t = this.$.revision.value, n = this.#l.value.target;
4633
4680
  if (t == null || n == null) return;
4634
- let r = Yt(t.revision.content, n, {
4681
+ let r = Qt(t.revision.content, n, {
4635
4682
  source: e.source,
4636
4683
  target: e.target,
4637
4684
  ...e.sourceHandle.startsWith("$branch:") ? { sourceHandle: e.sourceHandle.slice(8) } : {}
@@ -4642,10 +4689,10 @@ var ui = class {
4642
4689
  if (!await this.saveModuleEditor()) return;
4643
4690
  let e = this.$.revision.value, t = this.#l.value.target;
4644
4691
  if (e == null || t == null || this.#l.value.selectedNodeIds.length == 0) return;
4645
- let n = [...this.#l.value.selectedNodeIds], r = fn(this.#l.value.presentation?.value ?? {}, t), i = new Set(this.#l.value.selectedNodeIds.filter((e) => r.has(e))), a = pe(e, t, this.#l.value.selectedNodeIds);
4692
+ let n = [...this.#l.value.selectedNodeIds], r = mn(this.#l.value.presentation?.value ?? {}, t), i = new Set(this.#l.value.selectedNodeIds.filter((e) => r.has(e))), a = _e(e, t, this.#l.value.selectedNodeIds);
4646
4693
  await this.#N("delete", this.#l.value.selectedNodeIds.length, a, (e) => {
4647
- let r = i.size == 0 ? e : dn(e, t, i);
4648
- for (let e of n) r = ln(r, t, e, !1);
4694
+ let r = i.size == 0 ? e : pn(e, t, i);
4695
+ for (let e of n) r = dn(r, t, e, !1);
4649
4696
  return r;
4650
4697
  }, []);
4651
4698
  }
@@ -4686,9 +4733,9 @@ var ui = class {
4686
4733
  }];
4687
4734
  }));
4688
4735
  await this.#N("paste", c.size, a.changes, (e) => {
4689
- let n = cn(e, r, f);
4690
- for (let [e, t] of a.sourceIds.entries()) i.has(t) && (n = ln(n, r, a.nodeIds[e], !0));
4691
- for (let e of o) i.has(e.sourceId) && (n = ln(n, r, e.nodeId, !0)), n = un(n, r, e.nodeId, {
4736
+ let n = un(e, r, f);
4737
+ for (let [e, t] of a.sourceIds.entries()) i.has(t) && (n = dn(n, r, a.nodeIds[e], !0));
4738
+ for (let e of o) i.has(e.sourceId) && (n = dn(n, r, e.nodeId, !0)), n = fn(n, r, e.nodeId, {
4692
4739
  content: e.content,
4693
4740
  position: {
4694
4741
  x: e.position.x + t.x * d,
@@ -4705,36 +4752,36 @@ var ui = class {
4705
4752
  async saveNodeSettings(e, t) {
4706
4753
  let n = this.$.revision.value, r = this.#l.value.target;
4707
4754
  if (n == null || r == null) return !1;
4708
- let i = Ie(n, r, e, t);
4755
+ let i = Re(n, r, e, t);
4709
4756
  return i != null && await this.#E(i) != null;
4710
4757
  }
4711
4758
  async saveNodeDescription(e, t) {
4712
4759
  let n = this.$.revision.value, r = this.#l.value.target;
4713
4760
  if (n == null || r == null) return !1;
4714
- let i = Ue(n, r, e, t);
4761
+ let i = Ke(n, r, e, t);
4715
4762
  return i != null && await this.#E(i) != null;
4716
4763
  }
4717
4764
  async saveNodeIcon(e, t) {
4718
4765
  let n = this.$.revision.value, r = this.#l.value.target;
4719
4766
  if (n == null || r == null) return !1;
4720
- let i = be(n, r, e, t);
4767
+ let i = xe(n, r, e, t);
4721
4768
  return i != null && await this.#E(i) != null;
4722
4769
  }
4723
4770
  async saveNodeTitle(e, t) {
4724
4771
  let n = this.$.revision.value, r = this.#l.value.target;
4725
4772
  if (n == null || r == null) return !1;
4726
- let i = Ce(n, r, e, t);
4773
+ let i = we(n, r, e, t);
4727
4774
  return i != null && await this.#E(i) != null;
4728
4775
  }
4729
4776
  async setInputValue(e, t, n, r) {
4730
4777
  let i = this.$.revision.value, a = this.#l.value.target;
4731
4778
  if (i == null || a == null) return !1;
4732
- let o = Re(i, a, e, t, n);
4779
+ let o = Ve(i, a, e, t, n);
4733
4780
  return o != null && await this.#E(o, r) != null;
4734
4781
  }
4735
4782
  async resetInputs(e, t) {
4736
4783
  let n = this.$.revision.value, r = this.#l.value.target;
4737
- return n == null || r == null ? !1 : await this.#E(Oe(n.revision.content, r, e, t)) != null;
4784
+ return n == null || r == null ? !1 : await this.#E(pe(n.revision.content, r, e, t)) != null;
4738
4785
  }
4739
4786
  async resetTriggerConfig(e, t) {
4740
4787
  let n = this.$.revision.value, r = this.#l.value.target;
@@ -4752,7 +4799,7 @@ var ui = class {
4752
4799
  }
4753
4800
  async setInputSource(e, t, n) {
4754
4801
  let r = this.$.revision.value, i = this.#l.value.target;
4755
- return r == null || i == null ? !1 : await this.#E(ze(r.revision.content, i, e, t, [{
4802
+ return r == null || i == null ? !1 : await this.#E(me(r.revision.content, i, e, t, [{
4756
4803
  kind: "node",
4757
4804
  ...n
4758
4805
  }])) != null;
@@ -4760,19 +4807,19 @@ var ui = class {
4760
4807
  async setInputVariable(e, t, n) {
4761
4808
  let r = this.$.revision.value, i = this.#l.value.target;
4762
4809
  if (r == null || i == null) return !1;
4763
- let a = n == null ? Re(r, i, e, t, void 0) : _e(r, i, e, t, n, this.#i());
4810
+ let a = n == null ? Ve(r, i, e, t, void 0) : be(r, i, e, t, n, this.#i());
4764
4811
  return a != null && await this.#E(a) != null;
4765
4812
  }
4766
4813
  async saveCondition(e, t, n) {
4767
4814
  let r = this.$.revision.value, i = this.#l.value.target;
4768
4815
  if (r == null || i == null) return !1;
4769
- let a = je(r, i, e, t);
4816
+ let a = ke(r, i, e, t);
4770
4817
  return a != null && await this.#E(a, n) != null;
4771
4818
  }
4772
4819
  async saveValue(e, t, n) {
4773
4820
  let r = this.$.revision.value, i = this.#l.value.target;
4774
4821
  if (r == null || i == null) return !1;
4775
- let a = Je(r, i, e, t);
4822
+ let a = Ze(r, i, e, t);
4776
4823
  return a != null && await this.#E(a, n) != null;
4777
4824
  }
4778
4825
  async saveResolution(e, t, n, r) {
@@ -4783,13 +4830,13 @@ var ui = class {
4783
4830
  }
4784
4831
  async saveNodeContentHidden(e, t) {
4785
4832
  let n = this.#l.value.target, r = this.#R().nodes.find((t) => t.id == e);
4786
- n != null && r != null && r.kind != "condition" && await this.#N("edit", 1, [], (r) => ln(r, n, e, t));
4833
+ n != null && r != null && r.kind != "condition" && await this.#N("edit", 1, [], (r) => dn(r, n, e, t));
4787
4834
  }
4788
4835
  async saveComment(e, t) {
4789
4836
  let n = this.#l.value.target;
4790
4837
  if (n == null) return;
4791
4838
  let r = this.#R().nodes.find((t) => t.id == e)?.position;
4792
- r != null && await this.#N("edit", 1, [], (i) => un(i, n, e, {
4839
+ r != null && await this.#N("edit", 1, [], (i) => fn(i, n, e, {
4793
4840
  ...t,
4794
4841
  position: r
4795
4842
  }));
@@ -4797,31 +4844,25 @@ var ui = class {
4797
4844
  async saveTaskSettings(e, t) {
4798
4845
  let n = this.$.revision.value, r = this.#l.value.target;
4799
4846
  if (n == null || r == null) return !1;
4800
- let i = we(n, r, e, t);
4847
+ let i = Te(n, r, e, t);
4801
4848
  return i != null && await this.#E(i) != null;
4802
4849
  }
4803
- async saveCodeActions(e, t) {
4804
- let n = this.$.revision.value, r = this.#l.value.target;
4805
- if (n == null || r == null) return !1;
4806
- let i = he(n.revision.content, r, e, t);
4807
- return i == null || await this.#E(i) != null;
4808
- }
4809
4850
  async saveTaskPorts(e, t, n, r) {
4810
4851
  let i = this.$.revision.value, a = this.#l.value.target;
4811
4852
  if (i == null || a == null) return !1;
4812
- let o = Ge(i, a, e, t, r);
4853
+ let o = Je(i, a, e, t, r);
4813
4854
  return o != null && await this.#E(o, n) != null;
4814
4855
  }
4815
4856
  async saveTaskAdditionalInputs(e, t, n, r) {
4816
4857
  let i = this.$.revision.value, a = this.#l.value.target;
4817
4858
  if (i == null || a == null) return !1;
4818
- let o = fe(i, a, e, t, r);
4859
+ let o = ge(i, a, e, t, r);
4819
4860
  return o != null && await this.#E(o, n) != null;
4820
4861
  }
4821
4862
  async setConnectorConnection(e, t) {
4822
4863
  let n = this.$.revision.value;
4823
4864
  if (n == null) return !1;
4824
- let r = Fe(n.revision.content, e, t);
4865
+ let r = fe(n.revision.content, e, t);
4825
4866
  return r != null && await this.#E(r) != null;
4826
4867
  }
4827
4868
  get eventSourceClient() {
@@ -4837,15 +4878,15 @@ var ui = class {
4837
4878
  if (n == null || r?.kind != "flow") return !1;
4838
4879
  let i = n.graph(r)?.nodes[e];
4839
4880
  if (i?.kind != "integration" || i.definition.key != "feishu_app_bot.on_event" || t.provider != i.definition.provider) return !1;
4840
- let a = ye(n.revision.content, r, e, t.connectionId);
4881
+ let a = ie(n.revision.content, r, e, t.connectionId);
4841
4882
  if (a == null) return !1;
4842
- let o = Ve(i.config.sourceId, void 0) != t.sourceId;
4883
+ let o = ze(i.config.sourceId, void 0) != t.sourceId;
4843
4884
  return await this.#E([
4844
4885
  ...a,
4845
- ...R(n.revision.content, r, e, "sourceId", t.sourceId) ?? [],
4846
- ...o ? R(n.revision.content, r, e, "eventTypes", []) ?? [] : [],
4847
- ...o ? R(n.revision.content, r, e, "resource", void 0) ?? [] : [],
4848
- ...o ? R(n.revision.content, r, e, "chatIds", void 0) ?? [] : []
4886
+ ...C(n.revision.content, r, e, "sourceId", t.sourceId) ?? [],
4887
+ ...o ? C(n.revision.content, r, e, "eventTypes", []) ?? [] : [],
4888
+ ...o ? C(n.revision.content, r, e, "resource", void 0) ?? [] : [],
4889
+ ...o ? C(n.revision.content, r, e, "chatIds", void 0) ?? [] : []
4849
4890
  ]) != null;
4850
4891
  }
4851
4892
  async loadTriggerConfigOptions(e, t, n) {
@@ -4856,41 +4897,41 @@ var ui = class {
4856
4897
  async saveTriggerConfig(e, t, n) {
4857
4898
  let r = this.$.revision.value, i = this.#l.value.target;
4858
4899
  if (r == null || i?.kind != "flow") return !1;
4859
- let a = R(r.revision.content, i, e, t, n);
4900
+ let a = C(r.revision.content, i, e, t, n);
4860
4901
  if (a == null) return !1;
4861
4902
  let o = r.graph(i)?.nodes[e];
4862
4903
  if (a.length > 0 && o?.kind == "integration" && o.definition.key == "feishu_app_bot.on_event" && t == "eventTypes") {
4863
4904
  let t = Array.isArray(n) ? n.filter((e) => typeof e == "string") : [];
4864
- N(t) || (a = [...a, ...R(r.revision.content, i, e, "chatIds", void 0) ?? []]);
4865
- let s = Ve(o.config.resource, void 0);
4866
- te(s) && s.kind != Ke(t) && (a = [...a, ...R(r.revision.content, i, e, "resource", void 0) ?? []]);
4905
+ N(t) || (a = [...a, ...C(r.revision.content, i, e, "chatIds", void 0) ?? []]);
4906
+ let s = ze(o.config.resource, void 0);
4907
+ je(s) && s.kind != Ye(t) && (a = [...a, ...C(r.revision.content, i, e, "resource", void 0) ?? []]);
4867
4908
  }
4868
- return a.length > 0 && o?.kind == "poll" && o.definition.key == "linear.on_issue_changed" && t == "teamId" ? await this.#E([...a, ...R(r.revision.content, i, e, "stateIds", void 0) ?? []]) != null : await this.#E(a) != null;
4909
+ return a.length > 0 && o?.kind == "poll" && o.definition.key == "linear.on_issue_changed" && t == "teamId" ? await this.#E([...a, ...C(r.revision.content, i, e, "stateIds", void 0) ?? []]) != null : await this.#E(a) != null;
4869
4910
  }
4870
4911
  async saveTriggerSchedule(e, t) {
4871
4912
  let n = this.$.revision.value, r = this.#l.value.target;
4872
4913
  if (n == null || r?.kind != "flow") return !1;
4873
- let i = We(n.revision.content, r, e, t);
4914
+ let i = Ce(n.revision.content, r, e, t);
4874
4915
  return i != null && await this.#E(i) != null;
4875
4916
  }
4876
4917
  async saveWebhook(e, t, n) {
4877
4918
  let r = this.$.revision.value, i = this.#l.value.target;
4878
4919
  if (r == null || i?.kind != "flow") return !1;
4879
- let a = ge(r, i, e, t);
4920
+ let a = ye(r, i, e, t);
4880
4921
  return a != null && await this.#E(a, n) != null;
4881
4922
  }
4882
4923
  async setTriggerConnection(e, t) {
4883
4924
  let n = this.$.revision.value, r = this.#l.value.target;
4884
4925
  if (n == null || r?.kind != "flow") return !1;
4885
- let i = ye(n.revision.content, r, e, t);
4926
+ let i = ie(n.revision.content, r, e, t);
4886
4927
  if (i == null) return !1;
4887
4928
  let a = n.graph(r)?.nodes[e];
4888
- return i.length > 0 && a?.kind == "poll" && a.definition.key == "linear.on_issue_changed" ? await this.#E([...i, ...["teamId", "stateIds"].flatMap((t) => R(n.revision.content, r, e, t, void 0) ?? [])]) != null : await this.#E(i) != null;
4929
+ return i.length > 0 && a?.kind == "poll" && a.definition.key == "linear.on_issue_changed" ? await this.#E([...i, ...["teamId", "stateIds"].flatMap((t) => C(n.revision.content, r, e, t, void 0) ?? [])]) != null : await this.#E(i) != null;
4889
4930
  }
4890
4931
  async saveSubflowSettings(e, t) {
4891
4932
  let n = this.$.revision.value;
4892
4933
  if (n == null) return !1;
4893
- let r = Te(n, e, t);
4934
+ let r = Ee(n, e, t);
4894
4935
  return r != null && await this.#E(r) != null;
4895
4936
  }
4896
4937
  updateModuleSource(e) {
@@ -4912,11 +4953,11 @@ var ui = class {
4912
4953
  }
4913
4954
  async moveNodes(e) {
4914
4955
  let t = this.#l.value.target;
4915
- t != null && await this.#N("move", Object.keys(e).length, [], (n) => cn(n, t, e));
4956
+ t != null && await this.#N("move", Object.keys(e).length, [], (n) => un(n, t, e));
4916
4957
  }
4917
4958
  async moveViewport(e) {
4918
4959
  let t = this.#l.value.target;
4919
- t != null && await this.#j((n) => pn(n, t, e), !0);
4960
+ t != null && await this.#j((n) => hn(n, t, e), !0);
4920
4961
  }
4921
4962
  async check() {
4922
4963
  await this.#F();
@@ -4929,7 +4970,7 @@ var ui = class {
4929
4970
  }
4930
4971
  locateNode(e, { preserveSelection: t = !1 } = {}) {
4931
4972
  let n = this.$.revision.value, r = this.#l.value.target;
4932
- return n == null || r == null || n.node(r, e) == null && !fn(this.#l.value.presentation?.value ?? {}, r).has(e) || !t && !this.selectNodes([e]) ? !1 : (this.#V({ nodeFocus: {
4973
+ return n == null || r == null || n.node(r, e) == null && !mn(this.#l.value.presentation?.value ?? {}, r).has(e) || !t && !this.selectNodes([e]) ? !1 : (this.#V({ nodeFocus: {
4933
4974
  nodeId: e,
4934
4975
  requestId: ++this.#b
4935
4976
  } }), !0);
@@ -4947,7 +4988,7 @@ var ui = class {
4947
4988
  let t = /#(\d+)$/.exec(e.title);
4948
4989
  return t == null ? [] : [Number(t[1])];
4949
4990
  }));
4950
- if (!(!await this.#N("add", 1, [], (i) => un(i, e, t, {
4991
+ if (!(!await this.#N("add", 1, [], (i) => fn(i, e, t, {
4951
4992
  content: "",
4952
4993
  position: n,
4953
4994
  title: this.#r.t("addNode.commentName", { number: r + 1 })
@@ -4972,7 +5013,7 @@ var ui = class {
4972
5013
  if (this.#_ || (this.#d.applying || this.#d.failed) && !n) return;
4973
5014
  let r = this.#l.value.flowId, i = this.#l.value.draft;
4974
5015
  if (r == null || i == null) return;
4975
- if (e.length == 0 || u(B(i, e).content, i.content)) return i;
5016
+ if (e.length == 0 || u(z(i, e).content, i.content)) return i;
4976
5017
  let a = !n && this.#d.clear(), o = this.#n.capture();
4977
5018
  this.#d.pending++, this.#d.publish();
4978
5019
  try {
@@ -4994,7 +5035,7 @@ var ui = class {
4994
5035
  for (let t = 0; t < 2 && e(); t += 1) {
4995
5036
  let t = this.#l.value.draft;
4996
5037
  if (t == null) return;
4997
- let n = Le(t.content);
5038
+ let n = ne(t.content);
4998
5039
  if (n.length == 0) {
4999
5040
  this.#F();
5000
5041
  return;
@@ -5041,8 +5082,8 @@ var ui = class {
5041
5082
  if (this.#_ || this.#d.applying || this.#d.failed) return !1;
5042
5083
  let { draft: o, target: s, presentation: c, selectedNodeIds: l } = this.#l.value;
5043
5084
  if (o == null || s == null || c == null) return !1;
5044
- let d = r?.(c.value) ?? c.value, f = mn(c.value, d, s);
5045
- if (u(B(o, n).content, o.content) && f.nodeIds.length == 0) return !0;
5085
+ let d = r?.(c.value) ?? c.value, f = gn(c.value, d, s);
5086
+ if (u(z(o, n).content, o.content) && f.nodeIds.length == 0) return !0;
5046
5087
  let p = this.#d.generation, m = Gr(o.content, n);
5047
5088
  this.#d.pending++;
5048
5089
  let h = {
@@ -5064,7 +5105,7 @@ var ui = class {
5064
5105
  let [s, c] = await Promise.all([e, t]), l = s != null && c && (!g || p == this.#d.generation);
5065
5106
  return l && g && a != null && this.history$.value.undo === h && this.#D(a, h), l;
5066
5107
  } catch (e) {
5067
- return this.#c(L(e, this.#r.t)), this.retryHistorySync(), !1;
5108
+ return this.#c(F(e, this.#r.t)), this.retryHistorySync(), !1;
5068
5109
  } finally {
5069
5110
  this.#d.pending--, this.#_ || this.#d.publish();
5070
5111
  }
@@ -5083,10 +5124,10 @@ var ui = class {
5083
5124
  let r = this.#d.generation;
5084
5125
  this.#d.applying = !0, this.#d.publish();
5085
5126
  try {
5086
- let [t, i] = await Promise.all([this.#O(e ? n.forward : n.inverse, !0, !0), this.#j((t) => hn(t, n.target, n.presentation, e), !0)]);
5127
+ let [t, i] = await Promise.all([this.#O(e ? n.forward : n.inverse, !0, !0), this.#j((t) => _n(t, n.target, n.presentation, e), !0)]);
5087
5128
  t != null && i && r == this.#d.generation && (this.selectNodes(e ? n.afterSelection : n.beforeSelection), this.#d.complete(e));
5088
5129
  } catch (e) {
5089
- this.#c(L(e, this.#r.t)), this.retryHistorySync();
5130
+ this.#c(F(e, this.#r.t)), this.retryHistorySync();
5090
5131
  } finally {
5091
5132
  this.#d.applying = !1, this.#_ || this.#d.publish();
5092
5133
  }
@@ -5143,7 +5184,7 @@ var ui = class {
5143
5184
  });
5144
5185
  }
5145
5186
  } catch (n) {
5146
- !this.#_ && e == this.#l.value.flowId && t.revisionId == this.#l.value.draft?.revisionId && this.#c(L(n, this.#r.t));
5187
+ !this.#_ && e == this.#l.value.flowId && t.revisionId == this.#l.value.draft?.revisionId && this.#c(F(n, this.#r.t));
5147
5188
  } finally {
5148
5189
  !this.#_ && e == this.#l.value.flowId && t.revisionId == this.#l.value.draft?.revisionId && this.#V({ checkLoading: !1 });
5149
5190
  }
@@ -5184,15 +5225,15 @@ var ui = class {
5184
5225
  message: this.#r.t(o ? "notice.moduleUpdated" : "notice.draftUpdated")
5185
5226
  }), this.#F(), !0;
5186
5227
  } catch (n) {
5187
- return t && this.#B(e) && this.#c(L(n, this.#r.t)), !1;
5228
+ return t && this.#B(e) && this.#c(F(n, this.#r.t)), !1;
5188
5229
  }
5189
5230
  }
5190
5231
  #R() {
5191
5232
  let e = this.#l.value;
5192
- return tr(e.draft, e.target, e.presentation?.value, e.diagnostics?.diagnostics, {}, {}, this.#r.t);
5233
+ return rr(e.draft, e.target, e.presentation?.value, e.diagnostics?.diagnostics, {}, {}, this.#r.t);
5193
5234
  }
5194
5235
  #z(e) {
5195
- let t = F(e), n = li(t, this.#l.value.target);
5236
+ let t = P(e), n = li(t, this.#l.value.target);
5196
5237
  return {
5197
5238
  revision: t,
5198
5239
  selectedNodeIds: this.#l.value.selectedNodeIds.filter((e) => n != null && t.selection(n, e) != null),
@@ -5217,7 +5258,7 @@ function di(e) {
5217
5258
  return new Map(e.nodes.map((e) => [e.id, e]));
5218
5259
  }
5219
5260
  function fi(e, t) {
5220
- return e == null || t == null ? [] : F(e).designerInputs(t);
5261
+ return e == null || t == null ? [] : P(e).designerInputs(t);
5221
5262
  }
5222
5263
  function pi(e, t, n, r, i) {
5223
5264
  if (e == null || t?.kind != "flow" || n?.revisionId != e.revisionId || n.flowId != e.flowId) return /* @__PURE__ */ new Map();
@@ -5245,21 +5286,22 @@ var mi = { openExternalPage: async () => !1 }, hi = class {
5245
5286
  #d;
5246
5287
  #f;
5247
5288
  #p;
5248
- constructor(r, i, a = C, o = h(), s = mi, c = !0) {
5249
- this.#t = new I(), this.#r = n(), this.#a = n([]), this.#o = n(!1), this.#s = n(!1), this.#c = !0, this.#u = !1, this.#d = !1, this.#p = Promise.resolve(), this.retryCatalog = () => {
5289
+ #m;
5290
+ constructor(r, i, a = j, o = h(), s = mi, c = !0) {
5291
+ this.#t = new E(), this.#r = n(), this.#a = n([]), this.#o = n(!1), this.#s = n(!1), this.#c = !0, this.#u = n([]), this.#d = !1, this.#f = !1, this.#m = Promise.resolve(), this.retryCatalog = () => {
5250
5292
  this.connectors.retryCatalog(), this.triggers.catalog.retry();
5251
5293
  }, this.provideAddNodeOptions = (e, t, n = t) => T(t, [this.triggers.provideAddNodeOptions(e, t), this.connectors.provideAddNodeOptions(e, t, n)]), this.browseAddNodeOptions = (e) => T(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;
5252
5294
  let l = (e) => {
5253
- this.#u || this.#r.set(e);
5295
+ this.#d || this.#r.set(e);
5254
5296
  };
5255
- this.connectorAccess = new Dr(r, l, o), this.runs = new re(r, l, o), this.workspace = new ui(r, l, $t, o, (e) => {
5256
- e.kind == "run.created" ? this.#h(r, e) : this.runs.changed(e.runId);
5257
- }, new Tr(r, s.connectorCache), (e) => void this.#m(e), (e) => {
5297
+ this.connectorAccess = new Or(r, l, o, (e) => this.workspace.catalogs.refreshFlow(e)), this.runs = new ae(r, l, o), this.workspace = new ui(r, l, nn, o, (e) => {
5298
+ e.kind == "run.created" ? this.#_(r, e) : this.runs.changed(e.runId);
5299
+ }, new Er(r, s.connectorCache), (e) => void this.#h(e), (e) => {
5258
5300
  this.connectorAccess.changed(e), this.workspace.catalogs.refreshFlow(e);
5259
- }), this.#f = this.workspace.$.flowId.reaction((e) => {
5260
- this.#p = this.connectorAccess.load(e);
5261
- }), this.connectors = new Lr(r, this.workspace, l, s, o), this.triggers = new Wr(r, this.workspace, l, s, o), this.publications = new Sn(r, this.workspace, l, i, a, o), this.runRequests = new Mn(r, this.runs, l, async (e) => {
5262
- if (!(e != this.workspace.$.flowId.value || !await this.workspace.saveModuleEditor() || this.#u || e != this.workspace.$.flowId.value)) return this.workspace.$.draft.value?.revisionId;
5301
+ }), this.#p = this.workspace.$.flowId.reaction((e) => {
5302
+ this.#m = this.connectorAccess.load(e);
5303
+ }), this.connectors = new Lr(r, this.workspace, l, s, o), this.triggers = new Wr(r, this.workspace, l, s, o), this.publications = new wn(r, this.workspace, l, i, a, o), this.runRequests = new Pn(r, this.runs, l, async (e) => {
5304
+ if (!(e != this.workspace.$.flowId.value || !await this.workspace.saveModuleEditor() || this.#d || e != this.workspace.$.flowId.value)) return this.workspace.$.draft.value?.revisionId;
5263
5305
  }, o, a);
5264
5306
  let u = t((e) => {
5265
5307
  let t = e(this.workspace.$.diagnostics);
@@ -5273,9 +5315,9 @@ var mi = { openExternalPage: async () => !1 }, hi = class {
5273
5315
  }), d = /* @__PURE__ */ new Map(), f, p = t((e) => {
5274
5316
  let t = e(this.workspace.$.draft);
5275
5317
  f != t?.flowId && (d.clear(), f = t?.flowId);
5276
- 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(ke(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}`, _ = [
5318
+ 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(R(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}`, _ = [
5277
5319
  ...fi(t, n),
5278
- r == null || n == null ? void 0 : X(r, n),
5320
+ r == null || n == null ? void 0 : J(r, n),
5279
5321
  i,
5280
5322
  c,
5281
5323
  a,
@@ -5286,13 +5328,19 @@ var mi = { openExternalPage: async () => !1 }, hi = class {
5286
5328
  ...m == null ? [] : [t?.revisionId]
5287
5329
  ], v = d.get(g);
5288
5330
  if (v != null && v.inputs.length == _.length && v.inputs.every((e, t) => e === _[t])) return v.graph;
5289
- let y = tr(t, n, r, i, c, l, p, m, h, s);
5331
+ let y = rr(t, n, r, i, c, l, p, m, h, s);
5290
5332
  return d.set(g, {
5291
5333
  graph: y,
5292
5334
  inputs: _
5293
5335
  }), y;
5294
5336
  }), m = e(p, di);
5295
5337
  this.$ = {
5338
+ connectorSetupPending: t((e) => {
5339
+ let t = e(this.workspace.$.flowId), n = e(this.workspace.$.target), r = e(this.workspace.$.selection);
5340
+ if (r?.kind != "task" || r.definition == null || !("executor" in r.definition) || r.definition.executor.kind != "connector") return !1;
5341
+ let i = r.definition.executor.action;
5342
+ return e(this.#u).some((e) => e.flowId == t && K(e.target, n) && e.actionId == i && (e.nodeId == null || e.nodeId == r.id));
5343
+ }),
5296
5344
  busy: t((e) => {
5297
5345
  let t = e(this.workspace.$.busy);
5298
5346
  if (t != null) return t;
@@ -5302,11 +5350,11 @@ var mi = { openExternalPage: async () => !1 }, hi = class {
5302
5350
  if (e(this.publications.$.rollingBackPublicationId) != null) return "rollback";
5303
5351
  if (e(this.publications.$.changingTriggerId) != null) return "trigger";
5304
5352
  }),
5305
- diagnosticItems: t((e) => de(e(this.workspace.$.revision), e(this.workspace.$.target), e(u))),
5353
+ diagnosticItems: t((e) => ue(e(this.workspace.$.revision), e(this.workspace.$.target), e(u))),
5306
5354
  diagnostics: u,
5307
5355
  designer: p,
5308
5356
  designerNodeById: m,
5309
- sourceNodeIcons: e(p, (e) => Object.fromEntries(e.nodes.flatMap((e) => "icon" in e ? [[e.id, e.icon]] : [])), { equal: Wt }),
5357
+ sourceNodeIcons: e(p, (e) => Object.fromEntries(e.nodes.flatMap((e) => "icon" in e ? [[e.id, e.icon]] : [])), { equal: K }),
5310
5358
  notice: this.#r,
5311
5359
  runEventNodes: t((e) => pi(e(this.workspace.$.draft), e(this.workspace.$.target), e(this.runs.$.run), e(this.runs.$.events), e(m))),
5312
5360
  selectedDesignerNode: t((e) => {
@@ -5319,57 +5367,57 @@ var mi = { openExternalPage: async () => !1 }, hi = class {
5319
5367
  };
5320
5368
  }
5321
5369
  dispose() {
5322
- this.#u = !0, this.#f(), this.#t.invalidate();
5370
+ this.#d = !0, this.#p(), this.#t.invalidate();
5323
5371
  for (let e of Object.values(this.$)) e.dispose();
5324
5372
  this.connectors.dispose(), this.connectorAccess.dispose(), this.publications.dispose(), this.runRequests.dispose(), this.runs.dispose(), this.triggers.dispose(), this.workspace.dispose(), this.#a.dispose(), this.#o.dispose(), this.#s.dispose();
5325
5373
  }
5326
5374
  async start(e) {
5327
- this.#t.invalidate(), this.connectors.reset(), this.triggers.reset(), this.publications.reset(), this.runRequests.reset(), this.runs.reset(), await this.workspace.start(e), await this.#p;
5375
+ this.#t.invalidate(), this.connectors.reset(), this.triggers.reset(), this.publications.reset(), this.runRequests.reset(), this.runs.reset(), await this.workspace.start(e), await this.#m;
5328
5376
  }
5329
5377
  async retryFlows() {
5330
5378
  await this.workspace.reloadFlows();
5331
5379
  }
5332
5380
  dismissNotice() {
5333
- this.#u || this.#r.set(void 0);
5381
+ this.#d || this.#r.set(void 0);
5334
5382
  }
5335
5383
  invalidateVariableNames() {
5336
5384
  this.#c = !0;
5337
5385
  }
5338
5386
  async refreshVariableNames() {
5339
- if (!(this.#u || !this.#i)) {
5387
+ if (!(this.#d || !this.#i)) {
5340
5388
  if (this.#l != null) return this.#l;
5341
5389
  if (this.#c) return this.#c = !1, this.#s.set(!0), this.#l = (async () => {
5342
5390
  try {
5343
5391
  let { variables: e } = await this.#e.listVariables();
5344
- if (this.#u) return;
5392
+ if (this.#d) return;
5345
5393
  this.#a.set(e.map((e) => e.name)), this.#o.set(!0);
5346
5394
  } catch (e) {
5347
- this.#c = !0, this.#u || this.#r.set(L(e, this.#n.t));
5395
+ this.#c = !0, this.#d || this.#r.set(F(e, this.#n.t));
5348
5396
  } finally {
5349
- this.#l = void 0, this.#u || this.#s.set(!1);
5397
+ this.#l = void 0, this.#d || this.#s.set(!1);
5350
5398
  }
5351
5399
  })(), this.#l;
5352
5400
  }
5353
5401
  }
5354
5402
  async selectFlow(e) {
5355
- if (this.#u) return !1;
5403
+ if (this.#d) return !1;
5356
5404
  this.#t.invalidate();
5357
5405
  let t = this.workspace.$.flowId.value, n = this.#r.value;
5358
- 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(), await this.#p, !0);
5406
+ return !await this.workspace.selectFlow(e) || this.#d ? !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(), await this.#m, !0);
5359
5407
  }
5360
- async #m(e) {
5361
- if (!(this.#u || this.#d || this.workspace.$.flowId.value != null)) {
5362
- this.#d = !0;
5408
+ async #h(e) {
5409
+ if (!(this.#d || this.#f || this.workspace.$.flowId.value != null)) {
5410
+ this.#f = !0;
5363
5411
  try {
5364
5412
  await this.selectFlow(e);
5365
5413
  } finally {
5366
- this.#d = !1;
5414
+ this.#f = !1;
5367
5415
  }
5368
5416
  }
5369
5417
  }
5370
5418
  async createFlow(e, t) {
5371
5419
  let n = await this.workspace.createFlow(e, t);
5372
- return this.#u || n == null ? !1 : (await this.selectFlow(n.flowId), this.#u || this.#r.set({
5420
+ return this.#d || n == null ? !1 : (await this.selectFlow(n.flowId), this.#d || this.#r.set({
5373
5421
  kind: "success",
5374
5422
  message: this.#n.t("notice.created", { name: n.name })
5375
5423
  }), !0);
@@ -5390,24 +5438,49 @@ var mi = { openExternalPage: async () => !1 }, hi = class {
5390
5438
  return t == null || !("waits" in t) || !t.waits.some((t) => t.nodeId == e) ? !1 : this.workspace.locateNode(e);
5391
5439
  }
5392
5440
  async addNode(e, t, n) {
5441
+ let r;
5393
5442
  try {
5394
5443
  if (e.kind == "trigger" && "trigger" in e && e.trigger.kind == "connect") {
5395
5444
  await this.triggers.connect(e.trigger.provider);
5396
5445
  return;
5397
5446
  }
5447
+ let i = this.workspace.$.flowId.value, a = this.workspace.$.target.value;
5398
5448
  if (e.kind == "connector") {
5399
- let t = await this.prepareConnectorAction(e.connector);
5400
- if (t == null) return;
5449
+ let { defaultConnection: t, ...n } = e.connector;
5401
5450
  e = {
5402
5451
  ...e,
5403
- connector: t.action
5452
+ connector: n
5404
5453
  };
5405
5454
  }
5406
- let r = await this.workspace.addNode(e, t, n);
5407
- return r != null && e.kind == "connector" && this.connectors.refresh(), r != null && e.kind == "trigger" && this.triggers.refresh(), r;
5455
+ let o = e.kind == "connector" && i != null && a != null ? {
5456
+ flowId: i,
5457
+ target: a,
5458
+ actionId: e.connector.actionId,
5459
+ nodeId: void 0
5460
+ } : void 0;
5461
+ o != null && (this.#u.set([...this.#u.value, o]), r = () => this.#u.set(this.#u.value.filter((e) => e !== o)));
5462
+ let s = await this.workspace.addNode(e, t, n);
5463
+ return s != null && e.kind == "connector" && o != null && (o.nodeId = s, this.#u.set([...this.#u.value]), this.#g(o.flowId, o.target, s, e.connector).finally(r), r = void 0), s != null && e.kind == "trigger" && this.triggers.refresh(), s;
5408
5464
  } catch (e) {
5409
- this.#u || this.#r.set(L(e, this.#n.t));
5465
+ this.#d || this.#r.set(F(e, this.#n.t));
5410
5466
  return;
5467
+ } finally {
5468
+ r?.();
5469
+ }
5470
+ }
5471
+ async #g(e, t, n, r) {
5472
+ try {
5473
+ if (this.#d || e != this.workspace.$.flowId.value) return;
5474
+ let i = await this.prepareConnectorAction(r);
5475
+ if (i == null || this.#d || e != this.workspace.$.flowId.value) return;
5476
+ let a = this.workspace.$.revision.value?.node(t, n);
5477
+ if (a?.kind != "task" || a.node.task != null) return;
5478
+ let o = this.workspace.$.revision.value?.task(a.node.taskId)?.executor;
5479
+ if (o?.kind != "connector" || o.action != r.actionId || o.connectionId != null) return;
5480
+ let s = i.action.defaultConnection;
5481
+ s != null && await this.workspace.setConnectorConnection(a.node.taskId, s.connectionId), !this.#d && e == this.workspace.$.flowId.value && await this.connectors.refresh();
5482
+ } catch (t) {
5483
+ !this.#d && e == this.workspace.$.flowId.value && this.#r.set(F(t, this.#n.t));
5411
5484
  }
5412
5485
  }
5413
5486
  async prepareConnectorAction(e) {
@@ -5419,32 +5492,32 @@ var mi = { openExternalPage: async () => !1 }, hi = class {
5419
5492
  };
5420
5493
  if (!e.authenticated) {
5421
5494
  let n = await this.connectors.resolveAction(e.actionId);
5422
- return this.#u || t != this.workspace.$.flowId.value ? void 0 : n;
5495
+ return this.#d || t != this.workspace.$.flowId.value ? void 0 : n;
5423
5496
  }
5424
- if (this.connectorAccess.$.value.access ?? await this.connectorAccess.load(t), this.#u || t != this.workspace.$.flowId.value) return;
5497
+ if (this.connectorAccess.$.value.access ?? await this.connectorAccess.load(t), this.#d || t != this.workspace.$.flowId.value) return;
5425
5498
  let a = this.connectorAccess.$.value.access;
5426
5499
  if (a == null) return i;
5427
5500
  let o;
5428
5501
  if (a?.mode == "selectable") {
5429
- if (this.connectorAccess.$.value.candidates[e.serviceId] ?? await this.connectorAccess.loadCandidates(e.serviceId), this.#u || t != this.workspace.$.flowId.value) return;
5502
+ if (this.connectorAccess.$.value.candidates[e.serviceId] ?? await this.connectorAccess.loadCandidates([e.serviceId]), this.#d || t != this.workspace.$.flowId.value) return;
5430
5503
  let n = this.connectorAccess.$.value.candidates[e.serviceId]?.candidates.filter((t) => t.permissions == null || t.permissions.allActions || t.permissions.actionIds.includes(e.actionId));
5431
5504
  if (n == null) return i;
5432
5505
  let r = new Set(a.bindings.filter((t) => t.providerId == e.serviceId && t.status == "active").map((e) => e.accessBindingId));
5433
5506
  if (n != null && !n.some((e) => r.has(e.accessBindingId))) {
5434
5507
  let r = n.find((e) => e.isDefault) ?? (n.length == 1 ? n[0] : void 0);
5435
5508
  if (r != null) {
5436
- if (!await this.connectorAccess.select(e.serviceId, r.accessBindingId)) return this.#u || t != this.workspace.$.flowId.value ? void 0 : i;
5509
+ if (!await this.connectorAccess.select(e.serviceId, r.accessBindingId)) return this.#d || t != this.workspace.$.flowId.value ? void 0 : i;
5437
5510
  a = this.connectorAccess.$.value.access;
5438
5511
  }
5439
5512
  }
5440
5513
  o = n?.some((e) => a?.bindings.some((t) => t.accessBindingId == e.accessBindingId && t.status == "active"));
5441
5514
  }
5442
- if (this.#u || t != this.workspace.$.flowId.value) return;
5515
+ if (this.#d || t != this.workspace.$.flowId.value) return;
5443
5516
  let s = a?.bindings.some((t) => t.providerId == e.serviceId && t.status == "active") ?? !1;
5444
5517
  if (a?.mode != "implicit" && !(o ?? s)) return i;
5445
5518
  this.workspace.catalogs.refreshFlow(t);
5446
5519
  let c = await this.connectors.resolveAction(e.actionId);
5447
- if (!(this.#u || t != this.workspace.$.flowId.value)) {
5520
+ if (!(this.#d || t != this.workspace.$.flowId.value)) {
5448
5521
  if (c.action.serviceId != e.serviceId) throw Error("Connector Action Provider changed while access was being configured.");
5449
5522
  return c;
5450
5523
  }
@@ -5454,13 +5527,13 @@ var mi = { openExternalPage: async () => !1 }, hi = class {
5454
5527
  }
5455
5528
  async requestDraftRun(e) {
5456
5529
  let t = this.workspace.$.flowId.value;
5457
- if (!await this.workspace.saveDraft() || this.#u || t != this.workspace.$.flowId.value) return "unavailable";
5530
+ if (!await this.workspace.saveDraft() || this.#d || t != this.workspace.$.flowId.value) return "unavailable";
5458
5531
  let n = this.workspace.$.targetFlow.value, r = this.workspace.$.draft.value;
5459
5532
  return n == null || r == null ? "unavailable" : await this.runRequests.requestDraft(n, r, e);
5460
5533
  }
5461
5534
  async editDraftRunInputs(e) {
5462
5535
  let t = this.workspace.$.flowId.value;
5463
- if (!await this.workspace.saveDraft() || this.#u || t != this.workspace.$.flowId.value) return "unavailable";
5536
+ if (!await this.workspace.saveDraft() || this.#d || t != this.workspace.$.flowId.value) return "unavailable";
5464
5537
  let n = this.workspace.$.targetFlow.value, r = this.workspace.$.draft.value;
5465
5538
  return n == null || r == null ? "unavailable" : await this.runRequests.editDraft(n, r, e);
5466
5539
  }
@@ -5468,25 +5541,25 @@ var mi = { openExternalPage: async () => !1 }, hi = class {
5468
5541
  let e = this.workspace.$.targetFlow.value;
5469
5542
  return e == null ? "unavailable" : await this.runRequests.requestLive(e);
5470
5543
  }
5471
- async #h(e, t) {
5544
+ async #_(e, t) {
5472
5545
  let n = this.workspace.$.target.value;
5473
- if (this.#u || this.runRequests.$.submitting.value != null || n?.kind != "flow" || this.workspace.$.flowId.value != t.flowId) return;
5546
+ if (this.#d || this.runRequests.$.submitting.value != null || n?.kind != "flow" || this.workspace.$.flowId.value != t.flowId) return;
5474
5547
  let r = this.#t.begin();
5475
5548
  try {
5476
5549
  let n = await e.getRun(t.runId), i = this.workspace.$.target.value;
5477
- if (!r() || this.#u || i?.kind != "flow" || this.workspace.$.flowId.value != t.flowId || n.flowId != t.flowId || n.runId != t.runId) return;
5550
+ if (!r() || this.#d || i?.kind != "flow" || this.workspace.$.flowId.value != t.flowId || n.flowId != t.flowId || n.runId != t.runId) return;
5478
5551
  this.runs.followExternal(n);
5479
5552
  } catch {
5480
5553
  return;
5481
5554
  }
5482
5555
  }
5483
- }, gi = xt(() => import("./flowWorkspace-C8yH2xRN.js").then((e) => e.t));
5556
+ }, gi = Tt(() => import("./flowWorkspace-etUB3NSN.js").then((e) => e.t));
5484
5557
  function _i({ action: e, description: t, error: n, onSubmit: r, onTokenChange: i, pending: a = !1, title: o, token: c, tokenLabel: u }) {
5485
- let d = c != null && u != null && i != null, f = c ?? "", p = /* @__PURE__ */ K(yt, { children: [
5486
- /* @__PURE__ */ G("div", {
5558
+ let d = c != null && u != null && i != null, f = c ?? "", p = /* @__PURE__ */ U(Ct, { children: [
5559
+ /* @__PURE__ */ H("div", {
5487
5560
  "aria-hidden": "true",
5488
5561
  className: "flex size-10 items-center justify-center rounded-lg bg-muted text-muted-foreground",
5489
- children: /* @__PURE__ */ K("svg", {
5562
+ children: /* @__PURE__ */ U("svg", {
5490
5563
  className: "size-5",
5491
5564
  fill: "none",
5492
5565
  stroke: "currentColor",
@@ -5494,40 +5567,40 @@ function _i({ action: e, description: t, error: n, onSubmit: r, onTokenChange: i
5494
5567
  strokeLinejoin: "round",
5495
5568
  strokeWidth: "1.8",
5496
5569
  viewBox: "0 0 24 24",
5497
- children: [/* @__PURE__ */ G("rect", {
5570
+ children: [/* @__PURE__ */ H("rect", {
5498
5571
  height: "9",
5499
5572
  rx: "2",
5500
5573
  width: "14",
5501
5574
  x: "5",
5502
5575
  y: "11"
5503
- }), /* @__PURE__ */ G("path", { d: "M8 11V8a4 4 0 0 1 8 0v3" })]
5576
+ }), /* @__PURE__ */ H("path", { d: "M8 11V8a4 4 0 0 1 8 0v3" })]
5504
5577
  })
5505
5578
  }),
5506
- /* @__PURE__ */ K("header", {
5579
+ /* @__PURE__ */ U("header", {
5507
5580
  className: "flex flex-col gap-2",
5508
- children: [/* @__PURE__ */ G("h1", {
5581
+ children: [/* @__PURE__ */ H("h1", {
5509
5582
  className: "text-xl font-semibold tracking-tight text-balance",
5510
5583
  children: o
5511
- }), /* @__PURE__ */ G("p", {
5584
+ }), /* @__PURE__ */ H("p", {
5512
5585
  className: "text-sm/relaxed text-muted-foreground text-pretty",
5513
5586
  children: t
5514
5587
  })]
5515
5588
  }),
5516
- d && /* @__PURE__ */ G(it, { children: /* @__PURE__ */ K(nt, {
5589
+ d && /* @__PURE__ */ H(ct, { children: /* @__PURE__ */ U(ot, {
5517
5590
  "data-invalid": n != null,
5518
5591
  children: [
5519
- /* @__PURE__ */ G(rt, {
5592
+ /* @__PURE__ */ H(st, {
5520
5593
  htmlFor: "session-token",
5521
5594
  children: u
5522
5595
  }),
5523
- /* @__PURE__ */ G(l, {
5596
+ /* @__PURE__ */ H(l, {
5524
5597
  autoComplete: "username",
5525
5598
  name: "username",
5526
5599
  type: "hidden",
5527
5600
  value: "open-flow",
5528
5601
  readOnly: !0
5529
5602
  }),
5530
- /* @__PURE__ */ G(l, {
5603
+ /* @__PURE__ */ H(l, {
5531
5604
  autoComplete: "current-password",
5532
5605
  "aria-invalid": n != null,
5533
5606
  autoFocus: !0,
@@ -5539,29 +5612,29 @@ function _i({ action: e, description: t, error: n, onSubmit: r, onTokenChange: i
5539
5612
  type: "password",
5540
5613
  value: f
5541
5614
  }),
5542
- n != null && /* @__PURE__ */ G(st, { children: n })
5615
+ n != null && /* @__PURE__ */ H(dt, { children: n })
5543
5616
  ]
5544
5617
  }) }),
5545
- e != null && r != null && /* @__PURE__ */ K(s, {
5618
+ e != null && r != null && /* @__PURE__ */ U(s, {
5546
5619
  disabled: a || d && f.length == 0,
5547
5620
  size: "lg",
5548
5621
  type: "submit",
5549
- children: [a && /* @__PURE__ */ G(tt, {
5622
+ children: [a && /* @__PURE__ */ H(at, {
5550
5623
  "aria-label": e,
5551
5624
  "data-icon": "inline-start"
5552
5625
  }), e]
5553
5626
  }),
5554
- a && e == null && /* @__PURE__ */ G(tt, { "aria-label": t })
5627
+ a && e == null && /* @__PURE__ */ H(at, { "aria-label": t })
5555
5628
  ] }), m = "m-auto flex w-full max-w-[420px] flex-col gap-5 rounded-xl bg-card p-6 shadow-lg shadow-black/10";
5556
- return /* @__PURE__ */ G("main", {
5629
+ return /* @__PURE__ */ H("main", {
5557
5630
  className: "open-flow-workbench",
5558
- children: /* @__PURE__ */ G("div", {
5631
+ children: /* @__PURE__ */ H("div", {
5559
5632
  className: "grid h-full overflow-auto bg-muted/20 p-4",
5560
- children: r == null ? /* @__PURE__ */ G("section", {
5633
+ children: r == null ? /* @__PURE__ */ H("section", {
5561
5634
  "aria-busy": a,
5562
5635
  className: m,
5563
5636
  children: p
5564
- }) : /* @__PURE__ */ G("form", {
5637
+ }) : /* @__PURE__ */ H("form", {
5565
5638
  "aria-busy": a,
5566
5639
  className: m,
5567
5640
  onSubmit: r,
@@ -5571,14 +5644,14 @@ function _i({ action: e, description: t, error: n, onSubmit: r, onTokenChange: i
5571
5644
  });
5572
5645
  }
5573
5646
  function vi({ host: e, store: t }) {
5574
- let [n] = q(() => e.notify.bind(e)), i = r(t.$.notice);
5575
- return St(() => n(i), [n, i]), St(() => () => n(void 0), [n]), null;
5647
+ let [n] = W(() => e.notify.bind(e)), i = r(t.$.notice);
5648
+ return Et(() => n(i), [n, i]), Et(() => () => n(void 0), [n]), null;
5576
5649
  }
5577
5650
  function yi({ catalogWidth: e, createFlow: t, createFlowDisabled: n, createFlowField: i, flowBadges: a, hrefFor: o, hostAction: s, hostTitle: c, language: l, navigation: u, onConfigureConnector: d, onManageConnectorAccess: f, onHostAction: p, onLanguageChange: m, store: h, theme: g }) {
5578
5651
  let _ = r(h.workspace.$.flowId);
5579
- return /* @__PURE__ */ G("div", {
5652
+ return /* @__PURE__ */ H("div", {
5580
5653
  className: "app-shell",
5581
- children: _ == null ? /* @__PURE__ */ G(Vt, {
5654
+ children: _ == null ? /* @__PURE__ */ H(Gt, {
5582
5655
  catalogWidth: e,
5583
5656
  createFlowDisabled: n,
5584
5657
  createFlowField: i,
@@ -5595,12 +5668,12 @@ function yi({ catalogWidth: e, createFlow: t, createFlowDisabled: n, createFlowF
5595
5668
  onLanguageChange: m,
5596
5669
  onSelectFlow: (e) => void u.selectFlow(e),
5597
5670
  store: h
5598
- }) : /* @__PURE__ */ G(bt, {
5599
- fallback: /* @__PURE__ */ G("main", {
5671
+ }) : /* @__PURE__ */ H(wt, {
5672
+ fallback: /* @__PURE__ */ H("main", {
5600
5673
  "aria-busy": "true",
5601
5674
  className: "workspace"
5602
5675
  }),
5603
- children: /* @__PURE__ */ G(gi, {
5676
+ children: /* @__PURE__ */ H(gi, {
5604
5677
  hostAction: s,
5605
5678
  hostTitle: c,
5606
5679
  hrefFor: o,
@@ -5615,43 +5688,43 @@ function yi({ catalogWidth: e, createFlow: t, createFlowDisabled: n, createFlowF
5615
5688
  });
5616
5689
  }
5617
5690
  function bi({ catalogWidth: e, createFlow: t, createFlowDisabled: n, createFlowField: r, flowBadges: i, host: a, hostAction: s, hostTitle: c, hrefFor: l, language: u, location: d, onConfigureConnector: f, onManageConnectorAccess: p, onHostAction: m, onLanguageChange: g, onNavigate: _, preferences: v, theme: y, variables: b = !0 }) {
5618
- let x = Ct(_);
5691
+ let x = Dt(_);
5619
5692
  x.current = _;
5620
- let [{ i18n: S, navigation: w, store: T }] = q(() => {
5621
- let e = h(u), t = new hi(new M((e, t) => a.request(e, t), (e, t) => a.subscribeFlow(e, t), (e) => a.subscribeFlowCatalog(e)), v, C, e, a, b);
5693
+ let [{ i18n: S, navigation: C, store: w }] = W(() => {
5694
+ let e = h(u), t = new hi(new he((e, t) => a.request(e, t), (e, t) => a.subscribeFlow(e, t), (e) => a.subscribeFlowCatalog(e)), v, j, e, a, b);
5622
5695
  return {
5623
5696
  i18n: e,
5624
- navigation: new Dt(t, d, (e, t) => x.current(e, t)),
5697
+ navigation: new jt(t, d, (e, t) => x.current(e, t)),
5625
5698
  store: t
5626
5699
  };
5627
5700
  });
5628
- return St(() => {
5629
- w.start();
5701
+ return Et(() => {
5702
+ C.start();
5630
5703
  let e = () => {
5631
- T.connectors.refreshAfterAuthorization(), T.triggers.refreshAfterAuthorization(), T.invalidateVariableNames();
5704
+ w.connectors.refreshAfterAuthorization(), w.triggers.refreshAfterAuthorization(), w.invalidateVariableNames();
5632
5705
  };
5633
5706
  return globalThis.addEventListener("focus", e), () => {
5634
- globalThis.removeEventListener("focus", e), w.dispose(), T.dispose(), S.dispose();
5707
+ globalThis.removeEventListener("focus", e), C.dispose(), w.dispose(), S.dispose();
5635
5708
  };
5636
5709
  }, [
5637
5710
  S,
5638
- w,
5639
- T
5640
- ]), St(() => void w.apply(d), [d, w]), St(() => {
5641
- T.triggers.catalog.setLanguage(u), T.connectors.setLanguage(u), S.lang != u && S.switchLang(u);
5711
+ C,
5712
+ w
5713
+ ]), Et(() => void C.apply(d), [d, C]), Et(() => {
5714
+ w.triggers.catalog.setLanguage(u), w.connectors.setLanguage(u), S.lang != u && S.switchLang(u);
5642
5715
  }, [
5643
5716
  S,
5644
5717
  u,
5645
- T
5646
- ]), /* @__PURE__ */ G(o, {
5718
+ w
5719
+ ]), /* @__PURE__ */ H(o, {
5647
5720
  i18n: S,
5648
- children: /* @__PURE__ */ K("div", {
5721
+ children: /* @__PURE__ */ U("div", {
5649
5722
  className: "open-flow-theme open-flow-workbench",
5650
5723
  "data-theme": y,
5651
- children: [/* @__PURE__ */ G(vi, {
5724
+ children: [/* @__PURE__ */ H(vi, {
5652
5725
  host: a,
5653
- store: T
5654
- }), /* @__PURE__ */ G(yi, {
5726
+ store: w
5727
+ }), /* @__PURE__ */ H(yi, {
5655
5728
  catalogWidth: e,
5656
5729
  createFlow: t,
5657
5730
  createFlowDisabled: n,
@@ -5661,19 +5734,19 @@ function bi({ catalogWidth: e, createFlow: t, createFlowDisabled: n, createFlowF
5661
5734
  hostTitle: c,
5662
5735
  hrefFor: l,
5663
5736
  language: u,
5664
- navigation: w,
5737
+ navigation: C,
5665
5738
  onConfigureConnector: f,
5666
5739
  onManageConnectorAccess: p,
5667
5740
  onHostAction: m,
5668
5741
  onLanguageChange: g,
5669
- store: T,
5742
+ store: w,
5670
5743
  theme: y
5671
5744
  })]
5672
5745
  })
5673
5746
  });
5674
5747
  }
5675
5748
  function xi({ sessionKey: e, ...t }) {
5676
- return /* @__PURE__ */ G(bi, { ...t }, e);
5749
+ return /* @__PURE__ */ H(bi, { ...t }, e);
5677
5750
  }
5678
5751
  //#endregion
5679
- export { ne as EventSourcesPage, _i as OpenFlowSessionGate, xi as OpenFlowWorkbench, ht as isWorkbenchLanguage, _t as resolveWorkbenchLanguage, vt as workbenchLanguageNames, gt as workbenchLanguages };
5752
+ export { te as EventSourcesPage, _i as OpenFlowSessionGate, xi as OpenFlowWorkbench, yt as isWorkbenchLanguage, xt as resolveWorkbenchLanguage, St as workbenchLanguageNames, bt as workbenchLanguages };