lone-format 0.2.1 → 0.3.0

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,5 +1,5 @@
1
- import { defineComponent as le, useCssVars as ce, ref as R, computed as T, resolveComponent as pe, createElementBlock as A, openBlock as w, createElementVNode as P, createCommentVNode as N, withDirectives as re, toDisplayString as $, withKeys as X, vModelText as ne, createTextVNode as ie, Fragment as ye, renderList as be, createVNode as ue, normalizeClass as de, nextTick as Z, watch as ge } from "vue";
2
- class Ee {
1
+ import { defineComponent as pe, useCssVars as ye, ref as H, computed as j, resolveComponent as _e, createElementBlock as C, openBlock as A, createElementVNode as B, createCommentVNode as I, withDirectives as le, toDisplayString as F, withKeys as q, vModelText as ce, createTextVNode as he, Fragment as xe, renderList as ke, createVNode as ge, normalizeClass as be, nextTick as ee, watch as Oe } from "vue";
2
+ class Ce {
3
3
  /**
4
4
  * @callback HookCallback
5
5
  * @this {*|Jsep} this
@@ -42,7 +42,7 @@ class Ee {
42
42
  });
43
43
  }
44
44
  }
45
- class me {
45
+ class Ae {
46
46
  constructor(e) {
47
47
  this.jsep = e, this.registered = {};
48
48
  }
@@ -351,7 +351,7 @@ class o {
351
351
  * @returns {?jsep.BinaryExpression}
352
352
  */
353
353
  gobbleBinaryExpression() {
354
- let e, t, s, n, a, c, f, d, h;
354
+ let e, t, s, n, a, c, f, h, d;
355
355
  if (c = this.gobbleToken(), !c || (t = this.gobbleBinaryOp(), !t))
356
356
  return c;
357
357
  for (a = {
@@ -367,24 +367,24 @@ class o {
367
367
  value: t,
368
368
  prec: s,
369
369
  right_a: o.right_associative.has(t)
370
- }, h = t;
371
- const v = (g) => a.right_a && g.right_a ? s > g.prec : s <= g.prec;
372
- for (; n.length > 2 && v(n[n.length - 2]); )
370
+ }, d = t;
371
+ const _ = (b) => a.right_a && b.right_a ? s > b.prec : s <= b.prec;
372
+ for (; n.length > 2 && _(n[n.length - 2]); )
373
373
  f = n.pop(), t = n.pop().value, c = n.pop(), e = {
374
374
  type: o.BINARY_EXP,
375
375
  operator: t,
376
376
  left: c,
377
377
  right: f
378
378
  }, n.push(e);
379
- e = this.gobbleToken(), e || this.throwError("Expected expression after " + h), n.push(a, e);
379
+ e = this.gobbleToken(), e || this.throwError("Expected expression after " + d), n.push(a, e);
380
380
  }
381
- for (d = n.length - 1, e = n[d]; d > 1; )
381
+ for (h = n.length - 1, e = n[h]; h > 1; )
382
382
  e = {
383
383
  type: o.BINARY_EXP,
384
- operator: n[d - 1].value,
385
- left: n[d - 2],
384
+ operator: n[h - 1].value,
385
+ left: n[h - 2],
386
386
  right: e
387
- }, d -= 2;
387
+ }, h -= 2;
388
388
  return e;
389
389
  }
390
390
  /**
@@ -615,10 +615,10 @@ class o {
615
615
  };
616
616
  }
617
617
  }
618
- const ve = new Ee();
618
+ const we = new Ce();
619
619
  Object.assign(o, {
620
- hooks: ve,
621
- plugins: new me(o),
620
+ hooks: we,
621
+ plugins: new Ae(o),
622
622
  // Node Types
623
623
  // ----------
624
624
  // This is the full set of types that any JSEP node can be.
@@ -714,14 +714,14 @@ Object.assign(o, {
714
714
  });
715
715
  o.max_unop_len = o.getMaxKeyLen(o.unary_ops);
716
716
  o.max_binop_len = o.getMaxKeyLen(o.binary_ops);
717
- const L = (r) => new o(r).parse(), _e = Object.getOwnPropertyNames(class {
717
+ const K = (r) => new o(r).parse(), Se = Object.getOwnPropertyNames(class {
718
718
  });
719
- Object.getOwnPropertyNames(o).filter((r) => !_e.includes(r) && L[r] === void 0).forEach((r) => {
720
- L[r] = o[r];
719
+ Object.getOwnPropertyNames(o).filter((r) => !Se.includes(r) && K[r] === void 0).forEach((r) => {
720
+ K[r] = o[r];
721
721
  });
722
- L.Jsep = o;
723
- const xe = "ConditionalExpression";
724
- var ke = {
722
+ K.Jsep = o;
723
+ const Pe = "ConditionalExpression";
724
+ var Ne = {
725
725
  name: "ternary",
726
726
  init(r) {
727
727
  r.hooks.add("after-expression", function(t) {
@@ -732,7 +732,7 @@ var ke = {
732
732
  this.index++;
733
733
  const a = this.gobbleExpression();
734
734
  if (a || this.throwError("Expected expression"), t.node = {
735
- type: xe,
735
+ type: Pe,
736
736
  test: s,
737
737
  consequent: n,
738
738
  alternate: a
@@ -748,22 +748,22 @@ var ke = {
748
748
  });
749
749
  }
750
750
  };
751
- L.plugins.register(ke);
752
- const ae = 47, Oe = 92;
753
- var Ce = {
751
+ K.plugins.register(Ne);
752
+ const fe = 47, Te = 92;
753
+ var Be = {
754
754
  name: "regex",
755
755
  init(r) {
756
756
  r.hooks.add("gobble-token", function(t) {
757
- if (this.code === ae) {
757
+ if (this.code === fe) {
758
758
  const s = ++this.index;
759
759
  let n = !1;
760
760
  for (; this.index < this.expr.length; ) {
761
- if (this.code === ae && !n) {
761
+ if (this.code === fe && !n) {
762
762
  const a = this.expr.slice(s, this.index);
763
763
  let c = "";
764
764
  for (; ++this.index < this.expr.length; ) {
765
- const d = this.code;
766
- if (d >= 97 && d <= 122 || d >= 65 && d <= 90 || d >= 48 && d <= 57)
765
+ const h = this.code;
766
+ if (h >= 97 && h <= 122 || h >= 65 && h <= 90 || h >= 48 && h <= 57)
767
767
  c += this.char;
768
768
  else
769
769
  break;
@@ -771,8 +771,8 @@ var Ce = {
771
771
  let f;
772
772
  try {
773
773
  f = new RegExp(a, c);
774
- } catch (d) {
775
- this.throwError(d.message);
774
+ } catch (h) {
775
+ this.throwError(h.message);
776
776
  }
777
777
  return t.node = {
778
778
  type: r.LITERAL,
@@ -780,34 +780,34 @@ var Ce = {
780
780
  raw: this.expr.slice(s - 1, this.index)
781
781
  }, t.node = this.gobbleTokenProperty(t.node), t.node;
782
782
  }
783
- this.code === r.OBRACK_CODE ? n = !0 : n && this.code === r.CBRACK_CODE && (n = !1), this.index += this.code === Oe ? 2 : 1;
783
+ this.code === r.OBRACK_CODE ? n = !0 : n && this.code === r.CBRACK_CODE && (n = !1), this.index += this.code === Te ? 2 : 1;
784
784
  }
785
785
  this.throwError("Unclosed Regex");
786
786
  }
787
787
  });
788
788
  }
789
789
  };
790
- const se = 43, Ae = 45, G = {
790
+ const ue = 43, De = 45, z = {
791
791
  name: "assignment",
792
792
  assignmentOperators: /* @__PURE__ */ new Set(["=", "*=", "**=", "/=", "%=", "+=", "-=", "<<=", ">>=", ">>>=", "&=", "^=", "|=", "||=", "&&=", "??="]),
793
- updateOperators: [se, Ae],
793
+ updateOperators: [ue, De],
794
794
  assignmentPrecedence: 0.9,
795
795
  init(r) {
796
796
  const e = [r.IDENTIFIER, r.MEMBER_EXP];
797
- G.assignmentOperators.forEach((s) => r.addBinaryOp(s, G.assignmentPrecedence, !0)), r.hooks.add("gobble-token", function(n) {
797
+ z.assignmentOperators.forEach((s) => r.addBinaryOp(s, z.assignmentPrecedence, !0)), r.hooks.add("gobble-token", function(n) {
798
798
  const a = this.code;
799
- G.updateOperators.some((c) => c === a && c === this.expr.charCodeAt(this.index + 1)) && (this.index += 2, n.node = {
799
+ z.updateOperators.some((c) => c === a && c === this.expr.charCodeAt(this.index + 1)) && (this.index += 2, n.node = {
800
800
  type: "UpdateExpression",
801
- operator: a === se ? "++" : "--",
801
+ operator: a === ue ? "++" : "--",
802
802
  argument: this.gobbleTokenProperty(this.gobbleIdentifier()),
803
803
  prefix: !0
804
804
  }, (!n.node.argument || !e.includes(n.node.argument.type)) && this.throwError(`Unexpected ${n.node.operator}`));
805
805
  }), r.hooks.add("after-token", function(n) {
806
806
  if (n.node) {
807
807
  const a = this.code;
808
- G.updateOperators.some((c) => c === a && c === this.expr.charCodeAt(this.index + 1)) && (e.includes(n.node.type) || this.throwError(`Unexpected ${n.node.operator}`), this.index += 2, n.node = {
808
+ z.updateOperators.some((c) => c === a && c === this.expr.charCodeAt(this.index + 1)) && (e.includes(n.node.type) || this.throwError(`Unexpected ${n.node.operator}`), this.index += 2, n.node = {
809
809
  type: "UpdateExpression",
810
- operator: a === se ? "++" : "--",
810
+ operator: a === ue ? "++" : "--",
811
811
  argument: n.node,
812
812
  prefix: !1
813
813
  });
@@ -816,17 +816,17 @@ const se = 43, Ae = 45, G = {
816
816
  n.node && t(n.node);
817
817
  });
818
818
  function t(s) {
819
- G.assignmentOperators.has(s.operator) ? (s.type = "AssignmentExpression", t(s.left), t(s.right)) : s.operator || Object.values(s).forEach((n) => {
819
+ z.assignmentOperators.has(s.operator) ? (s.type = "AssignmentExpression", t(s.left), t(s.right)) : s.operator || Object.values(s).forEach((n) => {
820
820
  n && typeof n == "object" && t(n);
821
821
  });
822
822
  }
823
823
  }
824
824
  };
825
- L.plugins.register(Ce, G);
826
- L.addUnaryOp("typeof");
827
- L.addLiteral("null", null);
828
- L.addLiteral("undefined", void 0);
829
- const we = /* @__PURE__ */ new Set(["constructor", "__proto__", "__defineGetter__", "__defineSetter__"]), O = {
825
+ K.plugins.register(Be, z);
826
+ K.addUnaryOp("typeof");
827
+ K.addLiteral("null", null);
828
+ K.addLiteral("undefined", void 0);
829
+ const Ie = /* @__PURE__ */ new Set(["constructor", "__proto__", "__defineGetter__", "__defineSetter__"]), O = {
830
830
  /**
831
831
  * @param {jsep.Expression} ast
832
832
  * @param {Record<string, any>} subs
@@ -915,7 +915,7 @@ const we = /* @__PURE__ */ new Set(["constructor", "__proto__", "__defineGetter_
915
915
  ), s = O.evalAst(r.object, e);
916
916
  if (s == null)
917
917
  throw TypeError(`Cannot read properties of ${s} (reading '${t}')`);
918
- if (!Object.hasOwn(s, t) && we.has(t))
918
+ if (!Object.hasOwn(s, t) && Ie.has(t))
919
919
  throw TypeError(`Cannot read properties of ${s} (reading '${t}')`);
920
920
  const n = s[t];
921
921
  return typeof n == "function" ? n.bind(s) : n;
@@ -944,12 +944,12 @@ const we = /* @__PURE__ */ new Set(["constructor", "__proto__", "__defineGetter_
944
944
  return e[t] = s, e[t];
945
945
  }
946
946
  };
947
- class Se {
947
+ class je {
948
948
  /**
949
949
  * @param {string} expr Expression to evaluate
950
950
  */
951
951
  constructor(e) {
952
- this.code = e, this.ast = L(this.code);
952
+ this.code = e, this.ast = K(this.code);
953
953
  }
954
954
  /**
955
955
  * @param {object} context Object whose items will be added
@@ -961,13 +961,13 @@ class Se {
961
961
  return O.evalAst(this.ast, t);
962
962
  }
963
963
  }
964
- function M(r, e) {
964
+ function G(r, e) {
965
965
  return r = r.slice(), r.push(e), r;
966
966
  }
967
- function oe(r, e) {
967
+ function de(r, e) {
968
968
  return e = e.slice(), e.unshift(r), e;
969
969
  }
970
- class Pe extends Error {
970
+ class $e extends Error {
971
971
  /**
972
972
  * @param {AnyResult} value The evaluated scalar value
973
973
  */
@@ -975,10 +975,10 @@ class Pe extends Error {
975
975
  super('JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)'), this.avoidNew = !0, this.value = e, this.name = "NewError";
976
976
  }
977
977
  }
978
- function x(r, e, t, s, n) {
979
- if (!(this instanceof x))
978
+ function k(r, e, t, s, n) {
979
+ if (!(this instanceof k))
980
980
  try {
981
- return new x(r, e, t, s, n);
981
+ return new k(r, e, t, s, n);
982
982
  } catch (c) {
983
983
  if (!c.avoidNew)
984
984
  throw c;
@@ -995,11 +995,11 @@ function x(r, e, t, s, n) {
995
995
  a ? "json" in r && (c.json = r.json) : c.json = t;
996
996
  const f = this.evaluate(c);
997
997
  if (!f || typeof f != "object")
998
- throw new Pe(f);
998
+ throw new $e(f);
999
999
  return f;
1000
1000
  }
1001
1001
  }
1002
- x.prototype.evaluate = function(r, e, t, s) {
1002
+ k.prototype.evaluate = function(r, e, t, s) {
1003
1003
  let n = this.parent, a = this.parentProperty, {
1004
1004
  flatten: c,
1005
1005
  wrap: f
@@ -1013,172 +1013,172 @@ x.prototype.evaluate = function(r, e, t, s) {
1013
1013
  json: e
1014
1014
  } = r), c = Object.hasOwn(r, "flatten") ? r.flatten : c, this.currResultType = Object.hasOwn(r, "resultType") ? r.resultType : this.currResultType, this.currSandbox = Object.hasOwn(r, "sandbox") ? r.sandbox : this.currSandbox, f = Object.hasOwn(r, "wrap") ? r.wrap : f, this.currEval = Object.hasOwn(r, "eval") ? r.eval : this.currEval, t = Object.hasOwn(r, "callback") ? r.callback : t, this.currOtherTypeCallback = Object.hasOwn(r, "otherTypeCallback") ? r.otherTypeCallback : this.currOtherTypeCallback, n = Object.hasOwn(r, "parent") ? r.parent : n, a = Object.hasOwn(r, "parentProperty") ? r.parentProperty : a, r = r.path;
1015
1015
  }
1016
- if (n = n || null, a = a || null, Array.isArray(r) && (r = x.toPathString(r)), !r && r !== "" || !e)
1016
+ if (n = n || null, a = a || null, Array.isArray(r) && (r = k.toPathString(r)), !r && r !== "" || !e)
1017
1017
  return;
1018
- const d = x.toPathArray(r);
1019
- d[0] === "$" && d.length > 1 && d.shift(), this._hasParentSelector = null;
1020
- const h = this._trace(d, e, ["$"], n, a, t).filter(function(v) {
1021
- return v && !v.isParentSelector;
1018
+ const h = k.toPathArray(r);
1019
+ h[0] === "$" && h.length > 1 && h.shift(), this._hasParentSelector = null;
1020
+ const d = this._trace(h, e, ["$"], n, a, t).filter(function(_) {
1021
+ return _ && !_.isParentSelector;
1022
1022
  });
1023
- return h.length ? !f && h.length === 1 && !h[0].hasArrExpr ? this._getPreferredOutput(h[0]) : h.reduce((v, g) => {
1024
- const k = this._getPreferredOutput(g);
1025
- return c && Array.isArray(k) ? v = v.concat(k) : v.push(k), v;
1023
+ return d.length ? !f && d.length === 1 && !d[0].hasArrExpr ? this._getPreferredOutput(d[0]) : d.reduce((_, b) => {
1024
+ const x = this._getPreferredOutput(b);
1025
+ return c && Array.isArray(x) ? _ = _.concat(x) : _.push(x), _;
1026
1026
  }, []) : f ? [] : void 0;
1027
1027
  };
1028
- x.prototype._getPreferredOutput = function(r) {
1028
+ k.prototype._getPreferredOutput = function(r) {
1029
1029
  const e = this.currResultType;
1030
1030
  switch (e) {
1031
1031
  case "all": {
1032
- const t = Array.isArray(r.path) ? r.path : x.toPathArray(r.path);
1033
- return r.pointer = x.toPointer(t), r.path = typeof r.path == "string" ? r.path : x.toPathString(r.path), r;
1032
+ const t = Array.isArray(r.path) ? r.path : k.toPathArray(r.path);
1033
+ return r.pointer = k.toPointer(t), r.path = typeof r.path == "string" ? r.path : k.toPathString(r.path), r;
1034
1034
  }
1035
1035
  case "value":
1036
1036
  case "parent":
1037
1037
  case "parentProperty":
1038
1038
  return r[e];
1039
1039
  case "path":
1040
- return x.toPathString(r[e]);
1040
+ return k.toPathString(r[e]);
1041
1041
  case "pointer":
1042
- return x.toPointer(r.path);
1042
+ return k.toPointer(r.path);
1043
1043
  default:
1044
1044
  throw new TypeError("Unknown result type");
1045
1045
  }
1046
1046
  };
1047
- x.prototype._handleCallback = function(r, e, t) {
1047
+ k.prototype._handleCallback = function(r, e, t) {
1048
1048
  if (e) {
1049
1049
  const s = this._getPreferredOutput(r);
1050
- r.path = typeof r.path == "string" ? r.path : x.toPathString(r.path), e(s, t, r);
1050
+ r.path = typeof r.path == "string" ? r.path : k.toPathString(r.path), e(s, t, r);
1051
1051
  }
1052
1052
  };
1053
- x.prototype._trace = function(r, e, t, s, n, a, c, f) {
1054
- let d;
1053
+ k.prototype._trace = function(r, e, t, s, n, a, c, f) {
1054
+ let h;
1055
1055
  if (!r.length)
1056
- return d = {
1056
+ return h = {
1057
1057
  path: t,
1058
1058
  value: e,
1059
1059
  parent: s,
1060
1060
  parentProperty: n,
1061
1061
  hasArrExpr: c
1062
- }, this._handleCallback(d, a, "value"), d;
1063
- const h = r[0], v = r.slice(1), g = [];
1064
- function k(m) {
1065
- Array.isArray(m) ? m.forEach((S) => {
1066
- g.push(S);
1067
- }) : g.push(m);
1068
- }
1069
- if ((typeof h != "string" || f) && e && Object.hasOwn(e, h))
1070
- k(this._trace(v, e[h], M(t, h), e, h, a, c));
1071
- else if (h === "*")
1072
- this._walk(e, (m) => {
1073
- k(this._trace(v, e[m], M(t, m), e, m, a, !0, !0));
1062
+ }, this._handleCallback(h, a, "value"), h;
1063
+ const d = r[0], _ = r.slice(1), b = [];
1064
+ function x(g) {
1065
+ Array.isArray(g) ? g.forEach((w) => {
1066
+ b.push(w);
1067
+ }) : b.push(g);
1068
+ }
1069
+ if ((typeof d != "string" || f) && e && Object.hasOwn(e, d))
1070
+ x(this._trace(_, e[d], G(t, d), e, d, a, c));
1071
+ else if (d === "*")
1072
+ this._walk(e, (g) => {
1073
+ x(this._trace(_, e[g], G(t, g), e, g, a, !0, !0));
1074
1074
  });
1075
- else if (h === "..")
1076
- k(this._trace(v, e, t, s, n, a, c)), this._walk(e, (m) => {
1077
- typeof e[m] == "object" && k(this._trace(r.slice(), e[m], M(t, m), e, m, a, !0));
1075
+ else if (d === "..")
1076
+ x(this._trace(_, e, t, s, n, a, c)), this._walk(e, (g) => {
1077
+ typeof e[g] == "object" && x(this._trace(r.slice(), e[g], G(t, g), e, g, a, !0));
1078
1078
  });
1079
1079
  else {
1080
- if (h === "^")
1080
+ if (d === "^")
1081
1081
  return this._hasParentSelector = !0, {
1082
1082
  path: t.slice(0, -1),
1083
- expr: v,
1083
+ expr: _,
1084
1084
  isParentSelector: !0
1085
1085
  };
1086
- if (h === "~")
1087
- return d = {
1088
- path: M(t, h),
1086
+ if (d === "~")
1087
+ return h = {
1088
+ path: G(t, d),
1089
1089
  value: n,
1090
1090
  parent: s,
1091
1091
  parentProperty: null
1092
- }, this._handleCallback(d, a, "property"), d;
1093
- if (h === "$")
1094
- k(this._trace(v, e, t, null, null, a, c));
1095
- else if (/^(-?\d*):(-?\d*):?(\d*)$/u.test(h))
1096
- k(this._slice(h, v, e, t, s, n, a));
1097
- else if (h.indexOf("?(") === 0) {
1092
+ }, this._handleCallback(h, a, "property"), h;
1093
+ if (d === "$")
1094
+ x(this._trace(_, e, t, null, null, a, c));
1095
+ else if (/^(-?\d*):(-?\d*):?(\d*)$/u.test(d))
1096
+ x(this._slice(d, _, e, t, s, n, a));
1097
+ else if (d.indexOf("?(") === 0) {
1098
1098
  if (this.currEval === !1)
1099
1099
  throw new Error("Eval [?(expr)] prevented in JSONPath expression.");
1100
- const m = h.replace(/^\?\((.*?)\)$/u, "$1"), S = /@.?([^?]*)[['](\??\(.*?\))(?!.\)\])[\]']/gu.exec(m);
1101
- S ? this._walk(e, (C) => {
1102
- const U = [S[2]], D = S[1] ? e[C][S[1]] : e[C];
1103
- this._trace(U, D, t, s, n, a, !0).length > 0 && k(this._trace(v, e[C], M(t, C), e, C, a, !0));
1104
- }) : this._walk(e, (C) => {
1105
- this._eval(m, e[C], C, t, s, n) && k(this._trace(v, e[C], M(t, C), e, C, a, !0));
1100
+ const g = d.replace(/^\?\((.*?)\)$/u, "$1"), w = /@.?([^?]*)[['](\??\(.*?\))(?!.\)\])[\]']/gu.exec(g);
1101
+ w ? this._walk(e, (S) => {
1102
+ const M = [w[2]], $ = w[1] ? e[S][w[1]] : e[S];
1103
+ this._trace(M, $, t, s, n, a, !0).length > 0 && x(this._trace(_, e[S], G(t, S), e, S, a, !0));
1104
+ }) : this._walk(e, (S) => {
1105
+ this._eval(g, e[S], S, t, s, n) && x(this._trace(_, e[S], G(t, S), e, S, a, !0));
1106
1106
  });
1107
- } else if (h[0] === "(") {
1107
+ } else if (d[0] === "(") {
1108
1108
  if (this.currEval === !1)
1109
1109
  throw new Error("Eval [(expr)] prevented in JSONPath expression.");
1110
- k(this._trace(oe(this._eval(h, e, t.at(-1), t.slice(0, -1), s, n), v), e, t, s, n, a, c));
1111
- } else if (h[0] === "@") {
1112
- let m = !1;
1113
- const S = h.slice(1, -2);
1114
- switch (S) {
1110
+ x(this._trace(de(this._eval(d, e, t.at(-1), t.slice(0, -1), s, n), _), e, t, s, n, a, c));
1111
+ } else if (d[0] === "@") {
1112
+ let g = !1;
1113
+ const w = d.slice(1, -2);
1114
+ switch (w) {
1115
1115
  case "scalar":
1116
- (!e || !["object", "function"].includes(typeof e)) && (m = !0);
1116
+ (!e || !["object", "function"].includes(typeof e)) && (g = !0);
1117
1117
  break;
1118
1118
  case "boolean":
1119
1119
  case "string":
1120
1120
  case "undefined":
1121
1121
  case "function":
1122
- typeof e === S && (m = !0);
1122
+ typeof e === w && (g = !0);
1123
1123
  break;
1124
1124
  case "integer":
1125
- Number.isFinite(e) && !(e % 1) && (m = !0);
1125
+ Number.isFinite(e) && !(e % 1) && (g = !0);
1126
1126
  break;
1127
1127
  case "number":
1128
- Number.isFinite(e) && (m = !0);
1128
+ Number.isFinite(e) && (g = !0);
1129
1129
  break;
1130
1130
  case "nonFinite":
1131
- typeof e == "number" && !Number.isFinite(e) && (m = !0);
1131
+ typeof e == "number" && !Number.isFinite(e) && (g = !0);
1132
1132
  break;
1133
1133
  case "object":
1134
- e && typeof e === S && (m = !0);
1134
+ e && typeof e === w && (g = !0);
1135
1135
  break;
1136
1136
  case "array":
1137
- Array.isArray(e) && (m = !0);
1137
+ Array.isArray(e) && (g = !0);
1138
1138
  break;
1139
1139
  case "other":
1140
- m = this.currOtherTypeCallback(e, t, s, n);
1140
+ g = this.currOtherTypeCallback(e, t, s, n);
1141
1141
  break;
1142
1142
  case "null":
1143
- e === null && (m = !0);
1143
+ e === null && (g = !0);
1144
1144
  break;
1145
1145
  /* c8 ignore next 2 */
1146
1146
  default:
1147
- throw new TypeError("Unknown value type " + S);
1147
+ throw new TypeError("Unknown value type " + w);
1148
1148
  }
1149
- if (m)
1150
- return d = {
1149
+ if (g)
1150
+ return h = {
1151
1151
  path: t,
1152
1152
  value: e,
1153
1153
  parent: s,
1154
1154
  parentProperty: n
1155
- }, this._handleCallback(d, a, "value"), d;
1156
- } else if (h[0] === "`" && e && Object.hasOwn(e, h.slice(1))) {
1157
- const m = h.slice(1);
1158
- k(this._trace(v, e[m], M(t, m), e, m, a, c, !0));
1159
- } else if (h.includes(",")) {
1160
- const m = h.split(",");
1161
- for (const S of m)
1162
- k(this._trace(oe(S, v), e, t, s, n, a, !0));
1163
- } else !f && e && Object.hasOwn(e, h) && k(this._trace(v, e[h], M(t, h), e, h, a, c, !0));
1155
+ }, this._handleCallback(h, a, "value"), h;
1156
+ } else if (d[0] === "`" && e && Object.hasOwn(e, d.slice(1))) {
1157
+ const g = d.slice(1);
1158
+ x(this._trace(_, e[g], G(t, g), e, g, a, c, !0));
1159
+ } else if (d.includes(",")) {
1160
+ const g = d.split(",");
1161
+ for (const w of g)
1162
+ x(this._trace(de(w, _), e, t, s, n, a, !0));
1163
+ } else !f && e && Object.hasOwn(e, d) && x(this._trace(_, e[d], G(t, d), e, d, a, c, !0));
1164
1164
  }
1165
1165
  if (this._hasParentSelector)
1166
- for (let m = 0; m < g.length; m++) {
1167
- const S = g[m];
1168
- if (S && S.isParentSelector) {
1169
- const C = this._trace(S.expr, e, S.path, s, n, a, c);
1170
- if (Array.isArray(C)) {
1171
- g[m] = C[0];
1172
- const U = C.length;
1173
- for (let D = 1; D < U; D++)
1174
- m++, g.splice(m, 0, C[D]);
1166
+ for (let g = 0; g < b.length; g++) {
1167
+ const w = b[g];
1168
+ if (w && w.isParentSelector) {
1169
+ const S = this._trace(w.expr, e, w.path, s, n, a, c);
1170
+ if (Array.isArray(S)) {
1171
+ b[g] = S[0];
1172
+ const M = S.length;
1173
+ for (let $ = 1; $ < M; $++)
1174
+ g++, b.splice(g, 0, S[$]);
1175
1175
  } else
1176
- g[m] = C;
1176
+ b[g] = S;
1177
1177
  }
1178
1178
  }
1179
- return g;
1179
+ return b;
1180
1180
  };
1181
- x.prototype._walk = function(r, e) {
1181
+ k.prototype._walk = function(r, e) {
1182
1182
  if (Array.isArray(r)) {
1183
1183
  const t = r.length;
1184
1184
  for (let s = 0; s < t; s++)
@@ -1187,67 +1187,67 @@ x.prototype._walk = function(r, e) {
1187
1187
  e(t);
1188
1188
  });
1189
1189
  };
1190
- x.prototype._slice = function(r, e, t, s, n, a, c) {
1190
+ k.prototype._slice = function(r, e, t, s, n, a, c) {
1191
1191
  if (!Array.isArray(t))
1192
1192
  return;
1193
- const f = t.length, d = r.split(":"), h = d[2] && Number.parseInt(d[2]) || 1;
1194
- let v = d[0] && Number.parseInt(d[0]) || 0, g = d[1] && Number.parseInt(d[1]) || f;
1195
- v = v < 0 ? Math.max(0, v + f) : Math.min(f, v), g = g < 0 ? Math.max(0, g + f) : Math.min(f, g);
1196
- const k = [];
1197
- for (let m = v; m < g; m += h)
1198
- this._trace(oe(m, e), t, s, n, a, c, !0).forEach((C) => {
1199
- k.push(C);
1193
+ const f = t.length, h = r.split(":"), d = h[2] && Number.parseInt(h[2]) || 1;
1194
+ let _ = h[0] && Number.parseInt(h[0]) || 0, b = h[1] && Number.parseInt(h[1]) || f;
1195
+ _ = _ < 0 ? Math.max(0, _ + f) : Math.min(f, _), b = b < 0 ? Math.max(0, b + f) : Math.min(f, b);
1196
+ const x = [];
1197
+ for (let g = _; g < b; g += d)
1198
+ this._trace(de(g, e), t, s, n, a, c, !0).forEach((S) => {
1199
+ x.push(S);
1200
1200
  });
1201
- return k;
1201
+ return x;
1202
1202
  };
1203
- x.prototype._eval = function(r, e, t, s, n, a) {
1203
+ k.prototype._eval = function(r, e, t, s, n, a) {
1204
1204
  this.currSandbox._$_parentProperty = a, this.currSandbox._$_parent = n, this.currSandbox._$_property = t, this.currSandbox._$_root = this.json, this.currSandbox._$_v = e;
1205
1205
  const c = r.includes("@path");
1206
- c && (this.currSandbox._$_path = x.toPathString(s.concat([t])));
1206
+ c && (this.currSandbox._$_path = k.toPathString(s.concat([t])));
1207
1207
  const f = this.currEval + "Script:" + r;
1208
- if (!x.cache[f]) {
1209
- let d = r.replaceAll("@parentProperty", "_$_parentProperty").replaceAll("@parent", "_$_parent").replaceAll("@property", "_$_property").replaceAll("@root", "_$_root").replaceAll(/@([.\s)[])/gu, "_$_v$1");
1210
- if (c && (d = d.replaceAll("@path", "_$_path")), this.currEval === "safe" || this.currEval === !0 || this.currEval === void 0)
1211
- x.cache[f] = new this.safeVm.Script(d);
1208
+ if (!k.cache[f]) {
1209
+ let h = r.replaceAll("@parentProperty", "_$_parentProperty").replaceAll("@parent", "_$_parent").replaceAll("@property", "_$_property").replaceAll("@root", "_$_root").replaceAll(/@([.\s)[])/gu, "_$_v$1");
1210
+ if (c && (h = h.replaceAll("@path", "_$_path")), this.currEval === "safe" || this.currEval === !0 || this.currEval === void 0)
1211
+ k.cache[f] = new this.safeVm.Script(h);
1212
1212
  else if (this.currEval === "native")
1213
- x.cache[f] = new this.vm.Script(d);
1213
+ k.cache[f] = new this.vm.Script(h);
1214
1214
  else if (typeof this.currEval == "function" && this.currEval.prototype && Object.hasOwn(this.currEval.prototype, "runInNewContext")) {
1215
- const h = this.currEval;
1216
- x.cache[f] = new h(d);
1215
+ const d = this.currEval;
1216
+ k.cache[f] = new d(h);
1217
1217
  } else if (typeof this.currEval == "function")
1218
- x.cache[f] = {
1219
- runInNewContext: (h) => this.currEval(d, h)
1218
+ k.cache[f] = {
1219
+ runInNewContext: (d) => this.currEval(h, d)
1220
1220
  };
1221
1221
  else
1222
1222
  throw new TypeError(`Unknown "eval" property "${this.currEval}"`);
1223
1223
  }
1224
1224
  try {
1225
- return x.cache[f].runInNewContext(this.currSandbox);
1226
- } catch (d) {
1225
+ return k.cache[f].runInNewContext(this.currSandbox);
1226
+ } catch (h) {
1227
1227
  if (this.ignoreEvalErrors)
1228
1228
  return !1;
1229
- throw new Error("jsonPath: " + d.message + ": " + r);
1229
+ throw new Error("jsonPath: " + h.message + ": " + r);
1230
1230
  }
1231
1231
  };
1232
- x.cache = {};
1233
- x.toPathString = function(r) {
1232
+ k.cache = {};
1233
+ k.toPathString = function(r) {
1234
1234
  const e = r, t = e.length;
1235
1235
  let s = "$";
1236
1236
  for (let n = 1; n < t; n++)
1237
1237
  /^(~|\^|@.*?\(\))$/u.test(e[n]) || (s += /^[0-9*]+$/u.test(e[n]) ? "[" + e[n] + "]" : "['" + e[n] + "']");
1238
1238
  return s;
1239
1239
  };
1240
- x.toPointer = function(r) {
1240
+ k.toPointer = function(r) {
1241
1241
  const e = r, t = e.length;
1242
1242
  let s = "";
1243
1243
  for (let n = 1; n < t; n++)
1244
1244
  /^(~|\^|@.*?\(\))$/u.test(e[n]) || (s += "/" + e[n].toString().replaceAll("~", "~0").replaceAll("/", "~1"));
1245
1245
  return s;
1246
1246
  };
1247
- x.toPathArray = function(r) {
1247
+ k.toPathArray = function(r) {
1248
1248
  const {
1249
1249
  cache: e
1250
- } = x;
1250
+ } = k;
1251
1251
  if (e[r])
1252
1252
  return e[r].concat();
1253
1253
  const t = [], n = r.replaceAll(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/gu, ";$&;").replaceAll(/[['](\??\(.*?\))[\]'](?!.\])/gu, function(a, c) {
@@ -1262,17 +1262,17 @@ x.toPathArray = function(r) {
1262
1262
  });
1263
1263
  return e[r] = n, e[r].concat();
1264
1264
  };
1265
- x.prototype.safeVm = {
1266
- Script: Se
1265
+ k.prototype.safeVm = {
1266
+ Script: je
1267
1267
  };
1268
- const Ne = function(r, e, t) {
1268
+ const Re = function(r, e, t) {
1269
1269
  const s = r.length;
1270
1270
  for (let n = 0; n < s; n++) {
1271
1271
  const a = r[n];
1272
1272
  t(a) && e.push(r.splice(n--, 1)[0]);
1273
1273
  }
1274
1274
  };
1275
- class Te {
1275
+ class Le {
1276
1276
  /**
1277
1277
  * @param {string} expr Expression to evaluate
1278
1278
  */
@@ -1287,47 +1287,47 @@ class Te {
1287
1287
  runInNewContext(e) {
1288
1288
  let t = this.code;
1289
1289
  const s = Object.keys(e), n = [];
1290
- Ne(s, n, (h) => typeof e[h] == "function");
1291
- const a = s.map((h) => e[h]);
1292
- t = n.reduce((h, v) => {
1293
- let g = e[v].toString();
1294
- return /function/u.test(g) || (g = "function " + g), "var " + v + "=" + g + ";" + h;
1290
+ Re(s, n, (d) => typeof e[d] == "function");
1291
+ const a = s.map((d) => e[d]);
1292
+ t = n.reduce((d, _) => {
1293
+ let b = e[_].toString();
1294
+ return /function/u.test(b) || (b = "function " + b), "var " + _ + "=" + b + ";" + d;
1295
1295
  }, "") + t, !/(['"])use strict\1/u.test(t) && !s.includes("arguments") && (t = "var arguments = undefined;" + t), t = t.replace(/;\s*$/u, "");
1296
- const f = t.lastIndexOf(";"), d = f !== -1 ? t.slice(0, f + 1) + " return " + t.slice(f + 1) : " return " + t;
1297
- return new Function(...s, d)(...a);
1296
+ const f = t.lastIndexOf(";"), h = f !== -1 ? t.slice(0, f + 1) + " return " + t.slice(f + 1) : " return " + t;
1297
+ return new Function(...s, h)(...a);
1298
1298
  }
1299
1299
  }
1300
- x.prototype.vm = {
1301
- Script: Te
1300
+ k.prototype.vm = {
1301
+ Script: Le
1302
1302
  };
1303
- const Be = { class: "json-node" }, De = {
1303
+ const Ue = { class: "json-node" }, Me = {
1304
1304
  key: 0,
1305
1305
  class: "json-node__container"
1306
- }, je = { class: "json-node__line" }, Ie = {
1306
+ }, Ve = { class: "json-node__line" }, Fe = {
1307
1307
  key: 2,
1308
1308
  class: "json-node__colon"
1309
- }, $e = ["title"], Re = {
1309
+ }, He = ["title"], Ke = {
1310
1310
  key: 3,
1311
1311
  class: "json-node__collapsed"
1312
- }, Le = {
1312
+ }, Xe = {
1313
1313
  key: 4,
1314
1314
  class: "json-node__comma"
1315
- }, Ue = {
1315
+ }, Ge = {
1316
1316
  key: 0,
1317
1317
  class: "json-node__children"
1318
- }, Me = { class: "json-node__children-content" }, Ve = { class: "json-node__line json-node__closing-bracket" }, Fe = { class: "json-node__bracket" }, He = {
1318
+ }, Qe = { class: "json-node__children-content" }, Ye = { class: "json-node__line json-node__closing-bracket" }, qe = { class: "json-node__bracket" }, ze = {
1319
1319
  key: 0,
1320
1320
  class: "json-node__comma"
1321
- }, Ke = {
1321
+ }, We = {
1322
1322
  key: 1,
1323
1323
  class: "json-node__primitive"
1324
- }, Xe = {
1324
+ }, Ze = {
1325
1325
  key: 2,
1326
1326
  class: "json-node__colon"
1327
- }, Ge = ["title"], Qe = {
1327
+ }, Je = ["title"], et = {
1328
1328
  key: 0,
1329
1329
  class: "json-node__comma"
1330
- }, Ye = /* @__PURE__ */ le({
1330
+ }, tt = /* @__PURE__ */ pe({
1331
1331
  name: "JsonNode",
1332
1332
  __name: "JsonNode",
1333
1333
  props: {
@@ -1341,195 +1341,201 @@ const Be = { class: "json-node" }, De = {
1341
1341
  },
1342
1342
  emits: ["update:value", "toggle-expand", "copy", "update:key"],
1343
1343
  setup(r, { emit: e }) {
1344
- ce((u) => ({
1345
- "41b58a02": u.level,
1346
- "63accfe8": u.theme.colors.syntaxKey,
1347
- "7a4b22f6": u.theme.colors.hoverBackground,
1348
- "5865f1b1": u.theme.colors.syntaxBracket,
1349
- "79c93d33": u.theme.colors.textSecondary,
1350
- "59ced5e8": u.theme.colors.syntaxString,
1351
- 51525120: u.theme.colors.syntaxNumber,
1352
- "5410b131": u.theme.colors.syntaxBoolean,
1353
- "11eec51e": u.theme.colors.syntaxNull,
1354
- ac53437c: u.theme.colors.background,
1355
- "15cbe7d4": u.theme.colors.indentLine
1344
+ ye((u) => ({
1345
+ a64439cc: u.level,
1346
+ "34bc012d": u.theme.colors.syntaxKey,
1347
+ "577f8c7b": u.theme.colors.hoverBackground,
1348
+ "7f7e0f14": u.theme.colors.syntaxBracket,
1349
+ "3cb77810": u.theme.colors.textSecondary,
1350
+ "5e753afa": u.theme.colors.syntaxString,
1351
+ "6f6e448a": u.theme.colors.syntaxNumber,
1352
+ 88289014: u.theme.colors.syntaxBoolean,
1353
+ "62c5bc79": u.theme.colors.syntaxNull,
1354
+ "0aa554c6": u.theme.colors.background,
1355
+ "66a2df2f": u.theme.colors.indentLine
1356
1356
  }));
1357
- const t = r, s = e, n = R(!1), a = R(!1), c = R(""), f = R(""), d = (u) => {
1357
+ const t = r, s = e, n = H(!1), a = H(!1), c = H(""), f = H(""), h = (u) => {
1358
1358
  if (!/^-?\d+(\.\d+)?$/.test(u)) return !1;
1359
- const _ = Number(u);
1360
- return !Number.isSafeInteger(_) || u.length > 15;
1361
- }, h = T(() => t.value !== null && typeof t.value == "object"), v = T(() => Array.isArray(t.value)), g = T(() => t.path ? t.path : t.keyName ? t.keyName : "root"), k = T(() => t.expanded.has(g.value)), m = T(() => t.keyName), S = T(() => v.value ? "[" : "{"), C = T(() => v.value ? "]" : "}"), U = T(() => {
1359
+ const E = Number(u);
1360
+ return !Number.isSafeInteger(E) || u.length > 15;
1361
+ }, d = (u) => {
1362
+ if (typeof u != "string" || !/^-?\d+(\.\d+)?$/.test(u)) return !1;
1363
+ if (u.includes(".") && /\.\d*0$/.test(u))
1364
+ return !0;
1365
+ const E = Number(u), i = u.startsWith("-") ? u.slice(1) : u;
1366
+ return !Number.isSafeInteger(E) || i.length > 15;
1367
+ }, _ = j(() => t.value !== null && typeof t.value == "object"), b = j(() => Array.isArray(t.value)), x = j(() => t.path ? t.path : t.keyName ? t.keyName : "root"), g = j(() => t.expanded.has(x.value)), w = j(() => t.keyName), S = j(() => b.value ? "[" : "{"), M = j(() => b.value ? "]" : "}"), $ = j(() => {
1362
1368
  if (!t.value) return "";
1363
- const _ = Object.keys(t.value).length;
1364
- return v.value ? _ > 0 ? ` ${_} items ` : " " : _ > 0 ? ` ${_} keys ` : " ";
1365
- }), D = T(() => {
1369
+ const E = Object.keys(t.value).length;
1370
+ return b.value ? E > 0 ? ` ${E} items ` : " " : E > 0 ? ` ${E} keys ` : " ";
1371
+ }), W = j(() => {
1366
1372
  const u = typeof t.value;
1367
1373
  return t.value === null ? "json-node__value--null" : u === "boolean" ? "json-node__value--boolean" : u === "number" ? "json-node__value--number" : u === "string" ? d(t.value) ? "json-node__value--number" : "json-node__value--string" : "";
1368
- }), Q = T(() => a.value ? f.value : t.value === null ? "null" : typeof t.value == "boolean" || typeof t.value == "number" ? String(t.value) : typeof t.value == "string" ? d(t.value) ? t.value : `"${t.value}"` : String(t.value)), te = T(() => "Click to edit, double-click to copy"), J = (u) => t.level === 0 ? u : g.value ? `${g.value}.${u}` : u, V = (u) => {
1369
- const _ = Object.keys(t.value);
1370
- return _.indexOf(u) === _.length - 1;
1371
- }, Y = () => {
1372
- s("toggle-expand", g.value);
1373
- }, q = () => {
1374
- t.level !== 0 && (n.value = !0, c.value = t.keyName, Z(() => {
1375
- const u = document.querySelectorAll(".json-node__key-input"), _ = u[u.length - 1];
1376
- _ && (_.focus(), _.select());
1374
+ }), ae = j(() => a.value ? f.value : t.value === null ? "null" : typeof t.value == "boolean" || typeof t.value == "number" ? String(t.value) : typeof t.value == "string" ? d(t.value) ? t.value : `"${t.value}"` : String(t.value)), te = j(() => "Click to edit, double-click to copy"), Q = (u) => t.level === 0 ? u : x.value ? `${x.value}.${u}` : u, re = (u) => {
1375
+ const E = Object.keys(t.value);
1376
+ return E.indexOf(u) === E.length - 1;
1377
+ }, Z = () => {
1378
+ s("toggle-expand", x.value);
1379
+ }, J = () => {
1380
+ t.level !== 0 && (n.value = !0, c.value = t.keyName, ee(() => {
1381
+ const u = document.querySelectorAll(".json-node__key-input"), E = u[u.length - 1];
1382
+ E && (E.focus(), E.select());
1377
1383
  }));
1378
- }, ee = () => {
1379
- h.value || (a.value = !0, typeof t.value == "string" && d(t.value) || typeof t.value == "string" ? f.value = t.value : f.value = String(t.value), Z(() => {
1380
- const u = document.querySelectorAll(".json-node__value-input"), _ = u[u.length - 1];
1381
- _ && (_.focus(), _.select());
1384
+ }, ne = () => {
1385
+ _.value || (a.value = !0, typeof t.value == "string" && h(t.value) || typeof t.value == "string" ? f.value = t.value : f.value = String(t.value), ee(() => {
1386
+ const u = document.querySelectorAll(".json-node__value-input"), E = u[u.length - 1];
1387
+ E && (E.focus(), E.select());
1382
1388
  }));
1383
- }, F = () => {
1389
+ }, Y = () => {
1384
1390
  if (t.level === 0 || !n.value) return;
1385
1391
  const u = c.value.trim();
1386
1392
  if (!u) {
1387
- W();
1393
+ X();
1388
1394
  return;
1389
1395
  }
1390
1396
  if (u === t.keyName) {
1391
1397
  n.value = !1;
1392
1398
  return;
1393
1399
  }
1394
- n.value = !1, s("update:key", g.value, u);
1395
- }, z = () => {
1400
+ n.value = !1, s("update:key", x.value, u);
1401
+ }, se = () => {
1396
1402
  try {
1397
1403
  let u;
1398
- const _ = f.value.trim();
1399
- if (_ === "null")
1404
+ const E = f.value.trim();
1405
+ if (E === "null")
1400
1406
  u = null;
1401
- else if (_ === "true" || _ === "false")
1402
- u = _ === "true";
1403
- else if (!isNaN(Number(_)) && _ !== "") {
1404
- const K = Number(_);
1405
- !Number.isSafeInteger(K) || _.length > 15 ? u = _ : u = K;
1407
+ else if (E === "true" || E === "false")
1408
+ u = E === "true";
1409
+ else if (!isNaN(Number(E)) && E !== "") {
1410
+ const i = Number(E);
1411
+ !Number.isSafeInteger(i) || E.length > 15 ? u = E : u = i;
1406
1412
  } else
1407
1413
  u = f.value;
1408
- s("update:value", g.value, u), a.value = !1;
1414
+ s("update:value", x.value, u), a.value = !1;
1409
1415
  } catch (u) {
1410
1416
  console.error("Failed to parse value:", u), a.value = !1;
1411
1417
  }
1412
- }, W = () => {
1418
+ }, X = () => {
1413
1419
  n.value = !1, c.value = t.keyName;
1414
- }, H = () => {
1415
- a.value = !1, typeof t.value == "string" && d(t.value) || typeof t.value == "string" ? f.value = t.value : f.value = String(t.value);
1420
+ }, oe = () => {
1421
+ a.value = !1, typeof t.value == "string" && h(t.value) || typeof t.value == "string" ? f.value = t.value : f.value = String(t.value);
1416
1422
  };
1417
- return (u, _) => {
1418
- const K = pe("JsonNode", !0);
1419
- return w(), A("div", Be, [
1420
- h.value ? (w(), A("div", De, [
1421
- P("div", je, [
1422
- u.keyName && !n.value ? (w(), A("span", {
1423
+ return (u, E) => {
1424
+ const i = _e("JsonNode", !0);
1425
+ return A(), C("div", Ue, [
1426
+ _.value ? (A(), C("div", Me, [
1427
+ B("div", Ve, [
1428
+ u.keyName && !n.value ? (A(), C("span", {
1423
1429
  key: 0,
1424
1430
  class: "json-node__key",
1425
- onClick: q,
1431
+ onClick: J,
1426
1432
  title: "Click to edit key"
1427
- }, ' "' + $(m.value) + '" ', 1)) : N("", !0),
1428
- u.keyName && n.value ? re((w(), A("input", {
1433
+ }, ' "' + F(w.value) + '" ', 1)) : I("", !0),
1434
+ u.keyName && n.value ? le((A(), C("input", {
1429
1435
  key: 1,
1430
- "onUpdate:modelValue": _[0] || (_[0] = (i) => c.value = i),
1436
+ "onUpdate:modelValue": E[0] || (E[0] = (l) => c.value = l),
1431
1437
  onKeyup: [
1432
- X(F, ["enter"]),
1433
- X(W, ["escape"])
1438
+ q(Y, ["enter"]),
1439
+ q(X, ["escape"])
1434
1440
  ],
1435
- onBlur: F,
1441
+ onBlur: Y,
1436
1442
  class: "json-node__key-input"
1437
1443
  }, null, 544)), [
1438
- [ne, c.value]
1439
- ]) : N("", !0),
1440
- u.keyName ? (w(), A("span", Ie, ": ")) : N("", !0),
1441
- P("span", {
1444
+ [ce, c.value]
1445
+ ]) : I("", !0),
1446
+ u.keyName ? (A(), C("span", Fe, ": ")) : I("", !0),
1447
+ B("span", {
1442
1448
  class: "json-node__bracket json-node__bracket--clickable",
1443
- onClick: Y,
1444
- title: k.value ? "Click to collapse" : "Click to expand"
1445
- }, $(S.value), 9, $e),
1446
- k.value ? N("", !0) : (w(), A("span", Re, [
1447
- ie($(U.value) + " ", 1),
1448
- P("span", {
1449
+ onClick: Z,
1450
+ title: g.value ? "Click to collapse" : "Click to expand"
1451
+ }, F(S.value), 9, He),
1452
+ g.value ? I("", !0) : (A(), C("span", Ke, [
1453
+ he(F($.value) + " ", 1),
1454
+ B("span", {
1449
1455
  class: "json-node__bracket json-node__bracket--clickable",
1450
- onClick: Y
1451
- }, $(C.value), 1)
1456
+ onClick: Z
1457
+ }, F(M.value), 1)
1452
1458
  ])),
1453
- !k.value && !u.isLast ? (w(), A("span", Le, ",")) : N("", !0)
1459
+ !g.value && !u.isLast ? (A(), C("span", Xe, ",")) : I("", !0)
1454
1460
  ]),
1455
- k.value ? (w(), A("div", Ue, [
1456
- P("div", Me, [
1457
- (w(!0), A(ye, null, be(u.value, (i, l) => (w(), A("div", {
1458
- key: l,
1461
+ g.value ? (A(), C("div", Ge, [
1462
+ B("div", Qe, [
1463
+ (A(!0), C(xe, null, ke(u.value, (l, m) => (A(), C("div", {
1464
+ key: m,
1459
1465
  class: "json-node__child"
1460
1466
  }, [
1461
- ue(K, {
1462
- value: i,
1463
- "key-name": v.value ? "" : String(l),
1467
+ ge(i, {
1468
+ value: l,
1469
+ "key-name": b.value ? "" : String(m),
1464
1470
  level: u.level + 1,
1465
- path: J(String(l)),
1471
+ path: Q(String(m)),
1466
1472
  expanded: u.expanded,
1467
1473
  theme: u.theme,
1468
- "onUpdate:value": _[1] || (_[1] = (y, p) => u.$emit("update:value", y, p)),
1469
- onToggleExpand: _[2] || (_[2] = (y) => u.$emit("toggle-expand", y)),
1470
- onCopy: _[3] || (_[3] = (y) => u.$emit("copy", y)),
1471
- "onUpdate:key": _[4] || (_[4] = (y, p) => u.$emit("update:key", y, p)),
1472
- "is-last": V(String(l))
1474
+ "onUpdate:value": E[1] || (E[1] = (p, y) => u.$emit("update:value", p, y)),
1475
+ onToggleExpand: E[2] || (E[2] = (p) => u.$emit("toggle-expand", p)),
1476
+ onCopy: E[3] || (E[3] = (p) => u.$emit("copy", p)),
1477
+ "onUpdate:key": E[4] || (E[4] = (p, y) => u.$emit("update:key", p, y)),
1478
+ "is-last": re(String(m))
1473
1479
  }, null, 8, ["value", "key-name", "level", "path", "expanded", "theme", "is-last"])
1474
1480
  ]))), 128))
1475
1481
  ]),
1476
- P("div", Ve, [
1477
- P("span", Fe, $(C.value), 1),
1478
- u.isLast ? N("", !0) : (w(), A("span", He, ","))
1482
+ B("div", Ye, [
1483
+ B("span", qe, F(M.value), 1),
1484
+ u.isLast ? I("", !0) : (A(), C("span", ze, ","))
1479
1485
  ])
1480
- ])) : N("", !0)
1481
- ])) : (w(), A("div", Ke, [
1482
- u.keyName && !n.value ? (w(), A("span", {
1486
+ ])) : I("", !0)
1487
+ ])) : (A(), C("div", We, [
1488
+ u.keyName && !n.value ? (A(), C("span", {
1483
1489
  key: 0,
1484
1490
  class: "json-node__key",
1485
- onClick: q,
1491
+ onClick: J,
1486
1492
  title: "Click to edit key"
1487
- }, ' "' + $(m.value) + '" ', 1)) : N("", !0),
1488
- u.keyName && n.value ? re((w(), A("input", {
1493
+ }, ' "' + F(w.value) + '" ', 1)) : I("", !0),
1494
+ u.keyName && n.value ? le((A(), C("input", {
1489
1495
  key: 1,
1490
- "onUpdate:modelValue": _[5] || (_[5] = (i) => c.value = i),
1496
+ "onUpdate:modelValue": E[5] || (E[5] = (l) => c.value = l),
1491
1497
  onKeyup: [
1492
- X(F, ["enter"]),
1493
- X(W, ["escape"])
1498
+ q(Y, ["enter"]),
1499
+ q(X, ["escape"])
1494
1500
  ],
1495
- onBlur: F,
1501
+ onBlur: Y,
1496
1502
  class: "json-node__key-input"
1497
1503
  }, null, 544)), [
1498
- [ne, c.value]
1499
- ]) : N("", !0),
1500
- u.keyName ? (w(), A("span", Xe, ": ")) : N("", !0),
1501
- a.value ? N("", !0) : (w(), A("span", {
1504
+ [ce, c.value]
1505
+ ]) : I("", !0),
1506
+ u.keyName ? (A(), C("span", Ze, ": ")) : I("", !0),
1507
+ a.value ? I("", !0) : (A(), C("span", {
1502
1508
  key: 3,
1503
- class: de(["json-node__value", D.value]),
1504
- onClick: ee,
1505
- onDblclick: _[6] || (_[6] = (i) => u.$emit("copy", u.value)),
1509
+ class: be(["json-node__value", W.value]),
1510
+ onClick: ne,
1511
+ onDblclick: E[6] || (E[6] = (l) => u.$emit("copy", u.value)),
1506
1512
  title: te.value
1507
1513
  }, [
1508
- ie($(Q.value), 1),
1509
- u.isLast ? N("", !0) : (w(), A("span", Qe, ","))
1510
- ], 42, Ge)),
1511
- a.value ? re((w(), A("input", {
1514
+ he(F(ae.value), 1),
1515
+ u.isLast ? I("", !0) : (A(), C("span", et, ","))
1516
+ ], 42, Je)),
1517
+ a.value ? le((A(), C("input", {
1512
1518
  key: 4,
1513
- "onUpdate:modelValue": _[7] || (_[7] = (i) => f.value = i),
1519
+ "onUpdate:modelValue": E[7] || (E[7] = (l) => f.value = l),
1514
1520
  onKeyup: [
1515
- X(z, ["enter"]),
1516
- X(H, ["escape"])
1521
+ q(se, ["enter"]),
1522
+ q(oe, ["escape"])
1517
1523
  ],
1518
- onBlur: z,
1524
+ onBlur: se,
1519
1525
  class: "json-node__value-input"
1520
1526
  }, null, 544)), [
1521
- [ne, f.value]
1522
- ]) : N("", !0)
1527
+ [ce, f.value]
1528
+ ]) : I("", !0)
1523
1529
  ]))
1524
1530
  ]);
1525
1531
  };
1526
1532
  }
1527
- }), he = (r, e) => {
1533
+ }), me = (r, e) => {
1528
1534
  const t = r.__vccOpts || r;
1529
1535
  for (const [s, n] of e)
1530
1536
  t[s] = n;
1531
1537
  return t;
1532
- }, qe = /* @__PURE__ */ he(Ye, [["__scopeId", "data-v-f3f3cbc9"]]), fe = {
1538
+ }, rt = /* @__PURE__ */ me(tt, [["__scopeId", "data-v-c799bdec"]]), Ee = {
1533
1539
  name: "github-light",
1534
1540
  colors: {
1535
1541
  // 背景色
@@ -1568,7 +1574,7 @@ const Be = { class: "json-node" }, De = {
1568
1574
  // 缩进线
1569
1575
  indentLine: "#d0d7de"
1570
1576
  }
1571
- }, ze = {
1577
+ }, nt = {
1572
1578
  name: "github-dark",
1573
1579
  colors: {
1574
1580
  // 背景色
@@ -1607,7 +1613,7 @@ const Be = { class: "json-node" }, De = {
1607
1613
  // 缩进线
1608
1614
  indentLine: "#30363d"
1609
1615
  }
1610
- }, We = {
1616
+ }, st = {
1611
1617
  name: "min-light",
1612
1618
  colors: {
1613
1619
  // 背景色 - 纯白简洁
@@ -1646,7 +1652,7 @@ const Be = { class: "json-node" }, De = {
1646
1652
  // 缩进线
1647
1653
  indentLine: "#e5e7eb"
1648
1654
  }
1649
- }, Ze = {
1655
+ }, ot = {
1650
1656
  name: "slack-ochin",
1651
1657
  colors: {
1652
1658
  // 背景色 - 温暖的米色调
@@ -1685,34 +1691,34 @@ const Be = { class: "json-node" }, De = {
1685
1691
  // 缩进线
1686
1692
  indentLine: "#e8d5b7"
1687
1693
  }
1688
- }, Je = {
1689
- "github-light": fe,
1690
- "github-dark": ze,
1691
- "min-light": We,
1692
- "slack-ochin": Ze
1694
+ }, it = {
1695
+ "github-light": Ee,
1696
+ "github-dark": nt,
1697
+ "min-light": st,
1698
+ "slack-ochin": ot
1693
1699
  };
1694
- function et(r = "github-light") {
1695
- return Je[r] || fe;
1700
+ function at(r = "github-light") {
1701
+ return it[r] || Ee;
1696
1702
  }
1697
- const tt = {
1703
+ const lt = {
1698
1704
  key: 0,
1699
1705
  class: "json-format__toolbar"
1700
- }, rt = { class: "json-format__actions" }, nt = ["disabled"], st = ["disabled"], ot = ["disabled"], it = ["disabled"], at = { class: "json-format__info" }, lt = {
1706
+ }, ct = { class: "json-format__actions" }, ut = ["disabled"], dt = ["disabled"], ht = ["disabled"], ft = ["disabled"], pt = { class: "json-format__info" }, yt = {
1701
1707
  key: 0,
1702
1708
  class: "json-format__status json-format__status--success"
1703
- }, ct = {
1709
+ }, gt = {
1704
1710
  key: 1,
1705
1711
  class: "json-format__status json-format__status--error"
1706
- }, ut = { class: "json-format__content" }, dt = {
1712
+ }, bt = { class: "json-format__content" }, mt = {
1707
1713
  key: 0,
1708
1714
  class: "json-format__error"
1709
- }, ht = {
1715
+ }, Et = {
1710
1716
  key: 1,
1711
1717
  class: "json-format__error"
1712
- }, ft = {
1718
+ }, vt = {
1713
1719
  key: 2,
1714
1720
  class: "json-format__viewer"
1715
- }, pt = /* @__PURE__ */ le({
1721
+ }, _t = /* @__PURE__ */ pe({
1716
1722
  name: "JsonFormat",
1717
1723
  __name: "index",
1718
1724
  props: {
@@ -1724,62 +1730,102 @@ const tt = {
1724
1730
  },
1725
1731
  emits: ["update:modelValue", "copy-success", "copy-error", "expand-all", "collapse-all", "compress"],
1726
1732
  setup(r, { expose: e, emit: t }) {
1727
- ce((i) => ({
1728
- dd679ea0: g.value.colors.border,
1729
- "0543a09c": g.value.colors.background,
1730
- "630352b1": g.value.colors.text,
1731
- be141a92: g.value.colors.surfaceBackground,
1732
- "4e0b2382": g.value.colors.buttonBorder,
1733
- ee392cf8: g.value.colors.buttonBackground,
1734
- "6224d203": g.value.colors.buttonText,
1735
- c17e7bd0: g.value.colors.buttonBackgroundHover,
1736
- "5c94496c": g.value.colors.buttonPrimary,
1737
- a3b0d9a0: g.value.colors.buttonPrimaryHover,
1738
- "1129928d": g.value.colors.successBackground,
1739
- "24ed13ff": g.value.colors.success,
1740
- "5bef9d5c": g.value.colors.errorBackground,
1741
- "06cd15f8": g.value.colors.error,
1742
- "4bc6db49": g.value.colors.scrollbarTrack,
1743
- "4bc29bd4": g.value.colors.scrollbarThumb,
1744
- aad6fc70: g.value.colors.scrollbarThumbHover
1733
+ ye((i) => ({
1734
+ "4580f20e": b.value.colors.border,
1735
+ "1c771210": b.value.colors.background,
1736
+ "7594d38f": b.value.colors.text,
1737
+ "75ad6ace": b.value.colors.surfaceBackground,
1738
+ "0a74e660": b.value.colors.buttonBorder,
1739
+ ba56e53c: b.value.colors.buttonBackground,
1740
+ fd84973e: b.value.colors.buttonText,
1741
+ "486158fa": b.value.colors.buttonBackgroundHover,
1742
+ "2d62e24e": b.value.colors.buttonPrimary,
1743
+ "105f378e": b.value.colors.buttonPrimaryHover,
1744
+ "355cea6f": b.value.colors.successBackground,
1745
+ "115f033e": b.value.colors.success,
1746
+ acd7cc98: b.value.colors.errorBackground,
1747
+ "3c380fe6": b.value.colors.error,
1748
+ d66942b2: b.value.colors.scrollbarTrack,
1749
+ d671c19c: b.value.colors.scrollbarThumb,
1750
+ e15d2dac: b.value.colors.scrollbarThumbHover
1745
1751
  }));
1746
- const s = r, n = t, a = R(null), c = R(""), f = R(/* @__PURE__ */ new Set()), d = R(null), h = R(""), v = T(() => c.value === ""), g = T(() => et(s.theme)), k = T(() => h.value ? null : d.value !== null ? d.value : a.value), m = (i) => {
1752
+ const s = r, n = t, a = H(null), c = H(""), f = H(/* @__PURE__ */ new Set()), h = H(null), d = H(""), _ = j(() => c.value === ""), b = j(() => at(s.theme)), x = j(() => d.value ? null : h.value !== null ? h.value : a.value), g = (i) => {
1747
1753
  if (!i.trim()) {
1748
- a.value = null, c.value = "", d.value = null, h.value = "";
1754
+ a.value = null, c.value = "", h.value = null, d.value = "";
1749
1755
  return;
1750
1756
  }
1751
1757
  try {
1752
1758
  let l = i;
1753
- try {
1754
- a.value = JSON.parse(l), c.value = "", d.value = null, h.value = "", Z(() => {
1755
- k.value !== null && V();
1756
- });
1757
- return;
1758
- } catch {
1759
- }
1760
- const y = l.split("");
1761
- let p = !1, b = !1;
1762
- for (let E = 0; E < y.length; E++)
1763
- y[E] === "\\" && p ? b = !b : y[E] === '"' && !b ? p = !p : b = !1;
1764
- p || (l = l.replace(/:\s*(\d{16,})\s*([,}\]])/g, ': "$1"$2'), l = l.replace(/:\s*(\d+\.\d*?0+)\s*([,}\]])/g, ': "$1"$2')), a.value = JSON.parse(l), c.value = "", d.value = null, h.value = "", Z(() => {
1765
- k.value !== null && V();
1759
+ const m = /(:\s*|,\s*|\[\s*)-?\d{16,}/.test(l), p = /(:\s*|,\s*|\[\s*)-?\d+\.\d*0+\s*[,}\]\s]*/.test(l);
1760
+ if (!m && !p)
1761
+ try {
1762
+ a.value = JSON.parse(l), c.value = "", h.value = null, d.value = "", ee(() => {
1763
+ x.value !== null && Q();
1764
+ });
1765
+ return;
1766
+ } catch {
1767
+ }
1768
+ const y = (P, N, D) => {
1769
+ let V = "", R = !1, L = !1, U = 0;
1770
+ for (; U < P.length; ) {
1771
+ const T = P[U];
1772
+ if (R)
1773
+ L ? L = !1 : T === "\\" ? L = !0 : T === '"' && (R = !1), V += T, U++;
1774
+ else if (T === '"')
1775
+ R = !0, V += T, U++;
1776
+ else {
1777
+ const ie = P.slice(U).match(N);
1778
+ if (ie && ie.index === 0) {
1779
+ const ve = ie[0].replace(N, D);
1780
+ V += ve, U += ie[0].length;
1781
+ } else
1782
+ V += T, U++;
1783
+ }
1784
+ }
1785
+ return V;
1786
+ };
1787
+ l = ((P) => {
1788
+ let N = "", D = !1, V = !1, R = 0;
1789
+ for (; R < P.length; ) {
1790
+ const L = P[R];
1791
+ if (D)
1792
+ V ? V = !1 : L === "\\" ? V = !0 : L === '"' && (D = !1), N += L, R++;
1793
+ else if (L === '"')
1794
+ D = !0, N += L, R++;
1795
+ else {
1796
+ const U = P.slice(R);
1797
+ let T = U.match(/^([:,\[\s]*)(-?\d{16,})(\s*[,\}\]\s]|$)/);
1798
+ if (T) {
1799
+ N += T[1] + '"' + T[2] + '"' + T[3], R += T[0].length;
1800
+ continue;
1801
+ }
1802
+ if (T = U.match(/^([:,\[\s]*)(-?\d+\.\d*0+)(\s*[,\}\]\s]|$)/), T) {
1803
+ N += T[1] + '"' + T[2] + '"' + T[3], R += T[0].length;
1804
+ continue;
1805
+ }
1806
+ N += L, R++;
1807
+ }
1808
+ }
1809
+ return N;
1810
+ })(l), a.value = JSON.parse(l), c.value = "", h.value = null, d.value = "", ee(() => {
1811
+ x.value !== null && Q();
1766
1812
  });
1767
1813
  } catch (l) {
1768
- c.value = l instanceof Error ? l.message : "Unknown parsing error", a.value = null, d.value = null, h.value = "";
1814
+ c.value = l instanceof Error ? l.message : "Unknown parsing error", a.value = null, h.value = null, d.value = "";
1769
1815
  }
1770
- }, S = (i) => {
1816
+ }, w = (i) => {
1771
1817
  if (!i || !i.expression.trim()) {
1772
- C();
1818
+ S();
1773
1819
  return;
1774
1820
  }
1775
1821
  if (!a.value) {
1776
- h.value = "No valid JSON data to filter";
1822
+ d.value = "No valid JSON data to filter";
1777
1823
  return;
1778
1824
  }
1779
1825
  try {
1780
1826
  let l;
1781
1827
  if (i.type === "jsonpath")
1782
- l = x({ path: i.expression, json: a.value }), l.length === 1 && i.expression.includes("$[") === !1 && !i.expression.endsWith("[*]") ? d.value = l[0] : d.value = l;
1828
+ l = k({ path: i.expression, json: a.value }), l.length === 1 && i.expression.includes("$[") === !1 && !i.expression.endsWith("[*]") ? h.value = l[0] : h.value = l;
1783
1829
  else if (i.type === "js")
1784
1830
  l = new Function("data", `
1785
1831
  try {
@@ -1787,249 +1833,249 @@ const tt = {
1787
1833
  } catch (error) {
1788
1834
  throw new Error('JavaScript expression error: ' + error.message);
1789
1835
  }
1790
- `)(a.value), d.value = l;
1836
+ `)(a.value), h.value = l;
1791
1837
  else
1792
1838
  throw new Error(`Unsupported filter type: ${i.type}`);
1793
- h.value = "", Z(() => {
1794
- V();
1839
+ d.value = "", ee(() => {
1840
+ Q();
1795
1841
  });
1796
1842
  } catch (l) {
1797
- h.value = l instanceof Error ? l.message : "Filter execution error", d.value = null;
1843
+ d.value = l instanceof Error ? l.message : "Filter execution error", h.value = null;
1798
1844
  }
1799
- }, C = () => {
1800
- d.value = null, h.value = "";
1845
+ }, S = () => {
1846
+ h.value = null, d.value = "";
1801
1847
  };
1802
- ge(() => s.modelValue, (i) => {
1803
- m(i);
1848
+ Oe(() => s.modelValue, (i) => {
1849
+ g(i);
1804
1850
  }, { immediate: !0 });
1805
- const U = (i) => {
1851
+ const M = (i) => {
1806
1852
  if (!/^-?\d+(\.\d+)?$/.test(i)) return !1;
1807
1853
  const l = Number(i);
1808
1854
  return !Number.isSafeInteger(l) || i.length > 15;
1809
- }, D = (i, l, y) => JSON.stringify(i, (p, b) => {
1810
- if (typeof b == "string" && U(b))
1811
- return `__BIG_NUMBER__${b}__BIG_NUMBER__`;
1812
- if (typeof b == "string" && /^-?\d+(\.\d+)?$/.test(b)) {
1813
- const E = Number(b);
1814
- if (Number.isSafeInteger(E) && E.toString() === b)
1815
- return E;
1816
- if (!Number.isNaN(E) && isFinite(E) && b.includes("."))
1817
- return E.toString() === b ? E : `__PRESERVE_STRING__${b}__PRESERVE_STRING__`;
1818
- if (!Number.isNaN(E) && isFinite(E))
1819
- return E;
1855
+ }, $ = (i, l, m) => JSON.stringify(i, (p, y) => {
1856
+ if (typeof y == "string" && M(y))
1857
+ return `__BIG_NUMBER__${y}__BIG_NUMBER__`;
1858
+ if (typeof y == "string" && /^-?\d+(\.\d+)?$/.test(y)) {
1859
+ const v = Number(y);
1860
+ if (Number.isSafeInteger(v) && v.toString() === y)
1861
+ return v;
1862
+ if (!Number.isNaN(v) && isFinite(v) && y.includes("."))
1863
+ return v.toString() === y ? v : `__PRESERVE_STRING__${y}__PRESERVE_STRING__`;
1864
+ if (!Number.isNaN(v) && isFinite(v))
1865
+ return v;
1820
1866
  }
1821
- return l && typeof l == "function" ? l(p, b) : b;
1822
- }, y).replace(/"__BIG_NUMBER__(.+?)__BIG_NUMBER__"/g, "$1").replace(/"__PRESERVE_STRING__(.+?)__PRESERVE_STRING__"/g, "$1"), Q = (i, l) => {
1867
+ return l && typeof l == "function" ? l(p, y) : y;
1868
+ }, m).replace(/"__BIG_NUMBER__(.+?)__BIG_NUMBER__"/g, "$1").replace(/"__PRESERVE_STRING__(.+?)__PRESERVE_STRING__"/g, "$1"), W = (i, l) => {
1823
1869
  if (!s.readonly)
1824
1870
  try {
1825
- const y = te(a.value, i, l), p = D(y, null, 2);
1871
+ const m = ae(a.value, i, l), p = $(m, null, 2);
1826
1872
  n("update:modelValue", p);
1827
- } catch (y) {
1828
- console.error("Failed to update JSON:", y);
1873
+ } catch (m) {
1874
+ console.error("Failed to update JSON:", m);
1829
1875
  }
1830
- }, te = (i, l, y) => {
1831
- if (!l || l === "root") return y;
1832
- const p = l.split("."), b = H(i, p.slice(0, -1));
1833
- let E = b;
1834
- for (let j = 0; j < p.length - 1; j++) {
1835
- const I = p[j];
1836
- I !== "root" && (Array.isArray(E) ? E = E[parseInt(I)] : E = E[I]);
1876
+ }, ae = (i, l, m) => {
1877
+ if (!l || l === "root") return m;
1878
+ const p = l.split("."), y = X(i, p.slice(0, -1));
1879
+ let v = y;
1880
+ for (let N = 0; N < p.length - 1; N++) {
1881
+ const D = p[N];
1882
+ D !== "root" && (Array.isArray(v) ? v = v[parseInt(D)] : v = v[D]);
1837
1883
  }
1838
- const B = p[p.length - 1];
1839
- return B === "root" ? y : (Array.isArray(E) ? E[parseInt(B)] = y : E[B] = y, b);
1840
- }, J = (i) => {
1884
+ const P = p[p.length - 1];
1885
+ return P === "root" ? m : (Array.isArray(v) ? v[parseInt(P)] = m : v[P] = m, y);
1886
+ }, te = (i) => {
1841
1887
  f.value.has(i) ? f.value.delete(i) : f.value.add(i);
1842
- }, V = () => {
1843
- const i = /* @__PURE__ */ new Set(), l = (y, p = "") => {
1844
- y !== null && typeof y == "object" && (i.add(p || "root"), Array.isArray(y) ? y.forEach((b, E) => {
1845
- const B = p ? `${p}.${E}` : `${E}`;
1846
- l(b, B);
1847
- }) : Object.keys(y).forEach((b) => {
1848
- const E = p ? `${p}.${b}` : b;
1849
- l(y[b], E);
1888
+ }, Q = () => {
1889
+ const i = /* @__PURE__ */ new Set(), l = (m, p = "") => {
1890
+ m !== null && typeof m == "object" && (i.add(p || "root"), Array.isArray(m) ? m.forEach((y, v) => {
1891
+ const P = p ? `${p}.${v}` : `${v}`;
1892
+ l(y, P);
1893
+ }) : Object.keys(m).forEach((y) => {
1894
+ const v = p ? `${p}.${y}` : y;
1895
+ l(m[y], v);
1850
1896
  }));
1851
1897
  };
1852
- l(k.value), f.value = i, n("expand-all");
1853
- }, Y = () => {
1898
+ l(x.value), f.value = i, n("expand-all");
1899
+ }, re = () => {
1854
1900
  f.value = /* @__PURE__ */ new Set(["root"]), n("collapse-all");
1855
- }, q = async () => {
1856
- if (v.value)
1901
+ }, Z = async () => {
1902
+ if (_.value)
1857
1903
  try {
1858
- const i = k.value, l = D(i, null, 2);
1904
+ const i = x.value, l = $(i, null, 2);
1859
1905
  await navigator.clipboard.writeText(l), n("copy-success", l);
1860
1906
  } catch (i) {
1861
1907
  console.error("Failed to copy JSON:", i), n("copy-error", i instanceof Error ? i : new Error("Failed to copy JSON"));
1862
1908
  }
1863
- }, ee = () => {
1864
- if (v.value)
1909
+ }, J = () => {
1910
+ if (_.value)
1865
1911
  try {
1866
- const i = k.value, l = D(i);
1912
+ const i = x.value, l = $(i);
1867
1913
  n("update:modelValue", l), n("compress", l);
1868
1914
  } catch (i) {
1869
1915
  console.error("Failed to compress JSON:", i);
1870
1916
  }
1871
- }, F = async (i) => {
1917
+ }, ne = async (i) => {
1872
1918
  try {
1873
1919
  let l;
1874
- typeof i == "string" && U(i) ? l = i : typeof i == "string" ? l = `"${i}"` : l = JSON.stringify(i), await navigator.clipboard.writeText(l);
1920
+ typeof i == "string" && M(i) ? l = i : typeof i == "string" ? l = `"${i}"` : l = JSON.stringify(i), await navigator.clipboard.writeText(l);
1875
1921
  } catch (l) {
1876
1922
  console.error("Failed to copy value:", l);
1877
1923
  }
1878
- }, z = (i, l) => {
1924
+ }, Y = (i, l) => {
1879
1925
  if (!s.readonly)
1880
1926
  try {
1881
- const y = W(a.value, i, l), p = D(y, null, 2);
1882
- n("update:modelValue", p), K(i, l);
1883
- } catch (y) {
1884
- console.error("Failed to rename key:", y);
1927
+ const m = se(a.value, i, l), p = $(m, null, 2);
1928
+ n("update:modelValue", p), E(i, l);
1929
+ } catch (m) {
1930
+ console.error("Failed to rename key:", m);
1885
1931
  }
1886
- }, W = (i, l, y) => {
1932
+ }, se = (i, l, m) => {
1887
1933
  if (!l || l === "root") return i;
1888
- const p = l.split("."), b = H(i, p.slice(0, -1));
1934
+ const p = l.split("."), y = X(i, p.slice(0, -1));
1889
1935
  if (p.length === 1) {
1890
- const j = p[0];
1891
- return b && typeof b == "object" && !Array.isArray(b) ? u(b, j, y) : b;
1936
+ const N = p[0];
1937
+ return y && typeof y == "object" && !Array.isArray(y) ? oe(y, N, m) : y;
1892
1938
  }
1893
- let E = b;
1894
- for (let j = 0; j < p.length - 1; j++) {
1895
- const I = p[j];
1896
- Array.isArray(E) ? E = E[parseInt(I)] : E = E[I];
1939
+ let v = y;
1940
+ for (let N = 0; N < p.length - 1; N++) {
1941
+ const D = p[N];
1942
+ Array.isArray(v) ? v = v[parseInt(D)] : v = v[D];
1897
1943
  }
1898
- const B = p[p.length - 1];
1899
- if (!Array.isArray(E) && E && typeof E == "object") {
1900
- const j = u(E, B, y), I = p.slice(0, -1);
1901
- I.length > 0 && _(b, I, j);
1944
+ const P = p[p.length - 1];
1945
+ if (!Array.isArray(v) && v && typeof v == "object") {
1946
+ const N = oe(v, P, m), D = p.slice(0, -1);
1947
+ D.length > 0 && u(y, D, N);
1902
1948
  }
1903
- return b;
1904
- }, H = (i, l) => {
1949
+ return y;
1950
+ }, X = (i, l) => {
1905
1951
  if (l.length === 0) return i;
1906
1952
  if (Array.isArray(i)) {
1907
- const y = [...i], p = l[0], b = parseInt(p);
1908
- return l.length === 1 || (y[b] = H(i[b], l.slice(1))), y;
1953
+ const m = [...i], p = l[0], y = parseInt(p);
1954
+ return l.length === 1 || (m[y] = X(i[y], l.slice(1))), m;
1909
1955
  } else if (i && typeof i == "object") {
1910
- const y = { ...i }, p = l[0];
1911
- return l.length === 1 || (y[p] = H(i[p], l.slice(1))), y;
1956
+ const m = { ...i }, p = l[0];
1957
+ return l.length === 1 || (m[p] = X(i[p], l.slice(1))), m;
1912
1958
  }
1913
1959
  return i;
1914
- }, u = (i, l, y) => {
1960
+ }, oe = (i, l, m) => {
1915
1961
  if (!i || typeof i != "object" || Array.isArray(i))
1916
1962
  return i;
1917
- const p = Object.keys(i), b = {};
1918
- for (const E of p)
1919
- E === l ? b[y] = i[E] : b[E] = i[E];
1920
- return b;
1921
- }, _ = (i, l, y) => {
1963
+ const p = Object.keys(i), y = {};
1964
+ for (const v of p)
1965
+ v === l ? y[m] = i[v] : y[v] = i[v];
1966
+ return y;
1967
+ }, u = (i, l, m) => {
1922
1968
  let p = i;
1923
- for (let E = 0; E < l.length - 1; E++) {
1924
- const B = l[E];
1925
- Array.isArray(p) ? p = p[parseInt(B)] : p = p[B];
1969
+ for (let v = 0; v < l.length - 1; v++) {
1970
+ const P = l[v];
1971
+ Array.isArray(p) ? p = p[parseInt(P)] : p = p[P];
1926
1972
  }
1927
- const b = l[l.length - 1];
1928
- Array.isArray(p) ? p[parseInt(b)] = y : p[b] = y;
1929
- }, K = (i, l) => {
1930
- const y = /* @__PURE__ */ new Set();
1973
+ const y = l[l.length - 1];
1974
+ Array.isArray(p) ? p[parseInt(y)] = m : p[y] = m;
1975
+ }, E = (i, l) => {
1976
+ const m = /* @__PURE__ */ new Set();
1931
1977
  f.value.forEach((p) => {
1932
1978
  if (p === i) {
1933
- const b = i.split(".");
1934
- b[b.length - 1] = l, y.add(b.join("."));
1979
+ const y = i.split(".");
1980
+ y[y.length - 1] = l, m.add(y.join("."));
1935
1981
  } else if (p.startsWith(i + ".")) {
1936
- const b = i.split(".");
1937
- b[b.length - 1] = l;
1938
- const E = b.join("."), B = p.substring(i.length);
1939
- y.add(E + B);
1982
+ const y = i.split(".");
1983
+ y[y.length - 1] = l;
1984
+ const v = y.join("."), P = p.substring(i.length);
1985
+ m.add(v + P);
1940
1986
  } else
1941
- y.add(p);
1942
- }), f.value = y;
1987
+ m.add(p);
1988
+ }), f.value = m;
1943
1989
  };
1944
1990
  return e({
1945
1991
  // 核心操作方法
1946
- copyJson: q,
1947
- compressSource: ee,
1948
- expandAll: V,
1949
- collapseAll: Y,
1950
- toggleExpand: J,
1951
- updateValue: Q,
1952
- updateKey: z,
1992
+ copyJson: Z,
1993
+ compressSource: J,
1994
+ expandAll: Q,
1995
+ collapseAll: re,
1996
+ toggleExpand: te,
1997
+ updateValue: W,
1998
+ updateKey: Y,
1953
1999
  // Filter 相关方法
1954
- filter: S,
1955
- clearFilter: C,
2000
+ filter: w,
2001
+ clearFilter: S,
1956
2002
  // 状态访问方法
1957
- isValidJson: () => v.value,
2003
+ isValidJson: () => _.value,
1958
2004
  getParsedJson: () => a.value,
1959
- getFilteredJson: () => d.value,
2005
+ getFilteredJson: () => h.value,
1960
2006
  getExpandedNodes: () => f.value,
1961
2007
  getParseError: () => c.value,
1962
- getFilterError: () => h.value,
2008
+ getFilterError: () => d.value,
1963
2009
  // 工具方法
1964
- parseJson: (i) => m(i),
1965
- copyValue: (i) => F(i)
1966
- }), (i, l) => (w(), A("div", {
1967
- class: de(["json-format", `json-format--${g.value.name}`])
2010
+ parseJson: (i) => g(i),
2011
+ copyValue: (i) => ne(i)
2012
+ }), (i, l) => (A(), C("div", {
2013
+ class: be(["json-format", `json-format--${b.value.name}`])
1968
2014
  }, [
1969
- i.showToolbar ? (w(), A("div", tt, [
1970
- P("div", rt, [
1971
- P("button", {
2015
+ i.showToolbar ? (A(), C("div", lt, [
2016
+ B("div", ct, [
2017
+ B("button", {
1972
2018
  class: "json-format__btn json-format__btn--primary",
1973
- onClick: q,
1974
- disabled: !v.value,
2019
+ onClick: Z,
2020
+ disabled: !_.value,
1975
2021
  title: "Copy JSON"
1976
- }, " 📋 Copy ", 8, nt),
1977
- P("button", {
2022
+ }, " 📋 Copy ", 8, ut),
2023
+ B("button", {
1978
2024
  class: "json-format__btn json-format__btn--secondary",
1979
- onClick: V,
1980
- disabled: !v.value,
2025
+ onClick: Q,
2026
+ disabled: !_.value,
1981
2027
  title: "Expand All"
1982
- }, " ⬇️ Expand All ", 8, st),
1983
- P("button", {
2028
+ }, " ⬇️ Expand All ", 8, dt),
2029
+ B("button", {
1984
2030
  class: "json-format__btn json-format__btn--secondary",
1985
- onClick: Y,
1986
- disabled: !v.value,
2031
+ onClick: re,
2032
+ disabled: !_.value,
1987
2033
  title: "Collapse All"
1988
- }, " ➡️ Collapse All ", 8, ot),
1989
- P("button", {
2034
+ }, " ➡️ Collapse All ", 8, ht),
2035
+ B("button", {
1990
2036
  class: "json-format__btn json-format__btn--secondary",
1991
- onClick: ee,
1992
- disabled: !v.value,
2037
+ onClick: J,
2038
+ disabled: !_.value,
1993
2039
  title: "Compress JSON"
1994
- }, " 📦 Compress ", 8, it)
2040
+ }, " 📦 Compress ", 8, ft)
1995
2041
  ]),
1996
- P("div", at, [
1997
- v.value ? (w(), A("span", lt, " ✅ Valid JSON ")) : (w(), A("span", ct, " ❌ Invalid JSON "))
2042
+ B("div", pt, [
2043
+ _.value ? (A(), C("span", yt, " ✅ Valid JSON ")) : (A(), C("span", gt, " ❌ Invalid JSON "))
1998
2044
  ])
1999
- ])) : N("", !0),
2000
- P("div", ut, [
2001
- v.value ? h.value ? (w(), A("div", ht, [
2002
- l[1] || (l[1] = P("h4", null, "Filter Error:", -1)),
2003
- P("pre", null, $(h.value), 1)
2004
- ])) : (w(), A("div", ft, [
2005
- ue(qe, {
2006
- value: k.value,
2045
+ ])) : I("", !0),
2046
+ B("div", bt, [
2047
+ _.value ? d.value ? (A(), C("div", Et, [
2048
+ l[1] || (l[1] = B("h4", null, "Filter Error:", -1)),
2049
+ B("pre", null, F(d.value), 1)
2050
+ ])) : (A(), C("div", vt, [
2051
+ ge(rt, {
2052
+ value: x.value,
2007
2053
  "key-name": "",
2008
2054
  level: 0,
2009
2055
  expanded: f.value,
2010
2056
  "is-last": !0,
2011
- theme: g.value,
2012
- "onUpdate:value": Q,
2013
- onToggleExpand: J,
2014
- onCopy: F,
2015
- "onUpdate:key": z
2057
+ theme: b.value,
2058
+ "onUpdate:value": W,
2059
+ onToggleExpand: te,
2060
+ onCopy: ne,
2061
+ "onUpdate:key": Y
2016
2062
  }, null, 8, ["value", "expanded", "theme"])
2017
- ])) : (w(), A("div", dt, [
2018
- l[0] || (l[0] = P("h4", null, "JSON Parse Error:", -1)),
2019
- P("pre", null, $(c.value), 1)
2063
+ ])) : (A(), C("div", mt, [
2064
+ l[0] || (l[0] = B("h4", null, "JSON Parse Error:", -1)),
2065
+ B("pre", null, F(c.value), 1)
2020
2066
  ]))
2021
2067
  ])
2022
2068
  ], 2));
2023
2069
  }
2024
- }), yt = /* @__PURE__ */ he(pt, [["__scopeId", "data-v-c6bbb1e1"]]), bt = [yt], gt = (r) => {
2025
- bt.forEach((e) => {
2070
+ }), xt = /* @__PURE__ */ me(_t, [["__scopeId", "data-v-632b8436"]]), kt = [xt], Ot = (r) => {
2071
+ kt.forEach((e) => {
2026
2072
  const t = e.name || e.__name || "UnknownComponent";
2027
2073
  r.component(t, e);
2028
2074
  });
2029
- }, vt = {
2030
- install: gt
2075
+ }, St = {
2076
+ install: Ot
2031
2077
  };
2032
2078
  export {
2033
- yt as JsonFormat,
2034
- vt as default
2079
+ xt as JsonFormat,
2080
+ St as default
2035
2081
  };