@babsey/code-graph 0.8.5 → 0.8.6
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.
- package/.vscode/extensions.json +3 -0
- package/dist/code-graph.js +122 -122
- package/dist/code-graph.umd.cjs +1 -1
- package/package.json +1 -1
package/dist/code-graph.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createElementBlock as k, openBlock as m, createElementVNode as f, createStaticVNode as Gt, defineComponent as ce, toRef as Sn, ref as ie, createVNode as X, unref as H, mergeModels as rs, useModel as na, resolveComponent as _s, createCommentVNode as K, onMounted as xn, onBeforeUnmount as ys, watch as gs, createBlock as ue, withCtx as Ye, normalizeProps as sa, guardReactiveProps as ra, renderSlot as Me, mergeProps as aa, toDisplayString as te, computed as z, onUpdated as bs, normalizeStyle as On, normalizeClass as je, withModifiers as st, withDirectives as Vt, Fragment as ae, createTextVNode as ws, withKeys as hn, vModelText as jt, renderList as Ke, nextTick as ks, resolveDynamicComponent as as, inject as ia, Transition as oa, reactive as Ae, markRaw as he, shallowReadonly as la } from "vue";
|
|
2
|
-
import { BaklavaEditor as ua, Components as fn, useViewModel as kt, useGraph as Cn, useTemporaryConnection as da, useTransform as ca, useNodeCategories as ha, displayInSidebar as Ms, CheckboxInterfaceComponent as fa, IntegerInterfaceComponent as pa, TextInputInterfaceComponent as Ss, NumberInterfaceComponent as ma, SelectInterfaceComponent as va, SliderInterfaceComponent as _a, TextareaInputInterfaceComponent as ya, Commands as He, DEFAULT_TOOLBAR_COMMANDS as ga, TextInputInterface as xs, DEFAULT_SETTINGS as ba, useCommandHandler as wa, useHistory as ka, useClipboard as Ma, registerDeleteNodesCommand as Sa, registerSaveSubgraphCommand as xa, registerSwitchToMainGraphCommand as Oa, registerSidebarCommands as Ca, registerZoomToFitCommands as
|
|
2
|
+
import { BaklavaEditor as ua, Components as fn, useViewModel as kt, useGraph as Cn, useTemporaryConnection as da, useTransform as ca, useNodeCategories as ha, displayInSidebar as Ms, CheckboxInterfaceComponent as fa, IntegerInterfaceComponent as pa, TextInputInterfaceComponent as Ss, NumberInterfaceComponent as ma, SelectInterfaceComponent as va, SliderInterfaceComponent as _a, TextareaInputInterfaceComponent as ya, Commands as He, DEFAULT_TOOLBAR_COMMANDS as ga, TextInputInterface as xs, DEFAULT_SETTINGS as ba, useCommandHandler as wa, useHistory as ka, useClipboard as Ma, registerDeleteNodesCommand as Sa, registerSaveSubgraphCommand as xa, registerSwitchToMainGraphCommand as Oa, registerSidebarCommands as Ca, registerZoomToFitCommands as Ta, setViewNodeProperties as Na } from "@baklavajs/renderer-vue";
|
|
3
3
|
import { GRAPH_NODE_TYPE_PREFIX as Da, AbstractNode as Ia, NodeInterface as Se, Graph as Ya, getGraphNodeTypeString as Os, GraphTemplate as Ea, GRAPH_INPUT_NODE_TYPE as Ra, GRAPH_OUTPUT_NODE_TYPE as Pa, Editor as La } from "@baklavajs/core";
|
|
4
4
|
import { usePointer as Aa } from "@vueuse/core";
|
|
5
5
|
import ut from "mustache";
|
|
@@ -35,7 +35,7 @@ function Va(e, t) {
|
|
|
35
35
|
f("path", { d: "M5 12l5 5l10 -10" }, null, -1)
|
|
36
36
|
])]);
|
|
37
37
|
}
|
|
38
|
-
const
|
|
38
|
+
const Ts = /* @__PURE__ */ q(Fa, [["render", Va]]), ja = {}, za = {
|
|
39
39
|
xmlns: "http://www.w3.org/2000/svg",
|
|
40
40
|
width: "24",
|
|
41
41
|
height: "24",
|
|
@@ -57,7 +57,7 @@ function Ba(e, t) {
|
|
|
57
57
|
f("path", { d: "M4 8m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v4a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z" }, null, -1)
|
|
58
58
|
])]);
|
|
59
59
|
}
|
|
60
|
-
const
|
|
60
|
+
const Ns = /* @__PURE__ */ q(ja, [["render", Ba]]), Za = {}, qa = {
|
|
61
61
|
xmlns: "http://www.w3.org/2000/svg",
|
|
62
62
|
width: "24",
|
|
63
63
|
height: "24",
|
|
@@ -218,7 +218,7 @@ function bi(e, t) {
|
|
|
218
218
|
f("path", { d: "M18 3a3 3 0 0 1 2.995 2.824l.005 .176v12a3 3 0 0 1 -2.824 2.995l-.176 .005h-12a3 3 0 0 1 -2.995 -2.824l-.005 -.176v-12a3 3 0 0 1 2.824 -2.995l.176 -.005h12zm-3 2h-9a1 1 0 0 0 -.993 .883l-.007 .117v12a1 1 0 0 0 .883 .993l.117 .007h9v-14zm-3.293 4.293a1 1 0 0 1 .083 1.32l-.083 .094l-1.292 1.293l1.292 1.293a1 1 0 0 1 .083 1.32l-.083 .094a1 1 0 0 1 -1.32 .083l-.094 -.083l-2 -2a1 1 0 0 1 -.083 -1.32l.083 -.094l2 -2a1 1 0 0 1 1.414 0z" }, null, -1)
|
|
219
219
|
])]);
|
|
220
220
|
}
|
|
221
|
-
const
|
|
221
|
+
const Tn = /* @__PURE__ */ q(yi, [["render", bi]]), wi = {}, ki = {
|
|
222
222
|
xmlns: "http://www.w3.org/2000/svg",
|
|
223
223
|
width: "24",
|
|
224
224
|
height: "24",
|
|
@@ -235,7 +235,7 @@ function Mi(e, t) {
|
|
|
235
235
|
Gt('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M11.5 21h-4.5a2 2 0 0 1 -2 -2v-6a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2"></path><path d="M11 16a1 1 0 1 0 2 0a1 1 0 0 0 -2 0"></path><path d="M8 11v-4a4 4 0 1 1 8 0v4"></path><path d="M20 21l2 -2l-2 -2"></path><path d="M17 17l-2 2l2 2"></path>', 6)
|
|
236
236
|
])]);
|
|
237
237
|
}
|
|
238
|
-
const
|
|
238
|
+
const Nn = /* @__PURE__ */ q(wi, [["render", Mi]]), Si = {}, xi = {
|
|
239
239
|
xmlns: "http://www.w3.org/2000/svg",
|
|
240
240
|
width: "24",
|
|
241
241
|
height: "24",
|
|
@@ -257,7 +257,7 @@ function Oi(e, t) {
|
|
|
257
257
|
f("path", { d: "M7 4v16l13 -8z" }, null, -1)
|
|
258
258
|
])]);
|
|
259
259
|
}
|
|
260
|
-
const Ci = /* @__PURE__ */ q(Si, [["render", Oi]]),
|
|
260
|
+
const Ci = /* @__PURE__ */ q(Si, [["render", Oi]]), Ti = {}, Ni = {
|
|
261
261
|
xmlns: "http://www.w3.org/2000/svg",
|
|
262
262
|
width: "24",
|
|
263
263
|
height: "24",
|
|
@@ -270,7 +270,7 @@ const Ci = /* @__PURE__ */ q(Si, [["render", Oi]]), Ni = {}, Ti = {
|
|
|
270
270
|
class: "baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-plus"
|
|
271
271
|
};
|
|
272
272
|
function Di(e, t) {
|
|
273
|
-
return m(), k("svg",
|
|
273
|
+
return m(), k("svg", Ni, [...t[0] || (t[0] = [
|
|
274
274
|
f("path", {
|
|
275
275
|
stroke: "none",
|
|
276
276
|
d: "M0 0h24v24H0z",
|
|
@@ -280,7 +280,7 @@ function Di(e, t) {
|
|
|
280
280
|
f("path", { d: "M5 12l14 0" }, null, -1)
|
|
281
281
|
])]);
|
|
282
282
|
}
|
|
283
|
-
const Rs = /* @__PURE__ */ q(
|
|
283
|
+
const Rs = /* @__PURE__ */ q(Ti, [["render", Di]]), Ii = {}, Yi = {
|
|
284
284
|
xmlns: "http://www.w3.org/2000/svg",
|
|
285
285
|
width: "24",
|
|
286
286
|
height: "24",
|
|
@@ -404,8 +404,8 @@ function Zi(e, t) {
|
|
|
404
404
|
}
|
|
405
405
|
const Ws = /* @__PURE__ */ q(zi, [["render", Zi]]), Eh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
406
406
|
__proto__: null,
|
|
407
|
-
Check:
|
|
408
|
-
CodeVariable:
|
|
407
|
+
Check: Ts,
|
|
408
|
+
CodeVariable: Ns,
|
|
409
409
|
Copy: Ds,
|
|
410
410
|
DotsVertical: Is,
|
|
411
411
|
Download: Ys,
|
|
@@ -413,8 +413,8 @@ const Ws = /* @__PURE__ */ q(zi, [["render", Zi]]), Eh = /* @__PURE__ */ Object.
|
|
|
413
413
|
LayoutSidebarLeftExpand: di,
|
|
414
414
|
LayoutSidebarRight: pi,
|
|
415
415
|
LayoutSidebarRightCollapse: Es,
|
|
416
|
-
LayoutSidebarRightExpand:
|
|
417
|
-
LockCode:
|
|
416
|
+
LayoutSidebarRightExpand: Tn,
|
|
417
|
+
LockCode: Nn,
|
|
418
418
|
PlayerPlay: Ci,
|
|
419
419
|
Plus: Rs,
|
|
420
420
|
Restore: Ps,
|
|
@@ -465,37 +465,37 @@ function Xi() {
|
|
|
465
465
|
function g(b) {
|
|
466
466
|
var S = document.documentElement.getAttribute("dir") === "rtl", M = document.createElement("textarea");
|
|
467
467
|
M.style.fontSize = "12pt", M.style.border = "0", M.style.padding = "0", M.style.margin = "0", M.style.position = "absolute", M.style[S ? "right" : "left"] = "-9999px";
|
|
468
|
-
var
|
|
469
|
-
return M.style.top = "".concat(
|
|
468
|
+
var T = window.pageYOffset || document.documentElement.scrollTop;
|
|
469
|
+
return M.style.top = "".concat(T, "px"), M.setAttribute("readonly", ""), M.value = b, M;
|
|
470
470
|
}
|
|
471
471
|
var $ = function(S, M) {
|
|
472
|
-
var
|
|
473
|
-
M.container.appendChild(
|
|
474
|
-
var D = I()(
|
|
475
|
-
return y("copy"),
|
|
472
|
+
var T = g(S);
|
|
473
|
+
M.container.appendChild(T);
|
|
474
|
+
var D = I()(T);
|
|
475
|
+
return y("copy"), T.remove(), D;
|
|
476
476
|
}, A = function(S) {
|
|
477
477
|
var M = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
|
|
478
478
|
container: document.body
|
|
479
|
-
},
|
|
480
|
-
return typeof S == "string" ?
|
|
479
|
+
}, T = "";
|
|
480
|
+
return typeof S == "string" ? T = $(S, M) : S instanceof HTMLInputElement && !["text", "search", "url", "tel", "password"].includes(S?.type) ? T = $(S.value, M) : (T = I()(S), y("copy")), T;
|
|
481
481
|
}, F = A;
|
|
482
|
-
function
|
|
482
|
+
function Te(b) {
|
|
483
483
|
"@babel/helpers - typeof";
|
|
484
|
-
return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ?
|
|
484
|
+
return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? Te = function(M) {
|
|
485
485
|
return typeof M;
|
|
486
|
-
} :
|
|
486
|
+
} : Te = function(M) {
|
|
487
487
|
return M && typeof Symbol == "function" && M.constructor === Symbol && M !== Symbol.prototype ? "symbol" : typeof M;
|
|
488
|
-
},
|
|
488
|
+
}, Te(b);
|
|
489
489
|
}
|
|
490
|
-
var
|
|
491
|
-
var S = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, M = S.action,
|
|
492
|
-
if (
|
|
490
|
+
var Ne = function() {
|
|
491
|
+
var S = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, M = S.action, T = M === void 0 ? "copy" : M, D = S.container, R = S.target, me = S.text;
|
|
492
|
+
if (T !== "copy" && T !== "cut")
|
|
493
493
|
throw new Error('Invalid "action" value, use either "copy" or "cut"');
|
|
494
494
|
if (R !== void 0)
|
|
495
|
-
if (R &&
|
|
496
|
-
if (
|
|
495
|
+
if (R && Te(R) === "object" && R.nodeType === 1) {
|
|
496
|
+
if (T === "copy" && R.hasAttribute("disabled"))
|
|
497
497
|
throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');
|
|
498
|
-
if (
|
|
498
|
+
if (T === "cut" && (R.hasAttribute("readonly") || R.hasAttribute("disabled")))
|
|
499
499
|
throw new Error(`Invalid "target" attribute. You can't cut text from elements with "readonly" or "disabled" attributes`);
|
|
500
500
|
} else
|
|
501
501
|
throw new Error('Invalid "target" value, use a valid Element');
|
|
@@ -504,10 +504,10 @@ function Xi() {
|
|
|
504
504
|
container: D
|
|
505
505
|
});
|
|
506
506
|
if (R)
|
|
507
|
-
return
|
|
507
|
+
return T === "cut" ? c(R) : F(R, {
|
|
508
508
|
container: D
|
|
509
509
|
});
|
|
510
|
-
}, ft =
|
|
510
|
+
}, ft = Ne;
|
|
511
511
|
function we(b) {
|
|
512
512
|
"@babel/helpers - typeof";
|
|
513
513
|
return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? we = function(M) {
|
|
@@ -522,8 +522,8 @@ function Xi() {
|
|
|
522
522
|
}
|
|
523
523
|
function Q(b, S) {
|
|
524
524
|
for (var M = 0; M < S.length; M++) {
|
|
525
|
-
var
|
|
526
|
-
|
|
525
|
+
var T = S[M];
|
|
526
|
+
T.enumerable = T.enumerable || !1, T.configurable = !0, "value" in T && (T.writable = !0), Object.defineProperty(b, T.key, T);
|
|
527
527
|
}
|
|
528
528
|
}
|
|
529
529
|
function se(b, S, M) {
|
|
@@ -535,23 +535,23 @@ function Xi() {
|
|
|
535
535
|
b.prototype = Object.create(S && S.prototype, { constructor: { value: b, writable: !0, configurable: !0 } }), S && pt(b, S);
|
|
536
536
|
}
|
|
537
537
|
function pt(b, S) {
|
|
538
|
-
return pt = Object.setPrototypeOf || function(
|
|
539
|
-
return
|
|
538
|
+
return pt = Object.setPrototypeOf || function(T, D) {
|
|
539
|
+
return T.__proto__ = D, T;
|
|
540
540
|
}, pt(b, S);
|
|
541
541
|
}
|
|
542
|
-
function
|
|
542
|
+
function Tt(b) {
|
|
543
543
|
var S = Dt();
|
|
544
544
|
return function() {
|
|
545
|
-
var
|
|
545
|
+
var T = ze(b), D;
|
|
546
546
|
if (S) {
|
|
547
547
|
var R = ze(this).constructor;
|
|
548
|
-
D = Reflect.construct(
|
|
548
|
+
D = Reflect.construct(T, arguments, R);
|
|
549
549
|
} else
|
|
550
|
-
D =
|
|
551
|
-
return
|
|
550
|
+
D = T.apply(this, arguments);
|
|
551
|
+
return Nt(this, D);
|
|
552
552
|
};
|
|
553
553
|
}
|
|
554
|
-
function
|
|
554
|
+
function Nt(b, S) {
|
|
555
555
|
return S && (we(S) === "object" || typeof S == "function") ? S : on(b);
|
|
556
556
|
}
|
|
557
557
|
function on(b) {
|
|
@@ -581,10 +581,10 @@ function Xi() {
|
|
|
581
581
|
}
|
|
582
582
|
var W = /* @__PURE__ */ (function(b) {
|
|
583
583
|
an(M, b);
|
|
584
|
-
var S =
|
|
585
|
-
function M(
|
|
584
|
+
var S = Tt(M);
|
|
585
|
+
function M(T, D) {
|
|
586
586
|
var R;
|
|
587
|
-
return C(this, M), R = S.call(this), R.resolveOptions(D), R.listenClick(
|
|
587
|
+
return C(this, M), R = S.call(this), R.resolveOptions(D), R.listenClick(T), R;
|
|
588
588
|
}
|
|
589
589
|
return se(M, [{
|
|
590
590
|
key: "resolveOptions",
|
|
@@ -946,7 +946,7 @@ const Qi = /* @__PURE__ */ qi(Ji), eo = (e) => ({
|
|
|
946
946
|
};
|
|
947
947
|
return (i, o) => (m(), k("div", null, [
|
|
948
948
|
r.value ? (m(), k("button", to, [
|
|
949
|
-
X(H(
|
|
949
|
+
X(H(Ts))
|
|
950
950
|
])) : (m(), k("button", {
|
|
951
951
|
key: 1,
|
|
952
952
|
onClick: a,
|
|
@@ -978,7 +978,7 @@ const Qi = /* @__PURE__ */ qi(Ji), eo = (e) => ({
|
|
|
978
978
|
title: "The code is locked.",
|
|
979
979
|
onClick: i[0] || (i[0] = (l) => r(!1))
|
|
980
980
|
}, [
|
|
981
|
-
X(H(
|
|
981
|
+
X(H(Nn))
|
|
982
982
|
])) : K("", !0),
|
|
983
983
|
X(Hs, { text: e.modelValue }, null, 8, ["text"])
|
|
984
984
|
]),
|
|
@@ -1067,11 +1067,11 @@ const Qi = /* @__PURE__ */ qi(Ji), eo = (e) => ({
|
|
|
1067
1067
|
"--hidden": a.value.state?.hidden
|
|
1068
1068
|
})), F = z(() => ({
|
|
1069
1069
|
"--reverse-y": r.node.reverseY ?? o.value.settings.nodes.reverseY
|
|
1070
|
-
})),
|
|
1070
|
+
})), Te = z(() => ({
|
|
1071
1071
|
top: `${r.node.position?.y ?? 0}px`,
|
|
1072
1072
|
left: `${r.node.position?.x ?? 0}px`,
|
|
1073
1073
|
"--width": `${r.node.width ?? o.value.settings.nodes.defaultWidth}px`
|
|
1074
|
-
})),
|
|
1074
|
+
})), Ne = z(() => Object.values(r.node.inputs).filter((W) => !W.hidden)), ft = z(() => Object.values(r.node.outputs).filter((W) => !W.hidden)), we = () => {
|
|
1075
1075
|
an(), i("select");
|
|
1076
1076
|
}, C = (W) => {
|
|
1077
1077
|
r.selected || we(), i("start-drag", W);
|
|
@@ -1092,15 +1092,15 @@ const Qi = /* @__PURE__ */ qi(Ji), eo = (e) => ({
|
|
|
1092
1092
|
l.value.removeNode(r.node);
|
|
1093
1093
|
break;
|
|
1094
1094
|
case "rename":
|
|
1095
|
-
p.value = r.node.
|
|
1095
|
+
p.value = r.node.title, w.value = !0, await ks(), I.value?.focus();
|
|
1096
1096
|
break;
|
|
1097
1097
|
case "editSubgraph":
|
|
1098
1098
|
u(r.node.template);
|
|
1099
1099
|
break;
|
|
1100
1100
|
}
|
|
1101
|
-
}, Nt = () => {
|
|
1102
|
-
a.value.state.variableName = p.value, a.value.events.titleChanged.emit(a.value.state.variableName), w.value = !1;
|
|
1103
1101
|
}, Tt = () => {
|
|
1102
|
+
a.value.title = p.value, a.value.events.titleChanged.emit(a.value.title), w.value = !1;
|
|
1103
|
+
}, Nt = () => {
|
|
1104
1104
|
h.value && o.value.hooks.renderNode.execute({ node: r.node, el: h.value });
|
|
1105
1105
|
}, on = (W) => {
|
|
1106
1106
|
y.value = !0, O = r.node.width, c = W.clientX, W.preventDefault();
|
|
@@ -1114,14 +1114,14 @@ const Qi = /* @__PURE__ */ qi(Ji), eo = (e) => ({
|
|
|
1114
1114
|
y.value = !1;
|
|
1115
1115
|
};
|
|
1116
1116
|
return xn(() => {
|
|
1117
|
-
|
|
1118
|
-
}), bs(
|
|
1117
|
+
Nt(), window.addEventListener("mousemove", ze), window.addEventListener("mouseup", et);
|
|
1118
|
+
}), bs(Nt), ys(() => {
|
|
1119
1119
|
window.removeEventListener("mousemove", ze), window.removeEventListener("mouseup", et);
|
|
1120
1120
|
}), (W, B) => (m(), k("div", {
|
|
1121
1121
|
class: je([A.value, "baklava-node"]),
|
|
1122
1122
|
"data-node-type": a.value.type,
|
|
1123
1123
|
id: a.value.id,
|
|
1124
|
-
style: On(
|
|
1124
|
+
style: On(Te.value),
|
|
1125
1125
|
ref_key: "el",
|
|
1126
1126
|
ref: h,
|
|
1127
1127
|
onPointerdown: we
|
|
@@ -1151,27 +1151,27 @@ const Qi = /* @__PURE__ */ qi(Ji), eo = (e) => ({
|
|
|
1151
1151
|
ref: I,
|
|
1152
1152
|
"onUpdate:modelValue": B[4] || (B[4] = (b) => p.value = b),
|
|
1153
1153
|
class: "baklava-input",
|
|
1154
|
-
placeholder: "
|
|
1154
|
+
placeholder: "Title",
|
|
1155
1155
|
style: { "flex-grow": "1" },
|
|
1156
1156
|
type: "text",
|
|
1157
|
-
onBlur:
|
|
1158
|
-
onKeydown: hn(
|
|
1157
|
+
onBlur: Tt,
|
|
1158
|
+
onKeydown: hn(Tt, ["enter"])
|
|
1159
1159
|
}, null, 544)), [
|
|
1160
1160
|
[jt, p.value]
|
|
1161
1161
|
]) : (m(), k(ae, { key: 1 }, [
|
|
1162
1162
|
f("div", uo, [
|
|
1163
|
-
a.value.idx > -1 ? (m(), k("span", co, te(a.value.idx + 1) + "
|
|
1164
|
-
ws(" " + te(a.value.
|
|
1163
|
+
a.value.idx > -1 ? (m(), k("span", co, te(a.value.idx + 1) + " - ", 1)) : K("", !0),
|
|
1164
|
+
ws(" " + te(a.value.title), 1)
|
|
1165
1165
|
]),
|
|
1166
1166
|
f("div", ho, [
|
|
1167
1167
|
a.value.isCodeNode ? (m(), k(ae, { key: 0 }, [
|
|
1168
|
-
a.value.state.lockCode ? (m(), ue(H(
|
|
1168
|
+
a.value.state.lockCode ? (m(), ue(H(Nn), {
|
|
1169
1169
|
key: 0,
|
|
1170
1170
|
class: "--clickable mx-1",
|
|
1171
1171
|
onClick: B[0] || (B[0] = (b) => a.value.lockCode = !1)
|
|
1172
1172
|
})) : K("", !0),
|
|
1173
1173
|
a.value.hasConnectedOutputNodes ? (m(), k(ae, { key: 1 }, [
|
|
1174
|
-
a.value.state.integrated ? (m(), ue(H(
|
|
1174
|
+
a.value.state.integrated ? (m(), ue(H(Ns), {
|
|
1175
1175
|
key: 1,
|
|
1176
1176
|
class: "--clickable mx-1",
|
|
1177
1177
|
onClick: B[2] || (B[2] = (b) => Dt(!1))
|
|
@@ -1181,7 +1181,7 @@ const Qi = /* @__PURE__ */ qi(Ji), eo = (e) => ({
|
|
|
1181
1181
|
onClick: B[1] || (B[1] = (b) => Dt(!0))
|
|
1182
1182
|
}))
|
|
1183
1183
|
], 64)) : K("", !0),
|
|
1184
|
-
a.value.isSelected && !H(o).displayedGraph.sidebar.visible ? (m(), ue(H(
|
|
1184
|
+
a.value.isSelected && !H(o).displayedGraph.sidebar.visible ? (m(), ue(H(Tn), {
|
|
1185
1185
|
key: 2,
|
|
1186
1186
|
class: "--clickable mx-1",
|
|
1187
1187
|
onClick: se
|
|
@@ -1245,7 +1245,7 @@ const Qi = /* @__PURE__ */ qi(Ji), eo = (e) => ({
|
|
|
1245
1245
|
], 64))), 128))
|
|
1246
1246
|
]),
|
|
1247
1247
|
f("div", vo, [
|
|
1248
|
-
(m(!0), k(ae, null, Ke(
|
|
1248
|
+
(m(!0), k(ae, null, Ke(Ne.value, (b) => (m(), k(ae, {
|
|
1249
1249
|
key: b.id
|
|
1250
1250
|
}, [
|
|
1251
1251
|
a.value.state?.hidden ? (m(), k("div", _o, [
|
|
@@ -1343,7 +1343,7 @@ const Qi = /* @__PURE__ */ qi(Ji), eo = (e) => ({
|
|
|
1343
1343
|
e.name ? (m(), k("div", ko, te(e.name), 1)) : K("", !0)
|
|
1344
1344
|
], 10, wo));
|
|
1345
1345
|
}
|
|
1346
|
-
}), Mo = { class: "__header" }, So = { class: "__node-name" }, xo = { class: "__interfaces" }, Oo = { class: "__inputs" }, Co = { style: { display: "flex" } },
|
|
1346
|
+
}), Mo = { class: "__header" }, So = { class: "__node-name" }, xo = { class: "__interfaces" }, Oo = { class: "__inputs" }, Co = { style: { display: "flex" } }, To = { class: "__outputs" }, No = {
|
|
1347
1347
|
key: 0,
|
|
1348
1348
|
class: "__interface"
|
|
1349
1349
|
}, Do = ["placeholder"], Io = { style: { display: "flex" } }, Gs = /* @__PURE__ */ ce({
|
|
@@ -1422,8 +1422,8 @@ const Qi = /* @__PURE__ */ qi(Ji), eo = (e) => ({
|
|
|
1422
1422
|
])
|
|
1423
1423
|
]))), 128))
|
|
1424
1424
|
]),
|
|
1425
|
-
f("div",
|
|
1426
|
-
u.value && u.value.state ? (m(), k("div",
|
|
1425
|
+
f("div", To, [
|
|
1426
|
+
u.value && u.value.state ? (m(), k("div", No, [
|
|
1427
1427
|
$[3] || ($[3] = f("label", null, "Variable name", -1)),
|
|
1428
1428
|
Vt(f("input", {
|
|
1429
1429
|
"onUpdate:modelValue": $[1] || ($[1] = (A) => u.value.state.variableName = A),
|
|
@@ -2429,7 +2429,7 @@ function ol() {
|
|
|
2429
2429
|
weekdayMismatch: !1
|
|
2430
2430
|
};
|
|
2431
2431
|
}
|
|
2432
|
-
function
|
|
2432
|
+
function N(e) {
|
|
2433
2433
|
return e._pf == null && (e._pf = ol()), e._pf;
|
|
2434
2434
|
}
|
|
2435
2435
|
var _n;
|
|
@@ -2442,7 +2442,7 @@ Array.prototype.some ? _n = Array.prototype.some : _n = function(e) {
|
|
|
2442
2442
|
};
|
|
2443
2443
|
function Ln(e) {
|
|
2444
2444
|
var t = null, n = !1, s = e._d && !isNaN(e._d.getTime());
|
|
2445
|
-
if (s && (t =
|
|
2445
|
+
if (s && (t = N(e), n = _n.call(t.parsedDateParts, function(r) {
|
|
2446
2446
|
return r != null;
|
|
2447
2447
|
}), s = t.overflow < 0 && !t.empty && !t.invalidEra && !t.invalidMonth && !t.invalidWeekday && !t.weekdayMismatch && !t.nullInput && !t.invalidFormat && !t.userInvalidated && (!t.meridiem || t.meridiem && n), e._strict && (s = s && t.charsLeftOver === 0 && t.unusedTokens.length === 0 && t.bigHour === void 0)), Object.isFrozen == null || !Object.isFrozen(e))
|
|
2448
2448
|
e._isValid = s;
|
|
@@ -2452,12 +2452,12 @@ function Ln(e) {
|
|
|
2452
2452
|
}
|
|
2453
2453
|
function zt(e) {
|
|
2454
2454
|
var t = Oe(NaN);
|
|
2455
|
-
return e != null ? Fe(
|
|
2455
|
+
return e != null ? Fe(N(t), e) : N(t).userInvalidated = !0, t;
|
|
2456
2456
|
}
|
|
2457
2457
|
var ls = v.momentProperties = [], ln = !1;
|
|
2458
2458
|
function An(e, t) {
|
|
2459
2459
|
var n, s, r, a = ls.length;
|
|
2460
|
-
if (re(t._isAMomentObject) || (e._isAMomentObject = t._isAMomentObject), re(t._i) || (e._i = t._i), re(t._f) || (e._f = t._f), re(t._l) || (e._l = t._l), re(t._strict) || (e._strict = t._strict), re(t._tzm) || (e._tzm = t._tzm), re(t._isUTC) || (e._isUTC = t._isUTC), re(t._offset) || (e._offset = t._offset), re(t._pf) || (e._pf =
|
|
2460
|
+
if (re(t._isAMomentObject) || (e._isAMomentObject = t._isAMomentObject), re(t._i) || (e._i = t._i), re(t._f) || (e._f = t._f), re(t._l) || (e._l = t._l), re(t._strict) || (e._strict = t._strict), re(t._tzm) || (e._tzm = t._tzm), re(t._isUTC) || (e._isUTC = t._isUTC), re(t._offset) || (e._offset = t._offset), re(t._pf) || (e._pf = N(t)), re(t._locale) || (e._locale = t._locale), a > 0)
|
|
2461
2461
|
for (n = 0; n < a; n++)
|
|
2462
2462
|
s = ls[n], r = t[s], re(r) || (e[s] = r);
|
|
2463
2463
|
return e;
|
|
@@ -2731,9 +2731,9 @@ function _(e, t, n) {
|
|
|
2731
2731
|
};
|
|
2732
2732
|
}
|
|
2733
2733
|
function Cl(e, t) {
|
|
2734
|
-
return P(Ut, e) ? Ut[e](t._strict, t._locale) : new RegExp(
|
|
2734
|
+
return P(Ut, e) ? Ut[e](t._strict, t._locale) : new RegExp(Tl(e));
|
|
2735
2735
|
}
|
|
2736
|
-
function
|
|
2736
|
+
function Tl(e) {
|
|
2737
2737
|
return Pe(
|
|
2738
2738
|
e.replace("\\", "").replace(
|
|
2739
2739
|
/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,
|
|
@@ -2766,7 +2766,7 @@ function Ct(e, t) {
|
|
|
2766
2766
|
r._w = r._w || {}, t(n, r._w, r, a);
|
|
2767
2767
|
});
|
|
2768
2768
|
}
|
|
2769
|
-
function
|
|
2769
|
+
function Nl(e, t, n) {
|
|
2770
2770
|
t != null && P(bn, e) && bn[e](t, n._a, n, e);
|
|
2771
2771
|
}
|
|
2772
2772
|
function Jt(e) {
|
|
@@ -2917,7 +2917,7 @@ U(["M", "MM"], function(e, t) {
|
|
|
2917
2917
|
});
|
|
2918
2918
|
U(["MMM", "MMMM"], function(e, t, n, s) {
|
|
2919
2919
|
var r = n._locale.monthsParse(e, s, n._strict);
|
|
2920
|
-
r != null ? t[Ee] = r :
|
|
2920
|
+
r != null ? t[Ee] = r : N(n).invalidMonth = e;
|
|
2921
2921
|
});
|
|
2922
2922
|
var Ll = "January_February_March_April_May_June_July_August_September_October_November_December".split(
|
|
2923
2923
|
"_"
|
|
@@ -3087,7 +3087,7 @@ _("dddd", function(e, t) {
|
|
|
3087
3087
|
});
|
|
3088
3088
|
Ct(["dd", "ddd", "dddd"], function(e, t, n, s) {
|
|
3089
3089
|
var r = n._locale.weekdaysParse(e, s, n._strict);
|
|
3090
|
-
r != null ? t.d = r :
|
|
3090
|
+
r != null ? t.d = r : N(n).invalidWeekday = e;
|
|
3091
3091
|
});
|
|
3092
3092
|
Ct(["d", "e", "E"], function(e, t, n, s) {
|
|
3093
3093
|
t[s] = Y(e);
|
|
@@ -3253,15 +3253,15 @@ U(["a", "A"], function(e, t, n) {
|
|
|
3253
3253
|
n._isPm = n._locale.isPM(e), n._meridiem = e;
|
|
3254
3254
|
});
|
|
3255
3255
|
U(["h", "hh"], function(e, t, n) {
|
|
3256
|
-
t[J] = Y(e),
|
|
3256
|
+
t[J] = Y(e), N(n).bigHour = !0;
|
|
3257
3257
|
});
|
|
3258
3258
|
U("hmm", function(e, t, n) {
|
|
3259
3259
|
var s = e.length - 2;
|
|
3260
|
-
t[J] = Y(e.substr(0, s)), t[ve] = Y(e.substr(s)),
|
|
3260
|
+
t[J] = Y(e.substr(0, s)), t[ve] = Y(e.substr(s)), N(n).bigHour = !0;
|
|
3261
3261
|
});
|
|
3262
3262
|
U("hmmss", function(e, t, n) {
|
|
3263
3263
|
var s = e.length - 4, r = e.length - 2;
|
|
3264
|
-
t[J] = Y(e.substr(0, s)), t[ve] = Y(e.substr(s, 2)), t[Re] = Y(e.substr(r)),
|
|
3264
|
+
t[J] = Y(e.substr(0, s)), t[ve] = Y(e.substr(s, 2)), t[Re] = Y(e.substr(r)), N(n).bigHour = !0;
|
|
3265
3265
|
});
|
|
3266
3266
|
U("Hmm", function(e, t, n) {
|
|
3267
3267
|
var s = e.length - 2;
|
|
@@ -3383,9 +3383,9 @@ function Ou() {
|
|
|
3383
3383
|
}
|
|
3384
3384
|
function qn(e) {
|
|
3385
3385
|
var t, n = e._a;
|
|
3386
|
-
return n &&
|
|
3386
|
+
return n && N(e).overflow === -2 && (t = n[Ee] < 0 || n[Ee] > 11 ? Ee : n[ke] < 1 || n[ke] > Vn(n[ee], n[Ee]) ? ke : n[J] < 0 || n[J] > 24 || n[J] === 24 && (n[ve] !== 0 || n[Re] !== 0 || n[Ze] !== 0) ? J : n[ve] < 0 || n[ve] > 59 ? ve : n[Re] < 0 || n[Re] > 59 ? Re : n[Ze] < 0 || n[Ze] > 999 ? Ze : -1, N(e)._overflowDayOfYear && (t < ee || t > ke) && (t = ke), N(e)._overflowWeeks && t === -1 && (t = Dl), N(e)._overflowWeekday && t === -1 && (t = Il), N(e).overflow = t), e;
|
|
3387
3387
|
}
|
|
3388
|
-
var Cu = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,
|
|
3388
|
+
var Cu = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/, Tu = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/, Nu = /Z|[+-]\d\d(?::?\d\d)?/, Et = [
|
|
3389
3389
|
["YYYYYY-MM-DD", /[+-]\d{6}-\d\d-\d\d/],
|
|
3390
3390
|
["YYYY-MM-DD", /\d{4}-\d\d-\d\d/],
|
|
3391
3391
|
["GGGG-[W]WW-E", /\d{4}-W\d\d-\d/],
|
|
@@ -3422,9 +3422,9 @@ var Cu = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(
|
|
|
3422
3422
|
PST: -480
|
|
3423
3423
|
};
|
|
3424
3424
|
function wr(e) {
|
|
3425
|
-
var t, n, s = e._i, r = Cu.exec(s) ||
|
|
3425
|
+
var t, n, s = e._i, r = Cu.exec(s) || Tu.exec(s), a, i, o, l, u = Et.length, h = dn.length;
|
|
3426
3426
|
if (r) {
|
|
3427
|
-
for (
|
|
3427
|
+
for (N(e).iso = !0, t = 0, n = u; t < n; t++)
|
|
3428
3428
|
if (Et[t][1].exec(r[1])) {
|
|
3429
3429
|
i = Et[t][0], a = Et[t][2] !== !1;
|
|
3430
3430
|
break;
|
|
@@ -3449,7 +3449,7 @@ function wr(e) {
|
|
|
3449
3449
|
return;
|
|
3450
3450
|
}
|
|
3451
3451
|
if (r[4])
|
|
3452
|
-
if (
|
|
3452
|
+
if (Nu.exec(r[4]))
|
|
3453
3453
|
l = "Z";
|
|
3454
3454
|
else {
|
|
3455
3455
|
e._isValid = !1;
|
|
@@ -3484,7 +3484,7 @@ function Lu(e, t, n) {
|
|
|
3484
3484
|
t[2]
|
|
3485
3485
|
).getDay();
|
|
3486
3486
|
if (s !== r)
|
|
3487
|
-
return
|
|
3487
|
+
return N(n).weekdayMismatch = !0, n._isValid = !1, !1;
|
|
3488
3488
|
}
|
|
3489
3489
|
return !0;
|
|
3490
3490
|
}
|
|
@@ -3508,7 +3508,7 @@ function kr(e) {
|
|
|
3508
3508
|
t[7]
|
|
3509
3509
|
), !Lu(t[1], n, e))
|
|
3510
3510
|
return;
|
|
3511
|
-
e._a = n, e._tzm = Au(t[8], t[9], t[10]), e._d = gt.apply(null, e._a), e._d.setUTCMinutes(e._d.getUTCMinutes() - e._tzm),
|
|
3511
|
+
e._a = n, e._tzm = Au(t[8], t[9], t[10]), e._d = gt.apply(null, e._a), e._d.setUTCMinutes(e._d.getUTCMinutes() - e._tzm), N(e).rfc2822 = !0;
|
|
3512
3512
|
} else
|
|
3513
3513
|
e._isValid = !1;
|
|
3514
3514
|
}
|
|
@@ -3548,14 +3548,14 @@ function $u(e) {
|
|
|
3548
3548
|
function Kn(e) {
|
|
3549
3549
|
var t, n, s = [], r, a, i;
|
|
3550
3550
|
if (!e._d) {
|
|
3551
|
-
for (r = $u(e), e._w && e._a[ke] == null && e._a[Ee] == null && Wu(e), e._dayOfYear != null && (i = nt(e._a[ee], r[ee]), (e._dayOfYear > _t(i) || e._dayOfYear === 0) && (
|
|
3551
|
+
for (r = $u(e), e._w && e._a[ke] == null && e._a[Ee] == null && Wu(e), e._dayOfYear != null && (i = nt(e._a[ee], r[ee]), (e._dayOfYear > _t(i) || e._dayOfYear === 0) && (N(e)._overflowDayOfYear = !0), n = gt(i, 0, e._dayOfYear), e._a[Ee] = n.getUTCMonth(), e._a[ke] = n.getUTCDate()), t = 0; t < 3 && e._a[t] == null; ++t)
|
|
3552
3552
|
e._a[t] = s[t] = r[t];
|
|
3553
3553
|
for (; t < 7; t++)
|
|
3554
3554
|
e._a[t] = s[t] = e._a[t] == null ? t === 2 ? 1 : 0 : e._a[t];
|
|
3555
3555
|
e._a[J] === 24 && e._a[ve] === 0 && e._a[Re] === 0 && e._a[Ze] === 0 && (e._nextDay = !0, e._a[J] = 0), e._d = (e._useUTC ? gt : zl).apply(
|
|
3556
3556
|
null,
|
|
3557
3557
|
s
|
|
3558
|
-
), a = e._useUTC ? e._d.getUTCDay() : e._d.getDay(), e._tzm != null && e._d.setUTCMinutes(e._d.getUTCMinutes() - e._tzm), e._nextDay && (e._a[J] = 24), e._w && typeof e._w.d < "u" && e._w.d !== a && (
|
|
3558
|
+
), a = e._useUTC ? e._d.getUTCDay() : e._d.getDay(), e._tzm != null && e._d.setUTCMinutes(e._d.getUTCMinutes() - e._tzm), e._nextDay && (e._a[J] = 24), e._w && typeof e._w.d < "u" && e._w.d !== a && (N(e).weekdayMismatch = !0);
|
|
3559
3559
|
}
|
|
3560
3560
|
}
|
|
3561
3561
|
function Wu(e) {
|
|
@@ -3564,7 +3564,7 @@ function Wu(e) {
|
|
|
3564
3564
|
t.GG,
|
|
3565
3565
|
e._a[ee],
|
|
3566
3566
|
bt(G(), 1, 4).year
|
|
3567
|
-
), s = nt(t.W, 1), r = nt(t.E, 1), (r < 1 || r > 7) && (l = !0)) : (a = e._locale._week.dow, i = e._locale._week.doy, u = bt(G(), a, i), n = nt(t.gg, e._a[ee], u.year), s = nt(t.w, u.week), t.d != null ? (r = t.d, (r < 0 || r > 6) && (l = !0)) : t.e != null ? (r = t.e + a, (t.e < 0 || t.e > 6) && (l = !0)) : r = a), s < 1 || s > Le(n, a, i) ?
|
|
3567
|
+
), s = nt(t.W, 1), r = nt(t.E, 1), (r < 1 || r > 7) && (l = !0)) : (a = e._locale._week.dow, i = e._locale._week.doy, u = bt(G(), a, i), n = nt(t.gg, e._a[ee], u.year), s = nt(t.w, u.week), t.d != null ? (r = t.d, (r < 0 || r > 6) && (l = !0)) : t.e != null ? (r = t.e + a, (t.e < 0 || t.e > 6) && (l = !0)) : r = a), s < 1 || s > Le(n, a, i) ? N(e)._overflowWeeks = !0 : l != null ? N(e)._overflowWeekday = !0 : (o = vr(n, s, r, a, i), e._a[ee] = o.year, e._dayOfYear = o.dayOfYear);
|
|
3568
3568
|
}
|
|
3569
3569
|
v.ISO_8601 = function() {
|
|
3570
3570
|
};
|
|
@@ -3579,17 +3579,17 @@ function Xn(e) {
|
|
|
3579
3579
|
kr(e);
|
|
3580
3580
|
return;
|
|
3581
3581
|
}
|
|
3582
|
-
e._a = [],
|
|
3582
|
+
e._a = [], N(e).empty = !0;
|
|
3583
3583
|
var t = "" + e._i, n, s, r, a, i, o = t.length, l = 0, u, h;
|
|
3584
3584
|
for (r = rr(e._f, e._locale).match($n) || [], h = r.length, n = 0; n < h; n++)
|
|
3585
|
-
a = r[n], s = (t.match(Cl(a, e)) || [])[0], s && (i = t.substr(0, t.indexOf(s)), i.length > 0 &&
|
|
3585
|
+
a = r[n], s = (t.match(Cl(a, e)) || [])[0], s && (i = t.substr(0, t.indexOf(s)), i.length > 0 && N(e).unusedInput.push(i), t = t.slice(
|
|
3586
3586
|
t.indexOf(s) + s.length
|
|
3587
|
-
), l += s.length), at[a] ? (s ?
|
|
3588
|
-
|
|
3587
|
+
), l += s.length), at[a] ? (s ? N(e).empty = !1 : N(e).unusedTokens.push(a), Nl(a, s, e)) : e._strict && !s && N(e).unusedTokens.push(a);
|
|
3588
|
+
N(e).charsLeftOver = o - l, t.length > 0 && N(e).unusedInput.push(t), e._a[J] <= 12 && N(e).bigHour === !0 && e._a[J] > 0 && (N(e).bigHour = void 0), N(e).parsedDateParts = e._a.slice(0), N(e).meridiem = e._meridiem, e._a[J] = Hu(
|
|
3589
3589
|
e._locale,
|
|
3590
3590
|
e._a[J],
|
|
3591
3591
|
e._meridiem
|
|
3592
|
-
), u =
|
|
3592
|
+
), u = N(e).era, u !== null && (e._a[ee] = e._locale.erasConvertYear(u, e._a[ee])), Kn(e), qn(e);
|
|
3593
3593
|
}
|
|
3594
3594
|
function Hu(e, t, n) {
|
|
3595
3595
|
var s;
|
|
@@ -3598,11 +3598,11 @@ function Hu(e, t, n) {
|
|
|
3598
3598
|
function Fu(e) {
|
|
3599
3599
|
var t, n, s, r, a, i, o = !1, l = e._f.length;
|
|
3600
3600
|
if (l === 0) {
|
|
3601
|
-
|
|
3601
|
+
N(e).invalidFormat = !0, e._d = /* @__PURE__ */ new Date(NaN);
|
|
3602
3602
|
return;
|
|
3603
3603
|
}
|
|
3604
3604
|
for (r = 0; r < l; r++)
|
|
3605
|
-
a = 0, i = !1, t = An({}, e), e._useUTC != null && (t._useUTC = e._useUTC), t._f = e._f[r], Xn(t), Ln(t) && (i = !0), a +=
|
|
3605
|
+
a = 0, i = !1, t = An({}, e), e._useUTC != null && (t._useUTC = e._useUTC), t._f = e._f[r], Xn(t), Ln(t) && (i = !0), a += N(t).charsLeftOver, a += N(t).unusedTokens.length * 10, N(t).score = a, o ? a < s && (s = a, n = t) : (s == null || a < s || i) && (s = a, n = t, i && (o = !0));
|
|
3606
3606
|
Fe(e, n || t);
|
|
3607
3607
|
}
|
|
3608
3608
|
function Gu(e) {
|
|
@@ -3752,7 +3752,7 @@ function nd(e, t, n) {
|
|
|
3752
3752
|
if (e = Jn(Xt, e), e === null)
|
|
3753
3753
|
return this;
|
|
3754
3754
|
} else Math.abs(e) < 16 && !n && (e = e * 60);
|
|
3755
|
-
return !this._isUTC && t && (r = kn(this)), this._offset = e, this._isUTC = !0, r != null && this.add(r, "m"), s !== e && (!t || this._changeInProgress ?
|
|
3755
|
+
return !this._isUTC && t && (r = kn(this)), this._offset = e, this._isUTC = !0, r != null && this.add(r, "m"), s !== e && (!t || this._changeInProgress ? Nr(
|
|
3756
3756
|
this,
|
|
3757
3757
|
be(e - s, "m"),
|
|
3758
3758
|
1,
|
|
@@ -3842,20 +3842,20 @@ function pd(e, t) {
|
|
|
3842
3842
|
var n;
|
|
3843
3843
|
return e.isValid() && t.isValid() ? (t = Qn(t, e), e.isBefore(t) ? n = hs(e, t) : (n = hs(t, e), n.milliseconds = -n.milliseconds, n.months = -n.months), n) : { milliseconds: 0, months: 0 };
|
|
3844
3844
|
}
|
|
3845
|
-
function
|
|
3845
|
+
function Tr(e, t) {
|
|
3846
3846
|
return function(n, s) {
|
|
3847
3847
|
var r, a;
|
|
3848
3848
|
return s !== null && !isNaN(+s) && (sr(
|
|
3849
3849
|
t,
|
|
3850
3850
|
"moment()." + t + "(period, number) is deprecated. Please use moment()." + t + "(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."
|
|
3851
|
-
), a = n, n = s, s = a), r = be(n, s),
|
|
3851
|
+
), a = n, n = s, s = a), r = be(n, s), Nr(this, r, e), this;
|
|
3852
3852
|
};
|
|
3853
3853
|
}
|
|
3854
|
-
function
|
|
3854
|
+
function Nr(e, t, n, s) {
|
|
3855
3855
|
var r = t._milliseconds, a = wn(t._days), i = wn(t._months);
|
|
3856
3856
|
e.isValid() && (s = s ?? !0, i && fr(e, yt(e, "Month") + i * n), a && dr(e, "Date", yt(e, "Date") + a * n), r && e._d.setTime(e._d.valueOf() + r * n), s && v.updateOffset(e, a || i));
|
|
3857
3857
|
}
|
|
3858
|
-
var md =
|
|
3858
|
+
var md = Tr(1, "add"), vd = Tr(-1, "subtract");
|
|
3859
3859
|
function Dr(e) {
|
|
3860
3860
|
return typeof e == "string" || e instanceof String;
|
|
3861
3861
|
}
|
|
@@ -3942,10 +3942,10 @@ function Cd(e, t) {
|
|
|
3942
3942
|
var n = ge(e) ? e : G(e), s;
|
|
3943
3943
|
return this.isValid() && n.isValid() ? (t = pe(t) || "millisecond", t === "millisecond" ? this.valueOf() === n.valueOf() : (s = n.valueOf(), this.clone().startOf(t).valueOf() <= s && s <= this.clone().endOf(t).valueOf())) : !1;
|
|
3944
3944
|
}
|
|
3945
|
-
function
|
|
3945
|
+
function Td(e, t) {
|
|
3946
3946
|
return this.isSame(e, t) || this.isAfter(e, t);
|
|
3947
3947
|
}
|
|
3948
|
-
function
|
|
3948
|
+
function Nd(e, t) {
|
|
3949
3949
|
return this.isSame(e, t) || this.isBefore(e, t);
|
|
3950
3950
|
}
|
|
3951
3951
|
function Dd(e, t, n) {
|
|
@@ -4200,10 +4200,10 @@ function Bd() {
|
|
|
4200
4200
|
return Ln(this);
|
|
4201
4201
|
}
|
|
4202
4202
|
function Zd() {
|
|
4203
|
-
return Fe({},
|
|
4203
|
+
return Fe({}, N(this));
|
|
4204
4204
|
}
|
|
4205
4205
|
function qd() {
|
|
4206
|
-
return
|
|
4206
|
+
return N(this).overflow;
|
|
4207
4207
|
}
|
|
4208
4208
|
function Kd() {
|
|
4209
4209
|
return {
|
|
@@ -4232,7 +4232,7 @@ U(
|
|
|
4232
4232
|
["N", "NN", "NNN", "NNNN", "NNNNN"],
|
|
4233
4233
|
function(e, t, n, s) {
|
|
4234
4234
|
var r = n._locale.erasParse(e, s, n._strict);
|
|
4235
|
-
r ?
|
|
4235
|
+
r ? N(n).era = r : N(n).invalidEra = e;
|
|
4236
4236
|
}
|
|
4237
4237
|
);
|
|
4238
4238
|
_("y", dt);
|
|
@@ -4518,8 +4518,8 @@ d.isAfter = Sd;
|
|
|
4518
4518
|
d.isBefore = xd;
|
|
4519
4519
|
d.isBetween = Od;
|
|
4520
4520
|
d.isSame = Cd;
|
|
4521
|
-
d.isSameOrAfter =
|
|
4522
|
-
d.isSameOrBefore =
|
|
4521
|
+
d.isSameOrAfter = Td;
|
|
4522
|
+
d.isSameOrBefore = Nd;
|
|
4523
4523
|
d.isValid = Bd;
|
|
4524
4524
|
d.lang = Yr;
|
|
4525
4525
|
d.locale = Ir;
|
|
@@ -4670,10 +4670,10 @@ function Oc(e, t) {
|
|
|
4670
4670
|
function Cc(e, t) {
|
|
4671
4671
|
return Hr(e, t, "monthsShort");
|
|
4672
4672
|
}
|
|
4673
|
-
function
|
|
4673
|
+
function Tc(e, t, n) {
|
|
4674
4674
|
return ns(e, t, n, "weekdays");
|
|
4675
4675
|
}
|
|
4676
|
-
function
|
|
4676
|
+
function Nc(e, t, n) {
|
|
4677
4677
|
return ns(e, t, n, "weekdaysShort");
|
|
4678
4678
|
}
|
|
4679
4679
|
function Dc(e, t, n) {
|
|
@@ -4900,7 +4900,7 @@ v.locale = Ve;
|
|
|
4900
4900
|
v.invalid = zt;
|
|
4901
4901
|
v.duration = be;
|
|
4902
4902
|
v.isMoment = ge;
|
|
4903
|
-
v.weekdays =
|
|
4903
|
+
v.weekdays = Tc;
|
|
4904
4904
|
v.parseZone = xc;
|
|
4905
4905
|
v.localeData = $e;
|
|
4906
4906
|
v.isDuration = Lt;
|
|
@@ -4909,7 +4909,7 @@ v.weekdaysMin = Dc;
|
|
|
4909
4909
|
v.defineLocale = Zn;
|
|
4910
4910
|
v.updateLocale = xu;
|
|
4911
4911
|
v.locales = Ou;
|
|
4912
|
-
v.weekdaysShort =
|
|
4912
|
+
v.weekdaysShort = Nc;
|
|
4913
4913
|
v.normalizeUnits = pe;
|
|
4914
4914
|
v.relativeTimeRounding = sh;
|
|
4915
4915
|
v.relativeTimeThreshold = rh;
|
|
@@ -5001,7 +5001,7 @@ const ih = "code-graph", oh = (e, t = "", n = "json") => {
|
|
|
5001
5001
|
command: Zr,
|
|
5002
5002
|
title: "Toggle palette",
|
|
5003
5003
|
icon: z(
|
|
5004
|
-
() => e.palette.enabled ? Es :
|
|
5004
|
+
() => e.palette.enabled ? Es : Tn
|
|
5005
5005
|
)
|
|
5006
5006
|
}, a = {
|
|
5007
5007
|
command: qr,
|
|
@@ -5528,20 +5528,20 @@ function gh(e, t, n) {
|
|
|
5528
5528
|
)
|
|
5529
5529
|
);
|
|
5530
5530
|
o.addGraphTemplate(F);
|
|
5531
|
-
const
|
|
5532
|
-
if (!
|
|
5531
|
+
const Te = o.nodeTypes.get(Os(F));
|
|
5532
|
+
if (!Te) throw new Error("Unable to create subgraph: Could not find corresponding graph node type");
|
|
5533
5533
|
i.activeTransactions++;
|
|
5534
|
-
const
|
|
5535
|
-
i.addNode(
|
|
5534
|
+
const Ne = Ae(new Te.type());
|
|
5535
|
+
i.addNode(Ne);
|
|
5536
5536
|
const ft = Math.round(
|
|
5537
5537
|
l.map((C) => C.position.x).reduce((C, Q) => C + Q, 0) / l.length
|
|
5538
5538
|
), we = Math.round(
|
|
5539
5539
|
l.map((C) => C.position.y).reduce((C, Q) => C + Q, 0) / l.length
|
|
5540
5540
|
);
|
|
5541
|
-
|
|
5542
|
-
i.removeConnection(C), i.addConnection(C.from,
|
|
5541
|
+
Ne.position.x = ft, Ne.position.y = we, w.forEach((C) => {
|
|
5542
|
+
i.removeConnection(C), i.addConnection(C.from, Ne.inputs[c.get(C.to.id)]);
|
|
5543
5543
|
}), p.forEach((C) => {
|
|
5544
|
-
i.removeConnection(C), i.addConnection(
|
|
5544
|
+
i.removeConnection(C), i.addConnection(Ne.outputs[c.get(C.from.id)], C.to);
|
|
5545
5545
|
}), l.forEach((C) => i.removeNode(C)), i.activeTransactions--, t.canExecuteCommand(He.SAVE_SUBGRAPH_COMMAND) && t.executeCommand(He.SAVE_SUBGRAPH_COMMAND), n(F), e.value.panning = { ...i.panning }, e.value.scaling = i.scaling;
|
|
5546
5546
|
};
|
|
5547
5547
|
t.registerCommand(yh, {
|
|
@@ -5639,12 +5639,12 @@ function Zh(e) {
|
|
|
5639
5639
|
settings: l,
|
|
5640
5640
|
switchGraph: i
|
|
5641
5641
|
});
|
|
5642
|
-
return t.value.registerViewModel(I), fh(I), Sa(a, u), gh(a, u, i), xa(a, u), Oa(a, u, i), Ca(a, u),
|
|
5642
|
+
return t.value.registerViewModel(I), fh(I), Sa(a, u), gh(a, u, i), xa(a, u), Oa(a, u, i), Ca(a, u), Ta(a, u, l), dh(a, u, l), ch(l), gs(
|
|
5643
5643
|
n,
|
|
5644
5644
|
(y, O) => {
|
|
5645
5645
|
O && (O.events.registerGraph.unsubscribe(s), O.graphEvents.beforeAddNode.unsubscribe(s), y.nodeHooks.beforeLoad.unsubscribe(s), y.nodeHooks.afterSave.unsubscribe(s), y.graphTemplateHooks.beforeLoad.unsubscribe(s), y.graphTemplateHooks.afterSave.unsubscribe(s), y.graph.hooks.load.unsubscribe(s), y.graph.hooks.save.unsubscribe(s)), y && (y.nodeHooks.beforeLoad.subscribe(s, (c, g) => (g.position = c.position ?? { x: 0, y: 0 }, g.state && (g.state.integrated = c.integrated, c.props && (g.state.props = c.props), c.variableName && (g.state.variableName = c.variableName)), c)), y.nodeHooks.afterSave.subscribe(s, (c, g) => (c.position = g.position, g.state && (c.integrated = g.state.integrated, g.state.props && (c.props = g.state.props), g.state.variableName && (c.variableName = g.state.variableName)), c)), y.graphTemplateHooks.beforeLoad.subscribe(s, (c, g) => (g.panning = c.panning, g.scaling = c.scaling, c)), y.graphTemplateHooks.afterSave.subscribe(s, (c, g) => (c.panning = g.panning, c.scaling = g.scaling, c)), y.graph.hooks.load.subscribe(s, (c, g) => (g.panning = c.panning, g.scaling = c.scaling, c)), y.graph.hooks.save.subscribe(s, (c, g) => (c.panning = g.panning, c.scaling = g.scaling, c)), y.graphEvents.beforeAddNode.subscribe(
|
|
5646
5646
|
s,
|
|
5647
|
-
(c) =>
|
|
5647
|
+
(c) => Na(c, { defaultWidth: l.nodes.defaultWidth })
|
|
5648
5648
|
), n.value.registerNodeType(ea, { category: "Subgraphs" }), n.value.registerNodeType(ta, { category: "Subgraphs" }), i(y.graph));
|
|
5649
5649
|
},
|
|
5650
5650
|
{ immediate: !0 }
|
package/dist/code-graph.umd.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(p,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vue"),require("@baklavajs/renderer-vue"),require("@baklavajs/core"),require("@vueuse/core"),require("mustache"),require("uuid"),require("@baklavajs/interface-types"),require("@baklavajs/engine"),require("toposort"),require("@baklavajs/events")):typeof define=="function"&&define.amd?define(["exports","vue","@baklavajs/renderer-vue","@baklavajs/core","@vueuse/core","mustache","uuid","@baklavajs/interface-types","@baklavajs/engine","toposort","@baklavajs/events"],r):(p=typeof globalThis<"u"?globalThis:p||self,r(p["@babsey/code-graph"]={},p.vue,p["@baklavajs/renderer-vue"],p["@baklavajs/core"],p["@vueuse/core"],p.mustache,p.uuid,p["@baklavajs/interface-types"],p["@baklavajs/engine"],p.toposort,p["@baklavajs/events"]))})(this,(function(p,r,S,q,Ya,Le,De,G,he,Ra,Jn){"use strict";const z=(e,t)=>{const n=e.__vccOpts||e;for(const[s,a]of t)n[s]=a;return n},Pa={},Ba={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-check"};function Va(e,t){return r.openBlock(),r.createElementBlock("svg",Ba,[...t[0]||(t[0]=[r.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),r.createElementVNode("path",{d:"M5 12l5 5l10 -10"},null,-1)])])}const Xn=z(Pa,[["render",Va]]),La={},Aa={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-code-variable"};function Ua(e,t){return r.openBlock(),r.createElementBlock("svg",Aa,[...t[0]||(t[0]=[r.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),r.createElementVNode("path",{d:"M4 8m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v4a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z"},null,-1)])])}const Qn=z(La,[["render",Ua]]),$a={},Wa={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-copy"};function Ha(e,t){return r.openBlock(),r.createElementBlock("svg",Wa,[...t[0]||(t[0]=[r.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),r.createElementVNode("path",{d:"M7 7m0 2.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667z"},null,-1),r.createElementVNode("path",{d:"M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1"},null,-1)])])}const es=z($a,[["render",Ha]]),Fa={},Ga={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-dots-vertical"};function ja(e,t){return r.openBlock(),r.createElementBlock("svg",Ga,[...t[0]||(t[0]=[r.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),r.createElementVNode("path",{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null,-1),r.createElementVNode("path",{d:"M12 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null,-1),r.createElementVNode("path",{d:"M12 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null,-1)])])}const ts=z(Fa,[["render",ja]]),za={},Za={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-download"};function qa(e,t){return r.openBlock(),r.createElementBlock("svg",Za,[...t[0]||(t[0]=[r.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),r.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),r.createElementVNode("path",{d:"M7 11l5 5l5 -5"},null,-1),r.createElementVNode("path",{d:"M12 4l0 12"},null,-1)])])}const ns=z(za,[["render",qa]]),Ka={},Ja={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",class:"baklava-icon icon icon-tabler icons-tabler-filled icon-tabler-layout-sidebar-left-collapse"};function Xa(e,t){return r.openBlock(),r.createElementBlock("svg",Ja,[...t[0]||(t[0]=[r.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),r.createElementVNode("path",{d:"M18 3a3 3 0 0 1 2.995 2.824l.005 .176v12a3 3 0 0 1 -2.824 2.995l-.176 .005h-12a3 3 0 0 1 -2.995 -2.824l-.005 -.176v-12a3 3 0 0 1 2.824 -2.995l.176 -.005h12zm0 2h-9v14h9a1 1 0 0 0 .993 -.883l.007 -.117v-12a1 1 0 0 0 -.883 -.993l-.117 -.007zm-2.293 4.293a1 1 0 0 1 .083 1.32l-.083 .094l-1.292 1.293l1.292 1.293a1 1 0 0 1 .083 1.32l-.083 .094a1 1 0 0 1 -1.32 .083l-.094 -.083l-2 -2a1 1 0 0 1 -.083 -1.32l.083 -.094l2 -2a1 1 0 0 1 1.414 0z"},null,-1)])])}const Qa=z(Ka,[["render",Xa]]),er={},tr={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",class:"baklava-icon icon icon-tabler icons-tabler-filled icon-tabler-layout-sidebar-left-expand"};function nr(e,t){return r.openBlock(),r.createElementBlock("svg",tr,[...t[0]||(t[0]=[r.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),r.createElementVNode("path",{d:"M18 3a3 3 0 0 1 2.995 2.824l.005 .176v12a3 3 0 0 1 -2.824 2.995l-.176 .005h-12a3 3 0 0 1 -2.995 -2.824l-.005 -.176v-12a3 3 0 0 1 2.824 -2.995l.176 -.005h12zm0 2h-9v14h9a1 1 0 0 0 .993 -.883l.007 -.117v-12a1 1 0 0 0 -.883 -.993l-.117 -.007zm-4.387 4.21l.094 .083l2 2a1 1 0 0 1 .083 1.32l-.083 .094l-2 2a1 1 0 0 1 -1.497 -1.32l.083 -.094l1.292 -1.293l-1.292 -1.293a1 1 0 0 1 -.083 -1.32l.083 -.094a1 1 0 0 1 1.32 -.083z"},null,-1)])])}const sr=z(er,[["render",nr]]),ar={},rr={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",class:"baklava-icon icon icon-tabler icons-tabler-filled icon-tabler-layout-sidebar-right"};function or(e,t){return r.openBlock(),r.createElementBlock("svg",rr,[...t[0]||(t[0]=[r.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),r.createElementVNode("path",{d:"M6 21a3 3 0 0 1 -3 -3v-12a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3zm8 -16h-8a1 1 0 0 0 -1 1v12a1 1 0 0 0 1 1h8z"},null,-1)])])}const ir=z(ar,[["render",or]]),lr={},dr={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",class:"baklava-icon icon icon-tabler icons-tabler-filled icon-tabler-layout-sidebar-right-collapse"};function cr(e,t){return r.openBlock(),r.createElementBlock("svg",dr,[...t[0]||(t[0]=[r.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),r.createElementVNode("path",{d:"M18 3a3 3 0 0 1 2.995 2.824l.005 .176v12a3 3 0 0 1 -2.824 2.995l-.176 .005h-12a3 3 0 0 1 -2.995 -2.824l-.005 -.176v-12a3 3 0 0 1 2.824 -2.995l.176 -.005h12zm-3 2h-9a1 1 0 0 0 -.993 .883l-.007 .117v12a1 1 0 0 0 .883 .993l.117 .007h9v-14zm-5.387 4.21l.094 .083l2 2a1 1 0 0 1 .083 1.32l-.083 .094l-2 2a1 1 0 0 1 -1.497 -1.32l.083 -.094l1.292 -1.293l-1.292 -1.293a1 1 0 0 1 -.083 -1.32l.083 -.094a1 1 0 0 1 1.32 -.083z"},null,-1)])])}const ss=z(lr,[["render",cr]]),ur={},hr={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",class:"baklava-icon icon icon-tabler icons-tabler-filled icon-tabler-layout-sidebar-right-expand"};function fr(e,t){return r.openBlock(),r.createElementBlock("svg",hr,[...t[0]||(t[0]=[r.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),r.createElementVNode("path",{d:"M18 3a3 3 0 0 1 2.995 2.824l.005 .176v12a3 3 0 0 1 -2.824 2.995l-.176 .005h-12a3 3 0 0 1 -2.995 -2.824l-.005 -.176v-12a3 3 0 0 1 2.824 -2.995l.176 -.005h12zm-3 2h-9a1 1 0 0 0 -.993 .883l-.007 .117v12a1 1 0 0 0 .883 .993l.117 .007h9v-14zm-3.293 4.293a1 1 0 0 1 .083 1.32l-.083 .094l-1.292 1.293l1.292 1.293a1 1 0 0 1 .083 1.32l-.083 .094a1 1 0 0 1 -1.32 .083l-.094 -.083l-2 -2a1 1 0 0 1 -.083 -1.32l.083 -.094l2 -2a1 1 0 0 1 1.414 0z"},null,-1)])])}const $t=z(ur,[["render",fr]]),pr={},mr={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-lock-code"};function _r(e,t){return r.openBlock(),r.createElementBlock("svg",mr,[...t[0]||(t[0]=[r.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M11.5 21h-4.5a2 2 0 0 1 -2 -2v-6a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2"></path><path d="M11 16a1 1 0 1 0 2 0a1 1 0 0 0 -2 0"></path><path d="M8 11v-4a4 4 0 1 1 8 0v4"></path><path d="M20 21l2 -2l-2 -2"></path><path d="M17 17l-2 2l2 2"></path>',6)])])}const Wt=z(pr,[["render",_r]]),yr={},gr={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-player-play"};function kr(e,t){return r.openBlock(),r.createElementBlock("svg",gr,[...t[0]||(t[0]=[r.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),r.createElementVNode("path",{d:"M7 4v16l13 -8z"},null,-1)])])}const br=z(yr,[["render",kr]]),wr={},vr={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-plus"};function Nr(e,t){return r.openBlock(),r.createElementBlock("svg",vr,[...t[0]||(t[0]=[r.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),r.createElementVNode("path",{d:"M12 5l0 14"},null,-1),r.createElementVNode("path",{d:"M5 12l14 0"},null,-1)])])}const as=z(wr,[["render",Nr]]),Cr={},Mr={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-restore"};function Sr(e,t){return r.openBlock(),r.createElementBlock("svg",Mr,[...t[0]||(t[0]=[r.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),r.createElementVNode("path",{d:"M3.06 13a9 9 0 1 0 .49 -4.087"},null,-1),r.createElementVNode("path",{d:"M3 4.001v5h5"},null,-1),r.createElementVNode("path",{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null,-1)])])}const rs=z(Cr,[["render",Sr]]),Or={},Er={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-schema"};function Tr(e,t){return r.openBlock(),r.createElementBlock("svg",Er,[...t[0]||(t[0]=[r.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M5 2h5v4h-5z"></path><path d="M15 10h5v4h-5z"></path><path d="M5 18h5v4h-5z"></path><path d="M5 10h5v4h-5z"></path><path d="M10 12h5"></path><path d="M7.5 6v4"></path><path d="M7.5 14v4"></path>',8)])])}const os=z(Or,[["render",Tr]]),Ir={},xr={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-schema-off"};function Dr(e,t){return r.openBlock(),r.createElementBlock("svg",xr,[...t[0]||(t[0]=[r.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M6 2h4v4m-4 0h-1v-1"></path><path d="M15 11v-1h5v4h-2"></path><path d="M5 18h5v4h-5z"></path><path d="M5 10h5v4h-5z"></path><path d="M10 12h2"></path><path d="M7.5 7.5v2.5"></path><path d="M7.5 14v4"></path><path d="M3 3l18 18"></path>',9)])])}const is=z(Ir,[["render",Dr]]),Yr={},Rr={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-transition-bottom"};function Pr(e,t){return r.openBlock(),r.createElementBlock("svg",Rr,[...t[0]||(t[0]=[r.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M21 18a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3"></path><path d="M3 3m0 3a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v0a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3z"></path><path d="M12 9v8"></path><path d="M9 14l3 3l3 -3"></path>',5)])])}const ls=z(Yr,[["render",Pr]]),Br={},Vr={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-upload"};function Lr(e,t){return r.openBlock(),r.createElementBlock("svg",Vr,[...t[0]||(t[0]=[r.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),r.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),r.createElementVNode("path",{d:"M7 9l5 -5l5 5"},null,-1),r.createElementVNode("path",{d:"M12 4l0 12"},null,-1)])])}const ds=z(Br,[["render",Lr]]),Ar={},Ur={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-x"};function $r(e,t){return r.openBlock(),r.createElementBlock("svg",Ur,[...t[0]||(t[0]=[r.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),r.createElementVNode("path",{d:"M18 6l-12 12"},null,-1),r.createElementVNode("path",{d:"M6 6l12 12"},null,-1)])])}const cs=z(Ar,[["render",$r]]),Wr=Object.freeze(Object.defineProperty({__proto__:null,Check:Xn,CodeVariable:Qn,Copy:es,DotsVertical:ts,Download:ns,LayoutSidebarLeftCollapse:Qa,LayoutSidebarLeftExpand:sr,LayoutSidebarRight:ir,LayoutSidebarRightCollapse:ss,LayoutSidebarRightExpand:$t,LockCode:Wt,PlayerPlay:br,Plus:as,Restore:rs,Schema:os,SchemaOff:is,TransitionBottom:ls,Upload:ds,X:cs},Symbol.toStringTag,{value:"Module"}));function Hr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ut={exports:{}};var Fr=ut.exports,us;function Gr(){return us||(us=1,(function(e,t){(function(s,a){e.exports=a()})(Fr,function(){return(function(){var n={686:(function(o,i,l){l.d(i,{default:function(){return j}});var d=l(279),c=l.n(d),f=l(370),w=l.n(f),m=l(817),x=l.n(m);function g(b){try{return document.execCommand(b)}catch{return!1}}var M=function(N){var v=x()(N);return g("cut"),v},h=M;function k(b){var N=document.documentElement.getAttribute("dir")==="rtl",v=document.createElement("textarea");v.style.fontSize="12pt",v.style.border="0",v.style.padding="0",v.style.margin="0",v.style.position="absolute",v.style[N?"right":"left"]="-9999px";var E=window.pageYOffset||document.documentElement.scrollTop;return v.style.top="".concat(E,"px"),v.setAttribute("readonly",""),v.value=b,v}var A=function(N,v){var E=k(N);v.container.appendChild(E);var I=x()(E);return g("copy"),E.remove(),I},V=function(N){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body},E="";return typeof N=="string"?E=A(N,v):N instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(N?.type)?E=A(N.value,v):(E=x()(N),g("copy")),E},H=V;function Oe(b){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Oe=function(v){return typeof v}:Oe=function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},Oe(b)}var Ee=function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},v=N.action,E=v===void 0?"copy":v,I=N.container,R=N.target,ue=N.text;if(E!=="copy"&&E!=="cut")throw new Error('Invalid "action" value, use either "copy" or "cut"');if(R!==void 0)if(R&&Oe(R)==="object"&&R.nodeType===1){if(E==="copy"&&R.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if(E==="cut"&&(R.hasAttribute("readonly")||R.hasAttribute("disabled")))throw new Error(`Invalid "target" attribute. You can't cut text from elements with "readonly" or "disabled" attributes`)}else throw new Error('Invalid "target" value, use a valid Element');if(ue)return H(ue,{container:I});if(R)return E==="cut"?h(R):H(R,{container:I})},dt=Ee;function ye(b){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ye=function(v){return typeof v}:ye=function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},ye(b)}function O(b,N){if(!(b instanceof N))throw new TypeError("Cannot call a class as a function")}function J(b,N){for(var v=0;v<N.length;v++){var E=N[v];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(b,E.key,E)}}function te(b,N,v){return N&&J(b.prototype,N),v&&J(b,v),b}function qn(b,N){if(typeof N!="function"&&N!==null)throw new TypeError("Super expression must either be null or a function");b.prototype=Object.create(N&&N.prototype,{constructor:{value:b,writable:!0,configurable:!0}}),N&&ct(b,N)}function ct(b,N){return ct=Object.setPrototypeOf||function(E,I){return E.__proto__=I,E},ct(b,N)}function Vt(b){var N=At();return function(){var E=Ve(b),I;if(N){var R=Ve(this).constructor;I=Reflect.construct(E,arguments,R)}else I=E.apply(this,arguments);return Lt(this,I)}}function Lt(b,N){return N&&(ye(N)==="object"||typeof N=="function")?N:Kn(b)}function Kn(b){if(b===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b}function At(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function Ve(b){return Ve=Object.setPrototypeOf?Object.getPrototypeOf:function(v){return v.__proto__||Object.getPrototypeOf(v)},Ve(b)}function qe(b,N){var v="data-clipboard-".concat(b);if(N.hasAttribute(v))return N.getAttribute(v)}var U=(function(b){qn(v,b);var N=Vt(v);function v(E,I){var R;return O(this,v),R=N.call(this),R.resolveOptions(I),R.listenClick(E),R}return te(v,[{key:"resolveOptions",value:function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.action=typeof I.action=="function"?I.action:this.defaultAction,this.target=typeof I.target=="function"?I.target:this.defaultTarget,this.text=typeof I.text=="function"?I.text:this.defaultText,this.container=ye(I.container)==="object"?I.container:document.body}},{key:"listenClick",value:function(I){var R=this;this.listener=w()(I,"click",function(ue){return R.onClick(ue)})}},{key:"onClick",value:function(I){var R=I.delegateTarget||I.currentTarget,ue=this.action(R)||"copy",Ut=dt({action:ue,container:this.container,target:this.target(R),text:this.text(R)});this.emit(Ut?"success":"error",{action:ue,text:Ut,trigger:R,clearSelection:function(){R&&R.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(I){return qe("action",I)}},{key:"defaultTarget",value:function(I){var R=qe("target",I);if(R)return document.querySelector(R)}},{key:"defaultText",value:function(I){return qe("text",I)}},{key:"destroy",value:function(){this.listener.destroy()}}],[{key:"copy",value:function(I){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body};return H(I,R)}},{key:"cut",value:function(I){return h(I)}},{key:"isSupported",value:function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["copy","cut"],R=typeof I=="string"?[I]:I,ue=!!document.queryCommandSupported;return R.forEach(function(Ut){ue=ue&&!!document.queryCommandSupported(Ut)}),ue}}]),v})(c()),j=U}),828:(function(o){var i=9;if(typeof Element<"u"&&!Element.prototype.matches){var l=Element.prototype;l.matches=l.matchesSelector||l.mozMatchesSelector||l.msMatchesSelector||l.oMatchesSelector||l.webkitMatchesSelector}function d(c,f){for(;c&&c.nodeType!==i;){if(typeof c.matches=="function"&&c.matches(f))return c;c=c.parentNode}}o.exports=d}),438:(function(o,i,l){var d=l(828);function c(m,x,g,M,h){var k=w.apply(this,arguments);return m.addEventListener(g,k,h),{destroy:function(){m.removeEventListener(g,k,h)}}}function f(m,x,g,M,h){return typeof m.addEventListener=="function"?c.apply(null,arguments):typeof g=="function"?c.bind(null,document).apply(null,arguments):(typeof m=="string"&&(m=document.querySelectorAll(m)),Array.prototype.map.call(m,function(k){return c(k,x,g,M,h)}))}function w(m,x,g,M){return function(h){h.delegateTarget=d(h.target,x),h.delegateTarget&&M.call(m,h)}}o.exports=f}),879:(function(o,i){i.node=function(l){return l!==void 0&&l instanceof HTMLElement&&l.nodeType===1},i.nodeList=function(l){var d=Object.prototype.toString.call(l);return l!==void 0&&(d==="[object NodeList]"||d==="[object HTMLCollection]")&&"length"in l&&(l.length===0||i.node(l[0]))},i.string=function(l){return typeof l=="string"||l instanceof String},i.fn=function(l){var d=Object.prototype.toString.call(l);return d==="[object Function]"}}),370:(function(o,i,l){var d=l(879),c=l(438);function f(g,M,h){if(!g&&!M&&!h)throw new Error("Missing required arguments");if(!d.string(M))throw new TypeError("Second argument must be a String");if(!d.fn(h))throw new TypeError("Third argument must be a Function");if(d.node(g))return w(g,M,h);if(d.nodeList(g))return m(g,M,h);if(d.string(g))return x(g,M,h);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function w(g,M,h){return g.addEventListener(M,h),{destroy:function(){g.removeEventListener(M,h)}}}function m(g,M,h){return Array.prototype.forEach.call(g,function(k){k.addEventListener(M,h)}),{destroy:function(){Array.prototype.forEach.call(g,function(k){k.removeEventListener(M,h)})}}}function x(g,M,h){return c(document.body,g,M,h)}o.exports=f}),817:(function(o){function i(l){var d;if(l.nodeName==="SELECT")l.focus(),d=l.value;else if(l.nodeName==="INPUT"||l.nodeName==="TEXTAREA"){var c=l.hasAttribute("readonly");c||l.setAttribute("readonly",""),l.select(),l.setSelectionRange(0,l.value.length),c||l.removeAttribute("readonly"),d=l.value}else{l.hasAttribute("contenteditable")&&l.focus();var f=window.getSelection(),w=document.createRange();w.selectNodeContents(l),f.removeAllRanges(),f.addRange(w),d=f.toString()}return d}o.exports=i}),279:(function(o){function i(){}i.prototype={on:function(l,d,c){var f=this.e||(this.e={});return(f[l]||(f[l]=[])).push({fn:d,ctx:c}),this},once:function(l,d,c){var f=this;function w(){f.off(l,w),d.apply(c,arguments)}return w._=d,this.on(l,w,c)},emit:function(l){var d=[].slice.call(arguments,1),c=((this.e||(this.e={}))[l]||[]).slice(),f=0,w=c.length;for(f;f<w;f++)c[f].fn.apply(c[f].ctx,d);return this},off:function(l,d){var c=this.e||(this.e={}),f=c[l],w=[];if(f&&d)for(var m=0,x=f.length;m<x;m++)f[m].fn!==d&&f[m].fn._!==d&&w.push(f[m]);return w.length?c[l]=w:delete c[l],this}},o.exports=i,o.exports.TinyEmitter=i})},s={};function a(o){if(s[o])return s[o].exports;var i=s[o]={exports:{}};return n[o](i,i.exports,a),i.exports}return(function(){a.n=function(o){var i=o&&o.__esModule?function(){return o.default}:function(){return o};return a.d(i,{a:i}),i}})(),(function(){a.d=function(o,i){for(var l in i)a.o(i,l)&&!a.o(o,l)&&Object.defineProperty(o,l,{enumerable:!0,get:i[l]})}})(),(function(){a.o=function(o,i){return Object.prototype.hasOwnProperty.call(o,i)}})(),a(686)})().default})})(ut)),ut.exports}var jr=Gr();const zr=Hr(jr),Zr=e=>({toClipboard(t,n){return new Promise((s,a)=>{const o=document.createElement("button"),i=new zr(o,{text:()=>t,action:()=>"copy",container:n!==void 0?n:document.body});i.on("success",l=>{i.destroy(),s(l)}),i.on("error",l=>{i.destroy(),a(l)}),document.body.appendChild(o),o.click(),document.body.removeChild(o)})}}),qr={key:0,class:"baklava-button"},hs=r.defineComponent({__name:"CopyToClipboard",props:{text:String},setup(e){const{toClipboard:t}=Zr(),n=e,s=r.toRef(n,"text"),a=r.ref(!1),o=async()=>{try{await t(s.value),a.value=!0,setTimeout(()=>a.value=!1,1500),console.log("Copied to clipboard")}catch(i){console.error(i)}};return(i,l)=>(r.openBlock(),r.createElementBlock("div",null,[a.value?(r.openBlock(),r.createElementBlock("button",qr,[r.createVNode(r.unref(Xn))])):(r.openBlock(),r.createElementBlock("button",{key:1,onClick:o,class:"baklava-button"},[r.createVNode(r.unref(es))]))]))}}),Kr={class:"code-editor"},Jr={class:"code-buttons"},Xr=r.defineComponent({__name:"CodeEditor",props:r.mergeModels({locked:{type:Boolean},extensions:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:r.mergeModels(["update:locked"],["update:modelValue"]),setup(e,{emit:t}){const n=r.useModel(e,"modelValue"),s=t,a=o=>s("update:locked",o);return(o,i)=>{const l=r.resolveComponent("codemirror");return r.openBlock(),r.createElementBlock("div",Kr,[r.createElementVNode("div",Jr,[e.locked?(r.openBlock(),r.createElementBlock("button",{key:0,class:"baklava-button",title:"The code is locked.",onClick:i[0]||(i[0]=d=>a(!1))},[r.createVNode(r.unref(Wt))])):r.createCommentVNode("",!0),r.createVNode(hs,{text:e.modelValue},null,8,["text"])]),r.createVNode(l,{modelValue:n.value,"onUpdate:modelValue":i[1]||(i[1]=d=>n.value=d),extensions:e.extensions,class:"codemirror",style:{height:"100%"},onKeydown:i[2]||(i[2]=d=>a(!0))},null,8,["modelValue","extensions"])])}}}),Qr=r.defineComponent({__name:"CodeGraphEditor",props:{viewModel:{}},setup(e){const t=e,n=r.toRef(t,"viewModel"),s=a=>a.events.update.emit(null);return r.onMounted(n.value.onMounted),r.onBeforeUnmount(n.value.onBeforeUnmount),r.watch(n,(a,o)=>{o&&o.onBeforeUnmount(),a&&a.onMounted()}),(a,o)=>(r.openBlock(),r.createBlock(r.unref(S.BaklavaEditor),{viewModel:n.value},{palette:r.withCtx(()=>[r.createVNode(r.unref(ms))]),node:r.withCtx(i=>[r.createVNode(r.unref(fs),r.mergeProps(i,{onUpdate:l=>s(i.node)}),null,16,["onUpdate"])]),sidebar:r.withCtx(i=>[r.createVNode(r.unref(ps),r.normalizeProps(r.guardReactiveProps(i)),{codeEditor:r.withCtx(({node:l})=>[r.renderSlot(a.$slots,"sidebarCodeEditor",{node:l})]),_:3},16)]),_:3},8,["viewModel"]))}}),eo={class:"code-graph-info"},to=r.defineComponent({__name:"CodeGraphInfo",props:{viewModel:{}},setup(e){return(t,n)=>(r.openBlock(),r.createElementBlock("div",eo,[r.createElementVNode("div",null,"Editor graph: "+r.toDisplayString(e.viewModel.editor.graph.shortId),1),r.createElementVNode("div",null,"Displayed graph: "+r.toDisplayString(e.viewModel.displayedGraph.shortId),1),r.createElementVNode("div",null,"Graphs: "+r.toDisplayString(e.viewModel.editor.graphIds),1),r.createElementVNode("div",null,"Graph templates: "+r.toDisplayString(e.viewModel.editor.graphTemplateIds),1),r.createElementVNode("div",null,"Engine status: "+r.toDisplayString(e.viewModel.engine?.status),1)]))}}),no=["data-node-type","id"],so={class:"__title-label",style:{"flex-grow":"1"}},ao={key:0},ro={class:"__menu",style:{display:"flex"}},oo={class:"__outputs"},io={key:0},lo=["id","title"],co={class:"__inputs"},uo={key:0},ho=["id","title"],fs=r.defineComponent({__name:"CodeGraphNode",props:{node:{},selected:{type:Boolean,default:!1},dragging:{type:Boolean}},emits:["select","start-drag","update"],setup(e,{emit:t}){const n=S.Components.ContextMenu,s=S.Components.NodeInterface,a=e,o=r.computed(()=>a.node),i=t,{viewModel:l}=S.useViewModel(),{graph:d,switchGraph:c}=S.useGraph(),f=r.ref(null),w=r.ref(!1),m=r.ref(""),x=r.ref(null),g=r.ref(!1);let M=0,h=0;const k=r.ref(!1),A=r.computed(()=>{const U=[{value:"edit",label:"Edit"},{value:"rename",label:"Rename"},{value:"delete",label:"Delete"}];return a.node.type.startsWith(q.GRAPH_NODE_TYPE_PREFIX)&&U.push({value:"editSubgraph",label:"Edit Subgraph"}),U}),V=r.computed(()=>({"--selected":a.selected,"--dragging":a.dragging,"--two-column":!!a.node.twoColumn,"--hidden":o.value.state?.hidden})),H=r.computed(()=>({"--reverse-y":a.node.reverseY??l.value.settings.nodes.reverseY})),Oe=r.computed(()=>({top:`${a.node.position?.y??0}px`,left:`${a.node.position?.x??0}px`,"--width":`${a.node.width??l.value.settings.nodes.defaultWidth}px`})),Ee=r.computed(()=>Object.values(a.node.inputs).filter(U=>!U.hidden)),dt=r.computed(()=>Object.values(a.node.outputs).filter(U=>!U.hidden)),ye=()=>{qn(),i("select")},O=U=>{a.selected||ye(),i("start-drag",U)},J=()=>{k.value=!0},te=()=>{const U=l.value.displayedGraph.sidebar;U.nodeId=a.node.id,U.visible=!0},qn=()=>{const U=l.value.displayedGraph.sidebar;U.nodeId=a.node.id},ct=async U=>{switch(U){case"edit":te();break;case"delete":d.value.removeNode(a.node);break;case"rename":m.value=a.node.state.variableName,w.value=!0,await r.nextTick(),x.value?.focus();break;case"editSubgraph":c(a.node.template);break}},Vt=()=>{o.value.state.variableName=m.value,o.value.events.titleChanged.emit(o.value.state.variableName),w.value=!1},Lt=()=>{f.value&&l.value.hooks.renderNode.execute({node:a.node,el:f.value})},Kn=U=>{g.value=!0,M=a.node.width,h=U.clientX,U.preventDefault()},At=U=>{o.value.state&&(o.value.state.integrated=U,i("update"))},Ve=U=>{if(!g.value)return;const j=U.clientX-h,b=M+j/d.value.scaling,N=l.value.settings.nodes.minWidth,v=l.value.settings.nodes.maxWidth;o.value.width=Math.max(N,Math.min(v,b))},qe=()=>{g.value=!1};return r.onMounted(()=>{Lt(),window.addEventListener("mousemove",Ve),window.addEventListener("mouseup",qe)}),r.onUpdated(Lt),r.onBeforeUnmount(()=>{window.removeEventListener("mousemove",Ve),window.removeEventListener("mouseup",qe)}),(U,j)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([V.value,"baklava-node"]),"data-node-type":o.value.type,id:o.value.id,style:r.normalizeStyle(Oe.value),ref_key:"el",ref:f,onPointerdown:ye},[r.unref(l).settings.nodes.resizable?(r.openBlock(),r.createElementBlock("div",{key:0,class:"__resize-handle",onMousedown:Kn},null,32)):r.createCommentVNode("",!0),r.createElementVNode("div",{class:"__title",onPointerdown:r.withModifiers(O,["self","stop"]),onContextmenu:r.withModifiers(J,["prevent"])},[o.value.inputs._code?(r.openBlock(),r.createBlock(r.unref(Ht),{key:0,intf:o.value.inputs._code,node:o.value,title:o.value.inputs._code.value,class:"--input","data-interface-type":"node",style:{"flex-grow":"0"}},null,8,["intf","node","title"])):r.createCommentVNode("",!0),w.value?r.withDirectives((r.openBlock(),r.createElementBlock("input",{key:2,ref_key:"renameInputEl",ref:x,"onUpdate:modelValue":j[4]||(j[4]=b=>m.value=b),class:"baklava-input",placeholder:"Variable name",style:{"flex-grow":"1"},type:"text",onBlur:Vt,onKeydown:r.withKeys(Vt,["enter"])},null,544)),[[r.vModelText,m.value]]):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.createElementVNode("div",so,[o.value.idx>-1?(r.openBlock(),r.createElementBlock("span",ao,r.toDisplayString(o.value.idx+1)+" > ",1)):r.createCommentVNode("",!0),r.createTextVNode(" "+r.toDisplayString(o.value.state.variableName.length>0?o.value.state.variableName:o.value.title),1)]),r.createElementVNode("div",ro,[o.value.isCodeNode?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[o.value.state.lockCode?(r.openBlock(),r.createBlock(r.unref(Wt),{key:0,class:"--clickable mx-1",onClick:j[0]||(j[0]=b=>o.value.lockCode=!1)})):r.createCommentVNode("",!0),o.value.hasConnectedOutputNodes?(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[o.value.state.integrated?(r.openBlock(),r.createBlock(r.unref(Qn),{key:1,class:"--clickable mx-1",onClick:j[2]||(j[2]=b=>At(!1))})):(r.openBlock(),r.createBlock(r.unref(ls),{key:0,class:"--clickable mx-1",onClick:j[1]||(j[1]=b=>At(!0))}))],64)):r.createCommentVNode("",!0),o.value.isSelected&&!r.unref(l).displayedGraph.sidebar.visible?(r.openBlock(),r.createBlock(r.unref($t),{key:2,class:"--clickable mx-1",onClick:te})):r.createCommentVNode("",!0)],64)):r.createCommentVNode("",!0),r.createVNode(r.unref(ts),{class:"--clickable mx-1",onClick:J}),r.createVNode(r.unref(n),{modelValue:k.value,"onUpdate:modelValue":j[3]||(j[3]=b=>k.value=b),x:0,y:0,items:A.value,onClick:ct},null,8,["modelValue","items"])])],64)),o.value.outputs._code?(r.openBlock(),r.createBlock(r.unref(Ht),{key:3,node:o.value,intf:o.value.outputs._code,class:"--output",title:o.value.outputs._code.value,"data-interface-type":"node"},null,8,["node","intf","title"])):r.createCommentVNode("",!0)],32),r.createElementVNode("div",{class:r.normalizeClass(["__content",H.value]),onKeydown:j[5]||(j[5]=r.withKeys(r.withModifiers(()=>{},["stop"]),["delete"])),onContextmenu:j[6]||(j[6]=r.withModifiers(()=>{},["prevent"]))},[r.createElementVNode("div",oo,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(dt.value,b=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:b.id},[o.value.state?.hidden?(r.openBlock(),r.createElementBlock("div",io,[b.port?(r.openBlock(),r.createElementBlock("div",{key:0,id:b.id,title:b.name,class:"baklava-node-interface --output --connected"},[...j[7]||(j[7]=[r.createElementVNode("div",{class:"__port"},null,-1)])],8,lo)):r.createCommentVNode("",!0)])):r.renderSlot(U.$slots,"nodeInterface",{key:1,type:"output",node:o.value,intf:b},()=>[r.createVNode(r.unref(s),{node:o.value,intf:b,title:b.value},null,8,["node","intf","title"])])],64))),128))]),r.createElementVNode("div",co,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(Ee.value,b=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:b.id},[o.value.state?.hidden?(r.openBlock(),r.createElementBlock("div",uo,[b.port?(r.openBlock(),r.createElementBlock("div",{key:0,id:b.id,title:b.name,class:"baklava-node-interface --input --connected"},[...j[8]||(j[8]=[r.createElementVNode("div",{class:"__port"},null,-1)])],8,ho)):r.createCommentVNode("",!0)])):r.renderSlot(U.$slots,"nodeInterface",{key:1,node:o.value,intf:b,type:"input"},()=>[r.createVNode(r.unref(s),{node:o.value,intf:b,title:b.value},null,8,["node","intf","title"])])],64))),128))])],34)],46,no))}}),fo=["id"],po={class:"align-middle"},Ht=r.defineComponent({__name:"CodeGraphNodeInterface",props:{node:{},intf:{}},setup(e){const t=e,{viewModel:n}=S.useViewModel(),{hoveredOver:s,temporaryConnection:a}=S.useTemporaryConnection(),o=r.ref(null),i=r.computed(()=>t.intf.connectionCount>0),l=r.computed(()=>({"--connected":i.value})),d=()=>{s(t.intf)},c=()=>{s(void 0)},f=()=>{o.value&&n.value.hooks.renderInterface.execute({intf:t.intf,el:o.value})};return r.onMounted(f),r.onUpdated(f),(w,m)=>(r.openBlock(),r.createElementBlock("div",{id:e.intf.id,ref_key:"el",ref:o,class:r.normalizeClass(["baklava-node-interface",l.value])},[e.intf.port?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass([{"--selected":r.unref(a)?.from===e.intf},"__port"]),onPointerover:d,onPointerout:c},null,34)):r.createCommentVNode("",!0),r.createElementVNode("span",po,[r.renderSlot(w.$slots,"default")])],10,fo))}}),mo=["title"],_o={key:0,class:"__label"},Ft=r.defineComponent({__name:"SidebarCheckbox",props:{disabled:{type:Boolean},inversed:{type:Boolean},modelValue:{type:Boolean},name:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;return(s,a)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["baklava-checkbox",{"--checked":e.inversed?!e.modelValue:e.modelValue,"--disabled":e.disabled}]),title:e.name,onClick:a[0]||(a[0]=o=>n("update:modelValue",!e.modelValue))},[a[1]||(a[1]=r.createElementVNode("div",{class:"__checkmark-container"},[r.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18"},[r.createElementVNode("path",{class:"__checkmark",d:"M 6 5 L 6 10 L 16 10",transform:"rotate(-45 10 10)"})])],-1)),e.name?(r.openBlock(),r.createElementBlock("div",_o,r.toDisplayString(e.name),1)):r.createCommentVNode("",!0)],10,mo))}}),yo={class:"__header"},go={class:"__node-name"},ko={class:"__interfaces"},bo={class:"__inputs"},wo={style:{display:"flex"}},vo={class:"__outputs"},No={key:0,class:"__interface"},Co=["placeholder"],Mo={style:{display:"flex"}},ps=r.defineComponent({__name:"CodeGraphSidebar",setup(e){const{viewModel:t}=S.useViewModel(),{graph:n}=S.useGraph(),s=r.ref(null),a=r.toRef(t.value.settings.sidebar,"width"),o=r.computed(()=>t.value.settings.sidebar.resizable);let i=0,l=0;const d=r.computed(()=>{const k=n.value.sidebar.nodeId;return n.value.nodes.find(A=>A.id===k)}),c=r.computed(()=>d.value),f=r.computed(()=>({width:`${a.value}px`})),w=r.computed(()=>c.value?Object.values(c.value.inputs).filter(k=>k.displayInSidebar&&k.component):[]),m=r.computed(()=>c.value?Object.values(c.value.outputs).filter(k=>k.displayInSidebar&&k.component):[]),x=()=>{n.value.sidebar.visible=!1},g=()=>{d.value&&(d.value.state.variableNameNumberAppendix=c.value.state.variableName.length===0,d.value.events.update.emit(null))},M=k=>{i=a.value,l=k.clientX,window.addEventListener("mousemove",h),window.addEventListener("mouseup",()=>{window.removeEventListener("mousemove",h)},{once:!0})},h=k=>{const A=s.value?.parentElement?.getBoundingClientRect().width??500,V=k.clientX-l;let H=i-V;H<300?H=300:H>.9*A&&(H=.9*A),a.value=H};return(k,A)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([{"--open":r.unref(n).sidebar.visible},"baklava-sidebar"]),style:r.normalizeStyle(f.value),ref_key:"el",ref:s},[o.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:"__resizer",onMousedown:M},null,32)):r.createCommentVNode("",!0),d.value?(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.createElementVNode("div",yo,[r.createElementVNode("button",{tabindex:"-1",class:"__close",onClick:x},"×"),r.createElementVNode("div",go,[r.createElementVNode("b",null,r.toDisplayString(d.value.title),1)])]),r.createElementVNode("div",ko,[r.createElementVNode("div",bo,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(w.value,V=>(r.openBlock(),r.createElementBlock("div",{key:V.id,class:"__interface"},[r.createElementVNode("div",wo,[r.createVNode(Ft,{modelValue:V.hidden,"onUpdate:modelValue":[H=>V.hidden=H,A[0]||(A[0]=()=>d.value?.events.update.emit(null))],disabled:!V.optional,inversed:"",style:{"padding-right":"8px"}},null,8,["modelValue","onUpdate:modelValue","disabled"]),(r.openBlock(),r.createBlock(r.resolveDynamicComponent(V.component),{modelValue:V.value,"onUpdate:modelValue":H=>V.value=H,node:d.value,intf:V,style:{width:"100%"}},null,8,["modelValue","onUpdate:modelValue","node","intf"]))])]))),128))]),r.createElementVNode("div",vo,[c.value&&c.value.state?(r.openBlock(),r.createElementBlock("div",No,[A[3]||(A[3]=r.createElementVNode("label",null,"Variable name",-1)),r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":A[1]||(A[1]=V=>c.value.state.variableName=V),placeholder:c.value.variableName,type:"text",class:"baklava-input",title:"Variable name",onBlur:g,onKeydown:r.withKeys(g,["enter"])},null,40,Co),[[r.vModelText,c.value.state.variableName]])])):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(m.value,V=>(r.openBlock(),r.createElementBlock("div",{key:V.id,class:"__interface"},[r.createElementVNode("div",Mo,[r.createVNode(Ft,{modelValue:V.hidden,"onUpdate:modelValue":[H=>V.hidden=H,A[2]||(A[2]=()=>d.value?.events.update.emit(null))],disabled:!V.optional,inversed:"",style:{"padding-right":"8px"}},null,8,["modelValue","onUpdate:modelValue","disabled"]),(r.openBlock(),r.createBlock(r.resolveDynamicComponent(V.component),{modelValue:V.value,"onUpdate:modelValue":H=>V.value=H,node:d.value,intf:V,style:{width:"100%"}},null,8,["modelValue","onUpdate:modelValue","node","intf"]))])]))),128))])]),r.renderSlot(k.$slots,"codeEditor",{node:d.value})],64)):r.createCommentVNode("",!0)],6))}});function So(e,t){return Object.fromEntries(Object.entries(e).filter(t))}function Oo(e,t){return Object.fromEntries(Object.entries(e).map(([n,s])=>[n,t(s)]))}const Eo={class:"baklava-node --palette",style:{"margin-top":"-20px","margin-bottom":"20px"}},To={key:0,style:{display:"flex","justify-content":"space-between"}},Io=["onClick"],xo={key:0,style:{margin:"auto 0","font-size":"12px"}},ms=r.defineComponent({__name:"CodeNodePalette",setup(e){const t=S.Components.PaletteEntry,{viewModel:n}=S.useViewModel(),{x:s,y:a}=Ya.usePointer(),{transform:o}=S.useTransform(),i=S.useNodeCategories(n),l=r.inject("editorEl"),d=r.ref(""),c=r.ref(null),f=()=>d.value?i.value.filter(g=>g.name.toLowerCase().includes(d.value.toLowerCase())||Object.values(g.nodeTypes).some(M=>M.title.toLowerCase().includes(d.value.toLowerCase()))):i.value,w=g=>d.value?So(g,M=>{const h=M[1];return h.category.includes(d.value.toLowerCase())||h.title?.toLowerCase().includes(d.value.toLowerCase())}):g,m=r.computed(()=>{if(!c.value||!l?.value)return{};const{left:g,top:M}=l.value.getBoundingClientRect();return{top:`${a.value-M}px`,left:`${s.value-g}px`}}),x=(g,M)=>{c.value={type:g,nodeInformation:M};const h=()=>{const k=r.reactive(new M.type);n.value.displayedGraph.addNode(k);const A=l.value.getBoundingClientRect(),[V,H]=o(s.value-A.left,a.value-A.top);k.position.x=V,k.position.y=H,c.value=null,document.removeEventListener("pointerup",h)};document.addEventListener("pointerup",h)};return(g,M)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createElementVNode("div",{class:r.normalizeClass([{"--open":r.unref(n).settings.palette.enabled},"baklava-node-palette"]),onContextmenu:M[1]||(M[1]=r.withModifiers(()=>{},["stop","prevent"]))},[r.createElementVNode("div",Eo,[r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":M[0]||(M[0]=h=>d.value=h),type:"text",class:"baklava-input",title:"Filter nodes",onKeyup:f},null,544),[[r.vModelText,d.value]])]),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(f(),h=>(r.openBlock(),r.createElementBlock("section",{key:h.name},[h.name!=="default"?(r.openBlock(),r.createElementBlock("h3",To,[r.createElementVNode("div",{onClick:k=>d.value=h.name,style:{cursor:"pointer"}},r.toDisplayString(h.name),9,Io),Object.keys(w(h.nodeTypes)).length<Object.values(h.nodeTypes).length?(r.openBlock(),r.createElementBlock("div",xo," ( "+r.toDisplayString(Object.keys(w(h.nodeTypes)).length)+" / "+r.toDisplayString(Object.values(h.nodeTypes).length)+" ) ",1)):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(w(h.nodeTypes),(k,A)=>(r.openBlock(),r.createBlock(r.unref(t),{key:A,title:k.title,type:A,onPointerdown:V=>x(A,k)},null,8,["title","type","onPointerdown"]))),128))]))),128))],34),r.createVNode(r.Transition,{name:"fade"},{default:r.withCtx(()=>[c.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:"baklava-dragged-node",style:r.normalizeStyle(m.value)},[r.createVNode(r.unref(t),{type:c.value.type,title:c.value.nodeInformation.title},null,8,["type","title"])],4)):r.createCommentVNode("",!0)]),_:1})],64))}}),Do={},Yo={class:"prependIcon"},Ro={class:"appendIcon"};function Po(e,t){const n=r.resolveComponent("router-link");return r.openBlock(),r.createBlock(n,{class:"navItem"},{default:r.withCtx(()=>[r.createElementVNode("span",Yo,[r.renderSlot(e.$slots,"prependIcon")]),r.renderSlot(e.$slots,"default"),r.createElementVNode("span",Ro,[r.renderSlot(e.$slots,"appendIcon")])]),_:3})}const Gt=z(Do,[["render",Po]]),Bo={class:"navbar"},Vo=["onClick"],Lo=r.defineComponent({__name:"NavBar",props:{viewModel:{},editorStates:{},routes:{}},emits:["click:remove"],setup(e,{emit:t}){const n=t,s=a=>{n("click:remove",a)};return(a,o)=>(r.openBlock(),r.createElementBlock("nav",Bo,[r.renderSlot(a.$slots,"prepend"),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.editorStates,i=>(r.openBlock(),r.createBlock(Gt,{key:i.graph.id,class:r.normalizeClass({active:i.graph.id===e.viewModel.displayedGraph.id}),to:{name:e.routes?.edit??"edit",params:{editorId:i.graph.id}}},{appendIcon:r.withCtx(()=>[r.createElementVNode("button",{class:"remove",onClick:r.withModifiers(l=>s(i.graph.id),["prevent"])},[r.createVNode(r.unref(cs))],8,Vo)]),default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(i.graph.id.slice(0,6))+" ",1)]),_:2},1032,["class","to"]))),128)),r.renderSlot(a.$slots,"append",{},()=>[r.createVNode(Gt,{to:{name:e.routes?.new??"new"},class:"navItem"},{default:r.withCtx(()=>[r.createVNode(r.unref(as),{class:"plus"})]),_:1},8,["to"])])]))}}),Ao=r.defineComponent({props:{intf:{type:Object,required:!0},modelValue:{type:String,required:!0}},emits:["update:modelValue"],setup(e,{emit:t}){return{v:r.computed({get:()=>e.modelValue,set:s=>{t("update:modelValue",s)}})}}}),Uo={style:{position:"relative"}},$o={style:{"font-size":"12px",padding:"0 6px",position:"absolute",top:"-8px","background-color":"var(--baklava-node-color-background)"}},Wo=["placeholder","title"];function Ho(e,t,n,s,a,o){return r.openBlock(),r.createElementBlock("div",Uo,[r.createElementVNode("label",$o,r.toDisplayString(e.intf.name),1),r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":t[0]||(t[0]=i=>e.v=i),type:"text",class:"baklava-input",placeholder:e.intf.name,title:e.intf.name},null,8,Wo),[[r.vModelText,e.v]])])}const jt=z(Ao,[["render",Ho]]),Fo=Object.freeze(Object.defineProperty({__proto__:null,CodeEditor:Xr,CodeGraphEditor:Qr,CodeGraphInfo:to,CodeGraphNode:fs,CodeGraphNodeInterface:Ht,CodeGraphSidebar:ps,CodeNodePalette:ms,CopyToClipboard:hs,NavBar:Lo,NavItem:Gt,SidebarCheckbox:Ft,TextInputInterface:jt},Symbol.toStringTag,{value:"Module"}));Le.escape=e=>e;class zt extends q.AbstractNode{codeTemplate;isCodeNode=!0;mask=null;name="";state;_variableName="";inputs={};outputs={};constructor(){super(),this.initializeIo(),this.twoColumn=!0,this.state=r.reactive({codeTemplate:"",hidden:!1,integrated:!1,lockCode:!1,modules:[],props:null,script:"",variableName:"",variableNameNumberAppendix:!0}),this.codeTemplate=function(){return`${this.name}(${_s(this.codeNodeInputs).join(", ")})`}}get code(){return this.graph.code}get codeNodeInputs(){return Object.fromEntries(Object.entries(this.inputs).filter(t=>t[1].isCodeNode&&t[1].type!="node"))}get codeNodeOutputs(){return Object.fromEntries(Object.entries(this.outputs).filter(t=>t[1].isCodeNode&&t[1].type!="node"))}get graph(){return super.graph}get hasConnectedOutputNodes(){return this.getConnectedNodes("outputs").length>0}get idx(){return this.graph.nodes.filter(t=>!t.state.integrated).indexOf(this)??-1}get idxByType(){return this.graph.getNodesByType(this.type).indexOf(this)??-1}get idxByVariableNames(){return this.graph.getNodesByVariableName(this.state.variableName||this._variableName).filter(t=>!t.state.integrated).indexOf(this)??-1}get isSelected(){return this.graph.selectedNodeIds.includes(this.id)}get lockCode(){return this.state.lockCode}set lockCode(t){this.state.lockCode=t,this.events.update.emit(null)}get optionalInputs(){return Object.fromEntries(Object.entries(this.codeNodeInputs).filter(t=>t[1].optional))}get requiredInputs(){return Object.fromEntries(Object.entries(this.codeNodeInputs).filter(t=>!t[1].optional))}get script(){return this.outputs._code?.value??""}set script(t){this.outputs._code&&(this.outputs._code.value=t),this.events.update.emit(null)}get shortId(){return this.id.slice(0,6)}get subgraph(){}get variableName(){return this.state.variableName||this._variableName?(this.state.variableName||this._variableName)+(this.state.variableNameNumberAppendix?this.idxByVariableNames+1:""):""}getConnectedNodeByInterface(t,n){const s=this.getConnectedNodesByInterface(t,n);return s.length>0?s[0]:null}getConnectedNodes(t){let n=[];if(t!=="inputs"){const s=this.graph.connections.filter(a=>a.from.name!=="_code").filter(a=>a.from.nodeId===this.id).map(a=>a.to.nodeId);s&&(n=n.concat(s))}if(t!=="outputs"){const s=this.graph.connections.filter(a=>a.from.name!=="_code").filter(a=>a.to.nodeId===this.id).map(a=>a.from.nodeId);s&&(n=n.concat(s))}return!n||n.length==0?[]:n.map(s=>this.graph.findNodeById(s))}getConnectedNodesByInterface(t,n){let s=[];if(n!=="outputs"&&this.inputs[t]){const a=this.graph.connections.filter(o=>o.to.id===this.inputs[t]?.id||o.from.id===this.inputs[t]?.id).map(o=>o.from.nodeId);a&&(s=s.concat(a))}if(n!=="inputs"&&this.outputs[t]){const a=this.graph.connections.filter(o=>o.from.id===this.outputs[t]?.id||o.from.id===this.outputs[t]?.id).map(o=>o.to.nodeId);a&&(s=s.concat(a))}return!s||s.length==0?[]:s.map(a=>this.graph.findNodeById(a))}remove(){this.graph?.removeNode(this)}renderCode(t){return Le.render(this.state.codeTemplate,t)}updateCodeTemplate(){this.state.codeTemplate=this.codeTemplate.call(this)}updateModules(t){if(t)this.state.modules=t;else if(this.type.includes(".")){const n=this.type.split(".");this.state.modules.push(n.slice(0,n.length-1).join("."))}}updateOutputNames(){Object.values(this.codeNodeOutputs).forEach(t=>{t.name=this.state.integrated?"":this.variableName+t.suffix})}updateOutputValues(t){Object.keys(this.outputs).forEach(n=>{n!=="_code"&&(t[n]=this.state.integrated?t._code:this.outputs[n].name)})}updateProps(t){this.state.props=t}updateInputValues(t){const n=Object.keys(this.inputs);Object.keys(t).forEach(s=>{!n.includes(s)||!this.inputs[s]||(this.inputs[s].value=t[s],this.inputs[s].setHidden(!1))})}}class ht extends zt{calculate=(t,n)=>{const s={};return this.lockCode||(s._code=this.renderCode({inputs:t,...n})),this.updateOutputValues(s),s};executeFactory(t,n){Object.keys(n||{}).forEach(s=>{const a=n[s]();t==="input"?this.addInput(s,a):this.addOutput(s,a)})}load(t){super.load(t),this.afterLoaded()}}const _s=(e,t=!0)=>{const n=[],s=Object.keys(e);return s.forEach(a=>{if(e[a]?.hidden)return;const i=t&&n.length<s.indexOf(a)?`${a}=`:"";n.push(`${i}{{ inputs.${a} }}`)}),n},ys=(e,t)=>{switch(e){case"CheckBoxInterface":return new ks(t.id,t.value);case"IntegerInterface":return new en(t.id,t.value,t.min,t.max);case"NumberInterface":return new ws(t.id,t.value,t.min,t.max);case"SelectInterface":return new vs(t.id,t.value,t.items);default:return new nn(t.id,t.value)}},Go=["title"],ft=r.defineComponent({__name:"CodeNodeInterface",props:{intf:{}},setup(e){return(t,n)=>(r.openBlock(),r.createElementBlock("div",{title:e.intf.value},r.toDisplayString(e.intf.name),9,Go))}});class Q extends q.NodeInterface{isCodeNode=!0;code;state;type=null;constructor(t,n){super(t,n),this.setComponent(r.markRaw(ft)),this.state=r.reactive({optional:!1})}get optional(){return this.state.optional}get shortId(){return this.id.slice(0,6)}getValue=()=>`${this.value??"None"}`;load(t){this.id=t.id,this.templateId=t.templateId,this.name!=="_code"&&(t.optional&&(this.state.optional=t.optional),this.value=t.value,this.hooks.load.execute(t),this.hidden=t.hidden)}save(){const t={id:this.id,templateId:this.templateId,value:this.value,hidden:this.hidden};return this.state.optional&&(t.optional=this.state.optional),this.hooks.save.execute(t)}setOptional(t){return this.state.optional=t,this.setHidden(t),this}}class Ae extends Q{constructor(t="",n){super(t,n),this.setComponent(r.markRaw(ft)),this.use(S.displayInSidebar,!0)}get value(){return super.value}set value(t){super.value=t,this.name!=="_code"&&this.setHidden(!1)}}const Zt=new G.NodeInterfaceType("boolean"),gs=new G.NodeInterfaceType("dict"),qt=new G.NodeInterfaceType("list"),se=new G.NodeInterfaceType("node"),Kt=new G.NodeInterfaceType("number"),Jt=new G.NodeInterfaceType("string"),Xt=new G.NodeInterfaceType("tuple"),jo=e=>{new G.BaklavaInterfaceTypes(e.editor,{viewPlugin:e}).addTypes(Zt,gs,qt,se,Kt,Jt,Xt)};class ks extends Ae{constructor(t,n){super(t,n),this.setComponent(r.markRaw(S.CheckboxInterfaceComponent)),this.use(G.setType,Zt)}getValue=()=>this.value?"True":"False"}class bs extends Q{isCodeNodeOutput=!0;suffix="";constructor(t="",n=""){super(t,""),this.suffix=n,this.setComponent(r.markRaw(ft))}get codeValue(){return this.node?.outputs._code.value??""}get node(){const{graph:t}=S.useGraph();return t.value.findNodeById(this.nodeId)}}class Qt extends Ae{min;max;constructor(t,n,s,a){super(t,n),this.min=s,this.max=a,this.use(G.setType,Kt)}validate(t){return(this.min===void 0||t>=this.min)&&(this.max===void 0||t<=this.max)}}class en extends Qt{component=r.markRaw(S.IntegerInterfaceComponent);validate(t){return Number.isInteger(t)&&super.validate(t)}}class zo extends Ae{constructor(t="",n=""){super(t,n),this.setComponent(r.markRaw(S.TextInputInterfaceComponent)),this.use(G.setType,qt)}getValue=()=>`[${this.value}]`}class ws extends Qt{component=r.markRaw(S.NumberInterfaceComponent)}class tn extends Ae{constructor(t,n){super(t,n),this.use(G.setType,Jt)}getValue=()=>`"${this.value}"`}class vs extends tn{component=r.markRaw(S.SelectInterfaceComponent);items;constructor(t,n,s){super(t,n),this.items=s}}class Zo extends Qt{component=r.markRaw(S.SliderInterfaceComponent);min;max;constructor(t,n,s,a){super(t,n,s,a),this.min=s,this.max=a}getValue=()=>`${Math.round(this.value*1e3)/1e3}`}class nn extends tn{component=r.markRaw(jt)}class qo extends tn{component=r.markRaw(S.TextareaInputInterfaceComponent)}class Ko extends Ae{constructor(t="",n=""){super(t,n),this.setComponent(r.markRaw(S.TextInputInterfaceComponent)),this.use(G.setType,Xt)}getValue=()=>`(${this.value})`}function Jo(e){return class extends ht{type=e.type;inputs={};outputs={};constructor(){super(),this._title=e.title??e.type,this.executeFactory("input",e.inputs),this.executeFactory("output",e.outputs),e.calculate&&(this.calculate=(t,n)=>e.calculate.call(this,t,n)),e.onCreate?.call(this),this.name=e.name??e.type,this.updateModules(e.modules),e.codeTemplate&&(this.codeTemplate=e.codeTemplate),e.variableName!=null&&(this._variableName=e.variableName),this.addInput("_code",new Q("_code",[]).use(G.setType,se).use(he.allowMultipleConnections).setHidden(!0)),this.addOutput("_code",new Q("_code",[]).use(G.setType,se).use(he.allowMultipleConnections).setHidden(!0))}afterGraphLoaded(){e.afterGraphLoaded?.call(this)}afterLoaded(){e.afterLoaded?.call(this)}onPlaced(){e.onPlaced?.call(this)}onConnected(){e.onConnected?.call(this)}onDestroy(){e.onDestroy?.call(this)}onGraphUpdate(){e.onGraphUpdate?.call(this)}onUnconnected(){e.onUnconnected?.call(this)}update(){e.update?.call(this)}}}class Ns extends ht{}function Xo(e){return class extends Ns{type=e.type;inputs={};outputs={};preventUpdate=!1;staticInputKeys=Object.keys(e.inputs??{});staticOutputKeys=Object.keys(e.outputs??{});constructor(){super(),this._title=e.title??e.type,this.executeFactory("input",e.inputs),this.executeFactory("output",e.outputs),e.calculate&&(this.calculate=(t,n)=>e.calculate?.call(this,t,n)),e.onCreate?.call(this),this.name=e.name??e.type,this.updateModules(e.modules),e.codeTemplate&&(this.codeTemplate=e.codeTemplate),e.variableName&&(this._variableName=e.variableName),this.addInput("_code",new Q("_code",[]).use(G.setType,se).use(he.allowMultipleConnections).setHidden(!0)),this.addOutput("_code",new Q("_code",[]).use(G.setType,se).use(he.allowMultipleConnections).setHidden(!0)),this.staticInputKeys.push("_code"),this.staticOutputKeys.push("_code")}afterGraphLoaded(){e.afterGraphLoaded?.call(this)}afterLoaded(){e.afterLoaded?.call(this)}onPlaced(){this.events.update.subscribe(this,t=>{t&&(t.type==="input"&&this.staticInputKeys.includes(t.name)||t.type==="output"&&this.staticOutputKeys.includes(t.name))&&this.onUpdate()}),this.onUpdate(),e.onPlaced?.call(this)}onConnected(){e.onConnected?.call(this)}onDestroy(){e.onDestroy?.call(this)}onGraphUpdate(){e.onGraphUpdate?.call(this)}onUnconnected(){e.onUnconnected?.call(this)}update(){e.update?.call(this)}load(t){this.preventUpdate=!0,this.hooks.beforeLoad.execute(t),this.id=t.id,this.title=t.title;for(const n of this.staticInputKeys)this.inputs[n].load(t.inputs[n]),this.inputs[n].nodeId=this.id;for(const n of this.staticOutputKeys)this.outputs[n].load(t.outputs[n]),this.outputs[n].nodeId=this.id;this.preventUpdate=!1,this.onUpdate(),this.preventUpdate=!0;for(const n of Object.keys(t.inputs))if(!(this.staticInputKeys.includes(n)||!t.inputs[n])){if(!this.inputs[n]){const s=t.inputs[n],a=s.value;let o;s.component?o=ys(s.component,{...s,id:n}):typeof a=="number"?o=new en(n,a):o=new nn(n,JSON.stringify(a)),o.use(S.displayInSidebar,!0),this.addInput(n,o)}this.inputs[n]&&(this.inputs[n].load(t.inputs[n]),this.inputs[n].nodeId=this.id)}for(const n of Object.keys(t.outputs))if(!(this.staticOutputKeys.includes(n)||!t.outputs[n])){if(!this.outputs[n]){const s=new bs(n);this.addOutput(n,s)}this.outputs[n]&&(this.outputs[n].load(t.outputs[n]),this.outputs[n].nodeId=this.id)}this.preventUpdate=!1,this.events.loaded.emit(this)}onUpdate(){if(!e.onUpdate||this.preventUpdate)return;this.graph&&this.graph.activeTransactions++;const t=this.getStaticValues(this.staticInputKeys,this.inputs),n=this.getStaticValues(this.staticOutputKeys,this.outputs),s=e.onUpdate.call(this,t,n);this.updateInterfaces("input",s.inputs??{},s.forceUpdateInputs??[]),this.updateInterfaces("output",s.outputs??{},s.forceUpdateOutputs??[]),this.graph&&this.graph.activeTransactions--}getStaticValues(t,n){const s={};for(const a of t)s[a]=n[a].value;return s}updateInputInterfaces(t={},n=[]){this.updateInterfaces("input",t,n)}updateInterfaces(t,n={},s=[]){const a=t==="input"?this.staticInputKeys:this.staticOutputKeys,o=t==="input"?this.inputs:this.outputs;for(const i of Object.keys(o))a.includes(i)||n[i]&&!s.includes(i)||(t==="input"?this.removeInput(i):this.removeOutput(i));for(const i of Object.keys(n)){if(o[i])continue;const l=n[i]();t==="input"?this.addInput(i,l):this.addOutput(i,l)}}updateProps(t){this.state.props=t,this.onUpdate()}}}Le.escape=e=>e;class pt{_id;_state;viewModel;constructor(){this._id=De.v4(),this._state=r.reactive({lockCode:!1,modules:{},script:"",template:""})}get engine(){return this.viewModel?.engine}get graph(){return this.viewModel?.editor.graph}get id(){return this._id}get lockCode(){return this.state.lockCode}set lockCode(t){this.state.lockCode=t,this.engine?.runOnce(null)}get modules(){const t=[];return this.graph?.codeNodes.filter(n=>n.state.modules?.length>0).forEach(n=>t.push(...n.state.modules)),t?(t.sort(),Array.from(new Set(t.map(n=>this.state.modules[n])))):[]}get script(){return this.state.script}set script(t){this.state.script=t,this.engine?.runOnce(null)}get shortId(){return this.id.slice(0,6)}get state(){return this._state}clear(){this.state.script=""}async loadTemplate(t){t.then(n=>{this._state.template=n.default??""})}registerViewModel(t){this.viewModel=t}renderCode(t){this.state.script=Le.render(this.state.template??"",t??{})}}class Qo extends pt{constructor(){super(),this.loadTemplate(Promise.resolve().then(()=>hu))}}class ei extends pt{constructor(){super(),this.loadTemplate(Promise.resolve().then(()=>fu))}}const ti=e=>{e.allowMultipleConnections=!0};class Cs extends he.BaseEngine{order=new Map;constructor(t){super(t)}start(){super.start(),this.recalculateOrder=!0,this.calculateWithoutData()}async runGraph(t,n,s){this.order.has(t.id)||this.order.set(t.id,he.sortTopologically(t));const{calculationOrder:a,connectionsFromNode:o}=this.order.get(t.id),i=new Map;for(const l of a){const d={};Object.entries(l.inputs).forEach(([f,w])=>{d[f]=this.getInterfaceValue(n,w.id)}),l.isCodeNode&&(l.updateCodeTemplate(),l.updateOutputNames()),this.events.beforeNodeCalculation.emit({inputValues:d,node:l});let c;if(l.calculate){if(c=await l.calculate(d,{globalValues:s,engine:this}),o.has(l))for(const[f,w]of Object.entries(c))this.hooks.transferData.execute(c[f],w),o.get(l).forEach(m=>n.set(m.to.id,w))}else{c={};for(const[f,w]of Object.entries(l.outputs))c[f]=this.getInterfaceValue(n,w.id)}this.events.afterNodeCalculation.emit({outputValues:c,node:l}),i.set(l.id,new Map(Object.entries(c))),o.has(l)&&o.get(l).forEach(f=>{const w=Object.entries(l.outputs).find(([,x])=>x.id===f.from.id)?.[0];if(!w)throw new Error(`Could not find key for interface ${f.from.id}
|
|
1
|
+
(function(p,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vue"),require("@baklavajs/renderer-vue"),require("@baklavajs/core"),require("@vueuse/core"),require("mustache"),require("uuid"),require("@baklavajs/interface-types"),require("@baklavajs/engine"),require("toposort"),require("@baklavajs/events")):typeof define=="function"&&define.amd?define(["exports","vue","@baklavajs/renderer-vue","@baklavajs/core","@vueuse/core","mustache","uuid","@baklavajs/interface-types","@baklavajs/engine","toposort","@baklavajs/events"],r):(p=typeof globalThis<"u"?globalThis:p||self,r(p["@babsey/code-graph"]={},p.vue,p["@baklavajs/renderer-vue"],p["@baklavajs/core"],p["@vueuse/core"],p.mustache,p.uuid,p["@baklavajs/interface-types"],p["@baklavajs/engine"],p.toposort,p["@baklavajs/events"]))})(this,(function(p,r,S,q,Ya,Le,De,G,he,Ra,Jn){"use strict";const z=(e,t)=>{const n=e.__vccOpts||e;for(const[s,a]of t)n[s]=a;return n},Pa={},Ba={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-check"};function Va(e,t){return r.openBlock(),r.createElementBlock("svg",Ba,[...t[0]||(t[0]=[r.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),r.createElementVNode("path",{d:"M5 12l5 5l10 -10"},null,-1)])])}const Xn=z(Pa,[["render",Va]]),La={},Aa={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-code-variable"};function Ua(e,t){return r.openBlock(),r.createElementBlock("svg",Aa,[...t[0]||(t[0]=[r.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),r.createElementVNode("path",{d:"M4 8m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v4a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z"},null,-1)])])}const Qn=z(La,[["render",Ua]]),$a={},Wa={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-copy"};function Ha(e,t){return r.openBlock(),r.createElementBlock("svg",Wa,[...t[0]||(t[0]=[r.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),r.createElementVNode("path",{d:"M7 7m0 2.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667z"},null,-1),r.createElementVNode("path",{d:"M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1"},null,-1)])])}const es=z($a,[["render",Ha]]),Fa={},Ga={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-dots-vertical"};function ja(e,t){return r.openBlock(),r.createElementBlock("svg",Ga,[...t[0]||(t[0]=[r.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),r.createElementVNode("path",{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null,-1),r.createElementVNode("path",{d:"M12 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null,-1),r.createElementVNode("path",{d:"M12 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null,-1)])])}const ts=z(Fa,[["render",ja]]),za={},Za={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-download"};function qa(e,t){return r.openBlock(),r.createElementBlock("svg",Za,[...t[0]||(t[0]=[r.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),r.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),r.createElementVNode("path",{d:"M7 11l5 5l5 -5"},null,-1),r.createElementVNode("path",{d:"M12 4l0 12"},null,-1)])])}const ns=z(za,[["render",qa]]),Ka={},Ja={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",class:"baklava-icon icon icon-tabler icons-tabler-filled icon-tabler-layout-sidebar-left-collapse"};function Xa(e,t){return r.openBlock(),r.createElementBlock("svg",Ja,[...t[0]||(t[0]=[r.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),r.createElementVNode("path",{d:"M18 3a3 3 0 0 1 2.995 2.824l.005 .176v12a3 3 0 0 1 -2.824 2.995l-.176 .005h-12a3 3 0 0 1 -2.995 -2.824l-.005 -.176v-12a3 3 0 0 1 2.824 -2.995l.176 -.005h12zm0 2h-9v14h9a1 1 0 0 0 .993 -.883l.007 -.117v-12a1 1 0 0 0 -.883 -.993l-.117 -.007zm-2.293 4.293a1 1 0 0 1 .083 1.32l-.083 .094l-1.292 1.293l1.292 1.293a1 1 0 0 1 .083 1.32l-.083 .094a1 1 0 0 1 -1.32 .083l-.094 -.083l-2 -2a1 1 0 0 1 -.083 -1.32l.083 -.094l2 -2a1 1 0 0 1 1.414 0z"},null,-1)])])}const Qa=z(Ka,[["render",Xa]]),er={},tr={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",class:"baklava-icon icon icon-tabler icons-tabler-filled icon-tabler-layout-sidebar-left-expand"};function nr(e,t){return r.openBlock(),r.createElementBlock("svg",tr,[...t[0]||(t[0]=[r.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),r.createElementVNode("path",{d:"M18 3a3 3 0 0 1 2.995 2.824l.005 .176v12a3 3 0 0 1 -2.824 2.995l-.176 .005h-12a3 3 0 0 1 -2.995 -2.824l-.005 -.176v-12a3 3 0 0 1 2.824 -2.995l.176 -.005h12zm0 2h-9v14h9a1 1 0 0 0 .993 -.883l.007 -.117v-12a1 1 0 0 0 -.883 -.993l-.117 -.007zm-4.387 4.21l.094 .083l2 2a1 1 0 0 1 .083 1.32l-.083 .094l-2 2a1 1 0 0 1 -1.497 -1.32l.083 -.094l1.292 -1.293l-1.292 -1.293a1 1 0 0 1 -.083 -1.32l.083 -.094a1 1 0 0 1 1.32 -.083z"},null,-1)])])}const sr=z(er,[["render",nr]]),ar={},rr={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",class:"baklava-icon icon icon-tabler icons-tabler-filled icon-tabler-layout-sidebar-right"};function or(e,t){return r.openBlock(),r.createElementBlock("svg",rr,[...t[0]||(t[0]=[r.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),r.createElementVNode("path",{d:"M6 21a3 3 0 0 1 -3 -3v-12a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3zm8 -16h-8a1 1 0 0 0 -1 1v12a1 1 0 0 0 1 1h8z"},null,-1)])])}const ir=z(ar,[["render",or]]),lr={},dr={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",class:"baklava-icon icon icon-tabler icons-tabler-filled icon-tabler-layout-sidebar-right-collapse"};function cr(e,t){return r.openBlock(),r.createElementBlock("svg",dr,[...t[0]||(t[0]=[r.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),r.createElementVNode("path",{d:"M18 3a3 3 0 0 1 2.995 2.824l.005 .176v12a3 3 0 0 1 -2.824 2.995l-.176 .005h-12a3 3 0 0 1 -2.995 -2.824l-.005 -.176v-12a3 3 0 0 1 2.824 -2.995l.176 -.005h12zm-3 2h-9a1 1 0 0 0 -.993 .883l-.007 .117v12a1 1 0 0 0 .883 .993l.117 .007h9v-14zm-5.387 4.21l.094 .083l2 2a1 1 0 0 1 .083 1.32l-.083 .094l-2 2a1 1 0 0 1 -1.497 -1.32l.083 -.094l1.292 -1.293l-1.292 -1.293a1 1 0 0 1 -.083 -1.32l.083 -.094a1 1 0 0 1 1.32 -.083z"},null,-1)])])}const ss=z(lr,[["render",cr]]),ur={},hr={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",class:"baklava-icon icon icon-tabler icons-tabler-filled icon-tabler-layout-sidebar-right-expand"};function fr(e,t){return r.openBlock(),r.createElementBlock("svg",hr,[...t[0]||(t[0]=[r.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),r.createElementVNode("path",{d:"M18 3a3 3 0 0 1 2.995 2.824l.005 .176v12a3 3 0 0 1 -2.824 2.995l-.176 .005h-12a3 3 0 0 1 -2.995 -2.824l-.005 -.176v-12a3 3 0 0 1 2.824 -2.995l.176 -.005h12zm-3 2h-9a1 1 0 0 0 -.993 .883l-.007 .117v12a1 1 0 0 0 .883 .993l.117 .007h9v-14zm-3.293 4.293a1 1 0 0 1 .083 1.32l-.083 .094l-1.292 1.293l1.292 1.293a1 1 0 0 1 .083 1.32l-.083 .094a1 1 0 0 1 -1.32 .083l-.094 -.083l-2 -2a1 1 0 0 1 -.083 -1.32l.083 -.094l2 -2a1 1 0 0 1 1.414 0z"},null,-1)])])}const $t=z(ur,[["render",fr]]),pr={},mr={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-lock-code"};function _r(e,t){return r.openBlock(),r.createElementBlock("svg",mr,[...t[0]||(t[0]=[r.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M11.5 21h-4.5a2 2 0 0 1 -2 -2v-6a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2"></path><path d="M11 16a1 1 0 1 0 2 0a1 1 0 0 0 -2 0"></path><path d="M8 11v-4a4 4 0 1 1 8 0v4"></path><path d="M20 21l2 -2l-2 -2"></path><path d="M17 17l-2 2l2 2"></path>',6)])])}const Wt=z(pr,[["render",_r]]),yr={},gr={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-player-play"};function kr(e,t){return r.openBlock(),r.createElementBlock("svg",gr,[...t[0]||(t[0]=[r.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),r.createElementVNode("path",{d:"M7 4v16l13 -8z"},null,-1)])])}const br=z(yr,[["render",kr]]),wr={},vr={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-plus"};function Nr(e,t){return r.openBlock(),r.createElementBlock("svg",vr,[...t[0]||(t[0]=[r.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),r.createElementVNode("path",{d:"M12 5l0 14"},null,-1),r.createElementVNode("path",{d:"M5 12l14 0"},null,-1)])])}const as=z(wr,[["render",Nr]]),Cr={},Mr={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-restore"};function Sr(e,t){return r.openBlock(),r.createElementBlock("svg",Mr,[...t[0]||(t[0]=[r.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),r.createElementVNode("path",{d:"M3.06 13a9 9 0 1 0 .49 -4.087"},null,-1),r.createElementVNode("path",{d:"M3 4.001v5h5"},null,-1),r.createElementVNode("path",{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null,-1)])])}const rs=z(Cr,[["render",Sr]]),Or={},Er={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-schema"};function Tr(e,t){return r.openBlock(),r.createElementBlock("svg",Er,[...t[0]||(t[0]=[r.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M5 2h5v4h-5z"></path><path d="M15 10h5v4h-5z"></path><path d="M5 18h5v4h-5z"></path><path d="M5 10h5v4h-5z"></path><path d="M10 12h5"></path><path d="M7.5 6v4"></path><path d="M7.5 14v4"></path>',8)])])}const os=z(Or,[["render",Tr]]),Ir={},xr={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-schema-off"};function Dr(e,t){return r.openBlock(),r.createElementBlock("svg",xr,[...t[0]||(t[0]=[r.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M6 2h4v4m-4 0h-1v-1"></path><path d="M15 11v-1h5v4h-2"></path><path d="M5 18h5v4h-5z"></path><path d="M5 10h5v4h-5z"></path><path d="M10 12h2"></path><path d="M7.5 7.5v2.5"></path><path d="M7.5 14v4"></path><path d="M3 3l18 18"></path>',9)])])}const is=z(Ir,[["render",Dr]]),Yr={},Rr={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-transition-bottom"};function Pr(e,t){return r.openBlock(),r.createElementBlock("svg",Rr,[...t[0]||(t[0]=[r.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M21 18a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3"></path><path d="M3 3m0 3a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v0a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3z"></path><path d="M12 9v8"></path><path d="M9 14l3 3l3 -3"></path>',5)])])}const ls=z(Yr,[["render",Pr]]),Br={},Vr={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-upload"};function Lr(e,t){return r.openBlock(),r.createElementBlock("svg",Vr,[...t[0]||(t[0]=[r.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),r.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),r.createElementVNode("path",{d:"M7 9l5 -5l5 5"},null,-1),r.createElementVNode("path",{d:"M12 4l0 12"},null,-1)])])}const ds=z(Br,[["render",Lr]]),Ar={},Ur={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-x"};function $r(e,t){return r.openBlock(),r.createElementBlock("svg",Ur,[...t[0]||(t[0]=[r.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),r.createElementVNode("path",{d:"M18 6l-12 12"},null,-1),r.createElementVNode("path",{d:"M6 6l12 12"},null,-1)])])}const cs=z(Ar,[["render",$r]]),Wr=Object.freeze(Object.defineProperty({__proto__:null,Check:Xn,CodeVariable:Qn,Copy:es,DotsVertical:ts,Download:ns,LayoutSidebarLeftCollapse:Qa,LayoutSidebarLeftExpand:sr,LayoutSidebarRight:ir,LayoutSidebarRightCollapse:ss,LayoutSidebarRightExpand:$t,LockCode:Wt,PlayerPlay:br,Plus:as,Restore:rs,Schema:os,SchemaOff:is,TransitionBottom:ls,Upload:ds,X:cs},Symbol.toStringTag,{value:"Module"}));function Hr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ut={exports:{}};var Fr=ut.exports,us;function Gr(){return us||(us=1,(function(e,t){(function(s,a){e.exports=a()})(Fr,function(){return(function(){var n={686:(function(o,i,l){l.d(i,{default:function(){return j}});var d=l(279),c=l.n(d),f=l(370),w=l.n(f),m=l(817),x=l.n(m);function g(b){try{return document.execCommand(b)}catch{return!1}}var M=function(N){var v=x()(N);return g("cut"),v},h=M;function k(b){var N=document.documentElement.getAttribute("dir")==="rtl",v=document.createElement("textarea");v.style.fontSize="12pt",v.style.border="0",v.style.padding="0",v.style.margin="0",v.style.position="absolute",v.style[N?"right":"left"]="-9999px";var E=window.pageYOffset||document.documentElement.scrollTop;return v.style.top="".concat(E,"px"),v.setAttribute("readonly",""),v.value=b,v}var A=function(N,v){var E=k(N);v.container.appendChild(E);var I=x()(E);return g("copy"),E.remove(),I},V=function(N){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body},E="";return typeof N=="string"?E=A(N,v):N instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(N?.type)?E=A(N.value,v):(E=x()(N),g("copy")),E},H=V;function Oe(b){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Oe=function(v){return typeof v}:Oe=function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},Oe(b)}var Ee=function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},v=N.action,E=v===void 0?"copy":v,I=N.container,R=N.target,ue=N.text;if(E!=="copy"&&E!=="cut")throw new Error('Invalid "action" value, use either "copy" or "cut"');if(R!==void 0)if(R&&Oe(R)==="object"&&R.nodeType===1){if(E==="copy"&&R.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if(E==="cut"&&(R.hasAttribute("readonly")||R.hasAttribute("disabled")))throw new Error(`Invalid "target" attribute. You can't cut text from elements with "readonly" or "disabled" attributes`)}else throw new Error('Invalid "target" value, use a valid Element');if(ue)return H(ue,{container:I});if(R)return E==="cut"?h(R):H(R,{container:I})},dt=Ee;function ye(b){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ye=function(v){return typeof v}:ye=function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},ye(b)}function O(b,N){if(!(b instanceof N))throw new TypeError("Cannot call a class as a function")}function J(b,N){for(var v=0;v<N.length;v++){var E=N[v];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(b,E.key,E)}}function te(b,N,v){return N&&J(b.prototype,N),v&&J(b,v),b}function qn(b,N){if(typeof N!="function"&&N!==null)throw new TypeError("Super expression must either be null or a function");b.prototype=Object.create(N&&N.prototype,{constructor:{value:b,writable:!0,configurable:!0}}),N&&ct(b,N)}function ct(b,N){return ct=Object.setPrototypeOf||function(E,I){return E.__proto__=I,E},ct(b,N)}function Vt(b){var N=At();return function(){var E=Ve(b),I;if(N){var R=Ve(this).constructor;I=Reflect.construct(E,arguments,R)}else I=E.apply(this,arguments);return Lt(this,I)}}function Lt(b,N){return N&&(ye(N)==="object"||typeof N=="function")?N:Kn(b)}function Kn(b){if(b===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b}function At(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function Ve(b){return Ve=Object.setPrototypeOf?Object.getPrototypeOf:function(v){return v.__proto__||Object.getPrototypeOf(v)},Ve(b)}function qe(b,N){var v="data-clipboard-".concat(b);if(N.hasAttribute(v))return N.getAttribute(v)}var U=(function(b){qn(v,b);var N=Vt(v);function v(E,I){var R;return O(this,v),R=N.call(this),R.resolveOptions(I),R.listenClick(E),R}return te(v,[{key:"resolveOptions",value:function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.action=typeof I.action=="function"?I.action:this.defaultAction,this.target=typeof I.target=="function"?I.target:this.defaultTarget,this.text=typeof I.text=="function"?I.text:this.defaultText,this.container=ye(I.container)==="object"?I.container:document.body}},{key:"listenClick",value:function(I){var R=this;this.listener=w()(I,"click",function(ue){return R.onClick(ue)})}},{key:"onClick",value:function(I){var R=I.delegateTarget||I.currentTarget,ue=this.action(R)||"copy",Ut=dt({action:ue,container:this.container,target:this.target(R),text:this.text(R)});this.emit(Ut?"success":"error",{action:ue,text:Ut,trigger:R,clearSelection:function(){R&&R.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(I){return qe("action",I)}},{key:"defaultTarget",value:function(I){var R=qe("target",I);if(R)return document.querySelector(R)}},{key:"defaultText",value:function(I){return qe("text",I)}},{key:"destroy",value:function(){this.listener.destroy()}}],[{key:"copy",value:function(I){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body};return H(I,R)}},{key:"cut",value:function(I){return h(I)}},{key:"isSupported",value:function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["copy","cut"],R=typeof I=="string"?[I]:I,ue=!!document.queryCommandSupported;return R.forEach(function(Ut){ue=ue&&!!document.queryCommandSupported(Ut)}),ue}}]),v})(c()),j=U}),828:(function(o){var i=9;if(typeof Element<"u"&&!Element.prototype.matches){var l=Element.prototype;l.matches=l.matchesSelector||l.mozMatchesSelector||l.msMatchesSelector||l.oMatchesSelector||l.webkitMatchesSelector}function d(c,f){for(;c&&c.nodeType!==i;){if(typeof c.matches=="function"&&c.matches(f))return c;c=c.parentNode}}o.exports=d}),438:(function(o,i,l){var d=l(828);function c(m,x,g,M,h){var k=w.apply(this,arguments);return m.addEventListener(g,k,h),{destroy:function(){m.removeEventListener(g,k,h)}}}function f(m,x,g,M,h){return typeof m.addEventListener=="function"?c.apply(null,arguments):typeof g=="function"?c.bind(null,document).apply(null,arguments):(typeof m=="string"&&(m=document.querySelectorAll(m)),Array.prototype.map.call(m,function(k){return c(k,x,g,M,h)}))}function w(m,x,g,M){return function(h){h.delegateTarget=d(h.target,x),h.delegateTarget&&M.call(m,h)}}o.exports=f}),879:(function(o,i){i.node=function(l){return l!==void 0&&l instanceof HTMLElement&&l.nodeType===1},i.nodeList=function(l){var d=Object.prototype.toString.call(l);return l!==void 0&&(d==="[object NodeList]"||d==="[object HTMLCollection]")&&"length"in l&&(l.length===0||i.node(l[0]))},i.string=function(l){return typeof l=="string"||l instanceof String},i.fn=function(l){var d=Object.prototype.toString.call(l);return d==="[object Function]"}}),370:(function(o,i,l){var d=l(879),c=l(438);function f(g,M,h){if(!g&&!M&&!h)throw new Error("Missing required arguments");if(!d.string(M))throw new TypeError("Second argument must be a String");if(!d.fn(h))throw new TypeError("Third argument must be a Function");if(d.node(g))return w(g,M,h);if(d.nodeList(g))return m(g,M,h);if(d.string(g))return x(g,M,h);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function w(g,M,h){return g.addEventListener(M,h),{destroy:function(){g.removeEventListener(M,h)}}}function m(g,M,h){return Array.prototype.forEach.call(g,function(k){k.addEventListener(M,h)}),{destroy:function(){Array.prototype.forEach.call(g,function(k){k.removeEventListener(M,h)})}}}function x(g,M,h){return c(document.body,g,M,h)}o.exports=f}),817:(function(o){function i(l){var d;if(l.nodeName==="SELECT")l.focus(),d=l.value;else if(l.nodeName==="INPUT"||l.nodeName==="TEXTAREA"){var c=l.hasAttribute("readonly");c||l.setAttribute("readonly",""),l.select(),l.setSelectionRange(0,l.value.length),c||l.removeAttribute("readonly"),d=l.value}else{l.hasAttribute("contenteditable")&&l.focus();var f=window.getSelection(),w=document.createRange();w.selectNodeContents(l),f.removeAllRanges(),f.addRange(w),d=f.toString()}return d}o.exports=i}),279:(function(o){function i(){}i.prototype={on:function(l,d,c){var f=this.e||(this.e={});return(f[l]||(f[l]=[])).push({fn:d,ctx:c}),this},once:function(l,d,c){var f=this;function w(){f.off(l,w),d.apply(c,arguments)}return w._=d,this.on(l,w,c)},emit:function(l){var d=[].slice.call(arguments,1),c=((this.e||(this.e={}))[l]||[]).slice(),f=0,w=c.length;for(f;f<w;f++)c[f].fn.apply(c[f].ctx,d);return this},off:function(l,d){var c=this.e||(this.e={}),f=c[l],w=[];if(f&&d)for(var m=0,x=f.length;m<x;m++)f[m].fn!==d&&f[m].fn._!==d&&w.push(f[m]);return w.length?c[l]=w:delete c[l],this}},o.exports=i,o.exports.TinyEmitter=i})},s={};function a(o){if(s[o])return s[o].exports;var i=s[o]={exports:{}};return n[o](i,i.exports,a),i.exports}return(function(){a.n=function(o){var i=o&&o.__esModule?function(){return o.default}:function(){return o};return a.d(i,{a:i}),i}})(),(function(){a.d=function(o,i){for(var l in i)a.o(i,l)&&!a.o(o,l)&&Object.defineProperty(o,l,{enumerable:!0,get:i[l]})}})(),(function(){a.o=function(o,i){return Object.prototype.hasOwnProperty.call(o,i)}})(),a(686)})().default})})(ut)),ut.exports}var jr=Gr();const zr=Hr(jr),Zr=e=>({toClipboard(t,n){return new Promise((s,a)=>{const o=document.createElement("button"),i=new zr(o,{text:()=>t,action:()=>"copy",container:n!==void 0?n:document.body});i.on("success",l=>{i.destroy(),s(l)}),i.on("error",l=>{i.destroy(),a(l)}),document.body.appendChild(o),o.click(),document.body.removeChild(o)})}}),qr={key:0,class:"baklava-button"},hs=r.defineComponent({__name:"CopyToClipboard",props:{text:String},setup(e){const{toClipboard:t}=Zr(),n=e,s=r.toRef(n,"text"),a=r.ref(!1),o=async()=>{try{await t(s.value),a.value=!0,setTimeout(()=>a.value=!1,1500),console.log("Copied to clipboard")}catch(i){console.error(i)}};return(i,l)=>(r.openBlock(),r.createElementBlock("div",null,[a.value?(r.openBlock(),r.createElementBlock("button",qr,[r.createVNode(r.unref(Xn))])):(r.openBlock(),r.createElementBlock("button",{key:1,onClick:o,class:"baklava-button"},[r.createVNode(r.unref(es))]))]))}}),Kr={class:"code-editor"},Jr={class:"code-buttons"},Xr=r.defineComponent({__name:"CodeEditor",props:r.mergeModels({locked:{type:Boolean},extensions:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:r.mergeModels(["update:locked"],["update:modelValue"]),setup(e,{emit:t}){const n=r.useModel(e,"modelValue"),s=t,a=o=>s("update:locked",o);return(o,i)=>{const l=r.resolveComponent("codemirror");return r.openBlock(),r.createElementBlock("div",Kr,[r.createElementVNode("div",Jr,[e.locked?(r.openBlock(),r.createElementBlock("button",{key:0,class:"baklava-button",title:"The code is locked.",onClick:i[0]||(i[0]=d=>a(!1))},[r.createVNode(r.unref(Wt))])):r.createCommentVNode("",!0),r.createVNode(hs,{text:e.modelValue},null,8,["text"])]),r.createVNode(l,{modelValue:n.value,"onUpdate:modelValue":i[1]||(i[1]=d=>n.value=d),extensions:e.extensions,class:"codemirror",style:{height:"100%"},onKeydown:i[2]||(i[2]=d=>a(!0))},null,8,["modelValue","extensions"])])}}}),Qr=r.defineComponent({__name:"CodeGraphEditor",props:{viewModel:{}},setup(e){const t=e,n=r.toRef(t,"viewModel"),s=a=>a.events.update.emit(null);return r.onMounted(n.value.onMounted),r.onBeforeUnmount(n.value.onBeforeUnmount),r.watch(n,(a,o)=>{o&&o.onBeforeUnmount(),a&&a.onMounted()}),(a,o)=>(r.openBlock(),r.createBlock(r.unref(S.BaklavaEditor),{viewModel:n.value},{palette:r.withCtx(()=>[r.createVNode(r.unref(ms))]),node:r.withCtx(i=>[r.createVNode(r.unref(fs),r.mergeProps(i,{onUpdate:l=>s(i.node)}),null,16,["onUpdate"])]),sidebar:r.withCtx(i=>[r.createVNode(r.unref(ps),r.normalizeProps(r.guardReactiveProps(i)),{codeEditor:r.withCtx(({node:l})=>[r.renderSlot(a.$slots,"sidebarCodeEditor",{node:l})]),_:3},16)]),_:3},8,["viewModel"]))}}),eo={class:"code-graph-info"},to=r.defineComponent({__name:"CodeGraphInfo",props:{viewModel:{}},setup(e){return(t,n)=>(r.openBlock(),r.createElementBlock("div",eo,[r.createElementVNode("div",null,"Editor graph: "+r.toDisplayString(e.viewModel.editor.graph.shortId),1),r.createElementVNode("div",null,"Displayed graph: "+r.toDisplayString(e.viewModel.displayedGraph.shortId),1),r.createElementVNode("div",null,"Graphs: "+r.toDisplayString(e.viewModel.editor.graphIds),1),r.createElementVNode("div",null,"Graph templates: "+r.toDisplayString(e.viewModel.editor.graphTemplateIds),1),r.createElementVNode("div",null,"Engine status: "+r.toDisplayString(e.viewModel.engine?.status),1)]))}}),no=["data-node-type","id"],so={class:"__title-label",style:{"flex-grow":"1"}},ao={key:0},ro={class:"__menu",style:{display:"flex"}},oo={class:"__outputs"},io={key:0},lo=["id","title"],co={class:"__inputs"},uo={key:0},ho=["id","title"],fs=r.defineComponent({__name:"CodeGraphNode",props:{node:{},selected:{type:Boolean,default:!1},dragging:{type:Boolean}},emits:["select","start-drag","update"],setup(e,{emit:t}){const n=S.Components.ContextMenu,s=S.Components.NodeInterface,a=e,o=r.computed(()=>a.node),i=t,{viewModel:l}=S.useViewModel(),{graph:d,switchGraph:c}=S.useGraph(),f=r.ref(null),w=r.ref(!1),m=r.ref(""),x=r.ref(null),g=r.ref(!1);let M=0,h=0;const k=r.ref(!1),A=r.computed(()=>{const U=[{value:"edit",label:"Edit"},{value:"rename",label:"Rename"},{value:"delete",label:"Delete"}];return a.node.type.startsWith(q.GRAPH_NODE_TYPE_PREFIX)&&U.push({value:"editSubgraph",label:"Edit Subgraph"}),U}),V=r.computed(()=>({"--selected":a.selected,"--dragging":a.dragging,"--two-column":!!a.node.twoColumn,"--hidden":o.value.state?.hidden})),H=r.computed(()=>({"--reverse-y":a.node.reverseY??l.value.settings.nodes.reverseY})),Oe=r.computed(()=>({top:`${a.node.position?.y??0}px`,left:`${a.node.position?.x??0}px`,"--width":`${a.node.width??l.value.settings.nodes.defaultWidth}px`})),Ee=r.computed(()=>Object.values(a.node.inputs).filter(U=>!U.hidden)),dt=r.computed(()=>Object.values(a.node.outputs).filter(U=>!U.hidden)),ye=()=>{qn(),i("select")},O=U=>{a.selected||ye(),i("start-drag",U)},J=()=>{k.value=!0},te=()=>{const U=l.value.displayedGraph.sidebar;U.nodeId=a.node.id,U.visible=!0},qn=()=>{const U=l.value.displayedGraph.sidebar;U.nodeId=a.node.id},ct=async U=>{switch(U){case"edit":te();break;case"delete":d.value.removeNode(a.node);break;case"rename":m.value=a.node.title,w.value=!0,await r.nextTick(),x.value?.focus();break;case"editSubgraph":c(a.node.template);break}},Vt=()=>{o.value.title=m.value,o.value.events.titleChanged.emit(o.value.title),w.value=!1},Lt=()=>{f.value&&l.value.hooks.renderNode.execute({node:a.node,el:f.value})},Kn=U=>{g.value=!0,M=a.node.width,h=U.clientX,U.preventDefault()},At=U=>{o.value.state&&(o.value.state.integrated=U,i("update"))},Ve=U=>{if(!g.value)return;const j=U.clientX-h,b=M+j/d.value.scaling,N=l.value.settings.nodes.minWidth,v=l.value.settings.nodes.maxWidth;o.value.width=Math.max(N,Math.min(v,b))},qe=()=>{g.value=!1};return r.onMounted(()=>{Lt(),window.addEventListener("mousemove",Ve),window.addEventListener("mouseup",qe)}),r.onUpdated(Lt),r.onBeforeUnmount(()=>{window.removeEventListener("mousemove",Ve),window.removeEventListener("mouseup",qe)}),(U,j)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([V.value,"baklava-node"]),"data-node-type":o.value.type,id:o.value.id,style:r.normalizeStyle(Oe.value),ref_key:"el",ref:f,onPointerdown:ye},[r.unref(l).settings.nodes.resizable?(r.openBlock(),r.createElementBlock("div",{key:0,class:"__resize-handle",onMousedown:Kn},null,32)):r.createCommentVNode("",!0),r.createElementVNode("div",{class:"__title",onPointerdown:r.withModifiers(O,["self","stop"]),onContextmenu:r.withModifiers(J,["prevent"])},[o.value.inputs._code?(r.openBlock(),r.createBlock(r.unref(Ht),{key:0,intf:o.value.inputs._code,node:o.value,title:o.value.inputs._code.value,class:"--input","data-interface-type":"node",style:{"flex-grow":"0"}},null,8,["intf","node","title"])):r.createCommentVNode("",!0),w.value?r.withDirectives((r.openBlock(),r.createElementBlock("input",{key:2,ref_key:"renameInputEl",ref:x,"onUpdate:modelValue":j[4]||(j[4]=b=>m.value=b),class:"baklava-input",placeholder:"Title",style:{"flex-grow":"1"},type:"text",onBlur:Vt,onKeydown:r.withKeys(Vt,["enter"])},null,544)),[[r.vModelText,m.value]]):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.createElementVNode("div",so,[o.value.idx>-1?(r.openBlock(),r.createElementBlock("span",ao,r.toDisplayString(o.value.idx+1)+" - ",1)):r.createCommentVNode("",!0),r.createTextVNode(" "+r.toDisplayString(o.value.title),1)]),r.createElementVNode("div",ro,[o.value.isCodeNode?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[o.value.state.lockCode?(r.openBlock(),r.createBlock(r.unref(Wt),{key:0,class:"--clickable mx-1",onClick:j[0]||(j[0]=b=>o.value.lockCode=!1)})):r.createCommentVNode("",!0),o.value.hasConnectedOutputNodes?(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[o.value.state.integrated?(r.openBlock(),r.createBlock(r.unref(Qn),{key:1,class:"--clickable mx-1",onClick:j[2]||(j[2]=b=>At(!1))})):(r.openBlock(),r.createBlock(r.unref(ls),{key:0,class:"--clickable mx-1",onClick:j[1]||(j[1]=b=>At(!0))}))],64)):r.createCommentVNode("",!0),o.value.isSelected&&!r.unref(l).displayedGraph.sidebar.visible?(r.openBlock(),r.createBlock(r.unref($t),{key:2,class:"--clickable mx-1",onClick:te})):r.createCommentVNode("",!0)],64)):r.createCommentVNode("",!0),r.createVNode(r.unref(ts),{class:"--clickable mx-1",onClick:J}),r.createVNode(r.unref(n),{modelValue:k.value,"onUpdate:modelValue":j[3]||(j[3]=b=>k.value=b),x:0,y:0,items:A.value,onClick:ct},null,8,["modelValue","items"])])],64)),o.value.outputs._code?(r.openBlock(),r.createBlock(r.unref(Ht),{key:3,node:o.value,intf:o.value.outputs._code,class:"--output",title:o.value.outputs._code.value,"data-interface-type":"node"},null,8,["node","intf","title"])):r.createCommentVNode("",!0)],32),r.createElementVNode("div",{class:r.normalizeClass(["__content",H.value]),onKeydown:j[5]||(j[5]=r.withKeys(r.withModifiers(()=>{},["stop"]),["delete"])),onContextmenu:j[6]||(j[6]=r.withModifiers(()=>{},["prevent"]))},[r.createElementVNode("div",oo,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(dt.value,b=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:b.id},[o.value.state?.hidden?(r.openBlock(),r.createElementBlock("div",io,[b.port?(r.openBlock(),r.createElementBlock("div",{key:0,id:b.id,title:b.name,class:"baklava-node-interface --output --connected"},[...j[7]||(j[7]=[r.createElementVNode("div",{class:"__port"},null,-1)])],8,lo)):r.createCommentVNode("",!0)])):r.renderSlot(U.$slots,"nodeInterface",{key:1,type:"output",node:o.value,intf:b},()=>[r.createVNode(r.unref(s),{node:o.value,intf:b,title:b.value},null,8,["node","intf","title"])])],64))),128))]),r.createElementVNode("div",co,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(Ee.value,b=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:b.id},[o.value.state?.hidden?(r.openBlock(),r.createElementBlock("div",uo,[b.port?(r.openBlock(),r.createElementBlock("div",{key:0,id:b.id,title:b.name,class:"baklava-node-interface --input --connected"},[...j[8]||(j[8]=[r.createElementVNode("div",{class:"__port"},null,-1)])],8,ho)):r.createCommentVNode("",!0)])):r.renderSlot(U.$slots,"nodeInterface",{key:1,node:o.value,intf:b,type:"input"},()=>[r.createVNode(r.unref(s),{node:o.value,intf:b,title:b.value},null,8,["node","intf","title"])])],64))),128))])],34)],46,no))}}),fo=["id"],po={class:"align-middle"},Ht=r.defineComponent({__name:"CodeGraphNodeInterface",props:{node:{},intf:{}},setup(e){const t=e,{viewModel:n}=S.useViewModel(),{hoveredOver:s,temporaryConnection:a}=S.useTemporaryConnection(),o=r.ref(null),i=r.computed(()=>t.intf.connectionCount>0),l=r.computed(()=>({"--connected":i.value})),d=()=>{s(t.intf)},c=()=>{s(void 0)},f=()=>{o.value&&n.value.hooks.renderInterface.execute({intf:t.intf,el:o.value})};return r.onMounted(f),r.onUpdated(f),(w,m)=>(r.openBlock(),r.createElementBlock("div",{id:e.intf.id,ref_key:"el",ref:o,class:r.normalizeClass(["baklava-node-interface",l.value])},[e.intf.port?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass([{"--selected":r.unref(a)?.from===e.intf},"__port"]),onPointerover:d,onPointerout:c},null,34)):r.createCommentVNode("",!0),r.createElementVNode("span",po,[r.renderSlot(w.$slots,"default")])],10,fo))}}),mo=["title"],_o={key:0,class:"__label"},Ft=r.defineComponent({__name:"SidebarCheckbox",props:{disabled:{type:Boolean},inversed:{type:Boolean},modelValue:{type:Boolean},name:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;return(s,a)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["baklava-checkbox",{"--checked":e.inversed?!e.modelValue:e.modelValue,"--disabled":e.disabled}]),title:e.name,onClick:a[0]||(a[0]=o=>n("update:modelValue",!e.modelValue))},[a[1]||(a[1]=r.createElementVNode("div",{class:"__checkmark-container"},[r.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18"},[r.createElementVNode("path",{class:"__checkmark",d:"M 6 5 L 6 10 L 16 10",transform:"rotate(-45 10 10)"})])],-1)),e.name?(r.openBlock(),r.createElementBlock("div",_o,r.toDisplayString(e.name),1)):r.createCommentVNode("",!0)],10,mo))}}),yo={class:"__header"},go={class:"__node-name"},ko={class:"__interfaces"},bo={class:"__inputs"},wo={style:{display:"flex"}},vo={class:"__outputs"},No={key:0,class:"__interface"},Co=["placeholder"],Mo={style:{display:"flex"}},ps=r.defineComponent({__name:"CodeGraphSidebar",setup(e){const{viewModel:t}=S.useViewModel(),{graph:n}=S.useGraph(),s=r.ref(null),a=r.toRef(t.value.settings.sidebar,"width"),o=r.computed(()=>t.value.settings.sidebar.resizable);let i=0,l=0;const d=r.computed(()=>{const k=n.value.sidebar.nodeId;return n.value.nodes.find(A=>A.id===k)}),c=r.computed(()=>d.value),f=r.computed(()=>({width:`${a.value}px`})),w=r.computed(()=>c.value?Object.values(c.value.inputs).filter(k=>k.displayInSidebar&&k.component):[]),m=r.computed(()=>c.value?Object.values(c.value.outputs).filter(k=>k.displayInSidebar&&k.component):[]),x=()=>{n.value.sidebar.visible=!1},g=()=>{d.value&&(d.value.state.variableNameNumberAppendix=c.value.state.variableName.length===0,d.value.events.update.emit(null))},M=k=>{i=a.value,l=k.clientX,window.addEventListener("mousemove",h),window.addEventListener("mouseup",()=>{window.removeEventListener("mousemove",h)},{once:!0})},h=k=>{const A=s.value?.parentElement?.getBoundingClientRect().width??500,V=k.clientX-l;let H=i-V;H<300?H=300:H>.9*A&&(H=.9*A),a.value=H};return(k,A)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([{"--open":r.unref(n).sidebar.visible},"baklava-sidebar"]),style:r.normalizeStyle(f.value),ref_key:"el",ref:s},[o.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:"__resizer",onMousedown:M},null,32)):r.createCommentVNode("",!0),d.value?(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.createElementVNode("div",yo,[r.createElementVNode("button",{tabindex:"-1",class:"__close",onClick:x},"×"),r.createElementVNode("div",go,[r.createElementVNode("b",null,r.toDisplayString(d.value.title),1)])]),r.createElementVNode("div",ko,[r.createElementVNode("div",bo,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(w.value,V=>(r.openBlock(),r.createElementBlock("div",{key:V.id,class:"__interface"},[r.createElementVNode("div",wo,[r.createVNode(Ft,{modelValue:V.hidden,"onUpdate:modelValue":[H=>V.hidden=H,A[0]||(A[0]=()=>d.value?.events.update.emit(null))],disabled:!V.optional,inversed:"",style:{"padding-right":"8px"}},null,8,["modelValue","onUpdate:modelValue","disabled"]),(r.openBlock(),r.createBlock(r.resolveDynamicComponent(V.component),{modelValue:V.value,"onUpdate:modelValue":H=>V.value=H,node:d.value,intf:V,style:{width:"100%"}},null,8,["modelValue","onUpdate:modelValue","node","intf"]))])]))),128))]),r.createElementVNode("div",vo,[c.value&&c.value.state?(r.openBlock(),r.createElementBlock("div",No,[A[3]||(A[3]=r.createElementVNode("label",null,"Variable name",-1)),r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":A[1]||(A[1]=V=>c.value.state.variableName=V),placeholder:c.value.variableName,type:"text",class:"baklava-input",title:"Variable name",onBlur:g,onKeydown:r.withKeys(g,["enter"])},null,40,Co),[[r.vModelText,c.value.state.variableName]])])):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(m.value,V=>(r.openBlock(),r.createElementBlock("div",{key:V.id,class:"__interface"},[r.createElementVNode("div",Mo,[r.createVNode(Ft,{modelValue:V.hidden,"onUpdate:modelValue":[H=>V.hidden=H,A[2]||(A[2]=()=>d.value?.events.update.emit(null))],disabled:!V.optional,inversed:"",style:{"padding-right":"8px"}},null,8,["modelValue","onUpdate:modelValue","disabled"]),(r.openBlock(),r.createBlock(r.resolveDynamicComponent(V.component),{modelValue:V.value,"onUpdate:modelValue":H=>V.value=H,node:d.value,intf:V,style:{width:"100%"}},null,8,["modelValue","onUpdate:modelValue","node","intf"]))])]))),128))])]),r.renderSlot(k.$slots,"codeEditor",{node:d.value})],64)):r.createCommentVNode("",!0)],6))}});function So(e,t){return Object.fromEntries(Object.entries(e).filter(t))}function Oo(e,t){return Object.fromEntries(Object.entries(e).map(([n,s])=>[n,t(s)]))}const Eo={class:"baklava-node --palette",style:{"margin-top":"-20px","margin-bottom":"20px"}},To={key:0,style:{display:"flex","justify-content":"space-between"}},Io=["onClick"],xo={key:0,style:{margin:"auto 0","font-size":"12px"}},ms=r.defineComponent({__name:"CodeNodePalette",setup(e){const t=S.Components.PaletteEntry,{viewModel:n}=S.useViewModel(),{x:s,y:a}=Ya.usePointer(),{transform:o}=S.useTransform(),i=S.useNodeCategories(n),l=r.inject("editorEl"),d=r.ref(""),c=r.ref(null),f=()=>d.value?i.value.filter(g=>g.name.toLowerCase().includes(d.value.toLowerCase())||Object.values(g.nodeTypes).some(M=>M.title.toLowerCase().includes(d.value.toLowerCase()))):i.value,w=g=>d.value?So(g,M=>{const h=M[1];return h.category.includes(d.value.toLowerCase())||h.title?.toLowerCase().includes(d.value.toLowerCase())}):g,m=r.computed(()=>{if(!c.value||!l?.value)return{};const{left:g,top:M}=l.value.getBoundingClientRect();return{top:`${a.value-M}px`,left:`${s.value-g}px`}}),x=(g,M)=>{c.value={type:g,nodeInformation:M};const h=()=>{const k=r.reactive(new M.type);n.value.displayedGraph.addNode(k);const A=l.value.getBoundingClientRect(),[V,H]=o(s.value-A.left,a.value-A.top);k.position.x=V,k.position.y=H,c.value=null,document.removeEventListener("pointerup",h)};document.addEventListener("pointerup",h)};return(g,M)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createElementVNode("div",{class:r.normalizeClass([{"--open":r.unref(n).settings.palette.enabled},"baklava-node-palette"]),onContextmenu:M[1]||(M[1]=r.withModifiers(()=>{},["stop","prevent"]))},[r.createElementVNode("div",Eo,[r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":M[0]||(M[0]=h=>d.value=h),type:"text",class:"baklava-input",title:"Filter nodes",onKeyup:f},null,544),[[r.vModelText,d.value]])]),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(f(),h=>(r.openBlock(),r.createElementBlock("section",{key:h.name},[h.name!=="default"?(r.openBlock(),r.createElementBlock("h3",To,[r.createElementVNode("div",{onClick:k=>d.value=h.name,style:{cursor:"pointer"}},r.toDisplayString(h.name),9,Io),Object.keys(w(h.nodeTypes)).length<Object.values(h.nodeTypes).length?(r.openBlock(),r.createElementBlock("div",xo," ( "+r.toDisplayString(Object.keys(w(h.nodeTypes)).length)+" / "+r.toDisplayString(Object.values(h.nodeTypes).length)+" ) ",1)):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(w(h.nodeTypes),(k,A)=>(r.openBlock(),r.createBlock(r.unref(t),{key:A,title:k.title,type:A,onPointerdown:V=>x(A,k)},null,8,["title","type","onPointerdown"]))),128))]))),128))],34),r.createVNode(r.Transition,{name:"fade"},{default:r.withCtx(()=>[c.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:"baklava-dragged-node",style:r.normalizeStyle(m.value)},[r.createVNode(r.unref(t),{type:c.value.type,title:c.value.nodeInformation.title},null,8,["type","title"])],4)):r.createCommentVNode("",!0)]),_:1})],64))}}),Do={},Yo={class:"prependIcon"},Ro={class:"appendIcon"};function Po(e,t){const n=r.resolveComponent("router-link");return r.openBlock(),r.createBlock(n,{class:"navItem"},{default:r.withCtx(()=>[r.createElementVNode("span",Yo,[r.renderSlot(e.$slots,"prependIcon")]),r.renderSlot(e.$slots,"default"),r.createElementVNode("span",Ro,[r.renderSlot(e.$slots,"appendIcon")])]),_:3})}const Gt=z(Do,[["render",Po]]),Bo={class:"navbar"},Vo=["onClick"],Lo=r.defineComponent({__name:"NavBar",props:{viewModel:{},editorStates:{},routes:{}},emits:["click:remove"],setup(e,{emit:t}){const n=t,s=a=>{n("click:remove",a)};return(a,o)=>(r.openBlock(),r.createElementBlock("nav",Bo,[r.renderSlot(a.$slots,"prepend"),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.editorStates,i=>(r.openBlock(),r.createBlock(Gt,{key:i.graph.id,class:r.normalizeClass({active:i.graph.id===e.viewModel.displayedGraph.id}),to:{name:e.routes?.edit??"edit",params:{editorId:i.graph.id}}},{appendIcon:r.withCtx(()=>[r.createElementVNode("button",{class:"remove",onClick:r.withModifiers(l=>s(i.graph.id),["prevent"])},[r.createVNode(r.unref(cs))],8,Vo)]),default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(i.graph.id.slice(0,6))+" ",1)]),_:2},1032,["class","to"]))),128)),r.renderSlot(a.$slots,"append",{},()=>[r.createVNode(Gt,{to:{name:e.routes?.new??"new"},class:"navItem"},{default:r.withCtx(()=>[r.createVNode(r.unref(as),{class:"plus"})]),_:1},8,["to"])])]))}}),Ao=r.defineComponent({props:{intf:{type:Object,required:!0},modelValue:{type:String,required:!0}},emits:["update:modelValue"],setup(e,{emit:t}){return{v:r.computed({get:()=>e.modelValue,set:s=>{t("update:modelValue",s)}})}}}),Uo={style:{position:"relative"}},$o={style:{"font-size":"12px",padding:"0 6px",position:"absolute",top:"-8px","background-color":"var(--baklava-node-color-background)"}},Wo=["placeholder","title"];function Ho(e,t,n,s,a,o){return r.openBlock(),r.createElementBlock("div",Uo,[r.createElementVNode("label",$o,r.toDisplayString(e.intf.name),1),r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":t[0]||(t[0]=i=>e.v=i),type:"text",class:"baklava-input",placeholder:e.intf.name,title:e.intf.name},null,8,Wo),[[r.vModelText,e.v]])])}const jt=z(Ao,[["render",Ho]]),Fo=Object.freeze(Object.defineProperty({__proto__:null,CodeEditor:Xr,CodeGraphEditor:Qr,CodeGraphInfo:to,CodeGraphNode:fs,CodeGraphNodeInterface:Ht,CodeGraphSidebar:ps,CodeNodePalette:ms,CopyToClipboard:hs,NavBar:Lo,NavItem:Gt,SidebarCheckbox:Ft,TextInputInterface:jt},Symbol.toStringTag,{value:"Module"}));Le.escape=e=>e;class zt extends q.AbstractNode{codeTemplate;isCodeNode=!0;mask=null;name="";state;_variableName="";inputs={};outputs={};constructor(){super(),this.initializeIo(),this.twoColumn=!0,this.state=r.reactive({codeTemplate:"",hidden:!1,integrated:!1,lockCode:!1,modules:[],props:null,script:"",variableName:"",variableNameNumberAppendix:!0}),this.codeTemplate=function(){return`${this.name}(${_s(this.codeNodeInputs).join(", ")})`}}get code(){return this.graph.code}get codeNodeInputs(){return Object.fromEntries(Object.entries(this.inputs).filter(t=>t[1].isCodeNode&&t[1].type!="node"))}get codeNodeOutputs(){return Object.fromEntries(Object.entries(this.outputs).filter(t=>t[1].isCodeNode&&t[1].type!="node"))}get graph(){return super.graph}get hasConnectedOutputNodes(){return this.getConnectedNodes("outputs").length>0}get idx(){return this.graph.nodes.filter(t=>!t.state.integrated).indexOf(this)??-1}get idxByType(){return this.graph.getNodesByType(this.type).indexOf(this)??-1}get idxByVariableNames(){return this.graph.getNodesByVariableName(this.state.variableName||this._variableName).filter(t=>!t.state.integrated).indexOf(this)??-1}get isSelected(){return this.graph.selectedNodeIds.includes(this.id)}get lockCode(){return this.state.lockCode}set lockCode(t){this.state.lockCode=t,this.events.update.emit(null)}get optionalInputs(){return Object.fromEntries(Object.entries(this.codeNodeInputs).filter(t=>t[1].optional))}get requiredInputs(){return Object.fromEntries(Object.entries(this.codeNodeInputs).filter(t=>!t[1].optional))}get script(){return this.outputs._code?.value??""}set script(t){this.outputs._code&&(this.outputs._code.value=t),this.events.update.emit(null)}get shortId(){return this.id.slice(0,6)}get subgraph(){}get variableName(){return this.state.variableName||this._variableName?(this.state.variableName||this._variableName)+(this.state.variableNameNumberAppendix?this.idxByVariableNames+1:""):""}getConnectedNodeByInterface(t,n){const s=this.getConnectedNodesByInterface(t,n);return s.length>0?s[0]:null}getConnectedNodes(t){let n=[];if(t!=="inputs"){const s=this.graph.connections.filter(a=>a.from.name!=="_code").filter(a=>a.from.nodeId===this.id).map(a=>a.to.nodeId);s&&(n=n.concat(s))}if(t!=="outputs"){const s=this.graph.connections.filter(a=>a.from.name!=="_code").filter(a=>a.to.nodeId===this.id).map(a=>a.from.nodeId);s&&(n=n.concat(s))}return!n||n.length==0?[]:n.map(s=>this.graph.findNodeById(s))}getConnectedNodesByInterface(t,n){let s=[];if(n!=="outputs"&&this.inputs[t]){const a=this.graph.connections.filter(o=>o.to.id===this.inputs[t]?.id||o.from.id===this.inputs[t]?.id).map(o=>o.from.nodeId);a&&(s=s.concat(a))}if(n!=="inputs"&&this.outputs[t]){const a=this.graph.connections.filter(o=>o.from.id===this.outputs[t]?.id||o.from.id===this.outputs[t]?.id).map(o=>o.to.nodeId);a&&(s=s.concat(a))}return!s||s.length==0?[]:s.map(a=>this.graph.findNodeById(a))}remove(){this.graph?.removeNode(this)}renderCode(t){return Le.render(this.state.codeTemplate,t)}updateCodeTemplate(){this.state.codeTemplate=this.codeTemplate.call(this)}updateModules(t){if(t)this.state.modules=t;else if(this.type.includes(".")){const n=this.type.split(".");this.state.modules.push(n.slice(0,n.length-1).join("."))}}updateOutputNames(){Object.values(this.codeNodeOutputs).forEach(t=>{t.name=this.state.integrated?"":this.variableName+t.suffix})}updateOutputValues(t){Object.keys(this.outputs).forEach(n=>{n!=="_code"&&(t[n]=this.state.integrated?t._code:this.outputs[n].name)})}updateProps(t){this.state.props=t}updateInputValues(t){const n=Object.keys(this.inputs);Object.keys(t).forEach(s=>{!n.includes(s)||!this.inputs[s]||(this.inputs[s].value=t[s],this.inputs[s].setHidden(!1))})}}class ht extends zt{calculate=(t,n)=>{const s={};return this.lockCode||(s._code=this.renderCode({inputs:t,...n})),this.updateOutputValues(s),s};executeFactory(t,n){Object.keys(n||{}).forEach(s=>{const a=n[s]();t==="input"?this.addInput(s,a):this.addOutput(s,a)})}load(t){super.load(t),this.afterLoaded()}}const _s=(e,t=!0)=>{const n=[],s=Object.keys(e);return s.forEach(a=>{if(e[a]?.hidden)return;const i=t&&n.length<s.indexOf(a)?`${a}=`:"";n.push(`${i}{{ inputs.${a} }}`)}),n},ys=(e,t)=>{switch(e){case"CheckBoxInterface":return new ks(t.id,t.value);case"IntegerInterface":return new en(t.id,t.value,t.min,t.max);case"NumberInterface":return new ws(t.id,t.value,t.min,t.max);case"SelectInterface":return new vs(t.id,t.value,t.items);default:return new nn(t.id,t.value)}},Go=["title"],ft=r.defineComponent({__name:"CodeNodeInterface",props:{intf:{}},setup(e){return(t,n)=>(r.openBlock(),r.createElementBlock("div",{title:e.intf.value},r.toDisplayString(e.intf.name),9,Go))}});class Q extends q.NodeInterface{isCodeNode=!0;code;state;type=null;constructor(t,n){super(t,n),this.setComponent(r.markRaw(ft)),this.state=r.reactive({optional:!1})}get optional(){return this.state.optional}get shortId(){return this.id.slice(0,6)}getValue=()=>`${this.value??"None"}`;load(t){this.id=t.id,this.templateId=t.templateId,this.name!=="_code"&&(t.optional&&(this.state.optional=t.optional),this.value=t.value,this.hooks.load.execute(t),this.hidden=t.hidden)}save(){const t={id:this.id,templateId:this.templateId,value:this.value,hidden:this.hidden};return this.state.optional&&(t.optional=this.state.optional),this.hooks.save.execute(t)}setOptional(t){return this.state.optional=t,this.setHidden(t),this}}class Ae extends Q{constructor(t="",n){super(t,n),this.setComponent(r.markRaw(ft)),this.use(S.displayInSidebar,!0)}get value(){return super.value}set value(t){super.value=t,this.name!=="_code"&&this.setHidden(!1)}}const Zt=new G.NodeInterfaceType("boolean"),gs=new G.NodeInterfaceType("dict"),qt=new G.NodeInterfaceType("list"),se=new G.NodeInterfaceType("node"),Kt=new G.NodeInterfaceType("number"),Jt=new G.NodeInterfaceType("string"),Xt=new G.NodeInterfaceType("tuple"),jo=e=>{new G.BaklavaInterfaceTypes(e.editor,{viewPlugin:e}).addTypes(Zt,gs,qt,se,Kt,Jt,Xt)};class ks extends Ae{constructor(t,n){super(t,n),this.setComponent(r.markRaw(S.CheckboxInterfaceComponent)),this.use(G.setType,Zt)}getValue=()=>this.value?"True":"False"}class bs extends Q{isCodeNodeOutput=!0;suffix="";constructor(t="",n=""){super(t,""),this.suffix=n,this.setComponent(r.markRaw(ft))}get codeValue(){return this.node?.outputs._code.value??""}get node(){const{graph:t}=S.useGraph();return t.value.findNodeById(this.nodeId)}}class Qt extends Ae{min;max;constructor(t,n,s,a){super(t,n),this.min=s,this.max=a,this.use(G.setType,Kt)}validate(t){return(this.min===void 0||t>=this.min)&&(this.max===void 0||t<=this.max)}}class en extends Qt{component=r.markRaw(S.IntegerInterfaceComponent);validate(t){return Number.isInteger(t)&&super.validate(t)}}class zo extends Ae{constructor(t="",n=""){super(t,n),this.setComponent(r.markRaw(S.TextInputInterfaceComponent)),this.use(G.setType,qt)}getValue=()=>`[${this.value}]`}class ws extends Qt{component=r.markRaw(S.NumberInterfaceComponent)}class tn extends Ae{constructor(t,n){super(t,n),this.use(G.setType,Jt)}getValue=()=>`"${this.value}"`}class vs extends tn{component=r.markRaw(S.SelectInterfaceComponent);items;constructor(t,n,s){super(t,n),this.items=s}}class Zo extends Qt{component=r.markRaw(S.SliderInterfaceComponent);min;max;constructor(t,n,s,a){super(t,n,s,a),this.min=s,this.max=a}getValue=()=>`${Math.round(this.value*1e3)/1e3}`}class nn extends tn{component=r.markRaw(jt)}class qo extends tn{component=r.markRaw(S.TextareaInputInterfaceComponent)}class Ko extends Ae{constructor(t="",n=""){super(t,n),this.setComponent(r.markRaw(S.TextInputInterfaceComponent)),this.use(G.setType,Xt)}getValue=()=>`(${this.value})`}function Jo(e){return class extends ht{type=e.type;inputs={};outputs={};constructor(){super(),this._title=e.title??e.type,this.executeFactory("input",e.inputs),this.executeFactory("output",e.outputs),e.calculate&&(this.calculate=(t,n)=>e.calculate.call(this,t,n)),e.onCreate?.call(this),this.name=e.name??e.type,this.updateModules(e.modules),e.codeTemplate&&(this.codeTemplate=e.codeTemplate),e.variableName!=null&&(this._variableName=e.variableName),this.addInput("_code",new Q("_code",[]).use(G.setType,se).use(he.allowMultipleConnections).setHidden(!0)),this.addOutput("_code",new Q("_code",[]).use(G.setType,se).use(he.allowMultipleConnections).setHidden(!0))}afterGraphLoaded(){e.afterGraphLoaded?.call(this)}afterLoaded(){e.afterLoaded?.call(this)}onPlaced(){e.onPlaced?.call(this)}onConnected(){e.onConnected?.call(this)}onDestroy(){e.onDestroy?.call(this)}onGraphUpdate(){e.onGraphUpdate?.call(this)}onUnconnected(){e.onUnconnected?.call(this)}update(){e.update?.call(this)}}}class Ns extends ht{}function Xo(e){return class extends Ns{type=e.type;inputs={};outputs={};preventUpdate=!1;staticInputKeys=Object.keys(e.inputs??{});staticOutputKeys=Object.keys(e.outputs??{});constructor(){super(),this._title=e.title??e.type,this.executeFactory("input",e.inputs),this.executeFactory("output",e.outputs),e.calculate&&(this.calculate=(t,n)=>e.calculate?.call(this,t,n)),e.onCreate?.call(this),this.name=e.name??e.type,this.updateModules(e.modules),e.codeTemplate&&(this.codeTemplate=e.codeTemplate),e.variableName&&(this._variableName=e.variableName),this.addInput("_code",new Q("_code",[]).use(G.setType,se).use(he.allowMultipleConnections).setHidden(!0)),this.addOutput("_code",new Q("_code",[]).use(G.setType,se).use(he.allowMultipleConnections).setHidden(!0)),this.staticInputKeys.push("_code"),this.staticOutputKeys.push("_code")}afterGraphLoaded(){e.afterGraphLoaded?.call(this)}afterLoaded(){e.afterLoaded?.call(this)}onPlaced(){this.events.update.subscribe(this,t=>{t&&(t.type==="input"&&this.staticInputKeys.includes(t.name)||t.type==="output"&&this.staticOutputKeys.includes(t.name))&&this.onUpdate()}),this.onUpdate(),e.onPlaced?.call(this)}onConnected(){e.onConnected?.call(this)}onDestroy(){e.onDestroy?.call(this)}onGraphUpdate(){e.onGraphUpdate?.call(this)}onUnconnected(){e.onUnconnected?.call(this)}update(){e.update?.call(this)}load(t){this.preventUpdate=!0,this.hooks.beforeLoad.execute(t),this.id=t.id,this.title=t.title;for(const n of this.staticInputKeys)this.inputs[n].load(t.inputs[n]),this.inputs[n].nodeId=this.id;for(const n of this.staticOutputKeys)this.outputs[n].load(t.outputs[n]),this.outputs[n].nodeId=this.id;this.preventUpdate=!1,this.onUpdate(),this.preventUpdate=!0;for(const n of Object.keys(t.inputs))if(!(this.staticInputKeys.includes(n)||!t.inputs[n])){if(!this.inputs[n]){const s=t.inputs[n],a=s.value;let o;s.component?o=ys(s.component,{...s,id:n}):typeof a=="number"?o=new en(n,a):o=new nn(n,JSON.stringify(a)),o.use(S.displayInSidebar,!0),this.addInput(n,o)}this.inputs[n]&&(this.inputs[n].load(t.inputs[n]),this.inputs[n].nodeId=this.id)}for(const n of Object.keys(t.outputs))if(!(this.staticOutputKeys.includes(n)||!t.outputs[n])){if(!this.outputs[n]){const s=new bs(n);this.addOutput(n,s)}this.outputs[n]&&(this.outputs[n].load(t.outputs[n]),this.outputs[n].nodeId=this.id)}this.preventUpdate=!1,this.events.loaded.emit(this)}onUpdate(){if(!e.onUpdate||this.preventUpdate)return;this.graph&&this.graph.activeTransactions++;const t=this.getStaticValues(this.staticInputKeys,this.inputs),n=this.getStaticValues(this.staticOutputKeys,this.outputs),s=e.onUpdate.call(this,t,n);this.updateInterfaces("input",s.inputs??{},s.forceUpdateInputs??[]),this.updateInterfaces("output",s.outputs??{},s.forceUpdateOutputs??[]),this.graph&&this.graph.activeTransactions--}getStaticValues(t,n){const s={};for(const a of t)s[a]=n[a].value;return s}updateInputInterfaces(t={},n=[]){this.updateInterfaces("input",t,n)}updateInterfaces(t,n={},s=[]){const a=t==="input"?this.staticInputKeys:this.staticOutputKeys,o=t==="input"?this.inputs:this.outputs;for(const i of Object.keys(o))a.includes(i)||n[i]&&!s.includes(i)||(t==="input"?this.removeInput(i):this.removeOutput(i));for(const i of Object.keys(n)){if(o[i])continue;const l=n[i]();t==="input"?this.addInput(i,l):this.addOutput(i,l)}}updateProps(t){this.state.props=t,this.onUpdate()}}}Le.escape=e=>e;class pt{_id;_state;viewModel;constructor(){this._id=De.v4(),this._state=r.reactive({lockCode:!1,modules:{},script:"",template:""})}get engine(){return this.viewModel?.engine}get graph(){return this.viewModel?.editor.graph}get id(){return this._id}get lockCode(){return this.state.lockCode}set lockCode(t){this.state.lockCode=t,this.engine?.runOnce(null)}get modules(){const t=[];return this.graph?.codeNodes.filter(n=>n.state.modules?.length>0).forEach(n=>t.push(...n.state.modules)),t?(t.sort(),Array.from(new Set(t.map(n=>this.state.modules[n])))):[]}get script(){return this.state.script}set script(t){this.state.script=t,this.engine?.runOnce(null)}get shortId(){return this.id.slice(0,6)}get state(){return this._state}clear(){this.state.script=""}async loadTemplate(t){t.then(n=>{this._state.template=n.default??""})}registerViewModel(t){this.viewModel=t}renderCode(t){this.state.script=Le.render(this.state.template??"",t??{})}}class Qo extends pt{constructor(){super(),this.loadTemplate(Promise.resolve().then(()=>hu))}}class ei extends pt{constructor(){super(),this.loadTemplate(Promise.resolve().then(()=>fu))}}const ti=e=>{e.allowMultipleConnections=!0};class Cs extends he.BaseEngine{order=new Map;constructor(t){super(t)}start(){super.start(),this.recalculateOrder=!0,this.calculateWithoutData()}async runGraph(t,n,s){this.order.has(t.id)||this.order.set(t.id,he.sortTopologically(t));const{calculationOrder:a,connectionsFromNode:o}=this.order.get(t.id),i=new Map;for(const l of a){const d={};Object.entries(l.inputs).forEach(([f,w])=>{d[f]=this.getInterfaceValue(n,w.id)}),l.isCodeNode&&(l.updateCodeTemplate(),l.updateOutputNames()),this.events.beforeNodeCalculation.emit({inputValues:d,node:l});let c;if(l.calculate){if(c=await l.calculate(d,{globalValues:s,engine:this}),o.has(l))for(const[f,w]of Object.entries(c))this.hooks.transferData.execute(c[f],w),o.get(l).forEach(m=>n.set(m.to.id,w))}else{c={};for(const[f,w]of Object.entries(l.outputs))c[f]=this.getInterfaceValue(n,w.id)}this.events.afterNodeCalculation.emit({outputValues:c,node:l}),i.set(l.id,new Map(Object.entries(c))),o.has(l)&&o.get(l).forEach(f=>{const w=Object.entries(l.outputs).find(([,x])=>x.id===f.from.id)?.[0];if(!w)throw new Error(`Could not find key for interface ${f.from.id}
|
|
2
2
|
This is likely an internal issue. Please report it on GitHub.`);const m=this.hooks.transferData.execute(c[w],f);w!=="_code"&&(f.to.allowMultipleConnections?n.has(f.to.id)?n.get(f.to.id).push(m):n.set(f.to.id,[m]):n.set(f.to.id,m))})}return i}async execute(t){this.recalculateOrder&&(this.order.clear(),this.recalculateOrder=!1);const n=this.getInputValues(this.editor.graph);return await this.runGraph(this.editor.graph,n,t)}getInputValues(t){const n=new Map;for(const s of t.nodes)Object.values(s.inputs).forEach(a=>{a.connectionCount===0&&n.set(a.id,a.getValue?a.getValue():a.value)}),s.calculate||Object.values(s.outputs).forEach(a=>{n.set(a.id,a.getValue?a.getValue():a.value)});return n}onChange(t){this.recalculateOrder=t||this.recalculateOrder,this.calculateWithoutData()}getInterfaceValue(t,n){if(!t.has(n))throw new Error(`Could not find value for interface ${n}
|
|
3
3
|
This is likely an internal issue. Please report it on GitHub.`);return t.get(n)}}var Ms;function _(){return Ms.apply(null,arguments)}function ni(e){Ms=e}function ie(e){return e instanceof Array||Object.prototype.toString.call(e)==="[object Array]"}function Ye(e){return e!=null&&Object.prototype.toString.call(e)==="[object Object]"}function P(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function sn(e){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(e).length===0;var t;for(t in e)if(P(e,t))return!1;return!0}function ee(e){return e===void 0}function ge(e){return typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]"}function Ke(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function Ss(e,t){var n=[],s,a=e.length;for(s=0;s<a;++s)n.push(t(e[s],s));return n}function Te(e,t){for(var n in t)P(t,n)&&(e[n]=t[n]);return P(t,"toString")&&(e.toString=t.toString),P(t,"valueOf")&&(e.valueOf=t.valueOf),e}function fe(e,t,n,s){return Qs(e,t,n,s,!0).utc()}function si(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function T(e){return e._pf==null&&(e._pf=si()),e._pf}var an;Array.prototype.some?an=Array.prototype.some:an=function(e){var t=Object(this),n=t.length>>>0,s;for(s=0;s<n;s++)if(s in t&&e.call(this,t[s],s,t))return!0;return!1};function rn(e){var t=null,n=!1,s=e._d&&!isNaN(e._d.getTime());if(s&&(t=T(e),n=an.call(t.parsedDateParts,function(a){return a!=null}),s=t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n),e._strict&&(s=s&&t.charsLeftOver===0&&t.unusedTokens.length===0&&t.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(e))e._isValid=s;else return s;return e._isValid}function mt(e){var t=fe(NaN);return e!=null?Te(T(t),e):T(t).userInvalidated=!0,t}var Os=_.momentProperties=[],on=!1;function ln(e,t){var n,s,a,o=Os.length;if(ee(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),ee(t._i)||(e._i=t._i),ee(t._f)||(e._f=t._f),ee(t._l)||(e._l=t._l),ee(t._strict)||(e._strict=t._strict),ee(t._tzm)||(e._tzm=t._tzm),ee(t._isUTC)||(e._isUTC=t._isUTC),ee(t._offset)||(e._offset=t._offset),ee(t._pf)||(e._pf=T(t)),ee(t._locale)||(e._locale=t._locale),o>0)for(n=0;n<o;n++)s=Os[n],a=t[s],ee(a)||(e[s]=a);return e}function Je(e){ln(this,e),this._d=new Date(e._d!=null?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),on===!1&&(on=!0,_.updateOffset(this),on=!1)}function le(e){return e instanceof Je||e!=null&&e._isAMomentObject!=null}function Es(e){_.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+e)}function ae(e,t){var n=!0;return Te(function(){if(_.deprecationHandler!=null&&_.deprecationHandler(null,e),n){var s=[],a,o,i,l=arguments.length;for(o=0;o<l;o++){if(a="",typeof arguments[o]=="object"){a+=`
|
|
4
4
|
[`+o+"] ";for(i in arguments[0])P(arguments[0],i)&&(a+=i+": "+arguments[0][i]+", ");a=a.slice(0,-2)}else a=arguments[o];s.push(a)}Es(e+`
|