@versa-stack/v-craft 1.1.0-alpha.3 → 1.1.0-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { computed as _, toValue as Be, inject as ge, defineAsyncComponent as Et, defineComponent as B, useSlots as Qe, useAttrs as Ct, unref as d, openBlock as v, createBlock as $, resolveDynamicComponent as Ce, normalizeProps as Le, mergeProps as xe, createSlots as Ne, renderList as U, withCtx as G, renderSlot as J, guardReactiveProps as Nt, createCommentVNode as M, markRaw as Ge, ref as K, watch as ne, normalizeClass as ye, createTextVNode as ie, toDisplayString as oe, createElementBlock as N, withKeys as Fe, withModifiers as V, nextTick as ve, provide as te, resolveComponent as H, createVNode as Q, Fragment as j, createElementVNode as O, toRef as he, onUnmounted as _t, toRefs as be, normalizeStyle as Ie, withDirectives as Pt, Teleport as xt, vShow as St, onMounted as Se, onBeforeMount as Ot, onBeforeUnmount as wt, readonly as We, onUpdated as kt, toHandlers as Te, reactive as He, h as Dt } from "vue";
1
+ import { computed as C, toValue as we, inject as ge, defineAsyncComponent as Et, defineComponent as L, useSlots as Qe, useAttrs as Ct, unref as p, openBlock as v, createBlock as M, resolveDynamicComponent as Ce, normalizeProps as Le, mergeProps as Se, createSlots as Ne, renderList as j, withCtx as G, renderSlot as J, guardReactiveProps as Nt, createCommentVNode as R, markRaw as Ge, ref as K, watch as ne, normalizeClass as ye, createTextVNode as ie, toDisplayString as oe, createElementBlock as E, withKeys as Fe, withModifiers as V, nextTick as ve, provide as te, resolveComponent as H, createVNode as Q, Fragment as B, createElementVNode as O, toRef as he, onUnmounted as Pt, toRefs as be, normalizeStyle as Te, withDirectives as _t, Teleport as St, vShow as xt, onMounted as xe, onBeforeMount as Ot, onBeforeUnmount as wt, readonly as We, onUpdated as kt, toHandlers as Ue, reactive as He, h as Dt } from "vue";
2
2
  import { defineStore as Ze, storeToRefs as se } from "pinia";
3
3
  import { v4 as ee } from "uuid";
4
4
  import { debounce as Je } from "lodash-es";
@@ -372,8 +372,8 @@ class c {
372
372
  prec: n,
373
373
  right_a: c.right_associative.has(r)
374
374
  }, u = r;
375
- const p = (m) => s.right_a && m.right_a ? n > m.prec : n <= m.prec;
376
- for (; o.length > 2 && p(o[o.length - 2]); )
375
+ const d = (m) => s.right_a && m.right_a ? n > m.prec : n <= m.prec;
376
+ for (; o.length > 2 && d(o[o.length - 2]); )
377
377
  i = o.pop(), r = o.pop().value, a = o.pop(), e = {
378
378
  type: c.BINARY_EXP,
379
379
  operator: r,
@@ -791,10 +791,10 @@ var jt = {
791
791
  });
792
792
  }
793
793
  };
794
- const we = 43, Bt = 45, fe = {
794
+ const ke = 43, Bt = 45, fe = {
795
795
  name: "assignment",
796
796
  assignmentOperators: /* @__PURE__ */ new Set(["=", "*=", "**=", "/=", "%=", "+=", "-=", "<<=", ">>=", ">>>=", "&=", "^=", "|=", "||=", "&&=", "??="]),
797
- updateOperators: [we, Bt],
797
+ updateOperators: [ke, Bt],
798
798
  assignmentPrecedence: 0.9,
799
799
  init(t) {
800
800
  const e = [t.IDENTIFIER, t.MEMBER_EXP];
@@ -802,7 +802,7 @@ const we = 43, Bt = 45, fe = {
802
802
  const s = this.code;
803
803
  fe.updateOperators.some((a) => a === s && a === this.expr.charCodeAt(this.index + 1)) && (this.index += 2, o.node = {
804
804
  type: "UpdateExpression",
805
- operator: s === we ? "++" : "--",
805
+ operator: s === ke ? "++" : "--",
806
806
  argument: this.gobbleTokenProperty(this.gobbleIdentifier()),
807
807
  prefix: !0
808
808
  }, (!o.node.argument || !e.includes(o.node.argument.type)) && this.throwError(`Unexpected ${o.node.operator}`));
@@ -811,7 +811,7 @@ const we = 43, Bt = 45, fe = {
811
811
  const s = this.code;
812
812
  fe.updateOperators.some((a) => a === s && a === this.expr.charCodeAt(this.index + 1)) && (e.includes(o.node.type) || this.throwError(`Unexpected ${o.node.operator}`), this.index += 2, o.node = {
813
813
  type: "UpdateExpression",
814
- operator: s === we ? "++" : "--",
814
+ operator: s === ke ? "++" : "--",
815
815
  argument: o.node,
816
816
  prefix: !1
817
817
  });
@@ -831,7 +831,7 @@ re.addUnaryOp("typeof");
831
831
  re.addUnaryOp("void");
832
832
  re.addLiteral("null", null);
833
833
  re.addLiteral("undefined", void 0);
834
- const Lt = /* @__PURE__ */ new Set(["constructor", "__proto__", "__defineGetter__", "__defineSetter__", "__lookupGetter__", "__lookupSetter__"]), I = {
834
+ const Lt = /* @__PURE__ */ new Set(["constructor", "__proto__", "__defineGetter__", "__defineSetter__", "__lookupGetter__", "__lookupSetter__"]), $ = {
835
835
  /**
836
836
  * @param {jsep.Expression} ast
837
837
  * @param {Record<string, any>} subs
@@ -840,25 +840,25 @@ const Lt = /* @__PURE__ */ new Set(["constructor", "__proto__", "__defineGetter_
840
840
  switch (t.type) {
841
841
  case "BinaryExpression":
842
842
  case "LogicalExpression":
843
- return I.evalBinaryExpression(t, e);
843
+ return $.evalBinaryExpression(t, e);
844
844
  case "Compound":
845
- return I.evalCompound(t, e);
845
+ return $.evalCompound(t, e);
846
846
  case "ConditionalExpression":
847
- return I.evalConditionalExpression(t, e);
847
+ return $.evalConditionalExpression(t, e);
848
848
  case "Identifier":
849
- return I.evalIdentifier(t, e);
849
+ return $.evalIdentifier(t, e);
850
850
  case "Literal":
851
- return I.evalLiteral(t, e);
851
+ return $.evalLiteral(t, e);
852
852
  case "MemberExpression":
853
- return I.evalMemberExpression(t, e);
853
+ return $.evalMemberExpression(t, e);
854
854
  case "UnaryExpression":
855
- return I.evalUnaryExpression(t, e);
855
+ return $.evalUnaryExpression(t, e);
856
856
  case "ArrayExpression":
857
- return I.evalArrayExpression(t, e);
857
+ return $.evalArrayExpression(t, e);
858
858
  case "CallExpression":
859
- return I.evalCallExpression(t, e);
859
+ return $.evalCallExpression(t, e);
860
860
  case "AssignmentExpression":
861
- return I.evalAssignmentExpression(t, e);
861
+ return $.evalAssignmentExpression(t, e);
862
862
  default:
863
863
  throw SyntaxError("Unexpected expression", t);
864
864
  }
@@ -888,19 +888,19 @@ const Lt = /* @__PURE__ */ new Set(["constructor", "__proto__", "__defineGetter_
888
888
  "*": (n, o) => n * o(),
889
889
  "/": (n, o) => n / o(),
890
890
  "%": (n, o) => n % o()
891
- }[t.operator](I.evalAst(t.left, e), () => I.evalAst(t.right, e));
891
+ }[t.operator]($.evalAst(t.left, e), () => $.evalAst(t.right, e));
892
892
  },
893
893
  evalCompound(t, e) {
894
894
  let r;
895
895
  for (let n = 0; n < t.body.length; n++) {
896
896
  t.body[n].type === "Identifier" && ["var", "let", "const"].includes(t.body[n].name) && t.body[n + 1] && t.body[n + 1].type === "AssignmentExpression" && (n += 1);
897
897
  const o = t.body[n];
898
- r = I.evalAst(o, e);
898
+ r = $.evalAst(o, e);
899
899
  }
900
900
  return r;
901
901
  },
902
902
  evalConditionalExpression(t, e) {
903
- return I.evalAst(t.test, e) ? I.evalAst(t.consequent, e) : I.evalAst(t.alternate, e);
903
+ return $.evalAst(t.test, e) ? $.evalAst(t.consequent, e) : $.evalAst(t.alternate, e);
904
904
  },
905
905
  evalIdentifier(t, e) {
906
906
  if (Object.hasOwn(e, t.name))
@@ -915,9 +915,9 @@ const Lt = /* @__PURE__ */ new Set(["constructor", "__proto__", "__defineGetter_
915
915
  // NOTE: `String(value)` throws error when
916
916
  // value has overwritten the toString method to return non-string
917
917
  // i.e. `value = {toString: () => []}`
918
- t.computed ? I.evalAst(t.property) : t.property.name
918
+ t.computed ? $.evalAst(t.property) : t.property.name
919
919
  // `object.property` property is Identifier
920
- ), n = I.evalAst(t.object, e);
920
+ ), n = $.evalAst(t.object, e);
921
921
  if (n == null)
922
922
  throw TypeError(`Cannot read properties of ${n} (reading '${r}')`);
923
923
  if (!Object.hasOwn(n, r) && Lt.has(r))
@@ -927,21 +927,21 @@ const Lt = /* @__PURE__ */ new Set(["constructor", "__proto__", "__defineGetter_
927
927
  },
928
928
  evalUnaryExpression(t, e) {
929
929
  return {
930
- "-": (n) => -I.evalAst(n, e),
931
- "!": (n) => !I.evalAst(n, e),
932
- "~": (n) => ~I.evalAst(n, e),
930
+ "-": (n) => -$.evalAst(n, e),
931
+ "!": (n) => !$.evalAst(n, e),
932
+ "~": (n) => ~$.evalAst(n, e),
933
933
  // eslint-disable-next-line no-implicit-coercion -- API
934
- "+": (n) => +I.evalAst(n, e),
935
- typeof: (n) => typeof I.evalAst(n, e),
934
+ "+": (n) => +$.evalAst(n, e),
935
+ typeof: (n) => typeof $.evalAst(n, e),
936
936
  // eslint-disable-next-line no-void, sonarjs/void-use -- feature
937
- void: (n) => void I.evalAst(n, e)
937
+ void: (n) => void $.evalAst(n, e)
938
938
  }[t.operator](t.argument);
939
939
  },
940
940
  evalArrayExpression(t, e) {
941
- return t.elements.map((r) => I.evalAst(r, e));
941
+ return t.elements.map((r) => $.evalAst(r, e));
942
942
  },
943
943
  evalCallExpression(t, e) {
944
- const r = t.arguments.map((o) => I.evalAst(o, e)), n = I.evalAst(t.callee, e);
944
+ const r = t.arguments.map((o) => $.evalAst(o, e)), n = $.evalAst(t.callee, e);
945
945
  if (n === Function)
946
946
  throw new Error("Function constructor is disabled");
947
947
  return n(...r);
@@ -949,7 +949,7 @@ const Lt = /* @__PURE__ */ new Set(["constructor", "__proto__", "__defineGetter_
949
949
  evalAssignmentExpression(t, e) {
950
950
  if (t.left.type !== "Identifier")
951
951
  throw SyntaxError("Invalid left-hand side in assignment");
952
- const r = t.left.name, n = I.evalAst(t.right, e);
952
+ const r = t.left.name, n = $.evalAst(t.right, e);
953
953
  return e[r] = n, e[r];
954
954
  }
955
955
  };
@@ -967,13 +967,13 @@ class Ft {
967
967
  */
968
968
  runInNewContext(e) {
969
969
  const r = Object.assign(/* @__PURE__ */ Object.create(null), e);
970
- return I.evalAst(this.ast, r);
970
+ return $.evalAst(this.ast, r);
971
971
  }
972
972
  }
973
973
  function ae(t, e) {
974
974
  return t = t.slice(), t.push(e), t;
975
975
  }
976
- function ke(t, e) {
976
+ function De(t, e) {
977
977
  return e = e.slice(), e.unshift(t), e;
978
978
  }
979
979
  class Ht extends Error {
@@ -984,10 +984,10 @@ class Ht extends Error {
984
984
  super('JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)'), this.avoidNew = !0, this.value = e, this.name = "NewError";
985
985
  }
986
986
  }
987
- function D(t, e, r, n, o) {
988
- if (!(this instanceof D))
987
+ function k(t, e, r, n, o) {
988
+ if (!(this instanceof k))
989
989
  try {
990
- return new D(t, e, r, n, o);
990
+ return new k(t, e, r, n, o);
991
991
  } catch (a) {
992
992
  if (!a.avoidNew)
993
993
  throw a;
@@ -1008,7 +1008,7 @@ function D(t, e, r, n, o) {
1008
1008
  return i;
1009
1009
  }
1010
1010
  }
1011
- D.prototype.evaluate = function(t, e, r, n) {
1011
+ k.prototype.evaluate = function(t, e, r, n) {
1012
1012
  let o = this.parent, s = this.parentProperty, {
1013
1013
  flatten: a,
1014
1014
  wrap: i
@@ -1022,44 +1022,44 @@ D.prototype.evaluate = function(t, e, r, n) {
1022
1022
  json: e
1023
1023
  } = t), a = Object.hasOwn(t, "flatten") ? t.flatten : a, this.currResultType = Object.hasOwn(t, "resultType") ? t.resultType : this.currResultType, this.currSandbox = Object.hasOwn(t, "sandbox") ? t.sandbox : this.currSandbox, i = Object.hasOwn(t, "wrap") ? t.wrap : i, this.currEval = Object.hasOwn(t, "eval") ? t.eval : this.currEval, r = Object.hasOwn(t, "callback") ? t.callback : r, this.currOtherTypeCallback = Object.hasOwn(t, "otherTypeCallback") ? t.otherTypeCallback : this.currOtherTypeCallback, o = Object.hasOwn(t, "parent") ? t.parent : o, s = Object.hasOwn(t, "parentProperty") ? t.parentProperty : s, t = t.path;
1024
1024
  }
1025
- if (o = o || null, s = s || null, Array.isArray(t) && (t = D.toPathString(t)), !t && t !== "" || !e)
1025
+ if (o = o || null, s = s || null, Array.isArray(t) && (t = k.toPathString(t)), !t && t !== "" || !e)
1026
1026
  return;
1027
- const l = D.toPathArray(t);
1027
+ const l = k.toPathArray(t);
1028
1028
  l[0] === "$" && l.length > 1 && l.shift(), this._hasParentSelector = null;
1029
- const u = this._trace(l, e, ["$"], o, s, r).filter(function(p) {
1030
- return p && !p.isParentSelector;
1029
+ const u = this._trace(l, e, ["$"], o, s, r).filter(function(d) {
1030
+ return d && !d.isParentSelector;
1031
1031
  });
1032
- return u.length ? !i && u.length === 1 && !u[0].hasArrExpr ? this._getPreferredOutput(u[0]) : u.reduce((p, m) => {
1032
+ return u.length ? !i && u.length === 1 && !u[0].hasArrExpr ? this._getPreferredOutput(u[0]) : u.reduce((d, m) => {
1033
1033
  const f = this._getPreferredOutput(m);
1034
- return a && Array.isArray(f) ? p = p.concat(f) : p.push(f), p;
1034
+ return a && Array.isArray(f) ? d = d.concat(f) : d.push(f), d;
1035
1035
  }, []) : i ? [] : void 0;
1036
1036
  };
1037
- D.prototype._getPreferredOutput = function(t) {
1037
+ k.prototype._getPreferredOutput = function(t) {
1038
1038
  const e = this.currResultType;
1039
1039
  switch (e) {
1040
1040
  case "all": {
1041
- const r = Array.isArray(t.path) ? t.path : D.toPathArray(t.path);
1042
- return t.pointer = D.toPointer(r), t.path = typeof t.path == "string" ? t.path : D.toPathString(t.path), t;
1041
+ const r = Array.isArray(t.path) ? t.path : k.toPathArray(t.path);
1042
+ return t.pointer = k.toPointer(r), t.path = typeof t.path == "string" ? t.path : k.toPathString(t.path), t;
1043
1043
  }
1044
1044
  case "value":
1045
1045
  case "parent":
1046
1046
  case "parentProperty":
1047
1047
  return t[e];
1048
1048
  case "path":
1049
- return D.toPathString(t[e]);
1049
+ return k.toPathString(t[e]);
1050
1050
  case "pointer":
1051
- return D.toPointer(t.path);
1051
+ return k.toPointer(t.path);
1052
1052
  default:
1053
1053
  throw new TypeError("Unknown result type");
1054
1054
  }
1055
1055
  };
1056
- D.prototype._handleCallback = function(t, e, r) {
1056
+ k.prototype._handleCallback = function(t, e, r) {
1057
1057
  if (e) {
1058
1058
  const n = this._getPreferredOutput(t);
1059
- t.path = typeof t.path == "string" ? t.path : D.toPathString(t.path), e(n, r, t);
1059
+ t.path = typeof t.path == "string" ? t.path : k.toPathString(t.path), e(n, r, t);
1060
1060
  }
1061
1061
  };
1062
- D.prototype._trace = function(t, e, r, n, o, s, a, i) {
1062
+ k.prototype._trace = function(t, e, r, n, o, s, a, i) {
1063
1063
  let l;
1064
1064
  if (!t.length)
1065
1065
  return l = {
@@ -1069,27 +1069,27 @@ D.prototype._trace = function(t, e, r, n, o, s, a, i) {
1069
1069
  parentProperty: o,
1070
1070
  hasArrExpr: a
1071
1071
  }, this._handleCallback(l, s, "value"), l;
1072
- const u = t[0], p = t.slice(1), m = [];
1072
+ const u = t[0], d = t.slice(1), m = [];
1073
1073
  function f(h) {
1074
- Array.isArray(h) ? h.forEach((g) => {
1075
- m.push(g);
1074
+ Array.isArray(h) ? h.forEach((b) => {
1075
+ m.push(b);
1076
1076
  }) : m.push(h);
1077
1077
  }
1078
1078
  if ((typeof u != "string" || i) && e && Object.hasOwn(e, u))
1079
- f(this._trace(p, e[u], ae(r, u), e, u, s, a));
1079
+ f(this._trace(d, e[u], ae(r, u), e, u, s, a));
1080
1080
  else if (u === "*")
1081
1081
  this._walk(e, (h) => {
1082
- f(this._trace(p, e[h], ae(r, h), e, h, s, !0, !0));
1082
+ f(this._trace(d, e[h], ae(r, h), e, h, s, !0, !0));
1083
1083
  });
1084
1084
  else if (u === "..")
1085
- f(this._trace(p, e, r, n, o, s, a)), this._walk(e, (h) => {
1085
+ f(this._trace(d, e, r, n, o, s, a)), this._walk(e, (h) => {
1086
1086
  typeof e[h] == "object" && f(this._trace(t.slice(), e[h], ae(r, h), e, h, s, !0));
1087
1087
  });
1088
1088
  else {
1089
1089
  if (u === "^")
1090
1090
  return this._hasParentSelector = !0, {
1091
1091
  path: r.slice(0, -1),
1092
- expr: p,
1092
+ expr: d,
1093
1093
  isParentSelector: !0
1094
1094
  };
1095
1095
  if (u === "~")
@@ -1100,27 +1100,27 @@ D.prototype._trace = function(t, e, r, n, o, s, a, i) {
1100
1100
  parentProperty: null
1101
1101
  }, this._handleCallback(l, s, "property"), l;
1102
1102
  if (u === "$")
1103
- f(this._trace(p, e, r, null, null, s, a));
1103
+ f(this._trace(d, e, r, null, null, s, a));
1104
1104
  else if (/^(-?\d*):(-?\d*):?(\d*)$/u.test(u))
1105
- f(this._slice(u, p, e, r, n, o, s));
1105
+ f(this._slice(u, d, e, r, n, o, s));
1106
1106
  else if (u.indexOf("?(") === 0) {
1107
1107
  if (this.currEval === !1)
1108
1108
  throw new Error("Eval [?(expr)] prevented in JSONPath expression.");
1109
- const h = u.replace(/^\?\((.*?)\)$/u, "$1"), g = /@.?([^?]*)[['](\??\(.*?\))(?!.\)\])[\]']/gu.exec(h);
1110
- g ? this._walk(e, (P) => {
1111
- const A = [g[2]], C = g[1] ? e[P][g[1]] : e[P];
1112
- this._trace(A, C, r, n, o, s, !0).length > 0 && f(this._trace(p, e[P], ae(r, P), e, P, s, !0));
1109
+ const h = u.replace(/^\?\((.*?)\)$/u, "$1"), b = /@.?([^?]*)[['](\??\(.*?\))(?!.\)\])[\]']/gu.exec(h);
1110
+ b ? this._walk(e, (P) => {
1111
+ const A = [b[2]], T = b[1] ? e[P][b[1]] : e[P];
1112
+ this._trace(A, T, r, n, o, s, !0).length > 0 && f(this._trace(d, e[P], ae(r, P), e, P, s, !0));
1113
1113
  }) : this._walk(e, (P) => {
1114
- this._eval(h, e[P], P, r, n, o) && f(this._trace(p, e[P], ae(r, P), e, P, s, !0));
1114
+ this._eval(h, e[P], P, r, n, o) && f(this._trace(d, e[P], ae(r, P), e, P, s, !0));
1115
1115
  });
1116
1116
  } else if (u[0] === "(") {
1117
1117
  if (this.currEval === !1)
1118
1118
  throw new Error("Eval [(expr)] prevented in JSONPath expression.");
1119
- f(this._trace(ke(this._eval(u, e, r.at(-1), r.slice(0, -1), n, o), p), e, r, n, o, s, a));
1119
+ f(this._trace(De(this._eval(u, e, r.at(-1), r.slice(0, -1), n, o), d), e, r, n, o, s, a));
1120
1120
  } else if (u[0] === "@") {
1121
1121
  let h = !1;
1122
- const g = u.slice(1, -2);
1123
- switch (g) {
1122
+ const b = u.slice(1, -2);
1123
+ switch (b) {
1124
1124
  case "scalar":
1125
1125
  (!e || !["object", "function"].includes(typeof e)) && (h = !0);
1126
1126
  break;
@@ -1128,7 +1128,7 @@ D.prototype._trace = function(t, e, r, n, o, s, a, i) {
1128
1128
  case "string":
1129
1129
  case "undefined":
1130
1130
  case "function":
1131
- typeof e === g && (h = !0);
1131
+ typeof e === b && (h = !0);
1132
1132
  break;
1133
1133
  case "integer":
1134
1134
  Number.isFinite(e) && !(e % 1) && (h = !0);
@@ -1140,7 +1140,7 @@ D.prototype._trace = function(t, e, r, n, o, s, a, i) {
1140
1140
  typeof e == "number" && !Number.isFinite(e) && (h = !0);
1141
1141
  break;
1142
1142
  case "object":
1143
- e && typeof e === g && (h = !0);
1143
+ e && typeof e === b && (h = !0);
1144
1144
  break;
1145
1145
  case "array":
1146
1146
  Array.isArray(e) && (h = !0);
@@ -1153,7 +1153,7 @@ D.prototype._trace = function(t, e, r, n, o, s, a, i) {
1153
1153
  break;
1154
1154
  /* c8 ignore next 2 */
1155
1155
  default:
1156
- throw new TypeError("Unknown value type " + g);
1156
+ throw new TypeError("Unknown value type " + b);
1157
1157
  }
1158
1158
  if (h)
1159
1159
  return l = {
@@ -1164,30 +1164,30 @@ D.prototype._trace = function(t, e, r, n, o, s, a, i) {
1164
1164
  }, this._handleCallback(l, s, "value"), l;
1165
1165
  } else if (u[0] === "`" && e && Object.hasOwn(e, u.slice(1))) {
1166
1166
  const h = u.slice(1);
1167
- f(this._trace(p, e[h], ae(r, h), e, h, s, a, !0));
1167
+ f(this._trace(d, e[h], ae(r, h), e, h, s, a, !0));
1168
1168
  } else if (u.includes(",")) {
1169
1169
  const h = u.split(",");
1170
- for (const g of h)
1171
- f(this._trace(ke(g, p), e, r, n, o, s, !0));
1172
- } else !i && e && Object.hasOwn(e, u) && f(this._trace(p, e[u], ae(r, u), e, u, s, a, !0));
1170
+ for (const b of h)
1171
+ f(this._trace(De(b, d), e, r, n, o, s, !0));
1172
+ } else !i && e && Object.hasOwn(e, u) && f(this._trace(d, e[u], ae(r, u), e, u, s, a, !0));
1173
1173
  }
1174
1174
  if (this._hasParentSelector)
1175
1175
  for (let h = 0; h < m.length; h++) {
1176
- const g = m[h];
1177
- if (g && g.isParentSelector) {
1178
- const P = this._trace(g.expr, e, g.path, n, o, s, a);
1176
+ const b = m[h];
1177
+ if (b && b.isParentSelector) {
1178
+ const P = this._trace(b.expr, e, b.path, n, o, s, a);
1179
1179
  if (Array.isArray(P)) {
1180
1180
  m[h] = P[0];
1181
1181
  const A = P.length;
1182
- for (let C = 1; C < A; C++)
1183
- h++, m.splice(h, 0, P[C]);
1182
+ for (let T = 1; T < A; T++)
1183
+ h++, m.splice(h, 0, P[T]);
1184
1184
  } else
1185
1185
  m[h] = P;
1186
1186
  }
1187
1187
  }
1188
1188
  return m;
1189
1189
  };
1190
- D.prototype._walk = function(t, e) {
1190
+ k.prototype._walk = function(t, e) {
1191
1191
  if (Array.isArray(t)) {
1192
1192
  const r = t.length;
1193
1193
  for (let n = 0; n < r; n++)
@@ -1196,67 +1196,67 @@ D.prototype._walk = function(t, e) {
1196
1196
  e(r);
1197
1197
  });
1198
1198
  };
1199
- D.prototype._slice = function(t, e, r, n, o, s, a) {
1199
+ k.prototype._slice = function(t, e, r, n, o, s, a) {
1200
1200
  if (!Array.isArray(r))
1201
1201
  return;
1202
1202
  const i = r.length, l = t.split(":"), u = l[2] && Number.parseInt(l[2]) || 1;
1203
- let p = l[0] && Number.parseInt(l[0]) || 0, m = l[1] && Number.parseInt(l[1]) || i;
1204
- p = p < 0 ? Math.max(0, p + i) : Math.min(i, p), m = m < 0 ? Math.max(0, m + i) : Math.min(i, m);
1203
+ let d = l[0] && Number.parseInt(l[0]) || 0, m = l[1] && Number.parseInt(l[1]) || i;
1204
+ d = d < 0 ? Math.max(0, d + i) : Math.min(i, d), m = m < 0 ? Math.max(0, m + i) : Math.min(i, m);
1205
1205
  const f = [];
1206
- for (let h = p; h < m; h += u)
1207
- this._trace(ke(h, e), r, n, o, s, a, !0).forEach((P) => {
1206
+ for (let h = d; h < m; h += u)
1207
+ this._trace(De(h, e), r, n, o, s, a, !0).forEach((P) => {
1208
1208
  f.push(P);
1209
1209
  });
1210
1210
  return f;
1211
1211
  };
1212
- D.prototype._eval = function(t, e, r, n, o, s) {
1212
+ k.prototype._eval = function(t, e, r, n, o, s) {
1213
1213
  this.currSandbox._$_parentProperty = s, this.currSandbox._$_parent = o, this.currSandbox._$_property = r, this.currSandbox._$_root = this.json, this.currSandbox._$_v = e;
1214
1214
  const a = t.includes("@path");
1215
- a && (this.currSandbox._$_path = D.toPathString(n.concat([r])));
1215
+ a && (this.currSandbox._$_path = k.toPathString(n.concat([r])));
1216
1216
  const i = this.currEval + "Script:" + t;
1217
- if (!D.cache[i]) {
1217
+ if (!k.cache[i]) {
1218
1218
  let l = t.replaceAll("@parentProperty", "_$_parentProperty").replaceAll("@parent", "_$_parent").replaceAll("@property", "_$_property").replaceAll("@root", "_$_root").replaceAll(/@([.\s)[])/gu, "_$_v$1");
1219
1219
  if (a && (l = l.replaceAll("@path", "_$_path")), this.currEval === "safe" || this.currEval === !0 || this.currEval === void 0)
1220
- D.cache[i] = new this.safeVm.Script(l);
1220
+ k.cache[i] = new this.safeVm.Script(l);
1221
1221
  else if (this.currEval === "native")
1222
- D.cache[i] = new this.vm.Script(l);
1222
+ k.cache[i] = new this.vm.Script(l);
1223
1223
  else if (typeof this.currEval == "function" && this.currEval.prototype && Object.hasOwn(this.currEval.prototype, "runInNewContext")) {
1224
1224
  const u = this.currEval;
1225
- D.cache[i] = new u(l);
1225
+ k.cache[i] = new u(l);
1226
1226
  } else if (typeof this.currEval == "function")
1227
- D.cache[i] = {
1227
+ k.cache[i] = {
1228
1228
  runInNewContext: (u) => this.currEval(l, u)
1229
1229
  };
1230
1230
  else
1231
1231
  throw new TypeError(`Unknown "eval" property "${this.currEval}"`);
1232
1232
  }
1233
1233
  try {
1234
- return D.cache[i].runInNewContext(this.currSandbox);
1234
+ return k.cache[i].runInNewContext(this.currSandbox);
1235
1235
  } catch (l) {
1236
1236
  if (this.ignoreEvalErrors)
1237
1237
  return !1;
1238
1238
  throw new Error("jsonPath: " + l.message + ": " + t);
1239
1239
  }
1240
1240
  };
1241
- D.cache = {};
1242
- D.toPathString = function(t) {
1241
+ k.cache = {};
1242
+ k.toPathString = function(t) {
1243
1243
  const e = t, r = e.length;
1244
1244
  let n = "$";
1245
1245
  for (let o = 1; o < r; o++)
1246
1246
  /^(~|\^|@.*?\(\))$/u.test(e[o]) || (n += /^[0-9*]+$/u.test(e[o]) ? "[" + e[o] + "]" : "['" + e[o] + "']");
1247
1247
  return n;
1248
1248
  };
1249
- D.toPointer = function(t) {
1249
+ k.toPointer = function(t) {
1250
1250
  const e = t, r = e.length;
1251
1251
  let n = "";
1252
1252
  for (let o = 1; o < r; o++)
1253
1253
  /^(~|\^|@.*?\(\))$/u.test(e[o]) || (n += "/" + e[o].toString().replaceAll("~", "~0").replaceAll("/", "~1"));
1254
1254
  return n;
1255
1255
  };
1256
- D.toPathArray = function(t) {
1256
+ k.toPathArray = function(t) {
1257
1257
  const {
1258
1258
  cache: e
1259
- } = D;
1259
+ } = k;
1260
1260
  if (e[t])
1261
1261
  return e[t].concat();
1262
1262
  const r = [], o = t.replaceAll(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/gu, ";$&;").replaceAll(/[['](\??\(.*?\))[\]'](?!.\])/gu, function(s, a) {
@@ -1271,7 +1271,7 @@ D.toPathArray = function(t) {
1271
1271
  });
1272
1272
  return e[t] = o, e[t].concat();
1273
1273
  };
1274
- D.prototype.safeVm = {
1274
+ k.prototype.safeVm = {
1275
1275
  Script: Ft
1276
1276
  };
1277
1277
  const Vt = function(t, e, r) {
@@ -1298,18 +1298,18 @@ class Kt {
1298
1298
  const n = Object.keys(e), o = [];
1299
1299
  Vt(n, o, (u) => typeof e[u] == "function");
1300
1300
  const s = n.map((u) => e[u]);
1301
- r = o.reduce((u, p) => {
1302
- let m = e[p].toString();
1303
- return /function/u.test(m) || (m = "function " + m), "var " + p + "=" + m + ";" + u;
1301
+ r = o.reduce((u, d) => {
1302
+ let m = e[d].toString();
1303
+ return /function/u.test(m) || (m = "function " + m), "var " + d + "=" + m + ";" + u;
1304
1304
  }, "") + r, !/(['"])use strict\1/u.test(r) && !n.includes("arguments") && (r = "var arguments = undefined;" + r), r = r.replace(/;\s*$/u, "");
1305
1305
  const i = r.lastIndexOf(";"), l = i !== -1 ? r.slice(0, i + 1) + " return " + r.slice(i + 1) : " return " + r;
1306
1306
  return new Function(...n, l)(...s);
1307
1307
  }
1308
1308
  }
1309
- D.prototype.vm = {
1309
+ k.prototype.vm = {
1310
1310
  Script: Kt
1311
1311
  };
1312
- function De(t, e, r) {
1312
+ function Ae(t, e, r) {
1313
1313
  const n = e.replace(/^\$\.?/, "").split(/\.|\[|\]/).filter(Boolean);
1314
1314
  let o = t;
1315
1315
  for (let a = 0; a < n.length - 1; a++) {
@@ -1317,8 +1317,8 @@ function De(t, e, r) {
1317
1317
  if (i === "__proto__" || i === "constructor" || i === "prototype")
1318
1318
  throw new Error("Invalid path part: " + i);
1319
1319
  if (i in o || (o[i] = u ? [] : {}), u) {
1320
- const p = parseInt(l, 10);
1321
- Array.isArray(o[i]) || (o[i] = []), o[i].length <= p && (o[i][p] = a === n.length - 2 ? r : {}), o = o[i][p], a++;
1320
+ const d = parseInt(l, 10);
1321
+ Array.isArray(o[i]) || (o[i] = []), o[i].length <= d && (o[i][d] = a === n.length - 2 ? r : {}), o = o[i][d], a++;
1322
1322
  } else
1323
1323
  o = o[i];
1324
1324
  }
@@ -1332,33 +1332,41 @@ function De(t, e, r) {
1332
1332
  o[s] = r;
1333
1333
  }
1334
1334
  const Xt = (t, e) => {
1335
- const r = {};
1336
- return t && Object.entries(t).forEach(([n, o]) => {
1337
- const s = e[n];
1338
- s !== void 0 && Object.entries(o).forEach(([a, i]) => {
1339
- const l = D({
1340
- path: i,
1341
- json: s,
1342
- resultType: "value"
1343
- });
1344
- l.length && De(r, a, l[0]);
1335
+ if (typeof t != "string") return;
1336
+ const r = k({ path: t, json: e, resultType: "value" });
1337
+ return r.length ? r[0] : void 0;
1338
+ }, zt = (t, e, r) => {
1339
+ const n = {};
1340
+ return t && Object.entries(t).forEach(([o, s]) => {
1341
+ const a = e[o];
1342
+ a !== void 0 && Object.entries(s).forEach(([i, l]) => {
1343
+ const u = r ? r.resolvePropertyValue(l, a) : Xt(l, a);
1344
+ u !== void 0 && Ae(n, i, u);
1345
1345
  });
1346
- }), r;
1347
- }, zt = (t, e = {}) => ({
1348
- props: _(
1349
- () => Xt(Be(t)?.slotsPropsPropsMap, Be(e) || {})
1346
+ }), n;
1347
+ }, qt = (t, e = {}, r) => ({
1348
+ props: C(
1349
+ () => zt(
1350
+ we(t)?.slotsPropsPropsMap,
1351
+ we(e) || {},
1352
+ we(r)
1353
+ )
1350
1354
  )
1351
- }), qt = (t, e) => {
1355
+ }), Yt = (t, e) => {
1352
1356
  if (!t)
1353
1357
  return e.componentName;
1354
1358
  const r = t.resolveComponent(e);
1355
1359
  return r ? typeof r == "function" && !("setup" in r) && !("render" in r) ? Et(r) : r : t.resolve(e.componentName)?.componentName || e.componentName;
1356
- }, _e = (t, e = {}) => {
1357
- const r = ge("resolver"), n = _(() => !r || !t?.value ? {} : r.value.resolve(
1360
+ }, Pe = (t, e = {}) => {
1361
+ const r = ge("resolver"), n = C(() => !r || !t?.value ? {} : r.value.resolve(
1358
1362
  t.value.componentName
1359
- )), o = _(() => n.value?.defaultProps || {}), s = _(
1360
- () => qt(r?.value, t.value)
1361
- ), { props: a } = zt(t, e), i = _(() => ({
1363
+ )), o = C(() => n.value?.defaultProps || {}), s = C(
1364
+ () => Yt(r?.value, t.value)
1365
+ ), { props: a } = qt(
1366
+ t,
1367
+ e,
1368
+ () => r?.value
1369
+ ), i = C(() => ({
1362
1370
  ...o.value,
1363
1371
  ...t.value?.props,
1364
1372
  ...a.value
@@ -1370,47 +1378,47 @@ const Xt = (t, e) => {
1370
1378
  componentToRender: s,
1371
1379
  props: i
1372
1380
  };
1373
- }, Yt = /* @__PURE__ */ B({
1381
+ }, Qt = /* @__PURE__ */ L({
1374
1382
  name: "CraftCanvas",
1375
1383
  __name: "CraftCanvas",
1376
1384
  props: {
1377
1385
  componentName: {}
1378
1386
  },
1379
1387
  setup(t) {
1380
- const e = Qe(), r = Ct(), n = t, o = _(() => ({
1388
+ const e = Qe(), r = Ct(), n = t, o = C(() => ({
1381
1389
  componentName: n.componentName,
1382
1390
  props: {},
1383
1391
  slots: {},
1384
1392
  uuid: ""
1385
- })), { componentToRender: s } = _e(o);
1386
- return (a, i) => d(s) ? (v(), $(Ce(d(s)), Le(xe({ key: 0 }, d(r))), Ne({ _: 2 }, [
1387
- U(d(e), (l, u) => ({
1393
+ })), { componentToRender: s } = Pe(o);
1394
+ return (a, i) => p(s) ? (v(), M(Ce(p(s)), Le(Se({ key: 0 }, p(r))), Ne({ _: 2 }, [
1395
+ j(p(e), (l, u) => ({
1388
1396
  name: u,
1389
- fn: G((p) => [
1390
- J(a.$slots, u, Le(Nt(p || {})))
1397
+ fn: G((d) => [
1398
+ J(a.$slots, u, Le(Nt(d || {})))
1391
1399
  ])
1392
1400
  }))
1393
- ]), 1040)) : M("", !0);
1401
+ ]), 1040)) : R("", !0);
1394
1402
  }
1395
- }), Qt = () => {
1403
+ }), Gt = () => {
1396
1404
  const t = ge("craftNode");
1397
1405
  if (!t)
1398
1406
  throw new Error("craftNode or resolver not provided");
1399
- const { resolver: e, resolvedNode: r, defaultProps: n } = _e(t);
1407
+ const { resolver: e, resolvedNode: r, defaultProps: n } = Pe(t);
1400
1408
  return {
1401
1409
  craftNode: t,
1402
1410
  resolver: e,
1403
1411
  resolvedNode: r,
1404
1412
  defaultProps: n
1405
1413
  };
1406
- }, tt = (t) => t.visible === void 0 || t.visible, Gt = (t) => {
1414
+ }, tt = (t) => t.visible === void 0 || t.visible, Wt = (t) => {
1407
1415
  let e = t;
1408
1416
  const r = q();
1409
1417
  for (; e.parentUuid; )
1410
1418
  if (e = r.nodeMap.get(e.parentUuid), W(e))
1411
1419
  return !0;
1412
1420
  return !1;
1413
- }, Wt = (t) => Gt(t) ? t.rules?.canDrag ? t.rules.canDrag(t) : !0 : !1, rt = (t, e) => {
1421
+ }, Zt = (t) => Wt(t) ? t.rules?.canDrag ? t.rules.canDrag(t) : !0 : !1, rt = (t, e) => {
1414
1422
  const r = q();
1415
1423
  let n = e;
1416
1424
  for (; n?.parentUuid; ) {
@@ -1429,7 +1437,7 @@ const Xt = (t, e) => {
1429
1437
  return;
1430
1438
  }
1431
1439
  return !(a.canMoveInto && !a.canMoveInto(t, e, r) || rt(t, e) || s.canMoveIn && !s.canMoveIn(t, e, r));
1432
- }, W = (t) => t.componentName === "CraftCanvas", Pe = (t, e, r) => {
1440
+ }, W = (t) => t.componentName === "CraftCanvas", _e = (t, e, r) => {
1433
1441
  const n = q();
1434
1442
  return e.uuid === t.uuid || !e.parentUuid ? !1 : me(
1435
1443
  t,
@@ -1593,7 +1601,7 @@ const Xt = (t, e) => {
1593
1601
  },
1594
1602
  insertNodeBefore(t, e, r) {
1595
1603
  if (!this.resolver) throw new Error("Resolver is not set");
1596
- if (!Pe(t, e, this.resolver))
1604
+ if (!_e(t, e, this.resolver))
1597
1605
  throw new Error("Can not be the sibling of the target node.");
1598
1606
  t = this.emancipateNode(t);
1599
1607
  const n = e.parentUuid;
@@ -1613,7 +1621,7 @@ const Xt = (t, e) => {
1613
1621
  },
1614
1622
  insertNodeAfter(t, e, r) {
1615
1623
  if (!this.resolver) throw new Error("Resolver is not set");
1616
- if (!Pe(t, e, this.resolver))
1624
+ if (!_e(t, e, this.resolver))
1617
1625
  throw new Error("Can not be the sibling of the target node.");
1618
1626
  t = this.emancipateNode(t);
1619
1627
  const n = e.parentUuid;
@@ -1663,7 +1671,7 @@ const Xt = (t, e) => {
1663
1671
  return t.rootNodes.map((r) => e(r));
1664
1672
  }
1665
1673
  }
1666
- }), Zt = ["value", "onKeyup"], Jt = /* @__PURE__ */ B({
1674
+ }), Jt = ["value", "onKeyup"], er = /* @__PURE__ */ L({
1667
1675
  __name: "CraftComponentSimpleText",
1668
1676
  props: {
1669
1677
  content: { default: "Lorem ipsum dolor sit amet..." },
@@ -1678,9 +1686,9 @@ const Xt = (t, e) => {
1678
1686
  } catch {
1679
1687
  return null;
1680
1688
  }
1681
- })(), a = s ? se(s).enabled : K(!1), i = K(!1), l = K(null), u = K(""), { craftNode: p } = Qt(), m = _(() => !!s && a.value), f = _(() => m.value && !i.value), h = () => {
1682
- f.value && g();
1683
- }, g = () => {
1689
+ })(), a = s ? se(s).enabled : K(!1), i = K(!1), l = K(null), u = K(""), { craftNode: d } = Gt(), m = C(() => !!s && a.value), f = C(() => m.value && !i.value), h = () => {
1690
+ f.value && b();
1691
+ }, b = () => {
1684
1692
  u.value = r.content, i.value = !0, s?.disableDragging(), ve(() => {
1685
1693
  l.value && (l.value.focus(), P());
1686
1694
  });
@@ -1689,20 +1697,20 @@ const Xt = (t, e) => {
1689
1697
  }, A = async () => {
1690
1698
  if (s?.enableDragging(), !i.value) return;
1691
1699
  i.value = !1;
1692
- const b = l.value?.value.trim() ?? "";
1693
- b !== r.content && p.value?.uuid && (s?.nodeMap.set(p.value.uuid, {
1694
- ...p.value,
1700
+ const U = l.value?.value.trim() ?? "";
1701
+ U !== r.content && d.value?.uuid && (s?.nodeMap.set(d.value.uuid, {
1702
+ ...d.value,
1695
1703
  props: {
1696
- ...p.value.props,
1697
- content: b
1704
+ ...d.value.props,
1705
+ content: U
1698
1706
  }
1699
- }), await ve(), n("update:content", b));
1700
- }, C = () => {
1707
+ }), await ve(), n("update:content", U));
1708
+ }, T = () => {
1701
1709
  i.value = !1, n("update:content", u.value);
1702
1710
  };
1703
- return s && ne(a, (b) => {
1704
- !b && i.value && C();
1705
- }), (b, T) => (v(), $(Ce(t.componentName), {
1711
+ return s && ne(a, (U) => {
1712
+ !U && i.value && T();
1713
+ }), (U, _) => (v(), M(Ce(t.componentName), {
1706
1714
  class: ye({
1707
1715
  "pre-wrap": !i.value,
1708
1716
  "editable-text": m.value,
@@ -1713,7 +1721,7 @@ const Xt = (t, e) => {
1713
1721
  }, {
1714
1722
  default: G(() => [
1715
1723
  ie(oe(i.value ? "" : t.content) + " ", 1),
1716
- i.value ? (v(), N("textarea", {
1724
+ i.value ? (v(), E("textarea", {
1717
1725
  key: 0,
1718
1726
  ref_key: "textareaRef",
1719
1727
  ref: l,
@@ -1723,9 +1731,9 @@ const Xt = (t, e) => {
1723
1731
  onBlur: A,
1724
1732
  onKeyup: [
1725
1733
  Fe(V(A, ["exact"]), ["enter"]),
1726
- Fe(C, ["esc"])
1734
+ Fe(T, ["esc"])
1727
1735
  ]
1728
- }, null, 40, Zt)) : M("", !0)
1736
+ }, null, 40, Jt)) : R("", !0)
1729
1737
  ]),
1730
1738
  _: 1
1731
1739
  }, 40, ["class"]));
@@ -1734,6 +1742,7 @@ const Xt = (t, e) => {
1734
1742
  class Oe {
1735
1743
  resolverMap = {};
1736
1744
  resolveComponentHook;
1745
+ resolvePropertyValueHook;
1737
1746
  constructor(e = {}) {
1738
1747
  return this.setResolverMap(e), Ge(this);
1739
1748
  }
@@ -1745,6 +1754,16 @@ class Oe {
1745
1754
  onResolveComponent(e) {
1746
1755
  this.resolveComponentHook = e;
1747
1756
  }
1757
+ onResolvePropertyValue(e) {
1758
+ this.resolvePropertyValueHook = e;
1759
+ }
1760
+ resolvePropertyValue(e, r) {
1761
+ const n = (o) => {
1762
+ const s = k({ path: o, json: r, resultType: "value" });
1763
+ return s.length ? s[0] : void 0;
1764
+ };
1765
+ return this.resolvePropertyValueHook ? this.resolvePropertyValueHook(e, r, n) : typeof e == "string" ? n(e) : void 0;
1766
+ }
1748
1767
  resolve(e) {
1749
1768
  return this.resolverMap[e];
1750
1769
  }
@@ -1780,7 +1799,7 @@ class Oe {
1780
1799
  return this.resolveNode(e)?.slotsProps || {};
1781
1800
  }
1782
1801
  }
1783
- const Ue = Ze("indicator", {
1802
+ const je = Ze("indicator", {
1784
1803
  state: () => ({
1785
1804
  barSize: 2,
1786
1805
  visible: !1,
@@ -1850,7 +1869,7 @@ function Ke(t) {
1850
1869
  s[a] = parseInt(s[a].slice(0, -2), 10);
1851
1870
  }), s;
1852
1871
  }
1853
- const er = /* @__PURE__ */ B({
1872
+ const tr = /* @__PURE__ */ L({
1854
1873
  __name: "CraftEditor",
1855
1874
  props: {
1856
1875
  config: {},
@@ -1858,7 +1877,7 @@ const er = /* @__PURE__ */ B({
1858
1877
  },
1859
1878
  emits: ["nodeDragStart", "nodeDragEnd", "iframeLoad"],
1860
1879
  setup(t, { emit: e }) {
1861
- const r = t, n = e, o = q(), s = Ue(), { getDraggedNode: a } = se(o);
1880
+ const r = t, n = e, o = q(), s = je(), { getDraggedNode: a } = se(o);
1862
1881
  ne(a, (l) => {
1863
1882
  if (l) {
1864
1883
  n("nodeDragStart", l);
@@ -1870,8 +1889,8 @@ const er = /* @__PURE__ */ B({
1870
1889
  r.config.resolver || new Oe(r.config.resolverMap)
1871
1890
  );
1872
1891
  return te("resolver", i), (l, u) => {
1873
- const p = H("CraftFrame"), m = H("CraftEditorPanelLayout");
1874
- return v(), $(m, {
1892
+ const d = H("CraftFrame"), m = H("CraftEditorPanelLayout");
1893
+ return v(), M(m, {
1875
1894
  blueprints: t.config.blueprintsLibrary
1876
1895
  }, Ne({ _: 2 }, [
1877
1896
  l.$slots["panel-layout"] ? {
@@ -1886,7 +1905,7 @@ const er = /* @__PURE__ */ B({
1886
1905
  } : {
1887
1906
  name: "default",
1888
1907
  fn: G(() => [
1889
- Q(p, {
1908
+ Q(d, {
1890
1909
  iframe: t.iframe,
1891
1910
  resolverMap: t.config.resolverMap,
1892
1911
  onIframeLoad: u[0] || (u[0] = (f) => n("iframeLoad", f))
@@ -1902,7 +1921,7 @@ const er = /* @__PURE__ */ B({
1902
1921
  ]), 1032, ["blueprints"]);
1903
1922
  };
1904
1923
  }
1905
- }), tr = /* @__PURE__ */ B({
1924
+ }), rr = /* @__PURE__ */ L({
1906
1925
  name: "CraftEditorBlueprint",
1907
1926
  __name: "CraftEditorBlueprint",
1908
1927
  props: {
@@ -1914,7 +1933,7 @@ const er = /* @__PURE__ */ B({
1914
1933
  }, o = (s) => {
1915
1934
  s.stopPropagation(), e.dragNode(null);
1916
1935
  };
1917
- return (s, a) => (v(), N("div", {
1936
+ return (s, a) => (v(), E("div", {
1918
1937
  draggable: !0,
1919
1938
  onDragstart: V(n, ["stop"]),
1920
1939
  onDragend: o
@@ -1937,11 +1956,11 @@ const er = /* @__PURE__ */ B({
1937
1956
  e = t.charCodeAt(s) + ((e << 5) - e);
1938
1957
  const r = e % 360, n = 70 + e % 30, o = 45 + e % 30;
1939
1958
  return `hsla(${r}, ${n}%, ${o}%, 0.9)`;
1940
- }, rr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1959
+ }, nr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1941
1960
  __proto__: null,
1942
1961
  blueprintsWithDefaults: st,
1943
1962
  generateColorFromUUID: at
1944
- }, Symbol.toStringTag, { value: "Module" })), nr = { key: 0 }, or = { class: "flex flex-wrap gap-2 p-1" }, sr = { class: "v-craft-blueprint" }, ar = { class: "v-craft-blueprint-label" }, ir = /* @__PURE__ */ B({
1963
+ }, Symbol.toStringTag, { value: "Module" })), or = { key: 0 }, sr = { class: "flex flex-wrap gap-2 p-1" }, ar = { class: "v-craft-blueprint" }, ir = { class: "v-craft-blueprint-label" }, lr = /* @__PURE__ */ L({
1945
1964
  __name: "CraftEditorBlueprintsList",
1946
1965
  props: {
1947
1966
  blueprints: {}
@@ -1950,21 +1969,21 @@ const er = /* @__PURE__ */ B({
1950
1969
  const e = ge("resolver");
1951
1970
  return (r, n) => {
1952
1971
  const o = H("CraftEditorBlueprint");
1953
- return d(e) ? (v(), N("div", nr, [
1954
- (v(!0), N(j, null, U(t.blueprints.groups, (s) => (v(), N("div", null, [
1972
+ return p(e) ? (v(), E("div", or, [
1973
+ (v(!0), E(B, null, j(t.blueprints.groups, (s) => (v(), E("div", null, [
1955
1974
  J(r.$slots, "blueprint-group", {
1956
1975
  group: s,
1957
- resolver: d(e)
1976
+ resolver: p(e)
1958
1977
  }, () => [
1959
1978
  O("h4", null, oe(s.label), 1),
1960
- O("div", or, [
1961
- (v(!0), N(j, null, U(d(st)(s, d(e)), (a, i) => (v(), $(o, {
1979
+ O("div", sr, [
1980
+ (v(!0), E(B, null, j(p(st)(s, p(e)), (a, i) => (v(), M(o, {
1962
1981
  craftNode: a,
1963
1982
  key: i
1964
1983
  }, {
1965
1984
  default: G(() => [
1966
- O("div", sr, [
1967
- O("div", ar, oe(a.label), 1)
1985
+ O("div", ar, [
1986
+ O("div", ir, oe(a.label), 1)
1968
1987
  ])
1969
1988
  ]),
1970
1989
  _: 2
@@ -1972,10 +1991,10 @@ const er = /* @__PURE__ */ B({
1972
1991
  ])
1973
1992
  ])
1974
1993
  ]))), 256))
1975
- ])) : M("", !0);
1994
+ ])) : R("", !0);
1976
1995
  };
1977
1996
  }
1978
- }), lr = { class: "v-craft-panel v-craft-blueprints-panel" }, ur = { class: "v-craft-panel-content" }, cr = /* @__PURE__ */ B({
1997
+ }), ur = { class: "v-craft-panel v-craft-blueprints-panel" }, cr = { class: "v-craft-panel-content" }, dr = /* @__PURE__ */ L({
1979
1998
  name: "CraftEditorPanelBlueprints",
1980
1999
  __name: "CraftEditorPanelBlueprints",
1981
2000
  props: {
@@ -1985,9 +2004,9 @@ const er = /* @__PURE__ */ B({
1985
2004
  setup(t) {
1986
2005
  return (e, r) => {
1987
2006
  const n = H("CraftEditorBlueprintsList");
1988
- return v(), N("div", lr, [
2007
+ return v(), E("div", ur, [
1989
2008
  r[0] || (r[0] = O("h3", { class: "v-craft-title" }, "blueprints", -1)),
1990
- O("div", ur, [
2009
+ O("div", cr, [
1991
2010
  Q(n, { blueprints: t.blueprints }, null, 8, ["blueprints"])
1992
2011
  ])
1993
2012
  ]);
@@ -1998,7 +2017,7 @@ const er = /* @__PURE__ */ B({
1998
2017
  for (const [n, o] of e)
1999
2018
  r[n] = o;
2000
2019
  return r;
2001
- }, dr = /* @__PURE__ */ Ee(cr, [["__scopeId", "data-v-a6de4dca"]]), pr = /* @__PURE__ */ B({
2020
+ }, pr = /* @__PURE__ */ Ee(dr, [["__scopeId", "data-v-a6de4dca"]]), fr = /* @__PURE__ */ L({
2002
2021
  __name: "CraftEditorPanelForm",
2003
2022
  props: {
2004
2023
  craftNode: {},
@@ -2007,21 +2026,21 @@ const er = /* @__PURE__ */ B({
2007
2026
  },
2008
2027
  emits: ["update"],
2009
2028
  setup(t, { emit: e }) {
2010
- const r = t, n = e, o = he(r, "model"), s = he(r, "schema"), a = he(r, "craftNode"), i = _(
2029
+ const r = t, n = e, o = he(r, "model"), s = he(r, "schema"), a = he(r, "craftNode"), i = C(
2011
2030
  () => o.value ? { ...o.value } : {}
2012
- ), l = Je((p) => {
2013
- n("update", p);
2014
- }, 50), u = (p) => {
2015
- p != null && l(p);
2031
+ ), l = Je((d) => {
2032
+ n("update", d);
2033
+ }, 50), u = (d) => {
2034
+ d != null && l(d);
2016
2035
  };
2017
- return _t(() => l.cancel()), (p, m) => J(p.$slots, "panel-content", {
2036
+ return Pt(() => l.cancel()), (d, m) => J(d.$slots, "panel-content", {
2018
2037
  craftNode: a.value,
2019
2038
  model: i.value,
2020
2039
  handleFormInput: u,
2021
2040
  schema: s.value
2022
2041
  });
2023
2042
  }
2024
- }), fr = { class: "v-craft-panel v-craft-layers-panel" }, hr = { class: "v-craft-layers" }, vr = { class: "v-craft-node-layers" }, mr = /* @__PURE__ */ B({
2043
+ }), hr = { class: "v-craft-panel v-craft-layers-panel" }, vr = { class: "v-craft-layers" }, mr = { class: "v-craft-node-layers" }, gr = /* @__PURE__ */ L({
2025
2044
  name: "CraftEditorPanelLayers",
2026
2045
  __name: "CraftEditorPanelLayers",
2027
2046
  setup(t) {
@@ -2030,11 +2049,11 @@ const er = /* @__PURE__ */ B({
2030
2049
  };
2031
2050
  return (o, s) => {
2032
2051
  const a = H("CraftEditorPanelNodeLayer");
2033
- return v(), N("div", fr, [
2052
+ return v(), E("div", hr, [
2034
2053
  s[0] || (s[0] = O("h3", { class: "v-craft-title" }, "tree", -1)),
2035
- O("div", hr, [
2036
- O("ul", vr, [
2037
- (v(!0), N(j, null, U(d(r), (i, l) => (v(), $(a, {
2054
+ O("div", vr, [
2055
+ O("ul", mr, [
2056
+ (v(!0), E(B, null, j(p(r), (i, l) => (v(), M(a, {
2038
2057
  key: l,
2039
2058
  craftNode: i,
2040
2059
  onLayerClick: n
@@ -2044,10 +2063,10 @@ const er = /* @__PURE__ */ B({
2044
2063
  ]);
2045
2064
  };
2046
2065
  }
2047
- }), gr = /* @__PURE__ */ Ee(mr, [["__scopeId", "data-v-ab795ec3"]]), yr = { key: 0 }, br = {
2066
+ }), yr = /* @__PURE__ */ Ee(gr, [["__scopeId", "data-v-ab795ec3"]]), br = { key: 0 }, Er = {
2048
2067
  key: 1,
2049
2068
  class: "v-craft-panel-manager"
2050
- }, Er = { class: "flex w-full justify-between gap-10" }, Cr = { class: "v-craft-grid-panel v-craft-panel-left shrink" }, Nr = { class: "v-craft-grid-panel v-craft-panel-right shrink max-w-[20vw]" }, _r = /* @__PURE__ */ B({
2069
+ }, Cr = { class: "flex w-full justify-between gap-10" }, Nr = { class: "v-craft-grid-panel v-craft-panel-left shrink" }, Pr = { class: "v-craft-grid-panel v-craft-panel-right shrink max-w-[20vw]" }, _r = /* @__PURE__ */ L({
2051
2070
  __name: "CraftEditorPanelLayout",
2052
2071
  props: {
2053
2072
  blueprints: {}
@@ -2058,14 +2077,14 @@ const er = /* @__PURE__ */ B({
2058
2077
  };
2059
2078
  return (n, o) => {
2060
2079
  const s = H("CraftEditorPanelBlueprints"), a = H("CraftEditorPanelLayers"), i = H("CraftEditorPanelSettings");
2061
- return n.$slots["panel-layout"] ? (v(), N("div", yr, [
2080
+ return n.$slots["panel-layout"] ? (v(), E("div", br, [
2062
2081
  J(n.$slots, "panel-layout", {
2063
2082
  blueprints: t.blueprints,
2064
2083
  deselectNodes: r
2065
2084
  }, void 0, !0)
2066
- ])) : (v(), N("div", br, [
2067
- O("div", Er, [
2068
- O("div", Cr, [
2085
+ ])) : (v(), E("div", Er, [
2086
+ O("div", Cr, [
2087
+ O("div", Nr, [
2069
2088
  Q(s, { blueprints: t.blueprints }, null, 8, ["blueprints"])
2070
2089
  ]),
2071
2090
  O("div", {
@@ -2074,7 +2093,7 @@ const er = /* @__PURE__ */ B({
2074
2093
  }, [
2075
2094
  J(n.$slots, "default", {}, void 0, !0)
2076
2095
  ]),
2077
- O("div", Nr, [
2096
+ O("div", Pr, [
2078
2097
  Q(a),
2079
2098
  Q(i)
2080
2099
  ])
@@ -2082,13 +2101,13 @@ const er = /* @__PURE__ */ B({
2082
2101
  ]));
2083
2102
  };
2084
2103
  }
2085
- }), Pr = /* @__PURE__ */ Ee(_r, [["__scopeId", "data-v-7dd1d43b"]]), xr = {
2104
+ }), Sr = /* @__PURE__ */ Ee(_r, [["__scopeId", "data-v-7dd1d43b"]]), xr = {
2086
2105
  key: 0,
2087
2106
  class: "v-craft-panel-settings formkit-fieldset v-craft-scrollable-content"
2088
- }, Sr = {
2107
+ }, Or = {
2089
2108
  key: 0,
2090
2109
  class: "formkit-help v-craft-data-source-error"
2091
- }, Or = /* @__PURE__ */ B({
2110
+ }, wr = /* @__PURE__ */ L({
2092
2111
  __name: "CraftEditorPanelNodeDataSourceSettings",
2093
2112
  props: {
2094
2113
  craftNode: {},
@@ -2119,12 +2138,12 @@ const er = /* @__PURE__ */ B({
2119
2138
  } catch {
2120
2139
  i.value = "Invalid JSON - not applied until fixed.";
2121
2140
  }
2122
- }, p = (f) => {
2141
+ }, d = (f) => {
2123
2142
  s.value = f === "list" ? "list" : "single", u();
2124
2143
  }, m = (f) => {
2125
2144
  a.value = f, u();
2126
2145
  };
2127
- return (f, h) => o.value ? (v(), N("fieldset", xr, [
2146
+ return (f, h) => o.value ? (v(), E("fieldset", xr, [
2128
2147
  h[2] || (h[2] = O("legend", { class: "formkit-legend" }, "Data Source", -1)),
2129
2148
  h[3] || (h[3] = O("p", { class: "formkit-help" }, [
2130
2149
  ie(" Paste JSON here to experiment with mapping data fields into this subtree's props. Descendants read it via "),
@@ -2137,7 +2156,7 @@ const er = /* @__PURE__ */ B({
2137
2156
  O("code", null, "editor.setNodeData()"),
2138
2157
  ie(" directly. ")
2139
2158
  ], -1)),
2140
- Q(d(le), {
2159
+ Q(p(le), {
2141
2160
  type: "select",
2142
2161
  label: "Type",
2143
2162
  options: [
@@ -2145,22 +2164,22 @@ const er = /* @__PURE__ */ B({
2145
2164
  { value: "list", label: "List" }
2146
2165
  ],
2147
2166
  value: s.value,
2148
- onInput: h[0] || (h[0] = (g) => p(String(g ?? "single")))
2167
+ onInput: h[0] || (h[0] = (b) => d(String(b ?? "single")))
2149
2168
  }, null, 8, ["value"]),
2150
- Q(d(le), {
2169
+ Q(p(le), {
2151
2170
  type: "textarea",
2152
2171
  label: "JSON",
2153
2172
  placeholder: s.value === "list" ? '[{ "title": "Alice" }, { "title": "Bob" }]' : '{ "title": "Alice" }',
2154
2173
  value: a.value,
2155
- onInput: h[1] || (h[1] = (g) => m(String(g ?? "")))
2174
+ onInput: h[1] || (h[1] = (b) => m(String(b ?? "")))
2156
2175
  }, null, 8, ["placeholder", "value"]),
2157
- i.value ? (v(), N("p", Sr, oe(i.value), 1)) : M("", !0)
2158
- ])) : M("", !0);
2176
+ i.value ? (v(), E("p", Or, oe(i.value), 1)) : R("", !0)
2177
+ ])) : R("", !0);
2159
2178
  }
2160
- }), wr = /* @__PURE__ */ Ee(Or, [["__scopeId", "data-v-7c1c5696"]]), kr = {
2179
+ }), kr = /* @__PURE__ */ Ee(wr, [["__scopeId", "data-v-7c1c5696"]]), Dr = {
2161
2180
  key: 0,
2162
2181
  class: "v-craft-panel-settings formkit-fieldset v-craft-scrollable-content"
2163
- }, Dr = /* @__PURE__ */ B({
2182
+ }, Ar = /* @__PURE__ */ L({
2164
2183
  __name: "CraftEditorPanelNodeEventsSettings",
2165
2184
  props: {
2166
2185
  craftNode: {},
@@ -2171,37 +2190,37 @@ const er = /* @__PURE__ */ B({
2171
2190
  const r = t, { craftNode: n, schema: o } = be(r), s = e;
2172
2191
  return (a, i) => {
2173
2192
  const l = H("CraftEditorPanelForm");
2174
- return v(), $(l, {
2175
- craftNode: d(n),
2176
- schema: d(o),
2177
- model: d(n)?.events,
2193
+ return v(), M(l, {
2194
+ craftNode: p(n),
2195
+ schema: p(o),
2196
+ model: p(n)?.events,
2178
2197
  onUpdate: i[0] || (i[0] = (u) => s("update:events", u))
2179
2198
  }, {
2180
- "panel-content": G(({ craftNode: u, model: p, handleFormInput: m, schema: f }) => [
2181
- f ? (v(), N("fieldset", kr, [
2199
+ "panel-content": G(({ craftNode: u, model: d, handleFormInput: m, schema: f }) => [
2200
+ f ? (v(), E("fieldset", Dr, [
2182
2201
  i[1] || (i[1] = O("legend", { class: "formkit-legend" }, "Events", -1)),
2183
- (v(), $(d(le), {
2202
+ (v(), M(p(le), {
2184
2203
  key: u?.uuid,
2185
2204
  type: "form",
2186
- value: p,
2205
+ value: d,
2187
2206
  onInput: m,
2188
2207
  actions: !1
2189
2208
  }, {
2190
2209
  default: G(() => [
2191
- Q(d(et), { schema: f }, null, 8, ["schema"])
2210
+ Q(p(et), { schema: f }, null, 8, ["schema"])
2192
2211
  ]),
2193
2212
  _: 2
2194
2213
  }, 1032, ["value", "onInput"]))
2195
- ])) : M("", !0)
2214
+ ])) : R("", !0)
2196
2215
  ]),
2197
2216
  _: 1
2198
2217
  }, 8, ["craftNode", "schema", "model"]);
2199
2218
  };
2200
2219
  }
2201
- }), Ar = { class: "v-craft-component-layer-face" }, Rr = { class: "v-craft-component-name" }, Mr = {
2220
+ }), Rr = { class: "v-craft-component-layer-face" }, Mr = { class: "v-craft-component-name" }, $r = {
2202
2221
  key: 0,
2203
2222
  class: "v-craft-node-layers nested-layers"
2204
- }, $r = /* @__PURE__ */ B({
2223
+ }, Ir = /* @__PURE__ */ L({
2205
2224
  __name: "CraftEditorPanelNodeLayer",
2206
2225
  props: {
2207
2226
  craftNode: {},
@@ -2209,46 +2228,46 @@ const er = /* @__PURE__ */ B({
2209
2228
  },
2210
2229
  emits: ["layer-click"],
2211
2230
  setup(t, { emit: e }) {
2212
- const r = t, { craftNode: n, visible: o } = be(r), s = _(
2231
+ const r = t, { craftNode: n, visible: o } = be(r), s = C(
2213
2232
  () => o.value && n.value.visible === void 0 || n.value.visible
2214
- ), a = e, i = q(), { selectedNode: l } = se(i), u = _(() => ue(n.value)), p = _(
2233
+ ), a = e, i = q(), { selectedNode: l } = se(i), u = C(() => ue(n.value)), d = C(
2215
2234
  () => l?.value?.uuid === n.value.uuid
2216
2235
  ), m = () => {
2217
2236
  i.toggleNodeVisibility(n.value);
2218
2237
  };
2219
2238
  return (f, h) => {
2220
- const g = H("CraftEditorPanelNodeLayer", !0);
2221
- return v(), N("li", {
2239
+ const b = H("CraftEditorPanelNodeLayer", !0);
2240
+ return v(), E("li", {
2222
2241
  class: ye(["v-craft-node-layer", {
2223
- "v-craft-node-layer-selected": p.value
2242
+ "v-craft-node-layer-selected": d.value
2224
2243
  }]),
2225
- onClick: h[1] || (h[1] = V((P) => a("layer-click", d(n)), ["prevent", "stop"]))
2244
+ onClick: h[1] || (h[1] = V((P) => a("layer-click", p(n)), ["prevent", "stop"]))
2226
2245
  }, [
2227
- O("div", Ar, [
2228
- O("div", Rr, oe(u.value), 1),
2246
+ O("div", Rr, [
2247
+ O("div", Mr, oe(u.value), 1),
2229
2248
  O("button", {
2230
2249
  type: "button",
2231
2250
  class: "v-craft-component-icon",
2232
2251
  onClick: V(m, ["prevent", "stop"])
2233
2252
  }, oe(s.value ? "hide" : "show"), 1)
2234
2253
  ]),
2235
- d(n).slots && Object.keys(d(n).slots).length > 0 ? (v(), N("ul", Mr, [
2236
- (v(!0), N(j, null, U(d(n).slots, (P, A) => (v(), N(j, { key: A }, [
2237
- (v(!0), N(j, null, U(P, (C, b) => (v(), $(g, {
2238
- key: `${A}-${b}`,
2239
- craftNode: C,
2240
- onLayerClick: h[0] || (h[0] = (T) => a("layer-click", T)),
2254
+ p(n).slots && Object.keys(p(n).slots).length > 0 ? (v(), E("ul", $r, [
2255
+ (v(!0), E(B, null, j(p(n).slots, (P, A) => (v(), E(B, { key: A }, [
2256
+ (v(!0), E(B, null, j(P, (T, U) => (v(), M(b, {
2257
+ key: `${A}-${U}`,
2258
+ craftNode: T,
2259
+ onLayerClick: h[0] || (h[0] = (_) => a("layer-click", _)),
2241
2260
  visible: s.value
2242
2261
  }, null, 8, ["craftNode", "visible"]))), 128))
2243
2262
  ], 64))), 128))
2244
- ])) : M("", !0)
2263
+ ])) : R("", !0)
2245
2264
  ], 2);
2246
2265
  };
2247
2266
  }
2248
- }), Ir = /* @__PURE__ */ Ee($r, [["__scopeId", "data-v-208a4e02"]]), Tr = {
2267
+ }), Tr = /* @__PURE__ */ Ee(Ir, [["__scopeId", "data-v-208a4e02"]]), Ur = {
2249
2268
  key: 0,
2250
2269
  class: "v-craft-panel-settings formkit-fieldset v-craft-scrollable-content"
2251
- }, Ur = /* @__PURE__ */ B({
2270
+ }, jr = /* @__PURE__ */ L({
2252
2271
  __name: "CraftEditorPanelNodeSettings",
2253
2272
  props: {
2254
2273
  craftNode: {},
@@ -2259,47 +2278,47 @@ const er = /* @__PURE__ */ B({
2259
2278
  const r = t, { craftNode: n, schema: o } = be(r), s = e;
2260
2279
  return (a, i) => {
2261
2280
  const l = H("CraftEditorPanelForm");
2262
- return v(), $(l, {
2263
- craftNode: d(n),
2264
- schema: d(o),
2265
- model: d(n)?.props,
2281
+ return v(), M(l, {
2282
+ craftNode: p(n),
2283
+ schema: p(o),
2284
+ model: p(n)?.props,
2266
2285
  onUpdate: i[0] || (i[0] = (u) => s("update:props", u))
2267
2286
  }, {
2268
- "panel-content": G(({ craftNode: u, model: p, handleFormInput: m, schema: f }) => [
2269
- f ? (v(), N("fieldset", Tr, [
2287
+ "panel-content": G(({ craftNode: u, model: d, handleFormInput: m, schema: f }) => [
2288
+ f ? (v(), E("fieldset", Ur, [
2270
2289
  i[1] || (i[1] = O("legend", { class: "formkit-legend" }, "Properties", -1)),
2271
- (v(), $(d(le), {
2290
+ (v(), M(p(le), {
2272
2291
  key: u?.uuid,
2273
2292
  type: "form",
2274
- value: p,
2293
+ value: d,
2275
2294
  onInput: m,
2276
2295
  actions: !1
2277
2296
  }, {
2278
2297
  default: G(() => [
2279
- Q(d(et), { schema: f }, null, 8, ["schema"])
2298
+ Q(p(et), { schema: f }, null, 8, ["schema"])
2280
2299
  ]),
2281
2300
  _: 2
2282
2301
  }, 1032, ["value", "onInput"]))
2283
- ])) : M("", !0)
2302
+ ])) : R("", !0)
2284
2303
  ]),
2285
2304
  _: 1
2286
2305
  }, 8, ["craftNode", "schema", "model"]);
2287
2306
  };
2288
2307
  }
2289
- }), jr = (t) => {
2308
+ }), Br = (t) => {
2290
2309
  if (!t) return [];
2291
2310
  const e = t.type === "single" ? t.item : t.list?.[0];
2292
2311
  return e ? Object.keys(e) : [];
2293
- }, Br = (t) => {
2312
+ }, Lr = (t) => {
2294
2313
  const e = q(), r = ge("resolver");
2295
- return { buckets: _(() => {
2314
+ return { buckets: C(() => {
2296
2315
  const o = [];
2297
2316
  let s = t.value;
2298
2317
  for (; s?.parentUuid; ) {
2299
2318
  const a = e.nodeMap.get(s.parentUuid);
2300
2319
  if (!a) break;
2301
2320
  const i = Object.entries(a.slots || {}).find(
2302
- ([, u]) => u.some((p) => p.uuid === s.uuid)
2321
+ ([, u]) => u.some((d) => d.uuid === s.uuid)
2303
2322
  );
2304
2323
  if (i) {
2305
2324
  const [u] = i;
@@ -2315,18 +2334,18 @@ const er = /* @__PURE__ */ B({
2315
2334
  slotName: "data",
2316
2335
  ancestorUuid: a.uuid,
2317
2336
  ancestorComponentName: a.componentName,
2318
- keys: jr(l)
2337
+ keys: Br(l)
2319
2338
  }), s = a;
2320
2339
  }
2321
2340
  return o;
2322
2341
  }) };
2323
- }, Lr = {
2342
+ }, Fr = {
2324
2343
  key: 0,
2325
2344
  class: "v-craft-panel-settings formkit-fieldset v-craft-scrollable-content"
2326
- }, Fr = {
2345
+ }, Hr = {
2327
2346
  key: 0,
2328
2347
  class: "formkit-help"
2329
- }, Hr = ["onClick"], Vr = ["onClick"], Kr = ["onClick"], Xr = /* @__PURE__ */ B({
2348
+ }, Vr = ["onClick"], Kr = ["onClick"], Xr = ["onClick"], zr = /* @__PURE__ */ L({
2330
2349
  __name: "CraftEditorPanelNodeSlotPropsSettings",
2331
2350
  props: {
2332
2351
  craftNode: {},
@@ -2334,145 +2353,153 @@ const er = /* @__PURE__ */ B({
2334
2353
  },
2335
2354
  emits: ["update:slotsPropsPropsMap"],
2336
2355
  setup(t, { emit: e }) {
2337
- const r = t, n = e, o = he(r, "craftNode"), { buckets: s } = Br(o), a = _(() => {
2338
- const C = /* @__PURE__ */ new Set();
2339
- return s.value.filter((b) => C.has(b.slotName) ? !1 : (C.add(b.slotName), !0)).map((b) => ({
2340
- value: b.slotName,
2341
- label: b.keys.length ? `${b.slotName} (${b.ancestorComponentName}: ${b.keys.join(", ")})` : `${b.slotName} (${b.ancestorComponentName})`
2356
+ const r = t, n = e, o = (_) => {
2357
+ const g = _.trim();
2358
+ if (!g.startsWith("{")) return g;
2359
+ try {
2360
+ return JSON.parse(g);
2361
+ } catch {
2362
+ return g;
2363
+ }
2364
+ }, s = (_) => typeof _ == "string" ? _ : JSON.stringify(_), a = he(r, "craftNode"), { buckets: i } = Lr(a), l = C(() => {
2365
+ const _ = /* @__PURE__ */ new Set();
2366
+ return i.value.filter((g) => _.has(g.slotName) ? !1 : (_.add(g.slotName), !0)).map((g) => ({
2367
+ value: g.slotName,
2368
+ label: g.keys.length ? `${g.slotName} (${g.ancestorComponentName}: ${g.keys.join(", ")})` : `${g.slotName} (${g.ancestorComponentName})`
2342
2369
  }));
2343
- }), i = (C) => {
2344
- const b = r.availableProps || [];
2345
- return !C || b.some((T) => T.value === C) ? b : [{ value: C, label: `${C} (custom)` }, ...b];
2346
- }, l = K([]);
2347
- ne(() => o.value?.uuid, () => {
2348
- const C = o.value;
2349
- l.value = Object.entries(C?.slotsPropsPropsMap || {}).map(
2350
- ([b, T]) => ({
2370
+ }), u = (_) => {
2371
+ const g = r.availableProps || [];
2372
+ return !_ || g.some((w) => w.value === _) ? g : [{ value: _, label: `${_} (custom)` }, ...g];
2373
+ }, d = K([]);
2374
+ ne(() => a.value?.uuid, () => {
2375
+ const _ = a.value;
2376
+ d.value = Object.entries(_?.slotsPropsPropsMap || {}).map(
2377
+ ([g, w]) => ({
2351
2378
  id: ee(),
2352
- bucket: b,
2353
- fields: Object.entries(T).map(([E, w]) => ({
2379
+ bucket: g,
2380
+ fields: Object.entries(w).map(([y, N]) => ({
2354
2381
  id: ee(),
2355
- targetProp: E,
2356
- fromPath: w
2382
+ targetProp: y,
2383
+ fromPath: s(N)
2357
2384
  }))
2358
2385
  })
2359
2386
  );
2360
2387
  }, { immediate: !0 });
2361
- const p = () => {
2362
- const C = {};
2363
- l.value.forEach((b) => {
2364
- if (!b.bucket.trim()) return;
2365
- const T = {};
2366
- b.fields.forEach((E) => {
2367
- E.targetProp.trim() && E.fromPath.trim() && (T[E.targetProp.trim()] = E.fromPath.trim());
2368
- }), Object.keys(T).length && (C[b.bucket.trim()] = T);
2369
- }), n("update:slotsPropsPropsMap", C);
2370
- }, m = () => {
2371
- l.value.push({
2388
+ const f = () => {
2389
+ const _ = {};
2390
+ d.value.forEach((g) => {
2391
+ if (!g.bucket.trim()) return;
2392
+ const w = {};
2393
+ g.fields.forEach((y) => {
2394
+ y.targetProp.trim() && y.fromPath.trim() && (w[y.targetProp.trim()] = o(y.fromPath));
2395
+ }), Object.keys(w).length && (_[g.bucket.trim()] = w);
2396
+ }), n("update:slotsPropsPropsMap", _);
2397
+ }, h = () => {
2398
+ d.value.push({
2372
2399
  id: ee(),
2373
- bucket: a.value[0]?.value || "",
2400
+ bucket: l.value[0]?.value || "",
2374
2401
  fields: [{ id: ee(), targetProp: "", fromPath: "" }]
2375
- }), p();
2376
- }, f = (C) => {
2377
- l.value.splice(C, 1), p();
2378
- }, h = (C, b) => {
2379
- l.value[C].bucket = b, p();
2380
- }, g = (C) => {
2381
- l.value[C].fields.push({
2402
+ }), f();
2403
+ }, b = (_) => {
2404
+ d.value.splice(_, 1), f();
2405
+ }, P = (_, g) => {
2406
+ d.value[_].bucket = g, f();
2407
+ }, A = (_) => {
2408
+ d.value[_].fields.push({
2382
2409
  id: ee(),
2383
2410
  targetProp: "",
2384
2411
  fromPath: ""
2385
2412
  });
2386
- }, P = (C, b) => {
2387
- l.value[C].fields.splice(b, 1), p();
2388
- }, A = (C, b, T, E) => {
2389
- l.value[C].fields[b][T] = E, p();
2413
+ }, T = (_, g) => {
2414
+ d.value[_].fields.splice(g, 1), f();
2415
+ }, U = (_, g, w, y) => {
2416
+ d.value[_].fields[g][w] = y, f();
2390
2417
  };
2391
- return (C, b) => J(C.$slots, "panel-content", {
2392
- craftNode: o.value,
2393
- mappingGroups: l.value,
2394
- bucketOptions: a.value,
2418
+ return (_, g) => J(_.$slots, "panel-content", {
2419
+ craftNode: a.value,
2420
+ mappingGroups: d.value,
2421
+ bucketOptions: l.value,
2395
2422
  availableProps: t.availableProps ?? [],
2396
- targetPropOptionsFor: i,
2397
- addGroup: m,
2398
- removeGroup: f,
2399
- updateBucket: h,
2400
- addField: g,
2401
- removeField: P,
2402
- updateField: A
2423
+ targetPropOptionsFor: u,
2424
+ addGroup: h,
2425
+ removeGroup: b,
2426
+ updateBucket: P,
2427
+ addField: A,
2428
+ removeField: T,
2429
+ updateField: U
2403
2430
  }, () => [
2404
- o.value ? (v(), N("fieldset", Lr, [
2405
- b[0] || (b[0] = O("legend", { class: "formkit-legend" }, "Props Mapping", -1)),
2406
- b[1] || (b[1] = O("p", { class: "formkit-help" }, [
2431
+ a.value ? (v(), E("fieldset", Fr, [
2432
+ g[0] || (g[0] = O("legend", { class: "formkit-legend" }, "Props Mapping", -1)),
2433
+ g[1] || (g[1] = O("p", { class: "formkit-help" }, [
2407
2434
  ie(" Map fields from an ancestor slot's context into this component's own props using JSONPath (e.g. "),
2408
2435
  O("code", null, "$.item.name"),
2409
- ie("). ")
2436
+ ie("), or paste a JSON mapping object if the app supports richer transforms. ")
2410
2437
  ], -1)),
2411
- l.value.length ? M("", !0) : (v(), N("p", Fr, " No mappings configured. ")),
2412
- (v(!0), N(j, null, U(l.value, (T, E) => (v(), N("div", {
2413
- key: T.id,
2438
+ d.value.length ? R("", !0) : (v(), E("p", Hr, " No mappings configured. ")),
2439
+ (v(!0), E(B, null, j(d.value, (w, y) => (v(), E("div", {
2440
+ key: w.id,
2414
2441
  class: "v-craft-slot-props-map-group"
2415
2442
  }, [
2416
- Q(d(le), {
2443
+ Q(p(le), {
2417
2444
  type: "select",
2418
2445
  label: "Context",
2419
2446
  placeholder: "Select context",
2420
- options: a.value,
2421
- value: T.bucket,
2422
- onInput: (w) => h(E, String(w ?? ""))
2447
+ options: l.value,
2448
+ value: w.bucket,
2449
+ onInput: (N) => P(y, String(N ?? ""))
2423
2450
  }, null, 8, ["options", "value", "onInput"]),
2424
- (v(!0), N(j, null, U(T.fields, (w, y) => (v(), N(j, {
2425
- key: w.id
2451
+ (v(!0), E(B, null, j(w.fields, (N, S) => (v(), E(B, {
2452
+ key: N.id
2426
2453
  }, [
2427
- t.availableProps && t.availableProps.length ? (v(), $(d(le), {
2454
+ t.availableProps && t.availableProps.length ? (v(), M(p(le), {
2428
2455
  key: 0,
2429
2456
  type: "select",
2430
2457
  label: "Target Prop",
2431
2458
  placeholder: "target prop",
2432
- options: i(w.targetProp),
2433
- value: w.targetProp,
2434
- onInput: (x) => A(E, y, "targetProp", String(x ?? ""))
2435
- }, null, 8, ["options", "value", "onInput"])) : (v(), $(d(le), {
2459
+ options: u(N.targetProp),
2460
+ value: N.targetProp,
2461
+ onInput: (I) => U(y, S, "targetProp", String(I ?? ""))
2462
+ }, null, 8, ["options", "value", "onInput"])) : (v(), M(p(le), {
2436
2463
  key: 1,
2437
2464
  type: "text",
2438
2465
  label: "Target Prop",
2439
2466
  placeholder: "target prop",
2440
- value: w.targetProp,
2441
- onInput: (x) => A(E, y, "targetProp", String(x ?? ""))
2467
+ value: N.targetProp,
2468
+ onInput: (I) => U(y, S, "targetProp", String(I ?? ""))
2442
2469
  }, null, 8, ["value", "onInput"])),
2443
- Q(d(le), {
2444
- type: "text",
2445
- label: "JSONPath",
2446
- placeholder: "$.item.name",
2447
- value: w.fromPath,
2448
- onInput: (x) => A(E, y, "fromPath", String(x ?? ""))
2470
+ Q(p(le), {
2471
+ type: "textarea",
2472
+ label: "JSONPath (or JSON mapping object)",
2473
+ placeholder: "$.item.name (or paste a JSON transform object)",
2474
+ value: N.fromPath,
2475
+ onInput: (I) => U(y, S, "fromPath", String(I ?? ""))
2449
2476
  }, null, 8, ["value", "onInput"]),
2450
2477
  O("button", {
2451
2478
  type: "button",
2452
2479
  class: "formkit-input v-craft-slot-props-remove",
2453
- onClick: V((x) => P(E, y), ["prevent"])
2454
- }, " Remove field ", 8, Hr)
2480
+ onClick: V((I) => T(y, S), ["prevent"])
2481
+ }, " Remove field ", 8, Vr)
2455
2482
  ], 64))), 128)),
2456
2483
  O("button", {
2457
2484
  type: "button",
2458
2485
  class: "formkit-input v-craft-slot-props-add",
2459
- onClick: V((w) => g(E), ["prevent"])
2460
- }, " + Add field ", 8, Vr),
2486
+ onClick: V((N) => A(y), ["prevent"])
2487
+ }, " + Add field ", 8, Kr),
2461
2488
  O("button", {
2462
2489
  type: "button",
2463
2490
  class: "formkit-input v-craft-slot-props-remove",
2464
- onClick: V((w) => f(E), ["prevent"])
2465
- }, " Remove group ", 8, Kr)
2491
+ onClick: V((N) => b(y), ["prevent"])
2492
+ }, " Remove group ", 8, Xr)
2466
2493
  ]))), 128)),
2467
2494
  O("button", {
2468
2495
  type: "button",
2469
2496
  class: "formkit-input v-craft-slot-props-add",
2470
- onClick: V(m, ["prevent"])
2497
+ onClick: V(h, ["prevent"])
2471
2498
  }, " + Add mapping group ")
2472
- ])) : M("", !0)
2499
+ ])) : R("", !0)
2473
2500
  ], !0);
2474
2501
  }
2475
- }), zr = /* @__PURE__ */ Ee(Xr, [["__scopeId", "data-v-f762baf8"]]), qr = (t) => Array.isArray(t) ? t.filter(
2502
+ }), qr = /* @__PURE__ */ Ee(zr, [["__scopeId", "data-v-74ec0ff3"]]), Yr = (t) => Array.isArray(t) ? t.filter(
2476
2503
  (e) => typeof e == "object" && e !== null && typeof e.name == "string"
2477
2504
  ).map((e) => {
2478
2505
  const r = e.name, n = e.label;
@@ -2480,29 +2507,29 @@ const er = /* @__PURE__ */ B({
2480
2507
  value: r,
2481
2508
  label: typeof n == "string" && n.trim() ? n : r
2482
2509
  };
2483
- }) : [], Yr = { class: "text-sm" }, Qr = { key: 0 }, Gr = {
2510
+ }) : [], Qr = { class: "text-sm" }, Gr = { key: 0 }, Wr = {
2484
2511
  key: 0,
2485
2512
  class: "v-craft-settings"
2486
- }, Wr = {
2513
+ }, Zr = {
2487
2514
  key: 1,
2488
2515
  class: "v-craft-settings"
2489
- }, Zr = {
2516
+ }, Jr = {
2490
2517
  key: 2,
2491
2518
  class: "v-craft-settings"
2492
- }, Jr = {
2519
+ }, en = {
2493
2520
  key: 3,
2494
2521
  class: "v-craft-settings"
2495
- }, en = {
2522
+ }, tn = {
2496
2523
  class: "v-craft-actions",
2497
2524
  "data-type": "button"
2498
- }, tn = /* @__PURE__ */ B({
2525
+ }, rn = /* @__PURE__ */ L({
2499
2526
  __name: "CraftEditorPanelSettings",
2500
2527
  setup(t) {
2501
- const e = q(), { selectedNode: r, nodeDataMap: n } = se(e), o = ge("resolver"), s = _(() => !r.value || !o?.value ? [] : o.value.getSchema(r.value)), a = _(() => !r.value || !o?.value ? [] : o.value.getEventsSchema(r.value)), i = _(() => qr(s.value)), l = _(
2528
+ const e = q(), { selectedNode: r, nodeDataMap: n } = se(e), o = ge("resolver"), s = C(() => !r.value || !o?.value ? [] : o.value.getSchema(r.value)), a = C(() => !r.value || !o?.value ? [] : o.value.getEventsSchema(r.value)), i = C(() => Yr(s.value)), l = C(
2502
2529
  () => r.value && r.value.parentUuid
2503
2530
  ), u = () => {
2504
2531
  r.value && e.removeNode(r.value);
2505
- }, p = _(
2532
+ }, d = C(
2506
2533
  () => r.value ? `${o?.value?.resolveNode(r.value)?.componentName || "Unknown"}` : ""
2507
2534
  ), m = (A) => {
2508
2535
  r.value && A && e.updateNodeProps(r.value.uuid, A);
@@ -2513,23 +2540,23 @@ const er = /* @__PURE__ */ B({
2513
2540
  r.value.uuid,
2514
2541
  A
2515
2542
  );
2516
- }, g = _(
2543
+ }, b = C(
2517
2544
  () => r.value ? n.value[r.value.uuid] ?? null : null
2518
2545
  ), P = (A) => {
2519
2546
  r.value && e.setNodeData(r.value.uuid, A);
2520
2547
  };
2521
- return (A, C) => {
2522
- const b = H("CraftEditorPanelNodeSettings"), T = H("CraftEditorPanelNodeEventsSettings"), E = H("CraftEditorPanelNodeSlotPropsSettings"), w = H("CraftEditorPanelNodeDataSourceSettings");
2548
+ return (A, T) => {
2549
+ const U = H("CraftEditorPanelNodeSettings"), _ = H("CraftEditorPanelNodeEventsSettings"), g = H("CraftEditorPanelNodeSlotPropsSettings"), w = H("CraftEditorPanelNodeDataSourceSettings");
2523
2550
  return J(A.$slots, "panel-content", {
2524
- selectedNode: d(r),
2525
- nodeName: p.value,
2551
+ selectedNode: p(r),
2552
+ nodeName: d.value,
2526
2553
  handlePropsUpdate: m,
2527
2554
  schema: s.value,
2528
2555
  eventsSchema: a.value,
2529
2556
  handleEventsUpdate: f,
2530
2557
  availableProps: i.value,
2531
2558
  handleSlotsPropsPropsMapUpdate: h,
2532
- nodeData: g.value,
2559
+ nodeData: b.value,
2533
2560
  handleNodeDataUpdate: P,
2534
2561
  deleteable: l.value,
2535
2562
  removeNode: u
@@ -2539,59 +2566,59 @@ const er = /* @__PURE__ */ B({
2539
2566
  class: "v-craft-panel v-craft-settings-panel",
2540
2567
  onClick: V(() => !1, ["prevent", "stop"])
2541
2568
  }, [
2542
- C[1] || (C[1] = O("h3", { class: "v-craft-title" }, "component inspector", -1)),
2543
- O("span", Yr, oe(d(r)?.uuid), 1),
2544
- d(r) ? M("", !0) : (v(), N("div", Qr, [...C[0] || (C[0] = [
2569
+ T[1] || (T[1] = O("h3", { class: "v-craft-title" }, "component inspector", -1)),
2570
+ O("span", Qr, oe(p(r)?.uuid), 1),
2571
+ p(r) ? R("", !0) : (v(), E("div", Gr, [...T[0] || (T[0] = [
2545
2572
  O("p", null, "select a component to inspect", -1)
2546
2573
  ])])),
2547
2574
  O("div", {
2548
- class: ye(["v-craft-properties", { "v-craft-visible": d(r) }])
2575
+ class: ye(["v-craft-properties", { "v-craft-visible": p(r) }])
2549
2576
  }, [
2550
- O("h4", null, oe(p.value), 1),
2551
- s.value ? (v(), N("div", Gr, [
2552
- Q(b, {
2553
- craftNode: d(r),
2577
+ O("h4", null, oe(d.value), 1),
2578
+ s.value ? (v(), E("div", Wr, [
2579
+ Q(U, {
2580
+ craftNode: p(r),
2554
2581
  schema: s.value,
2555
2582
  "onUpdate:props": m
2556
2583
  }, null, 8, ["craftNode", "schema"])
2557
- ])) : M("", !0),
2558
- a.value && d(r) ? (v(), N("div", Wr, [
2559
- Q(T, {
2560
- craftNode: d(r),
2584
+ ])) : R("", !0),
2585
+ a.value && p(r) ? (v(), E("div", Zr, [
2586
+ Q(_, {
2587
+ craftNode: p(r),
2561
2588
  schema: a.value,
2562
2589
  "onUpdate:events": f
2563
2590
  }, null, 8, ["craftNode", "schema"])
2564
- ])) : M("", !0),
2565
- d(r) ? (v(), N("div", Zr, [
2566
- Q(E, {
2567
- craftNode: d(r),
2591
+ ])) : R("", !0),
2592
+ p(r) ? (v(), E("div", Jr, [
2593
+ Q(g, {
2594
+ craftNode: p(r),
2568
2595
  availableProps: i.value,
2569
2596
  "onUpdate:slotsPropsPropsMap": h
2570
2597
  }, null, 8, ["craftNode", "availableProps"])
2571
- ])) : M("", !0),
2572
- d(r) ? (v(), N("div", Jr, [
2598
+ ])) : R("", !0),
2599
+ p(r) ? (v(), E("div", en, [
2573
2600
  Q(w, {
2574
- craftNode: d(r),
2575
- nodeData: g.value,
2601
+ craftNode: p(r),
2602
+ nodeData: b.value,
2576
2603
  "onUpdate:nodeData": P
2577
2604
  }, null, 8, ["craftNode", "nodeData"])
2578
- ])) : M("", !0),
2579
- O("div", en, [
2580
- l.value ? (v(), N("button", {
2605
+ ])) : R("", !0),
2606
+ O("div", tn, [
2607
+ l.value ? (v(), E("button", {
2581
2608
  key: 0,
2582
2609
  class: "formkit-input v-craft-delete",
2583
2610
  onClick: V(u, ["prevent"])
2584
- }, " Delete ")) : M("", !0)
2611
+ }, " Delete ")) : R("", !0)
2585
2612
  ])
2586
2613
  ], 2)
2587
2614
  ], 512)
2588
2615
  ]);
2589
2616
  };
2590
2617
  }
2591
- }), Xe = /* @__PURE__ */ B({
2618
+ }), Xe = /* @__PURE__ */ L({
2592
2619
  __name: "CraftDropIndicator",
2593
2620
  setup(t) {
2594
- const e = Ue(), r = () => {
2621
+ const e = je(), r = () => {
2595
2622
  const { top: n, left: o } = e.position, { width: s, height: a } = e.size;
2596
2623
  return {
2597
2624
  top: `${n}px`,
@@ -2600,13 +2627,13 @@ const er = /* @__PURE__ */ B({
2600
2627
  width: `${s}px`
2601
2628
  };
2602
2629
  };
2603
- return (n, o) => d(e).isShown ? (v(), N("div", {
2630
+ return (n, o) => p(e).isShown ? (v(), E("div", {
2604
2631
  key: 0,
2605
- class: ye(["v-craft-indicator", { "v-craft-forbidden": d(e).isForbidden }]),
2606
- style: Ie(r())
2607
- }, null, 6)) : M("", !0);
2632
+ class: ye(["v-craft-indicator", { "v-craft-forbidden": p(e).isForbidden }]),
2633
+ style: Te(r())
2634
+ }, null, 6)) : R("", !0);
2608
2635
  }
2609
- }), it = /* @__PURE__ */ B({
2636
+ }), it = /* @__PURE__ */ L({
2610
2637
  __name: "CraftIframe",
2611
2638
  props: {
2612
2639
  iframeClass: { type: [Boolean, null, String, Object, Array], default: "" },
@@ -2624,7 +2651,7 @@ const er = /* @__PURE__ */ B({
2624
2651
  console.error("iframe could not be loaded.");
2625
2652
  return;
2626
2653
  }
2627
- m("iframeLoad", n.value), n.value?.setAttribute("data-iframe-ready", "true"), p(), r.inheritStyles && i(), r.styles.forEach((f) => {
2654
+ m("iframeLoad", n.value), n.value?.setAttribute("data-iframe-ready", "true"), d(), r.inheritStyles && i(), r.styles.forEach((f) => {
2628
2655
  n.value && l(n.value, f);
2629
2656
  }), r.styleSheets.forEach((f) => {
2630
2657
  n.value && u(n.value, f);
@@ -2641,40 +2668,40 @@ const er = /* @__PURE__ */ B({
2641
2668
  n.value?.contentDocument?.head.appendChild(P.cloneNode(!0));
2642
2669
  });
2643
2670
  }, l = (f, h) => {
2644
- const g = document.createElement("style");
2645
- g.innerHTML = h, f?.contentWindow?.document.getElementsByTagName("head").item(0)?.appendChild(g);
2671
+ const b = document.createElement("style");
2672
+ b.innerHTML = h, f?.contentWindow?.document.getElementsByTagName("head").item(0)?.appendChild(b);
2646
2673
  }, u = (f, h) => {
2647
- const g = document.createElement("link");
2648
- g.rel = "stylesheet", g.href = h, f.contentWindow?.document.head.appendChild(g);
2649
- }, p = () => {
2674
+ const b = document.createElement("link");
2675
+ b.rel = "stylesheet", b.href = h, f.contentWindow?.document.head.appendChild(b);
2676
+ }, d = () => {
2650
2677
  const f = n.value?.contentWindow?.document;
2651
2678
  if (!f) return;
2652
2679
  const h = f.querySelector("body");
2653
2680
  if (!h) return;
2654
- const g = f.createAttribute("id");
2655
- g.nodeValue = "v-craft-body", h.attributes.setNamedItem(g);
2681
+ const b = f.createAttribute("id");
2682
+ b.nodeValue = "v-craft-body", h.attributes.setNamedItem(b);
2656
2683
  }, m = e;
2657
- return (f, h) => Pt((v(), N("div", null, [
2684
+ return (f, h) => _t((v(), E("div", null, [
2658
2685
  O("iframe", {
2659
2686
  id: "v-craft-iframe",
2660
2687
  ref_key: "iframeRef",
2661
2688
  ref: n,
2662
2689
  class: ye(t.iframeClass),
2663
- style: Ie(t.iframeStyle),
2690
+ style: Te(t.iframeStyle),
2664
2691
  onload: a
2665
2692
  }, null, 6),
2666
- o.value ? (v(), $(xt, {
2693
+ o.value ? (v(), M(St, {
2667
2694
  key: 0,
2668
2695
  to: n.value?.contentWindow?.document.body
2669
2696
  }, [
2670
2697
  J(f.$slots, "default")
2671
- ], 8, ["to"])) : M("", !0)
2698
+ ], 8, ["to"])) : R("", !0)
2672
2699
  ], 512)), [
2673
- [St, f.$slots.default]
2700
+ [xt, f.$slots.default]
2674
2701
  ]);
2675
2702
  }
2676
- }), rn = (t) => typeof t.type == "symbol" ? "Fragment" : typeof t.type == "string" ? t.type : t.type.name ? t.type.name : "anonmymous", Ae = (t, e, r = null) => {
2677
- const n = rn(e), { props: o } = e, s = {
2703
+ }), nn = (t) => typeof t.type == "symbol" ? "Fragment" : typeof t.type == "string" ? t.type : t.type.name ? t.type.name : "anonmymous", Re = (t, e, r = null) => {
2704
+ const n = nn(e), { props: o } = e, s = {
2678
2705
  componentName: n,
2679
2706
  props: o,
2680
2707
  slots: {},
@@ -2695,7 +2722,7 @@ const er = /* @__PURE__ */ B({
2695
2722
  e.children,
2696
2723
  s
2697
2724
  ))), s;
2698
- }, ze = (t, e, r) => !e || !(e instanceof Array) ? [] : e.map((n) => Ae(t, n, r)).filter((n) => !!n), nn = (t) => {
2725
+ }, ze = (t, e, r) => !e || !(e instanceof Array) ? [] : e.map((n) => Re(t, n, r)).filter((n) => !!n), on = (t) => {
2699
2726
  const e = q(), { hasNodes: r } = se(e), n = t ? K(new Oe(t)) : ge("resolver");
2700
2727
  n?.value && e.setResolver(n.value), t && te("resolver", n);
2701
2728
  const o = () => {
@@ -2703,18 +2730,18 @@ const er = /* @__PURE__ */ B({
2703
2730
  const s = Qe(), i = (s.default ? s.default() : []).flatMap((l) => {
2704
2731
  if (l.key === "_default" && l.children && Array.isArray(l.children))
2705
2732
  return l.children.map((u) => {
2706
- const p = Ae(n.value, u);
2707
- return p || console.error("Invalid node created from child:", u), p;
2733
+ const d = Re(n.value, u);
2734
+ return d || console.error("Invalid node created from child:", u), d;
2708
2735
  }).filter(Boolean);
2709
2736
  {
2710
- const u = Ae(n.value, l);
2737
+ const u = Re(n.value, l);
2711
2738
  return u || console.error("Invalid node created from slot:", l), [u];
2712
2739
  }
2713
2740
  }).filter(Boolean);
2714
2741
  i.length && e.setNodes(i);
2715
2742
  }
2716
2743
  };
2717
- return Se(o), ne(
2744
+ return xe(o), ne(
2718
2745
  () => n?.value,
2719
2746
  (s) => {
2720
2747
  s && e.setResolver(s);
@@ -2723,7 +2750,7 @@ const er = /* @__PURE__ */ B({
2723
2750
  editor: e,
2724
2751
  mountNodes: o
2725
2752
  };
2726
- }, on = { class: "v-craft-frame" }, sn = /* @__PURE__ */ B({
2753
+ }, sn = { class: "v-craft-frame" }, an = /* @__PURE__ */ L({
2727
2754
  name: "CraftFrame",
2728
2755
  __name: "CraftFrame",
2729
2756
  props: {
@@ -2733,67 +2760,67 @@ const er = /* @__PURE__ */ B({
2733
2760
  },
2734
2761
  emits: ["iframeLoad"],
2735
2762
  setup(t, { emit: e }) {
2736
- const r = t, { iframe: n } = be(r), o = (p) => {
2737
- s("iframeLoad", p);
2738
- }, s = e, { editor: a } = nn(r.resolverMap), { nodeTree: i, hasNodes: l, enabled: u } = se(a);
2739
- return (p, m) => {
2763
+ const r = t, { iframe: n } = be(r), o = (d) => {
2764
+ s("iframeLoad", d);
2765
+ }, s = e, { editor: a } = on(r.resolverMap), { nodeTree: i, hasNodes: l, enabled: u } = se(a);
2766
+ return (d, m) => {
2740
2767
  const f = H("CraftNodeViewer"), h = H("CraftNodeEditor");
2741
- return v(), N("div", on, [
2742
- d(n) ? (v(), $(it, {
2768
+ return v(), E("div", sn, [
2769
+ p(n) ? (v(), M(it, {
2743
2770
  key: 0,
2744
2771
  onIframeLoad: o,
2745
- inheritStyles: d(n)?.inheritStyles,
2746
- iframeStyle: d(n)?.iframeStyle,
2747
- iframeClass: d(n)?.iframeClass,
2748
- class: ye(d(n)?.wrapperClass),
2749
- style: Ie(d(n)?.wrapperStyle),
2750
- styles: d(n)?.styles,
2751
- styleSheets: d(n)?.styleSheets
2772
+ inheritStyles: p(n)?.inheritStyles,
2773
+ iframeStyle: p(n)?.iframeStyle,
2774
+ iframeClass: p(n)?.iframeClass,
2775
+ class: ye(p(n)?.wrapperClass),
2776
+ style: Te(p(n)?.wrapperStyle),
2777
+ styles: p(n)?.styles,
2778
+ styleSheets: p(n)?.styleSheets
2752
2779
  }, {
2753
2780
  default: G(() => [
2754
- (t.viewOnly || !d(u)) && d(l) ? (v(!0), N(j, { key: 0 }, U(d(i), (g) => (v(), $(f, {
2755
- key: `${g.uuid}-view`,
2756
- craftNode: g
2757
- }, null, 8, ["craftNode"]))), 128)) : M("", !0),
2758
- !t.viewOnly && d(u) && d(l) ? (v(!0), N(j, { key: 1 }, U(d(i), (g) => (v(), $(h, {
2759
- key: `${g.uuid}-edit`,
2760
- craftNode: g
2761
- }, null, 8, ["craftNode"]))), 128)) : M("", !0),
2762
- !t.viewOnly && d(u) ? (v(), $(Xe, { key: 2 })) : M("", !0)
2781
+ (t.viewOnly || !p(u)) && p(l) ? (v(!0), E(B, { key: 0 }, j(p(i), (b) => (v(), M(f, {
2782
+ key: `${b.uuid}-view`,
2783
+ craftNode: b
2784
+ }, null, 8, ["craftNode"]))), 128)) : R("", !0),
2785
+ !t.viewOnly && p(u) && p(l) ? (v(!0), E(B, { key: 1 }, j(p(i), (b) => (v(), M(h, {
2786
+ key: `${b.uuid}-edit`,
2787
+ craftNode: b
2788
+ }, null, 8, ["craftNode"]))), 128)) : R("", !0),
2789
+ !t.viewOnly && p(u) ? (v(), M(Xe, { key: 2 })) : R("", !0)
2763
2790
  ]),
2764
2791
  _: 1
2765
- }, 8, ["inheritStyles", "iframeStyle", "iframeClass", "class", "style", "styles", "styleSheets"])) : M("", !0),
2766
- !d(n) && (t.viewOnly || !d(u)) && d(l) ? (v(!0), N(j, { key: 1 }, U(d(i), (g) => (v(), $(f, {
2767
- key: `${g.uuid}-view`,
2768
- craftNode: g
2769
- }, null, 8, ["craftNode"]))), 128)) : M("", !0),
2770
- !d(n) && !t.viewOnly && d(u) && d(l) ? (v(!0), N(j, { key: 2 }, U(d(i), (g) => (v(), $(h, {
2771
- key: `${g.uuid}-edit`,
2772
- craftNode: g
2773
- }, null, 8, ["craftNode"]))), 128)) : M("", !0),
2774
- !d(n) && !t.viewOnly && d(u) ? (v(), $(Xe, { key: 3 })) : M("", !0)
2792
+ }, 8, ["inheritStyles", "iframeStyle", "iframeClass", "class", "style", "styles", "styleSheets"])) : R("", !0),
2793
+ !p(n) && (t.viewOnly || !p(u)) && p(l) ? (v(!0), E(B, { key: 1 }, j(p(i), (b) => (v(), M(f, {
2794
+ key: `${b.uuid}-view`,
2795
+ craftNode: b
2796
+ }, null, 8, ["craftNode"]))), 128)) : R("", !0),
2797
+ !p(n) && !t.viewOnly && p(u) && p(l) ? (v(!0), E(B, { key: 2 }, j(p(i), (b) => (v(), M(h, {
2798
+ key: `${b.uuid}-edit`,
2799
+ craftNode: b
2800
+ }, null, 8, ["craftNode"]))), 128)) : R("", !0),
2801
+ !p(n) && !t.viewOnly && p(u) ? (v(), M(Xe, { key: 3 })) : R("", !0)
2775
2802
  ]);
2776
2803
  };
2777
2804
  }
2778
- }), an = (t, e) => {
2805
+ }), ln = (t, e) => {
2779
2806
  const r = q(), { enabled: n, selectedUuid: o, draggingDisabled: s } = se(r);
2780
2807
  let a = null;
2781
2808
  const i = () => {
2782
2809
  const m = e?.value?.$el;
2783
2810
  m && m !== a && (a = m, r.setNodeRef(t, m));
2784
2811
  };
2785
- Se(i), ne(e, i, { flush: "post" });
2786
- const l = _(
2812
+ xe(i), ne(e, i, { flush: "post" });
2813
+ const l = C(
2787
2814
  () => o.value === t.uuid
2788
2815
  );
2789
2816
  return {
2790
- isDraggable: _(() => n.value && !s.value && Wt(t)),
2817
+ isDraggable: C(() => n.value && !s.value && Zt(t)),
2791
2818
  isSelected: l,
2792
2819
  selectNode: () => {
2793
2820
  n.value && r.selectNode(t);
2794
2821
  }
2795
2822
  };
2796
- }, je = (t, e, r = {}) => {
2823
+ }, Be = (t, e, r = {}) => {
2797
2824
  const n = /* @__PURE__ */ new Map(), o = () => {
2798
2825
  !t.value?.events || !Object.values(t.value.events).length || Object.entries(t.value.events).forEach(([s, a]) => {
2799
2826
  if (!a.trim())
@@ -2833,7 +2860,7 @@ Error:`,
2833
2860
  }), wt(() => {
2834
2861
  n.clear();
2835
2862
  }), {
2836
- eventHandlers: _(() => Object.fromEntries(n))
2863
+ eventHandlers: C(() => Object.fromEntries(n))
2837
2864
  };
2838
2865
  }, lt = (t) => {
2839
2866
  const e = (() => {
@@ -2842,7 +2869,7 @@ Error:`,
2842
2869
  } catch {
2843
2870
  return null;
2844
2871
  }
2845
- })(), r = _(() => e ? se(e).enabled?.value ?? !1 : !1), n = _(() => t.value?.visible !== !1);
2872
+ })(), r = C(() => e ? se(e).enabled?.value ?? !1 : !1), n = C(() => t.value?.visible !== !1);
2846
2873
  return te("craftNode", We(t)), {
2847
2874
  editor: e,
2848
2875
  craftNode: t,
@@ -2863,13 +2890,13 @@ Error:`,
2863
2890
  return t.clientX - r.left < 15 || t.clientY - r.top < 15 || r.right - t.clientX < 15 || r.bottom - t.clientY < 15;
2864
2891
  }, pt = (t, e, { editor: r, indicator: n, craftNode: o, resolver: s }) => {
2865
2892
  if (r.draggedNode) {
2866
- if (n.setIsForbidden(!Pe(r.draggedNode, o.value, s)), ut(t, e)) {
2893
+ if (n.setIsForbidden(!_e(r.draggedNode, o.value, s)), ut(t, e)) {
2867
2894
  n.pointBefore(e);
2868
2895
  return;
2869
2896
  }
2870
2897
  n.pointAfter(e);
2871
2898
  }
2872
- }, ln = (t, e, { editor: r, indicator: n, craftNode: o, resolver: s }) => {
2899
+ }, un = (t, e, { editor: r, indicator: n, craftNode: o, resolver: s }) => {
2873
2900
  if (!r.draggedNode) return;
2874
2901
  const i = t.target.closest(".v-craft-drop-text");
2875
2902
  if (i) {
@@ -2887,14 +2914,14 @@ Error:`,
2887
2914
  return;
2888
2915
  }
2889
2916
  n.pointInside(e);
2890
- }, un = (t, e, r) => {
2917
+ }, cn = (t, e, r) => {
2891
2918
  if (W(r.craftNode.value)) {
2892
- ln(t, e, r);
2919
+ un(t, e, r);
2893
2920
  return;
2894
2921
  }
2895
2922
  pt(t, e, r);
2896
2923
  }, ft = (t, e, r, n) => {
2897
- if (!Pe(
2924
+ if (!_e(
2898
2925
  r,
2899
2926
  n.craftNode.value,
2900
2927
  n.resolver
@@ -2913,15 +2940,15 @@ Error:`,
2913
2940
  craftNode: K(l)
2914
2941
  }), n.craftNode.value;
2915
2942
  const u = i.closest(".v-craft-drop-text");
2916
- let p = "default";
2943
+ let d = "default";
2917
2944
  if (u) {
2918
2945
  const m = u.getAttribute("data-slot-name");
2919
- m && (p = m);
2946
+ m && (d = m);
2920
2947
  } else {
2921
2948
  if (dt(t, e))
2922
2949
  return ft(t, e, r, n);
2923
2950
  const m = n.craftNode.value.slots || {}, f = Object.keys(m);
2924
- p = f.length > 0 ? f[0] : "default";
2951
+ d = f.length > 0 ? f[0] : "default";
2925
2952
  }
2926
2953
  return me(
2927
2954
  r,
@@ -2930,9 +2957,9 @@ Error:`,
2930
2957
  ) && (ct(t, e) ? n.editor.prependNodeTo(
2931
2958
  r,
2932
2959
  n.craftNode.value,
2933
- p
2934
- ) : n.editor.appendNodeTo(r, n.craftNode.value, p)), n.craftNode.value;
2935
- }, cn = (t, e, r) => {
2960
+ d
2961
+ ) : n.editor.appendNodeTo(r, n.craftNode.value, d)), n.craftNode.value;
2962
+ }, dn = (t, e, r) => {
2936
2963
  if (!r.editor.draggedNode)
2937
2964
  return r.craftNode.value;
2938
2965
  const n = (() => {
@@ -2943,10 +2970,10 @@ Error:`,
2943
2970
  })();
2944
2971
  return W(r.craftNode.value) ? ht(t, e, n, r) : ft(t, e, n, r);
2945
2972
  }, qe = {
2946
- handleDragOver: un,
2947
- handleDrop: cn
2948
- }, dn = (t, e, r) => {
2949
- const n = q(), o = Ue(), s = (u) => {
2973
+ handleDragOver: cn,
2974
+ handleDrop: dn
2975
+ }, pn = (t, e, r) => {
2976
+ const n = q(), o = je(), s = (u) => {
2950
2977
  n.enabled && n.dragNode(t.value);
2951
2978
  }, a = Je((u) => {
2952
2979
  n.enabled && e.value?.$el && qe.handleDragOver(u, e.value.$el, {
@@ -2971,7 +2998,7 @@ Error:`,
2971
2998
  n.enabled && n.dragNode(null);
2972
2999
  }
2973
3000
  };
2974
- }, pn = ["data-slot-name"], fn = { class: "v-craft-slot-name" }, hn = /* @__PURE__ */ B({
3001
+ }, fn = ["data-slot-name"], hn = { class: "v-craft-slot-name" }, vn = /* @__PURE__ */ L({
2975
3002
  name: "CraftNodeEditor",
2976
3003
  __name: "CraftNodeEditor",
2977
3004
  props: {
@@ -2979,86 +3006,86 @@ Error:`,
2979
3006
  context: {}
2980
3007
  },
2981
3008
  setup(t) {
2982
- const e = t, { craftNode: r } = be(e), { editor: n, visible: o } = lt(r), { resolvedNode: s, resolver: a, componentToRender: i, props: l } = _e(r, () => e.context || {}), u = (S, R = {}, F) => {
2983
- const Z = a?.value?.getSlotsProps?.(r.value)?.[S], z = Z ? Object.fromEntries(
2984
- Z.filter((Y) => Y in R).map((Y) => [Y, R[Y]])
2985
- ) : R, pe = {
3009
+ const e = t, { craftNode: r } = be(e), { editor: n, visible: o } = lt(r), { resolvedNode: s, resolver: a, componentToRender: i, props: l } = Pe(r, () => e.context || {}), u = (x, D = {}, F) => {
3010
+ const Z = a?.value?.getSlotsProps?.(r.value)?.[x], z = Z ? Object.fromEntries(
3011
+ Z.filter((Y) => Y in D).map((Y) => [Y, D[Y]])
3012
+ ) : D, pe = {
2986
3013
  ...e.context || {},
2987
- [S]: z
3014
+ [x]: z
2988
3015
  };
2989
3016
  return F !== void 0 && (pe.data = F), pe;
2990
3017
  };
2991
3018
  ne(
2992
3019
  a,
2993
- (S) => {
2994
- S && te("resolver", a);
3020
+ (x) => {
3021
+ x && te("resolver", a);
2995
3022
  },
2996
3023
  { immediate: !0 }
2997
3024
  );
2998
- const p = K(null), m = K(null), f = _(() => n?.nodeDataMap[r.value.uuid]), { isSelected: h, isDraggable: g, selectNode: P } = an(
3025
+ const d = K(null), m = K(null), f = C(() => n?.nodeDataMap[r.value.uuid]), { isSelected: h, isDraggable: b, selectNode: P } = ln(
2999
3026
  r.value,
3000
- p
3001
- ), { handleDragStart: A, handleDragOver: C, handleDrop: b, handleDragEnd: T } = dn(r, p, a.value), { eventHandlers: E } = je(
3027
+ d
3028
+ ), { handleDragStart: A, handleDragOver: T, handleDrop: U, handleDragEnd: _ } = pn(r, d, a.value), { eventHandlers: g } = Be(
3002
3029
  r,
3003
3030
  n?.eventsContext || {},
3004
3031
  {
3005
3032
  getNodes: () => n?.nodeMap ? Object.fromEntries(n.nodeMap.entries()) : null,
3006
- getNode: (S) => n?.nodeMap.get(S) ?? null,
3033
+ getNode: (x) => n?.nodeMap.get(x) ?? null,
3007
3034
  nodeValues: n?.nodeRuntimeProps,
3008
- setNodeProps: (S, R) => n?.setNodeRuntimeProps(S, R),
3035
+ setNodeProps: (x, D) => n?.setNodeRuntimeProps(x, D),
3009
3036
  state: n?.pageState
3010
3037
  }
3011
- ), w = _(() => n?.nodeRuntimeProps[r.value.uuid] || {}), y = (S) => {
3012
- n?.setNodeRuntimeProps(r.value.uuid, { value: S });
3013
- }, x = _(() => {
3014
- const S = (R, F) => (...Z) => {
3015
- F(...Z), E.value[R]?.(...Z);
3038
+ ), w = C(() => n?.nodeRuntimeProps[r.value.uuid] || {}), y = (x) => {
3039
+ n?.setNodeRuntimeProps(r.value.uuid, { value: x });
3040
+ }, N = C(() => {
3041
+ const x = (D, F) => (...Z) => {
3042
+ F(...Z), g.value[D]?.(...Z);
3016
3043
  };
3017
3044
  return {
3018
- ...E.value,
3019
- input: S("input", (R) => y(R?.target?.value)),
3020
- change: S("change", (R) => y(R?.target?.value)),
3021
- "update:modelValue": S("update:modelValue", (R) => y(R))
3045
+ ...g.value,
3046
+ input: x("input", (D) => y(D?.target?.value)),
3047
+ change: x("change", (D) => y(D?.target?.value)),
3048
+ "update:modelValue": x("update:modelValue", (D) => y(D))
3022
3049
  };
3023
- }), k = _(() => {
3024
- const S = a?.value?.resolve(r.value.componentName);
3025
- return S?.label ? S.label : W(r.value) ? r.value.props.componentName : S?.componentName || r.value.componentName;
3026
- }), L = _(() => at(r.value.uuid)), X = () => {
3027
- const R = (m.value?.ownerDocument ?? p.value?.$el?.ownerDocument ?? document).querySelector(
3050
+ }), S = C(() => {
3051
+ const x = a?.value?.resolve(r.value.componentName);
3052
+ return x?.label ? x.label : W(r.value) ? r.value.props.componentName : x?.componentName || r.value.componentName;
3053
+ }), I = C(() => at(r.value.uuid)), X = () => {
3054
+ const D = (m.value?.ownerDocument ?? d.value?.$el?.ownerDocument ?? document).querySelector(
3028
3055
  `[data-craft-uuid="${r.value.uuid}"]`
3029
3056
  );
3030
- if (R) return R;
3031
- let F = p.value?.$el;
3057
+ if (D) return D;
3058
+ let F = d.value?.$el;
3032
3059
  for (; F && !(F instanceof HTMLElement); )
3033
3060
  F = F.nextElementSibling ?? null;
3034
3061
  return F ?? null;
3035
- }, ce = (S, R, F) => {
3036
- if (!(S instanceof Element)) {
3037
- console.error("resolveNodeEl returned a non-Element:", S);
3062
+ }, ce = (x, D, F) => {
3063
+ if (!(x instanceof Element)) {
3064
+ console.error("resolveNodeEl returned a non-Element:", x);
3038
3065
  return;
3039
3066
  }
3040
- S.style.setProperty("--node-name", R), S.style.setProperty("--node-color", F), S.setAttribute("data-node-name", R);
3067
+ x.style.setProperty("--node-name", D), x.style.setProperty("--node-color", F), x.setAttribute("data-node-name", D);
3041
3068
  }, de = () => {
3042
- const S = X();
3043
- S && (m.value = S, ce(S, k.value ?? "(n/a)", L.value));
3069
+ const x = X();
3070
+ x && (m.value = x, ce(x, S.value ?? "(n/a)", I.value));
3044
3071
  };
3045
- Se(() => ve(de)), kt(() => ve(de)), ne([k, L], () => {
3046
- m.value && ce(m.value, k.value ?? "", L.value);
3072
+ xe(() => ve(de)), kt(() => ve(de)), ne([S, I], () => {
3073
+ m.value && ce(m.value, S.value ?? "", I.value);
3047
3074
  });
3048
- const vt = _(() => {
3049
- const R = a?.value?.resolveNode?.(r.value)?.slots;
3050
- return R && R.length > 0 ? R : ["default"];
3051
- }), mt = _(() => W(r.value) ? !0 : Object.values(r.value.slots || {}).some(
3052
- (S) => S.length > 0
3053
- )), gt = () => P(), yt = (S, R) => f.value ? f.value.slotName && f.value.slotName !== R ? [] : bt(f.value, S) : [], bt = (S, R) => S.type === "single" ? R.map((F) => ({
3075
+ const vt = C(() => {
3076
+ const D = a?.value?.resolveNode?.(r.value)?.slots;
3077
+ return D && D.length > 0 ? D : ["default"];
3078
+ }), mt = C(() => W(r.value) ? !0 : Object.values(r.value.slots || {}).some(
3079
+ (x) => x.length > 0
3080
+ )), gt = () => P(), yt = (x, D) => f.value ? f.value.slotName && f.value.slotName !== D ? [] : bt(f.value, x) : [], bt = (x, D) => x.type === "single" ? D.map((F) => ({
3054
3081
  key: `${F.uuid}-single`,
3055
3082
  craftNode: {
3056
3083
  ...F,
3057
- props: { ...F.props, ...S.item || {} }
3084
+ props: { ...F.props, ...x.item || {} }
3058
3085
  },
3059
- dataItem: S.item || {}
3060
- })) : S.type === "list" ? S.list ? R.reduce((F, Z) => F.concat(
3061
- S.list.map((z, pe) => ({
3086
+ dataItem: x.item || {}
3087
+ })) : x.type === "list" ? x.list ? D.reduce((F, Z) => F.concat(
3088
+ x.list.map((z, pe) => ({
3062
3089
  key: `${Z.uuid}-data-${pe}`,
3063
3090
  craftNode: {
3064
3091
  ...Z,
@@ -3067,73 +3094,73 @@ Error:`,
3067
3094
  dataItem: z || {}
3068
3095
  }))
3069
3096
  ), []) : [] : [];
3070
- return (S, R) => {
3097
+ return (x, D) => {
3071
3098
  const F = H("CraftNodeViewer"), Z = H("CraftNodeEditor", !0);
3072
- return d(o) && d(r) && d(s) ? (v(), $(Ce(d(i)), xe({
3099
+ return p(o) && p(r) && p(s) ? (v(), M(Ce(p(i)), Se({
3073
3100
  key: 0,
3074
3101
  ref_key: "nodeRef",
3075
- ref: p
3102
+ ref: d
3076
3103
  }, {
3077
- ...d(l),
3104
+ ...p(l),
3078
3105
  ...w.value,
3079
- "data-craft-uuid": d(r).uuid
3080
- }, Te(x.value), {
3106
+ "data-craft-uuid": p(r).uuid
3107
+ }, Ue(N.value), {
3081
3108
  class: {
3082
- "v-craft-node-selected": d(h),
3083
- "v-craft-node": d(n)?.enabled,
3084
- "v-craft-canvas": d(W)(d(r)),
3085
- "v-craft-empty": !d(r).slots || Object.keys(d(r).slots).length === 0 || Object.values(d(r).slots).every((z) => z.length === 0),
3086
- "v-craft-other-node-dragged": d(n)?.draggedNode && !d(rt)(d(n).draggedNode, d(r))
3109
+ "v-craft-node-selected": p(h),
3110
+ "v-craft-node": p(n)?.enabled,
3111
+ "v-craft-canvas": p(W)(p(r)),
3112
+ "v-craft-empty": !p(r).slots || Object.keys(p(r).slots).length === 0 || Object.values(p(r).slots).every((z) => z.length === 0),
3113
+ "v-craft-other-node-dragged": p(n)?.draggedNode && !p(rt)(p(n).draggedNode, p(r))
3087
3114
  },
3088
- draggable: d(n)?.enabled && d(g),
3115
+ draggable: p(n)?.enabled && p(b),
3089
3116
  onClick: V(gt, ["prevent", "stop"]),
3090
- onDragend: V(d(T), ["prevent", "stop"]),
3091
- onDragover: V(d(C), ["prevent", "stop"]),
3092
- onDragstart: V(d(A), ["stop"]),
3093
- onDrop: V(d(b), ["prevent", "stop"])
3117
+ onDragend: V(p(_), ["prevent", "stop"]),
3118
+ onDragover: V(p(T), ["prevent", "stop"]),
3119
+ onDragstart: V(p(A), ["stop"]),
3120
+ onDrop: V(p(U), ["prevent", "stop"])
3094
3121
  }), Ne({ _: 2 }, [
3095
- U(vt.value, (z) => ({
3122
+ j(vt.value, (z) => ({
3096
3123
  name: z,
3097
3124
  fn: G((pe) => [
3098
- d(W)(d(r)) && (!d(r).slots || d(r).slots[z]?.length == 0) ? (v(), N("div", {
3125
+ p(W)(p(r)) && (!p(r).slots || p(r).slots[z]?.length == 0) ? (v(), E("div", {
3099
3126
  key: 0,
3100
3127
  class: "v-craft-drop-text",
3101
3128
  "data-slot-name": z,
3102
- onDragover: R[0] || (R[0] = V(
3129
+ onDragover: D[0] || (D[0] = V(
3103
3130
  //@ts-ignore
3104
- (...Y) => d(C) && d(C)(...Y),
3131
+ (...Y) => p(T) && p(T)(...Y),
3105
3132
  ["prevent", "stop"]
3106
3133
  )),
3107
- onDrop: R[1] || (R[1] = V(
3134
+ onDrop: D[1] || (D[1] = V(
3108
3135
  //@ts-ignore
3109
- (...Y) => d(b) && d(b)(...Y),
3136
+ (...Y) => p(U) && p(U)(...Y),
3110
3137
  ["prevent", "stop"]
3111
3138
  ))
3112
3139
  }, [
3113
- R[2] || (R[2] = O("span", { class: "v-craft-drop-text-label" }, "Drop a component here", -1)),
3114
- O("span", fn, oe(z), 1)
3115
- ], 40, pn)) : M("", !0),
3116
- mt.value ? (v(), N(j, { key: 1 }, [
3117
- f.value?.type && (!f.value.slotName || f.value.slotName === z) ? (v(!0), N(j, { key: 0 }, U(yt(
3118
- d(r).slots?.[z] || [],
3140
+ D[2] || (D[2] = O("span", { class: "v-craft-drop-text-label" }, "Drop a component here", -1)),
3141
+ O("span", hn, oe(z), 1)
3142
+ ], 40, fn)) : R("", !0),
3143
+ mt.value ? (v(), E(B, { key: 1 }, [
3144
+ f.value?.type && (!f.value.slotName || f.value.slotName === z) ? (v(!0), E(B, { key: 0 }, j(yt(
3145
+ p(r).slots?.[z] || [],
3119
3146
  z
3120
- ), (Y) => (v(), $(F, {
3147
+ ), (Y) => (v(), M(F, {
3121
3148
  key: Y.key,
3122
3149
  craftNode: Y.craftNode,
3123
3150
  context: u(z, pe, Y.dataItem)
3124
- }, null, 8, ["craftNode", "context"]))), 128)) : M("", !0),
3125
- (v(!0), N(j, null, U(d(r).slots?.[z] || [], (Y) => (v(), $(Z, {
3151
+ }, null, 8, ["craftNode", "context"]))), 128)) : R("", !0),
3152
+ (v(!0), E(B, null, j(p(r).slots?.[z] || [], (Y) => (v(), M(Z, {
3126
3153
  key: Y.uuid,
3127
3154
  craftNode: Y,
3128
3155
  context: u(z, pe)
3129
3156
  }, null, 8, ["craftNode", "context"]))), 128))
3130
- ], 64)) : M("", !0)
3157
+ ], 64)) : R("", !0)
3131
3158
  ])
3132
3159
  }))
3133
- ]), 1040, ["class", "draggable", "onDragend", "onDragover", "onDragstart", "onDrop"])) : M("", !0);
3160
+ ]), 1040, ["class", "draggable", "onDragend", "onDragover", "onDragstart", "onDrop"])) : R("", !0);
3134
3161
  };
3135
3162
  }
3136
- }), Re = /* @__PURE__ */ B({
3163
+ }), Me = /* @__PURE__ */ L({
3137
3164
  name: "CraftNodeViewer",
3138
3165
  __name: "CraftNodeViewer",
3139
3166
  props: {
@@ -3143,94 +3170,94 @@ Error:`,
3143
3170
  context: {}
3144
3171
  },
3145
3172
  setup(t) {
3146
- const e = t, r = he(e, "craftNode"), { editor: n, visible: o } = lt(r), { resolvedNode: s, resolver: a, componentToRender: i, props: l } = _e(r, () => e.context || {});
3173
+ const e = t, r = he(e, "craftNode"), { editor: n, visible: o } = lt(r), { resolvedNode: s, resolver: a, componentToRender: i, props: l } = Pe(r, () => e.context || {});
3147
3174
  te("resolver", a);
3148
- const u = (y, x = {}, k) => {
3149
- const L = a?.value?.getSlotsProps?.(r.value)?.[y], X = L ? Object.fromEntries(
3150
- L.filter((de) => de in x).map((de) => [de, x[de]])
3151
- ) : x, ce = {
3175
+ const u = (y, N = {}, S) => {
3176
+ const I = a?.value?.getSlotsProps?.(r.value)?.[y], X = I ? Object.fromEntries(
3177
+ I.filter((de) => de in N).map((de) => [de, N[de]])
3178
+ ) : N, ce = {
3152
3179
  ...e.context || {},
3153
3180
  [y]: X
3154
3181
  };
3155
- return k !== void 0 && (ce.data = k), ce;
3156
- }, p = _(() => e.nodeDataMap?.[r.value.uuid] || n?.nodeDataMap?.[r.value.uuid]), m = _(() => r.value.slots || {}), f = _(() => W(r.value)), h = _(() => {
3157
- if (!g.value)
3182
+ return S !== void 0 && (ce.data = S), ce;
3183
+ }, d = C(() => e.nodeDataMap?.[r.value.uuid] || n?.nodeDataMap?.[r.value.uuid]), m = C(() => r.value.slots || {}), f = C(() => W(r.value)), h = C(() => {
3184
+ if (!b.value)
3158
3185
  return [];
3159
- const y = [], k = a?.value?.resolveNode?.(r.value)?.slots;
3160
- return k && k.length > 0 ? y.push(...k) : y.push("default"), y;
3161
- }), g = _(() => f.value ? !0 : Object.values(m.value).some((y) => y.length > 0)), P = (y, x) => p.value ? p.value.slotName && p.value.slotName !== x ? [] : w(p.value, y) : [], A = K(null), { eventHandlers: C } = je(
3186
+ const y = [], S = a?.value?.resolveNode?.(r.value)?.slots;
3187
+ return S && S.length > 0 ? y.push(...S) : y.push("default"), y;
3188
+ }), b = C(() => f.value ? !0 : Object.values(m.value).some((y) => y.length > 0)), P = (y, N) => d.value ? d.value.slotName && d.value.slotName !== N ? [] : w(d.value, y) : [], A = K(null), { eventHandlers: T } = Be(
3162
3189
  r,
3163
3190
  e.eventsContext || n?.eventsContext || {},
3164
3191
  {
3165
3192
  getNodes: () => n?.nodeMap ? Object.fromEntries(n.nodeMap.entries()) : null,
3166
3193
  getNode: (y) => n?.nodeMap.get(y) ?? null,
3167
3194
  nodeValues: n?.nodeRuntimeProps,
3168
- setNodeProps: (y, x) => n?.setNodeRuntimeProps(y, x),
3195
+ setNodeProps: (y, N) => n?.setNodeRuntimeProps(y, N),
3169
3196
  state: n?.pageState
3170
3197
  }
3171
- ), b = _(() => n?.nodeRuntimeProps[r.value.uuid] || {}), T = (y) => {
3198
+ ), U = C(() => n?.nodeRuntimeProps[r.value.uuid] || {}), _ = (y) => {
3172
3199
  n?.setNodeRuntimeProps(r.value.uuid, { value: y });
3173
- }, E = _(() => {
3174
- const y = (x, k) => (...L) => {
3175
- k(...L), C.value[x]?.(...L);
3200
+ }, g = C(() => {
3201
+ const y = (N, S) => (...I) => {
3202
+ S(...I), T.value[N]?.(...I);
3176
3203
  };
3177
3204
  return {
3178
- ...C.value,
3179
- input: y("input", (x) => T(x?.target?.value)),
3180
- change: y("change", (x) => T(x?.target?.value)),
3181
- "update:modelValue": y("update:modelValue", (x) => T(x))
3205
+ ...T.value,
3206
+ input: y("input", (N) => _(N?.target?.value)),
3207
+ change: y("change", (N) => _(N?.target?.value)),
3208
+ "update:modelValue": y("update:modelValue", (N) => _(N))
3182
3209
  };
3183
3210
  });
3184
- Se(() => {
3211
+ xe(() => {
3185
3212
  A.value && r.value && n && n.setNodeRef(r.value, A.value);
3186
3213
  });
3187
- const w = (y, x) => y.type === "single" ? x.map((k) => ({
3188
- key: `${k.uuid}-single`,
3214
+ const w = (y, N) => y.type === "single" ? N.map((S) => ({
3215
+ key: `${S.uuid}-single`,
3189
3216
  craftNode: {
3190
- ...k,
3217
+ ...S,
3191
3218
  props: {
3192
- ...k.props,
3219
+ ...S.props,
3193
3220
  ...y.item || {}
3194
3221
  }
3195
3222
  },
3196
3223
  dataItem: y.item || {}
3197
- })) : y.type === "list" ? y.list ? x.reduce((k, L) => k.concat(
3224
+ })) : y.type === "list" ? y.list ? N.reduce((S, I) => S.concat(
3198
3225
  //@ts-ignore
3199
3226
  y.list.map((X, ce) => ({
3200
- key: `${L.uuid}-data-${ce}`,
3227
+ key: `${I.uuid}-data-${ce}`,
3201
3228
  craftNode: {
3202
- ...L,
3229
+ ...I,
3203
3230
  props: {
3204
- ...L.props,
3231
+ ...I.props,
3205
3232
  ...X || {}
3206
3233
  }
3207
3234
  }
3208
3235
  }))
3209
3236
  ), []) : [] : [];
3210
- return (y, x) => d(o) && d(a) && d(s) ? (v(), $(Ce(d(i)), xe({
3237
+ return (y, N) => p(o) && p(a) && p(s) ? (v(), M(Ce(p(i)), Se({
3211
3238
  key: 0,
3212
3239
  ref_key: "nodeRef",
3213
3240
  ref: A
3214
- }, { ...d(l), ...b.value }, Te(E.value)), Ne({ _: 2 }, [
3215
- U(h.value, (k) => ({
3216
- name: k,
3217
- fn: G((L) => [
3218
- g.value ? (v(), N(j, { key: 0 }, [
3219
- p.value?.type ? (v(!0), N(j, { key: 1 }, U(P(m.value[k], k), (X) => (v(), $(Re, {
3241
+ }, { ...p(l), ...U.value }, Ue(g.value)), Ne({ _: 2 }, [
3242
+ j(h.value, (S) => ({
3243
+ name: S,
3244
+ fn: G((I) => [
3245
+ b.value ? (v(), E(B, { key: 0 }, [
3246
+ d.value?.type ? (v(!0), E(B, { key: 1 }, j(P(m.value[S], S), (X) => (v(), M(Me, {
3220
3247
  key: X.key,
3221
3248
  craftNode: X.craftNode,
3222
- context: u(k, L, X.dataItem)
3223
- }, null, 8, ["craftNode", "context"]))), 128)) : (v(!0), N(j, { key: 0 }, U(m.value[k], (X) => (v(), $(Re, {
3249
+ context: u(S, I, X.dataItem)
3250
+ }, null, 8, ["craftNode", "context"]))), 128)) : (v(!0), E(B, { key: 0 }, j(m.value[S], (X) => (v(), M(Me, {
3224
3251
  key: X.uuid,
3225
3252
  craftNode: X,
3226
- context: u(k, L)
3253
+ context: u(S, I)
3227
3254
  }, null, 8, ["craftNode", "context"]))), 128))
3228
- ], 64)) : M("", !0)
3255
+ ], 64)) : R("", !0)
3229
3256
  ])
3230
3257
  }))
3231
- ]), 1040)) : M("", !0);
3258
+ ]), 1040)) : R("", !0);
3232
3259
  }
3233
- }), Me = /* @__PURE__ */ B({
3260
+ }), $e = /* @__PURE__ */ L({
3234
3261
  name: "CraftNodeStatic",
3235
3262
  __name: "CraftNodeStatic",
3236
3263
  props: {
@@ -3243,101 +3270,101 @@ Error:`,
3243
3270
  context: {}
3244
3271
  },
3245
3272
  setup(t) {
3246
- const e = t, { craftNode: r, nodeMap: n } = be(e), { resolvedNode: o, resolver: s, componentToRender: a, props: i } = _e(r, () => e.context || {});
3273
+ const e = t, { craftNode: r, nodeMap: n } = be(e), { resolvedNode: o, resolver: s, componentToRender: a, props: i } = Pe(r, () => e.context || {});
3247
3274
  te("resolver", s), te("craftNode", We(r.value));
3248
- const l = (E, w = {}, y) => {
3249
- const x = s?.value?.getSlotsProps?.(r.value)?.[E], k = x ? Object.fromEntries(
3250
- x.filter((X) => X in w).map((X) => [X, w[X]])
3251
- ) : w, L = {
3275
+ const l = (g, w = {}, y) => {
3276
+ const N = s?.value?.getSlotsProps?.(r.value)?.[g], S = N ? Object.fromEntries(
3277
+ N.filter((X) => X in w).map((X) => [X, w[X]])
3278
+ ) : w, I = {
3252
3279
  ...e.context || {},
3253
- [E]: k
3280
+ [g]: S
3254
3281
  };
3255
- return y !== void 0 && (L.data = y), L;
3256
- }, u = _(() => e.nodeDataMap?.[r.value.uuid] || null), p = _(() => r.value.slots || {}), m = _(() => W(r.value)), f = _(() => {
3282
+ return y !== void 0 && (I.data = y), I;
3283
+ }, u = C(() => e.nodeDataMap?.[r.value.uuid] || null), d = C(() => r.value.slots || {}), m = C(() => W(r.value)), f = C(() => {
3257
3284
  if (!h.value)
3258
3285
  return [];
3259
- const E = [], y = s?.value?.resolveNode?.(r.value)?.slots;
3260
- return y && y.length > 0 ? E.push(...y) : E.push("default"), E;
3261
- }), h = _(() => m.value ? !0 : Object.values(p.value).some((E) => E.length > 0)), g = (E, w) => u.value ? u.value.slotName && u.value.slotName !== w ? [] : T(u.value, E) : [], P = (E, w) => {
3262
- e.nodeRuntimeProps && (e.nodeRuntimeProps[E] = { ...e.nodeRuntimeProps[E] || {}, ...w });
3263
- }, { eventHandlers: A } = je(
3286
+ const g = [], y = s?.value?.resolveNode?.(r.value)?.slots;
3287
+ return y && y.length > 0 ? g.push(...y) : g.push("default"), g;
3288
+ }), h = C(() => m.value ? !0 : Object.values(d.value).some((g) => g.length > 0)), b = (g, w) => u.value ? u.value.slotName && u.value.slotName !== w ? [] : _(u.value, g) : [], P = (g, w) => {
3289
+ e.nodeRuntimeProps && (e.nodeRuntimeProps[g] = { ...e.nodeRuntimeProps[g] || {}, ...w });
3290
+ }, { eventHandlers: A } = Be(
3264
3291
  r,
3265
3292
  e.eventsContext || {},
3266
3293
  {
3267
3294
  getNodes: () => Object.fromEntries(n.value.entries()),
3268
- getNode: (E) => n.value.get(E) ?? null,
3295
+ getNode: (g) => n.value.get(g) ?? null,
3269
3296
  nodeValues: e.nodeRuntimeProps,
3270
3297
  setNodeProps: P,
3271
3298
  state: e.pageState
3272
3299
  }
3273
- ), C = _(() => ({
3300
+ ), T = C(() => ({
3274
3301
  ...i.value,
3275
3302
  ...e.nodeRuntimeProps?.[r.value.uuid] || {}
3276
- })), b = _(() => {
3277
- const E = (w, y) => (...x) => {
3278
- y(...x), A.value[w]?.(...x);
3303
+ })), U = C(() => {
3304
+ const g = (w, y) => (...N) => {
3305
+ y(...N), A.value[w]?.(...N);
3279
3306
  };
3280
3307
  return {
3281
3308
  ...A.value,
3282
- input: E("input", (w) => P(r.value.uuid, { value: w?.target?.value })),
3283
- change: E("change", (w) => P(r.value.uuid, { value: w?.target?.value })),
3284
- "update:modelValue": E("update:modelValue", (w) => P(r.value.uuid, { value: w }))
3309
+ input: g("input", (w) => P(r.value.uuid, { value: w?.target?.value })),
3310
+ change: g("change", (w) => P(r.value.uuid, { value: w?.target?.value })),
3311
+ "update:modelValue": g("update:modelValue", (w) => P(r.value.uuid, { value: w }))
3285
3312
  };
3286
- }), T = (E, w) => E.type === "single" ? w.map((y) => ({
3313
+ }), _ = (g, w) => g.type === "single" ? w.map((y) => ({
3287
3314
  key: `${y.uuid}-single`,
3288
3315
  craftNode: {
3289
3316
  ...y,
3290
3317
  props: {
3291
3318
  ...y.props,
3292
- ...E.item || {}
3319
+ ...g.item || {}
3293
3320
  }
3294
3321
  },
3295
- dataItem: E.item || {}
3296
- })) : E.type === "list" ? E.list ? w.reduce((y, x) => y.concat(
3322
+ dataItem: g.item || {}
3323
+ })) : g.type === "list" ? g.list ? w.reduce((y, N) => y.concat(
3297
3324
  //@ts-ignore
3298
- E.list.map((k, L) => ({
3299
- key: `${x.uuid}-data-${L}`,
3325
+ g.list.map((S, I) => ({
3326
+ key: `${N.uuid}-data-${I}`,
3300
3327
  craftNode: {
3301
- ...x,
3328
+ ...N,
3302
3329
  props: {
3303
- ...x.props,
3304
- ...k || {}
3330
+ ...N.props,
3331
+ ...S || {}
3305
3332
  }
3306
3333
  },
3307
- dataItem: k || {}
3334
+ dataItem: S || {}
3308
3335
  }))
3309
3336
  ), []) : [] : [];
3310
- return (E, w) => (d(r).visible || d(r).visible === void 0) && d(s) && d(o) ? (v(), $(Ce(d(a)), xe({
3337
+ return (g, w) => (p(r).visible || p(r).visible === void 0) && p(s) && p(o) ? (v(), M(Ce(p(a)), Se({
3311
3338
  key: 0,
3312
3339
  ref: "nodeRef"
3313
- }, C.value, Te(b.value)), Ne({ _: 2 }, [
3314
- U(f.value, (y) => ({
3340
+ }, T.value, Ue(U.value)), Ne({ _: 2 }, [
3341
+ j(f.value, (y) => ({
3315
3342
  name: y,
3316
- fn: G((x) => [
3317
- u.value?.type ? (v(!0), N(j, { key: 1 }, U(g(p.value[y], y), (k) => (v(), $(Me, {
3318
- key: k.key,
3319
- craftNode: k.craftNode,
3320
- nodeMap: d(n),
3343
+ fn: G((N) => [
3344
+ u.value?.type ? (v(!0), E(B, { key: 1 }, j(b(d.value[y], y), (S) => (v(), M($e, {
3345
+ key: S.key,
3346
+ craftNode: S.craftNode,
3347
+ nodeMap: p(n),
3321
3348
  nodeDataMap: t.nodeDataMap,
3322
3349
  eventsContext: t.eventsContext,
3323
3350
  nodeRuntimeProps: t.nodeRuntimeProps,
3324
3351
  pageState: t.pageState,
3325
- context: l(y, x, k.dataItem)
3326
- }, null, 8, ["craftNode", "nodeMap", "nodeDataMap", "eventsContext", "nodeRuntimeProps", "pageState", "context"]))), 128)) : (v(!0), N(j, { key: 0 }, U(p.value[y], (k) => (v(), $(Me, {
3327
- key: k.uuid,
3328
- craftNode: k,
3329
- nodeMap: d(n),
3352
+ context: l(y, N, S.dataItem)
3353
+ }, null, 8, ["craftNode", "nodeMap", "nodeDataMap", "eventsContext", "nodeRuntimeProps", "pageState", "context"]))), 128)) : (v(!0), E(B, { key: 0 }, j(d.value[y], (S) => (v(), M($e, {
3354
+ key: S.uuid,
3355
+ craftNode: S,
3356
+ nodeMap: p(n),
3330
3357
  nodeDataMap: t.nodeDataMap,
3331
3358
  eventsContext: t.eventsContext,
3332
3359
  nodeRuntimeProps: t.nodeRuntimeProps,
3333
3360
  pageState: t.pageState,
3334
- context: l(y, x)
3361
+ context: l(y, N)
3335
3362
  }, null, 8, ["craftNode", "nodeMap", "nodeDataMap", "eventsContext", "nodeRuntimeProps", "pageState", "context"]))), 128))
3336
3363
  ])
3337
3364
  }))
3338
- ]), 1040)) : M("", !0);
3365
+ ]), 1040)) : R("", !0);
3339
3366
  }
3340
- }), vn = /* @__PURE__ */ B({
3367
+ }), mn = /* @__PURE__ */ L({
3341
3368
  name: "CraftStaticRenderer",
3342
3369
  __name: "CraftStaticRenderer",
3343
3370
  props: {
@@ -3349,18 +3376,18 @@ Error:`,
3349
3376
  },
3350
3377
  setup(t) {
3351
3378
  const e = t, r = (i, l) => {
3352
- l.set(i.uuid, i), Object.entries(i.slots).forEach(([u, p]) => {
3353
- p?.forEach && p.forEach((m) => r(m, l));
3379
+ l.set(i.uuid, i), Object.entries(i.slots).forEach(([u, d]) => {
3380
+ d?.forEach && d.forEach((m) => r(m, l));
3354
3381
  });
3355
- }, n = _(() => {
3382
+ }, n = C(() => {
3356
3383
  const i = /* @__PURE__ */ new Map();
3357
3384
  return e.nodes.forEach((l) => r(l, i)), i;
3358
- }), o = _(
3385
+ }), o = C(
3359
3386
  () => e.resolver || new Oe(e.resolverMap)
3360
3387
  );
3361
3388
  te("resolver", o), te("nodeDataMap", e.nodeDataMap || {}), te("eventsContext", e.eventsContext || {});
3362
3389
  const s = He({}), a = He({});
3363
- return (i, l) => (v(!0), N(j, null, U(t.nodes, (u) => (v(), $(Me, {
3390
+ return (i, l) => (v(!0), E(B, null, j(t.nodes, (u) => (v(), M($e, {
3364
3391
  key: u.uuid,
3365
3392
  craftNode: u,
3366
3393
  nodeMap: n.value,
@@ -3372,27 +3399,27 @@ Error:`,
3372
3399
  }
3373
3400
  }), Ye = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3374
3401
  __proto__: null,
3375
- CraftCanvas: Yt,
3376
- CraftComponentSimpleText: Jt,
3377
- CraftEditor: er,
3378
- CraftEditorBlueprint: tr,
3379
- CraftEditorBlueprintsList: ir,
3380
- CraftEditorPanelBlueprints: dr,
3381
- CraftEditorPanelForm: pr,
3382
- CraftEditorPanelLayers: gr,
3383
- CraftEditorPanelLayout: Pr,
3384
- CraftEditorPanelNodeDataSourceSettings: wr,
3385
- CraftEditorPanelNodeEventsSettings: Dr,
3386
- CraftEditorPanelNodeLayer: Ir,
3387
- CraftEditorPanelNodeSettings: Ur,
3388
- CraftEditorPanelNodeSlotPropsSettings: zr,
3389
- CraftEditorPanelSettings: tn,
3390
- CraftFrame: sn,
3402
+ CraftCanvas: Qt,
3403
+ CraftComponentSimpleText: er,
3404
+ CraftEditor: tr,
3405
+ CraftEditorBlueprint: rr,
3406
+ CraftEditorBlueprintsList: lr,
3407
+ CraftEditorPanelBlueprints: pr,
3408
+ CraftEditorPanelForm: fr,
3409
+ CraftEditorPanelLayers: yr,
3410
+ CraftEditorPanelLayout: Sr,
3411
+ CraftEditorPanelNodeDataSourceSettings: kr,
3412
+ CraftEditorPanelNodeEventsSettings: Ar,
3413
+ CraftEditorPanelNodeLayer: Tr,
3414
+ CraftEditorPanelNodeSettings: jr,
3415
+ CraftEditorPanelNodeSlotPropsSettings: qr,
3416
+ CraftEditorPanelSettings: rn,
3417
+ CraftFrame: an,
3391
3418
  CraftIframe: it,
3392
- CraftNodeEditor: hn,
3393
- CraftNodeViewer: Re,
3394
- CraftStaticRenderer: vn,
3395
- Utils: rr
3419
+ CraftNodeEditor: vn,
3420
+ CraftNodeViewer: Me,
3421
+ CraftStaticRenderer: mn,
3422
+ Utils: nr
3396
3423
  }, Symbol.toStringTag, { value: "Module" })), xn = {
3397
3424
  metadata: {
3398
3425
  name: "default"
@@ -3409,7 +3436,7 @@ Error:`,
3409
3436
  }
3410
3437
  }
3411
3438
  };
3412
- function Sn() {
3439
+ function On() {
3413
3440
  const t = K(null);
3414
3441
  return { nodeEl: t, vNodeEl: {
3415
3442
  mounted(r) {
@@ -3423,27 +3450,27 @@ function Sn() {
3423
3450
  }
3424
3451
  } };
3425
3452
  }
3426
- const On = (t, e, r) => {
3453
+ const wn = (t, e, r) => {
3427
3454
  const n = {
3428
3455
  type: e.type,
3429
3456
  item: e.type === "single" ? {} : void 0,
3430
3457
  list: e.type === "list" ? [] : void 0
3431
3458
  }, o = (a, i) => {
3432
3459
  let l = a;
3433
- return i.patchSource === "value" ? i.value ?? i.defaultValue ?? null : (i.patchSource === "child" && (l = r), (i.type === "single" ? D({ path: i.fromPath, json: l, resultType: "value" }) : D({ path: i.fromPath, json: l })) ?? i.defaultValue ?? null);
3434
- }, s = e.type === "single" ? D({ path: e.fromPath, json: t, resultType: "value" }) : D({ path: e.fromPath, json: t });
3460
+ return i.patchSource === "value" ? i.value ?? i.defaultValue ?? null : (i.patchSource === "child" && (l = r), (i.type === "single" ? k({ path: i.fromPath, json: l, resultType: "value" }) : k({ path: i.fromPath, json: l })) ?? i.defaultValue ?? null);
3461
+ }, s = e.type === "single" ? k({ path: e.fromPath, json: t, resultType: "value" }) : k({ path: e.fromPath, json: t });
3435
3462
  return e.type === "single" ? e.patches.forEach((a) => {
3436
3463
  const i = o(s, a);
3437
- De(n.item, a.toPath, i);
3464
+ Ae(n.item, a.toPath, i);
3438
3465
  }) : e.type === "list" && (n.list = s.map((a) => {
3439
3466
  const i = {};
3440
3467
  return e.patches.forEach((l) => {
3441
3468
  const u = o(a, l);
3442
- De(i, l.toPath, u);
3469
+ Ae(i, l.toPath, u);
3443
3470
  }), i;
3444
3471
  })), n;
3445
3472
  };
3446
- function mn(t, e) {
3473
+ function gn(t, e) {
3447
3474
  const r = {};
3448
3475
  return !t.events || !Object.keys(t.events).length || Object.entries(t.events).forEach(([n, o]) => {
3449
3476
  o?.trim() && (r[n] = (...s) => {
@@ -3466,7 +3493,7 @@ Error:`,
3466
3493
  });
3467
3494
  }), r;
3468
3495
  }
3469
- function gn(t, e, r = "default") {
3496
+ function yn(t, e, r = "default") {
3470
3497
  if (!t.slots || !t.slots[r]) return [];
3471
3498
  const n = t.slots[r];
3472
3499
  return e.type === "single" ? n.map((o) => ({
@@ -3481,20 +3508,20 @@ function gn(t, e, r = "default") {
3481
3508
  }))
3482
3509
  ) : [];
3483
3510
  }
3484
- function $e(t, e, r, n, o) {
3511
+ function Ie(t, e, r, n, o) {
3485
3512
  if (!tt(t))
3486
3513
  return null;
3487
3514
  const s = e.resolveNode(t), a = s?.componentName || t.componentName, i = r?.[a] || a, l = {
3488
3515
  ...s?.defaultProps || {},
3489
3516
  ...t.props
3490
- }, u = o ? mn(t, o) : {}, p = n?.[t.uuid];
3517
+ }, u = o ? gn(t, o) : {}, d = n?.[t.uuid];
3491
3518
  let m;
3492
- return p?.type ? m = gn(
3519
+ return d?.type ? m = yn(
3493
3520
  t,
3494
- p,
3495
- p.slotName || "default"
3521
+ d,
3522
+ d.slotName || "default"
3496
3523
  ).map(
3497
- (h) => $e(
3524
+ (h) => Ie(
3498
3525
  h,
3499
3526
  e,
3500
3527
  r,
@@ -3502,7 +3529,7 @@ function $e(t, e, r, n, o) {
3502
3529
  o
3503
3530
  )
3504
3531
  ).filter((h) => h !== null) : t.slots && (m = Object.values(t.slots).flat().map(
3505
- (f) => $e(
3532
+ (f) => Ie(
3506
3533
  f,
3507
3534
  e,
3508
3535
  r,
@@ -3511,10 +3538,10 @@ function $e(t, e, r, n, o) {
3511
3538
  )
3512
3539
  ).filter((f) => f !== null)), Dt(i, { key: t.uuid, ...l, ...u }, m);
3513
3540
  }
3514
- function wn(t, e) {
3541
+ function kn(t, e) {
3515
3542
  const r = new Oe(e.resolverMap);
3516
3543
  return t.map(
3517
- (n) => $e(
3544
+ (n) => Ie(
3518
3545
  n,
3519
3546
  r,
3520
3547
  e.componentRegistry,
@@ -3523,7 +3550,7 @@ function wn(t, e) {
3523
3550
  )
3524
3551
  ).filter((n) => n !== null);
3525
3552
  }
3526
- const kn = {
3553
+ const Dn = {
3527
3554
  CraftComponentSimpleText: {
3528
3555
  componentName: "CraftComponentSimpleText",
3529
3556
  eventsSchema: {
@@ -3569,55 +3596,55 @@ const kn = {
3569
3596
  CraftCanvas: {
3570
3597
  componentName: "CraftCanvas"
3571
3598
  }
3572
- }, yn = (t) => {
3599
+ }, bn = (t) => {
3573
3600
  for (const e in Ye)
3574
3601
  t.component(e, Ye[e]);
3575
- }, Dn = { install: yn };
3602
+ }, An = { install: bn };
3576
3603
  export {
3577
- Yt as CraftCanvas,
3578
- Jt as CraftComponentSimpleText,
3579
- er as CraftEditor,
3580
- tr as CraftEditorBlueprint,
3581
- ir as CraftEditorBlueprintsList,
3582
- dr as CraftEditorPanelBlueprints,
3583
- pr as CraftEditorPanelForm,
3584
- gr as CraftEditorPanelLayers,
3585
- Pr as CraftEditorPanelLayout,
3586
- wr as CraftEditorPanelNodeDataSourceSettings,
3587
- Dr as CraftEditorPanelNodeEventsSettings,
3588
- Ir as CraftEditorPanelNodeLayer,
3589
- Ur as CraftEditorPanelNodeSettings,
3590
- zr as CraftEditorPanelNodeSlotPropsSettings,
3591
- tn as CraftEditorPanelSettings,
3592
- sn as CraftFrame,
3604
+ Qt as CraftCanvas,
3605
+ er as CraftComponentSimpleText,
3606
+ tr as CraftEditor,
3607
+ rr as CraftEditorBlueprint,
3608
+ lr as CraftEditorBlueprintsList,
3609
+ pr as CraftEditorPanelBlueprints,
3610
+ fr as CraftEditorPanelForm,
3611
+ yr as CraftEditorPanelLayers,
3612
+ Sr as CraftEditorPanelLayout,
3613
+ kr as CraftEditorPanelNodeDataSourceSettings,
3614
+ Ar as CraftEditorPanelNodeEventsSettings,
3615
+ Tr as CraftEditorPanelNodeLayer,
3616
+ jr as CraftEditorPanelNodeSettings,
3617
+ qr as CraftEditorPanelNodeSlotPropsSettings,
3618
+ rn as CraftEditorPanelSettings,
3619
+ an as CraftFrame,
3593
3620
  it as CraftIframe,
3594
- hn as CraftNodeEditor,
3621
+ vn as CraftNodeEditor,
3595
3622
  Oe as CraftNodeResolver,
3596
- Re as CraftNodeViewer,
3597
- vn as CraftStaticRenderer,
3598
- rr as Utils,
3599
- Dn as VCraft,
3623
+ Me as CraftNodeViewer,
3624
+ mn as CraftStaticRenderer,
3625
+ nr as Utils,
3626
+ An as VCraft,
3600
3627
  nt as buildCraftNodeTree,
3601
3628
  me as craftNodeCanBeChildOf,
3602
- Pe as craftNodeCanBeSiblingOf,
3603
- Gt as craftNodeInCanvas,
3629
+ _e as craftNodeCanBeSiblingOf,
3630
+ Wt as craftNodeInCanvas,
3604
3631
  rt as craftNodeIsAncestorOf,
3605
3632
  W as craftNodeIsCanvas,
3606
- Wt as craftNodeIsDraggable,
3633
+ Zt as craftNodeIsDraggable,
3607
3634
  xn as defaultBlueprints,
3608
- kn as defaultResolvers,
3635
+ Dn as defaultResolvers,
3609
3636
  ot as initializeSlotsFromResolver,
3610
3637
  tt as isVisible,
3611
- On as mapData,
3612
- $e as renderCraftNodeToVNode,
3613
- wn as renderCraftNodesToVNodes,
3638
+ wn as mapData,
3639
+ Ie as renderCraftNodeToVNode,
3640
+ kn as renderCraftNodesToVNodes,
3614
3641
  ue as resolveNodeName,
3615
- Br as useAncestorContextBuckets,
3616
- Qt as useCraftNode,
3642
+ Lr as useAncestorContextBuckets,
3643
+ Gt as useCraftNode,
3617
3644
  q as useEditor,
3618
- Ue as useIndicator,
3619
- Sn as useNodeElement,
3620
- _e as useResolveCraftNode,
3621
- zt as useResolveCraftNodeProps
3645
+ je as useIndicator,
3646
+ On as useNodeElement,
3647
+ Pe as useResolveCraftNode,
3648
+ qt as useResolveCraftNodeProps
3622
3649
  };
3623
3650
  //# sourceMappingURL=v-craft.es.js.map