@oomol-lab/open-flow 0.1.0-beta.11 → 0.1.0-beta.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/dist/browser/{createResourceDialog-DhIU-HYW.js → createResourceDialog-2pESP2wA.js} +11 -11
  2. package/dist/browser/{esm-C64_h7HF.js → esm-BPZ0P6x4.js} +1 -1
  3. package/dist/browser/flow-authoring.js +88 -74
  4. package/dist/browser/flow-change-schema.d.ts +4 -1
  5. package/dist/browser/flow-change.js +1408 -1390
  6. package/dist/browser/{flowChanges-BINNGoug.js → flowChanges-CHPdBmZb.js} +953 -937
  7. package/dist/browser/{flowWorkspace-Dp_b8KXF.js → flowWorkspace-BLGcgnHj.js} +25733 -25724
  8. package/dist/browser/host-conformance.d.ts +7 -0
  9. package/dist/browser/host-conformance.js +33 -0
  10. package/dist/browser/{select-CbQHq-GM.js → select-Dn3vpjGC.js} +506 -485
  11. package/dist/browser/{waitNotificationInputs-fzyKN6mk.js → waitNotificationInputs-BFbQUOyp.js} +1 -1
  12. package/dist/browser/workbench.js +67 -61
  13. package/dist/browser/{workbenchSelect-BjbJjlNd.js → workbenchSelect-DzF8oik9.js} +7 -7
  14. package/dist/common/control-api-conformance.d.ts +6 -0
  15. package/dist/common/control-api-conformance.js +67 -1
  16. package/dist/common/control-api.js +5117 -434
  17. package/dist/common/control-requests.d.ts +68 -0
  18. package/dist/common/control-requests.js +4913 -0
  19. package/dist/common/flow-encoding.d.ts +3 -1
  20. package/dist/common/flow-encoding.js +4755 -59
  21. package/dist/common/flow-json.d.ts +2 -0
  22. package/dist/common/flow-semantics.js +1121 -1107
  23. package/dist/common/mcp-conformance.d.ts +2 -0
  24. package/dist/common/mcp.d.ts +545 -0
  25. package/dist/common/mcp.js +4964 -0
  26. package/dist/common/scheduler.js +513 -499
  27. package/package.json +13 -1
@@ -1,17 +1,17 @@
1
1
  import { a as e, f as t, t as n } from "./dist-C46JByB-.js";
2
2
  import { Kn as r, Ot as i, Un as a, Vn as o, Wn as s, jt as c, nr as l } from "./getPseudoElementBounds-Dfqo78k7.js";
3
- import { c as u, d, m as f, p, u as m } from "./select-CbQHq-GM.js";
4
- import { R as ee, _ as te, c as h, d as ne, f as re, n as ie, p as ae, u as oe } from "./DesignerIcon-ckcKnxxJ.js";
3
+ import { c as u, d, g as f, m as p, p as m, u as h } from "./select-Dn3vpjGC.js";
4
+ import { R as ee, _ as g, c as te, d as ne, f as re, n as ie, p as ae, u as oe } from "./DesignerIcon-ckcKnxxJ.js";
5
5
  import { i as se, n as ce } from "./languages-i3Xmpt6S.js";
6
- import { a as g, c as _, r as le } from "./dist-CP0883sY.js";
6
+ import { a as le, c as _, r as ue } from "./dist-CP0883sY.js";
7
7
  import "./lib-C5Ipyfps.js";
8
- import * as ue from "react";
9
- import { useState as de } from "react";
10
- import { jsx as v, jsxs as fe } from "react/jsx-runtime";
8
+ import * as de from "react";
9
+ import { useState as fe } from "react";
10
+ import { jsx as v, jsxs as pe } from "react/jsx-runtime";
11
11
  import * as y from "effect/Effect";
12
- import * as pe from "effect/Deferred";
12
+ import * as me from "effect/Deferred";
13
13
  //#region src/control/common/random.ts
14
- function me() {
14
+ function he() {
15
15
  let e = globalThis.crypto;
16
16
  if (e != null) {
17
17
  try {
@@ -26,6 +26,7 @@ function me() {
26
26
  }
27
27
  return `${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`;
28
28
  }
29
+ new TextEncoder();
29
30
  //#endregion
30
31
  //#region src/control/common/errors.ts
31
32
  var b = {
@@ -66,7 +67,7 @@ var b = {
66
67
  variableNotFound: "variable.not-found"
67
68
  };
68
69
  b.authenticationRequired, b.authorizationDenied, b.bindingUnresolved, b.connectorActionNotFound, b.connectorUnconfigured, b.connectorUnavailable, b.engineUnavailable, b.engineUnsupported, b.flowInvalid, b.flowNotFound, b.flowBusy, b.flowConflict, b.flowPresentationConflict, b.flowRevisionConflict, b.liveConflict, b.liveNotFound, b.pageInvalidCursor, b.publicationConflict, b.publicationNotFound, b.publicationUnsupported, b.publishOperationNotFound, b.routeNotFound, b.runConflict, b.runEventsExpired, b.runInvalid, b.runNotFound, b.runNotTerminal, b.runOverloaded, b.runWaitNotFound, b.triggerKeyInvalid, b.triggerKeyNotFound, b.triggerNotFound, b.variableInvalid, b.variableLimitReached, b.variableNotFound;
69
- var he = [
70
+ var ge = [
70
71
  "canceled",
71
72
  "completed",
72
73
  "failed",
@@ -76,18 +77,18 @@ var he = [
76
77
  "starting",
77
78
  "waiting"
78
79
  ];
79
- function ge(e) {
80
+ function _e(e) {
80
81
  return e == "canceled" || e == "completed" || e == "failed" || e == "indeterminate";
81
82
  }
82
83
  //#endregion
83
84
  //#region src/control/common/api.ts
84
- var _e = class extends Error {
85
+ var ve = class extends Error {
85
86
  constructor(e, t, n) {
86
87
  super(n), this.code = t, this.name = "ApiError", this.status = e;
87
88
  }
88
89
  };
89
90
  function x() {
90
- throw new _e(502, "response.invalid", "The Control API returned an invalid response.");
91
+ throw new ve(502, "response.invalid", "The Control API returned an invalid response.");
91
92
  }
92
93
  function S(e) {
93
94
  return typeof e != "object" || !e || Array.isArray(e) ? x() : e;
@@ -108,7 +109,7 @@ function E(e) {
108
109
  let t = S(e);
109
110
  return Object.fromEntries(Object.entries(t).map(([e, t]) => [e, E(t)]));
110
111
  }
111
- function ve(e) {
112
+ function ye(e) {
112
113
  let t = S(e);
113
114
  w(t, [
114
115
  ...Object.hasOwn(t, "alias") ? ["alias"] : [],
@@ -128,7 +129,7 @@ function ve(e) {
128
129
  status: n
129
130
  };
130
131
  }
131
- function ye(e, t = !1) {
132
+ function be(e, t = !1) {
132
133
  let n = S(e), r = n.description, i = t && Object.hasOwn(n, "value");
133
134
  return w(n, [
134
135
  "jsonSchema",
@@ -142,13 +143,13 @@ function ye(e, t = !1) {
142
143
  ...i ? { value: E(n.value) } : {}
143
144
  };
144
145
  }
145
- function be(e) {
146
- return ye(e, !0);
146
+ function xe(e) {
147
+ return be(e, !0);
147
148
  }
148
- function xe(e, t) {
149
+ function Se(e, t) {
149
150
  return Object.fromEntries(Object.entries(S(e)).map(([e, n]) => [e, t(n)]));
150
151
  }
151
- function Se(e) {
152
+ function Ce(e) {
152
153
  let t = S(e), n = t.homepageUrl, r = t.icon, i = t.defaultConnection != null;
153
154
  if (w(t, [
154
155
  "actionId",
@@ -170,19 +171,19 @@ function Se(e) {
170
171
  ...t.outputSchema === void 0 ? {} : { outputSchema: E(t.outputSchema) },
171
172
  actionId: C(t.actionId),
172
173
  authenticated: typeof t.authenticated == "boolean" ? t.authenticated : x(),
173
- ...i ? { defaultConnection: ve(t.defaultConnection) } : {},
174
+ ...i ? { defaultConnection: ye(t.defaultConnection) } : {},
174
175
  description: typeof t.description == "string" ? t.description : x(),
175
176
  ...n == null ? {} : { homepageUrl: n },
176
177
  ...r == null ? {} : { icon: r },
177
- inputs: xe(t.inputs, be),
178
+ inputs: Se(t.inputs, xe),
178
179
  name: C(t.name),
179
- outputs: xe(t.outputs, ye),
180
+ outputs: Se(t.outputs, be),
180
181
  serviceId: C(t.serviceId),
181
182
  serviceName: C(t.serviceName)
182
183
  };
183
184
  return a.defaultConnection != null && (a.defaultConnection.serviceId != a.serviceId || a.defaultConnection.status != "active") ? x() : a;
184
185
  }
185
- function Ce(e) {
186
+ function we(e) {
186
187
  let t = S(e), n = t.homepageUrl, r = t.icon;
187
188
  return w(t, [
188
189
  "serviceId",
@@ -196,7 +197,7 @@ function Ce(e) {
196
197
  serviceName: C(t.serviceName)
197
198
  };
198
199
  }
199
- function we(e) {
200
+ function Te(e) {
200
201
  let t = S(e), n = t.type;
201
202
  return n != "integration" && n != "poll" ? x() : {
202
203
  description: typeof t.description == "string" ? t.description : x(),
@@ -207,8 +208,8 @@ function we(e) {
207
208
  type: n
208
209
  };
209
210
  }
210
- function Te(e) {
211
- let t = S(e), n = we(t), r = {
211
+ function Ee(e) {
212
+ let t = S(e), n = Te(t), r = {
212
213
  configSchema: E(t.configSchema),
213
214
  definitionVersion: T(t.definitionVersion),
214
215
  description: n.description,
@@ -251,18 +252,18 @@ function Te(e) {
251
252
  type: "integration"
252
253
  };
253
254
  }
254
- var Ee = /* @__PURE__ */ new Set([
255
+ var De = /* @__PURE__ */ new Set([
255
256
  "cron",
256
257
  "integration",
257
258
  "poll",
258
259
  "webhook"
259
- ]), De = /* @__PURE__ */ new Set([
260
+ ]), Oe = /* @__PURE__ */ new Set([
260
261
  "failed",
261
262
  "healthy",
262
263
  "initializing",
263
264
  "needs_reauth",
264
265
  "suspended"
265
- ]), Oe = /* @__PURE__ */ new Set([
266
+ ]), ke = /* @__PURE__ */ new Set([
266
267
  "delivery.failed",
267
268
  "health.failed",
268
269
  "health.needs_reauth",
@@ -271,12 +272,12 @@ var Ee = /* @__PURE__ */ new Set([
271
272
  "operator.paused",
272
273
  "operator.resumed"
273
274
  ]);
274
- function ke(e) {
275
+ function Ae(e) {
275
276
  if (e != null) return C(e);
276
277
  }
277
- function Ae(e) {
278
+ function je(e) {
278
279
  let t = S(e), n = t.health, r = t.kind, i = t.operatorState, a = T(t.runtimeVersion);
279
- return t.version != 1 || typeof n != "string" || !De.has(n) || typeof r != "string" || !Ee.has(r) || i != "active" && i != "paused" || a <= 0 ? x() : {
280
+ return t.version != 1 || typeof n != "string" || !Oe.has(n) || typeof r != "string" || !De.has(r) || i != "active" && i != "paused" || a <= 0 ? x() : {
280
281
  ...t.currentPublicationId == null ? {} : { currentPublicationId: C(t.currentPublicationId) },
281
282
  ...t.currentRevisionId == null ? {} : { currentRevisionId: C(t.currentRevisionId) },
282
283
  ...t.endpointUrl == null ? {} : { endpointUrl: C(t.endpointUrl) },
@@ -291,17 +292,17 @@ function Ae(e) {
291
292
  version: 1
292
293
  };
293
294
  }
294
- function je(e) {
295
+ function Me(e) {
295
296
  let t = S(e);
296
297
  return t.version == 1 ? {
297
- binding: Ae(t.binding),
298
+ binding: je(t.binding),
298
299
  version: 1
299
300
  } : x();
300
301
  }
301
- function Me(e) {
302
+ function Ne(e) {
302
303
  let t = S(e), n = t.kind;
303
- if (typeof n != "string" || !Oe.has(n)) return x();
304
- let r = ke(t.errorCode), i = ke(t.errorMessage);
304
+ if (typeof n != "string" || !ke.has(n)) return x();
305
+ let r = Ae(t.errorCode), i = Ae(t.errorMessage);
305
306
  return i != null && i.length > 512 ? x() : {
306
307
  activityId: C(t.activityId),
307
308
  createdAt: C(t.createdAt),
@@ -310,15 +311,15 @@ function Me(e) {
310
311
  kind: n
311
312
  };
312
313
  }
313
- function Ne(e) {
314
- let t = S(e), n = ke(t.nextCursor);
314
+ function Pe(e) {
315
+ let t = S(e), n = Ae(t.nextCursor);
315
316
  return t.version != 1 || !Array.isArray(t.activities) ? x() : {
316
- activities: t.activities.map(Me),
317
+ activities: t.activities.map(Ne),
317
318
  ...n == null ? {} : { nextCursor: n },
318
319
  version: 1
319
320
  };
320
321
  }
321
- function Pe(e) {
322
+ function Fe(e) {
322
323
  let t = S(e), n = T(t.filtered);
323
324
  return t.version != 1 || !Array.isArray(t.events) || typeof t.hasMore != "boolean" || n < 0 ? x() : {
324
325
  events: t.events.map((e) => {
@@ -330,7 +331,7 @@ function Pe(e) {
330
331
  version: 1
331
332
  };
332
333
  }
333
- function Fe(e) {
334
+ function D(e) {
334
335
  let t = S(e), n = t.status;
335
336
  if (t.version != 1 || n != "active" && n != "retiring") return x();
336
337
  let r = t.live == null ? void 0 : S(t.live);
@@ -355,7 +356,7 @@ function Ie(e) {
355
356
  let n = t.nextCursor, r = t.total;
356
357
  return n != null && typeof n != "string" || r != null && !Number.isSafeInteger(r) ? x() : {
357
358
  ...n == null ? {} : { nextCursor: n },
358
- flows: t.flows.map(Fe),
359
+ flows: t.flows.map(D),
359
360
  ...r == null ? {} : { total: r },
360
361
  version: 1
361
362
  };
@@ -395,11 +396,15 @@ function Re(e) {
395
396
  };
396
397
  }
397
398
  function ze(e) {
398
- let t = S(e), n = S(t.content);
399
- return n.modelVersion == 1 ? (S(n.document), S(n.modules), {
400
- ...Re(t),
401
- content: t.content
402
- }) : x();
399
+ let t = S(e);
400
+ try {
401
+ return {
402
+ ...Re(t),
403
+ content: f(t.content)
404
+ };
405
+ } catch {
406
+ return x();
407
+ }
403
408
  }
404
409
  function Be(e) {
405
410
  let t = S(e);
@@ -558,7 +563,7 @@ function Je(e) {
558
563
  version: 1
559
564
  };
560
565
  }
561
- var Ye = new Set(he);
566
+ var Ye = new Set(ge);
562
567
  function Xe(e) {
563
568
  return typeof e == "string" && Ye.has(e) ? e : x();
564
569
  }
@@ -749,9 +754,9 @@ function ot(e) {
749
754
  }
750
755
  return x();
751
756
  }
752
- var D = encodeURIComponent;
757
+ var O = encodeURIComponent;
753
758
  function st(e) {
754
- return `${e}-${me()}`;
759
+ return `${e}-${he()}`;
755
760
  }
756
761
  var ct = class {
757
762
  constructor(e) {
@@ -771,20 +776,20 @@ var ct = class {
771
776
  };
772
777
  }
773
778
  async getVariable(e) {
774
- return Le(await this.request(`/v1/variables/${D(e)}`));
779
+ return Le(await this.request(`/v1/variables/${O(e)}`));
775
780
  }
776
781
  async putVariable(e, t) {
777
- return Le(await this.request(`/v1/variables/${D(e)}`, {
782
+ return Le(await this.request(`/v1/variables/${O(e)}`, {
778
783
  body: JSON.stringify({ value: t }),
779
784
  method: "PUT"
780
785
  }));
781
786
  }
782
787
  async deleteVariable(e) {
783
- let t = S(await this.request(`/v1/variables/${D(e)}`, { method: "DELETE" }));
788
+ let t = S(await this.request(`/v1/variables/${O(e)}`, { method: "DELETE" }));
784
789
  if (w(t, ["version"]), t.version != 1) return x();
785
790
  }
786
- async createFlow(e, t = `flow-${me()}`) {
787
- return Fe(await this.request("/v1/flows", {
791
+ async createFlow(e, t = `flow-${he()}`) {
792
+ return D(await this.request("/v1/flows", {
788
793
  body: JSON.stringify({
789
794
  name: e,
790
795
  version: 1
@@ -794,10 +799,10 @@ var ct = class {
794
799
  }));
795
800
  }
796
801
  async getFlow(e) {
797
- return Fe(await this.request(`/v1/flows/${D(e)}`));
802
+ return D(await this.request(`/v1/flows/${O(e)}`));
798
803
  }
799
804
  async renameFlow(e, t) {
800
- return Fe(await this.request(`/v1/flows/${D(e)}`, {
805
+ return D(await this.request(`/v1/flows/${O(e)}`, {
801
806
  body: JSON.stringify({
802
807
  name: t,
803
808
  version: 1
@@ -806,53 +811,53 @@ var ct = class {
806
811
  }));
807
812
  }
808
813
  async deleteFlow(e) {
809
- return Fe(await this.request(`/v1/flows/${D(e)}`, { method: "DELETE" }));
814
+ return D(await this.request(`/v1/flows/${O(e)}`, { method: "DELETE" }));
810
815
  }
811
816
  async listTriggerKeys(e) {
812
817
  let t = S(await this.request("/v1/trigger-keys", { signal: e }));
813
- return t.version != 1 || !Array.isArray(t.keys) ? x() : t.keys.map(we);
818
+ return t.version != 1 || !Array.isArray(t.keys) ? x() : t.keys.map(Te);
814
819
  }
815
820
  async listTriggerDefinitions(e) {
816
821
  let t = S(await this.request("/v1/trigger-keys/catalog", { signal: e }));
817
- return t.version != 1 || !Array.isArray(t.definitions) ? x() : t.definitions.map(Te);
822
+ return t.version != 1 || !Array.isArray(t.definitions) ? x() : t.definitions.map(Ee);
818
823
  }
819
824
  async getTriggerKey(e, t) {
820
- let n = S(await this.request(`/v1/trigger-keys/${D(e)}`, { signal: t }));
821
- return n.version == 1 ? Te(n.definition) : x();
825
+ let n = S(await this.request(`/v1/trigger-keys/${O(e)}`, { signal: t }));
826
+ return n.version == 1 ? Ee(n.definition) : x();
822
827
  }
823
828
  async listFlowTriggerBindings(e, t) {
824
- let n = S(await this.request(`/v1/flows/${D(e)}/triggers`, { signal: t }));
825
- return n.version != 1 || C(n.flowId) != e || !Array.isArray(n.bindings) ? x() : n.bindings.map(Ae);
829
+ let n = S(await this.request(`/v1/flows/${O(e)}/triggers`, { signal: t }));
830
+ return n.version != 1 || C(n.flowId) != e || !Array.isArray(n.bindings) ? x() : n.bindings.map(je);
826
831
  }
827
832
  async getFlowTriggerBinding(e, t) {
828
- return je(await this.request(`/v1/flows/${D(e)}/triggers/${D(t)}`));
833
+ return Me(await this.request(`/v1/flows/${O(e)}/triggers/${O(t)}`));
829
834
  }
830
835
  async listFlowTriggerActivities(e, t, n = {}) {
831
836
  let r = new URLSearchParams();
832
837
  n.cursor != null && r.set("cursor", n.cursor), n.limit != null && r.set("limit", String(n.limit));
833
838
  let i = r.size == 0 ? "" : `?${r}`;
834
- return Ne(await this.request(`/v1/flows/${D(e)}/triggers/${D(t)}/activities${i}`));
839
+ return Pe(await this.request(`/v1/flows/${O(e)}/triggers/${O(t)}/activities${i}`));
835
840
  }
836
841
  async pauseFlowTrigger(e, t) {
837
- return Ae(await this.request(`/v1/flows/${D(e)}/triggers/${D(t)}/pause`, {
842
+ return je(await this.request(`/v1/flows/${O(e)}/triggers/${O(t)}/pause`, {
838
843
  body: JSON.stringify({ version: 1 }),
839
844
  method: "POST"
840
845
  }));
841
846
  }
842
847
  async resumeFlowTrigger(e, t) {
843
- return Ae(await this.request(`/v1/flows/${D(e)}/triggers/${D(t)}/resume`, {
848
+ return je(await this.request(`/v1/flows/${O(e)}/triggers/${O(t)}/resume`, {
844
849
  body: JSON.stringify({ version: 1 }),
845
850
  method: "POST"
846
851
  }));
847
852
  }
848
853
  async testFlowPollTrigger(e, t) {
849
- return Pe(await this.request(`/v1/flows/${D(e)}/triggers/${D(t)}/test`, {
854
+ return Fe(await this.request(`/v1/flows/${O(e)}/triggers/${O(t)}/test`, {
850
855
  body: JSON.stringify({ version: 1 }),
851
856
  method: "POST"
852
857
  }));
853
858
  }
854
859
  async getEditor(e) {
855
- let t = S(await this.request(`/v1/flows/${D(e)}/editor`));
860
+ let t = S(await this.request(`/v1/flows/${O(e)}/editor`));
856
861
  if (w(t, [
857
862
  "flow",
858
863
  "draft",
@@ -861,7 +866,7 @@ var ct = class {
861
866
  "version"
862
867
  ]), t.version != 1) return x();
863
868
  let n = {
864
- flow: Fe(t.flow),
869
+ flow: D(t.flow),
865
870
  draft: ze(t.draft),
866
871
  live: qe(t.live),
867
872
  presentation: Be(t.presentation),
@@ -870,20 +875,20 @@ var ct = class {
870
875
  return n.flow.flowId != e || n.draft.flowId != e || n.live.flowId != e || n.flow.draftRevisionId != n.draft.revisionId ? x() : n;
871
876
  }
872
877
  async getPresentation(e) {
873
- return Be(await this.request(`/v1/flows/${D(e)}/presentation`));
878
+ return Be(await this.request(`/v1/flows/${O(e)}/presentation`));
874
879
  }
875
880
  async getDraft(e) {
876
- return ze(await this.request(`/v1/flows/${D(e)}/draft`));
881
+ return ze(await this.request(`/v1/flows/${O(e)}/draft`));
877
882
  }
878
883
  async syncDraft(e) {
879
- return He(await this.request(`/v1/flows/${D(e)}/draft/sync`));
884
+ return He(await this.request(`/v1/flows/${O(e)}/draft/sync`));
880
885
  }
881
886
  async getRevision(e, t) {
882
- return ze(await this.request(`/v1/flows/${D(e)}/revisions/${D(t)}`));
887
+ return ze(await this.request(`/v1/flows/${O(e)}/revisions/${O(t)}`));
883
888
  }
884
889
  async listConnectorProviders(e, t) {
885
- let n = S(await this.request(`/v1/connector/providers${t == null ? "" : `?flowId=${D(t)}`}`, { signal: e }));
886
- return w(n, ["providers", "version"]), n.version != 1 || !Array.isArray(n.providers) ? x() : n.providers.map(Ce);
890
+ let n = S(await this.request(`/v1/connector/providers${t == null ? "" : `?flowId=${O(t)}`}`, { signal: e }));
891
+ return w(n, ["providers", "version"]), n.version != 1 || !Array.isArray(n.providers) ? x() : n.providers.map(we);
887
892
  }
888
893
  async listConnectorActions(e, t, n) {
889
894
  return await this.connectorActions({
@@ -898,19 +903,19 @@ var ct = class {
898
903
  }, t);
899
904
  }
900
905
  async getConnectorAction(e, t, n) {
901
- let r = S(await this.request(`/v1/connector/actions/${D(e)}${n == null ? "" : `?flowId=${D(n)}`}`, { signal: t }));
902
- return w(r, ["action", "version"]), r.version == 1 ? Se(r.action) : x();
906
+ let r = S(await this.request(`/v1/connector/actions/${O(e)}${n == null ? "" : `?flowId=${O(n)}`}`, { signal: t }));
907
+ return w(r, ["action", "version"]), r.version == 1 ? Ce(r.action) : x();
903
908
  }
904
909
  async listConnectorConnections(e, t, n) {
905
- let r = S(await this.request(`/v1/connector/connections/${D(e)}${n == null ? "" : `?flowId=${D(n)}`}`, { signal: t }));
910
+ let r = S(await this.request(`/v1/connector/connections/${O(e)}${n == null ? "" : `?flowId=${O(n)}`}`, { signal: t }));
906
911
  return w(r, [
907
912
  "connections",
908
913
  "serviceId",
909
914
  "version"
910
- ]), r.version != 1 || C(r.serviceId) != e || !Array.isArray(r.connections) ? x() : r.connections.map(ve);
915
+ ]), r.version != 1 || C(r.serviceId) != e || !Array.isArray(r.connections) ? x() : r.connections.map(ye);
911
916
  }
912
917
  async createConnectorConnectionPage(e, t) {
913
- let n = S(await this.request(`/v1/connector/connections/${D(e)}/page${t == null ? "" : `?flowId=${D(t)}`}`, {
918
+ let n = S(await this.request(`/v1/connector/connections/${O(e)}/page${t == null ? "" : `?flowId=${O(t)}`}`, {
914
919
  body: JSON.stringify({ version: 1 }),
915
920
  method: "POST"
916
921
  }));
@@ -923,7 +928,7 @@ var ct = class {
923
928
  }
924
929
  }
925
930
  async changeDraft(e, t, n, r = st("change")) {
926
- return Ve(await this.request(`/v1/flows/${D(e)}/draft/changes`, {
931
+ return Ve(await this.request(`/v1/flows/${O(e)}/draft/changes`, {
927
932
  body: JSON.stringify({
928
933
  expectedRevisionId: t,
929
934
  operations: n,
@@ -934,7 +939,7 @@ var ct = class {
934
939
  }));
935
940
  }
936
941
  async checkFlow(e, t) {
937
- return Ke(await this.request(`/v1/flows/${D(e)}/revisions/${D(t)}/check`, {
942
+ return Ke(await this.request(`/v1/flows/${O(e)}/revisions/${O(t)}/check`, {
938
943
  body: JSON.stringify({
939
944
  engineContract: "open-flow-engine/v2",
940
945
  version: 1
@@ -943,16 +948,16 @@ var ct = class {
943
948
  }));
944
949
  }
945
950
  async getLive(e, t) {
946
- return qe(await this.request(`/v1/flows/${D(e)}/live`, { signal: t }));
951
+ return qe(await this.request(`/v1/flows/${O(e)}/live`, { signal: t }));
947
952
  }
948
953
  async listPublications(e, t = {}, n) {
949
954
  let r = new URLSearchParams();
950
955
  t.cursor != null && r.set("cursor", t.cursor), t.limit != null && r.set("limit", String(t.limit)), t.includeTotal != null && r.set("includeTotal", String(t.includeTotal));
951
956
  let i = r.size == 0 ? "" : `?${r}`;
952
- return Je(await this.request(`/v1/flows/${D(e)}/publications${i}`, { signal: n }));
957
+ return Je(await this.request(`/v1/flows/${O(e)}/publications${i}`, { signal: n }));
953
958
  }
954
959
  async createDraftRun(e, t, n) {
955
- let r = $e(await this.request(`/v1/flows/${D(e)}/revisions/${D(t)}/runs`, {
960
+ let r = $e(await this.request(`/v1/flows/${O(e)}/revisions/${O(t)}/runs`, {
956
961
  body: JSON.stringify({
957
962
  engineContract: "open-flow-engine/v2",
958
963
  inputs: n.inputs ?? {},
@@ -978,7 +983,7 @@ var ct = class {
978
983
  return n.source == "live" ? n : x();
979
984
  }
980
985
  async setFlowEnabled(e, t, n) {
981
- return Fe(await this.request(`/v1/flows/${D(e)}/enabled`, {
986
+ return D(await this.request(`/v1/flows/${O(e)}/enabled`, {
982
987
  method: "PUT",
983
988
  body: JSON.stringify({
984
989
  enabled: n,
@@ -988,7 +993,7 @@ var ct = class {
988
993
  }));
989
994
  }
990
995
  async publishFlow(e, t, n, r = {}) {
991
- return We(await this.request(`/v1/flows/${D(e)}/revisions/${D(t)}/publications`, {
996
+ return We(await this.request(`/v1/flows/${O(e)}/revisions/${O(t)}/publications`, {
992
997
  body: JSON.stringify({
993
998
  engineContract: "open-flow-engine/v2",
994
999
  expectedLivePublicationId: n,
@@ -999,10 +1004,10 @@ var ct = class {
999
1004
  }));
1000
1005
  }
1001
1006
  async getPublishOperation(e, t, n) {
1002
- return We(await this.request(`/v1/flows/${D(e)}/publish-operations/${D(t)}`, { signal: n }));
1007
+ return We(await this.request(`/v1/flows/${O(e)}/publish-operations/${O(t)}`, { signal: n }));
1003
1008
  }
1004
1009
  async rollbackFlow(e, t, n, r = {}) {
1005
- return Ue(await this.request(`/v1/flows/${D(e)}/publications/${D(t)}/rollback`, {
1010
+ return Ue(await this.request(`/v1/flows/${O(e)}/publications/${O(t)}/rollback`, {
1006
1011
  body: JSON.stringify({
1007
1012
  expectedLivePublicationId: n,
1008
1013
  version: 1
@@ -1012,31 +1017,31 @@ var ct = class {
1012
1017
  }));
1013
1018
  }
1014
1019
  async getRun(e, t) {
1015
- return $e(await this.request(`/v1/runs/${D(e)}`, { signal: t }));
1020
+ return $e(await this.request(`/v1/runs/${O(e)}`, { signal: t }));
1016
1021
  }
1017
1022
  async listRuns(e, t = {}) {
1018
1023
  let n = new URLSearchParams();
1019
1024
  t.cursor != null && n.set("cursor", t.cursor), t.limit != null && n.set("limit", String(t.limit)), t.status != null && n.set("status", t.status);
1020
1025
  let r = n.size == 0 ? "" : `?${n}`;
1021
- return et(await this.request(`/v1/flows/${D(e)}/runs${r}`));
1026
+ return et(await this.request(`/v1/flows/${O(e)}/runs${r}`));
1022
1027
  }
1023
1028
  async getRunEvents(e, t = {}, n) {
1024
1029
  let r = new URLSearchParams();
1025
1030
  t.after != null && r.set("after", String(t.after)), t.limit != null && r.set("limit", String(t.limit));
1026
1031
  let i = r.size == 0 ? "" : `?${r}`;
1027
- return rt(await this.request(`/v1/runs/${D(e)}/events${i}`, { signal: n }));
1032
+ return rt(await this.request(`/v1/runs/${O(e)}/events${i}`, { signal: n }));
1028
1033
  }
1029
1034
  async getRunResult(e, t) {
1030
- return ot(await this.request(`/v1/runs/${D(e)}/result`, { signal: t }));
1035
+ return ot(await this.request(`/v1/runs/${O(e)}/result`, { signal: t }));
1031
1036
  }
1032
1037
  async cancelRun(e) {
1033
- return it(await this.request(`/v1/runs/${D(e)}/cancel`, {
1038
+ return it(await this.request(`/v1/runs/${O(e)}/cancel`, {
1034
1039
  body: JSON.stringify({ version: 1 }),
1035
1040
  method: "POST"
1036
1041
  }));
1037
1042
  }
1038
1043
  async resolveRunWait(e, t, n) {
1039
- return at(await this.request(`/v1/runs/${D(e)}/waits/${D(t)}/resolve`, {
1044
+ return at(await this.request(`/v1/runs/${O(e)}/waits/${O(t)}/resolve`, {
1040
1045
  body: JSON.stringify({
1041
1046
  action: n,
1042
1047
  version: 1
@@ -1045,8 +1050,8 @@ var ct = class {
1045
1050
  }));
1046
1051
  }
1047
1052
  async connectorActions(e, t) {
1048
- let n = Object.entries(e).map(([e, t]) => `${D(e)}=${D(t)}`).join("&"), r = n == "" ? "" : `?${n}`, i = S(await this.request(`/v1/connector/actions${r}`, { signal: t }));
1049
- return w(i, ["actions", "version"]), i.version != 1 || !Array.isArray(i.actions) ? x() : i.actions.map(Se);
1053
+ let n = Object.entries(e).map(([e, t]) => `${O(e)}=${O(t)}`).join("&"), r = n == "" ? "" : `?${n}`, i = S(await this.request(`/v1/connector/actions${r}`, { signal: t }));
1054
+ return w(i, ["actions", "version"]), i.version != 1 || !Array.isArray(i.actions) ? x() : i.actions.map(Ce);
1050
1055
  }
1051
1056
  async request(e, t = {}) {
1052
1057
  let n = new Headers(t.headers);
@@ -1062,7 +1067,7 @@ var ct = class {
1062
1067
  }
1063
1068
  if (!r.ok) {
1064
1069
  let e = S(i).error, t = e == null ? void 0 : S(e);
1065
- throw new _e(r.status, typeof t?.code == "string" ? t.code : "request.failed", typeof t?.message == "string" ? t.message : `Request failed with status ${r.status}.`);
1070
+ throw new ve(r.status, typeof t?.code == "string" ? t.code : "request.failed", typeof t?.message == "string" ? t.message : `Request failed with status ${r.status}.`);
1066
1071
  }
1067
1072
  return i;
1068
1073
  }
@@ -5877,7 +5882,7 @@ function Et({ className: e, align: t = "inline-start", ...n }) {
5877
5882
  ...n
5878
5883
  });
5879
5884
  }
5880
- var Dt = ue.forwardRef(function({ className: e, ...t }, n) {
5885
+ var Dt = de.forwardRef(function({ className: e, ...t }, n) {
5881
5886
  return /* @__PURE__ */ v(c, {
5882
5887
  ref: n,
5883
5888
  "data-slot": "input-group-control",
@@ -5902,10 +5907,10 @@ function kt(e, t) {
5902
5907
  //#endregion
5903
5908
  //#region src/workbench/browser/runtime/shell/hostMenu.tsx
5904
5909
  function At({ action: e, onAction: t, title: n }) {
5905
- let [r, i] = de(null);
5910
+ let [r, i] = fe(null);
5906
5911
  return /* @__PURE__ */ v("div", {
5907
5912
  ref: i,
5908
- children: /* @__PURE__ */ fe(h, { children: [/* @__PURE__ */ v(te, {
5913
+ children: /* @__PURE__ */ pe(te, { children: [/* @__PURE__ */ v(g, {
5909
5914
  "aria-label": e,
5910
5915
  render: /* @__PURE__ */ v(o, {
5911
5916
  size: "icon",
@@ -5918,7 +5923,7 @@ function At({ action: e, onAction: t, title: n }) {
5918
5923
  className: "min-w-40",
5919
5924
  container: r,
5920
5925
  side: "bottom",
5921
- children: /* @__PURE__ */ fe(ne, { children: [/* @__PURE__ */ v(ae, { children: n }), /* @__PURE__ */ v(re, {
5926
+ children: /* @__PURE__ */ pe(ne, { children: [/* @__PURE__ */ v(ae, { children: n }), /* @__PURE__ */ v(re, {
5922
5927
  onClick: t,
5923
5928
  variant: "destructive",
5924
5929
  children: e
@@ -5934,19 +5939,19 @@ function Mt(e, t) {
5934
5939
  case "condition": return "Condition";
5935
5940
  case "value": return "Value";
5936
5941
  case "wait": return "Wait";
5937
- case "subflow": return p(e.document.subflows[t.subflowId]?.name ?? "") || "Subflow";
5938
- case "task": return p(t.task == null ? e.document.tasks[t.taskId]?.name ?? "" : t.task.name) || "Task";
5942
+ case "subflow": return m(e.document.subflows[t.subflowId]?.name ?? "") || "Subflow";
5943
+ case "task": return m(t.task == null ? e.document.tasks[t.taskId]?.name ?? "" : t.task.name) || "Task";
5939
5944
  case "manual": return "Manual Trigger";
5940
5945
  case "webhook": return "Webhook";
5941
5946
  case "cron": return "Scheduled Trigger";
5942
5947
  case "integration":
5943
- case "poll": return p(t.definition.displayName) || "Trigger";
5948
+ case "poll": return m(t.definition.displayName) || "Trigger";
5944
5949
  }
5945
5950
  }
5946
5951
  function Nt(e, t, n) {
5947
5952
  let r = /* @__PURE__ */ new Set(), i = [];
5948
5953
  for (let [n, a] of Object.entries(t.nodes)) {
5949
- let t = p(a.name ?? "") || Mt(e, a), o = d(t, r);
5954
+ let t = m(a.name ?? "") || Mt(e, a), o = d(t, r);
5950
5955
  r.add(o), a.name != o && i.push({
5951
5956
  name: o,
5952
5957
  node: a,
@@ -6205,7 +6210,7 @@ function Ut(e, t, n) {
6205
6210
  moduleId: n.task.moduleId
6206
6211
  }] : []];
6207
6212
  });
6208
- if (t.kind == "subflow") return O(e, a);
6213
+ if (t.kind == "subflow") return k(e, a);
6209
6214
  let o = new Set(n.flatMap((e) => {
6210
6215
  let t = r[e];
6211
6216
  return t?.kind == "poll" || t?.kind == "integration" ? [t.bindingId] : [];
@@ -6214,7 +6219,7 @@ function Ut(e, t, n) {
6214
6219
  bindingId: t,
6215
6220
  kind: "binding.delete"
6216
6221
  });
6217
- return O(e, a);
6222
+ return k(e, a);
6218
6223
  }
6219
6224
  function Wt(e, t, n, r) {
6220
6225
  let i = en(e, t)?.nodes[n];
@@ -6257,11 +6262,11 @@ function Kt(e, t, n, r) {
6257
6262
  value: c
6258
6263
  });
6259
6264
  }
6260
- return O(e, o);
6265
+ return k(e, o);
6261
6266
  }
6262
6267
  function qt(e, t, n, r, i) {
6263
6268
  let a = (t.kind == "flow" ? e.document.graph : e.document.subflows[t.id]?.graph)?.nodes[n];
6264
- return a == null || !("inputs" in a) ? [] : O(e, [{
6269
+ return a == null || !("inputs" in a) ? [] : k(e, [{
6265
6270
  kind: "graph.node.input.set",
6266
6271
  nodeId: n,
6267
6272
  handle: r,
@@ -6289,7 +6294,7 @@ function Jt(e, t, n, r, i, a) {
6289
6294
  },
6290
6295
  bindingId: a,
6291
6296
  kind: "binding.create"
6292
- }, ...O(e, [{
6297
+ }, ...k(e, [{
6293
6298
  before: s,
6294
6299
  handle: r,
6295
6300
  kind: "graph.node.input.set",
@@ -6304,8 +6309,8 @@ function Jt(e, t, n, r, i, a) {
6304
6309
  }
6305
6310
  }])];
6306
6311
  }
6307
- function O(e, t) {
6308
- let n = Yt(e.document), r = m(e, t), i = Yt(r.document);
6312
+ function k(e, t) {
6313
+ let n = Yt(e.document), r = h(e, t), i = Yt(r.document);
6309
6314
  return [...t, ...[...n.keys()].flatMap((e) => i.has(e) || r.document.bindings[e]?.kind != "variable" ? [] : [{
6310
6315
  bindingId: e,
6311
6316
  kind: "binding.delete"
@@ -6522,8 +6527,8 @@ var pn = class {
6522
6527
  "request.failed": "notice.requestFailed",
6523
6528
  "response.invalid": "notice.error.responseInvalid"
6524
6529
  };
6525
- function k(e, t) {
6526
- if (e instanceof _e) {
6530
+ function A(e, t) {
6531
+ if (e instanceof ve) {
6527
6532
  let n = mn[e.code];
6528
6533
  return n == null ? {
6529
6534
  kind: "error",
@@ -6591,26 +6596,23 @@ function bn(e, t) {
6591
6596
  }
6592
6597
  //#endregion
6593
6598
  //#region src/json-schema-subset/expression/result.ts
6594
- var A = Object.freeze({
6599
+ var j = Object.freeze({
6595
6600
  Equals: 0,
6596
6601
  Containing: 1,
6597
6602
  ContainedBy: 2,
6598
6603
  Rejection: 3,
6599
6604
  Intersection: 4
6600
- }), j = Dn(A.Equals), M = Dn(A.Containing), N = Dn(A.ContainedBy), P = Dn(A.Rejection), F = Dn(A.Intersection), xn = _n([
6601
- [A.Equals, j],
6602
- [A.Containing, M],
6603
- [A.ContainedBy, N],
6604
- [A.Rejection, P],
6605
- [A.Intersection, F]
6606
- ]), I = (() => {
6605
+ }), M = On(j.Equals), N = On(j.Containing), P = On(j.ContainedBy), F = On(j.Rejection), I = On(j.Intersection), xn = _n([
6606
+ [j.Equals, M],
6607
+ [j.Containing, N],
6608
+ [j.ContainedBy, P],
6609
+ [j.Rejection, F],
6610
+ [j.Intersection, I]
6611
+ ]), Sn = (() => {
6607
6612
  let e = 0;
6608
6613
  for (let [t, n] of xn) e |= n;
6609
6614
  return e;
6610
6615
  })();
6611
- function Sn(e) {
6612
- return !!(e & j);
6613
- }
6614
6616
  function Cn(e) {
6615
6617
  return !!(e & M);
6616
6618
  }
@@ -6624,21 +6626,24 @@ function En(e) {
6624
6626
  return !!(e & F);
6625
6627
  }
6626
6628
  function Dn(e) {
6629
+ return !!(e & I);
6630
+ }
6631
+ function On(e) {
6627
6632
  return 1 << e;
6628
6633
  }
6629
6634
  //#endregion
6630
6635
  //#region src/json-schema-subset/expression/combination.ts
6631
- function On(e) {
6632
- let t = 0, n = 0, r = { push: (r) => (t = n === 0 ? r : kn(t, r, e), n += 1, t) };
6636
+ function kn(e) {
6637
+ let t = 0, n = 0, r = { push: (r) => (t = n === 0 ? r : An(t, r, e), n += 1, t) };
6633
6638
  return Object.defineProperties(r, {
6634
6639
  result: { get: () => t },
6635
6640
  count: { get: () => n }
6636
6641
  }), r;
6637
6642
  }
6638
- function kn(e, t, n) {
6643
+ function An(e, t, n) {
6639
6644
  let r = 0;
6640
6645
  for (let [i, a] of xn) if (a & e) {
6641
- for (let [e, a] of xn) if (a & t && (r |= n(i, e), r === I)) return r;
6646
+ for (let [e, a] of xn) if (a & t && (r |= n(i, e), r === Sn)) return r;
6642
6647
  }
6643
6648
  return r;
6644
6649
  }
@@ -6652,271 +6657,271 @@ var L = Object.freeze({
6652
6657
  Not: 4,
6653
6658
  Swap: 5
6654
6659
  });
6655
- function An(e, t) {
6660
+ function jn(e, t) {
6656
6661
  switch (e) {
6657
6662
  case L.Save: return t[0];
6658
- case L.OneOf: return Mn(t);
6663
+ case L.OneOf: return Nn(t);
6659
6664
  case L.AllOf:
6660
- case L.AnyOf: return Nn(e, t);
6665
+ case L.AnyOf: return Pn(e, t);
6661
6666
  case L.Not:
6662
- case L.Swap: return Pn(e, t[0]);
6667
+ case L.Swap: return Fn(e, t[0]);
6663
6668
  }
6664
6669
  }
6665
- function jn(e) {
6666
- return Pn(L.Swap, e);
6667
- }
6668
6670
  function Mn(e) {
6671
+ return Fn(L.Swap, e);
6672
+ }
6673
+ function Nn(e) {
6669
6674
  if (e.length === 1) return e[0];
6670
- let t = Nn(L.AnyOf, e), n = [];
6675
+ let t = Pn(L.AnyOf, e), n = [];
6671
6676
  for (let t = 0; t < e.length; ++t) for (let r = t + 1; r < e.length; ++r) {
6672
- let i = e[t], a = e[r], o = Nn(L.AllOf, [i, a]);
6677
+ let i = e[t], a = e[r], o = Pn(L.AllOf, [i, a]);
6673
6678
  n.push(o);
6674
6679
  }
6675
- let r = Nn(L.AnyOf, n), i = Pn(L.Not, r);
6676
- return Nn(L.AllOf, [t, i]);
6680
+ let r = Pn(L.AnyOf, n), i = Fn(L.Not, r);
6681
+ return Pn(L.AllOf, [t, i]);
6677
6682
  }
6678
- function Nn(e, t) {
6683
+ function Pn(e, t) {
6679
6684
  if (t.length < 0) throw Error("invalid expressions: empty array");
6680
6685
  let n;
6681
6686
  switch (e) {
6682
6687
  case L.AllOf:
6683
- n = On(Fn);
6688
+ n = kn(In);
6684
6689
  break;
6685
6690
  case L.AnyOf:
6686
- n = On(In);
6691
+ n = kn(Ln);
6687
6692
  break;
6688
6693
  default: throw Error(`invalid operator ${e}`);
6689
6694
  }
6690
6695
  for (let e of t) n.push(e);
6691
6696
  return n.result;
6692
6697
  }
6693
- function Pn(e, t) {
6698
+ function Fn(e, t) {
6694
6699
  let n, r = 0;
6695
6700
  switch (e) {
6696
6701
  case L.Not:
6697
- n = Ln;
6702
+ n = Rn;
6698
6703
  break;
6699
6704
  case L.Swap:
6700
- n = Rn;
6705
+ n = zn;
6701
6706
  break;
6702
6707
  default: throw Error(`invalid operator ${e}`);
6703
6708
  }
6704
6709
  for (let [e, i] of xn) i & t && (r |= n(e));
6705
6710
  return r;
6706
6711
  }
6707
- function Fn(e, t) {
6712
+ function In(e, t) {
6708
6713
  let n = 0;
6709
6714
  switch (e) {
6710
- case A.Equals:
6715
+ case j.Equals:
6711
6716
  switch (t) {
6712
- case A.Equals:
6713
- n = j;
6717
+ case j.Equals:
6718
+ n = M;
6714
6719
  break;
6715
- case A.Containing:
6716
- n = j;
6720
+ case j.Containing:
6721
+ n = M;
6717
6722
  break;
6718
- case A.ContainedBy:
6719
- n = N;
6723
+ case j.ContainedBy:
6724
+ n = P;
6720
6725
  break;
6721
- case A.Rejection:
6726
+ case j.Rejection:
6722
6727
  n = 0;
6723
6728
  break;
6724
- case A.Intersection: n = N;
6729
+ case j.Intersection: n = P;
6725
6730
  }
6726
6731
  break;
6727
- case A.Containing:
6732
+ case j.Containing:
6728
6733
  switch (t) {
6729
- case A.Equals:
6730
- n = j;
6731
- break;
6732
- case A.Containing:
6733
- n = j | M;
6734
+ case j.Equals:
6735
+ n = M;
6734
6736
  break;
6735
- case A.ContainedBy:
6736
- n = N;
6737
+ case j.Containing:
6738
+ n = M | N;
6737
6739
  break;
6738
- case A.Rejection:
6740
+ case j.ContainedBy:
6739
6741
  n = P;
6740
6742
  break;
6741
- case A.Intersection: n = F | N;
6743
+ case j.Rejection:
6744
+ n = F;
6745
+ break;
6746
+ case j.Intersection: n = I | P;
6742
6747
  }
6743
6748
  break;
6744
- case A.ContainedBy:
6749
+ case j.ContainedBy:
6745
6750
  switch (t) {
6746
- case A.Equals:
6747
- n = N;
6751
+ case j.Equals:
6752
+ n = P;
6748
6753
  break;
6749
- case A.Containing:
6750
- n = N;
6754
+ case j.Containing:
6755
+ n = P;
6751
6756
  break;
6752
- case A.ContainedBy:
6753
- n = N;
6757
+ case j.ContainedBy:
6758
+ n = P;
6754
6759
  break;
6755
- case A.Rejection:
6760
+ case j.Rejection:
6756
6761
  n = 0;
6757
6762
  break;
6758
- case A.Intersection: n = N;
6763
+ case j.Intersection: n = P;
6759
6764
  }
6760
6765
  break;
6761
- case A.Rejection:
6766
+ case j.Rejection:
6762
6767
  switch (t) {
6763
- case A.Equals:
6768
+ case j.Equals:
6764
6769
  n = 0;
6765
6770
  break;
6766
- case A.Containing:
6767
- n = P;
6771
+ case j.Containing:
6772
+ n = F;
6768
6773
  break;
6769
- case A.ContainedBy:
6774
+ case j.ContainedBy:
6770
6775
  n = 0;
6771
6776
  break;
6772
- case A.Rejection:
6773
- n = P;
6777
+ case j.Rejection:
6778
+ n = F;
6774
6779
  break;
6775
- case A.Intersection: n = P;
6780
+ case j.Intersection: n = F;
6776
6781
  }
6777
6782
  break;
6778
- case A.Intersection: switch (t) {
6779
- case A.Equals:
6780
- n = N;
6781
- break;
6782
- case A.Containing:
6783
- n = F | N;
6783
+ case j.Intersection: switch (t) {
6784
+ case j.Equals:
6785
+ n = P;
6784
6786
  break;
6785
- case A.ContainedBy:
6786
- n = N;
6787
+ case j.Containing:
6788
+ n = I | P;
6787
6789
  break;
6788
- case A.Rejection:
6790
+ case j.ContainedBy:
6789
6791
  n = P;
6790
6792
  break;
6791
- case A.Intersection: n = N | P | F;
6793
+ case j.Rejection:
6794
+ n = F;
6795
+ break;
6796
+ case j.Intersection: n = P | F | I;
6792
6797
  }
6793
6798
  }
6794
6799
  return n;
6795
6800
  }
6796
- function In(e, t) {
6801
+ function Ln(e, t) {
6797
6802
  let n = 0;
6798
6803
  switch (e) {
6799
- case A.Equals:
6804
+ case j.Equals:
6800
6805
  switch (t) {
6801
- case A.Equals:
6802
- n = j;
6803
- break;
6804
- case A.Containing:
6806
+ case j.Equals:
6805
6807
  n = M;
6806
6808
  break;
6807
- case A.ContainedBy:
6808
- n = j;
6809
+ case j.Containing:
6810
+ n = N;
6809
6811
  break;
6810
- case A.Rejection:
6812
+ case j.ContainedBy:
6811
6813
  n = M;
6812
6814
  break;
6813
- case A.Intersection: n = M;
6815
+ case j.Rejection:
6816
+ n = N;
6817
+ break;
6818
+ case j.Intersection: n = N;
6814
6819
  }
6815
6820
  break;
6816
- case A.Containing:
6821
+ case j.Containing:
6817
6822
  switch (t) {
6818
- case A.Equals:
6819
- n = M;
6823
+ case j.Equals:
6824
+ n = N;
6820
6825
  break;
6821
- case A.Containing:
6822
- n = M;
6826
+ case j.Containing:
6827
+ n = N;
6823
6828
  break;
6824
- case A.ContainedBy:
6825
- n = M;
6829
+ case j.ContainedBy:
6830
+ n = N;
6826
6831
  break;
6827
- case A.Rejection:
6828
- n = M;
6832
+ case j.Rejection:
6833
+ n = N;
6829
6834
  break;
6830
- case A.Intersection: n = M;
6835
+ case j.Intersection: n = N;
6831
6836
  }
6832
6837
  break;
6833
- case A.ContainedBy:
6838
+ case j.ContainedBy:
6834
6839
  switch (t) {
6835
- case A.Equals:
6836
- n = j;
6837
- break;
6838
- case A.Containing:
6840
+ case j.Equals:
6839
6841
  n = M;
6840
6842
  break;
6841
- case A.ContainedBy:
6842
- n = j | N;
6843
+ case j.Containing:
6844
+ n = N;
6843
6845
  break;
6844
- case A.Rejection:
6845
- n = F;
6846
+ case j.ContainedBy:
6847
+ n = M | P;
6848
+ break;
6849
+ case j.Rejection:
6850
+ n = I;
6846
6851
  break;
6847
- case A.Intersection: n = M | F;
6852
+ case j.Intersection: n = N | I;
6848
6853
  }
6849
6854
  break;
6850
- case A.Rejection:
6855
+ case j.Rejection:
6851
6856
  switch (t) {
6852
- case A.Equals:
6853
- n = M;
6857
+ case j.Equals:
6858
+ n = N;
6854
6859
  break;
6855
- case A.Containing:
6856
- n = M;
6860
+ case j.Containing:
6861
+ n = N;
6857
6862
  break;
6858
- case A.ContainedBy:
6859
- n = F;
6863
+ case j.ContainedBy:
6864
+ n = I;
6860
6865
  break;
6861
- case A.Rejection:
6862
- n = P;
6866
+ case j.Rejection:
6867
+ n = F;
6863
6868
  break;
6864
- case A.Intersection: n = F;
6869
+ case j.Intersection: n = I;
6865
6870
  }
6866
6871
  break;
6867
- case A.Intersection: switch (t) {
6868
- case A.Equals:
6869
- n = M;
6872
+ case j.Intersection: switch (t) {
6873
+ case j.Equals:
6874
+ n = N;
6870
6875
  break;
6871
- case A.Containing:
6872
- n = M;
6876
+ case j.Containing:
6877
+ n = N;
6873
6878
  break;
6874
- case A.ContainedBy:
6875
- n = M | F;
6879
+ case j.ContainedBy:
6880
+ n = N | I;
6876
6881
  break;
6877
- case A.Rejection:
6878
- n = F;
6882
+ case j.Rejection:
6883
+ n = I;
6879
6884
  break;
6880
- case A.Intersection: n = M | F;
6885
+ case j.Intersection: n = N | I;
6881
6886
  }
6882
6887
  }
6883
6888
  return n;
6884
6889
  }
6885
- function Ln(e) {
6890
+ function Rn(e) {
6886
6891
  let t = 0;
6887
6892
  switch (e) {
6888
- case A.Equals:
6889
- t = P;
6890
- break;
6891
- case A.Containing:
6892
- t = P;
6893
+ case j.Equals:
6894
+ t = F;
6893
6895
  break;
6894
- case A.ContainedBy:
6896
+ case j.Containing:
6895
6897
  t = F;
6896
6898
  break;
6897
- case A.Rejection:
6898
- t = j | M;
6899
+ case j.ContainedBy:
6900
+ t = I;
6901
+ break;
6902
+ case j.Rejection:
6903
+ t = M | N;
6899
6904
  break;
6900
- case A.Intersection: t = N | F;
6905
+ case j.Intersection: t = P | I;
6901
6906
  }
6902
6907
  return t;
6903
6908
  }
6904
- function Rn(e) {
6909
+ function zn(e) {
6905
6910
  let t = 0;
6906
6911
  switch (e) {
6907
- case A.Equals:
6908
- t = j;
6909
- break;
6910
- case A.Containing:
6911
- t = N;
6912
- break;
6913
- case A.ContainedBy:
6912
+ case j.Equals:
6914
6913
  t = M;
6915
6914
  break;
6916
- case A.Rejection:
6915
+ case j.Containing:
6917
6916
  t = P;
6918
6917
  break;
6919
- case A.Intersection: t = F;
6918
+ case j.ContainedBy:
6919
+ t = N;
6920
+ break;
6921
+ case j.Rejection:
6922
+ t = F;
6923
+ break;
6924
+ case j.Intersection: t = I;
6920
6925
  }
6921
6926
  return t;
6922
6927
  }
@@ -6928,7 +6933,7 @@ var R = Object.freeze({
6928
6933
  AllOf: 2,
6929
6934
  AnyOf: 3,
6930
6935
  OneOf: 4
6931
- }), zn = (e) => (t, n) => {
6936
+ }), Bn = (e) => (t, n) => {
6932
6937
  let r = {
6933
6938
  parent: null,
6934
6939
  swapped: !1,
@@ -6953,7 +6958,7 @@ var R = Object.freeze({
6953
6958
  for (; a.length > 0;) c(a.pop());
6954
6959
  }
6955
6960
  function o(t) {
6956
- let n = j, [r, o] = t.expressions;
6961
+ let n = M, [r, o] = t.expressions;
6957
6962
  if (!e.equals(r, o)) {
6958
6963
  let a = e.describe(r);
6959
6964
  if (a.kind !== R.Leaf) {
@@ -7019,8 +7024,8 @@ var R = Object.freeze({
7019
7024
  }, r];
7020
7025
  }
7021
7026
  function c(e) {
7022
- let t = e.calculation, n = e.parent, r = An(t.operator, t.results);
7023
- if (r === 0 && (r = N), t.willSwap && (r = jn(r)), n) {
7027
+ let t = e.calculation, n = e.parent, r = jn(t.operator, t.results);
7028
+ if (r === 0 && (r = P), t.willSwap && (r = Mn(r)), n) {
7024
7029
  let e = n.node.calculation, t = e.results;
7025
7030
  t[n.index] = r, e.count += 1, e.count >= t.length && a.push(n.node);
7026
7031
  }
@@ -7028,37 +7033,37 @@ var R = Object.freeze({
7028
7033
  let l = r.calculation.results[0];
7029
7034
  if (l === 0) throw Error("cannot find result of root");
7030
7035
  return l;
7031
- }, Bn = class extends Error {
7036
+ }, Vn = class extends Error {
7032
7037
  constructor(e = []) {
7033
- super(Un(e)), this.name = "SchemaError", this.items = e;
7038
+ super(Wn(e)), this.name = "SchemaError", this.items = e;
7034
7039
  }
7035
- }, Vn = Object.freeze({
7040
+ }, Hn = Object.freeze({
7036
7041
  Compiled: 0,
7037
7042
  External: 1
7038
7043
  });
7039
- function Hn(e) {
7044
+ function Un(e) {
7040
7045
  switch (e.kind) {
7041
- case Vn.Compiled: {
7046
+ case Hn.Compiled: {
7042
7047
  let { message: t, path: n } = e;
7043
7048
  return `${t} (at ${n.length > 0 ? n.join(".") : "$root"})`;
7044
7049
  }
7045
- case Vn.External: return String(e.error);
7050
+ case Hn.External: return String(e.error);
7046
7051
  }
7047
7052
  }
7048
- function Un(e) {
7053
+ function Wn(e) {
7049
7054
  switch (e.length) {
7050
7055
  case 0: return "without any items";
7051
- case 1: return Hn(e[0]);
7052
- default: return `${Hn(e[0])} ... omit the rest ${e.length - 1} items`;
7056
+ case 1: return Un(e[0]);
7057
+ default: return `${Un(e[0])} ... omit the rest ${e.length - 1} items`;
7053
7058
  }
7054
7059
  }
7055
7060
  //#endregion
7056
7061
  //#region src/json-schema-subset/compiler/common.ts
7057
- var Wn = /* @__PURE__ */ new Set(/* @__PURE__ */ "type.enum.const.multipleOf.maximum.exclusiveMaximum.minimum.exclusiveMinimum.maxLength.minLength.pattern.items.additionalItems.maxItems.minItems.uniqueItems.contains.maxProperties.minProperties.required.properties.patternProperties.additionalProperties.dependencies.propertyNames.if.then.else.allOf.anyOf.oneOf.not.format.contentMediaType.contentEncoding.definitions".split("."));
7062
+ var Gn = /* @__PURE__ */ new Set(/* @__PURE__ */ "type.enum.const.multipleOf.maximum.exclusiveMaximum.minimum.exclusiveMinimum.maxLength.minLength.pattern.items.additionalItems.maxItems.minItems.uniqueItems.contains.maxProperties.minProperties.required.properties.patternProperties.additionalProperties.dependencies.propertyNames.if.then.else.allOf.anyOf.oneOf.not.format.contentMediaType.contentEncoding.definitions".split("."));
7058
7063
  function z(e) {
7059
- return Wn.has(e);
7064
+ return Gn.has(e);
7060
7065
  }
7061
- function Gn(e) {
7066
+ function Kn(e) {
7062
7067
  for (let t in e) if (z(t)) return !1;
7063
7068
  return !0;
7064
7069
  }
@@ -7072,35 +7077,35 @@ function V(e) {
7072
7077
  if (typeof e == "boolean") throw Error("JSONSchema7Definition cannot be boolean");
7073
7078
  return e;
7074
7079
  }
7075
- function Kn({ path: e, errors: t }, n, ...r) {
7076
- t.push(qn(e, r, n));
7080
+ function qn({ path: e, errors: t }, n, ...r) {
7081
+ t.push(Jn(e, r, n));
7077
7082
  }
7078
7083
  function H({ path: e, warns: t }, n, ...r) {
7079
- t.push(qn(e, r, n));
7084
+ t.push(Jn(e, r, n));
7080
7085
  }
7081
- function qn(e, t, n) {
7086
+ function Jn(e, t, n) {
7082
7087
  return {
7083
- kind: Vn.Compiled,
7088
+ kind: Hn.Compiled,
7084
7089
  message: n,
7085
7090
  path: [...e, ...t]
7086
7091
  };
7087
7092
  }
7088
7093
  //#endregion
7089
7094
  //#region src/json-schema-subset/compiler/utils.ts
7090
- function Jn(e) {
7095
+ function Yn(e) {
7091
7096
  for (let t in e) {
7092
7097
  let n = e[t];
7093
- n === void 0 ? delete e[t] : n && typeof n == "object" && (Array.isArray(n) ? n.length === 0 && delete e[t] : Yn(n) && delete e[t]);
7098
+ n === void 0 ? delete e[t] : n && typeof n == "object" && (Array.isArray(n) ? n.length === 0 && delete e[t] : Xn(n) && delete e[t]);
7094
7099
  }
7095
7100
  return e;
7096
7101
  }
7097
- function Yn(e) {
7102
+ function Xn(e) {
7098
7103
  for (let t in e) return !1;
7099
7104
  return !0;
7100
7105
  }
7101
7106
  //#endregion
7102
7107
  //#region src/json-schema-subset/compiler/wrapper.ts
7103
- var Xn = Symbol("compiledId"), Zn = Symbol("compiledKind"), Qn = Symbol("compiledPath"), $n = Symbol("validatorLoader"), U = Object.freeze({
7108
+ var Zn = Symbol("compiledId"), Qn = Symbol("compiledKind"), $n = Symbol("compiledPath"), er = Symbol("validatorLoader"), U = Object.freeze({
7104
7109
  Extends: 0,
7105
7110
  Never: 1,
7106
7111
  Any: 2,
@@ -7113,28 +7118,28 @@ var Xn = Symbol("compiledId"), Zn = Symbol("compiledKind"), Qn = Symbol("compile
7113
7118
  Not: 9,
7114
7119
  Combination: 10,
7115
7120
  EnumOrConst: 11
7116
- }), er = _n(sr(U.Any, gn(), {}, () => () => !0)), tr = _n(sr(U.Never, gn(), {
7121
+ }), tr = _n(cr(U.Any, gn(), {}, () => () => !0)), nr = _n(cr(U.Never, gn(), {
7117
7122
  type: "string",
7118
7123
  maxLength: 0,
7119
7124
  minLength: 1
7120
7125
  }, () => () => !1));
7121
- function nr(e) {
7122
- return typeof e != "object" || !e ? !1 : Xn in e;
7126
+ function rr(e) {
7127
+ return typeof e != "object" || !e ? !1 : Zn in e;
7123
7128
  }
7124
7129
  function W(e) {
7125
- return typeof e != "object" || !e ? !1 : Xn in e && Zn in e;
7130
+ return typeof e != "object" || !e ? !1 : Zn in e && Qn in e;
7126
7131
  }
7127
7132
  function G(e) {
7128
- return W(e) ? e[Zn] : U.Extends;
7129
- }
7130
- function rr(e) {
7131
- return W(e) || nr(e) ? e[Xn] : e.id;
7133
+ return W(e) ? e[Qn] : U.Extends;
7132
7134
  }
7133
7135
  function ir(e) {
7134
- return W(e) ? e[Qn] : void 0;
7136
+ return W(e) || rr(e) ? e[Zn] : e.id;
7135
7137
  }
7136
7138
  function ar(e) {
7137
- return typeof e != "object" || !e || Object.defineProperty(e, Xn, {
7139
+ return W(e) ? e[$n] : void 0;
7140
+ }
7141
+ function or(e) {
7142
+ return typeof e != "object" || !e || Object.defineProperty(e, Zn, {
7138
7143
  value: gn(),
7139
7144
  configurable: !1,
7140
7145
  writable: !1,
@@ -7142,33 +7147,33 @@ function ar(e) {
7142
7147
  }), e;
7143
7148
  }
7144
7149
  function K(e, t, n, r = []) {
7145
- return sr(e, gn(), t, n && (() => n.compile(t)), r);
7150
+ return cr(e, gn(), t, n && (() => n.compile(t)), r);
7146
7151
  }
7147
- function or(e) {
7148
- return sr(U.Never, gn(), { ...e }, e[$n], e[Qn]);
7152
+ function sr(e) {
7153
+ return cr(U.Never, gn(), { ...e }, e[er], e[$n]);
7149
7154
  }
7150
- function sr(e, t, n, r, i = []) {
7155
+ function cr(e, t, n, r, i = []) {
7151
7156
  let a = null;
7152
7157
  return Object.defineProperties(n, {
7153
- [Zn]: {
7158
+ [Qn]: {
7154
7159
  value: e,
7155
7160
  configurable: !1,
7156
7161
  writable: !1,
7157
7162
  enumerable: !1
7158
7163
  },
7159
- [Xn]: {
7164
+ [Zn]: {
7160
7165
  value: t,
7161
7166
  configurable: !1,
7162
7167
  writable: !1,
7163
7168
  enumerable: !1
7164
7169
  },
7165
- [Qn]: {
7170
+ [$n]: {
7166
7171
  value: i,
7167
7172
  configurable: !1,
7168
7173
  writable: !1,
7169
7174
  enumerable: !1
7170
7175
  },
7171
- [$n]: {
7176
+ [er]: {
7172
7177
  value: r,
7173
7178
  configurable: !1,
7174
7179
  writable: !1,
@@ -7185,16 +7190,16 @@ function sr(e, t, n, r, i = []) {
7185
7190
  }
7186
7191
  //#endregion
7187
7192
  //#region src/json-schema-subset/compiler/array.ts
7188
- function cr(e, t) {
7189
- let n = lr(e, t), r = ur(e, "maxItems", t), i = ur(e, "minItems", t), a = dr(e, t), o = t.uniqueItems, s;
7190
- if (Array.isArray(n) ? s = fr(e, t) : t.additionalItems && H(e, "it is needless when items is not array", "additionalItems"), !n || !a || s === null) return null;
7193
+ function lr(e, t) {
7194
+ let n = ur(e, t), r = dr(e, "maxItems", t), i = dr(e, "minItems", t), a = fr(e, t), o = t.uniqueItems, s;
7195
+ if (Array.isArray(n) ? s = pr(e, t) : t.additionalItems && H(e, "it is needless when items is not array", "additionalItems"), !n || !a || s === null) return null;
7191
7196
  let c = !1, l = !1;
7192
7197
  if (Array.isArray(n)) {
7193
- r !== void 0 && r <= n.length && (n = n.splice(r), s = pr(s, e.delegate));
7198
+ r !== void 0 && r <= n.length && (n = n.splice(r), s = mr(s, e.delegate));
7194
7199
  let t = n.findIndex((e) => G(e) === U.Never);
7195
- t !== -1 && (n = n.splice(t), s = pr(s, e.delegate), r === void 0 && (r = n.length, l = !0)), i !== void 0 && n.length < i && (H(e, `length(${n.length}) of items if less than minItems(${i})`), c = !0), n.length === 0 && s && G(s) === U.Never && (c = !0);
7200
+ t !== -1 && (n = n.splice(t), s = mr(s, e.delegate), r === void 0 && (r = n.length, l = !0)), i !== void 0 && n.length < i && (H(e, `length(${n.length}) of items if less than minItems(${i})`), c = !0), n.length === 0 && s && G(s) === U.Never && (c = !0);
7196
7201
  } else G(n) === U.Never && (c = !0);
7197
- return r !== void 0 && i !== void 0 && r < i && (l || H(e, `maxItems(${r}) is less than minItems(${i})`), c = !0), K(c ? U.Never : U.Array, Jn({
7202
+ return r !== void 0 && i !== void 0 && r < i && (l || H(e, `maxItems(${r}) is less than minItems(${i})`), c = !0), K(c ? U.Never : U.Array, Yn({
7198
7203
  type: "array",
7199
7204
  items: n,
7200
7205
  contains: a,
@@ -7204,7 +7209,7 @@ function cr(e, t) {
7204
7209
  additionalItems: s
7205
7210
  }), e.delegate, e.path);
7206
7211
  }
7207
- function lr(e, { items: t }) {
7212
+ function ur(e, { items: t }) {
7208
7213
  if (!t) return K(U.Any, {}, e.delegate, e.path);
7209
7214
  if (Array.isArray(t)) {
7210
7215
  let n = [], r = !1;
@@ -7220,7 +7225,7 @@ function lr(e, { items: t }) {
7220
7225
  }
7221
7226
  return J(B(e, "items"), V(t));
7222
7227
  }
7223
- function ur(e, t, n) {
7228
+ function dr(e, t, n) {
7224
7229
  let r = n[t];
7225
7230
  if (r !== void 0) {
7226
7231
  if (Number.isNaN(r)) {
@@ -7234,32 +7239,32 @@ function ur(e, t, n) {
7234
7239
  return r;
7235
7240
  }
7236
7241
  }
7237
- function dr(e, { contains: t }) {
7242
+ function fr(e, { contains: t }) {
7238
7243
  return t ? J(B(e, "contains"), V(t)) : K(U.Any, {}, e.delegate, e.path);
7239
7244
  }
7240
- function fr(e, { additionalItems: t }) {
7245
+ function pr(e, { additionalItems: t }) {
7241
7246
  switch (typeof t) {
7242
7247
  case "boolean": return t ? K(U.Any, {}, e.delegate, e.path) : !1;
7243
7248
  case "object": return J(B(e, "additionalItems"), t);
7244
7249
  default: return K(U.Any, {}, e.delegate, e.path);
7245
7250
  }
7246
7251
  }
7247
- function pr(e, t) {
7252
+ function mr(e, t) {
7248
7253
  return e === void 0 ? K(U.Never, {
7249
7254
  type: "string",
7250
7255
  maxLength: 0,
7251
7256
  minLength: 1
7252
- }, t) : W(e) ? G(e) === U.Never ? e : or(e) : e;
7257
+ }, t) : W(e) ? G(e) === U.Never ? e : sr(e) : e;
7253
7258
  }
7254
7259
  //#endregion
7255
7260
  //#region src/json-schema-subset/compiler/combination.ts
7256
- var mr = Object.freeze([
7261
+ var hr = Object.freeze([
7257
7262
  "allOf",
7258
7263
  "anyOf",
7259
7264
  "oneOf"
7260
7265
  ]);
7261
- function hr(e, t, n, r) {
7262
- if (n.length === 0) return Kn(e, "disable empty list", t), null;
7266
+ function gr(e, t, n, r) {
7267
+ if (n.length === 0) return qn(e, "disable empty list", t), null;
7263
7268
  let i = [];
7264
7269
  for (let [r, a] of n.entries()) {
7265
7270
  let n = J(B(e, t, r), V(a));
@@ -7276,7 +7281,7 @@ function hr(e, t, n, r) {
7276
7281
  let s = U.Combination;
7277
7282
  switch (t) {
7278
7283
  case "allOf":
7279
- o > 0 ? s = U.Never : a === i.length ? s = U.Any : gr(i) || (s = U.Never);
7284
+ o > 0 ? s = U.Never : a === i.length ? s = U.Any : _r(i) || (s = U.Never);
7280
7285
  break;
7281
7286
  case "anyOf":
7282
7287
  a > 0 ? s = U.Any : o === i.length && (s = U.Never);
@@ -7285,7 +7290,7 @@ function hr(e, t, n, r) {
7285
7290
  }
7286
7291
  return K(s, { [t]: i }, r, e.path);
7287
7292
  }
7288
- function gr(e) {
7293
+ function _r(e) {
7289
7294
  let t = null;
7290
7295
  for (let n of e) {
7291
7296
  let e = G(n);
@@ -7305,26 +7310,26 @@ var q = Object.freeze({
7305
7310
  Invalid: 1,
7306
7311
  Unknown: 2
7307
7312
  });
7308
- function _r(e, t) {
7313
+ function vr(e, t) {
7309
7314
  let n = e.isValid;
7310
7315
  return n ? n(t) === !0 ? q.Valid : q.Invalid : q.Unknown;
7311
7316
  }
7312
7317
  //#endregion
7313
7318
  //#region src/json-schema-subset/compiler/enumAndConst.ts
7314
- function vr(e, t, n, r) {
7319
+ function yr(e, t, n, r) {
7315
7320
  let i, a = !1;
7316
7321
  if (t) {
7317
- if (t.length === 0) return Kn(e, "disable empty list", "enum"), null;
7322
+ if (t.length === 0) return qn(e, "disable empty list", "enum"), null;
7318
7323
  i = [];
7319
- for (let [n, a] of t.entries()) switch (_r(r, a)) {
7324
+ for (let [n, a] of t.entries()) switch (vr(r, a)) {
7320
7325
  case q.Valid:
7321
- i.push(ar(a));
7326
+ i.push(or(a));
7322
7327
  break;
7323
7328
  case q.Invalid: H(e, "cannot pass JSON schema of currently schema object", "enum", n);
7324
7329
  }
7325
7330
  i.length === 0 && H(e, "all of elements from list is rejected by currently schema object", "enum");
7326
7331
  }
7327
- if (n && _r(r, n) === q.Invalid && (a = !0), i) {
7332
+ if (n && vr(r, n) === q.Invalid && (a = !0), i) {
7328
7333
  if (i.length === 0) a = !0;
7329
7334
  else if (n) {
7330
7335
  let e = !1;
@@ -7336,11 +7341,11 @@ function vr(e, t, n, r) {
7336
7341
  }
7337
7342
  }
7338
7343
  let o = a ? U.Never : U.EnumOrConst, s = {};
7339
- return r.type && (s.type = r.type), i && (s.enum = i), n && (s.const = ar(yn(n))), K(o, s, e.delegate, e.path);
7344
+ return r.type && (s.type = r.type), i && (s.enum = i), n && (s.const = or(yn(n))), K(o, s, e.delegate, e.path);
7340
7345
  }
7341
7346
  //#endregion
7342
7347
  //#region src/json-schema-subset/compiler/object.ts
7343
- var yr = /* @__PURE__ */ new Set([
7348
+ var br = /* @__PURE__ */ new Set([
7344
7349
  "type",
7345
7350
  "maxProperties",
7346
7351
  "minProperties",
@@ -7351,27 +7356,27 @@ var yr = /* @__PURE__ */ new Set([
7351
7356
  "dependencies",
7352
7357
  "propertyNames"
7353
7358
  ]);
7354
- function br(e, t) {
7355
- let n = Object.keys(t).filter((e) => !yr.has(e) && z(e));
7359
+ function xr(e, t) {
7360
+ let n = Object.keys(t).filter((e) => !br.has(e) && z(e));
7356
7361
  n.length > 0 && H(e, `type="object" will exclude other keys: ${n.toSorted().join(", ")}`);
7357
- let r = xr(e, "maxProperties", t), i = xr(e, "minProperties", t), a = Sr(e, t), o = Cr(e, t), s = wr(e, t), c = Er(e, t);
7362
+ let r = Sr(e, "maxProperties", t), i = Sr(e, "minProperties", t), a = Cr(e, t), o = wr(e, t), s = Tr(e, t), c = Dr(e, t);
7358
7363
  if (!a || !o || !s || !c) return null;
7359
- let l = Tr(e, o, s, t);
7364
+ let l = Er(e, o, s, t);
7360
7365
  if (!l) return null;
7361
- let u = Or(e, Dr(a, o, s, l), c, t);
7362
- return K(kr(e, a, l, u, r, i) ? U.Never : U.Object, Jn({
7366
+ let u = kr(e, Or(a, o, s, l), c, t);
7367
+ return K(Ar(e, a, l, u, r, i) ? U.Never : U.Object, Yn({
7363
7368
  type: "object",
7364
7369
  required: u,
7365
7370
  properties: l,
7366
7371
  minProperties: i,
7367
7372
  maxProperties: r,
7368
7373
  additionalProperties: a,
7369
- patternProperties: Pr(o),
7370
- dependencies: Fr(c, t),
7374
+ patternProperties: Fr(o),
7375
+ dependencies: Ir(c, t),
7371
7376
  propertyNames: s
7372
7377
  }), e.delegate, e.path);
7373
7378
  }
7374
- function xr(e, t, n) {
7379
+ function Sr(e, t, n) {
7375
7380
  let r = n[t];
7376
7381
  if (r !== void 0) {
7377
7382
  if (Number.isNaN(r)) {
@@ -7385,17 +7390,17 @@ function xr(e, t, n) {
7385
7390
  return r;
7386
7391
  }
7387
7392
  }
7388
- function Sr(e, { additionalProperties: t }) {
7393
+ function Cr(e, { additionalProperties: t }) {
7389
7394
  return t === !1 ? K(U.Never, {
7390
7395
  type: "string",
7391
7396
  maxLength: 0,
7392
7397
  minLength: 1
7393
7398
  }, e.delegate, e.path) : typeof t == "object" ? J(B(e, "additionalProperties"), V(t)) : K(U.Any, {}, e.delegate, e.path);
7394
7399
  }
7395
- function Cr(e, { patternProperties: t }) {
7400
+ function wr(e, { patternProperties: t }) {
7396
7401
  let n = !1, r = {};
7397
7402
  for (let i in t) {
7398
- let a = Nr(i);
7403
+ let a = Pr(i);
7399
7404
  if (a instanceof Error) {
7400
7405
  H(e, `property name invalid. ${i}`, "patternProperties", i);
7401
7406
  continue;
@@ -7409,24 +7414,24 @@ function Cr(e, { patternProperties: t }) {
7409
7414
  }
7410
7415
  return n ? null : r;
7411
7416
  }
7412
- function wr(e, { propertyNames: t }) {
7417
+ function Tr(e, { propertyNames: t }) {
7413
7418
  if (!t) return K(U.Any, {}, e.delegate, e.path);
7414
7419
  t = V(t);
7415
7420
  let n = J(B(e, "propertyNames"), t);
7416
7421
  if (!n) return null;
7417
7422
  let r = G(n);
7418
- return r !== U.String && r !== U.Any ? or(n) : n;
7423
+ return r !== U.String && r !== U.Any ? sr(n) : n;
7419
7424
  }
7420
- function Tr(e, t, n, { properties: r }) {
7425
+ function Er(e, t, n, { properties: r }) {
7421
7426
  let i = !1;
7422
7427
  if (!r) return {};
7423
7428
  let a = {};
7424
7429
  for (let o in r) {
7425
- if (_r(n, o) === q.Invalid) {
7430
+ if (vr(n, o) === q.Invalid) {
7426
7431
  H(e, `key ${JSON.stringify(o)} cannot pass JSON schema from propertyNames`, "properties");
7427
7432
  continue;
7428
7433
  }
7429
- let s = Mr(t, o);
7434
+ let s = Nr(t, o);
7430
7435
  if (s && G(s) === U.Never) {
7431
7436
  H(e, `key ${JSON.stringify(o)} matches a pattern that has a impossible(never) schema`, "properties");
7432
7437
  continue;
@@ -7440,40 +7445,40 @@ function Tr(e, t, n, { properties: r }) {
7440
7445
  }
7441
7446
  return i ? null : a;
7442
7447
  }
7443
- function Er(e, { dependencies: t }) {
7448
+ function Dr(e, { dependencies: t }) {
7444
7449
  if (!t) return [{}, {}];
7445
7450
  let n = {}, r = {};
7446
7451
  for (let i in t) {
7447
7452
  let a = V(t[i]);
7448
7453
  if (Array.isArray(a)) {
7449
- let { keys: t, duplicated: r } = jr(a);
7454
+ let { keys: t, duplicated: r } = Mr(a);
7450
7455
  r && H(e, `found duplicated property names: ${r.join(", ")}`, "dependencies", i), n[i] = t;
7451
7456
  } else {
7452
7457
  let t = J(B(e, "dependencies", i), a);
7453
7458
  if (t) {
7454
7459
  let e = G(t);
7455
- r[i] = e === U.Object || e === U.Any ? t : e === U.Extends ? tr : or(t);
7460
+ r[i] = e === U.Object || e === U.Any ? t : e === U.Extends ? nr : sr(t);
7456
7461
  }
7457
7462
  }
7458
7463
  }
7459
7464
  return [n, r];
7460
7465
  }
7461
- function Dr(e, t, n, r) {
7466
+ function Or(e, t, n, r) {
7462
7467
  return (i) => {
7463
- if (_r(n, i) === q.Invalid) return !0;
7464
- let a = Mr(t, i);
7468
+ if (vr(n, i) === q.Invalid) return !0;
7469
+ let a = Nr(t, i);
7465
7470
  return !!(a && G(a) === U.Never || G(r[i] ?? e) === U.Never);
7466
7471
  };
7467
7472
  }
7468
- function Or(e, t, n, { required: r }) {
7473
+ function kr(e, t, n, { required: r }) {
7469
7474
  if (!r) return [];
7470
- let i = jr(r);
7475
+ let i = Mr(r);
7471
7476
  i.duplicated && H(e, `found duplicated required keys: ${i.duplicated.join(", ")}`, "required");
7472
7477
  let a = [], o = [];
7473
- for (let e of i.keys) Ar(n, e).some((e) => t(e)) ? o.push(e) : a.push(e);
7478
+ for (let e of i.keys) jr(n, e).some((e) => t(e)) ? o.push(e) : a.push(e);
7474
7479
  return o.length > 0 && H(e, `key ${o.map((e) => JSON.stringify(e)).join(", ")} will ban by another condition`, "required"), a;
7475
7480
  }
7476
- function kr(e, t, n, r, i, a) {
7481
+ function Ar(e, t, n, r, i, a) {
7477
7482
  if (i !== void 0 && a !== void 0 && i < a) return H(e, `maxProperties(${i}) is less than minProperties(${a})`), !0;
7478
7483
  if (i !== void 0 && r.length > i) return H(e, `length(${r.length}) of required is greater than maxProperties(${i})`), !0;
7479
7484
  if (a !== void 0 && r.length < a) return H(e, `length(${r.length}) of required is less than minProperties(${a})`), !0;
@@ -7484,7 +7489,7 @@ function kr(e, t, n, r, i, a) {
7484
7489
  }
7485
7490
  return !0;
7486
7491
  }
7487
- function Ar([e, t], n) {
7492
+ function jr([e, t], n) {
7488
7493
  let r = [n], i = new Set(r);
7489
7494
  for (; r.length > 0;) {
7490
7495
  let n = r.pop(), i = t[n], o = e[n];
@@ -7495,7 +7500,7 @@ function Ar([e, t], n) {
7495
7500
  }
7496
7501
  return [...i];
7497
7502
  }
7498
- function jr(e) {
7503
+ function Mr(e) {
7499
7504
  let t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set();
7500
7505
  for (let r of e) t.has(r) ? n.add(r) : t.add(r);
7501
7506
  return n.size === 0 ? {
@@ -7506,14 +7511,14 @@ function jr(e) {
7506
7511
  duplicated: [...n]
7507
7512
  };
7508
7513
  }
7509
- function Mr(e, t) {
7514
+ function Nr(e, t) {
7510
7515
  for (let n in e) {
7511
7516
  let [r, i] = e[n];
7512
7517
  if (i.test(t)) return r;
7513
7518
  }
7514
7519
  return null;
7515
7520
  }
7516
- function Nr(e) {
7521
+ function Pr(e) {
7517
7522
  try {
7518
7523
  return new RegExp(e, "i");
7519
7524
  } catch (e) {
@@ -7521,12 +7526,12 @@ function Nr(e) {
7521
7526
  throw e;
7522
7527
  }
7523
7528
  }
7524
- function Pr(e) {
7529
+ function Fr(e) {
7525
7530
  let t = {};
7526
7531
  for (let n in e) t[n] = e[n][0];
7527
7532
  return t;
7528
7533
  }
7529
- function Fr([e, t], { dependencies: n }) {
7534
+ function Ir([e, t], { dependencies: n }) {
7530
7535
  let r = {};
7531
7536
  for (let i in n) {
7532
7537
  let n = e[i], a = t[i];
@@ -7536,38 +7541,38 @@ function Fr([e, t], { dependencies: n }) {
7536
7541
  }
7537
7542
  //#endregion
7538
7543
  //#region src/json-schema-subset/compiler/primitive.ts
7539
- var Ir = /* @__PURE__ */ new Set([
7544
+ var Lr = /* @__PURE__ */ new Set([
7540
7545
  "type",
7541
7546
  "multipleOf",
7542
7547
  "maximum",
7543
7548
  "exclusiveMaximum",
7544
7549
  "minimum",
7545
7550
  "exclusiveMinimum"
7546
- ]), Lr = /* @__PURE__ */ new Set([
7551
+ ]), Rr = /* @__PURE__ */ new Set([
7547
7552
  "type",
7548
7553
  "maxLength",
7549
7554
  "minLength",
7550
7555
  "pattern"
7551
7556
  ]);
7552
- function Rr(e, t) {
7557
+ function zr(e, t) {
7553
7558
  let { type: n } = t;
7554
7559
  switch (n) {
7555
7560
  case "number":
7556
- case "integer": return zr(e, t);
7557
- case "string": return Vr(e, t);
7561
+ case "integer": return Br(e, t);
7562
+ case "string": return Hr(e, t);
7558
7563
  case "boolean":
7559
7564
  case "null": {
7560
7565
  let r = Object.keys(t).filter((e) => z(e) && e !== "type");
7561
7566
  return r.length > 0 && H(e, `key "type" will exclude other keys: ${r.toSorted().join(", ")}`), K(n === "null" ? U.Null : U.Boolean, { type: n }, e.delegate, e.path);
7562
7567
  }
7563
- default: return Kn(e, `invalid type ${JSON.stringify(n)}`), null;
7568
+ default: return qn(e, `invalid type ${JSON.stringify(n)}`), null;
7564
7569
  }
7565
7570
  }
7566
- function zr(e, t) {
7567
- let n = Object.keys(t).filter((e) => !Ir.has(e) && z(e));
7571
+ function Br(e, t) {
7572
+ let n = Object.keys(t).filter((e) => !Lr.has(e) && z(e));
7568
7573
  n.length > 0 && H(e, `type=${JSON.stringify(t.type)} will exclude other keys: ${n.toSorted().join(", ")}`);
7569
- let r = vn(t, Ir);
7570
- for (let t of Ir) {
7574
+ let r = vn(t, Lr);
7575
+ for (let t of Lr) {
7571
7576
  let n = r[t];
7572
7577
  t !== "type" && n !== void 0 && Number.isNaN(n) && (H(e, "found NaN", t), delete r[t]);
7573
7578
  }
@@ -7576,38 +7581,38 @@ function zr(e, t) {
7576
7581
  let { multipleOf: c } = r;
7577
7582
  c === 0 && (delete r.multipleOf, r.type = "number", H(e, "cannot be 0", "multipleOf"));
7578
7583
  let l = U.Numeric;
7579
- return Br(r) || (l = U.Never), K(l, r, e.delegate, e.path);
7584
+ return Vr(r) || (l = U.Never), K(l, r, e.delegate, e.path);
7580
7585
  }
7581
- function Br(e) {
7586
+ function Vr(e) {
7582
7587
  let { maximum: t, exclusiveMaximum: n, minimum: r, exclusiveMinimum: i } = e;
7583
7588
  return t !== void 0 && r !== void 0 ? t >= r : n !== void 0 && r !== void 0 ? n > r : t !== void 0 && i !== void 0 ? t > i : n !== void 0 && i !== void 0 ? n > i : !0;
7584
7589
  }
7585
- function Vr(e, t) {
7586
- let n = Object.keys(t).filter((e) => !Lr.has(e) && z(e));
7590
+ function Hr(e, t) {
7591
+ let n = Object.keys(t).filter((e) => !Rr.has(e) && z(e));
7587
7592
  n.length > 0 && H(e, `type="string" will exclude other keys: ${n.toSorted().join(", ")}`);
7588
- let r = vn(t, Lr);
7589
- Hr(e, r, "maxLength"), Hr(e, r, "minLength");
7593
+ let r = vn(t, Rr);
7594
+ Ur(e, r, "maxLength"), Ur(e, r, "minLength");
7590
7595
  let i = r.maxLength, a = r.minLength, o = U.String;
7591
7596
  return i !== void 0 && (i < 0 || i !== void 0 && a !== void 0 && i < a) && (o = U.Never), K(o, r, e.delegate, e.path);
7592
7597
  }
7593
- function Hr(e, t, n) {
7598
+ function Ur(e, t, n) {
7594
7599
  let r = t[n];
7595
7600
  r !== void 0 && Number.isNaN(r) && (H(e, "found NaN", n), delete t[n]);
7596
7601
  }
7597
7602
  //#endregion
7598
7603
  //#region src/json-schema-subset/compiler/compiler.ts
7599
- var Ur = Object.freeze([]);
7600
- function Wr(e, t, n, r) {
7604
+ var Wr = Object.freeze([]);
7605
+ function Gr(e, t, n, r) {
7601
7606
  if (W(e) || t.isExtendsSchema(e)) return {
7602
7607
  schema: e,
7603
- warns: Ur
7608
+ warns: Wr
7604
7609
  };
7605
7610
  if (r) {
7606
7611
  let t = r.isSchema(e);
7607
7612
  if (typeof t == "object") {
7608
7613
  let e = [];
7609
7614
  for (let n of t) e.push({
7610
- kind: Vn.External,
7615
+ kind: Hn.External,
7611
7616
  error: n
7612
7617
  });
7613
7618
  if (e.length > 0) return e;
@@ -7621,14 +7626,14 @@ function Wr(e, t, n, r) {
7621
7626
  errors: [],
7622
7627
  warns: []
7623
7628
  }, a = J(i, e);
7624
- if (a) Gr(i.errors.length === 0, "found errors (it should be empty)");
7625
- else return Gr(i.errors.length > 0, "cannot found any errors"), i.errors;
7629
+ if (a) Kr(i.errors.length === 0, "found errors (it should be empty)");
7630
+ else return Kr(i.errors.length > 0, "cannot found any errors"), i.errors;
7626
7631
  return {
7627
7632
  schema: a,
7628
7633
  warns: i.warns
7629
7634
  };
7630
7635
  }
7631
- function Gr(e, t) {
7636
+ function Kr(e, t) {
7632
7637
  if (!e) throw Error(t);
7633
7638
  }
7634
7639
  function J(e, t) {
@@ -7640,15 +7645,15 @@ function J(e, t) {
7640
7645
  let { enum: e, const: n, ...a } = t;
7641
7646
  r = a, i = !0;
7642
7647
  }
7643
- let s = Kr(e, r);
7644
- return s && i && (s = vr(e, a, o, s)), s || null;
7648
+ let s = qr(e, r);
7649
+ return s && i && (s = yr(e, a, o, s)), s || null;
7645
7650
  }
7646
- function Kr(e, t) {
7647
- for (let n of mr) {
7651
+ function qr(e, t) {
7652
+ for (let n of hr) {
7648
7653
  let r = t[n];
7649
7654
  if (r) {
7650
7655
  let i = Object.keys(t).filter((e) => z(e) && e !== n);
7651
- return i.length > 0 && H(e, `composition key ${JSON.stringify(n)} will exclude other keys: ${i.toSorted().join(", ")}`), hr(e, n, r) || null;
7656
+ return i.length > 0 && H(e, `composition key ${JSON.stringify(n)} will exclude other keys: ${i.toSorted().join(", ")}`), gr(e, n, r) || null;
7652
7657
  }
7653
7658
  }
7654
7659
  {
@@ -7672,26 +7677,26 @@ function Kr(e, t) {
7672
7677
  let { type: n } = t;
7673
7678
  if (Array.isArray(n)) {
7674
7679
  let { type: r, ...i } = t;
7675
- return hr(e, "anyOf", n.map((e) => ({
7680
+ return gr(e, "anyOf", n.map((e) => ({
7676
7681
  ...i,
7677
7682
  type: e
7678
7683
  })));
7679
7684
  }
7680
7685
  switch (n) {
7681
- case "object": return br(e, t);
7682
- case "array": return cr(e, t);
7683
- default: return Rr(e, t);
7686
+ case "object": return xr(e, t);
7687
+ case "array": return lr(e, t);
7688
+ default: return zr(e, t);
7684
7689
  }
7685
7690
  }
7686
- return Gn(t) ? K(U.Any, {}, e.delegate, e.path) : (Kn(e, "unrecognized"), null);
7691
+ return Kn(t) ? K(U.Any, {}, e.delegate, e.path) : (qn(e, "unrecognized"), null);
7687
7692
  }
7688
7693
  //#endregion
7689
7694
  //#region src/json-schema-subset/checker/tools/mark.ts
7690
- var qr = class {
7695
+ var Jr = class {
7691
7696
  constructor(e) {
7692
7697
  let t = Object.freeze(e.toSorted());
7693
7698
  if (t.length > 32) throw Error(`cannot define ${t.length} keys which is greater than 32`);
7694
- this.keys = t, this.clazz = class extends Jr {
7699
+ this.keys = t, this.clazz = class extends Yr {
7695
7700
  constructor(e) {
7696
7701
  super(t, e);
7697
7702
  }
@@ -7715,7 +7720,7 @@ var qr = class {
7715
7720
  else if (e) for (let [n, r] of this.keys.entries()) e[r] && (t |= 1 << n);
7716
7721
  return new this.clazz(t);
7717
7722
  }
7718
- }, Jr = class {
7723
+ }, Yr = class {
7719
7724
  constructor(e, t) {
7720
7725
  this.keys = e, this.int32 = t;
7721
7726
  }
@@ -7730,21 +7735,21 @@ var qr = class {
7730
7735
  };
7731
7736
  //#endregion
7732
7737
  //#region src/json-schema-subset/checker/tools/quantum.ts
7733
- function Yr(e) {
7734
- return new Xr(e);
7738
+ function Xr(e) {
7739
+ return new Zr(e);
7735
7740
  }
7736
- var Xr = class {
7741
+ var Zr = class {
7737
7742
  constructor(e) {
7738
- this.description = new qr(e);
7743
+ this.description = new Jr(e);
7739
7744
  }
7740
7745
  get keys() {
7741
7746
  return this.description.keys;
7742
7747
  }
7743
7748
  variable(e) {
7744
7749
  let t;
7745
- return e && (t = this.description.toBundle(e).toInt32()), new Zr(this.description, t);
7750
+ return e && (t = this.description.toBundle(e).toInt32()), new Qr(this.description, t);
7746
7751
  }
7747
- }, Zr = class {
7752
+ }, Qr = class {
7748
7753
  constructor(e, t) {
7749
7754
  this.values = /* @__PURE__ */ new Set(), this.description = e, t !== void 0 && this.values.add(t);
7750
7755
  }
@@ -7782,11 +7787,11 @@ var Xr = class {
7782
7787
  };
7783
7788
  //#endregion
7784
7789
  //#region src/json-schema-subset/checker/tools/range.ts
7785
- function Qr(e, t) {
7790
+ function $r(e, t) {
7786
7791
  let [n] = e, [r] = t;
7787
- return n.num < r.num ? $r(e, t) : n.num > r.num ? ei(e, t) : ti(e, t);
7792
+ return n.num < r.num ? ei(e, t) : n.num > r.num ? ti(e, t) : ni(e, t);
7788
7793
  }
7789
- function $r(e, t) {
7794
+ function ei(e, t) {
7790
7795
  let [n, r] = e, [i, a] = t;
7791
7796
  if (r.num <= i.num) {
7792
7797
  let n = r.exclusive, a = i.exclusive;
@@ -7834,7 +7839,7 @@ function $r(e, t) {
7834
7839
  }
7835
7840
  };
7836
7841
  }
7837
- function ei(e, t) {
7842
+ function ti(e, t) {
7838
7843
  let [n, r] = e, [i, a] = t;
7839
7844
  if (n.num >= a.num) {
7840
7845
  let r = a.exclusive, i = n.exclusive;
@@ -7882,7 +7887,7 @@ function ei(e, t) {
7882
7887
  }
7883
7888
  };
7884
7889
  }
7885
- function ti(e, t) {
7890
+ function ni(e, t) {
7886
7891
  let [n, r] = e, [i, a] = t, o = n.exclusive, s = i.exclusive, c, l = n;
7887
7892
  if (!o && s ? (l = i, c = {
7888
7893
  fromLeft: !0,
@@ -7925,8 +7930,8 @@ function Y(e) {
7925
7930
  }
7926
7931
  //#endregion
7927
7932
  //#region src/json-schema-subset/checker/range.ts
7928
- var ni = (e) => (t = e, n = Infinity, r = e, i = Infinity) => {
7929
- let { left: a, center: o, right: s } = Qr([{
7933
+ var ri = (e) => (t = e, n = Infinity, r = e, i = Infinity) => {
7934
+ let { left: a, center: o, right: s } = $r([{
7930
7935
  num: t,
7931
7936
  exclusive: !1
7932
7937
  }, {
@@ -7956,126 +7961,126 @@ var ni = (e) => (t = e, n = Infinity, r = e, i = Infinity) => {
7956
7961
  intersection: u
7957
7962
  };
7958
7963
  };
7959
- function ri({ left: e, right: t, intersection: n }) {
7960
- if (!n) return A.Rejection;
7964
+ function ii({ left: e, right: t, intersection: n }) {
7965
+ if (!n) return j.Rejection;
7961
7966
  let r = !1, i = !1;
7962
- return e && (e.isFrom1 ? r = !0 : i = !0), t && (t.isFrom1 ? r = !0 : i = !0), r && i ? A.Intersection : r ? A.Containing : i ? A.ContainedBy : A.Equals;
7967
+ return e && (e.isFrom1 ? r = !0 : i = !0), t && (t.isFrom1 ? r = !0 : i = !0), r && i ? j.Intersection : r ? j.Containing : i ? j.ContainedBy : j.Equals;
7963
7968
  }
7964
7969
  //#endregion
7965
7970
  //#region src/json-schema-subset/checker/array.ts
7966
- var ii = ni(0), ai = Yr([
7971
+ var ai = ri(0), oi = Xr([
7967
7972
  "hasCommon",
7968
7973
  "hasExtra1",
7969
7974
  "hasExtra2",
7970
7975
  "hasRejection",
7971
7976
  "hasCommonBroken"
7972
7977
  ]);
7973
- function oi({ calculate: e }, t, n) {
7974
- let r = ii(t.minItems, t.maxItems, n.minItems, n.maxItems), i = ri(r);
7975
- if (i === A.Rejection) return P;
7976
- let [a, o] = si(t), [s, c] = si(n), l = Math.max(a.length, s.length) + 1, u = Math.min(l, r.intersection.max), d = ai.variable({}), f = Math.min(t.minItems ?? 0, n.minItems ?? 0);
7978
+ function si({ calculate: e }, t, n) {
7979
+ let r = ai(t.minItems, t.maxItems, n.minItems, n.maxItems), i = ii(r);
7980
+ if (i === j.Rejection) return F;
7981
+ let [a, o] = ci(t), [s, c] = ci(n), l = Math.max(a.length, s.length) + 1, u = Math.min(l, r.intersection.max), d = oi.variable({}), f = Math.min(t.minItems ?? 0, n.minItems ?? 0);
7977
7982
  for (let t = 0; t < u; t++) {
7978
7983
  let n = e(a[t] ?? o, s[t] ?? c);
7979
7984
  d.push(n, (e, n) => {
7980
7985
  switch (e) {
7981
- case A.Equals:
7986
+ case j.Equals:
7982
7987
  n.hasRejection || (n.hasCommon = !0);
7983
7988
  break;
7984
- case A.Containing:
7989
+ case j.Containing:
7985
7990
  n.hasRejection || (n.hasCommon = !0), n.hasExtra1 = !0;
7986
7991
  break;
7987
- case A.ContainedBy:
7992
+ case j.ContainedBy:
7988
7993
  n.hasRejection || (n.hasCommon = !0), n.hasExtra2 = !0;
7989
7994
  break;
7990
- case A.Intersection:
7995
+ case j.Intersection:
7991
7996
  n.hasRejection || (n.hasCommon = !0), n.hasExtra1 = !0, n.hasExtra2 = !0;
7992
7997
  break;
7993
- case A.Rejection: t < f && (n.hasCommonBroken = !0), n.hasRejection = !0, n.hasExtra1 = !0, n.hasExtra2 = !0;
7998
+ case j.Rejection: t < f && (n.hasCommonBroken = !0), n.hasRejection = !0, n.hasExtra1 = !0, n.hasExtra2 = !0;
7994
7999
  }
7995
8000
  });
7996
8001
  }
7997
8002
  d.update((e) => {
7998
8003
  switch (i) {
7999
- case A.Containing:
8004
+ case j.Containing:
8000
8005
  e.hasExtra1 = !0;
8001
8006
  break;
8002
- case A.ContainedBy:
8007
+ case j.ContainedBy:
8003
8008
  e.hasExtra2 = !0;
8004
8009
  break;
8005
- case A.Intersection: e.hasExtra1 = !0, e.hasExtra2 = !0;
8010
+ case j.Intersection: e.hasExtra1 = !0, e.hasExtra2 = !0;
8006
8011
  }
8007
8012
  (t.maxItems === 0 || n.maxItems === 0) && (e.hasCommon = !0, t.maxItems !== 0 && (e.hasExtra1 = !0), n.maxItems !== 0 && (e.hasExtra2 = !0));
8008
8013
  });
8009
8014
  let p = 0;
8010
8015
  for (let { hasExtra1: e, hasExtra2: t, hasCommon: n, hasCommonBroken: r } of d) {
8011
8016
  let i = n;
8012
- r && (i = !1), p |= i ? e && t ? F : e ? M : t ? N : j : P;
8017
+ r && (i = !1), p |= i ? e && t ? I : e ? N : t ? P : M : F;
8013
8018
  }
8014
8019
  return p;
8015
8020
  }
8016
- function si({ items: e, additionalItems: t }) {
8017
- return Array.isArray(e) ? [e, t ?? er] : [[], e ?? er];
8021
+ function ci({ items: e, additionalItems: t }) {
8022
+ return Array.isArray(e) ? [e, t ?? tr] : [[], e ?? tr];
8018
8023
  }
8019
8024
  //#endregion
8020
8025
  //#region src/json-schema-subset/checker/cache.ts
8021
- function ci(e) {
8026
+ function li(e) {
8022
8027
  let t = /* @__PURE__ */ new Map();
8023
8028
  return (n, r) => {
8024
- let i = nr(n);
8025
- return i === nr(r) ? i ? ui(t, n, r, e) : n === r : !1;
8029
+ let i = rr(n);
8030
+ return i === rr(r) ? i ? di(t, n, r, e) : n === r : !1;
8026
8031
  };
8027
8032
  }
8028
- function li(e) {
8033
+ function ui(e) {
8029
8034
  let t = /* @__PURE__ */ new Map();
8030
- return (n, r) => ui(t, n, r, e);
8035
+ return (n, r) => di(t, n, r, e);
8031
8036
  }
8032
- function ui(e, t, n, r) {
8033
- let i = `${rr(t)}/${rr(n)}`, a = e.get(i);
8037
+ function di(e, t, n, r) {
8038
+ let i = `${ir(t)}/${ir(n)}`, a = e.get(i);
8034
8039
  return a === void 0 && e.set(i, a = r(t, n)), a;
8035
8040
  }
8036
8041
  //#endregion
8037
8042
  //#region src/json-schema-subset/checker/enumAndConst.ts
8038
- function di(e, t, n) {
8039
- let r = pi(t), i = pi(n), a = !1, o = !1, s = !1;
8040
- for (let t of r) if (mi(e, i, t) ? s = !0 : a = !0, a && s) break;
8041
- for (let t of i) if (mi(e, r, t) ? s = !0 : o = !0, o && s) break;
8042
- return s ? a && o ? F : a ? M : o ? N : j : P;
8043
+ function fi(e, t, n) {
8044
+ let r = mi(t), i = mi(n), a = !1, o = !1, s = !1;
8045
+ for (let t of r) if (hi(e, i, t) ? s = !0 : a = !0, a && s) break;
8046
+ for (let t of i) if (hi(e, r, t) ? s = !0 : o = !0, o && s) break;
8047
+ return s ? a && o ? I : a ? N : o ? P : M : F;
8043
8048
  }
8044
- function fi(e, t) {
8049
+ function pi(e, t) {
8045
8050
  let n = !1, r = !1;
8046
- for (let i of pi(e)) {
8047
- switch (_r(t, i)) {
8051
+ for (let i of mi(e)) {
8052
+ switch (vr(t, i)) {
8048
8053
  case q.Valid:
8049
8054
  n = !0;
8050
8055
  break;
8051
8056
  case q.Invalid:
8052
8057
  r = !0;
8053
8058
  break;
8054
- case q.Unknown: return I;
8059
+ case q.Unknown: return Sn;
8055
8060
  }
8056
8061
  if (n && r) break;
8057
8062
  }
8058
- return n && r ? F : n ? j | N : r ? P : G(t) === U.Never ? j : N;
8063
+ return n && r ? I : n ? M | P : r ? F : G(t) === U.Never ? M : P;
8059
8064
  }
8060
- function pi({ const: e, enum: t }) {
8065
+ function mi({ const: e, enum: t }) {
8061
8066
  if (e !== void 0) return [e];
8062
8067
  if (t) return t;
8063
8068
  throw Error("invalid branch");
8064
8069
  }
8065
- function mi({ isEquals: e }, t, n) {
8070
+ function hi({ isEquals: e }, t, n) {
8066
8071
  for (let r of t) if (e(r, n)) return !0;
8067
8072
  return !1;
8068
8073
  }
8069
8074
  //#endregion
8070
8075
  //#region src/json-schema-subset/checker/equals.ts
8071
- function hi(e) {
8076
+ function gi(e) {
8072
8077
  function t(t, n) {
8073
8078
  let i = e.isExtendsSchema(t), a = e.isExtendsSchema(n);
8074
8079
  return i || a ? e.equals(t, n) : r(t, n);
8075
8080
  }
8076
8081
  let n = /* @__PURE__ */ new Map();
8077
8082
  function r(e, t) {
8078
- let r = rr(e), a = rr(t);
8083
+ let r = ir(e), a = ir(t);
8079
8084
  if (r === a) return !0;
8080
8085
  let o = `${r}/${a}`, s = n.get(o);
8081
8086
  return s === void 0 && (s = i(e, t), n.set(o, s)), s;
@@ -8098,19 +8103,19 @@ function hi(e) {
8098
8103
  }
8099
8104
  //#endregion
8100
8105
  //#region src/json-schema-subset/checker/numeric/integerNormalizer.ts
8101
- function gi(e) {
8102
- let t = Si(e), n = e.multipleOf ?? 1, r = X(t, n);
8106
+ function _i(e) {
8107
+ let t = Ci(e), n = e.multipleOf ?? 1, r = X(t, n);
8103
8108
  return r ? {
8104
8109
  multipleOf: n,
8105
8110
  range: r
8106
8111
  } : null;
8107
8112
  }
8108
- function _i([e, t]) {
8113
+ function vi([e, t]) {
8109
8114
  return !(e.num !== t.num || e.exclusive || t.exclusive);
8110
8115
  }
8111
8116
  function X(e, t) {
8112
8117
  if (!e) return;
8113
- let [n, r] = e, i = vi(n.num, t), a = yi(r.num, t);
8118
+ let [n, r] = e, i = yi(n.num, t), a = bi(r.num, t);
8114
8119
  if (i === n.num && n.exclusive && (i += t), a === r.num && r.exclusive && (a -= t), !(i > a) && (i !== a || i !== Infinity && i !== -Infinity)) return [{
8115
8120
  num: i,
8116
8121
  exclusive: !1
@@ -8119,29 +8124,29 @@ function X(e, t) {
8119
8124
  exclusive: !1
8120
8125
  }];
8121
8126
  }
8122
- function vi(e, t) {
8127
+ function yi(e, t) {
8123
8128
  return Math.ceil(e / t) * t;
8124
8129
  }
8125
- function yi(e, t) {
8130
+ function bi(e, t) {
8126
8131
  return Math.floor(e / t) * t;
8127
8132
  }
8128
8133
  //#endregion
8129
8134
  //#region src/json-schema-subset/checker/numeric/float.ts
8130
- function bi(e, t) {
8131
- let { left: n, right: r, center: i } = Qr(Si(e), Si(t));
8132
- if (!i) return P;
8135
+ function xi(e, t) {
8136
+ let { left: n, right: r, center: i } = $r(Ci(e), Ci(t));
8137
+ if (!i) return F;
8133
8138
  let a = !1, o = !1;
8134
- return n && (n.fromLeft ? a = !0 : o = !0), r && (r.fromLeft ? a = !0 : o = !0), a && o ? F : a ? M : o ? N : j;
8139
+ return n && (n.fromLeft ? a = !0 : o = !0), r && (r.fromLeft ? a = !0 : o = !0), a && o ? I : a ? N : o ? P : M;
8135
8140
  }
8136
- function xi(e, t) {
8137
- let n = Si(e), r = gi(t);
8138
- if (!r) return M;
8139
- let i = Qr(n, r.range), a = X(i.center, r.multipleOf), o = Ci(i.left, r.multipleOf), s = Ci(i.right, r.multipleOf);
8140
- if (!i.center) return P;
8141
+ function Si(e, t) {
8142
+ let n = Ci(e), r = _i(t);
8143
+ if (!r) return N;
8144
+ let i = $r(n, r.range), a = X(i.center, r.multipleOf), o = wi(i.left, r.multipleOf), s = wi(i.right, r.multipleOf);
8145
+ if (!i.center) return F;
8141
8146
  let c = !1, l = !1;
8142
- return i.left?.fromLeft && (c = !0), i.right?.fromLeft && (c = !0), (!a || !_i(i.center)) && (c = !0), o && (l = !0), s && (l = !0), c && l ? F : c ? M : l ? N : j;
8147
+ return i.left?.fromLeft && (c = !0), i.right?.fromLeft && (c = !0), (!a || !vi(i.center)) && (c = !0), o && (l = !0), s && (l = !0), c && l ? I : c ? N : l ? P : M;
8143
8148
  }
8144
- function Si(e) {
8149
+ function Ci(e) {
8145
8150
  let t, n;
8146
8151
  return t = e.exclusiveMinimum === void 0 ? e.minimum === void 0 ? {
8147
8152
  num: -Infinity,
@@ -8163,84 +8168,84 @@ function Si(e) {
8163
8168
  exclusive: !0
8164
8169
  }, [t, n];
8165
8170
  }
8166
- function Ci(e, t) {
8171
+ function wi(e, t) {
8167
8172
  if (e && !e.fromLeft) return X(e.range, t);
8168
8173
  }
8169
8174
  //#endregion
8170
8175
  //#region src/json-schema-subset/checker/numeric/integer.ts
8171
- function wi(e, t) {
8172
- let n = gi(e), r = gi(t);
8173
- if (!n && !r) return j;
8174
- if (!n) return N;
8175
- if (!r) return M;
8176
- let { range: i, multipleOf: a } = n, { range: o, multipleOf: s } = r, c = Qr(i, o), l, u = 0;
8177
- if (c.center && (u = Ei(a, s), l = X(c.center, u)), !l) return P;
8176
+ function Ti(e, t) {
8177
+ let n = _i(e), r = _i(t);
8178
+ if (!n && !r) return M;
8179
+ if (!n) return P;
8180
+ if (!r) return N;
8181
+ let { range: i, multipleOf: a } = n, { range: o, multipleOf: s } = r, c = $r(i, o), l, u = 0;
8182
+ if (c.center && (u = Di(a, s), l = X(c.center, u)), !l) return F;
8178
8183
  let d = !1, f = !1, { left: p, right: m } = c;
8179
- return p && X(p.range, p.fromLeft ? a : s) && (p.fromLeft ? d = !0 : f = !0), m && X(m.range, m.fromLeft ? a : s) && (m.fromLeft ? d = !0 : f = !0), d ||= Ti(n, l, u), f ||= Ti(r, l, u), d && f ? F : d ? M : f ? N : j;
8184
+ return p && X(p.range, p.fromLeft ? a : s) && (p.fromLeft ? d = !0 : f = !0), m && X(m.range, m.fromLeft ? a : s) && (m.fromLeft ? d = !0 : f = !0), d ||= Ei(n, l, u), f ||= Ei(r, l, u), d && f ? I : d ? N : f ? P : M;
8180
8185
  }
8181
- function Ti({ range: e, multipleOf: t }, n, r) {
8182
- let i = Qr(e, n);
8186
+ function Ei({ range: e, multipleOf: t }, n, r) {
8187
+ let i = $r(e, n);
8183
8188
  if (X(i.left?.range, t) || X(i.right?.range, t)) return !0;
8184
8189
  let a = X(i.center, t);
8185
8190
  if (!a) return !1;
8186
- let o = Oi(n);
8187
- return Oi(a) > o || o !== 1 && t < r;
8188
- }
8189
- function Ei(e, t) {
8190
- return e * t / Di(e, t);
8191
+ let o = ki(n);
8192
+ return ki(a) > o || o !== 1 && t < r;
8191
8193
  }
8192
8194
  function Di(e, t) {
8193
- return e === 0 ? t : Di(t % e, e);
8195
+ return e * t / Oi(e, t);
8194
8196
  }
8195
- function Oi(e) {
8197
+ function Oi(e, t) {
8198
+ return e === 0 ? t : Oi(t % e, e);
8199
+ }
8200
+ function ki(e) {
8196
8201
  if (!e) return 0;
8197
8202
  let [t, n] = e;
8198
8203
  return n.num - t.num + 1;
8199
8204
  }
8200
8205
  //#endregion
8201
8206
  //#region src/json-schema-subset/checker/numeric/checker.ts
8202
- function ki(e, t) {
8203
- if (Ai(e) || Ai(t)) return I;
8204
- let n = ji(e), r = ji(t);
8205
- return n && r ? bi(e, t) : n ? xi(e, t) : r ? jn(xi(t, e)) : wi(e, t);
8207
+ function Ai(e, t) {
8208
+ if (ji(e) || ji(t)) return Sn;
8209
+ let n = Mi(e), r = Mi(t);
8210
+ return n && r ? xi(e, t) : n ? Si(e, t) : r ? Mn(Si(t, e)) : Ti(e, t);
8206
8211
  }
8207
- function Ai(e) {
8212
+ function ji(e) {
8208
8213
  let { multipleOf: t } = e;
8209
8214
  return t === void 0 ? !1 : !Number.isInteger(t) || t < 0;
8210
8215
  }
8211
- function ji(e) {
8216
+ function Mi(e) {
8212
8217
  let { multipleOf: t } = e;
8213
8218
  return !(t !== void 0 && Number.isInteger(t) || e.type === "integer");
8214
8219
  }
8215
8220
  //#endregion
8216
8221
  //#region src/json-schema-subset/checker/object.ts
8217
- var Mi = ni(0), Ni = Yr([
8222
+ var Ni = ri(0), Pi = Xr([
8218
8223
  "hasCommonInRequired",
8219
8224
  "hasCommonOutRequired",
8220
8225
  "hasExtra1",
8221
8226
  "hasExtra2",
8222
8227
  "hasRejection"
8223
8228
  ]);
8224
- function Pi(e, t, n) {
8225
- if (Fi(t, n)) return P;
8226
- let r = Ii(t, n);
8227
- if (!r) return P;
8228
- let i = Hi(t), a = Hi(n), o = (t) => {
8229
+ function Fi(e, t, n) {
8230
+ if (Ii(t, n)) return F;
8231
+ let r = Li(t, n);
8232
+ if (!r) return F;
8233
+ let i = Ui(t), a = Ui(n), o = (t) => {
8229
8234
  let n = i(t), r = a(t);
8230
- return Ui(n, r) ? e.calculate(n, r) : 0;
8231
- }, { commonRequired: s, extraRequired1: c, extraRequired2: l } = r, u = Ni.variable({});
8232
- for (let e of [...s].toSorted()) u.push(o(e), Ri);
8233
- for (let e of [...c].toSorted()) u.push(o(e), zi);
8234
- for (let e of [...l].toSorted()) u.push(o(e), Bi);
8235
+ return Wi(n, r) ? e.calculate(n, r) : 0;
8236
+ }, { commonRequired: s, extraRequired1: c, extraRequired2: l } = r, u = Pi.variable({});
8237
+ for (let e of [...s].toSorted()) u.push(o(e), zi);
8238
+ for (let e of [...c].toSorted()) u.push(o(e), Bi);
8239
+ for (let e of [...l].toSorted()) u.push(o(e), Vi);
8235
8240
  let { hasOptional1: d, hasOptional2: f } = r;
8236
8241
  if (d || f) {
8237
- let r = Vi(d, f);
8238
- for (let e of [...Li(t, n)].toSorted()) {
8242
+ let r = Hi(d, f);
8243
+ for (let e of [...Ri(t, n)].toSorted()) {
8239
8244
  let t = o(e);
8240
8245
  t !== 0 && u.push(t, r);
8241
8246
  }
8242
- let i = t.additionalProperties ?? er, a = n.additionalProperties ?? er;
8243
- if (Ui(i, a)) {
8247
+ let i = t.additionalProperties ?? tr, a = n.additionalProperties ?? tr;
8248
+ if (Wi(i, a)) {
8244
8249
  let t = e.calculate(i, a);
8245
8250
  u.push(t, r);
8246
8251
  }
@@ -8249,13 +8254,13 @@ function Pi(e, t, n) {
8249
8254
  e.hasRejection || (c.size > 0 && (e.hasExtra2 = !0), l.size > 0 && (e.hasExtra1 = !0));
8250
8255
  });
8251
8256
  let { requiredKeysCount: p } = r, m = 0;
8252
- for (let { hasExtra1: e, hasExtra2: t, hasCommonInRequired: n, hasCommonOutRequired: r, hasRejection: i } of u) m |= !n && p > 0 || !r && p === 0 || i ? P : e && t ? F : e ? M : t ? N : j;
8257
+ for (let { hasExtra1: e, hasExtra2: t, hasCommonInRequired: n, hasCommonOutRequired: r, hasRejection: i } of u) m |= !n && p > 0 || !r && p === 0 || i ? F : e && t ? I : e ? N : t ? P : M;
8253
8258
  return m;
8254
8259
  }
8255
- function Fi(e, t) {
8256
- return ri(Mi(e.minProperties, e.maxProperties, t.minProperties, t.maxProperties)) === A.Rejection;
8257
- }
8258
8260
  function Ii(e, t) {
8261
+ return ii(Ni(e.minProperties, e.maxProperties, t.minProperties, t.maxProperties)) === j.Rejection;
8262
+ }
8263
+ function Li(e, t) {
8259
8264
  let n = new Set(e.required), r = new Set(t.required), i = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(), o = n.size, s = r.size;
8260
8265
  for (let e of n) r.has(e) && i.add(e), a.add(e);
8261
8266
  for (let e of r) n.has(e) && i.add(e), a.add(e);
@@ -8271,7 +8276,7 @@ function Ii(e, t) {
8271
8276
  hasOptional2: u > s
8272
8277
  };
8273
8278
  }
8274
- function Li(e, t) {
8279
+ function Ri(e, t) {
8275
8280
  let n = new Set(e.required), r = e.properties, i = t.properties, a = e.required, o = t.required;
8276
8281
  if (r) for (let e in r) n.add(e);
8277
8282
  if (i) for (let e in i) n.add(e);
@@ -8279,67 +8284,67 @@ function Li(e, t) {
8279
8284
  if (o) for (let e of o) n.delete(e);
8280
8285
  return n;
8281
8286
  }
8282
- var Ri = (e, t) => {
8287
+ var zi = (e, t) => {
8283
8288
  switch (e) {
8284
- case A.Equals:
8289
+ case j.Equals:
8285
8290
  t.hasCommonInRequired = !0;
8286
8291
  break;
8287
- case A.Containing:
8292
+ case j.Containing:
8288
8293
  t.hasExtra1 = !0, t.hasCommonInRequired = !0;
8289
8294
  break;
8290
- case A.ContainedBy:
8295
+ case j.ContainedBy:
8291
8296
  t.hasExtra2 = !0, t.hasCommonInRequired = !0;
8292
8297
  break;
8293
- case A.Intersection:
8298
+ case j.Intersection:
8294
8299
  t.hasExtra1 = !0, t.hasExtra2 = !0, t.hasCommonInRequired = !0;
8295
8300
  break;
8296
- case A.Rejection: t.hasRejection = !0;
8301
+ case j.Rejection: t.hasRejection = !0;
8297
8302
  }
8298
- }, zi = (e, t) => {
8303
+ }, Bi = (e, t) => {
8299
8304
  switch (e) {
8300
- case A.Equals:
8301
- case A.ContainedBy:
8305
+ case j.Equals:
8306
+ case j.ContainedBy:
8302
8307
  t.hasCommonInRequired = !0;
8303
8308
  break;
8304
- case A.Intersection:
8305
- case A.Containing:
8309
+ case j.Intersection:
8310
+ case j.Containing:
8306
8311
  t.hasExtra1 = !0, t.hasCommonInRequired = !0;
8307
8312
  break;
8308
- case A.Rejection: t.hasRejection = !0;
8313
+ case j.Rejection: t.hasRejection = !0;
8309
8314
  }
8310
- }, Bi = (e, t) => {
8315
+ }, Vi = (e, t) => {
8311
8316
  switch (e) {
8312
- case A.Equals:
8313
- case A.Containing:
8317
+ case j.Equals:
8318
+ case j.Containing:
8314
8319
  t.hasCommonInRequired = !0;
8315
8320
  break;
8316
- case A.Intersection:
8317
- case A.ContainedBy:
8321
+ case j.Intersection:
8322
+ case j.ContainedBy:
8318
8323
  t.hasExtra2 = !0, t.hasCommonInRequired = !0;
8319
8324
  break;
8320
- case A.Rejection: t.hasRejection = !0;
8325
+ case j.Rejection: t.hasRejection = !0;
8321
8326
  }
8322
- }, Vi = (e, t) => (n, r) => {
8327
+ }, Hi = (e, t) => (n, r) => {
8323
8328
  if (r.hasRejection) return;
8324
8329
  let i = !1, a = !1, o = !1;
8325
8330
  switch (n) {
8326
- case A.Equals:
8331
+ case j.Equals:
8327
8332
  o = !0;
8328
8333
  break;
8329
- case A.Containing:
8334
+ case j.Containing:
8330
8335
  i = !0, o = !0;
8331
8336
  break;
8332
- case A.ContainedBy:
8337
+ case j.ContainedBy:
8333
8338
  a = !0, o = !0;
8334
8339
  break;
8335
- case A.Intersection:
8340
+ case j.Intersection:
8336
8341
  i = !0, a = !0, o = !0;
8337
8342
  break;
8338
- case A.Rejection: i = !0, a = !0;
8343
+ case j.Rejection: i = !0, a = !0;
8339
8344
  }
8340
8345
  e && i && (r.hasExtra1 = !0), t && a && (r.hasExtra2 = !0), e && t && o && (r.hasCommonOutRequired = !0);
8341
8346
  };
8342
- function Hi(e) {
8347
+ function Ui(e) {
8343
8348
  let t = e.properties, n = e.propertyNames, r = e.additionalProperties, i = [];
8344
8349
  if (e.patternProperties) for (let t in e.patternProperties) {
8345
8350
  let n = e.patternProperties[t], r = new RegExp(t, "i");
@@ -8349,39 +8354,39 @@ function Hi(e) {
8349
8354
  });
8350
8355
  }
8351
8356
  return (e) => {
8352
- if (n && _r(n, e) === q.Invalid) return tr;
8357
+ if (n && vr(n, e) === q.Invalid) return nr;
8353
8358
  for (let { pattern: t, schema: n } of i) if (t.test(e)) return n;
8354
- return ((t && t[e]) ?? r) || er;
8359
+ return ((t && t[e]) ?? r) || tr;
8355
8360
  };
8356
8361
  }
8357
- function Ui(e, t) {
8362
+ function Wi(e, t) {
8358
8363
  let n = G(e), r = G(t);
8359
8364
  return n !== U.Never || r !== U.Never;
8360
8365
  }
8361
8366
  //#endregion
8362
8367
  //#region src/json-schema-subset/checker/string.ts
8363
- var Wi = ni(0);
8364
- function Gi(e, t) {
8365
- let n = ri(Wi(e.minLength, e.maxLength, t.minLength, t.maxLength)), r = !!e.pattern, i = !!t.pattern;
8368
+ var Gi = ri(0);
8369
+ function Ki(e, t) {
8370
+ let n = ii(Gi(e.minLength, e.maxLength, t.minLength, t.maxLength)), r = !!e.pattern, i = !!t.pattern;
8366
8371
  switch (n) {
8367
- case A.Rejection: return P;
8368
- case A.Containing: return r ? I : M;
8369
- case A.ContainedBy: return i ? I : N;
8370
- case A.Equals: return r && i ? e.pattern === t.pattern ? j : I : r ? j | N : i ? j | M : j;
8371
- case A.Intersection: return r && i ? I : r ? F | P | N : i ? F | P | M : F;
8372
+ case j.Rejection: return F;
8373
+ case j.Containing: return r ? Sn : N;
8374
+ case j.ContainedBy: return i ? Sn : P;
8375
+ case j.Equals: return r && i ? e.pattern === t.pattern ? M : Sn : r ? M | P : i ? M | N : M;
8376
+ case j.Intersection: return r && i ? Sn : r ? I | F | P : i ? I | F | N : I;
8372
8377
  }
8373
8378
  }
8374
8379
  //#endregion
8375
8380
  //#region src/json-schema-subset/checker/checker.ts
8376
- function Ki(e, t, n) {
8377
- let r = {}, i = [], a = li(Ji(e, r)), o = qi(), s = hi(e);
8378
- r.isEquals = ci(bn), r.calculate = zn({
8381
+ function qi(e, t, n) {
8382
+ let r = {}, i = [], a = ui(Yi(e, r)), o = Ji(), s = gi(e);
8383
+ r.isEquals = li(bn), r.calculate = Bn({
8379
8384
  describe: o,
8380
8385
  equals: s,
8381
8386
  calculate: a,
8382
8387
  observeCalculation: (e, t, n, r) => {
8383
- if (!Xi(r ? jn(n) : n)) return;
8384
- let a = r ? Zi(t, e) : Zi(e, t);
8388
+ if (!Zi(r ? Mn(n) : n)) return;
8389
+ let a = r ? Qi(t, e) : Qi(e, t);
8385
8390
  a && i.push(a);
8386
8391
  }
8387
8392
  }), Object.freeze(r);
@@ -8391,7 +8396,7 @@ function Ki(e, t, n) {
8391
8396
  expression: c
8392
8397
  };
8393
8398
  }
8394
- var qi = () => (e) => {
8399
+ var Ji = () => (e) => {
8395
8400
  let t;
8396
8401
  switch (G(e)) {
8397
8402
  case U.Not:
@@ -8403,54 +8408,54 @@ var qi = () => (e) => {
8403
8408
  case U.Combination:
8404
8409
  if ("allOf" in e) t = {
8405
8410
  kind: R.AllOf,
8406
- expressions: Yi(e.allOf, U.Any)
8411
+ expressions: Xi(e.allOf, U.Any)
8407
8412
  };
8408
8413
  else if ("anyOf" in e) t = {
8409
8414
  kind: R.AnyOf,
8410
- expressions: Yi(e.anyOf, U.Never)
8415
+ expressions: Xi(e.anyOf, U.Never)
8411
8416
  };
8412
8417
  else if ("oneOf" in e) t = {
8413
8418
  kind: R.OneOf,
8414
- expressions: Yi(e.oneOf, U.Never)
8419
+ expressions: Xi(e.oneOf, U.Never)
8415
8420
  };
8416
8421
  else throw Error(`invalid combination JSON Schema: ${JSON.stringify(e)}`);
8417
8422
  break;
8418
8423
  default: t = { kind: R.Leaf };
8419
8424
  }
8420
8425
  return t;
8421
- }, Ji = (e, t) => (n, r) => {
8426
+ }, Yi = (e, t) => (n, r) => {
8422
8427
  let i = G(n), a = G(r);
8423
8428
  if (i === U.Extends || a === U.Extends) return e.calculate(n, r);
8424
8429
  switch (i) {
8425
- case U.Any: return a === U.Any ? j : M;
8426
- case U.Never: return a === U.Never ? j : N;
8430
+ case U.Any: return a === U.Any ? M : N;
8431
+ case U.Never: return a === U.Never ? M : P;
8427
8432
  }
8428
8433
  switch (a) {
8429
- case U.Any: return N;
8430
- case U.Never: return M;
8434
+ case U.Any: return P;
8435
+ case U.Never: return N;
8431
8436
  }
8432
- if (i === U.EnumOrConst && a === U.EnumOrConst) return di(t, n, r);
8433
- if (i === U.EnumOrConst) return fi(n, r);
8434
- if (a === U.EnumOrConst) return jn(fi(r, n));
8435
- if (i !== a) return P;
8437
+ if (i === U.EnumOrConst && a === U.EnumOrConst) return fi(t, n, r);
8438
+ if (i === U.EnumOrConst) return pi(n, r);
8439
+ if (a === U.EnumOrConst) return Mn(pi(r, n));
8440
+ if (i !== a) return F;
8436
8441
  switch (i) {
8437
- case U.Null: return j;
8438
- case U.Numeric: return ki(n, r);
8439
- case U.String: return Gi(n, r);
8440
- case U.Boolean: return j;
8441
- case U.Object: return Pi(t, n, r);
8442
- case U.Array: return oi(t, n, r);
8442
+ case U.Null: return M;
8443
+ case U.Numeric: return Ai(n, r);
8444
+ case U.String: return Ki(n, r);
8445
+ case U.Boolean: return M;
8446
+ case U.Object: return Fi(t, n, r);
8447
+ case U.Array: return si(t, n, r);
8443
8448
  default: throw Error(`invalid kind ${i}`);
8444
8449
  }
8445
8450
  };
8446
- function Yi(e, t) {
8451
+ function Xi(e, t) {
8447
8452
  return e.filter((e) => G(e) !== t);
8448
8453
  }
8449
- function Xi(e) {
8450
- return !Sn(e) && !wn(e) && (Cn(e) || En(e) || Tn(e));
8454
+ function Zi(e) {
8455
+ return !Cn(e) && !Tn(e) && (wn(e) || Dn(e) || En(e));
8451
8456
  }
8452
- function Zi(e, t) {
8453
- let n = ir(t);
8457
+ function Qi(e, t) {
8458
+ let n = ar(t);
8454
8459
  if (!n) return;
8455
8460
  let r = G(e), i = G(t);
8456
8461
  if (r !== i) return [...n, "type"];
@@ -8483,7 +8488,7 @@ function Zi(e, t) {
8483
8488
  }
8484
8489
  //#endregion
8485
8490
  //#region src/json-schema-subset/extends/extendsContext.ts
8486
- var Qi = class e {
8491
+ var $i = class e {
8487
8492
  constructor(e = []) {
8488
8493
  this.extendsSchemaClasses = Object.freeze([...e]);
8489
8494
  }
@@ -8498,7 +8503,7 @@ var Qi = class e {
8498
8503
  calculate(t, n) {
8499
8504
  let r = !(t instanceof this.findMatchedClass(t, n)), i = 0, a;
8500
8505
  a = r ? n.compare(t) : t.compare(n);
8501
- for (let t of a) r && (t = e.swap(t)), i |= Dn(t);
8506
+ for (let t of a) r && (t = e.swap(t)), i |= On(t);
8502
8507
  return i;
8503
8508
  }
8504
8509
  equals(e, t) {
@@ -8510,43 +8515,43 @@ var Qi = class e {
8510
8515
  }
8511
8516
  static swap(e) {
8512
8517
  switch (e) {
8513
- case A.Containing: return A.ContainedBy;
8514
- case A.ContainedBy: return A.Containing;
8518
+ case j.Containing: return j.ContainedBy;
8519
+ case j.ContainedBy: return j.Containing;
8515
8520
  default: return e;
8516
8521
  }
8517
8522
  }
8518
8523
  };
8519
8524
  //#endregion
8520
8525
  //#region src/json-schema-subset/preprocessing.ts
8521
- function $i(e, t, n = !1) {
8526
+ function ea(e, t, n = !1) {
8522
8527
  let r = t(e);
8523
8528
  if (Array.isArray(r)) {
8524
8529
  let e = [];
8525
- throw ta(e, r, "$"), new Bn(e);
8530
+ throw na(e, r, "$"), new Vn(e);
8526
8531
  }
8527
8532
  let { schema: i, warns: a } = r;
8528
8533
  if (n && a.length > 0) {
8529
8534
  console.warn(`found ${a.length} warns after compile schema`);
8530
- for (let e of a) console.warn(Hn(e));
8535
+ for (let e of a) console.warn(Un(e));
8531
8536
  }
8532
8537
  return i;
8533
8538
  }
8534
- function ea(e, t, n, r = !1) {
8539
+ function ta(e, t, n, r = !1) {
8535
8540
  let i = n(e), a = n(t);
8536
8541
  if (Array.isArray(i) || Array.isArray(a)) {
8537
8542
  let e = [];
8538
- throw Array.isArray(i) && ta(e, i, "$1"), Array.isArray(a) && ta(e, a, "$2"), new Bn(e);
8543
+ throw Array.isArray(i) && na(e, i, "$1"), Array.isArray(a) && na(e, a, "$2"), new Vn(e);
8539
8544
  }
8540
8545
  let { schema: o, warns: s } = i, { schema: c, warns: l } = a;
8541
8546
  if (r) {
8542
8547
  s.length > 0 && console.warn(`found ${s.length} warns after compile superSchema`);
8543
- for (let e of s) console.warn(Hn(e));
8548
+ for (let e of s) console.warn(Un(e));
8544
8549
  l.length > 0 && console.warn(`found ${l.length} warns after compile subSchema`);
8545
- for (let e of l) console.warn(Hn(e));
8550
+ for (let e of l) console.warn(Un(e));
8546
8551
  }
8547
8552
  return [o, c];
8548
8553
  }
8549
- function ta(e, t, n) {
8554
+ function na(e, t, n) {
8550
8555
  for (let r of t) {
8551
8556
  let t = {
8552
8557
  ...r,
@@ -8557,77 +8562,77 @@ function ta(e, t, n) {
8557
8562
  }
8558
8563
  //#endregion
8559
8564
  //#region src/json-schema-subset/global.ts
8560
- var na = Object.freeze({
8565
+ var ra = Object.freeze({
8561
8566
  True: 0,
8562
8567
  False: 1,
8563
8568
  Unknown: 2
8564
8569
  });
8565
- function ra({ extendsSchemaClasses: e, delegate: t } = {}) {
8566
- let n = new Qi(e);
8570
+ function ia({ extendsSchemaClasses: e, delegate: t } = {}) {
8571
+ let n = new $i(e);
8567
8572
  return Object.freeze({
8568
- compile: (e, r, i) => $i(e, (e) => Wr(e, n, r, t), i),
8573
+ compile: (e, r, i) => ea(e, (e) => Gr(e, n, r, t), i),
8569
8574
  isSubset: (e, r, i = !1) => {
8570
- let [a, o] = ea(e, r, (e) => Wr(e, n, void 0, t), i), { errorPath: s, expression: c } = Ki(n, a, o), l = Sn(c) || wn(c), u = Cn(c) || En(c) || Tn(c);
8571
- return l && !u ? { result: na.True } : !l && u ? {
8575
+ let [a, o] = ta(e, r, (e) => Gr(e, n, void 0, t), i), { errorPath: s, expression: c } = qi(n, a, o), l = Cn(c) || Tn(c), u = wn(c) || Dn(c) || En(c);
8576
+ return l && !u ? { result: ra.True } : !l && u ? {
8572
8577
  errorPath: s,
8573
- result: na.False
8574
- } : { result: na.Unknown };
8578
+ result: ra.False
8579
+ } : { result: ra.Unknown };
8575
8580
  }
8576
8581
  });
8577
8582
  }
8578
8583
  //#endregion
8579
8584
  //#region src/manifest/common/schemaComparer.ts
8580
- function ia(e) {
8581
- return _(e)?.type === "string";
8582
- }
8583
8585
  function aa(e) {
8584
- return e instanceof da || _(e)?.type === "array";
8586
+ return _(e)?.type === "string";
8585
8587
  }
8586
8588
  function oa(e) {
8589
+ return e instanceof fa || _(e)?.type === "array";
8590
+ }
8591
+ function sa(e) {
8587
8592
  let t = _(e);
8588
8593
  return t?.type === "array" && _(t.items)?.type === "string";
8589
8594
  }
8590
- function sa(e) {
8595
+ function ca(e) {
8591
8596
  let t = _(e);
8592
8597
  return t != null && Object.keys(t).length === 0;
8593
8598
  }
8594
- function ca(e) {
8599
+ function la(e) {
8595
8600
  let t = _(e), n = _(t?.error);
8596
- if (t == null || n == null || t.packageId != null && !g(t.packageId) || n.message != null && !g(n.message)) throw TypeError("Invalid schema comparison context.");
8601
+ if (t == null || n == null || t.packageId != null && !le(t.packageId) || n.message != null && !le(n.message)) throw TypeError("Invalid schema comparison context.");
8597
8602
  }
8598
- function la(e) {
8599
- return e == null ? { error: {} } : (ca(e), e);
8603
+ function ua(e) {
8604
+ return e == null ? { error: {} } : (la(e), e);
8600
8605
  }
8601
8606
  var Z = class e {
8602
8607
  static setError(t, n, r) {
8603
8608
  t instanceof e ? t.context.error.message = r : n instanceof e && (n.context.error.message = r);
8604
8609
  }
8605
8610
  constructor(e, t, n) {
8606
- this.id = e, this.value = t, this.context = la(n);
8611
+ this.id = e, this.value = t, this.context = ua(n);
8607
8612
  }
8608
8613
  compare(e) {
8609
8614
  return this.passThrough(e) || this.compareImpl(e);
8610
8615
  }
8611
8616
  passThrough(e) {
8612
- if (e instanceof pa) return [A.Equals];
8617
+ if (e instanceof ma) return [j.Equals];
8613
8618
  }
8614
- }, ua = class e extends Z {
8619
+ }, da = class e extends Z {
8615
8620
  static isMatch(e) {
8616
8621
  let t = _(e)?.enum;
8617
- return Array.isArray(t) && t.every((e) => g(e));
8622
+ return Array.isArray(t) && t.every((e) => le(e));
8618
8623
  }
8619
8624
  constructor(t, n, r) {
8620
8625
  if (!e.isMatch(n)) throw TypeError("Invalid single-select schema.");
8621
8626
  super(t, n, r);
8622
8627
  }
8623
8628
  compareImpl(t) {
8624
- if (ia(t)) return [A.ContainedBy];
8629
+ if (aa(t)) return [j.ContainedBy];
8625
8630
  if (t instanceof e) {
8626
- let e = new Set(this.value.enum), n = A.Equals;
8627
- for (let r of t.value.enum) e.has(r) || (n = A.ContainedBy), e.delete(r);
8628
- return e.size === 0 ? [n] : e.size === this.value.enum.length ? [A.Rejection] : [A.Intersection];
8631
+ let e = new Set(this.value.enum), n = j.Equals;
8632
+ for (let r of t.value.enum) e.has(r) || (n = j.ContainedBy), e.delete(r);
8633
+ return e.size === 0 ? [n] : e.size === this.value.enum.length ? [j.Rejection] : [j.Intersection];
8629
8634
  }
8630
- return [A.Rejection];
8635
+ return [j.Rejection];
8631
8636
  }
8632
8637
  equals(t) {
8633
8638
  if (t instanceof e) {
@@ -8640,23 +8645,23 @@ var Z = class e {
8640
8645
  }
8641
8646
  return !1;
8642
8647
  }
8643
- }, da = class e extends Z {
8648
+ }, fa = class e extends Z {
8644
8649
  static isMatch(e) {
8645
8650
  let t = _(e), n = _(t?.items)?.enum;
8646
- return t?.type === "array" && t.uniqueItems === !0 && Array.isArray(n) && n.every((e) => g(e));
8651
+ return t?.type === "array" && t.uniqueItems === !0 && Array.isArray(n) && n.every((e) => le(e));
8647
8652
  }
8648
8653
  constructor(t, n, r) {
8649
8654
  if (!e.isMatch(n)) throw TypeError("Invalid multi-select schema.");
8650
8655
  super(t, n, r);
8651
8656
  }
8652
8657
  compareImpl(t) {
8653
- if (t instanceof fa || oa(t)) return [A.ContainedBy];
8658
+ if (t instanceof pa || sa(t)) return [j.ContainedBy];
8654
8659
  if (t instanceof e) {
8655
- let e = new Set(this.value.items.enum), n = A.Equals;
8656
- for (let r of t.value.items.enum) e.has(r) || (n = A.ContainedBy), e.delete(r);
8657
- return e.size === 0 ? [n] : e.size === this.value.items.enum.length ? [A.Rejection] : [A.Intersection];
8660
+ let e = new Set(this.value.items.enum), n = j.Equals;
8661
+ for (let r of t.value.items.enum) e.has(r) || (n = j.ContainedBy), e.delete(r);
8662
+ return e.size === 0 ? [n] : e.size === this.value.items.enum.length ? [j.Rejection] : [j.Intersection];
8658
8663
  }
8659
- return [A.Rejection];
8664
+ return [j.Rejection];
8660
8665
  }
8661
8666
  equals(t) {
8662
8667
  if (t instanceof e) {
@@ -8669,36 +8674,36 @@ var Z = class e {
8669
8674
  }
8670
8675
  return !1;
8671
8676
  }
8672
- }, fa = class e extends Z {
8677
+ }, pa = class e extends Z {
8673
8678
  static isMatch(e) {
8674
8679
  let t = _(e);
8675
- return t?.type === "array" && !t.uniqueItems && (!le(t.items) || sa(t.items));
8680
+ return t?.type === "array" && !t.uniqueItems && (!ue(t.items) || ca(t.items));
8676
8681
  }
8677
8682
  constructor(t, n, r) {
8678
8683
  if (!e.isMatch(n)) throw TypeError("Invalid array schema.");
8679
8684
  super(t, n, r);
8680
8685
  }
8681
8686
  compareImpl(t) {
8682
- return t instanceof e || aa(t) ? [A.Equals] : [A.Rejection];
8687
+ return t instanceof e || oa(t) ? [j.Equals] : [j.Rejection];
8683
8688
  }
8684
8689
  equals(t) {
8685
8690
  return t instanceof e;
8686
8691
  }
8687
- }, pa = class e extends Z {
8692
+ }, ma = class e extends Z {
8688
8693
  static isMatch(e) {
8689
- return sa(e);
8694
+ return ca(e);
8690
8695
  }
8691
8696
  constructor(t, n, r) {
8692
8697
  if (!e.isMatch(n)) throw TypeError("Invalid empty schema.");
8693
8698
  super(t, n, r);
8694
8699
  }
8695
8700
  compareImpl(e) {
8696
- return [A.Equals];
8701
+ return [j.Equals];
8697
8702
  }
8698
8703
  equals(e) {
8699
8704
  return !0;
8700
8705
  }
8701
- }, ma = class e extends Z {
8706
+ }, ha = class e extends Z {
8702
8707
  static isMatch(e) {
8703
8708
  return _(e)?.contentMediaType === "oomol/bin";
8704
8709
  }
@@ -8707,12 +8712,12 @@ var Z = class e {
8707
8712
  super(t, n, r);
8708
8713
  }
8709
8714
  compareImpl(t) {
8710
- return t instanceof e ? [A.Equals] : (Z.setError(this, t, "edgeError.binDiffType"), [A.Rejection]);
8715
+ return t instanceof e ? [j.Equals] : (Z.setError(this, t, "edgeError.binDiffType"), [j.Rejection]);
8711
8716
  }
8712
8717
  equals(t) {
8713
8718
  return t instanceof e;
8714
8719
  }
8715
- }, ha = class e extends Z {
8720
+ }, ga = class e extends Z {
8716
8721
  static isMatch(e) {
8717
8722
  return _(e)?.contentMediaType === "oomol/artifact";
8718
8723
  }
@@ -8721,38 +8726,38 @@ var Z = class e {
8721
8726
  super(t, n, r);
8722
8727
  }
8723
8728
  compareImpl(t) {
8724
- return t instanceof e ? [A.Equals] : (Z.setError(this, t, "edgeError.artifactDiffType"), [A.Rejection]);
8729
+ return t instanceof e ? [j.Equals] : (Z.setError(this, t, "edgeError.artifactDiffType"), [j.Rejection]);
8725
8730
  }
8726
8731
  equals(t) {
8727
8732
  return t instanceof e;
8728
8733
  }
8729
8734
  };
8730
- function ga() {
8731
- return ra({ extendsSchemaClasses: [
8732
- fa,
8735
+ function _a() {
8736
+ return ia({ extendsSchemaClasses: [
8733
8737
  pa,
8734
- ua,
8735
- da,
8736
8738
  ma,
8737
- ha
8739
+ da,
8740
+ fa,
8741
+ ha,
8742
+ ga
8738
8743
  ] });
8739
8744
  }
8740
8745
  //#endregion
8741
8746
  //#region src/manifest/common/schemaCompare.ts
8742
- var _a = ga();
8743
- function va(e, t) {
8747
+ var va = _a();
8748
+ function ya(e, t) {
8744
8749
  return t ? { anyOf: [e, { type: "null" }] } : e;
8745
8750
  }
8746
- function ya(e, t) {
8751
+ function ba(e, t) {
8747
8752
  try {
8748
- let n = {}, r = _a.compile(va(ba(e.schema), e.nullable), {
8753
+ let n = {}, r = va.compile(ya(xa(e.schema), e.nullable), {
8749
8754
  ...e,
8750
8755
  error: n
8751
- }), i = _a.compile(va(ba(t.schema), t.nullable), {
8756
+ }), i = va.compile(ya(xa(t.schema), t.nullable), {
8752
8757
  ...t,
8753
8758
  error: n
8754
- }), { result: a, errorPath: o } = _a.isSubset(r, i);
8755
- return a == na.True ? { kind: "compatible" } : {
8759
+ }), { result: a, errorPath: o } = va.isSubset(r, i);
8760
+ return a == ra.True ? { kind: "compatible" } : {
8756
8761
  kind: "incompatible",
8757
8762
  error: n.message,
8758
8763
  errorPath: o
@@ -8764,7 +8769,7 @@ function ya(e, t) {
8764
8769
  };
8765
8770
  }
8766
8771
  }
8767
- function ba(e) {
8772
+ function xa(e) {
8768
8773
  function t(t) {
8769
8774
  if (!t.startsWith("#")) return;
8770
8775
  let n = decodeURIComponent(t.slice(1));
@@ -8817,7 +8822,7 @@ function ba(e) {
8817
8822
  }
8818
8823
  //#endregion
8819
8824
  //#region src/flow/common/schema.ts
8820
- function xa(e) {
8825
+ function Sa(e) {
8821
8826
  return e.kind == "poll" || e.kind == "integration" ? e.definition.payloadSchema : e.kind == "cron" || e.kind == "manual" ? {
8822
8827
  additionalProperties: !1,
8823
8828
  type: "object"
@@ -8828,24 +8833,24 @@ function xa(e) {
8828
8833
  type: "object"
8829
8834
  };
8830
8835
  }
8831
- function Sa(e, t) {
8836
+ function Ca(e, t) {
8832
8837
  if (e === t) return !0;
8833
8838
  if (e == null || t == null || typeof e != "object" || typeof t != "object") return !1;
8834
- if (Array.isArray(e) || Array.isArray(t)) return Array.isArray(e) && Array.isArray(t) && e.length == t.length && e.every((e, n) => Sa(e, t[n]));
8839
+ if (Array.isArray(e) || Array.isArray(t)) return Array.isArray(e) && Array.isArray(t) && e.length == t.length && e.every((e, n) => Ca(e, t[n]));
8835
8840
  let n = Object.entries(e), r = t;
8836
- return n.length == Object.keys(r).length && n.every(([e, t]) => Object.hasOwn(r, e) && Sa(t, r[e]));
8841
+ return n.length == Object.keys(r).length && n.every(([e, t]) => Object.hasOwn(r, e) && Ca(t, r[e]));
8837
8842
  }
8838
- function Ca(e) {
8843
+ function wa(e) {
8839
8844
  return typeof e == "object" && e && !Array.isArray(e) ? e : void 0;
8840
8845
  }
8841
- function wa(e) {
8846
+ function Ta(e) {
8842
8847
  return Array.isArray(e) ? e : void 0;
8843
8848
  }
8844
- function Ta(e, t, n = !1, r = !1) {
8845
- if (t === !0 || Sa(t, {})) return !0;
8846
- if (e === !0 || Sa(e, {}) || e === !1 || t === !1) return !1;
8847
- let i = Ca(e), a = Ca(t);
8848
- return i == null || a == null ? !1 : ya({
8849
+ function Ea(e, t, n = !1, r = !1) {
8850
+ if (t === !0 || Ca(t, {})) return !0;
8851
+ if (e === !0 || Ca(e, {}) || e === !1 || t === !1) return !1;
8852
+ let i = wa(e), a = wa(t);
8853
+ return i == null || a == null ? !1 : ba({
8849
8854
  nullable: n,
8850
8855
  packageId: void 0,
8851
8856
  schema: i
@@ -8855,24 +8860,24 @@ function Ta(e, t, n = !1, r = !1) {
8855
8860
  schema: a
8856
8861
  }).kind == "compatible";
8857
8862
  }
8858
- function Ea(e, t) {
8859
- return Ta(e.jsonSchema, t.jsonSchema, e.nullable, t.nullable);
8863
+ function Da(e, t) {
8864
+ return Ea(e.jsonSchema, t.jsonSchema, e.nullable, t.nullable);
8860
8865
  }
8861
- function Da(e) {
8862
- let t = Ca(e), n = wa(t?.type);
8863
- return t != null && n?.includes("string") ? Ta({ type: "string" }, {
8866
+ function Oa(e) {
8867
+ let t = wa(e), n = Ta(t?.type);
8868
+ return t != null && n?.includes("string") ? Ea({ type: "string" }, {
8864
8869
  ...t,
8865
8870
  type: "string"
8866
- }) : Ta({ type: "string" }, e);
8871
+ }) : Ea({ type: "string" }, e);
8867
8872
  }
8868
8873
  //#endregion
8869
8874
  //#region src/flow/common/graph.ts
8870
- function Oa(e, t) {
8875
+ function ka(e, t) {
8871
8876
  switch (t.kind) {
8872
8877
  case "condition": return { [t.input.handle]: t.input };
8873
8878
  case "value": return {};
8874
- case "subflow": return f(e.subflows[t.subflowId]?.inputs ?? []);
8875
- case "task": return f([...t.task == null ? e.tasks[t.taskId]?.inputs ?? [] : t.task.inputs, ...t.additionalInputs ?? []]);
8879
+ case "subflow": return p(e.subflows[t.subflowId]?.inputs ?? []);
8880
+ case "task": return p([...t.task == null ? e.tasks[t.taskId]?.inputs ?? [] : t.task.inputs, ...t.additionalInputs ?? []]);
8876
8881
  case "wait": return { [t.input.handle]: t.input };
8877
8882
  case "cron":
8878
8883
  case "integration":
@@ -8881,27 +8886,27 @@ function Oa(e, t) {
8881
8886
  case "webhook": return {};
8882
8887
  }
8883
8888
  }
8884
- function ka(e, t) {
8889
+ function Aa(e, t) {
8885
8890
  switch (t.kind) {
8886
8891
  case "condition": {
8887
8892
  let e = [...t.cases.map((e) => e.output), ...t.defaultOutput == null ? [] : [t.defaultOutput]];
8888
8893
  return Object.fromEntries(e.map((e) => [e, t.input]));
8889
8894
  }
8890
- case "value": return f(t.values);
8891
- case "subflow": return f(e.subflows[t.subflowId]?.outputs ?? []);
8892
- case "task": return f(t.task == null ? e.tasks[t.taskId]?.outputs ?? [] : t.task.outputs);
8895
+ case "value": return p(t.values);
8896
+ case "subflow": return p(e.subflows[t.subflowId]?.outputs ?? []);
8897
+ case "task": return p(t.task == null ? e.tasks[t.taskId]?.outputs ?? [] : t.task.outputs);
8893
8898
  case "wait": return Object.fromEntries(t.actions.map((e) => [e, t.input]));
8894
8899
  case "cron":
8895
8900
  case "integration":
8896
8901
  case "poll":
8897
8902
  case "manual":
8898
8903
  case "webhook": return { payload: {
8899
- jsonSchema: xa(t),
8904
+ jsonSchema: Sa(t),
8900
8905
  nullable: !1
8901
8906
  } };
8902
8907
  }
8903
8908
  }
8904
- function Aa(e) {
8909
+ function ja(e) {
8905
8910
  let t = new Map(Object.keys(e.nodes).map((e) => [e, /* @__PURE__ */ new Set()])), n = /* @__PURE__ */ new Map();
8906
8911
  for (let r of e.edges) {
8907
8912
  if (!t.has(r.source) || !t.has(r.target)) continue;
@@ -8920,16 +8925,16 @@ function Aa(e) {
8920
8925
  }
8921
8926
  return r;
8922
8927
  }
8923
- var ja = /* @__PURE__ */ new WeakMap();
8924
- function Ma(e) {
8925
- let t = ja.get(e);
8928
+ var Ma = /* @__PURE__ */ new WeakMap();
8929
+ function Na(e) {
8930
+ let t = Ma.get(e);
8926
8931
  if (t != null) return t;
8927
8932
  let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
8928
8933
  for (let t of e.edges) {
8929
8934
  let e = i.get(t.target) ?? [];
8930
8935
  e.push(t), i.set(t.target, e);
8931
8936
  }
8932
- for (let t of Aa(e)) {
8937
+ for (let t of ja(e)) {
8933
8938
  let a = e.nodes[t], o = i.get(t) ?? [], s = /* @__PURE__ */ new Set(), c = [];
8934
8939
  for (let e of o) {
8935
8940
  s.add(e.source);
@@ -8951,9 +8956,9 @@ function Ma(e) {
8951
8956
  ancestors: r,
8952
8957
  paths: n
8953
8958
  };
8954
- return ja.set(e, a), a;
8959
+ return Ma.set(e, a), a;
8955
8960
  }
8956
- function Na(e, t, n) {
8961
+ function Pa(e, t, n) {
8957
8962
  if (n.kind != "node") return [{}];
8958
8963
  let r = e.nodes[n.nodeId], i = t.get(n.nodeId) ?? [];
8959
8964
  return r?.kind == "condition" || r?.kind == "wait" ? i.map((e) => ({
@@ -8961,23 +8966,23 @@ function Na(e, t, n) {
8961
8966
  [n.nodeId]: n.output
8962
8967
  })) : i;
8963
8968
  }
8964
- function Pa(e, t, n) {
8969
+ function Fa(e, t, n) {
8965
8970
  let r = e.filter((e) => Object.entries(e).every(([e, n]) => t[e] == null || t[e] == n));
8966
8971
  if (r.some((e) => Object.entries(e).every(([e, n]) => t[e] == n))) return !0;
8967
8972
  let i = r.flatMap((e) => Object.keys(e)).find((e) => t[e] == null);
8968
8973
  if (i == null) return !1;
8969
8974
  let a = n.nodes[i];
8970
- return (a?.kind == "condition" ? [...a.cases.map((e) => e.output), a.defaultOutput ?? ""] : a?.kind == "wait" ? a.actions : ["", ...Object.keys(n.nodes).filter((e) => !("inputs" in n.nodes[e]))]).every((e) => Pa(r, {
8975
+ return (a?.kind == "condition" ? [...a.cases.map((e) => e.output), a.defaultOutput ?? ""] : a?.kind == "wait" ? a.actions : ["", ...Object.keys(n.nodes).filter((e) => !("inputs" in n.nodes[e]))]).every((e) => Fa(r, {
8971
8976
  ...t,
8972
8977
  [i]: e
8973
8978
  }, n));
8974
8979
  }
8975
- function Fa(e, t, n, r) {
8980
+ function Ia(e, t, n, r) {
8976
8981
  if (n.kind == "value") return !0;
8977
8982
  let { ancestors: i, paths: a } = r;
8978
8983
  if (n.sources.length == 0 || t != null && n.sources.some((e) => e.kind == "node" && !i.get(t)?.has(e.nodeId))) return !1;
8979
- let o = n.sources.map((t) => Na(e, a, t)), s = t == null ? [{}] : a.get(t) ?? [];
8980
- return s.every((t) => Pa(o.flat(), t, e)) ? o.every((e, t) => o.slice(t + 1).every((t) => e.every((e) => t.every((t) => s.every((n) => {
8984
+ let o = n.sources.map((t) => Pa(e, a, t)), s = t == null ? [{}] : a.get(t) ?? [];
8985
+ return s.every((t) => Fa(o.flat(), t, e)) ? o.every((e, t) => o.slice(t + 1).every((t) => e.every((e) => t.every((t) => s.every((n) => {
8981
8986
  let r = {
8982
8987
  ...n,
8983
8988
  ...e
@@ -8985,29 +8990,29 @@ function Fa(e, t, n, r) {
8985
8990
  return Object.entries(e).some(([e, t]) => n[e] != null && n[e] != t) || Object.entries(t).some(([e, t]) => r[e] != null && r[e] != t);
8986
8991
  }))))) : !1;
8987
8992
  }
8988
- function Ia(e, t, n, r) {
8989
- let i = Ma(t);
8993
+ function La(e, t, n, r) {
8994
+ let i = Na(t);
8990
8995
  return Object.fromEntries([...i.ancestors.get(n) ?? []].flatMap((a) => {
8991
8996
  let o = t.nodes[a];
8992
8997
  if (o == null) return [];
8993
- let s = Object.keys(ka(e, o)).filter((s) => Fa(t, n, {
8998
+ let s = Object.keys(Aa(e, o)).filter((s) => Ia(t, n, {
8994
8999
  kind: "sources",
8995
9000
  sources: [{
8996
9001
  kind: "node",
8997
9002
  nodeId: a,
8998
9003
  output: s
8999
9004
  }]
9000
- }, i) && (r == null || Ea(ka(e, o)[s], Oa(e, t.nodes[n])[r])));
9005
+ }, i) && (r == null || Da(Aa(e, o)[s], ka(e, t.nodes[n])[r])));
9001
9006
  return s.length == 0 ? [] : [[a, s]];
9002
9007
  }));
9003
9008
  }
9004
- `${JSON.stringify("open-flow-engine/v2")}`, new TextEncoder();
9009
+ `${JSON.stringify("open-flow-engine/v2")}`;
9005
9010
  //#endregion
9006
9011
  //#region src/flow/common/semantics.ts
9007
- function La(e) {
9012
+ function Ra(e) {
9008
9013
  return Object.keys(e).toSorted().map((t) => [t, e[t]]);
9009
9014
  }
9010
- function Ra(e) {
9015
+ function za(e) {
9011
9016
  let t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set();
9012
9017
  function o(e) {
9013
9018
  t.add(e);
@@ -9022,7 +9027,7 @@ function Ra(e) {
9022
9027
  for (let t of Object.values(e)) if (t.kind == "sources") for (let e of t.sources) e.kind == "binding" && (n.add(e.bindingId), o(e.bindingId));
9023
9028
  }
9024
9029
  function l(e) {
9025
- for (let [, t] of La(e.nodes)) switch ("inputs" in t && c(t.inputs), t.kind) {
9030
+ for (let [, t] of Ra(e.nodes)) switch ("inputs" in t && c(t.inputs), t.kind) {
9026
9031
  case "condition": break;
9027
9032
  case "subflow":
9028
9033
  u(t.subflowId);
@@ -9052,12 +9057,12 @@ function Ra(e) {
9052
9057
  tasks: a
9053
9058
  };
9054
9059
  }
9055
- function za(e) {
9060
+ function Ba(e) {
9056
9061
  return [e.graph, ...Object.values(e.subflows).map((e) => e.graph)].flatMap((e) => Object.values(e.nodes).flatMap((e) => e.kind == "task" && e.task != null ? e.task.capabilities ?? [] : []));
9057
9062
  }
9058
9063
  //#endregion
9059
9064
  //#region src/workbench/browser/runtime/revisionView.ts
9060
- var Ba = /* @__PURE__ */ new WeakMap(), Va = class {
9065
+ var Va = /* @__PURE__ */ new WeakMap(), Ha = class {
9061
9066
  #e;
9062
9067
  #t;
9063
9068
  #n = /* @__PURE__ */ new WeakMap();
@@ -9066,7 +9071,7 @@ var Ba = /* @__PURE__ */ new WeakMap(), Va = class {
9066
9071
  this.revision = e, this.#e = e.content.document, this.#t = e.content.modules;
9067
9072
  let t = /* @__PURE__ */ new Set();
9068
9073
  for (let e of Object.values(this.#e.tasks)) e.executor.kind == "connector" && t.add(e.executor.action);
9069
- for (let e of za(this.#e)) t.add(e.action);
9074
+ for (let e of Ba(this.#e)) t.add(e.action);
9070
9075
  this.connectorActionIds = t;
9071
9076
  }
9072
9077
  subflow(e) {
@@ -9080,9 +9085,9 @@ var Ba = /* @__PURE__ */ new WeakMap(), Va = class {
9080
9085
  }
9081
9086
  inputSources(e, t) {
9082
9087
  let n = this.graph(e);
9083
- return Object.keys(Oa(this.#e, n.nodes[t])).map((e) => ({
9088
+ return Object.keys(ka(this.#e, n.nodes[t])).map((e) => ({
9084
9089
  handle: e,
9085
- outputs: Ia(this.#e, n, t, e)
9090
+ outputs: La(this.#e, n, t, e)
9086
9091
  }));
9087
9092
  }
9088
9093
  designerInputs(e) {
@@ -9203,13 +9208,13 @@ var Ba = /* @__PURE__ */ new WeakMap(), Va = class {
9203
9208
  return !1;
9204
9209
  }
9205
9210
  };
9206
- function Ha(e) {
9207
- let t = Ba.get(e);
9208
- return t ?? (t = new Va(e), Ba.set(e, t)), t;
9211
+ function Ua(e) {
9212
+ let t = Va.get(e);
9213
+ return t ?? (t = new Ha(e), Va.set(e, t)), t;
9209
9214
  }
9210
9215
  //#endregion
9211
9216
  //#region src/workbench/browser/runtime/runs/runStore.ts
9212
- var Ua = {
9217
+ var Wa = {
9213
9218
  eventCursor: 0,
9214
9219
  eventFilter: "all",
9215
9220
  events: [],
@@ -9223,31 +9228,31 @@ var Ua = {
9223
9228
  refreshing: !1,
9224
9229
  runById: /* @__PURE__ */ new Map(),
9225
9230
  runIds: []
9226
- }, Wa = 100, Ga = 500, Ka = 1200, qa = 6e4;
9227
- function Ja(e) {
9231
+ }, Ga = 100, Ka = 500, qa = 1200, Ja = 6e4;
9232
+ function Ya(e) {
9228
9233
  return e?.status == "queued" || e?.status == "starting" || e?.status == "running" || e?.status == "waiting";
9229
9234
  }
9230
- function Ya(e) {
9235
+ function Xa(e) {
9231
9236
  return e.selectedRunId == null ? void 0 : e.runById.get(e.selectedRunId);
9232
9237
  }
9233
- function Xa(e, t) {
9234
- let n = new Map(t.map((e) => [e.runId, e])), r = t.map((e) => e.runId), i = Ya(e);
9238
+ function Za(e, t) {
9239
+ let n = new Map(t.map((e) => [e.runId, e])), r = t.map((e) => e.runId), i = Xa(e);
9235
9240
  return i != null && (n.has(i.runId) || r.unshift(i.runId), n.set(i.runId, i)), {
9236
9241
  runById: n,
9237
9242
  runIds: r
9238
9243
  };
9239
9244
  }
9240
- function Za(e, t) {
9245
+ function Qa(e, t) {
9241
9246
  return new Map(e.runById).set(t.runId, t);
9242
9247
  }
9243
- var Qa = class {
9248
+ var $a = class {
9244
9249
  #e = new pn();
9245
9250
  #t;
9246
9251
  #n;
9247
9252
  #r = new pn();
9248
9253
  #i = new pn();
9249
9254
  #a;
9250
- #o = t(Ua);
9255
+ #o = t(Wa);
9251
9256
  #s;
9252
9257
  constructor(t, r, i = pt()) {
9253
9258
  this.#t = t, this.#n = i, this.#a = r, this.$ = {
@@ -9266,7 +9271,7 @@ var Qa = class {
9266
9271
  refreshing: e(this.#o, (e) => e.refreshing),
9267
9272
  result: e(this.#o, (e) => e.result),
9268
9273
  resolvingAction: e(this.#o, (e) => e.resolvingAction),
9269
- run: e(this.#o, Ya),
9274
+ run: e(this.#o, Xa),
9270
9275
  runs: e(this.#o, (e) => e.runIds.flatMap((t) => {
9271
9276
  let n = e.runById.get(t);
9272
9277
  return n == null ? [] : [n];
@@ -9279,7 +9284,7 @@ var Qa = class {
9279
9284
  this.#o.dispose();
9280
9285
  }
9281
9286
  reset() {
9282
- this.#e.invalidate(), this.#r.invalidate(), this.#i.invalidate(), this.#f(), this.#o.set(Ua);
9287
+ this.#e.invalidate(), this.#r.invalidate(), this.#i.invalidate(), this.#f(), this.#o.set(Wa);
9283
9288
  }
9284
9289
  async load(e) {
9285
9290
  let t = this.#o.value, n = t.loaded && t.target?.flowId == e, r = this.#r.begin();
@@ -9294,20 +9299,20 @@ var Qa = class {
9294
9299
  let t = await this.#t.listRuns(e, { limit: 50 });
9295
9300
  if (!r() || this.#o.value.target?.flowId != e) return;
9296
9301
  this.#p({
9297
- ...Xa(this.#o.value, t.runs),
9302
+ ...Za(this.#o.value, t.runs),
9298
9303
  nextCursor: t.nextCursor,
9299
9304
  refreshing: !1
9300
9305
  });
9301
9306
  } catch (e) {
9302
9307
  if (!r()) return;
9303
- this.#p({ refreshing: !1 }), this.#a(k(e, this.#n.t));
9308
+ this.#p({ refreshing: !1 }), this.#a(A(e, this.#n.t));
9304
9309
  }
9305
9310
  return;
9306
9311
  }
9307
9312
  this.#i.invalidate(), this.#f(), this.#a(void 0);
9308
- let i = Ya(t)?.flowId == e ? t.cancelingRunId : void 0;
9313
+ let i = Xa(t)?.flowId == e ? t.cancelingRunId : void 0;
9309
9314
  t.cancelingRunId != null && i == null && this.#e.invalidate(), this.#o.set({
9310
- ...Ua,
9315
+ ...Wa,
9311
9316
  ...i == null ? {} : { cancelingRunId: i },
9312
9317
  eventFilter: t.eventFilter,
9313
9318
  loading: !0,
@@ -9317,7 +9322,7 @@ var Qa = class {
9317
9322
  let t = await this.#t.listRuns(e, { limit: 50 });
9318
9323
  if (!r()) return;
9319
9324
  this.#p({
9320
- ...Xa(this.#o.value, t.runs),
9325
+ ...Za(this.#o.value, t.runs),
9321
9326
  loaded: !0,
9322
9327
  loadFailed: !1,
9323
9328
  loading: !1,
@@ -9330,7 +9335,7 @@ var Qa = class {
9330
9335
  this.#p({
9331
9336
  loadFailed: !0,
9332
9337
  loading: !1
9333
- }), this.#a(k(e, this.#n.t));
9338
+ }), this.#a(A(e, this.#n.t));
9334
9339
  }
9335
9340
  }
9336
9341
  async loadMore() {
@@ -9361,7 +9366,7 @@ var Qa = class {
9361
9366
  this.#p({
9362
9367
  loadMoreFailed: !0,
9363
9368
  loadingMore: !1
9364
- }), this.#a(k(e, this.#n.t));
9369
+ }), this.#a(A(e, this.#n.t));
9365
9370
  }
9366
9371
  }
9367
9372
  changed(e) {
@@ -9377,7 +9382,7 @@ var Qa = class {
9377
9382
  e != null && await this.load(e.flowId);
9378
9383
  }
9379
9384
  retryObservation() {
9380
- let e = Ya(this.#o.value);
9385
+ let e = Xa(this.#o.value);
9381
9386
  if (e == null) return;
9382
9387
  let t = this.#i.begin();
9383
9388
  this.#f(), this.#p({ observationFailed: !1 }), this.#l(e, t);
@@ -9386,8 +9391,8 @@ var Qa = class {
9386
9391
  this.#p({ eventFilter: e });
9387
9392
  }
9388
9393
  async cancel() {
9389
- let e = Ya(this.#o.value);
9390
- if (!Ja(e) || this.#o.value.cancelingRunId != null || this.#o.value.resolvingAction != null) return;
9394
+ let e = Xa(this.#o.value);
9395
+ if (!Ya(e) || this.#o.value.cancelingRunId != null || this.#o.value.resolvingAction != null) return;
9391
9396
  let t = this.#e.begin();
9392
9397
  this.#a(void 0), this.#p({ cancelingRunId: e.runId });
9393
9398
  try {
@@ -9399,31 +9404,31 @@ var Qa = class {
9399
9404
  ...i,
9400
9405
  status: n.status
9401
9406
  };
9402
- if (this.#p({ runById: Za(r, a) }), r.selectedRunId != e.runId) return;
9407
+ if (this.#p({ runById: Qa(r, a) }), r.selectedRunId != e.runId) return;
9403
9408
  let o = this.#i.begin();
9404
9409
  this.#f(), await this.#l(a, o);
9405
9410
  } catch (e) {
9406
- t() && this.#a(k(e, this.#n.t));
9411
+ t() && this.#a(A(e, this.#n.t));
9407
9412
  } finally {
9408
9413
  t() && this.#o.value.cancelingRunId == e.runId && this.#p({ cancelingRunId: void 0 });
9409
9414
  }
9410
9415
  }
9411
9416
  async resolve(e) {
9412
- let t = Ya(this.#o.value), n = t?.status == "waiting" && "waiting" in t ? t.waiting : void 0;
9417
+ let t = Xa(this.#o.value), n = t?.status == "waiting" && "waiting" in t ? t.waiting : void 0;
9413
9418
  if (!(t == null || n == null || this.#o.value.cancelingRunId != null || this.#o.value.resolvingAction != null || !n.actions.some((t) => t == e))) {
9414
9419
  this.#a(void 0), this.#p({ resolvingAction: e });
9415
9420
  try {
9416
- let r = await this.#t.resolveRunWait(t.runId, n.waitId, e), i = this.#o.value, a = Ya(i);
9421
+ let r = await this.#t.resolveRunWait(t.runId, n.waitId, e), i = this.#o.value, a = Xa(i);
9417
9422
  if (a?.runId != t.runId || !("waiting" in a) || a.waiting?.waitId != n.waitId) return;
9418
9423
  let { waiting: o, ...s } = a, c = {
9419
9424
  ...s,
9420
9425
  status: r.status
9421
9426
  };
9422
- this.#p({ runById: Za(i, c) }), this.retryObservation();
9427
+ this.#p({ runById: Qa(i, c) }), this.retryObservation();
9423
9428
  let l = this.#o.value.target;
9424
9429
  l != null && this.#u(l.flowId);
9425
9430
  } catch (e) {
9426
- this.#o.value.selectedRunId == t.runId && this.#a(k(e, this.#n.t));
9431
+ this.#o.value.selectedRunId == t.runId && this.#a(A(e, this.#n.t));
9427
9432
  } finally {
9428
9433
  this.#o.value.resolvingAction == e && this.#p({ resolvingAction: void 0 });
9429
9434
  }
@@ -9452,7 +9457,7 @@ var Qa = class {
9452
9457
  externalRunId: void 0,
9453
9458
  loaded: !0,
9454
9459
  result: void 0,
9455
- runById: Za(n, e),
9460
+ runById: Qa(n, e),
9456
9461
  runIds: [e.runId, ...n.runIds.filter((t) => t != e.runId)],
9457
9462
  selectedRunId: e.runId,
9458
9463
  target: { flowId: e.flowId }
@@ -9475,19 +9480,19 @@ var Qa = class {
9475
9480
  observationFailed: !1,
9476
9481
  resolvingAction: void 0,
9477
9482
  result: void 0,
9478
- runById: Za(n, e),
9483
+ runById: Qa(n, e),
9479
9484
  selectedRunId: e.runId
9480
9485
  }), this.#l(e, t);
9481
9486
  }
9482
9487
  async #l(e, t) {
9483
- let n = pe.makeUnsafe();
9488
+ let n = me.makeUnsafe();
9484
9489
  this.#s = y.runFork(y.gen({ self: this }, function* () {
9485
9490
  let r = e, i = 0;
9486
9491
  for (; t();) {
9487
9492
  let a = this.#o.value.eventCursor, [o, s] = yield* y.tryPromise({
9488
9493
  try: (t) => Promise.allSettled([this.#t.getRun(e.runId, t), this.#t.getRunEvents(e.runId, {
9489
9494
  after: a,
9490
- limit: Wa
9495
+ limit: Ga
9491
9496
  }, t)]),
9492
9497
  catch: (e) => e
9493
9498
  });
@@ -9495,11 +9500,11 @@ var Qa = class {
9495
9500
  if (!t() || this.#o.value.selectedRunId != e.runId) return;
9496
9501
  let c = o.value;
9497
9502
  if (this.#p({ observationFailed: !1 }), s.status == "rejected") {
9498
- if (!(s.reason instanceof _e) || s.reason.code != "run.events-expired") return yield* y.fail(s.reason);
9503
+ if (!(s.reason instanceof ve) || s.reason.code != "run.events-expired") return yield* y.fail(s.reason);
9499
9504
  this.#p({
9500
9505
  eventsExpiresAt: void 0,
9501
9506
  historyComplete: !1,
9502
- runById: Za(this.#o.value, c)
9507
+ runById: Qa(this.#o.value, c)
9503
9508
  }), yield* y.tryPromise({
9504
9509
  try: (e) => this.#d(c, t, e),
9505
9510
  catch: (e) => e
@@ -9512,19 +9517,19 @@ var Qa = class {
9512
9517
  events: [...this.#o.value.events, ...l.events],
9513
9518
  eventsExpiresAt: l.eventsExpiresAt,
9514
9519
  historyComplete: l.historyComplete,
9515
- runById: Za(this.#o.value, c)
9520
+ runById: Qa(this.#o.value, c)
9516
9521
  }), yield* y.tryPromise({
9517
9522
  try: (e) => this.#d(c, t, e),
9518
9523
  catch: (e) => e
9519
- }), yield* pe.succeed(n, void 0), ge(c.status) && l.done) return;
9524
+ }), yield* me.succeed(n, void 0), _e(c.status) && l.done) return;
9520
9525
  let u = c.status == "queued" || c.status == "starting";
9521
9526
  i = u && c.status == r.status ? i + 1 : 0;
9522
- let d = ge(c.status) || l.events.length == Wa ? 0 : c.status == "waiting" ? qa : u ? Math.min(Ka, Ga * 2 ** Math.max(0, i - 1)) : Ka;
9527
+ let d = _e(c.status) || l.events.length == Ga ? 0 : c.status == "waiting" ? Ja : u ? Math.min(qa, Ka * 2 ** Math.max(0, i - 1)) : qa;
9523
9528
  r = c, yield* y.sleep(d);
9524
9529
  }
9525
9530
  }).pipe(y.catch((n) => y.sync(() => {
9526
- t() && this.#o.value.selectedRunId == e.runId && (this.#p({ observationFailed: !0 }), this.#a(k(n, this.#n.t)));
9527
- })), y.ensuring(pe.succeed(n, void 0)))), await y.runPromise(pe.await(n));
9531
+ t() && this.#o.value.selectedRunId == e.runId && (this.#p({ observationFailed: !0 }), this.#a(A(n, this.#n.t)));
9532
+ })), y.ensuring(me.succeed(n, void 0)))), await y.runPromise(me.await(n));
9528
9533
  }
9529
9534
  async #u(e) {
9530
9535
  let t = this.#r.begin();
@@ -9536,7 +9541,7 @@ var Qa = class {
9536
9541
  let n = await this.#t.listRuns(e, { limit: 50 });
9537
9542
  if (!t() || this.#o.value.target?.flowId != e) return;
9538
9543
  this.#p({
9539
- ...Xa(this.#o.value, n.runs),
9544
+ ...Za(this.#o.value, n.runs),
9540
9545
  loaded: !0,
9541
9546
  loadingMore: !1,
9542
9547
  nextCursor: n.nextCursor,
@@ -9547,7 +9552,7 @@ var Qa = class {
9547
9552
  }
9548
9553
  }
9549
9554
  async #d(e, t, n) {
9550
- if (!ge(e.status) || this.#o.value.result?.runId == e.runId) return;
9555
+ if (!_e(e.status) || this.#o.value.result?.runId == e.runId) return;
9551
9556
  let r = await this.#t.getRunResult(e.runId, n);
9552
9557
  t() && this.#o.value.selectedRunId == e.runId && this.#p({ result: r });
9553
9558
  }
@@ -9560,7 +9565,7 @@ var Qa = class {
9560
9565
  ...e
9561
9566
  });
9562
9567
  }
9563
- }, $a = {
9568
+ }, eo = {
9564
9569
  "17track": "https://static.oomol.com/logo/third-party/17track.svg",
9565
9570
  "7_shifts": "https://static.oomol.com/logo/third-party/7_shifts.png",
9566
9571
  ably: "https://static.oomol.com/logo/third-party/ably.svg",
@@ -11038,35 +11043,35 @@ var Qa = class {
11038
11043
  };
11039
11044
  //#endregion
11040
11045
  //#region src/workbench/browser/runtime/providerIcon.ts
11041
- function eo(e, t = $a) {
11042
- let n = io(no(e.serviceName)), r = to(e, t);
11046
+ function to(e, t = eo) {
11047
+ let n = ao(ro(e.serviceName)), r = no(e, t);
11043
11048
  return r == null ? n : ie(r, n);
11044
11049
  }
11045
- function to(e, t = $a) {
11050
+ function no(e, t = eo) {
11046
11051
  let n = e.icon?.trim();
11047
11052
  if (n) return n;
11048
11053
  let r = t[e.serviceId]?.trim();
11049
11054
  if (r) return r;
11050
- let i = ro(e.homepageUrl);
11055
+ let i = io(e.homepageUrl);
11051
11056
  return i == null ? void 0 : `https://www.google.com/s2/favicons?sz=64&domain=${encodeURIComponent(i)}`;
11052
11057
  }
11053
- function no(e) {
11058
+ function ro(e) {
11054
11059
  return e.split(/\s+/).map((e) => e[0]).join("").slice(0, 2).toUpperCase() || "?";
11055
11060
  }
11056
- function ro(e) {
11061
+ function io(e) {
11057
11062
  if (e) try {
11058
11063
  return new URL(e).hostname || void 0;
11059
11064
  } catch {
11060
11065
  return;
11061
11066
  }
11062
11067
  }
11063
- function io(e) {
11068
+ function ao(e) {
11064
11069
  let t = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><rect width="64" height="64" rx="12" fill="#e4e4e7"/><text x="32" y="33" fill="#3f3f46" font-family="Arial,sans-serif" font-size="25" font-weight="600" text-anchor="middle" dominant-baseline="central">${[...e].map((e) => `&#${e.codePointAt(0)};`).join("")}</text></svg>`;
11065
11070
  return `data:image/svg+xml,${encodeURIComponent(t)}`;
11066
11071
  }
11067
11072
  //#endregion
11068
11073
  //#region src/workbench/browser/runtime/workspace.ts
11069
- function ao(e) {
11074
+ function oo(e) {
11070
11075
  let t = [], n = /* @__PURE__ */ new Map(), r;
11071
11076
  for (let i of e) n.set(i.connectionId, i), i.status == "active" && (t.push(i), i.isDefault && (r = i));
11072
11077
  return {
@@ -11076,7 +11081,7 @@ function ao(e) {
11076
11081
  preferred: r ?? (t.length == 1 ? t[0] : void 0)
11077
11082
  };
11078
11083
  }
11079
- function oo(e, t) {
11084
+ function so(e, t) {
11080
11085
  if (e.node.name != null) return e.node.name;
11081
11086
  switch (e.kind) {
11082
11087
  case "condition": return t?.("addNode.condition") ?? "Condition";
@@ -11086,7 +11091,7 @@ function oo(e, t) {
11086
11091
  case "task": return e.definition?.name ?? (e.node.task == null ? e.node.taskId : e.node.task.moduleId);
11087
11092
  }
11088
11093
  }
11089
- function so(e) {
11094
+ function co(e) {
11090
11095
  if (e.kind == "value") return ":oomol:value:";
11091
11096
  if (e.kind != "task") return;
11092
11097
  let t = e.definition;
@@ -11095,39 +11100,43 @@ function so(e) {
11095
11100
  function Q(e) {
11096
11101
  if (!(typeof e != "object" || !e || Array.isArray(e))) return e;
11097
11102
  }
11098
- function co(e) {
11103
+ function lo(e) {
11099
11104
  return typeof e == "number" && Number.isFinite(e) ? e : void 0;
11100
11105
  }
11101
- function lo(e, t) {
11106
+ function uo(e, t) {
11102
11107
  let n = Q(e.designer);
11103
- if (n?.version == 1) return Fo(n, t);
11108
+ if (n?.version == 1) return Lo(n, t);
11104
11109
  }
11105
- function uo(e, t) {
11110
+ function fo(e, t) {
11106
11111
  return ((e) => Object.fromEntries(Object.entries(Q(e) ?? {}).flatMap(([e, t]) => {
11107
- let n = Q(t), r = co(n?.x), i = co(n?.y);
11112
+ let n = Q(t), r = lo(n?.x), i = lo(n?.y);
11108
11113
  return r == null || i == null ? [] : [[e, {
11109
11114
  x: r,
11110
11115
  y: i
11111
11116
  }]];
11112
- })))(lo(e, t)?.nodes);
11117
+ })))(uo(e, t)?.nodes);
11113
11118
  }
11114
- function fo(e, t) {
11115
- let n = Q(lo(e, t)?.viewport), r = co(n?.x), i = co(n?.y), a = co(n?.zoom);
11119
+ function po(e, t) {
11120
+ let n = fo(e, t), r = uo(e, t)?.order, i = Array.isArray(r) ? r.flatMap((e) => typeof e == "string" && n[e] != null ? [e] : []) : [];
11121
+ return [.../* @__PURE__ */ new Set([...i, ...Object.keys(n)])];
11122
+ }
11123
+ function mo(e, t) {
11124
+ let n = Q(uo(e, t)?.viewport), r = lo(n?.x), i = lo(n?.y), a = lo(n?.zoom);
11116
11125
  return r == null || i == null || a == null || a <= 0 ? void 0 : {
11117
11126
  x: r,
11118
11127
  y: i,
11119
11128
  zoom: a
11120
11129
  };
11121
11130
  }
11122
- function po(e, t) {
11123
- return fo(e, t) ?? {
11131
+ function ho(e, t) {
11132
+ return mo(e, t) ?? {
11124
11133
  x: 0,
11125
11134
  y: 0,
11126
11135
  zoom: 1
11127
11136
  };
11128
11137
  }
11129
- function mo(e, t, n) {
11130
- let r = Q(lo(e, t)?.comments) ?? {};
11138
+ function go(e, t, n) {
11139
+ let r = Q(uo(e, t)?.comments) ?? {};
11131
11140
  return Object.fromEntries(Object.entries(r).flatMap(([e, t]) => {
11132
11141
  let r = Q(t), i = typeof r?.title == "string" ? r.title : void 0, a = typeof r?.content == "string" ? r.content : void 0;
11133
11142
  return i == null || a == null ? [] : [[e, {
@@ -11140,7 +11149,7 @@ function mo(e, t, n) {
11140
11149
  }]];
11141
11150
  }));
11142
11151
  }
11143
- function ho(e, t, n, r) {
11152
+ function _o(e, t, n, r) {
11144
11153
  return JSON.stringify([
11145
11154
  e,
11146
11155
  t,
@@ -11148,11 +11157,11 @@ function ho(e, t, n, r) {
11148
11157
  r
11149
11158
  ]);
11150
11159
  }
11151
- function go(e) {
11160
+ function vo(e) {
11152
11161
  if (e.kind == "trigger") return {
11153
11162
  inputs: /* @__PURE__ */ new Map(),
11154
11163
  outputs: /* @__PURE__ */ new Map([["payload", {
11155
- jsonSchema: xa(e.trigger),
11164
+ jsonSchema: Sa(e.trigger),
11156
11165
  nullable: !1
11157
11166
  }]])
11158
11167
  };
@@ -11241,7 +11250,7 @@ function go(e) {
11241
11250
  outputs: n
11242
11251
  };
11243
11252
  }
11244
- function _o(e) {
11253
+ function yo(e) {
11245
11254
  switch (e) {
11246
11255
  case "endsWith": return "ends with";
11247
11256
  case "hasKey": return "has key";
@@ -11265,7 +11274,7 @@ function _o(e) {
11265
11274
  case "contains": return e;
11266
11275
  }
11267
11276
  }
11268
- function vo(e, t, n) {
11277
+ function bo(e, t, n) {
11269
11278
  let r = e.kind == "flow" ? `/document/graph/nodes/${t.id}` : `/document/subflows/${e.id}/graph/nodes/${t.id}`, i = [r];
11270
11279
  if (t.kind == "task") {
11271
11280
  t.node.task == null ? i.push(`/document/tasks/${t.node.taskId}`) : i.push(`${r}/task`);
@@ -11274,7 +11283,7 @@ function vo(e, t, n) {
11274
11283
  } else t.kind == "subflow" && i.push(`/document/subflows/${t.node.subflowId}`);
11275
11284
  return n.filter((e) => i.some((t) => e.path.startsWith(t))).length;
11276
11285
  }
11277
- function yo(e, t, n, r) {
11286
+ function xo(e, t, n, r) {
11278
11287
  if (t.kind != "flow" || n?.flowId != e.revision.flowId || n.revisionId != e.revision.revisionId) return { nodes: /* @__PURE__ */ new Map() };
11279
11288
  let i = n.status == "queued" || n.status == "starting" || n.status == "running" || n.status == "waiting", a = /* @__PURE__ */ new Map();
11280
11289
  n.status == "waiting" && "waiting" in n && n.waiting != null && a.set(n.waiting.nodeId, {
@@ -11358,10 +11367,10 @@ function yo(e, t, n, r) {
11358
11367
  status: i ? "running" : "idle"
11359
11368
  };
11360
11369
  }
11361
- function bo(e, t, n) {
11370
+ function So(e, t, n) {
11362
11371
  if (e != null) return "moduleId" in e ? n?.("designer.executorJavaScript") ?? "javascript" : t ? n?.("designer.executorConnectionRequired") ?? "connection required" : e.executor.kind == "llm" ? n?.("designer.executorLlm") ?? "llm" : n?.("designer.executorConnector") ?? "connector";
11363
11372
  }
11364
- function xo(e) {
11373
+ function Co(e) {
11365
11374
  switch (e.kind) {
11366
11375
  case "manual": return ":carbon:play:";
11367
11376
  case "cron": return ":carbon:time:";
@@ -11370,16 +11379,16 @@ function xo(e) {
11370
11379
  case "webhook": return ":carbon:webhook:";
11371
11380
  }
11372
11381
  }
11373
- function So(e, t) {
11382
+ function wo(e, t) {
11374
11383
  return t.filter((t) => t.code != "trigger.config-incomplete" && t.path.startsWith(`/document/graph/nodes/${e}`)).length;
11375
11384
  }
11376
- function Co(e, t) {
11385
+ function To(e, t) {
11377
11386
  let n = [], r = new Map([...t].map((e) => [e, /* @__PURE__ */ new Set()])), i = new Map([...t].map((e) => [e, /* @__PURE__ */ new Set()]));
11378
11387
  for (let a of e.edges) {
11379
11388
  if (!t.has(a.source) || !t.has(a.target)) continue;
11380
11389
  let e = a.sourceHandle == null ? "$out" : `$branch:${a.sourceHandle}`;
11381
11390
  n.push({
11382
- id: ho(a.source, e, a.target, "$in"),
11391
+ id: _o(a.source, e, a.target, "$in"),
11383
11392
  source: a.source,
11384
11393
  sourceHandle: e,
11385
11394
  target: a.target,
@@ -11392,7 +11401,7 @@ function Co(e, t) {
11392
11401
  edges: n
11393
11402
  };
11394
11403
  }
11395
- function wo(e, t, n) {
11404
+ function Eo(e, t, n) {
11396
11405
  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();
11397
11406
  for (let e = 0; e < s.length; e += 1) {
11398
11407
  let t = s[e];
@@ -11411,14 +11420,14 @@ function wo(e, t, n) {
11411
11420
  ordered: a
11412
11421
  };
11413
11422
  }
11414
- function To(e, t, n, r, i) {
11423
+ function Do(e, t, n, r, i) {
11415
11424
  if (!("inputs" in t)) return [];
11416
11425
  let a = [];
11417
11426
  for (let [o, s] of n.inputs) {
11418
11427
  let n = t.inputs[o], c = [], l = /* @__PURE__ */ new Set();
11419
11428
  if (n?.kind == "sources") for (let t of n.sources) {
11420
11429
  if (t.kind != "node") continue;
11421
- let n = t.nodeId, r = t.output, i = ho(n, r, e, o);
11430
+ let n = t.nodeId, r = t.output, i = _o(n, r, e, o);
11422
11431
  l.has(i) || (l.add(i), c.push({
11423
11432
  nodeId: n,
11424
11433
  output: r
@@ -11431,16 +11440,16 @@ function To(e, t, n, r, i) {
11431
11440
  ...n?.kind == "value" ? { value: n.value } : {},
11432
11441
  ...c.length > 0 ? { sources: c } : {},
11433
11442
  ...d?.kind == "variable" ? { variable: d.target } : {},
11434
- variableCompatible: Da(s.jsonSchema),
11443
+ variableCompatible: Oa(s.jsonSchema),
11435
11444
  variableEnabled: i
11436
11445
  });
11437
11446
  }
11438
11447
  return a;
11439
11448
  }
11440
- function Eo(e) {
11449
+ function Oo(e) {
11441
11450
  return [...e.outputs].map(([e, t]) => Object.assign({ handle: e }, t));
11442
11451
  }
11443
- function Do(e, t) {
11452
+ function ko(e, t) {
11444
11453
  if (e.kind != "task" || e.definition == null) return t;
11445
11454
  let n = new Map(t.map((e) => [e.handle, e])), r = [];
11446
11455
  for (let t of e.definition.inputs) {
@@ -11453,7 +11462,7 @@ function Do(e, t) {
11453
11462
  }
11454
11463
  return r.push(...n.values()), r;
11455
11464
  }
11456
- function Oo(e, t) {
11465
+ function Ao(e, t) {
11457
11466
  if (e.kind != "task" || e.definition == null) return t;
11458
11467
  let n = new Map(t.map((e) => [e.handle, e])), r = [];
11459
11468
  for (let t of e.definition.outputs) {
@@ -11466,10 +11475,10 @@ function Oo(e, t) {
11466
11475
  }
11467
11476
  return r.push(...n.values()), r;
11468
11477
  }
11469
- function ko(e) {
11478
+ function jo(e) {
11470
11479
  return e === void 0 ? "" : typeof e == "string" ? e : JSON.stringify(e);
11471
11480
  }
11472
- function Ao(e) {
11481
+ function Mo(e) {
11473
11482
  if (e.kind != "integration" && e.kind != "poll") return [];
11474
11483
  let t = Q(e.definition.configSchema), n = Q(t?.properties), r = new Set(Array.isArray(t?.required) ? t.required.filter((e) => typeof e == "string") : []), i = [];
11475
11484
  for (let [t, a] of Object.entries(n ?? {})) {
@@ -11481,14 +11490,14 @@ function Ao(e) {
11481
11490
  label: typeof n.title == "string" ? n.title : t,
11482
11491
  name: t,
11483
11492
  required: r.has(t),
11484
- source: ko(o)
11493
+ source: jo(o)
11485
11494
  };
11486
11495
  if (Array.isArray(n.enum)) {
11487
11496
  i.push({
11488
11497
  ...s,
11489
11498
  kind: "select",
11490
11499
  options: n.enum.map((e) => {
11491
- let t = ko(e);
11500
+ let t = jo(e);
11492
11501
  return {
11493
11502
  label: t,
11494
11503
  source: t,
@@ -11504,14 +11513,14 @@ function Ao(e) {
11504
11513
  ...s,
11505
11514
  kind: "multi-select",
11506
11515
  options: c.enum.map((e) => {
11507
- let t = ko(e);
11516
+ let t = jo(e);
11508
11517
  return {
11509
11518
  label: t,
11510
11519
  source: t,
11511
11520
  value: e
11512
11521
  };
11513
11522
  }),
11514
- selected: Array.isArray(o) ? o.map(ko) : []
11523
+ selected: Array.isArray(o) ? o.map(jo) : []
11515
11524
  });
11516
11525
  continue;
11517
11526
  }
@@ -11533,7 +11542,7 @@ function Ao(e) {
11533
11542
  }
11534
11543
  return i.toSorted((e, t) => Number(!e.required) - Number(!t.required) || Number(e.kind == "json" || e.kind == "multi-select") - Number(t.kind == "json" || t.kind == "multi-select"));
11535
11544
  }
11536
- function jo(e, t, n, r) {
11545
+ function No(e, t, n, r) {
11537
11546
  let i;
11538
11547
  switch (t.kind) {
11539
11548
  case "manual":
@@ -11550,7 +11559,7 @@ function jo(e, t, n, r) {
11550
11559
  break;
11551
11560
  case "integration":
11552
11561
  i = {
11553
- config: Ao(t),
11562
+ config: Mo(t),
11554
11563
  kind: t.kind,
11555
11564
  schedules: [],
11556
11565
  source: t.definition.provider
@@ -11558,7 +11567,7 @@ function jo(e, t, n, r) {
11558
11567
  break;
11559
11568
  case "poll":
11560
11569
  i = {
11561
- config: Ao(t),
11570
+ config: Mo(t),
11562
11571
  kind: t.kind,
11563
11572
  schedules: t.pollTimes,
11564
11573
  source: t.definition.provider
@@ -11581,17 +11590,17 @@ function jo(e, t, n, r) {
11581
11590
  }
11582
11591
  return {
11583
11592
  description: t.description,
11584
- diagnostics: So(e, r),
11585
- icon: t.icon ?? (t.kind == "integration" || t.kind == "poll" ? eo({
11593
+ diagnostics: wo(e, r),
11594
+ icon: t.icon ?? (t.kind == "integration" || t.kind == "poll" ? to({
11586
11595
  serviceId: t.definition.provider,
11587
11596
  serviceName: t.definition.provider
11588
- }) : xo(t)),
11597
+ }) : Co(t)),
11589
11598
  id: e,
11590
11599
  inputs: [],
11591
11600
  kind: "trigger",
11592
11601
  outputs: [{
11593
11602
  handle: "payload",
11594
- jsonSchema: xa(t),
11603
+ jsonSchema: Sa(t),
11595
11604
  nullable: !1
11596
11605
  }],
11597
11606
  presentation: i,
@@ -11601,31 +11610,31 @@ function jo(e, t, n, r) {
11601
11610
  title: t.name
11602
11611
  };
11603
11612
  }
11604
- function Mo(e, t, n, r, i) {
11605
- let a = t.node, o = Do(t, To(e, a, n, i.revision, i.variables)), s = Oo(t, Eo(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 = u?.defaultConnection, p = l?.connectionId, m = p == null ? void 0 : d?.byId.get(p);
11613
+ function Po(e, t, n, r, i) {
11614
+ let a = t.node, o = ko(t, Do(e, a, n, i.revision, i.variables)), s = Ao(t, Oo(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 = u?.defaultConnection, p = l?.connectionId, m = p == null ? void 0 : d?.byId.get(p);
11606
11615
  m == null && f != null && f.connectionId == p && (m = f);
11607
- let ee = u?.authenticated == 1 && (l?.connectionId == null || d != null && m?.status != "active"), te = i.runNodes.get(e), h = {
11616
+ let h = u?.authenticated == 1 && (l?.connectionId == null || d != null && m?.status != "active"), ee = i.runNodes.get(e), g = {
11608
11617
  description: a.description,
11609
- diagnostics: vo(i.target, t, i.diagnostics),
11610
- icon: a.icon ?? (u == null ? so(t) : eo(u)),
11618
+ diagnostics: bo(i.target, t, i.diagnostics),
11619
+ icon: a.icon ?? (u == null ? co(t) : to(u)),
11611
11620
  id: e,
11612
11621
  inputs: o,
11613
11622
  outputs: s,
11614
11623
  position: r,
11615
11624
  rawIcon: a.icon,
11616
11625
  rawTitle: a.name,
11617
- ...te == null ? {} : { run: te },
11626
+ ...ee == null ? {} : { run: ee },
11618
11627
  timeoutSeconds: a.timeoutMs == null ? void 0 : a.timeoutMs / 1e3,
11619
- title: oo(t, i.t)
11628
+ title: so(t, i.t)
11620
11629
  };
11621
11630
  switch (a.kind) {
11622
11631
  case "condition": return {
11623
- ...h,
11632
+ ...g,
11624
11633
  kind: a.kind,
11625
11634
  cases: a.cases.map((e) => ({
11626
11635
  expressions: e.expressions.map((e) => ({
11627
11636
  input: e.input,
11628
- operator: _o(e.operator),
11637
+ operator: yo(e.operator),
11629
11638
  value: e.value
11630
11639
  })),
11631
11640
  output: e.output,
@@ -11634,12 +11643,12 @@ function Mo(e, t, n, r, i) {
11634
11643
  defaultOutput: a.defaultOutput
11635
11644
  };
11636
11645
  case "subflow": return {
11637
- ...h,
11646
+ ...g,
11638
11647
  kind: a.kind,
11639
11648
  reference: a.subflowId
11640
11649
  };
11641
11650
  case "task": return {
11642
- ...h,
11651
+ ...g,
11643
11652
  additionalInputs: a.additionalInputs?.flatMap((e) => {
11644
11653
  let t = o.find((t) => "handle" in t && t.handle == e.handle);
11645
11654
  return t == null || "group" in t ? [] : [t];
@@ -11647,29 +11656,29 @@ function Mo(e, t, n, r, i) {
11647
11656
  editableAdditionalInputs: a.task == null,
11648
11657
  editablePorts: a.task != null,
11649
11658
  kind: a.kind,
11650
- executorName: bo(c, ee, i.t),
11659
+ executorName: So(c, h, i.t),
11651
11660
  reference: a.task == null ? a.taskId : a.task.moduleId
11652
11661
  };
11653
11662
  case "value": return {
11654
- ...h,
11663
+ ...g,
11655
11664
  kind: a.kind,
11656
11665
  values: a.values.map((e) => Object.assign({}, e))
11657
11666
  };
11658
11667
  case "wait": {
11659
11668
  let e = a.notification == null ? void 0 : i.revision.task(a.notification.taskId), t = e?.executor.kind == "connector" ? i.connectorActions[e.executor.action] : void 0, n = (t?.name ?? e?.name)?.replaceAll("_", " "), r = n == null ? void 0 : t == null ? n : `${t.serviceName} · ${n}`;
11660
11669
  return {
11661
- ...h,
11670
+ ...g,
11662
11671
  kind: a.kind,
11663
11672
  ...r == null ? {} : { notice: {
11664
- ...t == null ? {} : { icon: eo(t) },
11673
+ ...t == null ? {} : { icon: to(t) },
11665
11674
  text: `${i.t?.("inspector.wait.notificationTask") ?? "Notification"} · ${r}`
11666
11675
  } }
11667
11676
  };
11668
11677
  }
11669
11678
  }
11670
11679
  }
11671
- function No(e, t, n = {}, r = [], i = {}, a = {}, o, s, c = [], l = [], u = !1, d = !1, f = !0) {
11672
- let p = e == null ? void 0 : Ha(e), m = p == null || t == null ? void 0 : p.graph(t);
11680
+ function Fo(e, t, n = {}, r = [], i = {}, a = {}, o, s, c = [], l = [], u = !1, d = !1, f = !0) {
11681
+ let p = e == null ? void 0 : Ua(e), m = p == null || t == null ? void 0 : p.graph(t);
11673
11682
  if (p == null || t == null || m == null) return {
11674
11683
  edges: [],
11675
11684
  nodes: [],
@@ -11679,52 +11688,53 @@ function No(e, t, n = {}, r = [], i = {}, a = {}, o, s, c = [], l = [], u = !1,
11679
11688
  zoom: 1
11680
11689
  }
11681
11690
  };
11682
- let ee = yo(p, t, s, c), te = Object.entries(m.nodes), h = new Map(te.map(([e, t]) => [e, p.resolveNode(e, t)])), ne = new Set(te.map(([e]) => e)), re = new Map([...h].map(([e, t]) => [e, go(t)])), ie = Co(m, ne), ae = wo(ne, ie.dependencies, ie.dependents), oe = uo(n, t), se = {
11691
+ let h = xo(p, t, s, c), ee = Object.entries(m.nodes), g = new Map(ee.map(([e, t]) => [e, p.resolveNode(e, t)])), te = new Set(ee.map(([e]) => e)), ne = new Map([...g].map(([e, t]) => [e, vo(t)])), re = To(m, te), ie = Eo(te, re.dependencies, re.dependents), ae = fo(n, t), oe = {
11683
11692
  connectionCatalogs: a,
11684
11693
  connectorActions: i,
11685
11694
  diagnostics: r,
11686
11695
  revision: p,
11687
- runNodes: ee.nodes,
11696
+ runNodes: h.nodes,
11688
11697
  t: o,
11689
11698
  target: t,
11690
11699
  variables: f
11691
- }, ce = /* @__PURE__ */ new Map(), g = [];
11692
- for (let e of ae.ordered) {
11693
- let t = ae.depth.get(e) ?? 0, n = ce.get(t) ?? 0;
11694
- ce.set(t, n + 1);
11695
- let i = oe[e] ?? {
11700
+ }, se = /* @__PURE__ */ new Map(), ce = [];
11701
+ for (let e of ie.ordered) {
11702
+ let t = ie.depth.get(e) ?? 0, n = se.get(t) ?? 0;
11703
+ se.set(t, n + 1);
11704
+ let i = ae[e] ?? {
11696
11705
  x: 80 + t * 500,
11697
11706
  y: 80 + n * 240
11698
- }, a = h.get(e);
11707
+ }, a = g.get(e);
11699
11708
  if (a.kind == "trigger") {
11700
- g.push(jo(e, a.trigger, i, r));
11709
+ ce.push(No(e, a.trigger, i, r));
11701
11710
  continue;
11702
11711
  }
11703
- g.push(Mo(e, a, re.get(e), i, se));
11712
+ ce.push(Po(e, a, ne.get(e), i, oe));
11704
11713
  }
11705
- for (let [e, r] of Object.entries(mo(n, t, oe)).toSorted(([e], [t]) => e.localeCompare(t))) g.push({
11714
+ for (let [e, r] of Object.entries(go(n, t, ae)).toSorted(([e], [t]) => e.localeCompare(t))) ce.push({
11706
11715
  ...r,
11707
11716
  id: e,
11708
11717
  kind: "comment"
11709
11718
  });
11710
- return {
11711
- edges: ie.edges,
11712
- nodes: g,
11713
- ...ee.status == null ? {} : { runStatus: ee.status },
11714
- viewport: po(n, t),
11719
+ let le = new Map(po(n, t).map((e, t) => [e, t]));
11720
+ return ce.sort((e, t) => (le.get(e.id) ?? -1) - (le.get(t.id) ?? -1)), {
11721
+ edges: re.edges,
11722
+ nodes: ce,
11723
+ ...h.status == null ? {} : { runStatus: h.status },
11724
+ viewport: ho(n, t),
11715
11725
  variableNames: l,
11716
11726
  variableNamesLoaded: u,
11717
11727
  variableNamesLoading: d
11718
11728
  };
11719
11729
  }
11720
- function Po(e) {
11730
+ function Io(e) {
11721
11731
  let t = Q(e.designer);
11722
11732
  return t?.version == 1 ? t : { version: 1 };
11723
11733
  }
11724
- function Fo(e, t) {
11734
+ function Lo(e, t) {
11725
11735
  return t.kind == "flow" ? Q(e.flow) : Q(Q(e.subflows)?.[t.id]);
11726
11736
  }
11727
- function Io(e, t, n) {
11737
+ function Ro(e, t, n) {
11728
11738
  if (t.kind == "flow") return {
11729
11739
  ...e,
11730
11740
  flow: n,
@@ -11740,17 +11750,20 @@ function Io(e, t, n) {
11740
11750
  version: 1
11741
11751
  };
11742
11752
  }
11743
- function Lo(e, t) {
11753
+ function zo(e, t) {
11744
11754
  let n = {
11745
- ...lo(e, t),
11746
- viewport: { ...po(e, t) },
11747
- nodes: uo(e, t)
11755
+ ...uo(e, t),
11756
+ viewport: { ...ho(e, t) },
11757
+ nodes: fo(e, t),
11758
+ order: po(e, t)
11748
11759
  };
11749
11760
  return delete n.layouts, n;
11750
11761
  }
11751
- function Ro(e, t, n) {
11752
- let r = Po(e), i = Lo(e, t), a = {
11753
- ...Q(i.nodes) ?? {},
11762
+ function Bo(e, t, n) {
11763
+ let r = Io(e), i = zo(e, t), a = Q(i.nodes) ?? {}, o = [...po(e, t)];
11764
+ for (let e of Object.keys(n)) o.includes(e) || o.push(e);
11765
+ let s = {
11766
+ ...a,
11754
11767
  ...Object.fromEntries(Object.entries(n).map(([e, t]) => [e, {
11755
11768
  x: t.x,
11756
11769
  y: t.y
@@ -11758,17 +11771,18 @@ function Ro(e, t, n) {
11758
11771
  };
11759
11772
  return {
11760
11773
  ...e,
11761
- designer: Io(r, t, {
11774
+ designer: Ro(r, t, {
11762
11775
  ...i,
11763
- nodes: a
11776
+ nodes: s,
11777
+ order: o
11764
11778
  })
11765
11779
  };
11766
11780
  }
11767
- function zo(e, t, n, r) {
11768
- let i = Ro(e, t, { [n]: r.position }), a = Po(i), o = Fo(a, t) ?? {}, s = Q(o.comments) ?? {};
11781
+ function Vo(e, t, n, r) {
11782
+ let i = Bo(e, t, { [n]: r.position }), a = Io(i), o = Lo(a, t) ?? {}, s = Q(o.comments) ?? {};
11769
11783
  return {
11770
11784
  ...i,
11771
- designer: Io(a, t, {
11785
+ designer: Ro(a, t, {
11772
11786
  ...o,
11773
11787
  comments: {
11774
11788
  ...s,
@@ -11780,28 +11794,30 @@ function zo(e, t, n, r) {
11780
11794
  })
11781
11795
  };
11782
11796
  }
11783
- function Bo(e, t, n) {
11784
- let r = Po(e), i = Lo(e, t), a = { ...Q(i.comments) }, o = { ...Q(i.nodes) };
11797
+ function Ho(e, t, n) {
11798
+ let r = Io(e), i = zo(e, t), a = { ...Q(i.comments) }, o = { ...Q(i.nodes) };
11785
11799
  for (let e of n) delete a[e], delete o[e];
11800
+ let s = po(e, t).filter((e) => !n.has(e));
11786
11801
  return {
11787
11802
  ...e,
11788
- designer: Io(r, t, {
11803
+ designer: Ro(r, t, {
11789
11804
  ...i,
11790
11805
  comments: a,
11791
- nodes: o
11806
+ nodes: o,
11807
+ order: s
11792
11808
  })
11793
11809
  };
11794
11810
  }
11795
- function Vo(e, t) {
11796
- return new Set(Object.keys(Q(lo(e, t)?.comments) ?? {}));
11811
+ function Uo(e, t) {
11812
+ return new Set(Object.keys(Q(uo(e, t)?.comments) ?? {}));
11797
11813
  }
11798
- function Ho(e, t, n) {
11799
- let r = fo(e, t);
11814
+ function Wo(e, t, n) {
11815
+ let r = mo(e, t);
11800
11816
  if (r?.x == n.x && r.y == n.y && r.zoom == n.zoom) return e;
11801
- let i = Po(e), a = Lo(e, t);
11817
+ let i = Io(e), a = zo(e, t);
11802
11818
  return {
11803
11819
  ...e,
11804
- designer: Io(i, t, {
11820
+ designer: Ro(i, t, {
11805
11821
  ...a,
11806
11822
  viewport: {
11807
11823
  x: n.x,
@@ -11811,7 +11827,7 @@ function Ho(e, t, n) {
11811
11827
  })
11812
11828
  };
11813
11829
  }
11814
- function Uo(e, t, n) {
11830
+ function Go(e, t, n) {
11815
11831
  let r = e.payload.nodeTitle;
11816
11832
  if (typeof r == "string") return r;
11817
11833
  let i = e.payload.executionId;
@@ -11824,7 +11840,7 @@ function Uo(e, t, n) {
11824
11840
  }
11825
11841
  //#endregion
11826
11842
  //#region src/workbench/browser/runtime/designer/addNodeOptions.ts
11827
- function Wo(e) {
11843
+ function Ko(e) {
11828
11844
  let t = /* @__PURE__ */ new Map(), n = (e) => {
11829
11845
  t.set(e.id, e);
11830
11846
  for (let t of e.choices ?? []) n(t.option);
@@ -11832,7 +11848,7 @@ function Wo(e) {
11832
11848
  for (let t of e) n(t);
11833
11849
  return t;
11834
11850
  }
11835
- function Go(e) {
11851
+ function qo(e) {
11836
11852
  let t = e("addNode.blocks");
11837
11853
  return [
11838
11854
  {
@@ -11955,9 +11971,9 @@ function Go(e) {
11955
11971
  }
11956
11972
  ];
11957
11973
  }
11958
- function Ko(e, t, n) {
11974
+ function Jo(e, t, n) {
11959
11975
  if (e == null || t == null) return [];
11960
- let r = Go(n);
11976
+ let r = qo(n);
11961
11977
  if (t.kind != "flow") return r;
11962
11978
  let i = n("addNode.triggers"), a = [
11963
11979
  {
@@ -12026,9 +12042,9 @@ function Ko(e, t, n) {
12026
12042
  },
12027
12043
  ...r
12028
12044
  ];
12029
- return Object.values(Ha(e).graph(t)?.nodes ?? {}).some((e) => e.kind == "manual") ? a.filter((e) => e.id != "trigger:manual") : a;
12045
+ return Object.values(Ua(e).graph(t)?.nodes ?? {}).some((e) => e.kind == "manual") ? a.filter((e) => e.id != "trigger:manual") : a;
12030
12046
  }
12031
- function qo(e, t, n, r) {
12047
+ function Yo(e, t, n, r) {
12032
12048
  switch (e.kind) {
12033
12049
  case "new-task": return {
12034
12050
  kind: "code",
@@ -12090,29 +12106,29 @@ function qo(e, t, n, r) {
12090
12106
  }
12091
12107
  //#endregion
12092
12108
  //#region src/manifest/common/meta/block/generateTyping.ts
12093
- function Jo(e, t, n) {
12094
- return e === "typescript" ? $o(t, n) + "\n" : es(t, n) + "\n";
12109
+ function Xo(e, t, n) {
12110
+ return e === "typescript" ? ts(t, n) + "\n" : ns(t, n) + "\n";
12095
12111
  }
12096
- var Yo = /* @__PURE__ */ new Set(["color", "text"]), Xo = (e) => e.includes(" | ") ? `(${e})` : e;
12097
- function Zo(e) {
12098
- return !e || typeof e != "object" ? !1 : e.contentMediaType === "oomol/artifact" ? !0 : Array.isArray(e.anyOf) ? e.anyOf.some(Zo) : e.type === "object" ? Object.values(e.properties || {}).some(Zo) : e.type === "array" && Zo(e.items);
12112
+ var Zo = /* @__PURE__ */ new Set(["color", "text"]), Qo = (e) => e.includes(" | ") ? `(${e})` : e;
12113
+ function $o(e) {
12114
+ return !e || typeof e != "object" ? !1 : e.contentMediaType === "oomol/artifact" ? !0 : Array.isArray(e.anyOf) ? e.anyOf.some($o) : e.type === "object" ? Object.values(e.properties || {}).some($o) : e.type === "array" && $o(e.items);
12099
12115
  }
12100
- function Qo(e, t) {
12101
- return [...e, ...t].some((e) => Zo(e.json_schema));
12116
+ function es(e, t) {
12117
+ return [...e, ...t].some((e) => $o(e.json_schema));
12102
12118
  }
12103
- function $o(e = [], t = []) {
12119
+ function ts(e = [], t = []) {
12104
12120
  let n = ["type Inputs = {"];
12105
12121
  for (let t of e) n.push(` ${t.handle}: ${$(t.json_schema, t.nullable)};`);
12106
12122
  n.push("};"), n.push("type Outputs = {");
12107
12123
  for (let e of t) n.push(` ${e.handle}: ${$(e.json_schema, e.nullable)};`);
12108
- return n.push("};"), Qo(e, t) && n.unshift("import type { ArtifactRef } from '@oomol-lab/open-flow'", ""), n.join("\n");
12124
+ return n.push("};"), es(e, t) && n.unshift("import type { ArtifactRef } from '@oomol-lab/open-flow'", ""), n.join("\n");
12109
12125
  }
12110
- function es(e = [], t = []) {
12126
+ function ns(e = [], t = []) {
12111
12127
  let n = ["@typedef {{"];
12112
12128
  for (let t of e) n.push(` ${t.handle}: ${$(t.json_schema, t.nullable)};`);
12113
12129
  n.push("}} Inputs;"), n.push("@typedef {{");
12114
12130
  for (let e of t) n.push(` ${e.handle}: ${$(e.json_schema, e.nullable)};`);
12115
- n.push("}} Outputs;"), Qo(e, t) && n.unshift("@import { ArtifactRef } from \"@oomol-lab/open-flow\"");
12131
+ n.push("}} Outputs;"), es(e, t) && n.unshift("@import { ArtifactRef } from \"@oomol-lab/open-flow\"");
12116
12132
  let r = n.map((e) => ` * ${e}`);
12117
12133
  return r.unshift("/**"), r.push(" */"), r.join("\n");
12118
12134
  }
@@ -12122,9 +12138,9 @@ function $(e, t) {
12122
12138
  case "oomol/bin": return t ? "Uint8Array | null" : "Uint8Array";
12123
12139
  case "oomol/artifact": return t ? "ArtifactRef | null" : "ArtifactRef";
12124
12140
  }
12125
- if (Yo.has(e["ui:widget"])) return t ? "string | null" : "string";
12126
- if (Array.isArray(e.anyOf)) return ts((t ? e.anyOf.concat({ type: "null" }) : e.anyOf).map((e) => Xo($(e, !1)))) || "unknown";
12127
- if (Array.isArray(e.enum)) return ts((t ? e.enum.concat(null) : e.enum).map((e) => JSON.stringify(e))) || "unknown";
12141
+ if (Zo.has(e["ui:widget"])) return t ? "string | null" : "string";
12142
+ if (Array.isArray(e.anyOf)) return rs((t ? e.anyOf.concat({ type: "null" }) : e.anyOf).map((e) => Qo($(e, !1)))) || "unknown";
12143
+ if (Array.isArray(e.enum)) return rs((t ? e.enum.concat(null) : e.enum).map((e) => JSON.stringify(e))) || "unknown";
12128
12144
  switch (e.type) {
12129
12145
  case "null": return "null";
12130
12146
  case "boolean": return t ? "boolean | null" : "boolean";
@@ -12139,30 +12155,30 @@ function $(e, t) {
12139
12155
  }
12140
12156
  case "array":
12141
12157
  if (e.uniqueItems && Array.isArray(e.items?.enum)) {
12142
- let n = `${Xo($(e.items, !1))}[]`;
12158
+ let n = `${Qo($(e.items, !1))}[]`;
12143
12159
  return t ? `${n} | null` : n;
12144
12160
  }
12145
12161
  {
12146
- let n = `${Xo($(e.items, !1))}[]`;
12162
+ let n = `${Qo($(e.items, !1))}[]`;
12147
12163
  return t ? `${n} | null` : n;
12148
12164
  }
12149
12165
  default: return "unknown";
12150
12166
  }
12151
12167
  }
12152
- function ts(e) {
12168
+ function rs(e) {
12153
12169
  let t = Array.from(new Set(e.filter((e) => !!e)));
12154
12170
  return t.length === 0 || t.includes("unknown") ? "unknown" : t.join(" | ");
12155
12171
  }
12156
12172
  //#endregion
12157
12173
  //#region src/workbench/browser/runtime/designer/flowChanges.ts
12158
- function ns(e, t) {
12174
+ function is(e, t) {
12159
12175
  return {
12160
12176
  ...e,
12161
- content: m(e.content, t)
12177
+ content: h(e.content, t)
12162
12178
  };
12163
12179
  }
12164
- function rs(e, t = [], n = {}) {
12165
- let r = Jo("javascript", e.inputs.flatMap((e) => "handle" in e ? [{
12180
+ function as(e, t = [], n = {}) {
12181
+ let r = Xo("javascript", e.inputs.flatMap((e) => "handle" in e ? [{
12166
12182
  handle: e.handle,
12167
12183
  json_schema: e.jsonSchema,
12168
12184
  nullable: e.nullable
@@ -12180,7 +12196,7 @@ function rs(e, t = [], n = {}) {
12180
12196
  for (let [e, t] of a) i.push(`${JSON.stringify(e)}: { ${t.join("; ")} }`);
12181
12197
  return `${r}/** @typedef {import("@oomol-lab/open-flow").TaskContext<{ ${i.join("; ").replaceAll("*/", "*\\/")} }>} TaskContext */\n`;
12182
12198
  }
12183
- function is(e) {
12199
+ function os(e) {
12184
12200
  return {
12185
12201
  executor: {
12186
12202
  action: e.actionId,
@@ -12192,20 +12208,20 @@ function is(e) {
12192
12208
  outputs: Object.entries(e.outputs).map(([e, t]) => Object.assign({ handle: e }, t))
12193
12209
  };
12194
12210
  }
12195
- function as(e) {
12211
+ function ss(e) {
12196
12212
  let t = Object.entries(e.inputs);
12197
12213
  return t.find(([, e]) => {
12198
12214
  let t = e.jsonSchema;
12199
12215
  return typeof t == "object" && !!t && !Array.isArray(t) && "type" in t && t.type == "string";
12200
12216
  })?.[0] ?? t[0]?.[0];
12201
12217
  }
12202
- function os(e, t, n) {
12203
- return n == null || Ra(m(e.revision.content, t)).tasks.has(n) ? t : [...t, {
12218
+ function cs(e, t, n) {
12219
+ return n == null || za(h(e.revision.content, t)).tasks.has(n) ? t : [...t, {
12204
12220
  kind: "task.delete",
12205
12221
  taskId: n
12206
12222
  }];
12207
12223
  }
12208
- function ss(e, t) {
12224
+ function ls(e, t) {
12209
12225
  return [{
12210
12226
  kind: "subflow.create",
12211
12227
  subflow: {
@@ -12233,13 +12249,13 @@ function ss(e, t) {
12233
12249
  subflowId: e
12234
12250
  }];
12235
12251
  }
12236
- function cs(e, t, n) {
12252
+ function us(e, t, n) {
12237
12253
  let r = e.graph(t);
12238
12254
  if (r == null) return n;
12239
12255
  let i = new Set(Object.values(r.nodes).flatMap((e) => e.name == null ? [] : [e.name]));
12240
12256
  return n.map((n) => {
12241
12257
  if (n.kind != "graph.node.create" || n.target.kind != t.kind || t.kind == "subflow" && (n.target.kind != "subflow" || n.target.id != t.id)) return n;
12242
- let r = p(n.node.name ?? "") || Mt(e.revision.content, n.node), a = d(r, i);
12258
+ let r = m(n.node.name ?? "") || Mt(e.revision.content, n.node), a = d(r, i);
12243
12259
  return i.add(a), {
12244
12260
  ...n,
12245
12261
  node: {
@@ -12249,7 +12265,7 @@ function cs(e, t, n) {
12249
12265
  };
12250
12266
  });
12251
12267
  }
12252
- function ls(e, t, n, r, i) {
12268
+ function ds(e, t, n, r, i) {
12253
12269
  let a;
12254
12270
  switch (r.kind) {
12255
12271
  case "code":
@@ -12268,7 +12284,7 @@ function ls(e, t, n, r, i) {
12268
12284
  a = It(t, {
12269
12285
  nodeId: n,
12270
12286
  taskId: i()
12271
- }, is(r.action));
12287
+ }, os(r.action));
12272
12288
  break;
12273
12289
  case "condition":
12274
12290
  a = Rt(t, n, r.name);
@@ -12282,7 +12298,7 @@ function ls(e, t, n, r, i) {
12282
12298
  case "subflow": {
12283
12299
  let i = e.subflow(r.subflowId);
12284
12300
  if (i == null) return;
12285
- a = Os(t, n, r.subflowId, i.inputs);
12301
+ a = As(t, n, r.subflowId, i.inputs);
12286
12302
  break;
12287
12303
  }
12288
12304
  case "manual":
@@ -12319,12 +12335,12 @@ function ls(e, t, n, r, i) {
12319
12335
  ...r.connectionId == null ? {} : { connectionId: r.connectionId }
12320
12336
  });
12321
12337
  }
12322
- return a == null ? void 0 : cs(e, t, a);
12338
+ return a == null ? void 0 : us(e, t, a);
12323
12339
  }
12324
- function us(e, t, n) {
12340
+ function fs(e, t, n) {
12325
12341
  return Ut(e.revision.content, t, n);
12326
12342
  }
12327
- function ds(e, t, n) {
12343
+ function ps(e, t, n) {
12328
12344
  let r = e.graph(t)?.nodes ?? {}, i = Object.fromEntries(n.flatMap((e) => r[e] == null ? [] : [[e, r[e]]]));
12329
12345
  return {
12330
12346
  edges: (e.graph(t)?.edges ?? []).filter((e) => i[e.source] != null && i[e.target] != null),
@@ -12341,7 +12357,7 @@ function ds(e, t, n) {
12341
12357
  nodes: i
12342
12358
  };
12343
12359
  }
12344
- function fs(e, t, n, r) {
12360
+ function ms(e, t, n, r) {
12345
12361
  if (e.graph(t) == null) return {
12346
12362
  changes: [],
12347
12363
  nodeIds: [],
@@ -12468,15 +12484,15 @@ function fs(e, t, n, r) {
12468
12484
  });
12469
12485
  }
12470
12486
  return {
12471
- changes: cs(e, t, s),
12487
+ changes: us(e, t, s),
12472
12488
  nodeIds: [...o.values()],
12473
12489
  sourceIds: a
12474
12490
  };
12475
12491
  }
12476
- function ps(e, t, n, r) {
12492
+ function hs(e, t, n, r) {
12477
12493
  return Wt(e.revision.content, t, n, r);
12478
12494
  }
12479
- function ms(e, t, n, r) {
12495
+ function gs(e, t, n, r) {
12480
12496
  let i = e.node(t, n)?.node;
12481
12497
  if (i != null) return i.description == r ? [] : [{
12482
12498
  before: i.description,
@@ -12487,7 +12503,7 @@ function ms(e, t, n, r) {
12487
12503
  value: r
12488
12504
  }];
12489
12505
  }
12490
- function hs(e, t, n, r) {
12506
+ function _s(e, t, n, r) {
12491
12507
  let i = e.node(t, n)?.node;
12492
12508
  if (i != null) return i.icon == r ? [] : [{
12493
12509
  before: i.icon,
@@ -12498,7 +12514,7 @@ function hs(e, t, n, r) {
12498
12514
  value: r
12499
12515
  }];
12500
12516
  }
12501
- function gs(e, t, n, r) {
12517
+ function vs(e, t, n, r) {
12502
12518
  let i = e.node(t, n)?.node;
12503
12519
  if (i == null) return;
12504
12520
  let a = "inputs" in i ? r : r ?? i.name;
@@ -12511,17 +12527,17 @@ function gs(e, t, n, r) {
12511
12527
  value: a
12512
12528
  }];
12513
12529
  }
12514
- function _s(e, t, n, r, i) {
12530
+ function ys(e, t, n, r, i) {
12515
12531
  let a = e.graph(t)?.nodes[n];
12516
12532
  if (!(i === void 0 && a != null && "inputs" in a && a.inputs[r] == null)) return Gt(e.revision.content, t, n, r, i);
12517
12533
  }
12518
- function vs(e, t, n, r, i, a) {
12534
+ function bs(e, t, n, r, i, a) {
12519
12535
  return Jt(e.revision.content, t, n, r, i, a);
12520
12536
  }
12521
- function ys(e, t, n, r) {
12537
+ function xs(e, t, n, r) {
12522
12538
  let a = e.graph(t), o = a?.nodes[n];
12523
12539
  if (a == null || o?.kind != "condition") return;
12524
- let s = Object.fromEntries([...o.cases.map((e) => [e.output, !0]), ...o.defaultOutput == null ? [] : [[o.defaultOutput, !0]]]), c = Object.fromEntries([...r.cases.map((e) => [e.output, !0]), ...r.defaultOutput == null ? [] : [[r.defaultOutput, !0]]]), l = o.input.handle == r.input.handle ? void 0 : [o.input.handle, r.input.handle], u = As(Object.keys(s).map((e) => ({ handle: e })), Object.keys(c).map((e) => ({ handle: e }))), d = new Set(Object.keys(c)), f = [];
12540
+ let s = Object.fromEntries([...o.cases.map((e) => [e.output, !0]), ...o.defaultOutput == null ? [] : [[o.defaultOutput, !0]]]), c = Object.fromEntries([...r.cases.map((e) => [e.output, !0]), ...r.defaultOutput == null ? [] : [[r.defaultOutput, !0]]]), l = o.input.handle == r.input.handle ? void 0 : [o.input.handle, r.input.handle], u = Ms(Object.keys(s).map((e) => ({ handle: e })), Object.keys(c).map((e) => ({ handle: e }))), d = new Set(Object.keys(c)), f = [];
12525
12541
  for (let e of a.edges) {
12526
12542
  if (e.source != n || e.sourceHandle == null) continue;
12527
12543
  let r = u != null && e.sourceHandle == u[0] ? u[1] : e.sourceHandle;
@@ -12570,11 +12586,11 @@ function ys(e, t, n, r) {
12570
12586
  value: r
12571
12587
  });
12572
12588
  }
12573
- f.push(...js(s.inputs, a, t, e));
12589
+ f.push(...Ns(s.inputs, a, t, e));
12574
12590
  }
12575
- return O(e.revision.content, f);
12591
+ return k(e.revision.content, f);
12576
12592
  }
12577
- function bs(e, t, n, r) {
12593
+ function Ss(e, t, n, r) {
12578
12594
  let a = e.node(t, n)?.node;
12579
12595
  if (a?.kind != "value") return;
12580
12596
  let o = r.map((e) => ({
@@ -12592,7 +12608,7 @@ function bs(e, t, n, r) {
12592
12608
  value: o
12593
12609
  }];
12594
12610
  }
12595
- function xs(e, t, n, r) {
12611
+ function Cs(e, t, n, r) {
12596
12612
  if (t.kind != "flow") return;
12597
12613
  let a = e.graph(t), o = a?.nodes[n];
12598
12614
  if (a == null || o?.kind != "wait") return;
@@ -12670,13 +12686,13 @@ function xs(e, t, n, r) {
12670
12686
  }
12671
12687
  });
12672
12688
  }
12673
- return u.length == 0 ? [] : os(e, O(e.revision.content, u), o.notification?.taskId == r.notification?.taskId ? void 0 : o.notification?.taskId);
12689
+ return u.length == 0 ? [] : cs(e, k(e.revision.content, u), o.notification?.taskId == r.notification?.taskId ? void 0 : o.notification?.taskId);
12674
12690
  }
12675
- function Ss(e, t, n, r) {
12676
- let i = e.graph({ kind: "flow" })?.nodes[t], a = as(n);
12677
- if (i?.kind == "wait" && a != null) return os(e, [{
12691
+ function ws(e, t, n, r) {
12692
+ let i = e.graph({ kind: "flow" })?.nodes[t], a = ss(n);
12693
+ if (i?.kind == "wait" && a != null) return cs(e, [{
12678
12694
  kind: "task.create",
12679
- task: is(n),
12695
+ task: os(n),
12680
12696
  taskId: r
12681
12697
  }, {
12682
12698
  before: {
@@ -12698,10 +12714,10 @@ function Ss(e, t, n, r) {
12698
12714
  }
12699
12715
  }], i.notification?.taskId);
12700
12716
  }
12701
- function Cs(e, t, n, r) {
12717
+ function Ts(e, t, n, r) {
12702
12718
  let i = e.graph(t)?.nodes[n];
12703
12719
  if (i?.kind == "task") switch (r.kind) {
12704
- case "code": return i.task == null ? void 0 : Ms(e, t, n, {
12720
+ case "code": return i.task == null ? void 0 : Ps(e, t, n, {
12705
12721
  ...i.task,
12706
12722
  name: r.name
12707
12723
  });
@@ -12734,33 +12750,33 @@ function Cs(e, t, n, r) {
12734
12750
  }
12735
12751
  }
12736
12752
  }
12737
- function ws(e, t, n, r) {
12753
+ function Es(e, t, n, r) {
12738
12754
  let a = e.node(t, n);
12739
12755
  if (a?.kind != "task" || a.node.task == null || a.module == null || i(a.node.task.inputs, r.inputs) && i(a.node.task.outputs, r.outputs)) return;
12740
- let o = Ms(e, t, n, {
12756
+ let o = Ps(e, t, n, {
12741
12757
  ...a.node.task,
12742
12758
  ...r
12743
12759
  });
12744
- if (o != null) return O(e.revision.content, o);
12760
+ if (o != null) return k(e.revision.content, o);
12745
12761
  }
12746
- function Ts(e, t, n, r) {
12762
+ function Ds(e, t, n, r) {
12747
12763
  let a = e.node(t, n);
12748
12764
  if (a?.kind != "task" || a.node.task != null || a.definition == null) return;
12749
12765
  let o = a.node;
12750
12766
  if (i(o.additionalInputs ?? [], r)) return;
12751
- let s = As(o.additionalInputs ?? [], r), c = new Set(a.definition.inputs.flatMap((e) => "handle" in e ? [e.handle] : []).concat(r.map((e) => e.handle))), l = Object.assign({}, o.inputs);
12767
+ let s = Ms(o.additionalInputs ?? [], r), c = new Set(a.definition.inputs.flatMap((e) => "handle" in e ? [e.handle] : []).concat(r.map((e) => e.handle))), l = Object.assign({}, o.inputs);
12752
12768
  s != null && Object.hasOwn(l, s[0]) && (l[s[1]] = l[s[0]], delete l[s[0]]);
12753
12769
  for (let e of Object.keys(l)) c.has(e) || delete l[e];
12754
12770
  let u = r.length == 0 ? void 0 : r;
12755
- return O(e.revision.content, [{
12771
+ return k(e.revision.content, [{
12756
12772
  before: o.additionalInputs,
12757
12773
  kind: "graph.node.additional-inputs.set",
12758
12774
  nodeId: n,
12759
12775
  target: t,
12760
12776
  value: u
12761
- }, ...js(o.inputs, l, t, n)]);
12777
+ }, ...Ns(o.inputs, l, t, n)]);
12762
12778
  }
12763
- function Es(e, t, n, r) {
12779
+ function Os(e, t, n, r) {
12764
12780
  let a = e.trigger(n);
12765
12781
  if (a == null || a.kind != "webhook") return;
12766
12782
  let o = {
@@ -12778,7 +12794,7 @@ function Es(e, t, n, r) {
12778
12794
  value: s
12779
12795
  }];
12780
12796
  }
12781
- function Ds(e, t, n) {
12797
+ function ks(e, t, n) {
12782
12798
  let r = e.subflow(t);
12783
12799
  if (r == null) return;
12784
12800
  let a = {
@@ -12793,11 +12809,11 @@ function Ds(e, t, n) {
12793
12809
  subflowId: t
12794
12810
  }];
12795
12811
  }
12796
- function Os(e, t, n, r) {
12812
+ function As(e, t, n, r) {
12797
12813
  return [{
12798
12814
  kind: "graph.node.create",
12799
12815
  node: {
12800
- inputs: ks(r),
12816
+ inputs: js(r),
12801
12817
  kind: "subflow",
12802
12818
  subflowId: n
12803
12819
  },
@@ -12805,17 +12821,17 @@ function Os(e, t, n, r) {
12805
12821
  target: e
12806
12822
  }];
12807
12823
  }
12808
- function ks(e) {
12824
+ function js(e) {
12809
12825
  return Object.fromEntries(e.flatMap((e) => "handle" in e && Object.hasOwn(e, "value") ? [[e.handle, {
12810
12826
  kind: "value",
12811
12827
  value: e.value
12812
12828
  }]] : []));
12813
12829
  }
12814
- function As(e, t) {
12830
+ function Ms(e, t) {
12815
12831
  let n = new Set(e.flatMap((e) => "handle" in e ? [e.handle] : [])), r = new Set(t.flatMap((e) => "handle" in e ? [e.handle] : [])), i = [...n].filter((e) => !r.has(e)), a = [...r].filter((e) => !n.has(e));
12816
12832
  return i.length == 1 && a.length == 1 ? [i[0], a[0]] : void 0;
12817
12833
  }
12818
- function js(e, t, n, r) {
12834
+ function Ns(e, t, n, r) {
12819
12835
  let a = /* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)]), o = [];
12820
12836
  for (let s of a) i(e[s], t[s]) || o.push({
12821
12837
  before: e[s],
@@ -12827,10 +12843,10 @@ function js(e, t, n, r) {
12827
12843
  });
12828
12844
  return o;
12829
12845
  }
12830
- function Ms(e, t, n, r) {
12846
+ function Ps(e, t, n, r) {
12831
12847
  let a = e.graph(t), o = a?.nodes[n];
12832
12848
  if (a == null || o?.kind != "task" || o.task == null) return;
12833
- let s = As(o.task.inputs, r.inputs), c = As(o.task.outputs, r.outputs), l = new Set(r.inputs.flatMap((e) => "handle" in e ? [e.handle] : [])), u = new Set(r.outputs.flatMap((e) => "handle" in e ? [e.handle] : [])), d = [];
12849
+ let s = Ms(o.task.inputs, r.inputs), c = Ms(o.task.outputs, r.outputs), l = new Set(r.inputs.flatMap((e) => "handle" in e ? [e.handle] : [])), u = new Set(r.outputs.flatMap((e) => "handle" in e ? [e.handle] : [])), d = [];
12834
12850
  for (let e of a.edges) {
12835
12851
  if (e.source != n || e.sourceHandle == null) continue;
12836
12852
  let r = c != null && e.sourceHandle == c[0] ? c[1] : e.sourceHandle;
@@ -12888,9 +12904,9 @@ function Ms(e, t, n, r) {
12888
12904
  value: a
12889
12905
  });
12890
12906
  }
12891
- d.push(...js(f.inputs, a, t, e));
12907
+ d.push(...Ns(f.inputs, a, t, e));
12892
12908
  }
12893
12909
  return d;
12894
12910
  }
12895
12911
  //#endregion
12896
- export { At as $, Bo as A, xa as B, qo as C, ao as D, Vo as E, eo as F, an as G, pn as H, Qa as I, Xt as J, Pt as K, Ja as L, Ho as M, Ro as N, No as O, lo as P, Qt as Q, Ha as R, Es as S, Wo as T, sn as U, k as V, dn as W, $t as X, qt as Y, Zt as Z, Ds as _, ss as a, _t as at, bs as b, _s as c, vt as ct, ws as d, gt as dt, kt as et, ys as f, pt as ft, ps as g, me as gt, gs as h, b as ht, ds as i, Dt as it, zo as j, Uo as k, vs as l, bt as lt, hs as m, _e as mt, ns as n, wt as nt, us as o, Ct as ot, ms as p, ut as pt, rn as q, rs as r, Et as rt, fs as s, St as st, ls as t, Ot as tt, Ss as u, xt as ut, Cs as v, Ko as w, xs as x, Ts as y, Ra as z };
12912
+ export { At as $, Ho as A, Sa as B, Yo as C, oo as D, Uo as E, to as F, an as G, pn as H, $a as I, Xt as J, Pt as K, Ya as L, Wo as M, Bo as N, Fo as O, uo as P, Qt as Q, Ua as R, Os as S, Ko as T, sn as U, A as V, dn as W, $t as X, qt as Y, Zt as Z, ks as _, ls as a, _t as at, Ss as b, ys as c, vt as ct, Es as d, gt as dt, kt as et, xs as f, pt as ft, hs as g, he as gt, vs as h, b as ht, ps as i, Dt as it, Vo as j, Go as k, bs as l, bt as lt, _s as m, ve as mt, is as n, wt as nt, fs as o, Ct as ot, gs as p, ut as pt, rn as q, as as r, Et as rt, ms as s, St as st, ds as t, Ot as tt, ws as u, xt as ut, Ts as v, Jo as w, Cs as x, Ds as y, za as z };